Repository navigation
fix(viz): choropleth --geojson implies geojson-id; trim locations, float ids, bad census vintage - #4877
Merged
Conversation
…oat ids, bad census vintage `--location-mode` carried a docopt `[default: iso3]`, so `viz choropleth --locations X --geojson ...` without an explicit mode emitted `"locationmode":"ISO-3"` beside the geojson. plotly then ignores the geojson and shades nothing, while qsv exits 0 -- including the help text's own `--geojson auto` example. The default is now resolved in code: an explicit `--location-mode` wins, a `--geojson` (without `--geocode`) implies geojson-id, else iso3. Related location fixes on the same path: - trim location cells in the built-in iso3/usa-states modes (`PA ` no longer splits from `PA`, and `--denominator census` finds padded codes) - stringify integral float feature ids as plotly does (`6037.0` -> `6037`) - reject a mistyped `--denominator census@<year>` up front instead of resolving it as a column after fetching boundaries Regenerated docs/help/viz.md and the qsv-viz skill JSON. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
viz choropleth --locations X --geojson <file|auto|census:*>without--location-modedrew a blank map while exiting 0.--location-modecarried a docopt[default: iso3], so the trace emitted"locationmode":"ISO-3"beside the geojson, and plotly only readsgeojsoningeojson-idmode. This hit the help text's own--geojson autoexample and has been there since the choropleth landed (#4086). The existing tests all passed--location-mode geojson-idexplicitly, so the suite never covered the default.--mapand theviz smartdashboards (choroplethmap) were unaffected.Found in a whole-file review of
viz.rs, along with three smaller location bugs on the same path:--location-modewins; otherwise--geojson(without--geocode) →geojson-id; otherwiseiso3.--geocodekeepsiso3because it yields ISO-3/US-state codes.iso3/usa-statesmodes (noRegionMatcherthere):PAno longer splits fromPA, and--denominator censusfinds padded codes."FIPS": 6037.0, common in geopandas exports) are stringified as plotly does (6037), not as serde_json does (6037.0, which matched no region).--denominator census@<bad-year>is a clear usage error up front, instead of being resolved as a column (on choropleth, only after fetching boundaries).Verification
--geojsonrepro drew 0 regions before and draws 2 now.tests/test_viz.rs. Each was mutation-checked (revert the fix → its test fails; 5/5 killed).test_viz*suite: 678 passed. Clippy: no new warnings.double-run-check.py --checkOK.docs/help/viz.mdand theqsv-vizskill JSON. Entries in CHANGELOG and the skills CHANGELOG.🤖 Generated with Claude Code