Giter Club home page Giter Club logo

Comments (4)

cittadhammo avatar cittadhammo commented on August 23, 2024

For anyone interested, this modif works in arc.js https://github.com/cittadhammo/d3-shape/blob/main/src/arc.js

main new code:


 // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.
      if (rp > epsilon) {
        var p0s = asin(rp / r0 * sin(aps)),
            p0e = asin(rp / r0 * sin(ape)),
            p1s = asin(rp / r1 * sin(aps)),
            p1e = asin(rp / r1 * sin(ape));
        if ((da0 -= p0s+p0e) > epsilon) p0s *= (cw ? 1 : -1), a00 += p0s, a10 -= p0e;
        else da0 = 0, a00 = a10 = (a0 + a1) / 2;
        if ((da1 -= p1s+p1e) > epsilon) p1s *= (cw ? 1 : -1), a01 += p1s, a11 -= p1e;
        else da1 = 0, a01 = a11 = (a0 + a1) / 2;
      }

compiled d3.js with the modif here and a test page here,

from d3-shape.

curran avatar curran commented on August 23, 2024

Very nice!

from d3-shape.

cittadhammo avatar cittadhammo commented on August 23, 2024

@curran Do you think it is worth a Pull Request ?

from d3-shape.

curran avatar curran commented on August 23, 2024

Personally, I think so! This would make a nice addition to the library, and it seems to be a non-breaking change.

I'm not able to merge PRs as I'm not a maintainer here, but happy to review it and provide feedback.

from d3-shape.

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.