plotly_book | plotly for R book - | Data Visualization library
kandi X-RAY | plotly_book Summary
kandi X-RAY | plotly_book Summary
plotly for R book
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of plotly_book
plotly_book Key Features
plotly_book Examples and Code Snippets
Community Discussions
Trending Discussions on plotly_book
QUESTION
I have a plotly graph (in my case made in R / rmarkdown), and would like to download the data.
- Option 1 is a download button outside the graph to a data object (e.g CSV, or a table). For example Download output file csv, or this. It works, but not that neat - using custom modebar would be neater.
Options 2 and 3 use a custom modebar button. plotly book - custom modebar button has a nice example with code to make the custom button.
Option 2, is a download button (e.g. to csv) as a plotly custom modebar button. Presumably this could be done in javascript (or html) and passed through, similar to example below in option 3? Suggestions for how to do this? There is some discussion on this option at Plotly forum, using Dash(?), but that is well over my pay grade.
Option 3 is a button that links to a table (possibly an appendix or other website with a datatable object), where that datatable has a download button. The last part, making a button for datatable that you can click is easy (see here). The javascript code for a website link should look something like this (javascript link to website). The default Plotly button in a plotly modebar does send you to a linked website when you click, but not sure how to replicate that html/javascript from R.
Am I missing something simple in this code?
Edit The icon web link below works, once opened in a browser - i.e. clicking on the icon wont open a website from the Rstudio viewer.
...ANSWER
Answered 2019-Nov-27 at 00:36Using onRender
from htmlwidgets
you can add JS event handlers. This one will print the clicked data series to a window.
https://plotly-r.com/js-event-handlers.html
Here is an example in an Rmd
file. Open this in RStudio and click [Knit to HTML] then [Open in Browser]. When you click one of the data series, a new windows will open containing the data in csv format.
QUESTION
I'm new to using the plotly package in R and want to animate a line graph. An example would be if I were plotting the GDPpercapita(x-axis) and Life Expectancy (y-axis) of one country. plotly book for R
...ANSWER
Answered 2017-May-06 at 12:07Here is an animated line graph - interpolating between sine curves of ever increasing periodicity (a dubious thing to do perhaps, but it does look cool).
Here is the code:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install plotly_book
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page