@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,121 @@
|
|
|
1
|
+
import { FrameScheduler } from "@ac-kit/browser";
|
|
2
|
+
import { watchMediaQuery } from "@ac-kit/browser/dom";
|
|
3
|
+
import { inertiaDuration, inertiaOffset, } from "@ac-kit/ui-gesture";
|
|
4
|
+
const REDUCED_MOTION_ = "(prefers-reduced-motion: reduce)";
|
|
5
|
+
/**
|
|
6
|
+
* Continues a released one-pointer pan by exponential decay on animation
|
|
7
|
+
* frames, unless the person prefers reduced motion (followed while bound). A
|
|
8
|
+
* press, `stop()` or the signal ends it. `undefined` when inertia is off.
|
|
9
|
+
*
|
|
10
|
+
* @throws {RangeError} For unusable inertia options.
|
|
11
|
+
* @throws {TypeError} When there are no frames to run on.
|
|
12
|
+
*/
|
|
13
|
+
export function bindInertia_(element, options) {
|
|
14
|
+
const { inertia, signal } = options;
|
|
15
|
+
if (inertia === undefined || inertia === false) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
const inertiaOptions = inertia === true ? {} : inertia;
|
|
19
|
+
// Refuses unusable options now rather than at the first release.
|
|
20
|
+
inertiaDuration(0, inertiaOptions);
|
|
21
|
+
const view = element.ownerDocument.defaultView;
|
|
22
|
+
const frames = options.frames ?? view ?? undefined;
|
|
23
|
+
const axes = options.axes ?? { x: true, y: true };
|
|
24
|
+
if (frames === undefined) {
|
|
25
|
+
throw new TypeError("inertia needs frames: the element has no window");
|
|
26
|
+
}
|
|
27
|
+
let run;
|
|
28
|
+
let peakPointers = 0;
|
|
29
|
+
const stop = () => {
|
|
30
|
+
run?.[Symbol.dispose]();
|
|
31
|
+
run = undefined;
|
|
32
|
+
};
|
|
33
|
+
const motion = view !== null && typeof view.matchMedia === "function"
|
|
34
|
+
? watchMediaQuery(view, REDUCED_MOTION_, { onChange: stop, signal })
|
|
35
|
+
: undefined;
|
|
36
|
+
const start = (velocityX, velocityY) => {
|
|
37
|
+
const speed = Math.hypot(velocityX, velocityY);
|
|
38
|
+
const duration = inertiaDuration(speed, inertiaOptions);
|
|
39
|
+
if (!(duration > 0) || !Number.isFinite(duration)) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const unitX = velocityX / speed;
|
|
43
|
+
const unitY = velocityY / speed;
|
|
44
|
+
let startTime;
|
|
45
|
+
let travelled = 0;
|
|
46
|
+
const scheduler = new FrameScheduler(frames, ({ time }) => {
|
|
47
|
+
startTime ??= time;
|
|
48
|
+
const elapsed = Math.min(Math.max(time - startTime, 0), duration);
|
|
49
|
+
const offset = inertiaOffset(speed, elapsed, inertiaOptions);
|
|
50
|
+
const step = offset - travelled;
|
|
51
|
+
travelled = offset;
|
|
52
|
+
if (elapsed >= duration && run === scheduler) {
|
|
53
|
+
stop();
|
|
54
|
+
}
|
|
55
|
+
if (step !== 0) {
|
|
56
|
+
options.pan(unitX * step, unitY * step);
|
|
57
|
+
options.onChange();
|
|
58
|
+
}
|
|
59
|
+
}, { continuous: true, signal });
|
|
60
|
+
run = scheduler;
|
|
61
|
+
};
|
|
62
|
+
signal.addEventListener("abort", stop, { once: true });
|
|
63
|
+
// Pointers pressed now, however many updates they made: a second finger that
|
|
64
|
+
// touched down and lifted without moving still made the gesture a pinch.
|
|
65
|
+
const pressed = new Set();
|
|
66
|
+
let wasMultiTouch = false;
|
|
67
|
+
element.addEventListener("pointerdown", (event) => {
|
|
68
|
+
stop();
|
|
69
|
+
if (pressed.size === 0) {
|
|
70
|
+
wasMultiTouch = false;
|
|
71
|
+
}
|
|
72
|
+
pressed.add(event.pointerId);
|
|
73
|
+
wasMultiTouch ||= pressed.size > 1;
|
|
74
|
+
}, { capture: true, signal });
|
|
75
|
+
const release = (event) => {
|
|
76
|
+
pressed.delete(event.pointerId);
|
|
77
|
+
};
|
|
78
|
+
// Capturing at the document sees the element's events, and the ends of a
|
|
79
|
+
// press the binding refused, which is neither captured nor seen to end on
|
|
80
|
+
// the element.
|
|
81
|
+
const page = element.ownerDocument;
|
|
82
|
+
page.addEventListener("pointerup", release, { capture: true, signal });
|
|
83
|
+
page.addEventListener("pointercancel", release, {
|
|
84
|
+
capture: true,
|
|
85
|
+
signal,
|
|
86
|
+
});
|
|
87
|
+
page.addEventListener("lostpointercapture", release, {
|
|
88
|
+
capture: true,
|
|
89
|
+
signal,
|
|
90
|
+
});
|
|
91
|
+
page.addEventListener("pointermove", (event) => {
|
|
92
|
+
const pointer = event;
|
|
93
|
+
// A mouse or pen that moves with no button down: a release unseen.
|
|
94
|
+
if (pointer.pointerType !== "touch" && pointer.buttons === 0) {
|
|
95
|
+
release(event);
|
|
96
|
+
}
|
|
97
|
+
}, { capture: true, signal });
|
|
98
|
+
return {
|
|
99
|
+
stop,
|
|
100
|
+
track: (update) => {
|
|
101
|
+
if (update.phase === "start") {
|
|
102
|
+
stop();
|
|
103
|
+
peakPointers = 0;
|
|
104
|
+
}
|
|
105
|
+
peakPointers = Math.max(peakPointers, update.pointerCount);
|
|
106
|
+
if (update.phase === "cancel") {
|
|
107
|
+
peakPointers = 0;
|
|
108
|
+
}
|
|
109
|
+
else if (update.phase === "end") {
|
|
110
|
+
const wasOnePointer = peakPointers <= 1 && !wasMultiTouch;
|
|
111
|
+
peakPointers = 0;
|
|
112
|
+
const velocityX = axes.x ? update.velocityX : 0;
|
|
113
|
+
const velocityY = axes.y ? update.velocityY : 0;
|
|
114
|
+
if (wasOnePointer && motion?.matches !== true) {
|
|
115
|
+
start(velocityX, velocityY);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=_inertia-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_inertia-input.js","sourceRoot":"","sources":["../../src/dom/_inertia-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAwB,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EACN,eAAe,EACf,aAAa,GAGb,MAAM,oBAAoB,CAAC;AAuB5B,MAAM,eAAe,GAAG,kCAAkC,CAAC;AAE3D;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAC3B,OAAuB,EACvB,OAA6B;IAE7B,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IACpC,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,KAAK,EAAE,CAAC;QAChD,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,MAAM,cAAc,GAAmB,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;IACvE,iEAAiE;IACjE,eAAe,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;IACnC,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC;IAC/C,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,IAAI,IAAI,SAAS,CAAC;IACnD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,EAAE,CAA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AC,CAAC;YAClB,CAAC;iBAAM,IAAI,MAAM,CAAC,KAAK,KAAK,KAAK,EAAE,CAAC;gBACnC,MAAM,aAAa,GAAG,YAAY,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC;gBAC1D,YAAY,GAAG,CAAC,CAAC;gBACjB,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;gBAChD,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;gBAChD,IAAI,aAAa,IAAI,MAAM,EAAE,OAAO,KAAK,IAAI,EAAE,CAAC;oBAC/C,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;gBAC7B,CAAC;YACF,CAAC;QACF,CAAC;KACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { AnimationFrames } from "@ac-kit/browser";
|
|
2
|
+
import { type Callable, type CallableNoArgs } from "@ac-kit/core";
|
|
3
|
+
import type { InertiaOptions, PointerSample, TapEvent } from "@ac-kit/ui-gesture";
|
|
4
|
+
import { type CooperativeHint, type GestureElement } from "@ac-kit/ui-gesture/dom";
|
|
5
|
+
import type { LookAroundCamera } from "../camera/look-around-camera.js";
|
|
6
|
+
export type LookAroundInputOptions = {
|
|
7
|
+
/**
|
|
8
|
+
* How the view is drawn, as `projectionScale` takes it, so a drag turns the
|
|
9
|
+
* view by the angle under the pointer (`1 / projectionScale` radians per
|
|
10
|
+
* pixel at the centre; every azimuthal projection has unit slope there).
|
|
11
|
+
* Default `Math.tan` (perspective, gnomonic).
|
|
12
|
+
*/
|
|
13
|
+
readonly radius?: Callable<[angle: number], number>;
|
|
14
|
+
/** The sky seen from inside: dragging right turns the view left. Default true. */
|
|
15
|
+
readonly mirror?: boolean;
|
|
16
|
+
readonly onChange: CallableNoArgs;
|
|
17
|
+
/** Default π/36. */
|
|
18
|
+
readonly keyRotationRadians?: number;
|
|
19
|
+
/** Default √2 per zoom key press. */
|
|
20
|
+
readonly keyZoomFactor?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Continues a released drag by exponential decay, never when the person
|
|
23
|
+
* prefers reduced motion. Default false.
|
|
24
|
+
*/
|
|
25
|
+
readonly inertia?: boolean | InertiaOptions;
|
|
26
|
+
/** Drives inertia. Default the element's window. */
|
|
27
|
+
readonly frames?: AnimationFrames;
|
|
28
|
+
/** Cooperative gestures, for a view inside a scrolling page. Default false. */
|
|
29
|
+
readonly cooperative?: boolean;
|
|
30
|
+
readonly onCooperativeHint?: Callable<[hint: CooperativeHint]>;
|
|
31
|
+
readonly onHover?: Callable<[sample: PointerSample]>;
|
|
32
|
+
readonly onHoverEnd?: CallableNoArgs;
|
|
33
|
+
readonly onTap?: Callable<[tap: TapEvent]>;
|
|
34
|
+
readonly signal?: AbortSignal;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Drag to look around (the content follows the pointer), pinch, wheel and `+`
|
|
38
|
+
* and `-` to zoom the field of view, arrows to turn (ArrowRight looks right),
|
|
39
|
+
* with optional inertia, on a focusable element styled `touch-action: none`.
|
|
40
|
+
* `onChange` is called once per input event that moved the camera, and once per
|
|
41
|
+
* frame of an inertia.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* using binding = bindLookAroundInput(canvas, camera, {
|
|
45
|
+
* onChange: () => scheduler.invalidate(),
|
|
46
|
+
* inertia: true,
|
|
47
|
+
* signal,
|
|
48
|
+
* });
|
|
49
|
+
*
|
|
50
|
+
* @throws {RangeError} For an invalid step, or unusable inertia options.
|
|
51
|
+
* @throws {TypeError} For inertia on an element with no window and no `frames`.
|
|
52
|
+
*/
|
|
53
|
+
export declare function bindLookAroundInput(element: GestureElement, camera: LookAroundCamera, options: LookAroundInputOptions): Disposable;
|
|
54
|
+
//# sourceMappingURL=bind-look-around-input.d.ts.map
|
|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CAAC,CAAC;IACrD,QAAQ,CAAC,UAAU,CAAC,EAAE,cAAc,CAAC;IACrC,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC3C,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;CAC9B,CAAC;AAKF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAClC,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,sBAAsB,GAC7B,UAAU,CA+GZ"}
|
|
@@ -0,0 +1,111 @@
|
|
|
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_ROTATION_RADIANS_ = Math.PI / 36;
|
|
5
|
+
const DEFAULT_KEY_ZOOM_FACTOR_ = Math.SQRT2;
|
|
6
|
+
/**
|
|
7
|
+
* Drag to look around (the content follows the pointer), pinch, wheel and `+`
|
|
8
|
+
* and `-` to zoom the field of view, arrows to turn (ArrowRight looks right),
|
|
9
|
+
* with optional inertia, on a focusable element styled `touch-action: none`.
|
|
10
|
+
* `onChange` is called once per input event that moved the camera, and once per
|
|
11
|
+
* frame of an inertia.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* using binding = bindLookAroundInput(canvas, camera, {
|
|
15
|
+
* onChange: () => scheduler.invalidate(),
|
|
16
|
+
* inertia: true,
|
|
17
|
+
* signal,
|
|
18
|
+
* });
|
|
19
|
+
*
|
|
20
|
+
* @throws {RangeError} For an invalid step, or unusable inertia options.
|
|
21
|
+
* @throws {TypeError} For inertia on an element with no window and no `frames`.
|
|
22
|
+
*/
|
|
23
|
+
export function bindLookAroundInput(element, camera, options) {
|
|
24
|
+
const { radius = Math.tan, mirror = true, onChange, keyRotationRadians = DEFAULT_KEY_ROTATION_RADIANS_, keyZoomFactor = DEFAULT_KEY_ZOOM_FACTOR_, } = options;
|
|
25
|
+
assertPositive(keyRotationRadians, "keyRotationRadians");
|
|
26
|
+
assertPositive(keyZoomFactor, "keyZoomFactor");
|
|
27
|
+
const lifetime = new AbortController();
|
|
28
|
+
const stop = options.signal === undefined
|
|
29
|
+
? lifetime.signal
|
|
30
|
+
: AbortSignal.any([options.signal, lifetime.signal]);
|
|
31
|
+
// Pixels of drag to radians, at the field of view of now; the sign is the
|
|
32
|
+
// content following the pointer, mirrored or not.
|
|
33
|
+
const drag = (deltaX, deltaY) => {
|
|
34
|
+
const height = element.clientHeight;
|
|
35
|
+
if ((deltaX === 0 && deltaY === 0) || !(height > 0)) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
const radiansPerPixel = 1 / camera.projectionScale(radius, height);
|
|
39
|
+
camera.rotate((mirror ? -deltaX : deltaX) * radiansPerPixel, deltaY * radiansPerPixel);
|
|
40
|
+
return true;
|
|
41
|
+
};
|
|
42
|
+
const inertia = bindInertia_(element, {
|
|
43
|
+
inertia: options.inertia,
|
|
44
|
+
frames: options.frames,
|
|
45
|
+
pan: drag,
|
|
46
|
+
onChange,
|
|
47
|
+
signal: stop,
|
|
48
|
+
});
|
|
49
|
+
const binding = bindTransformGesture(element, {
|
|
50
|
+
onTransform: (update) => {
|
|
51
|
+
inertia?.track(update);
|
|
52
|
+
if (update.phase === "cancel") {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
let changed = drag(update.deltaX, update.deltaY);
|
|
56
|
+
if (update.scaleFactor !== 1) {
|
|
57
|
+
camera.zoom(update.scaleFactor);
|
|
58
|
+
changed = true;
|
|
59
|
+
}
|
|
60
|
+
if (changed) {
|
|
61
|
+
onChange();
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
onStep: (step) => {
|
|
65
|
+
inertia?.stop();
|
|
66
|
+
if (step.scaleFactor !== 1) {
|
|
67
|
+
camera.zoom(step.scaleFactor);
|
|
68
|
+
onChange();
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
onKeyStep: (step) => {
|
|
72
|
+
inertia?.stop();
|
|
73
|
+
if (step.kind === "zoom") {
|
|
74
|
+
camera.zoom(keyZoomFactor ** step.direction);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
camera.rotate(step.x * keyRotationRadians, -step.y * keyRotationRadians);
|
|
78
|
+
}
|
|
79
|
+
onChange();
|
|
80
|
+
},
|
|
81
|
+
onTap: options.onTap === undefined
|
|
82
|
+
? undefined
|
|
83
|
+
: (tap) => {
|
|
84
|
+
inertia?.stop();
|
|
85
|
+
options.onTap?.(tap);
|
|
86
|
+
},
|
|
87
|
+
onCooperativeHint: options.onCooperativeHint,
|
|
88
|
+
onHover: options.onHover === undefined
|
|
89
|
+
? undefined
|
|
90
|
+
: (sample) => options.onHover?.(sample),
|
|
91
|
+
onHoverEnd: options.onHoverEnd === undefined
|
|
92
|
+
? undefined
|
|
93
|
+
: () => options.onHoverEnd?.(),
|
|
94
|
+
}, {
|
|
95
|
+
buttons: [0],
|
|
96
|
+
maxPointers: 2,
|
|
97
|
+
focusOnPress: true,
|
|
98
|
+
coordinates: "element",
|
|
99
|
+
cooperative: options.cooperative,
|
|
100
|
+
// A step that would not zoom (a trackpad twist) stays the page's.
|
|
101
|
+
acceptStep: (step) => step.scaleFactor !== 1,
|
|
102
|
+
signal: stop,
|
|
103
|
+
});
|
|
104
|
+
return {
|
|
105
|
+
[Symbol.dispose]: () => {
|
|
106
|
+
lifetime.abort();
|
|
107
|
+
binding[Symbol.dispose]();
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=bind-look-around-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bind-look-around-input.js","sourceRoot":"","sources":["../../src/dom/bind-look-around-input.ts"],"names":[],"mappings":"AACA,OAAO,EAGN,cAAc,GACd,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AAO,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,47 @@
|
|
|
1
|
+
import { type Callable, type CallableNoArgs } from "@ac-kit/core";
|
|
2
|
+
import { type PointerSample, type TapEvent } from "@ac-kit/ui-gesture";
|
|
3
|
+
import { type CooperativeHint, type GestureElement } from "@ac-kit/ui-gesture/dom";
|
|
4
|
+
import type { OrbitCamera } from "../camera/orbit-camera.js";
|
|
5
|
+
import type { Lens3 } from "../view3/view3.js";
|
|
6
|
+
export type OrbitInputOptions = {
|
|
7
|
+
/** Read at every event, so a lens that changes is followed. */
|
|
8
|
+
readonly lens: Lens3 | Callable<[], Lens3>;
|
|
9
|
+
readonly onChange: CallableNoArgs;
|
|
10
|
+
/** Radians per element height of a rotating drag. Default `TWO_PI`. */
|
|
11
|
+
readonly rotationPerHeight?: number;
|
|
12
|
+
/** Default 16. */
|
|
13
|
+
readonly keyPanPixels?: number;
|
|
14
|
+
/** Default π/36. */
|
|
15
|
+
readonly keyRotationRadians?: number;
|
|
16
|
+
/** Default `WHEEL_ZOOM_MAX_FACTOR` (2) per zoom key press. */
|
|
17
|
+
readonly keyDollyFactor?: number;
|
|
18
|
+
/** Default `WHEEL_ZOOM_PIXELS`. */
|
|
19
|
+
readonly wheelZoomPixels?: number;
|
|
20
|
+
/** Cooperative gestures, for a view inside a scrolling page. Default false. */
|
|
21
|
+
readonly cooperative?: boolean;
|
|
22
|
+
readonly onCooperativeHint?: Callable<[hint: CooperativeHint]>;
|
|
23
|
+
/** Hover and taps, for picking. */
|
|
24
|
+
readonly onHover?: Callable<[sample: PointerSample]>;
|
|
25
|
+
readonly onHoverEnd?: CallableNoArgs;
|
|
26
|
+
readonly onTap?: Callable<[tap: TapEvent]>;
|
|
27
|
+
readonly signal?: AbortSignal;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Orbit input on a focusable element styled `touch-action: none`. One pointer
|
|
31
|
+
* (left button or one touch) pans; the right button rotates; two touches pinch
|
|
32
|
+
* to dolly and move together to rotate; the wheel and a trackpad pinch dolly;
|
|
33
|
+
* the arrows pan (ArrowRight reveals what lies to the right) or, with Shift,
|
|
34
|
+
* rotate; `+` and `-` dolly. `onChange` is called once per input event that
|
|
35
|
+
* moved the camera.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* using binding = bindOrbitInput(canvas, camera, {
|
|
39
|
+
* lens: { kind: "perspective", fovY: Math.PI / 3, near: 0.1, far: 100 },
|
|
40
|
+
* onChange: () => scheduler.invalidate(),
|
|
41
|
+
* signal,
|
|
42
|
+
* });
|
|
43
|
+
*
|
|
44
|
+
* @throws {RangeError} For an invalid step, or a lens the camera would refuse.
|
|
45
|
+
*/
|
|
46
|
+
export declare function bindOrbitInput(element: GestureElement, camera: OrbitCamera, options: OrbitInputOptions): Disposable;
|
|
47
|
+
//# sourceMappingURL=bind-orbit-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bind-orbit-input.d.ts","sourceRoot":"","sources":["../../src/dom/bind-orbit-input.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,QAAQ,EACb,KAAK,cAAc,EAEnB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAGN,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEN,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,MAAM,iBAAiB,GAAG;IAC/B,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,KAAK,GAAG,QAAQ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|
+
import { bindTransformGesture, } from "@ac-kit/ui-gesture/dom";
|
|
5
|
+
import { lensWorldUnitsPerPixel_ } from "../view3/_projection.js";
|
|
6
|
+
const DEFAULT_KEY_PAN_PIXELS_ = 16;
|
|
7
|
+
const DEFAULT_KEY_ROTATION_RADIANS_ = Math.PI / 36;
|
|
8
|
+
/**
|
|
9
|
+
* Orbit input on a focusable element styled `touch-action: none`. One pointer
|
|
10
|
+
* (left button or one touch) pans; the right button rotates; two touches pinch
|
|
11
|
+
* to dolly and move together to rotate; the wheel and a trackpad pinch dolly;
|
|
12
|
+
* the arrows pan (ArrowRight reveals what lies to the right) or, with Shift,
|
|
13
|
+
* rotate; `+` and `-` dolly. `onChange` is called once per input event that
|
|
14
|
+
* moved the camera.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* using binding = bindOrbitInput(canvas, camera, {
|
|
18
|
+
* lens: { kind: "perspective", fovY: Math.PI / 3, near: 0.1, far: 100 },
|
|
19
|
+
* onChange: () => scheduler.invalidate(),
|
|
20
|
+
* signal,
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* @throws {RangeError} For an invalid step, or a lens the camera would refuse.
|
|
24
|
+
*/
|
|
25
|
+
export function bindOrbitInput(element, camera, options) {
|
|
26
|
+
const { onChange, rotationPerHeight = TWO_PI, keyPanPixels = DEFAULT_KEY_PAN_PIXELS_, keyRotationRadians = DEFAULT_KEY_ROTATION_RADIANS_, keyDollyFactor = WHEEL_ZOOM_MAX_FACTOR, wheelZoomPixels = WHEEL_ZOOM_PIXELS, } = options;
|
|
27
|
+
assertPositive(rotationPerHeight, "rotationPerHeight");
|
|
28
|
+
assertPositive(keyPanPixels, "keyPanPixels");
|
|
29
|
+
assertPositive(keyRotationRadians, "keyRotationRadians");
|
|
30
|
+
assertPositive(keyDollyFactor, "keyDollyFactor");
|
|
31
|
+
assertPositive(wheelZoomPixels, "wheelZoomPixels");
|
|
32
|
+
const readLens = () => typeof options.lens === "function" ? options.lens() : options.lens;
|
|
33
|
+
// Throws what the camera would at the first pan.
|
|
34
|
+
lensWorldUnitsPerPixel_(readLens(), 1, 1);
|
|
35
|
+
const rotate = (deltaX, deltaY, height) => {
|
|
36
|
+
camera.rotate((deltaX * rotationPerHeight) / height, (-deltaY * rotationPerHeight) / height);
|
|
37
|
+
};
|
|
38
|
+
const lifetime = new AbortController();
|
|
39
|
+
const stop = options.signal === undefined
|
|
40
|
+
? lifetime.signal
|
|
41
|
+
: AbortSignal.any([options.signal, lifetime.signal]);
|
|
42
|
+
const binding = bindTransformGesture(element, {
|
|
43
|
+
onTransform: (update) => {
|
|
44
|
+
const height = element.clientHeight;
|
|
45
|
+
if (update.phase === "cancel" || !(height > 0)) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const moved = update.deltaX !== 0 || update.deltaY !== 0;
|
|
49
|
+
const scaled = update.scaleFactor !== 1;
|
|
50
|
+
if (!moved && !scaled) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (update.pointerCount >= 2) {
|
|
54
|
+
if (scaled) {
|
|
55
|
+
camera.dolly(1 / update.scaleFactor);
|
|
56
|
+
}
|
|
57
|
+
rotate(update.deltaX, update.deltaY, height);
|
|
58
|
+
}
|
|
59
|
+
else if (update.button === 2) {
|
|
60
|
+
rotate(update.deltaX, update.deltaY, height);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
camera.pan(update.deltaX, update.deltaY, height, readLens());
|
|
64
|
+
}
|
|
65
|
+
onChange();
|
|
66
|
+
},
|
|
67
|
+
onStep: (step) => {
|
|
68
|
+
if (step.scaleFactor !== 1) {
|
|
69
|
+
camera.dolly(1 / step.scaleFactor);
|
|
70
|
+
onChange();
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
onKeyStep: (step, event) => {
|
|
74
|
+
const height = element.clientHeight;
|
|
75
|
+
if (step.kind === "zoom") {
|
|
76
|
+
camera.dolly(keyDollyFactor ** -step.direction);
|
|
77
|
+
}
|
|
78
|
+
else if (!(height > 0)) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
else if (event.shiftKey) {
|
|
82
|
+
camera.rotate(step.x * keyRotationRadians, -step.y * keyRotationRadians);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
camera.pan(-step.x * keyPanPixels, -step.y * keyPanPixels, height, readLens());
|
|
86
|
+
}
|
|
87
|
+
onChange();
|
|
88
|
+
},
|
|
89
|
+
onTap: options.onTap,
|
|
90
|
+
onCooperativeHint: options.onCooperativeHint,
|
|
91
|
+
onHover: options.onHover === undefined
|
|
92
|
+
? undefined
|
|
93
|
+
: (sample) => options.onHover?.(sample),
|
|
94
|
+
onHoverEnd: options.onHoverEnd === undefined
|
|
95
|
+
? undefined
|
|
96
|
+
: () => options.onHoverEnd?.(),
|
|
97
|
+
}, {
|
|
98
|
+
buttons: [0, 2],
|
|
99
|
+
maxPointers: 2,
|
|
100
|
+
focusOnPress: true,
|
|
101
|
+
preventContextMenu: true,
|
|
102
|
+
coordinates: "element",
|
|
103
|
+
cooperative: options.cooperative,
|
|
104
|
+
wheel: { zoomPixels: wheelZoomPixels },
|
|
105
|
+
// A wheel during a press is the page's, and so is one that would not
|
|
106
|
+
// dolly (a sideways scroll): neither acted on nor cancelled.
|
|
107
|
+
acceptStep: (step) => !binding.isActive && step.scaleFactor !== 1,
|
|
108
|
+
acceptKeyStep: (step) => step.kind === "zoom" || element.clientHeight > 0,
|
|
109
|
+
signal: stop,
|
|
110
|
+
});
|
|
111
|
+
return {
|
|
112
|
+
[Symbol.dispose]: () => {
|
|
113
|
+
lifetime.abort();
|
|
114
|
+
binding[Symbol.dispose]();
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=bind-orbit-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bind-orbit-input.js","sourceRoot":"","sources":["../../src/dom/bind-orbit-input.ts"],"names":[],"mappings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AK,EAAE,OAAO,CAAC,KAAK;QACpB,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;QAC5C,OAAO,EACN,OAAO,CAAC,OAAO,KAAK,SAAS;YAC5B,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC;QACzC,UAAU,EACT,OAAO,CAAC,UAAU,KAAK,SAAS;YAC/B,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE;KAChC,EACD;QACC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QACf,WAAW,EAAE,CAAC;QACd,YAAY,EAAE,IAAI;QAClB,kBAAkB,EAAE,IAAI;QACxB,WAAW,EAAE,SAAS;QACtB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,KAAK,EAAE,EAAE,UAAU,EAAE,eAAe,EAAE;QACtC,qEAAqE;QACrE,6DAA6D;QAC7D,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC,WAAW,KAAK,CAAC;QACjE,aAAa,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,OAAO,CAAC,YAAY,GAAG,CAAC;QACzE,MAAM,EAAE,IAAI;KACZ,CACD,CAAC;IAEF,OAAO;QACN,CAAC,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,60 @@
|
|
|
1
|
+
import type { AnimationFrames } from "@ac-kit/browser";
|
|
2
|
+
import { type Callable, type CallableNoArgs, type Predicate } from "@ac-kit/core";
|
|
3
|
+
import type { InertiaOptions, PointerSample, TapEvent } from "@ac-kit/ui-gesture";
|
|
4
|
+
import { type CooperativeHint, type GestureElement } from "@ac-kit/ui-gesture/dom";
|
|
5
|
+
import type { View2 } from "../view2/view2.js";
|
|
6
|
+
export type View2Axes = "xy" | "x" | "y" | "none";
|
|
7
|
+
export type View2InputOptions = {
|
|
8
|
+
readonly onChange: CallableNoArgs;
|
|
9
|
+
/** Twist rotates the view (and the view must be `rotatable`). Default false. */
|
|
10
|
+
readonly rotate?: boolean;
|
|
11
|
+
/** Axes a pinch, wheel, key or double tap zooms. Default `"xy"`. */
|
|
12
|
+
readonly zoomAxes?: View2Axes;
|
|
13
|
+
/** Axes a drag or arrow key pans. Default `"xy"`. */
|
|
14
|
+
readonly panAxes?: View2Axes;
|
|
15
|
+
/** What an unmodified wheel does. Default `"zoom"`. */
|
|
16
|
+
readonly wheel?: "zoom" | "pan";
|
|
17
|
+
/** Cooperative gestures, for a view inside a scrolling page. Default false. */
|
|
18
|
+
readonly cooperative?: boolean;
|
|
19
|
+
readonly onCooperativeHint?: Callable<[hint: CooperativeHint]>;
|
|
20
|
+
/** Default 16. */
|
|
21
|
+
readonly keyPanPixels?: number;
|
|
22
|
+
/** Default 2 per key press. */
|
|
23
|
+
readonly keyZoomFactor?: number;
|
|
24
|
+
/** Zoom of a double tap about the tap; 1 turns it off. Default 2. */
|
|
25
|
+
readonly doubleTapZoomFactor?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Continues a released pan by exponential decay, never when the person
|
|
28
|
+
* prefers reduced motion. Default false.
|
|
29
|
+
*/
|
|
30
|
+
readonly inertia?: boolean | InertiaOptions;
|
|
31
|
+
/** Drives inertia. Default the element's window. */
|
|
32
|
+
readonly frames?: AnimationFrames;
|
|
33
|
+
/** Where a press may start (a chart's plot area). Default everywhere. */
|
|
34
|
+
readonly accept?: Predicate<[event: PointerEvent]>;
|
|
35
|
+
readonly onHover?: Callable<[sample: PointerSample]>;
|
|
36
|
+
readonly onHoverEnd?: CallableNoArgs;
|
|
37
|
+
readonly onTap?: Callable<[tap: TapEvent]>;
|
|
38
|
+
readonly signal?: AbortSignal;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Pan, pinch, twist, wheel, trackpad, keys and double tap on a `View2`, on a
|
|
42
|
+
* focusable element styled `touch-action: none` (`pan-x pan-y pinch-zoom` when
|
|
43
|
+
* `cooperative`). Zoom is about the pointer, or the centre of the view for
|
|
44
|
+
* keys; ArrowRight reveals what lies to the right, as map viewers do. Changes
|
|
45
|
+
* are applied to the view, then `onChange` is called once per input event, and
|
|
46
|
+
* once per frame of an inertia.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* using binding = bindView2Input(canvas, view, {
|
|
50
|
+
* onChange: () => scheduler.invalidate(),
|
|
51
|
+
* inertia: true,
|
|
52
|
+
* signal,
|
|
53
|
+
* });
|
|
54
|
+
*
|
|
55
|
+
* @throws {RangeError} For a non-positive or non-finite step or factor, or
|
|
56
|
+
* unusable inertia options.
|
|
57
|
+
* @throws {TypeError} For inertia on an element with no window and no `frames`.
|
|
58
|
+
*/
|
|
59
|
+
export declare function bindView2Input(element: GestureElement, view: View2, options: View2InputOptions): Disposable;
|
|
60
|
+
//# sourceMappingURL=bind-view2-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bind-view2-input.d.ts","sourceRoot":"","sources":["../../src/dom/bind-view2-input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EACN,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,SAAS,EAEd,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACX,cAAc,EAEd,aAAa,EACb,QAAQ,EAGR,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEN,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,K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