vue-chrts 1.0.0 → 2.0.0-beta.1

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/index.js CHANGED
@@ -1,22 +1,20 @@
1
- import { default as a } from "./components/AreaChart/AreaChart.js";
1
+ import { default as e } from "./components/AreaChart/AreaChart.js";
2
2
  import { default as o } from "./components/LineChart/LineChart.js";
3
3
  import { default as p } from "./components/BarChart/BarChart.js";
4
4
  import { default as m } from "./components/DonutChart/DonutChart.js";
5
- import { default as d } from "./components/BubbleChart/BubbleChart.js";
6
- import { default as n } from "./components/Maps/TopoJSONMap/TopoJSONMap.js";
7
- import { default as C } from "./components/GanttChart/GanttChart.js";
8
- import { CurveType as i, LegendPosition as T, Orientation as b } from "./types.js";
9
- import { DonutType as B } from "./components/DonutChart/types.js";
5
+ import { default as x } from "./components/BubbleChart/BubbleChart.js";
6
+ import { default as l } from "./components/GanttChart/GanttChart.js";
7
+ import { CurveType as C, LegendPosition as h, Orientation as i } from "./types.js";
8
+ import { DonutType as y } from "./components/DonutChart/types.js";
10
9
  export {
11
- a as AreaChart,
10
+ e as AreaChart,
12
11
  p as BarChart,
13
- d as BubbleChart,
14
- i as CurveType,
12
+ x as BubbleChart,
13
+ C as CurveType,
15
14
  m as DonutChart,
16
- B as DonutType,
17
- C as GanttChart,
18
- T as LegendPosition,
15
+ y as DonutType,
16
+ l as GanttChart,
17
+ h as LegendPosition,
19
18
  o as LineChart,
20
- b as Orientation,
21
- n as TopoJSONMap
19
+ i as Orientation
22
20
  };
package/dist/types.d.ts CHANGED
@@ -62,13 +62,18 @@ export interface AxisConfig {
62
62
  minMaxTicksOnlyShowGridLines?: boolean;
63
63
  tickValues?: readonly number[] | readonly Date[];
64
64
  }
65
- export interface MarkerConfig {
66
- type?: "circle" | "square" | "triangle" | "diamond";
67
- size?: number;
68
- strokeWidth?: number;
69
- color?: string;
70
- strokeColor?: string;
71
- }
65
+ export type MarkerConfig = {
66
+ id: string;
67
+ config: {
68
+ [key: string]: {
69
+ type?: "circle" | "square" | "triangle" | "diamond";
70
+ size?: number;
71
+ strokeWidth?: number;
72
+ color?: string;
73
+ strokeColor?: string;
74
+ };
75
+ };
76
+ };
72
77
  export interface CrosshairConfig {
73
78
  color?: string;
74
79
  strokeColor?: string;
package/dist/utils.d.ts CHANGED
@@ -2,7 +2,7 @@ import { MarkerConfig } from './types';
2
2
  export declare function getDistributedIndices(length: number, numTicks: number): number[];
3
3
  export declare function getFirstPropertyValue(obj: unknown): undefined;
4
4
  export declare const markerShape: (type: string, size: number, strokeWidth: number, color: string, strokeColor: string) => string;
5
- export declare function createMarkers(markerConfig: Record<string, MarkerConfig>): string;
5
+ export declare function createMarkers(markerConfig: MarkerConfig): string;
6
6
  export declare const flattenData: (data: any[], xAxis: string) => {
7
7
  month: any;
8
8
  }[];
package/dist/utils.js CHANGED
@@ -1,4 +1,4 @@
1
- function m(t) {
1
+ function p(t) {
2
2
  if (t && Object.keys(t).length > 0) {
3
3
  const e = Object.keys(t)[0];
4
4
  return t[e];
@@ -18,10 +18,10 @@ const o = (t, e, r, n, $) => {
18
18
  return "";
19
19
  }
20
20
  };
21
- function p(t) {
22
- return Object.entries(t).map(([e, r]) => {
21
+ function m(t) {
22
+ return Object.entries(t.config).map(([e, r]) => {
23
23
  const n = r.type || "circle", $ = r.size || 10, c = r.strokeWidth || 2, a = r.color || "#000", l = r.strokeColor || r.color || "#000";
24
- return `<marker id="circle-marker-${e}" viewBox="0 0 ${$} ${$}" refX="${$ / 2}" refY="${$ / 2}" markerWidth="${$ / 2}" markerHeight="${$ / 2}">
24
+ return `<marker id="${t.id}-${e}" viewBox="0 0 ${$} ${$}" refX="${$ / 2}" refY="${$ / 2}" markerWidth="${$ / 2}" markerHeight="${$ / 2}">
25
25
  ${o(n, $, c, a, l)}
26
26
  </marker>`;
27
27
  }).join(`
@@ -42,9 +42,9 @@ const f = (t, e) => {
42
42
  }));
43
43
  }, y = (t) => Intl.DateTimeFormat().format(t);
44
44
  export {
45
- p as createMarkers,
45
+ m as createMarkers,
46
46
  y as dateFormatter,
47
47
  f as flattenData,
48
- m as getFirstPropertyValue,
48
+ p as getFirstPropertyValue,
49
49
  o as markerShape
50
50
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-chrts",
3
- "version": "1.0.0",
3
+ "version": "2.0.0-beta.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -28,8 +28,8 @@
28
28
  "@tanstack/vue-table": "^8.21.2",
29
29
  "@types/node": "^22.13.11",
30
30
  "@types/rollup": "^0.54.0",
31
- "@unovis/ts": "^1.6.1",
32
- "@unovis/vue": "^1.6.1",
31
+ "@unovis/ts": "^1.6.2",
32
+ "@unovis/vue": "^1.6.2",
33
33
  "@vitejs/plugin-vue": "^5.2.1",
34
34
  "@vue/tsconfig": "^0.7.0",
35
35
  "@vueuse/core": "^13.0.0",
@@ -1,59 +0,0 @@
1
- import { defineComponent as d, ref as m, computed as c, createElementBlock as f, openBlock as g, createVNode as r, unref as t, withCtx as v } from "vue";
2
- import { VisSingleContainer as S, VisTopoJSONMap as h, VisTooltip as _ } from "@unovis/vue";
3
- import { TopoJSONMap as n } from "@unovis/ts";
4
- const b = { class: "bg-white p-48" }, C = /* @__PURE__ */ d({
5
- __name: "TopoJSONMap",
6
- props: {
7
- mapFeatureKey: {},
8
- data: {}
9
- },
10
- setup(s) {
11
- const l = s, i = {
12
- [n.selectors.feature]: (e) => `${e.properties.name}`
13
- }, p = (e) => 5, a = m(null), u = c(() => a.value === "US" ? [
14
- { id: "US", color: "red" }
15
- ] : []);
16
- return console.log(l.data), (e, T) => (g(), f("div", b, [
17
- r(t(S), {
18
- height: 800,
19
- duration: 600,
20
- data: {
21
- areas: u.value,
22
- points: [
23
- {
24
- id: "ams",
25
- latitude: 52.35598,
26
- longitude: 4.95035,
27
- label: "Amsterdam",
28
- color: "red"
29
- }
30
- ]
31
- }
32
- }, {
33
- default: v(() => [
34
- r(t(h), {
35
- topojson: e.data,
36
- pointRadius: p,
37
- "point-label": (o) => o.label,
38
- "map-feature-name": e.mapFeatureKey,
39
- events: {
40
- [t(n).selectors.feature]: {
41
- mouseenter: (o) => {
42
- o.id === "US" && (a.value = "US");
43
- },
44
- mouseleave: (o) => {
45
- o.id === "US" && (a.value = null);
46
- }
47
- }
48
- }
49
- }, null, 8, ["topojson", "point-label", "map-feature-name", "events"]),
50
- r(t(_), { triggers: i })
51
- ]),
52
- _: 1
53
- }, 8, ["data"])
54
- ]));
55
- }
56
- });
57
- export {
58
- C as default
59
- };
@@ -1,14 +0,0 @@
1
- import { MapsData } from './types';
2
- declare const _default: <T extends Record<string, any>>(__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<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, never> & MapsData<T> & Partial<{}>> & import('vue').PublicProps;
4
- expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
5
- attrs: any;
6
- slots: {};
7
- emit: {};
8
- }>) => import('vue').VNode & {
9
- __ctx?: Awaited<typeof __VLS_setup>;
10
- };
11
- export default _default;
12
- type __VLS_PrettifyLocal<T> = {
13
- [K in keyof T]: T[K];
14
- } & {};
@@ -1,4 +0,0 @@
1
- import f from "./TopoJSONMap.js";
2
- export {
3
- f as default
4
- };
@@ -1,5 +0,0 @@
1
- import { Topology } from 'topojson-specification';
2
- export type MapsData<T extends Record<string, any>> = {
3
- mapFeatureKey: keyof T;
4
- data: Topology<T>;
5
- };