svelte-plots-basic 3.0.5 → 3.0.7
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/package.json +1 -1
- package/src/2d/Axes.svelte +3 -3
- package/src/2d/ColormapLegend.svelte +2 -1
- package/src/2d/Legend.svelte +2 -1
- package/src/2d/XAxis.svelte +4 -3
- package/src/2d/YAxis.svelte +4 -3
- package/src/constants.js +1 -1
package/package.json
CHANGED
package/src/2d/Axes.svelte
CHANGED
|
@@ -256,11 +256,11 @@
|
|
|
256
256
|
|
|
257
257
|
|
|
258
258
|
{#if params.labelsFactor !== 0}
|
|
259
|
-
{@const x = coords.start +
|
|
260
|
-
<text {x} y={coords.ltop} dx=
|
|
259
|
+
{@const x = coords.start + n * coords.width }
|
|
260
|
+
<text {x} y={coords.ltop} dx="1.2em" dy="-0.25em" dominant-baseline="hanging"
|
|
261
261
|
fill={params.labelColor}
|
|
262
262
|
font-size="{params.fontSize}em"
|
|
263
|
-
text-anchor="
|
|
263
|
+
text-anchor="right"
|
|
264
264
|
>{@html getTickFactorLabel(params.labelsFactor)}</text>
|
|
265
265
|
{/if}
|
|
266
266
|
{/snippet}
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
|
|
41
41
|
let {
|
|
42
42
|
breaks, // vector with breaks for color intervals or vector with their indices
|
|
43
|
+
show = true, // logical, use to hide the element
|
|
43
44
|
colmap, // array with colors for each interval
|
|
44
45
|
labels = null, // optional vector with labels for interval boundaries or elements
|
|
45
46
|
labelColor = Colors.CLEGEND_LABELS, // color of labels
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
// get axes context and set the parameters of colormap legend (the rest will be done by Axes component)
|
|
50
51
|
const axes = getContext('axes');
|
|
51
52
|
$effect(() => {
|
|
52
|
-
axes.setColmapLegend({show
|
|
53
|
+
axes.setColmapLegend({show, breaks, colmap, labels, labelColor, fontSize})
|
|
53
54
|
});
|
|
54
55
|
</script>
|
|
55
56
|
|
package/src/2d/Legend.svelte
CHANGED
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
|
|
47
47
|
let {
|
|
48
48
|
items, // array with text labels and their visual properties for each legend element.
|
|
49
|
+
show = true, // logical, use to hide the element
|
|
49
50
|
position = 'topleft', // position of the legend ("topleft", "top", "topright", "right", "bottomright", etc).
|
|
50
51
|
lineColor = Colors.LEGEND, // color of the legend box line
|
|
51
52
|
lineWidth = 1, // width (thickness) of the legend box line
|
|
@@ -122,7 +123,7 @@
|
|
|
122
123
|
const newPosition = checkPosition(position);
|
|
123
124
|
axes.setGroupLegend(
|
|
124
125
|
newItems && newPosition ?
|
|
125
|
-
{show
|
|
126
|
+
{show, position, items, lineColor, faceColor, lineWidth, fontSize} :
|
|
126
127
|
{show: false, position: null, items: null}
|
|
127
128
|
);
|
|
128
129
|
});
|
package/src/2d/XAxis.svelte
CHANGED
|
@@ -26,11 +26,12 @@
|
|
|
26
26
|
|
|
27
27
|
let {
|
|
28
28
|
label, // text label
|
|
29
|
-
showGrid = false, // logical, show or not grid lines
|
|
30
29
|
ticks, // vector with numeric tick positions (by default is computed automatically)
|
|
31
30
|
tickLabels, // vector with labels for each tick (by default tick position values will be used)
|
|
32
31
|
las = 1, // orientation of tick labels (1 - horizontal, 2 - vertical)
|
|
33
|
-
whole = false
|
|
32
|
+
whole = false, // should the tick positions be a whole number or not.
|
|
33
|
+
show = true, // logical, use to hide the element
|
|
34
|
+
showGrid = false, // logical, show or not grid lines
|
|
34
35
|
} = $props();
|
|
35
36
|
|
|
36
37
|
// get axes context and send axis parameters to parent
|
|
@@ -55,7 +56,7 @@
|
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
// activate axis
|
|
58
|
-
axes.setXAxis({show
|
|
59
|
+
axes.setXAxis({show, error: error, label: axisLabel, ticks: ticksProcessed,
|
|
59
60
|
labelHeight, showGrid, las, whole, tickLabels});
|
|
60
61
|
});
|
|
61
62
|
</script>
|
package/src/2d/YAxis.svelte
CHANGED
|
@@ -29,9 +29,10 @@
|
|
|
29
29
|
label, // text label
|
|
30
30
|
ticks, // vector with numeric tick positions (by default is computed automatically)
|
|
31
31
|
tickLabels, // vector with labels for each tick (by default tick values will be used)
|
|
32
|
-
showGrid = false, // logical, show or not grid lines
|
|
33
32
|
las = 1, // orientation of tick labels (1 - horizontal, 2 - vertical)
|
|
34
|
-
whole = false
|
|
33
|
+
whole = false, // should the ticks be a whole number or not
|
|
34
|
+
show = true, // logical, use to hide the element
|
|
35
|
+
showGrid = false, // logical, show or not grid lines
|
|
35
36
|
} = $props();
|
|
36
37
|
|
|
37
38
|
|
|
@@ -58,7 +59,7 @@
|
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
// activate axis
|
|
61
|
-
axes.setYAxis({show
|
|
62
|
+
axes.setYAxis({show, error: error, label: axisLabel, ticks: ticksProcessed,
|
|
62
63
|
labelHeight, showGrid, las, whole, tickLabels, pos: 4});
|
|
63
64
|
});
|
|
64
65
|
</script>
|