Skip to content

Commit

Permalink
Fix GridCellLayer website demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Xintong Xia committed May 30, 2019
1 parent 3fd2755 commit 2372951
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 27 deletions.
7 changes: 2 additions & 5 deletions website/.eslintrc.js
@@ -1,7 +1,7 @@
// prettier-ignore
module.exports = {
plugins: ['react'],
extends: ['uber-jsx', 'uber-es2015', 'prettier', 'prettier/react', 'plugin:import/errors'],
parser: 'babel-eslint',
overrides: {
files: ['*.spec.js', 'webpack.config.js', '**/bundle/*.js'],
rules: {
Expand All @@ -10,10 +10,7 @@ module.exports = {
},
settings: {
'import/core-modules': [
'@luma.gl/core',
'@luma.gl/constants',
'math.gl',
'viewport-mercator-project'
'deck.gl'
]
},
rules: {
Expand Down
13 changes: 7 additions & 6 deletions website/package.json
Expand Up @@ -16,10 +16,10 @@
"lint": "eslint src --ignore-pattern workers"
},
"dependencies": {
"@mapbox/vector-tile": "^1.3.1",
"@tweenjs/tween.js": "^16.7.0",
"@loaders.gl/core": "^1.0.1",
"@loaders.gl/las": "^1.0.1",
"@mapbox/vector-tile": "^1.3.1",
"@tweenjs/tween.js": "^16.7.0",
"autobind-decorator": "^1.3.3",
"d3-color": "^1.0.1",
"d3-request": "^1.0.2",
Expand All @@ -43,20 +43,21 @@
"tagmap.js": "^1.1.1"
},
"devDependencies": {
"autoprefixer-loader": "^3.2.0",
"@babel/cli": "^7.0.0",
"@babel/core": "^7.0.0",
"babel-eslint": "^7.0.0",
"babel-loader": "^8.0.0",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-proposal-decorators": "^7.1.2",
"@babel/preset-react": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"autoprefixer-loader": "^3.2.0",
"babel-eslint": "^10.0.1",
"babel-loader": "^8.0.0",
"brfs-babel": "^1.0.0",
"css-loader": "^0.26.1",
"eslint": "^3.0.0",
"eslint-config-uber-es2015": "^3.0.0",
"eslint-config-uber-jsx": "^3.0.0",
"eslint-import-resolver-webpack": "^0.11.1",
"eslint-plugin-react": "^6.0.0",
"file-loader": "^0.9.0",
"node-sass": "^4.3.0",
Expand Down
16 changes: 0 additions & 16 deletions website/src/components/demos/aggregation-layer-demos.js
Expand Up @@ -5,7 +5,6 @@ import {DATA_URI} from '../../constants/defaults';
import {
ContourLayer,
CPUGridLayer,
GridCellLayer,
HexagonLayer,
ScreenGridLayer,
GPUGridLayer,
Expand All @@ -30,21 +29,6 @@ export const ContourLayerDemo = createLayerDemoClass({
}
});

export const GridCellLayerDemo = createLayerDemoClass({
Layer: GridCellLayer,
dataUrl: `${DATA_URI}/hexagons.json`,
formatTooltip: d => `height: ${d.value * 5000}m`,
props: {
pickable: true,
extruded: true,
cellSize: 200,
elevationScale: 5000,
getPosition: d => d.centroid,
getColor: d => [48, 128, d.value * 255, 255],
getElevation: d => d.value
}
});

const GRID_LAYER_INFO = {
dataUrl: `${DATA_URI}/sf-bike-parking.json`,
formatTooltip: d => `${d.position.join(', ')}\nCount: ${d.count}`,
Expand Down
16 changes: 16 additions & 0 deletions website/src/components/demos/layer-demos.js
Expand Up @@ -7,6 +7,7 @@ import {
BitmapLayer,
ColumnLayer,
GeoJsonLayer,
GridCellLayer,
IconLayer,
LineLayer,
PathLayer,
Expand Down Expand Up @@ -68,6 +69,21 @@ export const GeoJsonLayerDemo = createLayerDemoClass({
}
});

export const GridCellLayerDemo = createLayerDemoClass({
Layer: GridCellLayer,
dataUrl: `${DATA_URI}/hexagons.json`,
formatTooltip: d => `height: ${d.value * 5000}m`,
props: {
pickable: true,
extruded: true,
cellSize: 200,
elevationScale: 5000,
getPosition: d => d.centroid,
getColor: d => [48, 128, d.value * 255, 255],
getElevation: d => d.value
}
});

export const IconLayerDemo = createLayerDemoClass({
Layer: IconLayer,
dataUrl: `${DATA_URI}/bart-stations.json`,
Expand Down

0 comments on commit 2372951

Please sign in to comment.