@next-bricks/data-view 1.6.2 → 1.8.0

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.
Files changed (60) hide show
  1. package/dist/bricks.json +16 -12
  2. package/dist/chunks/3035.c14dd436.js +2 -0
  3. package/dist/chunks/3035.c14dd436.js.map +1 -0
  4. package/dist/chunks/{3910.4e6c75b8.js → 5214.6fb670ee.js} +2 -2
  5. package/dist/chunks/5214.6fb670ee.js.map +1 -0
  6. package/dist/chunks/bubbles-indicator.9c56af44.js +2 -0
  7. package/dist/chunks/bubbles-indicator.9c56af44.js.map +1 -0
  8. package/dist/chunks/china-map-chart.d1e8b843.js +2 -0
  9. package/dist/chunks/china-map-chart.d1e8b843.js.map +1 -0
  10. package/dist/chunks/crystal-ball-indicator.67278de8.js +2 -0
  11. package/dist/chunks/crystal-ball-indicator.67278de8.js.map +1 -0
  12. package/dist/chunks/globe-with-gear-indicator.a35ef0d2.js +2 -0
  13. package/dist/chunks/globe-with-gear-indicator.a35ef0d2.js.map +1 -0
  14. package/dist/chunks/globe-with-halo-indicator.ed913008.js +2 -0
  15. package/dist/chunks/globe-with-halo-indicator.ed913008.js.map +1 -0
  16. package/dist/chunks/globe-with-orbit-indicator.14c59388.js +2 -0
  17. package/dist/chunks/globe-with-orbit-indicator.14c59388.js.map +1 -0
  18. package/dist/chunks/{main.f5a25c33.js → main.f2f04361.js} +2 -2
  19. package/dist/chunks/{main.f5a25c33.js.map → main.f2f04361.js.map} +1 -1
  20. package/dist/examples.json +21 -18
  21. package/dist/images/15af7907.png +0 -0
  22. package/dist/images/43f65465.png +0 -0
  23. package/dist/images/7ddba157.png +0 -0
  24. package/dist/images/923db8f8.png +0 -0
  25. package/dist/images/eae6fa62.png +0 -0
  26. package/dist/index.1906baf6.js +2 -0
  27. package/dist/index.1906baf6.js.map +1 -0
  28. package/dist/manifest.json +193 -154
  29. package/dist/media/8023ccd1.mp4 +0 -0
  30. package/dist/types.json +827 -688
  31. package/dist-types/bootstrap.d.ts +1 -0
  32. package/dist-types/bubbles-indicator/index.d.ts +4 -0
  33. package/dist-types/china-map-chart/index.d.ts +9 -1
  34. package/dist-types/globe-with-halo-indicator/RotatingArc.d.ts +7 -1
  35. package/dist-types/globe-with-orbit-indicator/index.d.ts +46 -0
  36. package/dist-types/globe-with-orbit-indicator/index.spec.d.ts +1 -0
  37. package/dist-types/shared/CornerIndicator.d.ts +10 -0
  38. package/dist-types/shared/formatValue.d.ts +9 -0
  39. package/dist-types/shared/useCenterScale.d.ts +4 -0
  40. package/dist-types/shared/useContainerScale.d.ts +11 -0
  41. package/docs/china-map-chart.md +31 -2
  42. package/docs/globe-with-orbit-indicator.md +44 -0
  43. package/package.json +2 -2
  44. package/dist/chunks/2938.1d24bf3a.js +0 -2
  45. package/dist/chunks/2938.1d24bf3a.js.map +0 -1
  46. package/dist/chunks/3910.4e6c75b8.js.map +0 -1
  47. package/dist/chunks/bubbles-indicator.0568641b.js +0 -2
  48. package/dist/chunks/bubbles-indicator.0568641b.js.map +0 -1
  49. package/dist/chunks/china-map-chart.eb43bf10.js +0 -2
  50. package/dist/chunks/china-map-chart.eb43bf10.js.map +0 -1
  51. package/dist/chunks/crystal-ball-indicator.d8cd86a8.js +0 -2
  52. package/dist/chunks/crystal-ball-indicator.d8cd86a8.js.map +0 -1
  53. package/dist/chunks/globe-with-gear-indicator.25c9901b.js +0 -2
  54. package/dist/chunks/globe-with-gear-indicator.25c9901b.js.map +0 -1
  55. package/dist/chunks/globe-with-halo-indicator.5491f30c.js +0 -2
  56. package/dist/chunks/globe-with-halo-indicator.5491f30c.js.map +0 -1
  57. package/dist/images/0fec7781.png +0 -0
  58. package/dist/images/698229b4.png +0 -0
  59. package/dist/index.e4bffdda.js +0 -2
  60. package/dist/index.e4bffdda.js.map +0 -1
@@ -43,3 +43,4 @@ import "./crystal-ball-indicator/index.js";
43
43
  import "./globe-with-halo-indicator/index.js";
44
44
  import "./globe-with-gear-indicator/index.js";
45
45
  import "./bubbles-indicator/index.js";
46
+ import "./globe-with-orbit-indicator/index.js";
@@ -12,6 +12,10 @@ export interface BubblesIndicatorProps {
12
12
  export interface DataItem {
13
13
  label: string;
14
14
  value: string | number;
15
+ /**
16
+ * 用于计算气泡相对大小的数值。
17
+ */
18
+ numberValue?: number;
15
19
  }
16
20
  export interface CornerDataItem extends DataItem {
17
21
  color?: string;
@@ -11,9 +11,15 @@ export declare class ChinaMapChart extends ReactNextElement {
11
11
  */
12
12
  accessor dataSource: DataSource[] | undefined;
13
13
  /**
14
- * 数据源
14
+ * 描述内容样式
15
15
  */
16
16
  accessor detailContentStyle: CSSProperties | undefined;
17
+ /**
18
+ * 是否铺满容器
19
+ *
20
+ * 注意:该属性不同时兼容 detail 插槽
21
+ */
22
+ accessor fillContainer: boolean;
17
23
  render(): React.JSX.Element;
18
24
  }
19
25
  interface DataSource {
@@ -24,9 +30,11 @@ interface DataSource {
24
30
  [x: string]: any;
25
31
  }
26
32
  export interface ChinaMapChartProps {
33
+ root: HTMLElement;
27
34
  onDetailOpenChange: (open: boolean, data: Record<string, any>) => void;
28
35
  dataSource: DataSource[];
29
36
  detailContentStyle?: CSSProperties;
37
+ fillContainer?: boolean;
30
38
  }
31
39
  export declare function ChinaMapChartComponent(props: ChinaMapChartProps): React.JSX.Element;
32
40
  export {};
@@ -1,2 +1,8 @@
1
1
  import React from "react";
2
- export declare function RotatingArc(): React.JSX.Element;
2
+ export interface RotatingArcProps {
3
+ cx: number;
4
+ cy: number;
5
+ rx: number;
6
+ ry: number;
7
+ }
8
+ export declare function RotatingArc({ cx, cy, rx, ry }: RotatingArcProps): React.JSX.Element;
@@ -0,0 +1,46 @@
1
+ import React from "react";
2
+ import { ReactNextElement } from "@next-core/react-element";
3
+ import "@next-core/theme";
4
+ import "../fonts/ALiBaBaPuHuiTi.css";
5
+ import "../fonts/HarmonyOSSans.css";
6
+ export interface GlobeWithOrbitIndicatorProps {
7
+ dataSource?: DataItem[];
8
+ centerDataSource?: DataItem;
9
+ cornerDataSource?: CornerDataItem[];
10
+ maxScale?: number;
11
+ }
12
+ export interface DataItem {
13
+ label: string;
14
+ value: string | number;
15
+ }
16
+ export interface CornerDataItem extends DataItem {
17
+ color?: string;
18
+ }
19
+ /**
20
+ * 地球加轨道的数据展示构件。
21
+ */
22
+ export declare class GlobeWithOrbitIndicator extends ReactNextElement implements GlobeWithOrbitIndicatorProps {
23
+ /**
24
+ * 指标数据列表(显示在轨道上)
25
+ *
26
+ * 注意:最多显示8项数据
27
+ */
28
+ accessor dataSource: DataItem[] | undefined;
29
+ /** 中心数据(显示在中心地球内) */
30
+ accessor centerDataSource: DataItem | undefined;
31
+ /**
32
+ * 左上角指标数据列表
33
+ */
34
+ accessor cornerDataSource: CornerDataItem[] | undefined;
35
+ /**
36
+ * 最大缩放比例
37
+ *
38
+ * @default 1
39
+ */
40
+ accessor maxScale: number | undefined;
41
+ render(): React.JSX.Element;
42
+ }
43
+ export interface GlobeWithOrbitIndicatorComponentProps extends GlobeWithOrbitIndicatorProps {
44
+ root: GlobeWithOrbitIndicator;
45
+ }
46
+ export declare function GlobeWithOrbitIndicatorComponent({ root, dataSource, centerDataSource, cornerDataSource, maxScale, }: GlobeWithOrbitIndicatorComponentProps): React.JSX.Element;
@@ -0,0 +1 @@
1
+ import "./";
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ export interface CornerDataItem {
3
+ label: string;
4
+ value: string | number;
5
+ color?: string;
6
+ }
7
+ export interface CornerIndicatorProps {
8
+ cornerDataSource?: CornerDataItem[];
9
+ }
10
+ export declare function CornerIndicator({ cornerDataSource }: CornerIndicatorProps): React.JSX.Element;
@@ -0,0 +1,9 @@
1
+ export declare function formatValue(value: string | number): string;
2
+ /**
3
+ * 判断一个值是否是有意义的数字,包括数字和可以转换为数字的字符串。
4
+ *
5
+ * 但不包括 NaN、Infinity、-Infinity 等。
6
+ *
7
+ * Ref https://github.com/jonschlinkert/is-number/blob/master/index.js
8
+ */
9
+ export declare function isMeaningfulNumber(value: unknown): value is number | string;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * 让中心数据值不要超过球体范围,但缩放值最低不小于 0.3
3
+ */
4
+ export declare function useCenterScale(maxWidth: number): readonly [number, import("react").MutableRefObject<HTMLDivElement>];
@@ -0,0 +1,11 @@
1
+ /**
2
+ * 根据容器尺寸进行缩放
3
+ */
4
+ export declare function useContainerScale({ width: baseWidth, height: baseHeight, root, maxScale, disabled, }: {
5
+ width: number;
6
+ height: number;
7
+ root: HTMLElement;
8
+ /** 最大缩放比例,默认为 1 */
9
+ maxScale?: number;
10
+ disabled?: boolean;
11
+ }): number | null;
@@ -4,7 +4,7 @@
4
4
 
5
5
  ### Basic
6
6
 
7
- ```yaml preview
7
+ ```yaml preview height="600px"
8
8
  brick: data-view.china-map-chart
9
9
  properties:
10
10
  dataSource:
@@ -24,9 +24,38 @@ lifeCycle:
24
24
  - dark-v2
25
25
  ```
26
26
 
27
+ ### Fill container
28
+
29
+ ```yaml preview height="600px"
30
+ brick: div
31
+ properties:
32
+ style:
33
+ height: calc(100vh - 4em)
34
+ position: relative
35
+ children:
36
+ - brick: data-view.china-map-chart
37
+ properties:
38
+ fillContainer: true
39
+ dataSource:
40
+ - text: "西藏 12311"
41
+ city: 西藏
42
+ - text: "四川 89781169"
43
+ city: 四川
44
+ - text: "台湾 234181"
45
+ city: 台湾
46
+ - text: "江西 21348"
47
+ city: 江西
48
+ # Currently this brick only looks well within dark theme
49
+ lifeCycle:
50
+ onPageLoad:
51
+ action: theme.setTheme
52
+ args:
53
+ - dark-v2
54
+ ```
55
+
27
56
  ### With detail
28
57
 
29
- ```yaml preview
58
+ ```yaml preview height="600px"
30
59
  brick: data-view.china-map-chart
31
60
  properties:
32
61
  detailContentStyle:
@@ -0,0 +1,44 @@
1
+ 地球加轨道的数据展示构件。
2
+
3
+ ## Examples
4
+
5
+ ### Basic
6
+
7
+ ```yaml preview height="660px"
8
+ brick: div
9
+ properties:
10
+ style:
11
+ height: calc(100vh - 2em)
12
+ children:
13
+ - brick: data-view.globe-with-orbit-indicator
14
+ properties:
15
+ centerDataSource:
16
+ label: 资产总数
17
+ value: 30123
18
+ dataSource:
19
+ - label: 低值易耗品
20
+ value: 3889
21
+ - label: 摊销资产
22
+ value: 2087
23
+ - label: 固定资产
24
+ value: 12088
25
+ - label: 无形资产
26
+ value: 1082
27
+ - label: 在建工程
28
+ value: 10997
29
+ - label: 其他资产
30
+ value: 4203
31
+ cornerDataSource:
32
+ - label: 资产增长
33
+ value: 43
34
+ color: red
35
+ - label: 资产减少
36
+ value: 21
37
+ color: green
38
+ # Currently this brick only works within dark theme
39
+ lifeCycle:
40
+ onPageLoad:
41
+ action: theme.setTheme
42
+ args:
43
+ - dark-v2
44
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-bricks/data-view",
3
- "version": "1.6.2",
3
+ "version": "1.8.0",
4
4
  "homepage": "https://github.com/easyops-cn/next-bricks/tree/master/bricks/data-view",
5
5
  "repository": {
6
6
  "type": "git",
@@ -41,5 +41,5 @@
41
41
  "peerDependencies": {
42
42
  "@next-bricks/icons": "*"
43
43
  },
44
- "gitHead": "c355d4b25eff9c0f3168a306e9dae6ae1384b88a"
44
+ "gitHead": "6f101f9a1838aeae7c794b53e5403f74f297ddef"
45
45
  }