-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Explore Vis] migrate state timeline #11136
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
Changes from all commits
9afc42e
893d2a5
6247662
994eb60
5afb4a8
56ce74d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| feat: | ||
| - Migrate state timeline ([#11136](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/11136)) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,6 +54,7 @@ import { | |
| createNumericalStateTimeline, | ||
| createCategoricalStateTimeline, | ||
| createSingleCategoricalStateTimeline, | ||
| createSingleNumericalStateTimeline, | ||
| } from './state_timeline/to_expression'; | ||
| import { createBarGaugeSpec } from './bar_gauge/to_expression'; | ||
| import { | ||
|
|
@@ -153,6 +154,15 @@ const oneMetricOneDateRule: VisualizationRule = { | |
| styleOptions as MetricChartStyle, | ||
| axisColumnMappings | ||
| ); | ||
| case 'state_timeline': | ||
| return createSingleNumericalStateTimeline( | ||
| transformedData, | ||
| numericalColumns, | ||
| categoricalColumns, | ||
| dateColumns, | ||
| styleOptions as StateTimeLineChartStyle, | ||
| axisColumnMappings | ||
| ); | ||
|
Comment on lines
+157
to
+165
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing The If this is intentional (e.g., the chart type should only be available via explicit selection), please confirm. Otherwise, consider adding it: 🔎 Proposed fix chartTypes: [
{ ...CHART_METADATA.line, priority: 100 },
{ ...CHART_METADATA.area, priority: 80 },
{ ...CHART_METADATA.bar, priority: 60 },
{ ...CHART_METADATA.metric, priority: 40 },
+ { ...CHART_METADATA.state_timeline, priority: 20 },
],
🤖 Prompt for AI Agents |
||
| default: | ||
| return createSimpleLineChart( | ||
| transformedData, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,6 +43,7 @@ export interface StateTimeLineChartStyleOptions { | |
| titleOptions?: TitleOptions; | ||
|
|
||
| valueMappingOptions?: ValueMappingOptions; | ||
| // TODO add Color mode options(temporary name) to make a switch between No style, Use Value Mapping Color, Use Threshold Color | ||
| useThresholdColor?: boolean; | ||
| thresholdOptions?: ThresholdOptions; | ||
| } | ||
|
|
@@ -127,6 +128,10 @@ export const createStateTimelineConfig = (): VisualizationType<'state_timeline'> | |
| [AxisRole.X]: { type: VisFieldType.Date, index: 0 }, | ||
| [AxisRole.COLOR]: { type: VisFieldType.Categorical, index: 0 }, | ||
| }, | ||
| { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this affect existing Vega implementation?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I also create a vega implementation for this one. |
||
| [AxisRole.X]: { type: VisFieldType.Date, index: 0 }, | ||
| [AxisRole.COLOR]: { type: VisFieldType.Numerical, index: 0 }, | ||
| }, | ||
| ], | ||
| }, | ||
| }); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need special handle for one chart case? Can we simply create a one grid chart?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, users can select a facet field that results in only a single group.