deck.gl

WebGL2 powered geospatial visualization layers

Github星跟踪图

docs

Installation

npm install deck.gl

Using deck.gl

deck.gl offers an extensive catalog of pre-packaged visualization "layers", including ScatterplotLayer, ArcLayer, TextLayer, GeoJsonLayer, etc. The input to a layer is usually an array of JSON objects. Each layer offers a highly-flexible API to customize how the data should be rendered.

Example constructing a deck.gl ScatterplotLayer:

import {ScatterplotLayer} from '@deck.gl/layers';

/**
 * data is an array of object in the shape of:
 * {
 *   "name":"Montgomery St. (MONT)",
 *   "address":"598 Market Street, San Francisco CA 94104",
 *   "entries":"43430",
 *   "exits":"45128",
 *   "coordinates":[-122.401407,37.789256]
 * }
 */
const scatterplotLayer = new ScatterplotLayer({
  id: 'bart-stations',
  data: 'https://github.com/uber-common/deck.gl-data/blob/master/website/bart-stations.json',
  getRadius: d => Math.sqrt(d.entries) / 100,
  getPosition: d => d.coordinates,
  getFillColor: [255, 228, 0],
});

Using deck.gl with React

import DeckGL from 'deck.gl';

<DeckGL
  width="100%"
  height="100%"
  initialViewState={{longitude: -122.4, latitude: 37.78, zoom: 8}}
  controller={true}
  layers={[scatterplotLayer]} />

Using deck.gl with Pure JS

import {Deck} from '@deck.gl/core';

const deck = new Deck({
  width: '100vw',
  height: '100vh',
  initialViewState: {
    longitude: -122.4,
    latitude: 37.78,
    zoom: 8
  },
  controller: true,
  layers: [scatterplotLayer]
});

Minimum setups of end-to-end deck.gl usage is also showcased in the hello-world examples, using both webpack and browserify, so you can choose which bundler you prefer or are more familiar with.

To learn how to use deck.gl through the many examples that come with the deck.gl repo, please clone the latest release branch:

git clone -b 7.3-release --single-branch https://github.com/uber/deck.gl.git

For the most up-to-date information, see our API documentations

Contributing

PRs and bug reports are welcome, and we are actively opening up the deck.gl roadmap to facilitate for external contributors.

Note that once your PR is about to be merged, you will be asked to register as a contributor by filling in a short form.

Attributions

Data sources

Data sources are listed in each example.

The deck.gl project is supported by

主要指标

概览
名称与所有者visgl/deck.gl
主编程语言TypeScript
编程语言JavaScript (语言数: 11)
平台
许可证MIT License
所有者活动
创建于2015-12-15 08:38:29
推送于2025-08-03 13:25:02
最后一次提交2025-08-03 09:17:18
发布数659
最新版本名称v9.1.14 (发布于 2025-07-28 11:50:59)
第一版名称v0.0.2 (发布于 2015-12-23 11:38:22)
用户参与
星数13.4k
关注者数1.7k
派生数2.2k
提交数5.2k
已启用问题?
问题数3188
打开的问题数397
拉请求数4654
打开的拉请求数42
关闭的拉请求数445
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?