geeViz.outputLib.charts¶
Zonal Summary & Charting Library for GEE
geeViz.outputLib.charts provides a Python pipeline for running zonal statistics on ee.Image / ee.ImageCollection objects and producing Plotly charts (time series, bar, sankey). It mirrors the logic in the geeView JS frontend so that both human users and AI agents have a clean, efficient API for this common workflow.
Quick start:
>>> import geeViz.geeView as gv
>>> from geeViz.outputLib import charts as cl
>>> ee = gv.ee
>>> study_area = ee.Geometry.Polygon(
... [[[-106, 39.5], [-105, 39.5], [-105, 40.5], [-106, 40.5]]]
... )
>>> lcms = ee.ImageCollection("USFS/GTAC/LCMS/v2024-10")
>>> df, fig = cl.summarize_and_chart(
... lcms.select(['Land_Cover']),
... study_area,
... stacked=True,
... )
>>> print(df.to_markdown())
>>> fig.write_html("chart.html", include_plotlyjs="cdn")
See summarize_and_chart() for the full API and more examples.
Module Attributes
Valid chart type strings for |
Functions
|
Create a Plotly bar chart from a single-Image zonal stats DataFrame. |
|
Create a Plotly donut chart from a single-Image zonal stats DataFrame. |
|
Create a subplot grid of donut charts, one per feature. |
|
Create a grouped (or stacked) bar chart for multi-feature zonal stats. |
|
Create a subplot figure with one time-series chart per feature. |
|
Create a D3 Sankey diagram directly from transition data — no Plotly. |
|
Create a scatter plot of two bands across features. |
|
Create a Plotly time series chart from a zonal stats DataFrame. |
|
Determine whether the input geometry represents a single region or multiple. |
|
Detect the type of a GEE object and read its thematic class metadata. |
|
Parse continuous (mean/median/etc.) reduction results into a DataFrame. |
|
Parse frequency histogram reduction results into a DataFrame with class names as columns. |
|
Prepare a GEE object for reduction by stacking an ImageCollection into a single multi-band image. |
|
Build a Sankey diagram dataset from class transitions across time periods. |
|
Run |
|
Run |
|
Wrap sankey D3 HTML in an iframe for Jupyter notebook display. |
|
Return sankey HTML, accepting either a raw HTML string or legacy Plotly figure. |
|
Save a chart to an HTML file. |
|
Run zonal statistics and produce a chart in one call. |
|
Compute zonal statistics for a GEE Image or ImageCollection over a geometry. |