Giter Site home page Giter Site logo

Comments (3)

Fil avatar Fil commented on July 19, 2024

The links generated by this module are made of a central path, connecting the center of the source to the center of the target. Its movement is given by the bump-x curve, and it is painted with a wide stroke. This makes it impossible (to my knowledge) to give it a variable stroke-width.

By contrast, Anneya's method is creating an area (with a fill), where the top and bottom edges are two curves, each determined by a (possibly different) bump-x curve. Maybe you could emulate that approach?

Unfortunately, using two parallel curves like this results in "squeezed" shapes (the ribbons appear smaller in the middle due to shearing), so it can't be the default method. This might be fixed by computing path offsets with path.getTangentAtLength and so on, but it seems like a lot of work.

Capture d’écran 2021-05-13 à 10 47 36

Refs:

from d3-sankey.

Fil avatar Fil commented on July 19, 2024

I've added a solution with @rveciana’s svg-path-properties

Capture d’écran 2021-05-13 à 11 36 34

from d3-sankey.

james-mckenzie-cko avatar james-mckenzie-cko commented on July 19, 2024

I've just done this using the approach outlined here:

https://observablehq.com/@enjalot/weird-sankey-links

The only caveat is that I've found an issue here (#92). It may or may not affect you depending on how you use it (we were scaling values either side of a node and so needed to recalculate the link height using the adjacent link positions)

hope this helps

from d3-sankey.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.