This demo lets you interactively try various settings and combinations of forces for d3-force.
It's based on Mike Bostock's example code for a force directed graph.
Using version d3.v4
: vanilla-js
.
In order to get the demo working properly, I had to make the following changes.
Added the following
main.js
export { forceProperties, updateAll };
index.html
<script src="https://d3js.org/d3.v4.min.js"></script>
<script type="module" src="/main.js"></script>
<script type="module">
import { forceProperties, updateAll } from "./main.js";
window.forceProperties = forceProperties;
window.updateAll = updateAll;
</script>