UNPKG

d3-graphviz

Version:

Graphviz DOT rendering and animated transitions for D3

18 lines (15 loc) 455 B
import {Graphviz} from "../graphviz.js"; import {timeout} from "d3-timer"; export default function(options) { var g = this.node().__graphviz__; if (g) { g.options(options); // Ensure a possible new initEnd event handler is attached before calling it timeout(function () { g._dispatch.call("initEnd", this); }.bind(this), 0); } else { g = new Graphviz(this, options); } return g; }