Repository navigation
feat(components): order chart series by value in the intent grammar - #53
Merged
Merged
Conversation
A chart intent can now carry `order: {by: "value", direction, period?}` on
line_chart, bar_chart and table, so a platform draws the series in value order
instead of the member-id order its canonical select produces. bar_chart takes
no `period`. catalog_version moves to 2026.11.1.
…h reports a fallback The `order` description on line_chart and table now says each series moves whole, so a table's rows keep their period order; states the ranking rule as the period where the most drawn series hold a value, the later on a tie; and says a refresh that can no longer rank as asked still draws and reports what it did in the fact summary.
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.
A chart intent can carry
order: {by: "value", direction: "descending" | "ascending", period?}online_chart,bar_chartandtable. dfo-apis sorts every select list by member id (canonical_select), so today a "24 largest" bar chart draws its bars in id order; this member lets a writer ask for value order while the select stays a set for identity.Changes
schemas/intent.v0.json:orderonline_chartandtablewith an optionalperiodlabel (up to 21 characters, the window label bound);bar_charttakes the same object withoutperiod.stat_card,note_narrationandsource_cardstill refuse it. The description says the order moves whole series, so a table's rows keep their period order within a series; that withoutperiodthe series rank at the period where the most drawn series hold a value, the later on a tie; and that a refresh that can no longer rank as asked still draws and reports what it did in the fact summary.manifest.json:catalog_version2026.11.1, the intent schema digest, and the payload fixtures' digests, since each fixture carries the version.tests/test_intent_grammar.py: which components admitorder, theperiodbound, and the refusedbyanddirectionvalues.Notes for reviewers
dfo-apis applies the member in DevelopmentFinanceObservatory/apis#300, pinned to this branch's head (9efaed0); repin to the merge commit after this merges. A deployment on 2026.11.0 refuses an intent that carries
orderwithschema_invalid, so dfo-ai sends it only after dfo-apis prod serves 2026.11.1.Testing:
uv run pytest testsinpython/dfo-spec-kit-components(367 passed), ruff,tools/validate_registry.py.