@cristianormazabal/triton-core 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/contracts/anchors.d.ts +150 -0
- package/dist/contracts/anchors.d.ts.map +1 -0
- package/dist/contracts/crosslink.d.ts +171 -0
- package/dist/contracts/crosslink.d.ts.map +1 -0
- package/dist/contracts/diagram.d.ts +107 -0
- package/dist/contracts/diagram.d.ts.map +1 -0
- package/dist/contracts/index.d.ts +29 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/overlay.d.ts +98 -0
- package/dist/contracts/overlay.d.ts.map +1 -0
- package/dist/contracts/primitives.d.ts +42 -0
- package/dist/contracts/primitives.d.ts.map +1 -0
- package/dist/contracts/renderer.d.ts +21 -0
- package/dist/contracts/renderer.d.ts.map +1 -0
- package/dist/contracts/result.d.ts +32 -0
- package/dist/contracts/result.d.ts.map +1 -0
- package/dist/contracts/routing.d.ts +60 -0
- package/dist/contracts/routing.d.ts.map +1 -0
- package/dist/contracts/scene.d.ts +114 -0
- package/dist/contracts/scene.d.ts.map +1 -0
- package/dist/contracts/theme.d.ts +113 -0
- package/dist/contracts/theme.d.ts.map +1 -0
- package/dist/crosslink/engine2.d.ts +40 -0
- package/dist/crosslink/engine2.d.ts.map +1 -0
- package/dist/crosslink/engine3.d.ts +36 -0
- package/dist/crosslink/engine3.d.ts.map +1 -0
- package/dist/crosslink/index.d.ts +5 -0
- package/dist/crosslink/index.d.ts.map +1 -0
- package/dist/crosslink/render.d.ts +22 -0
- package/dist/crosslink/render.d.ts.map +1 -0
- package/dist/crosslink/resolve.d.ts +26 -0
- package/dist/crosslink/resolve.d.ts.map +1 -0
- package/dist/diagrams/architecture/index.d.ts +5 -0
- package/dist/diagrams/architecture/index.d.ts.map +1 -0
- package/dist/diagrams/architecture/ir.d.ts +29 -0
- package/dist/diagrams/architecture/ir.d.ts.map +1 -0
- package/dist/diagrams/architecture/layout.d.ts +11 -0
- package/dist/diagrams/architecture/layout.d.ts.map +1 -0
- package/dist/diagrams/block/index.d.ts +5 -0
- package/dist/diagrams/block/index.d.ts.map +1 -0
- package/dist/diagrams/block/ir.d.ts +22 -0
- package/dist/diagrams/block/ir.d.ts.map +1 -0
- package/dist/diagrams/block/layout.d.ts +12 -0
- package/dist/diagrams/block/layout.d.ts.map +1 -0
- package/dist/diagrams/c4/index.d.ts +5 -0
- package/dist/diagrams/c4/index.d.ts.map +1 -0
- package/dist/diagrams/c4/ir.d.ts +33 -0
- package/dist/diagrams/c4/ir.d.ts.map +1 -0
- package/dist/diagrams/c4/layout.d.ts +12 -0
- package/dist/diagrams/c4/layout.d.ts.map +1 -0
- package/dist/diagrams/class/index.d.ts +5 -0
- package/dist/diagrams/class/index.d.ts.map +1 -0
- package/dist/diagrams/class/ir.d.ts +32 -0
- package/dist/diagrams/class/ir.d.ts.map +1 -0
- package/dist/diagrams/class/layout.d.ts +13 -0
- package/dist/diagrams/class/layout.d.ts.map +1 -0
- package/dist/diagrams/ds/graph/graph.d.ts +39 -0
- package/dist/diagrams/ds/graph/graph.d.ts.map +1 -0
- package/dist/diagrams/ds/hashmap/hashmap.d.ts +39 -0
- package/dist/diagrams/ds/hashmap/hashmap.d.ts.map +1 -0
- package/dist/diagrams/ds/matrix/matrix.d.ts +33 -0
- package/dist/diagrams/ds/matrix/matrix.d.ts.map +1 -0
- package/dist/diagrams/ds/queue/cqueue.d.ts +31 -0
- package/dist/diagrams/ds/queue/cqueue.d.ts.map +1 -0
- package/dist/diagrams/ds/queue/deque.d.ts +24 -0
- package/dist/diagrams/ds/queue/deque.d.ts.map +1 -0
- package/dist/diagrams/ds/queue/pqueue.d.ts +29 -0
- package/dist/diagrams/ds/queue/pqueue.d.ts.map +1 -0
- package/dist/diagrams/ds/queue/queue.d.ts +27 -0
- package/dist/diagrams/ds/queue/queue.d.ts.map +1 -0
- package/dist/diagrams/ds/queue/shared.d.ts +35 -0
- package/dist/diagrams/ds/queue/shared.d.ts.map +1 -0
- package/dist/diagrams/ds/stack/stack.d.ts +28 -0
- package/dist/diagrams/ds/stack/stack.d.ts.map +1 -0
- package/dist/diagrams/ds/struct/array.d.ts +28 -0
- package/dist/diagrams/ds/struct/array.d.ts.map +1 -0
- package/dist/diagrams/ds/struct/linkedlist.d.ts +21 -0
- package/dist/diagrams/ds/struct/linkedlist.d.ts.map +1 -0
- package/dist/diagrams/ds/struct/memory.d.ts +44 -0
- package/dist/diagrams/ds/struct/memory.d.ts.map +1 -0
- package/dist/diagrams/ds/struct/page.d.ts +25 -0
- package/dist/diagrams/ds/struct/page.d.ts.map +1 -0
- package/dist/diagrams/ds/struct/shared.d.ts +9 -0
- package/dist/diagrams/ds/struct/shared.d.ts.map +1 -0
- package/dist/diagrams/ds/tree/avl.d.ts +14 -0
- package/dist/diagrams/ds/tree/avl.d.ts.map +1 -0
- package/dist/diagrams/ds/tree/btree.d.ts +12 -0
- package/dist/diagrams/ds/tree/btree.d.ts.map +1 -0
- package/dist/diagrams/ds/tree/build.d.ts +34 -0
- package/dist/diagrams/ds/tree/build.d.ts.map +1 -0
- package/dist/diagrams/ds/tree/heap.d.ts +12 -0
- package/dist/diagrams/ds/tree/heap.d.ts.map +1 -0
- package/dist/diagrams/ds/tree/index.d.ts +5 -0
- package/dist/diagrams/ds/tree/index.d.ts.map +1 -0
- package/dist/diagrams/ds/tree/ir.d.ts +29 -0
- package/dist/diagrams/ds/tree/ir.d.ts.map +1 -0
- package/dist/diagrams/ds/tree/layout.d.ts +13 -0
- package/dist/diagrams/ds/tree/layout.d.ts.map +1 -0
- package/dist/diagrams/ds/tree/plan.d.ts +11 -0
- package/dist/diagrams/ds/tree/plan.d.ts.map +1 -0
- package/dist/diagrams/ds/tree/radix.d.ts +12 -0
- package/dist/diagrams/ds/tree/radix.d.ts.map +1 -0
- package/dist/diagrams/ds/tree/rbtree.d.ts +12 -0
- package/dist/diagrams/ds/tree/rbtree.d.ts.map +1 -0
- package/dist/diagrams/ds/tree/segtree.d.ts +12 -0
- package/dist/diagrams/ds/tree/segtree.d.ts.map +1 -0
- package/dist/diagrams/ds/trie/trie.d.ts +17 -0
- package/dist/diagrams/ds/trie/trie.d.ts.map +1 -0
- package/dist/diagrams/ds/unionfind/unionfind.d.ts +34 -0
- package/dist/diagrams/ds/unionfind/unionfind.d.ts.map +1 -0
- package/dist/diagrams/er/index.d.ts +5 -0
- package/dist/diagrams/er/index.d.ts.map +1 -0
- package/dist/diagrams/er/ir.d.ts +28 -0
- package/dist/diagrams/er/ir.d.ts.map +1 -0
- package/dist/diagrams/er/layout.d.ts +12 -0
- package/dist/diagrams/er/layout.d.ts.map +1 -0
- package/dist/diagrams/flowchart/index.d.ts +5 -0
- package/dist/diagrams/flowchart/index.d.ts.map +1 -0
- package/dist/diagrams/flowchart/ir.d.ts +38 -0
- package/dist/diagrams/flowchart/ir.d.ts.map +1 -0
- package/dist/diagrams/flowchart/layout.d.ts +5 -0
- package/dist/diagrams/flowchart/layout.d.ts.map +1 -0
- package/dist/diagrams/gantt/index.d.ts +5 -0
- package/dist/diagrams/gantt/index.d.ts.map +1 -0
- package/dist/diagrams/gantt/ir.d.ts +25 -0
- package/dist/diagrams/gantt/ir.d.ts.map +1 -0
- package/dist/diagrams/gantt/layout.d.ts +12 -0
- package/dist/diagrams/gantt/layout.d.ts.map +1 -0
- package/dist/diagrams/gitgraph/index.d.ts +5 -0
- package/dist/diagrams/gitgraph/index.d.ts.map +1 -0
- package/dist/diagrams/gitgraph/ir.d.ts +31 -0
- package/dist/diagrams/gitgraph/ir.d.ts.map +1 -0
- package/dist/diagrams/gitgraph/layout.d.ts +12 -0
- package/dist/diagrams/gitgraph/layout.d.ts.map +1 -0
- package/dist/diagrams/journey/index.d.ts +5 -0
- package/dist/diagrams/journey/index.d.ts.map +1 -0
- package/dist/diagrams/journey/ir.d.ts +20 -0
- package/dist/diagrams/journey/ir.d.ts.map +1 -0
- package/dist/diagrams/journey/layout.d.ts +13 -0
- package/dist/diagrams/journey/layout.d.ts.map +1 -0
- package/dist/diagrams/kanban/index.d.ts +5 -0
- package/dist/diagrams/kanban/index.d.ts.map +1 -0
- package/dist/diagrams/kanban/ir.d.ts +18 -0
- package/dist/diagrams/kanban/ir.d.ts.map +1 -0
- package/dist/diagrams/kanban/layout.d.ts +12 -0
- package/dist/diagrams/kanban/layout.d.ts.map +1 -0
- package/dist/diagrams/mindmap/index.d.ts +5 -0
- package/dist/diagrams/mindmap/index.d.ts.map +1 -0
- package/dist/diagrams/mindmap/ir.d.ts +15 -0
- package/dist/diagrams/mindmap/ir.d.ts.map +1 -0
- package/dist/diagrams/mindmap/layout.d.ts +12 -0
- package/dist/diagrams/mindmap/layout.d.ts.map +1 -0
- package/dist/diagrams/packet/index.d.ts +5 -0
- package/dist/diagrams/packet/index.d.ts.map +1 -0
- package/dist/diagrams/packet/ir.d.ts +15 -0
- package/dist/diagrams/packet/ir.d.ts.map +1 -0
- package/dist/diagrams/packet/layout.d.ts +12 -0
- package/dist/diagrams/packet/layout.d.ts.map +1 -0
- package/dist/diagrams/pie/index.d.ts +5 -0
- package/dist/diagrams/pie/index.d.ts.map +1 -0
- package/dist/diagrams/pie/ir.d.ts +16 -0
- package/dist/diagrams/pie/ir.d.ts.map +1 -0
- package/dist/diagrams/pie/layout.d.ts +12 -0
- package/dist/diagrams/pie/layout.d.ts.map +1 -0
- package/dist/diagrams/poster/index.d.ts +5 -0
- package/dist/diagrams/poster/index.d.ts.map +1 -0
- package/dist/diagrams/poster/ir.d.ts +46 -0
- package/dist/diagrams/poster/ir.d.ts.map +1 -0
- package/dist/diagrams/poster/layout.d.ts +8 -0
- package/dist/diagrams/poster/layout.d.ts.map +1 -0
- package/dist/diagrams/quadrant/index.d.ts +5 -0
- package/dist/diagrams/quadrant/index.d.ts.map +1 -0
- package/dist/diagrams/quadrant/ir.d.ts +23 -0
- package/dist/diagrams/quadrant/ir.d.ts.map +1 -0
- package/dist/diagrams/quadrant/layout.d.ts +12 -0
- package/dist/diagrams/quadrant/layout.d.ts.map +1 -0
- package/dist/diagrams/radar/index.d.ts +5 -0
- package/dist/diagrams/radar/index.d.ts.map +1 -0
- package/dist/diagrams/radar/ir.d.ts +22 -0
- package/dist/diagrams/radar/ir.d.ts.map +1 -0
- package/dist/diagrams/radar/layout.d.ts +12 -0
- package/dist/diagrams/radar/layout.d.ts.map +1 -0
- package/dist/diagrams/requirement/index.d.ts +5 -0
- package/dist/diagrams/requirement/index.d.ts.map +1 -0
- package/dist/diagrams/requirement/ir.d.ts +25 -0
- package/dist/diagrams/requirement/ir.d.ts.map +1 -0
- package/dist/diagrams/requirement/layout.d.ts +12 -0
- package/dist/diagrams/requirement/layout.d.ts.map +1 -0
- package/dist/diagrams/sankey/index.d.ts +5 -0
- package/dist/diagrams/sankey/index.d.ts.map +1 -0
- package/dist/diagrams/sankey/ir.d.ts +15 -0
- package/dist/diagrams/sankey/ir.d.ts.map +1 -0
- package/dist/diagrams/sankey/layout.d.ts +12 -0
- package/dist/diagrams/sankey/layout.d.ts.map +1 -0
- package/dist/diagrams/sequence/index.d.ts +5 -0
- package/dist/diagrams/sequence/index.d.ts.map +1 -0
- package/dist/diagrams/sequence/ir.d.ts +47 -0
- package/dist/diagrams/sequence/ir.d.ts.map +1 -0
- package/dist/diagrams/sequence/layout.d.ts +13 -0
- package/dist/diagrams/sequence/layout.d.ts.map +1 -0
- package/dist/diagrams/state/index.d.ts +5 -0
- package/dist/diagrams/state/index.d.ts.map +1 -0
- package/dist/diagrams/state/ir.d.ts +28 -0
- package/dist/diagrams/state/ir.d.ts.map +1 -0
- package/dist/diagrams/state/layout.d.ts +12 -0
- package/dist/diagrams/state/layout.d.ts.map +1 -0
- package/dist/diagrams/timeline/index.d.ts +7 -0
- package/dist/diagrams/timeline/index.d.ts.map +1 -0
- package/dist/diagrams/timeline/ir.d.ts +47 -0
- package/dist/diagrams/timeline/ir.d.ts.map +1 -0
- package/dist/diagrams/timeline/layout.d.ts +5 -0
- package/dist/diagrams/timeline/layout.d.ts.map +1 -0
- package/dist/diagrams/timeline/numbered.d.ts +16 -0
- package/dist/diagrams/timeline/numbered.d.ts.map +1 -0
- package/dist/diagrams/timeline/roadmap.d.ts +18 -0
- package/dist/diagrams/timeline/roadmap.d.ts.map +1 -0
- package/dist/diagrams/timeline/serpentine.d.ts +20 -0
- package/dist/diagrams/timeline/serpentine.d.ts.map +1 -0
- package/dist/diagrams/timeline/shared.d.ts +37 -0
- package/dist/diagrams/timeline/shared.d.ts.map +1 -0
- package/dist/diagrams/timeline/timeline-columns.d.ts +19 -0
- package/dist/diagrams/timeline/timeline-columns.d.ts.map +1 -0
- package/dist/diagrams/timeline/vertical-spine.d.ts +21 -0
- package/dist/diagrams/timeline/vertical-spine.d.ts.map +1 -0
- package/dist/diagrams/topology/topology.d.ts +47 -0
- package/dist/diagrams/topology/topology.d.ts.map +1 -0
- package/dist/diagrams/xychart/index.d.ts +5 -0
- package/dist/diagrams/xychart/index.d.ts.map +1 -0
- package/dist/diagrams/xychart/ir.d.ts +21 -0
- package/dist/diagrams/xychart/ir.d.ts.map +1 -0
- package/dist/diagrams/xychart/layout.d.ts +12 -0
- package/dist/diagrams/xychart/layout.d.ts.map +1 -0
- package/dist/frontend/detect.d.ts +7 -0
- package/dist/frontend/detect.d.ts.map +1 -0
- package/dist/frontend/index.d.ts +44 -0
- package/dist/frontend/index.d.ts.map +1 -0
- package/dist/frontend/registry.d.ts +21 -0
- package/dist/frontend/registry.d.ts.map +1 -0
- package/dist/graph/connect.d.ts +39 -0
- package/dist/graph/connect.d.ts.map +1 -0
- package/dist/graph/layered.d.ts +43 -0
- package/dist/graph/layered.d.ts.map +1 -0
- package/dist/graph/tree.d.ts +41 -0
- package/dist/graph/tree.d.ts.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +41345 -0
- package/dist/index.js.map +7 -0
- package/dist/overlay/apply.d.ts +15 -0
- package/dist/overlay/apply.d.ts.map +1 -0
- package/dist/overlay/compiler.d.ts +10 -0
- package/dist/overlay/compiler.d.ts.map +1 -0
- package/dist/overlay/layout.d.ts +16 -0
- package/dist/overlay/layout.d.ts.map +1 -0
- package/dist/palette/categorical.d.ts +15 -0
- package/dist/palette/categorical.d.ts.map +1 -0
- package/dist/render/registry.d.ts +15 -0
- package/dist/render/registry.d.ts.map +1 -0
- package/dist/render/svg.d.ts +11 -0
- package/dist/render/svg.d.ts.map +1 -0
- package/dist/routing/registry.d.ts +16 -0
- package/dist/routing/registry.d.ts.map +1 -0
- package/dist/routing/router.d.ts +10 -0
- package/dist/routing/router.d.ts.map +1 -0
- package/dist/scene/build.d.ts +45 -0
- package/dist/scene/build.d.ts.map +1 -0
- package/dist/scene/strip.d.ts +39 -0
- package/dist/scene/strip.d.ts.map +1 -0
- package/dist/style/cost.d.ts +35 -0
- package/dist/style/cost.d.ts.map +1 -0
- package/dist/text/metrics.d.ts +19 -0
- package/dist/text/metrics.d.ts.map +1 -0
- package/dist/text/wrap.d.ts +21 -0
- package/dist/text/wrap.d.ts.map +1 -0
- package/dist/theme/preset.d.ts +29 -0
- package/dist/theme/preset.d.ts.map +1 -0
- package/dist/theme/resolver.d.ts +7 -0
- package/dist/theme/resolver.d.ts.map +1 -0
- package/dist/time/dates.d.ts +72 -0
- package/dist/time/dates.d.ts.map +1 -0
- package/dist/util/round.d.ts +12 -0
- package/dist/util/round.d.ts.map +1 -0
- package/package.json +42 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file overlay/apply.ts — Uniform overlay application for layout engines.
|
|
3
|
+
*
|
|
4
|
+
* Every diagram layout ends the same way: if the IR carries overlays, compile
|
|
5
|
+
* them, lay them out against the finished scene, and merge their elements +
|
|
6
|
+
* expanded viewBox back in. This helper centralizes that tail so each layout
|
|
7
|
+
* engine reduces to a single call.
|
|
8
|
+
*/
|
|
9
|
+
import type { RawOverlay, Scene, ResolvedTheme } from '../contracts/index.js';
|
|
10
|
+
/**
|
|
11
|
+
* Return a scene with the IR's overlays merged in. When there are no overlays
|
|
12
|
+
* the input scene is returned unchanged.
|
|
13
|
+
*/
|
|
14
|
+
export declare function applyOverlays(scene: Scene, overlays: readonly RawOverlay[] | undefined, theme: ResolvedTheme): Scene;
|
|
15
|
+
//# sourceMappingURL=apply.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../../src/overlay/apply.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAI9E;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,SAAS,UAAU,EAAE,GAAG,SAAS,EAC3C,KAAK,EAAE,aAAa,GACnB,KAAK,CAKP"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RawOverlay, CompiledOverlays } from '../contracts/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Convert raw grammar-emitted overlay directives into resolved overlay types.
|
|
4
|
+
*
|
|
5
|
+
* Position resolution for notes is deferred — positions are relative offsets
|
|
6
|
+
* from the anchor element. The overlay layout function resolves these to
|
|
7
|
+
* absolute coordinates once node positions are known.
|
|
8
|
+
*/
|
|
9
|
+
export declare function compileOverlays(raw: readonly RawOverlay[]): CompiledOverlays;
|
|
10
|
+
//# sourceMappingURL=compiler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compiler.d.ts","sourceRoot":"","sources":["../../../../src/overlay/compiler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAIjB,MAAM,uBAAuB,CAAC;AAE/B;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,SAAS,UAAU,EAAE,GAAG,gBAAgB,CA+B5E"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CompiledOverlays, Scene, SceneElement, Rect, ResolvedTheme } from '../contracts/index.js';
|
|
2
|
+
export interface OverlayResult {
|
|
3
|
+
/** Additional elements to append to the scene's elements list. */
|
|
4
|
+
elements: SceneElement[];
|
|
5
|
+
/** Expanded viewBox that encompasses all overlay geometry. */
|
|
6
|
+
viewBox: Rect;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Lay out compiled overlays (annotations + legend) relative to an existing scene.
|
|
10
|
+
*
|
|
11
|
+
* Diagram layout functions call this internally after positioning all nodes/edges.
|
|
12
|
+
* The returned elements are appended to the scene's element list. The returned
|
|
13
|
+
* viewBox replaces the scene's viewBox if it has expanded.
|
|
14
|
+
*/
|
|
15
|
+
export declare function layoutOverlays(compiled: CompiledOverlays, scene: Scene, theme: ResolvedTheme): OverlayResult;
|
|
16
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../src/overlay/layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAGhB,KAAK,EACL,YAAY,EAEZ,IAAI,EAEJ,aAAa,EACd,MAAM,uBAAuB,CAAC;AAe/B,MAAM,WAAW,aAAa;IAC5B,kEAAkE;IAClE,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,8DAA8D;IAC9D,OAAO,EAAE,IAAI,CAAC;CACf;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,gBAAgB,EAC1B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,aAAa,GACnB,aAAa,CAyBf"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file palette/categorical.ts — Shared categorical hue cycle.
|
|
3
|
+
*
|
|
4
|
+
* A fixed, deterministic sequence of visually-separable hues for diagrams that
|
|
5
|
+
* colour items by index rather than by semantic status (narrative spines,
|
|
6
|
+
* section bands, pie/chart slices). Index wraps with modulo so any count works.
|
|
7
|
+
*
|
|
8
|
+
* This is intentionally NOT a theme token: it is decorative, diagram-driven
|
|
9
|
+
* colour, independent of the active theme's semantic palette.
|
|
10
|
+
*/
|
|
11
|
+
/** Eight distinct hues, ordered for maximum adjacent contrast. */
|
|
12
|
+
export declare const CATEGORICAL_HUES: readonly string[];
|
|
13
|
+
/** Hue at `index`, wrapping the cycle. */
|
|
14
|
+
export declare function categoricalHue(index: number): string;
|
|
15
|
+
//# sourceMappingURL=categorical.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"categorical.d.ts","sourceRoot":"","sources":["../../../../src/palette/categorical.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,kEAAkE;AAClE,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAG7C,CAAC;AAEF,0CAA0C;AAC1C,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGpD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renderer Registry
|
|
3
|
+
*
|
|
4
|
+
* Central registry of all available output renderers.
|
|
5
|
+
* The built-in 'svg' renderer is registered in frontend/index.ts.
|
|
6
|
+
* Third-party renderers (PNG, Canvas, PDF…) call registerRenderer().
|
|
7
|
+
*/
|
|
8
|
+
import type { Renderer } from '../contracts/index.js';
|
|
9
|
+
/** Register an output renderer under its name. */
|
|
10
|
+
export declare function registerRenderer<Output>(renderer: Renderer<Output>): void;
|
|
11
|
+
/** Look up a renderer by name. Returns undefined if not registered. */
|
|
12
|
+
export declare function getRenderer<Output = string>(name: string): Renderer<Output> | undefined;
|
|
13
|
+
/** Return all currently registered renderer names. */
|
|
14
|
+
export declare function registeredRenderers(): string[];
|
|
15
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/render/registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAKtD,kDAAkD;AAClD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,IAAI,CAEzE;AAED,uEAAuE;AACvE,wBAAgB,WAAW,CAAC,MAAM,GAAG,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,SAAS,CAEvF;AAED,sDAAsD;AACtD,wBAAgB,mBAAmB,IAAI,MAAM,EAAE,CAE9C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Scene, Renderer } from '../contracts/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Render a fully-resolved Scene to an SVG string.
|
|
4
|
+
*
|
|
5
|
+
* Contract: the caller must have already incorporated all overlay geometry
|
|
6
|
+
* into Scene.elements before calling this. The renderer is diagram-agnostic.
|
|
7
|
+
*/
|
|
8
|
+
export declare function renderSVG(scene: Scene): string;
|
|
9
|
+
/** The built-in SVG renderer. Registered by default in frontend/index.ts. */
|
|
10
|
+
export declare const svgRenderer: Renderer<string>;
|
|
11
|
+
//# sourceMappingURL=svg.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg.d.ts","sourceRoot":"","sources":["../../../../src/render/svg.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAgB,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE3E;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAwB9C;AAqFD,6EAA6E;AAC7E,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAGxC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Router Registry
|
|
3
|
+
*
|
|
4
|
+
* Central registry of all available routing algorithms.
|
|
5
|
+
* Built-in routers (straight, orthogonal, bezier, polyline) are
|
|
6
|
+
* registered in frontend/index.ts.
|
|
7
|
+
* Third-party routers call registerRouter().
|
|
8
|
+
*/
|
|
9
|
+
import type { Router, RouteStyle } from '../contracts/index.js';
|
|
10
|
+
/** Register a routing algorithm under a route style name. */
|
|
11
|
+
export declare function registerRouter(style: RouteStyle, router: Router): void;
|
|
12
|
+
/** Look up a router by style. Returns undefined if not registered. */
|
|
13
|
+
export declare function getRouter(style: RouteStyle): Router | undefined;
|
|
14
|
+
/** Return all currently registered route style names. */
|
|
15
|
+
export declare function registeredRouters(): RouteStyle[];
|
|
16
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/routing/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAIhE,6DAA6D;AAC7D,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAEtE;AAED,sEAAsE;AACtE,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAE/D;AAED,yDAAyD;AACzD,wBAAgB,iBAAiB,IAAI,UAAU,EAAE,CAEhD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Router, RouteStyle } from '../contracts/index.js';
|
|
2
|
+
export declare const straightRouter: Router;
|
|
3
|
+
export declare const orthogonalRouter: Router;
|
|
4
|
+
export declare const bezierRouter: Router;
|
|
5
|
+
export declare const polylineRouter: Router;
|
|
6
|
+
/** Create (or look up) a router by style name. */
|
|
7
|
+
export declare function createRouter(style: RouteStyle): Router;
|
|
8
|
+
/** Default router used by layout engines unless overridden. */
|
|
9
|
+
export declare const defaultRouter: Router;
|
|
10
|
+
//# sourceMappingURL=router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../src/routing/router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAuB,UAAU,EAAiB,MAAM,uBAAuB,CAAC;AAosBpG,eAAO,MAAM,cAAc,EAAE,MAA+B,CAAC;AAC7D,eAAO,MAAM,gBAAgB,EAAE,MAAgC,CAAC;AAChE,eAAO,MAAM,YAAY,EAAE,MAAgC,CAAC;AAC5D,eAAO,MAAM,cAAc,EAAE,MAAgC,CAAC;AAI9D,kDAAkD;AAClD,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAOtD;AAED,+DAA+D;AAC/D,eAAO,MAAM,aAAa,EAAE,MAAyB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file scene/build.ts — Scene-element construction helpers.
|
|
3
|
+
*
|
|
4
|
+
* A `Pen` is bound once to a theme and produces SceneElements, removing the
|
|
5
|
+
* `type` discriminant and the repeated `fontFamily: typography.fontFamily`
|
|
6
|
+
* plumbing from every call site. Shapes take explicit colours (which vary per
|
|
7
|
+
* element); only the font family — the one token that is invariant per theme —
|
|
8
|
+
* is defaulted. Output is identical to the equivalent object literals.
|
|
9
|
+
*/
|
|
10
|
+
import type { SceneElement, SceneText, SceneRect, SceneCircle, ScenePath, SceneGroup, Rect, Point, Color, FontWeight, TextAnchor, ResolvedTheme } from '../contracts/index.js';
|
|
11
|
+
export interface TextOpts {
|
|
12
|
+
weight?: FontWeight;
|
|
13
|
+
anchor?: TextAnchor;
|
|
14
|
+
opacity?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface RectOpts {
|
|
17
|
+
rx?: number;
|
|
18
|
+
opacity?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface PathOpts {
|
|
21
|
+
fill?: Color;
|
|
22
|
+
dash?: string;
|
|
23
|
+
markerEnd?: string;
|
|
24
|
+
markerStart?: string;
|
|
25
|
+
animated?: 'march' | 'particle';
|
|
26
|
+
opacity?: number;
|
|
27
|
+
}
|
|
28
|
+
export interface GroupOpts {
|
|
29
|
+
id?: string;
|
|
30
|
+
transform?: string;
|
|
31
|
+
opacity?: number;
|
|
32
|
+
}
|
|
33
|
+
export interface Pen {
|
|
34
|
+
/** Text at (x, y) with the theme font family; size + fill are explicit. */
|
|
35
|
+
text(content: string, x: number, y: number, size: number, fill: Color, opts?: TextOpts): SceneText;
|
|
36
|
+
rect(bounds: Rect, fill: Color, stroke: Color, strokeWidth: number, opts?: RectOpts): SceneRect;
|
|
37
|
+
circle(center: Point, radius: number, fill: Color, stroke: Color, strokeWidth: number, opts?: {
|
|
38
|
+
opacity?: number;
|
|
39
|
+
}): SceneCircle;
|
|
40
|
+
path(d: string, stroke: Color, strokeWidth: number, opts?: PathOpts): ScenePath;
|
|
41
|
+
group(children: readonly SceneElement[], opts?: GroupOpts): SceneGroup;
|
|
42
|
+
}
|
|
43
|
+
/** Create a Pen bound to a theme's font family. */
|
|
44
|
+
export declare function pen(theme: ResolvedTheme): Pen;
|
|
45
|
+
//# sourceMappingURL=build.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../../src/scene/build.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EACtE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAC1D,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,QAAQ;IACvB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,GAAG;IAClB,2EAA2E;IAC3E,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IACnG,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAChG,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,WAAW,CAAC;IACjI,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAChF,KAAK,CAAC,QAAQ,EAAE,SAAS,YAAY,EAAE,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;CACxE;AAED,mDAAmD;AACnD,wBAAgB,GAAG,CAAC,KAAK,EAAE,aAAa,GAAG,GAAG,CA4C7C"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file scene/strip.ts — Cell-strip construction.
|
|
3
|
+
*
|
|
4
|
+
* A strip is a contiguous (or gapped) run of equal-extent cells: arrays, heap
|
|
5
|
+
* array-backings, ring/queue buffers, packet fields, B-tree key strips, slotted
|
|
6
|
+
* pages. Returns the scene elements plus the bounding `slots` so pointer routing
|
|
7
|
+
* (graph/connect) can clip arrows to individual cells.
|
|
8
|
+
*
|
|
9
|
+
* Deterministic: positions are pure functions of inputs.
|
|
10
|
+
*/
|
|
11
|
+
import type { SceneElement, Rect, Color, Point, ResolvedTheme } from '../contracts/index.js';
|
|
12
|
+
import type { Pen } from './build.js';
|
|
13
|
+
export interface StripCell {
|
|
14
|
+
/** Centered cell text. */
|
|
15
|
+
readonly label?: string;
|
|
16
|
+
/** Cell fill; defaults to theme surface. */
|
|
17
|
+
readonly fill?: Color;
|
|
18
|
+
/** Optional label drawn just outside the strip (index / address). */
|
|
19
|
+
readonly index?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface StripOptions {
|
|
22
|
+
/** Top-left of the strip. */
|
|
23
|
+
readonly origin: Point;
|
|
24
|
+
readonly cellWidth: number;
|
|
25
|
+
readonly cellHeight: number;
|
|
26
|
+
/** 'horizontal' lays cells left→right (default); 'vertical' top→bottom. */
|
|
27
|
+
readonly orientation?: 'horizontal' | 'vertical';
|
|
28
|
+
/** Gap between cells; 0 = contiguous (default). */
|
|
29
|
+
readonly gap?: number;
|
|
30
|
+
}
|
|
31
|
+
export interface StripResult {
|
|
32
|
+
readonly elements: SceneElement[];
|
|
33
|
+
/** Bounding rect of each cell, in input order — anchors for pointers. */
|
|
34
|
+
readonly slots: Rect[];
|
|
35
|
+
/** Overall bounding box of the strip cells (excludes index labels). */
|
|
36
|
+
readonly bounds: Rect;
|
|
37
|
+
}
|
|
38
|
+
export declare function buildStrip(pen: Pen, theme: ResolvedTheme, cells: readonly StripCell[], options: StripOptions): StripResult;
|
|
39
|
+
//# sourceMappingURL=strip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strip.d.ts","sourceRoot":"","sources":["../../../../src/scene/strip.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC7F,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,WAAW,SAAS;IACxB,0BAA0B;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,4CAA4C;IAC5C,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC;IACtB,qEAAqE;IACrE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,YAAY;IAC3B,6BAA6B;IAC7B,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,2EAA2E;IAC3E,QAAQ,CAAC,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACjD,mDAAmD;IACnD,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,QAAQ,EAAE,YAAY,EAAE,CAAC;IAClC,yEAAyE;IACzE,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC;IACvB,uEAAuE;IACvE,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC;CACvB;AAED,wBAAgB,UAAU,CACxB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,aAAa,EACpB,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,OAAO,EAAE,YAAY,GACpB,WAAW,CAwCb"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file style/cost.ts — Cost / latency tier styling.
|
|
3
|
+
*
|
|
4
|
+
* Maps a numeric edge weight (latency, bandwidth-inverse, hop distance, plan
|
|
5
|
+
* cost) onto a discrete visual tier — colour + dash pattern — and builds a
|
|
6
|
+
* legend block. Shared by any diagram with weighted edges (architecture/NUMA,
|
|
7
|
+
* topology, query plans). Pure styling: no layout.
|
|
8
|
+
*/
|
|
9
|
+
import type { SceneElement, Color, Point, Rect, ResolvedTheme } from '../contracts/index.js';
|
|
10
|
+
import type { Pen } from '../scene/build.js';
|
|
11
|
+
export interface CostTier {
|
|
12
|
+
readonly name: string;
|
|
13
|
+
/** Inclusive upper bound for bucketing a weight into this tier. */
|
|
14
|
+
readonly maxWeight: number;
|
|
15
|
+
readonly color: Color;
|
|
16
|
+
/** Optional SVG stroke-dasharray (e.g. '5 4'). */
|
|
17
|
+
readonly dash?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface CostScale {
|
|
20
|
+
/** Unit label shown in the legend (e.g. 'ns', 'Gbps'). */
|
|
21
|
+
readonly unit?: string;
|
|
22
|
+
/** Tiers, ascending by maxWeight. */
|
|
23
|
+
readonly tiers: readonly CostTier[];
|
|
24
|
+
}
|
|
25
|
+
/** Bucket a weight into the first tier whose maxWeight ≥ weight (else the last). */
|
|
26
|
+
export declare function classifyCost(scale: CostScale, weight: number): CostTier;
|
|
27
|
+
/** Look up a tier by name (for explicit `-- tier -->` edges). */
|
|
28
|
+
export declare function tierByName(scale: CostScale, name: string): CostTier | undefined;
|
|
29
|
+
export interface LegendResult {
|
|
30
|
+
readonly elements: SceneElement[];
|
|
31
|
+
readonly bounds: Rect;
|
|
32
|
+
}
|
|
33
|
+
/** A small legend: one swatch + tier name + threshold per tier. */
|
|
34
|
+
export declare function buildLegend(pen: Pen, theme: ResolvedTheme, scale: CostScale, origin: Point): LegendResult;
|
|
35
|
+
//# sourceMappingURL=cost.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cost.d.ts","sourceRoot":"","sources":["../../../../src/style/cost.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC7F,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAE7C,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,mEAAmE;IACnE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,kDAAkD;IAClD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,SAAS;IACxB,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,qCAAqC;IACrC,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;CACrC;AAED,oFAAoF;AACpF,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,QAAQ,CAGvE;AAED,iEAAiE;AACjE,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAE/E;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,QAAQ,EAAE,YAAY,EAAE,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC;CACvB;AAED,mEAAmE;AACnE,wBAAgB,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,GAAG,YAAY,CAoBzG"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file text/metrics.ts — Deterministic text-width measurement.
|
|
3
|
+
*
|
|
4
|
+
* General utility (any diagram). Uses a hardcoded per-character advance-width
|
|
5
|
+
* table derived from DejaVu Sans (fraction of the em square), so measurements
|
|
6
|
+
* are byte-identical across platforms — no font parser, no system locale.
|
|
7
|
+
*
|
|
8
|
+
* Ported from packages/core/src/fonts/metrics.ts.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Measure the rendered width/height of `text` at `fontSizePx` pixels.
|
|
12
|
+
*/
|
|
13
|
+
export declare function measureText(text: string, fontSizePx: number): {
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
};
|
|
17
|
+
/** Convert point size to CSS pixels (at 96 dpi; 1pt = 96/72 px). */
|
|
18
|
+
export declare function ptToPx(pt: number): number;
|
|
19
|
+
//# sourceMappingURL=metrics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../../../src/text/metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAuCH;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAU/F;AAED,oEAAoE;AACpE,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAEzC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file text/wrap.ts — Deterministic text wrapping and truncation.
|
|
3
|
+
*
|
|
4
|
+
* General utility (any diagram). Uses the embedded font metrics from
|
|
5
|
+
* ./metrics.js. Same input always yields same output.
|
|
6
|
+
*
|
|
7
|
+
* Ported from packages/core/src/text-wrap.ts.
|
|
8
|
+
*/
|
|
9
|
+
export interface WrappedText {
|
|
10
|
+
lines: string[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Wrap text to fit maxWidth (px) at fontSizePx, with at most maxLines lines.
|
|
14
|
+
* Breaks at word boundaries; truncates the last visible line with an ellipsis.
|
|
15
|
+
*/
|
|
16
|
+
export declare function wrapText(text: string, fontSizePx: number, maxWidth: number, maxLines: number): WrappedText;
|
|
17
|
+
/**
|
|
18
|
+
* Truncate text to fit maxWidth (px) at fontSizePx, appending an ellipsis if cut.
|
|
19
|
+
*/
|
|
20
|
+
export declare function truncateText(text: string, fontSizePx: number, maxWidth: number): string;
|
|
21
|
+
//# sourceMappingURL=wrap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wrap.d.ts","sourceRoot":"","sources":["../../../../src/text/wrap.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,WAAW,CA8Cb;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACf,MAAM,CAmBR"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ResolvedTheme } from '../contracts/index.js';
|
|
2
|
+
export declare const defaultTheme: ResolvedTheme;
|
|
3
|
+
/** Boardroom / presentation aesthetic — deep navy canvas, light text. */
|
|
4
|
+
export declare const executiveTheme: ResolvedTheme;
|
|
5
|
+
/** Greyscale, ink-on-paper minimalism. */
|
|
6
|
+
export declare const minimalTheme: ResolvedTheme;
|
|
7
|
+
/** Navy + amber on white — classic consulting deck. */
|
|
8
|
+
export declare const consultingTheme: ResolvedTheme;
|
|
9
|
+
/** Modern SaaS product — violet + blue on white. */
|
|
10
|
+
export declare const productTheme: ResolvedTheme;
|
|
11
|
+
/** Release-management palette — vivid status hues. */
|
|
12
|
+
export declare const releaseTheme: ResolvedTheme;
|
|
13
|
+
/** Indigo accent on near-white — the AI-timeline editorial look. */
|
|
14
|
+
export declare const aiTimelineTheme: ResolvedTheme;
|
|
15
|
+
/** ByteByteGo-style dark infographic — navy canvas, vivid teal accent. */
|
|
16
|
+
export declare const byteByteGoTheme: ResolvedTheme;
|
|
17
|
+
/** Gitline dark-card look — deep navy canvas, periwinkle-blue accent. */
|
|
18
|
+
export declare const gitlineTheme: ResolvedTheme;
|
|
19
|
+
/** "Our Timeline" infographic — white canvas, navy + amber. */
|
|
20
|
+
export declare const ourTimelineTheme: ResolvedTheme;
|
|
21
|
+
/** Subject Timeline dark theme — deep navy, vivid cyan + pink accents. */
|
|
22
|
+
export declare const subjectTimelineTheme: ResolvedTheme;
|
|
23
|
+
/** Showcase Tier-3 aesthetic — deep navy canvas, electric-cyan accent. */
|
|
24
|
+
export declare const showcaseTheme: ResolvedTheme;
|
|
25
|
+
/** Named theme presets. Selected via a diagram's `theme:` / metadata.theme. */
|
|
26
|
+
export declare const THEMES: Readonly<Record<string, ResolvedTheme>>;
|
|
27
|
+
/** Resolve a theme preset by name, falling back to the default theme. */
|
|
28
|
+
export declare function getThemePreset(name?: string): ResolvedTheme;
|
|
29
|
+
//# sourceMappingURL=preset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../../../../src/theme/preset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AA0C3D,eAAO,MAAM,YAAY,EAAE,aAkBjB,CAAC;AAEX,yEAAyE;AACzE,eAAO,MAAM,cAAc,EAAE,aAkBnB,CAAC;AAEX,0CAA0C;AAC1C,eAAO,MAAM,YAAY,EAAE,aAkBjB,CAAC;AAEX,uDAAuD;AACvD,eAAO,MAAM,eAAe,EAAE,aAkBpB,CAAC;AAEX,oDAAoD;AACpD,eAAO,MAAM,YAAY,EAAE,aAkBjB,CAAC;AAEX,sDAAsD;AACtD,eAAO,MAAM,YAAY,EAAE,aAkBjB,CAAC;AAEX,oEAAoE;AACpE,eAAO,MAAM,eAAe,EAAE,aAkBpB,CAAC;AAEX,0EAA0E;AAC1E,eAAO,MAAM,eAAe,EAAE,aAkBpB,CAAC;AAEX,yEAAyE;AACzE,eAAO,MAAM,YAAY,EAAE,aAkBjB,CAAC;AAEX,+DAA+D;AAC/D,eAAO,MAAM,gBAAgB,EAAE,aAkBrB,CAAC;AAEX,0EAA0E;AAC1E,eAAO,MAAM,oBAAoB,EAAE,aAkBzB,CAAC;AAEX,0EAA0E;AAC1E,eAAO,MAAM,aAAa,EAAE,aAkBlB,CAAC;AAIX,+EAA+E;AAC/E,eAAO,MAAM,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAa1D,CAAC;AAEF,yEAAyE;AACzE,wBAAgB,cAAc,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,aAAa,CAE3D"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ResolvedTheme, ThemeInput } from '../contracts/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Merge a partial ThemeInput over a base ResolvedTheme.
|
|
4
|
+
* Only present fields override the base — absent fields keep the base value.
|
|
5
|
+
*/
|
|
6
|
+
export declare function resolveTheme(input: ThemeInput, base: ResolvedTheme): ResolvedTheme;
|
|
7
|
+
//# sourceMappingURL=resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../../../src/theme/resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEvE;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,GAAG,aAAa,CASlF"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file time/dates.ts — Deterministic date arithmetic.
|
|
3
|
+
*
|
|
4
|
+
* General utility for any time-based diagram (timeline, gantt, roadmap).
|
|
5
|
+
* All functions are pure: no system clock, no locale. The day-ordinal
|
|
6
|
+
* representation (integer days since 2000-01-01 = day 0) underpins every
|
|
7
|
+
* time→coordinate calculation.
|
|
8
|
+
*
|
|
9
|
+
* Ported from packages/core/src/layout/dates.ts.
|
|
10
|
+
*/
|
|
11
|
+
/** An IR date string: "2026", "2026-06", "2026-06-09", "2026-Q2", "2026-H1". */
|
|
12
|
+
export type IRDate = string;
|
|
13
|
+
/** Axis granularity. */
|
|
14
|
+
export type AxisUnit = 'day' | 'week' | 'month' | 'quarter' | 'half' | 'year';
|
|
15
|
+
export type DatePrecision = 'day' | 'month' | 'year' | 'quarter' | 'half';
|
|
16
|
+
export interface ParsedDate {
|
|
17
|
+
precision: DatePrecision;
|
|
18
|
+
year: number;
|
|
19
|
+
/** 1-12; present for precision month/day */
|
|
20
|
+
month?: number;
|
|
21
|
+
/** 1-31; present for precision day */
|
|
22
|
+
day?: number;
|
|
23
|
+
/** 1-4; present for precision quarter */
|
|
24
|
+
quarter?: number;
|
|
25
|
+
/** 1-2; present for precision half */
|
|
26
|
+
half?: number;
|
|
27
|
+
}
|
|
28
|
+
export declare function isLeapYear(year: number): boolean;
|
|
29
|
+
export declare function daysInMonth(year: number, month: number): number;
|
|
30
|
+
export declare function dateToOrdinal(year: number, month: number, day: number): number;
|
|
31
|
+
export declare function ordinalToDate(ord: number): [number, number, number];
|
|
32
|
+
/**
|
|
33
|
+
* Parse an IRDate into a structured form.
|
|
34
|
+
* Supports: ISO day (2026-06-09), ISO month (2026-06), year (2026),
|
|
35
|
+
* quarter (2026-Q2), half (2026-H1).
|
|
36
|
+
*/
|
|
37
|
+
export declare function parseIRDate(s: IRDate): ParsedDate;
|
|
38
|
+
/** Coerce a parsed date to its period-start day (left-edge rule). */
|
|
39
|
+
export declare function coerceLeft(parsed: ParsedDate): [number, number, number];
|
|
40
|
+
/** Coerce a parsed date to its period-end day (right-edge rule). */
|
|
41
|
+
export declare function coerceRight(parsed: ParsedDate): [number, number, number];
|
|
42
|
+
/** Parse an IRDate and coerce it to its period-start ordinal. */
|
|
43
|
+
export declare function parseAndCoerceLeft(s: IRDate): number;
|
|
44
|
+
/** Parse an IRDate and coerce it to its period-end ordinal. */
|
|
45
|
+
export declare function parseAndCoerceRight(s: IRDate): number;
|
|
46
|
+
/** Infer the axis unit from the span in days (first-match rule). */
|
|
47
|
+
export declare function inferAxisUnit(spanDays: number): AxisUnit;
|
|
48
|
+
export interface TickDate {
|
|
49
|
+
year: number;
|
|
50
|
+
month: number;
|
|
51
|
+
day: number;
|
|
52
|
+
ordinal: number;
|
|
53
|
+
}
|
|
54
|
+
/** Enumerate all period-start tick dates within [tsOrd, teOrd] (inclusive). */
|
|
55
|
+
export declare function enumTicks(tsOrd: number, teOrd: number, unit: AxisUnit): TickDate[];
|
|
56
|
+
/** Format an axis tick label according to the axis unit. */
|
|
57
|
+
export declare function formatTickLabel(tick: TickDate, unit: AxisUnit, tickIndex: number): string;
|
|
58
|
+
/** Format a concrete day date as the milestone label style: "15th May 2021". */
|
|
59
|
+
export declare function formatMilestoneDate(year: number, month: number, day: number): string;
|
|
60
|
+
/** Day-ordinal of a date's period START (e.g. "2026-Q2" → 1 Apr 2026). 0 on parse error. */
|
|
61
|
+
export declare function startOrdinal(date: IRDate): number;
|
|
62
|
+
/** Day-ordinal of a date's period END (e.g. "2026-Q2" → 1 Jul 2026). 0 on parse error. */
|
|
63
|
+
export declare function endOrdinal(date: IRDate): number;
|
|
64
|
+
/** Label style for {@link formatDate}. 'axis' shows "Jun 9" for days; 'full' shows "9th June 2026". */
|
|
65
|
+
export type DateLabelStyle = 'axis' | 'full';
|
|
66
|
+
/**
|
|
67
|
+
* Precision-aware human label for an IR date. Consolidates the per-layout
|
|
68
|
+
* formatters: months → "Jun 2026", quarters → "Q2 2026", halves → "H1 2026",
|
|
69
|
+
* years → "2026"; days depend on {@link DateLabelStyle}.
|
|
70
|
+
*/
|
|
71
|
+
export declare function formatDate(date: IRDate, style?: DateLabelStyle): string;
|
|
72
|
+
//# sourceMappingURL=dates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dates.d.ts","sourceRoot":"","sources":["../../../../src/time/dates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,gFAAgF;AAChF,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAE5B,wBAAwB;AACxB,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAE9E,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AAE1E,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,aAAa,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAID,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAG/D;AAQD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAU9E;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAoBnE;AAID;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,UAAU,CAiBjD;AAID,qEAAqE;AACrE,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAQvE;AAED,oEAAoE;AACpE,wBAAgB,WAAW,CAAC,MAAM,EAAE,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAcxE;AAED,iEAAiE;AACjE,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAGpD;AAED,+DAA+D;AAC/D,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAGrD;AAID,oEAAoE;AACpE,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAOxD;AAID,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;CACjB;AAgDD,+EAA+E;AAC/E,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,QAAQ,EAAE,CAmBlF;AAmBD,4DAA4D;AAC5D,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAwBzF;AAED,gFAAgF;AAChF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEpF;AAID,4FAA4F;AAC5F,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGjD;AAED,0FAA0F;AAC1F,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG/C;AAED,uGAAuG;AACvG,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,CAAC;AAE7C;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,cAAuB,GAAG,MAAM,CAe/E"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file util/round.ts — Deterministic round-half-up helpers.
|
|
3
|
+
*
|
|
4
|
+
* Layout coordinates round half up (toward +∞) so output is locale- and
|
|
5
|
+
* platform-stable. Shared by every layout engine; never use Math.round (which
|
|
6
|
+
* rounds half to even in some runtimes) for scene geometry.
|
|
7
|
+
*/
|
|
8
|
+
/** Round half up to the nearest integer. */
|
|
9
|
+
export declare function rhuInt(v: number): number;
|
|
10
|
+
/** Round half up to `decimals` places (default 2) — for sub-pixel path data. */
|
|
11
|
+
export declare function rhu(v: number, decimals?: number): number;
|
|
12
|
+
//# sourceMappingURL=round.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"round.d.ts","sourceRoot":"","sources":["../../../../src/util/round.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,4CAA4C;AAC5C,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAExC;AAED,gFAAgF;AAChF,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,SAAI,GAAG,MAAM,CAGnD"}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cristianormazabal/triton-core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Triton diagram compiler — deterministic SVG rendering for 50+ diagram types (Mermaid-compatible, trees, data structures, posters).",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"diagram",
|
|
9
|
+
"compiler",
|
|
10
|
+
"svg",
|
|
11
|
+
"mermaid",
|
|
12
|
+
"flowchart",
|
|
13
|
+
"sequence",
|
|
14
|
+
"tree",
|
|
15
|
+
"visualization",
|
|
16
|
+
"deterministic"
|
|
17
|
+
],
|
|
18
|
+
"main": "./dist/index.js",
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"import": "./dist/index.js",
|
|
23
|
+
"types": "./dist/index.d.ts"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=20"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist"
|
|
31
|
+
],
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "https://github.com/ormasoftchile/triton.git",
|
|
35
|
+
"directory": "packages/core"
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://github.com/ormasoftchile/triton",
|
|
41
|
+
"bugs": "https://github.com/ormasoftchile/triton/issues"
|
|
42
|
+
}
|