Skip to content

Commit 1b20631

Browse files
committed
fix 'hide disconnected nodes' resetting query
1 parent 15bb96e commit 1b20631

2 files changed

Lines changed: 24 additions & 5 deletions

File tree

src/graph/core.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,12 @@ class GraphCoreManager {
421421
// Update bubble groups to exclude hidden dangling nodes
422422
await this.cache.bs.updateBubbleSetIfChanged();
423423

424-
await this.cache.fm.handleFilterEvent("Hiding Elements", "Hiding nodes and edges that are not connected to any other node or edge.");
424+
await this.cache.fm.handleFilterEvent(
425+
"Hiding Elements",
426+
"Hiding nodes and edges that are not connected to any other node or edge.",
427+
null,
428+
false
429+
);
425430
}
426431

427432
async showDanglingElements() {
@@ -431,8 +436,12 @@ class GraphCoreManager {
431436
// Update bubble groups to restore hidden dangling nodes
432437
await this.cache.bs.updateBubbleSetIfChanged();
433438

434-
await this.cache.fm.handleFilterEvent("Showing Elements",
435-
"Showing all previously hidden nodes and edges that are not connected to any other node or edge.");
439+
await this.cache.fm.handleFilterEvent(
440+
"Showing Elements",
441+
"Showing all previously hidden nodes and edges that are not connected to any other node or edge.",
442+
null,
443+
false
444+
);
436445
}
437446

438447
async focusNodes(nodeIDs = undefined) {
@@ -930,4 +939,4 @@ class GraphCoreManager {
930939
}
931940

932941

933-
export {GraphCoreManager};
942+
export {GraphCoreManager};

src/graph/filter.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,17 @@ class GraphFilterManager {
3535
// Clean up manual bubble groups (remove filtered-out nodes)
3636
this.cache.bs.cleanupManualGroupMembers();
3737

38-
await this.cache.gcm.decideToRenderOrDraw();
38+
// Prevent query reset during preRenderEvent when we explicitly skip it.
39+
if (!shouldResetQuery) {
40+
this.cache.EVENT_LOCKS.QUERY_UPDATE_EVENT = true;
41+
}
42+
try {
43+
await this.cache.gcm.decideToRenderOrDraw();
44+
} finally {
45+
if (!shouldResetQuery) {
46+
this.cache.EVENT_LOCKS.QUERY_UPDATE_EVENT = false;
47+
}
48+
}
3949
}
4050

4151
resetFeatureIsWithinThresholdMaps() {

0 commit comments

Comments
 (0)