AngularJS 应用程序中的 D3 [英] D3 within an AngularJS app

查看:23
本文介绍了AngularJS 应用程序中的 D3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 AngularJS 创建我的第一个应用程序.它看起来很整洁,但有很多抽象,我很好奇是否有人对使用 angular 方法更新使用 d3js 创建的视觉效果的最惯用方法有建议.

I'm trying to create my first app with AngularJS. It looks neat, but there's a lot of abstraction, and I'm just curious if anyone has advice on the most idiomatic way to use the angular methodology to update visuals created with d3js.

谢谢,bp

推荐答案

为了使 angular 和其他框架更好地发挥作用,使用指令来包装其他"框架.

In order to make angular and other frameworks play nice is to wrap the "other" frameworks using directives.

http://docs.angularjs.org/guide/directive

您想要做的事情是在其他"框架更新数据时告诉 angular.如果 angular 不需要知道,那么您的任务就更简单了.

The thing that you want to do is to tell angular when data has been updated by the "other" frameworks. If angular doesn't need to know, then your task is simpler.

这是一个适用于 SVG 的示例,非常棒

Here is an example that works with SVG, its awesome

http://sullerandras.github.com/SVG-Sequence-Diagram/

这是一个包装 TinyMCE 的例子

Here is an example that wraps TinyMCE

http://jsfiddle.net/programmieraffe/kjsEV/

这篇关于AngularJS 应用程序中的 D3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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