-
Notifications
You must be signed in to change notification settings - Fork 53
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
Custom handle causing confusing error #23
Comments
Did you look at this example? |
I have yes. I'll pour through it again and see if the answer is in there. Probably an oversight on my part. |
I think the major issue is of a zero-width selection, and my forcing the handles to be visible during that selection. What is the best way to allow for a single width selection? That gif above represents 18 months. If I click on a value, I want to use that day that I clicked on as my only value. I don't want to set the extent to the start of the day and the end of the day, ideally... because of the visual representation I'm trying to go for, keeping the handles tight together when on a single date. All of the brush examples I've seen either snap to a wider date range, or just disappear the brush with that single selection. |
Same thing happens in the example you provided, if I comment out the lines that hide the brush when there is a null selection. I account for the null selection and make sure I have some sort of selection, but not sure how to prevent this error from happening.
Is it just complete bad practice to attempt this? I like the style of the handles directly together, especially for my example which completes the trefoil. |
I have the same issue. Is it possible to have an empty selection? Since resize controls are required in my case and I cannot apply the same behavior as @mbostock in his great example . |
Sorry for the delay. brush.move was too aggressive in converting a degenerate (trivial) selection to the null selection. This should only happen on interaction. Here is an example of preventing the brush from being cleared: |
I have created a custom handle for my brush, following some of the V4 examples, but when I click on the handle to manipulate it when the selection has the same values, it gives an error.
EXCEPTION: Cannot read property '0' of null
If I go to the source, seems to be caused in this area of the
d3
code, at the w0 variable area.If I disable pointerevents for my custom handle, everything works fine with no error.
Maybe it's just an issue with the way I am trying to accomodate single date values for my selection, and to not have the selection area disappear.
Creating the brush items
Updating my brush, on resizes or otherwise.
Updating my handles
brushmoved function
Everything works fine except clicking on my custom handle area again.
The text was updated successfully, but these errors were encountered: