Comments (7)
It is tantalisingly similar to pv.normalize, though I suppose we would also need an optional padding specifier.
Currently, I think padAngle is a bit specific to donuts/pies because internally it isn’t allowed to be larger than (endAngle - startAngle) / n, and I don’t think that is necessarily desirable in the general case.
from d3-shape.
I don’t think that restriction on padding makes it specific to pies. If you were to apportion the range [0, 1] up into n pieces by value, wouldn’t you still restrict the maximum padding per piece to 1 / n? Otherwise you’d exceed the given range.
But, that still leaves two characteristics that are pie-specific:
- The generated objects have startAngle, endAngle and padAngle properties.
- The range defaults to [0, τ].
I’d be willing to forgive the second, but the first is strongly useful and specific. I suppose you could drop the “angle” suffix and use the generic names “start”, “end” and “pad”, and make the corresponding change to the arc generator. But that seems… undesirable. So I’m going to close this issue.
from d3-shape.
If you were to apportion the range [0, 1] up into n pieces by value, wouldn’t you still restrict the maximum padding per piece to 1 / n? Otherwise you’d exceed the given range.
For a non-circular range, you would restrict the padding to 1 / (n - 1), so it’s a bit different.
from d3-shape.
That assumes you don’t want padding at the start and end of the range. You might still want that? For that matter, the pie generator can be used with a range that does not form a complete circle, such as [0, π]. It still pads the start of the first arc and the end of the last arc in this case, in part because there’s no way to tell the arc generator that the padding is asymmetric.
For example:
from d3-shape.
Ah, good point. I agree this is probably not important enough to pursue though; the only other place it might be used would be for ordinal.rangeBands, where the outer padding can be different from the internal padding.
from d3-shape.
Related d3/d3#2237, which proposes asymmetric padding for arcs.
from d3-shape.
I took a quick pass at asymmetric padding in #42. For example:
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
- startPadAngle and endPadAngle HOT 4
- 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.