├── .gitmodules ├── circle.yml ├── src ├── app │ ├── data │ │ ├── pieData.csv │ │ ├── gearData.csv │ │ └── data.csv │ ├── app.module.ts │ ├── app.component.ts │ └── app.html ├── angularD3 │ ├── directives │ │ ├── chart.spec.ts │ │ ├── line.ts │ │ ├── arc.ts │ │ ├── bars.ts │ │ ├── data.ts │ │ ├── axis-label.ts │ │ ├── area.ts │ │ ├── chart.ts │ │ ├── pie.ts │ │ ├── gear.ts │ │ └── axis.ts │ ├── d3.ts │ └── index.ts ├── bootstrap.ts ├── index.html └── styles │ └── styles.scss ├── .gitignore ├── test ├── sanity-test.spec.ts ├── injector.spec.ts └── app │ └── app.e2e.js ├── CHANGELOG.md ├── typedoc.json ├── tsconfig.json ├── tsconfig.build.json ├── bower.json ├── CONTRIBUTING.md ├── protractor.conf.js ├── MIT-LICENSE ├── tslint.json ├── webpack.config.js ├── karma.conf.js ├── package.json ├── README.md └── npm-shrinkwrap.json /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "docs"] 2 | path = docs 3 | url = git@github.com:WealthBar/a2d3.git 4 | -------------------------------------------------------------------------------- /circle.yml: -------------------------------------------------------------------------------- 1 | machine: 2 | node: 3 | version: 6.1.0 4 | 5 | experimental: 6 | notify: 7 | branches: 8 | only: 9 | - master 10 | -------------------------------------------------------------------------------- /src/app/data/pieData.csv: -------------------------------------------------------------------------------- 1 | age,population 2 | 5,2704659 3 | 5-13,4499890 4 | 14-17,2159981 5 | 18-24,3853788 6 | 25-44,14106543 7 | 45-64,8819342 8 | ≥65,612463 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .tmp 3 | .sass-cache 4 | app/components 5 | .sublime-* 6 | typings 7 | npm-debug.log 8 | dist 9 | .idea/ 10 | *.ngfactory.ts 11 | *.ngsummary.json 12 | -------------------------------------------------------------------------------- /test/sanity-test.spec.ts: -------------------------------------------------------------------------------- 1 | import { 2 | it, 3 | inject, 4 | injectAsync, 5 | beforeEachProviders, 6 | } from '@angular/core/testing'; 7 | 8 | describe('sanity checks', () => { 9 | it('should also be able to test', () => { 10 | expect(true).toBe(true); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 2 | # [1.0.0-rc.9](https://github.com/angular/angular/compare/921e8dcca...1.0.0-rc.9) (2016-11-07) 3 | 4 | ### Features 5 | 6 | **** Add the gear style pie chart 7 | 8 | ### Other 9 | 10 | * Upgrade to latest version of Angular 2 (2.1.2) 11 | * Upgrade to Webpack 2 12 | -------------------------------------------------------------------------------- /test/injector.spec.ts: -------------------------------------------------------------------------------- 1 | import { 2 | it, 3 | inject, 4 | injectAsync, 5 | beforeEachProviders, 6 | } from '@angular/core/testing'; 7 | import {APP_ID} from '@angular/core'; 8 | 9 | 10 | describe('default test injector', () => { 11 | it('should provide default id', inject([APP_ID], (id) => { 12 | expect(id).toBe('a'); 13 | })); 14 | }); 15 | -------------------------------------------------------------------------------- /src/angularD3/directives/chart.spec.ts: -------------------------------------------------------------------------------- 1 | describe('D3ChartDirective', () => { 2 | // CircleCI requires at least one test to be run to show that there are tests 3 | // Until this project has some tests, this is a placeholder test that will always be true 4 | // Which kind of renders running it on Circle pretty useless here, but still! 5 | it('should be true', () => { 6 | expect(true).toBe(true); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | 4 | import { AppComponent } from './app.component'; 5 | 6 | import {D3Module} from '../angularD3'; 7 | 8 | @NgModule({ 9 | imports: [ BrowserModule, D3Module ], 10 | declarations: [ AppComponent ], 11 | bootstrap: [ AppComponent ] 12 | }) 13 | export class AppModule { } 14 | -------------------------------------------------------------------------------- /typedoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "mode": "modules", 3 | "out": "doc", 4 | "theme": "default", 5 | "ignoreCompilerErrors": "true", 6 | "experimentalDecorators": "true", 7 | "emitDecoratorMetadata": "true", 8 | "target": "ES5", 9 | "moduleResolution": "node", 10 | "preserveConstEnums": "true", 11 | "stripInternal": "true", 12 | "suppressExcessPropertyErrors": "true", 13 | "suppressImplicitAnyIndexErrors": "true", 14 | "module": "commonjs" 15 | } 16 | -------------------------------------------------------------------------------- /src/bootstrap.ts: -------------------------------------------------------------------------------- 1 | import 'script-loader!jquery/dist/jquery.js' 2 | import 'bootstrap-loader'; 3 | 4 | import 'core-js/es7/reflect'; 5 | import 'web-animations-js'; 6 | 7 | import 'zone.js/dist/zone'; 8 | import 'zone.js/dist/long-stack-trace-zone'; 9 | 10 | import './styles/styles.scss'; 11 | 12 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 13 | import { AppModule } from './app/app.module'; 14 | platformBrowserDynamic().bootstrapModule(AppModule); 15 | -------------------------------------------------------------------------------- /src/app/data/gearData.csv: -------------------------------------------------------------------------------- 1 | innerR,outerR,weight,innerLR,outerLR,innerL,outerL 2 | 0.33 , 1.30, 3, 1.15, , 1%,areallyreallylongnamewithverylittlewieght 3 | 0.10 , , 9, , , 9%,another thing 4 | 0.13 , 0.88, 10, , , 10%,woof 5 | 0.15 , 0.85, 12, , , 13%,meow 6 | 0.20 , 0.93, 19, , , 20%,crazy thing 7 | 0.15 , 1.10, 7, , , 7%,one thing 8 | 0.25 , 0.80, 40, , , 40%,the big thing -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "es2015", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "inlineSources": true, 8 | "types": [], 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "removeComments": true, 12 | "noImplicitAny": false, 13 | "lib": ["es6", "dom"] 14 | }, 15 | "files": [ 16 | "src/bootstrap.ts", 17 | "src/angularD3/index.ts" 18 | ], 19 | "compileOnSave": false 20 | } 21 | -------------------------------------------------------------------------------- /tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "es2015", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "inlineSources": true, 8 | "types": [], 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "removeComments": true, 12 | "noImplicitAny": false, 13 | "declaration": true, 14 | "outDir": "./dist", 15 | "lib": ["es6", "dom"], 16 | "skipLibCheck": true 17 | }, 18 | "files": [ 19 | "src/angularD3/index.ts" 20 | ], 21 | "compileOnSave": false 22 | } 23 | -------------------------------------------------------------------------------- /src/app/data/data.csv: -------------------------------------------------------------------------------- 1 | date,savings,total,optimal 2 | 2001-01-01, 10, 10, 50 3 | 2001-02-01, 90, 100, 100 4 | 2001-03-01, 30, 130, 150 5 | 2001-04-01, 45, 175, 200 6 | 2001-05-01, 50, 225, 250 7 | 2001-06-01, 75, 300, 300 8 | 2001-07-01, 10, 310, 350 9 | 2001-08-01, 30, 340, 400 10 | 2001-09-01, 65, 405, 450 11 | 2001-10-01, 100, 505, 500 12 | 2001-11-01, 110, 615, 550 13 | 2001-12-01, 80, 695, 600 14 | 2002-01-01, 35, 730, 650 15 | 2002-02-01, 70, 800, 700 16 | 2002-03-01, 150, 950, 750 17 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angularD3", 3 | "version": "0.0.35", 4 | "main": "dist/angularD3.js", 5 | "ignore": [ 6 | ".*", 7 | "app", 8 | "node_modules", 9 | "bower_components", 10 | "test", 11 | "tests" 12 | ], 13 | "dependencies": { 14 | "d3": "~3.5", 15 | "angular2": "2.0.0-beta.0" 16 | , 17 | "homepage": "http://wealthbar.github.io/angular-d3", 18 | "authors": [ 19 | "Chris Nicola " 20 | ], 21 | "description": "AngularJS chart directives and other integrations for D3.js", 22 | "keywords": [ 23 | "AngularJS", 24 | "D3", 25 | "D3.js", 26 | "charts" 27 | ], 28 | "license": "MIT" 29 | } 30 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Guidelines for Contributing 2 | 3 | ## Getting Started 4 | 5 | We use Grunt to build and test Angular-D3 and Bower to manage dependencies. You 6 | can get started by first cloning the repository (fork it if you want to submit 7 | pull-requests). The follow these steps: 8 | 9 | ```sh 10 | # Setup 11 | npm install 12 | 13 | # Running the demo 14 | npm start 15 | 16 | # Building the NPM package (output to /dist) 17 | npm run dist 18 | ``` 19 | 20 | ## Submitting A Pull Request 21 | 22 | We don't have any strict requirements on pull requests at this point. This 23 | policy will probably change as we approach a 1.0 version. For now we welcome 24 | any pull requests, particularly those adding new directives for chart elements 25 | or features. 26 | 27 | And last but not least, thanks for contributing! 28 | -------------------------------------------------------------------------------- /src/angularD3/d3.ts: -------------------------------------------------------------------------------- 1 | import { selection } from 'd3-selection'; 2 | import { scales } from 'd3-scale'; 3 | const format = require('d3-format'); 4 | const interpolate = require('d3-interpolate'); 5 | 6 | export default { 7 | arc: shape.arc, 8 | area: shape.area, 9 | brush: brush.brush, 10 | brushX: brush.brushX, 11 | brushY: brush.brushY, 12 | extent: array.extent, 13 | format: format.format, 14 | interpolate: interpolate.interpolate, 15 | line: shape.line, 16 | max: array.max, 17 | min: array.min, 18 | mouse: selection.mouse, 19 | pie: shape.pie, 20 | range: array.range, 21 | rgb: color.rgb, 22 | select: selection.select, 23 | selectAll: selection.selectAll, 24 | scaleBand: scales.scaleBand, 25 | scaleLinear: scales.scaleLinear, 26 | scaleOrdinal: scales.scaleOrdinal, 27 | scalePoint: scales.scalePoint, 28 | scaleQuantile: scales.scaleQuantile, 29 | scaleTime: scales.scaleTime, 30 | treemap: shape.treemap 31 | }; 32 | -------------------------------------------------------------------------------- /protractor.conf.js: -------------------------------------------------------------------------------- 1 | // @AngularClass 2 | 3 | exports.config = { 4 | baseUrl: 'http://localhost:3000/', 5 | 6 | specs: [ 7 | 'test/**/*.e2e.js' 8 | ], 9 | exclude: [], 10 | 11 | framework: 'jasmine', 12 | 13 | allScriptsTimeout: 110000, 14 | 15 | jasmineNodeOpts: { 16 | showTiming: true, 17 | showColors: true, 18 | isVerbose: false, 19 | includeStackTrace: false, 20 | defaultTimeoutInterval: 400000 21 | }, 22 | directConnect: true, 23 | 24 | capabilities: { 25 | 'browserName': 'chrome', 26 | 'chromeOptions': { 27 | 'args': ['show-fps-counter=true'] 28 | } 29 | }, 30 | 31 | onPrepare: function() { 32 | browser.ignoreSynchronization = true; 33 | }, 34 | 35 | 36 | /** 37 | * Angular 2 configuration 38 | * 39 | * useAllAngular2AppRoots: tells Protractor to wait for any angular2 apps on the page instead of just the one matching 40 | * `rootEl` 41 | * 42 | */ 43 | useAllAngular2AppRoots: true 44 | }; 45 | -------------------------------------------------------------------------------- /test/app/app.e2e.js: -------------------------------------------------------------------------------- 1 | /* 2 | * TODO: ES5 for now until I make a webpack plugin for protractor 3 | */ 4 | describe('App', function() { 5 | 6 | //beforeEach(function() { 7 | //browser.get('/'); 8 | //}); 9 | 10 | 11 | //it('should have a title', function() { 12 | //var subject = browser.getTitle(); 13 | //var result = 'Angular2 Webpack Starter by @gdi2990 from @AngularClass'; 14 | //expect(subject).toEqual(result); 15 | //}); 16 | 17 | //it('should have
', function() { 18 | //var subject = element(by.deepCss('app /deep/ header')).isPresent(); 19 | //var result = true; 20 | //expect(subject).toEqual(result); 21 | //}); 22 | 23 | //it('should have
', function() { 24 | //var subject = element(by.deepCss('app /deep/ main')).isPresent(); 25 | //var result = true; 26 | //expect(subject).toEqual(result); 27 | //}); 28 | 29 | //it('should have