@easy-editor/materials-dashboard-gauge-chart 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/component.min.js +2 -3
- package/dist/index.min.js +2 -3
- package/dist/meta.min.js +1 -2
- package/easypack.config.ts +10 -0
- package/package.json +4 -8
- package/src/component.tsx +225 -180
- package/src/configure.ts +140 -285
- package/src/index.tsx +7 -7
- package/src/meta.ts +23 -23
- package/src/snippets.ts +69 -55
- package/tsconfig.json +20 -9
- package/.vite/plugins/vite-plugin-external-deps.ts +0 -224
- package/.vite/plugins/vite-plugin-material-dev.ts +0 -218
- package/dist/component.esm.js +0 -28857
- package/dist/component.esm.js.map +0 -1
- package/dist/component.js +0 -28864
- package/dist/component.js.map +0 -1
- package/dist/component.min.js.map +0 -1
- package/dist/index.cjs +0 -29174
- package/dist/index.cjs.map +0 -1
- package/dist/index.esm.js +0 -29171
- package/dist/index.esm.js.map +0 -1
- package/dist/index.js +0 -29178
- package/dist/index.js.map +0 -1
- package/dist/index.min.js.map +0 -1
- package/dist/meta.esm.js +0 -319
- package/dist/meta.esm.js.map +0 -1
- package/dist/meta.js +0 -329
- package/dist/meta.js.map +0 -1
- package/dist/meta.min.js.map +0 -1
- package/dist/src/component.d.ts +0 -19
- package/dist/src/configure.d.ts +0 -7
- package/dist/src/constants.d.ts +0 -28
- package/dist/src/index.d.ts +0 -6
- package/dist/src/meta.d.ts +0 -3
- package/dist/src/snippets.d.ts +0 -3
- package/dist/src/types.d.ts +0 -50
- package/dist/src/utils.d.ts +0 -28
- package/rollup.config.js +0 -212
- package/src/types.ts +0 -55
- package/src/utils.ts +0 -57
- package/tsconfig.build.json +0 -12
- package/tsconfig.test.json +0 -7
- package/vite.config.ts +0 -54
package/dist/meta.min.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).EasyEditorMaterialsGaugeChartMeta={})}(this,function(e){"use strict";const t=
|
|
2
|
-
//# sourceMappingURL=meta.min.js.map
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).EasyEditorMaterialsGaugeChartMeta={})}(this,function(e){"use strict";const t=(e,t)=>{const a=Array.isArray(e)?e:[e],r=a[0]||{};return{sourceType:"static",staticData:a,fieldMappings:Object.keys(r).map(e=>({componentField:e,sourceField:e}))}},a=(e,t,a)=>({type:"group",title:e,setter:{componentName:"CollapseSetter",props:{icon:!1,...a}},items:t}),r={name:"nodeInfo",title:"节点信息",setter:"NodeInfoSetter",extraProps:{label:!1}},o=a("基础配置",[{name:"title",title:"标题",setter:"StringSetter",extraProps:{getValue:e=>e.getExtraPropValue("title"),setValue(e,t){e.setExtraPropValue("title",t)}}},{name:"rect",title:"位置尺寸",setter:"RectSetter",extraProps:{getValue:e=>e.getExtraPropValue("$dashboard.rect"),setValue(e,t){e.setExtraPropValue("$dashboard.rect",t)}}},{name:"rotation",title:"旋转角度",setter:{componentName:"SliderSetter",props:{min:0,max:360,suffix:"°"}},extraProps:{defaultValue:0}},{name:"opacity",title:"不透明度",setter:{componentName:"SliderSetter",props:{min:0,max:100,suffix:"%"}},extraProps:{defaultValue:100}},{name:"background",title:"背景颜色",setter:"ColorSetter",extraProps:{defaultValue:"transparent"}}]),l=[{title:"点击事件",children:[{label:"点击",value:"onClick",description:"鼠标点击时触发"},{label:"双击",value:"onDoubleClick",description:"鼠标双击时触发"}]},{title:"鼠标事件",children:[{label:"鼠标进入",value:"onMouseEnter",description:"鼠标进入时触发"},{label:"鼠标离开",value:"onMouseLeave",description:"鼠标离开时触发"}]}],i=((e=l)=>a("事件绑定",[{name:"events",title:"事件",setter:{componentName:"EventSetter",props:{events:e}},extraProps:{label:!1}}]))(),s=a("高级配置",[{title:"条件渲染",setter:"SwitchSetter",extraProps:{supportVariable:!0,getValue:e=>e.getNode().getExtraPropValue("condition"),setValue(e,t){e.getNode().setExtraProp("condition",t)}}}]),n="EasyEditorMaterialsGaugeChart";const p=((e,t)=>({props:[{type:"group",title:"属性",setter:"TabSetter",items:[{type:"group",key:"config",title:"配置",items:[r,o,e]},{type:"group",key:"data",title:"数据",items:[r,t]},{type:"group",key:"advanced",title:"高级",items:[r,i,s]}]}],component:{},supports:{},advanced:{}}))(a("组件配置",[{type:"group",title:"组件配置",setter:"SubTabSetter",items:[{type:"group",key:"value",title:"数值",items:[{name:"min",title:"最小值",setter:"NumberSetter",extraProps:{defaultValue:0}},{name:"max",title:"最大值",setter:"NumberSetter",extraProps:{defaultValue:100}},{name:"unit",title:"单位",setter:"StringSetter"}]},{type:"group",key:"scale",title:"刻度",items:[{name:"showScale",title:"显示刻度",setter:"SwitchSetter",extraProps:{defaultValue:!0}},{name:"divisions",title:"刻度数量",setter:{componentName:"SliderSetter",props:{min:2,max:20,step:1}},extraProps:{defaultValue:10}},{name:"showLabels",title:"显示刻度值",setter:"SwitchSetter",extraProps:{defaultValue:!0}}]},{type:"group",key:"style",title:"样式",items:[{name:"pointerType",title:"指针类型",setter:{componentName:"SegmentedSetter",props:{options:[{label:"针形",value:"needle"},{label:"三角形",value:"triangle"},{label:"矩形",value:"rect"}]}},extraProps:{defaultValue:"needle"}},{name:"pointerColor",title:"指针颜色",setter:"ColorSetter",extraProps:{defaultValue:"#00d4ff"}},{name:"glowEffect",title:"发光效果",setter:"SwitchSetter",extraProps:{defaultValue:!0}}]}]}],{padding:"6px 16px 12px"}),{name:"$data",title:"数据配置",setter:{componentName:"DataSetter",props:{expectedFields:[{name:"value",label:"value",type:"number",required:!0,description:"当前值"}],showPreview:!0,previewLimit:10}},extraProps:{label:!1}});const u={componentName:n,title:"仪表盘",group:"chart",devMode:"proCode",npm:{package:"@easy-editor/materials-dashboard-gauge-chart",version:"0.0.3",globalName:n,componentName:n},snippets:[{title:"仪表盘",screenshot:"",schema:{componentName:n,title:"仪表盘",props:{$data:t({value:65}),min:0,max:100,showScale:!0,divisions:10,showLabels:!0,pointerType:"needle",pointerColor:"#ffffff",rotation:0,opacity:100,background:"transparent"},$dashboard:{rect:{width:220,height:140}}}},{title:"发光仪表盘",screenshot:"",schema:{componentName:n,title:"发光仪表盘",props:{$data:t({value:78}),min:0,max:100,unit:"%",showScale:!0,divisions:10,showLabels:!0,pointerType:"needle",pointerColor:"#00ffff",glowEffect:!0,rotation:0,opacity:100,background:"transparent"},$dashboard:{rect:{width:220,height:140}}}}],configure:p};e.meta=u});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@easy-editor/materials-dashboard-gauge-chart",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Gauge Chart component for EasyEditor dashboard",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -47,20 +47,16 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"echarts": "^5.6.0",
|
|
50
|
-
"@easy-editor/materials-shared": "0.0.
|
|
50
|
+
"@easy-editor/materials-shared": "0.0.1"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
|
-
"dev": "
|
|
53
|
+
"dev": "easypack dev",
|
|
54
54
|
"dev:debug": "vite --port 5006",
|
|
55
55
|
"format": "biome format --write .",
|
|
56
56
|
"lint": "biome check .",
|
|
57
57
|
"build": "npm-run-all -nl build:*",
|
|
58
58
|
"build:clean": "rimraf dist/",
|
|
59
|
-
"build:js": "
|
|
60
|
-
"build:types": "pnpm types",
|
|
61
|
-
"types": "npm-run-all -nl types:*",
|
|
62
|
-
"types:src": "tsc --project tsconfig.build.json",
|
|
63
|
-
"test-types": "tsc --project tsconfig.test.json"
|
|
59
|
+
"build:js": "easypack build"
|
|
64
60
|
},
|
|
65
61
|
"module": "dist/index.esm.js",
|
|
66
62
|
"unpkg": "dist/index.min.js"
|
package/src/component.tsx
CHANGED
|
@@ -1,180 +1,225 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import type
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
show:
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Gauge Chart Component
|
|
3
|
+
* 仪表盘组件 - 支持数据源绑定和事件交互
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { useEffect, useMemo, useRef, type CSSProperties } from 'react'
|
|
7
|
+
import * as echarts from 'echarts/core'
|
|
8
|
+
import { GaugeChart as EChartsGaugeChart } from 'echarts/charts'
|
|
9
|
+
import { TooltipComponent } from 'echarts/components'
|
|
10
|
+
import { CanvasRenderer } from 'echarts/renderers'
|
|
11
|
+
import type { EChartsOption } from 'echarts'
|
|
12
|
+
import { type MaterialComponet, useDataSource } from '@easy-editor/materials-shared'
|
|
13
|
+
import { DEFAULT_RANGES, type GaugeRange } from './constants'
|
|
14
|
+
import styles from './component.module.css'
|
|
15
|
+
|
|
16
|
+
// 按需注册 ECharts 组件
|
|
17
|
+
echarts.use([EChartsGaugeChart, TooltipComponent, CanvasRenderer])
|
|
18
|
+
|
|
19
|
+
export interface GaugeChartProps extends MaterialComponet {
|
|
20
|
+
/** 最小值 */
|
|
21
|
+
min?: number
|
|
22
|
+
/** 最大值 */
|
|
23
|
+
max?: number
|
|
24
|
+
/** 单位 */
|
|
25
|
+
unit?: string
|
|
26
|
+
/** 显示刻度 */
|
|
27
|
+
showScale?: boolean
|
|
28
|
+
/** 刻度数量 */
|
|
29
|
+
divisions?: number
|
|
30
|
+
/** 显示刻度值 */
|
|
31
|
+
showLabels?: boolean
|
|
32
|
+
/** 指针类型 */
|
|
33
|
+
pointerType?: 'needle' | 'triangle' | 'rect'
|
|
34
|
+
/** 指针颜色 */
|
|
35
|
+
pointerColor?: string
|
|
36
|
+
/** 颜色区间 */
|
|
37
|
+
ranges?: GaugeRange[]
|
|
38
|
+
/** 发光效果 */
|
|
39
|
+
glowEffect?: boolean
|
|
40
|
+
/** 点击事件 */
|
|
41
|
+
onClick?: (e: React.MouseEvent) => void
|
|
42
|
+
/** 双击事件 */
|
|
43
|
+
onDoubleClick?: (e: React.MouseEvent) => void
|
|
44
|
+
/** 鼠标进入 */
|
|
45
|
+
onMouseEnter?: (e: React.MouseEvent) => void
|
|
46
|
+
/** 鼠标离开 */
|
|
47
|
+
onMouseLeave?: (e: React.MouseEvent) => void
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const GaugeChart: React.FC<GaugeChartProps> = ({
|
|
51
|
+
ref,
|
|
52
|
+
$data,
|
|
53
|
+
__dataSource,
|
|
54
|
+
min = 0,
|
|
55
|
+
max = 100,
|
|
56
|
+
unit = '',
|
|
57
|
+
showScale = true,
|
|
58
|
+
divisions = 10,
|
|
59
|
+
showLabels = true,
|
|
60
|
+
pointerType = 'needle',
|
|
61
|
+
pointerColor = '#00d4ff',
|
|
62
|
+
ranges = DEFAULT_RANGES,
|
|
63
|
+
glowEffect = true,
|
|
64
|
+
rotation = 0,
|
|
65
|
+
opacity = 100,
|
|
66
|
+
background = 'transparent',
|
|
67
|
+
style: externalStyle,
|
|
68
|
+
onClick,
|
|
69
|
+
onDoubleClick,
|
|
70
|
+
onMouseEnter,
|
|
71
|
+
onMouseLeave,
|
|
72
|
+
}) => {
|
|
73
|
+
const chartRef = useRef<HTMLDivElement>(null)
|
|
74
|
+
const chartInstance = useRef<echarts.ECharts | null>(null)
|
|
75
|
+
|
|
76
|
+
// 解析数据源(单值)
|
|
77
|
+
const dataSource = useDataSource($data, __dataSource)
|
|
78
|
+
const value = useMemo<number>(() => {
|
|
79
|
+
if (dataSource.length > 0 && dataSource[0]?.value !== undefined) {
|
|
80
|
+
return Number(dataSource[0].value)
|
|
81
|
+
}
|
|
82
|
+
return 0
|
|
83
|
+
}, [dataSource])
|
|
84
|
+
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
if (!chartRef.current) {
|
|
87
|
+
return
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
chartInstance.current = echarts.init(chartRef.current)
|
|
91
|
+
|
|
92
|
+
// 构建颜色区间
|
|
93
|
+
const axisLineColors: [number, string][] = ranges.map(range => [(range.to - min) / (max - min), range.color])
|
|
94
|
+
|
|
95
|
+
// 指针宽度根据类型调整
|
|
96
|
+
const pointerWidthMap: Record<string, number> = {
|
|
97
|
+
needle: 4,
|
|
98
|
+
triangle: 8,
|
|
99
|
+
rect: 6,
|
|
100
|
+
}
|
|
101
|
+
const pointerWidth = pointerWidthMap[pointerType] ?? 6
|
|
102
|
+
|
|
103
|
+
const option: EChartsOption = {
|
|
104
|
+
backgroundColor: 'transparent',
|
|
105
|
+
series: [
|
|
106
|
+
{
|
|
107
|
+
type: 'gauge',
|
|
108
|
+
min,
|
|
109
|
+
max,
|
|
110
|
+
startAngle: 180,
|
|
111
|
+
endAngle: 0,
|
|
112
|
+
center: ['50%', '80%'],
|
|
113
|
+
radius: '72%',
|
|
114
|
+
progress: {
|
|
115
|
+
show: false,
|
|
116
|
+
},
|
|
117
|
+
axisLine: {
|
|
118
|
+
lineStyle: {
|
|
119
|
+
width: 16,
|
|
120
|
+
color: axisLineColors,
|
|
121
|
+
shadowColor: glowEffect ? 'rgba(0, 212, 255, 0.3)' : 'transparent',
|
|
122
|
+
shadowBlur: glowEffect ? 10 : 0,
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
axisTick: {
|
|
126
|
+
show: showScale,
|
|
127
|
+
distance: -20,
|
|
128
|
+
length: 4,
|
|
129
|
+
lineStyle: {
|
|
130
|
+
color: '#8899aa',
|
|
131
|
+
width: 1,
|
|
132
|
+
},
|
|
133
|
+
splitNumber: divisions / 5,
|
|
134
|
+
},
|
|
135
|
+
splitLine: {
|
|
136
|
+
show: showScale,
|
|
137
|
+
distance: -24,
|
|
138
|
+
length: 8,
|
|
139
|
+
lineStyle: {
|
|
140
|
+
color: '#8899aa',
|
|
141
|
+
width: 2,
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
axisLabel: {
|
|
145
|
+
show: showLabels,
|
|
146
|
+
distance: -32,
|
|
147
|
+
color: '#8899aa',
|
|
148
|
+
fontSize: 9,
|
|
149
|
+
},
|
|
150
|
+
pointer: {
|
|
151
|
+
show: true,
|
|
152
|
+
length: '55%',
|
|
153
|
+
width: pointerWidth,
|
|
154
|
+
itemStyle: {
|
|
155
|
+
color: pointerColor,
|
|
156
|
+
shadowColor: glowEffect ? pointerColor : 'transparent',
|
|
157
|
+
shadowBlur: glowEffect ? 10 : 0,
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
anchor: {
|
|
161
|
+
show: true,
|
|
162
|
+
size: 10,
|
|
163
|
+
itemStyle: {
|
|
164
|
+
color: pointerColor,
|
|
165
|
+
shadowColor: glowEffect ? pointerColor : 'transparent',
|
|
166
|
+
shadowBlur: glowEffect ? 5 : 0,
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
title: {
|
|
170
|
+
show: true,
|
|
171
|
+
offsetCenter: [0, '20%'],
|
|
172
|
+
color: '#8899aa',
|
|
173
|
+
fontSize: 11,
|
|
174
|
+
},
|
|
175
|
+
detail: {
|
|
176
|
+
valueAnimation: true,
|
|
177
|
+
offsetCenter: [0, '40%'],
|
|
178
|
+
fontSize: 22,
|
|
179
|
+
fontWeight: 'bold',
|
|
180
|
+
color: '#fff',
|
|
181
|
+
formatter: (val: number) => `${val}${unit}`,
|
|
182
|
+
textShadowColor: glowEffect ? 'rgba(0, 212, 255, 0.5)' : 'transparent',
|
|
183
|
+
textShadowBlur: glowEffect ? 10 : 0,
|
|
184
|
+
},
|
|
185
|
+
data: [{ value }],
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
chartInstance.current.setOption(option)
|
|
191
|
+
|
|
192
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
193
|
+
chartInstance.current?.resize()
|
|
194
|
+
})
|
|
195
|
+
resizeObserver.observe(chartRef.current)
|
|
196
|
+
|
|
197
|
+
return () => {
|
|
198
|
+
resizeObserver.disconnect()
|
|
199
|
+
chartInstance.current?.dispose()
|
|
200
|
+
}
|
|
201
|
+
}, [value, min, max, unit, showScale, divisions, showLabels, pointerType, pointerColor, ranges, glowEffect])
|
|
202
|
+
|
|
203
|
+
const containerStyle: CSSProperties = {
|
|
204
|
+
width: '100%',
|
|
205
|
+
height: '100%',
|
|
206
|
+
transform: rotation !== 0 ? `rotate(${rotation}deg)` : undefined,
|
|
207
|
+
opacity: opacity / 100,
|
|
208
|
+
backgroundColor: background,
|
|
209
|
+
...externalStyle,
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
return (
|
|
213
|
+
<div
|
|
214
|
+
className={styles.container}
|
|
215
|
+
onClick={onClick}
|
|
216
|
+
onDoubleClick={onDoubleClick}
|
|
217
|
+
onMouseEnter={onMouseEnter}
|
|
218
|
+
onMouseLeave={onMouseLeave}
|
|
219
|
+
ref={ref}
|
|
220
|
+
style={containerStyle}
|
|
221
|
+
>
|
|
222
|
+
<div className={styles.chart} ref={chartRef} />
|
|
223
|
+
</div>
|
|
224
|
+
)
|
|
225
|
+
}
|