diff --git a/README.md b/README.md index 9e9617e..438a1d0 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ - [@essent/nativescript-iadvize](packages/nativescript-iadvize/README.md) - [@essent/nativescript-medallia](packages/nativescript-medallia/README.md) - [@essent/nativescript-ng-sentry](packages/nativescript-ng-sentry/README.md) +- [@essent/nativescript-ui-charts](packages/nativescript-ui-charts/README.md) - [@essent/nativescript-urban-airship](packages/nativescript-urban-airship/README.md) # How to use? diff --git a/apps/demo-angular/custom_android/application.android.ts b/apps/demo-angular/custom_android/application.android.ts index 4ffed42..abbdaf5 100644 --- a/apps/demo-angular/custom_android/application.android.ts +++ b/apps/demo-angular/custom_android/application.android.ts @@ -1,4 +1,4 @@ -import { urbanAirshipSettings } from './urbanAirshipSettings'; +// import { urbanAirshipSettings } from './urbanAirshipSettings'; // import { NsUrbanAirship } from '@essent/nativescript-urban-airship'; // the `JavaProxy` decorator specifies the package and the name for the native *.JAVA file generated. diff --git a/apps/demo-angular/package.json b/apps/demo-angular/package.json index b6c7700..e090d92 100644 --- a/apps/demo-angular/package.json +++ b/apps/demo-angular/package.json @@ -2,11 +2,13 @@ "main": "./src/main.ts", "dependencies": { "@nativescript/core": "file:../../node_modules/@nativescript/core", - "@essent/nativescript-ng-sentry": "file:../../dist/packages/nativescript-ng-sentry", + "@essent/nativescript-ui-charts": "file:../../dist/packages/nativescript-ui-charts", "@essent/nativescript-adobe-experience-cloud": "file:../../dist/packages/nativescript-adobe-experience-cloud", "@essent/nativescript-appdynamics": "file:../../dist/packages/nativescript-appdynamics", "@essent/nativescript-iadvize": "file:../../dist/packages/nativescript-iadvize", "@essent/nativescript-medallia": "file:../../dist/packages/nativescript-medallia", + "@essent/nativescript-ng-sentry": "file:../../dist/packages/nativescript-ng-sentry", + "@nativescript/nativescript-ui-charts": "file:../../dist/packages/nativescript-ui-charts", "@essent/nativescript-urban-airship": "file:../../dist/packages/nativescript-urban-airship" }, "devDependencies": { diff --git a/apps/demo-angular/src/app-routing.module.ts b/apps/demo-angular/src/app-routing.module.ts index 0d7cd81..a28efe2 100644 --- a/apps/demo-angular/src/app-routing.module.ts +++ b/apps/demo-angular/src/app-routing.module.ts @@ -12,6 +12,7 @@ const routes: Routes = [ { path: 'nativescript-iadvize', loadChildren: () => import('./plugin-demos/nativescript-iadvize.module').then((m) => m.NativescriptIadvizeModule) }, { path: 'nativescript-medallia', loadChildren: () => import('./plugin-demos/nativescript-medallia.module').then((m) => m.NativescriptMedalliaModule) }, { path: 'nativescript-ng-sentry', loadChildren: () => import('./plugin-demos/nativescript-ng-sentry.module').then((m) => m.NativescriptNgSentryModule) }, + { path: 'nativescript-ui-charts', loadChildren: () => import('./plugin-demos/nativescript-ui-charts.module').then((m) => m.NativescriptUiChartsModule) }, { path: 'nativescript-urban-airship', loadChildren: () => import('./plugin-demos/nativescript-urban-airship.module').then((m) => m.NativescriptUrbanAirshipModule) }, ]; diff --git a/apps/demo-angular/src/home.component.ts b/apps/demo-angular/src/home.component.ts index 15e0a2b..43d7207 100644 --- a/apps/demo-angular/src/home.component.ts +++ b/apps/demo-angular/src/home.component.ts @@ -21,6 +21,9 @@ export class HomeComponent { { name: 'nativescript-ng-sentry', }, + { + name: 'nativescript-ui-charts', + }, { name: 'nativescript-urban-airship', }, diff --git a/apps/demo-angular/src/plugin-demos/nativescript-ui-charts.component.html b/apps/demo-angular/src/plugin-demos/nativescript-ui-charts.component.html new file mode 100644 index 0000000..7fcee0f --- /dev/null +++ b/apps/demo-angular/src/plugin-demos/nativescript-ui-charts.component.html @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/apps/demo-angular/src/plugin-demos/nativescript-ui-charts.component.scss b/apps/demo-angular/src/plugin-demos/nativescript-ui-charts.component.scss new file mode 100644 index 0000000..52e2394 --- /dev/null +++ b/apps/demo-angular/src/plugin-demos/nativescript-ui-charts.component.scss @@ -0,0 +1,3 @@ +.graph { + height: 300; +} diff --git a/apps/demo-angular/src/plugin-demos/nativescript-ui-charts.component.ts b/apps/demo-angular/src/plugin-demos/nativescript-ui-charts.component.ts new file mode 100644 index 0000000..504b487 --- /dev/null +++ b/apps/demo-angular/src/plugin-demos/nativescript-ui-charts.component.ts @@ -0,0 +1,405 @@ +import { Component, NgZone } from '@angular/core'; +import { DemoSharedNativescriptUiCharts } from '@demo/shared'; +import {} from '@essent/nativescript-ui-charts'; + +@Component({ + selector: 'demo-nativescript-ui-charts', + templateUrl: 'nativescript-ui-charts.component.html', + styleUrls: ['./nativescript-ui-charts.component.scss'], +}) +export class NativescriptUiChartsComponent { + demoShared: DemoSharedNativescriptUiCharts; + + public options = { + plotOptions: { + column: { + stacking: 'normal', + borderRadius: 4, + pointWidth: 30, + borderWidth: 0, + }, + series: { + animation: true, + }, + }, + boost: { + enabled: true, + useGPUTranslations: true, + }, + chart: { + scrollablePlotArea: { + minWidth: 1400, + scrollPositionX: 1, + }, + spacingBottom: 30, + animation: true, + }, + legend: { + verticalAlign: 'top', + }, + yAxis: { + min: -360, + max: 360, + title: { + text: 'kWh', + }, + tickAmount: 7, + }, + title: { + text: '', + }, + tooltip: { + enabled: false, + }, + credits: { + enabled: false, + }, + series: [ + { + type: 'column', + yAxis: 0, + states: { + hover: { + enabled: false, + }, + inactive: { + enabled: false, + }, + select: { + enabled: false, + }, + }, + pointPadding: 0.01, + maxPointWidth: 30, + groupPadding: 0.1, + name: 'Stroom', + id: 'Electricity', + stack: 'verbruik', + color: '#5FB624', + data: [ + { + y: 215, + selected: false, + id: '2020-10-05;2020-11-01', + }, + { + y: 266, + selected: false, + id: '2020-11-01;2020-12-01', + }, + { + y: 308, + selected: false, + id: '2020-12-01;2021-01-01', + }, + { + y: 257, + selected: false, + id: '2021-01-01;2021-02-01', + }, + { + y: 239, + selected: false, + id: '2021-02-01;2021-03-01', + }, + { + y: 222, + selected: false, + id: '2021-03-01;2021-04-01', + }, + { + y: 188, + selected: false, + id: '2021-04-01;2021-05-01', + }, + { + y: 162, + selected: false, + id: '2021-05-01;2021-06-01', + }, + { + y: 154, + selected: false, + id: '2021-06-01;2021-07-01', + }, + { + y: 59, + selected: false, + id: '2021-07-01;2021-08-01', + }, + { + y: 168, + selected: false, + id: '2021-08-01;2021-09-01', + }, + { + y: 195, + selected: false, + id: '2021-09-01;2021-10-01', + }, + { + y: 209, + selected: false, + id: '2021-10-01;2021-11-01', + }, + { + y: 270, + selected: false, + id: '2021-11-01;2021-12-01', + }, + { + y: 323, + selected: false, + id: '2021-12-01;2022-01-01', + }, + { + y: 311, + selected: false, + id: '2022-01-01;2022-02-01', + }, + { + y: 219, + selected: false, + id: '2022-02-01;2022-03-01', + }, + { + y: 211, + selected: false, + id: '2022-03-01;2022-04-01', + }, + { + y: 175, + selected: false, + id: '2022-04-01;2022-05-01', + }, + { + y: 165, + selected: false, + id: '2022-05-01;2022-06-01', + }, + { + y: 143, + selected: false, + id: '2022-06-01;2022-07-01', + }, + { + y: 150, + selected: false, + id: '2022-07-01;2022-08-01', + }, + { + y: 96, + selected: false, + id: '2022-08-01;2022-09-01', + }, + { + y: 194, + selected: false, + id: '2022-09-01;2022-10-01', + }, + { + y: 211, + selected: false, + id: '2022-10-01;2022-11-01', + }, + { + y: 262, + selected: false, + id: '2022-11-01;2022-12-01', + }, + { + y: 299, + selected: false, + id: '2022-12-01;2023-01-01', + }, + { + y: 282, + selected: true, + id: '2023-01-01;2023-02-01', + }, + ], + allowPointSelect: false, + }, + { + type: 'column', + yAxis: 0, + states: { + hover: { + enabled: false, + }, + inactive: { + enabled: false, + }, + select: { + enabled: false, + }, + }, + pointPadding: 0.01, + maxPointWidth: 30, + groupPadding: 0.1, + name: 'Teruglevering', + id: 'ReturnSupply', + stack: 'verbruik', + color: '#FFC800', + data: [ + { + y: -38, + selected: false, + id: '2020-10-05;2020-11-01', + }, + { + y: -23, + selected: false, + id: '2020-11-01;2020-12-01', + }, + { + y: -5, + selected: false, + id: '2020-12-01;2021-01-01', + }, + { + y: -17, + selected: false, + id: '2021-01-01;2021-02-01', + }, + { + y: -44, + selected: false, + id: '2021-02-01;2021-03-01', + }, + { + y: -100, + selected: false, + id: '2021-03-01;2021-04-01', + }, + { + y: -196, + selected: false, + id: '2021-04-01;2021-05-01', + }, + { + y: -231, + selected: false, + id: '2021-05-01;2021-06-01', + }, + { + y: -241, + selected: false, + id: '2021-06-01;2021-07-01', + }, + { + y: -272, + selected: false, + id: '2021-07-01;2021-08-01', + }, + { + y: -174, + selected: false, + id: '2021-08-01;2021-09-01', + }, + { + y: -119, + selected: false, + id: '2021-09-01;2021-10-01', + }, + { + y: -62, + selected: false, + id: '2021-10-01;2021-11-01', + }, + { + y: -20, + selected: false, + id: '2021-11-01;2021-12-01', + }, + { + y: -4, + selected: false, + id: '2021-12-01;2022-01-01', + }, + { + y: -9, + selected: false, + id: '2022-01-01;2022-02-01', + }, + { + y: -51, + selected: false, + id: '2022-02-01;2022-03-01', + }, + { + y: -149, + selected: false, + id: '2022-03-01;2022-04-01', + }, + { + y: -198, + selected: false, + id: '2022-04-01;2022-05-01', + }, + { + y: -256, + selected: false, + id: '2022-05-01;2022-06-01', + }, + { + y: -268, + selected: false, + id: '2022-06-01;2022-07-01', + }, + { + y: -255, + selected: false, + id: '2022-07-01;2022-08-01', + }, + { + y: -257, + selected: false, + id: '2022-08-01;2022-09-01', + }, + { + y: -135, + selected: false, + id: '2022-09-01;2022-10-01', + }, + { + y: -71, + selected: false, + id: '2022-10-01;2022-11-01', + }, + { + y: -22, + selected: false, + id: '2022-11-01;2022-12-01', + }, + { + y: -9, + selected: false, + id: '2022-12-01;2023-01-01', + }, + { + y: -14, + selected: true, + id: '2023-01-01;2023-02-01', + }, + ], + allowPointSelect: false, + }, + ], + xAxis: { + categories: ['okt', 'nov', 'dec', 'jan', 'feb', 'mrt', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec', 'jan', 'feb', 'mrt', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec', 'jan'], + labels: { + padding: 0, + }, + }, + exporting: { + enabled: false, + }, + }; + + constructor(private _ngZone: NgZone) {} + + ngOnInit() { + this.demoShared = new DemoSharedNativescriptUiCharts(); + } +} diff --git a/apps/demo-angular/src/plugin-demos/nativescript-ui-charts.module.ts b/apps/demo-angular/src/plugin-demos/nativescript-ui-charts.module.ts new file mode 100644 index 0000000..5c6d464 --- /dev/null +++ b/apps/demo-angular/src/plugin-demos/nativescript-ui-charts.module.ts @@ -0,0 +1,11 @@ +import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core'; +import { NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescript/angular'; +import { NativescriptUiChartsComponent } from './nativescript-ui-charts.component'; +import { UIChartsViewModule } from '@essent/nativescript-ui-charts/angular'; + +@NgModule({ + imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: NativescriptUiChartsComponent }]), UIChartsViewModule], + declarations: [NativescriptUiChartsComponent], + schemas: [NO_ERRORS_SCHEMA], +}) +export class NativescriptUiChartsModule {} diff --git a/apps/demo-angular/src/plugin-demos/nativescript-urban-airship.component.ts b/apps/demo-angular/src/plugin-demos/nativescript-urban-airship.component.ts index 74ff3b3..a9806d4 100644 --- a/apps/demo-angular/src/plugin-demos/nativescript-urban-airship.component.ts +++ b/apps/demo-angular/src/plugin-demos/nativescript-urban-airship.component.ts @@ -1,19 +1,17 @@ import { Component, NgZone } from '@angular/core'; import { DemoSharedNativescriptUrbanAirship } from '@demo/shared'; -import { } from '@essent/nativescript-urban-airship'; +import {} from '@essent/nativescript-urban-airship'; @Component({ - selector: 'demo-nativescript-urban-airship', - templateUrl: 'nativescript-urban-airship.component.html', + selector: 'demo-nativescript-urban-airship', + templateUrl: 'nativescript-urban-airship.component.html', }) export class NativescriptUrbanAirshipComponent { - demoShared: DemoSharedNativescriptUrbanAirship; - - constructor(private _ngZone: NgZone) {} + + constructor(private _ngZone: NgZone) {} ngOnInit() { this.demoShared = new DemoSharedNativescriptUrbanAirship(); } - -} \ No newline at end of file +} diff --git a/apps/demo-angular/src/plugin-demos/nativescript-urban-airship.module.ts b/apps/demo-angular/src/plugin-demos/nativescript-urban-airship.module.ts index c4df864..11054da 100644 --- a/apps/demo-angular/src/plugin-demos/nativescript-urban-airship.module.ts +++ b/apps/demo-angular/src/plugin-demos/nativescript-urban-airship.module.ts @@ -3,8 +3,8 @@ import { NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescrip import { NativescriptUrbanAirshipComponent } from './nativescript-urban-airship.component'; @NgModule({ - imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: NativescriptUrbanAirshipComponent }])], + imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: NativescriptUrbanAirshipComponent }])], declarations: [NativescriptUrbanAirshipComponent], - schemas: [ NO_ERRORS_SCHEMA] + schemas: [NO_ERRORS_SCHEMA], }) export class NativescriptUrbanAirshipModule {} diff --git a/apps/demo/package.json b/apps/demo/package.json index 018db4f..92550a1 100644 --- a/apps/demo/package.json +++ b/apps/demo/package.json @@ -5,11 +5,13 @@ "repository": "", "dependencies": { "@nativescript/core": "file:../../node_modules/@nativescript/core", - "@essent/nativescript-ng-sentry": "file:../../packages/nativescript-ng-sentry", + "@essent/nativescript-ui-charts": "file:../../packages/nativescript-ui-charts", "@essent/nativescript-adobe-experience-cloud": "file:../../packages/nativescript-adobe-experience-cloud", "@essent/nativescript-appdynamics": "file:../../packages/nativescript-appdynamics", "@essent/nativescript-iadvize": "file:../../packages/nativescript-iadvize", "@essent/nativescript-medallia": "file:../../packages/nativescript-medallia", + "@essent/nativescript-ng-sentry": "file:../../packages/nativescript-ng-sentry", + "@nativescript/nativescript-ui-charts": "file:../../packages/nativescript-ui-charts", "@essent/nativescript-urban-airship": "file:../../packages/nativescript-urban-airship" }, "devDependencies": { diff --git a/apps/demo/project.json b/apps/demo/project.json index 87572e6..96ad890 100644 --- a/apps/demo/project.json +++ b/apps/demo/project.json @@ -24,7 +24,8 @@ "ios": { "executor": "@nativescript/nx:build", "options": { - "platform": "ios" + "platform": "ios", + "noHmr": true }, "dependsOn": [ { @@ -36,7 +37,8 @@ "android": { "executor": "@nativescript/nx:build", "options": { - "platform": "android" + "platform": "android", + "noHmr": true }, "dependsOn": [ { diff --git a/apps/demo/src/main-page.xml b/apps/demo/src/main-page.xml index 098929c..15c7020 100644 --- a/apps/demo/src/main-page.xml +++ b/apps/demo/src/main-page.xml @@ -10,6 +10,7 @@