@sme.up/ketchup2 2.9.0 → 2.10.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.
- package/dist/{abnfDiagram-VCTEODGH-DwAVRNNu.js → abnfDiagram-VCTEODGH-jIDWUpNo.js} +3 -3
- package/dist/{architectureDiagram-5GKGNRK7-N1aPr2hw.js → architectureDiagram-5GKGNRK7-C1xA1c3c.js} +5 -5
- package/dist/basic-components/button/button-types.d.ts +2 -2
- package/dist/basic-components/cell/cell-types.d.ts +7 -6
- package/dist/basic-components/cell/cell-types.d.ts.map +1 -1
- package/dist/basic-components/cell/cell-utils.d.ts +10 -4
- package/dist/basic-components/cell/cell-utils.d.ts.map +1 -1
- package/dist/basic-components/cell/cell.d.ts.map +1 -1
- package/dist/basic-components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/basic-components/chips/chips.d.ts.map +1 -1
- package/dist/basic-components/date-picker/date-picker-types.d.ts +2 -2
- package/dist/basic-components/date-picker/date-picker-types.d.ts.map +1 -1
- package/dist/basic-components/file-upload/file-upload-types.d.ts +2 -2
- package/dist/basic-components/file-upload/file-upload-types.d.ts.map +1 -1
- package/dist/basic-components/file-upload/file-upload.d.ts.map +1 -1
- package/dist/basic-components/multiple-autocomplete/multiple-autocomplete.d.ts.map +1 -1
- package/dist/basic-components/multiple-select/multiple-select.d.ts.map +1 -1
- package/dist/basic-components/radio/radio.d.ts.map +1 -1
- package/dist/basic-components/slider/slider.d.ts.map +1 -1
- package/dist/basic-components/text/text-types.d.ts +3 -1
- package/dist/basic-components/text/text-types.d.ts.map +1 -1
- package/dist/basic-components/text/text.d.ts.map +1 -1
- package/dist/basic-components/textarea/textarea.d.ts.map +1 -1
- package/dist/basic-components/textfield/textfield-types.d.ts +3 -3
- package/dist/basic-components/textfield/textfield-types.d.ts.map +1 -1
- package/dist/basic-components/textfield/textfield.d.ts.map +1 -1
- package/dist/basic-components/time-picker/time-picker.d.ts.map +1 -1
- package/dist/{blockDiagram-I7D4REHJ-Cu18ws5-.js → blockDiagram-I7D4REHJ-C0hlmHW8.js} +9 -9
- package/dist/{c4Diagram-7LVT6UL2-B-uBy_NE.js → c4Diagram-7LVT6UL2-DwTMAxzR.js} +7 -7
- package/dist/{channel-CuEby436.js → channel-BD0NTdCR.js} +1 -1
- package/dist/{chunk-2E4U76K2-ComA5SPA.js → chunk-2E4U76K2-CMCSmJ5_.js} +6 -6
- package/dist/{chunk-4HAMMTFA-CZgIgrp_.js → chunk-4HAMMTFA-DBtV-sHy.js} +5 -5
- package/dist/{chunk-75Z2AOVW-Drsj7a97.js → chunk-75Z2AOVW-CLjRECiG.js} +1 -1
- package/dist/{chunk-CLGD4ZFX-CLGio9rD.js → chunk-CLGD4ZFX-DdntjE3C.js} +1 -1
- package/dist/{chunk-DU6HZSFF-waeanndy.js → chunk-DU6HZSFF-D9v_2L4Z.js} +950 -860
- package/dist/{chunk-F27PBJKO-jIrOJO87.js → chunk-F27PBJKO-DPhiW07t.js} +1 -1
- package/dist/{chunk-GMAD6QVW-D80II4AD.js → chunk-GMAD6QVW-Cnp61Cie.js} +3 -3
- package/dist/{chunk-GVQU2GXP-DP3t_9Rl.js → chunk-GVQU2GXP-BJ9OHC7T.js} +2 -2
- package/dist/{chunk-IMKFNOWR-8ItzAAcf.js → chunk-IMKFNOWR-yyUcHorm.js} +5 -5
- package/dist/{chunk-L3NEJ4N5-qPot4t6M.js → chunk-L3NEJ4N5-Dd1FmxFn.js} +5 -5
- package/dist/{chunk-OSK3NFVY-CQhPF3Mc.js → chunk-OSK3NFVY-qg1q5TTI.js} +7 -7
- package/dist/{chunk-P2QGCYS3-BUeNZ170.js → chunk-P2QGCYS3-667SFjNY.js} +1 -1
- package/dist/{chunk-POPQ4Y6H-CU9oz17Z.js → chunk-POPQ4Y6H-YFNrkrJW.js} +1 -1
- package/dist/{chunk-PWAF6VOD-D37VoZ8H.js → chunk-PWAF6VOD-z0rQy52m.js} +1 -1
- package/dist/{chunk-SHT3W25Y-Cri27Jke.js → chunk-SHT3W25Y-aBBFlrSX.js} +7 -7
- package/dist/{chunk-SVP7TREG-CyJlOPau.js → chunk-SVP7TREG-f53BROgh.js} +2 -2
- package/dist/{chunk-TICWLB2K-Cw2iT_VD.js → chunk-TICWLB2K-DzrOz9kL.js} +5 -5
- package/dist/{chunk-TLUHSLCS-BdsLNXjt.js → chunk-TLUHSLCS-Drk6ApJR.js} +8 -8
- package/dist/classDiagram-ZZMXUADV-CaI6YU6r.js +30 -0
- package/dist/classDiagram-v2-VYDZK3BY-ClCVTcLo.js +30 -0
- package/dist/components/app-bar/app-bar.data.d.ts.map +1 -1
- package/dist/components/box-list/box-list.d.ts.map +1 -1
- package/dist/components/calendar/calendar-types.d.ts +36 -3
- package/dist/components/calendar/calendar-types.d.ts.map +1 -1
- package/dist/components/calendar/calendar-utils.d.ts +95 -8
- package/dist/components/calendar/calendar-utils.d.ts.map +1 -1
- package/dist/components/calendar/calendar.d.ts.map +1 -1
- package/dist/components/calendar/views/calendar-event-text.d.ts +12 -0
- package/dist/components/calendar/views/calendar-event-text.d.ts.map +1 -0
- package/dist/components/calendar/views/calendar-month-grid.d.ts +10 -2
- package/dist/components/calendar/views/calendar-month-grid.d.ts.map +1 -1
- package/dist/components/calendar/views/calendar-more-events.d.ts +19 -0
- package/dist/components/calendar/views/calendar-more-events.d.ts.map +1 -0
- package/dist/components/calendar/views/calendar-time-grid.d.ts +12 -2
- package/dist/components/calendar/views/calendar-time-grid.d.ts.map +1 -1
- package/dist/components/data-table/data-table-types.d.ts +16 -1
- package/dist/components/data-table/data-table-types.d.ts.map +1 -1
- package/dist/components/data-table/data-table.d.ts.map +1 -1
- package/dist/components/data-table/fixed/fixed-utils.d.ts +63 -0
- package/dist/components/data-table/fixed/fixed-utils.d.ts.map +1 -0
- package/dist/components/data-table/footer/footer-types.d.ts +3 -0
- package/dist/components/data-table/footer/footer-types.d.ts.map +1 -1
- package/dist/components/data-table/footer/footer.d.ts.map +1 -1
- package/dist/components/data-table/group-row/group-row-types.d.ts +9 -0
- package/dist/components/data-table/group-row/group-row-types.d.ts.map +1 -1
- package/dist/components/data-table/group-row/group-row.d.ts.map +1 -1
- package/dist/components/data-table/grouping/buildFlatGroupedRows.d.ts +9 -0
- package/dist/components/data-table/grouping/buildFlatGroupedRows.d.ts.map +1 -1
- package/dist/components/data-table/header/Header.d.ts.map +1 -1
- package/dist/components/data-table/header/header-types.d.ts +5 -0
- package/dist/components/data-table/header/header-types.d.ts.map +1 -1
- package/dist/components/data-table/state/datatable-state.d.ts +1 -1
- package/dist/components/data-table/state/datatable-state.d.ts.map +1 -1
- package/dist/components/drawer/drawer.d.ts.map +1 -1
- package/dist/components/echart-graph-from-tree/echart-graph-from-tree-types.d.ts +14 -0
- package/dist/components/echart-graph-from-tree/echart-graph-from-tree-types.d.ts.map +1 -0
- package/dist/components/echart-graph-from-tree/echart-graph-from-tree.d.ts +11 -0
- package/dist/components/echart-graph-from-tree/echart-graph-from-tree.d.ts.map +1 -0
- package/dist/components/echarts-graph/builders/echarts-graph-builders-advanced.d.ts +26 -0
- package/dist/components/echarts-graph/builders/echarts-graph-builders-advanced.d.ts.map +1 -0
- package/dist/components/echarts-graph/builders/echarts-graph-builders.d.ts +17 -0
- package/dist/components/echarts-graph/builders/echarts-graph-builders.d.ts.map +1 -0
- package/dist/components/echarts-graph/data/echarts-graph-data.d.ts +151 -0
- package/dist/components/echarts-graph/data/echarts-graph-data.d.ts.map +1 -0
- package/dist/components/echarts-graph/data/echarts-graph-data.test.d.ts +2 -0
- package/dist/components/echarts-graph/data/echarts-graph-data.test.d.ts.map +1 -0
- package/dist/components/echarts-graph/data/echarts-graph-frame.d.ts +164 -0
- package/dist/components/echarts-graph/data/echarts-graph-frame.d.ts.map +1 -0
- package/dist/components/echarts-graph/data/echarts-graph-math.d.ts +26 -0
- package/dist/components/echarts-graph/data/echarts-graph-math.d.ts.map +1 -0
- package/dist/components/echarts-graph/data/echarts-graph-time.d.ts +42 -0
- package/dist/components/echarts-graph/data/echarts-graph-time.d.ts.map +1 -0
- package/dist/components/echarts-graph/data/echarts-graph-utils.d.ts +197 -0
- package/dist/components/echarts-graph/data/echarts-graph-utils.d.ts.map +1 -0
- package/dist/components/echarts-graph/data/echarts-graph-utils.test.d.ts +2 -0
- package/dist/components/echarts-graph/data/echarts-graph-utils.test.d.ts.map +1 -0
- package/dist/components/echarts-graph/echarts-graph-types.d.ts +210 -0
- package/dist/components/echarts-graph/echarts-graph-types.d.ts.map +1 -0
- package/dist/components/echarts-graph/echarts-graph.d.ts +15 -0
- package/dist/components/echarts-graph/echarts-graph.d.ts.map +1 -0
- package/dist/components/echarts-graph/theme/echarts-graph-color.d.ts +20 -0
- package/dist/components/echarts-graph/theme/echarts-graph-color.d.ts.map +1 -0
- package/dist/components/echarts-graph/theme/echarts-graph-color.test.d.ts +2 -0
- package/dist/components/echarts-graph/theme/echarts-graph-color.test.d.ts.map +1 -0
- package/dist/components/echarts-graph/theme/echarts-graph-theme.d.ts +58 -0
- package/dist/components/echarts-graph/theme/echarts-graph-theme.d.ts.map +1 -0
- package/dist/components/input-panel/assets/data.d.ts +1 -0
- package/dist/components/input-panel/assets/data.d.ts.map +1 -1
- package/dist/components/input-panel/input-panel-utils.d.ts.map +1 -1
- package/dist/components/input-panel/input-panel.d.ts.map +1 -1
- package/dist/components/pdf/pdf-utils.d.ts.map +1 -1
- package/dist/components/workflow-designer/workflow-designer-metadata-panel.d.ts.map +1 -1
- package/dist/context/interaction-context.d.ts +16 -0
- package/dist/context/interaction-context.d.ts.map +1 -0
- package/dist/{cynefinDiagram-5FMLGOSQ-3Ha1hdlV.js → cynefinDiagram-5FMLGOSQ-3SByb22K.js} +3 -3
- package/dist/{dagre-GXQ25YYZ-Bg7xf6xn.js → dagre-GXQ25YYZ--Qf92cTs.js} +10 -10
- package/dist/{diagram-S7CK7UJ4-BuDHTdHA.js → diagram-S7CK7UJ4-IhyDbKSO.js} +4 -4
- package/dist/{diagram-UQ7AKVKN-uvzJGj43.js → diagram-UQ7AKVKN-CPDZJAkA.js} +3 -3
- package/dist/{diagram-VSXAHHWV-CrQQCs-B.js → diagram-VSXAHHWV-CdX3XaQX.js} +2 -2
- package/dist/{diagram-VX7I27RA-BNmG1sig.js → diagram-VX7I27RA-DX39g4aO.js} +5 -5
- package/dist/{diagram-Z3DM3KII-B6BrLhP0.js → diagram-Z3DM3KII-DECfAI1l.js} +3 -3
- package/dist/{ebnfDiagram-PWID7BFC-DMx8xAFO.js → ebnfDiagram-PWID7BFC-D0cmYo-k.js} +3 -3
- package/dist/{erDiagram-RLTQ6QDP-bkJ9nzVK.js → erDiagram-RLTQ6QDP-C-nlwQZa.js} +12 -12
- package/dist/flowDiagram-HODETNUW-LRjksS-j.js +17 -0
- package/dist/functional-components/badge/badge-assets.d.ts +1 -0
- package/dist/functional-components/badge/badge-assets.d.ts.map +1 -1
- package/dist/functional-components/badge/badge-utils.d.ts +5 -0
- package/dist/functional-components/badge/badge-utils.d.ts.map +1 -1
- package/dist/functional-components/badge/badge.d.ts.map +1 -1
- package/dist/functional-components/multiple-field/multiple-field-types.d.ts +1 -0
- package/dist/functional-components/multiple-field/multiple-field-types.d.ts.map +1 -1
- package/dist/functional-components/multiple-field/multiple-field.d.ts.map +1 -1
- package/dist/functional-components/row/row-types.d.ts +23 -0
- package/dist/functional-components/row/row-types.d.ts.map +1 -1
- package/dist/functional-components/row/row.d.ts.map +1 -1
- package/dist/{ganttDiagram-EL5Y4UJY-CL-ywzz_.js → ganttDiagram-EL5Y4UJY-qQkBgEV6.js} +2 -2
- package/dist/{gitGraphDiagram-WWUBYQGX-aXhNDG6P.js → gitGraphDiagram-WWUBYQGX-D8cZBZXB.js} +2 -2
- package/dist/hooks/useClickOutside/useClickOutside-assets.d.ts +14 -0
- package/dist/hooks/useClickOutside/useClickOutside-assets.d.ts.map +1 -0
- package/dist/hooks/useClickOutside/useClickOutside.d.ts.map +1 -0
- package/dist/hooks/useFloating.d.ts.map +1 -1
- package/dist/hooks/useVirtualListScroll.d.ts +8 -1
- package/dist/hooks/useVirtualListScroll.d.ts.map +1 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/{infoDiagram-27XIBGKW-Je4heBlk.js → infoDiagram-27XIBGKW-DXO97_PJ.js} +2 -2
- package/dist/{ishikawaDiagram-5VMMS53U-DK7HlH95.js → ishikawaDiagram-5VMMS53U-B0RvuZyG.js} +3 -3
- package/dist/{journeyDiagram-3NMN7TZE-CpuYEKcB.js → journeyDiagram-3NMN7TZE-Dh8_Vc4e.js} +2 -2
- package/dist/{kanban-definition-UXKFOSKX-aK8uKmyY.js → kanban-definition-UXKFOSKX-C99A4PsR.js} +9 -9
- package/dist/ketchup2.css +1 -1
- package/dist/ketchup2.es.js +31668 -29256
- package/dist/{line-DTqYMLoX.js → line-CkNoVxEr.js} +1 -1
- package/dist/locale/en/translation.json.d.ts +5 -0
- package/dist/locale/it/translation.json.d.ts +5 -0
- package/dist/{mindmap-definition-YA3MSWOX-ZMYcmi9J.js → mindmap-definition-YA3MSWOX-D0ULN6M8.js} +11 -11
- package/dist/{pegDiagram-XKGWAZYB-DsfILwZN.js → pegDiagram-XKGWAZYB-BThnA3Uk.js} +3 -3
- package/dist/{pieDiagram-E7YTZNPT-DcSLcLdd.js → pieDiagram-E7YTZNPT-CJ4LPitY.js} +3 -3
- package/dist/{quadrantDiagram-AXDQQJYC-DSx3teop.js → quadrantDiagram-AXDQQJYC-nEwzg95_.js} +1 -1
- package/dist/{railroadDiagram-O6MQD6OU-jOZRtNDi.js → railroadDiagram-O6MQD6OU-D_9gvx5m.js} +3 -3
- package/dist/{requirementDiagram-BXWQKSXE-D14hkkez.js → requirementDiagram-BXWQKSXE-BU3gTMjQ.js} +11 -11
- package/dist/{sankeyDiagram-P5KCCOFB-C0jmknYo.js → sankeyDiagram-P5KCCOFB-BmNN-6y3.js} +1 -1
- package/dist/{sequenceDiagram-WJ2MYXX4-C00egnMz.js → sequenceDiagram-WJ2MYXX4-QYJxbuz_.js} +3 -3
- package/dist/{stateDiagram-D77RDMKH-YfzmviNY.js → stateDiagram-D77RDMKH-0Jasv70t.js} +14 -14
- package/dist/stateDiagram-v2-MP3YSRHH-JMSv8IGL.js +30 -0
- package/dist/{swimlanes-42K2YHIH-CJcMmxXf.js → swimlanes-42K2YHIH-DkMzBkx7.js} +10 -10
- package/dist/swimlanesDiagram-VR7AAH4N-DtnUyaK5.js +31 -0
- package/dist/{timeline-definition-24CTP7MA-D2xfYuSV.js → timeline-definition-24CTP7MA-AvgVPsM_.js} +3 -3
- package/dist/types/data-structures.d.ts +5 -1
- package/dist/types/data-structures.d.ts.map +1 -1
- package/dist/types/translation.d.ts +6 -1
- package/dist/types/translation.d.ts.map +1 -1
- package/dist/utils/floating-layer.d.ts +11 -0
- package/dist/utils/floating-layer.d.ts.map +1 -0
- package/dist/utils/legacy.d.ts +7 -0
- package/dist/utils/legacy.d.ts.map +1 -1
- package/dist/utils/objects.d.ts +20 -1
- package/dist/utils/objects.d.ts.map +1 -1
- package/dist/{vennDiagram-4TSXK5OY-C4XLgus_.js → vennDiagram-4TSXK5OY-DBz_EnfL.js} +3 -3
- package/dist/{wardleyDiagram-VM6X3IG4-DFoKuS9s.js → wardleyDiagram-VM6X3IG4-D4U_E7xl.js} +3 -3
- package/dist/{xychartDiagram-S5SC5T6Z-BzKKgVBe.js → xychartDiagram-S5SC5T6Z-aHqeFP13.js} +6 -6
- package/package.json +4 -4
- package/dist/classDiagram-ZZMXUADV-L32jCfMj.js +0 -30
- package/dist/classDiagram-v2-VYDZK3BY-BsnrDCgX.js +0 -30
- package/dist/components/echarts/echarts-graph-types.d.ts +0 -8
- package/dist/components/echarts/echarts-graph-types.d.ts.map +0 -1
- package/dist/components/echarts/echarts-graph.d.ts +0 -4
- package/dist/components/echarts/echarts-graph.d.ts.map +0 -1
- package/dist/flowDiagram-HODETNUW-BIvD7-ts.js +0 -17
- package/dist/hooks/useClickOutside.d.ts.map +0 -1
- package/dist/stateDiagram-v2-MP3YSRHH-B6Hzx8T0.js +0 -30
- package/dist/swimlanesDiagram-VR7AAH4N-DirvhGBA.js +0 -31
- /package/dist/hooks/{useClickOutside.d.ts → useClickOutside/useClickOutside.d.ts} +0 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { EChartsOption, TitleComponentOption } from 'echarts';
|
|
2
|
+
import { DataColumn, DataRow } from '../../../types/data-structures';
|
|
3
|
+
import { GeoAspect, GeoRegion } from './echarts-graph-data';
|
|
4
|
+
import { EchartsGraphTheme } from '../theme/echarts-graph-theme';
|
|
5
|
+
import { EchartsGraphClickPayload, ResolvedChaOptions } from '../echarts-graph-types';
|
|
6
|
+
import { ChartTable } from './echarts-graph-utils';
|
|
7
|
+
/** Size, in pixels, of the container of the chart. */
|
|
8
|
+
export type ChartSize = {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
};
|
|
12
|
+
/** Below this width the legend moves to the bottom and the fonts shrink. */
|
|
13
|
+
export declare const COMPACT_WIDTH = 400;
|
|
14
|
+
/** Below this height the fonts shrink and the values on the series are hidden. */
|
|
15
|
+
export declare const COMPACT_HEIGHT = 200;
|
|
16
|
+
/** Below this width the values on the series are hidden. */
|
|
17
|
+
export declare const MIN_WIDTH_FOR_MARKS = 300;
|
|
18
|
+
/**
|
|
19
|
+
* The labels of the axes stay inside the grid (`grid.containLabel` is
|
|
20
|
+
* deprecated in ECharts 6: this is the equivalent).
|
|
21
|
+
*/
|
|
22
|
+
export declare const GRID_CONTAIN_LABEL: {
|
|
23
|
+
readonly outerBoundsMode: "same";
|
|
24
|
+
readonly outerBoundsContain: "axisLabel";
|
|
25
|
+
};
|
|
26
|
+
export declare const MAX_LABEL_LENGTH = 14;
|
|
27
|
+
/** Parameters of a click on an element of the chart (subset of ECharts'). */
|
|
28
|
+
/** `dataType` tells the edges from the nodes of a Sankey chart. */
|
|
29
|
+
export type ChartClickParams = {
|
|
30
|
+
seriesIndex?: number;
|
|
31
|
+
dataIndex?: number;
|
|
32
|
+
dataType?: string;
|
|
33
|
+
/** Name of the series: the title of its column. */
|
|
34
|
+
seriesName?: string;
|
|
35
|
+
};
|
|
36
|
+
/** The ECharts option, and how to read a click on it. */
|
|
37
|
+
export type ChartBuild = {
|
|
38
|
+
option: EChartsOption;
|
|
39
|
+
/** Convert the click of ECharts to the payload of the callback. */
|
|
40
|
+
resolveClick: (params: ChartClickParams) => EchartsGraphClickPayload | undefined;
|
|
41
|
+
};
|
|
42
|
+
/** Arguments of the builders. */
|
|
43
|
+
export type ChartBuildArgs = {
|
|
44
|
+
table: ChartTable;
|
|
45
|
+
options: ResolvedChaOptions;
|
|
46
|
+
theme: EchartsGraphTheme;
|
|
47
|
+
size: ChartSize;
|
|
48
|
+
locale?: string;
|
|
49
|
+
animate?: boolean;
|
|
50
|
+
/** The map registered in ECharts, for the Map chart. */
|
|
51
|
+
map?: {
|
|
52
|
+
name: string;
|
|
53
|
+
regions: GeoRegion[];
|
|
54
|
+
aspect?: GeoAspect;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
/** Escape a text to put it safely inside the HTML of a tooltip. */
|
|
58
|
+
export declare function escapeHtml(text: string): string;
|
|
59
|
+
/** Whether the chart is compact (small container). */
|
|
60
|
+
export declare const isCompact: (size: ChartSize) => boolean;
|
|
61
|
+
/** Shorten a label to the given number of characters. */
|
|
62
|
+
export declare const truncate: (text: string, max: number) => string;
|
|
63
|
+
/**
|
|
64
|
+
* Style of the labels of the category axis, adapted to the available space:
|
|
65
|
+
* horizontal if they fit, then rotated, then truncated.
|
|
66
|
+
*
|
|
67
|
+
* With an explicit angle the labels are rotated by that angle (truncated when
|
|
68
|
+
* too long).
|
|
69
|
+
*/
|
|
70
|
+
export declare function buildCategoryLabel(categories: string[], size: ChartSize, angle?: number, pxPerChar?: number): {
|
|
71
|
+
interval?: number | "auto";
|
|
72
|
+
rotate: number;
|
|
73
|
+
width?: number;
|
|
74
|
+
overflow?: "truncate";
|
|
75
|
+
};
|
|
76
|
+
export type TooltipParam = {
|
|
77
|
+
seriesName?: string;
|
|
78
|
+
seriesIndex?: number;
|
|
79
|
+
name?: string;
|
|
80
|
+
value?: unknown;
|
|
81
|
+
marker?: string;
|
|
82
|
+
percent?: number;
|
|
83
|
+
axisValueLabel?: string;
|
|
84
|
+
axisValue?: number | string;
|
|
85
|
+
dataType?: string;
|
|
86
|
+
data?: unknown;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Layout shared by all the charts: title, legend, colors, text, number
|
|
90
|
+
* format and the margins left free for title and legend.
|
|
91
|
+
*/
|
|
92
|
+
export declare function buildFrame(args: ChartBuildArgs, legendNames: string[]): {
|
|
93
|
+
compact: boolean;
|
|
94
|
+
fontSize: number;
|
|
95
|
+
format: (value: unknown) => string;
|
|
96
|
+
formatPercent: (value: unknown) => string;
|
|
97
|
+
text: {
|
|
98
|
+
color: string;
|
|
99
|
+
fontFamily: string;
|
|
100
|
+
fontSize: number;
|
|
101
|
+
};
|
|
102
|
+
colors: string[];
|
|
103
|
+
title: TitleComponentOption;
|
|
104
|
+
legend: import('echarts').ScrollableLegendComponentOption;
|
|
105
|
+
legendVisible: boolean;
|
|
106
|
+
margins: {
|
|
107
|
+
top: number;
|
|
108
|
+
bottom: number;
|
|
109
|
+
left: number;
|
|
110
|
+
right: number;
|
|
111
|
+
};
|
|
112
|
+
tooltip: {
|
|
113
|
+
confine: boolean;
|
|
114
|
+
backgroundColor: string;
|
|
115
|
+
borderColor: string;
|
|
116
|
+
textStyle: {
|
|
117
|
+
color: string;
|
|
118
|
+
fontFamily: string;
|
|
119
|
+
fontSize: number;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
plot: {
|
|
123
|
+
width: number;
|
|
124
|
+
height: number;
|
|
125
|
+
centerX: number;
|
|
126
|
+
centerY: number;
|
|
127
|
+
radius: number;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
export type Frame = ReturnType<typeof buildFrame>;
|
|
131
|
+
/** Options common to all the charts. */
|
|
132
|
+
export declare function baseOption(args: ChartBuildArgs, frame: Frame): EChartsOption;
|
|
133
|
+
/**
|
|
134
|
+
* The column a click on a category refers to: the axis column, whose value is
|
|
135
|
+
* the clicked category (`x`). Without an axis, the column of the first series.
|
|
136
|
+
*/
|
|
137
|
+
export declare function getCategoryColumn(table: ChartTable): {
|
|
138
|
+
column?: DataColumn;
|
|
139
|
+
columnIndex?: number;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Add to the payload of a click the column found by title: as in `kup-echart`,
|
|
143
|
+
* the first column whose title is the name of the clicked series (for Pie,
|
|
144
|
+
* Funnel and Map, the title of the axis column). When there is no such column
|
|
145
|
+
* (the series names of duplicated titles have a suffix) the payload is kept.
|
|
146
|
+
*/
|
|
147
|
+
export declare function applyColumnByTitle(table: ChartTable, params: ChartClickParams, payload: EchartsGraphClickPayload): EchartsGraphClickPayload;
|
|
148
|
+
/**
|
|
149
|
+
* Name of the series of a chart of categories (Pie and Funnel): as in
|
|
150
|
+
* `kup-echart`, the title of the axis column, so that the click finds it.
|
|
151
|
+
*/
|
|
152
|
+
export declare function getCategoryTitle(table: ChartTable): string;
|
|
153
|
+
/**
|
|
154
|
+
* Copy of the row with the grouped value in the cell of the first series, as
|
|
155
|
+
* `kup-echart` does: the original row only has its own value.
|
|
156
|
+
*/
|
|
157
|
+
export declare function withGroupedValue(table: ChartTable, rowIndex: number, value: number | undefined): DataRow | undefined;
|
|
158
|
+
/** Click on a chart of aggregated categories (Pie and Funnel). */
|
|
159
|
+
export declare function resolveCategoryClick(table: ChartTable, categories: {
|
|
160
|
+
name: string;
|
|
161
|
+
value: number;
|
|
162
|
+
rowIndexes: number[];
|
|
163
|
+
}[]): (params: ChartClickParams) => EchartsGraphClickPayload | undefined;
|
|
164
|
+
//# sourceMappingURL=echarts-graph-frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"echarts-graph-frame.d.ts","sourceRoot":"","sources":["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SAAS,CAcxE"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Default number of points of a normal distribution curve. */
|
|
2
|
+
export declare const NORMAL_DISTRIBUTION_POINTS = 201;
|
|
3
|
+
/**
|
|
4
|
+
* Normal (Gaussian) distribution of the values: the curve of the density,
|
|
5
|
+
* from a little before the lowest value to a little after the highest.
|
|
6
|
+
*
|
|
7
|
+
* @returns `[x, density]` points. A single value, or equal values, give a
|
|
8
|
+
* narrow curve around it; no values give no curve.
|
|
9
|
+
*/
|
|
10
|
+
export declare function normalDistribution(values: number[], precision?: number): [number, number][];
|
|
11
|
+
/**
|
|
12
|
+
* Order the rows "like a mountain": the greatest value in the middle, the
|
|
13
|
+
* others alternating on its left and right. Empty values go to the edges.
|
|
14
|
+
*
|
|
15
|
+
* @returns the indexes of the values, in the new order.
|
|
16
|
+
*/
|
|
17
|
+
export declare function mountainOrder(values: (number | null)[]): number[];
|
|
18
|
+
/**
|
|
19
|
+
* Trend line of the values: the least squares line over the position of the
|
|
20
|
+
* values (0, 1, 2, ...), with the empty values left out of the calculation.
|
|
21
|
+
*
|
|
22
|
+
* @returns the value of the line at every position, or undefined when there
|
|
23
|
+
* are less than two values to calculate it on.
|
|
24
|
+
*/
|
|
25
|
+
export declare function linearTrend(values: (number | null)[]): number[] | undefined;
|
|
26
|
+
//# sourceMappingURL=echarts-graph-math.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"echarts-graph-math.d.ts","sourceRoot":"","sources":["../../../../src/components/echarts-graph/data/echarts-graph-math.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,eAAO,MAAM,0BAA0B,MAAM,CAAA;AAE7C;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EAAE,EAChB,SAAS,SAA6B,GACrC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CA4BpB;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,CAyBjE;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,GAAG,SAAS,CAa3E"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { DataColumn, DataRow } from '../../../types/data-structures';
|
|
2
|
+
/**
|
|
3
|
+
* Parse a date value: ISO (`YYYY-MM-DD`, with an optional time), `YYYYMMDD`,
|
|
4
|
+
* or anything `Date` understands.
|
|
5
|
+
* @returns the date (local time, midnight when there is no time), or null.
|
|
6
|
+
*/
|
|
7
|
+
export declare function parseDateValue(value: string | undefined | null): Date | null;
|
|
8
|
+
/**
|
|
9
|
+
* Parse a time value: `HH:mm`, `HH:mm:ss`, `HHmm` or `HHmmss`.
|
|
10
|
+
* @returns the seconds from midnight, or null.
|
|
11
|
+
*/
|
|
12
|
+
export declare function parseTimeValue(value: string | undefined | null): number | null;
|
|
13
|
+
/** Time axis of a cartesian chart: the instant of every row. */
|
|
14
|
+
export type TimeAxisData = {
|
|
15
|
+
/** Instant (ms) of every row, `null` when the row has no valid date/time. */
|
|
16
|
+
timestamps: (number | null)[];
|
|
17
|
+
/** Indexes of the rows with a valid instant, in chronological order. */
|
|
18
|
+
order: number[];
|
|
19
|
+
hasDate: boolean;
|
|
20
|
+
hasTime: boolean;
|
|
21
|
+
/** The time column handles seconds (object `I1` with parameter `2`). */
|
|
22
|
+
hasSeconds: boolean;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Read the instant of every row from the columns of `DateAxis` and `TimeAxis`.
|
|
26
|
+
* With both columns the instant is the date at the time; with only the time
|
|
27
|
+
* column the day is the same for all the rows.
|
|
28
|
+
* The time column decides whether the times have seconds, as `kup-objects`
|
|
29
|
+
* `isTimeWithSeconds`.
|
|
30
|
+
* @returns the time axis, or undefined if no row has a valid instant.
|
|
31
|
+
*/
|
|
32
|
+
export declare function buildTimeAxisData(options: {
|
|
33
|
+
DateAxis?: string;
|
|
34
|
+
TimeAxis?: string;
|
|
35
|
+
}, rows: DataRow[], columns?: DataColumn[]): TimeAxisData | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Format an instant for the axis and the tooltip, in the given locale.
|
|
38
|
+
* The year is always shown.
|
|
39
|
+
* With `withSeconds` the time has the seconds too.
|
|
40
|
+
*/
|
|
41
|
+
export declare function formatTimestamp(timestamp: number, locale: string | undefined, hasDate: boolean, hasTime: boolean, withSeconds?: boolean): string;
|
|
42
|
+
//# sourceMappingURL=echarts-graph-time.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"echarts-graph-time.d.ts","sourceRoot":"","sources":["../../../../src/components/echarts-graph/data/echarts-graph-time.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AAIzE;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CA0B5E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAC/B,MAAM,GAAG,IAAI,CAkBf;AAED,gEAAgE;AAChE,MAAM,MAAM,YAAY,GAAG;IACzB,6EAA6E;IAC7E,UAAU,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAA;IAC7B,wEAAwE;IACxE,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,wEAAwE;IACxE,UAAU,EAAE,OAAO,CAAA;CACpB,CAAA;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,EACjD,IAAI,EAAE,OAAO,EAAE,EACf,OAAO,GAAE,UAAU,EAAO,GACzB,YAAY,GAAG,SAAS,CA8C1B;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,WAAW,UAAQ,GAClB,MAAM,CAeR"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { DataCell, DataColumn, DataRow, DataTable } from '../../../types/data-structures';
|
|
2
|
+
import { EchartsGraphFunction, EchartsGraphType, ChaOptions, ResolvedChaOptions } from '../echarts-graph-types';
|
|
3
|
+
/**
|
|
4
|
+
* Split a list of values separated by `|`, trimming and dropping the empty ones.
|
|
5
|
+
*/
|
|
6
|
+
export declare function splitList(value: string | undefined | null): string[];
|
|
7
|
+
/** A range of values: both the ends are included. */
|
|
8
|
+
export type ValueRange = {
|
|
9
|
+
min: number;
|
|
10
|
+
max: number;
|
|
11
|
+
/** Name of the range, `min - max` as it was written. */
|
|
12
|
+
label: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Parse the `Ranges` option: `min;max` pairs separated by `|`
|
|
16
|
+
* (e.g. `20;39|40;54|55;99`). The pairs that are not valid are ignored; the
|
|
17
|
+
* ends are put in order when they are swapped.
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseRanges(value: string | undefined | null): ValueRange[];
|
|
20
|
+
/**
|
|
21
|
+
* Parse a numeric option (a suffix `px` is ignored).
|
|
22
|
+
* @returns the number, or undefined if the value is missing or not numeric.
|
|
23
|
+
*/
|
|
24
|
+
export declare function parseNumber(value: string | undefined | null): number | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Convert a dimension option to a CSS value: a bare number is a number of
|
|
27
|
+
* pixels, any other CSS length (`px`, `%`, ...) is left unchanged.
|
|
28
|
+
* @returns the CSS value, or undefined if the value is missing or invalid.
|
|
29
|
+
*/
|
|
30
|
+
export declare function parseDimension(value: string | undefined | null): string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Normalize a type name (case-insensitive, legacy aliases such as `VBAR`,
|
|
33
|
+
* `CAL`, `GEO`, `CANDLESTICK` are accepted).
|
|
34
|
+
* @returns the canonical type, or undefined if the value is not recognized.
|
|
35
|
+
*/
|
|
36
|
+
export declare function normalizeType(value: string | undefined | null): EchartsGraphType | undefined;
|
|
37
|
+
/** Whether the type is drawn on a cartesian grid. */
|
|
38
|
+
export declare function isCartesianType(type: EchartsGraphType): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Family of a chart type: how the data is read and drawn.
|
|
41
|
+
* `unsupported` types are not drawn yet.
|
|
42
|
+
*/
|
|
43
|
+
export type ChartFamily = "cartesian" | "gaussian" | "pie" | "funnel" | "radar" | "bubble" | "candle" | "calendar" | "sankey" | "map";
|
|
44
|
+
export declare function getChartFamily(type: EchartsGraphType | undefined): ChartFamily;
|
|
45
|
+
/**
|
|
46
|
+
* Family of a chart from all its types: a Gaussian curve (alone or with other
|
|
47
|
+
* types) is a Gaussian chart, otherwise the first type decides.
|
|
48
|
+
*/
|
|
49
|
+
export declare function getFamilyOfTypes(types: EchartsGraphType[]): ChartFamily;
|
|
50
|
+
/** Types of a resolved options object, one for each series. */
|
|
51
|
+
export declare function getResolvedTypes(options: ResolvedChaOptions): EchartsGraphType[];
|
|
52
|
+
/**
|
|
53
|
+
* Default axis column, when `Axe` is missing or not found.
|
|
54
|
+
*
|
|
55
|
+
* Adapted from the legacy `getDefaultAxis` (webup.js):
|
|
56
|
+
* 1. the column with `fill = "AXIS"`;
|
|
57
|
+
* 2. the first non numeric, visible column that is not a series;
|
|
58
|
+
* 3. the first non numeric column that is not a series;
|
|
59
|
+
* 4. the first visible column that is not a series;
|
|
60
|
+
* 5. the first column that is not a series.
|
|
61
|
+
*/
|
|
62
|
+
export declare function getDefaultAxis(data: DataTable, seriesNames: string[]): string;
|
|
63
|
+
/**
|
|
64
|
+
* Default series, when `Series` is missing or none of its columns is found.
|
|
65
|
+
*
|
|
66
|
+
* Adapted from the legacy `getDefaultSeries` (webup.js):
|
|
67
|
+
* 1. the columns with `fill = "SERIES"`;
|
|
68
|
+
* 2. the first numeric, visible column that is not the axis;
|
|
69
|
+
* 3. the first numeric column that is not the axis;
|
|
70
|
+
* 4. the first visible column that is not the axis;
|
|
71
|
+
* 5. the first column that is not the axis.
|
|
72
|
+
*/
|
|
73
|
+
export declare function getDefaultSeries(data: DataTable, axis: string): string[];
|
|
74
|
+
/**
|
|
75
|
+
* Resolve the options defaults from the data when explicit options are
|
|
76
|
+
* missing or not valid.
|
|
77
|
+
*
|
|
78
|
+
* Adapts the legacy `chartOptionsToChartProps` (webup.js) to ketchup2, keeping
|
|
79
|
+
* the names and the types of {@link ChaOptions}:
|
|
80
|
+
* - Axe: if not provided or not found in columns, auto-detect the axis column.
|
|
81
|
+
* - Series: columns not found are dropped; if none is left, auto-detect.
|
|
82
|
+
* - Typ: values not recognized are dropped (never throws); default `Bar`. A
|
|
83
|
+
* single cartesian type is repeated for every series; series are limited to
|
|
84
|
+
* the number of types.
|
|
85
|
+
* - Leg/LegPos: legend hidden unless `Leg` is `Yes`; default position `right`.
|
|
86
|
+
* - Stack: `STACKED` only if a bar type is present.
|
|
87
|
+
* - DateAxis/TimeAxis: cleared if the column is not found; if missing and the
|
|
88
|
+
* axis column is a date (or time), it is used as such.
|
|
89
|
+
* - YAxes: series not found are replaced by the first series.
|
|
90
|
+
* - AxisYMin/AxisYMax/LabelAngle/TitleSize: numeric values only.
|
|
91
|
+
* - ForceWidth/ForceHeight: numbers become pixels; default `100%`.
|
|
92
|
+
*
|
|
93
|
+
* @returns the resolved options.
|
|
94
|
+
*/
|
|
95
|
+
export declare function resolveEchartsGraphDefaults(options: ChaOptions, data: DataTable): ResolvedChaOptions;
|
|
96
|
+
/** Check if a function is among the (resolved) `Functions` of the chart. */
|
|
97
|
+
export declare function hasFunction(options: ResolvedChaOptions, fn: EchartsGraphFunction): boolean;
|
|
98
|
+
/** A series ready to be drawn. */
|
|
99
|
+
export type ChartSeriesData = {
|
|
100
|
+
/** Name shown in legend and tooltip (unique). */
|
|
101
|
+
name: string;
|
|
102
|
+
column: DataColumn;
|
|
103
|
+
/** Index of the column in `data.columns`. */
|
|
104
|
+
columnIndex: number;
|
|
105
|
+
type: EchartsGraphType;
|
|
106
|
+
/** One value for each row; `null` when the cell is empty or not numeric. */
|
|
107
|
+
values: (number | null)[];
|
|
108
|
+
};
|
|
109
|
+
/** Data of a chart, extracted from the `DataTable`. */
|
|
110
|
+
export type ChartTable = {
|
|
111
|
+
/** Name of the axis column, empty if there is none. */
|
|
112
|
+
axis: string;
|
|
113
|
+
/** All the columns of the data. */
|
|
114
|
+
columns: DataColumn[];
|
|
115
|
+
/** Category of every row (value of the axis column). */
|
|
116
|
+
categories: string[];
|
|
117
|
+
rows: DataRow[];
|
|
118
|
+
series: ChartSeriesData[];
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Text of a cell: its description (`decode`) when there is one, otherwise its
|
|
122
|
+
* value. Empty when the cell is missing.
|
|
123
|
+
*/
|
|
124
|
+
export declare function getCellText(cell: DataCell | undefined): string;
|
|
125
|
+
/**
|
|
126
|
+
* Split the values of the `XTicks` and `YTicks` options, separated by `;`,
|
|
127
|
+
* trimming and dropping the empty ones.
|
|
128
|
+
* @param numeric the values are numbers: the ones that are not are dropped
|
|
129
|
+
* @returns the values, or undefined when there is none.
|
|
130
|
+
*/
|
|
131
|
+
export declare function splitTicks(value: string | undefined | null, numeric: boolean): (string | number)[] | undefined;
|
|
132
|
+
/** Parse a number greater than 0 (as the `XTickInterval` option). */
|
|
133
|
+
export declare function parsePositive(value: string | undefined | null): number | undefined;
|
|
134
|
+
/**
|
|
135
|
+
* Values at a regular distance (`step`) covering the values of an axis: from
|
|
136
|
+
* the lowest one (or the multiple of the step before it, with `align`) up to
|
|
137
|
+
* the highest.
|
|
138
|
+
* @returns the values, or undefined when there are none or too many.
|
|
139
|
+
*/
|
|
140
|
+
export declare function stepTicks(values: number[], step: number, align: boolean): number[] | undefined;
|
|
141
|
+
/**
|
|
142
|
+
* Convert a cell value to a number.
|
|
143
|
+
* @returns the number, or null if the cell is empty or not numeric.
|
|
144
|
+
*/
|
|
145
|
+
export declare function toNumber(value: string | undefined | null): number | null;
|
|
146
|
+
/**
|
|
147
|
+
* Convert the value of a cell to a number. When the column or the cell has a
|
|
148
|
+
* number object (NR), the value is always read as a number: a blank (or not
|
|
149
|
+
* numeric) value becomes 0.
|
|
150
|
+
* @returns the number, or null if the cell is empty or not numeric and its
|
|
151
|
+
* object is not a number.
|
|
152
|
+
*/
|
|
153
|
+
export declare function cellToNumber(cell: DataCell | undefined, column?: DataColumn): number | null;
|
|
154
|
+
/**
|
|
155
|
+
* Extract categories and series from the data, following the resolved options.
|
|
156
|
+
*/
|
|
157
|
+
export declare function buildChartTable(options: ResolvedChaOptions, data: DataTable): ChartTable;
|
|
158
|
+
/** A category of Pie and Funnel charts: the rows with the same axis value. */
|
|
159
|
+
export type CategoryTotal = {
|
|
160
|
+
name: string;
|
|
161
|
+
/** Sum of the values of all the series, for all the rows of the category. */
|
|
162
|
+
value: number;
|
|
163
|
+
/** Indexes of the rows of the category, in `data.rows`. */
|
|
164
|
+
rowIndexes: number[];
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* Group the rows by category (value of the axis), summing the values of the
|
|
168
|
+
* series. Categories keep the order of the data. Without `grouped` (option
|
|
169
|
+
* `GroupData` = `No`) every row is a category of its own.
|
|
170
|
+
*/
|
|
171
|
+
export declare function groupByCategory(table: ChartTable, grouped?: boolean): CategoryTotal[];
|
|
172
|
+
/** A point of a Bubble chart. */
|
|
173
|
+
export type BubblePoint = {
|
|
174
|
+
x: number;
|
|
175
|
+
y: number;
|
|
176
|
+
/** Raw size, undefined when the data has no size column. */
|
|
177
|
+
size?: number;
|
|
178
|
+
/** Label of the bubble (value of the axis). */
|
|
179
|
+
label: string;
|
|
180
|
+
rowIndex: number;
|
|
181
|
+
};
|
|
182
|
+
/** The points of a Bubble chart with the same group (one series, one color). */
|
|
183
|
+
export type BubbleGroup = {
|
|
184
|
+
name: string;
|
|
185
|
+
points: BubblePoint[];
|
|
186
|
+
};
|
|
187
|
+
/**
|
|
188
|
+
* Read a Bubble chart from the series, in order:
|
|
189
|
+
* - 2 series: X, Y;
|
|
190
|
+
* - 3 series: X, Y, group;
|
|
191
|
+
* - 4 or more: X, Y, size, group (the others are ignored).
|
|
192
|
+
*
|
|
193
|
+
* The axis column is the label of the bubble. Rows without a numeric X or Y
|
|
194
|
+
* are skipped.
|
|
195
|
+
*/
|
|
196
|
+
export declare function buildBubbleGroups(table: ChartTable): BubbleGroup[];
|
|
197
|
+
//# sourceMappingURL=echarts-graph-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"echarts-graph-utils.d.ts","sourceRoot":"","sources":["../../../../src/components/echarts-graph/data/echarts-graph-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,OAAO,EACP,SAAS,EACV,MAAM,gCAAgC,CAAA;AAUvC,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACxB,MAAM,wBAAwB,CAAA;AAQ/B;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,EAAE,CAQpE;AAED,qDAAqD;AACrD,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,UAAU,EAAE,CAY1E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AG,IAAI,GAAG,MAAM,GAAG,IAAI,CAMxE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,QAAQ,GAAG,SAAS,EAC1B,MAAM,CAAC,EAAE,UAAU,GAClB,MAAM,GAAG,IAAI,CASf;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,kBAAkB,EAC3B,IAAI,EAAE,SAAS,GACd,UAAU,CAuCZ;AAED,8EAA8E;AAC9E,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAA;IACb,2DAA2D;IAC3D,UAAU,EAAE,MAAM,EAAE,CAAA;CACrB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,UAAU,EACjB,OAAO,UAAO,GACb,aAAa,EAAE,CAejB;AAED,iCAAiC;AACjC,MAAM,MAAM,WAAW,GAAG;IACxB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,gFAAgF;AAChF,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,WAAW,EAAE,CAAA;CACtB,CAAA;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,EAAE,CAkClE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"echarts-graph-utils.test.d.ts","sourceRoot":"","sources":["../../../../src/components/echarts-graph/data/echarts-graph-utils.test.ts"],"names":[],"mappings":""}
|