diff --git a/.changeset/lucky-apes-draw.md b/.changeset/lucky-apes-draw.md new file mode 100644 index 000000000..e735076b3 --- /dev/null +++ b/.changeset/lucky-apes-draw.md @@ -0,0 +1,5 @@ +--- +'layerchart': patch +--- + +fix(BarChart): Compatibility with Svelte 3/4 after accidental introduction of typescript in markup diff --git a/packages/layerchart/src/lib/components/charts/BarChart.svelte b/packages/layerchart/src/lib/components/charts/BarChart.svelte index f688d37de..f7a1a1344 100644 --- a/packages/layerchart/src/lib/components/charts/BarChart.svelte +++ b/packages/layerchart/src/lib/components/charts/BarChart.svelte @@ -24,6 +24,7 @@ findRelatedData, type Accessor, } from '../../utils/common.js'; + import { asAny } from '../../utils/types.js'; type ChartProps = ComponentProps>; @@ -343,7 +344,7 @@ {@const seriesItems = stackSeries ? [...series].reverse() : series} {#each seriesItems as s} {@const seriesTooltipData = s.data ? findRelatedData(s.data, data, x) : data} - {@const valueAccessor = accessor(s.value ?? (s.data ? (y as any) : s.key))} + {@const valueAccessor = accessor(s.value ?? (s.data ? asAny(y) : s.key))} { const seriesTooltipData = s.data ? findRelatedData(s.data, data, x) : data; - const valueAccessor = accessor(s.value ?? (s.data ? (y as any) : s.key)); + const valueAccessor = accessor(s.value ?? (s.data ? asAny(y) : s.key)); return valueAccessor(seriesTooltipData); })} format="integer"