@multiplatform.one/node-graph 7.46.0 → 7.47.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/cjs/diagnostics/LiveGraphDiagnostics.cjs +2 -1
- package/dist/cjs/diagnostics/LiveGraphDiagnostics.native.js +2 -1
- package/dist/cjs/diagnostics/LiveGraphDiagnostics.native.js.map +1 -1
- package/dist/cjs/edges/edgeStyle.native.js.map +1 -1
- package/dist/cjs/theme/faces.cjs +1 -1
- package/dist/cjs/theme/faces.native.js +1 -1
- package/dist/cjs/theme/faces.native.js.map +1 -1
- package/dist/cjs/theme/graphVars.cjs +2 -8
- package/dist/cjs/theme/graphVars.native.js +3 -9
- package/dist/cjs/theme/graphVars.native.js.map +1 -1
- package/dist/esm/diagnostics/LiveGraphDiagnostics.mjs +2 -1
- package/dist/esm/diagnostics/LiveGraphDiagnostics.mjs.map +1 -1
- package/dist/esm/diagnostics/LiveGraphDiagnostics.native.js +2 -1
- package/dist/esm/diagnostics/LiveGraphDiagnostics.native.js.map +1 -1
- package/dist/esm/edges/edgeStyle.mjs.map +1 -1
- package/dist/esm/edges/edgeStyle.native.js.map +1 -1
- package/dist/esm/theme/faces.mjs +1 -1
- package/dist/esm/theme/faces.mjs.map +1 -1
- package/dist/esm/theme/faces.native.js +1 -1
- package/dist/esm/theme/faces.native.js.map +1 -1
- package/dist/esm/theme/graphVars.mjs +3 -8
- package/dist/esm/theme/graphVars.mjs.map +1 -1
- package/dist/esm/theme/graphVars.native.js +4 -9
- package/dist/esm/theme/graphVars.native.js.map +1 -1
- package/dist/jsx/diagnostics/LiveGraphDiagnostics.mjs +2 -1
- package/dist/jsx/diagnostics/LiveGraphDiagnostics.mjs.map +1 -1
- package/dist/jsx/diagnostics/LiveGraphDiagnostics.native.js +2 -1
- package/dist/jsx/diagnostics/LiveGraphDiagnostics.native.js.map +1 -1
- package/dist/jsx/edges/edgeStyle.mjs.map +1 -1
- package/dist/jsx/edges/edgeStyle.native.js.map +1 -1
- package/dist/jsx/theme/faces.mjs +1 -1
- package/dist/jsx/theme/faces.mjs.map +1 -1
- package/dist/jsx/theme/faces.native.js +1 -1
- package/dist/jsx/theme/graphVars.mjs +3 -8
- package/dist/jsx/theme/graphVars.mjs.map +1 -1
- package/dist/jsx/theme/graphVars.native.js +3 -9
- package/dist/jsx/theme/graphVars.native.js.map +1 -1
- package/package.json +7 -7
- package/src/bench/Perf200.stories.tsx +10 -9
- package/src/diagnostics/GraphDiagnostics.stories.tsx +2 -1
- package/src/diagnostics/LiveGraphDiagnostics.native.tsx +4 -3
- package/src/diagnostics/LiveGraphDiagnostics.tsx +2 -1
- package/src/edges/Edges.stories.tsx +2 -1
- package/src/edges/edgeStyle.ts +3 -2
- package/src/interaction/Lasso.stories.tsx +8 -7
- package/src/interaction/Snapping.stories.tsx +2 -1
- package/src/layout/AutoLayout.stories.tsx +8 -7
- package/src/nodes/GraphNode.stories.tsx +14 -13
- package/src/nodes/GraphPort.stories.tsx +2 -1
- package/src/nodes/Overview.stories.tsx +2 -1
- package/src/react-flow/NodeGraphWeb.stories.tsx +2 -1
- package/src/theme/faces.ts +1 -1
- package/src/theme/graphVars.spec.ts +6 -3
- package/src/theme/graphVars.ts +3 -30
- package/types/diagnostics/LiveGraphDiagnostics.d.ts.map +1 -1
- package/types/diagnostics/LiveGraphDiagnostics.native.d.ts.map +1 -1
- package/types/edges/edgeStyle.d.ts +3 -2
- package/types/edges/edgeStyle.d.ts.map +1 -1
- package/types/theme/graphVars.d.ts +0 -23
- package/types/theme/graphVars.d.ts.map +1 -1
package/src/edges/edgeStyle.ts
CHANGED
|
@@ -37,8 +37,9 @@ export const edgeAppearances: Readonly<Record<BuiltinEdgeKind, EdgeAppearance>>
|
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* §11: an edge is a stroke, not a border, and a 0-width edge erases the graph's
|
|
40
|
-
* primary information. The theme's own
|
|
41
|
-
* (`
|
|
40
|
+
* primary information. The theme's own border widths are 0 / hairline / 1 / 2
|
|
41
|
+
* (`resolveKnobs.ts` `borderWidthMap`, LC-148), so this is a remap keyed by the
|
|
42
|
+
* resolved stop (`knobProps.borderWidthStop`), and
|
|
42
43
|
* deliberately not a floor to `hairlineWidth` — that token is dividers-only by
|
|
43
44
|
* its own header, and a stroke that stays legible while the canvas zooms out is
|
|
44
45
|
* not a divider.
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
import { Preset } from "@multiplatform.one/theme";
|
|
45
45
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
46
46
|
import { useCallback, useState } from "react";
|
|
47
|
-
import { SizableText, XStack, YStack } from "tamagui";
|
|
47
|
+
import { SizableText as TamaguiSizableText, XStack, YStack } from "tamagui";
|
|
48
48
|
import type { GraphEventWire } from "../dom/wire";
|
|
49
49
|
import type { NodeId } from "../model/index";
|
|
50
50
|
import { GraphToolbar } from "../native/GraphToolbar";
|
|
@@ -54,6 +54,7 @@ import { demoGraphSchema } from "../react-flow/demoNodeBody";
|
|
|
54
54
|
import { demoDocumentLarge } from "../react-flow/fixtures";
|
|
55
55
|
import { Background, Controls } from "../react-flow/xy";
|
|
56
56
|
import type { GraphInteractionMode } from "./useLassoSelect";
|
|
57
|
+
import { SizableText } from "@multiplatform.one/components";
|
|
57
58
|
|
|
58
59
|
const schema = demoGraphSchema();
|
|
59
60
|
|
|
@@ -106,11 +107,11 @@ function ToolbarModeStory() {
|
|
|
106
107
|
>
|
|
107
108
|
<XStack alignItems="center" gap="$3" flexWrap="wrap">
|
|
108
109
|
<GraphToolbar mode={mode} onModeChange={setMode} />
|
|
109
|
-
<
|
|
110
|
+
<TamaguiSizableText fontFamily="$mono" size="$2">
|
|
110
111
|
{`mode: ${mode} · panOnDrag: ${String(mode !== "select")} · selected: ${
|
|
111
112
|
selected.length ? selected.join(", ") : "none"
|
|
112
113
|
}`}
|
|
113
|
-
</
|
|
114
|
+
</TamaguiSizableText>
|
|
114
115
|
</XStack>
|
|
115
116
|
<YStack flex={1} minHeight={0}>
|
|
116
117
|
<NodeGraph
|
|
@@ -174,13 +175,13 @@ function LongPressStory() {
|
|
|
174
175
|
>
|
|
175
176
|
<XStack alignItems="center" gap="$3" flexWrap="wrap">
|
|
176
177
|
<GraphToolbar mode={mode} onModeChange={setMode} />
|
|
177
|
-
<
|
|
178
|
+
<TamaguiSizableText fontFamily="$mono" size="$2">
|
|
178
179
|
{`armed: ${String(armed)} · arms: ${arms} · cancels: ${cancels} · haptics: ${haptics}`}
|
|
179
|
-
</
|
|
180
|
+
</TamaguiSizableText>
|
|
180
181
|
</XStack>
|
|
181
|
-
<
|
|
182
|
+
<TamaguiSizableText fontFamily="$mono" size="$2" opacity={0.75}>
|
|
182
183
|
{`selected: ${selected.length ? selected.join(", ") : "none"}`}
|
|
183
|
-
</
|
|
184
|
+
</TamaguiSizableText>
|
|
184
185
|
<SizableText size="$2" opacity={0.7}>
|
|
185
186
|
{hasDomRealm
|
|
186
187
|
? "Hold for 350 ms without moving more than 10 px, then drag. The interceptor takes the move stream away from d3-zoom inside the canvas's own realm, so the marquee draws and the graph underneath does not pan. A second finger cancels: a pinch is not a lasso."
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
22
|
-
import {
|
|
22
|
+
import { XStack, YStack } from "tamagui";
|
|
23
23
|
import type { BuiltinEdgeData } from "../edges/edgeKinds";
|
|
24
24
|
import type { GraphDocument } from "../model/index";
|
|
25
25
|
import { NodeGraph } from "../NodeGraph";
|
|
@@ -27,6 +27,7 @@ import { demoGraphSchema } from "../react-flow/demoNodeBody";
|
|
|
27
27
|
import type { DemoNodeData } from "../react-flow/fixtures";
|
|
28
28
|
import { Background, Controls, useStore } from "../react-flow/xy";
|
|
29
29
|
import { defaultSnapThresholdPx } from "./snapAlignment";
|
|
30
|
+
import { SizableText } from "@multiplatform.one/components";
|
|
30
31
|
|
|
31
32
|
type Doc = GraphDocument<DemoNodeData, BuiltinEdgeData>;
|
|
32
33
|
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
39
39
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
40
40
|
import { Button } from "@multiplatform.one/forms";
|
|
41
|
-
import { SizableText, XStack, YStack } from "tamagui";
|
|
41
|
+
import { SizableText as TamaguiSizableText, XStack, YStack } from "tamagui";
|
|
42
42
|
import type { GraphEventWire } from "../dom/wire";
|
|
43
43
|
import type { GraphInteractionMode } from "../interaction/useLassoSelect";
|
|
44
44
|
import type { BuiltinEdgeData } from "../edges/edgeKinds";
|
|
@@ -50,6 +50,7 @@ import { demoGraphSchema } from "../react-flow/demoNodeBody";
|
|
|
50
50
|
import type { DemoNodeData } from "../react-flow/fixtures";
|
|
51
51
|
import type { NodeGraphHandle } from "../react-flow/graphHandle";
|
|
52
52
|
import { Background, Controls, reactFlowNodeSelector } from "../react-flow/xy";
|
|
53
|
+
import { SizableText } from "@multiplatform.one/components";
|
|
53
54
|
|
|
54
55
|
type Doc = GraphDocument<DemoNodeData, BuiltinEdgeData>;
|
|
55
56
|
|
|
@@ -276,9 +277,9 @@ function AutoLayoutPage({
|
|
|
276
277
|
) : null}
|
|
277
278
|
</XStack>
|
|
278
279
|
<XStack gap="$3" alignItems="center" flexWrap="wrap">
|
|
279
|
-
<
|
|
280
|
+
<TamaguiSizableText size="$2" theme={wrongRunner ? "red" : undefined} fontFamily="$mono">
|
|
280
281
|
{`runner ${reading?.runner ?? "not run yet"}`}
|
|
281
|
-
</
|
|
282
|
+
</TamaguiSizableText>
|
|
282
283
|
{wrongRunner ? (
|
|
283
284
|
<SizableText size="$2" theme="red">
|
|
284
285
|
FAILED — this platform has Worker, so `inline` is not a valid measurement
|
|
@@ -294,12 +295,12 @@ function AutoLayoutPage({
|
|
|
294
295
|
{`FAILED — the engine rejected: ${reading.error}`}
|
|
295
296
|
</SizableText>
|
|
296
297
|
) : null}
|
|
297
|
-
<
|
|
298
|
+
<TamaguiSizableText size="$2" opacity={0.7} fontFamily="$mono">
|
|
298
299
|
{reading === null ? "engine —" : `engine ${reading.ms.toFixed(1)} ms`}
|
|
299
|
-
</
|
|
300
|
-
<
|
|
300
|
+
</TamaguiSizableText>
|
|
301
|
+
<TamaguiSizableText size="$2" opacity={0.7} fontFamily="$mono">
|
|
301
302
|
{`${reading?.nodeCount ?? count} nodes`}
|
|
302
|
-
</
|
|
303
|
+
</TamaguiSizableText>
|
|
303
304
|
{pending ? (
|
|
304
305
|
<SizableText size="$2" opacity={0.7}>
|
|
305
306
|
laying out…
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import { Preset, Surface, fontCategoryStacks } from "@multiplatform.one/theme";
|
|
12
12
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
13
13
|
import { type ReactNode, useEffect, useRef, useState } from "react";
|
|
14
|
-
import { SizableText, Theme, XStack, YStack } from "tamagui";
|
|
14
|
+
import { SizableText as TamaguiSizableText, Theme, XStack, YStack } from "tamagui";
|
|
15
15
|
import { hasDomRealm } from "../native/DomOnlyStory";
|
|
16
16
|
import { ReactFlowProvider } from "../react-flow/xy";
|
|
17
17
|
import { GraphFaces } from "../theme/GraphFaces";
|
|
@@ -20,6 +20,7 @@ import { corruptFirstFamily, probeRenderedFamily } from "../theme/faces";
|
|
|
20
20
|
import type { FaceProbe } from "../theme/faces";
|
|
21
21
|
import { GraphNode } from "./GraphNode";
|
|
22
22
|
import type { GraphNodePort } from "./nodeMeasure";
|
|
23
|
+
import { SizableText } from "@multiplatform.one/components";
|
|
23
24
|
|
|
24
25
|
const oneIn: GraphNodePort[] = [{ id: "in", side: "left", direction: "in", label: "source" }];
|
|
25
26
|
|
|
@@ -270,9 +271,9 @@ export const KnobFuzz: Story = {
|
|
|
270
271
|
function ProbeRow({ label, probe }: { label: string; probe: FaceProbe | null }) {
|
|
271
272
|
if (!probe) {
|
|
272
273
|
return (
|
|
273
|
-
<
|
|
274
|
+
<TamaguiSizableText size="$2" fontFamily="$mono">
|
|
274
275
|
{label}: measuring…
|
|
275
|
-
</
|
|
276
|
+
</TamaguiSizableText>
|
|
276
277
|
);
|
|
277
278
|
}
|
|
278
279
|
const verdict = !probe.conclusive
|
|
@@ -282,16 +283,16 @@ function ProbeRow({ label, probe }: { label: string; probe: FaceProbe | null })
|
|
|
282
283
|
: "MISS — first family never painted";
|
|
283
284
|
return (
|
|
284
285
|
<YStack gap="$1">
|
|
285
|
-
<
|
|
286
|
+
<TamaguiSizableText size="$2" fontFamily="$mono">
|
|
286
287
|
{label}: {verdict}
|
|
287
|
-
</
|
|
288
|
-
<
|
|
288
|
+
</TamaguiSizableText>
|
|
289
|
+
<TamaguiSizableText size="$1" fontFamily="$mono" opacity={0.7}>
|
|
289
290
|
stack {probe.widthStack.toFixed(2)}px · first-corrupted{" "}
|
|
290
291
|
{probe.widthFirstCorrupted.toFixed(2)}px
|
|
291
|
-
</
|
|
292
|
-
<
|
|
292
|
+
</TamaguiSizableText>
|
|
293
|
+
<TamaguiSizableText size="$1" fontFamily="$mono" opacity={0.5}>
|
|
293
294
|
{probe.stack}
|
|
294
|
-
</
|
|
295
|
+
</TamaguiSizableText>
|
|
295
296
|
</YStack>
|
|
296
297
|
);
|
|
297
298
|
}
|
|
@@ -382,9 +383,9 @@ function FontProofPanel() {
|
|
|
382
383
|
ports={inOut}
|
|
383
384
|
/>
|
|
384
385
|
<YStack gap="$2" padding="$3" backgroundColor="$background" borderRadius="$4">
|
|
385
|
-
<
|
|
386
|
+
<TamaguiSizableText size="$2" fontFamily="$mono">
|
|
386
387
|
probe not run — there is no DOM here
|
|
387
|
-
</
|
|
388
|
+
</TamaguiSizableText>
|
|
388
389
|
<SizableText size="$1" opacity={0.7}>
|
|
389
390
|
The node above is the real Tamagui body, resolved through the real knob stack. The
|
|
390
391
|
corrupted-first-family control needs a document and a canvas measurer, so on device it
|
|
@@ -422,9 +423,9 @@ function FontProofPanel() {
|
|
|
422
423
|
<ProbeRow label="control, first family absent" probe={absent} />
|
|
423
424
|
<YStack gap="$1">
|
|
424
425
|
{statuses.map((status) => (
|
|
425
|
-
<
|
|
426
|
+
<TamaguiSizableText key={status.id} size="$1" fontFamily="$mono" opacity={0.7}>
|
|
426
427
|
{status.id} · {status.family} {status.weight} · delivered by {status.source}
|
|
427
|
-
</
|
|
428
|
+
</TamaguiSizableText>
|
|
428
429
|
))}
|
|
429
430
|
</YStack>
|
|
430
431
|
</YStack>
|
|
@@ -23,7 +23,7 @@ import { Switch } from "@multiplatform.one/forms";
|
|
|
23
23
|
import { Preset, Surface } from "@multiplatform.one/theme";
|
|
24
24
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
25
25
|
import { useState } from "react";
|
|
26
|
-
import {
|
|
26
|
+
import { XStack, YStack } from "tamagui";
|
|
27
27
|
// React Flow's own sheet FIRST: it carries `.react-flow__handle-left/right/
|
|
28
28
|
// top/bottom`, the rules that translate a handle onto the node edge, and
|
|
29
29
|
// nothing in this package reproduces them. Without it a port renders at its
|
|
@@ -39,6 +39,7 @@ import { GraphNode } from "./GraphNode";
|
|
|
39
39
|
import { GraphPort } from "./GraphPort";
|
|
40
40
|
import { paintedPortSize, portGeometry, portHitSize } from "./handleGeometry";
|
|
41
41
|
import type { GraphNodePort, GraphNodeSizeKnob, GraphPortSide } from "./nodeMeasure";
|
|
42
|
+
import { SizableText } from "@multiplatform.one/components";
|
|
42
43
|
|
|
43
44
|
/** The size token whose side of `$true` reads each table row. */
|
|
44
45
|
const rowToken = { small: "$3", medium: "$4", large: "$5" } as const;
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
import { Switch } from "@multiplatform.one/forms";
|
|
23
23
|
import { Preset, Surface } from "@multiplatform.one/theme";
|
|
24
24
|
import { useState } from "react";
|
|
25
|
-
import {
|
|
25
|
+
import { View, XStack, YStack } from "tamagui";
|
|
26
26
|
import type { BuiltinEdgeData } from "../edges/edgeKinds";
|
|
27
27
|
import type { GraphDocument } from "../model/index";
|
|
28
28
|
import { demoGraphSchema } from "../react-flow/demoNodeBody";
|
|
@@ -30,6 +30,7 @@ import type { DemoNodeData } from "../react-flow/fixtures";
|
|
|
30
30
|
import { NodeGraphWeb } from "../react-flow/NodeGraphWeb";
|
|
31
31
|
import { Background, Controls, MiniMap, useStore } from "../react-flow/xy";
|
|
32
32
|
import { defaultOverviewZoom, lodForZoom } from "./lod";
|
|
33
|
+
import { SizableText } from "@multiplatform.one/components";
|
|
33
34
|
|
|
34
35
|
export default {
|
|
35
36
|
title: "NodeGraph/Overview",
|
|
@@ -13,7 +13,7 @@ import { Preset } from "@multiplatform.one/theme";
|
|
|
13
13
|
import type { Knobs } from "@multiplatform.one/theme";
|
|
14
14
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
15
15
|
import { useState } from "react";
|
|
16
|
-
import {
|
|
16
|
+
import { Theme, XStack, YStack } from "tamagui";
|
|
17
17
|
import type { BuiltinEdgeData } from "../edges/edgeKinds";
|
|
18
18
|
import type { GraphDocument } from "../model/index";
|
|
19
19
|
import { NodeGraph } from "../NodeGraph";
|
|
@@ -21,6 +21,7 @@ import { demoGraphSchema } from "./demoNodeBody";
|
|
|
21
21
|
import type { DemoNodeData } from "./fixtures";
|
|
22
22
|
import { demoDocument, demoDocumentLarge } from "./fixtures";
|
|
23
23
|
import { Background, Controls, MiniMap } from "./xy";
|
|
24
|
+
import { SizableText } from "@multiplatform.one/components";
|
|
24
25
|
|
|
25
26
|
type Doc = GraphDocument<DemoNodeData, BuiltinEdgeData>;
|
|
26
27
|
|
package/src/theme/faces.ts
CHANGED
|
@@ -230,7 +230,7 @@ export function probeRenderedFamily(el: Element): FaceProbe {
|
|
|
230
230
|
matched: false,
|
|
231
231
|
conclusive: false,
|
|
232
232
|
};
|
|
233
|
-
if (typeof window === "undefined") return empty;
|
|
233
|
+
if (typeof window === "undefined" || typeof window.getComputedStyle !== "function") return empty;
|
|
234
234
|
const style = window.getComputedStyle(el);
|
|
235
235
|
const stack = style.fontFamily;
|
|
236
236
|
if (!stack) return empty;
|
|
@@ -24,7 +24,6 @@ import {
|
|
|
24
24
|
} from "@multiplatform.one/theme";
|
|
25
25
|
import {
|
|
26
26
|
type GraphThemeAccess,
|
|
27
|
-
edgeStrokeWidthPx,
|
|
28
27
|
elevationBoxShadow,
|
|
29
28
|
graphCssVars,
|
|
30
29
|
graphTransitionCss,
|
|
@@ -310,8 +309,12 @@ describe("the mirrored token tables", () => {
|
|
|
310
309
|
}
|
|
311
310
|
});
|
|
312
311
|
|
|
313
|
-
it("keys the edge stroke
|
|
314
|
-
|
|
312
|
+
it("keys the edge stroke by the resolved stop, so outlined + none paints the small stroke", () => {
|
|
313
|
+
const emitted = graphCssVars(
|
|
314
|
+
resolveFor({ fillStyle: "outlined", borderWidth: "none" }),
|
|
315
|
+
fixtureTheme,
|
|
316
|
+
);
|
|
317
|
+
expect(emitted["--xy-edge-stroke-width"]).toBe("1.5px");
|
|
315
318
|
});
|
|
316
319
|
});
|
|
317
320
|
|
package/src/theme/graphVars.ts
CHANGED
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
hairlineWidth,
|
|
25
25
|
cssAnimationConfig,
|
|
26
26
|
} from "@multiplatform.one/theme";
|
|
27
|
+
import { edgeStrokeWidths } from "../edges/edgeStyle";
|
|
27
28
|
import { graphNodeSize } from "../nodes/nodeMeasure";
|
|
28
29
|
|
|
29
30
|
// ── Theme access ─────────────────────────────────────────────────────────────
|
|
@@ -133,35 +134,6 @@ export const handlePaintedPx: Readonly<Record<string, number>> = {
|
|
|
133
134
|
large: 12,
|
|
134
135
|
};
|
|
135
136
|
|
|
136
|
-
/**
|
|
137
|
-
* Edge ink by the `borderWidth` knob (design 11, Border width): none 1, small
|
|
138
|
-
* 1.5, medium 2, large 3.
|
|
139
|
-
*
|
|
140
|
-
* A remap, not a floor to `hairlineWidth`: an edge is a stroke, not a divider,
|
|
141
|
-
* and `hairline.ts:16-21` scopes that token to dividers only. `none` still
|
|
142
|
-
* paints, because a 0-width edge erases the graph's primary information.
|
|
143
|
-
*
|
|
144
|
-
* Keyed by `knobProps.controlBorderFilled.borderWidth`, NOT by the design's
|
|
145
|
-
* `controlBorderOutlined.borderWidth`. That fragment is
|
|
146
|
-
* `Math.max(borderWidthValue, 1)` (resolveKnobs.ts:599-602), which collapses
|
|
147
|
-
* none / small / medium onto the single value 1 — three of the four stops are
|
|
148
|
-
* not recoverable from it, so a remap off it cannot produce four widths.
|
|
149
|
-
* `controlBorderFilled` carries the unclamped number (0 / 0.5 / 1 / 2) and is
|
|
150
|
-
* the only post-resolution place the stop survives; `ResolvedKnobs` exposes no
|
|
151
|
-
* `borderWidth` string at all.
|
|
152
|
-
*
|
|
153
|
-
* One measured consequence: under `fillStyle: "outlined"` the resolver already
|
|
154
|
-
* promotes `borderWidth: "none"` to `small` (resolveKnobs.ts:530-533), so an
|
|
155
|
-
* outlined graph paints the 1.5 px edge at BOTH stops. That is the resolver's
|
|
156
|
-
* own clamp showing through, not a choice made here.
|
|
157
|
-
*/
|
|
158
|
-
export const edgeStrokeWidthPx: Readonly<Record<string, number>> = {
|
|
159
|
-
"0": 1,
|
|
160
|
-
"0.5": 1.5,
|
|
161
|
-
"1": 2,
|
|
162
|
-
"2": 3,
|
|
163
|
-
};
|
|
164
|
-
|
|
165
137
|
// ── Colour helpers ───────────────────────────────────────────────────────────
|
|
166
138
|
|
|
167
139
|
function clamp255(value: number): number {
|
|
@@ -313,7 +285,8 @@ export function graphVarValues(
|
|
|
313
285
|
// is where the hover label colour actually lives.
|
|
314
286
|
const hoverColor = toCss(text.hoverKnobProps?.color, theme);
|
|
315
287
|
|
|
316
|
-
|
|
288
|
+
// Design 11 remaps the edge stroke by the resolved stop (edgeStyle.ts).
|
|
289
|
+
const edgeStrokeWidth = edgeStrokeWidths[knobProps.borderWidthStop];
|
|
317
290
|
|
|
318
291
|
const selectionFill = withAlpha(theme.raw("outlineColor") ?? theme.raw("borderColor"), 0.12);
|
|
319
292
|
const maskFill = withAlpha(theme.raw("color1"), 0.7);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LiveGraphDiagnostics.d.ts","sourceRoot":"","sources":["../../src/diagnostics/LiveGraphDiagnostics.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;
|
|
1
|
+
{"version":3,"file":"LiveGraphDiagnostics.d.ts","sourceRoot":"","sources":["../../src/diagnostics/LiveGraphDiagnostics.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAsCH,wBAAgB,oBAAoB,4CA2DnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LiveGraphDiagnostics.native.d.ts","sourceRoot":"","sources":["../../src/diagnostics/LiveGraphDiagnostics.native.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;
|
|
1
|
+
{"version":3,"file":"LiveGraphDiagnostics.native.d.ts","sourceRoot":"","sources":["../../src/diagnostics/LiveGraphDiagnostics.native.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAiBH,wBAAgB,oBAAoB,4CAsBnC"}
|
|
@@ -27,8 +27,9 @@ export interface EdgeAppearance {
|
|
|
27
27
|
export declare const edgeAppearances: Readonly<Record<BuiltinEdgeKind, EdgeAppearance>>;
|
|
28
28
|
/**
|
|
29
29
|
* §11: an edge is a stroke, not a border, and a 0-width edge erases the graph's
|
|
30
|
-
* primary information. The theme's own
|
|
31
|
-
* (`
|
|
30
|
+
* primary information. The theme's own border widths are 0 / hairline / 1 / 2
|
|
31
|
+
* (`resolveKnobs.ts` `borderWidthMap`, LC-148), so this is a remap keyed by the
|
|
32
|
+
* resolved stop (`knobProps.borderWidthStop`), and
|
|
32
33
|
* deliberately not a floor to `hairlineWidth` — that token is dividers-only by
|
|
33
34
|
* its own header, and a stroke that stays legible while the canvas zooms out is
|
|
34
35
|
* not a divider.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edgeStyle.d.ts","sourceRoot":"","sources":["../../src/edges/edgeStyle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,YAAY,GAAG,MAAM,GAAG,UAAU,CAAC;AACzE,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,aAAa,CAAC;AAEjD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,wEAAwE;IACxE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,yDAAyD;IACzD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;CAC7B;AAED,qCAAqC;AACrC,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,cAAc,CAAC,CAK7E,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"edgeStyle.d.ts","sourceRoot":"","sources":["../../src/edges/edgeStyle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,YAAY,GAAG,MAAM,GAAG,UAAU,CAAC;AACzE,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,aAAa,CAAC;AAEjD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,wEAAwE;I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C;IAClC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,mEAAmE;IACnE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,GAAG,SAAS,CAgBjE"}
|
|
@@ -88,29 +88,6 @@ export declare const spaceTokenPx: Readonly<Record<string, number>>;
|
|
|
88
88
|
export declare const graphTransitionCss: Readonly<Record<string, string>>;
|
|
89
89
|
/** GraphPort painted disc, by the `size` knob (design 11, Size). Never 44 — that is the HIT value. */
|
|
90
90
|
export declare const handlePaintedPx: Readonly<Record<string, number>>;
|
|
91
|
-
/**
|
|
92
|
-
* Edge ink by the `borderWidth` knob (design 11, Border width): none 1, small
|
|
93
|
-
* 1.5, medium 2, large 3.
|
|
94
|
-
*
|
|
95
|
-
* A remap, not a floor to `hairlineWidth`: an edge is a stroke, not a divider,
|
|
96
|
-
* and `hairline.ts:16-21` scopes that token to dividers only. `none` still
|
|
97
|
-
* paints, because a 0-width edge erases the graph's primary information.
|
|
98
|
-
*
|
|
99
|
-
* Keyed by `knobProps.controlBorderFilled.borderWidth`, NOT by the design's
|
|
100
|
-
* `controlBorderOutlined.borderWidth`. That fragment is
|
|
101
|
-
* `Math.max(borderWidthValue, 1)` (resolveKnobs.ts:599-602), which collapses
|
|
102
|
-
* none / small / medium onto the single value 1 — three of the four stops are
|
|
103
|
-
* not recoverable from it, so a remap off it cannot produce four widths.
|
|
104
|
-
* `controlBorderFilled` carries the unclamped number (0 / 0.5 / 1 / 2) and is
|
|
105
|
-
* the only post-resolution place the stop survives; `ResolvedKnobs` exposes no
|
|
106
|
-
* `borderWidth` string at all.
|
|
107
|
-
*
|
|
108
|
-
* One measured consequence: under `fillStyle: "outlined"` the resolver already
|
|
109
|
-
* promotes `borderWidth: "none"` to `small` (resolveKnobs.ts:530-533), so an
|
|
110
|
-
* outlined graph paints the 1.5 px edge at BOTH stops. That is the resolver's
|
|
111
|
-
* own clamp showing through, not a choice made here.
|
|
112
|
-
*/
|
|
113
|
-
export declare const edgeStrokeWidthPx: Readonly<Record<string, number>>;
|
|
114
91
|
/**
|
|
115
92
|
* The same colour at a different alpha, as `rgba()` / `hsla()`.
|
|
116
93
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphVars.d.ts","sourceRoot":"","sources":["../../src/theme/graphVars.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAEL,KAAK,aAAa,EAGnB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"graphVars.d.ts","sourceRoot":"","sources":["../../src/theme/graphVars.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAEL,KAAK,aAAa,EAGnB,MAAM,0BAA0B,CAAC;AAMlC;;;;;;;;;;GAUG;AACH,MAAM,WAAW,gBAAgB;IAC/B,oEAAoE;IACpE,QAAQ,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAClD,mEAAmE;IACnE,QAAQ,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;CACnD;AAID;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAe3D,CAAC;AAIF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,aAAa,GACrB;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAClD;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAChD;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAA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