Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8c29650

Browse files
committed
fixed the indentaions and variable assignation
1 parent 3bba5cf commit 8c29650

9 files changed

+161
-166
lines changed

_posts/plotly_js/layout/tick-format/2018-12-17-array-tickmode.html

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,19 @@
88
arrangement: horizontal
99
---
1010

11-
var x= [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
12-
y =[28.8, 28.5, 37, 56.8, 69.7, 79.7, 78.5, 77.8, 74.1, 62.6, 45.3, 39.9]
13-
var data = [
14-
{
15-
x: x,
16-
y: y,
17-
type: 'scatter'
18-
}
19-
];
11+
var x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
12+
var y = [28.8, 28.5, 37, 56.8, 69.7, 79.7, 78.5, 77.8, 74.1, 62.6, 45.3, 39.9];
13+
var data = [{
14+
x: x,
15+
y: y,
16+
type: 'scatter'
17+
}];
2018
var layout = {
21-
xaxis: {
22-
tickmode: "array", // If "array", the placement of the ticks is set via `tickvals` and the tick text is `ticktext`.
23-
tickvals: [1, 3, 5, 7, 9, 11],
24-
ticktext: ['One', 'Three', 'Five', 'Seven', 'Nine', 'Eleven']
25-
}
19+
xaxis: {
20+
tickmode: "array", // If "array", the placement of the ticks is set via `tickvals` and the tick text is `ticktext`.
21+
tickvals: [1, 3, 5, 7, 9, 11],
22+
ticktext: ['One', 'Three', 'Five', 'Seven', 'Nine', 'Eleven']
23+
}
2624
}
2725

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

_posts/plotly_js/layout/tick-format/2018-12-17-how-to-tick-format-layout.html

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,38 @@
77
order: 0
88
---
99

10+
11+
1012
{
1113
xaxis: {
1214
/* Set the tick mode for the axis "auto" or "linear" or "array" */
1315
tickmode: 'auto',
1416

15-
/* Set the placement of the first tick*/
17+
/* Set the placement of the first tick*/
1618
tick0: '',
1719
/* Set the step in-between ticks*/
1820
dtick: '',
1921
/* Specifies the maximum number of ticks */
2022
nticks: 0,
21-
23+
2224
/* Set the values at which ticks on this axis appear */
23-
tickvals: [/* */],
25+
tickvals: [ /* */ ],
2426
/* Set the text displayed at the ticks position via tickvals */
25-
ticktext: [/* */],
27+
ticktext: [ /* */ ],
2628
/* Set the source reference for tickvals */
2729
tickvalssrc: '',
2830
/* Set the source reference for ticktext */
2931
tickvtextsrc: '',
30-
32+
3133
/* Set the tick label formatting rule using d3 formatting mini-languages */
3234
tickformat: '',
3335
/* Set the tickformat per zoom level */
3436
tickformatstops: {
35-
enabled: true,
36-
/* Set the range of the dtick values which describe the zoom level, it is possible to omit "min" or "max" value by passing "null" */
37-
dtickrange: ["min", "max"],
38-
/* dtickformat for described zoom level, the same as "tickformat" */
39-
value: string,
37+
enabled: true,
38+
/* Set the range of the dtick values which describe the zoom level, it is possible to omit "min" or "max" value by passing "null" */
39+
dtickrange: ["min", "max"],
40+
/* dtickformat for described zoom level, the same as "tickformat" */
41+
value: string,
4042
},
4143

4244
/* Set the ticks to display with a prefix: "all" or "first" or "last" or "none" */

_posts/plotly_js/layout/tick-format/2018-12-17-include-fr-locale.html

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,19 @@
88
arrangement: horizontal
99
---
1010

11-
var x= ['2013-02-04', '2013-04-05', '2013-06-06', '2013-08-07', '2013-10-02'],
12-
y =[1, 4, 3, 6, 2]
13-
var data = [
14-
{
15-
x: x,
16-
y: y,
17-
type: 'scatter'
18-
}
19-
];
11+
var x = ['2013-02-04', '2013-04-05', '2013-06-06', '2013-08-07', '2013-10-02'];
12+
var y = [1, 4, 3, 6, 2];
13+
var data = [{
14+
x: x,
15+
y: y,
16+
type: 'scatter'
17+
}];
2018
var layout = {
21-
xaxis:{
22-
tickformat: '%a %e %b \n %Y'
23-
}
19+
xaxis: {
20+
tickformat: '%a %e %b \n %Y'
21+
}
2422
}
2523

2624
Plotly.newPlot('myDiv', data, layout, {
27-
locale: 'fr' // For more info, see: https://github.com/plotly/plotly.js/blob/master/dist/README.md#to-include-localization and https://github.com/plotly/plotly.js/tree/master/dist
25+
locale: 'fr' // For more info, see: https://github.com/plotly/plotly.js/blob/master/dist/README.md#to-include-localization and https://github.com/plotly/plotly.js/tree/master/dist
2826
});

_posts/plotly_js/layout/tick-format/2018-12-17-linear(date)-tickmode.html

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,19 @@
88
arrangement: horizontal
99
---
1010

11-
var x= ['2000-01', '2000-02', '2000-03', '2000-04', '2000-05', '2000-06', '2000-07', '2000-08', '2000-09', '2000-10', '2000-11', '2000-12', '2001-01'],
12-
y =[-36.5, -26.6, -43.6, -52.3, -71.5, -81.4, -80.5, -82.2, -76, -67.3, -46.1, -35, -40]
13-
var data = [
14-
{
15-
x: x,
16-
y: y,
17-
type: 'scatter'
18-
}
19-
];
11+
var x = ['2000-01', '2000-02', '2000-03', '2000-04', '2000-05', '2000-06', '2000-07', '2000-08', '2000-09', '2000-10', '2000-11', '2000-12', '2001-01'];
12+
var y = [-36.5, -26.6, -43.6, -52.3, -71.5, -81.4, -80.5, -82.2, -76, -67.3, -46.1, -35, -40];
13+
var data = [{
14+
x: x,
15+
y: y,
16+
type: 'scatter'
17+
}];
2018
var layout = {
21-
xaxis: {
22-
tickmode: "linear", // If "linear", the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick`
23-
tick0: '1999-12-15',
24-
dtick: 30*24*60*60*1000 // milliseconds
25-
}
19+
xaxis: {
20+
tickmode: "linear", // If "linear", the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick`
21+
tick0: '1999-12-15',
22+
dtick: 30 * 24 * 60 * 60 * 1000 // milliseconds
23+
}
2624
}
2725

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

_posts/plotly_js/layout/tick-format/2018-12-17-linear-tickmode.html

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,19 @@
88
arrangement: horizontal
99
---
1010

11-
var x= [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
12-
y =[28.8, 28.5, 37, 56.8, 69.7, 79.7, 78.5, 77.8, 74.1, 62.6, 45.3, 39.9]
13-
var data = [
14-
{
15-
x: x,
16-
y: y,
17-
type: 'scatter'
18-
}
19-
];
11+
var x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
12+
var y = [28.8, 28.5, 37, 56.8, 69.7, 79.7, 78.5, 77.8, 74.1, 62.6, 45.3, 39.9];
13+
var data = [{
14+
x: x,
15+
y: y,
16+
type: 'scatter'
17+
}];
2018
var layout = {
21-
xaxis: {
22-
tickmode: "linear", // If "linear", the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick`
23-
tick0: 0.5,
24-
dtick: 0.75
25-
}
19+
xaxis: {
20+
tickmode: "linear", // If "linear", the placement of the ticks is determined by a starting position `tick0` and a tick step `dtick`
21+
tick0: 0.5,
22+
dtick: 0.75
23+
}
2624
}
2725

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

_posts/plotly_js/layout/tick-format/2018-12-17-tickformatstops.html

Lines changed: 42 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -9,52 +9,49 @@
99
---
1010

1111
var gd = document.getElementById('myDiv');
12-
var x= ["2005-01","2005-02","2005-03","2005-04","2005-05","2005-06","2005-07"],
13-
y =[-20,10,-5,0,5,-10,20]
14-
var data = [
15-
{
16-
x: x,
17-
y: y,
18-
type: 'scatter'
19-
}
20-
];
12+
var x = ["2005-01", "2005-02", "2005-03", "2005-04", "2005-05", "2005-06", "2005-07"];
13+
var y = [-20, 10, -5, 0, 5, -10, 20];
14+
var data = [{
15+
x: x,
16+
y: y,
17+
type: 'scatter'
18+
}];
2119
var layout = {
22-
xaxis: {
23-
tickformatstops: [
24-
{
25-
"dtickrange": [null, 1000],
26-
"value": "%H:%M:%S.%L ms"
27-
},
28-
{
29-
"dtickrange": [1000, 60000],
30-
"value": "%H:%M:%S s"
31-
},
32-
{
33-
"dtickrange": [60000, 3600000],
34-
"value": "%H:%M m"
35-
},
36-
{
37-
"dtickrange": [3600000, 86400000],
38-
"value": "%H:%M h"
39-
},
40-
{
41-
"dtickrange": [86400000, 604800000],
42-
"value": "%e. %b d"
43-
},
44-
{
45-
"dtickrange": [604800000, "M1"],
46-
"value": "%e. %b w"
47-
},
48-
{
49-
"dtickrange": ["M1", "M12"],
50-
"value": "%b '%y M"
51-
},
52-
{
53-
"dtickrange": ["M12", null],
54-
"value": "%Y Y"
55-
}
56-
]
57-
}
20+
xaxis: {
21+
tickformatstops: [{
22+
"dtickrange": [null, 1000],
23+
"value": "%H:%M:%S.%L ms"
24+
},
25+
{
26+
"dtickrange": [1000, 60000],
27+
"value": "%H:%M:%S s"
28+
},
29+
{
30+
"dtickrange": [60000, 3600000],
31+
"value": "%H:%M m"
32+
},
33+
{
34+
"dtickrange": [3600000, 86400000],
35+
"value": "%H:%M h"
36+
},
37+
{
38+
"dtickrange": [86400000, 604800000],
39+
"value": "%e. %b d"
40+
},
41+
{
42+
"dtickrange": [604800000, "M1"],
43+
"value": "%e. %b w"
44+
},
45+
{
46+
"dtickrange": ["M1", "M12"],
47+
"value": "%b '%y M"
48+
},
49+
{
50+
"dtickrange": ["M12", null],
51+
"value": "%Y Y"
52+
}
53+
]
54+
}
5855
};
5956

6057
Plotly.plot(gd, data, layout);

_posts/plotly_js/layout/tick-format/2018-12-17-using-exponentformat.html

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,18 @@
88
arrangement: horizontal
99
---
1010

11-
var x= [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
12-
y =[68000, 52000, 60000, 20000, 95000, 40000, 60000, 79000, 74000, 42000, 20000, 90000]
13-
var data = [
14-
{
15-
x: x,
16-
y: y,
17-
type: 'scatter'
18-
}
19-
];
11+
var x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
12+
var y = [68000, 52000, 60000, 20000, 95000, 40000, 60000, 79000, 74000, 42000, 20000, 90000];
13+
var data = [{
14+
x: x,
15+
y: y,
16+
type: 'scatter'
17+
}];
2018
var layout = {
21-
yaxis: {
22-
showexponent: 'all',
23-
exponentformat: 'e'
24-
}
19+
yaxis: {
20+
showexponent: 'all',
21+
exponentformat: 'e'
22+
}
2523
}
2624

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

_posts/plotly_js/layout/tick-format/2018-12-17-using-tickformat(date).html

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,47 @@
88
arrangement: horizontal
99
---
1010

11-
Plotly.d3.csv("https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv", function(err, rows){
11+
12+
13+
Plotly.d3.csv("https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv", function (err, rows) {
1214

1315
function unpack(rows, key) {
14-
return rows.map(function(row) { return row[key]; });
15-
}
16-
17-
18-
var trace1 = {
19-
type: "scatter",
20-
mode: "lines",
21-
name: 'AAPL High',
22-
x: unpack(rows, 'Date'),
23-
y: unpack(rows, 'AAPL.High'),
24-
line: {color: '#17BECF'}
25-
}
26-
27-
var trace2 = {
28-
type: "scatter",
29-
mode: "lines",
30-
name: 'AAPL Low',
31-
x: unpack(rows, 'Date'),
32-
y: unpack(rows, 'AAPL.Low'),
33-
line: {color: '#7F7F7F'}
34-
}
35-
36-
var data = [trace1,trace2];
37-
38-
var layout = {
39-
title: 'Time series with custom tickformat',
40-
xaxis: {
41-
tickformat: '%d %B (%a)\n %Y' // For more time formatting types, see: https://github.com/d3/d3-time-format/blob/master/README.md
16+
return rows.map(function (row) {
17+
return row[key];
18+
});
19+
}
20+
21+
22+
var trace1 = {
23+
type: "scatter",
24+
mode: "lines",
25+
name: 'AAPL High',
26+
x: unpack(rows, 'Date'),
27+
y: unpack(rows, 'AAPL.High'),
28+
line: {
29+
color: '#17BECF'
30+
}
4231
}
43-
};
4432

45-
Plotly.newPlot('myDiv', data, layout);
33+
var trace2 = {
34+
type: "scatter",
35+
mode: "lines",
36+
name: 'AAPL Low',
37+
x: unpack(rows, 'Date'),
38+
y: unpack(rows, 'AAPL.Low'),
39+
line: {
40+
color: '#7F7F7F'
41+
}
42+
}
43+
44+
var data = [trace1, trace2];
45+
46+
var layout = {
47+
title: 'Time series with custom tickformat',
48+
xaxis: {
49+
tickformat: '%d %B (%a)\n %Y' // For more time formatting types, see: https://github.com/d3/d3-time-format/blob/master/README.md
50+
}
51+
};
52+
53+
Plotly.newPlot('myDiv', data, layout);
4654
})

0 commit comments

Comments
 (0)