When bookmarking, add option to NOT retain all the verbose plotly parameters
Nessuno ha ancora preso questa issue.
- Lingua principale
- R
- Stelle
- 2.7k
- Fork
- 641
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Iniziare riproducendo l’app Shiny di esempio con il bookmarking dell’URL e confrontare l’URL generato prima e dopo le interazioni con Plotly. Analizzare il modo in cui l’URL aggiunto ai segnalibri acquisisce i parametri relativi a plotly descritti nel report; il lavoro è completato quando esiste un modo pratico per ometterli per impostazione predefinita o tramite un’opzione senza compromettere il comportamento utile del bookmarking.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- r
- Ambito
- data-visualization, frontend
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100