aboutsummaryrefslogtreecommitdiffstats
path: root/.yarn/patches/d3-graphviz-npm-5.3.0-e0eace978a.patch
diff options
context:
space:
mode:
Diffstat (limited to '.yarn/patches/d3-graphviz-npm-5.3.0-e0eace978a.patch')
-rw-r--r--.yarn/patches/d3-graphviz-npm-5.3.0-e0eace978a.patch95
1 files changed, 95 insertions, 0 deletions
diff --git a/.yarn/patches/d3-graphviz-npm-5.3.0-e0eace978a.patch b/.yarn/patches/d3-graphviz-npm-5.3.0-e0eace978a.patch
new file mode 100644
index 00000000..17df8108
--- /dev/null
+++ b/.yarn/patches/d3-graphviz-npm-5.3.0-e0eace978a.patch
@@ -0,0 +1,95 @@
1diff --git a/src/dot.js b/src/dot.js
2index 97a0a7dbd3892742fa2b9e6badd4214b06579c13..bac59df04900de140ddd024b5dfac4bc1ad9c572 100644
3--- a/src/dot.js
4+++ b/src/dot.js
5@@ -1,4 +1,3 @@
6-import { Graphviz } from "@hpcc-js/wasm/graphviz";
7 import * as d3 from "d3-selection";
8 import {extractAllElementsData, extractElementData, createElementWithAttributes} from "./element.js";
9 import {convertToPathData} from "./svg.js";
10@@ -8,31 +7,6 @@ import {getEdgeTitle} from "./data.js";
11
12
13 export function initViz() {
14-
15- // force JIT compilation of @hpcc-js/wasm
16- try {
17- Graphviz.load().then(graphviz => {
18- graphviz.layout("", "svg", "dot");
19- this.layoutSync = graphviz.layout.bind(graphviz);
20- if (this._worker == null) {
21- this._dispatch.call("initEnd", this);
22- }
23- if (this._afterInit) {
24- this._afterInit();
25- }
26- });
27-// after the port to ESM modules, we don't know how to trigger this so
28-// we just disable it from coverage
29-/* c8 ignore start */
30- } catch(error) {
31- // we end up here when the the script tag type used to load
32- // the "@hpcc-js/wasm" script is not "application/javascript"
33- // or "text/javascript", but typically "javascript/worker". In
34- // this case the browser does not load the script since it's
35- // unnecessary because it's loaded by the web worker
36- // instead. This is expected so we just ignore the error.
37- }
38-/* c8 ignore stop */
39 if (this._worker != null) {
40 var vizURL = this._vizURL;
41 var graphvizInstance = this;
42@@ -337,7 +311,8 @@ function layoutDone(svgDoc, callback) {
43
44 var newSvg = newDoc
45 .select('svg');
46-
47+
48+ this._dispatch.call('postProcessSVG', this, newSvg);
49 var data = extractAllElementsData(newSvg);
50 this._dispatch.call('dataExtractEnd', this);
51 postProcessDataPass1Local(data);
52diff --git a/src/element.js b/src/element.js
53index 5aa398a6cf2550e15f642aea4eaa5a1c69af69ad..5d799e38566e8f847aa1ba80f4c575911e9851cf 100644
54--- a/src/element.js
55+++ b/src/element.js
56@@ -108,6 +108,8 @@ export function createElement(data) {
57 return document.createTextNode("");
58 } else if (data.tag == '#comment') {
59 return document.createComment(data.comment);
60+ } else if (data.tag == 'div' || data.tag == 'DIV') {
61+ return document.createElement('div');
62 } else {
63 return document.createElementNS('http://www.w3.org/2000/svg', data.tag);
64 }
65diff --git a/src/graphviz.js b/src/graphviz.js
66index c4638cb0e4042844c59c52dfe4749e13999fef6e..28dcfb71ad787c78645c460a29e9c52295c5f6bf 100644
67--- a/src/graphviz.js
68+++ b/src/graphviz.js
69@@ -49,7 +49,6 @@ import {drawnNodeSelection} from "./drawNode.js";
70 import {workerCode} from "./workerCode.js";
71 import {sharedWorkerCode} from "./workerCode.js";
72 import {workerCodeBody} from "./workerCode.js";
73-import {Graphviz as hpccWasmGraphviz} from "@hpcc-js/wasm/graphviz";
74
75 export function Graphviz(selection, options) {
76 this._options = {
77@@ -119,10 +118,6 @@ export function Graphviz(selection, options) {
78 this._workerPort = this._worker;
79 this._workerPortClose = this._worker.terminate.bind(this._worker);
80 this._workerCallbacks = [];
81- } else {
82- hpccWasmGraphviz.load().then(((graphviz) => {
83- this._graphvizVersion = graphviz.version();
84- }).bind(this));
85 }
86 this._selection = selection;
87 this._active = false;
88@@ -143,6 +138,7 @@ export function Graphviz(selection, options) {
89 'start',
90 'layoutStart',
91 'layoutEnd',
92+ 'postProcessSVG',
93 'dataExtractEnd',
94 'dataProcessPass1End',
95 'dataProcessPass2End',