Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Chart.js 4 and use my own chartjs-node-canvas #190

Merged
merged 8 commits into from
Mar 23, 2024

Conversation

smarr
Copy link
Owner

@smarr smarr commented Mar 23, 2024

This PR updates to Chart.js 4 and uses a version of chartjs-node-canvas that does not rely on freshRequire and various other bits of aggressive use of require (presumably to isolate plugins) and thereby avoids leaking memory on every chart.

Thus, this PR addresses #188 as far as I can see. At least in manual testing, the memory profiles look clearly different between before and after.

Though, before this PR can be merged, sgratzl/chartjs-chart-boxplot#109 needs to be published, or I need to apply some local patches to allow chartjs-chart-boxplot to work on Node.js.

The PR updates also various other dependencies.

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Signed-off-by: Stefan Marr <git@stefan-marr.de>
Signed-off-by: Stefan Marr <git@stefan-marr.de>
…JS 4

The vendored code is from https://github.com/smarr/ChartjsNodeCanvas/

Version: 644cdea2345b90f1f4a78d7344f62d90761cabf1

The changes are mostly whitespace and formatting, to easily fit into the local setup.

- override sharp dependency in join-images

Signed-off-by: Stefan Marr <git@stefan-marr.de>
…artJS 4 to have same appearance as before

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Signed-off-by: Stefan Marr <git@stefan-marr.de>
@smarr smarr added bug Something isn't working dependencies Pull requests that update a dependency file labels Mar 23, 2024
Signed-off-by: Stefan Marr <git@stefan-marr.de>
This uses patch-package as a postinstall step to apply the fix.

Signed-off-by: Stefan Marr <git@stefan-marr.de>
@smarr
Copy link
Owner Author

smarr commented Mar 23, 2024

The patch-package tool is useful to work around the issue in the upstream package. So, I am using this for chartjs-chart-boxplot. Though, should keep track of upstream whether the PR gets merged.

@smarr smarr merged commit 1efe3f6 into master Mar 23, 2024
2 checks passed
@smarr smarr deleted the chartjs-updates branch March 23, 2024 21:21
@smarr smarr linked an issue Mar 23, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chart.js code memory leak
1 participant