Explorer: disable the geo controls when geoviews is not installed #1223
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addressing (a tiny) part of #1190 with a different take compared to #1200 whose goal is to cover all kind of exceptions the explorer might raise, while in this PR I focused on finding the best way to let them know they should install GeoViews to enable the geo controls.
I ended up trying to import geoviews on initialization and if that fails disabling all the geo controls:
The
Checkbox
widget has no tooltip so instead I used a Toggle with a label that is updated to indicate GeoViews is required.Trying to instantiate an explorer by passing geo kwargs (e.g.
df.explorer(geo=True)
) will raise an import error.