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

0 commit comments

Comments
 (0)