Collide force doesn't handle identical initial positions well
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 20/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript
- Ambito
- data-visualization
Direzione di ricerca
Read the collision force and initial-positioning code in d3-force to understand how coincident nodes are handled and how the default phyllotaxis arrangement works. Reproduce the reported behavior with nodes sharing the same x and y values, then compare the simulation with and without seeded jitter. Done means the collision force separates identical initial positions without requiring many extra ticks.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I'm working on a fixed force layout with collision and X and Y positioning. It's being rendered by React, and so I'm trying to optimize and speed up the force layout to reduce the expense of the simulation as my component may be resized, panned, and thus rerendered/resimulated quite often.
I found that initializing the node positions with the x and y properties greatly reduces the number of ticks needed to get the layout looking the way I want it. But it also causes some problems where the initial position is the same for several points, as in this map where I'm trying to cluster points around polygon centroids.

With another 40-50 ticks, it will settle down into something like this which is what I expect. (Possibly just due to floating point error?)

I can get the same effect with a shorter simulation by applying a deterministic (seeded) random jitter to the initial positions, but I thought it would be nice if D3 could handle this itself similar to the way the phyllotaxis arrangement around 0,0 does this for the default initial positions.
- Lingua principale
- JavaScript
- Stelle
- 2k
- Fork
- 395
- Merge medio
- 5h 46m
- 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-force
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 18/100
-
`README` links to deprecated notebookForse già presa @hirehamir l’ha presa 1200 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 20/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
Issue simili
-
maintenance
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
assistant-ui/assistant-ui#10496 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
ai bug design good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
neomjs/neo-agent-institution#927 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
gramps-project/gramps-web#1671 ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue priority: P2 status: ready
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
RhinoLink-Tech/data-fabric#502 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
cline/mcp-marketplace#3708 ·