Comments (4)
I just installed jupyterlab directly in my lonboard env, launched JLab from that env and bingo.
FWIW this is what I usually do personally.
For other cases, all you need is to install anywidget in the JupyterLab environment, so that anywidget's JS code exists in JupyterLab when you start the page. Then you can install lonboard
separately inside a user environment. You do have to ensure that the anywidget version on the backend (in JupyterLab) and anywidget in the user environment is semver compatible.
from lonboard.
Unsurprisingly, there's been discussion on this before. See especially manzt/anywidget#385 (comment).
Note that the architecture of anywidget is that anywidget serves as a bridge between "fully bundled" widgets that need to be installed in full on the server and "dynamically imported" widgets. Anywidget itself loads the JS from the anywidget-based widget. Therefore only a compatible version of anywidget needs to be installed on the server. In our case, lonboard does not need to be installed on the server, only anywidget.
There are further questions about ensuring compatible versions of anywidget between frontend and server, but that's a more general question outside of lonboard's scope.
Solara also does some nice checks around this: manzt/anywidget#385 (comment)
from lonboard.
FWIW In my own IPYwidget library buckaroo, I addressed some of this.
Users frequently pip installed the library without restarting the server. This causes a JS error with no python error. I added a check on the MTime of the python library, and the start time of the server.
https://github.com/paddymul/buckaroo/blob/main/buckaroo/widget_utils.py#L37-L55
I'm interested to hear about other approaches around this problem. It's a really poor experience for an initial user install. Maybe you could source the JS from unpackage when the user would encounter the problem.
from lonboard.
discussion on this before. See especially manzt/anywidget#385 (comment).
says "... a virtual environment (Python venv, Conda environment or what have you) where package jupyterlab has been deployed — one deploys their widget package in the same environment as where Jupyter Lab lives" (bold mine).
When I was running for example your NYC building notebook from a Jupyter Lab instance launched from my jupyterlab
conda env -- to which I had made my lonboard
conda env visible as a kernel with the usual ipykernel dance -- I was having rendering issues e.g.
[1] m
Map(layers=[PolygonLayer(extruded=True, get_elevation=<pyarrow.lib.FloatArray object at 0x0000028B03972680>
[
…
And similar errors for ScatterPlot layers and viz([])
In order to fix this, I just installed jupyterlab directly in my lonboard env, launched JLab from that env and bingo.
Unless there's a "JS dance" to expose the JS of conda envs in kernels exported to jupyterlab, I think that means we need to duplicate jupyterlab installs for those conda envs where there is JS.
lonboard v. '0.9.3' in Jupyter Lab 4.2.1
from lonboard.
Related Issues (20)
- Pass `crs` parameter into `viz` HOT 1
- [EPIC] Enable mixed geometry type visualization HOT 9
- Adding a legend? HOT 1
- Basemap refactor HOT 1
- Pass `Path` into `viz`?
- WidgetControl: display other widgets on the same map
- Test with pyogrio 0.8
- GeoArrowLayer
- Use `ravel()` instead of `flatten()`
- Invert layers order in `split_mixed_gdf` function HOT 2
- Google Colab crashes for large datasets HOT 4
- Understanding fly_to() and set_view_state() HOT 3
- Automated widget testing
- [BUG] Error in reprojection from GeoArrow stream with non-WGS84 crs and non-nullable coords HOT 1
- Add test for fixed GeoArrow reprojection with GeoPandas 1.0
- [BUG] None default get_line_color in PolygonLayer not respected HOT 4
- [EPIC] Support for ColumnLayer (extruded point values) HOT 3
- feature: add support to zoom into a specific layer HOT 2
- [BUG] Layer Attribution Option HOT 2
- Rename "other args" to "keyword args" in docstrings
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lonboard.