@tellegen/svelte 0.4.3 → 0.4.5

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.
Files changed (115) hide show
  1. package/README.md +45 -0
  2. package/dist/TellegenMap.svelte +63 -22
  3. package/dist/TellegenProvider.svelte +7 -4
  4. package/dist/TellegenShell.svelte +12 -1
  5. package/dist/TellegenViewer.svelte +2 -0
  6. package/dist/basemap.d.ts +14 -0
  7. package/dist/basemap.js +27 -0
  8. package/dist/colors.d.ts +6 -1
  9. package/dist/colors.js +11 -4
  10. package/dist/components/DiagnosticLogView.svelte +176 -0
  11. package/dist/components/DiagnosticLogView.svelte.d.ts +11 -0
  12. package/dist/components/FormulationSelector.svelte +1 -1
  13. package/dist/components/LocalCaseDetails.svelte +18 -3
  14. package/dist/components/LogEntryView.svelte +188 -0
  15. package/dist/components/LogEntryView.svelte.d.ts +11 -0
  16. package/dist/components/LogPanel.svelte +25 -0
  17. package/dist/components/LogPanel.svelte.d.ts +3 -0
  18. package/dist/components/McResults.svelte +18 -3
  19. package/dist/components/McWorkbench.svelte +688 -0
  20. package/dist/components/McWorkbench.svelte.d.ts +38 -0
  21. package/dist/components/MultiWire.svelte +136 -0
  22. package/dist/components/MultiWire.svelte.d.ts +7 -0
  23. package/dist/components/MulticonductorDetails.svelte +7 -0
  24. package/dist/components/NotificationCenter.svelte +37 -6
  25. package/dist/components/OmniSearch.svelte +163 -0
  26. package/dist/components/OmniSearch.svelte.d.ts +14 -0
  27. package/dist/components/ResultsTable.svelte +259 -0
  28. package/dist/components/ResultsTable.svelte.d.ts +13 -0
  29. package/dist/components/SchematicCanvas.svelte +1896 -0
  30. package/dist/components/SchematicCanvas.svelte.d.ts +13 -0
  31. package/dist/components/SolveCard.svelte +6 -0
  32. package/dist/components/schematic/PickCard.svelte +126 -0
  33. package/dist/components/schematic/PickCard.svelte.d.ts +56 -0
  34. package/dist/components/schematic/export.d.ts +21 -0
  35. package/dist/components/schematic/export.js +110 -0
  36. package/dist/components/schematic/layers.d.ts +161 -0
  37. package/dist/components/schematic/layers.js +756 -0
  38. package/dist/components/schematic/paint.d.ts +28 -0
  39. package/dist/components/schematic/paint.js +69 -0
  40. package/dist/components/schematic/palette.d.ts +34 -0
  41. package/dist/components/schematic/palette.js +54 -0
  42. package/dist/components/schematic/text.d.ts +83 -0
  43. package/dist/components/schematic/text.js +190 -0
  44. package/dist/components/schematic/view-prefs.svelte.d.ts +30 -0
  45. package/dist/components/schematic/view-prefs.svelte.js +77 -0
  46. package/dist/components.d.ts +4 -0
  47. package/dist/components.js +4 -0
  48. package/dist/context.svelte.d.ts +2 -0
  49. package/dist/context.svelte.js +2 -0
  50. package/dist/controller.svelte.d.ts +40 -5
  51. package/dist/controller.svelte.js +230 -25
  52. package/dist/diagram/basemap.d.ts +28 -0
  53. package/dist/diagram/basemap.js +39 -0
  54. package/dist/diagram/bus-stacks.d.ts +19 -0
  55. package/dist/diagram/bus-stacks.js +99 -0
  56. package/dist/diagram/colour-modes.d.ts +18 -0
  57. package/dist/diagram/colour-modes.js +33 -0
  58. package/dist/diagram/connections.d.ts +30 -0
  59. package/dist/diagram/connections.js +129 -0
  60. package/dist/diagram/display-tree.d.ts +21 -0
  61. package/dist/diagram/display-tree.js +65 -0
  62. package/dist/diagram/energisation.d.ts +10 -0
  63. package/dist/diagram/energisation.js +31 -0
  64. package/dist/diagram/feeders.d.ts +30 -0
  65. package/dist/diagram/feeders.js +57 -0
  66. package/dist/diagram/galvanic-zones.d.ts +60 -0
  67. package/dist/diagram/galvanic-zones.js +210 -0
  68. package/dist/diagram/graph-inputs.d.ts +18 -0
  69. package/dist/diagram/graph-inputs.js +103 -0
  70. package/dist/diagram/index.d.ts +28 -0
  71. package/dist/diagram/index.js +28 -0
  72. package/dist/diagram/landmarks.d.ts +50 -0
  73. package/dist/diagram/landmarks.js +153 -0
  74. package/dist/diagram/layout-morph.d.ts +15 -0
  75. package/dist/diagram/layout-morph.js +32 -0
  76. package/dist/diagram/multi-wire.d.ts +44 -0
  77. package/dist/diagram/multi-wire.js +65 -0
  78. package/dist/diagram/phase-bars.d.ts +35 -0
  79. package/dist/diagram/phase-bars.js +44 -0
  80. package/dist/diagram/results-table.d.ts +47 -0
  81. package/dist/diagram/results-table.js +173 -0
  82. package/dist/diagram/schematic-equipment.d.ts +133 -0
  83. package/dist/diagram/schematic-equipment.js +645 -0
  84. package/dist/diagram/schematic-layout.d.ts +51 -0
  85. package/dist/diagram/schematic-layout.js +240 -0
  86. package/dist/diagram/search.d.ts +36 -0
  87. package/dist/diagram/search.js +48 -0
  88. package/dist/diagram/shared-routes.d.ts +21 -0
  89. package/dist/diagram/shared-routes.js +40 -0
  90. package/dist/diagram/short-names.d.ts +11 -0
  91. package/dist/diagram/short-names.js +54 -0
  92. package/dist/diagram/snapshot.d.ts +115 -0
  93. package/dist/diagram/snapshot.js +242 -0
  94. package/dist/diagram/summary.d.ts +65 -0
  95. package/dist/diagram/summary.js +144 -0
  96. package/dist/diagram/svg-export.d.ts +80 -0
  97. package/dist/diagram/svg-export.js +108 -0
  98. package/dist/diagram/tree-walk.d.ts +13 -0
  99. package/dist/diagram/tree-walk.js +83 -0
  100. package/dist/diagram/value-labels.d.ts +24 -0
  101. package/dist/diagram/value-labels.js +69 -0
  102. package/dist/diagram/view-state.d.ts +12 -0
  103. package/dist/diagram/view-state.js +22 -0
  104. package/dist/diagram/voltage-levels.d.ts +14 -0
  105. package/dist/diagram/voltage-levels.js +20 -0
  106. package/dist/index.d.ts +3 -0
  107. package/dist/index.js +2 -0
  108. package/dist/log.svelte.d.ts +77 -0
  109. package/dist/log.svelte.js +149 -0
  110. package/dist/notices.svelte.d.ts +3 -0
  111. package/dist/state.svelte.d.ts +42 -5
  112. package/dist/state.svelte.js +56 -4
  113. package/dist/transformer-icon.d.ts +22 -13
  114. package/dist/transformer-icon.js +23 -13
  115. package/package.json +2 -2
@@ -0,0 +1,13 @@
1
+ import type { MulticonductorCase } from '../state.svelte.js';
2
+ import { type BasemapSpec } from '../basemap.js';
3
+ type $$ComponentProps = {
4
+ mc: MulticonductorCase;
5
+ onselectbus: (id: string) => void;
6
+ onselectedge: (id: string) => void;
7
+ onclose: () => void;
8
+ /** The background map under geographic positions: the map's own basemap, light-themed. */
9
+ basemap?: BasemapSpec;
10
+ };
11
+ declare const SchematicCanvas: import("svelte").Component<$$ComponentProps, {}, "">;
12
+ type SchematicCanvas = ReturnType<typeof SchematicCanvas>;
13
+ export default SchematicCanvas;
@@ -61,6 +61,12 @@
61
61
  <dd class="mono">{iterations.length}</dd>
62
62
  </div>
63
63
  {/if}
64
+ {#if active.solveDetail}
65
+ <div>
66
+ <dt>Solve</dt>
67
+ <dd>{active.solveDetail}</dd>
68
+ </div>
69
+ {/if}
64
70
  {#if server}
65
71
  <div>
66
72
  <dt>Solver</dt>
@@ -0,0 +1,126 @@
1
+ <script lang="ts" generics="T extends { id: string }">
2
+ import type { Snippet } from 'svelte';
3
+ import type { HoverPin } from './view-prefs.svelte.js';
4
+
5
+ /** A card beside a point of the diagram listing what is drawn there (branches sharing a route,
6
+ * buses at one point), so one can be picked. It opens on hover, stays while hovered, and is
7
+ * pinned by its owner; it flips to the other side of the point near the stage's edge. */
8
+ let {
9
+ x,
10
+ y,
11
+ stage,
12
+ gap,
13
+ reach,
14
+ heading,
15
+ label,
16
+ rows,
17
+ pin,
18
+ selected,
19
+ onhover,
20
+ onpick,
21
+ cells
22
+ }: {
23
+ /** The point, in stage pixels. */
24
+ x: number;
25
+ y: number;
26
+ stage: { width: number; height: number };
27
+ /** Distance from the point to the card. */
28
+ gap: number;
29
+ /** Room the card needs to the right of the point before it flips left. */
30
+ reach: number;
31
+ heading: string;
32
+ label: string;
33
+ rows: T[];
34
+ pin: HoverPin;
35
+ selected: (row: T) => boolean;
36
+ onhover: (row: T | null) => void;
37
+ onpick: (row: T) => void;
38
+ cells: Snippet<[T]>;
39
+ } = $props();
40
+
41
+ const right = $derived(x + reach < stage.width);
42
+ const below = $derived(y + 180 < stage.height);
43
+ </script>
44
+
45
+ <!-- svelte-ignore a11y_no_static_element_interactions (Pointer bookkeeping only: the rows are buttons.) -->
46
+ <div
47
+ class="card"
48
+ style:left={right ? `${x + gap}px` : null}
49
+ style:right={right ? null : `${stage.width - x + gap}px`}
50
+ style:top={below ? `${y + gap}px` : null}
51
+ style:bottom={below ? null : `${stage.height - y + gap}px`}
52
+ onpointerenter={() => pin.enterCard()}
53
+ onpointerleave={() => pin.leaveCard()}
54
+ onkeydown={(e) => {
55
+ if (e.key === 'Escape') pin.close();
56
+ }}
57
+ >
58
+ <p>{heading}{pin.pinned !== null ? '' : ' · click to keep open'}</p>
59
+ <ul aria-label={label}>
60
+ {#each rows as row, i (i)}
61
+ <li>
62
+ <button
63
+ aria-pressed={selected(row)}
64
+ onpointerenter={() => onhover(row)}
65
+ onpointerleave={() => onhover(null)}
66
+ onclick={() => onpick(row)}>{@render cells(row)}</button
67
+ >
68
+ </li>
69
+ {/each}
70
+ </ul>
71
+ </div>
72
+
73
+ <style>
74
+ .card {
75
+ position: absolute;
76
+ z-index: 2;
77
+ width: max-content;
78
+ min-width: 280px;
79
+ max-width: 420px;
80
+ padding: 4px 6px;
81
+ font: 10px var(--font-mono);
82
+ color: var(--text-secondary);
83
+ background: var(--paper);
84
+ border: 1px solid var(--line);
85
+ border-radius: 3px;
86
+ box-shadow: var(--elev-1);
87
+ }
88
+ p {
89
+ margin: 0 0 3px;
90
+ }
91
+ ul {
92
+ margin: 0;
93
+ padding: 0;
94
+ list-style: none;
95
+ }
96
+ button {
97
+ display: grid;
98
+ grid-template-columns: minmax(0, 1fr) auto auto auto auto;
99
+ gap: 8px;
100
+ width: 100%;
101
+ padding: 2px 4px;
102
+ font: inherit;
103
+ text-align: left;
104
+ color: var(--ink);
105
+ background: none;
106
+ border: 0;
107
+ border-radius: 2px;
108
+ cursor: pointer;
109
+ }
110
+ button:hover,
111
+ button[aria-pressed='true'] {
112
+ background: var(--accent-soft);
113
+ }
114
+ /* Cells come from the owner's snippet. */
115
+ .card :global(.id) {
116
+ overflow: hidden;
117
+ text-overflow: ellipsis;
118
+ white-space: nowrap;
119
+ }
120
+ .card :global(.violation) {
121
+ color: var(--text-danger);
122
+ }
123
+ .card :global(.warning) {
124
+ color: var(--accent);
125
+ }
126
+ </style>
@@ -0,0 +1,56 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HoverPin } from './view-prefs.svelte.js';
3
+ declare function $$render<T extends {
4
+ id: string;
5
+ }>(): {
6
+ props: {
7
+ /** The point, in stage pixels. */
8
+ x: number;
9
+ y: number;
10
+ stage: {
11
+ width: number;
12
+ height: number;
13
+ };
14
+ /** Distance from the point to the card. */
15
+ gap: number;
16
+ /** Room the card needs to the right of the point before it flips left. */
17
+ reach: number;
18
+ heading: string;
19
+ label: string;
20
+ rows: T[];
21
+ pin: HoverPin;
22
+ selected: (row: T) => boolean;
23
+ onhover: (row: T | null) => void;
24
+ onpick: (row: T) => void;
25
+ cells: Snippet<[T]>;
26
+ };
27
+ exports: {};
28
+ bindings: "";
29
+ slots: {};
30
+ events: {};
31
+ };
32
+ declare class __sveltets_Render<T extends {
33
+ id: string;
34
+ }> {
35
+ props(): ReturnType<typeof $$render<T>>['props'];
36
+ events(): ReturnType<typeof $$render<T>>['events'];
37
+ slots(): ReturnType<typeof $$render<T>>['slots'];
38
+ bindings(): "";
39
+ exports(): {};
40
+ }
41
+ interface $$IsomorphicComponent {
42
+ new <T extends {
43
+ id: string;
44
+ }>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
45
+ $$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
46
+ } & ReturnType<__sveltets_Render<T>['exports']>;
47
+ <T extends {
48
+ id: string;
49
+ }>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
50
+ z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
51
+ }
52
+ declare const PickCard: $$IsomorphicComponent;
53
+ type PickCard<T extends {
54
+ id: string;
55
+ }> = InstanceType<typeof PickCard<T>>;
56
+ export default PickCard;
@@ -0,0 +1,21 @@
1
+ import type { Deck, OrthographicView } from '@deck.gl/core';
2
+ import { type titleBlock } from '../../diagram/index.js';
3
+ import type { SchematicScene } from './layers.js';
4
+ type TitleBlock = ReturnType<typeof titleBlock>;
5
+ export interface ExportView {
6
+ camera: {
7
+ target: [number, number, number];
8
+ zoom: number;
9
+ };
10
+ width: number;
11
+ height: number;
12
+ }
13
+ /** Hand a file to the viewer. */
14
+ export declare function download(blob: Blob, name: string): void;
15
+ /** A file name stem from a case label. */
16
+ export declare const fileStem: (label: string) => string;
17
+ /** The canvas as drawn, with a title block below it. */
18
+ export declare function canvasPng(deck: Deck<OrthographicView>, canvas: HTMLCanvasElement, title: TitleBlock): Promise<Blob | null>;
19
+ /** The visible region of a scene as vector SVG: lines, symbols, buses, the selection and labels. */
20
+ export declare function sceneSvg(s: SchematicScene, view: ExportView, title: TitleBlock): string;
21
+ export {};
@@ -0,0 +1,110 @@
1
+ import { fitText, TITLE_BLOCK_HEIGHT, viewportSvg } from '../../diagram/index.js';
2
+ import { segmentColours, segmentWidths, strokeColours } from './paint.js';
3
+ import { ACCENT, INK, PAPER, stateInk } from './palette.js';
4
+ /** Hand a file to the viewer. */
5
+ export function download(blob, name) {
6
+ const url = URL.createObjectURL(blob);
7
+ const a = document.createElement('a');
8
+ a.href = url;
9
+ a.download = name;
10
+ a.click();
11
+ setTimeout(() => URL.revokeObjectURL(url), 1000);
12
+ }
13
+ /** A file name stem from a case label. */
14
+ export const fileStem = (label) => `${label.replace(/[^\w.-]+/g, '_')}-schematic`;
15
+ /** The canvas as drawn, with a title block below it. */
16
+ export function canvasPng(deck, canvas, title) {
17
+ // Read the drawing buffer in the same task as a forced draw, before it is cleared.
18
+ deck.redraw('export');
19
+ const k = canvas.width / canvas.clientWidth;
20
+ const out = document.createElement('canvas');
21
+ const ctx = out.getContext('2d');
22
+ if (!ctx)
23
+ return Promise.resolve(null);
24
+ out.width = canvas.width;
25
+ out.height = canvas.height + TITLE_BLOCK_HEIGHT * k;
26
+ ctx.fillStyle = 'rgb(252 251 247)';
27
+ ctx.fillRect(0, 0, out.width, out.height);
28
+ ctx.drawImage(canvas, 0, 0);
29
+ for (const [col, lines] of [title.left, title.right].entries())
30
+ lines.forEach((line, i) => {
31
+ const lead = col === 0 && i === 0;
32
+ ctx.font = `${lead ? '600 ' : ''}${(lead ? 12 : 11) * k}px "IBM Plex Mono", monospace`;
33
+ ctx.fillStyle = lead ? 'rgb(32 36 43)' : 'rgb(77 81 86)';
34
+ ctx.fillText(fitText(line, canvas.clientWidth / 2), (col * out.width) / 2 + 12 * k, canvas.height + (18 + i * 15) * k);
35
+ });
36
+ return new Promise((resolve) => out.toBlob(resolve, 'image/png'));
37
+ }
38
+ /** The visible region of a scene as vector SVG: lines, symbols, buses, the selection and labels. */
39
+ export function sceneSvg(s, view, title) {
40
+ const { camera, width, height } = view;
41
+ const d = s.drawn;
42
+ const scale = 2 ** camera.zoom;
43
+ const x0 = camera.target[0] - width / 2 / scale;
44
+ const y0 = camera.target[1] - height / 2 / scale;
45
+ const css = (c) => `rgb(${c[0]} ${c[1]} ${c[2]})`;
46
+ const symbols = s.symbols;
47
+ return viewportSvg({
48
+ bounds: [x0, y0, x0 + width / scale, y0 + height / scale],
49
+ scale,
50
+ width: Math.round(width),
51
+ height: Math.round(height),
52
+ background: css(PAPER),
53
+ ink: css(INK),
54
+ muted: 'rgb(77 81 86)',
55
+ lineSets: [
56
+ {
57
+ sources: d.sources,
58
+ targets: d.targets,
59
+ colors: segmentColours(d, s.edgeColours, s.edgeMv, s.zoomedOut, s.fan),
60
+ count: d.segmentEdge.length,
61
+ widths: segmentWidths(d, s.edgeMv, s.colour !== 'none')
62
+ },
63
+ ...(symbols
64
+ ? [
65
+ {
66
+ sources: symbols.sources,
67
+ targets: symbols.targets,
68
+ colors: strokeColours(symbols.owner, s.fan.edges, s.live),
69
+ count: symbols.sources.length / 3,
70
+ width: 1.25
71
+ },
72
+ ...(s.ticksOn
73
+ ? [
74
+ {
75
+ sources: symbols.ticks.sources,
76
+ targets: symbols.ticks.targets,
77
+ colors: strokeColours(symbols.ticks.edge, s.fan.edges, s.live),
78
+ count: symbols.ticks.edge.length,
79
+ width: 1
80
+ }
81
+ ]
82
+ : [])
83
+ ]
84
+ : [])
85
+ ],
86
+ points: {
87
+ positions: s.geometry.positions,
88
+ colors: Uint8Array.from(s.busColours.flat()),
89
+ count: s.graph.buses.length,
90
+ radius: 2.6
91
+ },
92
+ markers: s.selectedBus >= 0
93
+ ? [
94
+ {
95
+ position: s.geometry.positions.subarray(s.selectedBus * 3, s.selectedBus * 3 + 2),
96
+ radius: 7,
97
+ stroke: css(ACCENT)
98
+ }
99
+ ]
100
+ : [],
101
+ texts: s.labels.map((l) => ({
102
+ position: l.position,
103
+ text: l.text,
104
+ dx: 6,
105
+ dy: -8,
106
+ color: css(stateInk(l.state))
107
+ })),
108
+ title
109
+ });
110
+ }
@@ -0,0 +1,161 @@
1
+ import type { Layer } from '@deck.gl/core';
2
+ import type { RGBA } from '../../colors.js';
3
+ import type { DistGraph } from '@tellegen/engine';
4
+ import { type BusStacks, type EquipmentItem, type EquipmentSymbols, type FannedBranch, type LabelCandidate, type Landmark, type ResultSnapshot, type SchematicGeometry, type ZoneCorridor, type ZoneState } from '../../diagram/index.js';
5
+ import { type FanState } from './paint.js';
6
+ /** The deck.gl modules, imported on demand. */
7
+ export interface DeckKit {
8
+ core: typeof import('@deck.gl/core');
9
+ layers: typeof import('@deck.gl/layers');
10
+ }
11
+ export type Colour = 'none' | 'voltage-band' | 'loading-heat';
12
+ /** Screen radius of a spread stack of `n` buses: wider for more, so their symbols stay apart. */
13
+ export declare const stackRadius: (n: number) => number;
14
+ /** Buses gliding between layouts along straight chords. */
15
+ export declare function morphLayers(kit: DeckKit, morph: {
16
+ s: Float32Array;
17
+ t: Float32Array;
18
+ cur: Float32Array;
19
+ endpoints: Int32Array;
20
+ }, busCount: number): Layer[];
21
+ /** Per-canvas memory of layer data. deck.gl compares a layer's `data` by reference, so a layer
22
+ * whose inputs did not change gets the same data and is left alone: a hover or selection change
23
+ * rebuilds only the small highlight layers, not 50,000 segment colours and every label. */
24
+ /** Columnar layer data: a count and typed-array attributes. */
25
+ type BinaryData = {
26
+ length: number;
27
+ attributes: Record<string, {
28
+ value: Float32Array | Uint8Array;
29
+ size: number;
30
+ normalized?: boolean;
31
+ }>;
32
+ };
33
+ export declare function createLayerCache(): {
34
+ branches: (keys: unknown[], compute: () => BinaryData) => BinaryData;
35
+ underlay: (keys: unknown[], compute: () => BinaryData) => BinaryData;
36
+ equipment: (keys: unknown[], compute: () => BinaryData) => BinaryData;
37
+ ticks: (keys: unknown[], compute: () => BinaryData) => BinaryData;
38
+ arrows: (keys: unknown[], compute: () => BinaryData) => BinaryData;
39
+ itemTexts: (keys: unknown[], compute: () => EquipmentItem[]) => EquipmentItem[];
40
+ transformerTexts: (keys: unknown[], compute: () => EquipmentItem[]) => EquipmentItem[];
41
+ zoneTags: (keys: unknown[], compute: () => {
42
+ z: number;
43
+ text: string;
44
+ position: [number, number];
45
+ width: number;
46
+ }[]) => {
47
+ z: number;
48
+ text: string;
49
+ position: [number, number];
50
+ width: number;
51
+ }[];
52
+ corridors: (keys: unknown[], compute: () => {
53
+ segments: {
54
+ z: number;
55
+ s: number;
56
+ }[];
57
+ buses: {
58
+ z: number;
59
+ i: number;
60
+ }[];
61
+ }) => {
62
+ segments: {
63
+ z: number;
64
+ s: number;
65
+ }[];
66
+ buses: {
67
+ z: number;
68
+ i: number;
69
+ }[];
70
+ };
71
+ segmentsOf: (keys: unknown[], compute: () => Map<number, number[]>) => Map<number, number[]>;
72
+ };
73
+ export type LayerCache = ReturnType<typeof createLayerCache>;
74
+ /** Everything one frame of the diagram draws, as the canvas derives it. */
75
+ export interface SchematicScene {
76
+ graph: DistGraph;
77
+ layout: 'schematic' | 'source';
78
+ colour: Colour;
79
+ /** The layout on screen, before stacks spread. */
80
+ shown: SchematicGeometry;
81
+ /** Bus positions as drawn (stacks spread). */
82
+ geometry: SchematicGeometry;
83
+ /** Branch segments as drawn (cut under symbols when they show). */
84
+ drawn: SchematicGeometry;
85
+ /** Equipment symbols, when they are legible. */
86
+ symbols: EquipmentSymbols | null;
87
+ ticksOn: boolean;
88
+ valuesOn: boolean;
89
+ /** Terminal and transformer labels beside the symbols, at the deepest zoom. */
90
+ labelsOn: boolean;
91
+ zoomedOut: boolean;
92
+ live: {
93
+ edges: ArrayLike<boolean | number>;
94
+ buses: ArrayLike<boolean | number>;
95
+ };
96
+ edgeColours: RGBA[];
97
+ busColours: RGBA[];
98
+ edgeMv: Uint8Array;
99
+ snapshot: ResultSnapshot | null;
100
+ /** Changes when attachment powers change (a text trigger). */
101
+ powers: unknown;
102
+ itemText: (d: EquipmentItem) => string;
103
+ arrows: {
104
+ edge: Int32Array;
105
+ sources: Float32Array;
106
+ targets: Float32Array;
107
+ } | null;
108
+ selectedBus: number;
109
+ selectedEdges: Set<number>;
110
+ hoveredBus: number;
111
+ hoveredEdges: Set<number>;
112
+ cursor: number;
113
+ labels: (LabelCandidate & {
114
+ position: [number, number];
115
+ })[];
116
+ marks: {
117
+ placed: Landmark[];
118
+ strokes: {
119
+ sources: Float32Array;
120
+ targets: Float32Array;
121
+ owner: Int32Array;
122
+ };
123
+ } | null;
124
+ markName: Map<string, string>;
125
+ mvBuses: number[];
126
+ allBuses: number[];
127
+ zones: {
128
+ states: ZoneState[];
129
+ shapes: {
130
+ z: number;
131
+ polygon: [number, number][];
132
+ }[];
133
+ tags: {
134
+ z: number;
135
+ text: string;
136
+ position: [number, number];
137
+ width: number;
138
+ }[];
139
+ tagZoom: number;
140
+ corridors: ZoneCorridor[];
141
+ };
142
+ /** Where the pointer is in the network: its network's branches faintly, its feeder's strongly,
143
+ * the path back to the source when shown, and the network's supply point. */
144
+ hover: {
145
+ network: Set<number>;
146
+ feeder: Set<number>;
147
+ path: Set<number>;
148
+ supply: [number, number] | null;
149
+ tint: RGBA;
150
+ } | null;
151
+ stacks: BusStacks | null;
152
+ spreadStacks: number[];
153
+ /** Changes whenever attachment text would (the canvas's text source). */
154
+ textSource: unknown;
155
+ cache: LayerCache;
156
+ fans: FannedBranch[];
157
+ fannedGroups: number[];
158
+ fan: FanState;
159
+ }
160
+ export declare function sceneLayers(kit: DeckKit, s: SchematicScene): Layer[];
161
+ export {};