Skip to content

Commit f084c20

Browse files
committed
feat(charts): add Score
1 parent ade34ed commit f084c20

File tree

8 files changed

+54
-24
lines changed

8 files changed

+54
-24
lines changed

@sensoro-design/charts/package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
"version": "2.0.0",
44
"description": "Sensoro Design Chart Library.",
55
"license": "MIT",
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/sensoro/sensoro-design-next.git",
9+
"directory": "@sensoro-design/charts"
10+
},
611
"module": "dist/index.js",
712
"types": "dist/index.d.ts",
813
"files": [
@@ -20,6 +25,7 @@
2025
"@ant-design/plots": "^2.2.6",
2126
"@antv/g2": "^5.1.18",
2227
"@antv/util": "^3.3.5",
28+
"@sensoro-design/react": "workspace:*",
2329
"@sensoro-design/styles": "1.27.1",
2430
"antd": "4.23.2",
2531
"clsx": "^2.1.1",
Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,2 @@
1-
import './theme';
2-
3-
export { default as Line } from './Line';
4-
export type { LineConfig } from './Line';
5-
6-
export { default as Area } from './Area';
7-
export type { AreaConfig } from './Area';
8-
export { default as Bar } from './Bar';
9-
export type { BarConfig } from './Bar';
10-
export { default as Column } from './Column';
11-
export type { ColumnConfig } from './Column';
12-
export { default as Funnel } from './Funnel';
13-
export type { FunnelConfig } from './Funnel';
14-
export { default as Gauge } from './Gauge';
15-
export type { GaugeConfig } from './Gauge';
16-
export { default as Pie } from './Pie';
17-
export type { PieConfig } from './Pie';
18-
export { default as Radar } from './Radar';
19-
export type { RadarConfig } from './Radar';
20-
export { default as Rose } from './Rose';
21-
export type { RoseConfig } from './Rose';
22-
export { default as Treemap } from './Treemap';
23-
export type { TreemapConfig } from './Treemap';
1+
export { default as Score } from './score';
2+
export type { ScoreConfig } from './score';
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React from 'react';
2+
import type { ScoreConfig } from './interface';
3+
4+
export function Score(
5+
{
6+
color = 'green',
7+
}: ScoreConfig,
8+
) {
9+
console.log(color);
10+
return null;
11+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { Score } from './Score';
2+
3+
export type { ScoreConfig } from './interface';
4+
export default Score;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import type React from 'react';
2+
3+
export interface ScoreConfig {
4+
/** 额外类名 */
5+
className?: string;
6+
/** 额外样式 */
7+
style?: React.CSSProperties;
8+
/** 图表大小 */
9+
size?: string | number;
10+
/** 图表颜色 */
11+
color?: string;
12+
/** 数值 */
13+
value: number;
14+
/** 数值样式 */
15+
valueStyle?: React.CSSProperties;
16+
/** 单位 */
17+
unit?: string;
18+
/** 单位样式 */
19+
unitStyle?: React.CSSProperties;
20+
/** 阈值和颜色值映射对象 */
21+
thresholds?: Record<string, string>;
22+
}

@sensoro-design/plots/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
"version": "2.0.0",
44
"description": "Sensoro Design G2 Plots.",
55
"license": "MIT",
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/sensoro/sensoro-design-next.git",
9+
"directory": "@sensoro-design/plots"
10+
},
611
"sideEffects": false,
712
"main": "src/index.ts",
813
"files": [

@sensoro-design/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"repository": {
99
"type": "git",
1010
"url": "https://github.com/sensoro/sensoro-design-next.git",
11-
"directory": "packages/@sensoro-design/react"
11+
"directory": "@sensoro-design/react"
1212
},
1313
"keywords": [
1414
"react",

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)