@krainovsd/graph 0.14.0-beta.8 → 0.15.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.cjs +845 -375
- package/lib/cjs/index.cjs.map +1 -1
- package/lib/esm/constants/force-controls.js +6 -4
- package/lib/esm/constants/force-controls.js.map +1 -1
- package/lib/esm/constants/highlight-controls.js +6 -3
- package/lib/esm/constants/highlight-controls.js.map +1 -1
- package/lib/esm/constants/link-controls.js +6 -3
- package/lib/esm/constants/link-controls.js.map +1 -1
- package/lib/esm/constants/node-controls.js +6 -3
- package/lib/esm/constants/node-controls.js.map +1 -1
- package/lib/esm/index.js +8 -6
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/module/GraphCanvas/GraphCanvas.js +40 -17
- package/lib/esm/module/GraphCanvas/GraphCanvas.js.map +1 -1
- package/lib/esm/module/GraphCanvas/StaticGraphCanvas.js +127 -0
- package/lib/esm/module/GraphCanvas/StaticGraphCanvas.js.map +1 -0
- package/lib/esm/module/GraphCanvas/constants/graph-settings.js +6 -7
- package/lib/esm/module/GraphCanvas/constants/graph-settings.js.map +1 -1
- package/lib/esm/module/GraphCanvas/constants/highlight-settings.js +1 -4
- package/lib/esm/module/GraphCanvas/constants/highlight-settings.js.map +1 -1
- package/lib/esm/module/GraphCanvas/constants/index.js +6 -4
- package/lib/esm/module/GraphCanvas/constants/index.js.map +1 -1
- package/lib/esm/module/GraphCanvas/constants/link-settings.js +1 -9
- package/lib/esm/module/GraphCanvas/constants/link-settings.js.map +1 -1
- package/lib/esm/module/GraphCanvas/constants/node-settings.js +1 -10
- package/lib/esm/module/GraphCanvas/constants/node-settings.js.map +1 -1
- package/lib/esm/module/GraphCanvas/lib/settings/force-settings-getter.js +6 -4
- package/lib/esm/module/GraphCanvas/lib/settings/force-settings-getter.js.map +1 -1
- package/lib/esm/module/GraphCanvas/lib/settings/graph-settings-getter.js +0 -3
- package/lib/esm/module/GraphCanvas/lib/settings/graph-settings-getter.js.map +1 -1
- package/lib/esm/module/GraphCanvas/lib/settings/highlight-settings-getter.js +6 -3
- package/lib/esm/module/GraphCanvas/lib/settings/highlight-settings-getter.js.map +1 -1
- package/lib/esm/module/GraphCanvas/lib/settings/link-settings-getter.js +6 -3
- package/lib/esm/module/GraphCanvas/lib/settings/link-settings-getter.js.map +1 -1
- package/lib/esm/module/GraphCanvas/lib/settings/node-settings-getter.js +20 -6
- package/lib/esm/module/GraphCanvas/lib/settings/node-settings-getter.js.map +1 -1
- package/lib/esm/module/GraphCanvas/lib/utils/calculate-curve-link-position-by-node.js +6 -4
- package/lib/esm/module/GraphCanvas/lib/utils/calculate-curve-link-position-by-node.js.map +1 -1
- package/lib/esm/module/GraphCanvas/lib/utils/calculate-link-position-by-node.js +6 -4
- package/lib/esm/module/GraphCanvas/lib/utils/calculate-link-position-by-node.js.map +1 -1
- package/lib/esm/module/GraphCanvas/lib/utils/get-particle-position.js +1 -1
- package/lib/esm/module/GraphCanvas/lib/utils/get-particle-position.js.map +1 -1
- package/lib/esm/module/GraphCanvas/lib/utils/is-node-visible.js +25 -27
- package/lib/esm/module/GraphCanvas/lib/utils/is-node-visible.js.map +1 -1
- package/lib/esm/module/GraphCanvas/lib/utils/is-overlaps-node.js.map +1 -1
- package/lib/esm/module/GraphCanvas/lib/utils/node-by-pointer-getter.js +2 -1
- package/lib/esm/module/GraphCanvas/lib/utils/node-by-pointer-getter.js.map +1 -1
- package/lib/esm/module/GraphCanvas/lib/utils/node-highlight.js +7 -11
- package/lib/esm/module/GraphCanvas/lib/utils/node-highlight.js.map +1 -1
- package/lib/esm/module/GraphCanvas/lib/utils/node-iteration-extractor.js +3 -0
- package/lib/esm/module/GraphCanvas/lib/utils/node-iteration-extractor.js.map +1 -1
- package/lib/esm/module/GraphCanvas/lib/utils/precompute-graph.js +24 -0
- package/lib/esm/module/GraphCanvas/lib/utils/precompute-graph.js.map +1 -0
- package/lib/esm/module/GraphCanvas/lib/utils/prepare-graph-data.js +49 -0
- package/lib/esm/module/GraphCanvas/lib/utils/prepare-graph-data.js.map +1 -0
- package/lib/esm/module/GraphCanvas/lib/utils/svg-context.js +159 -0
- package/lib/esm/module/GraphCanvas/lib/utils/svg-context.js.map +1 -0
- package/lib/esm/module/GraphCanvas/slices/draw-links.js +24 -42
- package/lib/esm/module/GraphCanvas/slices/draw-links.js.map +1 -1
- package/lib/esm/module/GraphCanvas/slices/draw-nodes.js +80 -168
- package/lib/esm/module/GraphCanvas/slices/draw-nodes.js.map +1 -1
- package/lib/esm/module/GraphCanvas/slices/draw-text.js +1 -9
- package/lib/esm/module/GraphCanvas/slices/draw-text.js.map +1 -1
- package/lib/esm/module/GraphCanvas/slices/export-svg.js +62 -0
- package/lib/esm/module/GraphCanvas/slices/export-svg.js.map +1 -0
- package/lib/esm/module/GraphCanvas/slices/init-dnd.js +15 -3
- package/lib/esm/module/GraphCanvas/slices/init-dnd.js.map +1 -1
- package/lib/esm/module/GraphCanvas/slices/init-draw.js +212 -8
- package/lib/esm/module/GraphCanvas/slices/init-draw.js.map +1 -1
- package/lib/esm/module/GraphCanvas/slices/init-pointer.js +6 -8
- package/lib/esm/module/GraphCanvas/slices/init-pointer.js.map +1 -1
- package/lib/esm/module/GraphCanvas/slices/init-simulation.js +3 -4
- package/lib/esm/module/GraphCanvas/slices/init-simulation.js.map +1 -1
- package/lib/esm/module/GraphCanvas/slices/init-zoom.js +2 -4
- package/lib/esm/module/GraphCanvas/slices/init-zoom.js.map +1 -1
- package/lib/esm/module/GraphCanvas/slices/update-link-cache.js +5 -5
- package/lib/esm/module/GraphCanvas/slices/update-node-cache.js +17 -29
- package/lib/esm/module/GraphCanvas/slices/update-node-cache.js.map +1 -1
- package/lib/index.d.ts +95 -43
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"precompute-graph.js","sources":["../../../../../../src/module/GraphCanvas/lib/utils/precompute-graph.ts"],"sourcesContent":["import { GraphCanvas } from \"../../GraphCanvas\";\nimport type {\n ForceSettingsInterface,\n LinkInterface,\n LinkSettingsInterface,\n NodeInterface,\n NodeSettingsInterface,\n} from \"../../types\";\n\ntype PrecomputeGraphOptions<\n NodeData extends Record<string, unknown>,\n LinkData extends Record<string, unknown>,\n> = {\n nodes: NodeInterface<NodeData>[];\n links: LinkInterface<NodeData, LinkData>[];\n forceSettings?: ForceSettingsInterface<NodeData, LinkData>;\n nodeSettings?: NodeSettingsInterface<NodeData, LinkData>;\n linkSettings?: LinkSettingsInterface<NodeData, LinkData>;\n maxMs?: number;\n};\nexport function precomputeGraph<\n NodeData extends Record<string, unknown>,\n LinkData extends Record<string, unknown>,\n>(opts: PrecomputeGraphOptions<NodeData, LinkData>) {\n const div = document.createElement(\"div\");\n const graph = new GraphCanvas({\n root: div,\n nodes: opts.nodes,\n links: opts.links,\n nodeSettings: opts.nodeSettings,\n linkSettings: opts.linkSettings,\n forceSettings: {\n ...opts.forceSettings,\n precompute: true,\n precomputeDisableForcesAfter: true,\n precomputeMaxTicks: Infinity,\n precomputeMaxTimeMs: opts.maxMs ?? Infinity,\n },\n });\n graph.precompute();\n graph.destroy();\n}\n"],"names":[],"mappings":";;AAoBM,SAAU,eAAe,CAG7B,IAAgD,EAAA;IAChD,MAAM,GAAG,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC;AACzC,IAAA,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC;AAC5B,QAAA,IAAI,EAAE,GAAG;QACT,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,YAAY,EAAE,IAAI,CAAC,YAAY;AAC/B,QAAA,aAAa,EAAE;YACb,GAAG,IAAI,CAAC,aAAa;AACrB,YAAA,UAAU,EAAE,IAAI;AAChB,YAAA,4BAA4B,EAAE,IAAI;AAClC,YAAA,kBAAkB,EAAE,QAAQ;AAC5B,YAAA,mBAAmB,EAAE,IAAI,CAAC,KAAK,IAAI,QAAQ;AAC5C,SAAA;AACF,KAAA,CAAC;IACF,KAAK,CAAC,UAAU,EAAE;IAClB,KAAK,CAAC,OAAO,EAAE;AACjB;;;;"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { extractLinkPointIds } from './extract-link-point-ids.js';
|
|
2
|
+
|
|
3
|
+
function prepareGraph(opts) {
|
|
4
|
+
const nodes = opts.nodes;
|
|
5
|
+
const links = opts.links;
|
|
6
|
+
const map = new Map();
|
|
7
|
+
const neighbors = new Map();
|
|
8
|
+
for (let i = 0; i < links.length; i++) {
|
|
9
|
+
const link = links[i];
|
|
10
|
+
const { sourceId, targetId } = extractLinkPointIds(link);
|
|
11
|
+
const sources = neighbors.get(sourceId);
|
|
12
|
+
if (sources) {
|
|
13
|
+
sources.push(targetId);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
neighbors.set(sourceId, [targetId]);
|
|
17
|
+
}
|
|
18
|
+
const targets = neighbors.get(targetId);
|
|
19
|
+
if (targets) {
|
|
20
|
+
targets.push(sourceId);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
neighbors.set(targetId, [sourceId]);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
27
|
+
const node = nodes[i];
|
|
28
|
+
map.set(node.id, node);
|
|
29
|
+
node.index = i;
|
|
30
|
+
node.x ??= 0;
|
|
31
|
+
node.y ??= 0;
|
|
32
|
+
if (opts.neighbors) {
|
|
33
|
+
const n = neighbors.get(node.id);
|
|
34
|
+
if (n) {
|
|
35
|
+
node.neighbors = [...new Set(n)];
|
|
36
|
+
node.linkCount = node.neighbors.length;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
for (let i = 0; i < links.length; i++) {
|
|
41
|
+
const link = links[i];
|
|
42
|
+
const { sourceId, targetId } = extractLinkPointIds(link);
|
|
43
|
+
link.source = map.get(sourceId) ?? link.source;
|
|
44
|
+
link.target = map.get(targetId) ?? link.target;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { prepareGraph };
|
|
49
|
+
//# sourceMappingURL=prepare-graph-data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepare-graph-data.js","sources":["../../../../../../src/module/GraphCanvas/lib/utils/prepare-graph-data.ts"],"sourcesContent":["import type { LinkInterface, NodeInterface } from \"../../types\";\nimport { extractLinkPointIds } from \"./extract-link-point-ids\";\n\ntype PrepareGraphOptions<\n NodeData extends Record<string, unknown>,\n LinkData extends Record<string, unknown>,\n> = {\n nodes: NodeInterface<NodeData>[];\n links: LinkInterface<NodeData, LinkData>[];\n neighbors?: boolean;\n};\nexport function prepareGraph<\n NodeData extends Record<string, unknown>,\n LinkData extends Record<string, unknown>,\n>(opts: PrepareGraphOptions<NodeData, LinkData>) {\n const nodes = opts.nodes;\n const links = opts.links;\n const map = new Map<string | number, NodeInterface<NodeData>>();\n const neighbors = new Map<string | number, (string | number)[]>();\n\n for (let i = 0; i < links.length; i++) {\n const link = links[i];\n const { sourceId, targetId } = extractLinkPointIds(link);\n const sources = neighbors.get(sourceId);\n if (sources) {\n sources.push(targetId);\n } else {\n neighbors.set(sourceId, [targetId]);\n }\n const targets = neighbors.get(targetId);\n if (targets) {\n targets.push(sourceId);\n } else {\n neighbors.set(targetId, [sourceId]);\n }\n }\n\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n map.set(node.id, node);\n node.index = i;\n node.x ??= 0;\n node.y ??= 0;\n if (opts.neighbors) {\n const n = neighbors.get(node.id);\n if (n) {\n node.neighbors = [...new Set(n)];\n node.linkCount = node.neighbors.length;\n }\n }\n }\n\n for (let i = 0; i < links.length; i++) {\n const link = links[i];\n const { sourceId, targetId } = extractLinkPointIds(link);\n link.source = map.get(sourceId) ?? link.source;\n link.target = map.get(targetId) ?? link.target;\n }\n}\n"],"names":[],"mappings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AAK,CAAC;AACZ,QAAA,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,MAAM,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,IAAI,CAAC,EAAE;gBACL,IAAI,CAAC,SAAS,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;gBAChC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM;;;;AAK5C,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACrC,QAAA,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC;QACrB,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,mBAAmB,CAAC,IAAI,CAAC;AACxD,QAAA,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,MAAM;AAC9C,QAAA,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,MAAM;;AAElD;;;;"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
function escapeXml(s) {
|
|
2
|
+
return s
|
|
3
|
+
.replace(/&/g, "&")
|
|
4
|
+
.replace(/</g, "<")
|
|
5
|
+
.replace(/>/g, ">")
|
|
6
|
+
.replace(/"/g, """);
|
|
7
|
+
}
|
|
8
|
+
class SvgContextAdapter {
|
|
9
|
+
parts;
|
|
10
|
+
globalAlpha = 1;
|
|
11
|
+
fillStyle = "black";
|
|
12
|
+
strokeStyle = "black";
|
|
13
|
+
lineWidth = 1;
|
|
14
|
+
textAlign = "start";
|
|
15
|
+
_font = "normal normal 400 12px sans-serif";
|
|
16
|
+
fontFamily = "sans-serif";
|
|
17
|
+
fontSize = 12;
|
|
18
|
+
fontWeight = 400;
|
|
19
|
+
fontStyle = "normal";
|
|
20
|
+
stateStack = [];
|
|
21
|
+
currentPath = [];
|
|
22
|
+
hasPath = false;
|
|
23
|
+
transformX = 0;
|
|
24
|
+
transformY = 0;
|
|
25
|
+
transformK = 1;
|
|
26
|
+
constructor(parts) {
|
|
27
|
+
this.parts = parts;
|
|
28
|
+
}
|
|
29
|
+
set font(value) {
|
|
30
|
+
this._font = value;
|
|
31
|
+
const p = value.trim().split(/\s+/);
|
|
32
|
+
if (p.length >= 5) {
|
|
33
|
+
this.fontStyle = p[0];
|
|
34
|
+
this.fontWeight = parseInt(p[2], 10) || 400;
|
|
35
|
+
this.fontSize = parseFloat(p[3]) || 12;
|
|
36
|
+
this.fontFamily = p.slice(4).join(" ");
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
get font() {
|
|
40
|
+
return this._font;
|
|
41
|
+
}
|
|
42
|
+
save() {
|
|
43
|
+
this.stateStack.push({
|
|
44
|
+
globalAlpha: this.globalAlpha,
|
|
45
|
+
fillStyle: this.fillStyle,
|
|
46
|
+
strokeStyle: this.strokeStyle,
|
|
47
|
+
lineWidth: this.lineWidth,
|
|
48
|
+
font: this._font,
|
|
49
|
+
fontFamily: this.fontFamily,
|
|
50
|
+
fontSize: this.fontSize,
|
|
51
|
+
fontWeight: this.fontWeight,
|
|
52
|
+
fontStyle: this.fontStyle,
|
|
53
|
+
textAlign: this.textAlign,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
restore() {
|
|
57
|
+
const state = this.stateStack.pop();
|
|
58
|
+
if (state) {
|
|
59
|
+
this.globalAlpha = state.globalAlpha;
|
|
60
|
+
this.fillStyle = state.fillStyle;
|
|
61
|
+
this.strokeStyle = state.strokeStyle;
|
|
62
|
+
this.lineWidth = state.lineWidth;
|
|
63
|
+
this._font = state.font;
|
|
64
|
+
this.fontFamily = state.fontFamily;
|
|
65
|
+
this.fontSize = state.fontSize;
|
|
66
|
+
this.fontWeight = state.fontWeight;
|
|
67
|
+
this.fontStyle = state.fontStyle;
|
|
68
|
+
this.textAlign = state.textAlign;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
beginPath() {
|
|
72
|
+
this.currentPath = [];
|
|
73
|
+
this.hasPath = false;
|
|
74
|
+
}
|
|
75
|
+
closePath() {
|
|
76
|
+
this.currentPath.push("Z");
|
|
77
|
+
}
|
|
78
|
+
moveTo(x, y) {
|
|
79
|
+
this.hasPath = true;
|
|
80
|
+
this.currentPath.push(`M${x},${y}`);
|
|
81
|
+
}
|
|
82
|
+
lineTo(x, y) {
|
|
83
|
+
this.hasPath = true;
|
|
84
|
+
this.currentPath.push(`L${x},${y}`);
|
|
85
|
+
}
|
|
86
|
+
arc(cx, cy, radius, startAngle, endAngle) {
|
|
87
|
+
this.hasPath = true;
|
|
88
|
+
if (endAngle - startAngle >= 2 * Math.PI - 0.01) {
|
|
89
|
+
const x1 = cx - radius;
|
|
90
|
+
const x2 = cx + radius;
|
|
91
|
+
this.currentPath.push(`M${x1},${cy} A${radius},${radius} 0 1,1 ${x2},${cy} A${radius},${radius} 0 1,1 ${x1},${cy}`);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
const sx = cx + radius * Math.cos(startAngle);
|
|
95
|
+
const sy = cy + radius * Math.sin(startAngle);
|
|
96
|
+
const ex = cx + radius * Math.cos(endAngle);
|
|
97
|
+
const ey = cy + radius * Math.sin(endAngle);
|
|
98
|
+
this.currentPath.push(`M${sx},${sy} A${radius},${radius} 0 0,1 ${ex},${ey}`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
quadraticCurveTo(cpx, cpy, x, y) {
|
|
102
|
+
this.hasPath = true;
|
|
103
|
+
this.currentPath.push(`Q${cpx},${cpy} ${x},${y}`);
|
|
104
|
+
}
|
|
105
|
+
roundRect(x, y, w, h, radii) {
|
|
106
|
+
this.hasPath = true;
|
|
107
|
+
const r = typeof radii === "number" ? radii : (radii[0] ?? 0);
|
|
108
|
+
if (r < 0.001) {
|
|
109
|
+
this.currentPath.push(`M${x},${y} L${x + w},${y} L${x + w},${y + h} L${x},${y + h} Z`);
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
this.currentPath.push(`M${x + r},${y} L${x + w - r},${y} A${r},${r} 0 0,1 ${x + w},${y + r} L${x + w},${y + h - r} A${r},${r} 0 0,1 ${x + w - r},${y + h} L${x + r},${y + h} A${r},${r} 0 0,1 ${x},${y + h - r} L${x},${y + r} A${r},${r} 0 0,1 ${x + r},${y} Z`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
rect(x, y, w, h) {
|
|
116
|
+
this.hasPath = true;
|
|
117
|
+
this.currentPath.push(`M${x},${y} L${x + w},${y} L${x + w},${y + h} L${x},${y + h} Z`);
|
|
118
|
+
}
|
|
119
|
+
fill() {
|
|
120
|
+
if (!this.hasPath)
|
|
121
|
+
return;
|
|
122
|
+
const d = this.currentPath.join(" ");
|
|
123
|
+
this.parts.push(`<path d="${d}" fill="${this.fillStyle}" stroke="none" opacity="${this.globalAlpha}" stroke-linejoin="round"/>`);
|
|
124
|
+
}
|
|
125
|
+
stroke() {
|
|
126
|
+
if (!this.hasPath)
|
|
127
|
+
return;
|
|
128
|
+
const d = this.currentPath.join(" ");
|
|
129
|
+
this.parts.push(`<path d="${d}" fill="none" stroke="${this.strokeStyle}" stroke-width="${this.lineWidth}" opacity="${this.globalAlpha}" stroke-linecap="round" stroke-linejoin="round"/>`);
|
|
130
|
+
}
|
|
131
|
+
fillText(text, x, y) {
|
|
132
|
+
const anchor = this.textAlign === "center" ? "middle" : this.textAlign === "right" ? "end" : "start";
|
|
133
|
+
this.parts.push(`<text x="${x}" y="${y}" font-family="${this.fontFamily}" font-size="${this.fontSize}" font-weight="${this.fontWeight}" font-style="${this.fontStyle}" fill="${this.fillStyle}" text-anchor="${anchor}" opacity="${this.globalAlpha}">${escapeXml(text)}</text>`);
|
|
134
|
+
}
|
|
135
|
+
fillRect(x, y, w, h) {
|
|
136
|
+
this.parts.push(`<rect x="${x}" y="${y}" width="${w}" height="${h}" fill="${this.fillStyle}" opacity="${this.globalAlpha}"/>`);
|
|
137
|
+
}
|
|
138
|
+
strokeRect(x, y, w, h) {
|
|
139
|
+
this.parts.push(`<rect x="${x}" y="${y}" width="${w}" height="${h}" fill="none" stroke="${this.strokeStyle}" stroke-width="${this.lineWidth}" opacity="${this.globalAlpha}"/>`);
|
|
140
|
+
}
|
|
141
|
+
clearRect() { }
|
|
142
|
+
translate(x, y) {
|
|
143
|
+
this.transformX = x;
|
|
144
|
+
this.transformY = y;
|
|
145
|
+
}
|
|
146
|
+
scale(k) {
|
|
147
|
+
this.transformK = k;
|
|
148
|
+
}
|
|
149
|
+
closeTransform() {
|
|
150
|
+
this.parts.unshift(`<g transform="translate(${this.transformX},${this.transformY}) scale(${this.transformK})">`);
|
|
151
|
+
this.parts.push("</g>");
|
|
152
|
+
}
|
|
153
|
+
setLineDash() { }
|
|
154
|
+
clip() { }
|
|
155
|
+
drawImage() { }
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export { SvgContextAdapter };
|
|
159
|
+
//# sourceMappingURL=svg-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg-context.js","sources":["../../../../../../src/module/GraphCanvas/lib/utils/svg-context.ts"],"sourcesContent":["type ContextState = {\n globalAlpha: number;\n fillStyle: string;\n strokeStyle: string;\n lineWidth: number;\n font: string;\n fontFamily: string;\n fontSize: number;\n fontWeight: number;\n fontStyle: string;\n textAlign: CanvasTextAlign;\n};\n\nfunction escapeXml(s: string): string {\n return s\n .replace(/&/g, \"&\")\n .replace(/</g, \"<\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\");\n}\n\nexport class SvgContextAdapter {\n parts: string[];\n\n globalAlpha: number = 1;\n fillStyle: string = \"black\";\n strokeStyle: string = \"black\";\n lineWidth: number = 1;\n textAlign: CanvasTextAlign = \"start\";\n\n private _font: string = \"normal normal 400 12px sans-serif\";\n private fontFamily: string = \"sans-serif\";\n private fontSize: number = 12;\n private fontWeight: number = 400;\n private fontStyle: string = \"normal\";\n\n private stateStack: ContextState[] = [];\n private currentPath: string[] = [];\n private hasPath = false;\n private transformX = 0;\n private transformY = 0;\n private transformK = 1;\n\n constructor(parts: string[]) {\n this.parts = parts;\n }\n\n set font(value: string) {\n this._font = value;\n const p = value.trim().split(/\\s+/);\n if (p.length >= 5) {\n this.fontStyle = p[0];\n this.fontWeight = parseInt(p[2], 10) || 400;\n this.fontSize = parseFloat(p[3]) || 12;\n this.fontFamily = p.slice(4).join(\" \");\n }\n }\n\n get font(): string {\n return this._font;\n }\n\n save() {\n this.stateStack.push({\n globalAlpha: this.globalAlpha,\n fillStyle: this.fillStyle,\n strokeStyle: this.strokeStyle,\n lineWidth: this.lineWidth,\n font: this._font,\n fontFamily: this.fontFamily,\n fontSize: this.fontSize,\n fontWeight: this.fontWeight,\n fontStyle: this.fontStyle,\n textAlign: this.textAlign,\n });\n }\n\n restore() {\n const state = this.stateStack.pop();\n if (state) {\n this.globalAlpha = state.globalAlpha;\n this.fillStyle = state.fillStyle;\n this.strokeStyle = state.strokeStyle;\n this.lineWidth = state.lineWidth;\n this._font = state.font;\n this.fontFamily = state.fontFamily;\n this.fontSize = state.fontSize;\n this.fontWeight = state.fontWeight;\n this.fontStyle = state.fontStyle;\n this.textAlign = state.textAlign;\n }\n }\n\n beginPath() {\n this.currentPath = [];\n this.hasPath = false;\n }\n\n closePath() {\n this.currentPath.push(\"Z\");\n }\n\n moveTo(x: number, y: number) {\n this.hasPath = true;\n this.currentPath.push(`M${x},${y}`);\n }\n\n lineTo(x: number, y: number) {\n this.hasPath = true;\n this.currentPath.push(`L${x},${y}`);\n }\n\n arc(cx: number, cy: number, radius: number, startAngle: number, endAngle: number) {\n this.hasPath = true;\n if (endAngle - startAngle >= 2 * Math.PI - 0.01) {\n const x1 = cx - radius;\n const x2 = cx + radius;\n this.currentPath.push(\n `M${x1},${cy} A${radius},${radius} 0 1,1 ${x2},${cy} A${radius},${radius} 0 1,1 ${x1},${cy}`,\n );\n } else {\n const sx = cx + radius * Math.cos(startAngle);\n const sy = cy + radius * Math.sin(startAngle);\n const ex = cx + radius * Math.cos(endAngle);\n const ey = cy + radius * Math.sin(endAngle);\n this.currentPath.push(`M${sx},${sy} A${radius},${radius} 0 0,1 ${ex},${ey}`);\n }\n }\n\n quadraticCurveTo(cpx: number, cpy: number, x: number, y: number) {\n this.hasPath = true;\n this.currentPath.push(`Q${cpx},${cpy} ${x},${y}`);\n }\n\n roundRect(x: number, y: number, w: number, h: number, radii: number | number[]) {\n this.hasPath = true;\n const r = typeof radii === \"number\" ? radii : (radii[0] ?? 0);\n if (r < 0.001) {\n this.currentPath.push(`M${x},${y} L${x + w},${y} L${x + w},${y + h} L${x},${y + h} Z`);\n } else {\n this.currentPath.push(\n `M${x + r},${y} L${x + w - r},${y} A${r},${r} 0 0,1 ${x + w},${y + r} L${x + w},${y + h - r} A${r},${r} 0 0,1 ${x + w - r},${y + h} L${x + r},${y + h} A${r},${r} 0 0,1 ${x},${y + h - r} L${x},${y + r} A${r},${r} 0 0,1 ${x + r},${y} Z`,\n );\n }\n }\n\n rect(x: number, y: number, w: number, h: number) {\n this.hasPath = true;\n this.currentPath.push(`M${x},${y} L${x + w},${y} L${x + w},${y + h} L${x},${y + h} Z`);\n }\n\n fill() {\n if (!this.hasPath) return;\n const d = this.currentPath.join(\" \");\n this.parts.push(\n `<path d=\"${d}\" fill=\"${this.fillStyle}\" stroke=\"none\" opacity=\"${this.globalAlpha}\" stroke-linejoin=\"round\"/>`,\n );\n }\n\n stroke() {\n if (!this.hasPath) return;\n const d = this.currentPath.join(\" \");\n this.parts.push(\n `<path d=\"${d}\" fill=\"none\" stroke=\"${this.strokeStyle}\" stroke-width=\"${this.lineWidth}\" opacity=\"${this.globalAlpha}\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>`,\n );\n }\n\n fillText(text: string, x: number, y: number) {\n const anchor =\n this.textAlign === \"center\" ? \"middle\" : this.textAlign === \"right\" ? \"end\" : \"start\";\n this.parts.push(\n `<text x=\"${x}\" y=\"${y}\" font-family=\"${this.fontFamily}\" font-size=\"${this.fontSize}\" font-weight=\"${this.fontWeight}\" font-style=\"${this.fontStyle}\" fill=\"${this.fillStyle}\" text-anchor=\"${anchor}\" opacity=\"${this.globalAlpha}\">${escapeXml(text)}</text>`,\n );\n }\n\n fillRect(x: number, y: number, w: number, h: number) {\n this.parts.push(\n `<rect x=\"${x}\" y=\"${y}\" width=\"${w}\" height=\"${h}\" fill=\"${this.fillStyle}\" opacity=\"${this.globalAlpha}\"/>`,\n );\n }\n\n strokeRect(x: number, y: number, w: number, h: number) {\n this.parts.push(\n `<rect x=\"${x}\" y=\"${y}\" width=\"${w}\" height=\"${h}\" fill=\"none\" stroke=\"${this.strokeStyle}\" stroke-width=\"${this.lineWidth}\" opacity=\"${this.globalAlpha}\"/>`,\n );\n }\n\n clearRect() {}\n\n translate(x: number, y: number) {\n this.transformX = x;\n this.transformY = y;\n }\n\n scale(k: number) {\n this.transformK = k;\n }\n\n closeTransform() {\n this.parts.unshift(\n `<g transform=\"translate(${this.transformX},${this.transformY}) scale(${this.transformK})\">`,\n );\n this.parts.push(\"</g>\");\n }\n\n setLineDash() {}\n\n clip() {}\n\n drawImage() {}\n}\n"],"names":[],"mappings":"AAaA,SAAS,SAAS,CAAC,CAAS,EAAA;AAC1B,IAAA,OAAO;AACJ,SAAA,OAAO,CAAC,IAAI,EAAE,OAAO;AACrB,SAAA,OAAO,CAAC,IAAI,EAAE,MAAM;AACpB,SAAA,OAAO,CAAC,IAAI,EAAE,MAAM;AACpB,SAAA,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;AAC5B;MAEa,iBAAiB,CAAA;AAC5B,IAAA,KAAK;IAEL,WAAW,GAAW,CAAC;IACvB,SAAS,GAAW,OAAO;IAC3B,WAAW,GAAW,OAAO;IAC7B,SAAS,GAAW,CAAC;IACrB,SAAS,GAAoB,OAAO;IAE5B,KAAK,GAAW,mCAAmC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AAW,CAAK,GAAA,CAAA,CAC9G;;AAGH,IAAA,UAAU,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS,EAAA;QACnD,IAAI,CAAC,KAAK,CAAC,IAAI,CACb,CAAY,SAAA,EAAA,CAAC,CAAQ,KAAA,EAAA,CAAC,CAAY,SAAA,EAAA,CAAC,CAAa,UAAA,EAAA,CAAC,CAAyB,sBAAA,EAAA,IAAI,CAAC,WAAW,CAAmB,gBAAA,EAAA,IAAI,CAAC,SAAS,CAAc,WAAA,EAAA,IAAI,CAAC,WAAW,CAAK,GAAA,CAAA,CAC/J;;AAGH,IAAA,SAAS;IAET,SAAS,CAAC,CAAS,EAAE,CAAS,EAAA;AAC5B,QAAA,IAAI,CAAC,UAAU,GAAG,CAAC;AACnB,QAAA,IAAI,CAAC,UAAU,GAAG,CAAC;;AAGrB,IAAA,KAAK,CAAC,CAAS,EAAA;AACb,QAAA,IAAI,CAAC,UAAU,GAAG,CAAC;;IAGrB,cAAc,GAAA;AACZ,QAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAChB,CAAA,wBAAA,EAA2B,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAW,QAAA,EAAA,IAAI,CAAC,UAAU,CAAA,GAAA,CAAK,CAC7F;AACD,QAAA,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC;;AAGzB,IAAA,WAAW;AAEX,IAAA,IAAI;AAEJ,IAAA,SAAS;AACV;;;;"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import '../constants/force-settings.js';
|
|
2
|
-
import '../constants/graph-settings.js';
|
|
3
|
-
import '../constants/highlight-settings.js';
|
|
4
|
-
import '../constants/link-settings.js';
|
|
5
|
-
import '../constants/node-settings.js';
|
|
6
2
|
import '@krainovsd/js-helpers';
|
|
7
3
|
import 'd3-array';
|
|
8
4
|
import { calculateLinkPositionByNode } from '../lib/utils/calculate-link-position-by-node.js';
|
|
9
5
|
import { getParticlePosition, approximateQuadraticBezierLength } from '../lib/utils/get-particle-position.js';
|
|
10
6
|
import { linkFade, linkHighlight } from '../lib/utils/link-highlight.js';
|
|
7
|
+
import 'd3-force';
|
|
8
|
+
import 'd3-selection';
|
|
9
|
+
import 'd3-zoom';
|
|
10
|
+
import 'd3-drag';
|
|
11
11
|
import { calculateCurveLinkPositionByNode } from '../lib/utils/calculate-curve-link-position-by-node.js';
|
|
12
12
|
|
|
13
|
-
function getDrawLink() {
|
|
13
|
+
function getDrawLink(linkBatch, particleBatch, arrowBatch, now) {
|
|
14
14
|
return function drawLink(link, index) {
|
|
15
15
|
if (!this.context ||
|
|
16
16
|
typeof link.source !== "object" ||
|
|
@@ -119,10 +119,9 @@ function getDrawLink() {
|
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
/** Link */
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
this.context.lineWidth = width;
|
|
122
|
+
const linkBatchKey = `${alpha}|${color}|${width}`;
|
|
123
|
+
linkBatch[linkBatchKey] ??= [];
|
|
124
|
+
const linkGroup = linkBatch[linkBatchKey];
|
|
126
125
|
let xStart = link.source.x;
|
|
127
126
|
let yStart = link.source.y;
|
|
128
127
|
let xEnd = link.target.x;
|
|
@@ -152,9 +151,7 @@ function getDrawLink() {
|
|
|
152
151
|
link._y2 = yEnd;
|
|
153
152
|
link._ax = xEndArrow;
|
|
154
153
|
link._ay = yEndArrow;
|
|
155
|
-
|
|
156
|
-
this.context.lineTo(xEnd, yEnd);
|
|
157
|
-
this.context.stroke();
|
|
154
|
+
linkGroup.push({ curve: false, xStart, yStart, xEnd, yEnd, xControl, yControl });
|
|
158
155
|
}
|
|
159
156
|
else {
|
|
160
157
|
const position = calculateCurveLinkPositionByNode(xStart, yStart, xEnd, yEnd, link.source, link.target, link._groupIndex ?? 0, isHasArrow ? arrowSize : 0);
|
|
@@ -175,14 +172,7 @@ function getDrawLink() {
|
|
|
175
172
|
link._ax = position.xEndArrow;
|
|
176
173
|
link._ay = position.yEndArrow;
|
|
177
174
|
linkDistance = approximateQuadraticBezierLength(position.xStart, position.yStart, position.xControl, position.yControl, position.xEnd, position.yEnd);
|
|
178
|
-
|
|
179
|
-
this.context.moveTo(position.xStart, position.yStart);
|
|
180
|
-
this.context.quadraticCurveTo(position.xControl, position.yControl, position.xEnd, position.yEnd);
|
|
181
|
-
this.context.setLineDash([]);
|
|
182
|
-
// if (isDashed) {
|
|
183
|
-
// this.context.setLineDash([10, 5]);
|
|
184
|
-
// }
|
|
185
|
-
this.context.stroke();
|
|
175
|
+
linkGroup.push({ curve: true, xStart, yStart, xEnd, yEnd, xControl, yControl });
|
|
186
176
|
}
|
|
187
177
|
/** Particle */
|
|
188
178
|
if (this.linkSettings.particles && (currentLinkHighlighted || currentNodeHighlighted)) {
|
|
@@ -198,6 +188,9 @@ function getDrawLink() {
|
|
|
198
188
|
}
|
|
199
189
|
this.particles[index] = particles;
|
|
200
190
|
}
|
|
191
|
+
const particleBatchKey = `${linkOptions.particleBorderColor}|${linkOptions.particleBorderWidth}|${linkOptions.particleColor}`;
|
|
192
|
+
particleBatch[particleBatchKey] ??= [];
|
|
193
|
+
const particleGroup = particleBatch[particleBatchKey];
|
|
201
194
|
this.particles[index].forEach((particle, _, particles) => {
|
|
202
195
|
if (!this.context)
|
|
203
196
|
return;
|
|
@@ -212,17 +205,10 @@ function getDrawLink() {
|
|
|
212
205
|
xControl,
|
|
213
206
|
yControl,
|
|
214
207
|
speed,
|
|
208
|
+
now,
|
|
215
209
|
});
|
|
216
210
|
if (particle.x != undefined && particle.y != undefined) {
|
|
217
|
-
|
|
218
|
-
this.context.strokeStyle = linkOptions.particleBorderColor;
|
|
219
|
-
this.context.lineWidth = linkOptions.particleBorderWidth;
|
|
220
|
-
this.context.arc(particle.x, particle.y, linkOptions.particleRadius, 0, Math.PI * 2);
|
|
221
|
-
this.context.fillStyle = linkOptions.particleColor;
|
|
222
|
-
this.context.fill();
|
|
223
|
-
if (linkOptions.particleBorderWidth > 0) {
|
|
224
|
-
this.context.stroke();
|
|
225
|
-
}
|
|
211
|
+
particleGroup.push({ x: particle.x, y: particle.y, r: linkOptions.particleRadius });
|
|
226
212
|
}
|
|
227
213
|
});
|
|
228
214
|
}
|
|
@@ -242,19 +228,15 @@ function getDrawLink() {
|
|
|
242
228
|
angle = Math.atan2(tangentY, tangentX);
|
|
243
229
|
}
|
|
244
230
|
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
this.context.fill();
|
|
255
|
-
if (arrowBorderWidth > 0) {
|
|
256
|
-
this.context.stroke();
|
|
257
|
-
}
|
|
231
|
+
const arrowBatchKey = `${arrowAlpha}|${arrowBorderColor}|${arrowBorderWidth}|${arrowColor}`;
|
|
232
|
+
arrowBatch[arrowBatchKey] ??= [];
|
|
233
|
+
const arrowGroup = arrowBatch[arrowBatchKey];
|
|
234
|
+
arrowGroup.push({
|
|
235
|
+
x: xEndArrow,
|
|
236
|
+
y: yEndArrow,
|
|
237
|
+
size: arrowSize,
|
|
238
|
+
angle,
|
|
239
|
+
});
|
|
258
240
|
}
|
|
259
241
|
if (linkOptions.drawExtraLink) {
|
|
260
242
|
linkOptions.drawExtraLink.call(this, link, { ...linkOptions, alpha });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"draw-links.js","sources":["../../../../../src/module/GraphCanvas/slices/draw-links.ts"],"sourcesContent":["import type { GraphCanvas } from \"../GraphCanvas\";\nimport { calculateLinkPositionByNode, getParticlePosition, linkFade, linkHighlight } from \"../lib\";\nimport { calculateCurveLinkPositionByNode } from \"../lib/utils/calculate-curve-link-position-by-node\";\nimport { approximateQuadraticBezierLength } from \"../lib/utils/get-particle-position\";\nimport type { LinkInterface, LinkParticle } from \"../types\";\n\nexport function getDrawLink<\n NodeData extends Record<string, unknown>,\n LinkData extends Record<string, unknown>,\n>() {\n return function drawLink(\n this: GraphCanvas<NodeData, LinkData>,\n link: LinkInterface<NodeData, LinkData>,\n index: number,\n ) {\n if (\n !this.context ||\n typeof link.source !== \"object\" ||\n typeof link.target !== \"object\" ||\n !link.source.x ||\n !link.source.y ||\n !link.target.x ||\n !link.target.y\n )\n return;\n\n if (\n (link.visible != undefined && !link.visible) ||\n (link.source.visible != undefined && !link.source.visible) ||\n (link.target.visible != undefined && !link.target.visible)\n )\n return;\n\n if (!link.source._visible && !link.target._visible) return;\n\n const linkOptions = this.linkOptionsCache[index];\n if (!linkOptions) return;\n\n if (linkOptions.drawLink) {\n linkOptions.drawLink.call(this, link, linkOptions);\n\n return;\n }\n\n let alpha = linkOptions.alpha;\n let color = linkOptions.color;\n let width = linkOptions.width;\n let arrowAlpha = this.linkSettings.arrowByHighlight ? 0 : linkOptions.arrowAlpha;\n let arrowColor = linkOptions.arrowColor;\n let arrowSize = linkOptions.arrowSize;\n let arrowBorderWidth = linkOptions.arrowBorderWidth;\n let arrowBorderColor = linkOptions.arrowBorderColor;\n\n const currentNodeHighlighted =\n this.highlightedNode &&\n (this.highlightedNode.id == link.source.id || this.highlightedNode.id == link.target.id);\n /** Highlight */\n if (this.highlightedNeighbors && this.highlightedNode) {\n /** By Node Not Highlight */\n if (!currentNodeHighlighted) {\n const fadeOptions = linkFade({\n arrow: this.linkSettings.arrow,\n arrowByHighlight: this.linkSettings.arrowByHighlight,\n linkOptions,\n highlightProgress: this.highlightProgress,\n highlightForArrowFadingMin: this.highlightSettings.highlightByNodeForArrowFadingMin,\n highlightForLinkFadingMin: this.highlightSettings.highlightByNodeForLinkFadingMin,\n });\n alpha = fadeOptions.alpha;\n arrowAlpha = fadeOptions.arrowAlpha;\n } else {\n const highlightOptions = linkHighlight({\n arrow: this.linkSettings.arrow,\n arrowByHighlight: this.linkSettings.arrowByHighlight,\n linkOptions,\n highlightProgress: this.highlightProgress,\n highlightForArrowBorderColor: this.highlightSettings.highlightByNodeForArrowBorderColor,\n highlightForArrowBorderSizingAdditional:\n this.highlightSettings.highlightByNodeForArrowBorderSizingAdditional,\n highlightForArrowColor: this.highlightSettings.highlightByNodeForArrowColor,\n highlightForArrowSizeAdditional:\n this.highlightSettings.highlightByNodeForArrowSizeAdditional,\n highlightForLinkColor: this.highlightSettings.highlightByNodeForLinkColor,\n highlightForLinkSizeAdditional:\n this.highlightSettings.highlightByNodeForLinkSizeAdditional,\n });\n arrowAlpha = highlightOptions.arrowAlpha;\n color = highlightOptions.color;\n width = highlightOptions.width;\n arrowColor = highlightOptions.arrowColor;\n arrowSize = highlightOptions.arrowSize;\n arrowBorderWidth = highlightOptions.arrowBorderWidth;\n arrowBorderColor = highlightOptions.arrowBorderColor;\n }\n }\n\n const currentLinkHighlighted = this.highlightedLink === link;\n if (this.highlightedNeighbors && this.highlightedLink) {\n /** By Link Not Highlight */\n if (!currentLinkHighlighted) {\n const fadeOptions = linkFade({\n arrow: this.linkSettings.arrow,\n arrowByHighlight: this.linkSettings.arrowByHighlight,\n linkOptions,\n highlightProgress: this.highlightProgress,\n highlightForArrowFadingMin: this.highlightSettings.highlightByLinkForArrowFadingMin,\n highlightForLinkFadingMin: this.highlightSettings.highlightByLinkForLinkFadingMin,\n });\n alpha = fadeOptions.alpha;\n arrowAlpha = fadeOptions.arrowAlpha;\n } else {\n /** By Link Highlight */\n const highlightOptions = linkHighlight({\n arrow: this.linkSettings.arrow,\n arrowByHighlight: this.linkSettings.arrowByHighlight,\n linkOptions,\n highlightProgress: this.highlightProgress,\n highlightForArrowBorderColor: this.highlightSettings.highlightByLinkForArrowBorderColor,\n highlightForArrowBorderSizingAdditional:\n this.highlightSettings.highlightByLinkForArrowBorderSizingAdditional,\n highlightForArrowColor: this.highlightSettings.highlightByLinkForArrowColor,\n highlightForArrowSizeAdditional:\n this.highlightSettings.highlightByLinkForArrowSizeAdditional,\n highlightForLinkColor: this.highlightSettings.highlightByLinkForLinkColor,\n highlightForLinkSizeAdditional:\n this.highlightSettings.highlightByLinkForLinkSizeAdditional,\n });\n arrowAlpha = highlightOptions.arrowAlpha;\n color = highlightOptions.color;\n width = highlightOptions.width;\n arrowColor = highlightOptions.arrowColor;\n arrowSize = highlightOptions.arrowSize;\n arrowBorderWidth = highlightOptions.arrowBorderWidth;\n arrowBorderColor = highlightOptions.arrowBorderColor;\n }\n }\n\n /** Link */\n this.context.beginPath();\n this.context.globalAlpha = alpha;\n this.context.strokeStyle = color;\n this.context.lineWidth = width;\n let xStart = link.source.x;\n let yStart = link.source.y;\n let xEnd = link.target.x;\n let yEnd = link.target.y;\n let xControl = 0;\n let yControl = 0;\n let xEndArrow = xEnd;\n let yEndArrow = yEnd;\n let linkDistance = 0;\n const isHasArrow = this.linkSettings.arrow && arrowAlpha > 0;\n if (!this.linkSettings.curve) {\n if (\n this.linkSettings.prettyDraw ||\n (this.linkSettings.arrow && arrowAlpha > 0) ||\n (this.particles && (currentNodeHighlighted || currentLinkHighlighted))\n ) {\n const position = calculateLinkPositionByNode(\n xStart,\n yStart,\n xEnd,\n yEnd,\n link.source,\n link.target,\n isHasArrow ? arrowSize : 0,\n );\n\n xStart = position.xStart;\n xEnd = position.xEnd;\n yStart = position.yStart;\n yEnd = position.yEnd;\n xEndArrow = position.xEndArrow;\n yEndArrow = position.yEndArrow;\n linkDistance = position.distance;\n }\n link._x1 = xStart;\n link._y1 = yStart;\n link._x2 = xEnd;\n link._y2 = yEnd;\n link._ax = xEndArrow;\n link._ay = yEndArrow;\n this.context.moveTo(xStart, yStart);\n this.context.lineTo(xEnd, yEnd);\n this.context.stroke();\n } else {\n const position = calculateCurveLinkPositionByNode(\n xStart,\n yStart,\n xEnd,\n yEnd,\n link.source,\n link.target,\n link._groupIndex ?? 0,\n isHasArrow ? arrowSize : 0,\n );\n xStart = position.xStart;\n yStart = position.yStart;\n xEnd = position.xEnd;\n yEnd = position.yEnd;\n xControl = position.xControl;\n yControl = position.yControl;\n xEndArrow = position.xEndArrow;\n yEndArrow = position.yEndArrow;\n link._x1 = position.xStart;\n link._y1 = position.yStart;\n link._x2 = position.xEnd;\n link._y2 = position.yEnd;\n link._cx = position.xControl;\n link._cy = position.yControl;\n link._ax = position.xEndArrow;\n link._ay = position.yEndArrow;\n linkDistance = approximateQuadraticBezierLength(\n position.xStart,\n position.yStart,\n position.xControl,\n position.yControl,\n position.xEnd,\n position.yEnd,\n );\n this.context.beginPath();\n this.context.moveTo(position.xStart, position.yStart);\n this.context.quadraticCurveTo(\n position.xControl,\n position.yControl,\n position.xEnd,\n position.yEnd,\n );\n this.context.setLineDash([]);\n // if (isDashed) {\n // this.context.setLineDash([10, 5]);\n // }\n this.context.stroke();\n }\n\n /** Particle */\n if (this.linkSettings.particles && (currentLinkHighlighted || currentNodeHighlighted)) {\n const speed = (1 / this.linkSettings.particleSpeedByDistance) * (1 + 0.5);\n if (!this.particles[index]) {\n const particleCount = Math.max(\n 1,\n Math.floor(linkDistance / this.linkSettings.particleCountByDistance),\n );\n const particles: LinkParticle[] = [];\n for (let i = 0; i < particleCount; i++) {\n const particle: LinkParticle = {\n index: i,\n };\n particles.push(particle);\n }\n this.particles[index] = particles;\n }\n this.particles[index].forEach((particle, _, particles) => {\n if (!this.context) return;\n getParticlePosition({\n distance: linkDistance,\n particle,\n totalCount: particles.length,\n xEnd,\n xStart,\n yEnd,\n yStart,\n xControl,\n yControl,\n speed,\n });\n if (particle.x != undefined && particle.y != undefined) {\n this.context.beginPath();\n this.context.strokeStyle = linkOptions.particleBorderColor;\n this.context.lineWidth = linkOptions.particleBorderWidth;\n this.context.arc(particle.x, particle.y, linkOptions.particleRadius, 0, Math.PI * 2);\n this.context.fillStyle = linkOptions.particleColor;\n this.context.fill();\n if (linkOptions.particleBorderWidth > 0) {\n this.context.stroke();\n }\n }\n });\n }\n\n /** Arrow */\n if (this.linkSettings.arrow && arrowAlpha > 0) {\n let angle = 0;\n if (!this.linkSettings.curve) {\n angle = Math.atan2(yEndArrow - yStart, xEndArrow - xStart);\n } else {\n const tangentX = 2 * (xEndArrow - xControl);\n const tangentY = 2 * (yEndArrow - yControl);\n if (Math.abs(tangentX) < 0.001 && Math.abs(tangentY) < 0.001) {\n angle = Math.atan2(yEndArrow - yControl, xEndArrow - xControl);\n } else {\n angle = Math.atan2(tangentY, tangentX);\n }\n }\n this.context.beginPath();\n this.context.globalAlpha = arrowAlpha;\n this.context.strokeStyle = arrowBorderColor;\n this.context.lineWidth = arrowBorderWidth;\n this.context.fillStyle = arrowColor;\n this.context.moveTo(xEndArrow, yEndArrow);\n this.context.lineTo(\n xEndArrow - arrowSize * Math.cos(angle - Math.PI / 6),\n yEndArrow - arrowSize * Math.sin(angle - Math.PI / 6),\n );\n this.context.lineTo(\n xEndArrow - arrowSize * Math.cos(angle + Math.PI / 6),\n yEndArrow - arrowSize * Math.sin(angle + Math.PI / 6),\n );\n this.context.closePath();\n this.context.fill();\n if (arrowBorderWidth > 0) {\n this.context.stroke();\n }\n }\n\n if (linkOptions.drawExtraLink) {\n linkOptions.drawExtraLink.call(this, link, { ...linkOptions, alpha });\n }\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;SAMgB,WAAW,GAAA;AAIzB,IAAA,OAAO,SAAS,QAAQ,CAEtB,IAAuC,EACvC,KAAa,EAAA;QAEb,IACE,CAAC,IAAI,CAAC,OAAO;AACb,YAAA,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ;AAC/B,YAAA,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ;AAC/B,YAAA,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACd,YAAA,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACd,YAAA,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACd,YAAA,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAEd;QAEF,IACE,CAAC,IAAI,CAAC,OAAO,IAAI,SAAS,IAAI,CAAC,IAAI,CAAC,OAAO;AAC3C,aAAC,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,SAAS,IAAI,CAAC,IAAI,CAAC,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B,GAAG,CAAC,EAAE;AACxB,gBAAA,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;;;AAIzB,QAAA,IAAI,WAAW,CAAC,aAAa,EAAE;AAC7B,YAAA,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,GAAG,WAAW,EAAE,KAAK,EAAE,CAAC;;AAEzE,KAAC;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"draw-links.js","sources":["../../../../../src/module/GraphCanvas/slices/draw-links.ts"],"sourcesContent":["import type { GraphCanvas } from \"../GraphCanvas\";\nimport { calculateLinkPositionByNode, getParticlePosition, linkFade, linkHighlight } from \"../lib\";\nimport { calculateCurveLinkPositionByNode } from \"../lib/utils/calculate-curve-link-position-by-node\";\nimport { approximateQuadraticBezierLength } from \"../lib/utils/get-particle-position\";\nimport type {\n LinkArrowDrawBatch,\n LinkDrawBatch,\n LinkInterface,\n LinkParticle,\n LinkParticleDrawBatch,\n} from \"../types\";\n\nexport function getDrawLink<\n NodeData extends Record<string, unknown>,\n LinkData extends Record<string, unknown>,\n>(\n linkBatch: Record<string, LinkDrawBatch[]>,\n particleBatch: Record<string, LinkParticleDrawBatch[]>,\n arrowBatch: Record<string, LinkArrowDrawBatch[]>,\n now: number,\n) {\n return function drawLink(\n this: GraphCanvas<NodeData, LinkData>,\n link: LinkInterface<NodeData, LinkData>,\n index: number,\n ) {\n if (\n !this.context ||\n typeof link.source !== \"object\" ||\n typeof link.target !== \"object\" ||\n !link.source.x ||\n !link.source.y ||\n !link.target.x ||\n !link.target.y\n )\n return;\n\n if (\n (link.visible != undefined && !link.visible) ||\n (link.source.visible != undefined && !link.source.visible) ||\n (link.target.visible != undefined && !link.target.visible)\n )\n return;\n\n if (!link.source._visible && !link.target._visible) return;\n\n const linkOptions = this.linkOptionsCache[index];\n if (!linkOptions) return;\n\n if (linkOptions.drawLink) {\n linkOptions.drawLink.call(this, link, linkOptions);\n\n return;\n }\n\n let alpha = linkOptions.alpha;\n let color = linkOptions.color;\n let width = linkOptions.width;\n let arrowAlpha = this.linkSettings.arrowByHighlight ? 0 : linkOptions.arrowAlpha;\n let arrowColor = linkOptions.arrowColor;\n let arrowSize = linkOptions.arrowSize;\n let arrowBorderWidth = linkOptions.arrowBorderWidth;\n let arrowBorderColor = linkOptions.arrowBorderColor;\n\n const currentNodeHighlighted =\n this.highlightedNode &&\n (this.highlightedNode.id == link.source.id || this.highlightedNode.id == link.target.id);\n /** Highlight */\n if (this.highlightedNeighbors && this.highlightedNode) {\n /** By Node Not Highlight */\n if (!currentNodeHighlighted) {\n const fadeOptions = linkFade({\n arrow: this.linkSettings.arrow,\n arrowByHighlight: this.linkSettings.arrowByHighlight,\n linkOptions,\n highlightProgress: this.highlightProgress,\n highlightForArrowFadingMin: this.highlightSettings.highlightByNodeForArrowFadingMin,\n highlightForLinkFadingMin: this.highlightSettings.highlightByNodeForLinkFadingMin,\n });\n alpha = fadeOptions.alpha;\n arrowAlpha = fadeOptions.arrowAlpha;\n } else {\n const highlightOptions = linkHighlight({\n arrow: this.linkSettings.arrow,\n arrowByHighlight: this.linkSettings.arrowByHighlight,\n linkOptions,\n highlightProgress: this.highlightProgress,\n highlightForArrowBorderColor: this.highlightSettings.highlightByNodeForArrowBorderColor,\n highlightForArrowBorderSizingAdditional:\n this.highlightSettings.highlightByNodeForArrowBorderSizingAdditional,\n highlightForArrowColor: this.highlightSettings.highlightByNodeForArrowColor,\n highlightForArrowSizeAdditional:\n this.highlightSettings.highlightByNodeForArrowSizeAdditional,\n highlightForLinkColor: this.highlightSettings.highlightByNodeForLinkColor,\n highlightForLinkSizeAdditional:\n this.highlightSettings.highlightByNodeForLinkSizeAdditional,\n });\n arrowAlpha = highlightOptions.arrowAlpha;\n color = highlightOptions.color;\n width = highlightOptions.width;\n arrowColor = highlightOptions.arrowColor;\n arrowSize = highlightOptions.arrowSize;\n arrowBorderWidth = highlightOptions.arrowBorderWidth;\n arrowBorderColor = highlightOptions.arrowBorderColor;\n }\n }\n\n const currentLinkHighlighted = this.highlightedLink === link;\n if (this.highlightedNeighbors && this.highlightedLink) {\n /** By Link Not Highlight */\n if (!currentLinkHighlighted) {\n const fadeOptions = linkFade({\n arrow: this.linkSettings.arrow,\n arrowByHighlight: this.linkSettings.arrowByHighlight,\n linkOptions,\n highlightProgress: this.highlightProgress,\n highlightForArrowFadingMin: this.highlightSettings.highlightByLinkForArrowFadingMin,\n highlightForLinkFadingMin: this.highlightSettings.highlightByLinkForLinkFadingMin,\n });\n alpha = fadeOptions.alpha;\n arrowAlpha = fadeOptions.arrowAlpha;\n } else {\n /** By Link Highlight */\n const highlightOptions = linkHighlight({\n arrow: this.linkSettings.arrow,\n arrowByHighlight: this.linkSettings.arrowByHighlight,\n linkOptions,\n highlightProgress: this.highlightProgress,\n highlightForArrowBorderColor: this.highlightSettings.highlightByLinkForArrowBorderColor,\n highlightForArrowBorderSizingAdditional:\n this.highlightSettings.highlightByLinkForArrowBorderSizingAdditional,\n highlightForArrowColor: this.highlightSettings.highlightByLinkForArrowColor,\n highlightForArrowSizeAdditional:\n this.highlightSettings.highlightByLinkForArrowSizeAdditional,\n highlightForLinkColor: this.highlightSettings.highlightByLinkForLinkColor,\n highlightForLinkSizeAdditional:\n this.highlightSettings.highlightByLinkForLinkSizeAdditional,\n });\n arrowAlpha = highlightOptions.arrowAlpha;\n color = highlightOptions.color;\n width = highlightOptions.width;\n arrowColor = highlightOptions.arrowColor;\n arrowSize = highlightOptions.arrowSize;\n arrowBorderWidth = highlightOptions.arrowBorderWidth;\n arrowBorderColor = highlightOptions.arrowBorderColor;\n }\n }\n\n /** Link */\n const linkBatchKey = `${alpha}|${color}|${width}`;\n linkBatch[linkBatchKey] ??= [];\n const linkGroup = linkBatch[linkBatchKey];\n let xStart = link.source.x;\n let yStart = link.source.y;\n let xEnd = link.target.x;\n let yEnd = link.target.y;\n let xControl = 0;\n let yControl = 0;\n let xEndArrow = xEnd;\n let yEndArrow = yEnd;\n let linkDistance = 0;\n const isHasArrow = this.linkSettings.arrow && arrowAlpha > 0;\n if (!this.linkSettings.curve) {\n if (\n this.linkSettings.prettyDraw ||\n (this.linkSettings.arrow && arrowAlpha > 0) ||\n (this.particles && (currentNodeHighlighted || currentLinkHighlighted))\n ) {\n const position = calculateLinkPositionByNode(\n xStart,\n yStart,\n xEnd,\n yEnd,\n link.source,\n link.target,\n isHasArrow ? arrowSize : 0,\n );\n\n xStart = position.xStart;\n xEnd = position.xEnd;\n yStart = position.yStart;\n yEnd = position.yEnd;\n xEndArrow = position.xEndArrow;\n yEndArrow = position.yEndArrow;\n linkDistance = position.distance;\n }\n link._x1 = xStart;\n link._y1 = yStart;\n link._x2 = xEnd;\n link._y2 = yEnd;\n link._ax = xEndArrow;\n link._ay = yEndArrow;\n linkGroup.push({ curve: false, xStart, yStart, xEnd, yEnd, xControl, yControl });\n } else {\n const position = calculateCurveLinkPositionByNode(\n xStart,\n yStart,\n xEnd,\n yEnd,\n link.source,\n link.target,\n link._groupIndex ?? 0,\n isHasArrow ? arrowSize : 0,\n );\n xStart = position.xStart;\n yStart = position.yStart;\n xEnd = position.xEnd;\n yEnd = position.yEnd;\n xControl = position.xControl;\n yControl = position.yControl;\n xEndArrow = position.xEndArrow;\n yEndArrow = position.yEndArrow;\n link._x1 = position.xStart;\n link._y1 = position.yStart;\n link._x2 = position.xEnd;\n link._y2 = position.yEnd;\n link._cx = position.xControl;\n link._cy = position.yControl;\n link._ax = position.xEndArrow;\n link._ay = position.yEndArrow;\n linkDistance = approximateQuadraticBezierLength(\n position.xStart,\n position.yStart,\n position.xControl,\n position.yControl,\n position.xEnd,\n position.yEnd,\n );\n linkGroup.push({ curve: true, xStart, yStart, xEnd, yEnd, xControl, yControl });\n }\n\n /** Particle */\n if (this.linkSettings.particles && (currentLinkHighlighted || currentNodeHighlighted)) {\n const speed = (1 / this.linkSettings.particleSpeedByDistance) * (1 + 0.5);\n if (!this.particles[index]) {\n const particleCount = Math.max(\n 1,\n Math.floor(linkDistance / this.linkSettings.particleCountByDistance),\n );\n const particles: LinkParticle[] = [];\n for (let i = 0; i < particleCount; i++) {\n const particle: LinkParticle = {\n index: i,\n };\n particles.push(particle);\n }\n this.particles[index] = particles;\n }\n const particleBatchKey = `${linkOptions.particleBorderColor}|${linkOptions.particleBorderWidth}|${linkOptions.particleColor}`;\n particleBatch[particleBatchKey] ??= [];\n const particleGroup = particleBatch[particleBatchKey];\n this.particles[index].forEach((particle, _, particles) => {\n if (!this.context) return;\n getParticlePosition({\n distance: linkDistance,\n particle,\n totalCount: particles.length,\n xEnd,\n xStart,\n yEnd,\n yStart,\n xControl,\n yControl,\n speed,\n now,\n });\n if (particle.x != undefined && particle.y != undefined) {\n particleGroup.push({ x: particle.x, y: particle.y, r: linkOptions.particleRadius });\n }\n });\n }\n\n /** Arrow */\n if (this.linkSettings.arrow && arrowAlpha > 0) {\n let angle = 0;\n if (!this.linkSettings.curve) {\n angle = Math.atan2(yEndArrow - yStart, xEndArrow - xStart);\n } else {\n const tangentX = 2 * (xEndArrow - xControl);\n const tangentY = 2 * (yEndArrow - yControl);\n if (Math.abs(tangentX) < 0.001 && Math.abs(tangentY) < 0.001) {\n angle = Math.atan2(yEndArrow - yControl, xEndArrow - xControl);\n } else {\n angle = Math.atan2(tangentY, tangentX);\n }\n }\n const arrowBatchKey = `${arrowAlpha}|${arrowBorderColor}|${arrowBorderWidth}|${arrowColor}`;\n arrowBatch[arrowBatchKey] ??= [];\n const arrowGroup = arrowBatch[arrowBatchKey];\n arrowGroup.push({\n x: xEndArrow,\n y: yEndArrow,\n size: arrowSize,\n angle,\n });\n }\n if (linkOptions.drawExtraLink) {\n linkOptions.drawExtraLink.call(this, link, { ...linkOptions, alpha });\n }\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAYM,SAAU,WAAW,CAIzB,SAA0C,EAC1C,aAAsD,EACtD,UAAgD,EAChD,GAAW,EAAA;AAEX,IAAA,OAAO,SAAS,QAAQ,CAEtB,IAAuC,EACvC,KAAa,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