One of AngularJS’ most sophisticated and unique features is directives. Directives allow you to extend the vocabulary of HTML, such that complex DOM structures and corresponding behavior can be hidden behind a new HTML tag, attribute or a CSS class.
Here, I want to present a simple yet powerful project aiming at creating an AngularJS directive to enable an easier usage of D3 for people without deep knowledge of JavaScript. This project is based on a module that provides D3 as an AngularJS service. This service can be injected via the AngularJSinjector. It enables you to inject the D3 service e.g. into a directive and use D3 in an isolated scope instead of a global variable. As an example I used a basic implementation of the world cloud visualisation by Jason Davies to demonstrate the power of D3 in AngularJS directives.
No comment yet.
Sign up to comment
Your new post is loading...