Skip to content

Commit

Permalink
update website (visgl#810)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pessimistress authored and Shaojing Li committed Jul 25, 2017
1 parent 52e5369 commit 2f5d686
Show file tree
Hide file tree
Showing 37 changed files with 51 additions and 90,254 deletions.
4 changes: 4 additions & 0 deletions website/contents/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ export const examplePages = generatePath([
demo: 'TripsDemo',
code: getCodeUrl('examples/trips')
}
},
{
name: 'Wind Map',
external: 'http://philogb.github.io/page/wind/'
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"rbush": "^2.0.1",
"react": "^15.4.0",
"react-dom": "^15.4.0",
"react-map-gl": ">=3.0.0-beta.1",
"react-map-gl": ">=3.0.0-beta.3",
"react-redux": "^4.4.5",
"react-router": "^2.8.1",
"redux": "^3.6.0",
Expand Down
4 changes: 2 additions & 2 deletions website/src/components/demos/arc-demo.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, {Component} from 'react';

import {MAPBOX_STYLES} from '../../constants/defaults';
import {MAPBOX_STYLES, DATA_URI} from '../../constants/defaults';
import {readableInteger} from '../../utils/format-utils';
import ArcOverlay, {inFlowColors, outFlowColors} from '../../../../examples/arc/deckgl-overlay';

Expand All @@ -11,7 +11,7 @@ export default class ArcDemo extends Component {

static get data() {
return {
url: 'data/arc-data.txt',
url: `${DATA_URI}/arc-data.txt`,
worker: 'workers/arc-data-decoder.js'
};
}
Expand Down
4 changes: 2 additions & 2 deletions website/src/components/demos/brushing-demo.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, {Component} from 'react';

import {MAPBOX_STYLES} from '../../constants/defaults';
import {MAPBOX_STYLES, DATA_URI} from '../../constants/defaults';
import {readableInteger} from '../../utils/format-utils';
import BrushingOverlay, {inFlowColors, outFlowColors} from '../../../../examples/brushing/deckgl-overlay';

Expand All @@ -14,7 +14,7 @@ export default class BrushingDemo extends Component {

static get data() {
return {
url: 'data/arc-data.txt',
url: `${DATA_URI}/arc-data.txt`,
worker: 'workers/arc-data-decoder.js'
};
}
Expand Down
4 changes: 2 additions & 2 deletions website/src/components/demos/geojson-demo.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, {Component} from 'react';
import {readableInteger} from '../../utils/format-utils';
import {MAPBOX_STYLES} from '../../constants/defaults';
import {MAPBOX_STYLES, DATA_URI} from '../../constants/defaults';
import GeoJsonOverlay from '../../../../examples/geojson/deckgl-overlay';

const COLOR_SCALE = [
Expand Down Expand Up @@ -34,7 +34,7 @@ export default class GeoJsonDemo extends Component {

static get data() {
return {
url: 'data/vancouver-blocks.txt',
url: `${DATA_URI}/vancouver-blocks.txt`,
worker: 'workers/geojson-data-decoder.js'
};
}
Expand Down
4 changes: 2 additions & 2 deletions website/src/components/demos/heatmap-demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import React, {Component} from 'react';
import {readableInteger} from '../../utils/format-utils';
import HeatmapOverlay from '../../../../examples/3d-heatmap/deckgl-overlay';

import {MAPBOX_STYLES} from '../../constants/defaults';
import {MAPBOX_STYLES, DATA_URI} from '../../constants/defaults';

export default class HeatmapDemo extends Component {

static get data() {
return {
url: 'data/heatmap-data.txt',
url: `${DATA_URI}/heatmap-data.txt`,
worker: 'workers/heatmap-data-decoder.js'
};
}
Expand Down
4 changes: 2 additions & 2 deletions website/src/components/demos/icon-demo.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {Component} from 'react';
import {MAPBOX_STYLES} from '../../constants/defaults';
import {MAPBOX_STYLES, DATA_URI} from '../../constants/defaults';
import {readableInteger} from '../../utils/format-utils';
import IconOverlay from '../../../../examples/icon/deckgl-overlay';

Expand All @@ -12,7 +12,7 @@ export default class IconDemo extends Component {
static get data() {
return [
{
url: 'data/meteorites.txt',
url: `${DATA_URI}/meteorites.txt`,
worker: 'workers/meteorites-decoder.js'
},
{
Expand Down
23 changes: 12 additions & 11 deletions website/src/components/demos/layer-demos.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import createLayerDemoClass from './layer-demo-base';
import {DATA_URI} from '../../constants/defaults';

import {
ScatterplotLayer,
Expand All @@ -18,7 +19,7 @@ import {colorToRGBArray} from '../../utils/format-utils';

export const ScatterplotLayerDemo = createLayerDemoClass({
Layer: ScatterplotLayer,
dataUrl: 'data/bart-stations.json',
dataUrl: `${DATA_URI}/bart-stations.json`,
formatTooltip: d => `${d.name}\n${d.address}`,
props: {
pickable: true,
Expand All @@ -34,7 +35,7 @@ export const ScatterplotLayerDemo = createLayerDemoClass({

export const ArcLayerDemo = createLayerDemoClass({
Layer: ArcLayer,
dataUrl: 'data/bart-segments.json',
dataUrl: `${DATA_URI}/bart-segments.json`,
formatTooltip: d => `${d.from.name} to ${d.to.name}`,
props: {
pickable: true,
Expand All @@ -48,7 +49,7 @@ export const ArcLayerDemo = createLayerDemoClass({

export const LineLayerDemo = createLayerDemoClass({
Layer: LineLayer,
dataUrl: 'data/bart-segments.json',
dataUrl: `${DATA_URI}/bart-segments.json`,
formatTooltip: d => `${d.from.name} to ${d.to.name}`,
props: {
pickable: true,
Expand All @@ -61,7 +62,7 @@ export const LineLayerDemo = createLayerDemoClass({

export const PathLayerDemo = createLayerDemoClass({
Layer: PathLayer,
dataUrl: 'data/bart-lines.json',
dataUrl: `${DATA_URI}/bart-lines.json`,
formatTooltip: d => d.name,
props: {
pickable: true,
Expand All @@ -75,7 +76,7 @@ export const PathLayerDemo = createLayerDemoClass({

export const IconLayerDemo = createLayerDemoClass({
Layer: IconLayer,
dataUrl: 'data/bart-stations.json',
dataUrl: `${DATA_URI}/bart-stations.json`,
formatTooltip: d => `${d.name}\n${d.address}`,
props: {
pickable: true,
Expand All @@ -100,7 +101,7 @@ export const IconLayerDemo = createLayerDemoClass({

export const ScreenGridLayerDemo = createLayerDemoClass({
Layer: ScreenGridLayer,
dataUrl: 'data/sf-bike-parking.json',
dataUrl: `${DATA_URI}/sf-bike-parking.json`,
formatTooltip: d => 'aggregated cell',
props: {
pickable: false,
Expand All @@ -115,7 +116,7 @@ export const ScreenGridLayerDemo = createLayerDemoClass({

export const GridLayerDemo = createLayerDemoClass({
Layer: GridLayer,
dataUrl: 'data/sf-bike-parking.json',
dataUrl: `${DATA_URI}/sf-bike-parking.json`,
formatTooltip: d => `${d.position.join(', ')}\nCount: ${d.count}`,
props: {
pickable: true,
Expand All @@ -128,7 +129,7 @@ export const GridLayerDemo = createLayerDemoClass({

export const HexagonLayerDemo = createLayerDemoClass({
Layer: HexagonLayer,
dataUrl: 'data/sf-bike-parking.json',
dataUrl: `${DATA_URI}/sf-bike-parking.json`,
formatTooltip: d => `${d.centroid.join(', ')}\nCount: ${d.points.length}`,
props: {
pickable: true,
Expand All @@ -141,7 +142,7 @@ export const HexagonLayerDemo = createLayerDemoClass({

export const PolygonLayerDemo = createLayerDemoClass({
Layer: PolygonLayer,
dataUrl: 'data/sf-zipcodes.json',
dataUrl: `${DATA_URI}/sf-zipcodes.json`,
formatTooltip: d => `${d.zipcode}\nPopulation: ${d.population}`,
props: {
pickable: true,
Expand All @@ -159,7 +160,7 @@ export const PolygonLayerDemo = createLayerDemoClass({

export const GeoJsonLayerDemo = createLayerDemoClass({
Layer: GeoJsonLayer,
dataUrl: 'data/bart.geo.json',
dataUrl: `${DATA_URI}/bart.geo.json`,
formatTooltip: d => d.properties.name || d.properties.station,
props: {
pickable: true,
Expand All @@ -178,7 +179,7 @@ export const GeoJsonLayerDemo = createLayerDemoClass({

export const PointCloudLayerDemo = createLayerDemoClass({
Layer: PointCloudLayer,
dataUrl: 'data/pointcloud.json',
dataUrl: `${DATA_URI}/pointcloud.json`,
formatTooltip: d => d.position.join(', '),
props: {
pickable: false,
Expand Down
6 changes: 3 additions & 3 deletions website/src/components/demos/line-demo.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import React, {Component} from 'react';
import {readableInteger} from '../../utils/format-utils';
import {MAPBOX_STYLES} from '../../constants/defaults';
import {MAPBOX_STYLES, DATA_URI} from '../../constants/defaults';
import LineOverlay from '../../../../examples/line/deckgl-overlay';

export default class LineDemo extends Component {

static get data() {
return [
{
url: 'data/flight-path-data.txt',
url: `${DATA_URI}/flight-path-data.txt`,
worker: 'workers/flight-path-data-decoder.js'
},
{
url: 'data/airports.json'
url: `${DATA_URI}/airports.json`
}
];
}
Expand Down
4 changes: 2 additions & 2 deletions website/src/components/demos/scatterplot-demo.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React, {Component} from 'react';
import {MAPBOX_STYLES} from '../../constants/defaults';
import {MAPBOX_STYLES, DATA_URI} from '../../constants/defaults';
import {readableInteger} from '../../utils/format-utils';
import ScatterplotOverlay from '../../../../examples/scatterplot/deckgl-overlay';

export default class ScatterPlotDemo extends Component {

static get data() {
return {
url: 'data/scatterplot-data.txt',
url: `${DATA_URI}/scatterplot-data.txt`,
worker: 'workers/scatterplot-data-decoder.js'
};
}
Expand Down
4 changes: 2 additions & 2 deletions website/src/components/demos/screen-grid-demo.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React, {Component} from 'react';
import {readableInteger} from '../../utils/format-utils';
import {MAPBOX_STYLES} from '../../constants/defaults';
import {MAPBOX_STYLES, DATA_URI} from '../../constants/defaults';
import ScreenGridOverlay from '../../../../examples/screen-grid/deckgl-overlay';

export default class ScreenGridDemo extends Component {

static get data() {
return {
url: 'data/screen-grid-data.txt',
url: `${DATA_URI}/screen-grid-data.txt`,
worker: 'workers/screen-grid-data-decoder.js'
};
}
Expand Down
6 changes: 3 additions & 3 deletions website/src/components/demos/trips-demo.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, {Component} from 'react';

import {MAPBOX_STYLES} from '../../constants/defaults';
import {MAPBOX_STYLES, DATA_URI} from '../../constants/defaults';
import {readableInteger} from '../../utils/format-utils';
import ViewportAnimation from '../../utils/map-utils';
import TripsOverlay from '../../../../examples/trips/deckgl-overlay';
Expand All @@ -10,11 +10,11 @@ export default class TripsDemo extends Component {
static get data() {
return [
{
url: 'data/trips-data.txt',
url: `${DATA_URI}/trips-data.txt`,
worker: 'workers/trips-data-decoder.js?loop=1800&trail=180'
},
{
url: 'data/building-data.txt',
url: `${DATA_URI}/building-data.txt`,
worker: 'workers/building-data-decoder.js'
}
];
Expand Down
2 changes: 0 additions & 2 deletions website/src/components/header.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import React, {Component} from 'react';
import {Link} from 'react-router';

Expand Down
2 changes: 1 addition & 1 deletion website/src/components/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Map extends Component {
}

@autobind
_onMouseMove(evt){
_onMouseMove(evt) {
if (evt.nativeEvent) {
this.setState({mousePosition: [evt.nativeEvent.offsetX, evt.nativeEvent.offsetY]});
}
Expand Down
2 changes: 2 additions & 0 deletions website/src/constants/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ export const DEFAULT_APP_STATE = {
headerOpacity: 1,
isMenuOpen: false
};

export const DATA_URI = 'https://raw.githubusercontent.com/uber-common/deck.gl-data/master/website';
Loading

0 comments on commit 2f5d686

Please sign in to comment.