Skip to content

Commit 27ff102

Browse files
authored
Merge pull request #331 from plotly/remove-title-string
Update examples to use `title.text`
2 parents bff3849 + bf38db8 commit 27ff102

File tree

216 files changed

+1069
-520
lines changed

Some content is hidden

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

216 files changed

+1069
-520
lines changed

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

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,25 @@ <h1>Plotly JavaScript Open Source Graphing Library</h1>
5151
reversescale: true, zmax: 2.5, zmin: -2.5
5252
};
5353
var layout = {
54-
title: 'turbulence simulation',
55-
xaxis: {title: 'radial direction', showline: true, mirror: 'allticks', ticks: 'inside'},
56-
yaxis: {title: 'vertical direction', showline: true, mirror: 'allticks', ticks: 'inside'},
54+
title: {
55+
text: 'turbulence simulation'
56+
},
57+
xaxis: {
58+
title: {
59+
text: 'radial direction'
60+
},
61+
showline: true,
62+
mirror: 'allticks',
63+
ticks: 'inside'
64+
},
65+
yaxis: {
66+
title: {
67+
text: 'vertical direction'
68+
},
69+
showline: true,
70+
mirror: 'allticks',
71+
ticks: 'inside'
72+
},
5773
margin: {l: 40, b: 40, t: 60},
5874
annotations: [{
5975
showarrow: false,
@@ -97,7 +113,11 @@ <h1>Plotly JavaScript Open Source Graphing Library</h1>
97113
};
98114

99115
var layout = {
100-
yaxis: {title: "Wind Speed"}, // set the y axis title
116+
yaxis: {
117+
title: {
118+
text: "Wind Speed"
119+
}
120+
}, // set the y axis title
101121
xaxis: {
102122
showgrid: false, // remove the x-axis grid lines
103123
tickformat: "%B, %Y" // customize the date format to "month, day"

_posts/plotly_js/2016-06-03-plotly_js_function_ref.html

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,20 @@ <h4 id="plotly-newplot"><a href="{{ BASE_URL }}/javascript/plotlyjs-function-ref
8484
}];
8585

8686
var layout = {
87-
title: 'Sales Growth',
87+
title: {
88+
text: 'Sales Growth'
89+
},
8890
xaxis: {
89-
title: 'Year',
91+
title: {
92+
text: 'Year'
93+
},
9094
showgrid: false,
9195
zeroline: false
9296
},
9397
yaxis: {
94-
title: 'Percent',
98+
title: {
99+
text: 'Percent'
100+
},
95101
showline: false
96102
}
97103
};
@@ -252,7 +258,7 @@ <h4 id="plotly-relayout"><a href="{{ BASE_URL }}/javascript/plotlyjs-function-re
252258
<pre><code class="language-javascript hljs" data-lang="javascript">
253259
// update only values within nested objects
254260
var update = {
255-
title: 'some new title', // updates the title
261+
title: {text: 'some new title'}, // updates the title
256262
'xaxis.range': [0, 5], // updates the xaxis range
257263
'yaxis.range[1]': 15 // updates the end of the yaxis range
258264
};
@@ -290,7 +296,7 @@ <h4 id="plotly-update"><a href="{{ BASE_URL }}/javascript/plotlyjs-function-refe
290296
<pre><code class="language-javascript hljs" data-lang="javascript">
291297
//update the layout and all the traces
292298
var layout_update = {
293-
title: 'some new title', // updates the title
299+
title: {text: 'some new title'}, // updates the title
294300
};
295301
var data_update = {
296302
'marker.color': 'red'
@@ -299,7 +305,7 @@ <h4 id="plotly-update"><a href="{{ BASE_URL }}/javascript/plotlyjs-function-refe
299305

300306
//update the layout and a single trace
301307
var layout_update = {
302-
title: 'some new title', // updates the title
308+
title: {text: 'some new title'}, // updates the title
303309
};
304310
var data_update = {
305311
'marker.color': 'red'
@@ -308,7 +314,7 @@ <h4 id="plotly-update"><a href="{{ BASE_URL }}/javascript/plotlyjs-function-refe
308314

309315
//update the layout and two specific traces
310316
var layout_update = {
311-
title: 'some new title', // updates the title
317+
title: {text: 'some new title'}, // updates the title
312318
};
313319
var data_update = {
314320
'marker.color': 'red'
@@ -380,7 +386,9 @@ <h4 id="plotly-makeTemplate"><a href="{{ BASE_URL }}/javascript/plotlyjs-functio
380386
y: [2, 1, 3, 2],
381387
}],
382388
layout:{
383-
title: 'Quarterly Earnings'
389+
title: {
390+
text: 'Quarterly Earnings'
391+
}
384392
}
385393
};
386394

_posts/plotly_js/3d/3d-cluster/2015-08-10-3d-point-cluster.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@
7070
zeroline: false
7171
}
7272
},
73-
title: '3d point clustering',
73+
title: {
74+
text: '3d point clustering'
75+
},
7476
width: 477
7577
};
7678

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@
7474

7575
var data = [trace1, trace2, trace3];
7676
var layout = {
77-
title: '3D Line Plot',
77+
title: {
78+
text: '3D Line Plot'
79+
},
7880
autosize: false,
7981
width: 500,
8082
height: 500,

_posts/plotly_js/3d/3d-surface/2015-04-09-elevations-3d-surface.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
}];
2525

2626
var layout = {
27-
title: 'Mt Bruno Elevation',
27+
title: {
28+
text: 'Mt Bruno Elevation'
29+
},
2830
autosize: false,
2931
width: 500,
3032
height: 500,

_posts/plotly_js/3d/3d-surface/2018-10-09-surface-contours.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
}];
3535

3636
var layout = {
37-
title: 'Mt Bruno Elevation With Projected Contours',
37+
title: {
38+
text: 'Mt Bruno Elevation With Projected Contours'
39+
},
3840
scene: {camera: {eye: {x: 1.87, y: 0.88, z: -0.64}}},
3941
autosize: false,
4042
width: 500,

_posts/plotly_js/3d/ribbon-plots/2015-08-12-ribbon-plot-example.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,17 @@
5757
var data = [trace1, trace2, trace3, trace4, trace5, trace6, trace7];
5858

5959
var layout = {
60-
title: 'Ribbon Plot',
60+
title: {
61+
text: 'Ribbon Plot'
62+
},
6163
showlegend: false,
6264
autosize: true,
6365
width: 600,
6466
height: 600,
6567
scene: {
66-
xaxis: {title: 'Sample #'},
67-
yaxis: {title: 'Wavelength'},
68-
zaxis: {title: 'OD'}
68+
xaxis: {title: {text: 'Sample #'}},
69+
yaxis: {title: {text: 'Wavelength'}},
70+
zaxis: {title: {text: 'OD'}}
6971
}
7072
};
7173
Plotly.newPlot('myDiv', data, layout);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@
106106

107107
var layout = {
108108
xaxis: {
109-
title: 'Life Expectancy',
109+
title: {text: 'Life Expectancy'},
110110
range: [30, 85]
111111
},
112112
yaxis: {
113-
title: 'GDP per Capita',
113+
title: {text: 'GDP per Capita'},
114114
type: 'log'
115115
},
116116
hovermode: 'closest',

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@
3333
mode: 'lines',
3434
line: {color: 'green'}
3535
}], {
36-
title: "Filled-Area Animation",
36+
title: {
37+
text: "Filled-Area Animation"
38+
},
3739
xaxis: {
3840
type: 'date',
3941
range: [

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@
5151
var data = [trace1,trace2];
5252

5353
var layout = {
54-
title: 'Multiple Trace Filled-Area Animation',
54+
title: {
55+
text: 'Multiple Trace Filled-Area Animation'
56+
},
5557
xaxis: {
5658
range: [frames[99].data[0].x[0], frames[99].data[0].x[99]],
5759
showgrid: false

_posts/plotly_js/animations/map-animations/2017-08-22-choropleth-animation.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@
4747

4848
}];
4949
var layout = {
50-
title: 'World Life Expectency<br>1952 - 2007',
50+
title: {
51+
text: 'World Life Expectency<br>1952 - 2007'
52+
},
5153
geo:{
5254
scope: 'world',
5355
countrycolor: 'rgb(255, 255, 255)',

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
}]
3535

3636
var layout = {
37-
title: 'Hover on <i>points</i> or <i>fill</i>',
37+
title: {
38+
text: 'Hover on <i>points</i> or <i>fill</i>'
39+
},
3840
xaxis: {
3941
range: [0,5]
4042
},
@@ -43,4 +45,4 @@
4345
}
4446
}
4547

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
{x: [1,2,3], y: [3,0,2], stackgroup: 'one'}
1414
];
1515

16-
Plotly.newPlot('myDiv', traces, {title: 'stacked and filled line chart'});
16+
Plotly.newPlot('myDiv', traces, {title: {text: 'stacked and filled line chart'}});

_posts/plotly_js/basic/area/2015-08-10-overlaid-area-char-without-boundary-lines.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
};
2525

2626
var layout = {
27-
title: 'Overlaid Chart Without Boundary Lines'
27+
title: {
28+
text: 'Overlaid Chart Without Boundary Lines'
29+
}
2830
};
2931

3032
var data = [trace1, trace2];

_posts/plotly_js/basic/area/2018-09-18-normalized-stacked-area.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
{x: [1,2,3], y: [3,0,2], stackgroup: 'one'}
1414
];
1515

16-
Plotly.newPlot('myDiv', traces, {title: 'Normalized stacked and filled line chart'});
16+
Plotly.newPlot('myDiv', traces, {title: {text: 'Normalized stacked and filled line chart'}});
1717

_posts/plotly_js/basic/bar/2015-04-09-bar-marker-array.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
var data = [trace1];
1919

2020
var layout = {
21-
title: 'Least Used Feature'
21+
title: {
22+
text: 'Least Used Feature'
23+
}
2224
};
2325

2426
Plotly.newPlot('myDiv', data, layout);

_posts/plotly_js/basic/bar/2015-07-08-colored-and-styled-bar-chart.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
var data = [trace1, trace2];
2727

2828
var layout = {
29-
title: 'US Export of Plastic Scrap',
29+
title: {
30+
text: 'US Export of Plastic Scrap'
31+
},
3032
xaxis: {tickfont: {
3133
size: 14,
3234
color: 'rgb(107, 107, 107)'

_posts/plotly_js/basic/bar/2015-08-07-Rotated-bar-chart-labels.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
var data = [trace1, trace2];
3333

3434
var layout = {
35-
title: '2013 Sales Report',
35+
title: {
36+
text: '2013 Sales Report'
37+
},
3638
xaxis: {
3739
tickangle: -45
3840
},

_posts/plotly_js/basic/bar/2015-08-07-bar-chart-with-hover-text.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
var data = [trace1];
2121

2222
var layout = {
23-
title: 'Number of Graphs Made this Week',
23+
title: {
24+
text: 'Number of Graphs Made this Week'
25+
},
2426
font:{
2527
family: 'Raleway, sans-serif'
2628
},

_posts/plotly_js/basic/bar/2015-08-07-barchart-direct-labels.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
var data = [trace1];
3232

3333
var layout = {
34-
title: 'January 2013 Sales Report',
34+
title: {
35+
text: 'January 2013 Sales Report'
36+
},
3537
barmode: 'stack'
3638
};
3739

_posts/plotly_js/basic/bar/2015-08-07-waterfall-bar-chart.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@
7777
var data = [trace1, trace2, trace3, trace4];
7878

7979
var layout = {
80-
title: 'Annual Profit 2015',
80+
title: {
81+
text: 'Annual Profit 2015'
82+
},
8183
barmode: 'stack',
8284
paper_bgcolor: 'rgba(245,246,249,1)',
8385
plot_bgcolor: 'rgba(245,246,249,1)',

_posts/plotly_js/basic/bar/2016-06-15-barmode-relative.html

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,20 @@
3535

3636
var data = [trace1, trace2, trace3, trace4];
3737
var layout = {
38-
xaxis: {title: 'X axis'},
39-
yaxis: {title: 'Y axis'},
38+
xaxis: {
39+
title: {
40+
text: 'X axis'
41+
}
42+
},
43+
yaxis: {
44+
title: {
45+
text: 'Y axis'
46+
}
47+
},
4048
barmode: 'relative',
41-
title: 'Relative Barmode'
49+
title: {
50+
text: 'Relative Barmode'
51+
}
4252
};
4353

44-
Plotly.newPlot('myDiv', data, layout);
54+
Plotly.newPlot('myDiv', data, layout);

_posts/plotly_js/basic/bar/2017-08-30-barchart-direct-labels-grouped.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@
4848
var data = [trace1,trace2];
4949

5050
var layout = {
51-
title: 'January 2013 Sales Report'
51+
title: {
52+
text: 'January 2013 Sales Report'
53+
}
5254
};
5355

5456
Plotly.newPlot('myDiv', data, layout);

0 commit comments

Comments
 (0)