Skip to content

Commit 1215c6d

Browse files
committed
dont group if just one rect
1 parent 46d761a commit 1215c6d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib/marks/Rect.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
required={[]}
5252
channels={['x1', 'x2', 'y1', 'y2', 'fill', 'stroke', 'opacity', 'fillOpacity', 'strokeOpacity']}
5353
{...args}>
54-
{#snippet children({ mark, usedScales, scaledData })}
55-
<g class="rect">
54+
{#snippet children({ usedScales, scaledData })}
55+
<GroupMultiple class={scaledData.length > 1 ? 'rect' : null} length={scaledData.length}>
5656
{#each scaledData as d}
5757
{#if d.valid}
5858
{@const x1 = d.x1 == null ? plot.options.marginLeft : d.x1}
@@ -76,7 +76,7 @@
7676

7777
{@const [style, styleClass] = resolveStyles(plot, d, args, 'fill', usedScales)}
7878
<rect
79-
class={[styleClass]}
79+
class={[scaledData.length === 1 && 'rect', styleClass]}
8080
{style}
8181
x={minx + insetL}
8282
y={miny + insetT}
@@ -91,7 +91,7 @@
9191
}} />
9292
{/if}
9393
{/each}
94-
</g>
94+
</GroupMultiple>
9595
{/snippet}
9696
</Mark>
9797

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy