Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<li> -'Map', `zoomInMap`, `zoomOutMap`, `resetViewMap` </li>
<li> -'Sankey', `resetSankeyGroup` </li>
<li> -'Shape drawing', `drawline`, `drawopenpath`, `drawclosedpath`, `drawcircle`, `drawrect`, `eraseshape` </li>
<li> -'Other', `hoverClosestPie`, `toggleHover`, `resetViews`, `toImage`, `sendChartToCloud`, `toggleSpikelines` </li>
<li> -'Other', `hoverClosestPie`, `toggleHover`, `resetViews`, `toImage`, `downloadJson`, `sendChartToCloud`, `toggleSpikelines` </li>
</ul>
---
var data = [{
Expand Down
Original file line number Diff line number Diff line change
@@ -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);