Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sunburst plots: 'plotly_click' event_data only available for root and leafs #1648

Closed
ismirsehregal opened this issue Nov 5, 2019 · 9 comments

Comments

@ismirsehregal
Copy link

ismirsehregal commented Nov 5, 2019

Currently it seems that for sunburst plots the 'plotly_click' event_data is only available after clicking the root and leafs of the plot.

I'm wondering whether this behaviour is intentional and inherited by plotly.js or not.

Please see the following example and a workaround I came up with using onclick, which I first posted here:

library(plotly)
library(shinyjs)

DF <- structure(list(labels = c("total", "A", "C", "B", "F", "E", "F", 
                                "E", "D", "E", "D", "D", "F", "G", "H", "H", "G", "H", "G", "H", 
                                "H", "G", "I", "G", "I", "H", "G", "I", "I", "G", "G", "I", "H", 
                                "H", "I", "I", "I", "H", "I", "G"),
                     values = c(100L, 36L, 29L,
                                35L, 12L, 14L, 10L, 14L, 8L, 18L, 5L, 10L, 9L, 6L, 5L, 4L, 3L,
                                7L, 4L, 2L, 6L, 3L, 8L, 3L, 2L, 4L, 4L, 4L, 4L, 4L, 3L, 2L, 5L, 
                                5L, 2L, 2L, 1L, 1L, 1L, 5L),
                     parents = c(NA, "total", "total", "total", "total - A", "total - C", "total - C", "total - A",
                                 "total - B", "total - B", "total - C", "total - A", "total - B",
                                 "total - A - F", "total - C - E", "total - C - F", "total - A - E",
                                 "total - A - E", "total - B - D", "total - B - D", "total - B - E",
                                 "total - C - D", "total - B - E", "total - A - D", "total - B - D",
                                 "total - B - F", "total - C - F", "total - A - E", "total - C - E",
                                 "total - B - E", "total - B - F", "total - A - D", "total - A - D",
                                 "total - A - F", "total - B - F", "total - C - F", "total - C - D",
                                 "total - C - D", "total - A - F", "total - C - E"),
                     ids = c(
                       "total", "total - A", "total - C", "total - B", "total - A - F", "total - C - E", 
                       "total - C - F", "total - A - E", "total - B - D", "total - B - E", "total - C - D",
                       "total - A - D", "total - B - F", "total - A - F - G", "total - C - E - H",
                       "total - C - F - H", "total - A - E - G", "total - A - E - H", "total - B - D - G",
                       "total - B - D - H", "total - B - E - H", "total - C - D - G", "total - B - E - I",
                       "total - A - D - G", "total - B - D - I", "total - B - F - H", "total - C - F - G",
                       "total - A - E - I", "total - C - E - I", "total - B - E - G", "total - B - F - G",
                       "total - A - D - I", "total - A - D - H", "total - A - F - H", "total - B - F - I",
                       "total - C - F - I", "total - C - D - I", "total - C - D - H", "total - A - F - I",
                       "total - C - E - G"
                     )), row.names = c(NA,-40L), class = "data.frame")

ui <- fluidPage(
  useShinyjs(),
  plotlyOutput("sunburst"),
  htmlOutput("hoverDataOut"),
  htmlOutput("clickDataOut")
)

server <- function(input, output, session) {
  output$sunburst <- renderPlotly({
    plot_ly(data = DF, source = "sunSource", customdata = ~ids, ids = ~ids, labels= ~labels, parents = ~parents, values= ~values, type='sunburst', branchvalues = 'total')
  })
  
  hoverData <- reactive({
    currentEventData <- unlist(event_data(event = "plotly_hover", source = "sunSource", priority = "event"))
  })
  
  clickData <- reactiveVal()
  
  observe({
    clickData(unlist(event_data(event = "plotly_click", source = "sunSource", priority = "event")))
  })
  
  # workaround:
  # onclick(id = "sunburst", expr = {clickData(hoverData())})
  
  output$hoverDataOut <- renderText({
    paste("Hover data:", paste(names(hoverData()), unlist(hoverData()), sep = ": ", collapse = " | "))
  })
  
  output$clickDataOut <- renderText({
    paste("Click data:", paste(names(clickData()), unlist(clickData()), sep = ": ", collapse = " | "))
  })
  
}

shinyApp(ui, server)

screen

@dracodoc
Copy link

dracodoc commented Nov 6, 2019

The zoom in/out of plotly sunburst chart is a great feature not seen in other similar sunburst chart implementations, however the missing event data on the zoom make it hard to use it in Shiny app. The workaround above is great using existing information, however if plotly itself can expose the data will be even better.

By the way, for the purpose to get the center piece after chart zoom in/out, maybe it's better to comment out the line of
observe({ clickData(unlist(event_data(event = "plotly_click", source = "sunSource", priority = "event"))) }), because when clicked on last level leaf, the plotly click event fired and was put into clickData. However this kind of click doesn't zoom the chart. With this commented out, the click data only update when non-last level leaf was clicked.

User may also need to determine if the plot zoomed in or out by checking if the clicked piece is center, thus need to save last click data to compare.

@cpsievert
Copy link
Collaborator

cpsievert commented Nov 6, 2019

Thanks for reporting. This is a plotly.js bug. Follow plotly/plotly.js#4338 for progress.

@cpsievert
Copy link
Collaborator

cpsievert commented Nov 6, 2019

Oh, it's not a plotly.js bug...there is dedicated click event specifically for sunburst, plotly_sunburstclick. I just added support for that event in event_data().

@xhdong-umd
Copy link

I can understand they want to use a separate event, because when you click on end level leaf the click event is still fired when there is no zoom happening.

@dracodoc
Copy link

dracodoc commented Nov 7, 2019

@cpsievert , the reason that I want to use this kind of event data is to get the current status of pie chart, especially the current center piece.

With sunburstclick, I can know which piece is clicked, but I need the full click history to calculate which one is center piece:

  • clicking on same piece 1st time, zoom in and take it as center if this is not last leaf
  • clicking on it immediately in 2nd time, zoom out and center piece will be its parent
  • if clicked on last level leaf, nothing happen and take previous center piece
    ...

This seemed too cumbersome. Do you think there is a better approach for this?

@cpsievert
Copy link
Collaborator

cpsievert commented Nov 7, 2019

I can know which piece is clicked, but I need the full click history to calculate which one is center piece:

You'll have to store and manage this information using shiny::reactiveVal() or shiny::reactiveValues(). See this for example https://plotly-r.com/linking-views-with-shiny.html#reactive-vals

@dracodoc
Copy link

dracodoc commented Nov 7, 2019

Yes I knew I can store the information. Just I was wondering if there is a better way, or if the information is actually available somewhere in the library, instead of calculating it and hope it don't loose track, once it loose track then everything will mess up...

@ismirsehregal
Copy link
Author

ismirsehregal commented Nov 7, 2019

Just use plotly_sunburstclick and filter/skip the leaf-clicks?

@dracodoc
Copy link

dracodoc commented Nov 7, 2019

I think that's not enough, clicking on piece A first time will make it to be center, clicking it twice will make its parent to be center. Thus we need to track history to know the status.

chschan pushed a commit to Displayr/plotly that referenced this issue Mar 12, 2020
* New version of scales no longer 'spans the gamut' of a qualitative color palette

* reduce Reduce() for merging lists

use do.call() instead to avoid quadratic complexity of growing lists

* ensure_one(): reduce noise if attrs are NULL

ignore NULL values

* ggplotly: fix Xaxis anchor if the last row incomplete

attach X axis to the last non-empty row in a column

* stylistic changes

* validate new visual baselines

* Doesn't seem like we need to handle yaxis being a factor

and if we do, it likely needs a different fix

* update shinytest baselines

* ugh maintaining shinytest tests for htmlwidgets is a real pain

* update sf baselines

* go back to using ggplotly() to prepare the widget for shiny rendering

* the extra call to plotly_build() forces more computation then necessary and fixes plotly#1569

* Generation of non-intercept data in hline/vline should respect coord_flip(), closes plotly#1519

* update news; fix typo

* Account for new changes in ggplot2's internal API, fixes plotly#1561

* Break values of positional scales have moved from  to
* Text labels of positional scales have moved from  to
* sf graticule degree labels are now quoted?

* include braces

* gsub

* moar braces

* new sf baselines

* update news

* upgrade to plotly.js v1.49.0

* upgrade to plotly.js v1.49.2

* upgrade to plotly.js v1.49.4

* update baseline

* update shinytest baseline

* make a deep copy of x.layout.width/x.layout.height for use in the resize method, closes plotly#1553

* Wrap user-supplied expression in evalq(), closes plotly#1528

* Use shiny::installExprFunction to register debug hooks

* Asynchronously register plot events

* Revert "Merge pull request plotly#1539 from ropensci/renderWidgetPrep"

This reverts commit d416cea, reversing
changes made to d11bb5a.

* no need to be making deep copies

* Improvements to algorithm for attaching key attribute for shiny's event data, fixes plotly#1610

* Account for pointNumbers
* Do nothing if we don't recognize the case

* When pointNumber is a constant, relay it as such

* handle the 3 cases separately

* use idx instead of i

* update news

* Call setInputValue only if it's defined, closes plotly#1624

* Revert "Revert "Merge pull request plotly#1539 from ropensci/renderWidgetPrep""

This reverts commit 2856731.

* pass along a quoted expr that calls func()

* Revert "go back to using ggplotly() to prepare the widget for shiny rendering"

This reverts commit a0fa68f.

* update news

* verify_webgl() shouldn't warn about types that are already gl, closes plotly#1569

* fix test

* Do not create structure with NULL to remove warnings

* Fix management of environments in renderPlotly(), fixes plotly#1639

Both assignment and evaluation of func() should happen in the local environment

* Add test to prove plotly#1299 fix

* proposed change to avoid peeking at 'grid' unit internals

* improve previous commit

* refactor Paul's unit type commits from plotly#1646

* Some CRAN builds don't have pandoc

* plot_mapbox() shouldn't force a scattermapbox trace type, closes plotly#1608

* fix R CMD check notes

* r-devel apparently doesn't yet have grid::unitType()

* remove outdated travis config

* Validate changes visual baselines due to changes in R3.6's new RNG method

* Add support for new plotly_sunburstclick event, closes plotly#1648

* validate new shinytest baselines

* update news

* fix silly mistake from 3cbccfc

* document

* test expectation should account for changes in the default color palette on r-devel

* improve the aforementioned test example and add a visual test

* Ignore calculated aesthetics that match specified aesthestics

After tidyverse/ggplot2@10fa0014, it's possible for calculated aes to exist for all default_aes

* fix broken link raster2uri and improve the description

* cran hyperlinks must be https

* fix roxygen warning

* In contrast to attr(x, unit), the new grid::unitType() function always return a vector the same length as it's input

* bump to release version; submit to CRAN

* Respect sf's plot12 graticule attribute when building axis ticks, fixes plotly#1673

* Remove missing values in ticktext/tickvals

As discussed in tidyverse/ggplot2#3566 (comment), it's now possible for the ggplot2 labels/positions to contains missing values, and we should be able to simply ignore them

* link to comment

* remove outdated/bad test expectation...the visual baseline covers it

* Don't assume sf geometry is always accessible via [['geometry']], fixes plotly#1659

* validate baselines

* update news

* update to plotly.js 1.52.2

* new baselines

* Add image and treemap visual tests. Also, ensure treemap's stroke reflects the paper's bgcolor

* Add Object.setPrototypeOf polyfill for shinytest and update shinytest json baseline

* Add add_image() for easier rendering of image traces via raster objects

* Bump version, update news, document, add unit test for add_image()

* roxygen escapes % now

* Only call locale_dependency() for locales not included with standard bundle, closes plotly#1686

* CRAN submission

* plot_mapbox() should default to scattermapbox unless z is present, fixes plotly#1707

* add visual test for plotly#1674

* update poor test expectations that assume stringsAsFactors defaults to TRUE

* bump version; update news

* update visual tests

* remove rnaturalearth dependency in tests

Co-authored-by: Carson Sievert <cpsievert1@gmail.com>
Co-authored-by: Alexey Stukalov <astukalov@gmail.com>
Co-authored-by: Wim <wfjvdham@gmail.com>
Co-authored-by: Paul Murrell <paul@stat.auckland.ac.nz>
chschan pushed a commit to Displayr/plotly that referenced this issue Jun 26, 2022
* New version of scales no longer 'spans the gamut' of a qualitative color palette

* reduce Reduce() for merging lists

use do.call() instead to avoid quadratic complexity of growing lists

* ensure_one(): reduce noise if attrs are NULL

ignore NULL values

* ggplotly: fix Xaxis anchor if the last row incomplete

attach X axis to the last non-empty row in a column

* stylistic changes

* validate new visual baselines

* Doesn't seem like we need to handle yaxis being a factor

and if we do, it likely needs a different fix

* update shinytest baselines

* ugh maintaining shinytest tests for htmlwidgets is a real pain

* update sf baselines

* go back to using ggplotly() to prepare the widget for shiny rendering

* the extra call to plotly_build() forces more computation then necessary and fixes plotly#1569

* Generation of non-intercept data in hline/vline should respect coord_flip(), closes plotly#1519

* update news; fix typo

* Account for new changes in ggplot2's internal API, fixes plotly#1561

* Break values of positional scales have moved from  to
* Text labels of positional scales have moved from  to
* sf graticule degree labels are now quoted?

* include braces

* gsub

* moar braces

* new sf baselines

* update news

* upgrade to plotly.js v1.49.0

* upgrade to plotly.js v1.49.2

* upgrade to plotly.js v1.49.4

* update baseline

* update shinytest baseline

* make a deep copy of x.layout.width/x.layout.height for use in the resize method, closes plotly#1553

* Wrap user-supplied expression in evalq(), closes plotly#1528

* Use shiny::installExprFunction to register debug hooks

* Asynchronously register plot events

* Revert "Merge pull request plotly#1539 from ropensci/renderWidgetPrep"

This reverts commit d416cea, reversing
changes made to d11bb5a.

* no need to be making deep copies

* Improvements to algorithm for attaching key attribute for shiny's event data, fixes plotly#1610

* Account for pointNumbers
* Do nothing if we don't recognize the case

* When pointNumber is a constant, relay it as such

* handle the 3 cases separately

* use idx instead of i

* update news

* Call setInputValue only if it's defined, closes plotly#1624

* Revert "Revert "Merge pull request plotly#1539 from ropensci/renderWidgetPrep""

This reverts commit 2856731.

* pass along a quoted expr that calls func()

* Revert "go back to using ggplotly() to prepare the widget for shiny rendering"

This reverts commit a0fa68f.

* update news

* verify_webgl() shouldn't warn about types that are already gl, closes plotly#1569

* fix test

* Do not create structure with NULL to remove warnings

* Fix management of environments in renderPlotly(), fixes plotly#1639

Both assignment and evaluation of func() should happen in the local environment

* Add test to prove plotly#1299 fix

* proposed change to avoid peeking at 'grid' unit internals

* improve previous commit

* refactor Paul's unit type commits from plotly#1646

* Some CRAN builds don't have pandoc

* plot_mapbox() shouldn't force a scattermapbox trace type, closes plotly#1608

* fix R CMD check notes

* r-devel apparently doesn't yet have grid::unitType()

* remove outdated travis config

* Validate changes visual baselines due to changes in R3.6's new RNG method

* Add support for new plotly_sunburstclick event, closes plotly#1648

* validate new shinytest baselines

* update news

* fix silly mistake from 3cbccfc

* document

* test expectation should account for changes in the default color palette on r-devel

* improve the aforementioned test example and add a visual test

* Ignore calculated aesthetics that match specified aesthestics

After tidyverse/ggplot2@10fa0014, it's possible for calculated aes to exist for all default_aes

* fix broken link raster2uri and improve the description

* cran hyperlinks must be https

* fix roxygen warning

* In contrast to attr(x, unit), the new grid::unitType() function always return a vector the same length as it's input

* bump to release version; submit to CRAN

* Respect sf's plot12 graticule attribute when building axis ticks, fixes plotly#1673

* Remove missing values in ticktext/tickvals

As discussed in tidyverse/ggplot2#3566 (comment), it's now possible for the ggplot2 labels/positions to contains missing values, and we should be able to simply ignore them

* link to comment

* remove outdated/bad test expectation...the visual baseline covers it

* Don't assume sf geometry is always accessible via [['geometry']], fixes plotly#1659

* validate baselines

* update news

* update to plotly.js 1.52.2

* new baselines

* Add image and treemap visual tests. Also, ensure treemap's stroke reflects the paper's bgcolor

* Add Object.setPrototypeOf polyfill for shinytest and update shinytest json baseline

* Add add_image() for easier rendering of image traces via raster objects

* Bump version, update news, document, add unit test for add_image()

* roxygen escapes % now

* Only call locale_dependency() for locales not included with standard bundle, closes plotly#1686

* CRAN submission

* plot_mapbox() should default to scattermapbox unless z is present, fixes plotly#1707

* add visual test for plotly#1674

* update poor test expectations that assume stringsAsFactors defaults to TRUE

* bump version; update news

* update visual tests

* remove rnaturalearth dependency in tests

Co-authored-by: Carson Sievert <cpsievert1@gmail.com>
Co-authored-by: Alexey Stukalov <astukalov@gmail.com>
Co-authored-by: Wim <wfjvdham@gmail.com>
Co-authored-by: Paul Murrell <paul@stat.auckland.ac.nz>
chschan added a commit to Displayr/plotly that referenced this issue Jul 4, 2022
* Start v4.9.4 release candidate (plotly#1959)

* Add crosstalk mapping to computed_mapping (not mapping) when present (plotly#1964)

* Follow up to plotly#1952: add crosstalk mapping to computed_mapping (not mapping) when present

* use dev version; update news

* v4.9.4.1 release candidate (plotly#1965)

* v4.9.4.1 release candidate

* Reduce some of the warning noise

* Reduce some of the warning noise

* use dev version

* Upgrade to plotly.js 2.0 (plotly#1967)

* wip upgrade to plotly.js 2.0

* patch plotly.js source to support phantomjs/shinytest

reverts part of plotly/plotly.js#5380

* bump mathjax version

* use npm instead of yarn

* make geom_bar() default to textposition='none'; approve new vdiffr 0.4 + plotly.js 2.0 baselines

* Migrate to vdiffr 1.0

* Use layout.legend.title over layout.annotations to when converting guides for discrete scales

* wip migrate to gha

* try npm install

* setup node

* use recommended node version

* try mac instead

* install phantomjs; various cleanup

* intentionally break a visual test

* fix

* use thematic's approach to testing

* bump version

* regenerate snapshots

* map secrets to env variables

* accept new gha baselines

* whoops

* hmm

* approve shinytest baseline

* intentionally break a visual test

* always upload

* revert change; new baselines

* Remove the vdiffr dependency and use testthat snaphots directly

* More obvious env var naming

* more gha details

* always upload

* new snaps

* intentionally break a visual test (again)

* Revert "intentionally break a visual test (again)"

This reverts commit a4e306c.

* Update subplots.R (plotly#1974)

To get rid of "Error is get_domains(length(plots), nrows, margin, widths = widths, heights = heights): The sum of the widths and heights arguments must be less than 1.

* Better positioning of facet axis annotations (plotly#1975)

* Add kaleido() for static image exporting (plotly#1971)

* Close plotly#1970: revert plotly.js 2.0 change in default modebar buttons

* Add save_image(), a convenience wrapper around kaleido()$transform() (plotly#1981)

* Upgrade to plotly.js v2.2.1 (plotly#1982)

* Use Plotly.react() to redraw in Shiny if layout.transition is populated (plotly#2001)

* Use Plotly.react() to redraw in Shiny if layout.transition is populated

* update news

* Update to plotly.js v2.5.1 (plotly#2002)

* update to plotly.js v2.5.1

* new visual baselines

* Closes plotly#2031. ggplot internaly convert `color` to `colour`

* Update README.md

* update baselines

* update URLs

* add_area() now uses barpolar instead of area (plotly#2041)

* Closes plotly#1872. Implemented to_basic for `geom_function`

* 4.10.0 release

* Added unit tests. And ran tests using

* Conformed with carson's review

* Reverted the deletion of _snaps

* Added test to check whether the fix works or not.

* Added test to check whether the fix works or not.

* use dev versioning

* Fix "partial argument match" warnings (plotly#1977)

* No partial-argument-match warning in ggplotly

* Update NEWS.md

* Solved the LaTeX2exp error. Closes plotly#2027 (plotly#2030)

Co-authored-by: Carson Sievert <cpsievert1@gmail.com>

* Revert "Solved the LaTeX2exp error. Closes plotly#2027 (plotly#2030)"

This reverts commit aeaecd6.

* Add ggalluvial support (plotly#2061)

Co-authored-by: Carson Sievert <cpsievert1@gmail.com>
Co-authored-by: Abdessabour Moutik <abds.papa@gmail.com>

* Fix ordering of lines in stat_ecdf() (plotly#2065)

* Handle geom_tile() with no fill aesthetic (plotly#2063)

* More careful joining of group columns (plotly#2064)

* Avoid with() to better account for missing tickvals/ticktext (plotly#2062)

* Test discrete-ness of fill after statistics have been calculated (plotly#2066)

* Announce snapshot files when visual testing isn't enabled so they won't get deleted

* Respect guide(aes = 'none') when constructing legend entries (plotly#2067)

* Add 'plotly_selecting' to acceptable 'on' events (plotly#1280)

* Use faster versions of system.file()/packageVersion()/is_installed() (plotly#2072)

* Bump plotly.js to 2.11.1 (plotly#2096)

* approve new visual baselines

* Use rlang::local_options() in test

* new shinytest baselines; avoid rlang altogether

* plotly.js fix bug when crosstalk filter keys are null (plotly#2087)

* transition `tidyr::gather_` -> `tidyr::pivot_longer` (plotly#2125)

* transition `tidyr::gather_` -> `tidyr::pivot_longer`

* add `NEWS` entry

* Replace `is.na` with `rlang::is_na` in `map_color()` (plotly#2131)

* roxygenize

* Support renderValue within iframe

* Add yaml for auto-P.R./fork updating; RS-2202

* [pull] master from ropensci:master (#2)

* New version of scales no longer 'spans the gamut' of a qualitative color palette

* reduce Reduce() for merging lists

use do.call() instead to avoid quadratic complexity of growing lists

* ensure_one(): reduce noise if attrs are NULL

ignore NULL values

* ggplotly: fix Xaxis anchor if the last row incomplete

attach X axis to the last non-empty row in a column

* stylistic changes

* validate new visual baselines

* Doesn't seem like we need to handle yaxis being a factor

and if we do, it likely needs a different fix

* update shinytest baselines

* ugh maintaining shinytest tests for htmlwidgets is a real pain

* update sf baselines

* go back to using ggplotly() to prepare the widget for shiny rendering

* the extra call to plotly_build() forces more computation then necessary and fixes plotly#1569

* Generation of non-intercept data in hline/vline should respect coord_flip(), closes plotly#1519

* update news; fix typo

* Account for new changes in ggplot2's internal API, fixes plotly#1561

* Break values of positional scales have moved from  to
* Text labels of positional scales have moved from  to
* sf graticule degree labels are now quoted?

* include braces

* gsub

* moar braces

* new sf baselines

* update news

* upgrade to plotly.js v1.49.0

* upgrade to plotly.js v1.49.2

* upgrade to plotly.js v1.49.4

* update baseline

* update shinytest baseline

* make a deep copy of x.layout.width/x.layout.height for use in the resize method, closes plotly#1553

* Wrap user-supplied expression in evalq(), closes plotly#1528

* Use shiny::installExprFunction to register debug hooks

* Asynchronously register plot events

* Revert "Merge pull request plotly#1539 from ropensci/renderWidgetPrep"

This reverts commit d416cea, reversing
changes made to d11bb5a.

* no need to be making deep copies

* Improvements to algorithm for attaching key attribute for shiny's event data, fixes plotly#1610

* Account for pointNumbers
* Do nothing if we don't recognize the case

* When pointNumber is a constant, relay it as such

* handle the 3 cases separately

* use idx instead of i

* update news

* Call setInputValue only if it's defined, closes plotly#1624

* Revert "Revert "Merge pull request plotly#1539 from ropensci/renderWidgetPrep""

This reverts commit 2856731.

* pass along a quoted expr that calls func()

* Revert "go back to using ggplotly() to prepare the widget for shiny rendering"

This reverts commit a0fa68f.

* update news

* verify_webgl() shouldn't warn about types that are already gl, closes plotly#1569

* fix test

* Do not create structure with NULL to remove warnings

* Fix management of environments in renderPlotly(), fixes plotly#1639

Both assignment and evaluation of func() should happen in the local environment

* Add test to prove plotly#1299 fix

* proposed change to avoid peeking at 'grid' unit internals

* improve previous commit

* refactor Paul's unit type commits from plotly#1646

* Some CRAN builds don't have pandoc

* plot_mapbox() shouldn't force a scattermapbox trace type, closes plotly#1608

* fix R CMD check notes

* r-devel apparently doesn't yet have grid::unitType()

* remove outdated travis config

* Validate changes visual baselines due to changes in R3.6's new RNG method

* Add support for new plotly_sunburstclick event, closes plotly#1648

* validate new shinytest baselines

* update news

* fix silly mistake from 3cbccfc

* document

* test expectation should account for changes in the default color palette on r-devel

* improve the aforementioned test example and add a visual test

* Ignore calculated aesthetics that match specified aesthestics

After tidyverse/ggplot2@10fa0014, it's possible for calculated aes to exist for all default_aes

* fix broken link raster2uri and improve the description

* cran hyperlinks must be https

* fix roxygen warning

* In contrast to attr(x, unit), the new grid::unitType() function always return a vector the same length as it's input

* bump to release version; submit to CRAN

* Respect sf's plot12 graticule attribute when building axis ticks, fixes plotly#1673

* Remove missing values in ticktext/tickvals

As discussed in tidyverse/ggplot2#3566 (comment), it's now possible for the ggplot2 labels/positions to contains missing values, and we should be able to simply ignore them

* link to comment

* remove outdated/bad test expectation...the visual baseline covers it

* Don't assume sf geometry is always accessible via [['geometry']], fixes plotly#1659

* validate baselines

* update news

* update to plotly.js 1.52.2

* new baselines

* Add image and treemap visual tests. Also, ensure treemap's stroke reflects the paper's bgcolor

* Add Object.setPrototypeOf polyfill for shinytest and update shinytest json baseline

* Add add_image() for easier rendering of image traces via raster objects

* Bump version, update news, document, add unit test for add_image()

* roxygen escapes % now

* Only call locale_dependency() for locales not included with standard bundle, closes plotly#1686

* CRAN submission

* plot_mapbox() should default to scattermapbox unless z is present, fixes plotly#1707

* add visual test for plotly#1674

* update poor test expectations that assume stringsAsFactors defaults to TRUE

* bump version; update news

* update visual tests

* remove rnaturalearth dependency in tests

Co-authored-by: Carson Sievert <cpsievert1@gmail.com>
Co-authored-by: Alexey Stukalov <astukalov@gmail.com>
Co-authored-by: Wim <wfjvdham@gmail.com>
Co-authored-by: Paul Murrell <paul@stat.auckland.ac.nz>

* Add back missing layout attribute

* Pass element instead of ID

* VIS-992: add test, use rhtmlBuildUtils (#15)

* Initial commit

* Remove prepush

* Final line for plotly.yml

* Re-add lib

* Refactor

* Create test

* Specify rhtmlBuildUtils version

* Remove preinstall script

* Delete package-lock.json

* Update documentation

* Update documentation and remove library

* Restore files

* Restore file

* Update build files

* VIS-933: add rhtmlwidget-status attribute (#16)

* Test callback

* Update compiled files

* Add rhtmlwidget-status attribute

* wording change

* VIS-1064: fix PPT exporting issue (#17)

* Candidate fix

* Bump version

* Update widgetdefinition.js and build

Co-authored-by: Carson Sievert <cpsievert1@gmail.com>
Co-authored-by: Abhilash Lakshman <46469834+abhilashlakshman@users.noreply.github.com>
Co-authored-by: Abdessabour Moutik <abds.papa@gmail.com>
Co-authored-by: Jack Parmer <jparmer09@gmail.com>
Co-authored-by: bersbersbers <12128514+bersbersbers@users.noreply.github.com>
Co-authored-by: casperhart <39182232+casperhart@users.noreply.github.com>
Co-authored-by: Simon P. Couch <simonpatrickcouch@gmail.com>
Co-authored-by: Paul Hoffman <mojaveazure@users.noreply.github.com>
Co-authored-by: Jeffrey Shen <jeffrey.shen@displayr.com>
Co-authored-by: flipDevTools <opensource@displayr.com>
Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com>
Co-authored-by: Alexey Stukalov <astukalov@gmail.com>
Co-authored-by: Wim <wfjvdham@gmail.com>
Co-authored-by: Paul Murrell <paul@stat.auckland.ac.nz>
Co-authored-by: Justin Yap <JustinCCYap@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants