NeXTs / Clusterize.js

Tiny vanilla JS plugin to display large data sets easily
https://clusterize.js.org
MIT License
7.22k stars 414 forks source link

providing only visible data (+length) ? #153

Open goulu opened 6 years ago

goulu commented 6 years ago

I'm working on a D3.js wrapper to make sorting+filtering easier. Current state is in http://bl.ocks.org/goulu/a45ad9ba663e23d470dbd0cbbab1bdd7 The problem is that data is duplicated between the D3 Table object and the Clusterize object.

Is there a way to dynamically pass only the visible data to Clusterize ? Something like:

    clusterize.length=5000; // number of rows
    clusterize.update(
      function(i) {
        return "<tr><td>data of</td><td>"+i+"</td><td>th row</td></tr>"
    });
goulu commented 6 years ago

implemented it in my fork https://github.com/goulu/Clusterize.js stays pretty compatible with existing demo : https://rawgit.com/goulu/Clusterize.js/master/Clusterize.js.html example of a D3js+Clusterize table here : http://bl.ocks.org/goulu/a45ad9ba663e23d470dbd0cbbab1bdd7

What do you think ? should I PR it ? It's a pretty deep change ...