Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime: Dashboard components with generic renderers and optional inline definition #4735

Merged
merged 4 commits into from
Apr 29, 2024

Conversation

begelundmuller
Copy link
Contributor

@begelundmuller begelundmuller commented Apr 26, 2024

Changes:

  • Changed the components: property to items: in the dashboard YAML
    • The idea is that item = component + grid info
  • Renamed the Chart resource to Component
  • Supports inline component definition from a dashboard:
    • if items[*].component is a string, it is treated as a reference to an externally defined component
    • if items[*].component is a map, it is treated as an inline component definition
  • Added generic renderer and renderer_properties fields to Component
  • Defines three renderers with the following formats:
    • "renderer": "vega_lite", "rendererProperties": {"spec": "..."}
    • "renderer": "markdown", "rendererProperties": {"contents": "..."}
    • "renderer": "image", "rendererProperties": {"url": "..."}
  • Inline component definitions are emitted as separate Component resources called [dashboard name]--component[idx]
  • Changes the /charts/{name}/data API to /components/{name}/data
  • Changes the GenerateChartSpec API to GenerateRenderer. It now returns two values: renderer and renderer_properties.

See this design doc for the new component syntax.

This PR currently breaks the frontend since these are breaking changes.

@begelundmuller begelundmuller self-assigned this Apr 26, 2024
uint32 x = 2;
uint32 y = 3;
uint32 width = 4;
uint32 height = 5;
string markdown = 6;
uint32 font_size = 7;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this stay in the DashboardComponent or be moved to the renderer_properties for the markdown renderer? If the latter, it may require a syntax change since currently it's:

kind: component
markdown: Hello world

not:

kind: component
markdown:
  contents: Hello world
  font_size: 12

Another idea is to not support a separately defined font size and let people do it within Markdown using for example <span> tags?

* Update to use new API

* Fix add chart

* Fix AI generate chart

* Fix lint
@begelundmuller begelundmuller merged commit 458a206 into main Apr 29, 2024
7 checks passed
@begelundmuller begelundmuller deleted the begelundmuller/dashboard-components branch April 29, 2024 18:41
k-anshul pushed a commit that referenced this pull request Apr 30, 2024
…ine definition (#4735)

* Runtime: Dashboard components with generic renderers and optional inline definition

* Change "components" to "items" in the dashboard YAML

* UI changes for updated Dashboard Component specs (#4744)

* Update to use new API

* Fix add chart

* Fix AI generate chart

* Fix lint

* Fix lint in web-admin

---------

Co-authored-by: Aditya Hegde <adityahegderocks@gmail.com>
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.

3 participants