quantmind / d3-canvas-transition

transition on canvas with d3
BSD 3-Clause "New" or "Revised" License
18 stars 7 forks source link

Webpack bundling #7

Open ekiwi111 opened 6 years ago

ekiwi111 commented 6 years ago

Is there a way to bundle this plugin with d3 using Webpack?

I found a way to import some of the functions through:

import * as d3base from 'd3';
import { getSize, resolution, selectCanvas } from 'd3-canvas-transition';

const d3 = Object.assign(d3base, { getSize, resolution, selectCanvas });

But some can't be imported, because they applied to selection.prototype directly.

And I keep getting an error in the console ....attr(...).canvasResolution is not a function

PhilTheAir commented 6 years ago

Anyone can help out?