Skip to content

Commit

Permalink
Merge pull request #1489 from merico-dev/1488-heatmaps-showing-wrong-…
Browse files Browse the repository at this point in the history
…yaxis-when-its-all-ticks-are-number

1488 heatmaps showing wrong yaxis when its all ticks are number
  • Loading branch information
GerilLeto authored Jul 31, 2024
2 parents 50d6cc8 + fa06c41 commit 50f0dec
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devtable/api",
"version": "13.27.14",
"version": "13.27.15",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion dashboard/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devtable/dashboard",
"version": "13.27.14",
"version": "13.27.15",
"license": "Apache-2.0",
"publishConfig": {
"access": "public",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ 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;
const overflowOption = getLabelOverflowOptionOnAxis(overflow.on_axis);
return defaultEchartsOptions.getYAxis({
...rest,
type: 'category',
data: yData,
axisLabel: {
rotate,
...overflowOption,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ 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;
const overflowOption = getLabelOverflowOptionOnAxis(overflow.on_axis);
return defaultEchartsOptions.getYAxis({
...rest,
type: 'category',
data: yData,
axisLabel: {
rotate,
...overflowOption,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devtable/root",
"version": "13.27.14",
"version": "13.27.15",
"private": true,
"workspaces": [
"api",
Expand Down
2 changes: 1 addition & 1 deletion settings-form/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devtable/settings-form",
"version": "13.27.14",
"version": "13.27.15",
"license": "Apache-2.0",
"publishConfig": {
"access": "public",
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 50f0dec

Please sign in to comment.