Skip to content

Commit

Permalink
docs(ngx charts): Added documentation around ngx charts and links t…
Browse files Browse the repository at this point in the history
…o their docs (#219)

* initial install commit for ngx-chart

* install commit

* lint errors fixed

* Line & Area Chart added

* ngx-charts updated to the latest version

* update(ngx-charts): overhaul ngx-chart demo & info

* remove blank README and pipe as provider
  • Loading branch information
richavyas authored and emoralesb05 committed Jan 27, 2017
1 parent 5e5a7ef commit d8311eb
Show file tree
Hide file tree
Showing 13 changed files with 928 additions and 56 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@
"@angular/platform-browser-dynamic": "^2.4.4",
"@angular/platform-server": "^2.4.4",
"@angular/router": "^3.4.4",
"@swimlane/ngx-charts": "^4.0.1",
"core-js": "^2.4.1",
"hammerjs": "^2.0.8",
"highlight.js": "9.9.0",
"rxjs": "^5.0.1",
"showdown": "1.6.0",
"zone.js": "^0.7.2",
"d3": "^4.2.1"
"d3": "^4.4.0"
},
"devDependencies": {
"@angular/compiler-cli": "^2.4.4",
Expand Down Expand Up @@ -112,4 +113,4 @@
"tslint": "^4.3.1",
"typescript": "2.1.5"
}
}
}
13 changes: 13 additions & 0 deletions src/app/components/components/components.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ <h3 md-line> {{item.title}} </h3>
</a>
<md-divider *ngIf="!last" md-inset></md-divider>
</template>
<h3 md-subheader>External Components</h3>
<template let-item let-last="last" ngFor [ngForOf]="external">
<a md-list-item
[routerLink]="[item.route]"
[routerLinkActive]="['active']"
[routerLinkActiveOptions]="{exact:true}"
(click)="list.toggle()">
<md-icon md-list-avatar>{{item.icon}}</md-icon>
<h3 md-line> {{item.title}} </h3>
<p md-line> {{item.description}} </p>
</a>
<md-divider *ngIf="!last" md-inset></md-divider>
</template>
</md-nav-list>
<div nav-toolbar-content layout="row" layout-align="center center" flex>
<span>Covalent Components &amp; Addons</span>
Expand Down
19 changes: 13 additions & 6 deletions src/app/components/components/components.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,6 @@ export class ComponentsComponent {
icon: 'chrome_reader_mode',
route: 'markdown',
title: 'Markdown',
}, {
description: 'Responsive Charts',
icon: 'show_chart',
route: 'charts',
title: 'Charts',
}, {
description: 'Build forms from a JS object',
icon: 'format_align_center',
Expand All @@ -119,6 +114,18 @@ export class ComponentsComponent {
description: 'Http wrappers and helpers',
icon: 'http',
route: 'http',
title: 'Http',
title: 'HTTP Service',
}, {
description: 'Simple responsive charts',
icon: 'show_chart',
route: 'charts',
title: 'TD Charts',
}];

external: Object[] = [{
description: 'Declarative D3 framework for ng2',
icon: 'insert_chart',
route: 'ngx-charts',
title: 'NGX-Charts',
}];
}
7 changes: 7 additions & 0 deletions src/app/components/components/components.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ import { DialogsDemoComponent } from './dialogs/dialogs.component';
import { DirectivesComponent } from './directives/directives.component';
import { PipesComponent } from './pipes/pipes.component';
import { ChartsDemoComponent } from './charts/charts.component';
import { NgxChartsDemoComponent } from './ngx-charts/ngx-charts.component';
import { DataTableDemoComponent } from './data-table/data-table.component';
import { PagingDemoComponent } from './paging/paging.component';
import { SearchDemoComponent } from './search/search.component';
import { DynamicFormsDemoComponent } from './dynamic-forms/dynamic-forms.component';
import { MaterialComponentsComponent, DialogComponent } from './material-components/material-components.component';
import { NotificationsDemoComponent } from './notifications/notifications.component';

// External Dependencies
import { NgxChartsModule } from '@swimlane/ngx-charts';

import { CovalentCoreModule } from '../../../platform/core';
import { CovalentHighlightModule } from '../../../platform/highlight';
import { CovalentMarkdownModule } from '../../../platform/markdown';
Expand Down Expand Up @@ -58,6 +62,8 @@ import { DocumentationToolsModule } from '../../documentation-tools';
MaterialComponentsComponent,
DialogComponent,
NotificationsDemoComponent,
// External Dependencies
NgxChartsDemoComponent,
],
imports: [
CovalentCoreModule.forRoot(),
Expand All @@ -67,6 +73,7 @@ import { DocumentationToolsModule } from '../../documentation-tools';
CovalentDynamicFormsModule.forRoot(),
DocumentationToolsModule.forRoot(),
componentsRoutes,
NgxChartsModule,
],
entryComponents: [ DialogComponent ],
})
Expand Down
4 changes: 4 additions & 0 deletions src/app/components/components/components.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { DialogsDemoComponent } from './dialogs/dialogs.component';
import { DirectivesComponent } from './directives/directives.component';
import { PipesComponent } from './pipes/pipes.component';
import { ChartsDemoComponent } from './charts/charts.component';
import { NgxChartsDemoComponent } from './ngx-charts/ngx-charts.component';
import { DataTableDemoComponent } from './data-table/data-table.component';
import { PagingDemoComponent } from './paging/paging.component';
import { SearchDemoComponent } from './search/search.component';
Expand Down Expand Up @@ -75,6 +76,9 @@ const routes: Routes = [{
}, {
component: ChartsDemoComponent,
path: 'charts',
}, {
component: NgxChartsDemoComponent,
path: 'ngx-charts',
}, {
component: DataTableDemoComponent,
path: 'data-table',
Expand Down
146 changes: 146 additions & 0 deletions src/app/components/components/ngx-charts/data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
export let single: any = [
{
'name': 'Databases',
'value': 382941,
},
{
'name': 'Containers',
'value': 152294,
},
{
'name': 'Streams',
'value': 283000,
},
{
'name': 'Queries',
'value': 828921,
},
];

export let multi: any = [
{
'name': 'Containers',
'series': [
{
'value': 2469,
'name': '2016-09-15T19:25:07.773Z',
},
{
'value': 3619,
'name': '2016-09-17T17:16:53.279Z',
},
{
'value': 3885,
'name': '2016-09-15T10:34:32.344Z',
},
{
'value': 4289,
'name': '2016-09-19T14:33:45.710Z',
},
{
'value': 3309,
'name': '2016-09-12T18:48:58.925Z',
},
],
},
{
'name': 'Alerts',
'series': [
{
'value': 2452,
'name': '2016-09-15T19:25:07.773Z',
},
{
'value': 4938,
'name': '2016-09-17T17:16:53.279Z',
},
{
'value': 4110,
'name': '2016-09-15T10:34:32.344Z',
},
{
'value': 3828,
'name': '2016-09-19T14:33:45.710Z',
},
{
'value': 5772,
'name': '2016-09-12T18:48:58.925Z',
},
],
},
{
'name': 'Streams',
'series': [
{
'value': 4022,
'name': '2016-09-15T19:25:07.773Z',
},
{
'value': 2345,
'name': '2016-09-17T17:16:53.279Z',
},
{
'value': 5148,
'name': '2016-09-15T10:34:32.344Z',
},
{
'value': 6868,
'name': '2016-09-19T14:33:45.710Z',
},
{
'value': 5415,
'name': '2016-09-12T18:48:58.925Z',
},
],
},
{
'name': 'Databases',
'series': [
{
'value': 6194,
'name': '2016-09-15T19:25:07.773Z',
},
{
'value': 6585,
'name': '2016-09-17T17:16:53.279Z',
},
{
'value': 6857,
'name': '2016-09-15T10:34:32.344Z',
},
{
'value': 2545,
'name': '2016-09-19T14:33:45.710Z',
},
{
'value': 5986,
'name': '2016-09-12T18:48:58.925Z',
},
],
},
{
'name': 'NoSQL',
'series': [
{
'value': 4260,
'name': '2016-09-15T19:25:07.773Z',
},
{
'value': 4810,
'name': '2016-09-17T17:16:53.279Z',
},
{
'value': 5087,
'name': '2016-09-15T10:34:32.344Z',
},
{
'value': 5941,
'name': '2016-09-19T14:33:45.710Z',
},
{
'value': 6427,
'name': '2016-09-12T18:48:58.925Z',
},
],
},
];
Loading

0 comments on commit d8311eb

Please sign in to comment.