Skip to content

Commit 231dc2c

Browse files
authored
Merge pull request #117 from simzer/main
Documentation fixes
2 parents 9189adc + 7ef8d81 commit 231dc2c

Some content is hidden

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

45 files changed

+546
-567
lines changed

docs/content/tutorial/18-presets.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ chart.animate(Vizzu.presets.stackedBubble({
1616
size: 'Popularity',
1717
color: 'Kinds',
1818
stackedBy: 'Genres'
19-
}));
19+
}))
2020
```
2121

2222
Presets will override all channels, removing all previously set series
@@ -30,7 +30,7 @@ chart.animate(Vizzu.presets.radialStackedBar({
3030
radius: 'Genres',
3131
stackedBy: 'Kinds',
3232
sort: 'byValue'
33-
}));
33+
}))
3434
```
3535
As you will see, the preset doesn't override the previously configured sorting
3636
and wouldn't affect the rest of the chart config parameters mentioned above either.
@@ -48,5 +48,5 @@ chart.animate({
4848
style: {
4949
'plot.xAxis.interlacing.color': '#ffffff00'
5050
}
51-
});
51+
})
5252
```

docs/generator/examples.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
const fs = require('fs');
44
const path = require('path');
55
const sharp = require('sharp');
6+
const exampleList = require('./example-list');
67

78
class Examples
89
{
910
constructor()
1011
{
1112
this.examples = [];
13+
this.examples.push(...this.collect('preset', 'presets', 'png'));
1214
this.examples.push(...this.collect('sample_static', 'static', 'png'));
1315
this.examples.push(...this.collect('templates', 'animated', 'webm'));
1416

@@ -36,7 +38,8 @@ class Examples
3638
if (!fs.existsSync(dirname))
3739
fs.mkdirSync(dirname, { recursive: true });
3840

39-
if (example.outputFolder === 'static')
41+
if (example.outputFolder === 'static'
42+
|| example.outputFolder === 'presets')
4043
{
4144
sharp(example.pngFilename)
4245
.resize(320)
@@ -106,4 +109,6 @@ class Examples
106109
}
107110
}
108111

109-
module.exports = Examples;
112+
module.exports = Examples;
113+
114+
let examples = new Examples();

docs/generator/package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "generator",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "examples.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"author": "",
10+
"license": "ISC",
11+
"dependencies": {
12+
"sharp": "^0.30.7"
13+
}
14+
}

test/integration/package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@
77
},
88
"type": "commonjs",
99
"dependencies": {
10-
"yargs": "*",
1110
"aggregate-error": "*",
12-
"p-limit": "*",
13-
"selenium-webdriver": "*",
14-
"chromedriver": "*",
15-
"express": "*",
16-
"serve-static": "*",
17-
"node-fetch": "<3.0.0",
1811
"ajv": "*",
12+
"chromedriver": "^103.0.0",
1913
"colors": "1.4.0",
20-
"strip-color": "*",
14+
"express": "*",
15+
"node-fetch": "<3.0.0",
16+
"p-limit": "*",
17+
"pixelmatch": "*",
2118
"pngjs": "*",
22-
"pixelmatch": "*"
19+
"selenium-webdriver": "^4.3.1",
20+
"serve-static": "*",
21+
"strip-color": "*",
22+
"yargs": "*"
2323
},
2424
"devDependencies": {
25-
"jest": "*",
26-
"jest-extended": "*"
25+
"jest": "^28.1.2",
26+
"jest-extended": "^3.0.0"
2727
}
2828
}

test/integration/test_cases/web_content/preset/02_C_R_column.mjs

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,26 @@ const testSteps = [
44
chart => chart.animate(
55
{
66
data: data,
7-
config: chart.constructor.presets.column({
8-
x:'Joy factors',
9-
y:'Value 2 (+)',
10-
title: 'Column Chart'
11-
}),
7+
config: chart.constructor.presets.column({
8+
x: 'Joy factors',
9+
y: 'Value 2 (+)',
10+
title: 'Column Chart'
11+
}),
1212
style: {
13-
plot: {
14-
paddingLeft: '8em',
15-
yAxis: {
16-
label: {
17-
paddingRight: '0.8em'
18-
}
19-
},
20-
xAxis: {
21-
label: { paddingTop: '0.8em' }
22-
}
13+
plot: {
14+
paddingLeft: '8em',
15+
yAxis: {
16+
label: {
17+
paddingRight: '0.8em'
18+
}
19+
},
20+
xAxis: {
21+
label: { paddingTop: '0.8em' }
2322
}
23+
}
2424
}
2525
}
26-
),
27-
chart => chart.feature('tooltip',true)
26+
)
2827
];
2928

3029
export default testSteps;

test/integration/test_cases/web_content/preset/03_C_R_grouped_column_negative.mjs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,28 @@ const testSteps = [
1010
record.Country == 'Bulgaria' ||
1111
record.Country == 'Cyprus' ||
1212
record.Country == 'Denmark' ||
13-
record.Country == 'Hungary'
13+
record.Country == 'Hungary'
14+
}),
15+
config: chart.constructor.presets.groupedColumn({
16+
x: 'Country',
17+
y: 'Value 5 (+/-)',
18+
groupedBy: 'Joy factors',
19+
title: 'Grouped Column Chart'
1420
}),
15-
config: chart.constructor.presets.groupedColumn({
16-
x:'Country',
17-
y:'Value 5 (+/-)',
18-
groupedBy: 'Joy factors',
19-
title: 'Grouped Column Chart'
20-
}),
2121
style:
2222
{
2323
plot: {
2424
paddingLeft: '1.2em',
2525
yAxis: {
2626
label: { paddingRight: '0.8em' }
27-
},
27+
},
2828
xAxis: {
2929
label: { paddingTop: '0.8em' }
30-
}
30+
}
3131
}
3232
}
3333
}
34-
),
35-
chart => chart.feature('tooltip',true)
34+
)
3635
];
3736

3837
export default testSteps;

test/integration/test_cases/web_content/preset/04_C_R_stacked_column.mjs

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,34 @@ const testSteps = [
55
{
66
data: Object.assign(data, {
77
filter: record =>
8-
record.Country == 'Austria' ||
9-
record.Country == 'Belgium' ||
10-
record.Country == 'Bulgaria' ||
11-
record.Country == 'Cyprus' ||
12-
record.Country == 'Czechia' ||
13-
record.Country == 'Denmark'
14-
}),
8+
record.Country == 'Austria' ||
9+
record.Country == 'Belgium' ||
10+
record.Country == 'Bulgaria' ||
11+
record.Country == 'Cyprus' ||
12+
record.Country == 'Czechia' ||
13+
record.Country == 'Denmark'
14+
}),
1515
config: chart.constructor.presets.stackedColumn({
16-
x:'Country',
17-
y:'Value 2 (+)',
18-
stackedBy: 'Joy factors',
16+
x: 'Country',
17+
y: 'Value 2 (+)',
18+
stackedBy: 'Joy factors',
1919
title: 'Stacked Column Chart'
2020
}),
2121
style: {
22-
plot: {
23-
paddingLeft: '1.2em',
24-
yAxis: {
25-
label: {
26-
paddingRight: '0.8em'
27-
}
28-
},
29-
xAxis: {
30-
label: { paddingTop: '0.8em' }
31-
}
22+
plot: {
23+
paddingLeft: '1.2em',
24+
yAxis: {
25+
label: {
26+
paddingRight: '0.8em'
27+
}
28+
},
29+
xAxis: {
30+
label: { paddingTop: '0.8em' }
3231
}
32+
}
3333
}
3434
}
35-
),
36-
chart => chart.feature('tooltip',true)
35+
)
3736
];
3837

3938
export default testSteps;

test/integration/test_cases/web_content/preset/05_C_R_splitted_column.mjs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ const testSteps = [
55
{
66
data: data,
77
config: chart.constructor.presets.splittedColumn({
8-
x:'Year',
9-
y:'Value 2 (+)',
8+
x: 'Year',
9+
y: 'Value 2 (+)',
1010
splittedBy: 'Joy factors',
1111
title: 'Splitted Column Chart'
12-
}),
12+
}),
1313
style: {
1414
plot: {
1515
paddingLeft: '1.2em',
1616
yAxis: {
1717
label: {
18-
paddingRight: '0.8em'
18+
paddingRight: '0.8em'
1919
}
2020
},
2121
xAxis: {
@@ -24,9 +24,7 @@ const testSteps = [
2424
}
2525
}
2626
}
27-
),
28-
29-
chart => chart.feature('tooltip',true)
27+
)
3028
];
3129

3230
export default testSteps;

test/integration/test_cases/web_content/preset/06_C_R_percentage_column.mjs

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,34 @@ const testSteps = [
55
{
66
data: Object.assign(data, {
77
filter: record =>
8-
record.Country == 'Austria' ||
9-
record.Country == 'Belgium' ||
10-
record.Country == 'Bulgaria' ||
11-
record.Country == 'Cyprus' ||
12-
record.Country == 'Czechia' ||
13-
record.Country == 'Denmark'
14-
}),
15-
config: chart.constructor.presets.percentageColumn({
16-
x:'Country',
17-
y:'Value 2 (+)',
18-
stackedBy: 'Joy factors',
19-
title: 'Percentage Column Chart'
20-
}),
8+
record.Country == 'Austria' ||
9+
record.Country == 'Belgium' ||
10+
record.Country == 'Bulgaria' ||
11+
record.Country == 'Cyprus' ||
12+
record.Country == 'Czechia' ||
13+
record.Country == 'Denmark'
14+
}),
15+
config: chart.constructor.presets.percentageColumn({
16+
x: 'Country',
17+
y: 'Value 2 (+)',
18+
stackedBy: 'Joy factors',
19+
title: 'Percentage Column Chart'
20+
}),
2121
style: {
22-
plot: {
23-
paddingLeft: '1.2em',
24-
yAxis: {
25-
label: {
26-
paddingRight: '0.8em'
27-
}
28-
},
29-
xAxis: {
30-
label: { paddingTop: '0.8em' }
31-
}
22+
plot: {
23+
paddingLeft: '1.2em',
24+
yAxis: {
25+
label: {
26+
paddingRight: '0.8em'
27+
}
28+
},
29+
xAxis: {
30+
label: { paddingTop: '0.8em' }
3231
}
32+
}
3333
}
3434
}
35-
),
36-
chart => chart.feature('tooltip',true)
35+
)
3736
];
3837

3938
export default testSteps;

0 commit comments

Comments
 (0)