Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Margin has no effect on Brush #1711

Open
lloydrichards opened this issue Jun 8, 2023 · 1 comment
Open

Margin has no effect on Brush #1711

lloydrichards opened this issue Jun 8, 2023 · 1 comment

Comments

@lloydrichards
Copy link

I've been having a try with the Brush component and noticed that the margin does not have any effect on the Brush area or calculations. Even looking at the Brush-Demo you can see that the const brushMargin = { top: 10, bottom: 15, left: 50, right: 20 }; is not moving anytihing inside the <rect /> for the brush but instead is being used only by the <g /> element for the <ChartArea />

This is a bit problematic and forces you to wrap the charts in a <g /> in order to correctly align them rather then being able to build the scale using margin.left and innerWidth like is sometimes common with D3 patterns.

To Recreate

  1. open the demo in CodeSandbox
  2. Go to line 189 margin={brushMargin}
  3. Delete the margin prop from the <Brush />
  4. See nothing change in the brush 🤷
@RyKilleen
Copy link
Contributor

RyKilleen commented Jul 5, 2023

Just ran into this as well, can confirm I had to use groups to offset appropriately because of Brush

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants