From 53ac4a3a1dee35df48ddc50517ceb95d4bbe2bc7 Mon Sep 17 00:00:00 2001 From: Gung Mahendra Date: Sun, 15 Jan 2017 15:38:54 +0800 Subject: [PATCH] Updated compile tsconfig --- dist/test/angular2-nvd3.component.spec.d.ts | 0 dist/test/angular2-nvd3.component.spec.js | 33 -- dist/test/sample-data.d.ts | 320 -------------- dist/test/sample-data.js | 441 -------------------- tsconfig.json | 3 +- 5 files changed, 1 insertion(+), 796 deletions(-) delete mode 100644 dist/test/angular2-nvd3.component.spec.d.ts delete mode 100644 dist/test/angular2-nvd3.component.spec.js delete mode 100644 dist/test/sample-data.d.ts delete mode 100644 dist/test/sample-data.js diff --git a/dist/test/angular2-nvd3.component.spec.d.ts b/dist/test/angular2-nvd3.component.spec.d.ts deleted file mode 100644 index e69de29..0000000 diff --git a/dist/test/angular2-nvd3.component.spec.js b/dist/test/angular2-nvd3.component.spec.js deleted file mode 100644 index 56daa11..0000000 --- a/dist/test/angular2-nvd3.component.spec.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -var testing_1 = require("@angular/core/testing"); -var angular2_nvd3_component_1 = require("../angular2-nvd3/angular2-nvd3.component"); -var sample_data_1 = require("./sample-data"); -sample_data_1.SampleData.chartTypes.forEach(function (type) { - describe("tasks:NvD3Component " + type, function () { - var component; - var fixture; - var componentElement; - beforeEach(function () { - testing_1.TestBed.configureTestingModule({ - declarations: [angular2_nvd3_component_1.NvD3Component], - }); - fixture = testing_1.TestBed.createComponent(angular2_nvd3_component_1.NvD3Component); - component = fixture.componentInstance; - component.options = sample_data_1.SampleData.allOptions[type]; - component.data = sample_data_1.SampleData.allData[type]; - fixture.detectChanges(); - componentElement = fixture.nativeElement; - }); - it("should have svg", function () { - expect(componentElement.querySelectorAll('svg').length).toBe(1); - }); - it('should svg have class nvd3-svg', function () { - var gElement = componentElement.querySelector('svg'); - expect(gElement.classList).toContain('nvd3-svg'); - }); - it("should g have class nv-" + type, function () { - var gElement = componentElement.querySelector('g'); - expect(gElement.className.baseVal).toContain(sample_data_1.SampleData.chartClassExpected[type]); - }); - }); -}); diff --git a/dist/test/sample-data.d.ts b/dist/test/sample-data.d.ts deleted file mode 100644 index 88b0d2a..0000000 --- a/dist/test/sample-data.d.ts +++ /dev/null @@ -1,320 +0,0 @@ -export declare namespace SampleData { - const chartTypes: string[]; - const allOptions: { - lineChart: { - chart: { - type: string; - height: number; - x: (d: any) => any; - y: (d: any) => any; - }; - }; - discreteBarChart: { - chart: { - type: string; - height: number; - x: (d: any) => any; - y: (d: any) => any; - }; - }; - pieChart: { - chart: { - type: string; - height: number; - x: (d: any) => any; - y: (d: any) => any; - }; - }; - scatterChart: { - chart: { - type: string; - height: number; - }; - }; - multiBarChart: { - chart: { - type: string; - height: number; - stacked: boolean; - }; - }; - candlestickBarChart: { - chart: { - type: string; - height: number; - x: (d: any) => any; - y: (d: any) => any; - }; - }; - ohlcBarChart: { - chart: { - type: string; - height: number; - x: (d: any) => any; - y: (d: any) => any; - }; - }; - boxPlotChart: { - chart: { - type: string; - height: number; - x: (d: any) => any; - }; - }; - multiChart: { - chart: { - type: string; - height: number; - }; - }; - sunburstChart: { - chart: { - type: string; - height: number; - }; - }; - stackedAreaChart: { - chart: { - type: string; - height: number; - x: (d: any) => any; - y: (d: any) => any; - }; - }; - multiBarHorizontalChart: { - chart: { - type: string; - height: number; - x: (d: any) => any; - y: (d: any) => any; - }; - }; - cumulativeLineChart: { - chart: { - type: string; - height: number; - x: (d: any) => any; - y: (d: any) => number; - average: (d: any) => number; - }; - }; - historicalBarChart: { - chart: { - type: string; - height: number; - x: (d: any) => any; - y: (d: any) => number; - }; - }; - parallelCoordinates: { - chart: { - type: string; - height: number; - dimensionData: string[]; - }; - }; - sparklinePlus: { - chart: { - type: string; - height: number; - x: (d: any, i: any) => any; - }; - }; - bulletChart: { - chart: { - type: string; - height: number; - }; - }; - linePlusBarWithFocusChart: { - chart: { - type: string; - height: number; - color: string[]; - x: (d: any, i: any) => any; - }; - }; - forceDirectedGraph: { - chart: { - type: string; - }; - }; - }; - const allData: { - lineChart: { - key: string; - values: { - x: number; - y: number; - }[]; - }[]; - discreteBarChart: { - key: string; - values: { - 'label': string; - 'value': number; - }[]; - }[]; - pieChart: { - key: string; - y: number; - }[]; - scatterChart: { - key: string; - values: { - x: number; - y: number; - }[]; - }[]; - multiBarChart: { - key: string; - values: { - x: number; - y: number; - }[]; - }[]; - candlestickBarChart: { - values: { - 'date': number; - 'open': number; - 'high': number; - 'low': number; - 'close': number; - 'volume': number; - 'adjusted': number; - }[]; - }[]; - ohlcBarChart: { - values: { - 'date': number; - 'open': number; - 'high': number; - 'low': number; - 'close': number; - 'volume': number; - 'adjusted': number; - }[]; - }[]; - boxPlotChart: { - label: string; - values: { - Q1: number; - Q2: number; - Q3: number; - whisker_low: number; - whisker_high: number; - outliers: number[]; - }; - }[]; - multiChart: { - key: string; - type: string; - yAxis: number; - values: { - x: number; - y: number; - }[]; - }[]; - sunburstChart: { - 'name': string; - 'children': { - 'name': string; - 'children': { - 'name': string; - 'children': { - 'name': string; - 'size': number; - }[]; - }[]; - }[]; - }[]; - stackedAreaChart: { - 'key': string; - 'values': number[][]; - }[]; - multiBarHorizontalChart: { - 'key': string; - 'values': { - 'label': string; - 'value': number; - }[]; - }[]; - cumulativeLineChart: { - key: string; - values: number[][]; - mean: number; - }[]; - historicalBarChart: { - 'key': string; - 'bar': boolean; - 'values': number[][]; - }[]; - parallelCoordinates: { - 'name': string; - 'economy (mpg)': string; - 'cylinders': string; - 'displacement (cc)': string; - 'power (hp)': string; - 'weight (lb)': string; - '0-60 mph (s)': string; - 'year': string; - }[]; - sparklinePlus: { - x: number; - y: number; - }[]; - bulletChart: { - 'title': string; - 'subtitle': string; - 'ranges': number[]; - 'measures': number[]; - 'markers': number[]; - }; - linePlusBarWithFocusChart: ({ - 'key': string; - 'bar': boolean; - 'values': { - x: number; - y: number; - }[]; - } | { - 'key': string; - 'values': { - x: number; - y: number; - }[]; - })[]; - forceDirectedGraph: { - 'nodes': { - 'name': string; - 'group': number; - }[]; - 'links': { - 'source': number; - 'target': number; - 'value': number; - }[]; - }; - }; - const chartClassExpected: { - lineChart: string; - discreteBarChart: string; - pieChart: string; - scatterChart: string; - multiBarChart: string; - multiBarHorizontalChart: string; - candlestickBarChart: string; - ohlcBarChart: string; - boxPlotChart: string; - multiChart: string; - sunburstChart: string; - stackedAreaChart: string; - cumulativeLineChart: string; - historicalBarChart: string; - parallelCoordinates: string; - sparklinePlus: string; - bulletChart: string; - linePlusBarWithFocusChart: string; - forceDirectedGraph: string; - }; -} diff --git a/dist/test/sample-data.js b/dist/test/sample-data.js deleted file mode 100644 index 8b8a329..0000000 --- a/dist/test/sample-data.js +++ /dev/null @@ -1,441 +0,0 @@ -"use strict"; -var SampleData; -(function (SampleData) { - SampleData.chartTypes = [ - 'lineChart', - 'discreteBarChart', - 'pieChart', - 'scatterChart', - 'multiBarChart', - 'multiBarHorizontalChart', - 'candlestickBarChart', - 'ohlcBarChart', - 'boxPlotChart', - 'multiChart', - 'sunburstChart', - 'stackedAreaChart', - 'cumulativeLineChart', - 'historicalBarChart', - 'parallelCoordinates', - 'sparklinePlus', - 'bulletChart', - 'linePlusBarWithFocusChart', - 'forceDirectedGraph' - ]; - SampleData.allOptions = { - lineChart: { - chart: { - type: 'lineChart', - height: 450, - x: function (d) { return d.x; }, - y: function (d) { return d.y; } - } - }, - discreteBarChart: { - chart: { - type: 'discreteBarChart', - height: 450, - x: function (d) { return d.label; }, - y: function (d) { return d.value; } - } - }, - pieChart: { - chart: { - type: 'pieChart', - height: 500, - x: function (d) { return d.key; }, - y: function (d) { return d.y; } - } - }, - scatterChart: { - chart: { - type: 'scatterChart', - height: 450 - } - }, - multiBarChart: { - chart: { - type: 'multiBarChart', - height: 450, - stacked: true - } - }, - candlestickBarChart: { - chart: { - type: 'candlestickBarChart', - height: 450, - x: function (d) { return d['date']; }, - y: function (d) { return d['close']; } - } - }, - ohlcBarChart: { - chart: { - type: 'ohlcBarChart', - height: 450, - x: function (d) { return d['date']; }, - y: function (d) { return d['close']; } - } - }, - boxPlotChart: { - chart: { - type: 'boxPlotChart', - height: 450, - x: function (d) { return d.label; } - } - }, - multiChart: { - chart: { - type: 'multiChart', - height: 450 - } - }, - sunburstChart: { - chart: { - type: 'sunburstChart', - height: 450 - } - }, - stackedAreaChart: { - chart: { - type: 'stackedAreaChart', - height: 450, - x: function (d) { return d[0]; }, - y: function (d) { return d[1]; } - } - }, - multiBarHorizontalChart: { - chart: { - type: 'multiBarHorizontalChart', - height: 450, - x: function (d) { return d.label; }, - y: function (d) { return d.value; } - } - }, - cumulativeLineChart: { - chart: { - type: 'cumulativeLineChart', - height: 450, - x: function (d) { return d[0]; }, - y: function (d) { return d[1] / 100; }, - average: function (d) { return d.mean / 100; } - } - }, - historicalBarChart: { - chart: { - type: 'historicalBarChart', - height: 450, - x: function (d) { return d[0]; }, - y: function (d) { return d[1] / 100000; } - } - }, - parallelCoordinates: { - chart: { - type: 'parallelCoordinates', - height: 450, - dimensionData: [ - 'economy (mpg)', - 'cylinders', - 'displacement (cc)', - 'power (hp)', - 'weight (lb)', - '0-60 mph (s)', - 'year' - ] - } - }, - sparklinePlus: { - chart: { - type: 'sparklinePlus', - height: 450, - x: function (d, i) { return i; } - } - }, - bulletChart: { - chart: { - type: 'bulletChart', - height: 450 - } - }, - linePlusBarWithFocusChart: { - chart: { - type: 'linePlusBarChart', - height: 500, - color: ['#2ca02c', 'darkred'], - x: function (d, i) { return i; } - } - }, - forceDirectedGraph: { - chart: { - type: 'forceDirectedGraph' - } - } - }; - SampleData.allData = { - lineChart: [ - { key: 'key1', values: [{ x: 0, y: 0 }, { x: 1, y: 1 }] }, - { key: 'key2', values: [{ x: 1, y: 1 }, { x: 0, y: 0 }] } - ], - discreteBarChart: [ - { - key: 'Cumulative Return', - values: [ - { 'label': 'A', 'value': 10 }, - { 'label': 'B', 'value': 20 } - ] - } - ], - pieChart: [ - { key: 'One', y: 5 }, - { key: 'Two', y: 2 } - ], - scatterChart: [ - { key: 'key1', values: [{ x: 0, y: 0 }, { x: 1, y: 1 }] }, - { key: 'key2', values: [{ x: 1, y: 1 }, { x: 0, y: 0 }] } - ], - multiBarChart: [ - { - key: 'Sent', - values: [{ x: 0, y: 1 }, { x: 1, y: 2 }] - }, - { - key: 'Received', - values: [{ x: 0, y: 2 }, { x: 1, y: 3 }] - }, - { - key: 'Spam', - values: [{ x: 0, y: 3 }, { x: 1, y: 5 }] - } - ], - candlestickBarChart: [{ - values: [ - { 'date': 15854, 'open': 165.42, 'high': 165.8, 'low': 164.34, 'close': 165.22, 'volume': 160363400, 'adjusted': 164.35 }, - { 'date': 15855, 'open': 165.35, 'high': 166.59, 'low': 165.22, 'close': 165.83, 'volume': 107793800, 'adjusted': 164.96 } - ] - } - ], - ohlcBarChart: [{ - values: [ - { 'date': 15707, 'open': 145.11, 'high': 146.15, 'low': 144.73, 'close': 146.06, 'volume': 192059000, 'adjusted': 144.65 }, - { 'date': 15708, 'open': 145.99, 'high': 146.37, 'low': 145.34, 'close': 145.73, 'volume': 144761800, 'adjusted': 144.32 }, - ] - } - ], - boxPlotChart: [ - { - label: 'Sample A', - values: { - Q1: 180, - Q2: 200, - Q3: 250, - whisker_low: 115, - whisker_high: 400, - outliers: [50, 100, 425] - } - } - ], - multiChart: [ - { - key: 'Stream1', - type: 'area', - yAxis: 1, - values: [{ x: 0, y: 1 }, { x: 1, y: 2 }] - }, - { - key: 'Stream2', - type: 'area', - yAxis: 1, - values: [{ x: 0, y: 2 }, { x: 1, y: 3 }] - }, - { - key: 'Stream3', - type: 'line', - yAxis: 1, - values: [{ x: 0, y: 3 }, { x: 1, y: 5 }] - }, - { - key: 'Stream4', - type: 'line', - yAxis: 2, - values: [{ x: 0, y: 3 }, { x: 1, y: 5 }] - }, - { - key: 'Stream4', - type: 'bar', - yAxis: 2, - values: [{ x: 0, y: 3 }, { x: 1, y: 5 }] - } - ], - sunburstChart: [{ - 'name': 'flare', - 'children': [ - { - 'name': 'analytics', - 'children': [ - { - 'name': 'cluster', - 'children': [ - { 'name': 'AgglomerativeCluster', 'size': 3938 }, - { 'name': 'CommunityStructure', 'size': 3812 }, - { 'name': 'HierarchicalCluster', 'size': 6714 }, - { 'name': 'MergeEdge', 'size': 743 } - ] - }, - { - 'name': 'graph', - 'children': [ - { 'name': 'BetweennessCentrality', 'size': 3534 }, - { 'name': 'LinkDistance', 'size': 5731 }, - { 'name': 'MaxFlowMinCut', 'size': 7840 }, - { 'name': 'ShortestPaths', 'size': 5914 }, - { 'name': 'SpanningTree', 'size': 3416 } - ] - }, - { - 'name': 'optimization', - 'children': [ - { 'name': 'AspectRatioBanker', 'size': 7074 } - ] - } - ] - } - ] - }], - stackedAreaChart: [ - { - 'key': 'North America', - 'values': [[1025409600000, 23.041422681023], [1028088000000, 19.854291255832]] - }, - { - 'key': 'Africa', - 'values': [[1025409600000, 7.9356392949025], [1028088000000, 7.4514668527298]] - } - ], - multiBarHorizontalChart: [ - { - 'key': 'Series1', - 'values': [ - { - 'label': 'Group A', - 'value': -1.8746444827653 - }, - { - 'label': 'Group B', - 'value': -8.0961543492239 - } - ] - }, - { - 'key': 'Series2', - 'values': [ - { - 'label': 'Group A', - 'value': 25.307646510375 - }, - { - 'label': 'Group B', - 'value': 16.756779544553 - } - ] - } - ], - cumulativeLineChart: [ - { - key: 'Long', - values: [[1083297600000, -2.974623048543], [1085976000000, -1.7740300785979]], - mean: 250 - }, - { - key: 'Short', - values: [[1083297600000, -0.77078283705125], [1085976000000, -1.8356366650335]], - mean: -60 - } - ], - historicalBarChart: [ - { - 'key': 'Quantity', - 'bar': true, - 'values': [[1136005200000, 1271000.0], [1138683600000, 1271000.0], [1141102800000, 1271000.0]] - } - ], - parallelCoordinates: [ - { - 'name': 'AMC Ambassador Brougham', - 'economy (mpg)': '13', - 'cylinders': '8', - 'displacement (cc)': '360', - 'power (hp)': '175', - 'weight (lb)': '3821', - '0-60 mph (s)': '11', - 'year': '73' - }, - { - 'name': 'AMC Ambassador DPL', - 'economy (mpg)': '15', - 'cylinders': '8', - 'displacement (cc)': '390', - 'power (hp)': '190', - 'weight (lb)': '3850', - '0-60 mph (s)': '8.5', - 'year': '70' - } - ], - sparklinePlus: [{ x: 1083297600000, y: 2.974623048543 }, { x: 1085976000000, y: 1.7740300785979 }], - bulletChart: { - 'title': 'Revenue', - 'subtitle': 'US$, in thousands', - 'ranges': [150, 225, 300], - 'measures': [220], - 'markers': [250] - }, - linePlusBarWithFocusChart: [ - { - 'key': 'Quantity', - 'bar': true, - 'values': [{ x: 1083297600000, y: 2.974623048543 }, { x: 1085976000000, y: 1.7740300785979 }] - }, - { - 'key': 'Price', - 'values': [{ x: 1083297600000, y: 2.974623048543 }, { x: 1085976000000, y: 1.7740300785979 }] - } - ], - forceDirectedGraph: { - 'nodes': [ - { 'name': 'Myriel', 'group': 1 }, - { 'name': 'Napoleon', 'group': 1 }, - { 'name': 'Labarre', 'group': 2 }, - { 'name': 'Valjean', 'group': 2 }, - { 'name': 'Marguerite', 'group': 3 }, - { 'name': 'Mme.deR', 'group': 3 } - ], - 'links': [ - { 'source': 1, 'target': 0, 'value': 1 }, - { 'source': 2, 'target': 0, 'value': 8 }, - { 'source': 3, 'target': 1, 'value': 10 }, - { 'source': 3, 'target': 2, 'value': 6 }, - { 'source': 4, 'target': 0, 'value': 1 }, - { 'source': 5, 'target': 3, 'value': 1 } - ] - } - }; - SampleData.chartClassExpected = { - lineChart: 'nv-lineChart', - discreteBarChart: 'nv-discreteBarWithAxes', - pieChart: 'nv-pieChart', - scatterChart: 'nv-scatterChart', - multiBarChart: 'nv-multiBarWithLegend', - multiBarHorizontalChart: 'nv-multiBarHorizontalChart', - candlestickBarChart: 'nv-historicalBarChart', - ohlcBarChart: 'nv-historicalBarChar', - boxPlotChart: 'nv-boxPlotWithAxes', - multiChart: 'multiChart', - sunburstChart: 'nv-sunburst', - stackedAreaChart: 'nv-stackedAreaChart', - cumulativeLineChart: 'nv-cumulativeLine', - historicalBarChart: 'nv-historicalBarChart', - parallelCoordinates: 'nv-parallelCoordinates', - sparklinePlus: 'nv-sparklineplus', - bulletChart: 'nv-bulletChart', - linePlusBarWithFocusChart: 'nv-linePlusBar', - forceDirectedGraph: 'nv-force-node' - }; -})(SampleData = exports.SampleData || (exports.SampleData = {})); diff --git a/tsconfig.json b/tsconfig.json index fac2c08..b69568f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,7 +19,6 @@ "files": [ "src/angular2-nvd3/angular2-nvd3.component.ts", "src/angular2-nvd3/angular2-nvd3.directive.ts", - "src/angular2-nvd3/angular2-nvd3.module.ts", - "src/test/angular2-nvd3.component.spec.ts" + "src/angular2-nvd3/angular2-nvd3.module.ts" ] } \ No newline at end of file