Skip to content

Commit 93d225f

Browse files
authored
Merge pull request #558 from highcharts/master
4.0.2
2 parents 999c504 + 0497b27 commit 93d225f

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 4.0.2
2+
3+
_Fixes:_
4+
5+
- Made chart userOptions available within `customCode` as variable `options` [(#551)](https://github.com/highcharts/node-export-server/issues/551).
6+
17
# 4.0.1
28

39
_Hotfix_:

lib/highcharts.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ export async function triggerExport(chartOptions, options, displayErrors) {
4141
// prevent from polluting other exports that can happen on the same page
4242
Highcharts.setOptionsObj = merge(false, {}, getOptions());
4343

44-
// Trigger custom code
45-
if (options.customLogic.customCode) {
46-
new Function(options.customLogic.customCode)();
47-
}
48-
4944
// By default animation is disabled
5045
const chart = {
5146
animation: false
@@ -100,6 +95,11 @@ export async function triggerExport(chartOptions, options, displayErrors) {
10095
const userOptions = options.export.strInj
10196
? new Function(`return ${options.export.strInj}`)()
10297
: chartOptions;
98+
99+
// Trigger custom code
100+
if (options.customLogic.customCode) {
101+
new Function('options', options.customLogic.customCode)(userOptions);
102+
}
103103

104104
// Merge the globalOptions, themeOptions, options from the wrapped
105105
// setOptions function and user options to create the final options object

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@
1414
"require": "./dist/index.cjs"
1515
}
1616
},
17-
"files": ["dist", "bin", "templates", "install.js", "lib"],
17+
"files": [
18+
"dist",
19+
"bin",
20+
"templates",
21+
"install.js",
22+
"lib",
23+
"msg",
24+
"public"
25+
],
1826
"repository": {
1927
"url": "https://github.com/highcharts/node-export-server",
2028
"type": "git"

0 commit comments

Comments
 (0)