Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(json) support for deck.gl widgets #9314

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/playground/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<title>deck.gl Playground</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href='https://unpkg.com/[email protected]/dist/maplibre-gl.css' rel='stylesheet' />
<link href="https://unpkg.com/deck.gl@^9.0.0/dist/stylesheet.css" rel='stylesheet' />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Nice if widgets could dynamically load this stylesheet, maybe as an option
  • Or maybe add affordance to the JSON syntax to allow for stylesheets to be specified.

<style>
body {margin: 0; font-family: sans-serif; overflow: hidden;}
#app {width: 100vw; height: 100vh; display: flex; flex-direction: row; align-items: stretch;}
Expand Down
8 changes: 8 additions & 0 deletions examples/playground/json-examples/3d-heatmap.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,13 @@
[209, 55, 78]
]
}
],
"widgets": [
chrisgervang marked this conversation as resolved.
Show resolved Hide resolved
{
"@@type": "ZoomWidget"
},
{
"@@type": "CompassWidget"
}
]
}
3 changes: 3 additions & 0 deletions examples/playground/src/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
colorCategories,
colorContinuous
} from '@deck.gl/carto';
import * as Widgets from '@deck.gl/widgets';

import {COORDINATE_SYSTEM} from '@deck.gl/core';
import {GL as GLConstants} from '@luma.gl/constants';
Expand All @@ -39,6 +40,8 @@ export default {
CARTO_LAYERS,
GeoLayers,
MeshLayers,
// Support `@deck.gl/widgets` Widgets
Widgets,
// Any non-standard views
{}
),
Expand Down
Loading