Browse Source

fix(echarts): Remove type casting from MapSeries (#31130)

Scott Cooper 3 years ago
parent
commit
8a0411856c

+ 1 - 1
static/app/chartcuterie/discover.tsx

@@ -427,7 +427,7 @@ discoverCharts.push({
       itemStyle: {
         areaColor: theme.gray200,
         borderColor: theme.backgroundSecondary,
-      } as any, // TODO(ts): Echarts types aren't correct for these colors as they don't allow for basic strings
+      },
     });
 
     // For absolute values, we want min/max to based on min/max of series

+ 5 - 4
static/app/components/charts/series/mapSeries.tsx

@@ -5,10 +5,11 @@ import type {MapSeriesOption} from 'echarts';
 export default function MapSeries(props: MapSeriesOption = {map: ''}): MapSeriesOption {
   return {
     roam: true,
-    itemStyle: {
-      emphasis: {label: {show: false}},
-    },
     ...props,
+    emphasis: {
+      label: {show: false},
+      ...props.emphasis,
+    },
     type: 'map',
-  } as MapSeriesOption;
+  };
 }