Skip to content

Commit 6b35d4b

Browse files
committed
Merge branch 'master' into ib/wgpu-scatterplot
2 parents 916ed08 + ff280a9 commit 6b35d4b

33 files changed

+1423
-183
lines changed

docs/api-reference/widgets/compass-widget.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,13 @@ Additional CSS styles for the widget. camelCase CSS properties (e.g. `background
4444

4545
Default: `undefined`
4646

47-
Class name to attach to the widget element. The element has the default class name of `deck-widget deck-compass-widget`.
47+
Class name to attach to the widget element. The element has the default class name of `deck-widget deck-compass-widget`.
48+
49+
## Styles
50+
51+
| Name | Type | Default |
52+
| ---------------- | ------------------------ | ---------------------------------------------- |
53+
| `--icon-compass` | [SVG Data Url][data_url] | [Material Symbol Fullscreen][icon_compass_url] |
54+
55+
[data_url]: https://developer.mozilla.org/en-US/docs/Web/CSS/url#using_a_data_url
56+
[icon_compass_url]: https://fonts.google.com/icons

docs/api-reference/widgets/fullscreen-widget.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,15 @@ Additional CSS styles for the widget. camelCase CSS properties (e.g. `background
4444

4545
Default: `undefined`
4646

47-
Class name to attach to the widget element. The element has the default class name of `deck-widget deck-fullscreen-widget`.
47+
Class name to attach to the widget element. The element has the default class name of `deck-widget deck-fullscreen-widget`.
48+
49+
## Styles
50+
51+
| Name | Type | Default |
52+
| ------------------------- | ------------------------ | ------------------------------------------------------------ |
53+
| `--icon-fullscreen-enter` | [SVG Data Url][data_url] | [Material Symbol Fullscreen][icon_fullscreen_enter_url] |
54+
| `--icon-fullscreen-exit` | [SVG Data Url][data_url] | [Material Symbol Fullscreen Exit][icon_fullscreen_exit_url] |
55+
56+
[data_url]: https://developer.mozilla.org/en-US/docs/Web/CSS/url#using_a_data_url
57+
[icon_fullscreen_enter_url]: https://fonts.google.com/icons?selected=Material+Symbols+Rounded:fullscreen:FILL@0;wght@400;GRAD@0;opsz@40
58+
[icon_fullscreen_exit_url]: https://fonts.google.com/icons?selected=Material+Symbols+Rounded:fullscreen_exit:FILL@0;wght@400;GRAD@0;opsz@40
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# InfoWidget (Experimental)
2+
3+
The InfoWidget shows a popup when an item in a layer has been clicked.
4+
5+
## Props
6+
7+
#### `id` (string, optional) {#id}
8+
9+
Default: `'popup'`
10+
11+
The `id` must be unique among all your widgets at a given time.
12+
13+
Note: It is necessary to set `id` explicitly if you have more than once instance of the same widget.
14+
15+
#### `placement` (string, optional) {#placement}
16+
17+
Default: `'top-left'`
18+
19+
Widget position within the view relative to the map container. Valid options are `top-left`, `top-right`, `bottom-left`, `bottom-right`, or `fill`.
20+
21+
#### `label` (string, optional) {#label}
22+
23+
Tooltip message displayed while hovering a mouse over the widget.
24+
25+
Default: `'Popup'`
26+
27+
#### `style` (object, optional) {#style}
28+
29+
Default: `{}`
30+
31+
Additional CSS styles for the widget. camelCase CSS properties (e.g. `backgroundColor`) and kabab-case CSS variables are accepted (e.g. `--button-size`).
32+
33+
#### `className` (string, optional) {#classname}
34+
35+
Default: `undefined`
36+
37+
Class name to attach to the widget element. The element has the default class name of `deck-widget deck-popup-widget`.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# LoadingWidget (Experimental)
2+
3+
This widget shows a spinning indicator while any deck.gl layers are loading data.
4+
5+
## Props
6+
7+
#### `id` (string, optional) {#id}
8+
9+
Default: `'loading'`
10+
11+
The `id` must be unique among all your widgets at a given time.
12+
13+
Note: It is necessary to set `id` explicitly if you have more than once instance of the same widget.
14+
15+
#### `placement` (string, optional) {#placement}
16+
17+
Default: `'top-left'`
18+
19+
Widget position within the view relative to the map container. Valid options are `top-left`, `top-right`, `bottom-left`, `bottom-right`, or `fill`.
20+
21+
#### `label` (string, optional) {#label}
22+
23+
Tooltip message displayed while hovering a mouse over the widget.
24+
25+
Default: `'Loading data'`
26+
27+
#### `style` (object, optional) {#style}
28+
29+
Default: `{}`
30+
31+
Additional CSS styles for the widget. camelCase CSS properties (e.g. `backgroundColor`) and kabab-case CSS variables are accepted (e.g. `--button-size`).
32+
33+
#### `className` (string, optional) {#classname}
34+
35+
Default: `undefined`
36+
37+
Class name to attach to the widget element. The element has the default class name of `deck-widget deck-loading-widget`.

docs/api-reference/widgets/overview.md

Lines changed: 2 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -95,123 +95,6 @@ new Deck({
9595
});
9696
```
9797

98-
## CSS Theming
98+
## Themes and Styling
9999

100-
Customizing the appearance of widgets beyond light and dark mode can be achieved using CSS variables. This section provides guidance on how to theme widgets at different levels of specificity.
101-
102-
### Global Theming
103-
104-
Apply to all widgets with the `.deck-widget` selector.
105-
106-
```css
107-
.deck-widget {
108-
--button-size: 48px;
109-
}
110-
```
111-
112-
> Note: While variables can be globally applied using the `:root` selector, ensuring their availability throughout the entire document, this method is not recommended. Applying variables globally can lead to naming conflicts, especially in larger projects or when integrating with other libraries.
113-
114-
### Type-specific Theming
115-
116-
Theme a specific type of widget using the `.deck-widget-[type]` selector.
117-
118-
```css
119-
.deck-widget-fullscreen {
120-
--button-size: 48px;
121-
}
122-
```
123-
124-
### Instance-specific Theming
125-
126-
Apply styles to a single instance of a widget using inline styles.
127-
128-
```js
129-
new FullscreenWidget({ style: {'--button-size': '48px'}})
130-
```
131-
132-
To style hyphenated CSS properties (e.g. `background-color`, `border-color`, etc.), use the camelCase equivalent.
133-
134-
```js
135-
new FullscreenWidget({ style: {'backgroundColor': '#fff'}})
136-
```
137-
138-
### Custom Class Theming
139-
140-
Define a custom class with your desired styles and apply it to a widget.
141-
142-
```css
143-
.my-class {
144-
--button-size: 48px;
145-
}
146-
```
147-
```js
148-
new FullscreenWidget({ className: 'my-class'})
149-
```
150-
151-
## Customizable CSS Variables
152-
153-
We've provided a set of CSS variables to make styling UI Widgets more convenient. These variables allow for customization of widget sizes, colors, and other properties. Below is a comprehensive list of these variables, their expected types, and default values:
154-
155-
### Size
156-
157-
| Name | Type | Default |
158-
| ---- | ---- | ------- |
159-
| `--button-size` | [Dimension](https://developer.mozilla.org/en-US/docs/Web/CSS/dimension) | `28px` |
160-
| `--button-border-radius` | [Dimension](https://developer.mozilla.org/en-US/docs/Web/CSS/dimension) | `8px` |
161-
| `--widget-margin` | [Dimension](https://developer.mozilla.org/en-US/docs/Web/CSS/dimension) | `12px` |
162-
163-
### Color
164-
165-
| Name | Type | Default |
166-
| ---- | ---- | ------- |
167-
| `--button-background` | [Color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value) | `#fff` |
168-
| `--button-stroke` | [Color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value) | `rgba(255, 255, 255, 0.3)` |
169-
| `--button-inner-stroke` | [Border](https://developer.mozilla.org/en-US/docs/Web/CSS/border) | `unset` |
170-
| `--button-shadow` | [Box Shadow](https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow) | `0px 0px 8px 0px rgba(0, 0, 0, 0.25)` |
171-
| `--button-backdrop-filter` | [Backdrop Filter](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter) | `unset` |
172-
| `--button-icon-idle` | [Color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value) | `rgba(97, 97, 102, 1)` |
173-
| `--button-icon-hover` | [Color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value) | `rgba(24, 24, 26, 1)` |
174-
| `--icon-compass-north-color` | [Color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value) | `#F05C44` |
175-
| `--icon-compass-south-color` | [Color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value) | `#C2C2CC` |
176-
177-
### Icon
178-
179-
| Name | Type | Default |
180-
| ---- | ---- | ------- |
181-
| `--icon-fullscreen-enter` | [SVG Data Url](https://developer.mozilla.org/en-US/docs/Web/CSS/url#using_a_data_url) | [Material Symbol Fullscreen](https://fonts.google.com/icons?selected=Material+Symbols+Rounded:fullscreen:FILL@0;wght@400;GRAD@0;opsz@40) |
182-
| `--icon-fullscreen-enter` | [SVG Data Url](https://developer.mozilla.org/en-US/docs/Web/CSS/url#using_a_data_url) | [Material Symbol Fullscreen Exit](https://fonts.google.com/icons?selected=Material+Symbols+Rounded:fullscreen_exit:FILL@0;wght@400;GRAD@0;opsz@40) |
183-
| `--icon-zoom-in` | [SVG Data Url](https://developer.mozilla.org/en-US/docs/Web/CSS/url#using_a_data_url) | [Material Symbol Add](https://fonts.google.com/icons?selected=Material+Symbols+Rounded:add:FILL@0;wght@600;GRAD@0;opsz@40) |
184-
| `--icon-zoom-out` | [SVG Data Url](https://developer.mozilla.org/en-US/docs/Web/CSS/url#using_a_data_url) | [Material Symbol Remove](https://fonts.google.com/icons?selected=Material+Symbols+Rounded:remove:FILL@0;wght@600;GRAD@0;opsz@40) |
185-
| `--icon-camera` | [SVG Data Url](https://developer.mozilla.org/en-US/docs/Web/CSS/url#using_a_data_url) | [Material Symbol Photo Camera](https://fonts.google.com/icons?selected=Material+Symbols+Outlined:photo_camera:FILL@0;wght@400;GRAD@0;opsz@24&icon.query=picture&icon.size=24&icon.color=%23000000) |
186-
187-
#### Replacing Icons
188-
189-
Users can to customize icons to better align with their design preferences or branding. This section provides a step-by-step guide on how to replace and customize these icons.
190-
191-
1. Prepare Your Icons:
192-
- Ensure your icons are available as [SVG Data Url](https://developer.mozilla.org/en-US/docs/Web/CSS/url#using_a_data_url). These will be used for a CSS [mask-image](https://developer.mozilla.org/en-US/docs/Web/CSS/mask-image).
193-
2. Icon Replacement:
194-
- Use CSS variables, such as `--icon-fullscreen-enter`, to replace the default icons with your customized ones.
195-
3. Color Customization:
196-
- The original color embedded in your SVG will be disregarded. However, it's crucial that the SVG isn't transparent.
197-
- Customize the color of your icon using the appropriate CSS variable, such as `--button-icon-idle`.
198-
199-
Example:
200-
```css
201-
.deck-widget {
202-
--icon-fullscreen-enter: url('path_to_your_svg_icon.svg');
203-
--button-icon-idle: blue;
204-
}
205-
```
206-
207-
#### Icon Recommendations
208-
209-
If possible, make the new icon re-colorable, resizable, and replaceable with CSS.
210-
211-
- Give the SVG a black fill for color masking
212-
- Convert your SVG to CSS with a convertor like [this](https://www.svgbackgrounds.com/tools/svg-to-css/).
213-
- Remove height and width attributes (widget sets to 100%)
214-
- Add css to the stylesheet like [this](https://github.com/visgl/deck.gl/blob/9752123d560ed9cf7cda62b6e83104b9a930e0df/modules/widgets/src/stylesheet.css#L132)
215-
- Use a unique CSS class name and variable for the icon.
216-
217-
For consistency with the other icons in the core set, you can use [Google Symbols](https://fonts.google.com/icons).
100+
deck.gl widget appearance can be customized using [themes and CSS](./styles).

docs/api-reference/widgets/reset-view-widget.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# ResetViewWidget
22

3-
This widget resets the view state of a deck.gl viewport to its initial state. The user clicks the widget to return to the initial view.
3+
This widget resets the view state of a deck.gl viewport to its initial state. The user clicks the widget to return to the initial view.
44

55
## Props
66

77
#### `id` (string, optional) {#id}
88

99
Default: `'reset-view'`
1010

11-
The `id` must be unique among all your widgets at a given time.
11+
The `id` must be unique among all your widgets at a given time.
1212

1313
Note: It is necessary to set `id` explicitly if you have more than once instance of the same widget.
1414

@@ -35,3 +35,12 @@ Additional CSS styles for the widget. camelCase CSS properties (e.g. `background
3535
Default: `undefined`
3636

3737
Class name to attach to the widget element. The element has the default class name of `deck-widget deck-reset-view-widget`.
38+
39+
## Styles
40+
41+
| Name | Type | Default |
42+
| ------------------- | ------------------------ | --------------------------------------------- |
43+
| `--icon-reset-view` | [SVG Data Url][data_url] | [Material Symbol Fullscreen][icon_reset_view] |
44+
45+
[data_url]: https://developer.mozilla.org/en-US/docs/Web/CSS/url#using_a_data_url
46+
[icon_reset_view_url]: https://fonts.google.com/icons

docs/api-reference/widgets/screenshot-widget.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
# ScreenshotWidget
22

3+
<p class="badges">
4+
<img src="https://img.shields.io/badge/from-v9.2-green.svg?style=flat-square" alt="from v9.2" />
5+
</p>
6+
37
This widget captures and downloads the deck.gl screen (canvas). Click the widget to capture an image of the screen. The image will be downloaded by the browser into the user's "download" folder.
48

5-
:::caution
9+
:::caution
610
Only the deck.gl canvas is captured, not other HTML DOM element underneath or on top of that canvas. This means that e.g. a non-interleaved basemap, or any widgets, will not be captured.
711
It is possible to use `props.onCapture` to integrate with more advanced screen capture modules such as [html2canvas](https://html2canvas.hertzen.com/)
812
:::
@@ -13,7 +17,7 @@ It is possible to use `props.onCapture` to integrate with more advanced screen c
1317

1418
Default: `'screenshot'`
1519

16-
The `id` must be unique among all your widgets at a given time.
20+
The `id` must be unique among all your widgets at a given time.
1721

1822
Note: It is necessary to set `id` explicitly if you have more than once instance of the same widget.
1923

@@ -43,7 +47,6 @@ onCapture(widget: ScreenshotWidget): void
4347

4448
Allows the application to define its own capture logic, perhaps to integrate a more advanced screen capture module such as [html2canvas](https://html2canvas.hertzen.com/).
4549

46-
4750
#### `style` (object, optional) {#style}
4851

4952
Default: `{}`
@@ -55,3 +58,12 @@ Additional CSS styles for the widget. camelCase CSS properties (e.g. `background
5558
Default: `undefined`
5659

5760
Class name to attach to the widget element. The element has the default class name of `deck-widget deck-screenshot-widget`.
61+
62+
## Styles
63+
64+
| Name | Type | Default |
65+
| --------------- | ------------------------ | ----------------------------------------------- |
66+
| `--icon-camera` | [SVG Data Url][data_url] | [Material Symbol Photo Camera][camera_icon_url] |
67+
68+
[data_url]: https://developer.mozilla.org/en-US/docs/Web/CSS/url#using_a_data_url
69+
[camera_icon_utl]: https://fonts.google.com/icons?selected=Material+Symbols+Outlined:photo_camera:FILL@0;wght@400;GRAD@0;opsz@24&icon.query=picture&icon.size=24&icon.color=%23000000

0 commit comments

Comments
 (0)