layerchart 0.38.4 → 0.38.5
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.
|
@@ -22,7 +22,7 @@ export let rule = false;
|
|
|
22
22
|
/** Draw a grid lines */
|
|
23
23
|
export let grid = false;
|
|
24
24
|
/** Control the number of ticks*/
|
|
25
|
-
export let ticks =
|
|
25
|
+
export let ticks = undefined;
|
|
26
26
|
/** Length of the tick line */
|
|
27
27
|
export let tickLength = 4;
|
|
28
28
|
/** Format tick labels */
|
|
@@ -50,8 +50,10 @@ $: tickVals = Array.isArray(ticks)
|
|
|
50
50
|
: typeof ticks === 'function'
|
|
51
51
|
? ticks(_scale)
|
|
52
52
|
: isScaleBand(_scale)
|
|
53
|
-
?
|
|
54
|
-
|
|
53
|
+
? ticks
|
|
54
|
+
? _scale.domain().filter((v, i) => i % ticks === 0)
|
|
55
|
+
: _scale.domain()
|
|
56
|
+
: _scale.ticks(ticks ?? (placement === 'left' || placement === 'right' ? 4 : undefined));
|
|
55
57
|
function getCoords(tick) {
|
|
56
58
|
switch (placement) {
|
|
57
59
|
case 'top':
|