feat(core): capability-driven field model and visual encodings#14
Merged
Conversation
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Replaces PlotX's domain-keyed chart selection with a domain-neutral field
model and capability-driven visual encodings. A dataset now exposes its
plottable parts as addressable fields, each advertising capabilities (regular
2-D scalar grid, 1-D curve, colored raster, …). Charts and encodings are offered
by what a field can do, not by which domain it belongs to, and colours and
level settings move out of the shared series binding into the concrete encoding
they belong to.
This makes cross-domain visualisation possible — an AFM height map can be drawn
as a contour, an NMR plane as a heatmap — with no new numeric kernels, and gives
contours independent positive/negative styling.
What changed
Field model
FieldIds, persisted ina per-dataset field catalog. Field identity survives reload and channel
reordering and is no longer a collection index.
field.*capability constants (reusingCapabilityId) drivesapplicability across encodings, chart descriptors and resource descriptors.
Visual encoding
SeriesSource { resource, field }replaces the dataset-index binding.SeriesEncoding(Line/Contour/Heatmap/Image) is a concrete, persistedper-series model;
color/scalenow live inside the encoding that gives themmeaning.
ContourSpecmodels positive and negative levels independently (base policy,count, ratio) with separate colour and style — positive and negative contours
are no longer forced to share one colour.
Capability-driven applicability
recommended_domainsis now advisory (ordering and default selection only) andno longer gates what is available. A provider that exposes
field.scalar_grid_2d.regulargets contour and heatmap without touching thechart registry.
AFM
selected_channelto per-seriesSeriesSource.field, fixing channel ownership.Compatibility
Pre-release: no backward compatibility is kept for older project files. The
persisted series requires
fieldandencoding; the project schema version isunchanged.
Out of scope
This change establishes the field and encoding model. A unified parameter
catalog with search, and background estimate/geometry caching for contours, are
not part of it.
Testing
cargo pr-checkpasses: formatting, source-size limit, dependency policy,Clippy with warnings denied, and the test suite on both the reference and
DataFusion backends. New tests cover capability-driven gallery selection, an
unregistered regular scalar field gaining contour/heatmap, non-uniform grids
being excluded from contour, magnitude-versus-real field rendering, contour
numeric edge cases, field-identity round-trips and channel reordering.