Skip to content

Commit

Permalink
align build systems (visgl#2398)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pessimistress authored Nov 1, 2018
1 parent 60e99cc commit 5d48b2d
Show file tree
Hide file tree
Showing 12 changed files with 182 additions and 130 deletions.
75 changes: 57 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,47 +16,86 @@
</a>
</p>

<h1 align="center">deck.gl | <a href="https://uber.github.io/deck.gl">Docs</a></h1>
<h1 align="center">deck.gl | <a href="https://uber.github.io/deck.gl">Website</a></h1>

<h5 align="center">A suite of WebGL2-powered data visualization layers</h5>
<h5 align="center"> WebGL2-powered, highly performant large-scale data visualization</h5>

[![docs](http://i.imgur.com/mvfvgf0.jpg)](https://uber.github.io/deck.gl)

Provides tested, highly performant layers for data visualization, such as scatterplots, arcs, geometries defined in GeoJSON, etc.

deck.gl has extensive documentation, please refer to the [docs website](https://uber.github.io/deck.gl) or browse it directly in the github [docs folder](./docs).
## Installation

```
npm install deck.gl
```

## Using deck.gl

deck.gl can be used through its standard JavaScript API (available both as installable npm modules as well as a "script" file for use in scripting setups). However, if you are using React you will likely want to use the provided React integration. Again, consult the extensive documentation for more details on how to access what you need.
deck.gl offers an extensive catalog of pre-packaged visualization "layers", including [ScatterplotLayer](http://deck.gl/#/documentation/deckgl-api-reference/layers/scatterplot-layer), [ArcLayer](http://deck.gl/#/documentation/deckgl-api-reference/layers/arc-layer), [TextLayer](http://deck.gl/#/documentation/deckgl-api-reference/layers/text-layer), [GeoJsonLayer](http://deck.gl/#/documentation/deckgl-api-reference/layers/geojson-layer), etc. The input to a layer is usually an array of JSON objects. Each layer offers highly-flexible API to customize how the data should be rendered.

Example constructing a deck.gl ScatterplotLayer:

```js
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,
getColor: [255, 228, 0],
});
```

## Using deck.gl with React

```js
import DeckGL from 'deck.gl';

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

To get a quick feel for what a deck.gl application's source code might look like, say the application has some data representing flights with start and end positions for each item. If it wanted to display this data as a set of arcs it would simply import and render a deck.gl `ArcLayer`:
## Using deck.gl with Pure JS

```javascript
import DeckGL, {ArcLayer} from 'deck.gl';
```js
import {Deck} from '@deck.gl/core';

const flights = new ArcLayer({
data: [] // Some flight points,
...
const deck = new Deck({
container: document.body,
width: '100vw',
height: '100vh',
longitude: -122.4,
latitude: 37.78,
zoom: 8,
controller: true,
layers: [scatterplotLayer]
});

<DeckGL width={1920} height={1080} layers={[flights]} />
```

Simple usage of deck.gl is also showcased in the [hello-world examples](./examples/get-started), using both [webpack2](./examples/get-started/react-webpack-2) and [browserify](./examples/get-started/react-browserify), so you can choose which bundler you prefer or are more familiar with.
Minimum setups of end-to-end deck.gl usage is also showcased in the [hello-world examples](./examples/get-started), using both [webpack2](./examples/get-started/react-webpack-2) and [browserify](./examples/get-started/react-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:

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 6.2-release --single-branch https://github.com/uber/deck.gl.git`
```
git clone -b 6.2-release --single-branch https://github.com/uber/deck.gl.git
```

For the most up-to-date information, see our [docs](http://uber.github.io/deck.gl/#/docs/getting-started/installation?section=running-the-examples)
For the most up-to-date information, see our [API documentations](http://deck.gl/#/documentation)


## Contributing

PRs and bug reports are welcome, and we are actively opening up the deck.gl roadmap to facilitate for external contributors.
PRs and bug reports are welcome, and we are actively opening up the deck.gl [roadmap](./dev-docs) to facilitate for external contributors.

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

Expand Down
20 changes: 10 additions & 10 deletions modules/experimental-layers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@
"type": "git",
"url": "https://github.com/uber/deck.gl.git"
},
"main": "dist/index.js",
"module": "dist-es6/index.js",
"main": "dist/es5/index.js",
"module": "dist/esm/index.js",
"esnext": "dist/es6/index.js",
"files": [
"dist",
"dist-es6",
"src"
"src",
"README.md"
],
"sideEffects": false,
"scripts": {
"build-clean": "rm -fr dist dist-es6 && mkdir -p dist dist-es6",
"build-es6": "rm -fr dist-es6 && BABEL_ENV=es6 babel src --out-dir dist-es6 --source-maps inline",
"build-es5": "rm -fr dist && BABEL_ENV=es5 babel src --out-dir dist --source-maps inline",
"build": "npm run build-clean && npm run build-es6 && npm run build-es5",
"test": "npm run lint && npm run build && npm run test-node",
"test-node": "node test/node.js"
"clean": "rm -fr dist dist-es6 && mkdir -p dist/es5 dist/esm dist/es6",
"build-es6": "BABEL_ENV=es6 babel src --out-dir dist/es6 --source-maps --ignore 'node_modules/'",
"build-esm": "BABEL_ENV=esm babel src --out-dir dist/esm --source-maps --ignore 'node_modules/'",
"build-es5": "BABEL_ENV=es5 babel src --out-dir dist/es5 --source-maps --ignore 'node_modules/'",
"build": "npm run clean && npm run build-es6 && npm run build-esm && npm run build-es5"
},
"dependencies": {
"@deck.gl/core": "^6.3.0-alpha.1",
Expand Down
31 changes: 0 additions & 31 deletions modules/experimental-layers/test/node-dist.js

This file was deleted.

31 changes: 0 additions & 31 deletions modules/experimental-layers/test/node.js

This file was deleted.

3 changes: 3 additions & 0 deletions modules/json/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../.babelrc"
}
20 changes: 10 additions & 10 deletions modules/json/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@
"type": "git",
"url": "https://github.com/uber/deck.gl.git"
},
"main": "dist/index.js",
"module": "dist-es6/index.js",
"main": "dist/es5/index.js",
"module": "dist/esm/index.js",
"esnext": "dist/es6/index.js",
"files": [
"dist",
"dist-es6",
"src"
"src",
"README.md"
],
"sideEffects": false,
"scripts": {
"build-clean": "rm -fr dist dist-es6 && mkdir -p dist dist-es6",
"build-es6": "rm -fr dist-es6 && BABEL_ENV=es6 babel src --out-dir dist-es6 --source-maps inline",
"build-es5": "rm -fr dist && BABEL_ENV=es5 babel src --out-dir dist --source-maps inline",
"build": "npm run build-clean && npm run build-es6 && npm run build-es5",
"test": "npm run lint && npm run build && npm run test-node",
"test-node": "node test/node.js"
"clean": "rm -fr dist dist-es6 && mkdir -p dist/es5 dist/esm dist/es6",
"build-es6": "BABEL_ENV=es6 babel src --out-dir dist/es6 --source-maps --ignore 'node_modules/'",
"build-esm": "BABEL_ENV=esm babel src --out-dir dist/esm --source-maps --ignore 'node_modules/'",
"build-es5": "BABEL_ENV=es5 babel src --out-dir dist/es5 --source-maps --ignore 'node_modules/'",
"build": "npm run clean && npm run build-es6 && npm run build-esm && npm run build-es5"
},
"dependencies": {
"@deck.gl/core": "^6.3.0-alpha.1",
Expand Down
3 changes: 2 additions & 1 deletion modules/layers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"esnext": "dist/es6/index.js",
"files": [
"dist",
"src"
"src",
"README.md"
],
"sideEffects": false,
"scripts": {
Expand Down
71 changes: 68 additions & 3 deletions modules/main/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,70 @@
# deck.gl "Main" Module

This is an umbrella module for [deck.gl](http://deck.gl/#/) react users.
# deck.gl

Note: This module is mainly supported for legacy reasons, it just imports and re-exports the `@deck.gl/core`, `@deck.gl/layers` and `@deck.gl/react` modules.
A WebGL2-powered, highly performant framework for large-scale data visualization.

[API Documentation](http://deck.gl/#/documentation)

[![docs](http://i.imgur.com/mvfvgf0.jpg)](https://uber.github.io/deck.gl)

## Installation

```
npm install deck.gl
```

## Using deck.gl

deck.gl offers an extensive catalog of pre-packaged visualization "layers", including [ScatterplotLayer](http://deck.gl/#/documentation/deckgl-api-reference/layers/scatterplot-layer), [ArcLayer](http://deck.gl/#/documentation/deckgl-api-reference/layers/arc-layer), [TextLayer](http://deck.gl/#/documentation/deckgl-api-reference/layers/text-layer), [GeoJsonLayer](http://deck.gl/#/documentation/deckgl-api-reference/layers/geojson-layer), etc. The input to a layer is usually an array of JSON objects. Each layer offers highly-flexible API to customize how the data should be rendered.

Example constructing a deck.gl ScatterplotLayer:

```js
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,
getColor: [255, 228, 0],
});
```

## Using deck.gl with React

```js
import DeckGL from 'deck.gl';

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

## Using deck.gl with Pure JS

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

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


Questions? Submit an issue on our [GitHub page](https://www.github.com/uber/deck.gl/issues).
3 changes: 2 additions & 1 deletion modules/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"files": [
"dist",
"deckgl.min.js",
"src"
"src",
"README.md"
],
"scripts": {
"build": "./build.sh",
Expand Down
20 changes: 10 additions & 10 deletions modules/mapbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@
"type": "git",
"url": "https://github.com/uber/deck.gl.git"
},
"main": "dist/index.js",
"module": "dist-es6/index.js",
"main": "dist/es5/index.js",
"module": "dist/esm/index.js",
"esnext": "dist/es6/index.js",
"files": [
"dist",
"dist-es6",
"src"
"src",
"README.md"
],
"sideEffects": false,
"scripts": {
"build-clean": "rm -fr dist dist-es6 && mkdir -p dist dist-es6",
"build-es6": "rm -fr dist-es6 && BABEL_ENV=es6 babel src --out-dir dist-es6 --source-maps inline",
"build-es5": "rm -fr dist && BABEL_ENV=es5 babel src --out-dir dist --source-maps inline",
"build": "npm run build-clean && npm run build-es6 && npm run build-es5",
"test": "npm run lint && npm run build && npm run test-node",
"test-node": "node test/node.js"
"clean": "rm -fr dist dist-es6 && mkdir -p dist/es5 dist/esm dist/es6",
"build-es6": "BABEL_ENV=es6 babel src --out-dir dist/es6 --source-maps --ignore 'node_modules/'",
"build-esm": "BABEL_ENV=esm babel src --out-dir dist/esm --source-maps --ignore 'node_modules/'",
"build-es5": "BABEL_ENV=es5 babel src --out-dir dist/es5 --source-maps --ignore 'node_modules/'",
"build": "npm run clean && npm run build-es6 && npm run build-esm && npm run build-es5"
},
"dependencies": {
"@deck.gl/core": "^6.3.0-alpha.1"
Expand Down
16 changes: 10 additions & 6 deletions modules/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,21 @@
"type": "git",
"url": "https://github.com/uber/deck.gl.git"
},
"main": "dist/index.js",
"main": "dist/es5/index.js",
"module": "dist/esm/index.js",
"esnext": "dist/es6/index.js",
"files": [
"dist",
"src"
"src",
"README.md"
],
"sideEffects": false,
"scripts": {
"build-clean": "rm -fr dist dist-es6 && mkdir -p dist dist-es6",
"build-es6": "rm -fr dist-es6 && BABEL_ENV=es6 babel src --out-dir dist-es6 --source-maps inline",
"build-es5": "rm -fr dist && BABEL_ENV=es5 babel src --out-dir dist --source-maps inline",
"build": "npm run build-clean && npm run build-es5"
"clean": "rm -fr dist dist-es6 && mkdir -p dist/es5 dist/esm dist/es6",
"build-es6": "BABEL_ENV=es6 babel src --out-dir dist/es6 --source-maps --ignore 'node_modules/'",
"build-esm": "BABEL_ENV=esm babel src --out-dir dist/esm --source-maps --ignore 'node_modules/'",
"build-es5": "BABEL_ENV=es5 babel src --out-dir dist/es5 --source-maps --ignore 'node_modules/'",
"build": "npm run clean && npm run build-es6 && npm run build-esm && npm run build-es5"
},
"dependencies": {
"@deck.gl/core": "^6.3.0-alpha.1",
Expand Down
Loading

0 comments on commit 5d48b2d

Please sign in to comment.