@unpunnyfuns/conduit 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/LICENSE +25 -0
- package/README.md +202 -0
- package/dist/assert.d.ts +6 -0
- package/dist/assert.d.ts.map +1 -0
- package/dist/assert.js +8 -0
- package/dist/assert.js.map +1 -0
- package/dist/cn.d.ts +3 -0
- package/dist/cn.d.ts.map +1 -0
- package/dist/cn.js +3 -0
- package/dist/cn.js.map +1 -0
- package/dist/components/Badge.d.ts +6 -0
- package/dist/components/Badge.d.ts.map +1 -0
- package/dist/components/Badge.js +11 -0
- package/dist/components/Badge.js.map +1 -0
- package/dist/components/Card.d.ts +20 -0
- package/dist/components/Card.d.ts.map +1 -0
- package/dist/components/Card.js +24 -0
- package/dist/components/Card.js.map +1 -0
- package/dist/components/Diagram.d.ts +37 -0
- package/dist/components/Diagram.d.ts.map +1 -0
- package/dist/components/Diagram.js +92 -0
- package/dist/components/Diagram.js.map +1 -0
- package/dist/components/EdgeLayer.d.ts +23 -0
- package/dist/components/EdgeLayer.d.ts.map +1 -0
- package/dist/components/EdgeLayer.js +85 -0
- package/dist/components/EdgeLayer.js.map +1 -0
- package/dist/components/Lane.d.ts +11 -0
- package/dist/components/Lane.d.ts.map +1 -0
- package/dist/components/Lane.js +6 -0
- package/dist/components/Lane.js.map +1 -0
- package/dist/components/icons.d.ts +7 -0
- package/dist/components/icons.d.ts.map +1 -0
- package/dist/components/icons.js +47 -0
- package/dist/components/icons.js.map +1 -0
- package/dist/components/pulse.d.ts +15 -0
- package/dist/components/pulse.d.ts.map +1 -0
- package/dist/components/pulse.js +10 -0
- package/dist/components/pulse.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/layout/architecture.d.ts +60 -0
- package/dist/layout/architecture.d.ts.map +1 -0
- package/dist/layout/architecture.js +88 -0
- package/dist/layout/architecture.js.map +1 -0
- package/dist/layout/bounds.d.ts +25 -0
- package/dist/layout/bounds.d.ts.map +1 -0
- package/dist/layout/bounds.js +32 -0
- package/dist/layout/bounds.js.map +1 -0
- package/dist/layout/congestion.d.ts +18 -0
- package/dist/layout/congestion.d.ts.map +1 -0
- package/dist/layout/congestion.js +49 -0
- package/dist/layout/congestion.js.map +1 -0
- package/dist/layout/design.d.ts +98 -0
- package/dist/layout/design.d.ts.map +1 -0
- package/dist/layout/design.js +92 -0
- package/dist/layout/design.js.map +1 -0
- package/dist/layout/edges.d.ts +53 -0
- package/dist/layout/edges.d.ts.map +1 -0
- package/dist/layout/edges.js +848 -0
- package/dist/layout/edges.js.map +1 -0
- package/dist/layout/errors.d.ts +6 -0
- package/dist/layout/errors.d.ts.map +1 -0
- package/dist/layout/errors.js +9 -0
- package/dist/layout/errors.js.map +1 -0
- package/dist/layout/frame.d.ts +35 -0
- package/dist/layout/frame.d.ts.map +1 -0
- package/dist/layout/frame.js +63 -0
- package/dist/layout/frame.js.map +1 -0
- package/dist/layout/geometry.d.ts +23 -0
- package/dist/layout/geometry.d.ts.map +1 -0
- package/dist/layout/geometry.js +22 -0
- package/dist/layout/geometry.js.map +1 -0
- package/dist/layout/labels.d.ts +12 -0
- package/dist/layout/labels.d.ts.map +1 -0
- package/dist/layout/labels.js +153 -0
- package/dist/layout/labels.js.map +1 -0
- package/dist/layout/lanes.d.ts +5 -0
- package/dist/layout/lanes.d.ts.map +1 -0
- package/dist/layout/lanes.js +13 -0
- package/dist/layout/lanes.js.map +1 -0
- package/dist/layout/layout.d.ts +42 -0
- package/dist/layout/layout.d.ts.map +1 -0
- package/dist/layout/layout.js +94 -0
- package/dist/layout/layout.js.map +1 -0
- package/dist/layout/rank.d.ts +14 -0
- package/dist/layout/rank.d.ts.map +1 -0
- package/dist/layout/rank.js +78 -0
- package/dist/layout/rank.js.map +1 -0
- package/dist/layout/scope.d.ts +20 -0
- package/dist/layout/scope.d.ts.map +1 -0
- package/dist/layout/scope.js +52 -0
- package/dist/layout/scope.js.map +1 -0
- package/dist/layout/seating.d.ts +27 -0
- package/dist/layout/seating.d.ts.map +1 -0
- package/dist/layout/seating.js +135 -0
- package/dist/layout/seating.js.map +1 -0
- package/dist/layout/text.d.ts +12 -0
- package/dist/layout/text.d.ts.map +1 -0
- package/dist/layout/text.js +148 -0
- package/dist/layout/text.js.map +1 -0
- package/dist/layout/trace.d.ts +8 -0
- package/dist/layout/trace.d.ts.map +1 -0
- package/dist/layout/trace.js +51 -0
- package/dist/layout/trace.js.map +1 -0
- package/dist/layout.d.ts +9 -0
- package/dist/layout.d.ts.map +1 -0
- package/dist/layout.js +6 -0
- package/dist/layout.js.map +1 -0
- package/dist/schema/document.d.ts +239 -0
- package/dist/schema/document.d.ts.map +1 -0
- package/dist/schema/document.js +83 -0
- package/dist/schema/document.js.map +1 -0
- package/dist/schema/errors.d.ts +20 -0
- package/dist/schema/errors.d.ts.map +1 -0
- package/dist/schema/errors.js +12 -0
- package/dist/schema/errors.js.map +1 -0
- package/dist/schema/integrity.d.ts +8 -0
- package/dist/schema/integrity.d.ts.map +1 -0
- package/dist/schema/integrity.js +63 -0
- package/dist/schema/integrity.js.map +1 -0
- package/dist/schema/parse.d.ts +6 -0
- package/dist/schema/parse.d.ts.map +1 -0
- package/dist/schema/parse.js +53 -0
- package/dist/schema/parse.js.map +1 -0
- package/dist/schema/primitives.d.ts +58 -0
- package/dist/schema/primitives.d.ts.map +1 -0
- package/dist/schema/primitives.js +44 -0
- package/dist/schema/primitives.js.map +1 -0
- package/dist/theme.css +63 -0
- package/package.json +83 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The measurements of the validated prototype, in one place. These are the
|
|
3
|
+
* design system: change a number here and every diagram moves with it.
|
|
4
|
+
*/
|
|
5
|
+
export const DIAGRAM_MARGIN = 16;
|
|
6
|
+
export const LANE_TOP = 44;
|
|
7
|
+
export const LANE_HEADER_BASELINE = 68;
|
|
8
|
+
export const LANE_PADDING_X = 16;
|
|
9
|
+
export const LANE_GAP = 20;
|
|
10
|
+
export const LANE_BOTTOM_PADDING = 20;
|
|
11
|
+
/**
|
|
12
|
+
* Every lane is the same width, and that width is a constant rather than
|
|
13
|
+
* anything derived from what the lanes hold.
|
|
14
|
+
*
|
|
15
|
+
* A lane's width decides where the lane after it starts, so a width drawn
|
|
16
|
+
* from content couples every column to the contents of the ones before it:
|
|
17
|
+
* adding one node with a long name to the first lane would slide every card
|
|
18
|
+
* in every later lane sideways, which is exactly the teleport a reviewer
|
|
19
|
+
* comparing two pushes must never be shown. The cost is that a lane holding
|
|
20
|
+
* something narrow is wider than it needs to be. Stability is worth more.
|
|
21
|
+
*
|
|
22
|
+
* Sized so that two cards sharing a row still each get a readable width.
|
|
23
|
+
*/
|
|
24
|
+
export const LANE_CONTENT_WIDTH = 372;
|
|
25
|
+
export const LANE_RADIUS = 12;
|
|
26
|
+
export const LANE_LABEL_SIZE = 10;
|
|
27
|
+
export const LANE_LABEL_TRACKING = 0.12;
|
|
28
|
+
/** Room at the top of a lane for its header, before the first row. */
|
|
29
|
+
export const LANE_HEADER_STRIP = 48;
|
|
30
|
+
export const ROW_GAP = 52;
|
|
31
|
+
export const CARD_RADIUS = 10;
|
|
32
|
+
export const CARD_GAP_X = 12;
|
|
33
|
+
export const CARD_PADDING_X = 14;
|
|
34
|
+
export const ICON_CHIP_SIZE = 26;
|
|
35
|
+
export const ICON_CHIP_GAP = 10;
|
|
36
|
+
export const ICON_CHIP_RADIUS = 7;
|
|
37
|
+
export const SUBTITLE_SIZE = 9.5;
|
|
38
|
+
export const BADGE_HEIGHT = 16;
|
|
39
|
+
export const BADGE_PADDING_X = 9;
|
|
40
|
+
export const BADGE_TEXT_SIZE = 8.5;
|
|
41
|
+
export const BADGE_TRACKING = 0.06;
|
|
42
|
+
export const BADGE_GAP = 6;
|
|
43
|
+
export const BADGE_RADIUS = 8;
|
|
44
|
+
/** How far the badge row rides above the top edge of the card it labels. */
|
|
45
|
+
export const BADGE_RISE = 8;
|
|
46
|
+
export const PILL_HEIGHT = 15;
|
|
47
|
+
export const PILL_PADDING_X = 8;
|
|
48
|
+
export const PILL_TEXT_SIZE = 9.5;
|
|
49
|
+
/** Two label pills never sit closer than this, in either direction. */
|
|
50
|
+
export const PILL_CLEARANCE = 2;
|
|
51
|
+
/**
|
|
52
|
+
* Routes travel in the gaps of the grid: vertical corridors beside lanes and
|
|
53
|
+
* horizontal bands between rows. Both gaps are physically 52px across — lane
|
|
54
|
+
* padding + lane gap + lane padding one way, ROW_GAP the other — and a track
|
|
55
|
+
* keeps this clearance from the cards on either side, leaving 40px of room.
|
|
56
|
+
*/
|
|
57
|
+
export const TRACK_CLEARANCE = 6;
|
|
58
|
+
/**
|
|
59
|
+
* Neighbouring tracks in one gap sit this far apart at most; when a gap
|
|
60
|
+
* carries more traffic than the room allows, the pitch shrinks to fit. An
|
|
61
|
+
* added route therefore nudges its gap-mates proportionately — an accepted
|
|
62
|
+
* trade, and one that never moves a card.
|
|
63
|
+
*/
|
|
64
|
+
export const TRACK_PITCH_MAX = 16;
|
|
65
|
+
/**
|
|
66
|
+
* And never closer than this: below it, parallel runs stop reading as
|
|
67
|
+
* separate lines. A gap asked to carry more traffic than the floor allows
|
|
68
|
+
* does not compress further — it widens instead, corridors pushing the lanes
|
|
69
|
+
* beside them apart and row gaps pushing the rows, in proportion to the
|
|
70
|
+
* traffic and to nothing else.
|
|
71
|
+
*/
|
|
72
|
+
export const TRACK_PITCH_MIN = 10;
|
|
73
|
+
/** Step between neighbouring arrow ports along one card face. */
|
|
74
|
+
export const PORT_PITCH = 16;
|
|
75
|
+
/** Ports keep clear of the card's rounded corners. */
|
|
76
|
+
export const PORT_INSET = 14;
|
|
77
|
+
/**
|
|
78
|
+
* A turn's bend radius comes from the shorter of its two legs, capped here.
|
|
79
|
+
* Deriving it from the longer leg balloons a route with one short leg and one
|
|
80
|
+
* long one — the shape every corridor run has — clear out of its corridor.
|
|
81
|
+
*/
|
|
82
|
+
export const BEND_RADIUS_MAX = 34;
|
|
83
|
+
/** One turn of the travelling pulse, and of the staggered train. */
|
|
84
|
+
export const PULSE_DURATION = 1.6;
|
|
85
|
+
export const HERO_PULSE_DURATION = 2.1;
|
|
86
|
+
export const HERO_PULSE_COUNT = 3;
|
|
87
|
+
/** Live edges: seconds per pulse ≈ PULSE_RATE_SCALE / rate, clamped so 10/s and 10k/s both read as traffic. */
|
|
88
|
+
export const PULSE_RATE_SCALE = 160;
|
|
89
|
+
export const PULSE_DURATION_MIN = 0.6;
|
|
90
|
+
export const PULSE_DURATION_MAX = 3;
|
|
91
|
+
export const DEFAULT_CARD_HEIGHTS = { compact: 52, withSubtitle: 62, chart: 140 };
|
|
92
|
+
//# sourceMappingURL=design.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"design.js","sourceRoot":"","sources":["../../src/layout/design.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC;AAEjC,MAAM,CAAC,MAAM,QAAQ,GAAG,EAAE,CAAC;AAC3B,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AACvC,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC;AACjC,MAAM,CAAC,MAAM,QAAQ,GAAG,EAAE,CAAC;AAC3B,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAEtC;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AACtC,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,CAAC;AAC9B,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAC;AAClC,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAExC,sEAAsE;AACtE,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AACpC,MAAM,CAAC,MAAM,OAAO,GAAG,EAAE,CAAC;AAE1B,MA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GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAC;AAElC,oEAAoE;AACpE,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC;AAClC,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AACvC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAElC,+GAA+G;AAC/G,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AACpC,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AACtC,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAIpC,MAAM,CAAC,MAAM,oBAAoB,GAAgB,EAAE,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { Edge } from "../schema/document.js";
|
|
2
|
+
import { type Box, type Point } from "./geometry.js";
|
|
3
|
+
import type { ArchitectureLayout } from "./architecture.js";
|
|
4
|
+
/**
|
|
5
|
+
* A route, kept as its own segments rather than as a path string, because the
|
|
6
|
+
* label pill has to be placed on a point of it after the fact.
|
|
7
|
+
*/
|
|
8
|
+
type Segment = {
|
|
9
|
+
kind: "line";
|
|
10
|
+
to: Point;
|
|
11
|
+
} | {
|
|
12
|
+
kind: "cubic";
|
|
13
|
+
first: Point;
|
|
14
|
+
second: Point;
|
|
15
|
+
to: Point;
|
|
16
|
+
};
|
|
17
|
+
export type Curve = {
|
|
18
|
+
from: Point;
|
|
19
|
+
segments: Segment[];
|
|
20
|
+
};
|
|
21
|
+
export type RoutedEdge = {
|
|
22
|
+
edge: Edge;
|
|
23
|
+
path: string;
|
|
24
|
+
curve: Curve;
|
|
25
|
+
/** Centre of the longest straight run — where this edge's label pill sits. */
|
|
26
|
+
labelAnchor: Point | undefined;
|
|
27
|
+
};
|
|
28
|
+
export declare const pathOf: (curve: Curve) => string;
|
|
29
|
+
/** The same curve moved by a fixed offset — how the canvas shift reaches a route. */
|
|
30
|
+
export declare const shiftCurve: (curve: Curve, dx: number, dy: number) => Curve;
|
|
31
|
+
/** The same curve with x and y swapped on every point. */
|
|
32
|
+
export declare const transposeCurve: (curve: Curve) => Curve;
|
|
33
|
+
/**
|
|
34
|
+
* A box the route cannot leave. A cubic stays inside the hull of its own
|
|
35
|
+
* control points, so taking every point of every segment is a bound rather
|
|
36
|
+
* than an estimate — which is what the canvas needs, since a route that ran
|
|
37
|
+
* off the edge would simply be clipped.
|
|
38
|
+
*/
|
|
39
|
+
export declare const curveBounds: (curve: Curve) => Box;
|
|
40
|
+
export declare const routeEdges: (edges: readonly Edge[], layout: ArchitectureLayout) => RoutedEdge[];
|
|
41
|
+
export type ChannelTraffic = {
|
|
42
|
+
corridors: ReadonlyMap<number, number>;
|
|
43
|
+
bands: ReadonlyMap<number, number>;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* How many runs each gap of this layout would carry, counted from the same
|
|
47
|
+
* routing that would be drawn — braid guard included. This is what decides
|
|
48
|
+
* whether a gap is wide enough for its traffic before anything is drawn
|
|
49
|
+
* into it.
|
|
50
|
+
*/
|
|
51
|
+
export declare const channelTraffic: (edges: readonly Edge[], layout: ArchitectureLayout) => ChannelTraffic;
|
|
52
|
+
export {};
|
|
53
|
+
//# sourceMappingURL=edges.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edges.d.ts","sourceRoot":"","sources":["../../src/layout/edges.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AASlD,OAAO,EAAoB,KAAK,GAAG,EAAE,KAAK,KAAK,EAAa,MAAM,eAAe,CAAC;AAClF,OAAO,KAAK,EAAE,kBAAkB,EAAsC,MAAM,mBAAmB,CAAC;AAEhG;;;GAGG;AACH,KAAK,OAAO,GACR;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,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