From 6124278a50c5458260c61f15e1191fc786976ae0 Mon Sep 17 00:00:00 2001 From: Leto <gerile.tu@merico.dev> Date: Wed, 31 Jul 2024 05:46:36 +0800 Subject: [PATCH 1/2] fix(dashboard): heatmap's showing wrong yaxis when its all ticks are number-like --- .../components/plugins/viz-components/heatmap/option/index.ts | 2 +- .../plugins/viz-components/heatmap/option/y-axis.ts | 4 ++-- .../viz-components/merico-heatmap/render/option/index.ts | 3 +-- .../viz-components/merico-heatmap/render/option/y-axis.ts | 3 +-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/dashboard/src/components/plugins/viz-components/heatmap/option/index.ts b/dashboard/src/components/plugins/viz-components/heatmap/option/index.ts index 5aa9d22fe..e89e991ab 100644 --- a/dashboard/src/components/plugins/viz-components/heatmap/option/index.ts +++ b/dashboard/src/components/plugins/viz-components/heatmap/option/index.ts @@ -68,7 +68,7 @@ export function getOption( const options = { xAxis: getXAxis(conf, xData, labelFormatters.x_axis, borderWidth), - yAxis: getYAxis(conf, yData, labelFormatters.y_axis, borderWidth), + yAxis: getYAxis(conf, labelFormatters.y_axis, borderWidth), series: getSeries(conf, seriesData, borderWidth), tooltip: getTooltip(conf, data, labelFormatters, valueFormatters), grid: getGrid(conf), diff --git a/dashboard/src/components/plugins/viz-components/heatmap/option/y-axis.ts b/dashboard/src/components/plugins/viz-components/heatmap/option/y-axis.ts index 5ce3e068d..c7c1fd1cb 100644 --- a/dashboard/src/components/plugins/viz-components/heatmap/option/y-axis.ts +++ b/dashboard/src/components/plugins/viz-components/heatmap/option/y-axis.ts @@ -2,8 +2,9 @@ import { defaultEchartsOptions } from '~/styles/default-echarts-options'; import { getLabelOverflowOptionOnAxis } from '../../../common-echarts-fields/axis-label-overflow'; import { IHeatmapConf } from '../type'; import { FormatterFuncType } from '~/components/plugins/common-echarts-fields/x-axis-label-formatter'; +import _ from 'lodash'; -export function getYAxis(conf: IHeatmapConf, yData: any[], formatterFunc: FormatterFuncType, borderWidth: number) { +export function getYAxis(conf: IHeatmapConf, formatterFunc: FormatterFuncType, borderWidth: number) { const { nameAlignment, data_key, ...rest } = conf.y_axis; const { overflow, rotate } = conf.y_axis.axisLabel; @@ -11,7 +12,6 @@ export function getYAxis(conf: IHeatmapConf, yData: any[], formatterFunc: Format return defaultEchartsOptions.getYAxis({ ...rest, type: 'category', - data: yData, axisLabel: { rotate, ...overflowOption, diff --git a/dashboard/src/components/plugins/viz-components/merico-heatmap/render/option/index.ts b/dashboard/src/components/plugins/viz-components/merico-heatmap/render/option/index.ts index 9a95bd76b..7445706ab 100644 --- a/dashboard/src/components/plugins/viz-components/merico-heatmap/render/option/index.ts +++ b/dashboard/src/components/plugins/viz-components/merico-heatmap/render/option/index.ts @@ -30,7 +30,6 @@ export function getOption(conf: TMericoHeatmapConf, data: TPanelData, variables: const y = parseDataKey(conf.y_axis.data_key); const h = parseDataKey(conf.heat_block.data_key); const xData = _.uniq(data[x.queryID].map((d) => d[x.columnKey])); - const yData = _.uniq(data[x.queryID].map((d) => d[y.columnKey])); const seriesData = data[x.queryID].map((d) => { const vx = _.get(d, x.columnKey); const vy = _.get(d, y.columnKey); @@ -51,7 +50,7 @@ export function getOption(conf: TMericoHeatmapConf, data: TPanelData, variables: const options = { xAxis: getXAxis(conf, xData, labelFormatters.x_axis), - yAxis: getYAxis(conf, yData, labelFormatters.y_axis), + yAxis: getYAxis(conf, labelFormatters.y_axis), series: getSeries(conf, seriesData), tooltip: getTooltip(conf, data, labelFormatters, valueFormatters), grid: getGrid(conf), diff --git a/dashboard/src/components/plugins/viz-components/merico-heatmap/render/option/y-axis.ts b/dashboard/src/components/plugins/viz-components/merico-heatmap/render/option/y-axis.ts index a38ce5b48..70b8269cb 100644 --- a/dashboard/src/components/plugins/viz-components/merico-heatmap/render/option/y-axis.ts +++ b/dashboard/src/components/plugins/viz-components/merico-heatmap/render/option/y-axis.ts @@ -3,7 +3,7 @@ import { defaultEchartsOptions } from '~/styles/default-echarts-options'; import { getLabelOverflowOptionOnAxis } from '../../../../common-echarts-fields/axis-label-overflow'; import { TMericoHeatmapConf } from '../../type'; -export function getYAxis(conf: TMericoHeatmapConf, yData: any[], formatterFunc: FormatterFuncType) { +export function getYAxis(conf: TMericoHeatmapConf, formatterFunc: FormatterFuncType) { const { nameAlignment, data_key, ...rest } = conf.y_axis; const { overflow, rotate } = conf.y_axis.axisLabel; @@ -11,7 +11,6 @@ export function getYAxis(conf: TMericoHeatmapConf, yData: any[], formatterFunc: return defaultEchartsOptions.getYAxis({ ...rest, type: 'category', - data: yData, axisLabel: { rotate, ...overflowOption, From fa06c41b9b32f584a9094874a225a7d4bd3a0fb3 Mon Sep 17 00:00:00 2001 From: Leto <gerile.tu@merico.dev> Date: Wed, 31 Jul 2024 05:47:02 +0800 Subject: [PATCH 2/2] chore: publish v13.27.15 --- api/package.json | 2 +- dashboard/package.json | 2 +- package.json | 2 +- settings-form/package.json | 2 +- website/package.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/package.json b/api/package.json index adc6c66ed..1b67b7161 100644 --- a/api/package.json +++ b/api/package.json @@ -1,6 +1,6 @@ { "name": "@devtable/api", - "version": "13.27.14", + "version": "13.27.15", "description": "", "main": "index.js", "scripts": { diff --git a/dashboard/package.json b/dashboard/package.json index cad98113b..53a8e964c 100644 --- a/dashboard/package.json +++ b/dashboard/package.json @@ -1,6 +1,6 @@ { "name": "@devtable/dashboard", - "version": "13.27.14", + "version": "13.27.15", "license": "Apache-2.0", "publishConfig": { "access": "public", diff --git a/package.json b/package.json index f279bc9bb..8c081800d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtable/root", - "version": "13.27.14", + "version": "13.27.15", "private": true, "workspaces": [ "api", diff --git a/settings-form/package.json b/settings-form/package.json index 82cf01b91..26c8e2aed 100644 --- a/settings-form/package.json +++ b/settings-form/package.json @@ -1,6 +1,6 @@ { "name": "@devtable/settings-form", - "version": "13.27.14", + "version": "13.27.15", "license": "Apache-2.0", "publishConfig": { "access": "public", diff --git a/website/package.json b/website/package.json index c0f2716d9..4190f19dc 100644 --- a/website/package.json +++ b/website/package.json @@ -2,7 +2,7 @@ "name": "@devtable/website", "private": true, "license": "Apache-2.0", - "version": "13.27.14", + "version": "13.27.15", "scripts": { "dev": "vite", "preview": "vite preview"