vue-chrts 2.0.0 → 2.1.0-beta-3
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/components/AreaChart/AreaChart.js +141 -112
- package/dist/components/AreaChart/types.d.ts +33 -1
- package/dist/components/BarChart/BarChart.js +76 -65
- package/dist/components/BarChart/types.d.ts +9 -1
- package/dist/components/BubbleChart/BubbleChart.js +55 -45
- package/dist/components/BubbleChart/types.d.ts +9 -1
- package/dist/components/DagreGraph/DagreGraph.js +171 -0
- package/dist/components/DagreGraph/DagreGraph.vue.d.ts +33 -0
- package/dist/components/DagreGraph/DagreGraph2.js +4 -0
- package/dist/components/DagreGraph/types.d.ts +253 -0
- package/dist/components/DonutChart/DonutChart.js +69 -59
- package/dist/components/DonutChart/types.d.ts +14 -2
- package/dist/components/DualChart/DualChart.js +216 -0
- package/dist/components/DualChart/DualChart.vue.d.ts +21 -0
- package/dist/components/DualChart/DualChart2.js +4 -0
- package/dist/components/DualChart/types.d.ts +195 -0
- package/dist/components/GanttChart/GanttChart.js +58 -48
- package/dist/components/GanttChart/types.d.ts +9 -1
- package/dist/components/LineChart/LineChart.js +17 -9
- package/dist/components/Maps/DottedMap/DottedMap.js +170 -0
- package/dist/components/Maps/DottedMap/DottedMap.vue.d.ts +52 -0
- package/dist/components/Maps/DottedMap/DottedMap2.js +4 -0
- package/dist/components/Maps/DottedMap/MapLegend.vue.d.ts +6 -0
- package/dist/components/Maps/DottedMap/MapZoomControls.js +44 -0
- package/dist/components/Maps/DottedMap/MapZoomControls.vue.d.ts +13 -0
- package/dist/components/Maps/DottedMap/MapZoomControls2.js +4 -0
- package/dist/components/Maps/DottedMap/core.js +122 -0
- package/dist/components/Maps/DottedMap/core.vue.d.ts +36 -0
- package/dist/components/Maps/DottedMap/core2.js +4 -0
- package/dist/components/Maps/DottedMap/mapUtils.d.ts +49 -0
- package/dist/components/Maps/DottedMap/mapUtils.js +130 -0
- package/dist/components/Maps/DottedMap/pins.d.ts +9 -0
- package/dist/components/Maps/DottedMap/pins.js +58 -0
- package/dist/components/Maps/DottedMap/regions.d.ts +4 -0
- package/dist/components/Maps/DottedMap/regions.js +66 -0
- package/dist/components/Maps/DottedMap/types.d.ts +127 -0
- package/dist/components/Maps/DottedMap/useMapPanZoom.d.ts +22 -0
- package/dist/components/Maps/DottedMap/useMapPanZoom.js +41 -0
- package/dist/components/Maps/TopoJSONMap/TopoJSONMap.js +170 -0
- package/dist/components/Maps/TopoJSONMap/TopoJSONMap.vue.d.ts +30 -0
- package/dist/components/Maps/TopoJSONMap/TopoJSONMap2.js +4 -0
- package/dist/components/Maps/TopoJSONMap/data.d.ts +13 -0
- package/dist/components/Maps/TopoJSONMap/types.d.ts +40 -0
- package/dist/components/Maps/types.d.ts +48 -0
- package/dist/components/SankeyChart/SankeyChart.js +133 -0
- package/dist/components/SankeyChart/SankeyChart.vue.d.ts +22 -0
- package/dist/components/SankeyChart/SankeyChart2.js +4 -0
- package/dist/components/SankeyChart/types.d.ts +116 -0
- package/dist/components/Tooltip.js +32 -27
- package/dist/data/countries.geo.json.js +9 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.js +25 -12
- package/dist/node_modules/.pnpm/@turf_boolean-point-in-polygon@7.3.1/node_modules/@turf/boolean-point-in-polygon/dist/esm/index.js +28 -0
- package/dist/node_modules/.pnpm/@turf_invariant@7.3.1/node_modules/@turf/invariant/dist/esm/index.js +20 -0
- package/dist/node_modules/.pnpm/mgrs@1.0.0/node_modules/mgrs/mgrs.js +222 -0
- package/dist/node_modules/.pnpm/point-in-polygon-hao@1.2.4/node_modules/point-in-polygon-hao/dist/esm/index.js +25 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/Point.js +24 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/Proj.js +46 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/adjust_axis.js +31 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/checkSanity.js +15 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/adjust_lat.js +8 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/adjust_lon.js +8 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/adjust_zone.js +13 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/asinhy.js +9 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/asinz.js +6 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/clens.js +8 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/clens_cmplx.js +10 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/cosh.js +7 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/e0fn.js +6 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/e1fn.js +6 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/e2fn.js +6 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/e3fn.js +6 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/gN.js +7 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/gatg.js +8 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/hypot.js +8 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/imlfn.js +11 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/iqsfnz.js +13 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/log1py.js +7 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/mlfn.js +6 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/msfnz.js +7 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/phi2z.js +10 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/pj_enfn.js +10 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/pj_inv_mlfn.js +14 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/pj_mlfn.js +6 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/qsfnz.js +7 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/sign.js +6 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/sinh.js +7 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/srat.js +6 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/toPoint.js +10 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/tsfnz.js +8 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/common/vincenty.js +33 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/constants/Datum.js +1278 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/constants/Ellipsoid.js +226 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/constants/PrimeMeridian.js +17 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/constants/units.js +25 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/constants/values.js +22 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/core.js +65 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/datum.js +8 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/datumUtils.js +82 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/datum_transform.js +94 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/defs.js +39 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/deriveConstants.js +30 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/extend.js +12 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/global.js +9 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/index.js +25 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/match.js +11 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/nadgrid.js +128 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/parseCode.js +47 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projString.js +119 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/aea.js +43 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/aeqd.js +36 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/bonne.js +55 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/cass.js +52 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/cea.js +36 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/eqc.js +27 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/eqdc.js +48 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/eqearth.js +30 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/etmerc.js +54 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/gauss.js +27 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/geocent.js +26 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/geos.js +49 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/gnom.js +28 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/krovak.js +31 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/laea.js +134 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/lcc.js +61 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/longlat.js +19 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/merc.js +49 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/mill.js +26 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/moll.js +37 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/nzmg.js +48 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/ob_tran.js +173 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/omerc.js +58 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/ortho.js +28 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/poly.js +68 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/qsc.js +67 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/robin.js +104 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/sinu.js +47 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/somerc.js +34 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/stere.js +46 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/sterea.js +33 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/tmerc.js +60 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/tpers.js +110 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/utm.js +22 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections/vandg.js +34 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/projections.js +34 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/lib/transform.js +49 -0
- package/dist/node_modules/.pnpm/proj4@2.20.2/node_modules/proj4/projs.js +38 -0
- package/dist/node_modules/.pnpm/robust-predicates@3.0.2/node_modules/robust-predicates/esm/orient2d.js +23 -0
- package/dist/node_modules/.pnpm/robust-predicates@3.0.2/node_modules/robust-predicates/esm/util.js +30 -0
- package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/PROJJSONBuilder2015.js +9 -0
- package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/PROJJSONBuilder2019.js +20 -0
- package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/PROJJSONBuilderBase.js +171 -0
- package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/buildPROJJSON.js +11 -0
- package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/detectWKTVersion.js +7 -0
- package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/index.js +104 -0
- package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/parser.js +117 -0
- package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/process.js +89 -0
- package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/transformPROJJSON.js +73 -0
- package/dist/node_modules/.pnpm/wkt-parser@1.5.2/node_modules/wkt-parser/util.js +12 -0
- package/dist/types.d.ts +21 -1
- package/dist/utils/geoJsonToGrid.d.ts +14 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils.d.ts +3 -0
- package/dist/utils.js +35 -31
- package/package.json +15 -9
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DagreGraphProps, GraphNodeDatum, GraphLinkDatum } from './types';
|
|
2
|
+
declare const _default: <N extends GraphNodeDatum = GraphNodeDatum, L extends GraphLinkDatum = GraphLinkDatum>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
4
|
+
readonly onNodeClick?: ((node: N, event?: MouseEvent | undefined) => any) | undefined;
|
|
5
|
+
readonly onNodeMouseover?: ((node: N, event?: MouseEvent | undefined) => any) | undefined;
|
|
6
|
+
readonly onNodeMouseout?: ((node: N, event?: MouseEvent | undefined) => any) | undefined;
|
|
7
|
+
readonly onLinkClick?: ((link: L, event?: MouseEvent | undefined) => any) | undefined;
|
|
8
|
+
readonly onLinkMouseover?: ((link: L, event?: MouseEvent | undefined) => any) | undefined;
|
|
9
|
+
readonly onLinkMouseout?: ((link: L, event?: MouseEvent | undefined) => any) | undefined;
|
|
10
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onNodeClick" | "onNodeMouseover" | "onNodeMouseout" | "onLinkClick" | "onLinkMouseover" | "onLinkMouseout"> & DagreGraphProps<N, L> & Partial<{}>> & import('vue').PublicProps;
|
|
11
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
12
|
+
attrs: any;
|
|
13
|
+
slots: {
|
|
14
|
+
tooltip?(_: {
|
|
15
|
+
node: N | undefined;
|
|
16
|
+
}): any;
|
|
17
|
+
fallback?(_: {}): any;
|
|
18
|
+
};
|
|
19
|
+
emit: {
|
|
20
|
+
(e: "nodeClick", node: N, event?: MouseEvent): void;
|
|
21
|
+
(e: "nodeMouseover", node: N, event?: MouseEvent): void;
|
|
22
|
+
(e: "nodeMouseout", node: N, event?: MouseEvent): void;
|
|
23
|
+
(e: "linkClick", link: L, event?: MouseEvent): void;
|
|
24
|
+
(e: "linkMouseover", link: L, event?: MouseEvent): void;
|
|
25
|
+
(e: "linkMouseout", link: L, event?: MouseEvent): void;
|
|
26
|
+
};
|
|
27
|
+
}>) => import('vue').VNode & {
|
|
28
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
29
|
+
};
|
|
30
|
+
export default _default;
|
|
31
|
+
type __VLS_PrettifyLocal<T> = {
|
|
32
|
+
[K in keyof T]: T[K];
|
|
33
|
+
} & {};
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { BulletLegendItemInterface, TooltipConfig, LegendPosition } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Dagre layout direction options
|
|
4
|
+
*/
|
|
5
|
+
export type DagreRankDir = "TB" | "BT" | "LR" | "RL";
|
|
6
|
+
/**
|
|
7
|
+
* Dagre layout alignment options
|
|
8
|
+
*/
|
|
9
|
+
export type DagreAlign = "UL" | "UR" | "DL" | "DR";
|
|
10
|
+
/**
|
|
11
|
+
* Dagre ranking algorithm options
|
|
12
|
+
*/
|
|
13
|
+
export type DagreRanker = "network-simplex" | "tight-tree" | "longest-path";
|
|
14
|
+
/**
|
|
15
|
+
* Node shape options
|
|
16
|
+
*/
|
|
17
|
+
export type NodeShape = "circle" | "square" | "triangle" | "diamond";
|
|
18
|
+
/**
|
|
19
|
+
* Link arrow position options
|
|
20
|
+
*/
|
|
21
|
+
export type LinkArrowPosition = "start" | "end" | "both" | "none";
|
|
22
|
+
/**
|
|
23
|
+
* Configuration for Dagre layout algorithm
|
|
24
|
+
*/
|
|
25
|
+
export interface DagreLayoutSettings {
|
|
26
|
+
/**
|
|
27
|
+
* Direction of the layout: 'TB' (top-to-bottom), 'BT' (bottom-to-top),
|
|
28
|
+
* 'LR' (left-to-right), 'RL' (right-to-left)
|
|
29
|
+
* @default 'TB'
|
|
30
|
+
*/
|
|
31
|
+
rankdir?: DagreRankDir;
|
|
32
|
+
/**
|
|
33
|
+
* Alignment of nodes: 'UL' (up-left), 'UR' (up-right), 'DL' (down-left), 'DR' (down-right)
|
|
34
|
+
*/
|
|
35
|
+
align?: DagreAlign;
|
|
36
|
+
/**
|
|
37
|
+
* Horizontal spacing between nodes in pixels
|
|
38
|
+
* @default 50
|
|
39
|
+
*/
|
|
40
|
+
nodesep?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Spacing between edges in pixels
|
|
43
|
+
* @default 10
|
|
44
|
+
*/
|
|
45
|
+
edgesep?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Vertical spacing between ranks in pixels
|
|
48
|
+
* @default 50
|
|
49
|
+
*/
|
|
50
|
+
ranksep?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Algorithm to use for ranking nodes
|
|
53
|
+
* @default 'network-simplex'
|
|
54
|
+
*/
|
|
55
|
+
ranker?: DagreRanker;
|
|
56
|
+
/**
|
|
57
|
+
* Horizontal margin in pixels
|
|
58
|
+
* @default 0
|
|
59
|
+
*/
|
|
60
|
+
marginx?: number;
|
|
61
|
+
/**
|
|
62
|
+
* Vertical margin in pixels
|
|
63
|
+
* @default 0
|
|
64
|
+
*/
|
|
65
|
+
marginy?: number;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Node data structure for the graph
|
|
69
|
+
*/
|
|
70
|
+
export interface GraphNodeDatum {
|
|
71
|
+
/**
|
|
72
|
+
* Unique identifier for the node
|
|
73
|
+
*/
|
|
74
|
+
id: string;
|
|
75
|
+
/**
|
|
76
|
+
* Display label for the node
|
|
77
|
+
*/
|
|
78
|
+
label?: string;
|
|
79
|
+
/**
|
|
80
|
+
* Node level (for hierarchical data)
|
|
81
|
+
*/
|
|
82
|
+
level?: number;
|
|
83
|
+
/**
|
|
84
|
+
* Additional data associated with the node
|
|
85
|
+
*/
|
|
86
|
+
[key: string]: any;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Link/Edge data structure for the graph
|
|
90
|
+
*/
|
|
91
|
+
export interface GraphLinkDatum {
|
|
92
|
+
/**
|
|
93
|
+
* Source node ID
|
|
94
|
+
*/
|
|
95
|
+
source: string;
|
|
96
|
+
/**
|
|
97
|
+
* Target node ID
|
|
98
|
+
*/
|
|
99
|
+
target: string;
|
|
100
|
+
/**
|
|
101
|
+
* Label for the link
|
|
102
|
+
*/
|
|
103
|
+
label?: string;
|
|
104
|
+
/**
|
|
105
|
+
* Additional data associated with the link
|
|
106
|
+
*/
|
|
107
|
+
[key: string]: any;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Graph data structure containing nodes and links
|
|
111
|
+
*/
|
|
112
|
+
export interface GraphData<N = GraphNodeDatum, L = GraphLinkDatum> {
|
|
113
|
+
/**
|
|
114
|
+
* Array of node data
|
|
115
|
+
*/
|
|
116
|
+
nodes: N[];
|
|
117
|
+
/**
|
|
118
|
+
* Array of link data
|
|
119
|
+
*/
|
|
120
|
+
links: L[];
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Props for the DagreGraph component
|
|
124
|
+
*/
|
|
125
|
+
export interface DagreGraphProps<N = GraphNodeDatum, L = GraphLinkDatum> {
|
|
126
|
+
/**
|
|
127
|
+
* The graph data containing nodes and links
|
|
128
|
+
*/
|
|
129
|
+
data: GraphData<N, L>;
|
|
130
|
+
/**
|
|
131
|
+
* The height of the graph container in pixels
|
|
132
|
+
* @default 600
|
|
133
|
+
*/
|
|
134
|
+
height?: number;
|
|
135
|
+
/**
|
|
136
|
+
* The width of the graph container in pixels
|
|
137
|
+
* @default undefined (auto)
|
|
138
|
+
*/
|
|
139
|
+
width?: number;
|
|
140
|
+
/**
|
|
141
|
+
* Dagre layout configuration
|
|
142
|
+
*/
|
|
143
|
+
dagreLayoutSettings?: DagreLayoutSettings;
|
|
144
|
+
/**
|
|
145
|
+
* Function or value to determine node size
|
|
146
|
+
* @default 40
|
|
147
|
+
*/
|
|
148
|
+
nodeSize?: number | ((node: N, index: number) => number);
|
|
149
|
+
/**
|
|
150
|
+
* Function to extract node label
|
|
151
|
+
*/
|
|
152
|
+
nodeLabel?: (node: N, index: number) => string;
|
|
153
|
+
/**
|
|
154
|
+
* Function or value to determine node shape
|
|
155
|
+
*/
|
|
156
|
+
nodeShape?: NodeShape | ((node: N, index: number) => NodeShape);
|
|
157
|
+
/**
|
|
158
|
+
* Function or value to determine node fill color
|
|
159
|
+
*/
|
|
160
|
+
nodeFill?: string | ((node: N, index: number) => string);
|
|
161
|
+
/**
|
|
162
|
+
* Function or value to determine node stroke color
|
|
163
|
+
*/
|
|
164
|
+
nodeStroke?: string | ((node: N, index: number) => string);
|
|
165
|
+
/**
|
|
166
|
+
* Function or value to determine node stroke width
|
|
167
|
+
*/
|
|
168
|
+
nodeStrokeWidth?: number | ((node: N, index: number) => number);
|
|
169
|
+
/**
|
|
170
|
+
* Link arrow configuration
|
|
171
|
+
* @default 'end'
|
|
172
|
+
*/
|
|
173
|
+
linkArrow?: LinkArrowPosition;
|
|
174
|
+
/**
|
|
175
|
+
* Function to extract link label
|
|
176
|
+
*/
|
|
177
|
+
linkLabel?: (link: L, index: number) => string;
|
|
178
|
+
/**
|
|
179
|
+
* Function or value to determine link color
|
|
180
|
+
*/
|
|
181
|
+
linkStroke?: string | ((link: L, index: number) => string);
|
|
182
|
+
/**
|
|
183
|
+
* Function or value to determine link width
|
|
184
|
+
*/
|
|
185
|
+
linkWidth?: number | ((link: L, index: number) => number);
|
|
186
|
+
/**
|
|
187
|
+
* Link curvature amount (0-1)
|
|
188
|
+
* @default 0
|
|
189
|
+
*/
|
|
190
|
+
linkCurvature?: number;
|
|
191
|
+
/**
|
|
192
|
+
* Optional padding applied to the graph
|
|
193
|
+
*/
|
|
194
|
+
padding?: {
|
|
195
|
+
top: number;
|
|
196
|
+
right: number;
|
|
197
|
+
bottom: number;
|
|
198
|
+
left: number;
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* If true, hides the tooltip
|
|
202
|
+
*/
|
|
203
|
+
hideTooltip?: boolean;
|
|
204
|
+
/**
|
|
205
|
+
* Enable zoom and pan controls
|
|
206
|
+
* @default true
|
|
207
|
+
*/
|
|
208
|
+
zoomEnabled?: boolean;
|
|
209
|
+
/**
|
|
210
|
+
* Zoom scale extent [min, max]
|
|
211
|
+
* @default [0.1, 10]
|
|
212
|
+
*/
|
|
213
|
+
zoomScaleExtent?: [number, number];
|
|
214
|
+
/**
|
|
215
|
+
* Enable node dragging
|
|
216
|
+
* @default false
|
|
217
|
+
*/
|
|
218
|
+
nodeDraggingEnabled?: boolean;
|
|
219
|
+
/**
|
|
220
|
+
* If true, hides the legend
|
|
221
|
+
*/
|
|
222
|
+
hideLegend?: boolean;
|
|
223
|
+
/**
|
|
224
|
+
* Legend position
|
|
225
|
+
* @default LegendPosition.BottomCenter
|
|
226
|
+
*/
|
|
227
|
+
legendPosition?: LegendPosition;
|
|
228
|
+
/**
|
|
229
|
+
* Legend style
|
|
230
|
+
*/
|
|
231
|
+
legendStyle?: string | Record<string, string>;
|
|
232
|
+
/**
|
|
233
|
+
* Legend items configuration
|
|
234
|
+
*/
|
|
235
|
+
legendItems?: BulletLegendItemInterface[];
|
|
236
|
+
/**
|
|
237
|
+
* Custom formatter for tooltip titles
|
|
238
|
+
*/
|
|
239
|
+
tooltipTitleFormatter?: (node: N) => string | number;
|
|
240
|
+
/**
|
|
241
|
+
* Custom formatter for tooltip content
|
|
242
|
+
*/
|
|
243
|
+
tooltipContentFormatter?: (node: N) => string;
|
|
244
|
+
/**
|
|
245
|
+
* Configuration object for the chart tooltip.
|
|
246
|
+
*/
|
|
247
|
+
tooltip?: TooltipConfig;
|
|
248
|
+
/**
|
|
249
|
+
* Animation duration in milliseconds
|
|
250
|
+
* @default 600
|
|
251
|
+
*/
|
|
252
|
+
duration?: number;
|
|
253
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Donut as
|
|
3
|
-
import { DonutType as
|
|
4
|
-
import
|
|
5
|
-
import { VisSingleContainer as
|
|
6
|
-
import { LegendPosition as
|
|
7
|
-
const
|
|
1
|
+
import { defineComponent as L, useSlots as S, useTemplateRef as P, ref as W, computed as s, createElementBlock as y, openBlock as d, normalizeStyle as u, createVNode as a, createCommentVNode as c, createElementVNode as h, unref as i, withCtx as b, createBlock as N, renderSlot as f } from "vue";
|
|
2
|
+
import { Donut as $ } from "@unovis/ts";
|
|
3
|
+
import { DonutType as j } from "./types.js";
|
|
4
|
+
import z from "../Tooltip.js";
|
|
5
|
+
import { VisSingleContainer as H, VisTooltip as E, VisDonut as F, VisBulletLegend as O } from "@unovis/vue";
|
|
6
|
+
import { LegendPosition as R } from "../../types.js";
|
|
7
|
+
const M = { style: {
|
|
8
8
|
position: "absolute",
|
|
9
9
|
top: "50%",
|
|
10
10
|
left: "50%",
|
|
11
11
|
transform: "translate(-50%, -50%)"
|
|
12
|
-
} },
|
|
12
|
+
} }, U = {
|
|
13
13
|
ref: "slotWrapper",
|
|
14
14
|
style: { display: "none" }
|
|
15
|
-
},
|
|
15
|
+
}, X = /* @__PURE__ */ L({
|
|
16
16
|
__name: "DonutChart",
|
|
17
17
|
props: {
|
|
18
18
|
type: {},
|
|
@@ -21,98 +21,108 @@ const R = { style: {
|
|
|
21
21
|
height: {},
|
|
22
22
|
radius: {},
|
|
23
23
|
hideLegend: { type: Boolean },
|
|
24
|
-
legendPosition: { default:
|
|
24
|
+
legendPosition: { default: R.BottomCenter },
|
|
25
25
|
legendStyle: {},
|
|
26
26
|
categories: {},
|
|
27
27
|
padAngle: {},
|
|
28
|
-
tooltipTitleFormatter: {}
|
|
28
|
+
tooltipTitleFormatter: {},
|
|
29
|
+
hideTooltip: { type: Boolean },
|
|
30
|
+
tooltip: { default: () => ({
|
|
31
|
+
followCursor: !0
|
|
32
|
+
}) },
|
|
33
|
+
duration: { default: 600 }
|
|
29
34
|
},
|
|
30
35
|
emits: ["click"],
|
|
31
|
-
setup(l, { emit:
|
|
32
|
-
const C =
|
|
33
|
-
function
|
|
34
|
-
const o = Object.values(
|
|
35
|
-
return
|
|
36
|
+
setup(l, { emit: v }) {
|
|
37
|
+
const C = v, e = l, w = S(), g = P("slotWrapper"), n = W(), k = (t) => t, T = e.type === j.Half;
|
|
38
|
+
function V(t) {
|
|
39
|
+
const o = Object.values(e.categories)[t.index].name;
|
|
40
|
+
return n.value = {
|
|
36
41
|
label: o,
|
|
37
|
-
[o]:
|
|
38
|
-
},
|
|
42
|
+
[o]: t.data
|
|
43
|
+
}, x();
|
|
39
44
|
}
|
|
40
|
-
function
|
|
41
|
-
return typeof window > "u" ? "" :
|
|
45
|
+
function x() {
|
|
46
|
+
return typeof window > "u" ? "" : g.value ? g.value.innerHTML : "";
|
|
42
47
|
}
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
if (
|
|
46
|
-
return
|
|
48
|
+
const B = s(() => e.legendPosition.includes("top")), D = s(() => e.legendPosition.includes("left") ? "flex-start" : e.legendPosition.includes("right") ? "flex-end" : "center"), p = (t, o = "#ccc") => t ? Array.isArray(t) ? t[0] || o : t : o, m = s(() => Object.values(e.categories)), A = (t, o) => {
|
|
49
|
+
const r = m.value[o];
|
|
50
|
+
if (r)
|
|
51
|
+
return p(r.color);
|
|
47
52
|
};
|
|
48
|
-
return (
|
|
49
|
-
style:
|
|
53
|
+
return (t, o) => (d(), y("div", {
|
|
54
|
+
style: u({
|
|
50
55
|
display: "flex",
|
|
51
|
-
flexDirection:
|
|
56
|
+
flexDirection: B.value ? "column-reverse" : "column",
|
|
52
57
|
gap: "var(--vis-legend-spacing)"
|
|
53
58
|
}),
|
|
54
|
-
onClick: o[0] || (o[0] = (
|
|
59
|
+
onClick: o[0] || (o[0] = (r) => C("click", r, n.value))
|
|
55
60
|
}, [
|
|
56
|
-
a(
|
|
61
|
+
a(i(H), {
|
|
57
62
|
data: l.data,
|
|
58
63
|
height: l.height,
|
|
64
|
+
duration: l.duration,
|
|
59
65
|
margin: {}
|
|
60
66
|
}, {
|
|
61
67
|
default: b(() => [
|
|
62
|
-
|
|
68
|
+
l.hideTooltip ? c("", !0) : (d(), N(i(E), {
|
|
69
|
+
key: 0,
|
|
63
70
|
"horizontal-shift": 20,
|
|
64
71
|
"vertical-shift": 20,
|
|
72
|
+
followCursor: e.tooltip.followCursor,
|
|
73
|
+
"show-delay": e.tooltip.showDelay,
|
|
74
|
+
"hide-delay": e.tooltip.hideDelay,
|
|
65
75
|
triggers: {
|
|
66
|
-
[
|
|
76
|
+
[i($).selectors.segment]: V
|
|
67
77
|
}
|
|
68
|
-
}, null, 8, ["triggers"]),
|
|
69
|
-
a(
|
|
70
|
-
value:
|
|
78
|
+
}, null, 8, ["followCursor", "show-delay", "hide-delay", "triggers"])),
|
|
79
|
+
a(i(F), {
|
|
80
|
+
value: k,
|
|
71
81
|
"corner-radius": l.radius,
|
|
72
82
|
"arc-width": l.arcWidth ?? 20,
|
|
73
|
-
color:
|
|
74
|
-
"angle-range":
|
|
75
|
-
"pad-angle":
|
|
83
|
+
color: A,
|
|
84
|
+
"angle-range": T ? [-1.5707963267948966, 1.5707963267948966] : [],
|
|
85
|
+
"pad-angle": e.padAngle || 0
|
|
76
86
|
}, null, 8, ["corner-radius", "arc-width", "angle-range", "pad-angle"]),
|
|
77
|
-
|
|
78
|
-
|
|
87
|
+
h("div", M, [
|
|
88
|
+
f(t.$slots, "default")
|
|
79
89
|
])
|
|
80
90
|
]),
|
|
81
91
|
_: 3
|
|
82
|
-
}, 8, ["data", "height"]),
|
|
83
|
-
|
|
92
|
+
}, 8, ["data", "height", "duration"]),
|
|
93
|
+
e.hideLegend ? c("", !0) : (d(), y("div", {
|
|
84
94
|
key: 0,
|
|
85
|
-
style:
|
|
95
|
+
style: u({
|
|
86
96
|
display: "flex",
|
|
87
|
-
justifyContent:
|
|
97
|
+
justifyContent: D.value
|
|
88
98
|
})
|
|
89
99
|
}, [
|
|
90
|
-
a(
|
|
91
|
-
style:
|
|
92
|
-
|
|
100
|
+
a(i(O), {
|
|
101
|
+
style: u([
|
|
102
|
+
e.legendStyle,
|
|
93
103
|
"display: flex; gap: var(--vis-legend-spacing);"
|
|
94
104
|
]),
|
|
95
|
-
items:
|
|
96
|
-
...
|
|
97
|
-
color:
|
|
105
|
+
items: m.value.map((r) => ({
|
|
106
|
+
...r,
|
|
107
|
+
color: p(r.color)
|
|
98
108
|
}))
|
|
99
109
|
}, null, 8, ["style", "items"])
|
|
100
110
|
], 4)),
|
|
101
|
-
|
|
102
|
-
|
|
111
|
+
h("div", U, [
|
|
112
|
+
i(w).tooltip ? f(t.$slots, "tooltip", {
|
|
103
113
|
key: 0,
|
|
104
|
-
values:
|
|
105
|
-
}) :
|
|
106
|
-
a(
|
|
107
|
-
data:
|
|
108
|
-
categories:
|
|
109
|
-
"title-formatter":
|
|
114
|
+
values: n.value
|
|
115
|
+
}) : n.value ? f(t.$slots, "fallback", { key: 1 }, () => [
|
|
116
|
+
a(z, {
|
|
117
|
+
data: n.value,
|
|
118
|
+
categories: e.categories,
|
|
119
|
+
"title-formatter": e.tooltipTitleFormatter
|
|
110
120
|
}, null, 8, ["data", "categories", "title-formatter"])
|
|
111
|
-
]) :
|
|
121
|
+
]) : c("", !0)
|
|
112
122
|
], 512)
|
|
113
123
|
], 4));
|
|
114
124
|
}
|
|
115
125
|
});
|
|
116
126
|
export {
|
|
117
|
-
|
|
127
|
+
X as default
|
|
118
128
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BulletLegendItemInterface, LegendPosition } from '../../types';
|
|
1
|
+
import { BulletLegendItemInterface, LegendPosition, TooltipConfig } from '../../types';
|
|
2
2
|
export type DonutChartProps<T> = {
|
|
3
3
|
/**
|
|
4
4
|
* The type of donut chart to render.
|
|
@@ -17,7 +17,7 @@ export type DonutChartProps<T> = {
|
|
|
17
17
|
/**
|
|
18
18
|
* The height of the chart in pixels.
|
|
19
19
|
*/
|
|
20
|
-
height
|
|
20
|
+
height?: number;
|
|
21
21
|
/**
|
|
22
22
|
* The radius of the donut in pixels.
|
|
23
23
|
*/
|
|
@@ -48,6 +48,18 @@ export type DonutChartProps<T> = {
|
|
|
48
48
|
* Use custom formatter for tooltip titles
|
|
49
49
|
*/
|
|
50
50
|
tooltipTitleFormatter?: (data: T) => string | number;
|
|
51
|
+
/**
|
|
52
|
+
* If `true`, hides the chart tooltip.
|
|
53
|
+
*/
|
|
54
|
+
hideTooltip?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Configuration object for the chart tooltip.
|
|
57
|
+
*/
|
|
58
|
+
tooltip?: TooltipConfig;
|
|
59
|
+
/**
|
|
60
|
+
* Animation duration in milliseconds.
|
|
61
|
+
*/
|
|
62
|
+
duration?: number;
|
|
51
63
|
};
|
|
52
64
|
declare enum DonutType {
|
|
53
65
|
Half = "half",
|