No project description provided
Project description
Embeddable mapping application
This Svelte app and related Python code are intended to provide a minimal, embeddable interactive map for embedding
in Jupyter notebooks, especially those built into static websites using JupyterBook. By using IFrame
widgets to
call the deployed application with a specific URL containing the desired state, a Jupyter user can render geospatial
data that has been stored in GCS. This avoids the problem of ipyleaflet
and other Jupyter visualization widgets
that store their data in the static HTML of a rendered JupyterBook webpage. The Python code in calitp_map_utils
defines the contract between data producers (i.e. notebooks) and the data consumer (i.e. the Svelte app) as well
as provides some utilities for validating the GeoJSON of specific analysis types.
Developing
You can run a development server locally; use the calitp-map-utils CLI to generate a valid state URL for testing.
npm run dev
echo '{ "legend_url": "https://storage.googleapis.com/calitp-map-tiles/legend_test.svg", "layers": [ {"name": "D7 State Highway Network", "url": "https://storage.googleapis.com/calitp-map-tiles/d7_shn.geojson.gz", "type": "state_highway_network"}, {"name": "California High Quality Transit Areas - Stops", "url": "https://storage.googleapis.com/calitp-map-tiles/ca_hq_transit_stops.geojson.gz"}, {"name": "LA Metro Bus Speed Maps AM Peak", "url": "https://storage.googleapis.com/calitp-map-tiles/metro_am.geojson.gz", "type": "speedmap"} ] }' | gzip | basenc --base64url | poetry run python -m calitp_map_utils validate-state --base64url --compressed --data --verbose --host=http://localhost:5173
...
URL: localhost:5173?state=H4sIAO38fWQC_6WSMU_DMBCF_8opM03GSt0KDAwUgcqGkHVNr47B8RnfhZJW_e8kbVE6FAY6WSef3_fek7dZwJqyCYTG-yvIPLaUpJtftj832e0Y5opKcOdstcYWHkjXnN6zbr9Jvl-pVKNMikKUE1rKLbP1hNFJXnJdlOidxlGNcaTOkxTLsZEq5Jb4Tbg7N72WtnHPkx5mqgPMhAEWE0dK6kiOhndXMNi86SArTsHh3ig8NT21heeEQZzCNBEKjLosHOUC7yWa6sPoQdVIr3Y-yLHSv13fT2FGmhiuG4F5JFrCDKPAdAaPhJd0XPeyBuvfWu5Z3fb5Yl_3f0GN5zAk2TDXw7RY8NfJhEKdmik5rJw9-VBkKSzNPzMcXyuJ5vJps9039EE5DrACAAA%3D
Build and deploy to Netlify
To create a production version of your app:
npm run build
netlify deploy --site=cal-itp-data-analyses --dir=build --alias=leaflet-speedmaps
We could look into using the Netlify adapter at some point.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file calitp_map_utils-2023.6.5.tar.gz
.
File metadata
- Download URL: calitp_map_utils-2023.6.5.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.11.3 Darwin/21.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed59838f9a4010ad01ed2cdea5555ccbd06ed298504127f85aa0233d74b1751f |
|
MD5 | 66db913983ce702899917c9a7b724f96 |
|
BLAKE2b-256 | b1c9ff485a1ee385bedd3f3dca7b47bd4f5379f6f1df019785bfe9b05af27958 |
File details
Details for the file calitp_map_utils-2023.6.5-py3-none-any.whl
.
File metadata
- Download URL: calitp_map_utils-2023.6.5-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.11.3 Darwin/21.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fcdd39a8edfb8a4440998c13296a9c4049724b0c2119144073db71c05aa02304 |
|
MD5 | 0c6843023529b875dd61cb9633f50473 |
|
BLAKE2b-256 | b273df897fe160e50079ce3566fa84ac9e85c90f21f5a6f450f4d9583951c843 |