@mark1russell7/visuals 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +79 -2
- package/build/globe.d.ts +2 -2
- package/build/graph.d.ts +190 -1
- package/build/graph.d.ts.map +1 -1
- package/build/graph.js +497 -11
- package/build/graph.js.map +1 -1
- package/build/highlight-BJ6xGp6V.d.ts +30 -0
- package/build/highlight-BJ6xGp6V.d.ts.map +1 -0
- package/build/index.d.ts +2 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -1
- package/build/labels.d.ts +1 -1
- package/build/markers.d.ts +2 -2
- package/build/{motion-DViuJNyh.js → motion-VS13e4Pw.js} +6 -2
- package/build/{motion-DViuJNyh.js.map → motion-VS13e4Pw.js.map} +1 -1
- package/build/{stage-DmFfah2e.d.ts → stage-D8JVM6wZ.d.ts} +3 -2
- package/build/stage-D8JVM6wZ.d.ts.map +1 -0
- package/build/{theme-3EGbXXoP.d.ts → theme-DBbBlCbC.d.ts} +2 -30
- package/build/theme-DBbBlCbC.d.ts.map +1 -0
- package/build/three.d.ts +2 -2
- package/build/three.js +2 -8
- package/build/three.js.map +1 -1
- package/package.json +1 -1
- package/build/stage-DmFfah2e.d.ts.map +0 -1
- package/build/theme-3EGbXXoP.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ The package has eight entries and two style sheets:
|
|
|
13
13
|
- The file `/scrubber.css` is the style sheet of the scrubber.
|
|
14
14
|
- The entry `/labels` has the labels of a stage: a short text next to a point, as an element of the page. It needs a browser.
|
|
15
15
|
- The file `/labels.css` is the style sheet of the labels.
|
|
16
|
-
- The entry `/graph` has the
|
|
16
|
+
- The entry `/graph` has the stage of a flat picture, for example a graph of boxes and edges. It does not need `three`.
|
|
17
17
|
|
|
18
18
|
## Install
|
|
19
19
|
|
|
@@ -474,7 +474,80 @@ stage?.refresh();
|
|
|
474
474
|
## A flat picture
|
|
475
475
|
|
|
476
476
|
The entry `/graph` is for a flat picture that a person moves and zooms, for example a graph of boxes and edges.
|
|
477
|
-
|
|
477
|
+
It has a stage on a canvas, and the maths of its camera, its pointers and its keys. It imports no `three`.
|
|
478
|
+
|
|
479
|
+
```ts
|
|
480
|
+
import { aimRects, createPictureStage, type PictureContent } from "@mark1russell7/visuals/graph";
|
|
481
|
+
|
|
482
|
+
interface Box {
|
|
483
|
+
readonly id: string;
|
|
484
|
+
readonly x: number;
|
|
485
|
+
readonly y: number;
|
|
486
|
+
readonly w: number;
|
|
487
|
+
readonly h: number;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
const first: Box = { id: "a", x: 0, y: 0, w: 160, h: 60 };
|
|
491
|
+
const boxes: readonly Box[] = [first, { id: "b", x: 240, y: 120, w: 160, h: 60 }];
|
|
492
|
+
|
|
493
|
+
// A content draws in CSS pixels. The view of the frame has the zoom and the position of the picture.
|
|
494
|
+
const content: PictureContent<Box, { readonly box: string; readonly selected: string }> = {
|
|
495
|
+
bounds: { x: 0, y: 0, w: 400, h: 180 },
|
|
496
|
+
has: (record) => boxes.some((box) => box.id === record),
|
|
497
|
+
pick: ({ point }) => {
|
|
498
|
+
const box = boxes.find((b) => point.x >= b.x && point.x <= b.x + b.w && point.y >= b.y && point.y <= b.y + b.h);
|
|
499
|
+
return box === undefined ? undefined : { record: box.id, value: box };
|
|
500
|
+
},
|
|
501
|
+
draw(context, { view }, theme, highlight) {
|
|
502
|
+
context.translate(view.x, view.y);
|
|
503
|
+
context.scale(view.k, view.k);
|
|
504
|
+
for (const box of boxes) {
|
|
505
|
+
context.fillStyle = highlight(box.id) === 0 ? theme.box : theme.selected;
|
|
506
|
+
context.fillRect(box.x, box.y, box.w, box.h);
|
|
507
|
+
}
|
|
508
|
+
return false;
|
|
509
|
+
},
|
|
510
|
+
};
|
|
511
|
+
|
|
512
|
+
const stage = createPictureStage(document.body, {
|
|
513
|
+
content,
|
|
514
|
+
theme: { box: "#c8d0d8", selected: "#2f6fd0" },
|
|
515
|
+
label: "Two boxes",
|
|
516
|
+
views: { first: aimRects([first], { least: 0.6 }) },
|
|
517
|
+
keys: { f: "first" },
|
|
518
|
+
onSelect: (box) => console.log(box?.id),
|
|
519
|
+
});
|
|
520
|
+
stage?.setView("first");
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
The stage fills its container, so give the container a size. `createPictureStage` gives `undefined` when the browser gives no 2D context.
|
|
524
|
+
|
|
525
|
+
- A drag moves the picture. The wheel, two fingers and a double click change the zoom at the pointer.
|
|
526
|
+
- A click selects the record below the pointer, and `onSelect` gets its value. `onHover` gets the record below a mouse or a pen.
|
|
527
|
+
- The wheel moves the page until a person uses the picture. Set `wheel` to `always` for a picture that fills the page.
|
|
528
|
+
- A view is an aim: a function that gives the view for a picture and a screen.
|
|
529
|
+
- `aimAll` shows all of the picture, and `aimRects` shows a group of boxes. `aimReveal` moves the camera only for a selection that is out of view.
|
|
530
|
+
- The stage asks the aim again after a change of the size, until a person moves the picture.
|
|
531
|
+
- A part of the picture stays in view: `keepRect` keeps 64 pixels of it in the free area.
|
|
532
|
+
- A very large picture gets a smaller least zoom from `zoomLimitsFor`, so a person can show all of it.
|
|
533
|
+
- `setInsets` tells the stage which parts of the picture the page covers. Each view uses the free area.
|
|
534
|
+
- `stackPictureContents` makes one content from layers, for example boxes below routes below labels.
|
|
535
|
+
- The stage makes a picture only after a change. A content that continues to change gives true from `draw`.
|
|
536
|
+
- A person who asks for less motion gets each view immediately.
|
|
537
|
+
|
|
538
|
+
| Function of the stage | What it does |
|
|
539
|
+
| --- | --- |
|
|
540
|
+
| `setContent` | It shows a different content, and disposes the old content. |
|
|
541
|
+
| `setTheme` | It changes the colors. |
|
|
542
|
+
| `setView` | It moves the camera to a view: a name of the options, or an aim. |
|
|
543
|
+
| `setInsets` | It sets the parts of the picture that the page covers. |
|
|
544
|
+
| `zoomBy` | It changes the zoom by a factor at the middle of the free area, for the buttons of a page. |
|
|
545
|
+
| `view`, `area` | They give the view of the camera, and the free area. |
|
|
546
|
+
| `highlight`, `select` | They highlight records by their names, and select one record. |
|
|
547
|
+
| `refresh` | It makes a new picture after a change of the content. |
|
|
548
|
+
| `dispose` | It removes the canvas, and disposes the content. |
|
|
549
|
+
|
|
550
|
+
The maths of the camera are pure functions, so a test in Node.js uses them:
|
|
478
551
|
|
|
479
552
|
```ts
|
|
480
553
|
import { fitRect, freeArea, toPicture, viewBetween, zoomView } from "@mark1russell7/visuals/graph";
|
|
@@ -499,6 +572,10 @@ A view has the zoom `k` and the screen position of the origin of the picture. A
|
|
|
499
572
|
| `pinchView` | The view after the two pointers of a pinch move. Each pointer keeps its point of the picture. |
|
|
500
573
|
| `freeArea` | The part of a picture that the page does not cover. A camera shows a selection there. |
|
|
501
574
|
| `fitRect` | The view that shows a rectangle in an area, as large as the area permits. |
|
|
575
|
+
| `zoomLimitsFor` | The limits of the zoom for a picture, with a least zoom that shows all of it. |
|
|
576
|
+
| `keepRect` | The view that keeps a part of a rectangle in an area, so a person cannot lose the picture. |
|
|
577
|
+
| `aimAll`, `aimRects`, `aimReveal` | The aims of a stage: all of the picture, a group of boxes, and a selection. |
|
|
578
|
+
| `stackPictureContents` | One content from a list of contents. The last content is on top. |
|
|
502
579
|
| `frameRects` | The view for the first rectangle of a list that the area shows at a least zoom or more. |
|
|
503
580
|
| `showsRect` | True when a view shows all of a rectangle in an area. |
|
|
504
581
|
| `revealRects` | The view that shows a selection. It is the view of the camera when the selection is in view, so the camera stays. |
|
package/build/globe.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as StageContent } from "./stage-
|
|
2
|
-
import {
|
|
1
|
+
import { r as StageContent } from "./stage-D8JVM6wZ.js";
|
|
2
|
+
import { _ as ViewAngles, a as StageView, t as StageTheme } from "./theme-DBbBlCbC.js";
|
|
3
3
|
import { Raycaster } from "three";
|
|
4
4
|
import { LatLon, Region } from "@mark1russell7/geo";
|
|
5
5
|
import { Point3 } from "@mark1russell7/layout-contract";
|
package/build/graph.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { n as Highlight } from "./highlight-BJ6xGp6V.js";
|
|
1
2
|
import { Point, Rect } from "@mark1russell7/layout-contract";
|
|
2
3
|
/**
|
|
3
4
|
* The camera of a flat picture: a zoom and the position of the origin.
|
|
@@ -94,6 +95,24 @@ interface FitOptions {
|
|
|
94
95
|
* The middle of the rectangle is at the middle of the area. A rectangle with no size gets the largest zoom.
|
|
95
96
|
*/
|
|
96
97
|
export declare function fitRect(rect: Rect, area: Rect, options?: FitOptions): PictureView;
|
|
98
|
+
/**
|
|
99
|
+
* This function gives the limits of the zoom for a picture with the bounds `bounds`.
|
|
100
|
+
*
|
|
101
|
+
* The smallest zoom of the result shows all of the picture in the area, with a padding at each edge.
|
|
102
|
+
* A picture that fits at the smallest zoom of `limits` keeps `limits`. Thus a person can show all of a very large picture.
|
|
103
|
+
*/
|
|
104
|
+
export declare function zoomLimitsFor(bounds: Rect, area: Rect, limits?: ZoomLimits, padding?: number): ZoomLimits;
|
|
105
|
+
/** The length of a picture that stays in the free area when a person moves the picture, in CSS pixels. */
|
|
106
|
+
export declare const KEEP_IN_VIEW = 64;
|
|
107
|
+
/**
|
|
108
|
+
* This function gives the view that keeps a part of a rectangle of the picture in an area of the screen.
|
|
109
|
+
* A person who moves the picture then cannot lose it.
|
|
110
|
+
*
|
|
111
|
+
* `least` is the length of the rectangle that stays in the area on each axis, in CSS pixels.
|
|
112
|
+
* A rectangle that is smaller on the screen stays in the area fully. The zoom does not change.
|
|
113
|
+
* The result is `view` itself when the view keeps the rectangle.
|
|
114
|
+
*/
|
|
115
|
+
export declare function keepRect(view: PictureView, rect: Rect, area: Rect, least?: number): PictureView;
|
|
97
116
|
/** The options of `frameRects`. */
|
|
98
117
|
interface FrameOptions extends FitOptions {
|
|
99
118
|
/** The smallest zoom at which a person reads the content of a rectangle. */
|
|
@@ -155,6 +174,34 @@ interface PictureMoveStep {
|
|
|
155
174
|
* The move has a slow start and a slow end. A move with no duration is at its end immediately.
|
|
156
175
|
*/
|
|
157
176
|
export declare function pictureMoveAt(move: PictureMove, now: number): PictureMoveStep;
|
|
177
|
+
/** What an aim gets: the picture and the screen at the time of the aim. */
|
|
178
|
+
interface AimFrame {
|
|
179
|
+
/** The bounds of the content, in the unit of the picture. */
|
|
180
|
+
readonly bounds: Rect;
|
|
181
|
+
/** The free area of the picture on the screen, in CSS pixels. */
|
|
182
|
+
readonly area: Rect;
|
|
183
|
+
/** The view of the camera before the aim. */
|
|
184
|
+
readonly view: PictureView;
|
|
185
|
+
/** The limits of the zoom. */
|
|
186
|
+
readonly limits: ZoomLimits;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* An aim of the camera of a flat picture: a function that gives the view for a picture and a screen.
|
|
190
|
+
* A stage asks the aim again after a change of the size of the picture, so the view stays correct.
|
|
191
|
+
*/
|
|
192
|
+
type PictureAim = (frame: AimFrame) => PictureView;
|
|
193
|
+
/** This function makes the aim that shows all of the picture, as large as the free area permits. */
|
|
194
|
+
export declare function aimAll(options?: FitOptions): PictureAim;
|
|
195
|
+
/**
|
|
196
|
+
* This function makes the aim that shows a group of boxes at a zoom that a person reads.
|
|
197
|
+
* The rectangles are the bounds of the groups, the largest group first: `frameRects` selects one. An empty list keeps the view.
|
|
198
|
+
*/
|
|
199
|
+
export declare function aimRects(rects: readonly Rect[], options: FrameOptions): PictureAim;
|
|
200
|
+
/**
|
|
201
|
+
* This function makes the aim that shows a selection, and keeps the view when the selection is in view.
|
|
202
|
+
* The rectangles are the bounds of the groups of the selection, the largest group first: `revealRects` selects one.
|
|
203
|
+
*/
|
|
204
|
+
export declare function aimReveal(rects: readonly Rect[], options: RevealOptions): PictureAim;
|
|
158
205
|
/** What a key does on a flat picture: it moves the camera to a view, or it shows a view by its name. */
|
|
159
206
|
type PictureKeyAction = {
|
|
160
207
|
readonly type: "move";
|
|
@@ -224,5 +271,147 @@ interface PointerUpResult {
|
|
|
224
271
|
export declare function pointerUp(pointers: Pointers, id: number, at: Point, limit?: number): PointerUpResult;
|
|
225
272
|
/** This function gives the pointers after the browser stopped a pointer, for example for a gesture of the system. It makes no click. */
|
|
226
273
|
export declare function pointerCancel(pointers: Pointers, id: number): Pointers;
|
|
227
|
-
|
|
274
|
+
/** The record below the pointer of a flat picture: its name, and the value that the content gives for it. */
|
|
275
|
+
interface PicturePick<P> {
|
|
276
|
+
/** The name of the record. The highlights of the stage use this name. */
|
|
277
|
+
readonly record: string;
|
|
278
|
+
/** The value of the record for the page, for example its kind and its source. */
|
|
279
|
+
readonly value: P;
|
|
280
|
+
}
|
|
281
|
+
/** The position of a pointer on a flat picture, for the pick of a content. */
|
|
282
|
+
interface PickAt {
|
|
283
|
+
/** The point of the picture below the pointer. */
|
|
284
|
+
readonly point: Point;
|
|
285
|
+
/** The position of the pointer on the screen, in CSS pixels from the top left corner of the picture. */
|
|
286
|
+
readonly screen: Point;
|
|
287
|
+
/** The view of the camera. */
|
|
288
|
+
readonly view: PictureView;
|
|
289
|
+
/** The distance from the pointer at which a thin part is below the pointer, in CSS pixels. A finger has a larger distance than a mouse. */
|
|
290
|
+
readonly slack: number;
|
|
291
|
+
}
|
|
292
|
+
/** One picture of a flat stage, for the drawing of its content. */
|
|
293
|
+
interface PictureFrame {
|
|
294
|
+
/** The view of the camera. */
|
|
295
|
+
readonly view: PictureView;
|
|
296
|
+
/** The width of the picture, in CSS pixels. */
|
|
297
|
+
readonly width: number;
|
|
298
|
+
/** The height of the picture, in CSS pixels. */
|
|
299
|
+
readonly height: number;
|
|
300
|
+
/** The part of the picture that the page does not cover, in CSS pixels. */
|
|
301
|
+
readonly area: Rect;
|
|
302
|
+
/** The number of pixels of the canvas for one CSS pixel. */
|
|
303
|
+
readonly pixelRatio: number;
|
|
304
|
+
/** The time since the last picture, in seconds. */
|
|
305
|
+
readonly seconds: number;
|
|
306
|
+
/**
|
|
307
|
+
* This value is true for the first picture of a content, and for a person who asks for less motion.
|
|
308
|
+
* Each change then has no time: the content sets each value to its goal immediately.
|
|
309
|
+
*/
|
|
310
|
+
readonly settle: boolean;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* The content of a flat stage: what the stage draws, and what the stage asks of it.
|
|
314
|
+
* `P` is the type of the value of a pick, and `T` is the type of the theme.
|
|
315
|
+
*/
|
|
316
|
+
interface PictureContent<P, T> {
|
|
317
|
+
/** The bounds of the content, in the unit of the picture. The views and the limits of the camera come from them. */
|
|
318
|
+
readonly bounds: Rect;
|
|
319
|
+
/** This function tells if the content has a record with a name. */
|
|
320
|
+
has(record: string): boolean;
|
|
321
|
+
/** This function gives the record below a pointer, or `undefined` for no record. */
|
|
322
|
+
pick(at: PickAt): PicturePick<P> | undefined;
|
|
323
|
+
/**
|
|
324
|
+
* This function draws the content on a clear canvas. The unit of the context is the CSS pixel: the view is in the frame.
|
|
325
|
+
* `highlight` gives the highlight of a record. The function gives true while a part continues to change.
|
|
326
|
+
* The stage then makes the next picture.
|
|
327
|
+
*/
|
|
328
|
+
draw(context: CanvasRenderingContext2D, frame: PictureFrame, theme: T, highlight: (record: string) => Highlight): boolean;
|
|
329
|
+
/** This function releases what the content keeps, for example its images. */
|
|
330
|
+
dispose?(): void;
|
|
331
|
+
}
|
|
332
|
+
/** The options of a flat stage. */
|
|
333
|
+
interface PictureStageOptions<P, T> {
|
|
334
|
+
/** The first content. The stage disposes each content that it gets. */
|
|
335
|
+
readonly content: PictureContent<P, T>;
|
|
336
|
+
readonly theme: T;
|
|
337
|
+
/** The name of the picture for a screen reader. */
|
|
338
|
+
readonly label: string;
|
|
339
|
+
/** The views of the stage, each with a name. The view `all` shows all of the picture, if the options do not give a different one. */
|
|
340
|
+
readonly views?: Readonly<Record<string, PictureAim>> | undefined;
|
|
341
|
+
/** The name of the first view. The keys `Home` and `0` show it. The default is `all`. */
|
|
342
|
+
readonly home?: string | undefined;
|
|
343
|
+
/** The name of the view of a key, for example `{ f: "focus" }`. A letter has no case. */
|
|
344
|
+
readonly keys?: Readonly<Record<string, string>> | undefined;
|
|
345
|
+
/** The limits of the zoom. The default is `ZOOM_LIMITS`. A very large picture gets a smaller least zoom, so a person can show all of it. */
|
|
346
|
+
readonly limits?: ZoomLimits | undefined;
|
|
347
|
+
/** The parts of the picture that the page covers, from each edge, in CSS pixels. */
|
|
348
|
+
readonly insets?: Partial<Insets> | undefined;
|
|
349
|
+
/**
|
|
350
|
+
* When the wheel changes the zoom. With `in-use`, the wheel moves the page until a person uses the picture.
|
|
351
|
+
* With `always`, the wheel changes the zoom at each time. The default is `in-use`. A pinch on a touch pad changes the zoom always.
|
|
352
|
+
*/
|
|
353
|
+
readonly wheel?: "always" | "in-use" | undefined;
|
|
354
|
+
/** The stage starts this function when the pointer goes to a different record, or to no record. */
|
|
355
|
+
readonly onHover?: ((pick: P | undefined) => void) | undefined;
|
|
356
|
+
/** The stage starts this function when a person selects a record with the pointer, or selects no record. */
|
|
357
|
+
readonly onSelect?: ((pick: P | undefined) => void) | undefined;
|
|
358
|
+
/** The stage starts this function after a change of the view, one time for each picture at most. */
|
|
359
|
+
readonly onView?: ((view: PictureView) => void) | undefined;
|
|
360
|
+
}
|
|
361
|
+
/** A flat stage in a page: one canvas with a camera that a person moves, and one content. */
|
|
362
|
+
interface PictureStage<P, T> {
|
|
363
|
+
/** The canvas of the stage. It is in the container. */
|
|
364
|
+
readonly canvas: HTMLCanvasElement;
|
|
365
|
+
/** This function shows a different content, and disposes the old content. The view stays if a person moved it. */
|
|
366
|
+
setContent(content: PictureContent<P, T>): void;
|
|
367
|
+
/** This function changes the colors. */
|
|
368
|
+
setTheme(theme: T): void;
|
|
369
|
+
/** This function moves the camera to a view: a name of the options, or an aim. `animate` has the default true. */
|
|
370
|
+
setView(view: string | PictureAim, animate?: boolean): void;
|
|
371
|
+
/** This function tells the stage which parts of the picture the page covers. The camera goes to its view again if no person moved it. */
|
|
372
|
+
setInsets(insets: Partial<Insets>): void;
|
|
373
|
+
/** This function gives the view of the camera. */
|
|
374
|
+
view(): PictureView;
|
|
375
|
+
/** This function gives the part of the picture that the page does not cover, in CSS pixels. */
|
|
376
|
+
area(): Rect;
|
|
377
|
+
/** This function changes the zoom by a factor, at the middle of the free area. Use it for the buttons of a page. `animate` has the default true. */
|
|
378
|
+
zoomBy(factor: number, animate?: boolean): void;
|
|
379
|
+
/** This function highlights records by their names, as the pointer does. An empty list removes the highlights. */
|
|
380
|
+
highlight(records: readonly string[]): void;
|
|
381
|
+
/** This function selects one record by its name, or no record. It does not start `onSelect`. */
|
|
382
|
+
select(record: string | undefined): void;
|
|
383
|
+
/** This function makes a new picture. Use it after a change of the content. */
|
|
384
|
+
refresh(): void;
|
|
385
|
+
/** This function removes the canvas, and disposes the content. */
|
|
386
|
+
dispose(): void;
|
|
387
|
+
}
|
|
388
|
+
/** The distance from a mouse at which a thin part is below the pointer, in CSS pixels. */
|
|
389
|
+
export declare const PICK_SLACK = 5;
|
|
390
|
+
/** The distance from a finger or a pen at which a thin part is below the pointer, in CSS pixels. */
|
|
391
|
+
export declare const TOUCH_PICK_SLACK = 12;
|
|
392
|
+
/** The factor of the zoom for a double click. */
|
|
393
|
+
export declare const DOUBLE_CLICK_ZOOM = 2;
|
|
394
|
+
/**
|
|
395
|
+
* This function makes a flat stage in a container of a page. The stage fills the container, so give the container a size.
|
|
396
|
+
*
|
|
397
|
+
* A person moves the picture with a drag, and changes the zoom with the wheel, with two fingers or with a double click.
|
|
398
|
+
* A click selects the record below the pointer. With the keyboard, the arrow keys move the camera, `+` and `-` change the zoom,
|
|
399
|
+
* and `Home` shows the first view. The stage makes a picture only after a change.
|
|
400
|
+
*
|
|
401
|
+
* The function gives `undefined` when the browser gives no 2D context for a canvas. It does not throw.
|
|
402
|
+
*/
|
|
403
|
+
export declare function createPictureStage<P, T>(container: HTMLElement, options: PictureStageOptions<P, T>): PictureStage<P, T> | undefined;
|
|
404
|
+
/**
|
|
405
|
+
* This function makes one content from a list of contents, for a flat stage that shows them together.
|
|
406
|
+
* An example is a layer of boxes below a layer of routes and a layer of labels.
|
|
407
|
+
*
|
|
408
|
+
* - The first content gives the bounds: the views and the limits of the camera come from it.
|
|
409
|
+
* - The stack draws the contents in their sequence, so the last content is on top.
|
|
410
|
+
* - A pick asks the last content first. The first record that a content gives is the record.
|
|
411
|
+
* - A record that two contents have is one record: each of them gets its highlight.
|
|
412
|
+
* - A content does not get the state of the canvas of an earlier content: the stack restores it.
|
|
413
|
+
* - The stage disposes the stack, and the stack disposes each content.
|
|
414
|
+
*/
|
|
415
|
+
export declare function stackPictureContents<P, T>(contents: readonly [PictureContent<P, T>, ...PictureContent<P, T>[]]): PictureContent<P, T>;
|
|
416
|
+
export type { AimFrame, FitOptions, FrameOptions, Insets, PickAt, PictureAim, PictureContent, PictureFrame, PictureKeyAction, PictureKeyOptions, PictureMove, PictureMoveStep, PicturePick, PictureStage, PictureStageOptions, PictureView, PointerMoveResult, PointerPair, PointerUpResult, Pointers, RevealOptions, ZoomLimits };
|
|
228
417
|
//# sourceMappingURL=graph.d.ts.map
|
package/build/graph.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.d.ts","names":[],"sources":["../src/graph/camera.ts","../src/graph/keys.ts","../src/graph/pointers.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"graph.d.ts","names":[],"sources":["../src/graph/camera.ts","../src/graph/aim.ts","../src/graph/keys.ts","../src/graph/pointers.ts","../src/graph/stage.ts","../src/graph/stack.ts"],"mappings":";;;;;;UAOiB;;WAEN;;WAEA;;WAEA;;;UAIM;WACN;WACA;;;qBAIE,aAAa;;qBAGb,WAAW;;wBAGR,UAAU,WAAW,SAAQ;;wBAK7B,UAAU,MAAM,aAAa,QAAQ,QAAQ;;wBAK7C,SAAS,MAAM,aAAa,OAAO,QAAQ;;wBAK3C,aAAa,MAAM,aAAa,MAAM,OAAO;;wBAK7C,OAAO,OAAO,OAAO,IAAI,OAAO,YAAY;;wBAK5C,QAAQ,MAAM,aAAa,YAAY,aAAa;;;;;wB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