Skip to content

Commit 14527ad

Browse files
committed
simple API speced
1 parent 6fd1731 commit 14527ad

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@ Interactively and programmatically add, edit, move and save SVG chart annotation
66

77
If you use NPM, `npm install d3-annotate`. Otherwise, download the [latest release](https://github.com/cmpolis/d3-annotate/releases/latest).
88

9-
## API Reference
9+
## API Reference (WIP)
1010

11-
(WIP)
11+
```js
12+
var annotation = d3.annoate()
13+
.key((d) => d.id) // if annotation will be applied to data selection
14+
.text((d) => `${d.name}: ${d.score}`)
15+
.show((d) => d.score > 100); // can be true, false or fn
16+
// TODO: .dx(), .dy(), .canWrite, .canMove, .canDelete
17+
18+
annotation.editMode(true); // enable controls, false by default
19+
20+
var bubbles = d3.selectAll('circle').data(teams, (d) => d.id);
21+
bubbles.enter().append('circle').....
22+
23+
bubbles.call(annotation());
24+
```

0 commit comments

Comments
 (0)