Skip to main content

CityJSON renderer for Jupyter Notebook / JupyterLab

Project description

CityView

PyPI npm

CityJSON loader and renderer for three.js, react-three-fiber, and Jupyter Notebook / JupyterLab.

Supports CityJSON format and CityJSONSeq format.

Contents

Packages

Package Name Description
cityview (top-level package) Python package
three-cityjson JavaScript / TypeScript package

Installation

pip install cityview

Usage

Basic usage

VirtualView

import cityview as cv

view = cv.VirtualView(theme="light")

with open("./packages/three-cityjson/public/sample/daiba_sta.city.jsonl", "r") as f:
    data = f.read()

view.layers = [
    cv.CityJSONLayer(data=data, format="cityjsonseq")
]

view.update()

view

VirtualView

MapView

import cityview as cv

view = cv.MapView(theme="dark")

with open("./packages/three-cityjson/public/sample/daiba_sta.city.jsonl", "r") as f:
    data = f.read()

view.layers = [
    cv.CityJSONLayer(data=data, format="cityjsonseq")
]

view.update()

view

VirtualView

Handling click events

import cityview as cv

view = cv.VirtualView(theme="light")

with open("./packages/three-cityjson/public/sample/daiba_sta.city.jsonl", "r") as f:
    data = f.read()

def handler(change):
    print(change["new"])

view.observe(handler, names="click")

view.layers = [
    cv.CityJSONLayer(data=data, format="cityjsonseq")
]

view.update()

view

Roadmap

  • Online viewer

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cityview-0.2.0.tar.gz (988.9 kB view details)

Uploaded Source

Built Distribution

cityview-0.2.0-py3-none-any.whl (992.3 kB view details)

Uploaded Python 3

File details

Details for the file cityview-0.2.0.tar.gz.

File metadata

  • Download URL: cityview-0.2.0.tar.gz
  • Upload date:
  • Size: 988.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.5 Darwin/22.6.0

File hashes

Hashes for cityview-0.2.0.tar.gz
Algorithm Hash digest
SHA256 abd30fe9bb521dda6af62e2326d45e7bf0a158ebe74b310c8c7936044ef024eb
MD5 501911b5709a5c8b22b681808b5ef5f7
BLAKE2b-256 9b363f3c0d391e4391bd345b7d9ac9b8af925d97138268983b71a8a5658d4ab4

See more details on using hashes here.

File details

Details for the file cityview-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: cityview-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 992.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.5 Darwin/22.6.0

File hashes

Hashes for cityview-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a6d1541ed12760331a9c14438e012ad24ff25c829c6c7595cc80355b75659a4c
MD5 bdd7029df18f534775d5bcf602eb693f
BLAKE2b-256 a9000c0f971b244b6a29cdc13872d01073860a0e6d2b0f8b854c0dc870518079

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page