NeXTs / Clusterize.js

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

variable row height and complex divs #154

Open sido420 opened 6 years ago

sido420 commented 6 years ago

I'm building a chat application where I wanted to use Clusterize for the main chat page.

As we already know chat messages can be complex including text only, images+text, videos, embeds, iframes etc and can have dynamic heights (ie. not known in advance).

Would this be OK to use Clusterize for smooth scrolling and div management? The only plus point seems to be the potential size of list that might only grow up to a few thousand (that too very rarely). Any thoughts on this?

Also, I'm using Backbone.js/Marionette, so a list would be rendered first (exists in DOM), then following code would be used on it.

var clusterize = new Clusterize({
  scrollId: 'scrollArea',
  contentId: 'contentArea'
});

However, new items would be added to collection that would in turn add the new div element to content list div in DOM. Then, do I have to literally add new item to Clusterize instance as well or it tracks the content div automatically for new additions? Please suggest the most efficient approach here.

Thanks.

ghost commented 5 years ago

@sido420 Have u tried it? Does it work with variable height?