Skip to content

Commit 76fe082

Browse files
authored
website: Update whatsnew (#9784)
1 parent bc526d8 commit 76fe082

28 files changed

+300
-70
lines changed

docs/api-reference/core/widget.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ The `Widget` class is a base class used to define new widgets and should not be
99

1010
## Types
1111

12-
#### `WidgetProps` (object) {#props}
12+
#### `WidgetProps` (object) {#widgetprops}
1313

1414
Options for the widget, as passed into the constructor and can be updated with `setProps`.
1515

16-
#### `id` {#id}
16+
#### `id` (string) {#id}
1717

1818
The `id` string must be unique among all your widgets at a given time. While a default `id` is provided, it is recommended to set `id` explicitly if you have multiple widgets of the same type.
1919

@@ -41,25 +41,25 @@ Widget positioning within the view. One of:
4141
- `'bottom-right'`
4242
- `'fill'`
4343

44-
#### `style`
44+
#### `style` (object, optional) {#style}
4545

46-
CSS inline style overrides.
46+
Additional inline CSS styles on the top HTML element.
4747

4848
```ts
4949
style?: Partial<CSSStyleDeclaration>;
5050
```
5151

52-
#### `className`
52+
* Default: `{}`
5353

54-
Additional CSS classnames for interaction with custom stylesheets.
54+
#### `className` (string, optional) {#classname}
55+
56+
Additional CSS classnames on the top HTML element.
5557

56-
```ts
57-
className?: string;
58-
```
58+
* Default: `''`
5959

6060
### Methods for Widget Writers
6161

62-
#### `constructor`
62+
#### `constructor` {#constructor}
6363

6464
Supply the props and default props to the base class.
6565

@@ -71,7 +71,7 @@ Called to update widget options.
7171

7272
Updates the widget. Called by the specific widget when state has changed. Calls `onRenderHTML()`
7373

74-
#### `onRenderHTML`
74+
#### `onRenderHTML` {#onrenderhtml}
7575

7676
This function is implemented by the specific widget subclass to update the HTML for the widget
7777

docs/api-reference/layers/line-layer.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# LineLayer
2+
![webgpu](https://img.shields.io/badge/webgpu-supported-blue.svg?style=flat-square)
23

34
import {LineLayerDemo} from '@site/src/doc-demos/layers';
45

docs/api-reference/layers/point-cloud-layer.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# PointCloudLayer
2+
[webgpu](https://img.shields.io/badge/webgpu-supported-blue.svg?style=flat-square)
23

34
import {PointCloudLayerDemo} from '@site/src/doc-demos/layers';
45

docs/api-reference/layers/scatterplot-layer.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# ScatterplotLayer
2+
![webgpu](https://img.shields.io/badge/webgpu-supported-blue.svg?style=flat-square)
23

34
import {ScatterplotLayerDemo} from '@site/src/doc-demos/layers';
45

docs/api-reference/layers/text-layer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ If `true`, the text always faces camera. Otherwise the text faces up (z).
198198

199199
Whether to render background for the text blocks.
200200

201-
#### `backgroundBorderRadius` (number | number[4], optional) {#backgroundBorderRadius}
201+
#### `backgroundBorderRadius` (number | number[4], optional) {#backgroundborderradius}
202202

203203
- Default `0`
204204

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ const deck = new Deck({
1818

1919
## Types
2020

21-
### `CompassWidgetProps`
21+
### `CompassWidgetProps` {#compasswidgetprops}
2222

23-
The `CompassWidget` accepts the generic [`WidgetProps`](../core/widget.md#props):
23+
The `CompassWidget` accepts the generic [`WidgetProps`](../core/widget.md#widgetprops):
2424

2525
- `id` (default `'compass'`) - Unique id for this widget
2626
- `placement` (default `'top-left'`) - Widget position within the view relative to the map container
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import {WidgetPreview} from '@site/src/doc-demos/widgets';
2+
import {_ContextMenuWidget as ContextMenuWidget} from '@deck.gl/widgets';
3+
4+
# ContextMenuWidget (Experimental)
5+
6+
Displays a context menu on right-click events with customizable menu items based on picked objects.
7+
8+
<WidgetPreview cls={ContextMenuWidget}/>
9+
10+
```ts
11+
import {Deck} from '@deck.gl/core';
12+
import {_ContextMenuWidget as ContextMenuWidget} from '@deck.gl/widgets';
13+
14+
const deck = new Deck({
15+
widgets: [
16+
new ContextMenuWidget({
17+
getMenuItems: (info, widget) => {
18+
if (info.object) {
19+
const name = info.object.properties.name;
20+
return [
21+
{key: 'name', label: name},
22+
{key: 'delete', label: 'Delete'}
23+
];
24+
}
25+
return [{label: 'Add Point', key: 'add'}];
26+
},
27+
onMenuItemSelected: (key, pickInfo) => {
28+
if (key === 'add') addPoint(pickInfo);
29+
if (key === 'delete') deletePoint(pickInfo);
30+
}
31+
})
32+
]
33+
});
34+
```
35+
36+
## Types
37+
38+
### `ContextMenuWidgetProps` {#contextmenuwidgetprops}
39+
40+
The `ContextMenuWidget` accepts the generic [`WidgetProps`](../core/widget.md#widgetprops) and:
41+
42+
- `id` (string, default: `'context'`) - **Required.** Unique id for this widget
43+
- `getMenuItems` (function) - **Required.** Function that returns menu items based on the picked object. Receives `PickingInfo` and returns an array of `ContextWidgetMenuItem` objects or `null`.
44+
- `onMenuItemSelected` (function, optional) - Callback invoked when a menu item is selected. Receives the selected item key and `PickingInfo`.
45+
- `visible` (boolean, default `false`) - Controls visibility of the context menu.
46+
- `position` (object, default `{x: 0, y: 0}`) - Screen position where the menu appears.
47+
- `menuItems` (array, default `[]`) - Current menu items to display.
48+
49+
### `ContextWidgetMenuItem` {#contextwidgetmenuitem}
50+
51+
Menu item definition:
52+
53+
- `label` (string) - Display text for the menu item
54+
- `key` (string) - Unique identifier for the menu item
55+
56+
## Behavior
57+
58+
- Right-click events trigger the context menu
59+
- Menu items are dynamically generated based on what was clicked
60+
- Click elsewhere to hide the menu
61+
- Menu automatically positions itself at the cursor location

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ new Deck({
1717

1818
## Types
1919

20-
### `FpsWidgetProps`
20+
### `FpsWidgetProps` {#fpswidgetprops}
2121

22-
The `FpsWidget` accepts the generic [`WidgetProps`](../core/widget.md#props):
22+
The `FpsWidget` accepts the generic [`WidgetProps`](../core/widget.md#widgetprops):
2323

2424
- `id` (default `'fps'`) - Unique id for this widget
2525
- `placement` (default `'top-left'`) - Widget position within the view relative to the map container

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ const deck = new Deck({
1818

1919
## Types
2020

21-
### `FullscreenWidgetProps`
21+
### `FullscreenWidgetProps` {#fullscreenwidgetprops}
2222

23-
The `FullscreenWidget` accepts the generic [`WidgetProps`](../core/widget.md#props):
23+
The `FullscreenWidget` accepts the generic [`WidgetProps`](../core/widget.md#widgetprops):
2424

2525
- `id` (default `'fullscreen'`) - Unique id for this widget
2626
- `placement` (default `'top-left'`) - Widget position within the view relative to the map container

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

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import {WidgetPreview} from '@site/src/doc-demos/widgets';
2+
import {GeocoderWidget} from '@deck.gl/widgets';
3+
14
# GeocoderWidget
25

36
The GeocoderWidget helps the user find positions on the map.
@@ -8,7 +11,7 @@ The user types an address or coordinates into the text field and press **Go** to
811

912
Addresses that return a valid location are stored in browser local storage (up to five entries). They will appear in the drop-down for quick re-use during later visits.
1013

11-
## Usage
14+
<WidgetPreview cls={GeocoderWidget}/>
1215

1316
```ts
1417
import {GeocoderWidget} from '@deck.gl/widgets';
@@ -19,25 +22,45 @@ new Deck({
1922
});
2023
```
2124

22-
## Props
25+
## Types
26+
27+
### `GeocoderWidgetProps` {#geocoderwidgetprops}
28+
29+
The `GeocoderWidgetProps` accepts the generic [`WidgetProps`](../core/widget.md#widgetprops):
30+
31+
- `id` (default `'geocoder'`) - Unique id for this widget
32+
- `placement` (default `'top-left'`) - Widget position within the view relative to the map container
33+
- `viewId` (default `null`) - The `viewId` prop controls how a widget interacts with views.
34+
- `style` (default `{}`) - Additional inline styles on the top HTML element.
35+
- `className` (default `''`) - Additional classnames on the top HTML element.
2336

24-
The `GeocoderWidget` shares the base properties listed on the [widget overview page](./overview.md). Additional options are listed below.
37+
#### `label` (string, optional) {#label}
38+
39+
Tooltip message displayed while hovering a mouse over the widget.
40+
41+
Default: `'Geocoder'`
2542

2643
#### `geocoder` (string, optional) {#geocoder}
2744

2845
Default: `'coordinates'`
2946

3047
Which geocoding service to use. Supported values are `'coordinates'`, `'google'`, `'mapbox'`, `'opencage'`, or `'custom'`.
3148

32-
#### `apiKey` (string, optional) {#apiKey}
49+
#### `apiKey` (string, optional) {#apikey}
3350

3451
Required if `geocoder` is set to a third party provider. For quick testing, applications can use the `coordinates` geocode does not require an api key.
3552

36-
#### `customGeocoder` (optional) {#customGeocoder}
53+
#### `customGeocoder` (optional) {#customgeocoder}
3754

3855
Only used when `geocoder` is `'custom'`. A function that receives the entered text and an API key, and resolves to a `{longitude, latitude}` object when successful.
3956

40-
#### `_geolocation` (optional) {#geolocation}
57+
#### `transitionDuration` (number, optional) {#transitionduration}
58+
59+
Default: `200`
60+
61+
View state transition duration in milliseconds.
62+
63+
#### `_geolocation` (optional) {#_geolocation}
4164

4265
In addition to addresses / coordinates, one position of obvious interest is the user's own current position. This experimental option adds a `current` menu item that calls the browser's geolocation API and navigates to the user's current position. Note that this requires the user to enable geolocation in the browser.
4366

0 commit comments

Comments
 (0)