Skip to content

Commit

Permalink
Add additional sample layers (visgl#385)
Browse files Browse the repository at this point in the history
* Add additional sample layers, LabelLayer, MeshLayer, BitmapLayer, OutlinePolygonLayer

* Working LabelLayer Example
  • Loading branch information
ibgreen authored and Shaojing Li committed Mar 8, 2017
1 parent e0c1243 commit 194bd0e
Show file tree
Hide file tree
Showing 43 changed files with 938 additions and 116 deletions.
16 changes: 13 additions & 3 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@

## Overview

* [Main (Layer Browser)](./main/README.md) - The Layer Browser enables
testing of props for all core layers. This is the main example
used for testing layers during development of deck.gl.
* [Layer Browser (Main Example)](./layer-browser/README.md) - The Layer Browser
enables testing of props for all core layers and many sample layers.
This is the main example used for testing layers during development of deck.gl.


## Sample Layers

A number of sample layers are available in `examples/sample-layers`. These can
be copied into your app and extended/modified as needed.


## Tutorial Examples

* [Hello World (webpack2)](./hello-world-webpack2/README.md): Bundles a minimal app with
[webpack 2](https://github.com/webpack/webpack) and serves it with webpack-dev-server.
Transpiles with buble.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,6 @@ import {

import * as dataSamples from '../data-samples';

const ChoroplethLayerContourExample = {
layer: ChoroplethLayer,
props: {
id: 'choroplethLayerContour',
data: dataSamples.choropleths,
getColor: f => [0, 80, 200],
opacity: 0.8,
drawContour: true
}
};

const ChoroplethLayerExample = {
layer: ChoroplethLayer,
props: {
Expand Down Expand Up @@ -79,8 +68,7 @@ const ExtrudedChoroplethLayer64WireframeExample = {
/* eslint-disable quote-props */
export default {
'Deprecated Layers': {
'ChoroplethLayer (Solid)': ChoroplethLayerExample,
'ChoroplethLayer (Contour)': ChoroplethLayerContourExample,
'ChoroplethLayer': ChoroplethLayerExample,
'ChoroplethLayer64 (Solid)': ChoroplethLayer64SolidExample,
'ChoroplethLayer64 (Contour)': ChoroplethLayer64ContourExample,
'ExtrudedChoroplethLayer64': ExtrudedChoroplethLayer64Example,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,6 @@ import * as mainDataSamples from '../data-samples';
import * as extraDataSamples from '../../../sample-layers/data';
const dataSamples = Object.assign({}, mainDataSamples, extraDataSamples);

import EnhancedChoroplethLayer from '../../../sample-layers/enhanced-choropleth-layer/enhanced-choropleth-layer';

const EnhancedChoroplethLayerExample = {
layer: EnhancedChoroplethLayer,
props: {
id: 'enhanced-choropleth-layer',
data: dataSamples.choropleths,
getColor: f => [200, 0, 80],
strokeWidth: 5
}
};

import TripsLayer from '../../../sample-layers/trips-layer/trips-layer';

const TripsLayerExample = {
Expand Down Expand Up @@ -49,11 +37,61 @@ const S2LayerExample = {
}
};

import EnhancedChoroplethLayer from '../../../sample-layers/enhanced-choropleth-layer/enhanced-choropleth-layer';

const EnhancedChoroplethLayerExample = {
layer: EnhancedChoroplethLayer,
props: {
id: 'enhanced-choropleth-layer',
data: dataSamples.choropleths,
getColor: f => [200, 0, 80],
strokeWidth: 5
}
};

import BitmapLayer from '../../../sample-layers/bitmap-layer/bitmap-layer';

const BitmapLayerExample = {
layer: BitmapLayer,
props: {
data: []
}
};

import MeshLayer from '../../../sample-layers/mesh-layer/mesh-layer';

const MeshLayerExample = {
layer: MeshLayer,
props: {
data: []
}
};

import LabelLayer from '../../../sample-layers/label-layer/label-layer';

const somePoints = dataSamples.points.slice(0, 50);

const LabelLayerExample = {
layer: LabelLayer,
props: {
data: somePoints,
getLabel: x => `${x.PLACEMENT}-${x.YR_INSTALLED}`,
getPosition: x => x.COORDINATES,
getColor: x => [Math.random() * 255, 0, Math.random() * 255, 255],
getSize: x => 2
}
};

/* eslint-disable quote-props */
export default {
'Sample Layers': {
'EnhancedChoroplethLayer': EnhancedChoroplethLayerExample,
'TripsLayer': TripsLayerExample,
'S2Layer': S2LayerExample
'S2Layer': S2LayerExample,

'EnhancedChoroplethLayer': EnhancedChoroplethLayerExample,

'BitmapLayer': BitmapLayerExample,
'MeshLayer': MeshLayerExample,
'LabelLayer': LabelLayerExample
}
};
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ module.exports = {
},

// inline source maps seem to work best
devtool: 'inline-source-map',
devtool: 'source-map',

resolve: {
// Make src files outside of this dir resolve modules in our node_modules folder
modules: [resolve(__dirname, '.'), resolve(__dirname, 'node_modules'), 'node_modules'],

alias: {
// From mapbox-gl-js README. Required for non-browserify bundlers (e.g. webpack):
'mapbox-gl$': resolve('./node_modules/mapbox-gl/dist/mapbox-gl.js')
Expand Down
Loading

0 comments on commit 194bd0e

Please sign in to comment.