使用dc.js和UI路由器与标签性能问题 [英] performance issue using dc.js and ui-router with tabs

查看:130
本文介绍了使用dc.js和UI路由器与标签性能问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是angular.js的UI路由器dc.js。
我的目标是有两个路由状态。每个人都应该present多个图形。

I'm using dc.js with angular.js's ui-router. My goal is to have two routing states. Each should present multiple graphs.

一切工作正常,但每次路由状态的变化,图形性能变慢。我认为这个问题可能位于dc.js或者我对它的使用。

Everything works fine, but everytime the routing state changes, the performance of the graphs gets slower. I think that the problem maybe is located on dc.js or my usage of it.

每次路由状态的变化,新的图形将被调用。也许dc.js不会删除旧的。是否有dc.js选项以删除图表?

Everytime the routing state changes, new graphs will be invoked. Maybe dc.js doesn't delete the old ones. Is there an option in dc.js to delete the graphs?

推荐答案

有是无证 dc.chartRegistry.deregister(图表组)

https://github.com/ DC-JS / dc.js / BLOB /主/ src目录/ core.js#L70

但更大的性能影响是,如​​果你创建尺寸或团体,而不是处理他们的:

But a bigger performance hit is if you are creating dimensions or groups and not disposing of them:

https://github.com/square/crossfilter/wiki/API-参考#dimension_dispose
https://github.com/square/crossfilter/wiki/API-Reference#group_dispose

此将导致越来越多的索引被创建,并且所有的数据将得到分类和分级在越来越多的方式。

This would cause more and more indices to be created, and all the data would have to get sorted and binned in more and more ways.

这篇关于使用dc.js和UI路由器与标签性能问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆