@pulzr/perses-timeseries-panel 0.1.2 → 0.1.4

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.
Files changed (73) hide show
  1. package/README.md +3 -1
  2. package/__mf/js/{PulzrTimeSeriesChart.8f5010ba5c.js → PulzrTimeSeriesChart.7c3ead7012.js} +2 -2
  3. package/__mf/js/async/{0.1f67a94360.js → 0.5ef0431536.js} +2 -2
  4. package/__mf/js/async/{07.36ac3671c5.js → 07.069fbddc67.js} +2 -2
  5. package/__mf/js/async/{0p.58ba51c3d8.js → 0p.45231180d3.js} +2 -2
  6. package/__mf/js/async/{1.73bde7147c.js → 1.75df3ae4b0.js} +2 -2
  7. package/__mf/js/async/{2.965b5a081a.js → 2.a727b9416d.js} +2 -2
  8. package/__mf/js/async/{24.c20b9c5a17.js → 24.aff881525a.js} +1 -1
  9. package/__mf/js/async/{3.364f359293.js → 3.1a66608288.js} +1 -1
  10. package/__mf/js/async/4.3c9a2b4233.js +1 -0
  11. package/__mf/js/async/{5.f4b8ab81b7.js → 5.5d8820f557.js} +1 -1
  12. package/__mf/js/async/{6.1c072abe87.js → 6.d90805485a.js} +1 -1
  13. package/__mf/js/async/{6x.3c32d29a25.js → 6x.368a17e295.js} +1 -1
  14. package/__mf/js/async/{7.15f564c6f3.js → 7.f40ccc96ba.js} +2 -2
  15. package/__mf/js/async/{9.f03162afcc.js → 9.d08e848582.js} +1 -1
  16. package/__mf/js/async/{__federation_expose_PulzrTimeSeriesChart.872d907273.js → __federation_expose_PulzrTimeSeriesChart.f8cb14738c.js} +1 -1
  17. package/__mf/js/async/{aw.c62047d59e.js → aw.bedacdca5d.js} +1 -1
  18. package/__mf/js/async/b.e5082f36ba.js +1 -0
  19. package/__mf/js/async/{c.db5f03155c.js → c.783005e082.js} +1 -1
  20. package/__mf/js/async/{f.629bfc34cd.js → f.1ee31f4c44.js} +2 -2
  21. package/__mf/js/async/{f6.a297b4c3b5.js → f6.ffd252b334.js} +1 -1
  22. package/__mf/js/async/{g.8f186fee46.js → g.adaadebd2d.js} +1 -1
  23. package/__mf/js/async/{i.20d8c95685.js → i.a9f4f52e01.js} +1 -1
  24. package/__mf/js/async/{k.9353f82963.js → k.4a35cfdf19.js} +2 -2
  25. package/__mf/js/async/kk.a702691f9e.js +1 -0
  26. package/__mf/js/async/{m.8322f15461.js → m.e7706a5825.js} +2 -2
  27. package/__mf/js/async/{n.07b91c8f3b.js → n.dada4ae652.js} +1 -1
  28. package/__mf/js/async/{o.f00502c3dc.js → o.27f2fd5272.js} +1 -1
  29. package/__mf/js/async/{o8.0d0f7ae8dd.js → o8.aeb40cdeea.js} +1 -1
  30. package/__mf/js/async/{os.48ffc14283.js → os.f5826c65d5.js} +2 -2
  31. package/__mf/js/async/{p.f622a2635a.js → p.7d81f7ca97.js} +2 -2
  32. package/__mf/js/async/{pj.dd52375d06.js → pj.a85577346e.js} +1 -1
  33. package/__mf/js/async/{s.4d1c08522b.js → s.db986f308e.js} +1 -1
  34. package/__mf/js/async/{s9.14445ad382.js → s9.5f6d9374f6.js} +1 -1
  35. package/__mf/js/async/{se.3e1054cb2e.js → se.02a1c72b61.js} +2 -2
  36. package/__mf/js/async/{sp.823f3e93e8.js → sp.dfb099e3e6.js} +1 -1
  37. package/__mf/js/async/{sr.52e9bae874.js → sr.694c7e4e84.js} +1 -1
  38. package/__mf/js/async/{t.94a8ce332d.js → t.4fcc93a4ee.js} +1 -1
  39. package/__mf/js/async/{tl.d9749e7d1e.js → tl.252b3303c9.js} +1 -1
  40. package/__mf/js/async/{uz.53202eb429.js → uz.9126a376c9.js} +1 -1
  41. package/__mf/js/async/{x.57044cf1d5.js → x.d033ab938e.js} +1 -1
  42. package/__mf/js/async/{xr.6ee20d6a04.js → xr.2f4b0bfea6.js} +1 -1
  43. package/__mf/js/async/{y.2d4e8c2b2e.js → y.a7adb70718.js} +1 -1
  44. package/__mf/js/async/{yk.d357453890.js → yk.79c1e2f705.js} +2 -2
  45. package/__mf/js/{main.5302f40bb7.js → main.c525171587.js} +2 -2
  46. package/lib/TimeSeriesChartPanel.d.ts.map +1 -1
  47. package/lib/TimeSeriesChartPanel.js +41 -19
  48. package/lib/TimeSeriesChartPanel.js.map +1 -1
  49. package/lib/time-series-chart-model.d.ts +9 -0
  50. package/lib/time-series-chart-model.d.ts.map +1 -1
  51. package/lib/time-series-chart-model.js.map +1 -1
  52. package/lib/utils/data-transform.d.ts.map +1 -1
  53. package/lib/utils/data-transform.js +3 -0
  54. package/lib/utils/data-transform.js.map +1 -1
  55. package/mf-manifest.json +42 -42
  56. package/mf-stats.json +42 -42
  57. package/package.json +1 -1
  58. package/__mf/js/async/4.21994aea94.js +0 -1
  59. package/__mf/js/async/b.d9e335c512.js +0 -1
  60. package/__mf/js/async/kk.54ddbdccb1.js +0 -1
  61. /package/__mf/js/async/{0.1f67a94360.js.LICENSE.txt → 0.5ef0431536.js.LICENSE.txt} +0 -0
  62. /package/__mf/js/async/{07.36ac3671c5.js.LICENSE.txt → 07.069fbddc67.js.LICENSE.txt} +0 -0
  63. /package/__mf/js/async/{0p.58ba51c3d8.js.LICENSE.txt → 0p.45231180d3.js.LICENSE.txt} +0 -0
  64. /package/__mf/js/async/{1.73bde7147c.js.LICENSE.txt → 1.75df3ae4b0.js.LICENSE.txt} +0 -0
  65. /package/__mf/js/async/{2.965b5a081a.js.LICENSE.txt → 2.a727b9416d.js.LICENSE.txt} +0 -0
  66. /package/__mf/js/async/{7.15f564c6f3.js.LICENSE.txt → 7.f40ccc96ba.js.LICENSE.txt} +0 -0
  67. /package/__mf/js/async/{f.629bfc34cd.js.LICENSE.txt → f.1ee31f4c44.js.LICENSE.txt} +0 -0
  68. /package/__mf/js/async/{k.9353f82963.js.LICENSE.txt → k.4a35cfdf19.js.LICENSE.txt} +0 -0
  69. /package/__mf/js/async/{m.8322f15461.js.LICENSE.txt → m.e7706a5825.js.LICENSE.txt} +0 -0
  70. /package/__mf/js/async/{os.48ffc14283.js.LICENSE.txt → os.f5826c65d5.js.LICENSE.txt} +0 -0
  71. /package/__mf/js/async/{p.f622a2635a.js.LICENSE.txt → p.7d81f7ca97.js.LICENSE.txt} +0 -0
  72. /package/__mf/js/async/{se.3e1054cb2e.js.LICENSE.txt → se.02a1c72b61.js.LICENSE.txt} +0 -0
  73. /package/__mf/js/async/{yk.d357453890.js.LICENSE.txt → yk.79c1e2f705.js.LICENSE.txt} +0 -0
@@ -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 {\n LegacyTimeSeries,\n EChartsDataFormat,\n EChartsValues,\n TimeSeriesOption,\n StepOptions,\n} from '@perses-dev/components';\nimport { OPTIMIZED_MODE_SERIES_LIMIT, getCommonTimeScale } from '@perses-dev/components';\nimport type { useTimeSeriesQueries, PanelData } from '@perses-dev/plugin-system';\nimport type { Exemplar, Labels, TimeScale, TimeSeries, TimeSeriesData, TimeSeriesValueTuple } from '@perses-dev/spec';\nimport type { YAXisComponentOption } from 'echarts';\nimport type { LineSeriesOption, BarSeriesOption, ScatterSeriesOption } from 'echarts/charts';\n\nimport type {\n TimeSeriesChartVisualOptions,\n TimeSeriesChartYAxisOptions,\n LineInterpolation,\n LineStyleType,\n} from '../time-series-chart-model';\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} 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\nexport const EXEMPLAR_SERIES_ID_PREFIX = 'exemplar-';\n\nexport const EXEMPLAR_SYMBOL_SIZE = 14;\n\n/**\n * The exemplars of one series, converted to a chart-friendly shape with the\n * rendering attributes (color, y axis) of the matching time series.\n */\nexport interface ExemplarChartData {\n seriesId: string;\n seriesName: string;\n color: string;\n seriesLabels?: Labels;\n yAxisIndex?: number;\n /**\n * When the matching series is rendered with `querySettings.negativeY`, its values are\n * visually negated so it renders below the X axis. The same transform is applied to\n * the exemplar markers' plotted Y values so they stay next to their series. The\n * original (positive) values remain on each `exemplar` for metadata display.\n */\n negativeY?: boolean;\n exemplars: Exemplar[];\n}\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?: {\n lineStyle?: LineStyleType;\n lineInterpolation?: LineInterpolation;\n areaOpacity?: number;\n stack?: boolean;\n },\n yAxisIndex?: number,\n visibleSeriesCount = 1,\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 const areaOpacity = querySettings?.areaOpacity ?? visual.areaOpacity ?? DEFAULT_AREA_OPACITY;\n\n // Show automatic point markers only on short, sparse charts. Dense charts\n // otherwise create a symbol for every sample across every visible series.\n const minuteMs = 60000;\n let showPoints = timeScale.rangeMs <= minuteMs * 15 && visibleSeriesCount <= HIDE_DATAPOINTS_LIMIT;\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 ...interpolationOption(querySettings?.lineInterpolation ?? visual.lineInterpolation),\n // ECharts builds an area polygon whenever areaStyle is set, including at opacity 0.\n ...(areaOpacity > 0 ? { areaStyle: { opacity: areaOpacity } } : {}),\n // https://echarts.apache.org/en/option.html#series-line.emphasis\n emphasis: {\n focus: 'series',\n disabled: 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/** ECharts' line options for an interpolation. Linear is ECharts' default. */\nexport function interpolationOption(interpolation?: LineInterpolation): Pick<LineSeriesOption, 'smooth' | 'step'> {\n switch (interpolation) {\n case 'smooth':\n return { smooth: true };\n case 'stepBefore':\n return { step: 'start' };\n case 'stepAfter':\n return { step: 'end' };\n default:\n return {};\n }\n}\n\n/**\n * The two ECharts series that fill a band between `lo` and `hi`: an invisible\n * lower edge, and the band's height stacked on it with an area. They carry\n * their own data rather than a dataset, and so must come after every series\n * that has one: the tooltip reads datasets by series index, and would\n * otherwise show the band's height as its upper edge.\n */\nexport function getBandSeries(\n id: string,\n lo: TimeSeriesValueTuple[],\n hi: TimeSeriesValueTuple[],\n color: string,\n opacity: number,\n yAxisIndex = 0,\n interpolation?: LineInterpolation,\n): [LineSeriesOption, LineSeriesOption] {\n const highAt = new Map(hi);\n const height = lo.map(([t, low]): [number, number | null] => {\n const high = highAt.get(t);\n return [t, low === null || high === null || high === undefined ? null : high - low];\n });\n const edge: LineSeriesOption = {\n type: 'line',\n stack: id,\n color,\n yAxisIndex,\n silent: true,\n showSymbol: false,\n lineStyle: { opacity: 0 },\n emphasis: { disabled: true },\n tooltip: { show: false },\n z: 1,\n ...interpolationOption(interpolation),\n };\n return [\n { ...edge, id: `${id}-lo`, data: lo },\n { ...edge, id: `${id}-hi`, data: height, areaStyle: { opacity, color } },\n ];\n}\n\n/**\n * Gets an ECharts scatter series rendering exemplar markers for a single series.\n * Each data item embeds its exemplar (and series labels) so the metadata dialog\n * can be populated when a marker is clicked.\n */\nexport function getExemplarSeries(data: ExemplarChartData): ScatterSeriesOption {\n return {\n type: 'scatter',\n id: `${EXEMPLAR_SERIES_ID_PREFIX}${data.seriesId}`,\n name: data.seriesName,\n color: data.color,\n yAxisIndex: data.yAxisIndex,\n symbol: 'diamond',\n symbolSize: EXEMPLAR_SYMBOL_SIZE,\n z: 10,\n cursor: 'pointer',\n data: data.exemplars.map((exemplar) => ({\n // The plotted Y value is negated when negativeY is enabled for the matching series,\n // while `exemplar.value` keeps the original value for the metadata tooltip.\n value: [exemplar.timestamp, data.negativeY ? -exemplar.value : exemplar.value],\n exemplar,\n seriesLabels: data.seriesLabels,\n })),\n };\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 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 = {\n show: inputAxis?.show ?? DEFAULT_Y_AXIS.show,\n min: minValue,\n max: inputAxis?.max,\n } satisfies YAXisComponentOption;\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 Number((firstDigit * Math.pow(10, magnitude)).toPrecision(1));\n}\n\n/**\n * A series' values on the chart's time scale, with nulls for the steps it has\n * no value for, so a line breaks where data is missing.\n *\n * Perses's own (getTimeSeriesValues in @perses-dev/components) moves each value\n * onto startMs + n * stepMs. A calendar day, week or month is not a fixed\n * number of ms: across a clock change a day is 23 or 25 hours, and a month is\n * 28 to 31 days. There a value lands on the next step, a day late, and a null\n * breaks the line before it. Here each value keeps its own time, and a null\n * marks only a step missing between two values; a value within half a step of\n * where one was expected is that step's.\n */\nexport function getTimeSeriesValues(series: TimeSeries, timeScale: TimeScale): TimeSeriesValueTuple[] {\n const { stepMs, endMs } = timeScale;\n const values: TimeSeriesValueTuple[] = [];\n let expected = timeScale.startMs;\n for (const [t, value] of series.values) {\n while (expected + stepMs / 2 < t) {\n values.push([expected, null]);\n expected += stepMs;\n }\n values.push([t, value]);\n // Never back: a value before the scale's start, or out of order, does not\n // send the nulls after it back over steps already passed.\n expected = Math.max(expected, t + stepMs);\n }\n while (expected <= endMs) {\n values.push([expected, null]);\n expected += stepMs;\n }\n return values;\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","EXEMPLAR_SERIES_ID_PREFIX","EXEMPLAR_SYMBOL_SIZE","getCommonTimeScaleForQueries","queries","seriesData","map","query","data","getTimeSeries","id","datasetIndex","formattedName","visual","timeScale","paletteColor","querySettings","yAxisIndex","visibleSeriesCount","lineWidth","pointRadius","shouldStack","stack","undefined","areaOpacity","minuteMs","showPoints","rangeMs","display","series","type","name","color","label","show","connectNulls","sampling","progressiveThreshold","showSymbol","showAllSymbol","symbolSize","lineStyle","width","interpolationOption","lineInterpolation","areaStyle","opacity","emphasis","focus","disabled","blur","interpolation","smooth","step","getBandSeries","lo","hi","highAt","Map","height","t","low","high","get","edge","silent","tooltip","z","getExemplarSeries","seriesId","seriesName","symbol","cursor","exemplars","exemplar","value","timestamp","negativeY","seriesLabels","getThresholdSeries","threshold","seriesIndex","datasetId","convertPercentThreshold","percent","max","min","percentDecimal","adjustedMax","findMax","adjustedMin","total","length","values","forEach","valueTuple","_","Math","abs","convertPanelYAxis","inputAxis","minValue","logBase","roundDown","yAxis","num","magnitude","floor","log10","firstDigit","pow","Number","toPrecision","getTimeSeriesValues","stepMs","endMs","expected","startMs","push"],"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;AASjC,SAASA,2BAA2B,EAAEC,kBAAkB,QAAQ,yBAAyB;AAYzF,SACEC,oBAAoB,EACpBC,qBAAqB,EACrBC,kBAAkB,EAClBC,oBAAoB,EACpBC,cAAc,EACdC,6BAA6B,EAC7BC,6BAA6B,QACxB,gCAA6B;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,OAAO,MAAMC,4BAA4B,YAAY;AAErD,OAAO,MAAMC,uBAAuB,GAAG;AAsBvC;;;;CAIC,GACD,OAAO,SAASC,6BAA6BC,OAAyC;IACpF,MAAMC,aAAaD,QAAQE,GAAG,CAAC,CAACC,QAAUA,MAAMC,IAAI;IACpD,OAAOrB,mBAAmBkB;AAC5B;AAEA;;CAEC,GACD,OAAO,SAASI,cACdC,EAAU,EACVC,YAAoB,EACpBC,aAAqB,EACrBC,MAAoC,EACpCC,SAAoB,EACpBC,YAAoB,EACpBC,aAKC,EACDC,UAAmB,EACnBC,qBAAqB,CAAC;IAEtB,MAAMC,YAAYN,OAAOM,SAAS,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QAC5BA,YAAYF;IACd;IACA,OAAOrB;AACT"}
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 {\n LegacyTimeSeries,\n EChartsDataFormat,\n EChartsValues,\n TimeSeriesOption,\n StepOptions,\n} from '@perses-dev/components';\nimport { OPTIMIZED_MODE_SERIES_LIMIT, getCommonTimeScale } from '@perses-dev/components';\nimport type { useTimeSeriesQueries, PanelData } from '@perses-dev/plugin-system';\nimport type { Exemplar, Labels, TimeScale, TimeSeries, TimeSeriesData, TimeSeriesValueTuple } from '@perses-dev/spec';\nimport type { YAXisComponentOption } from 'echarts';\nimport type { LineSeriesOption, BarSeriesOption, ScatterSeriesOption } from 'echarts/charts';\n\nimport type {\n TimeSeriesChartVisualOptions,\n TimeSeriesChartYAxisOptions,\n LineInterpolation,\n LineStyleType,\n} from '../time-series-chart-model';\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} 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\nexport const EXEMPLAR_SERIES_ID_PREFIX = 'exemplar-';\n\nexport const EXEMPLAR_SYMBOL_SIZE = 14;\n\n/**\n * The exemplars of one series, converted to a chart-friendly shape with the\n * rendering attributes (color, y axis) of the matching time series.\n */\nexport interface ExemplarChartData {\n seriesId: string;\n seriesName: string;\n color: string;\n seriesLabels?: Labels;\n yAxisIndex?: number;\n /**\n * When the matching series is rendered with `querySettings.negativeY`, its values are\n * visually negated so it renders below the X axis. The same transform is applied to\n * the exemplar markers' plotted Y values so they stay next to their series. The\n * original (positive) values remain on each `exemplar` for metadata display.\n */\n negativeY?: boolean;\n exemplars: Exemplar[];\n}\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?: {\n lineStyle?: LineStyleType;\n lineInterpolation?: LineInterpolation;\n areaOpacity?: number;\n stack?: boolean;\n },\n yAxisIndex?: number,\n visibleSeriesCount = 1,\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 const areaOpacity = querySettings?.areaOpacity ?? visual.areaOpacity ?? DEFAULT_AREA_OPACITY;\n\n // Show automatic point markers only on short, sparse charts. Dense charts\n // otherwise create a symbol for every sample across every visible series.\n const minuteMs = 60000;\n let showPoints = timeScale.rangeMs <= minuteMs * 15 && visibleSeriesCount <= HIDE_DATAPOINTS_LIMIT;\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 ...(visual.maxBarWidth ? { barMaxWidth: visual.maxBarWidth } : {}),\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 ...interpolationOption(querySettings?.lineInterpolation ?? visual.lineInterpolation),\n // ECharts builds an area polygon whenever areaStyle is set, including at opacity 0.\n ...(areaOpacity > 0 ? { areaStyle: { opacity: areaOpacity } } : {}),\n // https://echarts.apache.org/en/option.html#series-line.emphasis\n emphasis: {\n focus: 'series',\n disabled: 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/** ECharts' line options for an interpolation. Linear is ECharts' default. */\nexport function interpolationOption(interpolation?: LineInterpolation): Pick<LineSeriesOption, 'smooth' | 'step'> {\n switch (interpolation) {\n case 'smooth':\n return { smooth: true };\n case 'stepBefore':\n return { step: 'start' };\n case 'stepAfter':\n return { step: 'end' };\n default:\n return {};\n }\n}\n\n/**\n * The two ECharts series that fill a band between `lo` and `hi`: an invisible\n * lower edge, and the band's height stacked on it with an area. They carry\n * their own data rather than a dataset, and so must come after every series\n * that has one: the tooltip reads datasets by series index, and would\n * otherwise show the band's height as its upper edge.\n */\nexport function getBandSeries(\n id: string,\n lo: TimeSeriesValueTuple[],\n hi: TimeSeriesValueTuple[],\n color: string,\n opacity: number,\n yAxisIndex = 0,\n interpolation?: LineInterpolation,\n): [LineSeriesOption, LineSeriesOption] {\n const highAt = new Map(hi);\n const height = lo.map(([t, low]): [number, number | null] => {\n const high = highAt.get(t);\n return [t, low === null || high === null || high === undefined ? null : high - low];\n });\n const edge: LineSeriesOption = {\n type: 'line',\n stack: id,\n color,\n yAxisIndex,\n silent: true,\n showSymbol: false,\n lineStyle: { opacity: 0 },\n emphasis: { disabled: true },\n tooltip: { show: false },\n z: 1,\n ...interpolationOption(interpolation),\n };\n return [\n { ...edge, id: `${id}-lo`, data: lo },\n { ...edge, id: `${id}-hi`, data: height, areaStyle: { opacity, color } },\n ];\n}\n\n/**\n * Gets an ECharts scatter series rendering exemplar markers for a single series.\n * Each data item embeds its exemplar (and series labels) so the metadata dialog\n * can be populated when a marker is clicked.\n */\nexport function getExemplarSeries(data: ExemplarChartData): ScatterSeriesOption {\n return {\n type: 'scatter',\n id: `${EXEMPLAR_SERIES_ID_PREFIX}${data.seriesId}`,\n name: data.seriesName,\n color: data.color,\n yAxisIndex: data.yAxisIndex,\n symbol: 'diamond',\n symbolSize: EXEMPLAR_SYMBOL_SIZE,\n z: 10,\n cursor: 'pointer',\n data: data.exemplars.map((exemplar) => ({\n // The plotted Y value is negated when negativeY is enabled for the matching series,\n // while `exemplar.value` keeps the original value for the metadata tooltip.\n value: [exemplar.timestamp, data.negativeY ? -exemplar.value : exemplar.value],\n exemplar,\n seriesLabels: data.seriesLabels,\n })),\n };\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 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 = {\n show: inputAxis?.show ?? DEFAULT_Y_AXIS.show,\n min: minValue,\n max: inputAxis?.max,\n } satisfies YAXisComponentOption;\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 Number((firstDigit * Math.pow(10, magnitude)).toPrecision(1));\n}\n\n/**\n * A series' values on the chart's time scale, with nulls for the steps it has\n * no value for, so a line breaks where data is missing.\n *\n * Perses's own (getTimeSeriesValues in @perses-dev/components) moves each value\n * onto startMs + n * stepMs. A calendar day, week or month is not a fixed\n * number of ms: across a clock change a day is 23 or 25 hours, and a month is\n * 28 to 31 days. There a value lands on the next step, a day late, and a null\n * breaks the line before it. Here each value keeps its own time, and a null\n * marks only a step missing between two values; a value within half a step of\n * where one was expected is that step's.\n */\nexport function getTimeSeriesValues(series: TimeSeries, timeScale: TimeScale): TimeSeriesValueTuple[] {\n const { stepMs, endMs } = timeScale;\n const values: TimeSeriesValueTuple[] = [];\n let expected = timeScale.startMs;\n for (const [t, value] of series.values) {\n while (expected + stepMs / 2 < t) {\n values.push([expected, null]);\n expected += stepMs;\n }\n values.push([t, value]);\n // Never back: a value before the scale's start, or out of order, does not\n // send the nulls after it back over steps already passed.\n expected = Math.max(expected, t + stepMs);\n }\n while (expected <= endMs) {\n values.push([expected, null]);\n expected += stepMs;\n }\n return values;\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","EXEMPLAR_SERIES_ID_PREFIX","EXEMPLAR_SYMBOL_SIZE","getCommonTimeScaleForQueries","queries","seriesData","map","query","data","getTimeSeries","id","datasetIndex","formattedName","visual","timeScale","paletteColor","querySettings","yAxisIndex","visibleSeriesCount","lineWidth","pointRadius","shouldStack","stack","undefined","areaOpacity","minuteMs","showPoints","rangeMs","display","series","type","name","color","maxBarWidth","barMaxWidth","label","show","connectNulls","sampling","progressiveThreshold","showSymbol","showAllSymbol","symbolSize","lineStyle","width","interpolationOption","lineInterpolation","areaStyle","opacity","emphasis","focus","disabled","blur","interpolation","smooth","step","getBandSeries","lo","hi","highAt","Map","height","t","low","high","get","edge","silent","tooltip","z","getExemplarSeries","seriesId","seriesName","symbol","cursor","exemplars","exemplar","value","timestamp","negativeY","seriesLabels","getThresholdSeries","threshold","seriesIndex","datasetId","convertPercentThreshold","percent","max","min","percentDecimal","adjustedMax","findMax","adjustedMin","total","length","values","forEach","valueTuple","_","Math","abs","convertPanelYAxis","inputAxis","minValue","logBase","roundDown","yAxis","num","magnitude","floor","log10","firstDigit","pow","Number","toPrecision","getTimeSeriesValues","stepMs","endMs","expected","startMs","push"],"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;AASjC,SAASA,2BAA2B,EAAEC,kBAAkB,QAAQ,yBAAyB;AAYzF,SACEC,oBAAoB,EACpBC,qBAAqB,EACrBC,kBAAkB,EAClBC,oBAAoB,EACpBC,cAAc,EACdC,6BAA6B,EAC7BC,6BAA6B,QACxB,gCAA6B;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,OAAO,MAAMC,4BAA4B,YAAY;AAErD,OAAO,MAAMC,uBAAuB,GAAG;AAsBvC;;;;CAIC,GACD,OAAO,SAASC,6BAA6BC,OAAyC;IACpF,MAAMC,aAAaD,QAAQE,GAAG,CAAC,CAACC,QAAUA,MAAMC,IAAI;IACpD,OAAOrB,mBAAmBkB;AAC5B;AAEA;;CAEC,GACD,OAAO,SAASI,cACdC,EAAU,EACVC,YAAoB,EACpBC,aAAqB,EACrBC,MAAoC,EACpCC,SAAoB,EACpBC,YAAoB,EACpBC,aAKC,EACDC,UAAmB,EACnBC,qBAAqB,CAAC;IAEtB,MAAMC,YAAYN,OAAOM,SAAS,IAAI7B;IACtC,MAAM8B,cAAcP,OAAOO,WAAW,IAAI7B;IAC1C,MAAM8B,cAAcL,eAAeM,UAAUC,YAAYP,cAAcM,KAAK,GAAGT,OAAOS,KAAK,KAAK;IAChG,MAAME,cAAcR,eAAeQ,e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@
5
5
  "name": "PulzrTimeSeriesChart",
6
6
  "type": "app",
7
7
  "buildInfo": {
8
- "buildVersion": "0.1.2",
8
+ "buildVersion": "0.1.4",
9
9
  "buildName": "@pulzr/perses-timeseries-panel"
10
10
  },
11
11
  "remoteEntry": {
12
- "name": "__mf/js/PulzrTimeSeriesChart.8f5010ba5c.js",
12
+ "name": "__mf/js/PulzrTimeSeriesChart.7c3ead7012.js",
13
13
  "path": "",
14
14
  "type": "global"
15
15
  },
@@ -19,9 +19,9 @@
19
19
  "zip": "",
20
20
  "api": ""
21
21
  },
22
- "globalName": "PulzrTimeSeriesChart_0_1_2",
22
+ "globalName": "PulzrTimeSeriesChart_0_1_4",
23
23
  "pluginVersion": "2.9.3",
24
- "getPublicPath": "function() { return (window.PERSES_PLUGIN_ASSETS_PATH || window.PERSES_APP_CONFIG?.api_prefix || \"\") + \"/plugins/PulzrTimeSeriesChart~0.1.2/\"; }"
24
+ "getPublicPath": "function() { return (window.PERSES_PLUGIN_ASSETS_PATH || window.PERSES_APP_CONFIG?.api_prefix || \"\") + \"/plugins/PulzrTimeSeriesChart~0.1.4/\"; }"
25
25
  },
26
26
  "shared": [
27
27
  {
@@ -34,7 +34,7 @@
34
34
  "js": {
35
35
  "async": [],
36
36
  "sync": [
37
- "__mf/js/async/0p.58ba51c3d8.js"
37
+ "__mf/js/async/0p.45231180d3.js"
38
38
  ]
39
39
  },
40
40
  "css": {
@@ -54,8 +54,8 @@
54
54
  "js": {
55
55
  "async": [],
56
56
  "sync": [
57
- "__mf/js/async/6.1c072abe87.js",
58
- "__mf/js/async/o.f00502c3dc.js"
57
+ "__mf/js/async/6.d90805485a.js",
58
+ "__mf/js/async/o.27f2fd5272.js"
59
59
  ]
60
60
  },
61
61
  "css": {
@@ -75,8 +75,8 @@
75
75
  "js": {
76
76
  "async": [],
77
77
  "sync": [
78
- "__mf/js/async/24.c20b9c5a17.js",
79
- "__mf/js/async/f6.a297b4c3b5.js"
78
+ "__mf/js/async/24.aff881525a.js",
79
+ "__mf/js/async/f6.ffd252b334.js"
80
80
  ]
81
81
  },
82
82
  "css": {
@@ -96,8 +96,8 @@
96
96
  "js": {
97
97
  "async": [],
98
98
  "sync": [
99
- "__mf/js/async/n.07b91c8f3b.js",
100
- "__mf/js/async/yk.d357453890.js"
99
+ "__mf/js/async/n.dada4ae652.js",
100
+ "__mf/js/async/yk.79c1e2f705.js"
101
101
  ]
102
102
  },
103
103
  "css": {
@@ -117,7 +117,7 @@
117
117
  "js": {
118
118
  "async": [],
119
119
  "sync": [
120
- "__mf/js/async/m.8322f15461.js"
120
+ "__mf/js/async/m.e7706a5825.js"
121
121
  ]
122
122
  },
123
123
  "css": {
@@ -139,7 +139,7 @@
139
139
  "js": {
140
140
  "async": [],
141
141
  "sync": [
142
- "__mf/js/async/7.15f564c6f3.js"
142
+ "__mf/js/async/7.f40ccc96ba.js"
143
143
  ]
144
144
  },
145
145
  "css": {
@@ -159,7 +159,7 @@
159
159
  "js": {
160
160
  "async": [],
161
161
  "sync": [
162
- "__mf/js/async/6x.3c32d29a25.js"
162
+ "__mf/js/async/6x.368a17e295.js"
163
163
  ]
164
164
  },
165
165
  "css": {
@@ -179,7 +179,7 @@
179
179
  "js": {
180
180
  "async": [],
181
181
  "sync": [
182
- "__mf/js/async/y.2d4e8c2b2e.js"
182
+ "__mf/js/async/y.a7adb70718.js"
183
183
  ]
184
184
  },
185
185
  "css": {
@@ -199,7 +199,7 @@
199
199
  "js": {
200
200
  "async": [],
201
201
  "sync": [
202
- "__mf/js/async/s.4d1c08522b.js"
202
+ "__mf/js/async/s.db986f308e.js"
203
203
  ]
204
204
  },
205
205
  "css": {
@@ -219,7 +219,7 @@
219
219
  "js": {
220
220
  "async": [],
221
221
  "sync": [
222
- "__mf/js/async/xr.6ee20d6a04.js"
222
+ "__mf/js/async/xr.2f4b0bfea6.js"
223
223
  ]
224
224
  },
225
225
  "css": {
@@ -239,7 +239,7 @@
239
239
  "js": {
240
240
  "async": [],
241
241
  "sync": [
242
- "__mf/js/async/os.48ffc14283.js"
242
+ "__mf/js/async/os.f5826c65d5.js"
243
243
  ]
244
244
  },
245
245
  "css": {
@@ -259,7 +259,7 @@
259
259
  "js": {
260
260
  "async": [],
261
261
  "sync": [
262
- "__mf/js/async/f.629bfc34cd.js"
262
+ "__mf/js/async/f.1ee31f4c44.js"
263
263
  ]
264
264
  },
265
265
  "css": {
@@ -279,7 +279,7 @@
279
279
  "js": {
280
280
  "async": [],
281
281
  "sync": [
282
- "__mf/js/async/pj.dd52375d06.js"
282
+ "__mf/js/async/pj.a85577346e.js"
283
283
  ]
284
284
  },
285
285
  "css": {
@@ -299,7 +299,7 @@
299
299
  "js": {
300
300
  "async": [],
301
301
  "sync": [
302
- "__mf/js/async/07.36ac3671c5.js"
302
+ "__mf/js/async/07.069fbddc67.js"
303
303
  ]
304
304
  },
305
305
  "css": {
@@ -319,8 +319,8 @@
319
319
  "js": {
320
320
  "async": [],
321
321
  "sync": [
322
- "__mf/js/async/2.965b5a081a.js",
323
- "__mf/js/async/p.f622a2635a.js"
322
+ "__mf/js/async/2.a727b9416d.js",
323
+ "__mf/js/async/p.7d81f7ca97.js"
324
324
  ]
325
325
  },
326
326
  "css": {
@@ -340,7 +340,7 @@
340
340
  "js": {
341
341
  "async": [],
342
342
  "sync": [
343
- "__mf/js/async/0.1f67a94360.js"
343
+ "__mf/js/async/0.5ef0431536.js"
344
344
  ]
345
345
  },
346
346
  "css": {
@@ -360,7 +360,7 @@
360
360
  "js": {
361
361
  "async": [],
362
362
  "sync": [
363
- "__mf/js/async/s9.14445ad382.js"
363
+ "__mf/js/async/s9.5f6d9374f6.js"
364
364
  ]
365
365
  },
366
366
  "css": {
@@ -379,25 +379,25 @@
379
379
  "assets": {
380
380
  "js": {
381
381
  "sync": [
382
- "__mf/js/async/g.8f186fee46.js",
383
- "__mf/js/async/k.9353f82963.js",
384
- "__mf/js/async/se.3e1054cb2e.js",
385
- "__mf/js/async/uz.53202eb429.js",
386
- "__mf/js/async/t.94a8ce332d.js",
387
- "__mf/js/async/__federation_expose_PulzrTimeSeriesChart.872d907273.js"
382
+ "__mf/js/async/g.adaadebd2d.js",
383
+ "__mf/js/async/k.4a35cfdf19.js",
384
+ "__mf/js/async/se.02a1c72b61.js",
385
+ "__mf/js/async/uz.9126a376c9.js",
386
+ "__mf/js/async/t.4fcc93a4ee.js",
387
+ "__mf/js/async/__federation_expose_PulzrTimeSeriesChart.f8cb14738c.js"
388
388
  ],
389
389
  "async": [
390
- "__mf/js/async/o8.0d0f7ae8dd.js",
391
- "__mf/js/async/sp.823f3e93e8.js",
392
- "__mf/js/async/1.73bde7147c.js",
393
- "__mf/js/async/5.f4b8ab81b7.js",
394
- "__mf/js/async/i.20d8c95685.js",
395
- "__mf/js/async/tl.d9749e7d1e.js",
396
- "__mf/js/async/c.db5f03155c.js",
397
- "__mf/js/async/aw.c62047d59e.js",
398
- "__mf/js/async/x.57044cf1d5.js",
399
- "__mf/js/async/sr.52e9bae874.js",
400
- "__mf/js/async/4.21994aea94.js"
390
+ "__mf/js/async/o8.aeb40cdeea.js",
391
+ "__mf/js/async/sp.dfb099e3e6.js",
392
+ "__mf/js/async/1.75df3ae4b0.js",
393
+ "__mf/js/async/5.5d8820f557.js",
394
+ "__mf/js/async/i.a9f4f52e01.js",
395
+ "__mf/js/async/tl.252b3303c9.js",
396
+ "__mf/js/async/c.783005e082.js",
397
+ "__mf/js/async/aw.bedacdca5d.js",
398
+ "__mf/js/async/x.d033ab938e.js",
399
+ "__mf/js/async/sr.694c7e4e84.js",
400
+ "__mf/js/async/4.3c9a2b4233.js"
401
401
  ]
402
402
  },
403
403
  "css": {
package/mf-stats.json CHANGED
@@ -5,11 +5,11 @@
5
5
  "name": "PulzrTimeSeriesChart",
6
6
  "type": "app",
7
7
  "buildInfo": {
8
- "buildVersion": "0.1.2",
8
+ "buildVersion": "0.1.4",
9
9
  "buildName": "@pulzr/perses-timeseries-panel"
10
10
  },
11
11
  "remoteEntry": {
12
- "name": "__mf/js/PulzrTimeSeriesChart.8f5010ba5c.js",
12
+ "name": "__mf/js/PulzrTimeSeriesChart.7c3ead7012.js",
13
13
  "path": "",
14
14
  "type": "global"
15
15
  },
@@ -19,9 +19,9 @@
19
19
  "zip": "",
20
20
  "api": ""
21
21
  },
22
- "globalName": "PulzrTimeSeriesChart_0_1_2",
22
+ "globalName": "PulzrTimeSeriesChart_0_1_4",
23
23
  "pluginVersion": "2.9.3",
24
- "getPublicPath": "function() { return (window.PERSES_PLUGIN_ASSETS_PATH || window.PERSES_APP_CONFIG?.api_prefix || \"\") + \"/plugins/PulzrTimeSeriesChart~0.1.2/\"; }"
24
+ "getPublicPath": "function() { return (window.PERSES_PLUGIN_ASSETS_PATH || window.PERSES_APP_CONFIG?.api_prefix || \"\") + \"/plugins/PulzrTimeSeriesChart~0.1.4/\"; }"
25
25
  },
26
26
  "shared": [
27
27
  {
@@ -36,7 +36,7 @@
36
36
  "js": {
37
37
  "async": [],
38
38
  "sync": [
39
- "__mf/js/async/0p.58ba51c3d8.js"
39
+ "__mf/js/async/0p.45231180d3.js"
40
40
  ]
41
41
  },
42
42
  "css": {
@@ -60,8 +60,8 @@
60
60
  "js": {
61
61
  "async": [],
62
62
  "sync": [
63
- "__mf/js/async/6.1c072abe87.js",
64
- "__mf/js/async/o.f00502c3dc.js"
63
+ "__mf/js/async/6.d90805485a.js",
64
+ "__mf/js/async/o.27f2fd5272.js"
65
65
  ]
66
66
  },
67
67
  "css": {
@@ -85,8 +85,8 @@
85
85
  "js": {
86
86
  "async": [],
87
87
  "sync": [
88
- "__mf/js/async/24.c20b9c5a17.js",
89
- "__mf/js/async/f6.a297b4c3b5.js"
88
+ "__mf/js/async/24.aff881525a.js",
89
+ "__mf/js/async/f6.ffd252b334.js"
90
90
  ]
91
91
  },
92
92
  "css": {
@@ -110,8 +110,8 @@
110
110
  "js": {
111
111
  "async": [],
112
112
  "sync": [
113
- "__mf/js/async/n.07b91c8f3b.js",
114
- "__mf/js/async/yk.d357453890.js"
113
+ "__mf/js/async/n.dada4ae652.js",
114
+ "__mf/js/async/yk.79c1e2f705.js"
115
115
  ]
116
116
  },
117
117
  "css": {
@@ -135,7 +135,7 @@
135
135
  "js": {
136
136
  "async": [],
137
137
  "sync": [
138
- "__mf/js/async/m.8322f15461.js"
138
+ "__mf/js/async/m.e7706a5825.js"
139
139
  ]
140
140
  },
141
141
  "css": {
@@ -163,7 +163,7 @@
163
163
  "js": {
164
164
  "async": [],
165
165
  "sync": [
166
- "__mf/js/async/7.15f564c6f3.js"
166
+ "__mf/js/async/7.f40ccc96ba.js"
167
167
  ]
168
168
  },
169
169
  "css": {
@@ -189,7 +189,7 @@
189
189
  "js": {
190
190
  "async": [],
191
191
  "sync": [
192
- "__mf/js/async/6x.3c32d29a25.js"
192
+ "__mf/js/async/6x.368a17e295.js"
193
193
  ]
194
194
  },
195
195
  "css": {
@@ -215,7 +215,7 @@
215
215
  "js": {
216
216
  "async": [],
217
217
  "sync": [
218
- "__mf/js/async/y.2d4e8c2b2e.js"
218
+ "__mf/js/async/y.a7adb70718.js"
219
219
  ]
220
220
  },
221
221
  "css": {
@@ -239,7 +239,7 @@
239
239
  "js": {
240
240
  "async": [],
241
241
  "sync": [
242
- "__mf/js/async/s.4d1c08522b.js"
242
+ "__mf/js/async/s.db986f308e.js"
243
243
  ]
244
244
  },
245
245
  "css": {
@@ -263,7 +263,7 @@
263
263
  "js": {
264
264
  "async": [],
265
265
  "sync": [
266
- "__mf/js/async/xr.6ee20d6a04.js"
266
+ "__mf/js/async/xr.2f4b0bfea6.js"
267
267
  ]
268
268
  },
269
269
  "css": {
@@ -287,7 +287,7 @@
287
287
  "js": {
288
288
  "async": [],
289
289
  "sync": [
290
- "__mf/js/async/os.48ffc14283.js"
290
+ "__mf/js/async/os.f5826c65d5.js"
291
291
  ]
292
292
  },
293
293
  "css": {
@@ -311,7 +311,7 @@
311
311
  "js": {
312
312
  "async": [],
313
313
  "sync": [
314
- "__mf/js/async/f.629bfc34cd.js"
314
+ "__mf/js/async/f.1ee31f4c44.js"
315
315
  ]
316
316
  },
317
317
  "css": {
@@ -335,7 +335,7 @@
335
335
  "js": {
336
336
  "async": [],
337
337
  "sync": [
338
- "__mf/js/async/pj.dd52375d06.js"
338
+ "__mf/js/async/pj.a85577346e.js"
339
339
  ]
340
340
  },
341
341
  "css": {
@@ -359,7 +359,7 @@
359
359
  "js": {
360
360
  "async": [],
361
361
  "sync": [
362
- "__mf/js/async/07.36ac3671c5.js"
362
+ "__mf/js/async/07.069fbddc67.js"
363
363
  ]
364
364
  },
365
365
  "css": {
@@ -383,8 +383,8 @@
383
383
  "js": {
384
384
  "async": [],
385
385
  "sync": [
386
- "__mf/js/async/2.965b5a081a.js",
387
- "__mf/js/async/p.f622a2635a.js"
386
+ "__mf/js/async/2.a727b9416d.js",
387
+ "__mf/js/async/p.7d81f7ca97.js"
388
388
  ]
389
389
  },
390
390
  "css": {
@@ -410,7 +410,7 @@
410
410
  "js": {
411
411
  "async": [],
412
412
  "sync": [
413
- "__mf/js/async/0.1f67a94360.js"
413
+ "__mf/js/async/0.5ef0431536.js"
414
414
  ]
415
415
  },
416
416
  "css": {
@@ -436,7 +436,7 @@
436
436
  "js": {
437
437
  "async": [],
438
438
  "sync": [
439
- "__mf/js/async/s9.14445ad382.js"
439
+ "__mf/js/async/s9.5f6d9374f6.js"
440
440
  ]
441
441
  },
442
442
  "css": {
@@ -466,25 +466,25 @@
466
466
  "assets": {
467
467
  "js": {
468
468
  "sync": [
469
- "__mf/js/async/g.8f186fee46.js",
470
- "__mf/js/async/k.9353f82963.js",
471
- "__mf/js/async/se.3e1054cb2e.js",
472
- "__mf/js/async/uz.53202eb429.js",
473
- "__mf/js/async/t.94a8ce332d.js",
474
- "__mf/js/async/__federation_expose_PulzrTimeSeriesChart.872d907273.js"
469
+ "__mf/js/async/g.adaadebd2d.js",
470
+ "__mf/js/async/k.4a35cfdf19.js",
471
+ "__mf/js/async/se.02a1c72b61.js",
472
+ "__mf/js/async/uz.9126a376c9.js",
473
+ "__mf/js/async/t.4fcc93a4ee.js",
474
+ "__mf/js/async/__federation_expose_PulzrTimeSeriesChart.f8cb14738c.js"
475
475
  ],
476
476
  "async": [
477
- "__mf/js/async/o8.0d0f7ae8dd.js",
478
- "__mf/js/async/sp.823f3e93e8.js",
479
- "__mf/js/async/1.73bde7147c.js",
480
- "__mf/js/async/5.f4b8ab81b7.js",
481
- "__mf/js/async/i.20d8c95685.js",
482
- "__mf/js/async/tl.d9749e7d1e.js",
483
- "__mf/js/async/c.db5f03155c.js",
484
- "__mf/js/async/aw.c62047d59e.js",
485
- "__mf/js/async/x.57044cf1d5.js",
486
- "__mf/js/async/sr.52e9bae874.js",
487
- "__mf/js/async/4.21994aea94.js"
477
+ "__mf/js/async/o8.aeb40cdeea.js",
478
+ "__mf/js/async/sp.dfb099e3e6.js",
479
+ "__mf/js/async/1.75df3ae4b0.js",
480
+ "__mf/js/async/5.5d8820f557.js",
481
+ "__mf/js/async/i.a9f4f52e01.js",
482
+ "__mf/js/async/tl.252b3303c9.js",
483
+ "__mf/js/async/c.783005e082.js",
484
+ "__mf/js/async/aw.bedacdca5d.js",
485
+ "__mf/js/async/x.d033ab938e.js",
486
+ "__mf/js/async/sr.694c7e4e84.js",
487
+ "__mf/js/async/4.3c9a2b4233.js"
488
488
  ]
489
489
  },
490
490
  "css": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pulzr/perses-timeseries-panel",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "engines": {
@@ -1 +0,0 @@
1
- "use strict";(self.chunk_PulzrTimeSeriesChart_0_1_2=self.chunk_PulzrTimeSeriesChart_0_1_2||[]).push([[4],{ZZ(e,u,l){var _;Object.defineProperty(u,"__esModule",{value:!0}),u.default=void 0,u.default=(0,((_=l("gYg"))&&_.__esModule?_:{default:_}).default)("M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z","Download")}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.chunk_PulzrTimeSeriesChart_0_1_2=self.chunk_PulzrTimeSeriesChart_0_1_2||[]).push([["b"],{ZZ(e,u,l){var _;Object.defineProperty(u,"__esModule",{value:!0}),u.default=void 0,u.default=(0,((_=l("gYg"))&&_.__esModule?_:{default:_}).default)("M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z","Download")}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.chunk_PulzrTimeSeriesChart_0_1_2=self.chunk_PulzrTimeSeriesChart_0_1_2||[]).push([["kk"],{Wp(e,r,t){var o=t("th");r.H=o.createRoot,o.hydrateRoot},K0(e,r,t){t.r(r);var o=t("Qi"),s=t("IF");t("Wp").H(document.getElementById("root")).render((0,o.jsx)(s.StrictMode,{}))}}]);