Skip to content

Commit

Permalink
Replace dev scripts with ocular-dev-tools (visgl#2764)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pessimistress authored Mar 8, 2019
1 parent fdbf567 commit 7662afd
Show file tree
Hide file tree
Showing 40 changed files with 1,199 additions and 4,097 deletions.
60 changes: 0 additions & 60 deletions .babelrc

This file was deleted.

1 change: 0 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@
"ecmaVersion": 2017
}
}

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ node_modules/
coverage/
.nyc_output/
.vscode/
.reify-cache/

dist-bundle.js
examples/winds/data/*.html
Expand Down
3 changes: 3 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "node_modules/ocular-dev-tools/templates/.nycrc"
}
74 changes: 0 additions & 74 deletions aliases.js

This file was deleted.

15 changes: 15 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const getBabelConfig = require('ocular-dev-tools/config/babel.config');

module.exports = api => {
return getBabelConfig(api, {
plugins: [
'version-inline',
[
'remove-glsl-comments',
{
patterns: ['**/*.glsl.js']
}
]
]
});
};
50 changes: 36 additions & 14 deletions docs/get-started/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Installation

First, you need to install the deck.gl (and luma.gl) frameworks
To install the deck.gl framework:

```bash
npm install deck.gl --save
Expand All @@ -14,7 +14,8 @@ or
yarn add deck.gl
```

> As of v5.0, installing deck.gl automatically installs a compatible version of luma.gl. However if your application directly uses the luma.gl API you may still need to explicitly install `luma.gl` with your app (see remarks below).
The [deck.gl](https://www.npmjs.com/package/deck.gl) module includes all deck.gl features and their dependencies. If you want to selectively install a subset of the features, see the [Dependencies](#selectively-install-dependencies) section below.


## Running the Examples

Expand All @@ -28,27 +29,23 @@ Clone the deck.gl repo, if you haven't already
git clone git@github.com:uber/deck.gl.git
```

For most consistent results, it is recommended that you check out the latest release branch (e.g. `git checkout 6.0-release`) instead of `master` when running examples.
For most consistent results, it is recommended that you check out the latest release branch (e.g. `6.4-release`) instead of `master` when running examples.

```bash
git checkout 6.0-release
git checkout 6.4-release
```

Change directory to the example you are interested in
Change directory to the example you are interested in, e.g.

```bash
cd deck.gl/examples/...
cd deck.gl/examples/get-started/pure-js-without-map
```

Then install dependencies using the installer of your choice:

```bash
npm install
```

or

```bash
# or
yarn
```

Expand All @@ -75,7 +72,32 @@ npm run start-local
> While all examples support `npm run start-local`, there are some caveats when running against local source. Most importantly, you must make sure to run `npm install` or `yarn` in the deck.gl root folder before running `npm run start-local` in an example folder.

## Remarks
## Selectively Install Dependencies

A family of NPM modules are published as part of the deck.gl framework. The following tree shows their scope and dependencies:

- `@deck.gl/core` - Core module that handles the WebGL rendering pipeline, data management, and user interaction
+ `@deck.gl/layers` - Primitive layers that are the building blocks of all visualizations
* `@deck.gl/aggregation-layers` - Advanced layers that aggregate data into alternative representations, e.g. heatmap, contour, hex bins, etc.
* `@deck.gl/geo-layers` - Additional layers that handle geospatial use cases and GIS formats.
* `@deck.gl/mesh-layers` - Additional layers that render 3D meshes and [scene graphs](https://en.wikipedia.org/wiki/Scene_graph).
+ `@deck.gl/json` - Declarative interface that supports specifying deck.gl layers and views using a JSON format.
+ `@deck.gl/mapbox` - An integration with the [Mapbox custom layer](/docs/api-reference/mapbox/overview.md) API.
+ `@deck.gl/react` - React wrapper of deck.gl.
+ `@deck.gl/test-utils` - Testing utilities.

For example, to render a `PointCloudLayer`, you may install:

```bash
yarn add @deck.gl/core @deck.gl/layers
```

To use the `HexagonLayer` with React, you need to install:

```bash
yarn add @deck.gl/core @deck.gl/layers @deck.gl/aggregation-layers @deck.gl/react
```

While installing submodules separately affords applications the maximum control over the dependencies that it pulls in, the submodule versions are expected to be synchronized manually in order to produce consistent results.

* The need for explicitly installing luma.gl can depend on which installation tool you use (`npm install`, `yarn` etc) and exact behavior can vary between versions of these tools.
* When explicitly installing, there is a risk of getting multiple versions installed (deck.gl and luma.gl will warn at run-time in the console if multiple copies are detected). One of the best tools to debug such issues is `npm ls` and carefully checking your deck and luma version specifications in your package.json.
The `deck.gl` master module includes all submodules except for `@deck.gl/test-utils`. Most bundling solutions (Webpack, Rollup etc.) offer tree-shaking capabilities that exclude unused exports from a production build.
27 changes: 21 additions & 6 deletions docs/get-started/using-with-mapbox-gl.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,30 @@ As shown in the [examples](https://github.com/uber/deck.gl/tree/master/examples/

## About Mapbox Tokens

To show maps from a service such as Mapbox you will need to register with Mapbox and get a "token" that you need to provide to your map component. The map component will use the token to identify itself to the mapbox service which then will start serving up map tiles.
react-map-gl and the underlying Mapbox GL JS libraries are open source and free to use. However, to load the map styles and tiles from Mapbox's data service, you will need to register on their website in order to retrieve an [access token](https://docs.mapbox.com/help/how-mapbox-works/access-tokens/) required by the map component, which will be used to identify you and start serving up map tiles. The service will be free until a certain level of traffic is exceeded.

To get a token, you typically need to register (create an account) with the map data provider (mapbox), and apply for a token. The token will usually be free until a certain level of traffic is exceeded.
If you are using mapbox-gl without React, check out [Mapbox GL JS API](https://docs.mapbox.com/mapbox-gl-js/api/#accesstoken) for how to apply the token.

While the token will need to be hard-coded into your application in production, there are several ways to provide a token during development:
If you are using react-map-gl, there are several ways to provide a token to your app:

* Modify file to specify your Mapbox token,
* Set an environment variable (MapboxAccessToken) - through the use of a webpack loader or browserify transform, see the hello-world examples for details.
* Provide a token in the URL. See documentation of react-map-gl.
* Set the `MapboxAccessToken` environment variable. You may need to add additional set up to the bundler ([example](https://webpack.js.org/plugins/environment-plugin/)) so that `process.env.MapboxAccessToekn` is accessible at runtime.
* Provide it in the URL, e.g `?access_token=TOKEN`
* Pass it as a prop to the ReactMapGL instance `<ReactMapGL mapboxApiAccessToken={TOKEN} />`


### Display Maps Without A Mapbox Token

It is possible to use the map component without the Mapbox service, if you use another tile source (for example, if you host your own map tiles). You will need a custom Mapbox GL style that points to your own [vector tile source](https://www.mapbox.com/mapbox-gl-js/style-spec/), and pass it to `ReactMapGL` using the `mapStyle` prop. This custom style must match the schema of your tile source.

Open source tile schemas include:

- [TileZen schema](https://tilezen.readthedocs.io/en/latest/layers/)
- [OpenMapTiles schema ](https://openmaptiles.org/schema/)

Some useful resources for creating your own map service:

- [Mapbox Vector Tile Spec](https://www.mapbox.com/developers/vector-tiles/)
- [Open source tools](https://github.com/mapbox/awesome-vector-tiles)


## Mixing deck.gl and mapbox Layers
Expand Down
3 changes: 0 additions & 3 deletions modules/aggregation-layers/.babelrc

This file was deleted.

5 changes: 0 additions & 5 deletions modules/aggregation-layers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,7 @@
],
"sideEffects": false,
"scripts": {
"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-bundle": "webpack --config ../../scripts/bundle.config.js",
"build": "npm run clean && npm run build-es6 && npm run build-esm && npm run build-es5",
"prepublishOnly": "npm run build-bundle"
},
"dependencies": {
Expand Down
3 changes: 0 additions & 3 deletions modules/core/.babelrc

This file was deleted.

7 changes: 1 addition & 6 deletions modules/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,8 @@
"*.min.js"
],
"scripts": {
"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-bundle": "webpack --config ../../scripts/bundle.config.js",
"build": "npm run clean && npm run build-es6 && npm run build-esm && npm run build-es5",
"prepublishOnly": "npm run build && npm run build-bundle"
"prepublishOnly": "npm run build-bundle"
},
"dependencies": {
"gl-matrix": "^3.0.0",
Expand Down
3 changes: 0 additions & 3 deletions modules/geo-layers/.babelrc

This file was deleted.

5 changes: 0 additions & 5 deletions modules/geo-layers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,7 @@
],
"sideEffects": false,
"scripts": {
"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-bundle": "webpack --config ../../scripts/bundle.config.js",
"build": "npm run clean && npm run build-es6 && npm run build-esm && npm run build-es5",
"prepublishOnly": "npm run build-bundle"
},
"dependencies": {
Expand Down
3 changes: 0 additions & 3 deletions modules/json/.babelrc

This file was deleted.

9 changes: 3 additions & 6 deletions modules/json/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,13 @@
],
"sideEffects": false,
"scripts": {
"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-bundle": "webpack --config ../../scripts/bundle.config.js",
"build": "npm run clean && npm run build-es6 && npm run build-esm && npm run build-es5",
"prepublishOnly": "npm run build-bundle"
},
"dependencies": {
"@deck.gl/core": "^7.0.0-alpha.4",
"d3-dsv": "^1.0.8"
},
"peerDependencies": {
"@deck.gl/core": "^7.0.0-alpha.4"
}
}
3 changes: 0 additions & 3 deletions modules/layers/.babelrc

This file was deleted.

6 changes: 0 additions & 6 deletions modules/layers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,12 @@
],
"sideEffects": false,
"scripts": {
"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-bundle": "webpack --config ../../scripts/bundle.config.js",
"build": "npm run clean && npm run build-es6 && npm run build-esm && npm run build-es5",
"prepublishOnly": "npm run build-bundle"
},
"dependencies": {
"@loaders.gl/core": "^0.6.2",
"@mapbox/tiny-sdf": "^1.1.0",
"d3-hexbin": "^0.2.1",
"earcut": "^2.0.6"
},
"peerDependencies": {
Expand Down
3 changes: 0 additions & 3 deletions modules/main/.babelrc

This file was deleted.

Loading

0 comments on commit 7662afd

Please sign in to comment.