Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11

This commit is contained in:
Knut Sveidqvist
2024-06-12 12:38:29 +02:00
10 changed files with 37 additions and 22 deletions

View File

@@ -822,8 +822,6 @@ export const getData = () => {
const nodes: Node[] = [];
const edges: Edge[] = [];
// extract(getRootDocV2());
// const diagramStates = getStates();
const subGraphs = getSubGraphs();
log.info('Subgraphs - APA12', subGraphs);
const parentDB = new Map<string, string>();

View File

@@ -61,11 +61,9 @@ const setupDoc = (parentParsedItem, doc, diagramStates, nodes, edges, altFlag, l
switch (item.stmt) {
case STMT_STATE:
dataFetcher(parentParsedItem, item, diagramStates, nodes, edges, altFlag, look);
break;
case DEFAULT_STATE_TYPE:
dataFetcher(parentParsedItem, item, diagramStates, nodes, edges, altFlag, look);
break;
case STMT_RELATION:
{

View File

@@ -230,7 +230,7 @@ const extract = (_doc) => {
const config = getConfig();
const look = config.look;
resetDataFetching();
dataFetcher(undefined, getRootDocV2(), diagramStates, nodes, edges, true,look);
dataFetcher(undefined, getRootDocV2(), diagramStates, nodes, edges, true, look);
};
/**

View File

@@ -20,7 +20,7 @@ export const doublecircle = async (parent: SVGAElement, node: Node): Promise<SVG
let circleGroup;
const { cssStyles } = node;
if (node.look === 'handdrawn') {e
if (node.look === 'handdrawn') {
// @ts-ignore - rough is not typed
const rc = rough.svg(shapeSvg);
const outerOptions = userNodeOverrides(node, { roughness: 0.2, strokeWidth: 2.5 });

View File

@@ -32,6 +32,7 @@ export const drawRect = async (parent: SVGAElement, node: Node, options: RectOpt
rx = options.rx;
ry = options.ry;
}
if (node.look === 'handdrawn') {
// @ts-ignore TODO: Fix rough typings
const rc = rough.svg(shapeSvg);

View File

@@ -37,7 +37,7 @@ export const trapezoid = async (parent: SVGAElement, node: Node): Promise<SVGAEl
const { cssStyles } = node;
if (node.look === 'handdrawn') {
console.log('Trapezoid: Inside use handdrawn');
console.log('Trapezoid: Inside handdrawn block');
// @ts-ignore
const rc = rough.svg(shapeSvg);
const options = userNodeOverrides(node, {});

View File

@@ -133,4 +133,4 @@ export function insertPolygonShape(parent, w, h, points) {
}
export const getNodeClasses = (node, extra) =>
(node.useRough ? 'rough-node' : 'node') + ' ' + node.cssClasses + ' ' + (extra || '');
(node.look === 'handdrawn' ? 'rough-node' : 'node') + ' ' + node.cssClasses + ' ' + (extra || '');

View File

@@ -62,7 +62,6 @@ interface Node {
x?: number;
y?: number;
// Added look to handle
look?: string;
}
@@ -94,7 +93,6 @@ interface Edge {
minlen?: number;
pattern?: string;
thickness?: 'normal' | 'thick' | 'invisible';
look?: string;
}

View File

@@ -78,7 +78,6 @@ properties:
enum:
- classic
- handdrawn
- slick
default: 'classic'
handdrawnSeed:
description: |