feat: custom chart and component with vega lite ejection - #9850
Open
djbarnwal wants to merge 17 commits into
Open
feat: custom chart and component with vega lite ejection#9850djbarnwal wants to merge 17 commits into
djbarnwal wants to merge 17 commits into
Conversation
Extract inline canvas custom charts into reusable component resources: - Components declare typed params (metrics_view, measure, dimension, time_dimension, scalars) validated at parse and reconcile time - Canvas items reference components via 'component:' + 'params:' bindings; param-bound metrics views flow through transitive access security - ResolveComponent merges defaults, validates bindings, resolves templates, and injects scalar params as native Vega-Lite params - Component workspace with live preview, test bindings, used-by panel, and breaking-change warnings - 'Save as custom viz' extraction from inline charts and 'Detach copy' inverse - Vega-Lite examples gallery (vendored snapshot with static SVG thumbnails) with AI-first import: spec-in-prompt generation, placeholder file, and a self-healing validation loop with static structure/consistency checks - Generated components include customizable order_by and limit params with density-based defaults; order_by follows re-bound fields in the editor - Dev-agent instructions for authoring components (metrics_sql dialect rules, encoding/param type matching, row-local calculate preservation for diverging charts) Gated behind the customComponents frontend flag and custom_components runtime flag.
- Format touched files with prettier - Fix svelte-check errors: Extract string keys in AllKeys so ComponentRefSpec's index signature doesn't widen keys to string | number; narrow the index signature values to scalars (matching the parser's scalar-only bindings); type initializeRow over AddableItem; pass the required editor binding in ComponentWorkspace; remove unused imports and cast union field accesses - Add customComponents to the expected maps in Test_ResolveFeatureFlags
- Add the component_extract_title message key (en/es) - Bind the required viewVL prop on the preview's inline VegaLiteRenderer - Cast metrics_view access in FiltersMapper to string | null
- ResolveCanvas: skip templated metrics_view renderer properties instead of looking them up as literal resource names (param-bound metrics views are collected from the canvas items) - Frontend: give canvas items referencing an external component their positional instance id as component.id, so two references to the same component get distinct DOM ids and consistent selection/cleanup; make the drag-move reselect path instance-aware and use getElementById for ids containing '::' - Transitive access: scan metrics_sql lists (multi-query custom charts) for metrics view refs, not just single query strings - Parser: components declaring a metrics_view param with a default now get a ref to the default metrics view for DAG ordering and invalidation
# Conflicts: # proto/gen/rill/runtime/v1/queries.pb.go # proto/gen/rill/runtime/v1/resources.pb.go # runtime/parser/parser_test.go
…ct time_dimension picker - Renderer validators now run structural checks (required keys, types, enums) on parameterized components with templated properties; only field-membership checks against the metrics view are skipped for unresolvable values. - The time_dimension param picker now only offers time fields (the primary time dimension and time-typed dimensions) and supports search, instead of listing every dimension and returning no results for any search term.
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.
Uses flint for creating a gallery of custom viz with an option to eject to a vega lite spec for more granular control.
Checklist: