-
-
Notifications
You must be signed in to change notification settings - Fork 13
Description
Describe the bug
When grouping line charts via z
, some lines are drawn where there should be none.
It seems to happen only in case of single element groups.
To Reproduce
Consider following example:
<script>
import { Plot, Line } from 'svelteplot';
</script>
<Plot>
<Line
data={[{ x: 1, y: 1 }, { x: 1, y: 3 }, { x: 2, y: 5 }, { x: 3, y: 2 }]}
x="x"
y="y"
z="x"
marker={true}
/>
</Plot>
It connects dots from group 2
and 3
.

See also https://svelte.dev/playground/f9a5cd905657450c9f6d7e935d5365f6?version=5.30.2
Expected behavior
Lines should only be drawn within a z
group, not between them.
Here is corresponding example in Observable Plot
Plot.line(
[{ x: 1, y: 1 }, { x: 1, y: 3 }, { x: 2, y: 5 }, { x: 3, y: 2 }],
{ x: "x", y: "y", z: "x", marker: true }
).plot()
and its output
