This is an automated email from the ASF dual-hosted git repository. maximebeauchemin pushed a commit to branch template_less in repository https://gitbox.apache.org/repos/asf/superset.git
commit 7dbe05f6d8902c8c0efff4e16478302ff0481a36 Author: Maxime Beauchemin <[email protected]> AuthorDate: Tue Mar 18 17:28:59 2025 -0700 fix treemap --- .../src/Treemap/transformProps.ts | 2 +- .../plugin-chart-echarts/src/components/Echart.tsx | 33 +++++++--------------- .../components/gridComponents/Markdown.jsx | 5 +--- 3 files changed, 12 insertions(+), 28 deletions(-) diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Treemap/transformProps.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Treemap/transformProps.ts index 5336f36ba8..f38c229e3f 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Treemap/transformProps.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Treemap/transformProps.ts @@ -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, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx index e1b3eff25a..8dee87d901 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx @@ -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 diff --git a/superset-frontend/src/dashboard/components/gridComponents/Markdown.jsx b/superset-frontend/src/dashboard/components/gridComponents/Markdown.jsx index 2141fa9ec4..78684a7595 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Markdown.jsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Markdown.jsx @@ -88,6 +88,7 @@ const MarkdownStyles = styled.div` ${({ theme }) => css` &.dashboard-markdown { overflow: hidden; + color: ${theme.colorText}; h4, h5, @@ -95,10 +96,6 @@ const MarkdownStyles = styled.div` font-weight: ${theme.fontWeightNormal}; } - h5 { - color: ${theme.colors.grayscale.base}; - } - h6 { font-size: ${theme.fontSizeSM}px; }
