system-canvas 0.1.0
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/canvas.d.ts +28 -0
- package/dist/canvas.d.ts.map +1 -0
- package/dist/canvas.js +95 -0
- package/dist/canvas.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/rendering/anchor-points.d.ts +16 -0
- package/dist/rendering/anchor-points.d.ts.map +1 -0
- package/dist/rendering/anchor-points.js +53 -0
- package/dist/rendering/anchor-points.js.map +1 -0
- package/dist/rendering/edge-routing.d.ts +10 -0
- package/dist/rendering/edge-routing.d.ts.map +1 -0
- package/dist/rendering/edge-routing.js +109 -0
- package/dist/rendering/edge-routing.js.map +1 -0
- package/dist/rendering/index.d.ts +4 -0
- package/dist/rendering/index.d.ts.map +1 -0
- package/dist/rendering/index.js +4 -0
- package/dist/rendering/index.js.map +1 -0
- package/dist/rendering/viewport-math.d.ts +25 -0
- package/dist/rendering/viewport-math.d.ts.map +1 -0
- package/dist/rendering/viewport-math.js +66 -0
- package/dist/rendering/viewport-math.js.map +1 -0
- package/dist/themes/blueprint.d.ts +7 -0
- package/dist/themes/blueprint.d.ts.map +1 -0
- package/dist/themes/blueprint.js +62 -0
- package/dist/themes/blueprint.js.map +1 -0
- package/dist/themes/dark.d.ts +7 -0
- package/dist/themes/dark.d.ts.map +1 -0
- package/dist/themes/dark.js +62 -0
- package/dist/themes/dark.js.map +1 -0
- package/dist/themes/index.d.ts +7 -0
- package/dist/themes/index.d.ts.map +1 -0
- package/dist/themes/index.js +7 -0
- package/dist/themes/index.js.map +1 -0
- package/dist/themes/light.d.ts +7 -0
- package/dist/themes/light.d.ts.map +1 -0
- package/dist/themes/light.js +62 -0
- package/dist/themes/light.js.map +1 -0
- package/dist/themes/midnight.d.ts +7 -0
- package/dist/themes/midnight.d.ts.map +1 -0
- package/dist/themes/midnight.js +62 -0
- package/dist/themes/midnight.js.map +1 -0
- package/dist/themes/resolve.d.ts +17 -0
- package/dist/themes/resolve.d.ts.map +1 -0
- package/dist/themes/resolve.js +88 -0
- package/dist/themes/resolve.js.map +1 -0
- package/dist/themes/warm.d.ts +7 -0
- package/dist/themes/warm.d.ts.map +1 -0
- package/dist/themes/warm.js +62 -0
- package/dist/themes/warm.js.map +1 -0
- package/dist/types.d.ts +191 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/package.json +25 -0
package/dist/canvas.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { CanvasData, CanvasNode, CanvasEdge, ResolvedNode, CanvasTheme } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve all nodes in a canvas, applying category defaults and color resolution.
|
|
4
|
+
*
|
|
5
|
+
* If the canvas includes a `theme` hint with inline categories, those are
|
|
6
|
+
* merged into the active theme before resolving nodes.
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveCanvas(canvas: CanvasData, theme: CanvasTheme): {
|
|
9
|
+
nodes: ResolvedNode[];
|
|
10
|
+
edges: CanvasEdge[];
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Build a lookup map from node IDs to resolved nodes.
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildNodeMap(nodes: ResolvedNode[]): Map<string, ResolvedNode>;
|
|
16
|
+
/**
|
|
17
|
+
* Get the display label for a node (used in breadcrumbs, tooltips, etc.).
|
|
18
|
+
*/
|
|
19
|
+
export declare function getNodeLabel(node: CanvasNode): string;
|
|
20
|
+
/**
|
|
21
|
+
* Determine which nodes are spatially contained within a group node.
|
|
22
|
+
*/
|
|
23
|
+
export declare function getGroupChildren(group: ResolvedNode, allNodes: ResolvedNode[]): ResolvedNode[];
|
|
24
|
+
/**
|
|
25
|
+
* Validate a canvas document. Returns an array of error messages (empty if valid).
|
|
26
|
+
*/
|
|
27
|
+
export declare function validateCanvas(canvas: CanvasData): string[];
|
|
28
|
+
//# sourceMappingURL=canvas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canvas.d.ts","sourceRoot":"","sources":["../src/canvas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAG/F;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,WAAW,GACjB;IAAE,KAAK,EAAE,YAAY,EAAE,CAAC;IAAC,KAAK,EAAE,UAAU,EAAE,CAAA;CAAE,CAYhD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,YAAY,EAAE,GACpB,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAM3B;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAYrD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,YAAY,EAAE,GACvB,YAAY,EAAE,CAShB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,EAAE,CA4B3D"}
|
package/dist/canvas.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { resolveNode } from './themes/resolve.js';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve all nodes in a canvas, applying category defaults and color resolution.
|
|
4
|
+
*
|
|
5
|
+
* If the canvas includes a `theme` hint with inline categories, those are
|
|
6
|
+
* merged into the active theme before resolving nodes.
|
|
7
|
+
*/
|
|
8
|
+
export function resolveCanvas(canvas, theme) {
|
|
9
|
+
// Merge canvas-level categories into the theme
|
|
10
|
+
const effectiveTheme = canvas.theme?.categories
|
|
11
|
+
? {
|
|
12
|
+
...theme,
|
|
13
|
+
categories: { ...theme.categories, ...canvas.theme.categories },
|
|
14
|
+
}
|
|
15
|
+
: theme;
|
|
16
|
+
const nodes = (canvas.nodes ?? []).map((n) => resolveNode(n, effectiveTheme));
|
|
17
|
+
const edges = canvas.edges ?? [];
|
|
18
|
+
return { nodes, edges };
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Build a lookup map from node IDs to resolved nodes.
|
|
22
|
+
*/
|
|
23
|
+
export function buildNodeMap(nodes) {
|
|
24
|
+
const map = new Map();
|
|
25
|
+
for (const node of nodes) {
|
|
26
|
+
map.set(node.id, node);
|
|
27
|
+
}
|
|
28
|
+
return map;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get the display label for a node (used in breadcrumbs, tooltips, etc.).
|
|
32
|
+
*/
|
|
33
|
+
export function getNodeLabel(node) {
|
|
34
|
+
if (node.type === 'group' && node.label)
|
|
35
|
+
return node.label;
|
|
36
|
+
if (node.type === 'text' && node.text) {
|
|
37
|
+
// Use first line of text, truncated
|
|
38
|
+
const firstLine = node.text.split('\n')[0];
|
|
39
|
+
return firstLine.length > 40
|
|
40
|
+
? firstLine.slice(0, 37) + '...'
|
|
41
|
+
: firstLine;
|
|
42
|
+
}
|
|
43
|
+
if (node.type === 'file' && node.file)
|
|
44
|
+
return node.file;
|
|
45
|
+
if (node.type === 'link' && node.url)
|
|
46
|
+
return node.url;
|
|
47
|
+
return node.id;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Determine which nodes are spatially contained within a group node.
|
|
51
|
+
*/
|
|
52
|
+
export function getGroupChildren(group, allNodes) {
|
|
53
|
+
return allNodes.filter((n) => n.id !== group.id &&
|
|
54
|
+
n.x >= group.x &&
|
|
55
|
+
n.y >= group.y &&
|
|
56
|
+
n.x + n.width <= group.x + group.width &&
|
|
57
|
+
n.y + n.height <= group.y + group.height);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Validate a canvas document. Returns an array of error messages (empty if valid).
|
|
61
|
+
*/
|
|
62
|
+
export function validateCanvas(canvas) {
|
|
63
|
+
const errors = [];
|
|
64
|
+
const nodeIds = new Set();
|
|
65
|
+
for (const node of canvas.nodes ?? []) {
|
|
66
|
+
if (!node.id)
|
|
67
|
+
errors.push('Node missing id');
|
|
68
|
+
if (!node.type)
|
|
69
|
+
errors.push(`Node ${node.id}: missing type`);
|
|
70
|
+
if (node.x == null)
|
|
71
|
+
errors.push(`Node ${node.id}: missing x`);
|
|
72
|
+
if (node.y == null)
|
|
73
|
+
errors.push(`Node ${node.id}: missing y`);
|
|
74
|
+
if (nodeIds.has(node.id)) {
|
|
75
|
+
errors.push(`Duplicate node id: ${node.id}`);
|
|
76
|
+
}
|
|
77
|
+
nodeIds.add(node.id);
|
|
78
|
+
}
|
|
79
|
+
for (const edge of canvas.edges ?? []) {
|
|
80
|
+
if (!edge.id)
|
|
81
|
+
errors.push('Edge missing id');
|
|
82
|
+
if (!edge.fromNode)
|
|
83
|
+
errors.push(`Edge ${edge.id}: missing fromNode`);
|
|
84
|
+
if (!edge.toNode)
|
|
85
|
+
errors.push(`Edge ${edge.id}: missing toNode`);
|
|
86
|
+
if (edge.fromNode && !nodeIds.has(edge.fromNode)) {
|
|
87
|
+
errors.push(`Edge ${edge.id}: fromNode "${edge.fromNode}" not found`);
|
|
88
|
+
}
|
|
89
|
+
if (edge.toNode && !nodeIds.has(edge.toNode)) {
|
|
90
|
+
errors.push(`Edge ${edge.id}: toNode "${edge.toNode}" not found`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return errors;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=canvas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canvas.js","sourceRoot":"","sources":["../src/canvas.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAEjD;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAC3B,MAAkB,EAClB,KAAkB;IAEl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QACnE,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type { CanvasColor, NodeType, Side, EndShape, EdgeStyle, BackgroundStyle, CanvasNode, CanvasEdge, CanvasData, CanvasThemeHint, CategoryDefinition, PresetColor, GridConfig, RefIndicatorConfig, NodeTheme, EdgeTheme, GroupTheme, BreadcrumbTheme, CanvasTheme, ResolvedNode, AnchorPoint, ViewportState, BreadcrumbEntry, BoundingBox, ContextMenuEvent, } from './types.js';
|
|
2
|
+
export { darkTheme, midnightTheme, lightTheme, blueprintTheme, warmTheme, resolveTheme, resolveColor, resolveNode, } from './themes/index.js';
|
|
3
|
+
export { computeAnchorPoint, inferSide, computeEdgePath, computeEdgeMidpoint, computeBoundingBox, fitToBounds, screenToCanvas, canvasToScreen, } from './rendering/index.js';
|
|
4
|
+
export { resolveCanvas, buildNodeMap, getNodeLabel, getGroupChildren, validateCanvas, } from './canvas.js';
|
|
5
|
+
export declare const themes: {
|
|
6
|
+
readonly dark: import("./types.js").CanvasTheme;
|
|
7
|
+
readonly midnight: import("./types.js").CanvasTheme;
|
|
8
|
+
readonly light: import("./types.js").CanvasTheme;
|
|
9
|
+
readonly blueprint: import("./types.js").CanvasTheme;
|
|
10
|
+
readonly warm: import("./types.js").CanvasTheme;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EACV,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,eAAe,EACf,UAAU,EACV,UAAU,EACV,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,UAAU,EACV,eAAe,EACf,WAAW,EACX,YAAY,EACZ,WAAW,EACX,aAAa,EACb,eAAe,EACf,WAAW,EACX,gBAAgB,GACjB,MAAM,YAAY,CAAA;AAGnB,OAAO,EACL,SAAS,EACT,aAAa,EACb,UAAU,EACV,cAAc,EACd,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,WAAW,GACZ,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,cAAc,GACf,MAAM,sBAAsB,CAAA;AAG7B,OAAO,EACL,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,cAAc,GACf,MAAM,aAAa,CAAA;AASpB,eAAO,MAAM,MAAM;;;;;;CAMT,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Themes
|
|
2
|
+
export { darkTheme, midnightTheme, lightTheme, blueprintTheme, warmTheme, resolveTheme, resolveColor, resolveNode, } from './themes/index.js';
|
|
3
|
+
// Rendering utilities
|
|
4
|
+
export { computeAnchorPoint, inferSide, computeEdgePath, computeEdgeMidpoint, computeBoundingBox, fitToBounds, screenToCanvas, canvasToScreen, } from './rendering/index.js';
|
|
5
|
+
// Canvas helpers
|
|
6
|
+
export { resolveCanvas, buildNodeMap, getNodeLabel, getGroupChildren, validateCanvas, } from './canvas.js';
|
|
7
|
+
// Convenience theme collection
|
|
8
|
+
import { darkTheme as _dark } from './themes/dark.js';
|
|
9
|
+
import { midnightTheme as _midnight } from './themes/midnight.js';
|
|
10
|
+
import { lightTheme as _light } from './themes/light.js';
|
|
11
|
+
import { blueprintTheme as _blueprint } from './themes/blueprint.js';
|
|
12
|
+
import { warmTheme as _warm } from './themes/warm.js';
|
|
13
|
+
export const themes = {
|
|
14
|
+
dark: _dark,
|
|
15
|
+
midnight: _midnight,
|
|
16
|
+
light: _light,
|
|
17
|
+
blueprint: _blueprint,
|
|
18
|
+
warm: _warm,
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA6BA,SAAS;AACT,OAAO,EACL,SAAS,EACT,aAAa,EACb,UAAU,EACV,cAAc,EACd,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,WAAW,GACZ,MAAM,mBAAmB,CAAA;AAE1B,sBAAsB;AACtB,OAAO,EACL,kBAAkB,EAClB,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,cAAc,GACf,MAAM,sBAAsB,CAAA;AAE7B,iBAAiB;AACjB,OAAO,EACL,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,cAAc,GACf,MAAM,aAAa,CAAA;AAEpB,+BAA+B;AAC/B,OAAO,EAAE,SAAS,IAAI,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,aAAa,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EAAE,cAAc,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,EAAE,SAAS,IAAI,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAErD,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,IAAI,EAAE,KAAK;IACX,QAAQ,EAAE,SAAS;IACnB,KAAK,EAAE,MAAM;IACb,SAAS,EAAE,UAAU;IACrB,IAAI,EAAE,KAAK;CACH,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ResolvedNode, Side, AnchorPoint } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Compute the anchor point on a node's side.
|
|
4
|
+
* Returns the midpoint of the specified edge of the node's bounding box.
|
|
5
|
+
* If no side is specified, returns the center of the node.
|
|
6
|
+
*/
|
|
7
|
+
export declare function computeAnchorPoint(node: ResolvedNode, side?: Side): AnchorPoint;
|
|
8
|
+
/**
|
|
9
|
+
* Determine the best side to connect from/to based on relative position,
|
|
10
|
+
* when no explicit side is specified.
|
|
11
|
+
*/
|
|
12
|
+
export declare function inferSide(from: ResolvedNode, to: ResolvedNode): {
|
|
13
|
+
fromSide: Side;
|
|
14
|
+
toSide: Side;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=anchor-points.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anchor-points.d.ts","sourceRoot":"","sources":["../../src/rendering/anchor-points.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAElE;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,YAAY,EAClB,IAAI,CAAC,EAAE,IAAI,GACV,WAAW,CAgBb;AAED;;;GAGG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,YAAY,EAClB,EAAE,EAAE,YAAY,GACf;IAAE,QAAQ,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,IAAI,CAAA;CAAE,CAyBlC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compute the anchor point on a node's side.
|
|
3
|
+
* Returns the midpoint of the specified edge of the node's bounding box.
|
|
4
|
+
* If no side is specified, returns the center of the node.
|
|
5
|
+
*/
|
|
6
|
+
export function computeAnchorPoint(node, side) {
|
|
7
|
+
const cx = node.x + node.width / 2;
|
|
8
|
+
const cy = node.y + node.height / 2;
|
|
9
|
+
switch (side) {
|
|
10
|
+
case 'top':
|
|
11
|
+
return { x: cx, y: node.y };
|
|
12
|
+
case 'right':
|
|
13
|
+
return { x: node.x + node.width, y: cy };
|
|
14
|
+
case 'bottom':
|
|
15
|
+
return { x: cx, y: node.y + node.height };
|
|
16
|
+
case 'left':
|
|
17
|
+
return { x: node.x, y: cy };
|
|
18
|
+
default:
|
|
19
|
+
return { x: cx, y: cy };
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Determine the best side to connect from/to based on relative position,
|
|
24
|
+
* when no explicit side is specified.
|
|
25
|
+
*/
|
|
26
|
+
export function inferSide(from, to) {
|
|
27
|
+
const fromCx = from.x + from.width / 2;
|
|
28
|
+
const fromCy = from.y + from.height / 2;
|
|
29
|
+
const toCx = to.x + to.width / 2;
|
|
30
|
+
const toCy = to.y + to.height / 2;
|
|
31
|
+
const dx = toCx - fromCx;
|
|
32
|
+
const dy = toCy - fromCy;
|
|
33
|
+
// Determine primary axis of connection
|
|
34
|
+
if (Math.abs(dx) > Math.abs(dy)) {
|
|
35
|
+
// Horizontal connection
|
|
36
|
+
if (dx > 0) {
|
|
37
|
+
return { fromSide: 'right', toSide: 'left' };
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
return { fromSide: 'left', toSide: 'right' };
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
// Vertical connection
|
|
45
|
+
if (dy > 0) {
|
|
46
|
+
return { fromSide: 'bottom', toSide: 'top' };
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
return { fromSide: 'top', toSide: 'bottom' };
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=anchor-points.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anchor-points.js","sourceRoot":"","sources":["../../src/rendering/anchor-points.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAChC,IAAkB,EAClB,IAAW;IAEX,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA;IAClC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,GAAG,I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E,CAAC;QAChC,wBAAwB;QACxB,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;YACX,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;QAC9C,CAAC;aAAM,CAAC;YACN,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,CAAA;QAC9C,CAAC;IACH,CAAC;SAAM,CAAC;QACN,sBAAsB;QACtB,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;YACX,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,CAAA;QAC9C,CAAC;aAAM,CAAC;YACN,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAA;QAC9C,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CanvasEdge, ResolvedNode, EdgeStyle, AnchorPoint } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Compute the SVG path `d` attribute for an edge between two nodes.
|
|
4
|
+
*/
|
|
5
|
+
export declare function computeEdgePath(edge: CanvasEdge, fromNode: ResolvedNode, toNode: ResolvedNode, style?: EdgeStyle): string;
|
|
6
|
+
/**
|
|
7
|
+
* Compute the midpoint of an edge path (for label placement).
|
|
8
|
+
*/
|
|
9
|
+
export declare function computeEdgeMidpoint(edge: CanvasEdge, fromNode: ResolvedNode, toNode: ResolvedNode): AnchorPoint;
|
|
10
|
+
//# sourceMappingURL=edge-routing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edge-routing.d.ts","sourceRoot":"","sources":["../../src/rendering/edge-routing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,SAAS,EACT,WAAW,EACZ,MAAM,aAAa,CAAA;AAGpB;;GAEG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,YAAY,EACpB,KAAK,GAAE,SAAoB,GAC1B,MAAM,CAoBR;AAgFD;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,YAAY,GACnB,WAAW,CA8Bb"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { computeAnchorPoint, inferSide } from './anchor-points.js';
|
|
2
|
+
/**
|
|
3
|
+
* Compute the SVG path `d` attribute for an edge between two nodes.
|
|
4
|
+
*/
|
|
5
|
+
export function computeEdgePath(edge, fromNode, toNode, style = 'bezier') {
|
|
6
|
+
// Determine connection sides
|
|
7
|
+
const inferred = inferSide(fromNode, toNode);
|
|
8
|
+
const fromSide = edge.fromSide ?? inferred.fromSide;
|
|
9
|
+
const toSide = edge.toSide ?? inferred.toSide;
|
|
10
|
+
const from = computeAnchorPoint(fromNode, fromSide);
|
|
11
|
+
const to = computeAnchorPoint(toNode, toSide);
|
|
12
|
+
const effectiveStyle = edge.style ?? style;
|
|
13
|
+
switch (effectiveStyle) {
|
|
14
|
+
case 'straight':
|
|
15
|
+
return computeStraightPath(from, to);
|
|
16
|
+
case 'orthogonal':
|
|
17
|
+
return computeOrthogonalPath(from, to, fromSide, toSide);
|
|
18
|
+
case 'bezier':
|
|
19
|
+
default:
|
|
20
|
+
return computeBezierPath(from, to, fromSide, toSide);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/** Straight line between two points. */
|
|
24
|
+
function computeStraightPath(from, to) {
|
|
25
|
+
return `M ${from.x} ${from.y} L ${to.x} ${to.y}`;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Cubic bezier curve with control points offset along the connection sides.
|
|
29
|
+
* Uses a tightness factor of 0.75 (matching the Obsidian reference).
|
|
30
|
+
*/
|
|
31
|
+
function computeBezierPath(from, to, fromSide, toSide) {
|
|
32
|
+
const dist = Math.sqrt((to.x - from.x) ** 2 + (to.y - from.y) ** 2);
|
|
33
|
+
const offset = Math.max(50, dist * 0.4);
|
|
34
|
+
const cp1 = controlPointOffset(from, fromSide, offset);
|
|
35
|
+
const cp2 = controlPointOffset(to, toSide, offset);
|
|
36
|
+
return `M ${from.x} ${from.y} C ${cp1.x} ${cp1.y}, ${cp2.x} ${cp2.y}, ${to.x} ${to.y}`;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Orthogonal (right-angle) path routing.
|
|
40
|
+
* Creates an L-shaped or Z-shaped path depending on relative positions.
|
|
41
|
+
*/
|
|
42
|
+
function computeOrthogonalPath(from, to, fromSide, toSide) {
|
|
43
|
+
const midX = (from.x + to.x) / 2;
|
|
44
|
+
const midY = (from.y + to.y) / 2;
|
|
45
|
+
// Determine routing based on the sides involved
|
|
46
|
+
const isFromHorizontal = fromSide === 'left' || fromSide === 'right';
|
|
47
|
+
const isToHorizontal = toSide === 'left' || toSide === 'right';
|
|
48
|
+
if (isFromHorizontal && isToHorizontal) {
|
|
49
|
+
// Both horizontal: route through midX
|
|
50
|
+
return `M ${from.x} ${from.y} L ${midX} ${from.y} L ${midX} ${to.y} L ${to.x} ${to.y}`;
|
|
51
|
+
}
|
|
52
|
+
else if (!isFromHorizontal && !isToHorizontal) {
|
|
53
|
+
// Both vertical: route through midY
|
|
54
|
+
return `M ${from.x} ${from.y} L ${from.x} ${midY} L ${to.x} ${midY} L ${to.x} ${to.y}`;
|
|
55
|
+
}
|
|
56
|
+
else if (isFromHorizontal && !isToHorizontal) {
|
|
57
|
+
// From horizontal, to vertical: L-shape
|
|
58
|
+
return `M ${from.x} ${from.y} L ${to.x} ${from.y} L ${to.x} ${to.y}`;
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
// From vertical, to horizontal: L-shape
|
|
62
|
+
return `M ${from.x} ${from.y} L ${from.x} ${to.y} L ${to.x} ${to.y}`;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Offset a point along the direction of a side for bezier control points.
|
|
67
|
+
*/
|
|
68
|
+
function controlPointOffset(point, side, offset) {
|
|
69
|
+
switch (side) {
|
|
70
|
+
case 'top':
|
|
71
|
+
return { x: point.x, y: point.y - offset };
|
|
72
|
+
case 'bottom':
|
|
73
|
+
return { x: point.x, y: point.y + offset };
|
|
74
|
+
case 'left':
|
|
75
|
+
return { x: point.x - offset, y: point.y };
|
|
76
|
+
case 'right':
|
|
77
|
+
return { x: point.x + offset, y: point.y };
|
|
78
|
+
default:
|
|
79
|
+
return point;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Compute the midpoint of an edge path (for label placement).
|
|
84
|
+
*/
|
|
85
|
+
export function computeEdgeMidpoint(edge, fromNode, toNode) {
|
|
86
|
+
const inferred = inferSide(fromNode, toNode);
|
|
87
|
+
const fromSide = edge.fromSide ?? inferred.fromSide;
|
|
88
|
+
const toSide = edge.toSide ?? inferred.toSide;
|
|
89
|
+
const from = computeAnchorPoint(fromNode, fromSide);
|
|
90
|
+
const to = computeAnchorPoint(toNode, toSide);
|
|
91
|
+
// For the midpoint, we use the bezier curve midpoint (t=0.5)
|
|
92
|
+
const dist = Math.sqrt((to.x - from.x) ** 2 + (to.y - from.y) ** 2);
|
|
93
|
+
const offset = Math.max(50, dist * 0.4);
|
|
94
|
+
const cp1 = controlPointOffset(from, fromSide, offset);
|
|
95
|
+
const cp2 = controlPointOffset(to, toSide, offset);
|
|
96
|
+
// Cubic bezier at t=0.5
|
|
97
|
+
const t = 0.5;
|
|
98
|
+
const mt = 1 - t;
|
|
99
|
+
const x = mt * mt * mt * from.x +
|
|
100
|
+
3 * mt * mt * t * cp1.x +
|
|
101
|
+
3 * mt * t * t * cp2.x +
|
|
102
|
+
t * t * t * to.x;
|
|
103
|
+
const y = mt * mt * mt * from.y +
|
|
104
|
+
3 * mt * mt * t * cp1.y +
|
|
105
|
+
3 * mt * t * t * cp2.y +
|
|
106
|
+
t * t * t * to.y;
|
|
107
|
+
return { x, y };
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=edge-routing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edge-routing.js","sourceRoot":"","sources":["../../src/rendering/edge-routing.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAElE;;GAEG;AACH,MAAM,UAAU,eAAe,CAC7B,IAAgB,EAChB,QAAsB,EACtB,MAAoB,EACpB,QAAmB,QAAQ;IAE3B,6BAA6B;IAC7B,MAAM,QAAQ,GAAG,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;IAC5C,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAA;IACnD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAA;IAE7C,MAAM,IAAI,GAAG,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IACnD,MAAM,EAAE,GAAG,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAE7C,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,IAAI,KAAK,CAAA;IAE1C,QAAQ,cAAc,EAAE,CAAC;QACvB,KAAK,UAAU;YACb,OAAO,mBAAmB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;QACtC,KAAK,YAAY;YACf,OAAO,qBAAqB,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;QAC1D,KAAK,QAAQ,CAAC;QACd;YACE,OAAO,iBAAiB,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;IACxD,CAAC;AACH,CAAC;AAED,wCAAwC;AACxC,SAAS,mBAAmB,CAAC,IAAiB,EAAE,EAAe;IAC7D,OAAO,KAAK,IAAI,CA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GAAG,CAAC,CAAA;IAEvC,MAAM,GAAG,GAAG,kBAAkB,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;IACtD,MAAM,GAAG,GAAG,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IAElD,wBAAwB;IACxB,MAAM,CAAC,GAAG,GAAG,CAAA;IACb,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAA;IAChB,MAAM,CAAC,GACL,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;QACrB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;QACvB,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;QACtB,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;IAClB,MAAM,CAAC,GACL,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;QACrB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;QACvB,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;QACtB,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;IAElB,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAA;AACjB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { computeAnchorPoint, inferSide } from './anchor-points.js';
|
|
2
|
+
export { computeEdgePath, computeEdgeMidpoint } from './edge-routing.js';
|
|
3
|
+
export { computeBoundingBox, fitToBounds, screenToCanvas, canvasToScreen, } from './viewport-math.js';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rendering/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAClE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACxE,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,cAAc,GACf,MAAM,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { computeAnchorPoint, inferSide } from './anchor-points.js';
|
|
2
|
+
export { computeEdgePath, computeEdgeMidpoint } from './edge-routing.js';
|
|
3
|
+
export { computeBoundingBox, fitToBounds, screenToCanvas, canvasToScreen, } from './viewport-math.js';
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rendering/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAClE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACxE,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,cAAc,GACf,MAAM,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ResolvedNode, BoundingBox, ViewportState } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Compute the bounding box of all nodes.
|
|
4
|
+
*/
|
|
5
|
+
export declare function computeBoundingBox(nodes: ResolvedNode[]): BoundingBox;
|
|
6
|
+
/**
|
|
7
|
+
* Compute a viewport transform that fits all nodes into the given
|
|
8
|
+
* viewport dimensions with padding.
|
|
9
|
+
*/
|
|
10
|
+
export declare function fitToBounds(nodes: ResolvedNode[], viewportWidth: number, viewportHeight: number, padding?: number): ViewportState;
|
|
11
|
+
/**
|
|
12
|
+
* Convert a screen-space point to canvas-space given the current viewport.
|
|
13
|
+
*/
|
|
14
|
+
export declare function screenToCanvas(screenX: number, screenY: number, viewport: ViewportState): {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Convert a canvas-space point to screen-space given the current viewport.
|
|
20
|
+
*/
|
|
21
|
+
export declare function canvasToScreen(canvasX: number, canvasY: number, viewport: ViewportState): {
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=viewport-math.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewport-math.d.ts","sourceRoot":"","sources":["../../src/rendering/viewport-math.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,aAAa,EACd,MAAM,aAAa,CAAA;AAEpB;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,WAAW,CAyBrE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,YAAY,EAAE,EACrB,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,EACtB,OAAO,GAAE,MAAW,GACnB,aAAa,CAsBf;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,aAAa,GACtB;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAK1B;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,aAAa,GACtB;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAK1B"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compute the bounding box of all nodes.
|
|
3
|
+
*/
|
|
4
|
+
export function computeBoundingBox(nodes) {
|
|
5
|
+
if (nodes.length === 0) {
|
|
6
|
+
return { minX: 0, minY: 0, maxX: 0, maxY: 0, width: 0, height: 0 };
|
|
7
|
+
}
|
|
8
|
+
let minX = Infinity;
|
|
9
|
+
let minY = Infinity;
|
|
10
|
+
let maxX = -Infinity;
|
|
11
|
+
let maxY = -Infinity;
|
|
12
|
+
for (const node of nodes) {
|
|
13
|
+
minX = Math.min(minX, node.x);
|
|
14
|
+
minY = Math.min(minY, node.y);
|
|
15
|
+
maxX = Math.max(maxX, node.x + node.width);
|
|
16
|
+
maxY = Math.max(maxY, node.y + node.height);
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
minX,
|
|
20
|
+
minY,
|
|
21
|
+
maxX,
|
|
22
|
+
maxY,
|
|
23
|
+
width: maxX - minX,
|
|
24
|
+
height: maxY - minY,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Compute a viewport transform that fits all nodes into the given
|
|
29
|
+
* viewport dimensions with padding.
|
|
30
|
+
*/
|
|
31
|
+
export function fitToBounds(nodes, viewportWidth, viewportHeight, padding = 60) {
|
|
32
|
+
const bounds = computeBoundingBox(nodes);
|
|
33
|
+
if (bounds.width === 0 || bounds.height === 0) {
|
|
34
|
+
return { x: 0, y: 0, zoom: 1 };
|
|
35
|
+
}
|
|
36
|
+
const availableWidth = viewportWidth - padding * 2;
|
|
37
|
+
const availableHeight = viewportHeight - padding * 2;
|
|
38
|
+
const scaleX = availableWidth / bounds.width;
|
|
39
|
+
const scaleY = availableHeight / bounds.height;
|
|
40
|
+
const zoom = Math.min(scaleX, scaleY, 2); // cap at 2x
|
|
41
|
+
// Center the content
|
|
42
|
+
const contentCenterX = bounds.minX + bounds.width / 2;
|
|
43
|
+
const contentCenterY = bounds.minY + bounds.height / 2;
|
|
44
|
+
const x = viewportWidth / 2 - contentCenterX * zoom;
|
|
45
|
+
const y = viewportHeight / 2 - contentCenterY * zoom;
|
|
46
|
+
return { x, y, zoom };
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Convert a screen-space point to canvas-space given the current viewport.
|
|
50
|
+
*/
|
|
51
|
+
export function screenToCanvas(screenX, screenY, viewport) {
|
|
52
|
+
return {
|
|
53
|
+
x: (screenX - viewport.x) / viewport.zoom,
|
|
54
|
+
y: (screenY - viewport.y) / viewport.zoom,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Convert a canvas-space point to screen-space given the current viewport.
|
|
59
|
+
*/
|
|
60
|
+
export function canvasToScreen(canvasX, canvasY, viewport) {
|
|
61
|
+
return {
|
|
62
|
+
x: canvasX * viewport.zoom + viewport.x,
|
|
63
|
+
y: canvasY * viewport.zoom + viewport.y,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=viewport-math.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewport-math.js","sourceRoot":"","sources":["../../src/rendering/viewport-math.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAqB;IACtD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAA;IACpE,CAAC;IAED,IAAI,IAAI,GAAG,QAAQ,CAAA;IACnB,IAAI,IAAI,GAAG,QAAQ,CAAA;IACnB,IAAI,IAAI,GAAG,CAAC,QAAQ,CAAA;IACpB,IAAI,IAAI,GAAG,CAAC,QAAQ,CAAA;IAEpB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;QAC7B,IAAI,GAAG,IAAI,CAA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CAAA;IACrD,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,CAAA;IAEtD,MAAM,CAAC,GAAG,aAAa,GAAG,CAAC,GAAG,cAAc,GAAG,IAAI,CAAA;IACnD,MAAM,CAAC,GAAG,cAAc,GAAG,CAAC,GAAG,cAAc,GAAG,IAAI,CAAA;IAEpD,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAA;AACvB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAC5B,OAAe,EACf,OAAe,EACf,QAAuB;IAEvB,OAAO;QACL,CAAC,EAAE,CAAC,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI;QACzC,CAAC,EAAE,CAAC,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI;KAC1C,CAAA;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAC5B,OAAe,EACf,OAAe,EACf,QAAuB;IAEvB,OAAO;QACL,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,CAAC;QACvC,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,CAAC;KACxC,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CanvasTheme } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Blueprint theme — deep blue background, white/light-blue lines.
|
|
4
|
+
* Technical drawing / architectural blueprint aesthetic.
|
|
5
|
+
*/
|
|
6
|
+
export declare const blueprintTheme: CanvasTheme;
|
|
7
|
+
//# sourceMappingURL=blueprint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blueprint.d.ts","sourceRoot":"","sources":["../../src/themes/blueprint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,WAgE5B,CAAA"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Blueprint theme — deep blue background, white/light-blue lines.
|
|
3
|
+
* Technical drawing / architectural blueprint aesthetic.
|
|
4
|
+
*/
|
|
5
|
+
export const blueprintTheme = {
|
|
6
|
+
name: 'blueprint',
|
|
7
|
+
background: '#0a1628',
|
|
8
|
+
grid: {
|
|
9
|
+
size: 48,
|
|
10
|
+
color: '#132244',
|
|
11
|
+
strokeWidth: 0.6,
|
|
12
|
+
},
|
|
13
|
+
node: {
|
|
14
|
+
fill: 'rgba(10, 30, 60, 0.6)',
|
|
15
|
+
stroke: '#4a90d9',
|
|
16
|
+
strokeWidth: 1,
|
|
17
|
+
cornerRadius: 2,
|
|
18
|
+
labelColor: '#d4e5f7',
|
|
19
|
+
sublabelColor: '#7aaccf',
|
|
20
|
+
fontFamily: "'JetBrains Mono', 'Courier New', monospace",
|
|
21
|
+
fontSize: 11,
|
|
22
|
+
sublabelFontSize: 8,
|
|
23
|
+
refIndicator: {
|
|
24
|
+
icon: 'expand',
|
|
25
|
+
color: 'rgba(74, 144, 217, 0.5)',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
edge: {
|
|
29
|
+
stroke: '#4a90d9',
|
|
30
|
+
strokeWidth: 1,
|
|
31
|
+
arrowSize: 9,
|
|
32
|
+
labelColor: '#7aaccf',
|
|
33
|
+
labelFontSize: 8,
|
|
34
|
+
},
|
|
35
|
+
group: {
|
|
36
|
+
fill: 'rgba(20, 50, 90, 0.2)',
|
|
37
|
+
stroke: '#4a90d9',
|
|
38
|
+
strokeWidth: 0.8,
|
|
39
|
+
strokeDasharray: '12,4',
|
|
40
|
+
labelColor: '#7aaccf',
|
|
41
|
+
labelFontSize: 10,
|
|
42
|
+
cornerRadius: 2,
|
|
43
|
+
},
|
|
44
|
+
breadcrumbs: {
|
|
45
|
+
background: 'rgba(10, 22, 40, 0.95)',
|
|
46
|
+
textColor: '#7aaccf',
|
|
47
|
+
activeColor: '#d4e5f7',
|
|
48
|
+
separatorColor: '#2a4a6f',
|
|
49
|
+
fontFamily: "'JetBrains Mono', monospace",
|
|
50
|
+
fontSize: 11,
|
|
51
|
+
},
|
|
52
|
+
presetColors: {
|
|
53
|
+
'1': { fill: 'rgba(180, 60, 60, 0.25)', stroke: '#e07070' }, // blueprint red
|
|
54
|
+
'2': { fill: 'rgba(200, 130, 50, 0.25)', stroke: '#d4a050' }, // blueprint orange
|
|
55
|
+
'3': { fill: 'rgba(200, 180, 60, 0.25)', stroke: '#d4c860' }, // blueprint yellow
|
|
56
|
+
'4': { fill: 'rgba(60, 160, 80, 0.25)', stroke: '#60c070' }, // blueprint green
|
|
57
|
+
'5': { fill: 'rgba(60, 140, 200, 0.25)', stroke: '#60b0e0' }, // blueprint cyan
|
|
58
|
+
'6': { fill: 'rgba(130, 80, 200, 0.25)', stroke: '#a080d0' }, // blueprint violet
|
|
59
|
+
},
|
|
60
|
+
categories: {},
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=blueprint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blueprint.js","sourceRoot":"","sources":["../../src/themes/blueprint.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAgB;IACzC,IAAI,EAAE,WAAW;IAEjB,UAAU,EAAE,SAAS;IAErB,IAAI,EAAE;QACJ,IAAI,EAAE,EAAE;QACR,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,GAAG;KACjB;IAED,IAAI,EAAE;QACJ,IAAI,EAAE,uBAAuB;QAC7B,MAAM,EAAE,SAAS;QACjB,WAAW,EAAE,CAAC;QACd,YAAY,EAAE,CAAC;QACf,UAAU,EAAE,SAAS;QACrB,aAAa,EAAE,SAAS;QACxB,UAAU,EAAE,4CAA4C;QACxD,QAAQ,E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1,7 @@
|
|
|
1
|
+
import type { CanvasTheme } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Default dark theme — inspired by the architecture diagram reference.
|
|
4
|
+
* Slate-950 background, glowing colored nodes, grid pattern, JetBrains Mono.
|
|
5
|
+
*/
|
|
6
|
+
export declare const darkTheme: CanvasTheme;
|
|
7
|
+
//# sourceMappingURL=dark.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dark.d.ts","sourceRoot":"","sources":["../../src/themes/dark.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,WAgEvB,CAAA"}
|