@vscada/core 0.0.1
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/.tsbuildinfo +1 -0
- package/dist/a11y/contrast.d.ts +11 -0
- package/dist/a11y/contrast.d.ts.map +1 -0
- package/dist/a11y/live-region.d.ts +42 -0
- package/dist/a11y/live-region.d.ts.map +1 -0
- package/dist/a11y/reduced-motion.d.ts +55 -0
- package/dist/a11y/reduced-motion.d.ts.map +1 -0
- package/dist/a11y/static-representation-registry.d.ts +20 -0
- package/dist/a11y/static-representation-registry.d.ts.map +1 -0
- package/dist/bindings/binding-fixture.d.ts +3 -0
- package/dist/bindings/binding-fixture.d.ts.map +1 -0
- package/dist/bindings/binding-types.d.ts +52 -0
- package/dist/bindings/binding-types.d.ts.map +1 -0
- package/dist/bindings/color-ramp.d.ts +9 -0
- package/dist/bindings/color-ramp.d.ts.map +1 -0
- package/dist/bindings/transforms.d.ts +103 -0
- package/dist/bindings/transforms.d.ts.map +1 -0
- package/dist/constants-DMdpoOyH.js +4 -0
- package/dist/contracts/connection-renderer.d.ts +16 -0
- package/dist/contracts/connection-renderer.d.ts.map +1 -0
- package/dist/contracts/connection-state.d.ts +8 -0
- package/dist/contracts/connection-state.d.ts.map +1 -0
- package/dist/contracts/handles.d.ts +83 -0
- package/dist/contracts/handles.d.ts.map +1 -0
- package/dist/contracts/primitive.d.ts +37 -0
- package/dist/contracts/primitive.d.ts.map +1 -0
- package/dist/contracts/renderer.d.ts +34 -0
- package/dist/contracts/renderer.d.ts.map +1 -0
- package/dist/contracts/tag-value.d.ts +33 -0
- package/dist/contracts/tag-value.d.ts.map +1 -0
- package/dist/contracts/time-source.d.ts +14 -0
- package/dist/contracts/time-source.d.ts.map +1 -0
- package/dist/custom-elements.json +1068 -0
- package/dist/export/svg-export.d.ts +24 -0
- package/dist/export/svg-export.d.ts.map +1 -0
- package/dist/fsm/fsm.d.ts +45 -0
- package/dist/fsm/fsm.d.ts.map +1 -0
- package/dist/fsm/tween.d.ts +39 -0
- package/dist/fsm/tween.d.ts.map +1 -0
- package/dist/import/load-svg-import.d.ts +22 -0
- package/dist/import/load-svg-import.d.ts.map +1 -0
- package/dist/import/svg-source-registry.d.ts +4 -0
- package/dist/import/svg-source-registry.d.ts.map +1 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4549 -0
- package/dist/interaction/gesture-arbiter.d.ts +20 -0
- package/dist/interaction/gesture-arbiter.d.ts.map +1 -0
- package/dist/interaction/hit-area.d.ts +44 -0
- package/dist/interaction/hit-area.d.ts.map +1 -0
- package/dist/interaction/pan-zoom-gestures.d.ts +43 -0
- package/dist/interaction/pan-zoom-gestures.d.ts.map +1 -0
- package/dist/interaction/pointer-pipeline.d.ts +38 -0
- package/dist/interaction/pointer-pipeline.d.ts.map +1 -0
- package/dist/license/console-notice.d.ts +15 -0
- package/dist/license/console-notice.d.ts.map +1 -0
- package/dist/license/format.d.ts +29 -0
- package/dist/license/format.d.ts.map +1 -0
- package/dist/license/state.d.ts +43 -0
- package/dist/license/state.d.ts.map +1 -0
- package/dist/license/vendor-keys.d.ts +12 -0
- package/dist/license/vendor-keys.d.ts.map +1 -0
- package/dist/license/verify-fallback.d.ts +31 -0
- package/dist/license/verify-fallback.d.ts.map +1 -0
- package/dist/license/verify-webcrypto.d.ts +4 -0
- package/dist/license/verify-webcrypto.d.ts.map +1 -0
- package/dist/license/watermark.d.ts +20 -0
- package/dist/license/watermark.d.ts.map +1 -0
- package/dist/media/registry.d.ts +97 -0
- package/dist/media/registry.d.ts.map +1 -0
- package/dist/registry/connection-registry.d.ts +5 -0
- package/dist/registry/connection-registry.d.ts.map +1 -0
- package/dist/registry/element-catalog.d.ts +805 -0
- package/dist/registry/element-catalog.d.ts.map +1 -0
- package/dist/registry/primitive-registry.d.ts +7 -0
- package/dist/registry/primitive-registry.d.ts.map +1 -0
- package/dist/registry/theme-registry.d.ts +6 -0
- package/dist/registry/theme-registry.d.ts.map +1 -0
- package/dist/registry.d.ts +8 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/scada-view.d.ts +322 -0
- package/dist/scada-view.d.ts.map +1 -0
- package/dist/scene/connection-geometry.d.ts +95 -0
- package/dist/scene/connection-geometry.d.ts.map +1 -0
- package/dist/scene/constants.d.ts +10 -0
- package/dist/scene/constants.d.ts.map +1 -0
- package/dist/scene/crossing-jumps.d.ts +85 -0
- package/dist/scene/crossing-jumps.d.ts.map +1 -0
- package/dist/scene/dev-validate.d.ts +24 -0
- package/dist/scene/dev-validate.d.ts.map +1 -0
- package/dist/scene/errors.d.ts +15 -0
- package/dist/scene/errors.d.ts.map +1 -0
- package/dist/scene/groups.d.ts +90 -0
- package/dist/scene/groups.d.ts.map +1 -0
- package/dist/scene/lane-offset.d.ts +69 -0
- package/dist/scene/lane-offset.d.ts.map +1 -0
- package/dist/scene/orthogonal-router.d.ts +63 -0
- package/dist/scene/orthogonal-router.d.ts.map +1 -0
- package/dist/scene/scene-schema.d.ts +881 -0
- package/dist/scene/scene-schema.d.ts.map +1 -0
- package/dist/scene/structural-validator.d.ts +25 -0
- package/dist/scene/structural-validator.d.ts.map +1 -0
- package/dist/scene/validate-scene.d.ts +26 -0
- package/dist/scene/validate-scene.d.ts.map +1 -0
- package/dist/scene-authoring.d.ts +12 -0
- package/dist/scene-authoring.d.ts.map +1 -0
- package/dist/scene-authoring.js +952 -0
- package/dist/scheduler/alarm-band.d.ts +33 -0
- package/dist/scheduler/alarm-band.d.ts.map +1 -0
- package/dist/scheduler/animation-registry.d.ts +38 -0
- package/dist/scheduler/animation-registry.d.ts.map +1 -0
- package/dist/scheduler/lod.d.ts +25 -0
- package/dist/scheduler/lod.d.ts.map +1 -0
- package/dist/scheduler/quality-overlay.d.ts +19 -0
- package/dist/scheduler/quality-overlay.d.ts.map +1 -0
- package/dist/scheduler/quality.d.ts +15 -0
- package/dist/scheduler/quality.d.ts.map +1 -0
- package/dist/scheduler/scheduler.d.ts +243 -0
- package/dist/scheduler/scheduler.d.ts.map +1 -0
- package/dist/scheduler/visual-state-resolver.d.ts +31 -0
- package/dist/scheduler/visual-state-resolver.d.ts.map +1 -0
- package/dist/store/value-store.d.ts +65 -0
- package/dist/store/value-store.d.ts.map +1 -0
- package/dist/tokens.d.ts +703 -0
- package/dist/tokens.d.ts.map +1 -0
- package/dist/topology/graph.d.ts +33 -0
- package/dist/topology/graph.d.ts.map +1 -0
- package/dist/topology/group-collapse.d.ts +15 -0
- package/dist/topology/group-collapse.d.ts.map +1 -0
- package/dist/topology/inference.d.ts +71 -0
- package/dist/topology/inference.d.ts.map +1 -0
- package/dist/topology/traversal.d.ts +29 -0
- package/dist/topology/traversal.d.ts.map +1 -0
- package/dist/topology/upstream-highlight.d.ts +75 -0
- package/dist/topology/upstream-highlight.d.ts.map +1 -0
- package/dist/units/formatter.d.ts +22 -0
- package/dist/units/formatter.d.ts.map +1 -0
- package/dist/units/registry.d.ts +21 -0
- package/dist/units/registry.d.ts.map +1 -0
- package/dist/view/group-view-state.d.ts +77 -0
- package/dist/view/group-view-state.d.ts.map +1 -0
- package/dist/view/viewport-state.d.ts +112 -0
- package/dist/view/viewport-state.d.ts.map +1 -0
- package/dist/vscada.umd.cjs +45 -0
- package/package.json +37 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,UAAU;IACzB,8EAA8E;IAC9E,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAC;IAClC,8DAA8D;IAC9D,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE;QACN,2DAA2D;QAC3D,WAA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ene-schema';
|
|
2
|
+
/**
|
|
3
|
+
* Topology graph module (§5.4, Story 2.3 Task 1). Structurally SEPARATE
|
|
4
|
+
* from geometry/routing — this file never imports connection-geometry,
|
|
5
|
+
* lane-offset, crossing-jumps, or orthogonal-router. `scene.topology`
|
|
6
|
+
* describes the PROCESS graph (plain node ids, no ports); a connection's
|
|
7
|
+
* routed pipe geometry is an unrelated concern that happens to often share
|
|
8
|
+
* the same `id` as a topology edge (medium-inheritance's lookup key), but
|
|
9
|
+
* this module doesn't know or care about routing at all.
|
|
10
|
+
*
|
|
11
|
+
* `buildTopologyGraph` is pure and does no store/clock access (AD-2, AD-4)
|
|
12
|
+
* — callers build it ONCE per scene load and reuse the result; it must
|
|
13
|
+
* never be reconstructed inside a render/animation loop.
|
|
14
|
+
*/
|
|
15
|
+
export interface TopologyEdge {
|
|
16
|
+
/** Matches a `connections[].id` in the same scene — the medium-inheritance lookup key (Task 3). */
|
|
17
|
+
id: string;
|
|
18
|
+
from: string;
|
|
19
|
+
to: string;
|
|
20
|
+
medium: string | undefined;
|
|
21
|
+
}
|
|
22
|
+
export interface TopologyGraph {
|
|
23
|
+
nodes: ReadonlySet<string>;
|
|
24
|
+
edges: readonly TopologyEdge[];
|
|
25
|
+
/** Outgoing edges keyed by their `from` node — the downstream-traversal adjacency. */
|
|
26
|
+
outgoing: ReadonlyMap<string, readonly TopologyEdge[]>;
|
|
27
|
+
/** Incoming edges keyed by their `to` node — the upstream-traversal adjacency. */
|
|
28
|
+
incoming: ReadonlyMap<string, readonly TopologyEdge[]>;
|
|
29
|
+
/** O(1) edge lookup by id, e.g. for a connection's effective-medium precedence. */
|
|
30
|
+
edgeById: ReadonlyMap<string, TopologyEdge>;
|
|
31
|
+
}
|
|
32
|
+
export declare function buildTopologyGraph(scene: Scene): TopologyGraph;
|
|
33
|
+
//# sourceMappingURL=graph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../src/topology/graph.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,YAAY;IAC3B,mGAAmG;IACnG,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;IAC/B,sFAAsF;IACtF,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC,CAAC;IACvD,kFAAkF;IAClF,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC,CAAC;IACvD,mFAAmF;IACnF,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CAC7C;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,aAAa,CA0B9D"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Scene } from '../scene/scene-schema';
|
|
2
|
+
import type { TopologyGraph } from './graph';
|
|
3
|
+
/** Maps a single node/element id to the id it presents as, given which groups are currently collapsed. */
|
|
4
|
+
export declare function presentationNodeId(scene: Scene, collapsedGroupIds: ReadonlySet<string>, nodeId: string): string;
|
|
5
|
+
/**
|
|
6
|
+
* Builds a NEW `TopologyGraph` (the original `graph` argument is never
|
|
7
|
+
* mutated) where every currently-collapsed group's children are merged
|
|
8
|
+
* into one node keyed by the group's id. An edge whose endpoints both fold
|
|
9
|
+
* into the same group (fully interior to the collapsed section) is
|
|
10
|
+
* dropped — it isn't visible at this presentation level. Everything else
|
|
11
|
+
* — traversal correctness, cycle-safety — is inherited for free by reusing
|
|
12
|
+
* `reachableSet`/`upstreamOf`/`downstreamOf` unchanged against this view.
|
|
13
|
+
*/
|
|
14
|
+
export declare function buildCollapsedGraphView(graph: TopologyGraph, scene: Scene, collapsedGroupIds: ReadonlySet<string>): TopologyGraph;
|
|
15
|
+
//# sourceMappingURL=group-collapse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-collapse.d.ts","sourceRoot":"","sources":["../../src/topology/group-collapse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,SAAS,CAAC;AAiC3D,0GAA0G;AAC1G,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAE/G;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,aAAa,CAkCjI"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { TopologyGraph } from './graph';
|
|
2
|
+
/**
|
|
3
|
+
* Flow inference & isolation (§5.4, Story 2.4 Tasks 2/3) — opt-in via scene
|
|
4
|
+
* `inferFlow: true`. Pure graph pass, no store/clock access (AD-4): every
|
|
5
|
+
* traversal goes through the Story 2.3 sanctioned API (`downstreamOf`),
|
|
6
|
+
* never raw recursion, so the cycle guard stays in exactly one place.
|
|
7
|
+
*
|
|
8
|
+
* Scope (deliberate, see story Dev Notes):
|
|
9
|
+
* - Only nodes/edges within the forward-downstream cone of a declared
|
|
10
|
+
* source participate. Anything never reachable from ANY declared source
|
|
11
|
+
* (e.g. suction piping feeding INTO a pump, or an unrelated subsystem) is
|
|
12
|
+
* left untouched — no entry in the result maps — which is what keeps this
|
|
13
|
+
* free of reverse-flow inference (explicit `reverse` stays tag-driven,
|
|
14
|
+
* out of scope per the story).
|
|
15
|
+
* - `isolated`: structurally unreachable from every declared source once
|
|
16
|
+
* closed-valve nodes cut their outgoing edges (Task 3 — the graph split).
|
|
17
|
+
* - `no-flow`: still structurally reachable (not isolated) but not reached
|
|
18
|
+
* by any currently-ACTIVE (running) source — e.g. downstream of a stopped
|
|
19
|
+
* pump, or the specific pipe segment immediately blocked at a closed
|
|
20
|
+
* valve whose downstream zone happens to still be fed by another loop
|
|
21
|
+
* (recycle loops keep it merely `no-flow`, not `isolated`).
|
|
22
|
+
* - `flowing`: reachable from an active source through only open valves.
|
|
23
|
+
*/
|
|
24
|
+
export type InferredFlowState = 'flowing' | 'no-flow' | 'isolated';
|
|
25
|
+
export interface FlowInferenceInput {
|
|
26
|
+
graph: TopologyGraph;
|
|
27
|
+
/** Every node id that is a flow source (e.g. pumps), regardless of current run state. */
|
|
28
|
+
sourceNodeIds: ReadonlySet<string>;
|
|
29
|
+
/** Subset of `sourceNodeIds` currently stopped — flow only originates from the complement. */
|
|
30
|
+
stoppedSourceNodeIds: ReadonlySet<string>;
|
|
31
|
+
/** Node ids currently in a closed-valve-like FSM state — cuts their outgoing edges from reachability. */
|
|
32
|
+
closedNodeIds: ReadonlySet<string>;
|
|
33
|
+
}
|
|
34
|
+
export interface FlowInferenceResult {
|
|
35
|
+
/** Topology edge id -> inferred state (matches `connections[].id`, the medium-inheritance lookup key). */
|
|
36
|
+
edgeStates: ReadonlyMap<string, InferredFlowState>;
|
|
37
|
+
/** Topology node id -> inferred state (matches an element id). */
|
|
38
|
+
nodeStates: ReadonlyMap<string, InferredFlowState>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Pure recompute — callers (an FSM transition handler, or a test) decide
|
|
42
|
+
* WHEN to call this; it must never run per animation frame (AD-2/AD-4). Use
|
|
43
|
+
* `FlowInferenceCache` to memoize across ticks and only recompute on an
|
|
44
|
+
* actual source/valve state change.
|
|
45
|
+
*/
|
|
46
|
+
export declare function computeFlowInference(input: FlowInferenceInput): FlowInferenceResult;
|
|
47
|
+
/**
|
|
48
|
+
* AD-4: inferred flow/isolation state is reconstructible derived state,
|
|
49
|
+
* cached, invalidated on scene reload — NOT a new clock or store. This
|
|
50
|
+
* wrapper is the topology module's owned cache: `update()` only re-runs the
|
|
51
|
+
* (cheap but non-trivial) graph pass when the source/valve signature
|
|
52
|
+
* actually changed since the last call — event-driven from FSM transitions,
|
|
53
|
+
* never per animation frame. Per-frame readers (the scheduler tick) call
|
|
54
|
+
* only the O(1) `getXState` accessors.
|
|
55
|
+
*/
|
|
56
|
+
export declare class FlowInferenceCache {
|
|
57
|
+
private readonly graph;
|
|
58
|
+
private readonly sourceNodeIds;
|
|
59
|
+
private result;
|
|
60
|
+
private lastSignature;
|
|
61
|
+
constructor(graph: TopologyGraph, sourceNodeIds: ReadonlySet<string>);
|
|
62
|
+
/** Call this on a source/valve FSM state-change event — never on a tick. */
|
|
63
|
+
update(stoppedSourceNodeIds: ReadonlySet<string>, closedNodeIds: ReadonlySet<string>): FlowInferenceResult;
|
|
64
|
+
getEdgeState(edgeId: string): InferredFlowState | undefined;
|
|
65
|
+
getNodeState(nodeId: string): InferredFlowState | undefined;
|
|
66
|
+
/** A connection id (edge) or an element id (node) — whichever namespace `id` belongs to. */
|
|
67
|
+
getState(id: string): InferredFlowState | undefined;
|
|
68
|
+
/** Scene reload invalidation (AD-4) — the cache holds nothing that survives a fresh scene build. */
|
|
69
|
+
reset(): void;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=inference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../src/topology/inference.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,SAAS,CAAC;AAG3D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SAAS,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ph } from './graph';
|
|
2
|
+
/**
|
|
3
|
+
* Cycle-safe traversal primitives (§5.4, Story 2.3 Task 2) — THE only
|
|
4
|
+
* sanctioned way to walk a `TopologyGraph`. "Cycles are expected... a hard
|
|
5
|
+
* requirement, not an edge case" (recycle loops: condensate return,
|
|
6
|
+
* flue-gas recirculation). Every later consumer (Story 2.4 flow
|
|
7
|
+
* inference/isolation, hover-upstream-highlight) must traverse through
|
|
8
|
+
* `reachableSet`/`upstreamOf`/`downstreamOf` — never raw recursion — so the
|
|
9
|
+
* cycle guard lives in exactly one place.
|
|
10
|
+
*
|
|
11
|
+
* Pure, store/clock-free functions (AD-4); no per-frame use — call once per
|
|
12
|
+
* need and let the caller memoize/cache at whatever boundary makes sense
|
|
13
|
+
* for it (AD-2 governs the GRAPH build, not these read-only walks).
|
|
14
|
+
*/
|
|
15
|
+
export type TraversalDirection = 'upstream' | 'downstream';
|
|
16
|
+
/**
|
|
17
|
+
* Visited-set BFS. A node is added to `visited` at the moment it is
|
|
18
|
+
* discovered, BEFORE it is ever enqueued — so a recycle loop can never
|
|
19
|
+
* cause the same node to re-enter the queue, which is what actually
|
|
20
|
+
* guarantees termination (not merely a size check after the fact). The
|
|
21
|
+
* defensive iteration cap below only guards against a future edit
|
|
22
|
+
* accidentally breaking that invariant; it should never fire in practice.
|
|
23
|
+
*/
|
|
24
|
+
export declare function reachableSet(graph: TopologyGraph, startNodeId: string, direction: TraversalDirection): Set<string>;
|
|
25
|
+
/** All nodes reachable by walking edges backward (against `from -> to`) from `startNodeId`, inclusive of itself. */
|
|
26
|
+
export declare function upstreamOf(graph: TopologyGraph, startNodeId: string): Set<string>;
|
|
27
|
+
/** All nodes reachable by walking edges forward (`from -> to`) from `startNodeId`, inclusive of itself. */
|
|
28
|
+
export declare function downstreamOf(graph: TopologyGraph, startNodeId: string): Set<string>;
|
|
29
|
+
//# sourceMappingURL=traversal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traversal.d.ts","sourceRoot":"","sources":["../../src/topology/traversal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,SAAS,CAAC;AAE3D;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,YAAY,CAAC;AAE3D;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,kBAAkB,GAAG,GAAG,CAAC,MAAM,CAAC,CA+BlH;AAED,oHAAoH;AACpH,wBAAgB,UAAU,CAAC,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAEjF;AAED,2GAA2G;AAC3G,wBAAgB,YAAY,CAAC,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAEnF"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { Renderer } from '../contracts/renderer';
|
|
2
|
+
import type { TopologyGraph } from './graph';
|
|
3
|
+
/**
|
|
4
|
+
* Upstream hover highlight (§5.4, Story 2.4 Task 4). Pure computation +
|
|
5
|
+
* a thin renderer-seam toggle — no new DOM is ever constructed on hover
|
|
6
|
+
* (AD-2): the caller supplies element/connection nodes that ALREADY exist
|
|
7
|
+
* from the one-time structural build, and this module only flips an
|
|
8
|
+
* attribute on them through the existing `Renderer` seam.
|
|
9
|
+
*/
|
|
10
|
+
export interface UpstreamHighlight {
|
|
11
|
+
/** Node ids on the path back to source, including the hovered pipe's own two endpoints. */
|
|
12
|
+
nodes: ReadonlySet<string>;
|
|
13
|
+
/** Edge (connection) ids on the path back to source, including the hovered pipe itself. */
|
|
14
|
+
edges: ReadonlySet<string>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Everything upstream of the hovered pipe, back to source(s).
|
|
18
|
+
*
|
|
19
|
+
* Deliberately NOT built on `upstreamOf` (generic "every node that can
|
|
20
|
+
* reach this node" reachability). A junction node can be shared by two
|
|
21
|
+
* PHYSICALLY UNRELATED process loops that just happen to both terminate
|
|
22
|
+
* there (e.g. the recycle-loops fixture: BOILER-1 receives both the
|
|
23
|
+
* condensate-return steam loop AND the flue-gas recirculation loop on two
|
|
24
|
+
* different incoming edges). Generic backward reachability from a shared
|
|
25
|
+
* node follows every incoming edge regardless of which physical circuit it
|
|
26
|
+
* belongs to, so hovering one loop's pipe would bleed into the other
|
|
27
|
+
* loop's nodes purely because they touch the same junction — wrong.
|
|
28
|
+
*
|
|
29
|
+
* Instead this walks backward edge-by-edge along the hovered pipe's own
|
|
30
|
+
* predecessor chain: starting at the hovered edge, look at the edges
|
|
31
|
+
* feeding directly INTO its `from` node, keep only the ones carrying the
|
|
32
|
+
* SAME medium as the hovered pipe (the actual physical circuit the
|
|
33
|
+
* hovered flow could have come from), and recurse from each of those. A
|
|
34
|
+
* visited-edge set (not just visited-node) is the cycle guard — the same
|
|
35
|
+
* discipline as `reachableSet` in traversal.ts, just at edge granularity
|
|
36
|
+
* so a recycle loop closing back on itself still terminates.
|
|
37
|
+
*
|
|
38
|
+
* Splits are handled for free: a sibling branch downstream of a shared
|
|
39
|
+
* split node is never reached because we only ever follow `incoming`
|
|
40
|
+
* edges into nodes already on the path, never look at other outgoing
|
|
41
|
+
* edges — this is what gives Task 5's "hovering one branch highlights
|
|
42
|
+
* only its own upstream path" without a special case.
|
|
43
|
+
*/
|
|
44
|
+
export declare function computeUpstreamHighlight(graph: TopologyGraph, hoveredEdgeId: string): UpstreamHighlight | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* CAP-9: hover is a desktop enhancement — fine pointers (mouse) only.
|
|
47
|
+
* Touch devices are explicitly unaffected, no long-press substitute.
|
|
48
|
+
*/
|
|
49
|
+
export declare function isFinePointerHover(pointerType: string): boolean;
|
|
50
|
+
export interface UpstreamHoverControllerOptions {
|
|
51
|
+
getNodeElement(nodeId: string): Element | undefined;
|
|
52
|
+
getEdgeElement(edgeId: string): Element | undefined;
|
|
53
|
+
/** Defaults to `data-vscada-highlight` — a pre-built, theme-stylable toggle, never a literal color (AD-7). */
|
|
54
|
+
highlightAttr?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface UpstreamHoverController {
|
|
57
|
+
/** Wire this to the pipe/connection element's `pointerenter`. */
|
|
58
|
+
onPointerEnter(edgeId: string, event: {
|
|
59
|
+
pointerType: string;
|
|
60
|
+
}): void;
|
|
61
|
+
/** Wire this to the pipe/connection element's `pointerleave`. */
|
|
62
|
+
onPointerLeave(): void;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Ready-to-wire controller: toggles the SAME pre-built attribute on every
|
|
66
|
+
* node/edge element on the resolved upstream path, through the renderer
|
|
67
|
+
* seam (never touching the DOM directly). The one remaining integration
|
|
68
|
+
* step — attaching `pointerenter`/`pointerleave` listeners to each pipe's
|
|
69
|
+
* rendered element and calling these two methods — lives in
|
|
70
|
+
* `<scada-view>`'s connection-build path, which this story does not touch
|
|
71
|
+
* (concurrent work in progress there); see the story's Dev Agent Record for
|
|
72
|
+
* the exact one-line wiring note.
|
|
73
|
+
*/
|
|
74
|
+
export declare function createUpstreamHoverController(graph: TopologyGraph, renderer: Renderer, options: UpstreamHoverControllerOptions): UpstreamHoverController;
|
|
75
|
+
//# sourceMappingURL=upstream-highlight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upstream-highlight.d.ts","sourceRoot":"","sources":["../../src/topology/upstream-highlight.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,SAAS,CAAC;AAE3D;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC,2FAA2F;IAC3F,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,2FAA2F;IAC3F,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAuBnH;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAE/D;AAID,MAAM,WAAW,8BAA8B;IAC7C,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;IACpD,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;IACpD,8GAA8G;IAC9G,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,uBAAuB;IACtC,iEAAiE;IACjE,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IACrE,iEAAiE;IACjE,cAAc,IAAI,IAAI,CAAC;CACxB;AAED;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,8BAA8B,GACtC,uBAAuB,CA8BzB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface DisplayFormatOptions {
|
|
2
|
+
/** The unit the value is stored/received in (AD-11 — never converted before this point). */
|
|
3
|
+
unit: string;
|
|
4
|
+
/** Optional display-only target unit; defaults to `unit` (no conversion) when absent. */
|
|
5
|
+
displayUnit?: string;
|
|
6
|
+
decimals: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The core display formatter (Story 3.6 Task 1, AD-11) — the ONE place a
|
|
10
|
+
* `unit` -> `displayUnit` conversion happens, at render. Every consumer
|
|
11
|
+
* (readout-panel, gauge-digital, ...) calls this instead of converting on
|
|
12
|
+
* its own; nothing else in the codebase may import `convertUnit` directly
|
|
13
|
+
* (enforced by `formatter.test.ts`'s source-scan regression test) so a
|
|
14
|
+
* value can never be converted twice.
|
|
15
|
+
*
|
|
16
|
+
* Non-numeric values degrade to `String(value)` — no unit suffix, no
|
|
17
|
+
* conversion attempted. An unconvertible pair (unregistered unit, or a
|
|
18
|
+
* mismatched family) degrades to the RAW value labeled with the ORIGINAL
|
|
19
|
+
* `unit` — never a converted-looking number under the wrong label.
|
|
20
|
+
*/
|
|
21
|
+
export declare function formatDisplayValue(value: unknown, options: DisplayFormatOptions): string;
|
|
22
|
+
//# sourceMappingURL=formatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../../src/units/formatter.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,oBAAoB;IACnC,4FAA4F;IAC5F,IAAI,EAAE,MAAM,CAAC;IACb,yFAAyF;IACzF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,oBAAoB,GAAG,MAAM,CAUxF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical unit registry (Story 3.6 Task 1) — AD-11: the store holds
|
|
3
|
+
* values exactly as received per the binding's declared `unit`; the ONLY
|
|
4
|
+
* conversion in the whole system happens in `../units/formatter.ts` at
|
|
5
|
+
* render, and it happens through this module. Six families per Dev Notes:
|
|
6
|
+
* pressure, temperature, flow, level, power, mass. Every registered unit
|
|
7
|
+
* resolves to its family's canonical unit via a `toCanonical`/`fromCanonical`
|
|
8
|
+
* pair; temperature is the one family needing an affine (not linear) map,
|
|
9
|
+
* everything else is a scale factor.
|
|
10
|
+
*/
|
|
11
|
+
export type UnitFamily = 'pressure' | 'temperature' | 'flow' | 'level' | 'power' | 'mass';
|
|
12
|
+
/** The unit's family, or `undefined` for an unregistered unit name (e.g. `%`, or a typo). */
|
|
13
|
+
export declare function unitFamily(unit: string): UnitFamily | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Converts `value` from `fromUnit` to `toUnit`. Returns `undefined` when
|
|
16
|
+
* either unit is unregistered or the two belong to different families —
|
|
17
|
+
* never a silent wrong-physics guess; callers degrade to the
|
|
18
|
+
* un-converted value themselves (see `formatDisplayValue`).
|
|
19
|
+
*/
|
|
20
|
+
export declare function convertUnit(value: number, fromUnit: string, toUnit: string): number | undefined;
|
|
21
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/units/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAyD1F,6FAA6F;AAC7F,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAE/D;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAM/F"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { Scene } from '../scene/scene-schema';
|
|
2
|
+
import type { AnimationRegistry } from '../scheduler/animation-registry';
|
|
3
|
+
/**
|
|
4
|
+
* AD-4's view-state module for scene groups: the collapsed/expanded map.
|
|
5
|
+
* View state (zoom/pan/collapse) is a legal AD-4 state holder ONLY because
|
|
6
|
+
* it is fully reconstructible from scene + interactions — it must NEVER
|
|
7
|
+
* survive a scene reload. This controller enforces that by reading every
|
|
8
|
+
* group's initial collapsed state from the scene's OWN `collapsed`
|
|
9
|
+
* declaration (never from a cache), both at construction and on every
|
|
10
|
+
* `reset()` call.
|
|
11
|
+
*
|
|
12
|
+
* This module deliberately does NOT rebuild DOM structure (AD-2: collapse/
|
|
13
|
+
* expand is a structure-once rebuild, not CSS show/hide) — building the
|
|
14
|
+
* actual subtree remains whatever already builds primitives for every
|
|
15
|
+
* other element type (`<scada-view>`'s structure-build path). What this
|
|
16
|
+
* controller owns fully, and is tested standalone:
|
|
17
|
+
*
|
|
18
|
+
* - the collapsed/expanded map itself (source of truth for "is GROUP-X
|
|
19
|
+
* currently collapsed"), reset to the scene-declared defaults on reload
|
|
20
|
+
* - `toggleGroup(id)` / `setCollapsed(id, value)`, the public API the
|
|
21
|
+
* story calls for
|
|
22
|
+
* - AD-5 registry hygiene on collapse: cleanly deregisters every
|
|
23
|
+
* collapsing group's children via `AnimationRegistry.unregisterElement`
|
|
24
|
+
* so zero orphans remain — proven by the 50-cycle test in
|
|
25
|
+
* `group-view-state.test.ts`
|
|
26
|
+
*
|
|
27
|
+
* FSM states are never cached here — this controller stores exactly one
|
|
28
|
+
* boolean per group id (collapsed/expanded) and nothing else, so there is
|
|
29
|
+
* nothing to go stale; whatever recomputes FSM state from tags keeps doing
|
|
30
|
+
* so on its own schedule, unaffected by toggling.
|
|
31
|
+
*
|
|
32
|
+
* Deferred (same pattern as Story 2.4's hover-wiring gap — NOT built here
|
|
33
|
+
* because it requires touching `scada-view.ts`, off-limits for this story
|
|
34
|
+
* as another developer's concurrent work):
|
|
35
|
+
* - wiring `toggleGroup` to the `element-click` DOM event
|
|
36
|
+
* (`elementType: 'group'`) fired when a collapsed summary block is
|
|
37
|
+
* clicked
|
|
38
|
+
* - the actual structure REBUILD + fresh re-registration of children's
|
|
39
|
+
* animation handles on EXPAND (AD-2) — this controller guarantees only
|
|
40
|
+
* the collapse-side deregistration is clean; expand-time rebuild is
|
|
41
|
+
* whatever constructs real primitives for newly-visible children,
|
|
42
|
+
* exactly like the initial scene build already does for every element.
|
|
43
|
+
*/
|
|
44
|
+
export declare class GroupViewStateController {
|
|
45
|
+
private readonly animationRegistry?;
|
|
46
|
+
private collapsed;
|
|
47
|
+
private scene;
|
|
48
|
+
constructor(scene: Scene, animationRegistry?: AnimationRegistry | undefined);
|
|
49
|
+
private seedFromScene;
|
|
50
|
+
/** AD-4 — reset to the NEW scene's own declared defaults; the prior scene's toggles never carry over. */
|
|
51
|
+
reset(scene: Scene): void;
|
|
52
|
+
isCollapsed(groupId: string): boolean;
|
|
53
|
+
/** Every group id currently presenting as collapsed — the input `buildPresentationScene`/`buildCollapsedGraphView` (Task 2) expect. */
|
|
54
|
+
collapsedGroupIds(): ReadonlySet<string>;
|
|
55
|
+
/** Public toggle API (Task 3). Returns the group's new collapsed state. */
|
|
56
|
+
toggleGroup(groupId: string): boolean;
|
|
57
|
+
/** Sets a group's collapsed state directly. Unknown group ids are a no-op (returns the unchanged current state). */
|
|
58
|
+
setCollapsed(groupId: string, collapsed: boolean): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* AD-5: clean, complete deregistration on collapse — zero orphans left
|
|
61
|
+
* behind.
|
|
62
|
+
*
|
|
63
|
+
* Fix 7 (adversarial review): DOM removal isn't guaranteed atomic with
|
|
64
|
+
* this deregistration call (explicitly deferred — see the class doc), so
|
|
65
|
+
* a WAAPI animation could otherwise keep running invisibly, no longer
|
|
66
|
+
* trackable through the registry once its entry is gone. `pauseAll` is
|
|
67
|
+
* called first for exactly this reason — it is `AnimationRegistry`'s own
|
|
68
|
+
* public, already-existing pause path (used elsewhere for the freeze
|
|
69
|
+
* rule), so nothing here reaches into or changes `unregisterElement`
|
|
70
|
+
* itself, which is off-limits (owned by another developer's concurrent
|
|
71
|
+
* work). Pausing first means the animation is stopped even in the window
|
|
72
|
+
* where the element is deregistered but not yet DOM-removed.
|
|
73
|
+
*/
|
|
74
|
+
private deregisterChildren;
|
|
75
|
+
}
|
|
76
|
+
export declare function createGroupViewState(scene: Scene, animationRegistry?: AnimationRegistry): GroupViewStateController;
|
|
77
|
+
//# sourceMappingURL=group-view-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-view-state.d.ts","sourceRoot":"","sources":["../../src/view/group-view-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAS,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,qBAAa,wBAAwB;IAMjC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IALrC,OAAO,CAAC,SAAS,CAA8B;IAC/C,OAAO,CAAC,KAAK,CAAQ;gBAGnB,KAAK,EAAE,KAAK,EACK,iBAAiB,CAAC,EAAE,iBAAiB,YAAA;IAMxD,OAAO,CAAC,aAAa;IAIrB,yGAAyG;IACzG,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAKzB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAIrC,uIAAuI;IACvI,iBAAiB,IAAI,WAAW,CAAC,MAAM,CAAC;IAQxC,2EAA2E;IAC3E,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAIrC,oHAAoH;IACpH,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO;IAiB1D;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,kBAAkB;CAO3B;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,KAAK,EAAE,iBAAiB,CAAC,EAAE,iBAAiB,GAAG,wBAAwB,CAElH"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { TimeSource } from '../contracts/time-source';
|
|
2
|
+
/** Zoom clamps (Story 4.3 Task 1 — "zoom clamps ... as tokens"). */
|
|
3
|
+
export declare const DEFAULT_MIN_ZOOM = 0.25;
|
|
4
|
+
export declare const DEFAULT_MAX_ZOOM = 4;
|
|
5
|
+
/** Duration for a PROGRAMMATIC (`ScadaView.zoom = x`) zoom change — a live gesture never goes through this, it writes the target immediately (see `setZoomImmediate`). */
|
|
6
|
+
export declare const DEFAULT_ZOOM_TWEEN_DURATION_MS = 300;
|
|
7
|
+
/** Pan bound margin, scene/viewBox px beyond the canvas edge the view may still be dragged (Task 1 — "pan bounds (scene canvas ± margin)"). */
|
|
8
|
+
export declare const DEFAULT_PAN_MARGIN_PX = 100;
|
|
9
|
+
export interface ViewportTransform {
|
|
10
|
+
zoom: number;
|
|
11
|
+
panX: number;
|
|
12
|
+
panY: number;
|
|
13
|
+
}
|
|
14
|
+
export interface ViewportStateOptions {
|
|
15
|
+
minZoom?: number;
|
|
16
|
+
maxZoom?: number;
|
|
17
|
+
panMarginPx?: number;
|
|
18
|
+
zoomTweenDurationMs?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Clamps a single pan axis so the scene canvas can never be dragged more
|
|
22
|
+
* than `margin` px past the viewBox edge on that axis. The transform is
|
|
23
|
+
* `translate(panX, panY) scale(zoom)`, so `pan` is already in the SAME
|
|
24
|
+
* viewBox px space as `canvasSize` — no unit conversion needed. Derived
|
|
25
|
+
* from requiring the canvas rectangle `[pan, pan + canvasSize*zoom]` to
|
|
26
|
+
* overlap `[0, canvasSize]` within `margin`:
|
|
27
|
+
* pan <= margin (left edge can't run away right)
|
|
28
|
+
* pan >= (canvasSize - margin) - canvasSize*zoom (right edge can't run away left)
|
|
29
|
+
* When zoomed out far enough that those two bounds cross (a canvas much
|
|
30
|
+
* smaller than the viewport), split the difference rather than produce an
|
|
31
|
+
* inverted (min > max) clamp.
|
|
32
|
+
*/
|
|
33
|
+
export declare function clampPanAxis(pan: number, canvasSize: number, zoom: number, marginPx: number): number;
|
|
34
|
+
/**
|
|
35
|
+
* AD-4's view-state module for pan/zoom (Story 4.3 Task 1) — same
|
|
36
|
+
* "reconstructible from scene + interactions, never survives scene
|
|
37
|
+
* reload" contract `GroupViewStateController` already establishes for
|
|
38
|
+
* collapse/expand. Zoom is TWO-WAY (§3.2): a gesture writes it immediately
|
|
39
|
+
* (`setZoomImmediate`, already-continuous user input needs no smoothing);
|
|
40
|
+
* an external `ScadaView.zoom = x` assignment animates via the SAME
|
|
41
|
+
* `Tween` class every other state-transition ramp in this codebase uses
|
|
42
|
+
* (`setZoomAnimated`). Pan is intentionally NOT a public property (Dev
|
|
43
|
+
* Notes scope boundary — "expose pan center as a property only if
|
|
44
|
+
* trivially cheap; else defer"): purely internal, gesture-driven, clamped.
|
|
45
|
+
*
|
|
46
|
+
* Owns its own tiny `TimeSource.onTick` subscription, independent of
|
|
47
|
+
* `Scheduler`'s start/stop lifecycle (which only begins once `setValues()`
|
|
48
|
+
* has been called at least once) — a scene loaded with no data yet must
|
|
49
|
+
* still support pinch/pan/wheel-zoom. The subscription only runs while a
|
|
50
|
+
* programmatic zoom tween is actually in flight; it stops itself once
|
|
51
|
+
* settled.
|
|
52
|
+
*
|
|
53
|
+
* AD-4 note (architecture-code-audit-2026-08-27): flagged and reviewed as
|
|
54
|
+
* a second tick loop alongside `Scheduler`'s own — confirmed genuinely
|
|
55
|
+
* necessary (not an oversight) for exactly the "no data yet" reason above,
|
|
56
|
+
* and NOT merged into `Scheduler`. It still reads time only through the
|
|
57
|
+
* injected `TimeSource`, never a raw wall-clock read, so "one clock"
|
|
58
|
+
* holds; this is "one tick loop" bent, deliberately, with a concrete
|
|
59
|
+
* reason a merge can't reproduce without breaking pan/zoom on an empty
|
|
60
|
+
* scene.
|
|
61
|
+
*/
|
|
62
|
+
export declare class ViewportStateController {
|
|
63
|
+
private readonly timeSource;
|
|
64
|
+
private readonly onFrame;
|
|
65
|
+
private readonly minZoom;
|
|
66
|
+
private readonly maxZoom;
|
|
67
|
+
private readonly panMarginPx;
|
|
68
|
+
private readonly zoomTweenDurationMs;
|
|
69
|
+
private canvasWidth;
|
|
70
|
+
private canvasHeight;
|
|
71
|
+
private zoomValue;
|
|
72
|
+
private panXValue;
|
|
73
|
+
private panYValue;
|
|
74
|
+
private tween;
|
|
75
|
+
private stopTick;
|
|
76
|
+
constructor(timeSource: TimeSource, onFrame: (transform: ViewportTransform) => void, options?: ViewportStateOptions);
|
|
77
|
+
get zoom(): number;
|
|
78
|
+
get pan(): {
|
|
79
|
+
x: number;
|
|
80
|
+
y: number;
|
|
81
|
+
};
|
|
82
|
+
/** AD-4 — a genuinely new scene resets view state to identity; never carries a prior scene's zoom/pan across. */
|
|
83
|
+
reset(canvasWidth: number, canvasHeight: number): void;
|
|
84
|
+
private currentTransform;
|
|
85
|
+
private clampZoom;
|
|
86
|
+
private applyPanClamp;
|
|
87
|
+
/** Gesture path (pinch/wheel) — already-continuous user input, applied immediately with no smoothing. Cancels any in-flight programmatic tween: a live gesture always wins over a pending `.zoom = x` animation. */
|
|
88
|
+
setZoomImmediate(target: number): void;
|
|
89
|
+
/** External `ScadaView.zoom = x` path (§3.2, two-way) — animates via the tween layer rather than jumping. */
|
|
90
|
+
setZoomAnimated(target: number, durationMs?: number): void;
|
|
91
|
+
/** Gesture path (drag-pan / pinch-pan) — immediate, clamped to the scene canvas ± margin. */
|
|
92
|
+
panBy(dx: number, dy: number): void;
|
|
93
|
+
/**
|
|
94
|
+
* Gesture path for pinch and wheel-zoom (AC1) — zooms while keeping
|
|
95
|
+
* `(centerX, centerY)` (the pinch centroid / cursor position, in the
|
|
96
|
+
* SAME viewBox px space as `pan`) visually stationary, the standard
|
|
97
|
+
* "zoom about a point" feel. Derived from the transform
|
|
98
|
+
* `translate(panX,panY) scale(zoom)`: a screen point stays fixed under
|
|
99
|
+
* the gesture iff `pan' = center - (center - pan) * (newZoom/oldZoom)`.
|
|
100
|
+
* Cancels any in-flight programmatic tween exactly like
|
|
101
|
+
* `setZoomImmediate` (a live gesture always wins).
|
|
102
|
+
*/
|
|
103
|
+
zoomAboutPoint(target: number, centerX: number, centerY: number): void;
|
|
104
|
+
private ensureAnimating;
|
|
105
|
+
private tickTween;
|
|
106
|
+
/** AC4 (`ScadaView.snapToTargets()`) — completes an in-flight PROGRAMMATIC zoom tween immediately; a no-op if none is in flight (gesture-driven zoom is never mid-flight — it already writes immediately). */
|
|
107
|
+
snap(): void;
|
|
108
|
+
/** Releases the tween-drive subscription — called from `disconnectedCallback` so a detached instance never keeps ticking. */
|
|
109
|
+
destroy(): void;
|
|
110
|
+
}
|
|
111
|
+
export declare function createViewportState(timeSource: TimeSource, onFrame: (transform: ViewportTransform) => void, options?: ViewportStateOptions): ViewportStateController;
|
|
112
|
+
//# sourceMappingURL=viewport-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewport-state.d.ts","sourceRoot":"","sources":["../../src/view/viewport-state.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,oEAAoE;AACpE,eAAO,MAAM,gBAAgB,OAAO,CAAC;AACrC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,0KAA0K;AAC1K,eAAO,MAAM,8BAA8B,MAAM,CAAC;AAClD,+IAA+I;AAC/I,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAMD;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKpG;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,uBAAu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