Skip to content

Commit c8334b5

Browse files
committed
allow interactivity without specifying getLines manually
1 parent ba8f072 commit c8334b5

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

src/lib/components/data-vis/line-chart/LineChart.svelte

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@
9797
clickedTier = $bindable(undefined),
9898
overrideLineParams = () => ({}),
9999
getLine = (tier, el) => {
100+
if (tier === "hover") {
101+
return [hoveredSeries].includes(el.areaCode);
102+
}
103+
if (tier === "clicked") {
104+
return [clickedSeries].includes(el.areaCode);
105+
}
100106
return true;
101107
},
102108
nothingSelected = true,

src/wrappers/components/data-vis/line-chart/line-chart/Examples.svelte

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,6 @@
100100
pathStrokeWidth: 5,
101101
},
102102
}}
103-
getLine={(tier, el) => {
104-
if (tier === "all") {
105-
return true;
106-
}
107-
if (tier === "hover") {
108-
return [hoveredSeries].includes(el.areaCode);
109-
}
110-
if (tier === "clicked") {
111-
return [clickedSeries].includes(el.areaCode);
112-
}
113-
}}
114103
bind:clickedSeries
115104
bind:hoveredSeries
116105
></LineChart>

0 commit comments

Comments
 (0)