Skip to content

Commit a391edd

Browse files
committed
fix(diagram): fix passing of nodes to mermaid converter - #355
1 parent 0a8adcb commit a391edd

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/flowr/internal-session.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import { FlowrInlineTextFile } from '@eagleoutice/flowr/project/context/flowr-fi
3030
import type { FlowrAnalyzer } from '@eagleoutice/flowr/project/flowr-analyzer';
3131
import type { DiagramSelectionMode } from '../diagram';
3232
import type { CfgSimplificationPassName } from '@eagleoutice/flowr/control-flow/cfg-simplification';
33+
import { MermaidDefaultMarkStyle } from '@eagleoutice/flowr/util/mermaid/info';
3334

3435
const logLevelToScore = {
3536
Silly: LogLevel.Silly,
@@ -261,7 +262,7 @@ export class FlowrInternalSession implements FlowrSession {
261262

262263
return normalizedAstToMermaid(result.ast, {
263264
includeOnlyIds: selectionMode === 'hide' ? selectionNodes : undefined,
264-
mark: selectionMode === 'highlight' ? new Set(selectionNodes) : undefined,
265+
mark: selectionMode === 'highlight' ? selectionNodes : undefined,
265266
});
266267
}, 'ast', true, '');
267268
}
@@ -275,8 +276,9 @@ export class FlowrInternalSession implements FlowrSession {
275276

276277
return cfgToMermaid(result, ast, {
277278
includeOnlyIds: selectionMode === 'hide' ? selectionNodes : undefined,
278-
mark: selectionMode === 'highlight' ? new Set(selectionNodes?.values().map(v => String(v))) : undefined,
279-
simplify: simplified
279+
mark: selectionMode === 'highlight' ? selectionNodes : undefined,
280+
simplify: simplified,
281+
markStyle: MermaidDefaultMarkStyle
280282
});
281283
}, 'cfg', true, '');
282284
}

src/flowr/server-session.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { extractCfgQuick } from '@eagleoutice/flowr/control-flow/extract-cfg';
2929
import { getConfig, isVerbose, Settings } from '../settings';
3030
import type { DiagramSelectionMode } from '../diagram';
3131
import type { CfgSimplificationPassName } from '@eagleoutice/flowr/control-flow/cfg-simplification';
32+
import { MermaidDefaultMarkStyle } from '@eagleoutice/flowr/util/mermaid/info';
3233

3334
export class FlowrServerSession implements FlowrSession {
3435

@@ -186,7 +187,7 @@ export class FlowrServerSession implements FlowrSession {
186187

187188
return normalizedAstToMermaid(response.results.normalize.ast, {
188189
includeOnlyIds: selectionMode === 'hide' ? selectionNodes : undefined,
189-
mark: selectionMode === 'highlight' ? new Set(selectionNodes?.values().map(v => String(v))) : undefined,
190+
mark: selectionMode === 'highlight' ? selectionNodes : undefined,
190191
});
191192
}
192193

@@ -200,8 +201,9 @@ export class FlowrServerSession implements FlowrSession {
200201
};
201202
return cfgToMermaid(extractCfgQuick(normalize), normalize, {
202203
includeOnlyIds: selectionMode === 'hide' ? selectionNodes : undefined,
203-
mark: selectionMode === 'highlight' ? new Set(selectionNodes?.values().map(v => String(v))) : undefined,
204-
simplify: simplified
204+
mark: selectionMode === 'highlight' ? selectionNodes : undefined,
205+
simplify: simplified,
206+
markStyle: MermaidDefaultMarkStyle
205207
});
206208
}
207209

0 commit comments

Comments
 (0)