Skip to content

manzt/carbonplan-maps

Repository files navigation

Here be dragons 🐉

carbonplan-maps-widget

A Jupyter Widget for @carbonplan/maps. Built with anywidget.

usage

import carbonplan_maps

map_widget = carbonplan_maps.Widget(
    source="https://carbonplan-maps.s3.us-west-2.amazonaws.com/v2/demo/2d/tavg",
    variable="tavg",
    dimensions=("y", "x"),
)
map_widget

Screen Recording 2023-07-17 at 7 48 47 AM

combine with other widgets...

import ipywidgets

colormap = ipywidgets.Dropdown(options=["warm", "fire", "water"])
clim = ipywidgets.FloatRangeSlider(min=-20, max=30)
opacity = ipywidgets.FloatSlider(min=0, max=1, step=0.001)
region = ipywidgets.Checkbox(description="Region")

ipywidgets.link((map_widget, "colormap"), (colormap, "value"))
ipywidgets.link((map_widget, "clim"), (clim, "value"))
ipywidgets.link((map_widget, "opacity"), (opacity, "value"))
ipywidgets.link((map_widget, "region"), (region, "value"))

ipywidgets.VBox([
    ipywidgets.HBox([colormap, opacity, clim]),
    region,
    map_widget,
])

Screen Recording 2023-07-17 at 8 00 16 AM

development

python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
jupyter lab

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published