Skip to content

Commit

Permalink
Added support for Gantt
Browse files Browse the repository at this point in the history
  • Loading branch information
cvasseng committed Oct 18, 2018
1 parent 4c6e584 commit a051ed2
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 4 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# 2.0.16

* Added support for bullet charts
* Added support for Gantt charts
* Added configuration option for chart generation timeout (`--timeoutThreshold`)
* Gracefull failing of 404 map collections now working properly
* Updated express version
* Updated docs

# 2.0.15

* Added `queueSize` option to `initPool` to set the request overfow queue size
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ depending on your setup, it may be possible to set the env variable in your `pac
}
```

#### Including Maps and/or Gantt support in automated deployments

Use the environment variables `HIGHCHARTS_USE_MAPS` and `HIGHCHARTS_USE_GANTT`
to enable support of either.

## Note about process.exit listeners

The export server attaches event listeners to process.exit. This is to
Expand Down
35 changes: 31 additions & 4 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ const cdnLegacy = [
];

const cdnMaps = [
"maps/{{version}}/modules/map.js"
'maps/{{version}}/modules/map.js'
];

const cdnGantt = [
'{{version}}/modules/gantt.js'
];

const cdnMoment = [
Expand Down Expand Up @@ -129,6 +133,12 @@ let schema = {
required: true,
conform: boolConform
},
gantt: {
description: 'Include Gantt? (requires Gantt license, and >V6.2)',
default: 'no',
required: true,
conform: boolConform
},
styledMode: {
description: 'Enable styled mode? (requires Highcharts/Highstock 5+ license)',
default: 'no',
Expand Down Expand Up @@ -273,19 +283,34 @@ function endMsg() {
console.log('For documentation, see https://github.com/highcharts/node-export-server');
}

function embedAll(version, includeStyled, includeMaps, includeMoment, optionals) {
function embedAll(version, includeStyled, includeMaps, includeMoment, includeGantt, optionals) {
var standard = cdnScriptsStandard.concat(cdnScriptsCommon).concat(cdnAdditional),
styled = cdnScriptsStyled.concat(cdnScriptsCommon).concat(cdnAdditional)
;

optionals = optionals || {};

if (includeMaps) {
console.log('Including maps support'.green);
standard = standard.concat(cdnMaps).concat(cdnMapCollection);
styled = styled.concat(cdnMaps).concat(cdnMapCollection);

// Map collections are user supplied, so we need to allow them to 404
cdnMapCollection.forEach((url) => {
cdnScriptsOptional[url] = 1;
optionals[url] = 1;
});
}

if (includeGantt) {
console.log('Including Gantt support'.green);

standard = standard.concat(cdnGantt);
styled = styled.concat(cdnGantt);

// Gantt was introduced in 6.2. To avoid 404 errors if fetching an
// older version by accident, let the fetch fail gracefully
cdnGantt.forEach((url) => {
optionals[url] = 1
});
}

Expand Down Expand Up @@ -355,6 +380,7 @@ function startPrompt() {
affirmative(result.styledMode),
affirmative(result.maps),
affirmative(result.moment),
affirmative(result.gantt),
getOptionals(result)
);
} else {
Expand All @@ -372,7 +398,8 @@ if (process.env.ACCEPT_HIGHCHARTS_LICENSE) {
useIfDefined(process.env.HIGHCHARTS_VERSION, 'latest'),
useIfDefined(process.env.HIGHCHARTS_USE_STYLED, true),
useIfDefined(process.env.HIGHCHARTS_USE_MAPS, true),
useIfDefined(process.env.HIGHCHARTS_MOMENT, false)
useIfDefined(process.env.HIGHCHARTS_MOMENT, false),
useIfDefined(process.env.HIGHCHARTS_USE_GANTT, true)
);
} else {
console.log(fs.readFileSync(__dirname + '/msg/licenseagree.msg').toString().bold);
Expand Down

0 comments on commit a051ed2

Please sign in to comment.