Skip to content

Commit

Permalink
Merge pull request #465 from highcharts/master
Browse files Browse the repository at this point in the history
V3.0.5
  • Loading branch information
cvasseng authored Jan 12, 2024
2 parents ce41dc2 + 10728fd commit 4ebdf29
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 3.0.5

- Fixed an issue with transparent backgrounds in PNG exports (#463)
- Fixed an issue with missing `filename` property (https://github.com/highcharts/highcharts/issues/20370)

# 3.0.4

- Fixed and issue with reading `resources.json` during exports
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ Convert Highcharts.JS charts to static image files.

## Upgrade notes for V3.0

V3 should be a drop in replacement for V2 in most cases. However, due to changing out the browser back-end part, the various tweaks related to process handling (e.g. worker counts and so on) may have different effects than they did previously.
V3 should be a drop in replacement for V2 in most cases. However, due to changing out the browser back-end part, the various tweaks related to process handling (e.g. worker counts and so on) may have different effects than they did previously.

The API for when using the server as a node module has changed significantly, but a compatibility layer has been created to address this. It is however recommended to change to the new API described below, as the compatibility layer is likely to be deprecated at some point in the future.

One important note is that the export server now requires `node v16.14.0` or highe
One important note is that the export server now requires `node v16.14.0` or higher.

## Changelog

_Fixes and enhancements:_

- Replaced PhantomJS with Puppeteer
- Updated the config handling system to optionally load JSON files, and improved environment var loading
- Rewrote the HC caching system: it's now easier to include custom modules/depdencey lists in your own deployments
- Rewrote the HC caching system: it's now easier to include custom modules/dependency lists in your own deployments
- The install step no longer requires interaction when installing
- Replaced the custom worker pool system with `tarn`
- Error messages are now sent back to the client instead of being displayed in rasterized output
Expand Down Expand Up @@ -276,7 +276,7 @@ Like previously mentioned, there are multiple ways to set and prioritize options

The export server attaches event listeners to process.exit. This is to make sure that there are no memory leaks or zombie processes if the application is unexpectedly terminated.

Listeners are also attached to uncaught exceptions - if one appears, the entire pool is killed, and the application terminated.
Listeners are also attached to handle uncaught exceptions. If an exception occurs, the entire pool is terminated, and the application is shut down.

If you do not want this behavior, start the server with `--listenToProcessExits 0`.

Expand Down Expand Up @@ -353,6 +353,7 @@ The server accepts the following arguments in a POST body:
- `constr`: The constructor to use. Either `chart`, `stockChart`, `mapChart` or `ganttChart`.
- `b64`: Bool, set to true to get base64 back instead of binary.
- `noDownload`: Bool, set to true to not send attachment headers on the response.
- `filename`: If `noDownload == false`, the file will be downloaded with the `${filename}.${type}` name.
- `globalOptions`: A JSON object with options to be passed to `Highcharts.setOptions`.
- `themeOptions`: A JSON object with options to be passed to `Highcharts.setOptions`.
- `customCode`: Custom code to be called before chart initialization. Can be a function, a code that will be wrapped within a function or a filename with the js extension.
Expand Down
7 changes: 3 additions & 4 deletions lib/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,9 @@ const createImage = async (page, type, encoding, clip) =>
encoding,
clip,

// #447 - always render on a transparent page
// this will not affect users who do not explicitly set
// chart.backgroundColor to a color with opacity lower than 1
omitBackground: true
// #447, #463 - always render on a transparent page if
// the expected type format is PNG
omitBackground: type == 'png'
}),
new Promise((resolve, reject) =>
setTimeout(() => reject(new Error('Rasterization timeout')), 1500)
Expand Down
4 changes: 3 additions & 1 deletion lib/server/routes/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,9 @@ const exportHandler = (request, response) => {
// Decide whether to download or not chart file
if (!body.noDownload) {
response.attachment(
`${request.params.filename || 'chart'}.${type || 'png'}`
`${request.params.filename || request.body.filename || 'chart'}.${
type || 'png'
}`
);
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"author": "Highsoft AS <support@highcharts.com> (http://www.highcharts.com/about)",
"license": "MIT",
"type": "module",
"version": "3.0.4",
"version": "3.0.5",
"main": "dist/index.esm.js",
"exports": {
".": {
Expand Down

0 comments on commit 4ebdf29

Please sign in to comment.