Skip to content

Commit e79c134

Browse files
author
Joseph Damiba
authored
Merge pull request #1664 from plotly/plot-to-new-plot
updating plot to newPlot() in JS docs
2 parents ddff2e1 + bdeb41f commit e79c134

File tree

151 files changed

+158
-158
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+158
-158
lines changed

_posts/plotly_js/2015-04-05-plotly_js-index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ <h1>Plotly JavaScript Open Source Graphing Library</h1>
5858
x: 0, y: 0, xref: 'paper', yref: 'paper'
5959
}]
6060
}
61-
Plotly.plot(document.getElementById('contour-plot'), [trace], layout, {showLink: false});
61+
Plotly.newPlot(document.getElementById('contour-plot'), [trace], layout, {showLink: false});
6262
});</code></pre>
6363

6464

@@ -104,7 +104,7 @@ <h1>Plotly JavaScript Open Source Graphing Library</h1>
104104
}
105105
};
106106

107-
Plotly.plot(document.getElementById('wind-speed'), [trace], layout, {showLink: false});
107+
Plotly.newPlot(document.getElementById('wind-speed'), [trace], layout, {showLink: false});
108108
});</code></pre>
109109

110110

_posts/plotly_js/2015-07-21-plotlyjs-getting-started.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,18 @@ <h2 >Start plotting!</h2>
6464
<pre><code class="hljs html">&lt;div id="tester" style="width:600px;height:250px;"&gt;&lt;/div&gt;</code></pre>
6565

6666
<p>
67-
Now you can make interactive plotly.js charts using <code class="no-padding">Plotly.plot()</code>.
67+
Now you can make interactive plotly.js charts using <code class="no-padding">Plotly.newPlot()</code>.
6868
</p>
6969
<pre><code class="hljs javascript">&lt;script&gt;
7070
TESTER = document.getElementById('tester');
71-
Plotly.plot( TESTER, [{
71+
Plotly.newPlot( TESTER, [{
7272
x: [1, 2, 3, 4, 5],
7373
y: [1, 2, 4, 8, 16] }], {
7474
margin: { t: 0 } } );
7575
&lt;/script&gt;</code></pre>
7676

7777
<p>
78-
Now you can pass Plotly.plot() either the ID of the DIV ("tester") or the DIV DOM element (<code class="no-padding">TESTER</code>).
78+
Now you can pass Plotly.newPlot() either the ID of the DIV ("tester") or the DIV DOM element (<code class="no-padding">TESTER</code>).
7979
</p>
8080

8181
</div>

_posts/plotly_js/3d/3d-cone/2018-06-12-basic-3d-cone.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
}
2222
}
2323

24-
Plotly.plot('myDiv',data,layout)
24+
Plotly.newPlot('myDiv',data,layout)

_posts/plotly_js/3d/3d-cone/2018-06-12-lighting.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,4 @@
123123
margin: {t: 0, b: 0, l: 0, r: 0}
124124
}
125125

126-
Plotly.plot('myDiv',data,layout)
126+
Plotly.newPlot('myDiv',data,layout)

_posts/plotly_js/3d/3d-cone/2018-06-12-multiple-3d-cone.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@
3535
width: 800
3636
}
3737

38-
Plotly.plot('myDiv', data, layout)
38+
Plotly.newPlot('myDiv', data, layout)

_posts/plotly_js/3d/3d-line/2015-04-09-3d-line-spiral.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
c.push(i)
2424
}
2525

26-
Plotly.plot('myDiv', [{
26+
Plotly.newPlot('myDiv', [{
2727
type: 'scatter3d',
2828
mode: 'lines',
2929
x: x,

_posts/plotly_js/3d/3d-line/2015-04-09-simple-3d-line+markers.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
c.push(i)
2424
}
2525

26-
Plotly.plot('myDiv', [{
26+
Plotly.newPlot('myDiv', [{
2727
type: 'scatter3d',
2828
mode: 'lines+markers',
2929
x: x,

_posts/plotly_js/3d/3d-line/2015-04-09-simple-3d-line-plot.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
var y = unpack(rows , 'y');
1616
var z = unpack(rows , 'z');
1717
var c = unpack(rows , 'color');
18-
Plotly.plot('myDiv', [{
18+
Plotly.newPlot('myDiv', [{
1919
type: 'scatter3d',
2020
mode: 'lines',
2121
x: x,

_posts/plotly_js/3d/3d-mesh/2016-06-16-cube-mesh.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626
}
2727
];
2828

29-
Plotly.plot('myDiv', data, {});
29+
Plotly.newPlot('myDiv', data, {});

_posts/plotly_js/3d/3d-mesh/2016-06-16-tetrahedron.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323
}
2424
];
2525

26-
Plotly.plot('myDiv', data, {});
26+
Plotly.newPlot('myDiv', data, {});

_posts/plotly_js/animations/animations-slider/2017-08-22-adding-sliders.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
};
165165

166166
// Create the plot:
167-
Plotly.plot('myDiv', {
167+
Plotly.newPlot('myDiv', {
168168
data: traces,
169169
layout: layout,
170170
frames: frames,

_posts/plotly_js/animations/animations/2016-09-15-animations-animating-many-frames-quickly.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
z[i] = 30 + Math.random() * 10;
2020
}
2121

22-
Plotly.plot('myDiv', [{
22+
Plotly.newPlot('myDiv', [{
2323
x: x,
2424
y: z,
2525
mode: 'markers'

_posts/plotly_js/animations/animations/2016-09-15-animations-animating-sequences-of-frames.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
The third argument of `Plotly.animate` contains animation options. The transition duration defines the amount of time spent interpolating a trace from one state to another (currently limited to scatter traces), while the frame duration defines the total time spent in that state, including time spent transitioning. The example below has two frames, each with their own transition and frame timing.
1313
---
14-
Plotly.plot('myDiv', [{
14+
Plotly.newPlot('myDiv', [{
1515
x: [0, 0],
1616
y: [-1, 1],
1717
}], {

_posts/plotly_js/animations/animations/2016-09-15-animations-animating-the-layout.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
y[i] = x[i] + 0.2 * (Math.random() - 0.5);
1717
}
1818

19-
Plotly.plot('myDiv', [{
19+
Plotly.newPlot('myDiv', [{
2020
x: x,
2121
y: y,
2222
mode: 'markers'

_posts/plotly_js/animations/animations/2016-09-15-animations-defining-named-frames.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
frames[2].data[0].y[i] = Math.cos(t * Math.PI);
3737
}
3838

39-
Plotly.plot('myDiv', [{
39+
Plotly.newPlot('myDiv', [{
4040
x: frames[0].data[0].x,
4141
y: frames[0].data[0].y,
4242
line: {simplify: false},

_posts/plotly_js/animations/animations/2016-09-15-animations-frame-groups-and-animation-modes.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
})
5050
}
5151

52-
Plotly.plot('myDiv', [{
52+
Plotly.newPlot('myDiv', [{
5353
// Set up the initial water:
5454
x: frames[0].data[0].x,
5555
y: frames[0].data[0].y,

_posts/plotly_js/animations/animations/2016-09-15-animations-object-constancy.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
var ids = ['1', '2', '3', '4', '5', '6'];
2222

23-
Plotly.plot('myDiv', [{
23+
Plotly.newPlot('myDiv', [{
2424
x: [1, 0.5, -0.5, -1, -0.5, 0.5],
2525
y: [0, 0.866, 0.866, 0, -0.866, -0.866],
2626
marker:{size:14,

_posts/plotly_js/animations/filled-area-animations/2017-08-22-filled-area-animations.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
frames[i].data[0].y = y.slice(0, i+1);
2626
}
2727

28-
Plotly.plot('myDiv', [{
28+
Plotly.newPlot('myDiv', [{
2929
x: frames[1].data[0].x,
3030
y: frames[1].data[0].y,
3131
fill: 'tozeroy',

_posts/plotly_js/basic/WebGL/2018-08-07-webgl_100000-points.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@
3737
y: Y
3838
}]
3939

40-
Plotly.plot('myDiv', data)
40+
Plotly.newPlot('myDiv', data)

_posts/plotly_js/basic/WebGL/2018-08-07-webgl_1mill-points.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@
3838
y: Y
3939
}]
4040

41-
Plotly.plot('myDiv', data)
41+
Plotly.newPlot('myDiv', data)

_posts/plotly_js/basic/WebGL/2018-08-07-webgl_many-traces.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@
3939
})
4040
}
4141
var layout = {showlegend: false}
42-
Plotly.plot('myDiv', data = data, layout = layout)
42+
Plotly.newPlot('myDiv', data = data, layout = layout)

_posts/plotly_js/basic/area/2015-04-09-hoveron.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@
4343
}
4444
}
4545

46-
Plotly.plot('myDiv', data, layout)
46+
Plotly.newPlot('myDiv', data, layout)

_posts/plotly_js/basic/bar/2017-05-24-bar-widths.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616

1717
var data = [trace0]
1818

19-
Plotly.plot('myDiv', data);
19+
Plotly.newPlot('myDiv', data);

_posts/plotly_js/basic/pointcloud/2017-06-15-advanced-pointcloud.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166

167167

168168
// 'Open sans',verdana,arial,sans-serif
169-
Plotly.plot('myDiv', plotData.data, plotData.layout).then(function() {
169+
Plotly.newPlot('myDiv', plotData.data, plotData.layout).then(function() {
170170

171171
var plotArea = document.querySelector('.gl-container div').getBoundingClientRect()
172172

_posts/plotly_js/basic/sankey/2017-05-22-add_links.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@
4949
}
5050
}
5151

52-
Plotly.plot('myDiv', data, layout)
52+
Plotly.newPlot('myDiv', data, layout)
5353
});

_posts/plotly_js/basic/sankey/2017-05-22-style_sankey.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@
5151
paper_bgcolor: 'black'
5252
}
5353

54-
Plotly.plot('myDiv', data, layout)
54+
Plotly.newPlot('myDiv', data, layout)
5555
});

_posts/plotly_js/basic/table/2017-11-01-alternating-rows.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@
3838
}
3939
}]
4040

41-
Plotly.plot('myDiv', data);
41+
Plotly.newPlot('myDiv', data);

_posts/plotly_js/basic/table/2017-11-01-basic-example.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@
3232
}
3333
}]
3434

35-
Plotly.plot('myDiv', data);
35+
Plotly.newPlot('myDiv', data);

_posts/plotly_js/basic/table/2017-11-01-from-a-csv.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@
5555
title: "Bitcoin mining stats for 180 days"
5656
}
5757

58-
Plotly.plot('myDiv', data, layout);
58+
Plotly.newPlot('myDiv', data, layout);
5959
});

_posts/plotly_js/basic/table/2017-11-01-sizing-rows-columns.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@
3737
}
3838
}]
3939

40-
Plotly.plot('myDiv', data);
40+
Plotly.newPlot('myDiv', data);

_posts/plotly_js/basic/table/2017-11-01-styled-example.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@
3333
}
3434
}]
3535

36-
Plotly.plot('myDiv', data);
36+
Plotly.newPlot('myDiv', data);

_posts/plotly_js/chart-events/callbacks-click/2016-10-13-click-event-data.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
pointNumber: 2, // index of the selected point
1313
x: 5, // x value
1414
y: 600, // y value
15-
data: {/* */}, // ref to the trace as sent to Plotly.plot associated with the selected point
15+
data: {/* */}, // ref to the trace as sent to Plotly.newPlot associated with the selected point
1616
fullData: {/* */}, // ref to the trace including all the defaults
1717
xaxis: {/* */}, // ref to x-axis object (i.e layout.xaxis) associated with the selected point
1818
yaxis: {/* */} // ref to y-axis object " "

_posts/plotly_js/chart-events/callbacks-hover/2015-04-09-hover-bind.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
title:'Hover on Points'
2424
};
2525

26-
Plotly.plot('myDiv', data, layout);
26+
Plotly.newPlot('myDiv', data, layout);
2727

2828
myPlot.on('plotly_hover', function(data){
2929
var infotext = data.points.map(function(d){

_posts/plotly_js/chart-events/callbacks-hover/2015-04-09-hover-manual.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
title:'Click "Go" button to trigger hover'
2323
};
2424

25-
Plotly.plot('myDiv', data, layout);
25+
Plotly.newPlot('myDiv', data, layout);
2626

2727
myPlot.on('plotly_beforehover',function(){
2828
return false;

_posts/plotly_js/chart-events/callbacks-hover/2016-10-13-hover-event-data.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
pointNumber: 2, // index of the selected point
1414
x: 5, // x value
1515
y: 600, // y value
16-
data: {/* */}, // ref to the trace as sent to Plotly.plot associated with the selected point
16+
data: {/* */}, // ref to the trace as sent to Plotly.newPlot associated with the selected point
1717
fullData: {/* */}, // ref to the trace including all the defaults
1818
xaxis: {/* */}, // ref to x-axis object (i.e layout.xaxis) associated with the selected point
1919
yaxis: {/* */} // ref to y-axis object " "

_posts/plotly_js/chart-events/callbacks-hover/2017-02-07-pixel-hover.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
layout = {hovermode:'closest',
2323
title:'Hover on Points to see<br>Pixel Coordinates'};
2424

25-
Plotly.plot('myDiv', data, layout);
25+
Plotly.newPlot('myDiv', data, layout);
2626

2727
myPlot.on('plotly_hover', function(data){
2828
var xaxis = data.points[0].xaxis,

_posts/plotly_js/chart-events/callbacks-zoom/2015-04-09-zoom-bind.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
data = [ { x:x, y:y } ];
1717
layout = { title:'Click-drag to zoom' };
1818

19-
Plotly.plot(graphDiv, data, layout);
19+
Plotly.newPlot(graphDiv, data, layout);
2020

2121
graphDiv.on('plotly_relayout',
2222
function(eventdata){

_posts/plotly_js/chart-events/events/2017-01-01-order10_afterplot.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
arrangement: horizontal
99
markdown_content: |
1010
The event handler: `plotly_afterplot`, can be used to trigger an event each time a chart is plotted. This also includes re-plotting after the restyling or relayout of a plot.
11-
Users also have the option of adding a post-plot handler to the plot call with the following syntax: `Plotly.plot('myDiv', data, layout, config).then(postPlotHandler);`
11+
Users also have the option of adding a post-plot handler to the plot call with the following syntax: `Plotly.newPlot('myDiv', data, layout, config).then(postPlotHandler);`
1212

1313
The simple example below logs a console message each time the chart is plotted. Zoom or pan on the graph below to trigger the `plotly_afterplot` handler.
1414
---
@@ -21,7 +21,7 @@
2121
mode:'markers', marker:{size:14}}
2222
];
2323

24-
Plotly.plot('myDiv', data);
24+
Plotly.newPlot('myDiv', data);
2525

2626
myPlot.on('plotly_afterplot', function(){
2727
console.log('done plotting');

_posts/plotly_js/chart-events/events/2017-01-01-order3-1_event_data.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
pointNumber: 1, // index of the selected point
1919
x: 1, // x value
2020
y: 1, // y value
21-
data: {/* */}, // ref to the trace as sent to Plotly.plot associated with the selected point
21+
data: {/* */}, // ref to the trace as sent to Plotly.newPlot associated with the selected point
2222
fullData: {/* */}, // ref to the trace including all of the default attributes
2323
xaxis: {/* */}, // ref to x-axis object (i.e layout.xaxis) associated with the selected point
2424
yaxis: {/* */} // ref to y-axis object " "
@@ -34,7 +34,7 @@
3434
pointNumbers: [1, 5, 28, 33, 41, ...], // Array of indices of the points aggregated into selected bin
3535
x: 1, // x value
3636
y: 45, // y value
37-
data: {/* */}, // ref to the trace as sent to Plotly.plot associated with the selected point
37+
data: {/* */}, // ref to the trace as sent to Plotly.newPlot associated with the selected point
3838
fullData: {/* */}, // ref to the trace including all of the default attributes
3939
xaxis: {/* */}, // ref to x-axis object (i.e layout.xaxis) associated with the selected point
4040
yaxis: {/* */} // ref to y-axis object " "
@@ -51,7 +51,7 @@
5151
x: 5, // x value
5252
y: 600, // y value
5353
z: 12, // z value
54-
data: {/* */}, // ref to the trace as sent to Plotly.plot associated with the selected point
54+
data: {/* */}, // ref to the trace as sent to Plotly.newPlot associated with the selected point
5555
fullData: {/* */}, // ref to the trace including all of the default attributes
5656
xaxis: {/* */}, // ref to x-axis object (i.e layout.xaxis) associated with the selected point
5757
yaxis: {/* */} // ref to y-axis object " "
@@ -68,7 +68,7 @@
6868
pointNumber: 2, // index of the selected point
6969
lat: 50, // latitude value
7070
lon: -12, // longitude value
71-
data: {/* */}, // ref to the trace as sent to Plotly.plot associated with the selected point
71+
data: {/* */}, // ref to the trace as sent to Plotly.newPlot associated with the selected point
7272
fullData: {/* */}, // ref to the trace including all of the default attributes
7373
location: //
7474
}, {

_posts/plotly_js/chart-events/events/2017-01-01-order6_selected_event.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
var x = randomArray();
2727
var y = randomArray();
2828

29-
Plotly.plot(graphDiv, [{
29+
Plotly.newPlot(graphDiv, [{
3030
type: 'scatter',
3131
mode: 'markers',
3232
x: x,

_posts/plotly_js/controls/callbacks-buttons/2018-10-16-button-relayout.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,6 @@
116116
}
117117

118118

119-
Plotly.plot("myDiv", data, layout);
119+
Plotly.newPlot("myDiv", data, layout);
120120

121121
});

_posts/plotly_js/controls/callbacks-buttons/2018-10-16-button-restyle-multiple.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,6 @@
211211
}
212212

213213

214-
Plotly.plot("myDiv", data, layout);
214+
Plotly.newPlot("myDiv", data, layout);
215215

216216
});

_posts/plotly_js/controls/callbacks-buttons/2018-10-16-button-restyle-simple.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,6 @@
9494
}
9595

9696

97-
Plotly.plot("myDiv", data, layout);
97+
Plotly.newPlot("myDiv", data, layout);
9898

9999
});

0 commit comments

Comments
 (0)