diff --git a/README.md b/README.md index 1db8858b7..6591c45b0 100644 --- a/README.md +++ b/README.md @@ -5,14 +5,15 @@ npm run setup npm start ``` -- @nativescript/canvas -- @nativescript/canvas-babylon -- @nativescript/canvas-media -- @nativescript/canvas-phaser -- @nativescript/canvas-phaser-ce -- @nativescript/canvas-pixi -- @nativescript/canvas-polyfill -- @nativescript/canvas-three +- [@nativescript/canvas](packages/canvas/README.md) +- [@nativescript/canvas-babylon](packages/canvas-babylon/README.md) +- [@nativescript/canvas-chartjs](packages/canvas-chartjs/README.md) +- [@nativescript/canvas-media](packages/canvas-media/README.md) +- [@nativescript/canvas-phaser](packages/canvas-phaser/README.md) +- [@nativescript/canvas-phaser-ce](packages/canvas-phaser-ce/README.md) +- [@nativescript/canvas-pixi](packages/canvas-pixi/README.md) +- [@nativescript/canvas-polyfill](packages/canvas-polyfill/README.md) +- [@nativescript/canvas-three](packages/canvas-three/README.md) # How to use? diff --git a/apps/demo-angular/package.json b/apps/demo-angular/package.json index 8cb61c5d1..d45e52469 100644 --- a/apps/demo-angular/package.json +++ b/apps/demo-angular/package.json @@ -1,19 +1,20 @@ { - "main": "./src/main.ts", - "dependencies": { - "@nativescript/canvas": "file:../../dist/packages/canvas", - "@nativescript/canvas-babylon": "file:../../dist/packages/canvas-babylon", - "@nativescript/canvas-media": "file:../../dist/packages/canvas-media", - "@nativescript/canvas-phaser": "file:../../dist/packages/canvas-phaser", - "@nativescript/canvas-phaser-ce": "file:../../dist/packages/canvas-phaser-ce", - "@nativescript/canvas-pixi": "file:../../dist/packages/canvas-pixi", - "@nativescript/canvas-polyfill": "file:../../dist/packages/canvas-polyfill", - "@nativescript/canvas-three": "file:../../dist/packages/canvas-three", - "@nativescript/core": "file:../../node_modules/@nativescript/core", - "three": "file:../../node_modules/three" - }, - "devDependencies": { - "@nativescript/android": "~8.5.0", - "@nativescript/ios": "8.5.1-dev.0" - } + "main": "./src/main.ts", + "dependencies": { + "@nativescript/canvas": "file:../../dist/packages/canvas", + "@nativescript/canvas-babylon": "file:../../dist/packages/canvas-babylon", + "@nativescript/canvas-media": "file:../../dist/packages/canvas-media", + "@nativescript/canvas-phaser": "file:../../dist/packages/canvas-phaser", + "@nativescript/canvas-phaser-ce": "file:../../dist/packages/canvas-phaser-ce", + "@nativescript/canvas-pixi": "file:../../dist/packages/canvas-pixi", + "@nativescript/canvas-polyfill": "file:../../dist/packages/canvas-polyfill", + "@nativescript/canvas-three": "file:../../dist/packages/canvas-three", + "@nativescript/core": "file:../../node_modules/@nativescript/core", + "three": "file:../../node_modules/three", + "@nativescript/canvas-chartjs": "file:../../dist/packages/canvas-chartjs" + }, + "devDependencies": { + "@nativescript/android": "~8.5.0", + "@nativescript/ios": "8.5.1-dev.0" + } } diff --git a/apps/demo-angular/src/app-routing.module.ts b/apps/demo-angular/src/app-routing.module.ts index ef3578032..5b1c933ac 100644 --- a/apps/demo-angular/src/app-routing.module.ts +++ b/apps/demo-angular/src/app-routing.module.ts @@ -9,6 +9,7 @@ const routes: Routes = [ { path: 'home', component: HomeComponent }, { path: 'canvas', loadChildren: () => import('./plugin-demos/canvas.module').then(m => m.CanvasModule) }, { path: 'canvas-babylon', loadChildren: () => import('./plugin-demos/canvas-babylon.module').then(m => m.CanvasBabylonModule) }, + { path: 'canvas-chartjs', loadChildren: () => import('./plugin-demos/canvas-chartjs.module').then(m => m.CanvasChartjsModule) }, { path: 'canvas-media', loadChildren: () => import('./plugin-demos/canvas-media.module').then(m => m.CanvasMediaModule) }, { path: 'canvas-phaser', loadChildren: () => import('./plugin-demos/canvas-phaser.module').then(m => m.CanvasPhaserModule) }, { path: 'canvas-phaser-ce', loadChildren: () => import('./plugin-demos/canvas-phaser-ce.module').then(m => m.CanvasPhaserCeModule) }, diff --git a/apps/demo-angular/src/home.component.ts b/apps/demo-angular/src/home.component.ts index e351d431e..9dbe641be 100644 --- a/apps/demo-angular/src/home.component.ts +++ b/apps/demo-angular/src/home.component.ts @@ -9,34 +9,32 @@ export class HomeComponent { constructor(private router: RouterExtensions){} demos = [ - { - name: 'canvas', - }, - { - name: 'canvas-babylon', - }, - { - name: 'canvas-media', - }, - { - name: 'canvas-phaser', - }, - { - name: 'canvas-phaser-ce', - }, - { - name: 'canvas-pixi', - }, - { - name: 'canvas-polyfill', - }, - { - name: 'canvas-three', - }, - ]; - - onTap(event){ - const item = this.demos[event.index]; - this.router.navigate(['/' + item.name]); + { + name: 'canvas' + }, + { + name: 'canvas-babylon' + }, + { + name: 'canvas-chartjs' + }, + { + name: 'canvas-media' + }, + { + name: 'canvas-phaser' + }, + { + name: 'canvas-phaser-ce' + }, + { + name: 'canvas-pixi' + }, + { + name: 'canvas-polyfill' + }, + { + name: 'canvas-three' } -} +]; +} \ No newline at end of file diff --git a/apps/demo-angular/src/plugin-demos/canvas-chartjs.component.html b/apps/demo-angular/src/plugin-demos/canvas-chartjs.component.html new file mode 100644 index 000000000..ae852df04 --- /dev/null +++ b/apps/demo-angular/src/plugin-demos/canvas-chartjs.component.html @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/apps/demo-angular/src/plugin-demos/canvas-chartjs.component.ts b/apps/demo-angular/src/plugin-demos/canvas-chartjs.component.ts new file mode 100644 index 000000000..77b350cfa --- /dev/null +++ b/apps/demo-angular/src/plugin-demos/canvas-chartjs.component.ts @@ -0,0 +1,19 @@ +import { Component, NgZone } from '@angular/core'; +import { DemoSharedCanvasChartjs } from '@demo/shared'; +import { } from '@nativescript/canvas-chartjs'; + +@Component({ + selector: 'demo-canvas-chartjs', + templateUrl: 'canvas-chartjs.component.html', +}) +export class CanvasChartjsComponent { + + demoShared: DemoSharedCanvasChartjs; + + constructor(private _ngZone: NgZone) {} + + ngOnInit() { + this.demoShared = new DemoSharedCanvasChartjs(); + } + +} \ No newline at end of file diff --git a/apps/demo-angular/src/plugin-demos/canvas-chartjs.module.ts b/apps/demo-angular/src/plugin-demos/canvas-chartjs.module.ts new file mode 100644 index 000000000..004afb2ff --- /dev/null +++ b/apps/demo-angular/src/plugin-demos/canvas-chartjs.module.ts @@ -0,0 +1,10 @@ +import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core'; +import { NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescript/angular'; +import { CanvasChartjsComponent } from './canvas-chartjs.component'; + +@NgModule({ + imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: CanvasChartjsComponent }])], + declarations: [CanvasChartjsComponent], + schemas: [ NO_ERRORS_SCHEMA] +}) +export class CanvasChartjsModule {} diff --git a/apps/demo-vue/app/plugin-demos/canvas-chartjs.vue b/apps/demo-vue/app/plugin-demos/canvas-chartjs.vue new file mode 100644 index 000000000..18ce9c8a1 --- /dev/null +++ b/apps/demo-vue/app/plugin-demos/canvas-chartjs.vue @@ -0,0 +1,34 @@ + + + + + diff --git a/apps/demo-vue/package.json b/apps/demo-vue/package.json index 13b993060..bf2306b00 100644 --- a/apps/demo-vue/package.json +++ b/apps/demo-vue/package.json @@ -1,19 +1,20 @@ { - "main": "./app/app.ts", - "dependencies": { - "nativescript-vue": "file:../../node_modules/nativescript-vue", - "@nativescript/core": "file:../../node_modules/@nativescript/core", - "@nativescript/canvas-media": "file:../../packages/canvas-media", - "@nativescript/canvas": "file:../../packages/canvas", - "@nativescript/canvas-babylon": "file:../../packages/canvas-babylon", - "@nativescript/canvas-phaser": "file:../../packages/canvas-phaser", - "@nativescript/canvas-phaser-ce": "file:../../packages/canvas-phaser-ce", - "@nativescript/canvas-pixi": "file:../../packages/canvas-pixi", - "@nativescript/canvas-polyfill": "file:../../packages/canvas-polyfill", - "@nativescript/canvas-three": "file:../../packages/canvas-three" - }, - "devDependencies": { - "@nativescript/android": "~8.5.0", - "@nativescript/ios": "8.5.1-dev.0" - } + "main": "./app/app.ts", + "dependencies": { + "nativescript-vue": "file:../../node_modules/nativescript-vue", + "@nativescript/core": "file:../../node_modules/@nativescript/core", + "@nativescript/canvas-media": "file:../../packages/canvas-media", + "@nativescript/canvas": "file:../../packages/canvas", + "@nativescript/canvas-babylon": "file:../../packages/canvas-babylon", + "@nativescript/canvas-phaser": "file:../../packages/canvas-phaser", + "@nativescript/canvas-phaser-ce": "file:../../packages/canvas-phaser-ce", + "@nativescript/canvas-pixi": "file:../../packages/canvas-pixi", + "@nativescript/canvas-polyfill": "file:../../packages/canvas-polyfill", + "@nativescript/canvas-three": "file:../../packages/canvas-three", + "@nativescript/canvas-chartjs": "file:../../packages/canvas-chartjs" + }, + "devDependencies": { + "@nativescript/android": "~8.5.0", + "@nativescript/ios": "8.5.1-dev.0" + } } diff --git a/apps/demo/package.json b/apps/demo/package.json index 58f99aa70..1c42a7989 100644 --- a/apps/demo/package.json +++ b/apps/demo/package.json @@ -1,32 +1,33 @@ { - "main": "./src/app.ts", - "description": "NativeScript Application", - "license": "SEE LICENSE IN ", - "repository": "", - "dependencies": { - "@nativescript/canvas": "file:../../packages/canvas", - "@nativescript/canvas-babylon": "file:../../packages/canvas-babylon", - "@nativescript/canvas-media": "file:../../packages/canvas-media", - "@nativescript/canvas-phaser": "file:../../packages/canvas-phaser", - "@nativescript/canvas-phaser-ce": "file:../../packages/canvas-phaser-ce", - "@nativescript/canvas-pixi": "file:../../packages/canvas-pixi", - "@nativescript/canvas-polyfill": "file:../../packages/canvas-polyfill", - "@nativescript/canvas-three": "file:../../packages/canvas-three", - "@nativescript/core": "file:../../node_modules/@nativescript/core", - "babylonjs": "file:../../node_modules/babylonjs", - "babylonjs-materials": "file:../../node_modules/babylonjs-materials", - "chart.js": "file:../../node_modules/chart.js", - "d3": "file:../../node_modules/d3", - "matter-js": "file:../../node_modules/matter-js", - "phaser": "file:../../node_modules/phaser", - "phaser-ce": "file:../../node_modules/phaser-ce", - "pixi.js": "file:../../node_modules/pixi.js", - "three": "file:../../node_modules/three", - "vexflow": "file:../../node_modules/vexflow", - "zen-3d": "file:../../node_modules/zen-3d" - }, - "devDependencies": { - "@nativescript/android": "8.5.4", - "@nativescript/ios": "8.5.2" - } + "main": "./src/app.ts", + "description": "NativeScript Application", + "license": "SEE LICENSE IN ", + "repository": "", + "dependencies": { + "@nativescript/canvas": "file:../../packages/canvas", + "@nativescript/canvas-babylon": "file:../../packages/canvas-babylon", + "@nativescript/canvas-media": "file:../../packages/canvas-media", + "@nativescript/canvas-phaser": "file:../../packages/canvas-phaser", + "@nativescript/canvas-phaser-ce": "file:../../packages/canvas-phaser-ce", + "@nativescript/canvas-pixi": "file:../../packages/canvas-pixi", + "@nativescript/canvas-polyfill": "file:../../packages/canvas-polyfill", + "@nativescript/canvas-three": "file:../../packages/canvas-three", + "@nativescript/core": "file:../../node_modules/@nativescript/core", + "babylonjs": "file:../../node_modules/babylonjs", + "babylonjs-materials": "file:../../node_modules/babylonjs-materials", + "chart.js": "file:../../node_modules/chart.js", + "d3": "file:../../node_modules/d3", + "matter-js": "file:../../node_modules/matter-js", + "phaser": "file:../../node_modules/phaser", + "phaser-ce": "file:../../node_modules/phaser-ce", + "pixi.js": "file:../../node_modules/pixi.js", + "three": "file:../../node_modules/three", + "vexflow": "file:../../node_modules/vexflow", + "zen-3d": "file:../../node_modules/zen-3d", + "@nativescript/canvas-chartjs": "file:../../packages/canvas-chartjs" + }, + "devDependencies": { + "@nativescript/android": "8.6.2", + "@nativescript/ios": "8.6.1" + } } diff --git a/apps/demo/src/app.ts b/apps/demo/src/app.ts index 97e5b0a0c..661ffc3dd 100644 --- a/apps/demo/src/app.ts +++ b/apps/demo/src/app.ts @@ -49,7 +49,7 @@ Application.on('uncaughtError', (args) => { console.log('uncaughtError: platform error', args.android ?? args.ios); }); Application.on('launch', (args) => { - require('@nativescript/canvas-polyfill'); + //require('@nativescript/canvas-polyfill'); if (global.isAndroid) { jp.wasabeef.takt.Takt.stock(Utils.android.getApplicationContext()).seat(jp.wasabeef.takt.Seat.TOP_CENTER).color(-65536); } else { diff --git a/apps/demo/src/main-page.xml b/apps/demo/src/main-page.xml index f1187ceb5..fe995b678 100644 --- a/apps/demo/src/main-page.xml +++ b/apps/demo/src/main-page.xml @@ -13,6 +13,7 @@