Skip to content

Commit 1e73e34

Browse files
committed
Fix filter breaks with unexpanded nodes
1 parent 4d83978 commit 1e73e34

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

APIServer/public/js/GraphRedex.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ interface GRND extends NodeData {
3232
_id: string;
3333
_key: string;
3434
term: Awaitable<string>;
35-
_stuck: boolean;
35+
_stuck?: boolean;
3636
_limited?: boolean;
3737
_expanded: boolean;
3838
_pict?: Awaitable<string>;
@@ -108,7 +108,7 @@ export default class GraphRedex<N extends GRND, E extends GRED> {
108108
nodeOptions: (node) => {
109109
let ret = [] as Array<ShowerOptionData>;
110110

111-
if (node.data._stuck === false) {
111+
if ((node.data._stuck ?? false) === false) {
112112
ret.push({
113113
name: "Expand node",
114114
size: 4,
@@ -172,7 +172,7 @@ export default class GraphRedex<N extends GRND, E extends GRED> {
172172
"start",
173173
(d) => d.data._id === this.curExample.baseTerm,
174174
)
175-
.classed("stuck", (d) => d.data._stuck);
175+
.classed("stuck", (d) => d.data._stuck ?? false);
176176

177177
nodes.on("dblclick", (d) => {
178178
d3.event.preventDefault();
@@ -288,7 +288,7 @@ export default class GraphRedex<N extends GRND, E extends GRED> {
288288
<hr>
289289
<pre style="max-width: 100%;white-space: pre-wrap;">${renderedTerm}</pre>
290290
${
291-
nd._stuck
291+
nd._stuck ?? false
292292
? "<br>This term has no further reductions."
293293
: ""
294294
}
@@ -1182,8 +1182,8 @@ function isInputDataArray<N extends GRND, E extends GRED>(
11821182
"_id" in x &&
11831183
"_key" in x &&
11841184
"term" in x &&
1185-
"_stuck" in x &&
1186-
"_expanded" in x,
1185+
"_expanded" in x &&
1186+
("_stuck" in x || x._expanded === false),
11871187
) &&
11881188
edges.every(
11891189
(x) =>

0 commit comments

Comments
 (0)