Skip to content

VizX visualization module + function-categories infographic fix (beta/0.4.0 → main)#46

Merged
mjohns-databricks merged 2 commits into
mainfrom
beta/0.4.0
Jun 25, 2026
Merged

VizX visualization module + function-categories infographic fix (beta/0.4.0 → main)#46
mjohns-databricks merged 2 commits into
mainfrom
beta/0.4.0

Conversation

@mjohns-databricks

Copy link
Copy Markdown
Collaborator

Summary

Promotes beta/0.4.0 to main. Two changes since main:

VizX visualization module (was PR #45)

  • Rebrands the viz module to VizX (databricks.labs.gbx.vizx, [vizx] extra) across the module, docs, sidebar, API overview, a new package icon, and the example notebooks.
  • Adds plot_static — a tier-agnostic static-map renderer that draws Spark- or GeoPandas-derived geometries (and H3 cells via grid_system="h3") over a contextily basemap as a GitHub-renderable figure (the non-interactive counterpart to .explore()):
    • Accepts WKT / EWKT / WKB / EWKB and native GEOMETRY/GEOGRAPHY (decoded via the shared parse_geom).
    • fill=False outline mode for boundary overlays; reprojects every layer to EPSG:3857 so overlays align; basemap failures (no egress / missing dep) degrade to a warning rather than a hard error.
    • grid_system forward-declares quadbin/bng/custom (fast-follow).
  • Adds contextily to the [vizx] extra (range pin) and exact-version + hash-pins it (plus transitive deps) in requirements-pyrx-ci.txt and requirements-dev-container.txt.
  • Documents plot_static in docs/docs/api/vizx.mdx; adopts it in the h3-rasterize notebook; refreshes the xView notebook outputs.
  • Tests: 25 in test/vizx/test_static_map.py; full vizx suite green; lint clean.

Function-categories infographic fix (was PR #44)

  • Re-renders the RasterX function-categories infographic at full height so the "Vector-Raster Bridge" pill is no longer clipped at the bottom, and fixes the generator script's dimensions.

Validation

  • Lightweight Python tests green (vizx suite); black / isort / flake8 clean.
  • QC checks pass: doc-coverage, binding-parity, diagram-coverage, secrets-scan, internals-leak.

This pull request and its description were written by Isaac.

…ottom) (#44)

The portrait infographic SVG auto-sizes to its content (now 1416x1782), but the PNG
was screenshotted at the stale fixed height 1100, clipping the bottom of the right
column (Vector-Raster Bridge, H3 Grid, Quadbin Grid, Web-Mercator Tile Output) once
rst_h3_rasterize_agg pushed Aggregators to a second row. Re-screenshot at the real
height. To stop this recurring, the script now prints the portrait canvas size and
the docstring says to use that printed height (it grows as functions are added).

Co-authored-by: Isaac

Co-authored-by: Michael Johns <user.name>
* refactor(vizx): rebrand the visualization module viz -> VizX (gbx.vizx)

Promote the visualization module to a first-class VizX package, consistent with
RasterX/GridX/VectorX. Clean rename (beta, no aliases): module databricks.labs.gbx.viz
-> .vizx; extra [viz] -> [vizx]; all imports + install snippets across code, docs,
tests, CI, notebooks, READMEs, release notes. Docs: viz.mdx -> vizx.mdx with the new
VizX logo in the title; sidebar entry "VizX" under GridX; a VizX section after VectorX
on the overview. New resources/images/VizX.png (emerald isometric-cube icon matching
the package set, generated by vizx-icon.py). Historical superpowers specs/plans left
as-is. vizx tests 27 passed; lint clean; Docusaurus build green (no dangling /api/viz).

Co-authored-by: Isaac

* docs(vizx): title "Function Reference" (logo only), matching GridX

H1 is the VizX logo + "Function Reference" (the logo carries the name, like the
GridX/RasterX pages); frontmatter title -> "VizX Function Reference".

Co-authored-by: Isaac

* refactor(xview): adopt VizX plot helpers; strip dbfs:/file: in plot_file

The xView notebook defined its own plot_raster/plot_file inline (raw
rasterio.plot.show, no decimation/stretch/nodata masking). Replace them
with the tier-agnostic VizX helpers so the preview path matches eo-series
and gains decimation, percentile stretch, and nodata masking for free.

xView passes dbfs:-qualified Volume paths to plot_file, so normalize a
leading dbfs:/file: scheme to the bare FUSE path inside vizx.plot_file
(benefits every Databricks caller) rather than stripping at each call
site. Update the install to geobrix[light,vizx], the README, and the
vizx docs accordingly.

Co-authored-by: Isaac

* docs(spec): VizX plot_static static-map helper design

Design for a tier-agnostic vizx.plot_static that renders Spark/GeoPandas
geometries (and DGGS cells) over a contextily basemap as a static,
GitHub-renderable figure — the non-interactive counterpart to .explore().
Auto-resolves geometry encodings (WKT/EWKT/WKB/EWKB + native
GEOMETRY/GEOGRAPHY) via the shared parse_geom; grid_system param
(h3 in v1; quadbin/bng/custom forward-declared as fast-follow); basemap
with graceful no-egress fallback.

Co-authored-by: Isaac

* docs(plan): VizX plot_static implementation plan (6 tasks, TDD)

* build(vizx): add contextily dep, hash-pin in CI + dev-container locks

* feat(vizx): _static_map geometry-path resolution (parse_geom reuse)

Adds _static_map.py with _geom_strategy, _detect_geom_col, _collect_limited,
and _resolve_gdf (geometry path); reuses gbx._geom.parse_geom for WKT/WKB
decoding. _resolve_cells stub deferred to Task 3. All 8 tests green.

* feat(vizx): plot_static h3 cell dispatch; quadbin/bng/custom forward-declared

* feat(vizx): plot_static renderer with contextily basemap + fallback

* docs(vizx): document plot_static static-map helper

* docs(notebooks): adopt vizx.plot_static in h3-rasterize map cell

* docs(spec): note quadbin/bng fast-follow via quadbin_aswkb/bng_aswkb

* docs(spec): quadbin/bng fast-follow uses driver-side _aswkb (h3-style)

* fix(vizx): plot_static reprojects to 3857 always so overlays align

The 3857 reproject was gated on basemap=True, so a basemap=False overlay
(e.g. a canvas-boundary layer) was drawn in raw 4326 degrees while the base
layer was in Web Mercator meters -> the layers landed in different coordinate
spaces and did not overlay. Reproject every layer to 3857 regardless; basemap
now only toggles whether tiles are fetched. Adds a regression test asserting a
basemap=False layer is in meters, not degrees.

Co-authored-by: Isaac

* feat(vizx): plot_static fill= outline mode + drop internal plt.show()

Two overlay-ergonomics improvements:
- fill=False draws geometries as outlines (facecolor none) so a boundary layer
  (e.g. a shared-canvas rectangle) doesn't cover the filled layers beneath it.
- plot_static no longer calls pyplot.show(); the inline/Databricks backend
  auto-displays the figure at cell end with all overlaid layers. Calling show()
  on the figure-creating call flushed the base layer before an ax= overlay was
  added, so overlays didn't render in real notebooks (masked in tests by the
  no-op Agg backend).

Together these make the documented overlay pattern correct:
  ax = plot_static(cells_df, grid_system='h3', column='band_level', title=...)
  plot_static(grid_gdf, ax=ax, fill=False, edgecolor='red', basemap=False)

Adds fill true/false and no-show regression tests; docs updated. Notebook cell
left to the user (live-edited).

Co-authored-by: Isaac

* docs(notebooks): plot_static in h3-rasterize; refresh outputs

h3-rasterize: adopt vizx.plot_static for the polyfill and shared-canvas
overlay map cells (per-cell H3 choropleth over a basemap; fill=False
outline for the canvas rectangle), with cluster-executed outputs.
xView: refresh cluster-executed outputs (no code change).

* test(vizx): cover _detect_geom_col error and single-column paths

The geometry/cell column auto-detection was only exercised through the
happy-path end-to-end tests, leaving its error branches unverified. Add
direct tests: no geometry column found (grid_system=None) and an ambiguous
multi-column cell input (grid_system set) both raise ValueError, and a lone
column with grid_system set is selected. Closes the QC test-completeness gap.

---------

Co-authored-by: Michael Johns <user.name>
@mjohns-databricks mjohns-databricks requested a review from a team as a code owner June 25, 2026 03:13
@mjohns-databricks mjohns-databricks merged commit 36d7b0a into main Jun 25, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant