如何用jquery同位素处理大数据集
我计划使用很棒的同位素插件来显示联系人列表,然后允许对它们进行过滤。我遇到的问题是,它对于小型数据集效果很好,但我不确定将其扩展到 1000 多个数据的最佳方法。
到目前为止,我的想法是:
- 加载一个随机子集,然后在单击过滤器时向其中添加节点以填充空白,
- 当用户滚动分页时加载更多节点,
- 不显示联系人
- ,直到选择了足够的过滤器来获取数字低于预定阈值。
我不确定这些是否有效,我希望其他人也遇到过这种情况并能给我一些想法。
I am planning on using the great isotope plugin for displaying a list of contacts and then allowing them to be filtered. The issue I have is that it works great for a small data set but i'm not sure the best way of scaling it up for 1000+ pieces of data.
So far the ideas I had were:
- loading a random subset and then adding nodes to it as filters are clicked to fill in the gaps
- loading more nodes as a user scrolls
- paging the results
- not displaying contacts until enough filters have been selected to bring the numbers below a predefined threshold.
I'm not sure if these will work well and I was hoping others had faced this situation and could give me some ideas.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您描述的情况非常常见:如何让您的用户访问比他们一次可能看到的详细数据更多的数据。
有多种方法可以回答这个问题,正确的答案完全是主观的:这取决于您的用户试图查看联系人或对联系人执行什么操作。在真正获得满意的解决方案之前,您需要了解用户将使用联系人做什么。
只是猜测(但你会比我更了解!),我希望他们正在做两件事:
如果您对所有解决方案进行过滤,那么“查找”目标几乎就可以实现。探索目标是您想要设计的目标:
我想如果我处于你的立场,我会引入一些联系人的集群。我怀疑超过 1000 个联系人会带来很大的性能问题(少说一百万个!),所以超过 10000 个联系人实际上是一个用户限制:他们无法同时查看 1000 个联系人。
我建议引入一些聚类,可能是按姓氏或姓氏和名字。然后向用户提供一种深入到一个群集但折叠所有其他联系人的方法,这样它们就不会立即可见。 accordian/rollodex 范例 中的一些内容。这会给您的用户带来他们正在与“所有联系人”合作的错觉。可能为每个集群引入一个最小数量,这样如果集群足够小,您就不必费心显示它(即,为什么要显示 2、3 或 5 个联系人的集群 - 只需显示联系人)。当应用过滤器时,簇就会消失。
The situation you describe is pretty common: how to give your user access to more data than they can possibly see in detail at once.
There are several ways to answer the question and the correct answer is completely subjective: it depends on what your user is trying to see or do with the contacts. Before you can really get a satisfactory solution, you need to know what the users are going to use the contacts for.
Just guessing (but you would know better than me!), I'd expect there are two things they're doing:
If you do filtering for all the solutions, then the Lookup goal is pretty much in the bag. The Explore goal is the one you want to design for:
I think if I were in your shoes, I'd introduce some clustering of the contacts. I doubt that the 1000+ contacts is much of a performance problem (in less you're talking a million!), so the 10000+ is really a user constraint: they just can't view 1000 contacts at once.
I'd suggest introducing some clustering, probably by the last name or last name and first name. Then present the user with a way to drill into one cluster but fold up all the other contacts so they're aren't immediately visible. Something in the ream of the accordian/rollodex paradigm. This gives your user the illusion that they are working with 'all the contacts'. Probably introduce a minimal number for each cluster so that if the cluster is sufficiently small you don't bother showing it (ie, why show a cluster for 2 or 3 or 5 contacts - just show the contacts). As filters are applied then, the clusters melt away.
采用读取缓存的想法,类似于:
加载区域可以很简单:
这样你就可以在 DOM 中一步步加载所有元素,并且只显示需要的内容。
Taking the idea of Read Through Cache, something like:
Loading area could be simply:
This way you can load all elements step by step in the DOM, and you can display only what is needed.
在附加和排列大量同位素项目时,我遇到性能不佳的问题,这是因为我是增量添加项目而不是批量添加项目。这应该是一个显而易见的选择,但我忽略了这一点。
请务必使用数组或元素列表,而不是单独加载或删除。
I was experiencing poor performance when appending and arranging a large number of isotope items and it was because I was adding the items incrementally rather than in a batch. It should be an obvious choice, but something that I had overlooked.
Be sure to use an array or list of elements, as opposed to loading or removing individually.