layerchart 0.43.4 → 0.43.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.
@@ -45,13 +45,13 @@ declare class __sveltets_Render<TData> {
45
45
  /** The r accessor. The key in each row of data that corresponds to the r-field. This can be a string, an accessor function, a number or an array of any combination of those types. This property gets converted to a function when you access it through the context. */
46
46
  r?: Accessor<TData>;
47
47
  /** Set a min or max. For linear scales, if you want to inherit the value from the data's extent, set that value to `null`. This value can also be an array because sometimes your scales are [piecewise](https://github.com/d3/d3-scale#continuous_domain) or are a list of discrete values such as in [ordinal scales](https://github.com/d3/d3-scale#ordinal-scales), useful for color series. Set it to a function that receives the computed domain and lets you return a modified domain, useful for sorting values. */
48
- xDomain?: Function | string[] | [number | Date | null, number | Date | null] | (number | null)[] | Date[] | null[] | null;
48
+ xDomain?: Function | (string | number | Date | null | undefined)[] | null;
49
49
  /** Set a min or max. For linear scales, if you want to inherit the value from the data's extent, set that value to `null`. Set it to a function that receives the computed domain and lets you return a modified domain, useful for sorting values. */
50
- yDomain?: Function | string[] | [number | Date | null, number | Date | null] | (number | null)[] | Date[] | null[] | null;
50
+ yDomain?: Function | (string | number | Date | null | undefined)[] | null;
51
51
  /** Set a min or max. For linear scales, if you want to inherit the value from the data's extent, set that value to `null`. This value can also be an array because sometimes your scales are [piecewise](https://github.com/d3/d3-scale#continuous_domain) or are a list of discrete values such as in [ordinal scales](https://github.com/d3/d3-scale#ordinal-scales), useful for color series. Set it to a function that receives the computed domain and lets you return a modified domain, useful for sorting values. */
52
- zDomain?: Function | string[] | [number | Date | null, number | Date | null] | (number | null)[] | Date[] | null[] | null;
52
+ zDomain?: Function | (string | number | Date | null | undefined)[] | null;
53
53
  /** Set a min or max. For linear scales, if you want to inherit the value from the data's extent, set that value to `null`. This value can also be an array because sometimes your scales are [piecewise](https://github.com/d3/d3-scale#continuous_domain) or are a list of discrete values such as in [ordinal scales](https://github.com/d3/d3-scale#ordinal-scales), useful for color series. Set it to a function that receives the computed domain and lets you return a modified domain, useful for sorting values. */
54
- rDomain?: Function | string[] | [number | Date | null, number | Date | null] | (number | null)[] | Date[] | null[] | null;
54
+ rDomain?: Function | (string | number | Date | null | undefined)[] | null;
55
55
  /** Applies D3's [scale.nice()](https://github.com/d3/d3-scale#continuous_nice) to the x domain. @default false */
56
56
  xNice?: boolean | number;
57
57
  /** Applies D3's [scale.nice()](https://github.com/d3/d3-scale#continuous_nice) to the y domain. @default false */
@@ -305,7 +305,7 @@ $: if (highlightData) {
305
305
  {...typeof points === 'object' ? points : null}
306
306
  class={cls(
307
307
  'stroke-[6] stroke-white [paint-order:stroke] drop-shadow',
308
- !point.fill && typeof points === 'object' && !points.fill && 'fill-primary',
308
+ !point.fill && (typeof points === 'boolean' || !points.fill) && 'fill-primary',
309
309
  typeof points === 'object' ? points.class : null
310
310
  )}
311
311
  />
@@ -18,8 +18,7 @@ export function scaleBandInvert(scale) {
18
18
  const eachBand = scale.step();
19
19
  const paddingOuter = eachBand * (scale.paddingOuter?.() ?? scale.padding()); // `scaleBand` uses paddingOuter(), while `scalePoint` uses padding() for outer paddding - https://github.com/d3/d3-scale#point_padding
20
20
  return function (value) {
21
- // TODO: Should this use Math.round to better select? https://stackoverflow.com/questions/38633082/d3-getting-invert-value-of-band-scales/50846323#comment104743795_50846323
22
- const index = Math.floor((value - paddingOuter) / eachBand);
21
+ const index = Math.floor((value - paddingOuter / 2) / eachBand);
23
22
  return domain[Math.max(0, Math.min(index, domain.length - 1))];
24
23
  };
25
24
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "author": "Sean Lynch <techniq35@gmail.com>",
5
5
  "license": "MIT",
6
6
  "repository": "techniq/layerchart",
7
- "version": "0.43.4",
7
+ "version": "0.43.6",
8
8
  "devDependencies": {
9
9
  "@changesets/cli": "^2.27.5",
10
10
  "@mdi/js": "^7.4.47",