d3 / d3-shape

Graphical primitives for visualization, such as lines and areas.
https://d3js.org/d3-shape
ISC License
2.48k stars 308 forks source link

Line gets imported as undefined. #82

Closed Steve-Mc closed 7 years ago

Steve-Mc commented 7 years ago

I am importing line from d3-shape:

import { line } from 'd3-shape';

and attaching it to a d3 constant:

const d3 = { line }

However I am getting d3.line is not a function when calling d3.line().

I am able to import from d3-selection, d3-array, d3-scale and d3-axis just fine. Has anyone else experienced this issue?

mbostock commented 7 years ago

That looks reasonable. Unfortunately without seeing the complete environment you are using, it’s impossible to say where things could be going wrong. I suggest posting a minimal test case to bl.ocks.org and then asking on Stack Overflow for help. Good luck.

Motoxpro commented 6 years ago

I had the same problem. Could import everything else fine, but not line from the shape module.

What I did, which i'm not sure why it worked, was do:

import * as d3Line from 'd3-shape'

then call

d3Line.line()

instead of importing the functions individually.

Ni55aN commented 6 years ago

@Motoxpro d3Line is undefined in my case. I'm building with Rollup

curran commented 6 years ago

import { line } from 'd3-shape'; should work fine.

Any chance you could post a full example so others could reproduce the error?

Ni55aN commented 6 years ago

My mistake, Githubissues.

  • Githubissues is a development platform for aggregating issues.