MCPcopy Create free account
hub / github.com/SeaOfNodes/Simple / dot

Function dot

chapter18/docs/d3-graphviz.js:967–998  ·  view source on GitHub ↗
(src, callback)

Source from the content-addressed store, hash-verified

965 }
966 }
967 function dot (src, callback) {
968 var graphvizInstance = this;
969 this._worker;
970 var engine = this._options.engine;
971 var images = this._images;
972 this._dispatch.call("start", this);
973 this._busy = true;
974 this._dispatch.call("layoutStart", this);
975 var vizOptions = {
976 images: images
977 };
978 if (!this._worker && this.layoutSync == null) {
979 this._afterInit = this.dot.bind(this, src, callback);
980 return this;
981 }
982 this.layout(src, engine, vizOptions, function (data) {
983 switch (data.type) {
984 case "error":
985 if (graphvizInstance._onerror) {
986 graphvizInstance._onerror(data.error);
987 } else {
988 throw data.error.message;
989 }
990 break;
991 case "done":
992 var svgDoc = data.svg;
993 layoutDone.call(this, svgDoc, callback);
994 break;
995 }
996 });
997 return this;
998 }
999 function layoutDone(svgDoc, callback) {
1000 var keyMode = this._options.keyMode;
1001 var tweenPaths = this._options.tweenPaths;

Callers

nothing calls this directly

Calls 2

callMethod · 0.45
layoutMethod · 0.45

Tested by

no test coverage detected