plotly / dash-deck Goto Github PK
View Code? Open in Web Editor NEWBringing deck.gl and pydeck into Dash
Home Page: https://dash-gallery.plotly.host/dash-deck-explorer/
License: MIT License
Bringing deck.gl and pydeck into Dash
Home Page: https://dash-gallery.plotly.host/dash-deck-explorer/
License: MIT License
Dash-Deck is not using the latest deckGL version and that is causing compatibility issues with mobile. See this issue for more details.
Any way we can get an upgrade to the latest DeckGL and Pydeck dependencies?
Hello, i am trying to reproduce some example code but i cannot execute it.
Just keeps loading with a black screen. Here is the code example, maybe something change in the latest release?
Any idea? thank you!
import os
import dash
import dash_deck
import dash_html_components as html
import pydeck as pdk
import pandas as pd
mapbox_api_token = os.getenv("MAPBOX_ACCESS_TOKEN")
app = dash.Dash(__name__)
# Map of San Francisco from 1906
IMG_URL = '"https://i.imgur.com/W95ked7.jpg"'
# Specifies the corners of the image bounding box
BOUNDS = [
[-122.52690000000051, 37.70313158980733],
[-122.52690000000051, 37.816395657523195],
[-122.34604834372873, 37.816134829424335],
[-122.34656848822227, 37.70339041384273],
]
bitmap_layer = pdk.Layer(
"BitmapLayer", data=None, image=IMG_URL, bounds=BOUNDS, opacity=0.7
)
view_state = pdk.ViewState(
latitude=37.7576171, longitude=-122.5776844, zoom=10, bearing=-45, pitch=60,
)
r = pdk.Deck(
bitmap_layer,
initial_view_state=view_state,
map_style=pdk.map_styles.SATELLITE,
# mapbox_key=mapbox_api_token,
)
app.layout = html.Div(
dash_deck.DeckGL(r.to_json(), id="deck-gl", mapboxKey=mapbox_api_token)
)
if __name__ == "__main__":
app.run_server(debug=False)
I want to get the zoom level when user scrolls, but I can't find relevant props in dash-deck
.
Hi,
The line-layer demo: https://dash-gallery.plotly.host/dash-deck-explorer/line-layer
Hows far less data than the equivalent deck.gl demo. https://deck.gl/examples/line-layer/
Yet both load and parse the same data source file:
https://raw.githubusercontent.com/visgl/deck.gl-data/master/examples/line/heathrow-flights.json
Any ideas on why this is the case? I cannot see any obvious cause in the code.
Thanks
Darren
In the dash-deck gallery, the example for Column layers is not displaying the map.
https://dash.gallery/dash-deck-explorer/column-layer
I have tried to reproduce the example locally and the same issue holds.
So my sample code is the code given in the gallery.
I have created an app with different data and the issue persists.
Any indication why this may be so?
Thanks.
I am using Dash Deck to create interactive maps, but I have a question about the geojson data I upload. I want to know if the geojson data is stored on the Carto server or if it is only used for rendering the map. I don't want my data to be reused by anyone else without my permission.
This is an awesome set of components. I'm glad this was made. Any chance it could mirrored into conda-forge? Thanks!
I am trying to update the rendered map through a callback function like this:
layer = pdk.Layer(
"TripsLayer",
df,
get_path="coordinates",
get_timestamps="timestamps",
get_color=[253, 128, 93],
opacity=0.8,
width_min_pixels=5,
rounded=True,
trail_length=600,
current_time=500,
)
r = pdk.Deck(layers=[layer])
deckgl_map = dash_deck.DeckGL(r.to_json(), id="map-graph", mapboxKey=mapbox_access_token)
@app.callback(
Output("map-graph", < component_property ??!! >),
[
Input("date-picker", "date"),
Input("trip-slider", "value")
],
)
def update_graph(datePicked, sliderValue):
# use slider-value to filter / modify and update the map
In my layout, there is a date picker and a slider. I want to update the map based on the values on the slider and the date picker or any other input.
However I do not know the syntax to do so or whether it can be done at all.
Also, if it is possible, what would be the component_property for the deck component ?
Resides in usage-arclayer.py
. Currently, map style and tooltip are not working.
Please Upgrade to the latest DeckGl.js
Hello,
I'm trying to render a Scenegraph layer with dash-deck but this does not seem possible.
I am getting an error Unexpected ":" at character 5
Example:
import os
import dash
import dash_deck
import dash_html_components as html
import pydeck as pdk
mapbox_api_token = os.getenv("MAPBOX_ACCESS_TOKEN")
layer = pdk.Layer(
"ScenegraphLayer",
data=[{"coordinates": [-122.466233, 37.684638]}],
draggable=True,
scenegraph="https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/BoxAnimated/glTF-Binary/BoxAnimated.glb",
get_position="coordinates",
get_orientation=[0, 20, 90],
get_color=[100, 100, 100, 100],
size_scale=1,
_lighting="pbr",
)
view_state = pdk.ViewState(
latitude=37.7749295, longitude=-122.4194155, zoom=11, bearing=0, pitch=45
)
# Render
r = pdk.Deck(layers=[layer], initial_view_state=view_state)
app = dash.Dash(__name__)
app.layout = html.Div(
dash_deck.DeckGL(r.to_json(), id="deck-gl", mapboxKey=mapbox_api_token)
)
if __name__ == "__main__":
app.run_server(debug=True)
Dash Core Components 2.0.0
Dash HTML Components 2.0.0
Dash Deck 0.0.1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.