From 5d6bdc60b161dc23b5b0bd1d1c57a82a520aa4ee Mon Sep 17 00:00:00 2001 From: xdavidwu Date: Sat, 10 Dec 2022 11:07:12 +0800 Subject: [PATCH] HeatmapPanel: Fix typo in variable naming (#57326) --- public/app/plugins/panel/heatmap/utils.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/public/app/plugins/panel/heatmap/utils.ts b/public/app/plugins/panel/heatmap/utils.ts index 113aa80f2b3..0dce0ec7aae 100644 --- a/public/app/plugins/panel/heatmap/utils.ts +++ b/public/app/plugins/panel/heatmap/utils.ts @@ -264,10 +264,10 @@ export function prepConfig(opts: PrepConfigOpts) { const yAxisReverse = Boolean(yAxisConfig.reverse); const isSparseHeatmap = heatmapType === DataFrameType.HeatmapCells && !isHeatmapCellsDense(dataRef.current?.heatmap!); const shouldUseLogScale = yScale.type !== ScaleDistribution.Linear || isSparseHeatmap; - const isOrdianalY = readHeatmapRowsCustomMeta(dataRef.current?.heatmap).yOrdinalDisplay != null; + const isOrdinalY = readHeatmapRowsCustomMeta(dataRef.current?.heatmap).yOrdinalDisplay != null; // random to prevent syncing y in other heatmaps - // TODO: try to match TimeSeries y keygen algo to sync with TimeSeries panels (when not isOrdianalY) + // TODO: try to match TimeSeries y keygen algo to sync with TimeSeries panels (when not isOrdinalY) const yScaleKey = 'y_' + (Math.random() + 1).toString(36).substring(7); builder.addScale({ @@ -289,7 +289,7 @@ export function prepConfig(opts: PrepConfigOpts) { ? uPlot.rangeLog(dataMin, dataMax, (yScale.log ?? 2) as unknown as uPlot.Scale.LogBase, true) : [dataMin, dataMax]; - if (shouldUseLogScale && !isOrdianalY) { + if (shouldUseLogScale && !isOrdinalY) { let yExp = u.scales[yScaleKey].log!; let log = yExp === 2 ? Math.log2 : Math.log10; @@ -354,7 +354,7 @@ export function prepConfig(opts: PrepConfigOpts) { scaleMax *= yExp / 2; } - if (!isOrdianalY) { + if (!isOrdinalY) { // guard against <= 0 if (explicitMin != null && explicitMin > 0) { // snap down to magnitude @@ -389,7 +389,7 @@ export function prepConfig(opts: PrepConfigOpts) { // how to expand scale range if inferred non-regular or log buckets? } - if (!isOrdianalY) { + if (!isOrdinalY) { scaleMin = explicitMin ?? scaleMin; scaleMax = explicitMax ?? scaleMax; } @@ -409,7 +409,7 @@ export function prepConfig(opts: PrepConfigOpts) { label: yAxisConfig.axisLabel, theme: theme, formatValue: (v, decimals) => formattedValueToString(dispY(v, decimals)), - splits: isOrdianalY + splits: isOrdinalY ? (self: uPlot) => { const meta = readHeatmapRowsCustomMeta(dataRef.current?.heatmap); if (!meta.yOrdinalDisplay) { @@ -437,7 +437,7 @@ export function prepConfig(opts: PrepConfigOpts) { return splits; } : undefined, - values: isOrdianalY + values: isOrdinalY ? (self: uPlot, splits) => { const meta = readHeatmapRowsCustomMeta(dataRef.current?.heatmap); if (meta.yOrdinalDisplay) {