mhkeller / layercake

graphics framework for sveltejs
https://layercake.graphics
MIT License
1.35k stars 31 forks source link

Deprecate `extents` prop perhaps? #179

Open mhkeller opened 6 months ago

mhkeller commented 6 months ago

Setting the domain via xDomain, yDomain, rDomain or zDomain is very similar to setting it via extents with the exception that domains set via extents skip measuring the extent for that dimension.

Instead of having this as a separate prop, dimensions could be skipped if a domain is passed into the _Domain props and it contains no null values.

In any event, this can wait until Svelte 5 is out since it would be a breaking change.

mhkeller commented 6 months ago

@techniq @rgieseke or @jtrim-ons are you using the extents prop at all? I think I added it for a very dynamic project I was working on and it seemed like a good at the time but I think the above solution provides the same benefits through _Domain props.

techniq commented 6 months ago

@mhkeller A quick search in LayerChart, I'm using it on some Horizontal / Vertical Bar examples (Grouped, Stacked, etc). I haven't check any other projects yet.

I'm out of town right now, but I can investigate using xDomain / yDomain instead in a few days. Thanks for the heads up.

techniq commented 6 months ago

@mhkeller Actually I found a minute and went ahead and replaced the LayerChart's extents={{ ... }} usage with xDomain / yDomain. Thanks for the heads up

rgieseke commented 6 months ago

@mhkeller Thanks for the heads up, I didn't find any usage of the extents prop in my projects.

jtrim-ons commented 5 months ago

Thanks @mhkeller . I don't think I have anything that uses extents. cc-ing @bothness...

mhkeller commented 4 months ago

To limit the number of breaking changes, I'm going to delay deprecating this until the Svelte 5 Runes rewrite.

mhkeller commented 4 months ago

Thanks everyone for chiming in! Seems like removing this won't be that impactful. I'll see if I can put in a warning in the meantime maybe.

techniq commented 4 months ago

To limit the number of breaking changes, I'm going to delay deprecating this until the Svelte 5 Runes rewrite.

I'll be hot on your tail when you do :)