diff --git a/_posts/plotly_js/fundamentals/config-options/2020-01-24-remove-modebarButtons.html b/_posts/plotly_js/fundamentals/config-options/2020-01-24-remove-modebarButtons.html index 45491bac1..2a241da19 100644 --- a/_posts/plotly_js/fundamentals/config-options/2020-01-24-remove-modebarButtons.html +++ b/_posts/plotly_js/fundamentals/config-options/2020-01-24-remove-modebarButtons.html @@ -15,7 +15,7 @@
  • -'Map', `zoomInMap`, `zoomOutMap`, `resetViewMap`
  • -'Sankey', `resetSankeyGroup`
  • -'Shape drawing', `drawline`, `drawopenpath`, `drawclosedpath`, `drawcircle`, `drawrect`, `eraseshape`
  • -
  • -'Other', `hoverClosestPie`, `toggleHover`, `resetViews`, `toImage`, `sendChartToCloud`, `toggleSpikelines`
  • +
  • -'Other', `hoverClosestPie`, `toggleHover`, `resetViews`, `toImage`, `downloadJson`, `sendChartToCloud`, `toggleSpikelines`
  • --- var data = [{ diff --git a/_posts/plotly_js/fundamentals/config-options/2026-09-19-config-opt-downloadJson.html b/_posts/plotly_js/fundamentals/config-options/2026-09-19-config-opt-downloadJson.html new file mode 100644 index 000000000..4ba5687d6 --- /dev/null +++ b/_posts/plotly_js/fundamentals/config-options/2026-09-19-config-opt-downloadJson.html @@ -0,0 +1,27 @@ +--- +name: Download Plot as JSON +language: plotly_js +suite: configuration +order: 3.2 +sitemap: false +arrangement: horizontal +markdown_content: | + The `downloadJson` modebar button downloads the current figure as JSON using Plotly's `full-json` export. It is opt-in: add it with `modeBarButtonsToAdd: ['downloadJson']` (or via `layout.modebar.add`). +--- +var data = [{ + x: [1, 2, 3, 4], + y: [10, 15, 13, 17], + type: 'scatter' +}]; + +var layout = { + title: { + text: 'Download Plot as JSON' + } +}; + +var config = { + modeBarButtonsToAdd: ['downloadJson'] +}; + +Plotly.newPlot('myDiv', data, layout, config);