Comments (4)
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.
Very nice!
from d3-shape.
@curran Do you think it is worth a Pull Request ?
from d3-shape.
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)
- Arc - Inconsistent error notification when invoked via fluent function calls vs invoking with data HOT 1
- Dynamic smoothing interpolation HOT 2
- Possible typing issue or a missing example (How to write a custom accessor?) HOT 1
- lineGenerator fail
- es5 to es6+ syntax? HOT 1
- The pie arguments problem HOT 1
- d3.arc startAngle and endAngle are switched when startAngle > endAngle HOT 8
- the BumpRadial curve only works with two-point lines
- Needs connection to me not fast enough!
- How does Catmull Rom work with a Bézier curve? HOT 2
- The types for Arc are incorrect HOT 1
- Unexpected arcs when corner radius is nonzero HOT 1
- curveBumpX creates a circle in Chrome if applied to a straight line. HOT 2
- How to add pointer effect to the shape? HOT 1
- running tests with d3-shape HOT 1
- Configurable precision for generated path data HOT 1
- Curve Natural gets outside the svg HOT 1
- add optional angle radius parameter in curbeBezier `curveStep` curves HOT 4
- option for arc's curve precision
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d3-shape.