In order to support Canvas and simplify common use cases, we should support
<Pattern lines=[{ x2: '100%', class: 'stroke-surface-content' }] width={4} height={4}>
{#snippet children({ pattern })}
<rect fill={pattern} />
{/snippet}
</Pattern>
or
<Pattern shapes=[{ type: 'rect', x2: '100%', class: 'stroke-surface-content' }] width={4} height={4}>
{#snippet children({ pattern })}
<rect fill={pattern} />
{/snippet}
</Pattern>
which translates to:
<Pattern width={4} height={4}>
{#snippet patternContent()}
<line x2="100%" class="stroke-surface-content" />
{/snippet}
{#snippet children({ pattern })}
<rect fill={pattern} />
{/snippet}
</Pattern>
We would support line, circle, and other shape types. Using <Pattern shapes> would allow controlling the render/stack order, but would be a more verbose API as well (commonly you only need a single type, or the shapes do not overlap)
Might also be nice to simplify further, similar to Nivo (source) and Visx (source)
In order to support Canvas and simplify common use cases, we should support
or
which translates to:
We would support
line,circle, and other shape types. Using<Pattern shapes>would allow controlling the render/stack order, but would be a more verbose API as well (commonly you only need a single type, or the shapes do not overlap)Might also be nice to simplify further, similar to Nivo (source) and Visx (source)