Skip to content

Commit

Permalink
feat(drag) add module for d3-drag handling of graph nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
akollegger committed Jan 26, 2021
1 parent f6f773c commit 85d75c9
Show file tree
Hide file tree
Showing 39 changed files with 1,471 additions and 2,687 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ready to be used in a `d3-force` simulation.

``` TypeScript
import * as d3 from "d3";
import {parse, layout, draw, moveNodes, moveLinks} from 'd3-gram';
import {parse, layout, draw, drag, updateNodes, updateLinks} from 'd3-gram';

d3.text("https://raw.githubusercontent.com/gram-data/d3-gram/master/public/miserables.gram").then( gramSource => {

Expand All @@ -17,9 +17,11 @@ d3.text("https://raw.githubusercontent.com/gram-data/d3-gram/master/public/miser

const {nodeSelection, linkSelection} = draw(graph, "svg");

nodeSelection.call(drag(simulation));

simulation.on("tick", () => {
moveNodes(nodeSelection);
moveLinks(linkSelection);
updateNodes(nodeSelection);
updateLinks(linkSelection);
});
}
```
1 change: 0 additions & 1 deletion docs/.env

This file was deleted.

1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
_site
.env

0 comments on commit 85d75c9

Please sign in to comment.