svelte-plots-basic 3.0.5 → 3.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "svelte-plots-basic",
3
3
  "description": "Svelte components for creating simple plots",
4
- "version": "3.0.5",
4
+ "version": "3.0.6",
5
5
  "author": "Sergey Kucheryavskiy",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -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: true, breaks, colmap, labels, labelColor, fontSize})
53
+ axes.setColmapLegend({show, breaks, colmap, labels, labelColor, fontSize})
53
54
  });
54
55
  </script>
55
56
 
@@ -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: true, position, items, lineColor, faceColor, lineWidth, fontSize} :
126
+ {show, position, items, lineColor, faceColor, lineWidth, fontSize} :
126
127
  {show: false, position: null, items: null}
127
128
  );
128
129
  });
@@ -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 // should the tick positions be a whole number or not.
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: true, error: error, label: axisLabel, ticks: ticksProcessed,
59
+ axes.setXAxis({show, error: error, label: axisLabel, ticks: ticksProcessed,
59
60
  labelHeight, showGrid, las, whole, tickLabels});
60
61
  });
61
62
  </script>
@@ -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 // should the ticks be a whole number or not
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: true, error: error, label: axisLabel, ticks: ticksProcessed,
62
+ axes.setYAxis({show, error: error, label: axisLabel, ticks: ticksProcessed,
62
63
  labelHeight, showGrid, las, whole, tickLabels, pos: 4});
63
64
  });
64
65
  </script>