Skip to content

Conversation

@bijanvakili
Copy link
Contributor

@bijanvakili bijanvakili commented Feb 13, 2025

For #9370

This is a smaller-scoped fix to propagate Javascript errors so that they are immediately visible in a python notebook.
The intent is to make it easier to iterate on errors or collect information for bugs.

Background

This is a short term fix for issue #9370 until the refactor suggested in #9064 is completed.

Change List

  • Add new onError handler to determine whether to show a deck.gl error in the HTML output or via the browser console
  • Optionally hook the Deck.onError handler and the createDeck exception handler catch block to call the new onError handler.
  • Add show_error boolean flag to instruct pydeck.Deck to display the error immediately instead of logging it to the developer console

NOTE: This does not raise a python exception from Deck.to_html(). The method still considers its execution as succeeded.

When show_error is True, the resulting output should look similar to the following screenshot:

pydeck_9370_sample

@coveralls
Copy link

Coverage Status

coverage: 91.607% (-0.02%) from 91.63%
when pulling 3c05c80 on bijanvakili:issue-9370-display-text
into 8721dfd on visgl:master.

@felixpalmer felixpalmer merged commit 95884c4 into visgl:master Feb 17, 2025
4 checks passed
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

Successfully merging this pull request may close these issues.

3 participants