v5.2.0
deck.gl v5.2
Release date: April 24, 2018
New TextLayer |
ScreenGridLayer Color Scale |
Automated Render Tests @deck.gl/test-utils |
Use deck.gl without React
deck.gl can now be used in non-React applications. A new top-level JavaScript class Deck
is provided as an alternative to the traditional top-level DeckGL
React component, and the core deck.gl npm module no longer has any React dependencies. This allows deck.gl to be used in any JavaScript application or framework.
The new non-React API is officially supported, however since it is not yet extensively battle-tested in applications there may be some rough corners, so to help developers set expectations we are labeling this as a "pre release" intended for early adopters.
Scripting Support
deck.gl now publishes a bundle that can be imported using a simple <script>
statement in HTML to give access to the deck.gl API. This makes deck.gl easy to use in e.g. "codepens" and for casual programming and visualizations.
Multiple Modules
deck.gl is now published as multiple npm modules allowing applications to choose which features to import. The basic modules are:
@deck.gl/core
- the core deck.gl API (JavaScript classes, including theDeck
top-level class).@deck.gl/react
- React bindings for deck.gl (i.e. the top-levelDeckGL
React class).deck.gl
- The classic module is still supported for backwards compatibility with React applications.
Multi-Viewport Support
deck.gl allows you to divide your screen into multiple viewports and render layers from different perspectives. It is e.g. possible to render a top-down map view next to a first person view and allow your users to "walk around" in the city onto which your data is overlaid.
The Deck.views
property accepts instances of View
classes, such as MapView
and FirstPersonView
:
<DeckGL
views=[
new MapView({id: 'map', width: '50%'}),
new FirstPersonView({x: '50%', width: '50%'})
]
/>
MapController
It is now possible to specify a MapController
as a controller
for the Deck
or DeckGL
classes, instead of relying on e.g. react-map-gl
or experimental classes to drive event handling.
Automatic Resize Handling
It is no longer necessary for deck.gl applications to track screen size and manage the exact width
and height
of the Deck
or DeckGL
components. width
and height
can now be specified using CSS descriptors (e.g. width = 100%
):
<DeckGL width='100%' height='100%'/>
Layers
TextLayer (New)
A TextLayer has been added to the core layer catalog for rendering labels with WebGL.
ScreenGridLayer
Color Scale Support (Experimental) - New experimental props colorRange
and colorDomain
are added to ScreenGridLayer. These props provide more fine tune control over how grid cells are colored, and brings the ScreenGridLayer into parity with other aggregation layers (i.e. HexagonLayer and GridLayer).
Experimental Layers
A number of experimental deck.gl layers are published in a new module @deck.gl/experimental-layers. Be aware that use of these layers come with caveats and are mainly intended for early adopters. Please refer to roadmap for more information.
Test Utilities
deck.gl now provides a suite of test utilities that make it easy to test both layers and applications. The utilities support visual regression testing against "golden" images, as well as utilities for traditional unit testing of layers. The utilities come pre-integrated with tools that help automate the running of browser based render tests from the console. To start using the utilities, install the new (@deck.gl/test-utils) module.
Dist Size Reduction
Work on bundle size reduction continues. In this release, the focus has been on leveraging the tree-shaking abilities of the Babel 7 and Webpack 4 combination. In addition, new article about Application Bundling and Tree Shaking has been added to the docs.
Shader Modules
project32 (New)
Unified 32/64-bit projection - A new common API for projection is implemented in both the project64
shader module and a new project32
shader module allowing the same vertex shader can be used for both 32-bit and 64-bit projection. This simplifies adding fp64 support to layers and reduces bundle size. See docs for more details.