@deck.gl/widgets 9.1.12 → 9.2.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compass-widget.d.ts +11 -34
- package/dist/compass-widget.d.ts.map +1 -1
- package/dist/compass-widget.js +27 -62
- package/dist/compass-widget.js.map +1 -1
- package/dist/context-menu-widget.d.ts +37 -0
- package/dist/context-menu-widget.d.ts.map +1 -0
- package/dist/context-menu-widget.js +74 -0
- package/dist/context-menu-widget.js.map +1 -0
- package/dist/dist.dev.js +2271 -581
- package/dist/fps-widget.d.ts +29 -0
- package/dist/fps-widget.d.ts.map +1 -0
- package/dist/fps-widget.js +51 -0
- package/dist/fps-widget.js.map +1 -0
- package/dist/fullscreen-widget.d.ts +15 -33
- package/dist/fullscreen-widget.d.ts.map +1 -1
- package/dist/fullscreen-widget.js +20 -51
- package/dist/fullscreen-widget.js.map +1 -1
- package/dist/geocoder-widget.d.ts +51 -0
- package/dist/geocoder-widget.d.ts.map +1 -0
- package/dist/geocoder-widget.js +138 -0
- package/dist/geocoder-widget.js.map +1 -0
- package/dist/gimbal-widget.d.ts +33 -0
- package/dist/gimbal-widget.d.ts.map +1 -0
- package/dist/gimbal-widget.js +116 -0
- package/dist/gimbal-widget.js.map +1 -0
- package/dist/index.cjs +1587 -341
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +37 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -7
- package/dist/index.js.map +1 -1
- package/dist/info-widget.d.ts +37 -0
- package/dist/info-widget.d.ts.map +1 -0
- package/dist/info-widget.js +183 -0
- package/dist/info-widget.js.map +1 -0
- package/dist/lib/components/button-group.d.ts +8 -0
- package/dist/lib/components/button-group.d.ts.map +1 -0
- package/dist/lib/components/button-group.js +7 -0
- package/dist/lib/components/button-group.js.map +1 -0
- package/dist/lib/components/dropdown-menu.d.ts +8 -0
- package/dist/lib/components/dropdown-menu.d.ts.map +1 -0
- package/dist/lib/components/dropdown-menu.js +55 -0
- package/dist/lib/components/dropdown-menu.js.map +1 -0
- package/dist/lib/components/grouped-icon-button.d.ts +8 -0
- package/dist/lib/components/grouped-icon-button.d.ts.map +1 -0
- package/dist/lib/components/grouped-icon-button.js +7 -0
- package/dist/lib/components/grouped-icon-button.js.map +1 -0
- package/dist/lib/components/icon-button.d.ts +11 -0
- package/dist/lib/components/icon-button.d.ts.map +1 -0
- package/dist/lib/components/icon-button.js +7 -0
- package/dist/lib/components/icon-button.js.map +1 -0
- package/dist/lib/components/icon-menu.d.ts +16 -0
- package/dist/lib/components/icon-menu.d.ts.map +1 -0
- package/dist/lib/components/icon-menu.js +49 -0
- package/dist/lib/components/icon-menu.js.map +1 -0
- package/dist/lib/components/simple-menu.d.ts +16 -0
- package/dist/lib/components/simple-menu.d.ts.map +1 -0
- package/dist/lib/components/simple-menu.js +30 -0
- package/dist/lib/components/simple-menu.js.map +1 -0
- package/dist/lib/geocode/geocoder-history.d.ts +23 -0
- package/dist/lib/geocode/geocoder-history.d.ts.map +1 -0
- package/dist/lib/geocode/geocoder-history.js +64 -0
- package/dist/lib/geocode/geocoder-history.js.map +1 -0
- package/dist/lib/geocode/geocoder.d.ts +15 -0
- package/dist/lib/geocode/geocoder.d.ts.map +1 -0
- package/dist/lib/geocode/geocoder.js +5 -0
- package/dist/lib/geocode/geocoder.js.map +1 -0
- package/dist/lib/geocode/geocoders.d.ts +68 -0
- package/dist/lib/geocode/geocoders.d.ts.map +1 -0
- package/dist/lib/geocode/geocoders.js +182 -0
- package/dist/lib/geocode/geocoders.js.map +1 -0
- package/dist/loading-widget.d.ts +26 -0
- package/dist/loading-widget.d.ts.map +1 -0
- package/dist/loading-widget.js +41 -0
- package/dist/loading-widget.js.map +1 -0
- package/dist/reset-view-widget.d.ts +4 -4
- package/dist/reset-view-widget.d.ts.map +1 -1
- package/dist/reset-view-widget.js +7 -10
- package/dist/reset-view-widget.js.map +1 -1
- package/dist/scale-widget.d.ts +28 -0
- package/dist/scale-widget.d.ts.map +1 -0
- package/dist/scale-widget.js +111 -0
- package/dist/scale-widget.js.map +1 -0
- package/dist/screenshot-widget.d.ts +4 -4
- package/dist/screenshot-widget.d.ts.map +1 -1
- package/dist/screenshot-widget.js +7 -14
- package/dist/screenshot-widget.js.map +1 -1
- package/dist/splitter-widget.d.ts +32 -0
- package/dist/splitter-widget.d.ts.map +1 -0
- package/dist/splitter-widget.js +123 -0
- package/dist/splitter-widget.js.map +1 -0
- package/dist/stats-widget.d.ts +36 -0
- package/dist/stats-widget.d.ts.map +1 -0
- package/dist/stats-widget.js +115 -0
- package/dist/stats-widget.js.map +1 -0
- package/dist/stylesheet.css +121 -4
- package/dist/theme-widget.d.ts +31 -0
- package/dist/theme-widget.d.ts.map +1 -0
- package/dist/theme-widget.js +83 -0
- package/dist/theme-widget.js.map +1 -0
- package/dist/themes.d.ts +65 -36
- package/dist/themes.d.ts.map +1 -1
- package/dist/themes.js +20 -8
- package/dist/themes.js.map +1 -1
- package/dist/timeline-widget.d.ts +59 -0
- package/dist/timeline-widget.d.ts.map +1 -0
- package/dist/timeline-widget.js +83 -0
- package/dist/timeline-widget.js.map +1 -0
- package/dist/view-selector-widget.d.ts +33 -0
- package/dist/view-selector-widget.d.ts.map +1 -0
- package/dist/view-selector-widget.js +62 -0
- package/dist/view-selector-widget.js.map +1 -0
- package/dist/zoom-widget.d.ts +14 -43
- package/dist/zoom-widget.d.ts.map +1 -1
- package/dist/zoom-widget.js +14 -56
- package/dist/zoom-widget.js.map +1 -1
- package/dist.min.js +3 -1
- package/package.json +4 -3
- package/src/compass-widget.tsx +44 -106
- package/src/context-menu-widget.tsx +115 -0
- package/src/fps-widget.tsx +67 -0
- package/src/fullscreen-widget.tsx +33 -86
- package/src/geocoder-widget.tsx +209 -0
- package/src/gimbal-widget.tsx +188 -0
- package/src/index.ts +58 -8
- package/src/info-widget.tsx +225 -0
- package/src/lib/components/button-group.tsx +16 -0
- package/src/lib/components/dropdown-menu.tsx +98 -0
- package/src/lib/components/grouped-icon-button.tsx +24 -0
- package/src/lib/components/icon-button.tsx +30 -0
- package/src/lib/components/icon-menu.tsx +89 -0
- package/src/lib/components/simple-menu.tsx +52 -0
- package/src/lib/geocode/geocoder-history.ts +73 -0
- package/src/lib/geocode/geocoder.ts +15 -0
- package/src/lib/geocode/geocoders.ts +199 -0
- package/src/loading-widget.tsx +67 -0
- package/src/reset-view-widget.tsx +8 -11
- package/src/scale-widget.tsx +183 -0
- package/src/screenshot-widget.tsx +9 -11
- package/src/splitter-widget.tsx +179 -0
- package/src/stats-widget.tsx +166 -0
- package/src/stylesheet.css +121 -4
- package/src/theme-widget.tsx +120 -0
- package/src/themes.ts +45 -12
- package/src/timeline-widget.tsx +155 -0
- package/src/view-selector-widget.tsx +108 -0
- package/src/zoom-widget.tsx +39 -113
- package/dist/components.d.ts +0 -4
- package/dist/components.d.ts.map +0 -1
- package/dist/components.js +0 -17
- package/dist/components.js.map +0 -1
- package/dist/widget-impl.d.ts +0 -29
- package/dist/widget-impl.d.ts.map +0 -1
- package/dist/widget-impl.js +0 -60
- package/dist/widget-impl.js.map +0 -1
- package/src/components.tsx +0 -38
- package/src/widget-impl.ts +0 -88
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { jsx as _jsx } from "preact/jsx-runtime";
|
|
2
|
+
// deck.gl
|
|
3
|
+
// SPDX-License-Identifier: MIT
|
|
4
|
+
// Copyright (c) vis.gl contributors
|
|
5
|
+
import { log, _deepEqual as deepEqual, _applyStyles as applyStyles } from '@deck.gl/core';
|
|
6
|
+
import { Widget } from '@deck.gl/core';
|
|
7
|
+
import { render } from 'preact';
|
|
8
|
+
// import {useCallback} from 'preact/hooks';
|
|
9
|
+
import { IconButton } from "./lib/components/icon-button.js";
|
|
10
|
+
import { LightGlassTheme, DarkGlassTheme } from "./themes.js";
|
|
11
|
+
export class ThemeWidget extends Widget {
|
|
12
|
+
constructor(props = {}) {
|
|
13
|
+
super(props, ThemeWidget.defaultProps);
|
|
14
|
+
this.className = 'deck-widget-theme';
|
|
15
|
+
this.placement = 'top-left';
|
|
16
|
+
this.themeMode = 'dark';
|
|
17
|
+
this.placement = props.placement ?? this.placement;
|
|
18
|
+
this.themeMode = this._getInitialThemeMode();
|
|
19
|
+
}
|
|
20
|
+
// eslint-disable-next-line complexity
|
|
21
|
+
setProps(props) {
|
|
22
|
+
const { lightModeTheme, darkModeTheme } = this.props;
|
|
23
|
+
this.placement = props.placement ?? this.placement;
|
|
24
|
+
super.setProps(props);
|
|
25
|
+
// Update if current theme definition changed
|
|
26
|
+
switch (this.themeMode) {
|
|
27
|
+
case 'light':
|
|
28
|
+
if (props.lightModeTheme && !deepEqual(props.lightModeTheme, lightModeTheme, 1)) {
|
|
29
|
+
this._setThemeMode('light');
|
|
30
|
+
}
|
|
31
|
+
break;
|
|
32
|
+
case 'dark':
|
|
33
|
+
if (props.darkModeTheme && !deepEqual(props.darkModeTheme, darkModeTheme, 1)) {
|
|
34
|
+
this._setThemeMode('dark');
|
|
35
|
+
}
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
onRenderHTML(rootElement) {
|
|
40
|
+
const { lightModeLabel, darkModeLabel } = this.props;
|
|
41
|
+
// const onClick = useCallback(this._handleClick.bind(this), [this._handleClick]);
|
|
42
|
+
render(_jsx(IconButton, { onClick: this._handleClick.bind(this), label: this.themeMode === 'dark' ? darkModeLabel : lightModeLabel, className: this.themeMode === 'dark' ? 'deck-widget-moon' : 'deck-widget-sun' }), rootElement);
|
|
43
|
+
}
|
|
44
|
+
onAdd() {
|
|
45
|
+
// Note: theme styling is applied in here onAdd() once DOM element is created
|
|
46
|
+
this._setThemeMode(this.themeMode);
|
|
47
|
+
}
|
|
48
|
+
_handleClick() {
|
|
49
|
+
const newThemeMode = this.themeMode === 'dark' ? 'light' : 'dark';
|
|
50
|
+
this._setThemeMode(newThemeMode);
|
|
51
|
+
}
|
|
52
|
+
_setThemeMode(themeMode) {
|
|
53
|
+
this.themeMode = themeMode;
|
|
54
|
+
const container = this.rootElement?.closest('.deck-widget-container');
|
|
55
|
+
if (container) {
|
|
56
|
+
const themeStyle = themeMode === 'dark' ? this.props.darkModeTheme : this.props.lightModeTheme;
|
|
57
|
+
applyStyles(container, themeStyle);
|
|
58
|
+
const label = this.themeMode === 'dark' ? this.props.darkModeLabel : this.props.lightModeLabel;
|
|
59
|
+
log.log(1, `Switched theme to ${label}`, themeStyle);
|
|
60
|
+
this.updateHTML();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/** Read browser preference */
|
|
64
|
+
_getInitialThemeMode() {
|
|
65
|
+
const { initialThemeMode } = this.props;
|
|
66
|
+
return initialThemeMode === 'auto'
|
|
67
|
+
? window.matchMedia('(prefers-color-scheme: dark)').matches
|
|
68
|
+
? 'dark'
|
|
69
|
+
: 'light'
|
|
70
|
+
: initialThemeMode;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
ThemeWidget.defaultProps = {
|
|
74
|
+
...Widget.defaultProps,
|
|
75
|
+
id: 'theme',
|
|
76
|
+
placement: 'top-left',
|
|
77
|
+
lightModeLabel: 'Light Mode',
|
|
78
|
+
lightModeTheme: LightGlassTheme,
|
|
79
|
+
darkModeLabel: 'Dark Mode',
|
|
80
|
+
darkModeTheme: DarkGlassTheme,
|
|
81
|
+
initialThemeMode: 'auto'
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=theme-widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-widget.js","sourceRoot":"","sources":["../src/theme-widget.tsx"],"names":[],"mappings":";AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,GAAG,EAAE,UAAU,IAAI,SAAS,EAAE,YAAY,IAAI,WAAW,EAAC,MAAM,eAAe,CAAC;AACxF,OAAO,EAAC,MAAM,EAA+B,MAAM,eAAe,CAAC;AACnE,OAAO,EAAC,MAAM,EAAC,MAAM,QAAQ,CAAC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CAAC;YACnF,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,qBAAqB,KAAK,EAAE,EAAE,UAAU,CAAC,CAAC;YAErD,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;IAED,8BAA8B;IAC9B,oBAAoB;QAClB,MAAM,EAAC,gBAAgB,EAAC,GAAG,IAAI,CAAC,KAAK,CAAC;QACtC,OAAO,gBAAgB,KAAK,MAAM;YAChC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC,OAAO;gBACzD,CAAC,CAAC,MAAM;gBACR,CAAC,CAAC,OAAO;YACX,CAAC,CAAC,gBAAgB,CAAC;IACvB,CAAC;;AA1FM,wBAAY,GAA+B;IAChD,GAAG,MAAM,CAAC,YAAY;IACtB,EAAE,EAAE,OAAO;IACX,SAAS,EAAE,UAAU;IACrB,cAAc,EAAE,YAAY;IAC5B,cAAc,EAAE,eAAe;IAC/B,aAAa,EAAE,WAAW;IAC1B,aAAa,EAAE,cAAc;IAC7B,gBAAgB,EAAE,MAAM;CACzB,AATkB,CASjB"}
|
package/dist/themes.d.ts
CHANGED
|
@@ -1,45 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Deck Theme is a set of CSS variables that control CSS styling of the official widgets.
|
|
3
|
+
*/
|
|
4
|
+
export type DeckWidgetTheme = {
|
|
5
|
+
'--widget-margin'?: string;
|
|
6
|
+
'--button-size'?: string;
|
|
7
|
+
'--button-corner-radius'?: string;
|
|
8
|
+
'--button-background'?: string;
|
|
9
|
+
'--button-stroke'?: string;
|
|
10
|
+
'--button-inner-stroke'?: string;
|
|
11
|
+
'--button-shadow'?: string;
|
|
12
|
+
'--button-backdrop-filter'?: string;
|
|
13
|
+
'--button-icon-idle'?: string;
|
|
14
|
+
'--button-icon-hover'?: string;
|
|
15
|
+
'--icon-compass-north-color'?: string;
|
|
16
|
+
'--icon-compass-south-color'?: string;
|
|
17
|
+
};
|
|
1
18
|
export declare const LightTheme: {
|
|
2
|
-
'--
|
|
3
|
-
'--button-
|
|
4
|
-
'--button-
|
|
5
|
-
'--button-
|
|
6
|
-
'--button-
|
|
7
|
-
'--button-
|
|
8
|
-
'--button-
|
|
9
|
-
'--
|
|
10
|
-
'--icon-
|
|
19
|
+
readonly '--widget-margin': "12px";
|
|
20
|
+
readonly '--button-size': "28px";
|
|
21
|
+
readonly '--button-corner-radius': "8px";
|
|
22
|
+
readonly '--button-background': "#fff";
|
|
23
|
+
readonly '--button-stroke': "rgba(255, 255, 255, 0.3)";
|
|
24
|
+
readonly '--button-inner-stroke': "unset";
|
|
25
|
+
readonly '--button-shadow': "0px 0px 8px 0px rgba(0, 0, 0, 0.25)";
|
|
26
|
+
readonly '--button-backdrop-filter': "unset";
|
|
27
|
+
readonly '--button-icon-idle': "rgba(97, 97, 102, 1)";
|
|
28
|
+
readonly '--button-icon-hover': "rgba(24, 24, 26, 1)";
|
|
29
|
+
readonly '--icon-compass-north-color': "rgb(240, 92, 68)";
|
|
30
|
+
readonly '--icon-compass-south-color': "rgb(204, 204, 204)";
|
|
11
31
|
};
|
|
12
32
|
export declare const DarkTheme: {
|
|
13
|
-
'--
|
|
14
|
-
'--button-
|
|
15
|
-
'--button-
|
|
16
|
-
'--button-
|
|
17
|
-
'--button-
|
|
18
|
-
'--button-
|
|
19
|
-
'--button-
|
|
20
|
-
'--
|
|
21
|
-
'--icon-
|
|
33
|
+
readonly '--widget-margin': "12px";
|
|
34
|
+
readonly '--button-size': "28px";
|
|
35
|
+
readonly '--button-corner-radius': "8px";
|
|
36
|
+
readonly '--button-background': "rgba(18, 18, 20, 1)";
|
|
37
|
+
readonly '--button-stroke': "rgba(18, 18, 20, 0.30)";
|
|
38
|
+
readonly '--button-inner-stroke': "unset";
|
|
39
|
+
readonly '--button-shadow': "0px 0px 8px 0px rgba(0, 0, 0, 0.25)";
|
|
40
|
+
readonly '--button-backdrop-filter': "unset";
|
|
41
|
+
readonly '--button-icon-idle': "rgba(158, 157, 168, 1)";
|
|
42
|
+
readonly '--button-icon-hover': "rgba(215, 214, 229, 1)";
|
|
43
|
+
readonly '--icon-compass-north-color': "rgb(240, 92, 68)";
|
|
44
|
+
readonly '--icon-compass-south-color': "rgb(200, 199, 209)";
|
|
22
45
|
};
|
|
23
46
|
export declare const LightGlassTheme: {
|
|
24
|
-
'--
|
|
25
|
-
'--button-
|
|
26
|
-
'--button-
|
|
27
|
-
'--button-
|
|
28
|
-
'--button-
|
|
29
|
-
'--button-
|
|
30
|
-
'--button-
|
|
31
|
-
'--
|
|
32
|
-
'--icon-
|
|
47
|
+
readonly '--widget-margin': "12px";
|
|
48
|
+
readonly '--button-size': "28px";
|
|
49
|
+
readonly '--button-corner-radius': "8px";
|
|
50
|
+
readonly '--button-background': "rgba(255, 255, 255, 0.6)";
|
|
51
|
+
readonly '--button-stroke': "rgba(255, 255, 255, 0.3)";
|
|
52
|
+
readonly '--button-inner-stroke': "1px solid rgba(255, 255, 255, 0.6)";
|
|
53
|
+
readonly '--button-shadow': "0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset";
|
|
54
|
+
readonly '--button-backdrop-filter': "blur(4px)";
|
|
55
|
+
readonly '--button-icon-idle': "rgba(97, 97, 102, 1)";
|
|
56
|
+
readonly '--button-icon-hover': "rgba(24, 24, 26, 1)";
|
|
57
|
+
readonly '--icon-compass-north-color': "rgb(240, 92, 68)";
|
|
58
|
+
readonly '--icon-compass-south-color': "rgb(204, 204, 204)";
|
|
33
59
|
};
|
|
34
60
|
export declare const DarkGlassTheme: {
|
|
35
|
-
'--
|
|
36
|
-
'--button-
|
|
37
|
-
'--button-
|
|
38
|
-
'--button-
|
|
39
|
-
'--button-
|
|
40
|
-
'--button-
|
|
41
|
-
'--button-
|
|
42
|
-
'--
|
|
43
|
-
'--icon-
|
|
61
|
+
readonly '--widget-margin': "12px";
|
|
62
|
+
readonly '--button-size': "28px";
|
|
63
|
+
readonly '--button-corner-radius': "8px";
|
|
64
|
+
readonly '--button-background': "rgba(18, 18, 20, 0.75)";
|
|
65
|
+
readonly '--button-stroke': "rgba(18, 18, 20, 0.30)";
|
|
66
|
+
readonly '--button-inner-stroke': "1px solid rgba(18, 18, 20, 0.75)";
|
|
67
|
+
readonly '--button-shadow': "0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset";
|
|
68
|
+
readonly '--button-backdrop-filter': "blur(4px)";
|
|
69
|
+
readonly '--button-icon-idle': "rgba(158, 157, 168, 1)";
|
|
70
|
+
readonly '--button-icon-hover': "rgba(215, 214, 229, 1)";
|
|
71
|
+
readonly '--icon-compass-north-color': "rgb(240, 92, 68)";
|
|
72
|
+
readonly '--icon-compass-south-color': "rgb(200, 199, 209)";
|
|
44
73
|
};
|
|
45
74
|
//# sourceMappingURL=themes.d.ts.map
|
package/dist/themes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../src/themes.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../src/themes.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAE5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,4BAA4B,CAAC,EAAE,MAAM,CAAC;CACvC,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;;;;;;;CAauB,CAAC;AAE/C,eAAO,MAAM,SAAS;;;;;;;;;;;;;CAawB,CAAC;AAE/C,eAAO,MAAM,eAAe;;;;;;;;;;;;;CAckB,CAAC;AAE/C,eAAO,MAAM,cAAc;;;;;;;;;;;;;CAcmB,CAAC"}
|
package/dist/themes.js
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
export const LightTheme = {
|
|
5
|
+
'--widget-margin': '12px',
|
|
6
|
+
'--button-size': '28px',
|
|
7
|
+
'--button-corner-radius': '8px',
|
|
5
8
|
'--button-background': '#fff',
|
|
6
9
|
'--button-stroke': 'rgba(255, 255, 255, 0.3)',
|
|
7
10
|
'--button-inner-stroke': 'unset',
|
|
@@ -9,10 +12,13 @@ export const LightTheme = {
|
|
|
9
12
|
'--button-backdrop-filter': 'unset',
|
|
10
13
|
'--button-icon-idle': 'rgba(97, 97, 102, 1)',
|
|
11
14
|
'--button-icon-hover': 'rgba(24, 24, 26, 1)',
|
|
12
|
-
'--icon-compass-north-color': '
|
|
13
|
-
'--icon-compass-south-color': '
|
|
15
|
+
'--icon-compass-north-color': 'rgb(240, 92, 68)',
|
|
16
|
+
'--icon-compass-south-color': 'rgb(204, 204, 204)'
|
|
14
17
|
};
|
|
15
18
|
export const DarkTheme = {
|
|
19
|
+
'--widget-margin': '12px',
|
|
20
|
+
'--button-size': '28px',
|
|
21
|
+
'--button-corner-radius': '8px',
|
|
16
22
|
'--button-background': 'rgba(18, 18, 20, 1)',
|
|
17
23
|
'--button-stroke': 'rgba(18, 18, 20, 0.30)',
|
|
18
24
|
'--button-inner-stroke': 'unset',
|
|
@@ -20,10 +26,13 @@ export const DarkTheme = {
|
|
|
20
26
|
'--button-backdrop-filter': 'unset',
|
|
21
27
|
'--button-icon-idle': 'rgba(158, 157, 168, 1)',
|
|
22
28
|
'--button-icon-hover': 'rgba(215, 214, 229, 1)',
|
|
23
|
-
'--icon-compass-north-color': '
|
|
24
|
-
'--icon-compass-south-color': '
|
|
29
|
+
'--icon-compass-north-color': 'rgb(240, 92, 68)',
|
|
30
|
+
'--icon-compass-south-color': 'rgb(200, 199, 209)'
|
|
25
31
|
};
|
|
26
32
|
export const LightGlassTheme = {
|
|
33
|
+
'--widget-margin': '12px',
|
|
34
|
+
'--button-size': '28px',
|
|
35
|
+
'--button-corner-radius': '8px',
|
|
27
36
|
'--button-background': 'rgba(255, 255, 255, 0.6)',
|
|
28
37
|
'--button-stroke': 'rgba(255, 255, 255, 0.3)',
|
|
29
38
|
'--button-inner-stroke': '1px solid rgba(255, 255, 255, 0.6)',
|
|
@@ -31,10 +40,13 @@ export const LightGlassTheme = {
|
|
|
31
40
|
'--button-backdrop-filter': 'blur(4px)',
|
|
32
41
|
'--button-icon-idle': 'rgba(97, 97, 102, 1)',
|
|
33
42
|
'--button-icon-hover': 'rgba(24, 24, 26, 1)',
|
|
34
|
-
'--icon-compass-north-color': '
|
|
35
|
-
'--icon-compass-south-color': '
|
|
43
|
+
'--icon-compass-north-color': 'rgb(240, 92, 68)',
|
|
44
|
+
'--icon-compass-south-color': 'rgb(204, 204, 204)'
|
|
36
45
|
};
|
|
37
46
|
export const DarkGlassTheme = {
|
|
47
|
+
'--widget-margin': '12px',
|
|
48
|
+
'--button-size': '28px',
|
|
49
|
+
'--button-corner-radius': '8px',
|
|
38
50
|
'--button-background': 'rgba(18, 18, 20, 0.75)',
|
|
39
51
|
'--button-stroke': 'rgba(18, 18, 20, 0.30)',
|
|
40
52
|
'--button-inner-stroke': '1px solid rgba(18, 18, 20, 0.75)',
|
|
@@ -42,7 +54,7 @@ export const DarkGlassTheme = {
|
|
|
42
54
|
'--button-backdrop-filter': 'blur(4px)',
|
|
43
55
|
'--button-icon-idle': 'rgba(158, 157, 168, 1)',
|
|
44
56
|
'--button-icon-hover': 'rgba(215, 214, 229, 1)',
|
|
45
|
-
'--icon-compass-north-color': '
|
|
46
|
-
'--icon-compass-south-color': '
|
|
57
|
+
'--icon-compass-north-color': 'rgb(240, 92, 68)',
|
|
58
|
+
'--icon-compass-south-color': 'rgb(200, 199, 209)'
|
|
47
59
|
};
|
|
48
60
|
//# sourceMappingURL=themes.js.map
|
package/dist/themes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themes.js","sourceRoot":"","sources":["../src/themes.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;
|
|
1
|
+
{"version":3,"file":"themes.js","sourceRoot":"","sources":["../src/themes.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAuBpC,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,iBAAiB,EAAE,MAAM;IACzB,eAAe,EAAE,MAAM;IACvB,wBAAwB,EAAE,KAAK;IAC/B,qBAAqB,EAAE,MAAM;IAC7B,iBAAiB,EAAE,0BAA0B;IAC7C,uBAAuB,EAAE,OAAO;IAChC,iBAAiB,EAAE,qCAAqC;IACxD,0BAA0B,EAAE,OAAO;IACnC,oBAAoB,EAAE,sBAAsB;IAC5C,qBAAqB,EAAE,qBAAqB;IAC5C,4BAA4B,EAAE,kBAAkB;IAChD,4BAA4B,EAAE,oBAAoB;CACN,CAAC;AAE/C,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,iBAAiB,EAAE,MAAM;IACzB,eAAe,EAAE,MAAM;IACvB,wBAAwB,EAAE,KAAK;IAC/B,qBAAqB,EAAE,qBAAqB;IAC5C,iBAAiB,EAAE,wBAAwB;IAC3C,uBAAuB,EAAE,OAAO;IAChC,iBAAiB,EAAE,qCAAqC;IACxD,0BAA0B,EAAE,OAAO;IACnC,oBAAoB,EAAE,wBAAwB;IAC9C,qBAAqB,EAAE,wBAAwB;IAC/C,4BAA4B,EAAE,kBAAkB;IAChD,4BAA4B,EAAE,oBAAoB;CACN,CAAC;AAE/C,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,iBAAiB,EAAE,MAAM;IACzB,eAAe,EAAE,MAAM;IACvB,wBAAwB,EAAE,KAAK;IAC/B,qBAAqB,EAAE,0BAA0B;IACjD,iBAAiB,EAAE,0BAA0B;IAC7C,uBAAuB,EAAE,oCAAoC;IAC7D,iBAAiB,EACf,+EAA+E;IACjF,0BAA0B,EAAE,WAAW;IACvC,oBAAoB,EAAE,sBAAsB;IAC5C,qBAAqB,EAAE,qBAAqB;IAC5C,4BAA4B,EAAE,kBAAkB;IAChD,4BAA4B,EAAE,oBAAoB;CACN,CAAC;AAE/C,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,iBAAiB,EAAE,MAAM;IACzB,eAAe,EAAE,MAAM;IACvB,wBAAwB,EAAE,KAAK;IAC/B,qBAAqB,EAAE,wBAAwB;IAC/C,iBAAiB,EAAE,wBAAwB;IAC3C,uBAAuB,EAAE,kCAAkC;IAC3D,iBAAiB,EACf,+EAA+E;IACjF,0BAA0B,EAAE,WAAW;IACvC,oBAAoB,EAAE,wBAAwB;IAC9C,qBAAqB,EAAE,wBAAwB;IAC/C,4BAA4B,EAAE,kBAAkB;IAChD,4BAA4B,EAAE,oBAAoB;CACN,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Widget, type WidgetPlacement } from '@deck.gl/core';
|
|
2
|
+
export type TimelineWidgetProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Widget id
|
|
5
|
+
*/
|
|
6
|
+
id?: string;
|
|
7
|
+
/**
|
|
8
|
+
* CSS inline style overrides.
|
|
9
|
+
*/
|
|
10
|
+
style?: Partial<CSSStyleDeclaration>;
|
|
11
|
+
/**
|
|
12
|
+
* Additional CSS class.
|
|
13
|
+
*/
|
|
14
|
+
className?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Widget placement.
|
|
17
|
+
*/
|
|
18
|
+
placement?: WidgetPlacement;
|
|
19
|
+
/**
|
|
20
|
+
* Slider timeRange [min, max].
|
|
21
|
+
*/
|
|
22
|
+
timeRange?: [number, number];
|
|
23
|
+
/**
|
|
24
|
+
* Slider step.
|
|
25
|
+
*/
|
|
26
|
+
step?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Initial slider value.
|
|
29
|
+
*/
|
|
30
|
+
initialTime?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Callback when value changes.
|
|
33
|
+
*/
|
|
34
|
+
onTimeChange?: (value: number) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Play interval in milliseconds.
|
|
37
|
+
*/
|
|
38
|
+
playInterval?: number;
|
|
39
|
+
};
|
|
40
|
+
export declare class TimelineWidget extends Widget<TimelineWidgetProps> {
|
|
41
|
+
id: string;
|
|
42
|
+
className: string;
|
|
43
|
+
placement: WidgetPlacement;
|
|
44
|
+
private playing;
|
|
45
|
+
private timerId;
|
|
46
|
+
currentTime: number;
|
|
47
|
+
static defaultProps: Required<TimelineWidgetProps>;
|
|
48
|
+
constructor(props?: TimelineWidgetProps);
|
|
49
|
+
setProps(props: Partial<TimelineWidgetProps>): void;
|
|
50
|
+
onAdd(): void;
|
|
51
|
+
onRemove(): void;
|
|
52
|
+
onRenderHTML(rootElement: HTMLElement): void;
|
|
53
|
+
private handlePlayPause;
|
|
54
|
+
private handleSliderChange;
|
|
55
|
+
private start;
|
|
56
|
+
private stop;
|
|
57
|
+
private tick;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=timeline-widget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-widget.d.ts","sourceRoot":"","sources":["../src/timeline-widget.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,MAAM,EAAE,KAAK,eAAe,EAAC,MAAM,eAAe,CAAC;AAG3D,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ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IT
|
|
4
|
+
// Copyright (c) vis.gl contributors
|
|
5
|
+
import { Widget } from '@deck.gl/core';
|
|
6
|
+
import { render } from 'preact';
|
|
7
|
+
export class TimelineWidget extends Widget {
|
|
8
|
+
constructor(props = {}) {
|
|
9
|
+
super(props, TimelineWidget.defaultProps);
|
|
10
|
+
this.id = 'timeline';
|
|
11
|
+
this.className = 'deck-widget-timeline';
|
|
12
|
+
this.placement = 'bottom-left';
|
|
13
|
+
this.playing = false;
|
|
14
|
+
this.timerId = null;
|
|
15
|
+
this.handlePlayPause = () => {
|
|
16
|
+
if (this.playing) {
|
|
17
|
+
this.stop();
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
this.start();
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
this.handleSliderChange = (e) => {
|
|
24
|
+
const input = e.target;
|
|
25
|
+
const val = Number(input.value);
|
|
26
|
+
this.currentTime = val;
|
|
27
|
+
this.props.onTimeChange(val);
|
|
28
|
+
this.updateHTML();
|
|
29
|
+
};
|
|
30
|
+
this.tick = () => {
|
|
31
|
+
const [min, max] = this.props.timeRange;
|
|
32
|
+
let next = this.currentTime + this.props.step;
|
|
33
|
+
if (next > max) {
|
|
34
|
+
next = min;
|
|
35
|
+
}
|
|
36
|
+
this.currentTime = next;
|
|
37
|
+
this.props.onTimeChange(next);
|
|
38
|
+
this.updateHTML();
|
|
39
|
+
if (this.playing) {
|
|
40
|
+
this.timerId = window.setTimeout(this.tick, this.props.playInterval);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
this.currentTime = this.props.initialTime ?? this.props.timeRange[0];
|
|
44
|
+
}
|
|
45
|
+
setProps(props) {
|
|
46
|
+
this.placement = props.placement || this.placement;
|
|
47
|
+
super.setProps(props);
|
|
48
|
+
}
|
|
49
|
+
onAdd() {
|
|
50
|
+
this.playing = false;
|
|
51
|
+
this.timerId = null;
|
|
52
|
+
}
|
|
53
|
+
onRemove() {
|
|
54
|
+
this.stop();
|
|
55
|
+
}
|
|
56
|
+
onRenderHTML(rootElement) {
|
|
57
|
+
render(_jsxs("div", { style: { display: 'flex', alignItems: 'center', pointerEvents: 'auto' }, children: [_jsx("button", { type: "button", className: "timeline-play-pause", title: this.playing ? 'Pause' : 'Play', onClick: this.handlePlayPause, children: this.playing ? '⏸' : '▶' }), _jsx("input", { type: "range", className: "timeline-slider", min: this.props.timeRange[0], max: this.props.timeRange[1], step: this.props.step, value: this.currentTime, onInput: this.handleSliderChange })] }), rootElement);
|
|
58
|
+
}
|
|
59
|
+
start() {
|
|
60
|
+
this.playing = true;
|
|
61
|
+
this.updateHTML();
|
|
62
|
+
this.tick();
|
|
63
|
+
}
|
|
64
|
+
stop() {
|
|
65
|
+
this.playing = false;
|
|
66
|
+
if (this.timerId !== null) {
|
|
67
|
+
window.clearTimeout(this.timerId);
|
|
68
|
+
this.timerId = null;
|
|
69
|
+
}
|
|
70
|
+
this.updateHTML();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
TimelineWidget.defaultProps = {
|
|
74
|
+
...Widget.defaultProps,
|
|
75
|
+
id: 'timeline',
|
|
76
|
+
placement: 'bottom-left',
|
|
77
|
+
timeRange: [0, 100],
|
|
78
|
+
step: 1,
|
|
79
|
+
initialTime: undefined,
|
|
80
|
+
onTimeChange: () => { },
|
|
81
|
+
playInterval: 1000
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=timeline-widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-widget.js","sourceRoot":"","sources":["../src/timeline-widget.tsx"],"names":[],"mappings":";AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,MAAM,EAAuB,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAC,MAAM,EAAC,MAAM,QAAQ,CAAC;AAyC9B,MAAM,OAAO,cAAe,SAAQ,MAA2B;IAoB7D,YAAY,QAA6B,EAAE;QACzC,KAAK,CAAC,KAAK,EAAE,cAA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AAO,EAAE,IAAI,CAAC,kBAAkB,GAChC,IACE,EACN,WAAW,CACZ,CAAC;IACJ,CAAC;IAkBO,KAAK;QACX,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAEO,IAAI;QACV,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;YAC1B,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAClC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACtB,CAAC;QACD,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;;AApFM,2BAAY,GAAkC;IACnD,GAAG,MAAM,CAAC,YAAY;IACtB,EAAE,EAAE,UAAU;IACd,SAAS,EAAE,aAAsB;IACjC,SAAS,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC;IACnB,IAAI,EAAE,CAAC;IACP,WAAW,EAAE,SAAU;IACvB,YAAY,EAAE,GAAG,EAAE,GAAE,CAAC;IACtB,YAAY,EAAE,IAAI;CACnB,AATkB,CASjB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Widget, type WidgetProps, type WidgetPlacement } from '@deck.gl/core';
|
|
2
|
+
/** The available view modes */
|
|
3
|
+
export type ViewMode = 'single' | 'split-horizontal' | 'split-vertical';
|
|
4
|
+
/** Properties for the ViewSelectorWidget */
|
|
5
|
+
export type ViewSelectorWidgetProps = WidgetProps & {
|
|
6
|
+
/** Widget positioning within the view. Default 'top-left'. */
|
|
7
|
+
placement?: WidgetPlacement;
|
|
8
|
+
/** Tooltip label */
|
|
9
|
+
label?: string;
|
|
10
|
+
/** The initial view mode. Defaults to 'single'. */
|
|
11
|
+
initialViewMode?: ViewMode;
|
|
12
|
+
/** Callback invoked when the view mode changes */
|
|
13
|
+
onViewModeChange?: (mode: ViewMode) => void;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* A widget that renders a popup menu for selecting a view mode.
|
|
17
|
+
* It displays a button with the current view mode icon. Clicking the button
|
|
18
|
+
* toggles a popup that shows three icons for:
|
|
19
|
+
* - Single view
|
|
20
|
+
* - Two views, split horizontally
|
|
21
|
+
* - Two views, split vertically
|
|
22
|
+
*/
|
|
23
|
+
export declare class ViewSelectorWidget extends Widget<ViewSelectorWidgetProps> {
|
|
24
|
+
static defaultProps: Required<ViewSelectorWidgetProps>;
|
|
25
|
+
className: string;
|
|
26
|
+
placement: WidgetPlacement;
|
|
27
|
+
viewMode: ViewMode;
|
|
28
|
+
constructor(props?: ViewSelectorWidgetProps);
|
|
29
|
+
setProps(props: Partial<ViewSelectorWidgetProps>): void;
|
|
30
|
+
onRenderHTML(rootElement: HTMLElement): void;
|
|
31
|
+
handleSelectMode: (viewMode: ViewMode) => void;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=view-selector-widget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-selector-widget.d.ts","sourceRoot":"","sources":["../src/view-selector-widget.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAC,MAAM,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAC,MAAM,eAAe,CAAC;AAG7E,+BAA+B;AAC/B,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,kBAAkB,GAAG,gBAAgB,CAAC;AAExE,4CAA4C;AAC5C,MAAM,MAAM,uBAAuB,GAAG,WAAW,GAAG;IAClD,8DAA8D;IAC9D,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,oBAAoB;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,eAAe,CAAC,EAAE,QAAQ,CAAC;IAC3B,kDAAkD;IAClD,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;CAC7C,CAAC;AAEF;;;;;;;GAOG;AACH,qBAAa,kBAAmB,SAAQ,MAAM,CAAC,uBAAuB,CAAC;IACrE,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,uBAAuB,CAAC,CAUpD;IAEF,SAAS,SAA+B;IACxC,SAAS,EAAE,eAAe,CAAc;IACxC,QAAQ,EAAE,QAAQ,CAAC;gBAEP,KAAK,GAAE,uBAA4B;IAM/C,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,uBAAuB,CAAC;IAKhD,YAAY,CAAC,WAAW,EAAE,WAAW;IAYrC,gBAAgB,aAAc,QAAQ,UAGpC;CACH"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
|
+
// ViewSelectorWidget.tsx
|
|
3
|
+
// deck.gl
|
|
4
|
+
// SPDX-License-Identifier: MIT
|
|
5
|
+
// Copyright (c) vis.gl contributors
|
|
6
|
+
import { render } from 'preact';
|
|
7
|
+
import { Widget } from '@deck.gl/core';
|
|
8
|
+
import { IconMenu } from "./lib/components/icon-menu.js";
|
|
9
|
+
/**
|
|
10
|
+
* A widget that renders a popup menu for selecting a view mode.
|
|
11
|
+
* It displays a button with the current view mode icon. Clicking the button
|
|
12
|
+
* toggles a popup that shows three icons for:
|
|
13
|
+
* - Single view
|
|
14
|
+
* - Two views, split horizontally
|
|
15
|
+
* - Two views, split vertically
|
|
16
|
+
*/
|
|
17
|
+
export class ViewSelectorWidget extends Widget {
|
|
18
|
+
constructor(props = {}) {
|
|
19
|
+
super(props, ViewSelectorWidget.defaultProps);
|
|
20
|
+
this.className = 'deck-widget-view-selector';
|
|
21
|
+
this.placement = 'top-left';
|
|
22
|
+
this.handleSelectMode = (viewMode) => {
|
|
23
|
+
this.viewMode = viewMode;
|
|
24
|
+
this.updateHTML();
|
|
25
|
+
};
|
|
26
|
+
this.placement = this.props.placement;
|
|
27
|
+
this.viewMode = this.props.initialViewMode;
|
|
28
|
+
}
|
|
29
|
+
setProps(props) {
|
|
30
|
+
super.setProps(props);
|
|
31
|
+
this.placement = props.placement ?? this.placement;
|
|
32
|
+
}
|
|
33
|
+
onRenderHTML(rootElement) {
|
|
34
|
+
render(_jsx(IconMenu, { className: "deck-widget-view-selector", menuItems: MENU_ITEMS, initialItem: this.props.initialViewMode, onItemSelected: this.handleSelectMode }), rootElement);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
ViewSelectorWidget.defaultProps = {
|
|
38
|
+
...Widget.defaultProps,
|
|
39
|
+
id: 'view-selector-widget',
|
|
40
|
+
placement: 'top-left',
|
|
41
|
+
label: 'Split View',
|
|
42
|
+
initialViewMode: 'single',
|
|
43
|
+
onViewModeChange: (viewMode) => {
|
|
44
|
+
// eslint-disable-next-line no-console
|
|
45
|
+
console.log(viewMode);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
// Define common icon style.
|
|
49
|
+
const ICON_STYLE = { width: '24px', height: '24px' };
|
|
50
|
+
// Define inline SVG icons for each view mode.
|
|
51
|
+
const ICONS = {
|
|
52
|
+
single: () => (_jsx("svg", { width: "24", height: "24", style: ICON_STYLE, children: _jsx("rect", { x: "4", y: "4", width: "16", height: "16", stroke: "black", fill: "none", strokeWidth: "2" }) })),
|
|
53
|
+
'split-horizontal': () => (_jsxs("svg", { width: "24", height: "24", style: ICON_STYLE, children: [_jsx("rect", { x: "4", y: "4", width: "16", height: "7", stroke: "black", fill: "none", strokeWidth: "2" }), _jsx("rect", { x: "4", y: "13", width: "16", height: "7", stroke: "black", fill: "none", strokeWidth: "2" })] })),
|
|
54
|
+
'split-vertical': () => (_jsxs("svg", { width: "24", height: "24", style: ICON_STYLE, children: [_jsx("rect", { x: "4", y: "4", width: "7", height: "16", stroke: "black", fill: "none", strokeWidth: "2" }), _jsx("rect", { x: "13", y: "4", width: "7", height: "16", stroke: "black", fill: "none", strokeWidth: "2" })] }))
|
|
55
|
+
};
|
|
56
|
+
// Define menu items for the popup menu.
|
|
57
|
+
const MENU_ITEMS = [
|
|
58
|
+
{ value: 'single', icon: ICONS.single, label: 'Single View' },
|
|
59
|
+
{ value: 'split-horizontal', icon: ICONS['split-horizontal'], label: 'Split Horizontal' },
|
|
60
|
+
{ value: 'split-vertical', icon: ICONS['split-vertical'], label: 'Split Vertical' }
|
|
61
|
+
];
|
|
62
|
+
//# sourceMappingURL=view-selector-widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-selector-widget.js","sourceRoot":"","sources":["../src/view-selector-widget.tsx"],"names":[],"mappings":";AAAA,yBAAyB;AACzB,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,MAAM,EAAM,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAC,MAAM,EAAyC,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAC,QAAQ,EAAC,sCAAmC;AAiBpD;;;;;;;GAOG;AACH,MAAM,OAAO,kBAAmB,SAAQ,MAA+B;IAiBrE,YAAY,QAAiC,EAAE;QAC7C,KAAK,CAAC,KAAK,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC;QALhD,cAAS,GAAG,2BAA2B,CAAC;QACxC,cAAS,GAAoB,UAAU,CAAC;QA0BxC,qBAAgB,GAAG,CAAC,QAAkB,EAAE,EAAE;YACxC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;YACzB,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,CAAC,CAAC;QAxBA,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;QACtC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC;IAC7C,CAAC;IAED,QAAQ,CAAC,KAAuC;QAC9C,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC;IACrD,CAAC;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ning within the view. Default 'top-left'.
|
|
6
|
-
*/
|
|
1
|
+
import { Widget } from '@deck.gl/core';
|
|
2
|
+
import { Viewport, WidgetProps, WidgetPlacement } from '@deck.gl/core';
|
|
3
|
+
export type ZoomWidgetProps = WidgetProps & {
|
|
4
|
+
/** Widget positioning within the view. Default 'top-left'. */
|
|
7
5
|
placement?: WidgetPlacement;
|
|
8
|
-
/**
|
|
9
|
-
* View to attach to and interact with. Required when using multiple views.
|
|
10
|
-
*/
|
|
6
|
+
/** View to attach to and interact with. Required when using multiple views. */
|
|
11
7
|
viewId?: string | null;
|
|
12
|
-
/**
|
|
13
|
-
* Button orientation.
|
|
14
|
-
*/
|
|
8
|
+
/** Button orientation. */
|
|
15
9
|
orientation?: 'vertical' | 'horizontal';
|
|
16
|
-
/**
|
|
17
|
-
* Tooltip message on zoom in button.
|
|
18
|
-
*/
|
|
10
|
+
/** Tooltip message on zoom in button. */
|
|
19
11
|
zoomInLabel?: string;
|
|
20
|
-
/**
|
|
21
|
-
* Tooltip message on zoom out button.
|
|
22
|
-
*/
|
|
12
|
+
/** Tooltip message on zoom out button. */
|
|
23
13
|
zoomOutLabel?: string;
|
|
24
|
-
/**
|
|
25
|
-
* Zoom transition duration in ms. 0 disables the transition
|
|
26
|
-
*/
|
|
14
|
+
/** Zoom transition duration in ms. 0 disables the transition */
|
|
27
15
|
transitionDuration?: number;
|
|
28
|
-
/**
|
|
29
|
-
* CSS inline style overrides.
|
|
30
|
-
*/
|
|
31
|
-
style?: Partial<CSSStyleDeclaration>;
|
|
32
|
-
/**
|
|
33
|
-
* Additional CSS class.
|
|
34
|
-
*/
|
|
35
|
-
className?: string;
|
|
36
16
|
};
|
|
37
|
-
export declare class ZoomWidget
|
|
38
|
-
|
|
39
|
-
|
|
17
|
+
export declare class ZoomWidget extends Widget<ZoomWidgetProps> {
|
|
18
|
+
static defaultProps: Required<ZoomWidgetProps>;
|
|
19
|
+
className: string;
|
|
40
20
|
placement: WidgetPlacement;
|
|
41
21
|
viewId?: string | null;
|
|
42
22
|
viewports: {
|
|
43
23
|
[id: string]: Viewport;
|
|
44
24
|
};
|
|
45
|
-
deck?: Deck<any>;
|
|
46
|
-
element?: HTMLDivElement;
|
|
47
|
-
static defaultProps: Required<ZoomWidgetProps>;
|
|
48
25
|
constructor(props?: ZoomWidgetProps);
|
|
49
|
-
onAdd({ deck }: {
|
|
50
|
-
deck: Deck<any>;
|
|
51
|
-
}): HTMLDivElement;
|
|
52
|
-
onRemove(): void;
|
|
53
26
|
setProps(props: Partial<ZoomWidgetProps>): void;
|
|
27
|
+
onRenderHTML(rootElement: HTMLElement): void;
|
|
54
28
|
onViewportChange(viewport: Viewport): void;
|
|
55
29
|
handleZoom(viewport: Viewport, nextZoom: number): void;
|
|
56
30
|
handleZoomIn(): void;
|
|
57
31
|
handleZoomOut(): void;
|
|
58
|
-
/**
|
|
59
|
-
* @todo - move to deck or widget manager
|
|
60
|
-
*/
|
|
32
|
+
/** @todo - move to deck or widget manager */
|
|
61
33
|
private setViewState;
|
|
62
|
-
private update;
|
|
63
34
|
}
|
|
64
35
|
//# sourceMappingURL=zoom-widget.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zoom-widget.d.ts","sourceRoot":"","sources":["../src/zoom-widget.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"zoom-widget.d.ts","sourceRoot":"","sources":["../src/zoom-widget.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,MAAM,EAAwC,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAC,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAC,MAAM,eAAe,CAAC;AAKrE,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG;IAC1C,8DAA8D;IAC9D,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,+EAA+E;IAC/E,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,0BAA0B;IAC1B,WAAW,CAAC,EAAE,UAAU,GAAG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