-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Description
Description
Some configuration changes aren't reflected during calls to Plotly.react
. This includes mode bar button title changes, icons, etc. Toggling display of the logo (among other config options) seems to force a full update that reflects all the config changes. This is discussed a bit here in #6394.
Steps to reproduce
- Be on master
- Launch Plotly DevTools
- Open mock line_scatter (other mocks could work, but I know this one does)
- Run the following snippet to update the mode bar buttons:
let toggle = true Plotly.react( gd, gd.data, gd.layout, { displaylogo: false, modeBarButtonsToAdd: [ { name: 'custombutton', title: toggle ? 'Take PICTURE' : 'Record MOVIE', icon: toggle ? Plotly.Icons.camera : Plotly.Icons.movie, click: () => {} }, ], modeBarButtonsToRemove: [ "autoscale", "pan2d", "lasso2d", "resetScale2d", "select2d", "toImage", "zoom", "zoomIn2d", "zoomOut2d" ] } )
- Run this other snippet to update the label of the custom button:
toggle = false Plotly.react( gd, gd.data, gd.layout, { displaylogo: false, modeBarButtonsToAdd: [ { name: 'custombutton', title: toggle ? 'Take PICTURE' : 'Record MOVIE', icon: toggle ? Plotly.Icons.camera : Plotly.Icons.movie, click: () => {} }, ], modeBarButtonsToRemove: [ "autoscale", "pan2d", "lasso2d", "resetScale2d", "select2d", "toImage", "zoom", "zoomIn2d", "zoomOut2d" ] } )
- Note that the button title and icon have not updated
Notes
- This issue was split off from enable updating the config of a plot without changing other parameters #6394 as mentioned here
- It appears that this issue was also written up downstream in Config not reactive in some cases cshaa/svelte-plotly.js#10
Metadata
Metadata
Assignees
Labels
No labels