d3-chord | Visualizations relationships or network flow | Data Visualization library
kandi X-RAY | d3-chord Summary
kandi X-RAY | d3-chord Summary
Visualize relationships or network flow with an aesthetically-pleasing circular layout.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- parses a chord
- Provides a binding between two arguments
- Compares two values .
- Default source source source
- Default target handler .
- The default radius object .
- Determine the default start angle for a danger
- Set the default end angle for a dangion
- The default pad type
- The default arhead base class .
d3-chord Key Features
d3-chord Examples and Code Snippets
Community Discussions
Trending Discussions on d3-chord
QUESTION
I am developing a D3.js chord diagram to visualize people flows between different areas of an airport. When clicking an an area's outer arch, only the chords running to that arch are shown. I am now getting to the fine touches of it and am lacking any clues on how to approach one design problem.
Here's the photoshop-made target I am aiming for:
I did find a solution for the problem of chords crossing each other (using this excellent blog post https://www.visualcinnamon.com/2016/06/orientation-gradient-d3-chord-diagram), but the problem I am now still having, is that adjacent chords still overlap:
This just looks really hideous and I would very much like to avoid this from happening, however I've got no clue on how to achieve this... Is this possible with d3.js? (I am currently using v3, as the "avoid chords from crossing" hack is customizing d3.js v3 source files). Otherwise, where might I be able to be customize d3 to change the shape of the chords?
Edit: I want to emphasize, that I have figured out the problem of chord ORDERING, this is already correct, the chords do not cross each other, but still overlap. Here is an illustration to clarify my problem:
jsfiddle: https://jsfiddle.net/t2g3je69/
...ANSWER
Answered 2020-Jan-09 at 13:20Okay, solved my problem. Thanks to JohanC's comment of this post: Change and transition dataset in chord diagram with D3, it lead me towards the right direction.
My problem was solely the shape of the curves which d3's chord path generator generated. Thus I went and changed the svg path generator so that it shapes the curves to my liking. The default d3 v3 path generator uses quadratic bezier curves for the chords, where the middle control point is put at the center of the chord diagram. I changed the generator function to use cubic bezier curves instead, where the middle control points are placed between the inner ring and the center. The greater the angle between start- and endpoint, the closer the control points are to the center of the diagram, on a quadratic scale (in case anyone wishes an illustration or more elaborate explanation, feel free to comment)
Before (using d3.svg.chord()):
After (using custom generator):
Code Important: This probably only works with d3.v3!
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install d3-chord
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page