svelte-plots-basic 3.1.4 → 3.1.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/README.md CHANGED
@@ -15,8 +15,9 @@ These websites and web-applications use `svelte-plots-basic` library:
15
15
 
16
16
  ## News
17
17
 
18
- ### 3.1.1-3.1.4
18
+ ### 3.1.1-3.1.6
19
19
 
20
+ * Fixed bug which sometimes caused an error when manual text tick labels provided.
20
21
  * Added `markerSize` specification to legend items.
21
22
  * Small improvements and bug fixes.
22
23
 
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.1.4",
4
+ "version": "3.1.6",
5
5
  "author": "Sergey Kucheryavskiy",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -303,7 +303,7 @@
303
303
  fill={item.point.faceColor}
304
304
  stroke-width={item.point.lineWidth}
305
305
  stroke={item.point.lineColor}
306
- font-size="{item.markerSize}em"
306
+ font-size="{item.point.markerSize}em"
307
307
  >{MARKER_SYMBOLS[item.point.marker - 1]}</text>
308
308
  {/if}
309
309
 
@@ -47,16 +47,17 @@
47
47
  // if ticks are provided check if they are valid and preprocess them
48
48
  let ticksProcessed, error = '';
49
49
  if (ticks) {
50
- [ticksProcessed, error] = validateTicks(ticks, axes.limX())
50
+ [ticksProcessed, error] = validateTicks(ticks, axes.limX());
51
51
  }
52
52
 
53
53
  // if tick labels are provided check if they are valid and preprocess them
54
+ let tickLabelsProcessed;
54
55
  if (!error && tickLabels) {
55
- [tickLabels, error] = validateTickLabels(tickLabels, ticksProcessed);
56
+ [tickLabelsProcessed, error] = validateTickLabels(tickLabels, ticksProcessed);
56
57
  }
57
58
 
58
59
  // activate axis
59
60
  axes.setXAxis({show, error: error, label: axisLabel, ticks: ticksProcessed,
60
- labelHeight, showGrid, las, whole, tickLabels});
61
+ labelHeight, showGrid, las, whole, tickLabels: tickLabelsProcessed});
61
62
  });
62
63
  </script>
@@ -50,16 +50,17 @@
50
50
  // if ticks are provided check if they are valid and preprocess them
51
51
  let ticksProcessed, error = '';
52
52
  if (ticks) {
53
- [ticksProcessed, error] = validateTicks(ticks, axes.limY())
53
+ [ticksProcessed, error] = validateTicks(ticks, axes.limY());
54
54
  }
55
55
 
56
56
  // if tick labels are provided check if they are valid and preprocess them
57
+ let tickLabelsProcessed;
57
58
  if (!error && tickLabels) {
58
- [tickLabels, error] = validateTickLabels(tickLabels, ticksProcessed);
59
+ [tickLabelsProcessed, error] = validateTickLabels(tickLabels, ticksProcessed);
59
60
  }
60
61
 
61
62
  // activate axis
62
63
  axes.setYAxis({show, error: error, label: axisLabel, ticks: ticksProcessed,
63
- labelHeight, showGrid, las, whole, tickLabels, pos: 4});
64
+ labelHeight, showGrid, las, whole, tickLabels: tickLabelsProcessed, pos: 4});
64
65
  });
65
66
  </script>
package/src/methods.js CHANGED
@@ -885,8 +885,9 @@ export function getcolmap(n, alpha) {
885
885
  */
886
886
  export function getXAxisParams(limX, limY, scales, tY, axis) {
887
887
 
888
- let ticks = axis.ticks;
889
- let tickLabels = axis.tickLabels;
888
+
889
+ let ticks = axis.error ? null : axis.ticks ;
890
+ let tickLabels = axis.error ? null : axis.tickLabels;
890
891
  let tickFactor = 0;
891
892
 
892
893
  // compute x-coordinates of the ticks or take the ones manually specified by user