@devtable/dashboard 1.22.0 → 1.26.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.
@@ -1,9 +1,10 @@
1
1
  import { IVizPanelProps } from "../../../types";
2
2
  import { TNumbroFormat } from "../../settings/common/numbro-format-selector";
3
3
  export interface ICartesianChartSeriesItem {
4
- type: 'line' | 'bar';
4
+ type: 'line' | 'bar' | 'scatter';
5
5
  name: string;
6
6
  showSymbol: false;
7
+ symbolSize: number;
7
8
  y_axis_data_key: string;
8
9
  yAxisIndex: number;
9
10
  label_position?: string;
@@ -17,11 +18,31 @@ export interface IYAxisConf {
17
18
  name: string;
18
19
  label_formatter: TNumbroFormat;
19
20
  }
21
+ export interface IRegressionTransform {
22
+ type: 'ecStat:regression';
23
+ config: {
24
+ method: 'linear' | 'exponential' | 'logarithmic' | 'polynomial';
25
+ order: number;
26
+ formulaOn: 'end';
27
+ };
28
+ }
29
+ export interface IRegressionLineConf {
30
+ type: 'line';
31
+ yAxisIndex: number;
32
+ color: string;
33
+ }
34
+ export interface IRegressionConf {
35
+ transform: IRegressionTransform;
36
+ plot: IRegressionLineConf;
37
+ name: string;
38
+ y_axis_data_key: string;
39
+ }
20
40
  export interface ICartesianChartConf {
21
41
  x_axis_data_key: string;
22
42
  x_axis_name: string;
23
43
  y_axes: IYAxisConf[];
24
44
  series: ICartesianChartSeriesItem[];
45
+ regressions: IRegressionConf[];
25
46
  }
26
47
  export interface IVizCartesianChartPanel extends Omit<IVizPanelProps, 'conf' | 'setConf'> {
27
48
  conf: ICartesianChartConf;
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { IRichTextConf } from './type';
3
+ interface IRichText {
4
+ conf: IRichTextConf;
5
+ data: any[];
6
+ width: number;
7
+ height: number;
8
+ }
9
+ export declare function VizRichText({ conf, width, height }: IRichText): JSX.Element | null;
10
+ export {};
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { IVizRichTextPanel } from "./type";
3
+ export declare function VizRichTextPanel({ conf, setConf }: IVizRichTextPanel): JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { IVizPanelProps } from "../../../types";
2
+ export interface IRichTextConf {
3
+ content: '';
4
+ }
5
+ export interface IVizRichTextPanel extends Omit<IVizPanelProps, 'conf' | 'setConf'> {
6
+ conf: IRichTextConf;
7
+ setConf: (values: IRichTextConf) => void;
8
+ }
@@ -6,5 +6,5 @@ interface IVizStats {
6
6
  width: number;
7
7
  height: number;
8
8
  }
9
- export declare function VizStats({ conf: { content, size, color, ...rest }, data }: IVizStats): JSX.Element;
9
+ export declare function VizStats({ conf: { template, variables, align }, data }: IVizStats): JSX.Element;
10
10
  export {};
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { Control, UseFieldArrayRemove } from "react-hook-form";
3
+ import { IVizStatsConf } from "../types";
4
+ interface VariableField {
5
+ control: Control<IVizStatsConf, any>;
6
+ index: number;
7
+ remove: UseFieldArrayRemove;
8
+ data: any[];
9
+ }
10
+ export declare function VariableField({ control, index, remove, data }: VariableField): JSX.Element;
11
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare type AggregationType = 'none' | 'sum' | 'mean' | 'median' | 'max' | 'min';
2
+ export declare function aggregateValue(data: Record<string, number>[], data_field: string, aggregation: AggregationType): number;
@@ -1,4 +1,4 @@
1
- interface InterpolateColorOption {
1
+ export interface InterpolateColorOption {
2
2
  valueRange: number[];
3
3
  colorRange: string[];
4
4
  }
@@ -7,4 +7,3 @@ export declare class InterpolateColor {
7
7
  constructor({ valueRange, colorRange }: InterpolateColorOption);
8
8
  getColor(value: number): string;
9
9
  }
10
- export {};
@@ -0,0 +1,16 @@
1
+ import { TextInputProps } from "@mantine/core";
2
+ import React, { ChangeEventHandler } from "react";
3
+ import { ITemplateVariable } from "./types";
4
+ export declare function getANewVariable(): ITemplateVariable;
5
+ interface ITemplateInput extends Omit<TextInputProps, 'value' | 'onChange'> {
6
+ value: string;
7
+ onChange: ChangeEventHandler<HTMLInputElement>;
8
+ }
9
+ export declare const TemplateInput: React.ForwardRefExoticComponent<ITemplateInput & React.RefAttributes<unknown>>;
10
+ interface ITemplateVariableField {
11
+ value: ITemplateVariable;
12
+ onChange: (v: ITemplateVariable) => void;
13
+ data: any[];
14
+ }
15
+ export declare function TemplateVariableField({ value, onChange, data }: ITemplateVariableField): JSX.Element;
16
+ export {};
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { ITemplateVariable } from "./types";
3
+ export declare function templateToJSX(template: string, variables: ITemplateVariable[], data: Record<string, number>[]): (JSX.Element | import("react").ReactNode[])[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtable/dashboard",
3
- "version": "1.22.0",
3
+ "version": "1.26.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org/"
@@ -30,13 +30,13 @@
30
30
  "popmotion": "^11.0.3"
31
31
  },
32
32
  "devDependencies": {
33
- "@mantine/core": "^4.2.5",
34
- "@mantine/dates": "^4.2.5",
35
- "@mantine/form": "^4.2.5",
36
- "@mantine/hooks": "^4.2.5",
37
- "@mantine/notifications": "^4.2.5",
38
- "@mantine/prism": "^4.2.5",
39
- "@mantine/rte": "^4.2.5",
33
+ "@mantine/core": "^4.2.12",
34
+ "@mantine/dates": "^4.2.12",
35
+ "@mantine/form": "^4.2.12",
36
+ "@mantine/hooks": "^4.2.12",
37
+ "@mantine/notifications": "^4.2.12",
38
+ "@mantine/prism": "^4.2.12",
39
+ "@mantine/rte": "^4.2.12",
40
40
  "@types/lodash": "^4.14.182",
41
41
  "@types/react": "^18.0.0",
42
42
  "@types/react-dom": "^18.0.0",
@@ -58,13 +58,13 @@
58
58
  "vite-plugin-dts": "^1.1.1"
59
59
  },
60
60
  "peerDependencies": {
61
- "@mantine/core": "^4.2.5",
62
- "@mantine/dates": "^4.2.5",
63
- "@mantine/form": "^4.2.5",
64
- "@mantine/hooks": "^4.2.5",
65
- "@mantine/notifications": "^4.2.5",
66
- "@mantine/prism": "^4.2.5",
67
- "@mantine/rte": "^4.2.5",
61
+ "@mantine/core": "^4.2.12",
62
+ "@mantine/dates": "^4.2.12",
63
+ "@mantine/form": "^4.2.12",
64
+ "@mantine/hooks": "^4.2.12",
65
+ "@mantine/notifications": "^4.2.12",
66
+ "@mantine/prism": "^4.2.12",
67
+ "@mantine/rte": "^4.2.12",
68
68
  "ahooks": "^3.3.11",
69
69
  "axios": "^0.27.2",
70
70
  "echarts": "^5.3.2",
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import { IVizPanelProps } from "../../../types/viz-panel";
3
- export declare function VizStatsPanel({ conf, setConf, data }: IVizPanelProps): JSX.Element;