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

Beta release of pydeck, Python bindings and Jupyter notebook widget for deck.gl #2929

Closed
19 of 25 tasks
ajduberstein opened this issue Apr 9, 2019 · 6 comments
Closed
19 of 25 tasks
Assignees
Labels
Milestone

Comments

@ajduberstein
Copy link
Collaborator

ajduberstein commented Apr 9, 2019

Target use case

Enable Python developers to use deck.gl

Proposed feature

A Python wrapper around deck.gl and Jupyter notebook integration, see #2747

See #3013 and #3035 and for the associated pull requests.

v7.3 end of Aug

  • Publish NPM module for Jupyter widget P0
  • Modify notebook demos to include 2 way interaction and a tooltip
  • Verify installation on 2.7
  • Python-only (one-way API outside notebook) P2
  • Make pydeck notebooks work on github P2

v7.2 end of June

  • Publish pydeck to official PyPI P0
  • Markdown Documentation (awaiting API review) P1
  • Solve versioning issue (kernel)
  • Create example notebook, interactive P0
  • Create example notebook non-interactive P0
  • IframeWidget - P1
  • Persist state for a visualization through a restart of the kernel P1 (sort of a no-op, a user has to specify "Save Widget State" through the browser UI)
  • In a notebook, change the visualization on pydeck configuration change
  • Publish pydeck to test.PyPI P0
  • Travis CI for Python P0
  • Remove the Typescript
  • Replace karma with tape in JS tests
  • Make into a scoped module, @deck.gl/jupter-widget
  • Python tests as pre-commit hooks

TBD

  • Use NPM module in hosted notebook build
  • Sphinx Documentation P2
  • Binary arrow data transfer P1
  • Save a canvas out to an image
  • Add screen diff tests
  • Add more explicit error handling
@ajduberstein
Copy link
Collaborator Author

Breaking #2750 into two pull requests–one for Python objects that wrap the deck.gl JSON API and one for a Jupyter widget. JSON bindings are at #3013.

@ajduberstein
Copy link
Collaborator Author

Interactive updates available in #3174, addresses In a notebook, change the visualization on pydeck configuration change

@ibgreen ibgreen added this to the 7.2.0 milestone Jun 4, 2019
@ajduberstein
Copy link
Collaborator Author

ajduberstein commented Jun 11, 2019

Known Issues

Most of these have workarounds--I'll formalize them if need be.

.show() renders one widget per visualization and kernel

Update: Fixed in pydeck 7.3 beta release.

A Deck object can only run r.show() once in a notebook and can’t be moved without clearing out the notebook.

Code snippet to reproduce:

from pydeck import (
    Deck,
    Layer,
    ViewState)

layer = Layer(
    'HexagonLayer',
    UK_ACCIDENTS_DATA,
    elevation_scale=50,
    elevation_range=[0, 3000],
    extruded=True,                 
    coverage=1)

# Set the viewport location
view_state = ViewState(
    longitude=-1.415,
    latitude=52.2323,
    zoom=6,
    min_zoom=5,
    max_zoom=15,
    pitch=40.5,
    bearing=-27.396)

# Combined all of it and render a viewport
r = Deck(layers=[layer], initial_view_state=view_state)
r.show()


# Run `r.show()` in a different cell and it won’t render.

One solution, of course, is to move the entire cell.

Rendering too many widgets produces an error from producing too many WebGL contexts

WebGL contexts start dropping if .show() is run too many times, which kills different WebGL canvases. Is there a better way of handling this?

Provide two way viewport communication

In a timed update loop, any attempt to navigate the data snaps back to the configured initial viewport:

Beijing Subway Viewport Reset

This makes exploratory data analysis with PyDeck fairly difficult.

Provide some sort of notebook-level error message or Python exception handling to better surface deck.gl-caught errors

Errors won't surface in the notebook cells themselves–the user has to open the JS console to see the issues. This is inconvenient, since abstracting away the JS interface makes this library much more accessible to data scientists and analysts.

For example, below the notebook cell renders and then produces an error not seen outside the console:

console_error

One possible solution: Modifying probe.gl logger here

@ibgreen
Copy link
Collaborator

ibgreen commented Jun 11, 2019

For example, below the notebook cell renders and then produces an error not seen outside the console:

A very rough mechanism (not deck.gl specific) is to bind window.onerror which gets called on uncaught exceptions.

@ajduberstein
Copy link
Collaborator Author

pydeck beta is released. Improvements will be tracked in #3640

@ajduberstein
Copy link
Collaborator Author

Quick gallery:

beijing
Conway

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

No branches or pull requests

3 participants