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

Support NPM / Browserify #27

Open
felixfbecker opened this issue Jan 16, 2016 · 13 comments
Open

Support NPM / Browserify #27

felixfbecker opened this issue Jan 16, 2016 · 13 comments

Comments

@felixfbecker
Copy link

It seems like this module is only able to use global Highcharts object. It would be nice if it could be installed with NPM and require()d like Highcharts itself.

Would submit PR.

@A----
Copy link
Owner

A---- commented Jan 19, 2016

If you have time for a PR, sure! Could do for a AMD module too!

@felixfbecker
Copy link
Author

Pretty much finished, just waiting for an answer on highcharts/export-csv#72 so the dependency can be expressed correctly in package.json without globals or git references.

@felixfbecker
Copy link
Author

Waiting for highcharts/export-csv#79

@felixfbecker
Copy link
Author

@A---- Am I understanding correctly that RGBColor and canvg are provided through highcharts/modules/canvas-tools as globals?

@A----
Copy link
Owner

A---- commented Jan 20, 2016

Yes :)

@felixfbecker
Copy link
Author

That sucks... I don't really want to add a require statement in the code for globals - are there other options? I'm currently in the talks for proper NPM packages for canvg (includes rgbcolor) and export-csv. Is there anything else that is needed from canvas-tools? Is that Highcharts module in there needed?

@A----
Copy link
Owner

A---- commented Jan 20, 2016

Well, canvas-tools is a fork of canvg if I remember correctly. And you need it for the SVG to PNG/JPG conversion.

canvg seems Common.js-compatible now: https://github.com/gabelerner/canvg/blob/master/canvg.js

I had some issues with older versions but on more recent attemps, it worked alright.

@felixfbecker
Copy link
Author

It also patches (global) Highcharts a custom renderer module: https://github.com/highcharts/highcharts-dist/blob/master/modules/canvas-tools.src.js#L2919

I'm currently working to get a NPM package of canvg. PR for export-csv is submitted and jspdf is available on NPM.

@felixfbecker
Copy link
Author

@A---- How are you calling canvg? It must be an XML string, but where does that come from? Do you have a DOM document object initially or a Node object or do you get the string from Highcharts?

@A----
Copy link
Owner

A---- commented Jan 20, 2016

The exporting module of Highcharts provides a getSVG() method.

@felixfbecker
Copy link
Author

I just found out that Highcharts now supports client side export natively: http://www.highcharts.com/docs/export-module/client-side-export

So this module isnt needed anymore.

@ulrik59
Copy link

ulrik59 commented Mar 29, 2016

Is there any plan to publish on NPM ? Because Highcharts offline export module doesn't support JPEG and PDF yet...

@deathran
Copy link

deathran commented May 3, 2016

Would love a npm package for this aswell :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants