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

Render a Scenegraph Layer #13

Open
harisbal opened this issue Oct 1, 2021 · 0 comments
Open

Render a Scenegraph Layer #13

harisbal opened this issue Oct 1, 2021 · 0 comments

Comments

@harisbal
Copy link

harisbal commented Oct 1, 2021

Description

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

Steps/Code to Reproduce

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)

Versions

Dash Core Components 2.0.0
Dash HTML Components 2.0.0
Dash Deck 0.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant