@darajs/ui-causal-graph-editor 1.11.2 → 1.11.3
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/dist/shared/causal-graph-store.d.ts +3 -3
- package/dist/shared/causal-graph-store.d.ts.map +1 -1
- package/dist/shared/causal-graph-store.js.map +1 -1
- package/dist/shared/rendering/background.d.ts +17 -1
- package/dist/shared/rendering/background.d.ts.map +1 -1
- package/dist/shared/rendering/background.js +10 -25
- package/dist/shared/rendering/background.js.map +1 -1
- package/dist/shared/rendering/edge/curve.d.ts +3 -3
- package/dist/shared/rendering/edge/curve.d.ts.map +1 -1
- package/dist/shared/rendering/edge/curve.js.map +1 -1
- package/dist/shared/rendering/edge/definitions.d.ts +1 -1
- package/dist/shared/rendering/edge/definitions.d.ts.map +1 -1
- package/dist/shared/rendering/edge/edge-object.d.ts +2 -2
- package/dist/shared/rendering/edge/edge-object.d.ts.map +1 -1
- package/dist/shared/rendering/edge/edge-object.js +38 -44
- package/dist/shared/rendering/edge/edge-object.js.map +1 -1
- package/dist/shared/rendering/edge/symbols.d.ts +4 -4
- package/dist/shared/rendering/edge/symbols.d.ts.map +1 -1
- package/dist/shared/rendering/edge/symbols.js +14 -42
- package/dist/shared/rendering/edge/symbols.js.map +1 -1
- package/dist/shared/rendering/engine.d.ts +2 -2
- package/dist/shared/rendering/engine.d.ts.map +1 -1
- package/dist/shared/rendering/engine.js +45 -27
- package/dist/shared/rendering/engine.js.map +1 -1
- package/dist/shared/rendering/grouping/group-container-object.d.ts +2 -2
- package/dist/shared/rendering/grouping/group-container-object.d.ts.map +1 -1
- package/dist/shared/rendering/grouping/group-container-object.js +12 -8
- package/dist/shared/rendering/grouping/group-container-object.js.map +1 -1
- package/dist/shared/rendering/node/node-object.d.ts +3 -2
- package/dist/shared/rendering/node/node-object.d.ts.map +1 -1
- package/dist/shared/rendering/node/node-object.js +27 -26
- package/dist/shared/rendering/node/node-object.js.map +1 -1
- package/dist/shared/rendering/svg.d.ts +3 -3
- package/dist/shared/rendering/svg.d.ts.map +1 -1
- package/dist/shared/rendering/svg.js +6 -1
- package/dist/shared/rendering/svg.js.map +1 -1
- package/dist/shared/rendering/text.js +2 -2
- package/dist/shared/rendering/text.js.map +1 -1
- package/dist/shared/rendering/texture-cache.d.ts +19 -4
- package/dist/shared/rendering/texture-cache.d.ts.map +1 -1
- package/dist/shared/rendering/texture-cache.js +8 -6
- package/dist/shared/rendering/texture-cache.js.map +1 -1
- package/dist/shared/rendering/use-render-engine.d.ts +1 -1
- package/dist/shared/rendering/use-render-engine.d.ts.map +1 -1
- package/dist/shared/rendering/use-render-engine.js.map +1 -1
- package/package.json +14 -28
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { SmoothGraphics } from '@pixi/graphics-smooth';
|
|
18
17
|
import * as PIXI from 'pixi.js';
|
|
19
18
|
import { EdgeConstraintType, EdgeType, EditorMode } from '../../../types';
|
|
20
19
|
import { QUESTION_MARK, drawPath } from '../svg';
|
|
@@ -28,7 +27,7 @@ import { QUESTION_MARK, drawPath } from '../svg';
|
|
|
28
27
|
*/
|
|
29
28
|
export function createSideSymbol(style, position, tint, bgTint) {
|
|
30
29
|
var _a, _b;
|
|
31
|
-
const gfx = new
|
|
30
|
+
const gfx = new PIXI.Graphics();
|
|
32
31
|
const color = tint;
|
|
33
32
|
// normal arrow in normal/resolver mode
|
|
34
33
|
if ([EditorMode.RESOLVER, EditorMode.DEFAULT, EditorMode.EDGE_ENCODER].includes(style.editorMode)) {
|
|
@@ -45,12 +44,11 @@ export function createSideSymbol(style, position, tint, bgTint) {
|
|
|
45
44
|
if (style.editorMode === EditorMode.EDGE_ENCODER) {
|
|
46
45
|
// Edge encoder - shows semi-circle tip for soft directed constraint
|
|
47
46
|
if (((_a = style.constraint) === null || _a === void 0 ? void 0 : _a.type) === EdgeConstraintType.SOFT_DIRECTED) {
|
|
48
|
-
gfx.
|
|
49
|
-
cap:
|
|
47
|
+
gfx.arc(0, 0, 8, 0, Math.PI, false).stroke({
|
|
48
|
+
cap: 'round',
|
|
50
49
|
color,
|
|
51
50
|
width: 2,
|
|
52
51
|
});
|
|
53
|
-
gfx.arc(0, 0, 8, 0, Math.PI, false);
|
|
54
52
|
return gfx;
|
|
55
53
|
}
|
|
56
54
|
// Encoder - only show arrow for directed constraint
|
|
@@ -58,11 +56,10 @@ export function createSideSymbol(style, position, tint, bgTint) {
|
|
|
58
56
|
return gfx;
|
|
59
57
|
}
|
|
60
58
|
}
|
|
61
|
-
gfx.lineStyle({ cap: PIXI.LINE_CAP.ROUND, color, width: 2 });
|
|
62
59
|
gfx.moveTo(0, 8);
|
|
63
60
|
gfx.lineTo(-8, 0);
|
|
64
61
|
gfx.moveTo(0, 8);
|
|
65
|
-
gfx.lineTo(8, 0);
|
|
62
|
+
gfx.lineTo(8, 0).stroke({ cap: 'round', color, width: 2 });
|
|
66
63
|
}
|
|
67
64
|
// Multiplier for Y values - flip bottom position graphics
|
|
68
65
|
const my = position === 'top' ? 1 : -1;
|
|
@@ -71,22 +68,16 @@ export function createSideSymbol(style, position, tint, bgTint) {
|
|
|
71
68
|
const symbol = style.type[position === 'top' ? 1 : 0];
|
|
72
69
|
// Fill for arrows
|
|
73
70
|
if (['<', '>'].includes(symbol)) {
|
|
74
|
-
gfx.
|
|
75
|
-
gfx.drawPolygon([0, my * 10, -8, 0, 8, 0]);
|
|
76
|
-
gfx.endFill();
|
|
71
|
+
gfx.poly([0, my * 10, -8, 0, 8, 0]).fill(color);
|
|
77
72
|
}
|
|
78
73
|
else if (symbol === 'o') {
|
|
79
|
-
gfx.
|
|
80
|
-
gfx.drawCircle(0, 0, 6);
|
|
81
|
-
gfx.endFill();
|
|
82
|
-
// stroke for circles
|
|
83
|
-
gfx.lineStyle({ color, width: 3 });
|
|
84
|
-
gfx.drawCircle(0, 0, 5);
|
|
74
|
+
gfx.circle(0, 0, 6).fill(bgTint).circle(0, 0, 5).stroke({ color, width: 3 });
|
|
85
75
|
}
|
|
86
76
|
else {
|
|
87
77
|
// undirected - no symbol
|
|
88
78
|
return gfx;
|
|
89
79
|
}
|
|
80
|
+
return gfx;
|
|
90
81
|
}
|
|
91
82
|
return gfx;
|
|
92
83
|
}
|
|
@@ -96,16 +87,14 @@ export function createSideSymbol(style, position, tint, bgTint) {
|
|
|
96
87
|
* @param dots number of dots to include in the symbol
|
|
97
88
|
*/
|
|
98
89
|
export function createStrengthSymbol(dots) {
|
|
99
|
-
const gfx = new
|
|
90
|
+
const gfx = new PIXI.Graphics();
|
|
100
91
|
if (!dots) {
|
|
101
92
|
return gfx;
|
|
102
93
|
}
|
|
103
|
-
gfx.beginFill(0xffffff, 1, true);
|
|
104
94
|
// Draw a circle for each dot
|
|
105
95
|
for (let i = 0; i < dots; i++) {
|
|
106
|
-
gfx.
|
|
96
|
+
gfx.circle(0, -10 * i, 4).fill(0xffffff);
|
|
107
97
|
}
|
|
108
|
-
gfx.endFill();
|
|
109
98
|
return gfx;
|
|
110
99
|
}
|
|
111
100
|
/**
|
|
@@ -114,45 +103,28 @@ export function createStrengthSymbol(dots) {
|
|
|
114
103
|
* @param style edge style
|
|
115
104
|
*/
|
|
116
105
|
export function createCenterSymbol(style) {
|
|
117
|
-
const gfx = new
|
|
106
|
+
const gfx = new PIXI.Graphics();
|
|
118
107
|
// In resolver modes, draw a question mark for unresolved direction edges
|
|
119
108
|
if (EditorMode.RESOLVER === style.editorMode) {
|
|
120
109
|
if (style.type !== EdgeType.DIRECTED_EDGE) {
|
|
121
|
-
gfx.lineStyle({
|
|
122
|
-
cap: PIXI.LINE_CAP.ROUND,
|
|
123
|
-
color: 0xffffff,
|
|
124
|
-
width: 1,
|
|
125
|
-
});
|
|
126
|
-
gfx.beginFill(0xffffff, 1, true);
|
|
127
110
|
drawPath(QUESTION_MARK, gfx);
|
|
128
|
-
gfx.endFill();
|
|
129
111
|
}
|
|
130
112
|
}
|
|
131
113
|
// In edge encoder, show prohibited/undirected in the center
|
|
132
114
|
if (style.editorMode === EditorMode.EDGE_ENCODER && style.constraint) {
|
|
133
115
|
if (style.constraint.type === EdgeConstraintType.FORBIDDEN) {
|
|
134
|
-
gfx.
|
|
135
|
-
cap:
|
|
116
|
+
gfx.moveTo(-6, 6).lineTo(6, -6).moveTo(6, 6).lineTo(-6, -6).stroke({
|
|
117
|
+
cap: 'round',
|
|
136
118
|
color: 0xffffff,
|
|
137
119
|
width: 2,
|
|
138
120
|
});
|
|
139
|
-
gfx.moveTo(-6, 6);
|
|
140
|
-
gfx.lineTo(6, -6);
|
|
141
|
-
gfx.moveTo(6, 6);
|
|
142
|
-
gfx.lineTo(-6, -6);
|
|
143
121
|
}
|
|
144
122
|
else if (style.constraint.type === EdgeConstraintType.UNDIRECTED) {
|
|
145
|
-
gfx.
|
|
146
|
-
cap:
|
|
123
|
+
gfx.moveTo(-8, 4).lineTo(0, 12).lineTo(8, 4).moveTo(-8, -4).lineTo(0, -12).lineTo(8, -4).stroke({
|
|
124
|
+
cap: 'round',
|
|
147
125
|
color: 0xffffff,
|
|
148
126
|
width: 2,
|
|
149
127
|
});
|
|
150
|
-
gfx.moveTo(-8, 4);
|
|
151
|
-
gfx.lineTo(0, 12);
|
|
152
|
-
gfx.lineTo(8, 4);
|
|
153
|
-
gfx.moveTo(-8, -4);
|
|
154
|
-
gfx.lineTo(0, -12);
|
|
155
|
-
gfx.lineTo(8, -4);
|
|
156
128
|
}
|
|
157
129
|
}
|
|
158
130
|
return gfx;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"symbols.js","sourceRoot":"","sources":["../../../../src/shared/rendering/edge/symbols.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"symbols.js","sourceRoot":"","sources":["../../../../src/shared/rendering/edge/symbols.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAe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I,KAAK,CAAC,UAAU,CAAC,IAAI,KAAK,kBAAkB,CAAC,SAAS,EAAE,CAAC;YACzD,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;gBAC/D,GAAG,EAAE,OAAO;gBACZ,KAAK,EAAE,QAAQ;gBACf,KAAK,EAAE,CAAC;aACX,CAAC,CAAC;QACP,CAAC;aAAM,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI,KAAK,kBAAkB,CAAC,UAAU,EAAE,CAAC;YACjE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;gBAC5F,GAAG,EAAE,OAAO;gBACZ,KAAK,EAAE,QAAQ;gBACf,KAAK,EAAE,CAAC;aACX,CAAC,CAAC;QACP,CAAC;IACL,CAAC;IAED,OAAO,GAAG,CAAC;AACf,CAAC"}
|
|
@@ -20,7 +20,7 @@ export interface EngineEvents {
|
|
|
20
20
|
groupMouseover: (event: PIXI.FederatedMouseEvent, groupKey: string) => void;
|
|
21
21
|
}
|
|
22
22
|
export declare const ENGINE_EVENTS: Array<keyof EngineEvents>;
|
|
23
|
-
export declare class Engine extends PIXI.
|
|
23
|
+
export declare class Engine extends PIXI.EventEmitter<EngineEvents> {
|
|
24
24
|
/** App instance */
|
|
25
25
|
private app;
|
|
26
26
|
/** Background object */
|
|
@@ -130,7 +130,7 @@ export declare class Engine extends PIXI.utils.EventEmitter<EngineEvents> {
|
|
|
130
130
|
/**
|
|
131
131
|
* Get the center position of the rendered viewport
|
|
132
132
|
*/
|
|
133
|
-
getCenterPosition(): PIXI.
|
|
133
|
+
getCenterPosition(): PIXI.PointData;
|
|
134
134
|
/**
|
|
135
135
|
* Cleanup the app appropriately
|
|
136
136
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../../src/shared/rendering/engine.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../../src/shared/rendering/engine.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAG/D,OAAO,EAA6B,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD,OAAO,EACH,cAAc,EAEd,UAAU,EAEV,cAAc,EACd,eAAe,EAEf,cAAc,EACjB,MAAM,QAAQ,CAAC;AAIhB,OAAO,EAAsD,aAAa,EAAE,MAAM,QAAQ,CAAC;AAkB3F,MAAM,WAAW,YAAY;IACzB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,UAAU,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,mBAAmB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACtF,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,mBAAmB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,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;OAKG;IACH,OAAO,CAAC,eAAe;IAUvB;;;;;OAKG;IACH,OAAO,CAAC,yBAAyB;IAQjC;;;;OAIG;IACH,OAAO,CAAC,oBAAoB;IAK5B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAgB3B;;OAEG;IACH,OAAO,CAAC,YAAY;CAavB"}
|
|
@@ -23,7 +23,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
23
23
|
* See the License for the specific language governing permissions and
|
|
24
24
|
* limitations under the License.
|
|
25
25
|
*/
|
|
26
|
-
import { Cull } from '@pixi-essentials/cull';
|
|
27
26
|
import FontFaceObserver from 'fontfaceobserver';
|
|
28
27
|
import { assignLayout } from 'graphology-layout/utils';
|
|
29
28
|
import debounce from 'lodash/debounce';
|
|
@@ -61,7 +60,7 @@ export const ENGINE_EVENTS = [
|
|
|
61
60
|
'groupMouseout',
|
|
62
61
|
'groupMouseover',
|
|
63
62
|
];
|
|
64
|
-
export class Engine extends PIXI.
|
|
63
|
+
export class Engine extends PIXI.EventEmitter {
|
|
65
64
|
constructor(graph, layout, editable, editorMode, theme, constraints, zoomThresholds, errorHandler, processEdgeStyle, requireFocusToZoom) {
|
|
66
65
|
super();
|
|
67
66
|
/** Debounced version of `this.updateLayout` in case multiple changes come in at the same time */
|
|
@@ -135,7 +134,8 @@ export class Engine extends PIXI.utils.EventEmitter {
|
|
|
135
134
|
this.errorHandler = errorHandler;
|
|
136
135
|
this.processEdgeStyle = processEdgeStyle;
|
|
137
136
|
this.isFocused = false;
|
|
138
|
-
PIXI.Filter.
|
|
137
|
+
PIXI.Filter.defaultOptions.resolution = 3;
|
|
138
|
+
PIXI.extensions.add(PIXI.CullerPlugin);
|
|
139
139
|
}
|
|
140
140
|
/**
|
|
141
141
|
* Get the center position of the rendered viewport
|
|
@@ -147,7 +147,7 @@ export class Engine extends PIXI.utils.EventEmitter {
|
|
|
147
147
|
* Cleanup the app appropriately
|
|
148
148
|
*/
|
|
149
149
|
destroy() {
|
|
150
|
-
var _a;
|
|
150
|
+
var _a, _b, _c, _d;
|
|
151
151
|
// remove listeners
|
|
152
152
|
this.graph.off('attributesUpdated', this.onGraphAttributesUpdatedBound);
|
|
153
153
|
this.graph.off('nodeAdded', this.onGraphNodeAddedBound);
|
|
@@ -157,9 +157,9 @@ export class Engine extends PIXI.utils.EventEmitter {
|
|
|
157
157
|
this.graph.off('edgeAttributesUpdated', this.onGraphEdgeAttributesUpdatedBound);
|
|
158
158
|
this.graph.off('nodeAttributesUpdated', this.onGraphNodeAttributesUpdatedBound);
|
|
159
159
|
(_a = this.onCleanup) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
160
|
-
this.textureCache.destroy();
|
|
161
|
-
this.resizeObserver.disconnect();
|
|
162
|
-
this.app.destroy(true, true);
|
|
160
|
+
(_b = this.textureCache) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
161
|
+
(_c = this.resizeObserver) === null || _c === void 0 ? void 0 : _c.disconnect();
|
|
162
|
+
(_d = this.app) === null || _d === void 0 ? void 0 : _d.destroy(true, true);
|
|
163
163
|
}
|
|
164
164
|
/**
|
|
165
165
|
* Mark styles to update them in the next animation frame
|
|
@@ -344,6 +344,12 @@ export class Engine extends PIXI.utils.EventEmitter {
|
|
|
344
344
|
});
|
|
345
345
|
});
|
|
346
346
|
this.requestRender();
|
|
347
|
+
// Force a culling update all nodes and edges are created
|
|
348
|
+
// Without this the first time the nodes are collapsed the graph will
|
|
349
|
+
// be culled completely making it invisible
|
|
350
|
+
setTimeout(() => {
|
|
351
|
+
this.viewport.dirty = true;
|
|
352
|
+
}, 300);
|
|
347
353
|
}
|
|
348
354
|
}
|
|
349
355
|
/**
|
|
@@ -530,7 +536,10 @@ export class Engine extends PIXI.utils.EventEmitter {
|
|
|
530
536
|
yield fontObserver.load();
|
|
531
537
|
this.container = container;
|
|
532
538
|
const [initialColor] = colorToPixi(this.theme.colors.blue1);
|
|
533
|
-
this.app = new PIXI.Application(
|
|
539
|
+
this.app = new PIXI.Application();
|
|
540
|
+
const isWebGPU = localStorage.getItem('enable-webgpu') === 'true';
|
|
541
|
+
yield this.app.init({
|
|
542
|
+
preference: isWebGPU ? 'webgpu' : 'webgl',
|
|
534
543
|
antialias: true,
|
|
535
544
|
autoDensity: true,
|
|
536
545
|
autoStart: false,
|
|
@@ -541,7 +550,7 @@ export class Engine extends PIXI.utils.EventEmitter {
|
|
|
541
550
|
resolution: window.devicePixelRatio,
|
|
542
551
|
});
|
|
543
552
|
// Add a canvas to the container
|
|
544
|
-
container.appendChild(this.app.
|
|
553
|
+
container.appendChild(this.app.canvas);
|
|
545
554
|
this.textureCache = new TextureCache(this.app.renderer);
|
|
546
555
|
// Create viewport and add it to the app
|
|
547
556
|
this.viewport = new Viewport({
|
|
@@ -553,7 +562,7 @@ export class Engine extends PIXI.utils.EventEmitter {
|
|
|
553
562
|
if (!this.requireFocusToZoom) {
|
|
554
563
|
this.toggleWheelZoom(true);
|
|
555
564
|
}
|
|
556
|
-
this.viewport.
|
|
565
|
+
this.viewport.addListener('frame-end', () => {
|
|
557
566
|
if (this.viewport.dirty) {
|
|
558
567
|
this.requestRender();
|
|
559
568
|
this.viewport.dirty = false;
|
|
@@ -568,10 +577,15 @@ export class Engine extends PIXI.utils.EventEmitter {
|
|
|
568
577
|
this.app.stage.addChild(this.viewport);
|
|
569
578
|
// create layers - containers to hold different rendered parts of the graph
|
|
570
579
|
this.groupContainerLayer = new PIXI.Container();
|
|
580
|
+
this.groupContainerLayer.cullable = true;
|
|
571
581
|
this.edgeLayer = new PIXI.Container();
|
|
582
|
+
this.edgeLayer.cullable = true;
|
|
572
583
|
this.edgeSymbolsLayer = new PIXI.Container();
|
|
584
|
+
this.edgeSymbolsLayer.cullable = true;
|
|
573
585
|
this.nodeLayer = new PIXI.Container();
|
|
586
|
+
this.nodeLayer.cullable = true;
|
|
574
587
|
this.nodeLabelLayer = new PIXI.Container();
|
|
588
|
+
this.nodeLabelLayer.cullable = true;
|
|
575
589
|
this.viewport.addChild(this.groupContainerLayer);
|
|
576
590
|
this.viewport.addChild(this.edgeLayer);
|
|
577
591
|
this.viewport.addChild(this.edgeSymbolsLayer);
|
|
@@ -655,11 +669,11 @@ export class Engine extends PIXI.utils.EventEmitter {
|
|
|
655
669
|
toggleWheelZoom(isEnabled) {
|
|
656
670
|
if (isEnabled) {
|
|
657
671
|
this.viewport.wheel();
|
|
658
|
-
this.app.
|
|
672
|
+
this.app.canvas.addEventListener('wheel', Engine.wheelListener);
|
|
659
673
|
}
|
|
660
674
|
else {
|
|
661
675
|
this.viewport.plugins.remove('wheel');
|
|
662
|
-
this.app.
|
|
676
|
+
this.app.canvas.removeEventListener('wheel', Engine.wheelListener);
|
|
663
677
|
}
|
|
664
678
|
}
|
|
665
679
|
/**
|
|
@@ -677,11 +691,11 @@ export class Engine extends PIXI.utils.EventEmitter {
|
|
|
677
691
|
return __awaiter(this, void 0, void 0, function* () {
|
|
678
692
|
// create a new container to render
|
|
679
693
|
const containerWithBackground = new PIXI.Container();
|
|
694
|
+
containerWithBackground.cullable = true;
|
|
680
695
|
// Add a custom background since renderer background is not rendered, simply render a single-color rect
|
|
681
|
-
const bg = new PIXI.Graphics()
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
bg.endFill();
|
|
696
|
+
const bg = new PIXI.Graphics()
|
|
697
|
+
.rect(0, 0, this.app.renderer.width, this.app.renderer.height)
|
|
698
|
+
.fill(this.app.renderer.background.color);
|
|
685
699
|
containerWithBackground.addChild(bg);
|
|
686
700
|
// add the stage
|
|
687
701
|
containerWithBackground.addChild(this.app.stage);
|
|
@@ -695,15 +709,16 @@ export class Engine extends PIXI.utils.EventEmitter {
|
|
|
695
709
|
const maxY = Math.max(...nodesY);
|
|
696
710
|
const region = new PIXI.Rectangle(minX - WORLD_PADDING, minY - WORLD_PADDING, maxX - minX + WORLD_PADDING * 2, maxY - minY + WORLD_PADDING * 2);
|
|
697
711
|
let resolution = window.devicePixelRatio;
|
|
698
|
-
//
|
|
699
|
-
|
|
712
|
+
// now calculate our ideal resolution to get to 4k resolution in the generated image
|
|
713
|
+
const area = region.width * region.height;
|
|
714
|
+
// WEBGL vs WebGPU renderer
|
|
715
|
+
if (this.app.renderer.type === PIXI.RendererType.WEBGL) {
|
|
700
716
|
// compute what's the max safe WEBGL dimension size we can render without crashing
|
|
701
717
|
const { gl } = this.app.renderer;
|
|
702
718
|
const maxRenderBufferSize = gl.getParameter(gl.MAX_RENDERBUFFER_SIZE);
|
|
703
719
|
const maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE);
|
|
704
720
|
const maxSafeDimension = Math.min(maxRenderBufferSize, maxTextureSize);
|
|
705
721
|
// now calculate our ideal resolution to get to 4k resolution in the generated image
|
|
706
|
-
const area = region.width * region.height;
|
|
707
722
|
const desiredResolution = Math.sqrt(MAX_REASONABLE_PIXELS / area);
|
|
708
723
|
// scale the dimensions, capping each on the max safe dimension
|
|
709
724
|
const scaledWidth = Math.min(region.width * desiredResolution, maxSafeDimension);
|
|
@@ -711,15 +726,21 @@ export class Engine extends PIXI.utils.EventEmitter {
|
|
|
711
726
|
// pick the smaller scale factor
|
|
712
727
|
resolution = Math.floor(Math.min(scaledWidth / region.width, scaledHeight / region.height));
|
|
713
728
|
}
|
|
714
|
-
|
|
715
|
-
|
|
729
|
+
if (this.app.renderer.type === PIXI.RendererType.WEBGPU) {
|
|
730
|
+
resolution = Math.floor(Math.sqrt(MAX_REASONABLE_PIXELS / area));
|
|
731
|
+
}
|
|
732
|
+
const renderTexture = this.app.renderer.generateTexture({
|
|
733
|
+
target: containerWithBackground,
|
|
716
734
|
// increase the resolution for better quality
|
|
735
|
+
textureSourceOptions: {
|
|
736
|
+
scaleMode: 'linear',
|
|
737
|
+
sampleCount: this.app.renderer.type === PIXI.RendererType.WEBGPU ? 1 : PIXI.MSAA_QUALITY.HIGH,
|
|
738
|
+
},
|
|
717
739
|
resolution,
|
|
718
|
-
|
|
719
|
-
region,
|
|
740
|
+
frame: region,
|
|
720
741
|
});
|
|
721
742
|
// generate the data URL
|
|
722
|
-
return this.app.renderer.extract.base64(renderTexture, '
|
|
743
|
+
return this.app.renderer.extract.base64({ target: renderTexture, format: 'png' });
|
|
723
744
|
});
|
|
724
745
|
}
|
|
725
746
|
/**
|
|
@@ -1291,9 +1312,6 @@ export class Engine extends PIXI.utils.EventEmitter {
|
|
|
1291
1312
|
* Applies culling to hide off-screen graphics, updates LOD based on zoom level
|
|
1292
1313
|
*/
|
|
1293
1314
|
updateGraphVisibility() {
|
|
1294
|
-
const cull = new Cull();
|
|
1295
|
-
cull.addAll(this.viewport.children.flatMap((layer) => layer.children));
|
|
1296
|
-
cull.cull(this.app.renderer.screen);
|
|
1297
1315
|
const zoomState = getZoomState(this.viewport.scale.x, this.zoomThresholds);
|
|
1298
1316
|
this.graph.forEachNode((nodeKey) => {
|
|
1299
1317
|
const node = this.nodeMap.get(nodeKey);
|