Skip to content

Commit a46aac7

Browse files
7.0 what's new and upgrade guide (visgl#2823)
1 parent 641f5b1 commit a46aac7

File tree

3 files changed

+162
-4
lines changed

3 files changed

+162
-4
lines changed

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
workers/
22
**/dist*/**/*.js
3+
dist.js
34
*.min.js
45
**/mapbox-gl-dev.js
56
**/mapbox-gl.js

docs/upgrade-guide.md

+69
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,74 @@
11
# Upgrade Guide
22

3+
## Upgrading from deck.gl v6.4 to v7.0
4+
5+
#### Submodule Structure and Dependency Changes
6+
7+
- `@deck.gl/core` is moved from `dependencies` to `devDependencies` for all submodules. This will reduce the runtime error caused by installing multiple copies of the core.
8+
- The master module `deck.gl` now include all submodules except `@deck.gl/test-utils`. See [list of submodules](/docs/get-started/getting-started.md#selectively-install-dependencies) for details.
9+
- `ContourLayer`, `GridLayer`, `HexagonLayer` and `ScreenGridLayer` are moved from `@deck.gl/layers` to `@deck.gl/aggregation-layers`. No action is required if you are importing them from `deck.gl`.
10+
- `@deck.gl/experimental-layers` is deprecated. Experimental layers will be exported from their respective modules with a `_` prefix.
11+
+ `BitmapLayer` is moved to `@deck.gl/layers`.
12+
+ `MeshLayer` is renamed to `SimpleMeshLayer` and moved to `@deck.gl/mesh-layers`.
13+
+ `TileLayer` and `TripsLayer` are moved to `@deck.gl/geo-layers`.
14+
15+
#### Layers
16+
17+
- `HexagonCellLayer` is removed. Use [ColumnLayer](/docs/layers/column-layer.md) with `diskResolution: 6` instead.
18+
- `ArcLayer` and `LineLayer`'s `getStrokeWidth` props are deprecated. Use `getWidth` instead.
19+
- The following former experimental layers' APIs are redesigned as they graduate to official layers. Refer to their documentations for details:
20+
- [BitmapLayer](/docs/layers/column-layer.md)
21+
- [SimpleMeshLayer](/docs/layers/simple-mesh-layer.md)
22+
- [TileLayer](/docs/layers/tile-layer.md)
23+
- [TripsLayer](/docs/layers/trips-layer.md)
24+
25+
#### Lighting
26+
27+
The old experimental prop `lightSettings` in many 3D layers is no longer supported. The new and improved settings are split into two places: a [material](https://github.com/uber/luma.gl/tree/master/docs/api-reference/core/materials) prop for each 3D layer and a shared set of lights specified by [LightingEffect](/docs/effects/lighting-effect.md) with the [effects prop of Deck](/docs/api-reference/deck.md#effects).
28+
29+
30+
## Upgrading from deck.gl v6.3 to v6.4
31+
32+
#### OrthographicView
33+
34+
The experimental `OrthographicView` class has the following breaking changes:
35+
36+
- `zoom` is reversed (larger value means zooming in) and switched to logarithmic scale.
37+
- Changed view state defaults:
38+
+ `zoom` - `1` -> `0`
39+
+ `offset` - `[0, 1]` -> `[0, 0]`
40+
+ `minZoom` - `0.1` -> `-10`
41+
- `eye`, `lookAt` and `up` are now set in the `OrthographicView` constructor instead of `viewState`.
42+
43+
#### ScatterplotLayer
44+
45+
Deprecations:
46+
47+
- `outline` is deprecated: use `stroked` instead.
48+
- `strokeWidth` is deprecated: use `getLineWidth` instead. Note that while `strokeWidth` is in pixels, line width is now pecified in meters. The old appearance can be achieved by using `lineWidthMinPixels` and/or `lineWidthMaxPixels`.
49+
- `getColor` is deprecated: use `getFillColor` and `getLineColor` instead.
50+
51+
Breaking changes:
52+
53+
- `outline` / `stroked` no longer turns off fill. Use `filled: false` instead.
54+
55+
#### GeoJsonLayer
56+
57+
Breaking changes:
58+
59+
- `stroked`, `getLineWidth` and `getLineColor` props now apply to point features (rendered with a ScatterplotLayer) in addition to polygon features. To revert to the old appearance, supply a `_subLayerProps` override:
60+
61+
```js
62+
new GeoJsonLayer({
63+
// ...other props
64+
stroked: true,
65+
_subLayerProps: {
66+
points: {stroked: false}
67+
}
68+
});
69+
```
70+
71+
372
## Upgrading from deck.gl v6.2 to v6.3
473

574
#### GridLayer and HexagonLayer

docs/whats-new.md

+92-4
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,108 @@ Target Release Date: Mar, 2019
1313
<img height=200 src="https://raw.github.com/uber-common/deck.gl-data/master/images/whats-new/s2-layer.png" />
1414
<p><i>S2Layer</i></p>
1515
</td>
16+
<td>
17+
<img height=200 src="https://raw.github.com/uber-common/deck.gl-data/master/images/whats-new/mesh-layer.gif" />
18+
<p><i>MeshLayer</i></p>
19+
</td>
20+
<td>
21+
<img height=200 src="https://raw.github.com/uber-common/deck.gl-data/master/images/whats-new/tile-layer.jpg" />
22+
<p><i>TileLayer</i></p>
23+
</td>
1624
</tr>
1725
</tbody>
1826
</table>
1927

20-
21-
### New Layer Catalog: S2 Layers (Experimental)
22-
23-
The new `@deck.gl/s2-layers` module contains an `S2Layer` that understands geospatial indices from the [S2 Geometry Library](http://s2geometry.io/).
28+
### New Effects System
29+
30+
A new effects system is written from the ground up for v7.0. This opens the possibilities for many exciting visual effect features down the road. As a start, we're introducing [LightingEffect](/docs/effects/lighting-effect.md) - an easier, more comprehensive way to control the lighting for your layers.
31+
32+
### New Layer Catalog
33+
34+
As the number of deck.gl layers grow, we are splitting existing and new layers into multiple submodules for better dependency management. These new layer modules are:
35+
36+
* `@deck.gl/layers` - Primitive layers that are the building blocks of all visualizations
37+
- [ArcLayer](/docs/layers/arc-layer.md)
38+
- [BitmapLayer](/docs/layers/bitmap-layer.md) **New**
39+
- [ColumnLayer](/docs/layers/column-layer.md) **New**
40+
- [GeoJsonLayer](/docs/layers/geojson-layer.md)
41+
- [GridCellLayer](/docs/layers/grid-cell-layer.md)
42+
- [IconLayer](/docs/layers/icon-layer.md)
43+
- [LineLayer](/docs/layers/line-layer.md)
44+
- [PathLayer](/docs/layers/path-layer.md)
45+
- [PointCloudLayer](/docs/layers/point-cloud-layer.md)
46+
- [PolygonLayer](/docs/layers/polygon-layer.md)
47+
- [ScatterplotLayer](/docs/layers/scatterplot-layer.md)
48+
- [SolidPolygonLayer](/docs/layers/solid-polygon-layer.md)
49+
- [TextLayer](/docs/layers/text-layer.md)
50+
* `@deck.gl/aggregation-layers` - Advanced layers that aggregate data into alternative representations, e.g. heatmap, contour, hex bins, etc.
51+
- [ContourLayer](/docs/layers/contour-layer.md)
52+
- [GPUGridLayer](/docs/layers/gpu-grid-layer.md)
53+
- [GridLayer](/docs/layers/grid-layer.md)
54+
- [HexagonLayer](/docs/layers/hexagon-layer.md)
55+
- [ScreenGridLayer](/docs/layers/screen-grid-layer.md)
56+
* `@deck.gl/geo-layers` - Additional layers that handle geospatial use cases and GIS formats.
57+
- [GreatCircleLayer](/docs/layers/great-circle-layer.md) **New**
58+
- [H3ClusterLayer](/docs/layers/h3-cluster-layer.md) **New**
59+
- [H3HexagonLayer](/docs/layers/h3-hexagon-layer.md) **New**
60+
- [S2Layer](/docs/layers/s2-layer.md) **New**
61+
- [TileLayer](/docs/layers/tile-layer.md) **New**
62+
- [TripsLayer](/docs/layers/trips-layer.md) **New**
63+
* `@deck.gl/mesh-layers` - Additional layers that render 3D meshes and [scene graphs](https://en.wikipedia.org/wiki/Scene_graph).
64+
- [SimpleMeshLayer](/docs/layers/simple-mesh-layer.md) **New**
65+
- [ScenegraphLayer](/docs/layers/scene-graph-layer.md) **New**
66+
67+
### Binary Data Support
68+
69+
In v7.0 we are making binary data a first-class citizen of deck.gl. Whereas the `data` prop of layers only accepted JavaScript arrays in the past, you may now provide a non-iterable object to `data`.
70+
71+
### Improved Test Utilities
72+
73+
The `@deck.gl/test-utils` module is revamped with two new exports:
74+
* [`generateLayerTests`](/docs/api-reference/test-utils/generate-layer-tests.md) - automatically create test cases for use with [`testLayer`](/docs/api-reference/test-utils/test-layer.md) to test layer conformance.
75+
* [`SnapshotTestRunner`](/docs/api-reference/test-utils/snapshot-test-runner.md) - automated integration test for WebGL. Renders deck.gl layers, takes screenshot and compare with golden images in headless Chromium.
2476

2577

2678
## deck.gl v6.4
2779

2880
Release Date: Jan 29, 2019
2981

82+
<table style="border: 0;" align="center">
83+
<tbody>
84+
<tr>
85+
<td>
86+
<img height=200 src="https://raw.github.com/uber-common/deck.gl-data/master/images/whats-new/deck64-sdf.gif" />
87+
<p><i>SDF font in TextLayer</i></p>
88+
</td>
89+
<td>
90+
<img height=200 src="https://raw.github.com/uber-common/deck.gl-data/master/images/whats-new/deck64-scatterplot.jpg" />
91+
<p><i>Stroke and fill in ScatterplotLayer</i></p>
92+
</td>
93+
<td>
94+
<img height=200 src="https://raw.github.com/uber-common/deck.gl-data/master/images/whats-new/deck64-isoband.jpg" />
95+
<p><i>Isoband in ContourLayer</i></p>
96+
</td>
97+
</tr>
98+
</tbody>
99+
</table>
100+
101+
### Layer API Improvements
102+
103+
- `ScatterplotLayer` now supports drawing both stroke and fill, and outline width can be controlled per-instance.
104+
- `ContourLayer` now supports isoband - filling between two thresholds.
105+
- `ScreenGridLayer` now supports aggregating by min/max/mean.
106+
- `TextLayer` adds new props that allow better control of the font rendering quality, including font weight and raster size. The layer can also optionally generate a font atlas with [Signed Distance Fields](http://cs.brown.edu/people/pfelzens/papers/dt-final.pdf), which yields a much crisper look when rendering large font sizes.
107+
- `IconLayer` supports dynamically packed icon atlas. Users can now load programatically generated image urls as icons, for example Facebook profile images.
108+
- `PathLayer`'s `getPath` and `PolygonLayer`'s `getPolygon` props now support flattened coordinates instead of nested arrays, making it easier for these layers to use binary data.
109+
110+
See each layer's documentation for full API changes.
111+
112+
113+
### Composite Layer Customization (experimental)
114+
115+
It is now possible to fine-tune sublayer appearances by passing a new experimental prop `_subLayerProps` to a composite layer. For example, in a `GeoJsonLayer`, one may wish to make only the point features interactive, or replace the circles with icons.
116+
117+
This offers a light alternative to overriding composite layer behaviors without creating a custom class. See [CompositeLayer](/docs/api-reference/composite-layer.md) for details.
30118

31119
## deck.gl v6.3
32120

0 commit comments

Comments
 (0)