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

x-range study points disappearing #5647

Closed
peterchoo opened this Issue Sep 1, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@peterchoo

peterchoo commented Sep 1, 2016

Expected behaviour

All points where x and x2 range intersects with the viewing area.

Actual behaviour

Points where the x value is lower than the threshhold disappear.

Live demo with steps to reproduce

http://jsfiddle.net/bpqpy0ko/1/

Reduce the size of the brush/navigator (Click 1W) and move the navigator to the start of the timeline. Then slowly move it to the right and watch the bars disappear when the left edge goes off the left of the chart area.

Edit: I have just experimented with the data array length. It appears that having 51 points in the array causes x < threshold to disappear: http://jsfiddle.net/bpqpy0ko/2/ - where as having 50 points doesn't: http://jsfiddle.net/bpqpy0ko/3/

Affected browser(s)

Chrome, Firefox on Linux

@peterchoo

This comment has been minimized.

Show comment
Hide comment
@peterchoo

peterchoo Sep 1, 2016

Having done a little more digging, this looks like an issue with cropThreshold.

What I need to change in the x-range plugin is the function which decides whether a point should be shown or not, to add something along the lines of:

isPointShown(point, limits) {
  return x.x < limits.max && x.x2 > limits.min;
} 

Is there a function I can override in the plugin to allow this to happen?

Thanks

peterchoo commented Sep 1, 2016

Having done a little more digging, this looks like an issue with cropThreshold.

What I need to change in the x-range plugin is the function which decides whether a point should be shown or not, to add something along the lines of:

isPointShown(point, limits) {
  return x.x < limits.max && x.x2 > limits.min;
} 

Is there a function I can override in the plugin to allow this to happen?

Thanks

@pawelfus

This comment has been minimized.

Show comment
Hide comment
@pawelfus

pawelfus Sep 2, 2016

Contributor

How about setting cropThreshold ? For example: http://jsfiddle.net/bpqpy0ko/4/

Contributor

pawelfus commented Sep 2, 2016

How about setting cropThreshold ? For example: http://jsfiddle.net/bpqpy0ko/4/

@peterchoo

This comment has been minimized.

Show comment
Hide comment
@peterchoo

peterchoo Sep 2, 2016

cropThreshold would work if we knew the max dataset size, and knew it wouldn't cause any particular performance issues. Unfortunately we are currently looking at having 10,000+ data points,a nd are worried about performance.

As suggested by @TorsteinHonsi in his commit which closed this issue, I had already come up with a cropData override which searches both the xData and x2Data arrays. This doesn't work out ideally, as if a data point with a low index has a high x2 value, and happens to be shown, then all points in between shall be rendered.

I'll keep looking for a better solution.

peterchoo commented Sep 2, 2016

cropThreshold would work if we knew the max dataset size, and knew it wouldn't cause any particular performance issues. Unfortunately we are currently looking at having 10,000+ data points,a nd are worried about performance.

As suggested by @TorsteinHonsi in his commit which closed this issue, I had already come up with a cropData override which searches both the xData and x2Data arrays. This doesn't work out ideally, as if a data point with a low index has a high x2 value, and happens to be shown, then all points in between shall be rendered.

I'll keep looking for a better solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment