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

Add gaps, time ranges, time zones, defaults to the canvas YAML #6389

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,002 changes: 581 additions & 421 deletions proto/gen/rill/runtime/v1/resources.pb.go

Large diffs are not rendered by default.

178 changes: 176 additions & 2 deletions proto/gen/rill/runtime/v1/resources.pb.validate.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 52 additions & 3 deletions proto/gen/rill/runtime/v1/runtime.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3472,33 +3472,85 @@ definitions:
height:
type: integer
format: int64
v1CanvasPreset:
type: object
properties:
timeRange:
type: string
description: |-
Time range for the explore.
It corresponds to the `range` property of the explore's `time_ranges`.
If not found in `time_ranges`, it should be added to the list.
comparisonMode:
$ref: '#/definitions/v1ExploreComparisonMode'
description: |-
Comparison mode.
TODO: Once the canvas APIs have stabilized, rename ExploreComparisonMode to a non-explore-specific name.
comparisonDimension:
type: string
description: If comparison_mode is EXPLORE_COMPARISON_MODE_DIMENSION, this indicates the dimension to use.
v1CanvasSpec:
type: object
properties:
displayName:
type: string
description: Display name for the canvas.
maxWidth:
type: integer
format: int64
description: Max width in pixels of the canvas.
gapX:
type: integer
format: int64
description: Horizontal gap in pixels of the canvas.
gapY:
type: integer
format: int64
description: Vertical gap in pixels of the canvas.
theme:
type: string
description: Name of the theme to use. Only one of theme and embedded_theme can be set.
embeddedTheme:
$ref: '#/definitions/v1ThemeSpec'
description: Theme to use, provided inline. Only one of theme and embedded_theme can be set.
timeRanges:
type: array
items:
type: object
$ref: '#/definitions/v1ExploreTimeRange'
description: |-
List of selectable time ranges with comparison time ranges.
If the list is empty, a default list should be shown.
TODO: Once the canvas APIs have stabilized, rename ExploreTimeRange to a non-explore-specific name.
timeZones:
type: array
items:
type: string
description: |-
List of selectable time zones.
If the list is empty, a default list should be shown.
The values should be valid IANA location identifiers.
defaultPreset:
$ref: '#/definitions/v1CanvasPreset'
description: Preset UI state to show by default.
variables:
type: array
items:
type: object
$ref: '#/definitions/v1ComponentVariable'
description: Variables that can be used in the canvas.
items:
type: array
items:
type: object
$ref: '#/definitions/v1CanvasItem'
title: Items to render on the canvas
securityRules:
type: array
items:
type: object
$ref: '#/definitions/v1SecurityRule'
description: Security rules to apply for access to the canvas.
v1CanvasState:
type: object
properties:
Expand Down Expand Up @@ -3844,9 +3896,6 @@ definitions:
$ref: '#/definitions/v1ComponentVariable'
output:
$ref: '#/definitions/v1ComponentVariable'
show:
type: string
description: Templated string that should evaluate to a boolean.
definedInCanvas:
type: boolean
v1ComponentState:
Expand Down
34 changes: 33 additions & 1 deletion proto/rill/runtime/v1/resources.proto
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,6 @@ message ComponentSpec {
google.protobuf.Struct renderer_properties = 5;
repeated ComponentVariable input = 8;
ComponentVariable output = 9;
string show = 10; // Templated string that should evaluate to a boolean.
bool defined_in_canvas = 6;
}

Expand All @@ -699,12 +698,33 @@ message Canvas {
}

message CanvasSpec {
// Display name for the canvas.
string display_name = 1;
// Max width in pixels of the canvas.
uint32 max_width = 2;
// Horizontal gap in pixels of the canvas.
uint32 gap_x = 9;
// Vertical gap in pixels of the canvas.
uint32 gap_y = 10;
// Name of the theme to use. Only one of theme and embedded_theme can be set.
string theme = 7;
// Theme to use, provided inline. Only one of theme and embedded_theme can be set.
ThemeSpec embedded_theme = 8;
// List of selectable time ranges with comparison time ranges.
// If the list is empty, a default list should be shown.
// TODO: Once the canvas APIs have stabilized, rename ExploreTimeRange to a non-explore-specific name.
repeated ExploreTimeRange time_ranges = 11;
// List of selectable time zones.
// If the list is empty, a default list should be shown.
// The values should be valid IANA location identifiers.
repeated string time_zones = 12;
// Preset UI state to show by default.
CanvasPreset default_preset = 15;
// Variables that can be used in the canvas.
repeated ComponentVariable variables = 5;
// Items to render on the canvas
repeated CanvasItem items = 4;
// Security rules to apply for access to the canvas.
repeated SecurityRule security_rules = 6;
}

Expand All @@ -721,6 +741,18 @@ message CanvasItem {
optional uint32 height = 5;
}

message CanvasPreset {
// Time range for the explore.
// It corresponds to the `range` property of the explore's `time_ranges`.
// If not found in `time_ranges`, it should be added to the list.
optional string time_range = 1;
// Comparison mode.
// TODO: Once the canvas APIs have stabilized, rename ExploreComparisonMode to a non-explore-specific name.
ExploreComparisonMode comparison_mode = 2;
// If comparison_mode is EXPLORE_COMPARISON_MODE_DIMENSION, this indicates the dimension to use.
optional string comparison_dimension = 8;
}

// API defines a custom operation for querying data stored in Rill.
message API {
APISpec spec = 1;
Expand Down
Loading
Loading