@graview/react 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 +96 -0
- package/README.md +20 -0
- package/dist/activity.d.ts +113 -0
- package/dist/activity.d.ts.map +1 -0
- package/dist/activity.js +207 -0
- package/dist/activity.js.map +1 -0
- package/dist/animation.d.ts +64 -0
- package/dist/animation.d.ts.map +1 -0
- package/dist/animation.js +245 -0
- package/dist/animation.js.map +1 -0
- package/dist/captions.d.ts +43 -0
- package/dist/captions.d.ts.map +1 -0
- package/dist/captions.js +61 -0
- package/dist/captions.js.map +1 -0
- package/dist/channels.d.ts +15 -0
- package/dist/channels.d.ts.map +1 -0
- package/dist/channels.js +114 -0
- package/dist/channels.js.map +1 -0
- package/dist/connectors.d.ts +176 -0
- package/dist/connectors.d.ts.map +1 -0
- package/dist/connectors.js +837 -0
- package/dist/connectors.js.map +1 -0
- package/dist/context.d.ts +348 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +568 -0
- package/dist/context.js.map +1 -0
- package/dist/drawn.d.ts +60 -0
- package/dist/drawn.d.ts.map +1 -0
- package/dist/drawn.js +58 -0
- package/dist/drawn.js.map +1 -0
- package/dist/edge-signs.d.ts +13 -0
- package/dist/edge-signs.d.ts.map +1 -0
- package/dist/edge-signs.js +76 -0
- package/dist/edge-signs.js.map +1 -0
- package/dist/hooks.d.ts +160 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +457 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/keyboard.d.ts +5 -0
- package/dist/keyboard.d.ts.map +1 -0
- package/dist/keyboard.js +178 -0
- package/dist/keyboard.js.map +1 -0
- package/dist/kit.d.ts +10 -0
- package/dist/kit.d.ts.map +1 -0
- package/dist/kit.js +32 -0
- package/dist/kit.js.map +1 -0
- package/dist/local-intelligence.d.ts +31 -0
- package/dist/local-intelligence.d.ts.map +1 -0
- package/dist/local-intelligence.js +66 -0
- package/dist/local-intelligence.js.map +1 -0
- package/dist/motion.d.ts +17 -0
- package/dist/motion.d.ts.map +1 -0
- package/dist/motion.js +26 -0
- package/dist/motion.js.map +1 -0
- package/dist/occupants.d.ts +45 -0
- package/dist/occupants.d.ts.map +1 -0
- package/dist/occupants.js +57 -0
- package/dist/occupants.js.map +1 -0
- package/dist/parallel.d.ts +19 -0
- package/dist/parallel.d.ts.map +1 -0
- package/dist/parallel.js +30 -0
- package/dist/parallel.js.map +1 -0
- package/dist/picking.d.ts +30 -0
- package/dist/picking.d.ts.map +1 -0
- package/dist/picking.js +140 -0
- package/dist/picking.js.map +1 -0
- package/dist/plots.d.ts +106 -0
- package/dist/plots.d.ts.map +1 -0
- package/dist/plots.js +306 -0
- package/dist/plots.js.map +1 -0
- package/dist/pointer.d.ts +27 -0
- package/dist/pointer.d.ts.map +1 -0
- package/dist/pointer.js +39 -0
- package/dist/pointer.js.map +1 -0
- package/dist/presence.d.ts +110 -0
- package/dist/presence.d.ts.map +1 -0
- package/dist/presence.js +280 -0
- package/dist/presence.js.map +1 -0
- package/dist/rails.d.ts +11 -0
- package/dist/rails.d.ts.map +1 -0
- package/dist/rails.js +15 -0
- package/dist/rails.js.map +1 -0
- package/dist/resolved-view.d.ts +78 -0
- package/dist/resolved-view.d.ts.map +1 -0
- package/dist/resolved-view.js +365 -0
- package/dist/resolved-view.js.map +1 -0
- package/dist/robot.d.ts +114 -0
- package/dist/robot.d.ts.map +1 -0
- package/dist/robot.js +93 -0
- package/dist/robot.js.map +1 -0
- package/dist/routes.d.ts +50 -0
- package/dist/routes.d.ts.map +1 -0
- package/dist/routes.js +150 -0
- package/dist/routes.js.map +1 -0
- package/dist/scene-camera.d.ts +25 -0
- package/dist/scene-camera.d.ts.map +1 -0
- package/dist/scene-camera.js +130 -0
- package/dist/scene-camera.js.map +1 -0
- package/dist/scene-hand.d.ts +110 -0
- package/dist/scene-hand.d.ts.map +1 -0
- package/dist/scene-hand.js +317 -0
- package/dist/scene-hand.js.map +1 -0
- package/dist/scene-helpers.d.ts +46 -0
- package/dist/scene-helpers.d.ts.map +1 -0
- package/dist/scene-helpers.js +108 -0
- package/dist/scene-helpers.js.map +1 -0
- package/dist/scene-lines.d.ts +76 -0
- package/dist/scene-lines.d.ts.map +1 -0
- package/dist/scene-lines.js +578 -0
- package/dist/scene-lines.js.map +1 -0
- package/dist/scene-root.d.ts +71 -0
- package/dist/scene-root.d.ts.map +1 -0
- package/dist/scene-root.js +790 -0
- package/dist/scene-root.js.map +1 -0
- package/dist/scene.d.ts +17 -0
- package/dist/scene.d.ts.map +1 -0
- package/dist/scene.js +17 -0
- package/dist/scene.js.map +1 -0
- package/dist/seat-marks.d.ts +35 -0
- package/dist/seat-marks.d.ts.map +1 -0
- package/dist/seat-marks.js +43 -0
- package/dist/seat-marks.js.map +1 -0
- package/dist/settings.d.ts +30 -0
- package/dist/settings.d.ts.map +1 -0
- package/dist/settings.js +73 -0
- package/dist/settings.js.map +1 -0
- package/dist/view-boundary.d.ts +33 -0
- package/dist/view-boundary.d.ts.map +1 -0
- package/dist/view-boundary.js +53 -0
- package/dist/view-boundary.js.map +1 -0
- package/dist/view-host.d.ts +57 -0
- package/dist/view-host.d.ts.map +1 -0
- package/dist/view-host.js +474 -0
- package/dist/view-host.js.map +1 -0
- package/dist/view-registry.d.ts +122 -0
- package/dist/view-registry.d.ts.map +1 -0
- package/dist/view-registry.js +20 -0
- package/dist/view-registry.js.map +1 -0
- package/dist/where-drawn.d.ts +151 -0
- package/dist/where-drawn.d.ts.map +1 -0
- package/dist/where-drawn.js +231 -0
- package/dist/where-drawn.js.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import type { Manner } from "./activity.js";
|
|
2
|
+
import type { DrawnBox } from "./context.js";
|
|
3
|
+
import type { SceneNode } from "./scene-root.js";
|
|
4
|
+
/** How each manner reads in words, for the tooltip and for assistive tech. */
|
|
5
|
+
export declare const WHO: Record<Manner, string>;
|
|
6
|
+
/**
|
|
7
|
+
* A selection, mapped onto what is actually DRAWN.
|
|
8
|
+
*
|
|
9
|
+
* The selection holds real node ids. A connector holds the ids of whatever is
|
|
10
|
+
* on screen — which above the stack is always a kind card, because
|
|
11
|
+
* `connectorsFor` resolves every endpoint through the nearest group that
|
|
12
|
+
* contains it. Comparing the two directly matched nothing, so any ordinary
|
|
13
|
+
* selection carried into the Graview receded every line at once and blanked
|
|
14
|
+
* the picture you rose to look at.
|
|
15
|
+
*
|
|
16
|
+
* Exported because it is the whole of that bug, and a pure function is the
|
|
17
|
+
* only way to hold it still.
|
|
18
|
+
*/
|
|
19
|
+
export declare function onScreen(nodes: readonly SceneNode[], selection: readonly string[]): ReadonlySet<string>;
|
|
20
|
+
/**
|
|
21
|
+
* HOW STRONGLY A LINE IS DRAWN AT ALTITUDE.
|
|
22
|
+
*
|
|
23
|
+
* Pulled out because it is a rule rather than a detail, and because the
|
|
24
|
+
* thing it gets wrong is invisible in a screenshot until you know to look:
|
|
25
|
+
* up here a selection is resolved to the CARD that stands for it, which is
|
|
26
|
+
* right for asking which cards a line touches and wrong for asking which
|
|
27
|
+
* LINE. With a district opened, every line into it touches that card — so
|
|
28
|
+
* choosing one name lit every name's lines, and clicking a member changed
|
|
29
|
+
* nothing about the picture.
|
|
30
|
+
*
|
|
31
|
+
* When the selection names something the strands actually mention, that
|
|
32
|
+
* finer answer wins. When it names none of them — a district chosen as a
|
|
33
|
+
* district — the card rule stands.
|
|
34
|
+
*/
|
|
35
|
+
export declare function altitudeOpacity(state: {
|
|
36
|
+
/** A relation kind is being stressed (hovered in the key). */
|
|
37
|
+
readonly emphasised: boolean;
|
|
38
|
+
/** This line is of that kind, or is itself chosen. */
|
|
39
|
+
readonly stressed: boolean;
|
|
40
|
+
/** Some strand on screen is touched by the chosen members. */
|
|
41
|
+
readonly anyChosen: boolean;
|
|
42
|
+
/** This strand is one of them. */
|
|
43
|
+
readonly mine: boolean;
|
|
44
|
+
/** This line touches the selection once resolved to cards. */
|
|
45
|
+
readonly touches: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* How many lines this one relation is drawing at once.
|
|
48
|
+
*
|
|
49
|
+
* A bundle is unpicked so each line can START at the thing it is about —
|
|
50
|
+
* the week draws every shift as its own span, and a line leaving the span
|
|
51
|
+
* says WHICH shifts are covered, which is worth having. But seven of them
|
|
52
|
+
* arriving at one closed district is a starburst across the whole picture
|
|
53
|
+
* at the same weight as a single fact. So a relation drawing many lines
|
|
54
|
+
* draws each of them quieter: the shape stays legible, and choosing one
|
|
55
|
+
* still brings it fully forward.
|
|
56
|
+
*/
|
|
57
|
+
readonly siblings?: number;
|
|
58
|
+
}): number;
|
|
59
|
+
/**
|
|
60
|
+
* How strongly a line is drawn INSIDE THE STACK.
|
|
61
|
+
*
|
|
62
|
+
* The twin of `altitudeOpacity`, and for a long time the reason the two
|
|
63
|
+
* altitudes disagreed: up there an untouched line recedes to 0.12 the
|
|
64
|
+
* moment anything is chosen, while down here the rule was a single
|
|
65
|
+
* expression with no name and no recede in it. Every unlit line kept its
|
|
66
|
+
* resting weight whatever was selected, so choosing one thing lit two lines
|
|
67
|
+
* and left fifteen others at full strength across the same picture — the
|
|
68
|
+
* two you asked for were the quietest thing on screen.
|
|
69
|
+
*
|
|
70
|
+
* The kit owns both numbers: `rest` is the crowd's weight while nothing is
|
|
71
|
+
* lit, `dim` what the crowd keeps once something is. A line's own declared
|
|
72
|
+
* opacity multiplies through, so a relation a brand made faint stays
|
|
73
|
+
* fainter than its neighbours at every step.
|
|
74
|
+
*/
|
|
75
|
+
export declare function stackOpacity(state: {
|
|
76
|
+
/** This line IS the chosen edge. */
|
|
77
|
+
readonly edgeChosen: boolean;
|
|
78
|
+
/** This line touches the selection. */
|
|
79
|
+
readonly lit: boolean;
|
|
80
|
+
/** Something on screen is lit — a selection, or a relation kind stressed. */
|
|
81
|
+
readonly anyLit: boolean;
|
|
82
|
+
/** The line's own opacity, from the kit. */
|
|
83
|
+
readonly own: number;
|
|
84
|
+
readonly kit: {
|
|
85
|
+
readonly rest: number;
|
|
86
|
+
readonly dim: number;
|
|
87
|
+
};
|
|
88
|
+
}): number;
|
|
89
|
+
/** A node's box as DRAWN, after its plane's scale — anchored at its top-left. */
|
|
90
|
+
export declare function drawnBox(node: SceneNode | undefined, scheme: "light" | "dark"): {
|
|
91
|
+
x: number;
|
|
92
|
+
y: number;
|
|
93
|
+
width: number;
|
|
94
|
+
height: number;
|
|
95
|
+
} | null;
|
|
96
|
+
/**
|
|
97
|
+
* The box a person can SEE for a laid-out node, measured from the DOM.
|
|
98
|
+
*
|
|
99
|
+
* A host is a band slot with the view somewhere inside it — the focus band
|
|
100
|
+
* pokes above its panel, a shrunk view centres in a taller natural box, and
|
|
101
|
+
* from altitude the visible thing is the iso block at the bottom of the
|
|
102
|
+
* card. Lines anchored to host borders ended in open air on every one of
|
|
103
|
+
* those; lines anchored to the measured inner box end on the thing itself.
|
|
104
|
+
* Null when there is no DOM to measure (tests, SSR) — callers fall back to
|
|
105
|
+
* the layout box.
|
|
106
|
+
*/
|
|
107
|
+
/**
|
|
108
|
+
* WHAT A PERSON CAN SEE OF AN ELEMENT, in stage coordinates, or null.
|
|
109
|
+
*
|
|
110
|
+
* A line is anchored on a measured box, and a box has a rectangle whether
|
|
111
|
+
* or not anything of it is on screen: a chip scrolled off the end of a
|
|
112
|
+
* roster, a row under a panel's fold, a name behind the fade at the foot of
|
|
113
|
+
* a card. Anchoring there drew lines that began in the air at the edge of
|
|
114
|
+
* a card and read as the picture being wrong about the graph. The
|
|
115
|
+
* rectangle is cut down by every ancestor that clips — scrollers and
|
|
116
|
+
* overflow-hidden boxes alike — up to the stage, and nothing is left when
|
|
117
|
+
* nothing shows.
|
|
118
|
+
*/
|
|
119
|
+
export declare function visibleRect(el: Element, stageEl: HTMLElement): {
|
|
120
|
+
x: number;
|
|
121
|
+
y: number;
|
|
122
|
+
width: number;
|
|
123
|
+
height: number;
|
|
124
|
+
} | null;
|
|
125
|
+
export declare function measureVisible(stageEl: HTMLElement | null, id: string, preferBlock: boolean): {
|
|
126
|
+
x: number;
|
|
127
|
+
y: number;
|
|
128
|
+
width: number;
|
|
129
|
+
height: number;
|
|
130
|
+
} | null;
|
|
131
|
+
/**
|
|
132
|
+
* WHERE SOMETHING IS, in the frame being drawn.
|
|
133
|
+
*
|
|
134
|
+
* `id` may be a node, a kind card (`kind:<kind>`), a group
|
|
135
|
+
* (`aggregate:<kind>`) or a Place slug. Each is resolved to the node in
|
|
136
|
+
* the frame that stands for it — a kind and its group are one card at
|
|
137
|
+
* altitude and one group in the stack, so either name finds whichever is
|
|
138
|
+
* drawn — and a node not drawn itself resolves to the nearest container
|
|
139
|
+
* that holds it, exactly as a connector's endpoint does. The box is what
|
|
140
|
+
* a person can see when there is a DOM to measure, and the drawn box
|
|
141
|
+
* otherwise, so the answer is the same one the ties land on.
|
|
142
|
+
*/
|
|
143
|
+
export declare function whereIsIn(frame: {
|
|
144
|
+
readonly nodes: readonly SceneNode[];
|
|
145
|
+
}, stageEl: HTMLElement | null, scheme: "light" | "dark", views: {
|
|
146
|
+
places(): readonly {
|
|
147
|
+
readonly kind: string;
|
|
148
|
+
readonly as: string;
|
|
149
|
+
}[];
|
|
150
|
+
}, id: string): DrawnBox | null;
|
|
151
|
+
//# sourceMappingURL=where-drawn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"where-drawn.d.ts","sourceRoot":"","sources":["../src/where-drawn.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,8EAA8E;AAC9E,eAAO,MAAM,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAA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IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAShE;AAED;;;;;;;;;;GAUG;AACH;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CACzB,EAAE,EAAE,OAAO,EACX,OAAO,EAAE,WAAW,GACnB;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CA+BhE;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,WAAW,GAAG,IAAI,EAC3B,EAAE,EAAE,MAAM,EACV,WAAW,EAAE,OAAO,GACnB;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAWhE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,SAAS,EAAE,CAAA;CAAE,EAC/C,OAAO,EAAE,WAAW,GAAG,IAAI,EAC3B,MAAM,EAAE,OAAO,GAAG,MAAM,EACxB,KAAK,EAAE;IAAE,MAAM,IAAI,SAAS;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,EAC9E,EAAE,EAAE,MAAM,GACT,QAAQ,GAAG,IAAI,CA8CjB"}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { aggregateId, isAggregateId, kindCardId, kindOfCard, kindsOfAggregate } from "@graview/layout";
|
|
2
|
+
import { mixStyles, styleFor } from "@graview/render";
|
|
3
|
+
/** How each manner reads in words, for the tooltip and for assistive tech. */
|
|
4
|
+
export const WHO = {
|
|
5
|
+
directed: "You",
|
|
6
|
+
autonomous: "An agent",
|
|
7
|
+
"co-edited": "You and an agent",
|
|
8
|
+
rule: "A rule",
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A selection, mapped onto what is actually DRAWN.
|
|
12
|
+
*
|
|
13
|
+
* The selection holds real node ids. A connector holds the ids of whatever is
|
|
14
|
+
* on screen — which above the stack is always a kind card, because
|
|
15
|
+
* `connectorsFor` resolves every endpoint through the nearest group that
|
|
16
|
+
* contains it. Comparing the two directly matched nothing, so any ordinary
|
|
17
|
+
* selection carried into the Graview receded every line at once and blanked
|
|
18
|
+
* the picture you rose to look at.
|
|
19
|
+
*
|
|
20
|
+
* Exported because it is the whole of that bug, and a pure function is the
|
|
21
|
+
* only way to hold it still.
|
|
22
|
+
*/
|
|
23
|
+
export function onScreen(nodes, selection) {
|
|
24
|
+
const drawn = new Set(nodes.map((node) => node.id));
|
|
25
|
+
const chosen = new Set();
|
|
26
|
+
for (const id of selection) {
|
|
27
|
+
if (drawn.has(id)) {
|
|
28
|
+
chosen.add(id);
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
// Not drawn as itself: the card standing for it is what the eye can see,
|
|
32
|
+
// and what a connector to it actually points at.
|
|
33
|
+
const container = nodes.find((node) => node.aggregate?.memberIds.includes(id));
|
|
34
|
+
if (container)
|
|
35
|
+
chosen.add(container.id);
|
|
36
|
+
}
|
|
37
|
+
return chosen;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* HOW STRONGLY A LINE IS DRAWN AT ALTITUDE.
|
|
41
|
+
*
|
|
42
|
+
* Pulled out because it is a rule rather than a detail, and because the
|
|
43
|
+
* thing it gets wrong is invisible in a screenshot until you know to look:
|
|
44
|
+
* up here a selection is resolved to the CARD that stands for it, which is
|
|
45
|
+
* right for asking which cards a line touches and wrong for asking which
|
|
46
|
+
* LINE. With a district opened, every line into it touches that card — so
|
|
47
|
+
* choosing one name lit every name's lines, and clicking a member changed
|
|
48
|
+
* nothing about the picture.
|
|
49
|
+
*
|
|
50
|
+
* When the selection names something the strands actually mention, that
|
|
51
|
+
* finer answer wins. When it names none of them — a district chosen as a
|
|
52
|
+
* district — the card rule stands.
|
|
53
|
+
*/
|
|
54
|
+
export function altitudeOpacity(state) {
|
|
55
|
+
if (state.emphasised)
|
|
56
|
+
return state.stressed ? 0.95 : 0.08;
|
|
57
|
+
if (state.anyChosen)
|
|
58
|
+
return state.mine ? 0.9 : 0.12;
|
|
59
|
+
if (!state.touches)
|
|
60
|
+
return 0.12;
|
|
61
|
+
return Math.max(0.34, 0.9 - 0.09 * Math.max(0, (state.siblings ?? 1) - 1));
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* How strongly a line is drawn INSIDE THE STACK.
|
|
65
|
+
*
|
|
66
|
+
* The twin of `altitudeOpacity`, and for a long time the reason the two
|
|
67
|
+
* altitudes disagreed: up there an untouched line recedes to 0.12 the
|
|
68
|
+
* moment anything is chosen, while down here the rule was a single
|
|
69
|
+
* expression with no name and no recede in it. Every unlit line kept its
|
|
70
|
+
* resting weight whatever was selected, so choosing one thing lit two lines
|
|
71
|
+
* and left fifteen others at full strength across the same picture — the
|
|
72
|
+
* two you asked for were the quietest thing on screen.
|
|
73
|
+
*
|
|
74
|
+
* The kit owns both numbers: `rest` is the crowd's weight while nothing is
|
|
75
|
+
* lit, `dim` what the crowd keeps once something is. A line's own declared
|
|
76
|
+
* opacity multiplies through, so a relation a brand made faint stays
|
|
77
|
+
* fainter than its neighbours at every step.
|
|
78
|
+
*/
|
|
79
|
+
export function stackOpacity(state) {
|
|
80
|
+
if (state.edgeChosen)
|
|
81
|
+
return 0.9;
|
|
82
|
+
if (state.lit)
|
|
83
|
+
return 0.78;
|
|
84
|
+
return state.own * (state.anyLit ? state.kit.dim : state.kit.rest);
|
|
85
|
+
}
|
|
86
|
+
/** A node's box as DRAWN, after its plane's scale — anchored at its top-left. */
|
|
87
|
+
export function drawnBox(node, scheme) {
|
|
88
|
+
if (!node)
|
|
89
|
+
return null;
|
|
90
|
+
const lower = Math.max(0, Math.min(2, Math.floor(node.plane)));
|
|
91
|
+
const upper = Math.max(0, Math.min(2, Math.ceil(node.plane)));
|
|
92
|
+
const { scale } = lower === upper
|
|
93
|
+
? styleFor(lower, scheme)
|
|
94
|
+
: mixStyles(styleFor(lower, scheme), styleFor(upper, scheme), node.plane - lower);
|
|
95
|
+
return { x: node.x, y: node.y, width: node.width * scale, height: node.height * scale };
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* The box a person can SEE for a laid-out node, measured from the DOM.
|
|
99
|
+
*
|
|
100
|
+
* A host is a band slot with the view somewhere inside it — the focus band
|
|
101
|
+
* pokes above its panel, a shrunk view centres in a taller natural box, and
|
|
102
|
+
* from altitude the visible thing is the iso block at the bottom of the
|
|
103
|
+
* card. Lines anchored to host borders ended in open air on every one of
|
|
104
|
+
* those; lines anchored to the measured inner box end on the thing itself.
|
|
105
|
+
* Null when there is no DOM to measure (tests, SSR) — callers fall back to
|
|
106
|
+
* the layout box.
|
|
107
|
+
*/
|
|
108
|
+
/**
|
|
109
|
+
* WHAT A PERSON CAN SEE OF AN ELEMENT, in stage coordinates, or null.
|
|
110
|
+
*
|
|
111
|
+
* A line is anchored on a measured box, and a box has a rectangle whether
|
|
112
|
+
* or not anything of it is on screen: a chip scrolled off the end of a
|
|
113
|
+
* roster, a row under a panel's fold, a name behind the fade at the foot of
|
|
114
|
+
* a card. Anchoring there drew lines that began in the air at the edge of
|
|
115
|
+
* a card and read as the picture being wrong about the graph. The
|
|
116
|
+
* rectangle is cut down by every ancestor that clips — scrollers and
|
|
117
|
+
* overflow-hidden boxes alike — up to the stage, and nothing is left when
|
|
118
|
+
* nothing shows.
|
|
119
|
+
*/
|
|
120
|
+
export function visibleRect(el, stageEl) {
|
|
121
|
+
if (typeof getComputedStyle === "undefined")
|
|
122
|
+
return null;
|
|
123
|
+
if (getComputedStyle(el).visibility === "hidden")
|
|
124
|
+
return null;
|
|
125
|
+
let left = -Infinity;
|
|
126
|
+
let top = -Infinity;
|
|
127
|
+
let right = Infinity;
|
|
128
|
+
let bottom = Infinity;
|
|
129
|
+
const own = el.getBoundingClientRect();
|
|
130
|
+
left = Math.max(left, own.left);
|
|
131
|
+
top = Math.max(top, own.top);
|
|
132
|
+
right = Math.min(right, own.right);
|
|
133
|
+
bottom = Math.min(bottom, own.bottom);
|
|
134
|
+
let up = el.parentElement;
|
|
135
|
+
while (up && up !== stageEl) {
|
|
136
|
+
const style = getComputedStyle(up);
|
|
137
|
+
if (style.overflowX !== "visible" || style.overflowY !== "visible") {
|
|
138
|
+
const box = up.getBoundingClientRect();
|
|
139
|
+
if (style.overflowX !== "visible") {
|
|
140
|
+
left = Math.max(left, box.left);
|
|
141
|
+
right = Math.min(right, box.right);
|
|
142
|
+
}
|
|
143
|
+
if (style.overflowY !== "visible") {
|
|
144
|
+
top = Math.max(top, box.top);
|
|
145
|
+
bottom = Math.min(bottom, box.bottom);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
up = up.parentElement;
|
|
149
|
+
}
|
|
150
|
+
if (right - left <= 2 || bottom - top <= 2)
|
|
151
|
+
return null;
|
|
152
|
+
const stage = stageEl.getBoundingClientRect();
|
|
153
|
+
return { x: left - stage.left, y: top - stage.top, width: right - left, height: bottom - top };
|
|
154
|
+
}
|
|
155
|
+
export function measureVisible(stageEl, id, preferBlock) {
|
|
156
|
+
if (!stageEl || typeof document === "undefined")
|
|
157
|
+
return null;
|
|
158
|
+
const host = stageEl.querySelector(`[data-graview-view="${CSS.escape(id)}"]`);
|
|
159
|
+
if (!host)
|
|
160
|
+
return null;
|
|
161
|
+
const inner = (preferBlock ? host.querySelector(".graview-kind-block") : null) ??
|
|
162
|
+
host.querySelector('[data-graview-primitive="panel"], .graview-kind-face, .graview-kind-card') ??
|
|
163
|
+
host;
|
|
164
|
+
// Cut down to what shows: a host half under a scroller's fold anchors a
|
|
165
|
+
// line where its visible half is, and one wholly under it anchors none.
|
|
166
|
+
return visibleRect(inner, stageEl);
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* WHERE SOMETHING IS, in the frame being drawn.
|
|
170
|
+
*
|
|
171
|
+
* `id` may be a node, a kind card (`kind:<kind>`), a group
|
|
172
|
+
* (`aggregate:<kind>`) or a Place slug. Each is resolved to the node in
|
|
173
|
+
* the frame that stands for it — a kind and its group are one card at
|
|
174
|
+
* altitude and one group in the stack, so either name finds whichever is
|
|
175
|
+
* drawn — and a node not drawn itself resolves to the nearest container
|
|
176
|
+
* that holds it, exactly as a connector's endpoint does. The box is what
|
|
177
|
+
* a person can see when there is a DOM to measure, and the drawn box
|
|
178
|
+
* otherwise, so the answer is the same one the ties land on.
|
|
179
|
+
*/
|
|
180
|
+
export function whereIsIn(frame, stageEl, scheme, views, id) {
|
|
181
|
+
const find = (wanted) => frame.nodes.find((node) => node.id === wanted);
|
|
182
|
+
/*
|
|
183
|
+
* THE AUDIENCE STRIP in front of a drive-in's screen: the ground between
|
|
184
|
+
* the screen's foot and the plot's near half, where figures will stand.
|
|
185
|
+
* Nothing draws there yet; the address is what later tasks stand on.
|
|
186
|
+
*/
|
|
187
|
+
if (id.startsWith("screen:")) {
|
|
188
|
+
const kind = id.slice("screen:".length);
|
|
189
|
+
const screen = frame.nodes.find((node) => node.screenOf === kind);
|
|
190
|
+
if (!screen)
|
|
191
|
+
return null;
|
|
192
|
+
const box = measureVisible(stageEl, screen.id, false) ?? drawnBox(screen, scheme);
|
|
193
|
+
if (!box)
|
|
194
|
+
return null;
|
|
195
|
+
const card = frame.nodes.find((node) => node.id === kindCardId(kind));
|
|
196
|
+
const plate = card ? drawnBox(card, scheme) : null;
|
|
197
|
+
const foot = box.y + box.height;
|
|
198
|
+
const depth = plate ? Math.max(20, plate.y - foot) : Math.max(20, box.height * 0.18);
|
|
199
|
+
return { x: box.x, y: foot, width: box.width, height: depth };
|
|
200
|
+
}
|
|
201
|
+
let target = find(id);
|
|
202
|
+
const kind = kindOfCard(id);
|
|
203
|
+
if (!target && kind !== null)
|
|
204
|
+
target = find(aggregateId(kind));
|
|
205
|
+
if (!target && isAggregateId(id)) {
|
|
206
|
+
const [first] = kindsOfAggregate(id);
|
|
207
|
+
if (first)
|
|
208
|
+
target = find(kindCardId(first));
|
|
209
|
+
}
|
|
210
|
+
if (!target) {
|
|
211
|
+
const place = views.places().find((candidate) => candidate.as === id);
|
|
212
|
+
if (place)
|
|
213
|
+
target = find(aggregateId(place.kind)) ?? find(kindCardId(place.kind));
|
|
214
|
+
}
|
|
215
|
+
if (!target) {
|
|
216
|
+
target = [...frame.nodes]
|
|
217
|
+
.filter((node) => node.aggregate?.memberIds.includes(id))
|
|
218
|
+
.sort((a, b) => a.plane - b.plane)[0];
|
|
219
|
+
}
|
|
220
|
+
if (!target)
|
|
221
|
+
return null;
|
|
222
|
+
/*
|
|
223
|
+
* The iso BLOCK is the district's visible thing only from altitude; in
|
|
224
|
+
* the stack it is invisible and hangs a few pixels below the card, and
|
|
225
|
+
* a figure docked on it stood past the bottom of the ground.
|
|
226
|
+
*/
|
|
227
|
+
const aloft = frame.city !== undefined;
|
|
228
|
+
return (measureVisible(stageEl, target.id, aloft && target.aggregate !== undefined && Math.round(target.plane) === 2) ??
|
|
229
|
+
drawnBox(target, scheme));
|
|
230
|
+
}
|
|
231
|
+
//# sourceMappingURL=where-drawn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"where-drawn.js","sourceRoot":"","sources":["../src/where-drawn.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACvG,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAKtD,8EAA8E;AAC9E,MAAM,CAAC,MAAM,GAAG,GAA2B;IACzC,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE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G,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IACpF,CAAC;IACD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC;aACtB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;aACxD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC;IACD,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB;;;;OAIG;IACH,MAAM,KAAK,GAAI,KAAqC,CAAC,IAAI,KAAK,SAAS,CAAC;IACxE,OAAO,CACL,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,IAAI,MAAM,CAAC,SAAS,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC7G,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CACzB,CAAC;AACJ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@graview/react",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"default": "./dist/index.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@graview/core": "0.1.0",
|
|
15
|
+
"@graview/tools": "0.1.0",
|
|
16
|
+
"@graview/render": "0.1.0",
|
|
17
|
+
"@graview/layout": "0.1.0"
|
|
18
|
+
},
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"react": ">=18",
|
|
21
|
+
"react-dom": ">=18"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"zod": "^4.4.3"
|
|
25
|
+
},
|
|
26
|
+
"description": "The React binding: a provider, a scene, and the hooks an app builds on.",
|
|
27
|
+
"keywords": [
|
|
28
|
+
"graview",
|
|
29
|
+
"context-graph",
|
|
30
|
+
"typed-graph",
|
|
31
|
+
"interface",
|
|
32
|
+
"declarative",
|
|
33
|
+
"react",
|
|
34
|
+
"react-component"
|
|
35
|
+
],
|
|
36
|
+
"files": [
|
|
37
|
+
"dist",
|
|
38
|
+
"README.md"
|
|
39
|
+
],
|
|
40
|
+
"sideEffects": false,
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "git+https://github.com/en-dash-consulting/graview.git",
|
|
44
|
+
"directory": "packages/react"
|
|
45
|
+
},
|
|
46
|
+
"publishConfig": {
|
|
47
|
+
"access": "public"
|
|
48
|
+
},
|
|
49
|
+
"license": "Elastic-2.0",
|
|
50
|
+
"homepage": "https://graview.dev/docs/packages/react.html",
|
|
51
|
+
"bugs": {
|
|
52
|
+
"url": "https://github.com/en-dash-consulting/graview/issues"
|
|
53
|
+
},
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": ">=22"
|
|
56
|
+
},
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "tsc -b"
|
|
59
|
+
}
|
|
60
|
+
}
|