@devtable/dashboard 7.18.0 → 7.19.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.
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { Control, UseFormWatch } from 'react-hook-form';
3
+ import { ISunburstConf } from '../type';
4
+ interface IDataField {
5
+ control: Control<ISunburstConf, $TSFixMe>;
6
+ watch: UseFormWatch<ISunburstConf>;
7
+ data: $TSFixMe[];
8
+ }
9
+ export declare function DataField({ data, control, watch }: IDataField): JSX.Element;
10
+ export {};
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { Control, UseFormWatch } from 'react-hook-form';
3
+ import { ISunburstConf } from '../../type';
4
+ interface ILevelsField {
5
+ control: Control<ISunburstConf, $TSFixMe>;
6
+ watch: UseFormWatch<ISunburstConf>;
7
+ data: $TSFixMe[];
8
+ }
9
+ export declare const LevelsField: ({ control, watch, data }: ILevelsField) => JSX.Element;
10
+ export {};
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { Control } from 'react-hook-form';
3
+ import { ISunburstConf } from '../../type';
4
+ interface ILevelField {
5
+ control: Control<ISunburstConf, $TSFixMe>;
6
+ data: $TSFixMe[];
7
+ index: number;
8
+ remove: (index: number) => void;
9
+ }
10
+ export declare const LevelField: ({ control, data, index, remove }: ILevelField) => JSX.Element;
11
+ export {};
@@ -0,0 +1,2 @@
1
+ import { TreeItemIn, TreeItemOut } from './types';
2
+ export declare function arrayToTree(nodes: TreeItemIn[]): TreeItemOut[];
@@ -0,0 +1,4 @@
1
+ import { AnyObject } from '~/types';
2
+ import { ISunburstConf } from '../type';
3
+ import { TreeItemIn } from './types';
4
+ export declare function buildSunburstData(conf: ISunburstConf, data: AnyObject[]): TreeItemIn[];
@@ -0,0 +1,3 @@
1
+ import { ITemplateVariable } from '~/utils/template';
2
+ import { ISunburstConf } from '../type';
3
+ export declare function getOption(conf: ISunburstConf, data: $TSFixMe[], variables: ITemplateVariable[]): any;
@@ -0,0 +1,14 @@
1
+ import { ISunburstConf } from '../type';
2
+ import { IEchartsSunburstLabelFormatter } from './types';
3
+ export declare function getLevels(conf: ISunburstConf): {
4
+ label: {
5
+ formatter: ({ treePathInfo, name, value }: IEchartsSunburstLabelFormatter) => string | undefined;
6
+ rotate: "0" | "radial" | "tangential";
7
+ align: "left" | "right" | "center";
8
+ position: import("../type").TEchartsLabelPosition;
9
+ padding: number;
10
+ };
11
+ id: string;
12
+ r0: string;
13
+ r: string;
14
+ }[];
@@ -0,0 +1,7 @@
1
+ import { IEchartsSunburstLabelFormatter } from './types';
2
+ export declare function getTooltip(): {
3
+ show: boolean;
4
+ trigger: string;
5
+ confine: boolean;
6
+ formatter: ({ treePathInfo, name, value, color, marker, ...rest }: IEchartsSunburstLabelFormatter) => string;
7
+ };
@@ -0,0 +1,19 @@
1
+ import { SunburstItemType } from '../type';
2
+ export declare type TreeItemIn = {
3
+ id: string;
4
+ parent_id: string | null;
5
+ } & SunburstItemType;
6
+ export declare type TreeItemOut = TreeItemIn & {
7
+ children: TreeItemOut[];
8
+ };
9
+ export interface IEchartsSunburstLabelFormatter {
10
+ treePathInfo: {
11
+ name: string;
12
+ dataIndex: number;
13
+ value: number;
14
+ }[];
15
+ name: string;
16
+ value: number;
17
+ marker: string;
18
+ color: string;
19
+ }
@@ -1,5 +1,24 @@
1
+ export declare type TEchartsLabelPosition = 'top' | 'left' | 'right' | 'bottom' | 'inside' | 'insideLeft' | 'insideRight' | 'insideTop' | 'insideBottom' | 'insideTopLeft' | 'insideBottomLeft' | 'insideTopRight' | 'insideBottomRight';
2
+ export interface ISunburstLevelConf {
3
+ id: string;
4
+ r0: string;
5
+ r: string;
6
+ label: {
7
+ show_label_tolerance: number;
8
+ rotate: 'radial' | 'tangential' | '0';
9
+ align: 'left' | 'center' | 'right';
10
+ position: TEchartsLabelPosition;
11
+ padding: number;
12
+ };
13
+ }
1
14
  export interface ISunburstConf {
2
- label_field: string;
3
- value_field: string;
15
+ label_key: string;
16
+ value_key: string;
17
+ group_key: string;
18
+ levels: ISunburstLevelConf[];
4
19
  }
5
20
  export declare const DEFAULT_CONFIG: ISunburstConf;
21
+ export declare type SunburstItemType = {
22
+ name: string;
23
+ value?: string | number | null;
24
+ } & Record<string, any>;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { VizConfigProps } from '~/types/plugin';
3
+ export declare function VizSunburstEditor({ context }: VizConfigProps): JSX.Element;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import { VizViewProps } from '~/types/plugin';
3
- export declare function VizSunburst({ context }: VizViewProps): JSX.Element;
3
+ export declare function VizSunburst({ context }: VizViewProps): JSX.Element | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtable/dashboard",
3
- "version": "7.18.0",
3
+ "version": "7.19.0",
4
4
  "license": "Apache-2.0",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import { VizConfigProps } from '~/types/plugin';
3
- export declare function VizSunburstPanel({ context }: VizConfigProps): JSX.Element;