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 +2 -1
- package/package.json +1 -1
- package/src/2d/Axes.svelte +1 -1
- package/src/2d/XAxis.svelte +4 -3
- package/src/2d/YAxis.svelte +4 -3
- package/src/methods.js +3 -2
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.
|
|
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
package/src/2d/Axes.svelte
CHANGED
package/src/2d/XAxis.svelte
CHANGED
|
@@ -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
|
-
[
|
|
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>
|
package/src/2d/YAxis.svelte
CHANGED
|
@@ -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
|
-
[
|
|
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
|
-
|
|
889
|
-
let
|
|
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
|