@ac-kit/graphics-view 0.0.0-stage → 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/CHANGELOG.md +80 -0
- package/LICENSE +28 -0
- package/README.md +206 -2
- package/dist/camera/camera3.d.ts +17 -0
- package/dist/camera/camera3.d.ts.map +1 -0
- package/dist/camera/camera3.js +2 -0
- package/dist/camera/camera3.js.map +1 -0
- package/dist/camera/look-around-camera.d.ts +110 -0
- package/dist/camera/look-around-camera.d.ts.map +1 -0
- package/dist/camera/look-around-camera.js +220 -0
- package/dist/camera/look-around-camera.js.map +1 -0
- package/dist/camera/orbit-camera.d.ts +102 -0
- package/dist/camera/orbit-camera.d.ts.map +1 -0
- package/dist/camera/orbit-camera.js +252 -0
- package/dist/camera/orbit-camera.js.map +1 -0
- package/dist/dom/_inertia-input.d.ts +35 -0
- package/dist/dom/_inertia-input.d.ts.map +1 -0
- package/dist/dom/_inertia-input.js +121 -0
- package/dist/dom/_inertia-input.js.map +1 -0
- package/dist/dom/bind-look-around-input.d.ts +54 -0
- package/dist/dom/bind-look-around-input.d.ts.map +1 -0
- package/dist/dom/bind-look-around-input.js +111 -0
- package/dist/dom/bind-look-around-input.js.map +1 -0
- package/dist/dom/bind-orbit-input.d.ts +47 -0
- package/dist/dom/bind-orbit-input.d.ts.map +1 -0
- package/dist/dom/bind-orbit-input.js +118 -0
- package/dist/dom/bind-orbit-input.js.map +1 -0
- package/dist/dom/bind-view2-input.d.ts +60 -0
- package/dist/dom/bind-view2-input.d.ts.map +1 -0
- package/dist/dom/bind-view2-input.js +164 -0
- package/dist/dom/bind-view2-input.js.map +1 -0
- package/dist/dom/index.d.ts +4 -0
- package/dist/dom/index.d.ts.map +1 -0
- package/dist/dom/index.js +4 -0
- package/dist/dom/index.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/view2/interpolate-view2-frame.d.ts +13 -0
- package/dist/view2/interpolate-view2-frame.d.ts.map +1 -0
- package/dist/view2/interpolate-view2-frame.js +30 -0
- package/dist/view2/interpolate-view2-frame.js.map +1 -0
- package/dist/view2/view2.d.ts +195 -0
- package/dist/view2/view2.d.ts.map +1 -0
- package/dist/view2/view2.js +445 -0
- package/dist/view2/view2.js.map +1 -0
- package/dist/view3/_projection.d.ts +20 -0
- package/dist/view3/_projection.d.ts.map +1 -0
- package/dist/view3/_projection.js +43 -0
- package/dist/view3/_projection.js.map +1 -0
- package/dist/view3/choose-depth-range.d.ts +25 -0
- package/dist/view3/choose-depth-range.d.ts.map +1 -0
- package/dist/view3/choose-depth-range.js +22 -0
- package/dist/view3/choose-depth-range.js.map +1 -0
- package/dist/view3/view3.d.ts +145 -0
- package/dist/view3/view3.d.ts.map +1 -0
- package/dist/view3/view3.js +306 -0
- package/dist/view3/view3.js.map +1 -0
- package/package.json +76 -3
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { assertPositive, } from "@ac-kit/core";
|
|
2
|
+
import { bindTransformGesture, } from "@ac-kit/ui-gesture/dom";
|
|
3
|
+
import { bindInertia_ } from "./_inertia-input.js";
|
|
4
|
+
const DEFAULT_KEY_PAN_PIXELS_ = 16;
|
|
5
|
+
const DEFAULT_KEY_ZOOM_FACTOR_ = 2;
|
|
6
|
+
const DEFAULT_DOUBLE_TAP_ZOOM_FACTOR_ = 2;
|
|
7
|
+
const allowsX_ = (axes) => axes === "xy" || axes === "x";
|
|
8
|
+
const allowsY_ = (axes) => axes === "xy" || axes === "y";
|
|
9
|
+
/**
|
|
10
|
+
* Pan, pinch, twist, wheel, trackpad, keys and double tap on a `View2`, on a
|
|
11
|
+
* focusable element styled `touch-action: none` (`pan-x pan-y pinch-zoom` when
|
|
12
|
+
* `cooperative`). Zoom is about the pointer, or the centre of the view for
|
|
13
|
+
* keys; ArrowRight reveals what lies to the right, as map viewers do. Changes
|
|
14
|
+
* are applied to the view, then `onChange` is called once per input event, and
|
|
15
|
+
* once per frame of an inertia.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* using binding = bindView2Input(canvas, view, {
|
|
19
|
+
* onChange: () => scheduler.invalidate(),
|
|
20
|
+
* inertia: true,
|
|
21
|
+
* signal,
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* @throws {RangeError} For a non-positive or non-finite step or factor, or
|
|
25
|
+
* unusable inertia options.
|
|
26
|
+
* @throws {TypeError} For inertia on an element with no window and no `frames`.
|
|
27
|
+
*/
|
|
28
|
+
export function bindView2Input(element, view, options) {
|
|
29
|
+
const { onChange, rotate = false, zoomAxes = "xy", panAxes = "xy", wheel = "zoom", keyPanPixels = DEFAULT_KEY_PAN_PIXELS_, keyZoomFactor = DEFAULT_KEY_ZOOM_FACTOR_, doubleTapZoomFactor = DEFAULT_DOUBLE_TAP_ZOOM_FACTOR_, signal, } = options;
|
|
30
|
+
assertPositive(keyPanPixels, "keyPanPixels");
|
|
31
|
+
assertPositive(keyZoomFactor, "keyZoomFactor");
|
|
32
|
+
assertPositive(doubleTapZoomFactor, "doubleTapZoomFactor");
|
|
33
|
+
const lifetime = new AbortController();
|
|
34
|
+
const stop = signal === undefined
|
|
35
|
+
? lifetime.signal
|
|
36
|
+
: AbortSignal.any([signal, lifetime.signal]);
|
|
37
|
+
const panX = allowsX_(panAxes);
|
|
38
|
+
const panY = allowsY_(panAxes);
|
|
39
|
+
const zoomX = allowsX_(zoomAxes);
|
|
40
|
+
const zoomY = allowsY_(zoomAxes);
|
|
41
|
+
const pan = (deltaX, deltaY) => {
|
|
42
|
+
const x = panX ? deltaX : 0;
|
|
43
|
+
const y = panY ? deltaY : 0;
|
|
44
|
+
if (x === 0 && y === 0) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
view.panBy(x, y);
|
|
48
|
+
return true;
|
|
49
|
+
};
|
|
50
|
+
const zoom = (factor, x, y) => {
|
|
51
|
+
if (factor === 1 || (!zoomX && !zoomY)) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
if (zoomX && zoomY) {
|
|
55
|
+
view.zoomAbout(factor, x, y);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
view.zoomAxesAbout(zoomX ? factor : 1, zoomY ? factor : 1, x, y);
|
|
59
|
+
}
|
|
60
|
+
return true;
|
|
61
|
+
};
|
|
62
|
+
const turn = (radians, x, y) => {
|
|
63
|
+
if (!rotate || radians === 0) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
view.rotateAbout(radians, x, y);
|
|
67
|
+
return true;
|
|
68
|
+
};
|
|
69
|
+
// The binding cancels the page's wheel and keys only where one acts: a step
|
|
70
|
+
// that moves the view along an enabled axis, zooms or turns it.
|
|
71
|
+
const canMove = panX || panY || zoomX || zoomY;
|
|
72
|
+
const handlesWheel = wheel === "zoom" ? zoomX || zoomY : canMove;
|
|
73
|
+
const movesView = (step) => (panX && step.deltaX !== 0) ||
|
|
74
|
+
(panY && step.deltaY !== 0) ||
|
|
75
|
+
((zoomX || zoomY) && step.scaleFactor !== 1) ||
|
|
76
|
+
(rotate && step.rotationDelta !== 0);
|
|
77
|
+
const keyMovesView = (step) => step.kind === "zoom"
|
|
78
|
+
? zoomX || zoomY
|
|
79
|
+
: (panX && step.x !== 0) || (panY && step.y !== 0);
|
|
80
|
+
const inertia = bindInertia_(element, {
|
|
81
|
+
inertia: options.inertia,
|
|
82
|
+
frames: options.frames,
|
|
83
|
+
axes: { x: panX, y: panY },
|
|
84
|
+
pan: pan,
|
|
85
|
+
onChange,
|
|
86
|
+
signal: stop,
|
|
87
|
+
});
|
|
88
|
+
const binding = bindTransformGesture(element, {
|
|
89
|
+
onTransform: (update) => {
|
|
90
|
+
inertia?.track(update);
|
|
91
|
+
if (update.phase === "cancel") {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const panned = pan(update.deltaX, update.deltaY);
|
|
95
|
+
const zoomed = zoom(update.scaleFactor, update.originX, update.originY);
|
|
96
|
+
const turned = turn(update.rotationDelta, update.originX, update.originY);
|
|
97
|
+
if (panned || zoomed || turned) {
|
|
98
|
+
onChange();
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
onStep: !handlesWheel
|
|
102
|
+
? undefined
|
|
103
|
+
: (step) => {
|
|
104
|
+
inertia?.stop();
|
|
105
|
+
const panned = pan(step.deltaX, step.deltaY);
|
|
106
|
+
const zoomed = zoom(step.scaleFactor, step.originX, step.originY);
|
|
107
|
+
const turned = turn(step.rotationDelta, step.originX, step.originY);
|
|
108
|
+
if (panned || zoomed || turned) {
|
|
109
|
+
onChange();
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
onKeyStep: !canMove
|
|
113
|
+
? undefined
|
|
114
|
+
: (step) => {
|
|
115
|
+
inertia?.stop();
|
|
116
|
+
const changed = step.kind === "pan"
|
|
117
|
+
? // The view moves towards the arrow: the content the other way.
|
|
118
|
+
pan(-step.x * keyPanPixels, -step.y * keyPanPixels)
|
|
119
|
+
: zoom(keyZoomFactor ** step.direction, view.width / 2, view.height / 2);
|
|
120
|
+
if (changed) {
|
|
121
|
+
onChange();
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
onTap: options.onTap === undefined
|
|
125
|
+
? undefined
|
|
126
|
+
: (tap) => {
|
|
127
|
+
inertia?.stop();
|
|
128
|
+
options.onTap?.(tap);
|
|
129
|
+
},
|
|
130
|
+
onDoubleTap: doubleTapZoomFactor === 1 || !(zoomX || zoomY)
|
|
131
|
+
? undefined
|
|
132
|
+
: (tap) => {
|
|
133
|
+
inertia?.stop();
|
|
134
|
+
if (zoom(doubleTapZoomFactor, tap.x, tap.y)) {
|
|
135
|
+
onChange();
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
onCooperativeHint: options.onCooperativeHint,
|
|
139
|
+
onHover: options.onHover === undefined
|
|
140
|
+
? undefined
|
|
141
|
+
: (sample) => options.onHover?.(sample),
|
|
142
|
+
onHoverEnd: options.onHoverEnd === undefined
|
|
143
|
+
? undefined
|
|
144
|
+
: () => options.onHoverEnd?.(),
|
|
145
|
+
}, {
|
|
146
|
+
buttons: [0],
|
|
147
|
+
maxPointers: 2,
|
|
148
|
+
focusOnPress: true,
|
|
149
|
+
coordinates: "element",
|
|
150
|
+
cooperative: options.cooperative,
|
|
151
|
+
accept: options.accept,
|
|
152
|
+
wheel: { action: wheel },
|
|
153
|
+
acceptStep: movesView,
|
|
154
|
+
acceptKeyStep: keyMovesView,
|
|
155
|
+
signal: stop,
|
|
156
|
+
});
|
|
157
|
+
return {
|
|
158
|
+
[Symbol.dispose]: () => {
|
|
159
|
+
lifetime.abort();
|
|
160
|
+
binding[Symbol.dispose]();
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=bind-view2-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bind-view2-input.js","sourceRoot":"","sources":["../../src/dom/bind-view2-input.ts"],"names":[],"mappings":"AACA,OAAO,EAIN,cAAc,GACd,MAAM,cAAc,CAAC;AAStB,OAAO,EACN,oBAAoB,GAGpB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAsCnD,MAAM,uBAAuB,GAAG,EAAE,CAAC;AACnC,MAAM,wBAAwB,GAAG,CAAC,CAAC;AACnC,MAAM,+BAA+B,GAAG,CAAC,CAAC;AAE1C,MAAM,QAAQ,GAAG,CAAC,IAAe,EAAW,EAAE,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,GAAG,CAAC;AAC7E,MAAM,QAAQ,GAAG,CAAC,IAAe,EAAW,EAAE,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,GAAG,CAAC;AAE7E;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,cAAc,CAC7B,OAAuB,EACvB,IAAW,EACX,OAA0B;IAE1B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,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE;YACtB,QAAQ,CAAC,KAAK,EAAE,CAAC;YACjB,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,CAAC;KACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dom/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/dom/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./camera/camera3.js";
|
|
2
|
+
export * from "./camera/look-around-camera.js";
|
|
3
|
+
export * from "./camera/orbit-camera.js";
|
|
4
|
+
export * from "./view2/interpolate-view2-frame.js";
|
|
5
|
+
export * from "./view2/view2.js";
|
|
6
|
+
export * from "./view3/choose-depth-range.js";
|
|
7
|
+
export * from "./view3/view3.js";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kBAAkB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./camera/camera3.js";
|
|
2
|
+
export * from "./camera/look-around-camera.js";
|
|
3
|
+
export * from "./camera/orbit-camera.js";
|
|
4
|
+
export * from "./view2/interpolate-view2-frame.js";
|
|
5
|
+
export * from "./view2/view2.js";
|
|
6
|
+
export * from "./view3/choose-depth-range.js";
|
|
7
|
+
export * from "./view3/view3.js";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { View2Frame } from "./view2.js";
|
|
2
|
+
/**
|
|
3
|
+
* Between two frames: centre linearly, scale geometrically (so a zoom feels
|
|
4
|
+
* constant-rate), rotation along the shorter arc (the positive one when they
|
|
5
|
+
* are half a turn apart). `t` is clamped to [0, 1]; `0` gives a copy of `a` and
|
|
6
|
+
* `1` a copy of `b`, exactly, and in between each component stays inside its
|
|
7
|
+
* two ends (finite even from −1e308 to 1e308) and never moves away from the end
|
|
8
|
+
* it heads to. Allocates the result. The frames are taken as valid (finite,
|
|
9
|
+
* positive scales), as `View2.setFrame` checks them; a `NaN` in a frame or in
|
|
10
|
+
* `t` gives `NaN` components, and nothing throws.
|
|
11
|
+
*/
|
|
12
|
+
export declare function interpolateView2Frame(a: View2Frame, b: View2Frame, t: number): View2Frame;
|
|
13
|
+
//# sourceMappingURL=interpolate-view2-frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interpolate-view2-frame.d.ts","sourceRoot":"","sources":["../../src/view2/interpolate-view2-frame.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACpC,CAAC,EAAE,UAAU,EACb,CAAC,EAAE,UAAU,EACb,CAAC,EAAE,MAAM,GACP,UAAU,CAqBZ"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { clamp } from "@ac-kit/core";
|
|
2
|
+
import { vec2Of } from "@ac-kit/math-linear";
|
|
3
|
+
import { angleLerpRad, lerpBounded, lerpGeometric } from "@ac-kit/math-scalar";
|
|
4
|
+
/**
|
|
5
|
+
* Between two frames: centre linearly, scale geometrically (so a zoom feels
|
|
6
|
+
* constant-rate), rotation along the shorter arc (the positive one when they
|
|
7
|
+
* are half a turn apart). `t` is clamped to [0, 1]; `0` gives a copy of `a` and
|
|
8
|
+
* `1` a copy of `b`, exactly, and in between each component stays inside its
|
|
9
|
+
* two ends (finite even from −1e308 to 1e308) and never moves away from the end
|
|
10
|
+
* it heads to. Allocates the result. The frames are taken as valid (finite,
|
|
11
|
+
* positive scales), as `View2.setFrame` checks them; a `NaN` in a frame or in
|
|
12
|
+
* `t` gives `NaN` components, and nothing throws.
|
|
13
|
+
*/
|
|
14
|
+
export function interpolateView2Frame(a, b, t) {
|
|
15
|
+
const factor = clamp(t, 0, 1);
|
|
16
|
+
if (factor === 0 || factor === 1) {
|
|
17
|
+
const end = factor === 0 ? a : b;
|
|
18
|
+
return {
|
|
19
|
+
center: vec2Of(end.center[0], end.center[1]),
|
|
20
|
+
scale: vec2Of(end.scale[0], end.scale[1]),
|
|
21
|
+
rotation: end.rotation,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
center: vec2Of(lerpBounded(a.center[0], b.center[0], factor), lerpBounded(a.center[1], b.center[1], factor)),
|
|
26
|
+
scale: vec2Of(lerpGeometric(a.scale[0], b.scale[0], factor), lerpGeometric(a.scale[1], b.scale[1], factor)),
|
|
27
|
+
rotation: angleLerpRad(a.rotation, b.rotation, factor),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=interpolate-view2-frame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interpolate-view2-frame.js","sourceRoot":"","sources":["../../src/view2/interpolate-view2-frame.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAI/E;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CACpC,CAAa,EACb,CAAa,EACb,CAAS;IAET,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9B,IAAI,MAAM,KAAK,CAAC,IAAI,MAAM,KAAK,CAAC,EAAE,CAAC;QAClC,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACjC,OAAO;YACN,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAC5C,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACzC,QAAQ,EAAE,GAAG,CAAC,QAAQ;SACtB,CAAC;IACH,CAAC;IACD,OAAO;QACN,MAAM,EAAE,MAAM,CACb,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAC7C,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAC7C;QACD,KAAK,EAAE,MAAM,CACZ,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAC7C,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAC7C;QACD,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC;KACtD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { type Box2, type ReadonlyBox2 } from "@ac-kit/math-geometry";
|
|
2
|
+
import { type Affine2, type Mat4x4, type ReadonlyVec2, type Vec2 } from "@ac-kit/math-linear";
|
|
3
|
+
/** Which way the world's y axis points on screen. */
|
|
4
|
+
export type View2YAxis = "up" | "down";
|
|
5
|
+
/** How `bounds` restrains the view. */
|
|
6
|
+
export type View2BoundsMode =
|
|
7
|
+
/** The view's centre stays inside the bounds. */
|
|
8
|
+
"center"
|
|
9
|
+
/**
|
|
10
|
+
* The visible area stays inside the bounds on each axis where it fits, and is
|
|
11
|
+
* centred on them where it does not.
|
|
12
|
+
*/
|
|
13
|
+
| "inside";
|
|
14
|
+
export type View2Options = {
|
|
15
|
+
/** World point at the centre of the viewport. Default [0, 0]. */
|
|
16
|
+
readonly center?: ReadonlyVec2;
|
|
17
|
+
/** Screen pixels per world unit, one value or one per axis. Default 1. */
|
|
18
|
+
readonly scale?: number | ReadonlyVec2;
|
|
19
|
+
/**
|
|
20
|
+
* Radians, positive clockwise on screen (ui-gesture's `rotationDelta`).
|
|
21
|
+
* Default 0.
|
|
22
|
+
*/
|
|
23
|
+
readonly rotation?: number;
|
|
24
|
+
/** Default `"up"` (charts, maps); `"down"` for images and diagrams. */
|
|
25
|
+
readonly yAxis?: View2YAxis;
|
|
26
|
+
/** Viewport size in screen pixels. Default 0 × 0 until `setViewport`. */
|
|
27
|
+
readonly width?: number;
|
|
28
|
+
readonly height?: number;
|
|
29
|
+
/** Scale range per axis, screen pixels per world unit. Default (0, ∞). */
|
|
30
|
+
readonly scaleLimits?: {
|
|
31
|
+
readonly x?: readonly [min: number, max: number];
|
|
32
|
+
readonly y?: readonly [min: number, max: number];
|
|
33
|
+
};
|
|
34
|
+
/** World box the view is kept over. Default: none. */
|
|
35
|
+
readonly bounds?: ReadonlyBox2;
|
|
36
|
+
/** Default `"center"`. */
|
|
37
|
+
readonly boundsMode?: View2BoundsMode;
|
|
38
|
+
/**
|
|
39
|
+
* Whether rotation is allowed at all; `rotateAbout` is a no-op when false.
|
|
40
|
+
* Default false.
|
|
41
|
+
*/
|
|
42
|
+
readonly rotatable?: boolean;
|
|
43
|
+
};
|
|
44
|
+
/** A view's state as one value, for animation and persistence. */
|
|
45
|
+
export type View2Frame = {
|
|
46
|
+
readonly center: ReadonlyVec2;
|
|
47
|
+
readonly scale: ReadonlyVec2;
|
|
48
|
+
readonly rotation: number;
|
|
49
|
+
};
|
|
50
|
+
export type View2FitOptions = {
|
|
51
|
+
/** Screen pixels kept free around the box: one value, or per side. Default 0. */
|
|
52
|
+
readonly padding?: number | {
|
|
53
|
+
readonly top: number;
|
|
54
|
+
readonly right: number;
|
|
55
|
+
readonly bottom: number;
|
|
56
|
+
readonly left: number;
|
|
57
|
+
};
|
|
58
|
+
/** The same scale on both axes (the box's aspect kept). Default true. */
|
|
59
|
+
readonly keepAspect?: boolean;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* A 2D view: which world area a viewport shows. Changes come in screen pixels
|
|
63
|
+
* (pans, zooms and turns about a screen point, as gestures produce them) and
|
|
64
|
+
* are clamped by the scale limits and the bounds after each call. The
|
|
65
|
+
* world-to-screen map is `T(viewport centre) · R(rotation) · S(scale) ·
|
|
66
|
+
* F(yAxis) · T(−center)`. O(1) per call; no allocation after construction
|
|
67
|
+
* except `getFrame`.
|
|
68
|
+
*
|
|
69
|
+
* The state is always finite with positive scales: a call whose result would
|
|
70
|
+
* not be (a non-finite argument, a zoom that overflows) changes nothing.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* const view = new View2({ yAxis: "up", width: 800, height: 600 });
|
|
74
|
+
* view.fit(box2FromXywh(box2Create(), 0, 0, 100, 50), { padding: 24 });
|
|
75
|
+
* view.zoomAbout(2, 400, 300);
|
|
76
|
+
* context.setTransform(
|
|
77
|
+
* ...view.getWorldToScreen(affine2Create(), devicePixelRatio),
|
|
78
|
+
* ); // Canvas 2D
|
|
79
|
+
*/
|
|
80
|
+
export declare class View2 {
|
|
81
|
+
private centerX_;
|
|
82
|
+
private centerY_;
|
|
83
|
+
private scaleX_;
|
|
84
|
+
private scaleY_;
|
|
85
|
+
private rotation_;
|
|
86
|
+
private cos_;
|
|
87
|
+
private sin_;
|
|
88
|
+
private width_;
|
|
89
|
+
private height_;
|
|
90
|
+
private version_;
|
|
91
|
+
private readonly flip_;
|
|
92
|
+
private readonly yAxis_;
|
|
93
|
+
private readonly limitsX_;
|
|
94
|
+
private readonly limitsY_;
|
|
95
|
+
private readonly bounds_;
|
|
96
|
+
private readonly boundsMode_;
|
|
97
|
+
private readonly rotatable_;
|
|
98
|
+
/**
|
|
99
|
+
* @throws {RangeError} For a non-finite or non-positive scale, limits not
|
|
100
|
+
* ordered, a non-finite center, rotation or size, or an empty or non-finite
|
|
101
|
+
* bounds box.
|
|
102
|
+
*/
|
|
103
|
+
constructor(options?: View2Options);
|
|
104
|
+
/** Increases on each change of the frame or the viewport. */
|
|
105
|
+
get version(): number;
|
|
106
|
+
get width(): number;
|
|
107
|
+
get height(): number;
|
|
108
|
+
get rotation(): number;
|
|
109
|
+
get yAxis(): View2YAxis;
|
|
110
|
+
getCenter(out: Vec2): Vec2;
|
|
111
|
+
getScale(out: Vec2): Vec2;
|
|
112
|
+
/** Allocates. */
|
|
113
|
+
getFrame(): View2Frame;
|
|
114
|
+
/**
|
|
115
|
+
* Resizes the viewport, keeping the world point at its centre.
|
|
116
|
+
*
|
|
117
|
+
* @throws {RangeError} For a negative or non-finite size.
|
|
118
|
+
*/
|
|
119
|
+
setViewport(width: number, height: number): void;
|
|
120
|
+
/**
|
|
121
|
+
* Sets the frame, then applies the scale limits and the bounds.
|
|
122
|
+
*
|
|
123
|
+
* @throws {RangeError} For non-finite values or a non-positive scale.
|
|
124
|
+
*/
|
|
125
|
+
setFrame(frame: View2Frame): void;
|
|
126
|
+
/**
|
|
127
|
+
* Moves the content by screen pixels (right and down positive). A non-finite
|
|
128
|
+
* delta changes nothing.
|
|
129
|
+
*/
|
|
130
|
+
panBy(deltaX: number, deltaY: number): void;
|
|
131
|
+
/**
|
|
132
|
+
* Scales both axes by `factor` (> 1 zooms in), keeping screen point (x, y)
|
|
133
|
+
* fixed, and the aspect ratio unless the limits of an axis stop it first. A
|
|
134
|
+
* factor that is not finite and positive, or a non-finite point, changes
|
|
135
|
+
* nothing.
|
|
136
|
+
*/
|
|
137
|
+
zoomAbout(factor: number, x: number, y: number): void;
|
|
138
|
+
/**
|
|
139
|
+
* Per-axis zoom in world axes, keeping (x, y) fixed: a time axis zoomed
|
|
140
|
+
* alone. A factor that is not finite and positive changes nothing.
|
|
141
|
+
*/
|
|
142
|
+
zoomAxesAbout(factorX: number, factorY: number, x: number, y: number): void;
|
|
143
|
+
/**
|
|
144
|
+
* Turns the content by `angle` (clockwise on screen) about (x, y); no-op
|
|
145
|
+
* unless `rotatable`.
|
|
146
|
+
*/
|
|
147
|
+
rotateAbout(angle: number, x: number, y: number): void;
|
|
148
|
+
/**
|
|
149
|
+
* Shows `box` in the viewport minus padding, keeping the rotation. A flat box
|
|
150
|
+
* (zero width or height) is fitted on its other axis. With the aspect kept
|
|
151
|
+
* the one scale stays inside the intersection of the two axes' limits; where
|
|
152
|
+
* they do not intersect each axis is clamped to its own, and the aspect is
|
|
153
|
+
* given up. With `keepAspect: false` on a view turned near 45° (or a flat
|
|
154
|
+
* box) the two scales cannot both be solved for, and the aspect is kept.
|
|
155
|
+
*
|
|
156
|
+
* @throws {RangeError} For an empty or non-finite box, a box that is a single
|
|
157
|
+
* point, a negative or non-finite padding, a padding that leaves no room in
|
|
158
|
+
* the viewport, or a box too small to scale to it.
|
|
159
|
+
*/
|
|
160
|
+
fit(box: ReadonlyBox2, options?: View2FitOptions): void;
|
|
161
|
+
/**
|
|
162
|
+
* World → screen as an affine transform; with `pixelRatio`, → device pixels
|
|
163
|
+
* (a Canvas 2D `setTransform`).
|
|
164
|
+
*/
|
|
165
|
+
getWorldToScreen(out: Affine2, pixelRatio?: number): Affine2;
|
|
166
|
+
getScreenToWorld(out: Affine2): Affine2;
|
|
167
|
+
/**
|
|
168
|
+
* World → clip space ([−1, 1]², y up), for a GPU pass covering the viewport.
|
|
169
|
+
* A viewport with no width or height gives non-finite entries.
|
|
170
|
+
*/
|
|
171
|
+
getWorldToClip(out: Affine2): Affine2;
|
|
172
|
+
/**
|
|
173
|
+
* The same as a `Mat4x4`, for `DrawViewOptions.viewProjection`: x and y as
|
|
174
|
+
* `getWorldToClip`, z mapped to 0, whatever the input z.
|
|
175
|
+
*/
|
|
176
|
+
getViewProjection(out: Mat4x4): Mat4x4;
|
|
177
|
+
worldToScreen(out: Vec2, point: ReadonlyVec2): Vec2;
|
|
178
|
+
screenToWorld(out: Vec2, point: ReadonlyVec2): Vec2;
|
|
179
|
+
/** Axis-aligned world bounds of the visible area (rotated views included). */
|
|
180
|
+
getVisibleBounds(out: Box2): Box2;
|
|
181
|
+
private halfExtentX_;
|
|
182
|
+
private halfExtentY_;
|
|
183
|
+
/**
|
|
184
|
+
* Scales by the factors and turns by `angle` about screen point (x, y), which
|
|
185
|
+
* stays on the same world point.
|
|
186
|
+
*/
|
|
187
|
+
private transformAbout_;
|
|
188
|
+
/**
|
|
189
|
+
* Commits a frame after the scale limits and the bounds, unless a value is
|
|
190
|
+
* not finite (the state then stays as it was).
|
|
191
|
+
*/
|
|
192
|
+
private apply_;
|
|
193
|
+
private constrain_;
|
|
194
|
+
}
|
|
195
|
+
//# sourceMappingURL=view2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view2.d.ts","sourceRoot":"","sources":["../../src/view2/view2.ts"],"names":[],"mappings":"AAMA,OAAO,EACN,KAAK,IAAI,EACT,KAAK,YAAY,EAOjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACN,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,IAAI,EAOT,MAAM,qBAAqB,CAAC;AAG7B,qDAAqD;AACrD,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,MAAM,CAAC;AAEvC,uCAAuC;AACvC,MAAM,MAAM,eAAe;AAC1B,iDAAiD;AAC/C,QAAQ;AACV;;;GAGG;GACD,QAAQ,CAAC;AAEZ,MAAM,MAAM,YAAY,GAAG;IAC1B,iEAAiE;IACjE,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC;IAC/B,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IACvC;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,uEAAuE;IACvE,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAC5B,yEAAyE;IACzE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,0EAA0E;IAC1E,QAAQ,CAAC,WAAW,CAAC,EAAE;QACtB,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QACjD,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;KACjD,CAAC;IAC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