-
Notifications
You must be signed in to change notification settings - Fork 525
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
In VictoryBrushContainer, clicking outside the brushed area brushes the whole domain #855
Comments
@jmansor this is expected behavior, but I would be willing to add a prop to change it. |
Thanks for the response, I've seen some d3 examples like this one: https://bl.ocks.org/mbostock/34f08d5e11952a80609169b7917d4172 with the same behavior. Yet, I think it would be nice to have a way to deactivate this, so that clicks outside the brushed areas has no effect. Makes sense? |
Would it be possible to override the behavior through the <VictoryChart
padding={{left: 1, right: 1}}
theme={theme}
height={20}
scale={{x: 'time'}}
events={[{
target: 'parent',
eventHandlers: {
onClick: () => {
return [
{
target: 'data',
mutation: (props) => {
console.log('this is called when clicking')
return {domain: props.domain}
}
}, {
target: 'labels',
eventKey: 0,
mutation: () => {
return {text: 'hey'}
}
}
]
}
}
}]}
containerComponent={brushComponent} >
...
</VictoryChart>
The console log works when clicking over the chart but still the domain is taking the whole area. |
@boygirl It would be nice to have an option to prevent this, maybe trough onBrushDomainChange when returning false, or leave brush untouched if only click happens. |
@boygirl I too stuck with this scenerio. Can we expext some good solution on this. I don't want to brush my whole chart when user clicked outside the brushed area. It is very annoying when we apply brush container on top of graph. |
Proposed solution: |
@boygirl I think you meant ETA May 4th and need to comment before May 2nd ? |
Yes! Sorry! |
Hi @boygirl -> For better clarity on prop "disable", i'm taking below example:- |
@code4arpit correct. If you set the prop to "disable" clicking outside of your [2, 5] domain will result in the following behavior |
Steps:
Is this the expected behavior? Is there any way to prevent this?
The text was updated successfully, but these errors were encountered: