Skip to content

Commit a051ed2

Browse files
committed
Added support for Gantt
1 parent 4c6e584 commit a051ed2

File tree

3 files changed

+45
-4
lines changed

3 files changed

+45
-4
lines changed

Diff for: CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# 2.0.16
2+
3+
* Added support for bullet charts
4+
* Added support for Gantt charts
5+
* Added configuration option for chart generation timeout (`--timeoutThreshold`)
6+
* Gracefull failing of 404 map collections now working properly
7+
* Updated express version
8+
* Updated docs
9+
110
# 2.0.15
211

312
* Added `queueSize` option to `initPool` to set the request overfow queue size

Diff for: README.md

+5
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ depending on your setup, it may be possible to set the env variable in your `pac
143143
}
144144
```
145145

146+
#### Including Maps and/or Gantt support in automated deployments
147+
148+
Use the environment variables `HIGHCHARTS_USE_MAPS` and `HIGHCHARTS_USE_GANTT`
149+
to enable support of either.
150+
146151
## Note about process.exit listeners
147152

148153
The export server attaches event listeners to process.exit. This is to

Diff for: build.js

+31-4
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ const cdnLegacy = [
8585
];
8686

8787
const cdnMaps = [
88-
"maps/{{version}}/modules/map.js"
88+
'maps/{{version}}/modules/map.js'
89+
];
90+
91+
const cdnGantt = [
92+
'{{version}}/modules/gantt.js'
8993
];
9094

9195
const cdnMoment = [
@@ -129,6 +133,12 @@ let schema = {
129133
required: true,
130134
conform: boolConform
131135
},
136+
gantt: {
137+
description: 'Include Gantt? (requires Gantt license, and >V6.2)',
138+
default: 'no',
139+
required: true,
140+
conform: boolConform
141+
},
132142
styledMode: {
133143
description: 'Enable styled mode? (requires Highcharts/Highstock 5+ license)',
134144
default: 'no',
@@ -273,19 +283,34 @@ function endMsg() {
273283
console.log('For documentation, see https://github.com/highcharts/node-export-server');
274284
}
275285

276-
function embedAll(version, includeStyled, includeMaps, includeMoment, optionals) {
286+
function embedAll(version, includeStyled, includeMaps, includeMoment, includeGantt, optionals) {
277287
var standard = cdnScriptsStandard.concat(cdnScriptsCommon).concat(cdnAdditional),
278288
styled = cdnScriptsStyled.concat(cdnScriptsCommon).concat(cdnAdditional)
279289
;
280290

291+
optionals = optionals || {};
292+
281293
if (includeMaps) {
282294
console.log('Including maps support'.green);
283295
standard = standard.concat(cdnMaps).concat(cdnMapCollection);
284296
styled = styled.concat(cdnMaps).concat(cdnMapCollection);
285297

286298
// Map collections are user supplied, so we need to allow them to 404
287299
cdnMapCollection.forEach((url) => {
288-
cdnScriptsOptional[url] = 1;
300+
optionals[url] = 1;
301+
});
302+
}
303+
304+
if (includeGantt) {
305+
console.log('Including Gantt support'.green);
306+
307+
standard = standard.concat(cdnGantt);
308+
styled = styled.concat(cdnGantt);
309+
310+
// Gantt was introduced in 6.2. To avoid 404 errors if fetching an
311+
// older version by accident, let the fetch fail gracefully
312+
cdnGantt.forEach((url) => {
313+
optionals[url] = 1
289314
});
290315
}
291316

@@ -355,6 +380,7 @@ function startPrompt() {
355380
affirmative(result.styledMode),
356381
affirmative(result.maps),
357382
affirmative(result.moment),
383+
affirmative(result.gantt),
358384
getOptionals(result)
359385
);
360386
} else {
@@ -372,7 +398,8 @@ if (process.env.ACCEPT_HIGHCHARTS_LICENSE) {
372398
useIfDefined(process.env.HIGHCHARTS_VERSION, 'latest'),
373399
useIfDefined(process.env.HIGHCHARTS_USE_STYLED, true),
374400
useIfDefined(process.env.HIGHCHARTS_USE_MAPS, true),
375-
useIfDefined(process.env.HIGHCHARTS_MOMENT, false)
401+
useIfDefined(process.env.HIGHCHARTS_MOMENT, false),
402+
useIfDefined(process.env.HIGHCHARTS_USE_GANTT, true)
376403
);
377404
} else {
378405
console.log(fs.readFileSync(__dirname + '/msg/licenseagree.msg').toString().bold);

0 commit comments

Comments
 (0)