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