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

allow vertical panning for infinite scroll #276

Open
sasarivera opened this issue Sep 6, 2019 · 2 comments
Open

allow vertical panning for infinite scroll #276

sasarivera opened this issue Sep 6, 2019 · 2 comments

Comments

@sasarivera
Copy link

I'm trying to implement and infinite scroll in event drops.

so far, I have the implementation using a button. This button adds the extra data and redraw the chart (after drawing I'm scrolling the page to the previous scroll position)

`
const doc = document.documentElement;
const top = (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);

const data = [
...repositories,
...newData
]

d3
.select('#eventdrops-demo')
.data([data])
.call(chart);

window.scrollTo(0, top);
`

this works fine, but I was wondering if I can create a vertical panning to emulate the same functionality?

@Busteren
Copy link
Contributor

Is there a particular reason you want to be able to zoom vertically on the chart? Not sure I see the benefits of it?

The zoom only does it on a horizontal level (x scale);

const newScale = transform.rescaleX(xScale);

You could potentially modify it to allow for zoom on the yScale,
but you would have to modify it a bit (something along these lines, where need to pass in the yScale and then apply the new scale);

const newYScale = transform.rescaleY(yScale);

d3 zoom documentation

@sasarivera
Copy link
Author

sasarivera commented Sep 16, 2019 via email

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