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

.filter() function and draw callback to save memory #172

Open
JYone3A opened this issue Oct 11, 2019 · 0 comments
Open

.filter() function and draw callback to save memory #172

JYone3A opened this issue Oct 11, 2019 · 0 comments

Comments

@JYone3A
Copy link

JYone3A commented Oct 11, 2019

We want to show a list of lots of records and want to be able to filter them. That is why we need to keep the original array of the records (with the raw data) besides the array of HTML strings we provide to clusterize. When filtering, we use the raw data to find out what records should be shown, select those entries from the HTML strings array and send it to clusterize .update()

So basically, we need to versions of our data.

If we had two additional functionalities in clusterize I think we could make that more efficient:

  • if we could define a draw callback that is executed for each row before appending it to the DOM, we could use this function to convert the raw data to the HTML string. Therefore we would not have to keep a separate array with the HTML strings besides the raw data, and could use the raw data array in clusterize.
  • instead of calling .update() with a filtered array, it would be awesome if there was an .filter() function in clusterize where we can pass an array of row numbers. Clusterize would then redraw with the data it is initialized with currently, but would only show the rows that are listed in the array send to .filter()

I could try to implement some code, but I wanted to make sure that there are no better ways to save memory, and maybe get some directions where to start.

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

1 participant