@perses-dev/timeseries-chart-plugin 0.13.0-beta.3 → 0.13.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__mf/js/TimeSeriesChart.1b9392b7.js +7 -0
- package/__mf/js/async/208.b9f374ad.js +7 -0
- package/__mf/js/async/{52.0850e52c.js → 52.0d78de2b.js} +1 -1
- package/__mf/js/async/546.c53e636c.js +3 -0
- package/__mf/js/async/694.0fb9ee5a.js +2 -0
- package/__mf/js/async/{984.5778f693.js → 984.3fc3c480.js} +3 -3
- package/__mf/js/async/__federation_expose_TimeSeriesChart.8b44fc75.js +1 -0
- package/__mf/js/{main.046b2715.js → main.dc72f3eb.js} +2 -2
- package/lib/QuerySettingsEditor.d.ts.map +1 -1
- package/lib/QuerySettingsEditor.js +81 -4
- package/lib/QuerySettingsEditor.js.map +1 -1
- package/lib/TimeSeriesChartPanel.d.ts.map +1 -1
- package/lib/TimeSeriesChartPanel.js +17 -3
- package/lib/TimeSeriesChartPanel.js.map +1 -1
- package/lib/VisualOptionsEditor.js.map +1 -1
- package/lib/cjs/QuerySettingsEditor.js +80 -3
- package/lib/cjs/TimeSeriesChartPanel.js +17 -3
- package/lib/cjs/utils/data-transform.js +9 -13
- package/lib/time-series-chart-model.d.ts +7 -0
- package/lib/time-series-chart-model.d.ts.map +1 -1
- package/lib/time-series-chart-model.js.map +1 -1
- package/lib/utils/data-transform.d.ts +1 -0
- package/lib/utils/data-transform.d.ts.map +1 -1
- package/lib/utils/data-transform.js +9 -13
- package/lib/utils/data-transform.js.map +1 -1
- package/mf-manifest.json +17 -17
- package/mf-stats.json +17 -17
- package/package.json +5 -5
- package/__mf/js/TimeSeriesChart.693fccf6.js +0 -7
- package/__mf/js/async/247.b8cba23e.js +0 -7
- package/__mf/js/async/555.a66f6ab5.js +0 -2
- package/__mf/js/async/570.bafa9150.js +0 -3
- package/__mf/js/async/__federation_expose_TimeSeriesChart.5f574fcb.js +0 -1
- /package/__mf/css/async/{247.85c2cbf6.css → 208.85c2cbf6.css} +0 -0
- /package/__mf/js/async/{247.b8cba23e.js.LICENSE.txt → 208.b9f374ad.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{555.a66f6ab5.js.LICENSE.txt → 694.0fb9ee5a.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{984.5778f693.js.LICENSE.txt → 984.3fc3c480.js.LICENSE.txt} +0 -0
|
@@ -225,11 +225,36 @@ function QuerySettingsEditor(props) {
|
|
|
225
225
|
qs.format = undefined;
|
|
226
226
|
});
|
|
227
227
|
};
|
|
228
|
+
const addStack = (i)=>{
|
|
229
|
+
updateQuerySettings(i, (qs)=>{
|
|
230
|
+
qs.stack = false;
|
|
231
|
+
});
|
|
232
|
+
};
|
|
233
|
+
const removeStack = (i)=>{
|
|
234
|
+
updateQuerySettings(i, (qs)=>{
|
|
235
|
+
qs.stack = undefined;
|
|
236
|
+
});
|
|
237
|
+
};
|
|
238
|
+
const handleStackChange = (i, checked)=>{
|
|
239
|
+
updateQuerySettings(i, (qs)=>{
|
|
240
|
+
qs.stack = checked;
|
|
241
|
+
});
|
|
242
|
+
};
|
|
228
243
|
const handleFormatChange = (i, format)=>{
|
|
229
244
|
updateQuerySettings(i, (qs)=>{
|
|
230
245
|
qs.format = format;
|
|
231
246
|
});
|
|
232
247
|
};
|
|
248
|
+
const addNegativeY = (i)=>{
|
|
249
|
+
updateQuerySettings(i, (qs)=>{
|
|
250
|
+
qs.negativeY = true;
|
|
251
|
+
});
|
|
252
|
+
};
|
|
253
|
+
const removeNegativeY = (i)=>{
|
|
254
|
+
updateQuerySettings(i, (qs)=>{
|
|
255
|
+
qs.negativeY = undefined;
|
|
256
|
+
});
|
|
257
|
+
};
|
|
233
258
|
const { queryDefinitions } = (0, _pluginsystem.useDataQueriesContext)();
|
|
234
259
|
const queryCount = queryDefinitions.length;
|
|
235
260
|
const queryNames = (0, _react.useMemo)(()=>(0, _pluginsystem.generateQueryNames)(queryDefinitions), [
|
|
@@ -296,7 +321,12 @@ function QuerySettingsEditor(props) {
|
|
|
296
321
|
onRemoveAreaOpacity: ()=>removeAreaOpacity(i),
|
|
297
322
|
onAddFormat: ()=>addFormat(i),
|
|
298
323
|
onRemoveFormat: ()=>removeFormat(i),
|
|
299
|
-
onFormatChange: (format)=>handleFormatChange(i, format)
|
|
324
|
+
onFormatChange: (format)=>handleFormatChange(i, format),
|
|
325
|
+
onAddNegativeY: ()=>addNegativeY(i),
|
|
326
|
+
onRemoveNegativeY: ()=>removeNegativeY(i),
|
|
327
|
+
onAddStack: ()=>addStack(i),
|
|
328
|
+
onRemoveStack: ()=>removeStack(i),
|
|
329
|
+
onStackChange: (checked)=>handleStackChange(i, checked)
|
|
300
330
|
}, i)),
|
|
301
331
|
queryCount > 0 && firstAvailableQueryIndex !== NO_INDEX_AVAILABLE && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
302
332
|
variant: "contained",
|
|
@@ -310,7 +340,7 @@ function QuerySettingsEditor(props) {
|
|
|
310
340
|
]
|
|
311
341
|
});
|
|
312
342
|
}
|
|
313
|
-
function QuerySettingsInput({ querySettings: { queryIndex, colorMode, colorValue, lineStyle, areaOpacity, format }, availableQueryIndexes, queryNames, onQueryIndexChange, onColorModeChange, onColorValueChange, onLineStyleChange, onAreaOpacityChange, onDelete, inputRef, onAddColor: onAddColor, onRemoveColor: onRemoveColor, onAddLineStyle, onRemoveLineStyle, onAddAreaOpacity, onRemoveAreaOpacity, onAddFormat, onRemoveFormat, onFormatChange }) {
|
|
343
|
+
function QuerySettingsInput({ querySettings: { queryIndex, colorMode, colorValue, lineStyle, areaOpacity, format, negativeY, stack }, availableQueryIndexes, queryNames, onQueryIndexChange, onColorModeChange, onColorValueChange, onLineStyleChange, onAreaOpacityChange, onDelete, inputRef, onAddColor: onAddColor, onRemoveColor: onRemoveColor, onAddLineStyle, onRemoveLineStyle, onAddAreaOpacity, onRemoveAreaOpacity, onAddFormat, onRemoveFormat, onFormatChange, onAddNegativeY, onRemoveNegativeY, onAddStack, onRemoveStack, onStackChange }) {
|
|
314
344
|
// current query index should also be selectable
|
|
315
345
|
const selectableQueryIndexes = availableQueryIndexes.concat(queryIndex).sort((a, b)=>a - b);
|
|
316
346
|
// State for dropdown menu
|
|
@@ -338,16 +368,30 @@ function QuerySettingsInput({ querySettings: { queryIndex, colorMode, colorValue
|
|
|
338
368
|
label: 'Format',
|
|
339
369
|
action: onAddFormat
|
|
340
370
|
});
|
|
371
|
+
if (!negativeY) options.push({
|
|
372
|
+
key: 'negativeY',
|
|
373
|
+
label: 'Negative Y',
|
|
374
|
+
action: onAddNegativeY
|
|
375
|
+
});
|
|
376
|
+
if (stack === undefined) options.push({
|
|
377
|
+
key: 'stack',
|
|
378
|
+
label: 'Stack',
|
|
379
|
+
action: onAddStack
|
|
380
|
+
});
|
|
341
381
|
return options;
|
|
342
382
|
}, [
|
|
343
383
|
colorMode,
|
|
344
384
|
lineStyle,
|
|
345
385
|
areaOpacity,
|
|
346
386
|
format,
|
|
387
|
+
negativeY,
|
|
388
|
+
stack,
|
|
347
389
|
onAddColor,
|
|
348
390
|
onAddLineStyle,
|
|
349
391
|
onAddAreaOpacity,
|
|
350
|
-
onAddFormat
|
|
392
|
+
onAddFormat,
|
|
393
|
+
onAddNegativeY,
|
|
394
|
+
onAddStack
|
|
351
395
|
]);
|
|
352
396
|
const handleAddMenuClick = (event)=>{
|
|
353
397
|
if (availableOptions.length === 1 && availableOptions[0]) {
|
|
@@ -491,6 +535,39 @@ function QuerySettingsInput({ querySettings: { queryIndex, colorMode, colorValue
|
|
|
491
535
|
})
|
|
492
536
|
})
|
|
493
537
|
}),
|
|
538
|
+
negativeY && /*#__PURE__*/ (0, _jsxruntime.jsx)(SettingsSection, {
|
|
539
|
+
label: "Negative Y",
|
|
540
|
+
onRemove: onRemoveNegativeY,
|
|
541
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
542
|
+
variant: "body2",
|
|
543
|
+
color: "text.secondary",
|
|
544
|
+
sx: {
|
|
545
|
+
flexGrow: 1,
|
|
546
|
+
py: 0.5
|
|
547
|
+
},
|
|
548
|
+
children: "Series rendered below the X axis"
|
|
549
|
+
})
|
|
550
|
+
}),
|
|
551
|
+
stack !== undefined && /*#__PURE__*/ (0, _jsxruntime.jsxs)(SettingsSection, {
|
|
552
|
+
label: "Stack",
|
|
553
|
+
onRemove: onRemoveStack,
|
|
554
|
+
children: [
|
|
555
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Switch, {
|
|
556
|
+
checked: stack,
|
|
557
|
+
onChange: (e)=>onStackChange(e.target.checked),
|
|
558
|
+
slotProps: {
|
|
559
|
+
input: {
|
|
560
|
+
'aria-label': 'stack override'
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
}),
|
|
564
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
|
|
565
|
+
sx: {
|
|
566
|
+
flexGrow: 1
|
|
567
|
+
}
|
|
568
|
+
})
|
|
569
|
+
]
|
|
570
|
+
}),
|
|
494
571
|
availableOptions.length > 0 && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
495
572
|
children: [
|
|
496
573
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
@@ -203,9 +203,21 @@ function TimeSeriesChartPanel(props) {
|
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
+
// When negativeY is set on this query, negate the rendered values so the
|
|
207
|
+
// series renders below the X axis. The original (positive) values are
|
|
208
|
+
// preserved in `timeSeries.values` (used for legend calculations) and in
|
|
209
|
+
// `queryResults` (used for CSV export).
|
|
210
|
+
const baseValues = (0, _components.getTimeSeriesValues)(timeSeries, timeScale);
|
|
211
|
+
const renderedValues = querySettings?.negativeY ? baseValues.map((tuple)=>{
|
|
212
|
+
const [t, v] = tuple;
|
|
213
|
+
return [
|
|
214
|
+
t,
|
|
215
|
+
v === null ? null : -v
|
|
216
|
+
];
|
|
217
|
+
}) : baseValues;
|
|
206
218
|
timeChartData.push({
|
|
207
219
|
name: formattedSeriesName,
|
|
208
|
-
values:
|
|
220
|
+
values: renderedValues
|
|
209
221
|
});
|
|
210
222
|
}
|
|
211
223
|
if (legend && legendItems) {
|
|
@@ -361,8 +373,10 @@ function TimeSeriesChartPanel(props) {
|
|
|
361
373
|
end: new Date(event.end)
|
|
362
374
|
});
|
|
363
375
|
};
|
|
364
|
-
// Used to opt in to ECharts trigger item which show subgroup data accurately
|
|
365
|
-
|
|
376
|
+
// Used to opt in to ECharts trigger item which show subgroup data accurately.
|
|
377
|
+
// Derived from the actual series mapping rather than `visual.stack` alone so that
|
|
378
|
+
// bar charts stacked only via per-query overrides also use the right tooltip mode.
|
|
379
|
+
const isStackedBar = visual.display === 'bar' && timeSeriesMapping.some((s)=>s?.type === 'bar' && s.stack === 'all');
|
|
366
380
|
// Turn on tooltip pinning by default but opt out for stacked bar or if explicitly set in tooltip panel spec
|
|
367
381
|
let enablePinning = true;
|
|
368
382
|
if (isStackedBar) {
|
|
@@ -65,6 +65,7 @@ function getCommonTimeScaleForQueries(queries) {
|
|
|
65
65
|
function getTimeSeries(id, datasetIndex, formattedName, visual, timeScale, paletteColor, querySettings, yAxisIndex) {
|
|
66
66
|
const lineWidth = visual.lineWidth ?? _timeserieschartmodel.DEFAULT_LINE_WIDTH;
|
|
67
67
|
const pointRadius = visual.pointRadius ?? _timeserieschartmodel.DEFAULT_POINT_RADIUS;
|
|
68
|
+
const shouldStack = querySettings?.stack !== undefined ? querySettings.stack : visual.stack === 'all';
|
|
68
69
|
// Shows datapoint symbols when selected time range is roughly 15 minutes or less
|
|
69
70
|
const minuteMs = 60000;
|
|
70
71
|
let showPoints = timeScale.rangeMs <= minuteMs * 15;
|
|
@@ -79,7 +80,7 @@ function getTimeSeries(id, datasetIndex, formattedName, visual, timeScale, palet
|
|
|
79
80
|
datasetIndex,
|
|
80
81
|
name: formattedName,
|
|
81
82
|
color: paletteColor,
|
|
82
|
-
stack:
|
|
83
|
+
stack: shouldStack ? 'all' : undefined,
|
|
83
84
|
yAxisIndex: yAxisIndex,
|
|
84
85
|
label: {
|
|
85
86
|
show: false
|
|
@@ -94,7 +95,7 @@ function getTimeSeries(id, datasetIndex, formattedName, visual, timeScale, palet
|
|
|
94
95
|
name: formattedName,
|
|
95
96
|
connectNulls: visual.connectNulls ?? _timeserieschartmodel.DEFAULT_CONNECT_NULLS,
|
|
96
97
|
color: paletteColor,
|
|
97
|
-
stack:
|
|
98
|
+
stack: shouldStack ? 'all' : undefined,
|
|
98
99
|
yAxisIndex: yAxisIndex,
|
|
99
100
|
sampling: 'lttb',
|
|
100
101
|
progressiveThreshold: _components.OPTIMIZED_MODE_SERIES_LIMIT,
|
|
@@ -118,13 +119,6 @@ function getTimeSeries(id, datasetIndex, formattedName, visual, timeScale, palet
|
|
|
118
119
|
type: visual.lineStyle
|
|
119
120
|
}
|
|
120
121
|
},
|
|
121
|
-
selectedMode: 'single',
|
|
122
|
-
select: {
|
|
123
|
-
itemStyle: {
|
|
124
|
-
borderColor: paletteColor,
|
|
125
|
-
borderWidth: pointRadius + 0.5
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
122
|
blur: {
|
|
129
123
|
lineStyle: {
|
|
130
124
|
width: lineWidth,
|
|
@@ -177,8 +171,10 @@ function findMax(data) {
|
|
|
177
171
|
series.values.forEach((valueTuple)=>{
|
|
178
172
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
179
173
|
const [_, value] = valueTuple;
|
|
180
|
-
|
|
181
|
-
|
|
174
|
+
// Use the absolute value so percent thresholds compute correctly against
|
|
175
|
+
// negated series (e.g. when `querySettings[].negativeY` is enabled).
|
|
176
|
+
if (typeof value === 'number' && Math.abs(value) > max) {
|
|
177
|
+
max = Math.abs(value);
|
|
182
178
|
}
|
|
183
179
|
});
|
|
184
180
|
});
|
|
@@ -186,8 +182,8 @@ function findMax(data) {
|
|
|
186
182
|
data.forEach((series)=>{
|
|
187
183
|
if (series.data !== undefined) {
|
|
188
184
|
series.data.forEach((value)=>{
|
|
189
|
-
if (typeof value === 'number' && value > max) {
|
|
190
|
-
max = value;
|
|
185
|
+
if (typeof value === 'number' && Math.abs(value) > max) {
|
|
186
|
+
max = Math.abs(value);
|
|
191
187
|
}
|
|
192
188
|
});
|
|
193
189
|
}
|
|
@@ -29,6 +29,13 @@ export interface QuerySettingsOptions {
|
|
|
29
29
|
lineStyle?: LineStyleType;
|
|
30
30
|
areaOpacity?: number;
|
|
31
31
|
format?: FormatOptions;
|
|
32
|
+
/**
|
|
33
|
+
* If true, the query's series values are negated for display so they render
|
|
34
|
+
* below the X axis. The original (positive) values are preserved for legend
|
|
35
|
+
* calculations and CSV export, matching Grafana's `transform: "negative-Y"` behavior.
|
|
36
|
+
*/
|
|
37
|
+
negativeY?: boolean;
|
|
38
|
+
stack?: boolean;
|
|
32
39
|
}
|
|
33
40
|
export type TimeSeriesChartOptionsEditorProps = OptionsEditorProps<TimeSeriesChartOptions>;
|
|
34
41
|
export interface TimeSeriesChartYAxisOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time-series-chart-model.d.ts","sourceRoot":"","sources":["../../src/time-series-chart-model.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,yBAA0B,SAAQ,UAAU,CAAC,sBAAsB,CAAC;IACnF,IAAI,EAAE,iBAAiB,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACr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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/time-series-chart-model.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { FormatOptions, ThresholdOptions } from '@perses-dev/components';\nimport { OptionsEditorProps, LegendSpecOptions } from '@perses-dev/plugin-system';\nimport { Definition } from '@perses-dev/spec';\n\n/**\n * Line style options for time series charts.\n */\nexport type LineStyleType = 'solid' | 'dashed' | 'dotted';\n\n/**\n * The schema for a TimeSeriesChart panel.\n */\nexport interface TimeSeriesChartDefinition extends Definition<TimeSeriesChartOptions> {\n kind: 'TimeSeriesChart';\n}\n\n/**\n * The Options object supported by the TimeSeriesChartPanel plugin.\n */\nexport interface TimeSeriesChartOptions {\n legend?: LegendSpecOptions;\n yAxis?: TimeSeriesChartYAxisOptions;\n thresholds?: ThresholdOptions;\n visual?: TimeSeriesChartVisualOptions;\n tooltip?: TooltipSpecOptions;\n querySettings?: QuerySettingsOptions[];\n}\n\nexport interface QuerySettingsOptions {\n queryIndex: number;\n colorMode?: 'fixed' | 'fixed-single';\n colorValue?: string;\n lineStyle?: LineStyleType;\n areaOpacity?: number;\n format?: FormatOptions;\n}\n\nexport type TimeSeriesChartOptionsEditorProps = OptionsEditorProps<TimeSeriesChartOptions>;\n\nexport interface TimeSeriesChartYAxisOptions {\n show?: boolean;\n label?: string;\n format?: FormatOptions;\n min?: number;\n max?: number;\n logBase?: LOG_BASE;\n}\n\nexport interface TooltipSpecOptions {\n enablePinning: boolean;\n}\n\nexport interface TimeSeriesChartPaletteOptions {\n mode: 'auto' | 'categorical';\n}\n\nexport type TimeSeriesChartVisualOptions = {\n display?: 'line' | 'bar';\n lineWidth?: number;\n lineStyle?: LineStyleType;\n areaOpacity?: number;\n showPoints?: 'auto' | 'always';\n palette?: TimeSeriesChartPaletteOptions;\n pointRadius?: number;\n stack?: StackOptions;\n connectNulls?: boolean;\n};\n\nexport const DEFAULT_FORMAT: FormatOptions = {\n unit: 'decimal',\n shortValues: true,\n};\n\nexport const DEFAULT_Y_AXIS: TimeSeriesChartYAxisOptions = {\n show: true,\n label: '',\n format: DEFAULT_FORMAT,\n min: undefined,\n max: undefined,\n logBase: undefined,\n};\n\nexport const Y_AXIS_CONFIG = {\n show: { label: 'Show' },\n label: { label: 'Label' },\n unit: { label: 'Unit' },\n min: { label: 'Min' },\n max: { label: 'Max' },\n logBase: { label: 'Log Base' },\n};\n\nexport const DEFAULT_DISPLAY = 'line';\nexport const DEFAULT_LINE_WIDTH = 1.25;\nexport const DEFAULT_LINE_STYLE = 'solid';\nexport const DEFAULT_AREA_OPACITY = 0;\n// How much larger datapoint symbols are than line width, also applied in VisualOptionsEditor.\nexport const POINT_SIZE_OFFSET = 1.5;\nexport const DEFAULT_POINT_RADIUS = DEFAULT_LINE_WIDTH + POINT_SIZE_OFFSET;\nexport const DEFAULT_CONNECT_NULLS = false;\n\nexport const DEFAULT_VISUAL: TimeSeriesChartVisualOptions = {\n display: DEFAULT_DISPLAY,\n lineWidth: DEFAULT_LINE_WIDTH,\n lineStyle: DEFAULT_LINE_STYLE,\n areaOpacity: DEFAULT_AREA_OPACITY,\n pointRadius: DEFAULT_POINT_RADIUS,\n connectNulls: DEFAULT_CONNECT_NULLS,\n};\n\n// Controls how often static threshold values should be plotted so threshold data shows\n// in tooltip without flicker.\nexport const THRESHOLD_PLOT_INTERVAL = 15;\n\nexport const VISUAL_CONFIG = {\n lineWidth: {\n label: 'Line Width',\n testId: 'slider-line-width',\n min: 0.25,\n max: 3,\n step: 0.25,\n },\n lineStyle: {\n label: 'Line Style',\n },\n pointRadius: {\n label: 'Point Radius',\n testId: 'slider-point-radius',\n min: 0,\n max: 6,\n step: 0.25,\n },\n areaOpacity: {\n label: 'Area Opacity',\n testId: 'slider-area-opacity',\n min: 0,\n max: 1,\n step: 0.05,\n },\n stack: {\n label: 'Stack Series',\n },\n connectNulls: {\n label: 'Connect Nulls',\n },\n};\n\n// None is equivalent to undefined since stack is optional\nexport type StackOptions = 'none' | 'all'; // TODO: add percent option support\n\nexport const STACK_CONFIG = {\n none: { label: 'None' },\n all: { label: 'All' },\n // TODO: enable option after 'Percent' implemented\n // percent: { label: 'Percent', disabled: true }, // hidden since not implemented yet\n};\n\nexport const STACK_OPTIONS = Object.entries(STACK_CONFIG).map(([id, config]) => {\n return {\n id: id as StackOptions,\n ...config,\n };\n});\n\nexport const LINE_STYLE_CONFIG = {\n solid: { label: 'Solid' },\n dashed: { label: 'Dashes' },\n dotted: { label: 'Dots' },\n};\n\nexport const OPACITY_CONFIG = {\n label: 'Opacity',\n testId: 'slider-opacity',\n min: 0,\n max: 1,\n step: 0.05,\n};\n\n// LogBase outlines the allowed log bases for the log-supported charts.\nexport type LOG_BASE = undefined | 2 | 10;\n\n// Single source of truth for log base configuration\nexport const LOG_BASE_CONFIG: Record<string, { label: string; log: LOG_BASE }> = {\n none: { label: 'None', log: undefined },\n '2': { label: '2', log: 2 },\n '10': { label: '10', log: 10 },\n};\n\n// Options array for SettingsAutocomplete\nexport const LOG_BASE_OPTIONS = Object.entries(LOG_BASE_CONFIG).map(([id, config]) => ({\n id: id as string,\n ...config,\n}));\n\n// Both of these constants help produce a value that is LESS THAN the initial value.\n// For positive values, we multiply by a number less than 1 to get this outcome.\n// For negative values, we multiply to a number greater than 1 to get this outcome.\nexport const POSITIVE_MIN_VALUE_MULTIPLIER = 0.8;\nexport const NEGATIVE_MIN_VALUE_MULTIPLIER = 1.2;\n\n/**\n * Creates an initial/empty options object for the TimeSeriesChartPanel.\n */\nexport function createInitialTimeSeriesChartOptions(): TimeSeriesChartOptions {\n return {};\n}\n"],"names":["DEFAULT_FORMAT","unit","shortValues","DEFAULT_Y_AXIS","show","label","format","min","undefined","max","logBase","Y_AXIS_CONFIG","DEFAULT_DISPLAY","DEFAULT_LINE_WIDTH","DEFAULT_LINE_STYLE","DEFAULT_AREA_OPACITY","POINT_SIZE_OFFSET","DEFAULT_POINT_RADIUS","DEFAULT_CONNECT_NULLS","DEFAULT_VISUAL","display","lineWidth","lineStyle","areaOpacity","pointRadius","connectNulls","THRESHOLD_PLOT_INTERVAL","VISUAL_CONFIG","testId","step","stack","STACK_CONFIG","none","all","STACK_OPTIONS","Object","entries","map","id","config","LINE_STYLE_CONFIG","solid","dashed","dotted","OPACITY_CONFIG","LOG_BASE_CONFIG","log","LOG_BASE_OPTIONS","POSITIVE_MIN_VALUE_MULTIPLIER","NEGATIVE_MIN_VALUE_MULTIPLIER","createInitialTimeSeriesChartOptions"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;
|
|
1
|
+
{"version":3,"sources":["../../src/time-series-chart-model.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { FormatOptions, ThresholdOptions } from '@perses-dev/components';\nimport { OptionsEditorProps, LegendSpecOptions } from '@perses-dev/plugin-system';\nimport { Definition } from '@perses-dev/spec';\n\n/**\n * Line style options for time series charts.\n */\nexport type LineStyleType = 'solid' | 'dashed' | 'dotted';\n\n/**\n * The schema for a TimeSeriesChart panel.\n */\nexport interface TimeSeriesChartDefinition extends Definition<TimeSeriesChartOptions> {\n kind: 'TimeSeriesChart';\n}\n\n/**\n * The Options object supported by the TimeSeriesChartPanel plugin.\n */\nexport interface TimeSeriesChartOptions {\n legend?: LegendSpecOptions;\n yAxis?: TimeSeriesChartYAxisOptions;\n thresholds?: ThresholdOptions;\n visual?: TimeSeriesChartVisualOptions;\n tooltip?: TooltipSpecOptions;\n querySettings?: QuerySettingsOptions[];\n}\n\nexport interface QuerySettingsOptions {\n queryIndex: number;\n colorMode?: 'fixed' | 'fixed-single';\n colorValue?: string;\n lineStyle?: LineStyleType;\n areaOpacity?: number;\n format?: FormatOptions;\n /**\n * If true, the query's series values are negated for display so they render\n * below the X axis. The original (positive) values are preserved for legend\n * calculations and CSV export, matching Grafana's `transform: \"negative-Y\"` behavior.\n */\n negativeY?: boolean;\n stack?: boolean;\n}\n\nexport type TimeSeriesChartOptionsEditorProps = OptionsEditorProps<TimeSeriesChartOptions>;\n\nexport interface TimeSeriesChartYAxisOptions {\n show?: boolean;\n label?: string;\n format?: FormatOptions;\n min?: number;\n max?: number;\n logBase?: LOG_BASE;\n}\n\nexport interface TooltipSpecOptions {\n enablePinning: boolean;\n}\n\nexport interface TimeSeriesChartPaletteOptions {\n mode: 'auto' | 'categorical';\n}\n\nexport type TimeSeriesChartVisualOptions = {\n display?: 'line' | 'bar';\n lineWidth?: number;\n lineStyle?: LineStyleType;\n areaOpacity?: number;\n showPoints?: 'auto' | 'always';\n palette?: TimeSeriesChartPaletteOptions;\n pointRadius?: number;\n stack?: StackOptions;\n connectNulls?: boolean;\n};\n\nexport const DEFAULT_FORMAT: FormatOptions = {\n unit: 'decimal',\n shortValues: true,\n};\n\nexport const DEFAULT_Y_AXIS: TimeSeriesChartYAxisOptions = {\n show: true,\n label: '',\n format: DEFAULT_FORMAT,\n min: undefined,\n max: undefined,\n logBase: undefined,\n};\n\nexport const Y_AXIS_CONFIG = {\n show: { label: 'Show' },\n label: { label: 'Label' },\n unit: { label: 'Unit' },\n min: { label: 'Min' },\n max: { label: 'Max' },\n logBase: { label: 'Log Base' },\n};\n\nexport const DEFAULT_DISPLAY = 'line';\nexport const DEFAULT_LINE_WIDTH = 1.25;\nexport const DEFAULT_LINE_STYLE = 'solid';\nexport const DEFAULT_AREA_OPACITY = 0;\n// How much larger datapoint symbols are than line width, also applied in VisualOptionsEditor.\nexport const POINT_SIZE_OFFSET = 1.5;\nexport const DEFAULT_POINT_RADIUS = DEFAULT_LINE_WIDTH + POINT_SIZE_OFFSET;\nexport const DEFAULT_CONNECT_NULLS = false;\n\nexport const DEFAULT_VISUAL: TimeSeriesChartVisualOptions = {\n display: DEFAULT_DISPLAY,\n lineWidth: DEFAULT_LINE_WIDTH,\n lineStyle: DEFAULT_LINE_STYLE,\n areaOpacity: DEFAULT_AREA_OPACITY,\n pointRadius: DEFAULT_POINT_RADIUS,\n connectNulls: DEFAULT_CONNECT_NULLS,\n};\n\n// Controls how often static threshold values should be plotted so threshold data shows\n// in tooltip without flicker.\nexport const THRESHOLD_PLOT_INTERVAL = 15;\n\nexport const VISUAL_CONFIG = {\n lineWidth: {\n label: 'Line Width',\n testId: 'slider-line-width',\n min: 0.25,\n max: 3,\n step: 0.25,\n },\n lineStyle: {\n label: 'Line Style',\n },\n pointRadius: {\n label: 'Point Radius',\n testId: 'slider-point-radius',\n min: 0,\n max: 6,\n step: 0.25,\n },\n areaOpacity: {\n label: 'Area Opacity',\n testId: 'slider-area-opacity',\n min: 0,\n max: 1,\n step: 0.05,\n },\n stack: {\n label: 'Stack Series',\n },\n connectNulls: {\n label: 'Connect Nulls',\n },\n};\n\n// None is equivalent to undefined since stack is optional\nexport type StackOptions = 'none' | 'all'; // TODO: add percent option support\n\nexport const STACK_CONFIG = {\n none: { label: 'None' },\n all: { label: 'All' },\n // TODO: enable option after 'Percent' implemented\n // percent: { label: 'Percent', disabled: true }, // hidden since not implemented yet\n};\n\nexport const STACK_OPTIONS = Object.entries(STACK_CONFIG).map(([id, config]) => {\n return {\n id: id as StackOptions,\n ...config,\n };\n});\n\nexport const LINE_STYLE_CONFIG = {\n solid: { label: 'Solid' },\n dashed: { label: 'Dashes' },\n dotted: { label: 'Dots' },\n};\n\nexport const OPACITY_CONFIG = {\n label: 'Opacity',\n testId: 'slider-opacity',\n min: 0,\n max: 1,\n step: 0.05,\n};\n\n// LogBase outlines the allowed log bases for the log-supported charts.\nexport type LOG_BASE = undefined | 2 | 10;\n\n// Single source of truth for log base configuration\nexport const LOG_BASE_CONFIG: Record<string, { label: string; log: LOG_BASE }> = {\n none: { label: 'None', log: undefined },\n '2': { label: '2', log: 2 },\n '10': { label: '10', log: 10 },\n};\n\n// Options array for SettingsAutocomplete\nexport const LOG_BASE_OPTIONS = Object.entries(LOG_BASE_CONFIG).map(([id, config]) => ({\n id: id as string,\n ...config,\n}));\n\n// Both of these constants help produce a value that is LESS THAN the initial value.\n// For positive values, we multiply by a number less than 1 to get this outcome.\n// For negative values, we multiply to a number greater than 1 to get this outcome.\nexport const POSITIVE_MIN_VALUE_MULTIPLIER = 0.8;\nexport const NEGATIVE_MIN_VALUE_MULTIPLIER = 1.2;\n\n/**\n * Creates an initial/empty options object for the TimeSeriesChartPanel.\n */\nexport function createInitialTimeSeriesChartOptions(): TimeSeriesChartOptions {\n return {};\n}\n"],"names":["DEFAULT_FORMAT","unit","shortValues","DEFAULT_Y_AXIS","show","label","format","min","undefined","max","logBase","Y_AXIS_CONFIG","DEFAULT_DISPLAY","DEFAULT_LINE_WIDTH","DEFAULT_LINE_STYLE","DEFAULT_AREA_OPACITY","POINT_SIZE_OFFSET","DEFAULT_POINT_RADIUS","DEFAULT_CONNECT_NULLS","DEFAULT_VISUAL","display","lineWidth","lineStyle","areaOpacity","pointRadius","connectNulls","THRESHOLD_PLOT_INTERVAL","VISUAL_CONFIG","testId","step","stack","STACK_CONFIG","none","all","STACK_OPTIONS","Object","entries","map","id","config","LINE_STYLE_CONFIG","solid","dashed","dotted","OPACITY_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;AAEJ,oFAAoF;AACpF,gFAAgF;AAChF,mFAAmF;AACnF,OAAO,MAAMS,gCAAgC,IAAI;AACjD,OAAO,MAAMC,gCAAgC,IAAI;AAEjD;;CAEC,GACD,OAAO,SAASC;IACd,OAAO,CAAC;AACV"}
|
|
@@ -20,6 +20,7 @@ export declare function getCommonTimeScaleForQueries(queries: Array<PanelData<Ti
|
|
|
20
20
|
export declare function getTimeSeries(id: string, datasetIndex: number, formattedName: string, visual: TimeSeriesChartVisualOptions, timeScale: TimeScale, paletteColor: string, querySettings?: {
|
|
21
21
|
lineStyle?: LineStyleType;
|
|
22
22
|
areaOpacity?: number;
|
|
23
|
+
stack?: boolean;
|
|
23
24
|
}, yAxisIndex?: number): TimeSeriesOption;
|
|
24
25
|
/**
|
|
25
26
|
* Gets threshold-specific line series styles
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-transform.d.ts","sourceRoot":"","sources":["../../../src/utils/data-transform.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAEL,gBAAgB,EAChB,iBAAiB,EAEjB,gBAAgB,EAChB,WAAW,EAEZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAAwB,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAQL,4BAA4B,EAC5B,2BAA2B,EAC3B,aAAa,EACd,MAAM,4BAA4B,CAAC;AAEpC,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAE1E,eAAO,MAAM,gBAAgB,EAAE,iBAI9B,CAAC;AAEF,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,eAAO,MAAM,oBAAoB,MA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AAG,SAAS,GAAG,SAAS,CAG7G;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,MAAM,EACV,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,4BAA4B,EACpC,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,MAAM,EACpB,aAAa,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,aAAa,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,EACpF,UAAU,CAAC,EAAE,MAAM,GAClB,gBAAgB,CAqElB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,GAAG,gBAAgB,CA2B9G;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,gBAAgB,EAAE,GAAG,UAAU,EAAE,EACvC,GAAG,CAAC,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,GACX,MAAM,CAMR;AA8BD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,GAAE,2BAAgC,GAAG,oBAAoB,CAgDnG;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAI7C"}
|
|
@@ -32,6 +32,7 @@ export const BLUR_FADEOUT_OPACITY = 0.5;
|
|
|
32
32
|
*/ export function getTimeSeries(id, datasetIndex, formattedName, visual, timeScale, paletteColor, querySettings, yAxisIndex) {
|
|
33
33
|
const lineWidth = visual.lineWidth ?? DEFAULT_LINE_WIDTH;
|
|
34
34
|
const pointRadius = visual.pointRadius ?? DEFAULT_POINT_RADIUS;
|
|
35
|
+
const shouldStack = querySettings?.stack !== undefined ? querySettings.stack : visual.stack === 'all';
|
|
35
36
|
// Shows datapoint symbols when selected time range is roughly 15 minutes or less
|
|
36
37
|
const minuteMs = 60000;
|
|
37
38
|
let showPoints = timeScale.rangeMs <= minuteMs * 15;
|
|
@@ -46,7 +47,7 @@ export const BLUR_FADEOUT_OPACITY = 0.5;
|
|
|
46
47
|
datasetIndex,
|
|
47
48
|
name: formattedName,
|
|
48
49
|
color: paletteColor,
|
|
49
|
-
stack:
|
|
50
|
+
stack: shouldStack ? 'all' : undefined,
|
|
50
51
|
yAxisIndex: yAxisIndex,
|
|
51
52
|
label: {
|
|
52
53
|
show: false
|
|
@@ -61,7 +62,7 @@ export const BLUR_FADEOUT_OPACITY = 0.5;
|
|
|
61
62
|
name: formattedName,
|
|
62
63
|
connectNulls: visual.connectNulls ?? DEFAULT_CONNECT_NULLS,
|
|
63
64
|
color: paletteColor,
|
|
64
|
-
stack:
|
|
65
|
+
stack: shouldStack ? 'all' : undefined,
|
|
65
66
|
yAxisIndex: yAxisIndex,
|
|
66
67
|
sampling: 'lttb',
|
|
67
68
|
progressiveThreshold: OPTIMIZED_MODE_SERIES_LIMIT,
|
|
@@ -85,13 +86,6 @@ export const BLUR_FADEOUT_OPACITY = 0.5;
|
|
|
85
86
|
type: visual.lineStyle
|
|
86
87
|
}
|
|
87
88
|
},
|
|
88
|
-
selectedMode: 'single',
|
|
89
|
-
select: {
|
|
90
|
-
itemStyle: {
|
|
91
|
-
borderColor: paletteColor,
|
|
92
|
-
borderWidth: pointRadius + 0.5
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
89
|
blur: {
|
|
96
90
|
lineStyle: {
|
|
97
91
|
width: lineWidth,
|
|
@@ -151,8 +145,10 @@ function findMax(data) {
|
|
|
151
145
|
series.values.forEach((valueTuple)=>{
|
|
152
146
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
153
147
|
const [_, value] = valueTuple;
|
|
154
|
-
|
|
155
|
-
|
|
148
|
+
// Use the absolute value so percent thresholds compute correctly against
|
|
149
|
+
// negated series (e.g. when `querySettings[].negativeY` is enabled).
|
|
150
|
+
if (typeof value === 'number' && Math.abs(value) > max) {
|
|
151
|
+
max = Math.abs(value);
|
|
156
152
|
}
|
|
157
153
|
});
|
|
158
154
|
});
|
|
@@ -160,8 +156,8 @@ function findMax(data) {
|
|
|
160
156
|
data.forEach((series)=>{
|
|
161
157
|
if (series.data !== undefined) {
|
|
162
158
|
series.data.forEach((value)=>{
|
|
163
|
-
if (typeof value === 'number' && value > max) {
|
|
164
|
-
max = value;
|
|
159
|
+
if (typeof value === 'number' && Math.abs(value) > max) {
|
|
160
|
+
max = Math.abs(value);
|
|
165
161
|
}
|
|
166
162
|
});
|
|
167
163
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/data-transform.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { YAXisComponentOption } from 'echarts';\nimport { LineSeriesOption, BarSeriesOption } from 'echarts/charts';\nimport {\n OPTIMIZED_MODE_SERIES_LIMIT,\n LegacyTimeSeries,\n EChartsDataFormat,\n EChartsValues,\n TimeSeriesOption,\n StepOptions,\n getCommonTimeScale,\n} from '@perses-dev/components';\nimport { useTimeSeriesQueries, PanelData } from '@perses-dev/plugin-system';\nimport { TimeScale, TimeSeries, TimeSeriesData, TimeSeriesValueTuple } from '@perses-dev/spec';\nimport {\n DEFAULT_AREA_OPACITY,\n DEFAULT_CONNECT_NULLS,\n DEFAULT_LINE_WIDTH,\n DEFAULT_POINT_RADIUS,\n DEFAULT_Y_AXIS,\n POSITIVE_MIN_VALUE_MULTIPLIER,\n NEGATIVE_MIN_VALUE_MULTIPLIER,\n TimeSeriesChartVisualOptions,\n TimeSeriesChartYAxisOptions,\n LineStyleType,\n} from '../time-series-chart-model';\n\nexport type RunningQueriesState = ReturnType<typeof useTimeSeriesQueries>;\n\nexport const EMPTY_GRAPH_DATA: EChartsDataFormat = {\n timeSeries: [],\n xAxis: [],\n legendItems: [],\n};\n\nexport const HIDE_DATAPOINTS_LIMIT = 70;\n\nexport const BLUR_FADEOUT_OPACITY = 0.5;\n\n/**\n * Given a list of running queries, calculates a common time scale for use on\n * the x axis (i.e. start/end dates and a step that is divisible into all of\n * the queries' steps).\n */\nexport function getCommonTimeScaleForQueries(queries: Array<PanelData<TimeSeriesData>>): TimeScale | undefined {\n const seriesData = queries.map((query) => query.data);\n return getCommonTimeScale(seriesData);\n}\n\n/**\n * Gets ECharts line series option properties for regular trends\n */\nexport function getTimeSeries(\n id: string,\n datasetIndex: number,\n formattedName: string,\n visual: TimeSeriesChartVisualOptions,\n timeScale: TimeScale,\n paletteColor: string,\n querySettings?: { lineStyle?: LineStyleType; areaOpacity?: number },\n yAxisIndex?: number\n): TimeSeriesOption {\n const lineWidth = visual.lineWidth ?? DEFAULT_LINE_WIDTH;\n const pointRadius = visual.pointRadius ?? DEFAULT_POINT_RADIUS;\n\n // Shows datapoint symbols when selected time range is roughly 15 minutes or less\n const minuteMs = 60000;\n let showPoints = timeScale.rangeMs <= minuteMs * 15;\n // Allows overriding default behavior and opt-in to always show all symbols (can hurt performance)\n if (visual.showPoints === 'always') {\n showPoints = true;\n }\n\n if (visual.display === 'bar') {\n const series: BarSeriesOption = {\n type: 'bar',\n id: id,\n datasetIndex,\n name: formattedName,\n color: paletteColor,\n stack: visual.stack === 'all' ? visual.stack : undefined,\n yAxisIndex: yAxisIndex,\n label: {\n show: false,\n },\n };\n return series;\n }\n\n const series: LineSeriesOption = {\n type: 'line',\n id: id,\n datasetIndex,\n name: formattedName,\n connectNulls: visual.connectNulls ?? DEFAULT_CONNECT_NULLS,\n color: paletteColor,\n stack: visual.stack === 'all' ? visual.stack : undefined,\n yAxisIndex: yAxisIndex,\n sampling: 'lttb',\n progressiveThreshold: OPTIMIZED_MODE_SERIES_LIMIT, // https://echarts.apache.org/en/option.html#series-lines.progressiveThreshold\n showSymbol: showPoints,\n showAllSymbol: true,\n symbolSize: pointRadius,\n lineStyle: {\n width: lineWidth,\n type: (querySettings?.lineStyle ?? visual.lineStyle) as LineStyleType,\n },\n areaStyle: {\n opacity: querySettings?.areaOpacity ?? visual.areaOpacity ?? DEFAULT_AREA_OPACITY,\n },\n // https://echarts.apache.org/en/option.html#series-line.emphasis\n emphasis: {\n focus: 'series',\n disabled: visual.areaOpacity !== undefined && visual.areaOpacity > 0, // prevents flicker when moving cursor between shaded regions\n lineStyle: {\n width: lineWidth + 1,\n opacity: 1,\n type: visual.lineStyle,\n },\n },\n selectedMode: 'single',\n select: {\n itemStyle: {\n borderColor: paletteColor,\n borderWidth: pointRadius + 0.5,\n },\n },\n blur: {\n lineStyle: {\n width: lineWidth,\n opacity: BLUR_FADEOUT_OPACITY,\n type: visual.lineStyle,\n },\n },\n };\n return series;\n}\n\n/**\n * Gets threshold-specific line series styles\n * markLine cannot be used since it does not update yAxis max / min\n * and threshold data needs to show in the tooltip\n */\nexport function getThresholdSeries(name: string, threshold: StepOptions, seriesIndex: number): LineSeriesOption {\n return {\n type: 'line',\n name: name,\n id: name,\n datasetId: name,\n datasetIndex: seriesIndex,\n color: threshold.color,\n label: {\n show: false,\n },\n lineStyle: {\n type: 'dashed',\n width: 2,\n },\n emphasis: {\n focus: 'series',\n lineStyle: {\n width: 2.5,\n },\n },\n blur: {\n lineStyle: {\n opacity: BLUR_FADEOUT_OPACITY,\n },\n },\n };\n}\n\n/**\n * Converts percent threshold into absolute step value\n * If max is undefined, use the max value from time series data as default\n */\nexport function convertPercentThreshold(\n percent: number,\n data: LegacyTimeSeries[] | TimeSeries[],\n max?: number,\n min?: number\n): number {\n const percentDecimal = percent / 100;\n const adjustedMax = max ?? findMax(data);\n const adjustedMin = min ?? 0;\n const total = adjustedMax - adjustedMin;\n return percentDecimal * total + adjustedMin;\n}\n\nfunction findMax(data: LegacyTimeSeries[] | TimeSeries[]): number {\n let max = 0;\n if (data.length && data[0] !== undefined && (data as TimeSeries[])[0]?.values) {\n (data as TimeSeries[]).forEach((series) => {\n series.values.forEach((valueTuple: TimeSeriesValueTuple) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const [_, value] = valueTuple;\n if (typeof value === 'number' && value > max) {\n max = value;\n }\n });\n });\n } else {\n (data as LegacyTimeSeries[]).forEach((series) => {\n if (series.data !== undefined) {\n series.data.forEach((value: EChartsValues) => {\n if (typeof value === 'number' && value > max) {\n max = value;\n }\n });\n }\n });\n }\n return max;\n}\n\n/**\n * Converts Perses panel yAxis from dashboard spec to ECharts supported yAxis options.\n * Handles both linear and logarithmic scales with appropriate min/max calculations.\n */\nexport function convertPanelYAxis(inputAxis: TimeSeriesChartYAxisOptions = {}): YAXisComponentOption {\n // Determine the appropriate min value based on scale type and user input\n let minValue: YAXisComponentOption['min'];\n if (inputAxis.logBase !== undefined) {\n // For logarithmic scales without explicit min:\n // Let ECharts auto-calculate the range based on data to avoid issues with\n // function-based calculations which can result in improper ranges (e.g., 1-10)\n minValue = undefined;\n } else if (inputAxis?.min !== undefined) {\n // User explicitly set a min value - use it for both linear and log scales\n minValue = inputAxis.min;\n } else {\n // For linear scales without explicit min:\n // Use dynamic calculation with padding for better visualization\n // https://echarts.apache.org/en/option.html#yAxis.min\n minValue = (value): number => {\n if (value.min >= 0 && value.min <= 1) {\n // Helps with PercentDecimal units, or datasets that return 0 or 1 booleans\n return 0;\n }\n\n // Note: We can tweak the MULTIPLIER constants if we want\n // TODO: Experiment with using a padding that is based on the difference between max value and min value\n if (value.min > 0) {\n return roundDown(value.min * POSITIVE_MIN_VALUE_MULTIPLIER);\n } else {\n return roundDown(value.min * NEGATIVE_MIN_VALUE_MULTIPLIER);\n }\n };\n }\n\n // Build the yAxis configuration\n const yAxis: YAXisComponentOption = {\n show: inputAxis?.show ?? DEFAULT_Y_AXIS.show,\n min: minValue,\n max: inputAxis?.max,\n };\n\n // Apply logarithmic scale settings if requested\n if (inputAxis.logBase !== undefined) {\n return {\n ...yAxis,\n type: 'log',\n logBase: inputAxis.logBase,\n };\n }\n\n return yAxis;\n}\n\n/**\n * Rounds down to nearest number with one significant digit.\n *\n * Examples:\n * 1. 675 --> 600\n * 2. 0.567 --> 0.5\n * 3. -12 --> -20\n */\nexport function roundDown(num: number): number {\n const magnitude = Math.floor(Math.log10(Math.abs(num)));\n const firstDigit = Math.floor(num / Math.pow(10, magnitude));\n return firstDigit * Math.pow(10, magnitude);\n}\n"],"names":["OPTIMIZED_MODE_SERIES_LIMIT","getCommonTimeScale","DEFAULT_AREA_OPACITY","DEFAULT_CONNECT_NULLS","DEFAULT_LINE_WIDTH","DEFAULT_POINT_RADIUS","DEFAULT_Y_AXIS","POSITIVE_MIN_VALUE_MULTIPLIER","NEGATIVE_MIN_VALUE_MULTIPLIER","EMPTY_GRAPH_DATA","timeSeries","xAxis","legendItems","HIDE_DATAPOINTS_LIMIT","BLUR_FADEOUT_OPACITY","getCommonTimeScaleForQueries","queries","seriesData","map","query","data","getTimeSeries","id","datasetIndex","formattedName","visual","timeScale","paletteColor","querySettings","yAxisIndex","lineWidth","pointRadius","minuteMs","showPoints","rangeMs","display","series","type","name","color","stack","undefined","label","show","connectNulls","sampling","progressiveThreshold","showSymbol","showAllSymbol","symbolSize","lineStyle","width","areaStyle","opacity","areaOpacity","emphasis","focus","disabled","selectedMode","select","itemStyle","borderColor","borderWidth","blur","getThresholdSeries","threshold","seriesIndex","datasetId","convertPercentThreshold","percent","max","min","percentDecimal","adjustedMax","findMax","adjustedMin","total","length","values","forEach","valueTuple","_","value","convertPanelYAxis","inputAxis","minValue","logBase","roundDown","yAxis","num","magnitude","Math","floor","log10","abs","firstDigit","pow"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EA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GAAG,IAAI,KAAKW,MAAMX,GAAG,IAAI,GAAG;gBACpC,2EAA2E;gBAC3E,OAAO;YACT;YAEA,yDAAyD;YACzD,wGAAwG;YACxG,IAAIW,MAAMX,GAAG,GAAG,GAAG;gBACjB,OAAOgB,UAAUL,MAAMX,GAAG,GAAGhE;YAC/B,OAAO;gBACL,OAAOgF,UAAUL,MAAMX,GAAG,GAAG/D;YAC/B;QACF;IACF;IAEA,gCAAgC;IAChC,MAAMgF,QAA8B;QAClC7C,MAAMyC,WAAWzC,QAAQrC,eAAeqC,IAAI;QAC5C4B,KAAKc;QACLf,KAAKc,WAAWd;IAClB;IAEA,gDAAgD;IAChD,IAAIc,UAAUE,OAAO,KAAK7C,WAAW;QACnC,OAAO;YACL,GAAG+C,KAAK;YACRnD,MAAM;YACNiD,SAASF,UAAUE,OAAO;QAC5B;IACF;IAEA,OAAOE;AACT;AAEA;;;;;;;CAOC,GACD,OAAO,SAASD,UAAUE,GAAW;IACnC,MAAMC,YAAYC,KAAKC,KAAK,CAACD,KAAKE,KAAK,CAACF,KAAKG,GAAG,CAACL;IACjD,MAAMM,aAAaJ,KAAKC,KAAK,CAACH,MAAME,KAAKK,GAAG,CAAC,IAAIN;IACjD,OAAOK,aAAaJ,KAAKK,GAAG,CAAC,IAAIN;AACnC"}
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/data-transform.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport type { YAXisComponentOption } from 'echarts';\nimport { LineSeriesOption, BarSeriesOption } from 'echarts/charts';\nimport {\n OPTIMIZED_MODE_SERIES_LIMIT,\n LegacyTimeSeries,\n EChartsDataFormat,\n EChartsValues,\n TimeSeriesOption,\n StepOptions,\n getCommonTimeScale,\n} from '@perses-dev/components';\nimport { useTimeSeriesQueries, PanelData } from '@perses-dev/plugin-system';\nimport { TimeScale, TimeSeries, TimeSeriesData, TimeSeriesValueTuple } from '@perses-dev/spec';\nimport {\n DEFAULT_AREA_OPACITY,\n DEFAULT_CONNECT_NULLS,\n DEFAULT_LINE_WIDTH,\n DEFAULT_POINT_RADIUS,\n DEFAULT_Y_AXIS,\n POSITIVE_MIN_VALUE_MULTIPLIER,\n NEGATIVE_MIN_VALUE_MULTIPLIER,\n TimeSeriesChartVisualOptions,\n TimeSeriesChartYAxisOptions,\n LineStyleType,\n} from '../time-series-chart-model';\n\nexport type RunningQueriesState = ReturnType<typeof useTimeSeriesQueries>;\n\nexport const EMPTY_GRAPH_DATA: EChartsDataFormat = {\n timeSeries: [],\n xAxis: [],\n legendItems: [],\n};\n\nexport const HIDE_DATAPOINTS_LIMIT = 70;\n\nexport const BLUR_FADEOUT_OPACITY = 0.5;\n\n/**\n * Given a list of running queries, calculates a common time scale for use on\n * the x axis (i.e. start/end dates and a step that is divisible into all of\n * the queries' steps).\n */\nexport function getCommonTimeScaleForQueries(queries: Array<PanelData<TimeSeriesData>>): TimeScale | undefined {\n const seriesData = queries.map((query) => query.data);\n return getCommonTimeScale(seriesData);\n}\n\n/**\n * Gets ECharts line series option properties for regular trends\n */\nexport function getTimeSeries(\n id: string,\n datasetIndex: number,\n formattedName: string,\n visual: TimeSeriesChartVisualOptions,\n timeScale: TimeScale,\n paletteColor: string,\n querySettings?: { lineStyle?: LineStyleType; areaOpacity?: number; stack?: boolean },\n yAxisIndex?: number\n): TimeSeriesOption {\n const lineWidth = visual.lineWidth ?? DEFAULT_LINE_WIDTH;\n const pointRadius = visual.pointRadius ?? DEFAULT_POINT_RADIUS;\n const shouldStack = querySettings?.stack !== undefined ? querySettings.stack : visual.stack === 'all';\n\n // Shows datapoint symbols when selected time range is roughly 15 minutes or less\n const minuteMs = 60000;\n let showPoints = timeScale.rangeMs <= minuteMs * 15;\n // Allows overriding default behavior and opt-in to always show all symbols (can hurt performance)\n if (visual.showPoints === 'always') {\n showPoints = true;\n }\n\n if (visual.display === 'bar') {\n const series: BarSeriesOption = {\n type: 'bar',\n id: id,\n datasetIndex,\n name: formattedName,\n color: paletteColor,\n stack: shouldStack ? 'all' : undefined,\n yAxisIndex: yAxisIndex,\n label: {\n show: false,\n },\n };\n return series;\n }\n\n const series: LineSeriesOption = {\n type: 'line',\n id: id,\n datasetIndex,\n name: formattedName,\n connectNulls: visual.connectNulls ?? DEFAULT_CONNECT_NULLS,\n color: paletteColor,\n stack: shouldStack ? 'all' : undefined,\n yAxisIndex: yAxisIndex,\n sampling: 'lttb',\n progressiveThreshold: OPTIMIZED_MODE_SERIES_LIMIT, // https://echarts.apache.org/en/option.html#series-lines.progressiveThreshold\n showSymbol: showPoints,\n showAllSymbol: true,\n symbolSize: pointRadius,\n lineStyle: {\n width: lineWidth,\n type: (querySettings?.lineStyle ?? visual.lineStyle) as LineStyleType,\n },\n areaStyle: {\n opacity: querySettings?.areaOpacity ?? visual.areaOpacity ?? DEFAULT_AREA_OPACITY,\n },\n // https://echarts.apache.org/en/option.html#series-line.emphasis\n emphasis: {\n focus: 'series',\n disabled: visual.areaOpacity !== undefined && visual.areaOpacity > 0, // prevents flicker when moving cursor between shaded regions\n lineStyle: {\n width: lineWidth + 1,\n opacity: 1,\n type: visual.lineStyle,\n },\n },\n blur: {\n lineStyle: {\n width: lineWidth,\n opacity: BLUR_FADEOUT_OPACITY,\n type: visual.lineStyle,\n },\n },\n };\n return series;\n}\n\n/**\n * Gets threshold-specific line series styles\n * markLine cannot be used since it does not update yAxis max / min\n * and threshold data needs to show in the tooltip\n */\nexport function getThresholdSeries(name: string, threshold: StepOptions, seriesIndex: number): LineSeriesOption {\n return {\n type: 'line',\n name: name,\n id: name,\n datasetId: name,\n datasetIndex: seriesIndex,\n color: threshold.color,\n label: {\n show: false,\n },\n lineStyle: {\n type: 'dashed',\n width: 2,\n },\n emphasis: {\n focus: 'series',\n lineStyle: {\n width: 2.5,\n },\n },\n blur: {\n lineStyle: {\n opacity: BLUR_FADEOUT_OPACITY,\n },\n },\n };\n}\n\n/**\n * Converts percent threshold into absolute step value\n * If max is undefined, use the max value from time series data as default\n */\nexport function convertPercentThreshold(\n percent: number,\n data: LegacyTimeSeries[] | TimeSeries[],\n max?: number,\n min?: number\n): number {\n const percentDecimal = percent / 100;\n const adjustedMax = max ?? findMax(data);\n const adjustedMin = min ?? 0;\n const total = adjustedMax - adjustedMin;\n return percentDecimal * total + adjustedMin;\n}\n\nfunction findMax(data: LegacyTimeSeries[] | TimeSeries[]): number {\n let max = 0;\n if (data.length && data[0] !== undefined && (data as TimeSeries[])[0]?.values) {\n (data as TimeSeries[]).forEach((series) => {\n series.values.forEach((valueTuple: TimeSeriesValueTuple) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const [_, value] = valueTuple;\n // Use the absolute value so percent thresholds compute correctly against\n // negated series (e.g. when `querySettings[].negativeY` is enabled).\n if (typeof value === 'number' && Math.abs(value) > max) {\n max = Math.abs(value);\n }\n });\n });\n } else {\n (data as LegacyTimeSeries[]).forEach((series) => {\n if (series.data !== undefined) {\n series.data.forEach((value: EChartsValues) => {\n if (typeof value === 'number' && Math.abs(value) > max) {\n max = Math.abs(value);\n }\n });\n }\n });\n }\n return max;\n}\n\n/**\n * Converts Perses panel yAxis from dashboard spec to ECharts supported yAxis options.\n * Handles both linear and logarithmic scales with appropriate min/max calculations.\n */\nexport function convertPanelYAxis(inputAxis: TimeSeriesChartYAxisOptions = {}): YAXisComponentOption {\n // Determine the appropriate min value based on scale type and user input\n let minValue: YAXisComponentOption['min'];\n if (inputAxis.logBase !== undefined) {\n // For logarithmic scales without explicit min:\n // Let ECharts auto-calculate the range based on data to avoid issues with\n // function-based calculations which can result in improper ranges (e.g., 1-10)\n minValue = undefined;\n } else if (inputAxis?.min !== undefined) {\n // User explicitly set a min value - use it for both linear and log scales\n minValue = inputAxis.min;\n } else {\n // For linear scales without explicit min:\n // Use dynamic calculation with padding for better visualization\n // https://echarts.apache.org/en/option.html#yAxis.min\n minValue = (value): number => {\n if (value.min >= 0 && value.min <= 1) {\n // Helps with PercentDecimal units, or datasets that return 0 or 1 booleans\n return 0;\n }\n\n // Note: We can tweak the MULTIPLIER constants if we want\n // TODO: Experiment with using a padding that is based on the difference between max value and min value\n if (value.min > 0) {\n return roundDown(value.min * POSITIVE_MIN_VALUE_MULTIPLIER);\n } else {\n return roundDown(value.min * NEGATIVE_MIN_VALUE_MULTIPLIER);\n }\n };\n }\n\n // Build the yAxis configuration\n const yAxis: YAXisComponentOption = {\n show: inputAxis?.show ?? DEFAULT_Y_AXIS.show,\n min: minValue,\n max: inputAxis?.max,\n };\n\n // Apply logarithmic scale settings if requested\n if (inputAxis.logBase !== undefined) {\n return {\n ...yAxis,\n type: 'log',\n logBase: inputAxis.logBase,\n };\n }\n\n return yAxis;\n}\n\n/**\n * Rounds down to nearest number with one significant digit.\n *\n * Examples:\n * 1. 675 --> 600\n * 2. 0.567 --> 0.5\n * 3. -12 --> -20\n */\nexport function roundDown(num: number): number {\n const magnitude = Math.floor(Math.log10(Math.abs(num)));\n const firstDigit = Math.floor(num / Math.pow(10, magnitude));\n return firstDigit * Math.pow(10, magnitude);\n}\n"],"names":["OPTIMIZED_MODE_SERIES_LIMIT","getCommonTimeScale","DEFAULT_AREA_OPACITY","DEFAULT_CONNECT_NULLS","DEFAULT_LINE_WIDTH","DEFAULT_POINT_RADIUS","DEFAULT_Y_AXIS","POSITIVE_MIN_VALUE_MULTIPLIER","NEGATIVE_MIN_VALUE_MULTIPLIER","EMPTY_GRAPH_DATA","timeSeries","xAxis","legendItems","HIDE_DATAPOINTS_LIMIT","BLUR_FADEOUT_OPACITY","getCommonTimeScaleForQueries","queries","seriesData","map","query","data","getTimeSeries","id","datasetIndex","formattedName","visual","timeScale","paletteColor","querySettings","yAxisIndex","lineWidth","pointRadius","shouldStack","stack","undefined","minuteMs","showPoints","rangeMs","display","series","type","name","color","label","show","connectNulls","sampling","progressiveThreshold","showSymbol","showAllSymbol","symbolSize","lineStyle","width","areaStyle","opacity","areaOpacity","emphasis","focus","disabled","blur","getThresholdSeries","threshold","seriesIndex","datasetId","convertPercentThreshold","percent","max","min","percentDecimal","adjustedMax","findMax","adjustedMin","total","length","values","forEach","valueTuple","_","value","Math","abs","convertPanelYAxis","inputAxis","minValue","logBase","roundDown","yAxis","num","magnitude","floor","log10","firstDigit","pow"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,SACEA,2BAA2B,EAM3BC,kBAAkB,QACb,yBAAyB;AAGhC,SACEC,oBAAoB,EACpBC,qBAAqB,EACrBC,kBAAkB,EAClBC,oBAAoB,EACpBC,cAAc,EACdC,6BAA6B,EAC7BC,6BAA6B,QAIxB,6BAA6B;AAIpC,OAAO,MAAMC,mBAAsC;IACjDC,YAAY,EAAE;IACdC,OAAO,EAAE;IACTC,aAAa,EAAE;AACjB,EAAE;AAEF,OAAO,MAAMC,wBAAwB,GAAG;AAExC,OAAO,MAAMC,uBAAuB,IAAI;AAExC;;;;CAIC,GACD,OAAO,SAASC,6BAA6BC,OAAyC;IACpF,MAAMC,aAAaD,QAAQE,GAAG,CAAC,CAACC,QAAUA,MAAMC,IAAI;IACpD,OAAOnB,mBAAmBgB;AAC5B;AAEA;;CAEC,GACD,OAAO,SAASI,cACdC,EAAU,EACVC,YAAoB,EACpBC,aAAqB,EACrBC,MAAoC,EACpCC,SAAoB,EACpBC,YAAoB,EACpBC,aAAoF,EACpFC,UAAmB;IAEnB,MAAMC,YAAYL,OAAOK,SAAS,IAAI1B;IACtC,MAAM2B,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,OAAOG,aAAaZ,KAAKa,GAAG,CAAC,IAAIJ;AACnC"}
|
package/mf-manifest.json
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
"name": "TimeSeriesChart",
|
|
6
6
|
"type": "app",
|
|
7
7
|
"buildInfo": {
|
|
8
|
-
"buildVersion": "0.13.0-
|
|
8
|
+
"buildVersion": "0.13.0-rc.1",
|
|
9
9
|
"buildName": "@perses-dev/timeseries-chart-plugin"
|
|
10
10
|
},
|
|
11
11
|
"remoteEntry": {
|
|
12
|
-
"name": "__mf/js/TimeSeriesChart.
|
|
12
|
+
"name": "__mf/js/TimeSeriesChart.1b9392b7.js",
|
|
13
13
|
"path": "",
|
|
14
14
|
"type": "global"
|
|
15
15
|
},
|
|
@@ -89,20 +89,20 @@
|
|
|
89
89
|
{
|
|
90
90
|
"id": "TimeSeriesChart:@perses-dev/components",
|
|
91
91
|
"name": "@perses-dev/components",
|
|
92
|
-
"version": "0.54.0-
|
|
92
|
+
"version": "0.54.0-rc.1",
|
|
93
93
|
"singleton": true,
|
|
94
|
-
"requiredVersion": "^0.54.0-
|
|
94
|
+
"requiredVersion": "^0.54.0-rc.1",
|
|
95
95
|
"assets": {
|
|
96
96
|
"js": {
|
|
97
97
|
"async": [],
|
|
98
98
|
"sync": [
|
|
99
|
-
"__mf/js/async/
|
|
99
|
+
"__mf/js/async/208.b9f374ad.js"
|
|
100
100
|
]
|
|
101
101
|
},
|
|
102
102
|
"css": {
|
|
103
103
|
"async": [],
|
|
104
104
|
"sync": [
|
|
105
|
-
"__mf/css/async/
|
|
105
|
+
"__mf/css/async/208.85c2cbf6.css"
|
|
106
106
|
]
|
|
107
107
|
}
|
|
108
108
|
},
|
|
@@ -111,14 +111,14 @@
|
|
|
111
111
|
{
|
|
112
112
|
"id": "TimeSeriesChart:@perses-dev/dashboards",
|
|
113
113
|
"name": "@perses-dev/dashboards",
|
|
114
|
-
"version": "0.54.0-
|
|
114
|
+
"version": "0.54.0-rc.1",
|
|
115
115
|
"singleton": true,
|
|
116
|
-
"requiredVersion": "^0.54.0-
|
|
116
|
+
"requiredVersion": "^0.54.0-rc.1",
|
|
117
117
|
"assets": {
|
|
118
118
|
"js": {
|
|
119
119
|
"async": [],
|
|
120
120
|
"sync": [
|
|
121
|
-
"__mf/js/async/984.
|
|
121
|
+
"__mf/js/async/984.3fc3c480.js"
|
|
122
122
|
]
|
|
123
123
|
},
|
|
124
124
|
"css": {
|
|
@@ -131,14 +131,14 @@
|
|
|
131
131
|
{
|
|
132
132
|
"id": "TimeSeriesChart:@perses-dev/plugin-system",
|
|
133
133
|
"name": "@perses-dev/plugin-system",
|
|
134
|
-
"version": "0.54.0-
|
|
134
|
+
"version": "0.54.0-rc.1",
|
|
135
135
|
"singleton": true,
|
|
136
|
-
"requiredVersion": "^0.54.0-
|
|
136
|
+
"requiredVersion": "^0.54.0-rc.1",
|
|
137
137
|
"assets": {
|
|
138
138
|
"js": {
|
|
139
139
|
"async": [],
|
|
140
140
|
"sync": [
|
|
141
|
-
"__mf/js/async/
|
|
141
|
+
"__mf/js/async/546.c53e636c.js"
|
|
142
142
|
]
|
|
143
143
|
},
|
|
144
144
|
"css": {
|
|
@@ -280,17 +280,17 @@
|
|
|
280
280
|
"__mf/js/async/955.176fe200.js",
|
|
281
281
|
"__mf/js/async/702.785cd635.js",
|
|
282
282
|
"__mf/js/async/527.f97d1b86.js",
|
|
283
|
-
"__mf/js/async/52.
|
|
283
|
+
"__mf/js/async/52.0d78de2b.js",
|
|
284
284
|
"__mf/js/async/724.c45dcf5b.js",
|
|
285
|
-
"__mf/js/async/__federation_expose_TimeSeriesChart.
|
|
285
|
+
"__mf/js/async/__federation_expose_TimeSeriesChart.8b44fc75.js"
|
|
286
286
|
],
|
|
287
287
|
"async": [
|
|
288
288
|
"__mf/js/async/lib-router.319c02cd.js",
|
|
289
|
-
"__mf/js/async/356.8170c96d.js",
|
|
290
289
|
"__mf/js/async/655.dbf8c618.js",
|
|
291
290
|
"__mf/js/async/137.59c998ab.js",
|
|
291
|
+
"__mf/js/async/356.8170c96d.js",
|
|
292
292
|
"__mf/js/async/603.3b771310.js",
|
|
293
|
-
"__mf/js/async/
|
|
293
|
+
"__mf/js/async/694.0fb9ee5a.js",
|
|
294
294
|
"__mf/js/async/588.0a1aa144.js",
|
|
295
295
|
"__mf/js/async/71.8c6cf914.js",
|
|
296
296
|
"__mf/js/async/491.85194549.js",
|
|
@@ -301,7 +301,7 @@
|
|
|
301
301
|
"css": {
|
|
302
302
|
"sync": [],
|
|
303
303
|
"async": [
|
|
304
|
-
"__mf/css/async/
|
|
304
|
+
"__mf/css/async/208.85c2cbf6.css"
|
|
305
305
|
]
|
|
306
306
|
}
|
|
307
307
|
},
|