Skip to content

dwind-dviz: harden the public API - #29

Merged
JedimEmO merged 9 commits into
mainfrom
feat/dwind-dviz
Sep 12, 2026
Merged

JedimEmO merged 9 commits into
mainfrom
feat/dwind-dviz

Conversation

@JedimEmO

@JedimEmO JedimEmO commented Sep 12, 2026

Copy link
Copy Markdown
Owner

What changed

This PR hardens the new dwind-dviz crate before its first public release. The focus is correctness and extension points, not adding another chart type.

Data and scale contracts

  • Add typed DataError validation for empty/duplicate series ids and invalid coordinates.
  • Add transactional try_new/try_set constructors for static and mutable sources.
  • Add checked logarithmic-scale constructors and duplicate-category validation.
  • Add typed CategoryPoint conversion and encode_category_series for categorical bars.
  • Make series color assignment deterministic by series id rather than first-render order.

Extensibility and reactivity

  • Add CustomScale/CustomScaleHandle for user-defined x/y scales with mapping, inversion, ticks, descriptions, and responsive ranges.
  • Add DomainSource for reactive x-extents from static, mutable, and windowed data.
  • Make labels and fixed y-domains consistently signal-capable across the presets.
  • Add hover and click-selection callbacks to crosshair interaction.

Accessibility and examples

  • Keep the chart ARIA fallback and description behavior.
  • Provide table_view for series summaries and point_table_view for every exact observation.
  • Update the live gallery page and API documentation/roadmap.

Verification

  • cargo test -p dwind-dviz-core -p dwind-dviz-data -p dwind-dviz: 72 core, 11 data, and 22 renderer tests passing.
  • cargo check --workspace: passing.
  • cargo check -p dwind-dviz --target wasm32-unknown-unknown: passing.
  • Strict no-dependency Clippy passes for all three dviz crates.
  • git diff --check: passing.

Browser tests are configured in CI with wasm-bindgen 0.2.126 to match the lockfile. The local runner is 0.2.128, so local browser execution is blocked by that tool-version mismatch rather than a compile or test failure.

JedimEmO and others added 2 commits September 12, 2026 10:22
The chart library that grew up as its own (never pushed) repository now
lives here as three crates: dwind-dviz-core (DOM-free scales, ticks,
geometry, formatting, validated palettes), dwind-dviz-data (signal-backed
static and live sources) and dwind-dviz (the SVG renderer, layers and
presets). They opt into a new [workspace.package] block and depend on
dwind, dwind-macros and dwui by path, so they version, test and publish
with the rest of the stack. The crate README, PLAN.md and pre-migration
changelog come along.

The chrome neutrals are now the woodsmoke steps, and three host tokens
(--dviz-accent, --dviz-font-display, --dviz-font-mono) let an app pull
charts into its look without touching data colours. The example site sets
them on its root and gains a Charts page at #/charts: every preset, live
data, keyboard and pointer interaction, and a light-surface preview
switch. It is linked from the header, the footer and the command palette.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JsXRd7GCo4GpdH3sfLCXk5
@JedimEmO JedimEmO changed the title Harden dwind-dviz API and publish branch preview dwind-dviz: harden the public API Sep 12, 2026
@JedimEmO
JedimEmO merged commit 6e4b643 into main Sep 12, 2026
1 check 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