Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/1wheel/swoopy-drag
Artisanal label placement for d3 graphics
https://github.com/1wheel/swoopy-drag
Last synced: 2 days ago
JSON representation
Artisanal label placement for d3 graphics
- Host: GitHub
- URL: https://github.com/1wheel/swoopy-drag
- Owner: 1wheel
- License: mit
- Created: 2016-03-04T19:24:36.000Z (almost 9 years ago)
- Default Branch: gh-pages
- Last Pushed: 2018-07-05T03:05:09.000Z (over 6 years ago)
- Last Synced: 2024-12-04T07:38:03.095Z (8 days ago)
- Language: HTML
- Homepage: http://1wheel.github.io/swoopy-drag/
- Size: 199 KB
- Stars: 120
- Watchers: 4
- Forks: 13
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-d3 - swoopy-drag - Artisanal label placement for d3 graphics (Utils)
- awesome-d3 - swoopy-drag - Artisanal label placement for d3 graphics (Utils)
- awesome-d3 - swoopy-drag - Artisanal label placement for d3 graphics (Utils)
- awesome-starred - 1wheel/swoopy-drag - Artisanal label placement for d3 graphics (others)
README
# swoopyDrag
> The annotation layer is the most important thing we do
*- Amanda Cox -*
### [Demo/Documentation](http://1wheel.github.io/swoopy-drag/)
### API Reference
#### d3.swoopyDrag()
Creates a new `swoopyDrag`.
#### swoopyDrag.x([function])
Function called on each annotation object to determine its `x` position.
#### swoopyDrag.y([function])
Function called on each annotation object to determine its `y` position.
#### swoopyDraw.draggable([boolean])
Boolean. Pass true while adjusting annotations to enable dragging and add control points to paths.
#### swoopyDrag.annotations([array])
Array of objects representing annotations. The `path` in each annotations will have its `d` attribute set to the `path` property. The `text` element will contain the `text` property and be translated by `textOffset`.
#### swoopyDrag.on('drag', [function])
Called as the labels or paths are dragged.