@likable-hair/svelte 3.2.10 → 3.2.11

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.
@@ -28,7 +28,7 @@ onMount(async () => {
28
28
  export let data = {
29
29
  labels: [],
30
30
  datasets: []
31
- }, horizontal = false, responsive = true, maintainAspectRatio = true, showLegend = true, showYTicks = false, showXTicks = false, displayYGrid = true, lineWidth = 1, enableZoom = false, resetZoom = false, xTickStepSize = void 0, yTickStepSize = void 0, xMax = void 0, yMax = void 0;
31
+ }, horizontal = false, responsive = true, maintainAspectRatio = true, showLegend = true, showYTicks = false, showXTicks = false, displayYGrid = true, displayXGrid = true, gridLineWidth = 1, lineWidth = 3, enableZoom = false, resetZoom = false, xTickStepSize = void 0, yTickStepSize = void 0, xMax = void 0, yMax = void 0, xMin = void 0, yMin = void 0, pointRadius = void 0, hitRadius = void 0, hoverRadius = void 0, tooltipsDisabled = false;
32
32
  $:
33
33
  gridColor = "rgb(" + (background || "200, 200, 200") + ", .3)";
34
34
  let chart;
@@ -38,10 +38,13 @@ $:
38
38
  resetZoom = false;
39
39
  }
40
40
  $:
41
- if (enableZoom && mounted) {
41
+ if (mounted) {
42
42
  import("chartjs-plugin-zoom").then(({ default: zoomPlugin }) => {
43
43
  ChartJS.register(zoomPlugin);
44
44
  zoomMounted = true;
45
+ setTimeout(() => {
46
+ chart?.resetZoom();
47
+ }, 20);
45
48
  });
46
49
  }
47
50
  let chartOptions;
@@ -50,22 +53,35 @@ $:
50
53
  indexAxis: horizontal ? "y" : "x",
51
54
  responsive,
52
55
  maintainAspectRatio,
56
+ elements: {
57
+ line: {
58
+ borderWidth: lineWidth
59
+ },
60
+ point: {
61
+ radius: pointRadius,
62
+ hitRadius,
63
+ hoverRadius
64
+ }
65
+ },
53
66
  plugins: {
54
67
  legend: {
55
68
  display: showLegend
56
69
  },
57
70
  zoom: {
58
71
  pan: {
59
- enabled: true,
72
+ enabled: enableZoom,
60
73
  mode: "x",
61
74
  modifierKey: "ctrl"
62
75
  },
63
76
  zoom: {
64
77
  drag: {
65
- enabled: true
78
+ enabled: enableZoom
66
79
  },
67
80
  mode: "x"
68
81
  }
82
+ },
83
+ tooltip: {
84
+ enabled: !tooltipsDisabled
69
85
  }
70
86
  },
71
87
  interaction: {
@@ -74,7 +90,8 @@ $:
74
90
  scales: {
75
91
  x: {
76
92
  max: xMax,
77
- display: true,
93
+ min: xMin,
94
+ display: displayXGrid,
78
95
  title: {
79
96
  display: true
80
97
  },
@@ -91,10 +108,11 @@ $:
91
108
  },
92
109
  y: {
93
110
  max: yMax,
111
+ min: yMin,
94
112
  display: displayYGrid,
95
113
  title: {},
96
114
  grid: {
97
- lineWidth,
115
+ lineWidth: gridLineWidth,
98
116
  color: gridColor
99
117
  },
100
118
  border: {
@@ -20,6 +20,8 @@ declare const __propDef: {
20
20
  showYTicks?: boolean | undefined;
21
21
  showXTicks?: boolean | undefined;
22
22
  displayYGrid?: boolean | undefined;
23
+ displayXGrid?: boolean | undefined;
24
+ gridLineWidth?: number | undefined;
23
25
  lineWidth?: number | undefined;
24
26
  enableZoom?: boolean | undefined;
25
27
  resetZoom?: boolean | undefined;
@@ -27,6 +29,12 @@ declare const __propDef: {
27
29
  yTickStepSize?: number | undefined;
28
30
  xMax?: number | undefined;
29
31
  yMax?: number | undefined;
32
+ xMin?: number | undefined;
33
+ yMin?: number | undefined;
34
+ pointRadius?: number | undefined;
35
+ hitRadius?: number | undefined;
36
+ hoverRadius?: number | undefined;
37
+ tooltipsDisabled?: boolean | undefined;
30
38
  };
31
39
  events: {
32
40
  [evt: string]: CustomEvent<any>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@likable-hair/svelte",
3
3
  "description": "A Svelte component for likablehair and others",
4
- "version": "3.2.10",
4
+ "version": "3.2.11",
5
5
  "scripts": {
6
6
  "host": "vite --host",
7
7
  "dev": "vite dev",