Skip to content

Commit 92de90a

Browse files
committed
fix(react-components): minor anomaly widget style changes
1 parent db44919 commit 92de90a

File tree

6 files changed

+12
-3
lines changed

6 files changed

+12
-3
lines changed

packages/react-components/src/components/anomaly-chart/constants.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
2+
13
import {
24
colorBackgroundContainerContent,
35
colorBorderControlDefault,
@@ -89,8 +91,14 @@ export const ANOMALY_TOOLTIP = {
8991
// These only work because the tooltip is rendered as html
9092
borderColor: colorBorderControlDefault,
9193
backgroundColor: colorBackgroundContainerContent,
92-
position: (point: [number, number]) => {
93-
return [point[0] + 20, '0%'];
94+
position: (
95+
point: [number, number],
96+
_params: any,
97+
_dom: any,
98+
_rect: any,
99+
size: { viewSize: [number, number]; contentSize: [number, number] }
100+
) => {
101+
return [point[0] + 20, size.viewSize[1] / 2 - 40 - size.contentSize[1] / 2];
94102
},
95103
};
96104

packages/react-components/src/echarts/unboundedZoom/constants.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const DEFAULT_X_AXIS: XAXisComponentOption = {
5151
nameLocation: 'middle',
5252
nameTextStyle: {
5353
fontWeight: 'bold',
54-
padding: [24, 0, 0, 0],
54+
padding: [20, 0, 0, 0],
5555
},
5656
// hardcoding the x axis so that all viewport logic is managed exclusively by useDataZoom hooks
5757
min: 0,
@@ -61,6 +61,7 @@ export const DEFAULT_X_AXIS: XAXisComponentOption = {
6161
export const DEFAULT_TOOLBOX_GESTURES_ENABLED: ToolboxComponentOption = {
6262
show: true,
6363
top: 4,
64+
itemGap: 12,
6465
right: 8,
6566
feature: {
6667
dataZoom: {

0 commit comments

Comments
 (0)