When bookmarking, add option to NOT retain all the verbose plotly parameters
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- R
- Sterne
- 2.7k
- Forks
- 641
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
When I have a plotly plot in a bookmarkable shiny app, the bookmarking URL becomes very long and messy with lots of plotly-related data that doesn't seem too useful. It would be nice if there was an easy way to turn that off, or perhaps even just not include all this information by default.
Example app:
library(shiny)
library(plotly)
ui <- function(req) {
fluidPage(
bookmarkButton(),
plotlyOutput("plot")
)
}
server <- function(input, output, session) {
output$plot <- renderPlotly({
plot_ly(economics, x = ~pop)
})
}
shinyApp(ui, server, enableBookmarking = "url", options = list(port = 3900))
When I just open this app and click on the bookmark button, I get this URL:
http://127.0.0.1:3900/?_inputs_&.clientValue-default-plotlyCrosstalkOpts=%7B%22on%22%3A%22plotly_click%22%2C%22persistent%22%3Afalse%2C%22dynamic%22%3Afalse%2C%22selectize%22%3Afalse%2C%22opacityDim%22%3A0.2%2C%22selected%22%3A%7B%22opacity%22%3A1%7D%2C%22debounce%22%3A0%2C%22color%22%3A%5B%5D%7D&.clientValue-plotly_relayout-A=%22%7B%5C%22width%5C%22%3A1570%2C%5C%22height%5C%22%3A400%7D%22
looks unnecessarily long. If I interact with this basic plot a little bit, I get an even longer URL such as
http://127.0.0.1:3900/?_inputs_&.clientValue-default-plotlyCrosstalkOpts=%7B%22on%22%3A%22plotly_click%22%2C%22persistent%22%3Afalse%2C%22dynamic%22%3Afalse%2C%22selectize%22%3Afalse%2C%22opacityDim%22%3A0.2%2C%22selected%22%3A%7B%22opacity%22%3A1%7D%2C%22debounce%22%3A0%2C%22color%22%3A%5B%5D%2C%22persistentShift%22%3Afalse%7D&.clientValue-plotly_hover-A=null&.clientValue-plotly_relayout-A=%22%7B%5C%22dragmode%5C%22%3A%5C%22lasso%5C%22%7D%22&.clientValue-plotly_selected-A=%22%5B%7B%5C%22curveNumber%5C%22%3A0%2C%5C%22x%5C%22%3A294999.5%2C%5C%22y%5C%22%3A43%7D%2C%7B%5C%22curveNumber%5C%22%3A0%2C%5C%22x%5C%22%3A304999.5%2C%5C%22y%5C%22%3A46%7D%5D%22
But even though it's so long, pasting this back into the URL bar goes back to the default plotly view and it did not retain the interactions I did. So it doesn't seem too useful to have the bookmark URL dirtied for this.
I'm not sure if this is a plotly issue, a crosstalk issue, an htmlwidgets issue, or maybe even a shiny issue. If this is the wrong place to post, let me know where it should go instead.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginnen Sie damit, die Beispiel-Shiny-App mit URL-Lesezeichenfunktion nachzubilden, und vergleichen Sie die generierte URL vor und nach Plotly-Interaktionen. Untersuchen Sie, wie die Lesezeichen-URL die im Bericht beschriebenen plotly-bezogenen Parameter erfasst; die Aufgabe ist abgeschlossen, wenn es eine praktikable Möglichkeit gibt, sie standardmäßig oder über eine Option wegzulassen, ohne nützliches Lesezeichenverhalten zu beeinträchtigen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- r
- Bereich
- data-visualization, frontend
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100