Skip to content

Conversation

@Rich-Harris
Copy link
Owner

(and SvgArea?)

@jdomeij
Copy link

jdomeij commented Jan 10, 2021

Why not allow custom svg generator to be passed to SvgLine, this will prevent pancake to depend on d3-shape if not needed (it also allows more custom modifiers for the shape).

I have added this feature to my modified version of pancake (jdomeij@3064c8d)

If then want to use d3-shape you only need to override the default svg generator with customized d3-shape like

  import { line as d3Line, curveCardinal } from 'd3-shape';
  const d3Curve = curveCardinal.tension(0);
  const d3LineFunc = d3Line().curve(d3Curve).x(p=>p.x).y(p=>p.y);

<Pancake.SvgLine data={points} line={d3LineFunc} let:d>

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

Successfully merging this pull request may close these issues.

3 participants