Comments (8)
Got a lonboard
map running within quarto!
# this was needed because I'm using poetry within a nix environment
export QUARTO_PYTHON=$(which python)
# render the qmd file to html
quarto render test.qmd
However, it is a bit slow for all the links in the full country so I'm going to move the project to a shiny app.
from lonboard.
@arthurgailes I just had the following in test.qmd
before I ran quarto render test.qmd
. I've put a \
before the triple backticks so that you can see all the contents in one snippet rather than multiple! :-) The \
won't be there in the actual qmd
file..
---
title: "Lonboard test"
execute:
echo: false
format:
html:
self-contained: true
jupyter: python3
---
\```{python}
# importing packages
import pandas as pd
import geopandas as gpd
import lonboard
from IPython.display import display, HTML
# geopandas option
gpd.options.io_engine = "pyogrio"
\```
\```{python}
network = gpd.read_file("data/network.gpkg")
car_vols = pd.read_csv("data/volumes_car_hourly.csv")
# join volume data to network
network_vols = network.merge(car_vols)
\```
\```{python}
layer = lonboard.PathLayer.from_geopandas(
network_vols,
width_min_pixels=0.8)
map_ = lonboard.Map(layers=[layer])
map_
\```
from lonboard.
@shriv that works, thank you very much.
from lonboard.
I'm not familiar with using quarto in this way. Does to_html
do what you want? That saves the HTML as a file on disk. Or do you want to render the HTML with IPython as a static HTML?
from lonboard.
The latter. I normally render the quarto document within a single html. The rendering engine for python in quarto is Jupyter and I can even render a ipynb
file with quarto.. Maybe it will all be fine! Apologies, I normally use R with quarto and I haven't used it as extensively with python. I'll have a bit of a tinker and write back here :-)
from lonboard.
You can try using IPython.display.core.HTML()
like I do in this PR #474
from lonboard.
Many thanks @kylebarron..! I will try that as well 👍
from lonboard.
@shriv how did you get quarto to output the HTML properly?
from lonboard.
Related Issues (20)
- Set up plausible analytics
- Update `viz()` documentation to include geoarrow array
- Improve attribution
- Chunking issues with Arrow input.
- PathStyleExtension in lonboard HOT 3
- [BUG] Unable to change the basemap_style HOT 2
- Pass `crs` parameter into `viz` HOT 1
- [EPIC] Enable mixed geometry type visualization HOT 9
- Adding a legend? HOT 1
- Allow dict input for Map Style
- 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 support. HOT 3
- Understanding fly_to() and set_view_state() HOT 3
- Automated widget testing
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.