Skip to content

Commit

Permalink
Add "Playground" (aka json-browser) to website (#3561)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibgreen committed Sep 11, 2019
1 parent 152c856 commit 5e504fd
Show file tree
Hide file tree
Showing 28 changed files with 57 additions and 205 deletions.
13 changes: 0 additions & 13 deletions examples/experimental/json-browser/config/templates.js

This file was deleted.

99 changes: 0 additions & 99 deletions examples/experimental/json-examples/bezier-graph.json

This file was deleted.

32 changes: 0 additions & 32 deletions examples/experimental/json-examples/plot.json

This file was deleted.

Expand Up @@ -16,7 +16,7 @@
"type": "MapView",
"id": "main",
"mapStyle": "mapbox://styles/mapbox/dark-v9",
"controller": "true"
"controller": true
},
{
"type": "MapView",
Expand Down Expand Up @@ -59,4 +59,4 @@
]
}
]
}
}
Expand Up @@ -13,7 +13,7 @@
"views": [
{
"type": "MapView",
"controller": "true",
"controller": true,
"mapStyle": "mapbox://styles/mapbox/dark-v9"
}
],
Expand Down
6 changes: 6 additions & 0 deletions examples/playground/json-examples/README.md
@@ -0,0 +1,6 @@
# JSON examples

JSON versions of deck.gl examples go into this folder.

- New examples need to be listed in `../'src/templates.js`
- Any new layers or classes used by the examples need to be added to `../'src/configuration.js`
Expand Up @@ -12,7 +12,7 @@
"views": [
{
"type": "MapView",
"controller": "true",
"controller": true,
"mapStyle": "mapbox://styles/mapbox/light-v9"
}
],
Expand Down
13 changes: 13 additions & 0 deletions examples/playground/json-examples/index.js
@@ -0,0 +1,13 @@
export default {
// WEBSITE EXAMPLES AS JSON PAYLOADS
'website/3D Heatmap (HexagonLayer)': require('./3d-heatmap.json'),
'website/3D Heatmap (wth Minimap)': require('./3d-heatmap-minimap.json'),
'website/GeoJSON (GeoJsonLayer)': require('./geojson.json'),
'website/Line (LineLayer)': require('./line.json'),
'website/Scatterplot (ScatterplotLayer)': require('./scatterplot.json'),
'website/Screen Grid (ScreenGridLayer)': require('./screen-grid.json'),
'website/TagMap (TextLayer)': require('./tagmap.json'),
// GET STARTED EXAMPLES AS JSON PAYLOADS
'get-started/US map (GeoJsonLayer)': require('./us-map.json'),
'get-started/Dot Text (Scatterplot/TextLayer)': require('./dot-text.json')
};
Expand Up @@ -14,7 +14,7 @@
"views": [
{
"type": "MapView",
"controller": "true",
"controller": true,
"mapStyle": "mapbox://styles/mapbox/dark-v9"
}
],
Expand Down
Expand Up @@ -12,7 +12,7 @@
"views": [
{
"type": "MapView",
"controller": "true",
"controller": true,
"mapStyle": "mapbox://styles/mapbox/light-v9"
}
],
Expand Down
Expand Up @@ -13,7 +13,7 @@
"views": [
{
"type": "MapView",
"controller": "true",
"controller": true,
"mapStyle": "mapbox://styles/mapbox/light-v9"
}
],
Expand Down
Expand Up @@ -11,7 +11,7 @@
"views": [
{
"type": "MapView",
"controller": "true",
"controller": true,
"mapStyle": "https://rivulet-zhang.github.io/dataRepo/mapbox/style/map-style-dark-v9-no-labels.json"
}
],
Expand Down
File renamed without changes.
Expand Up @@ -9,10 +9,9 @@ import AceEditor from 'react-ace';
import 'brace/mode/json';
import 'brace/theme/github';

import JSON_CONFIGURATION from './config/configuration';
import JSON_TEMPLATES from './config/templates';
import JSON_CONFIGURATION from './configuration';
import JSON_TEMPLATES from '../json-examples';

// First template, to match the select dropdown
const INITIAL_TEMPLATE = Object.keys(JSON_TEMPLATES)[0];

// Set your mapbox token here
Expand Down Expand Up @@ -67,7 +66,7 @@ function setStyleSheet(url) {
document.head.appendChild(styles);
}

export default class App extends Component {
export class App extends Component {
constructor(props) {
super(props);

Expand Down
File renamed without changes.
File renamed without changes.
@@ -1,6 +1,6 @@
import React from 'react';
import {render} from 'react-dom';
import App from './app';
import {App} from './app';

/* global document */
render(
Expand Down
Expand Up @@ -10,7 +10,7 @@ const CONFIG = {
mode: 'development',

entry: {
app: resolve('./root.js')
app: resolve('./src/root.js')
},

module: {
Expand Down Expand Up @@ -38,5 +38,4 @@ const CONFIG = {
};

// This line enables bundling against src in this repo rather than installed deck.gl module
module.exports = env =>
env ? require('../../webpack.config.local')(CONFIG, __dirname)(env) : CONFIG;
module.exports = env => (env ? require('../webpack.config.local')(CONFIG, __dirname)(env) : CONFIG);
10 changes: 10 additions & 0 deletions website/contents/pages.js
Expand Up @@ -159,6 +159,16 @@ export const examplePages = generatePath([
}
}
]
},
{
name: 'Declarative Layers',
expanded: true,
children: [
{
name: 'Playground',
external: 'http://deck.gl/json'
}
]
}
]);

Expand Down
2 changes: 1 addition & 1 deletion website/src/components/demos/index.js
Expand Up @@ -18,4 +18,4 @@ export {default as DataFilterDemo} from './data-filter-demo';
export * from './layer-demos';
export * from './aggregation-layer-demos';
export * from './geo-layer-demos';
export { default as JSONBrowserDemo } from './json-browser-demo';

44 changes: 0 additions & 44 deletions website/src/components/demos/json-browser-demo.js

This file was deleted.

Binary file added website/src/static/images/playground-thumb.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions website/src/static/markdown/examples.md
Expand Up @@ -112,3 +112,16 @@
</div>
</div>
</div>

### Declarative Layers

<div>
<div class="thumb">
<div data-title="Playground" data-name="Playground">
<a href="https://deck.gl/json">
<img src="images/playground-thumb.png" />
</a>
</div>
</div>
</div>

0 comments on commit 5e504fd

Please sign in to comment.