mirror of
https://github.com/apache/superset.git
synced 2026-05-09 18:05:52 +00:00
fix treemap
This commit is contained in:
@@ -45,7 +45,6 @@ import {
|
||||
GAP_WIDTH,
|
||||
LABEL_FONTSIZE,
|
||||
extractTreePathInfo,
|
||||
BORDER_COLOR,
|
||||
} from './constants';
|
||||
import { OpacityEnum } from '../constants';
|
||||
import { getDefaultTooltip } from '../utils/tooltip';
|
||||
@@ -124,6 +123,7 @@ export default function transformProps(
|
||||
const { columnFormats = {}, currencyFormats = {} } = datasource;
|
||||
const { setDataMask = () => {}, onContextMenu } = hooks;
|
||||
const coltypeMapping = getColtypesMapping(queriesData[0]);
|
||||
const BORDER_COLOR = theme.colorBgBase;
|
||||
|
||||
const {
|
||||
colorScheme,
|
||||
|
||||
@@ -26,9 +26,7 @@ import {
|
||||
useCallback,
|
||||
Ref,
|
||||
} from 'react';
|
||||
import merge from 'lodash/merge';
|
||||
|
||||
import * as echarts from 'echarts';
|
||||
import { merge } from 'lodash';
|
||||
|
||||
import { styled, themeObject } from '@superset-ui/core';
|
||||
import { use, init, EChartsType } from 'echarts/core';
|
||||
@@ -98,7 +96,7 @@ use([
|
||||
LabelLayout,
|
||||
]);
|
||||
|
||||
const getTheme = options => {
|
||||
const getTheme = (options: any) => {
|
||||
const token = themeObject.theme;
|
||||
const theme = {
|
||||
textStyle: {
|
||||
@@ -120,18 +118,7 @@ const getTheme = options => {
|
||||
lineStyle: { color: token.colorPrimary },
|
||||
label: { color: token.colorText },
|
||||
},
|
||||
xAxis: {
|
||||
axisLine: { lineStyle: { color: token.colorSplit } },
|
||||
axisLabel: { color: token.colorTextSecondary },
|
||||
splitLine: { lineStyle: { color: token.colorSplit } },
|
||||
},
|
||||
yAxis: {
|
||||
axisLine: { lineStyle: { color: token.colorSplit } },
|
||||
axisLabel: { color: token.colorTextSecondary },
|
||||
splitLine: { lineStyle: { color: token.colorSplit } },
|
||||
},
|
||||
};
|
||||
/*
|
||||
} as any;
|
||||
if (options?.xAxis) {
|
||||
theme.xAxis = {
|
||||
axisLine: { lineStyle: { color: token.colorSplit } },
|
||||
@@ -145,7 +132,7 @@ const getTheme = options => {
|
||||
axisLabel: { color: token.colorTextSecondary },
|
||||
splitLine: { lineStyle: { color: token.colorSplit } },
|
||||
};
|
||||
} */
|
||||
}
|
||||
return theme;
|
||||
};
|
||||
|
||||
@@ -192,12 +179,12 @@ function Echart(
|
||||
chartRef.current?.getZr().off(name);
|
||||
chartRef.current?.getZr().on(name, handler);
|
||||
});
|
||||
/*
|
||||
const themedEchartOptions = merge({}, getTheme(echartOptions), echartOptions);
|
||||
*/
|
||||
chartRef.current.setTheme(getTheme(echartOptions));
|
||||
chartRef.current.setOption(echartOptions, true);
|
||||
chartRef.current.setTheme(getTheme(echartOptions));
|
||||
const themedEchartOptions = merge(
|
||||
{},
|
||||
getTheme(echartOptions),
|
||||
echartOptions,
|
||||
);
|
||||
chartRef.current.setOption(themedEchartOptions, true);
|
||||
}, [echartOptions, eventHandlers, zrEventHandlers]);
|
||||
|
||||
// highlighting
|
||||
|
||||
Reference in New Issue
Block a user