curveCubicX?
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 20/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- d3, javascript
- Ambito
- data-visualization, frontend
Direzione di ricerca
Start by reviewing the linked original discussion in d3-interpolate#49 and the spline interpolation references in the issue. The proposal is to add a d3-shape curve that keeps Y a function of X, but the issue asks for ideas on deriving Bézier control points and does not identify files or tests. Done would mean implementing the curve and validating that it passes through the supplied points while keeping a single Y value for each X.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Issue was originally in d3-interpolate#49
I'm proposing the addition of a new type of curve for d3-shape — aptly called curveCubicX by @mbostock on the original thread — that treats the Y coordinate as a function of the X coordinate, such that for any X coordinate there's a single corresponding Y value.
In the image below, the proposed curveCubicX in comparison with curveNatural and curveBasis:
(the cubic curve is generated with a cubic spline interpolator through small line segments joining 1000 samples of <x, f(x)>)
The algorithm for the interpolator is described on Wikipedia (also of note is its talk page, which makes it apparent that the page suffered various incarnations of the algorithm, of various readability levels).
There are also some demos and implementations of the algorithm:
- http://blog.ivank.net/interpolation-with-cubic-splines.html
- https://github.com/morganherlocker/cubic-spline
- https://tools.timodenk.com/?p=cubic-spline-interpolation
However, these are all oriented towards finding the interpolator function, and any SVG paths are drawn with sampling the function, and I am severely out of my comfort zone in regards to obtaining the Bézier control points needed to draw the SVG path, so I'm hoping for some pointers or ideas on the matter...
As for the utility: I started with trying to recreate the Curves interface in Adobe Photoshop, which seems to be using such a cubic spline to interpolate the values. For data visualization, on the one hand it maintains Y being a function of X which makes sense in most types of charts, and the spline does pass through all the points, but on the other hand it tends to overshoot much more than other types of curves.
- Lingua principale
- JavaScript
- Stelle
- 2.5k
- Fork
- 307
- Merge medio
- 4h 16m
- PR unite (30g)
- 1
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di d3/d3-shape
-
Improve tree-shakingAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 38/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
mega-yfue/ha-eufy-sdk-bridge#198 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
blamechris/chroxy#9108 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Content:WebExt needs triage
Difficoltà 1/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
liberation-data/drivine#733 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno