svelte-tiny-linked-charts 1.1.4 → 1.2.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/README.md +1 -0
- package/package.json +2 -1
- package/src/LinkedChart.svelte +2 -1
package/README.md
CHANGED
|
@@ -81,6 +81,7 @@ uid | | Unique ID to link this chart to a LinkedValue component with the same ui
|
|
|
81
81
|
height | 40 | Height of the chart in pixels.
|
|
82
82
|
width | 150 | Width of the chart in pixels.
|
|
83
83
|
barMinWidth | 4 | Width of the bars in the chart in pixels.
|
|
84
|
+
barMinHeight | 0 | Mimumum height of the bars in the chart in pixels.
|
|
84
85
|
grow | false | Whether or not the bar should grow to fill out the full width of the chart.
|
|
85
86
|
align | right | The side the bars should align to when they do not completely fill out the chart.
|
|
86
87
|
gap | 1 | Gap between the bars in pixels.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-tiny-linked-charts",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "rollup -c",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"src/"
|
|
41
41
|
],
|
|
42
42
|
"license": "MIT",
|
|
43
|
+
"type": "module",
|
|
43
44
|
"main": "src/index.js",
|
|
44
45
|
"module": "src/index.mjs",
|
|
45
46
|
"svelte": "src/index.js",
|
package/src/LinkedChart.svelte
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
export let height = 40
|
|
11
11
|
export let width = 150
|
|
12
12
|
export let barMinWidth = 4
|
|
13
|
+
export let barMinHeight = 0
|
|
13
14
|
export let grow = false
|
|
14
15
|
export let align = "right"
|
|
15
16
|
export let gap = 1
|
|
@@ -61,7 +62,7 @@
|
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
function getHeight(value) {
|
|
64
|
-
return Math.round((parseInt(height) / highestValue) * value - (type == "line" ? barWidth / 2 : 0)) || 0
|
|
65
|
+
return Math.max(Math.round((parseInt(height) / highestValue) * value - (type == "line" ? barWidth / 2 : 0)) || 0, barMinHeight)
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
function getBarWidth() {
|