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

minimum d3js import list #2407

Open
laurentdebricon opened this issue Jul 9, 2018 · 3 comments
Open

minimum d3js import list #2407

laurentdebricon opened this issue Jul 9, 2018 · 3 comments

Comments

@laurentdebricon
Copy link

laurentdebricon commented Jul 9, 2018

Hello,
what is the minimum d3js requirement for c3 ?

I would like to produce a minimal build for d3.js with stuff like :
import {scaleLinear} from "d3-scale";

From the doc of D3 : "D3 is written using ES2015 modules ..." https://github.com/d3/d3

so if anyone has the list, could be great.
I am currently building a Vuejs application with webpack and with the vue wrapper around C3 : https://github.com/chryb/vue-c3 .
My bundle size is big just for one little graph, that's why my question.

@laurentdebricon laurentdebricon changed the title minimum d3js minimum d3js import list Jul 9, 2018
@ahorek
Copy link

ahorek commented Jul 16, 2018

these works for me, it will reduce d3 size by around 50%
d3-array.js
d3-brush.js
d3-collection.js
d3-color.js
d3-dispatch.js
d3-ease.js
d3-format.js
d3-interpolate.js
d3-path.js
d3-scale-chromatic.js
d3-scale.js
d3-selection.js
d3-shape.js
d3-time-format.js
d3-timer.js
d3-transition.js
d3-zoom.js

@davidhund
Copy link

I am very interested in a custom build of C3, importing only necessary D3 modules for our use-case.
(E.g. only time-series base line-charts with tooltips, zoom and selection)

However: I could not get it to work properly in a Rollup/ES6 imports project.

Any working examples/tips on how to build a custom version of C3 (slimming down the considerable size) would be appreciated!

It seems a much-requested feature but I could not find any working examples.

@JamesMcMahon
Copy link

these works for me, it will reduce d3 size by around 50%
d3-array.js
d3-brush.js
d3-collection.js
d3-color.js
d3-dispatch.js
d3-ease.js
d3-format.js
d3-interpolate.js
d3-path.js
d3-scale-chromatic.js
d3-scale.js
d3-selection.js
d3-shape.js
d3-time-format.js
d3-timer.js
d3-transition.js
d3-zoom.js

How do you translate the above to config? Does anyone have an example?

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