From 96ca445ee049ba8252a4afbdbb409c85afb2f27d Mon Sep 17 00:00:00 2001 From: Ryan Patrick Kyle Date: Tue, 17 Dec 2019 20:37:06 -0500 Subject: [PATCH 01/23] :pencil2: update R yaml :package: metadata --- dash-info.yaml | 2473 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 2471 insertions(+), 2 deletions(-) diff --git a/dash-info.yaml b/dash-info.yaml index 493cc5f0..2edeb391 100644 --- a/dash-info.yaml +++ b/dash-info.yaml @@ -1,4 +1,4 @@ -pkg_help_description: > +pkg_help_description: >- Dash is a web application framework that provides pure Python and R abstraction around HTML, CSS, and JavaScript. Instead of writing HTML or using an HTML @@ -6,5 +6,2474 @@ pkg_help_description: > functions within the dashHtmlComponents package. The source for this package is on GitHub: plotly/dash-html-components. -pkg_help_title: > +pkg_help_title: >- Vanilla HTML Components for Dash +r_examples: + - name: htmlA + dontrun: TRUE + code: | + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout( + htmlDiv(list( + htmlA(children="Link to external site", + href="https://plot.ly", + target="_blank") + ) + ) + ) + + app$run_server() + - name: htmlAbbr + dontrun: TRUE + code: | + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout( + htmlDiv(list( + htmlAbbr(children="\U{1F50D} Hover over this line for a few seconds and see the text box appear...", + title="Hello! htmlAbbr at work!") + ) + ) + ) + + app$run_server() + - name: htmlAcronym + dontrun: TRUE + code: | + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout( + htmlDiv(list( + htmlAcronym(children="Mouse over these words to see the acronym for \"as soon as possible\".", + title="ASAP") + ) + ) + ) + + app$run_server() + - name: htmlAddress + dontrun: TRUE + code: | + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout( + htmlDiv(list( + htmlAddress(children="5555 Avenue de Gasp\U{00E9}, Montr\U{00E9}al QC H2T 2A3") + ) + ) + ) + + app$run_server() + - name: htmlArea + dontrun: TRUE + code: | + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout( + htmlDiv(list( + htmlImg(src = "https://upload.wikimedia.org/wikipedia/commons/0/0c/PIA17351-ApparentSizes-MarsDeimosPhobos-EarthMoon.jpg", + useMap = "#image-map"), + htmlMapEl(list( + htmlArea(target="_blank", + alt="Deimos", + title="Deimos", + href="https://en.wikipedia.org/wiki/Deimos_(moon)", + coords="5,114,32,147", + shape="rect"), + htmlArea(target="_blank", + alt="Phobos", + title="Phobos", + href="https://en.wikipedia.org/wiki/Phobos_(moon)", + coords="113,196,32,103", + shape="rect"), + htmlArea(target="_blank", + alt="Moon", + title="Moon", + href="https://en.wikipedia.org/wiki/Moon", + coords="127,285,294,1", + shape="rect") + ), + name = "image-map" + ), + htmlDiv(children = "Click on the image to visit a Wikipedia article", + id = "object-name") + ) + ) + ) + + app$run_server() + - name: htmlArticle + dontrun: TRUE + code: | + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout( + htmlDiv(list( + htmlArticle(list( + htmlH2("Dash for R launched!"), + htmlP("Dash is a user interface library for creating analytical web applications.\n + Those who use R for data analysis, data exploration, visualization,\n + modelling, instrument control, and reporting will find immediate use for Dash for R."), + htmlAside("Plotly is a technical computing company with offices in Montr\U{00E9}al, Canada and Cambridge, Massachusetts.") + ) + ) + ) + ) + ) + + app$run_server() + - name: htmlAside + dontrun: TRUE + code: | + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout( + htmlDiv(list( + htmlArticle(list( + htmlH2("Dash for R launched!"), + htmlP("Dash is a user interface library for creating analytical web applications.\n + Those who use R for data analysis, data exploration, visualization,\n + modelling, instrument control, and reporting will find immediate use for Dash for R."), + htmlAside("Plotly is a technical computing company with offices in Montr\U{00E9}al, Canada and Cambridge, Massachusetts.") + ) + ) + ) + ) + ) + + app$run_server() + - name: htmlAudio + dontrun: TRUE + code: | + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout( + htmlDiv(list( + htmlAudio(src="https://www.nasa.gov/62284main_onesmall2.wav", + controls=TRUE, + title="Apollo 11 - July 16, 1969 - Neil Armstrong") + ) + ) + ) + + app$run_server() + - name: htmlB + dontrun: TRUE + code: | + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout( + htmlDiv(list( + htmlB(children="This is a bold statement!"), + htmlP(children="This is not so bold.") + ) + ) + ) + + app$run_server() + - name: htmlBase + dontrun: TRUE + code: + - name: htmlBasefont + dontrun: TRUE + code: | + # This feature is obsolete. It may still work in some + # browsers, but could stop working at any time. Try to + # avoid using this component. + # + # Instead, use CSS properties to set font, font-family, + # font-size and color. + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout( + htmlDiv(list( + htmlBasefont(color="FF0000", + face="Helvetica", + size="+2"), + htmlP(children="If it works, this will be Helvetica but a couple point sizes larger.") + ) + ) + ) + + app$run_server() + - name: htmlBdi + dontrun: TRUE + code: | + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout( + htmlDiv(list( + htmlP(children="The line below should render as 'Aladdin', but in Arabic script:"), + htmlBdi(children="\U{0639}\U{0644}\U{0627}\U{0621} \U{0627}\U{0644}\U{062F}\U{064A}\U{0646}") + ) + ) + ) + + app$run_server() + - name: htmlBdo + dontrun: TRUE + code: | + # This element supports bidirectional text override. + # We can force text to render from right to left instead + # of left to right. + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout( + htmlDiv(list( + htmlP(children="This text will print from left to right."), + htmlP(children="Below, we use bidirectional override to print right to left:"), + htmlBdo(children="This text will print from right to left.", + dir="rtl") + ) + ) + ) + + app$run_server() + - name: htmlBig + dontrun: TRUE + code: | + # The tag is not supported in HTML5. + # Instead, use the font-size property in + # CSS to enlarge text. + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout( + htmlDiv(list( + htmlP(children="This text will display in standard size."), + htmlBig(children="This text may or may not appear slightly larger.") + ) + ) + ) + + app$run_server() + - name: htmlBlink + dontrun: TRUE + code: | + # The blink tag is now obsolete and deprecated. + # It may not function properly in all browsers, + # and it may cease working without warning. + # + # This element is generally unsupported on all + # modern browser releases. + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout( + htmlDiv(list( + htmlP(children="Here is a bit of text."), + htmlBlink(children="Here is a bit of blinking text.") + ) + ) + ) + + app$run_server() + - name: htmlBlockquote + dontrun: TRUE + code: | + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout( + htmlDiv(list( + htmlP("Here is some text."), + htmlBlockquote(children=list( + htmlP("And here is a quotation in block format.") + ) + ) + ) + ) + ) + + app$run_server() + - name: htmlBr + dontrun: TRUE + code: | + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout( + htmlDiv(list( + htmlP("Here is some text."), + htmlBr(), + htmlP("Here is additional text."), + htmlBr(), + htmlP("See the gap in between the lines?") + ) + ) + ) + + app$run_server() + - name: htmlButton + dontrun: TRUE + code: | + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout( + htmlDiv(list( + htmlButton("Click me!") + ) + ) + ) + + app$run_server() + - name: htmlCanvas + dontrun: TRUE + code: | + # this component requires JavaScript code + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout( + htmlDiv(list( + htmlCanvas(id="canvas-component") + ) + ) + ) + + app$run_server() + - name: htmlCaption + dontrun: TRUE + code: | + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout( + htmlDiv(list( + htmlCaption("This is an example of htmlCaption.") + ) + ) + ) + + app$run_server() + - name: htmlCenter + dontrun: TRUE + code: | + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout( + htmlDiv(list( + htmlCenter("Centered text!") + ) + ) + ) + + app$run_server() + - name: htmlCite + dontrun: TRUE + code: | + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout( + htmlDiv(list( + htmlCite("Click me!") + ) + ) + ) + + app$run_server() + - name: htmlCode + dontrun: TRUE + code: | + - name: htmlCol + dontrun: TRUE + code: | + - name: htmlColgroup + dontrun: TRUE + code: | + - name: htmlCommand + dontrun: TRUE + code: | + - name: htmlContent + dontrun: TRUE + code: | + - name: htmlData + dontrun: TRUE + code: | + - name: htmlDatalist + dontrun: TRUE + code: | + - name: htmlDd + dontrun: TRUE + code: | + - name: htmlDel + dontrun: TRUE + code: | + - name: htmlDetails + dontrun: TRUE + code: | + - name: htmlDfn + dontrun: TRUE + code: | + - name: htmlDialog + dontrun: TRUE + code: | + + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout(htmlDiv(list( + htmlDialog( + children = htmlP('Greetings') + ) + ) + ) + ) + + app$run_server() + - name: htmlDiv + dontrun: TRUE + code: | + app <- Dash$new() + + app$layout( + htmlDiv(list( + htmlDiv('This Title is Wrapped inside an inner Div') + ) + ) + ) + + app$run_server() + - name: htmlDl + dontrun: TRUE + code: | + + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout(htmlDiv(list( + htmlDl( + children= list('Dash', + htmlDd('Dash is a framework for building web + applications.')) + ) + ) + ) + ) + + app$run_server() + - name: htmlDt + dontrun: TRUE + code: | + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout(htmlDiv(list( + htmlDl( + children= list(htmlDt("Dash for R"), + htmlDd('HtmlDt and htmlDD must be used + within htmlDl')) + ) + ) + ) + ) + + app$run_server() + - name: htmlElement + dontrun: TRUE + code: | + + # This feature is obsolete. It may still work in some + # browsers, but could stop working at any time. Try to + # avoid using this component. + - name: htmlEm + dontrun: TRUE + code: | + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout(htmlDiv(list( + htmlH1(list('Dash is a very ', + htmlEm(' important '), + 'framework') + ) + ) + ) + ) + + app$run_server() + - name: htmlEmbed + dontrun: TRUE + code: | + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout(htmlDiv(list( + htmlEmbed( + src = 'https://www.youtube.com/watch?v=njW7DmeK1Qk', + width = '250', + height = '500') + ) + ) + ) + + app$run_server() + - name: htmlFieldset + dontrun: TRUE + code: | + + library(dash) + library(dashHtmlComponents) + library(dashCoreComponents) + + app <- Dash$new() + + app$layout(htmlDiv(list( + htmlFieldset( + children = list('Choose your favorite Dash HTML component', + dccRadioItems( + options=list( + list("label" = "htmlDiv", "value" = "htmlDiv"), + list("label" = "htmlBase", "value" = "htmlBase"), + list("label" = "htmlArticle", "value" = "htmlArticle") + ) + ) + ) + ) + ) + ) + ) + + app$run_server() + - name: htmlFigcaption + dontrun: TRUE + code: | + + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout(htmlDiv(list( + htmlFigure(children = list( + htmlImg(src = 'https://brand.plot.ly/static/images/plotly-logo-01-stripe@2x.png'), + htmlFigcaption(children = 'Plotly Logo'))) + ) + ) + ) + + app$run_server() + - name: htmlFigure + dontrun: TRUE + code: | + library(dash) + library(dashHtmlComponents) + + app <- Dash$new() + + app$layout(htmlDiv(list( + htmlFigure(children = list( + htmlImg(src = 'https://brand.plot.ly/static/images/plotly-logo-01-stripe@2x.png', + width = '400', + height = '150') + ) + ) + ) + ) + ) + + app$run_server() + - name: htmlFont + dontrun: TRUE + code: | + + # Starting with HTML 4, HTML does not convey styling information + # anymore (outside the