@revolist/angular-charts 0.0.0-stage → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,3 +1,107 @@
1
- # Temporary Holding Version
1
+ # RevoGrid Angular Charts
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ One generic `RevoChart` component backed by the standalone chart engine.
4
+
5
+ ## Installation: public wrapper, private engine
6
+
7
+ The four wrapper packages are configured for public npm publishing. `@revolist/charts` remains a
8
+ private commercial package on GitHub Packages; you need licensed access to
9
+ install and use it. The wrapper imports the engine and does not bundle it.
10
+
11
+ ### Before the first release
12
+
13
+ The wrappers are not published yet; registry install commands below apply after
14
+ publication. In this monorepo, replace `your-app` with your consumer workspace
15
+ name and use the local package:
16
+
17
+ ```sh
18
+ pnpm --filter your-app add "@revolist/angular-charts@workspace:*" "@revolist/charts@workspace:*"
19
+ pnpm build
20
+ ```
21
+
22
+ Source: `packages/charts/packages/angular-charts`. The public import name is unchanged.
23
+
24
+ ### Registry installation after publication
25
+
26
+ Configure your project's `.npmrc` for the engine, keeping credentials in your
27
+ environment:
28
+
29
+ ```ini
30
+ @revolist:registry=https://npm.pkg.github.com/
31
+ //npm.pkg.github.com/:_authToken=${GITHUB_PACKAGES_TOKEN}
32
+ ```
33
+
34
+ Both registries use the `@revolist` scope. Install the public wrapper by its
35
+ explicit npm tarball URL so the scope mapping continues to send the engine to
36
+ GitHub Packages. A plain `pnpm add @revolist/angular-charts` with that mapping
37
+ would look for the wrapper on GitHub instead. Changing only the default
38
+ `--registry` does not override the scope mapping.
39
+
40
+ ```sh
41
+ pnpm add @revolist/charts@3.0.0
42
+ pnpm add https://registry.npmjs.org/@revolist/angular-charts/-/angular-charts-3.0.0.tgz
43
+ ```
44
+
45
+ Use matching released wrapper and engine versions; replace `3.0.0` in these
46
+ examples when upgrading. Commit your lockfile so CI retains both registries'
47
+ resolved tarball URLs, and provide `GITHUB_PACKAGES_TOKEN` during CI installs.
48
+ Missing or unauthorized engine access causes installation to fail. No separate
49
+ wrapper trial package is published.
50
+
51
+ ```ts
52
+ import { Component } from '@angular/core';
53
+ import { RevoChart, type ChartComponentOptions, type ChartRef } from '@revolist/angular-charts';
54
+ @Component({
55
+ selector: 'sales-chart',
56
+ standalone: true,
57
+ imports: [RevoChart],
58
+ template: '<revo-chart [options]="options" (ready)="onReady($event)" style="height:400px" />',
59
+ })
60
+ export class SalesChart {
61
+ options: ChartComponentOptions = {
62
+ chartType: 'line',
63
+ data: [{ month: 'Jan', revenue: 120 }, { month: 'Feb', revenue: 180 }],
64
+ mapping: { category: { field: 'month' }, series: [{ field: 'revenue' }] },
65
+ };
66
+ onReady(chart: ChartRef) { console.log(chart.model); }
67
+ }
68
+ ```
69
+
70
+ ## Updates and lifecycle
71
+
72
+ `options` has type `Omit<ChartOptions, 'container'>`. It accepts the same rows and
73
+ mapping, dataset, saved model, renderer, data source and chart settings as
74
+ `@revolist/charts`. Existing callbacks such as `onNodeClick`, `onChange` and
75
+ `onError` belong inside `options`. Callback replacements take effect without
76
+ recreating a chart.
77
+
78
+ Replace `options` and changed nested values to update the chart; do not mutate
79
+ nested objects in place. In Vue, replace the ref value; in Svelte, prefer
80
+ `$state.raw` for chart configuration. Ordinary data/settings changes update the
81
+ current chart. Source replacements use `setDataSource`. Initialization settings,
82
+ input-mode changes and removed settings recreate it to restore engine defaults.
83
+
84
+ The host defaults to width `100%` and height `300px`. Override its dimensions with
85
+ framework styles. The engine observes resizing. No stylesheet, element
86
+ registration or manual mount call is needed.
87
+
88
+ The readiness callback/event receives `ChartRef` for `download`, `getCSV`,
89
+ `getImageDataURL`, selection and transactions. It fires again after recreation;
90
+ replace any stored ref on each readiness event. The component owns destruction,
91
+ so do not destroy its ref yourself.
92
+
93
+ Creation and updates are asynchronous. Pending work is cancelled on unmount or
94
+ superseding configuration, and stale results are destroyed. Failures call
95
+ `options.onError`, or `console.error` when no error handler is supplied. Server
96
+ rendering produces an empty host; chart creation starts after client mounting.
97
+
98
+ ## Building and distribution
99
+
100
+ The package compiles with the monorepo's root `pnpm build`. Framework runtimes and
101
+ `@revolist/charts` stay external. Install the framework peers listed in
102
+ `package.json`; the engine version follows the wrapper version.
103
+
104
+ The normal charts release publishes this wrapper to public npmjs using the
105
+ repository's `NPM_TOKEN` secret. The private engine is published separately to
106
+ GitHub Packages using GitHub credentials. No wrapper `build:trial` or trial
107
+ publication is needed.
package/dist/README.md ADDED
@@ -0,0 +1,107 @@
1
+ # RevoGrid Angular Charts
2
+
3
+ One generic `RevoChart` component backed by the standalone chart engine.
4
+
5
+ ## Installation: public wrapper, private engine
6
+
7
+ The four wrapper packages are configured for public npm publishing. `@revolist/charts` remains a
8
+ private commercial package on GitHub Packages; you need licensed access to
9
+ install and use it. The wrapper imports the engine and does not bundle it.
10
+
11
+ ### Before the first release
12
+
13
+ The wrappers are not published yet; registry install commands below apply after
14
+ publication. In this monorepo, replace `your-app` with your consumer workspace
15
+ name and use the local package:
16
+
17
+ ```sh
18
+ pnpm --filter your-app add "@revolist/angular-charts@workspace:*" "@revolist/charts@workspace:*"
19
+ pnpm build
20
+ ```
21
+
22
+ Source: `packages/charts/packages/angular-charts`. The public import name is unchanged.
23
+
24
+ ### Registry installation after publication
25
+
26
+ Configure your project's `.npmrc` for the engine, keeping credentials in your
27
+ environment:
28
+
29
+ ```ini
30
+ @revolist:registry=https://npm.pkg.github.com/
31
+ //npm.pkg.github.com/:_authToken=${GITHUB_PACKAGES_TOKEN}
32
+ ```
33
+
34
+ Both registries use the `@revolist` scope. Install the public wrapper by its
35
+ explicit npm tarball URL so the scope mapping continues to send the engine to
36
+ GitHub Packages. A plain `pnpm add @revolist/angular-charts` with that mapping
37
+ would look for the wrapper on GitHub instead. Changing only the default
38
+ `--registry` does not override the scope mapping.
39
+
40
+ ```sh
41
+ pnpm add @revolist/charts@3.0.0
42
+ pnpm add https://registry.npmjs.org/@revolist/angular-charts/-/angular-charts-3.0.0.tgz
43
+ ```
44
+
45
+ Use matching released wrapper and engine versions; replace `3.0.0` in these
46
+ examples when upgrading. Commit your lockfile so CI retains both registries'
47
+ resolved tarball URLs, and provide `GITHUB_PACKAGES_TOKEN` during CI installs.
48
+ Missing or unauthorized engine access causes installation to fail. No separate
49
+ wrapper trial package is published.
50
+
51
+ ```ts
52
+ import { Component } from '@angular/core';
53
+ import { RevoChart, type ChartComponentOptions, type ChartRef } from '@revolist/angular-charts';
54
+ @Component({
55
+ selector: 'sales-chart',
56
+ standalone: true,
57
+ imports: [RevoChart],
58
+ template: '<revo-chart [options]="options" (ready)="onReady($event)" style="height:400px" />',
59
+ })
60
+ export class SalesChart {
61
+ options: ChartComponentOptions = {
62
+ chartType: 'line',
63
+ data: [{ month: 'Jan', revenue: 120 }, { month: 'Feb', revenue: 180 }],
64
+ mapping: { category: { field: 'month' }, series: [{ field: 'revenue' }] },
65
+ };
66
+ onReady(chart: ChartRef) { console.log(chart.model); }
67
+ }
68
+ ```
69
+
70
+ ## Updates and lifecycle
71
+
72
+ `options` has type `Omit<ChartOptions, 'container'>`. It accepts the same rows and
73
+ mapping, dataset, saved model, renderer, data source and chart settings as
74
+ `@revolist/charts`. Existing callbacks such as `onNodeClick`, `onChange` and
75
+ `onError` belong inside `options`. Callback replacements take effect without
76
+ recreating a chart.
77
+
78
+ Replace `options` and changed nested values to update the chart; do not mutate
79
+ nested objects in place. In Vue, replace the ref value; in Svelte, prefer
80
+ `$state.raw` for chart configuration. Ordinary data/settings changes update the
81
+ current chart. Source replacements use `setDataSource`. Initialization settings,
82
+ input-mode changes and removed settings recreate it to restore engine defaults.
83
+
84
+ The host defaults to width `100%` and height `300px`. Override its dimensions with
85
+ framework styles. The engine observes resizing. No stylesheet, element
86
+ registration or manual mount call is needed.
87
+
88
+ The readiness callback/event receives `ChartRef` for `download`, `getCSV`,
89
+ `getImageDataURL`, selection and transactions. It fires again after recreation;
90
+ replace any stored ref on each readiness event. The component owns destruction,
91
+ so do not destroy its ref yourself.
92
+
93
+ Creation and updates are asynchronous. Pending work is cancelled on unmount or
94
+ superseding configuration, and stale results are destroyed. Failures call
95
+ `options.onError`, or `console.error` when no error handler is supplied. Server
96
+ rendering produces an empty host; chart creation starts after client mounting.
97
+
98
+ ## Building and distribution
99
+
100
+ The package compiles with the monorepo's root `pnpm build`. Framework runtimes and
101
+ `@revolist/charts` stay external. Install the framework peers listed in
102
+ `package.json`; the engine version follows the wrapper version.
103
+
104
+ The normal charts release publishes this wrapper to public npmjs using the
105
+ repository's `NPM_TOKEN` secret. The private engine is published separately to
106
+ GitHub Packages using GitHub credentials. No wrapper `build:trial` or trial
107
+ publication is needed.
@@ -0,0 +1,69 @@
1
+ import { isPlatformBrowser } from "@angular/common";
2
+ import * as i0 from "@angular/core";
3
+ import { Component, ElementRef, EventEmitter, Input, Output, PLATFORM_ID, inject } from "@angular/core";
4
+ import { createChartComponentController } from "@revolist/charts/framework";
5
+ var RevoChart = class RevoChart {
6
+ options;
7
+ ready = new EventEmitter();
8
+ host = inject(ElementRef);
9
+ platform = inject(PLATFORM_ID);
10
+ controller;
11
+ ngAfterViewInit() {
12
+ if (!isPlatformBrowser(this.platform)) return;
13
+ this.controller = createChartComponentController(this.host.nativeElement, (chart) => this.ready.emit(chart));
14
+ this.controller.setOptions(this.options);
15
+ }
16
+ ngOnChanges() {
17
+ this.controller?.setOptions(this.options);
18
+ }
19
+ ngOnDestroy() {
20
+ this.controller?.destroy();
21
+ }
22
+ static ɵfac = i0.ɵɵngDeclareFactory({
23
+ minVersion: "12.0.0",
24
+ version: "22.1.0",
25
+ ngImport: i0,
26
+ type: RevoChart,
27
+ deps: [],
28
+ target: i0.ɵɵFactoryTarget.Component
29
+ });
30
+ static ɵcmp = i0.ɵɵngDeclareComponent({
31
+ minVersion: "14.0.0",
32
+ version: "22.1.0",
33
+ type: RevoChart,
34
+ isStandalone: true,
35
+ selector: "revo-chart",
36
+ inputs: { options: "options" },
37
+ outputs: { ready: "ready" },
38
+ host: { styleAttribute: "display:block;width:100%;height:300px" },
39
+ usesOnChanges: true,
40
+ ngImport: i0,
41
+ template: "",
42
+ isInline: true
43
+ });
44
+ };
45
+ i0.ɵɵngDeclareClassMetadata({
46
+ minVersion: "12.0.0",
47
+ version: "22.1.0",
48
+ ngImport: i0,
49
+ type: RevoChart,
50
+ decorators: [{
51
+ type: Component,
52
+ args: [{
53
+ selector: "revo-chart",
54
+ standalone: true,
55
+ template: "",
56
+ host: { style: "display:block;width:100%;height:300px" }
57
+ }]
58
+ }],
59
+ propDecorators: {
60
+ options: [{
61
+ type: Input,
62
+ args: [{ required: true }]
63
+ }],
64
+ ready: [{ type: Output }]
65
+ }
66
+ });
67
+ export { RevoChart };
68
+
69
+ //# sourceMappingURL=revolist-angular-charts.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"revolist-angular-charts.mjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport { Component, ElementRef, EventEmitter, Input, Output, PLATFORM_ID, inject } from '@angular/core';\nimport type { AfterViewInit, OnChanges, OnDestroy } from '@angular/core';\nimport { createChartComponentController } from '@revolist/charts/framework';\nimport type { ChartComponentController, ChartComponentOptions } from '@revolist/charts/framework';\nimport type { ChartRef } from '@revolist/charts';\n\nexport type { ChartComponentOptions, ChartRef };\n@Component({\n selector: 'revo-chart',\n standalone: true,\n template: '',\n host: { style: 'display:block;width:100%;height:300px' },\n})\nexport class RevoChart implements AfterViewInit, OnChanges, OnDestroy {\n @Input({ required: true }) options!: ChartComponentOptions;\n @Output() readonly ready = new EventEmitter<ChartRef>();\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly platform = inject(PLATFORM_ID);\n private controller?: ChartComponentController;\n\n ngAfterViewInit() {\n if (!isPlatformBrowser(this.platform)) return;\n this.controller = createChartComponentController(this.host.nativeElement, chart => this.ready.emit(chart));\n void this.controller.setOptions(this.options);\n }\n ngOnChanges() { void this.controller?.setOptions(this.options); }\n ngOnDestroy() { this.controller?.destroy(); }\n}\n"],"mappings":";;;;AAcA,IAAa,YAAb,MAAa,UAAS;CACO;CACR,QAAQ,IAAI,aAAY;CAC1B,OAAO,OAAgC,UAAU;CACjD,WAAW,OAAO,WAAW;CACtC;CAER,kBAAe;EACb,IAAI,CAAC,kBAAkB,KAAK,QAAQ,GAAG;EACvC,KAAK,aAAa,+BAA+B,KAAK,KAAK,gBAAe,UAAS,KAAK,MAAM,KAAK,KAAK,CAAC;EACzG,AAAK,KAAK,WAAW,WAAW,KAAK,OAAO;CAC9C;CACA,cAAW;EAAK,AAAK,KAAK,YAAY,WAAW,KAAK,OAAO;CAAG;CAChE,cAAW;EAAK,KAAK,YAAY,QAAO;CAAI;CAbjC,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAS,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAT,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAS,cAAA;EAAA,UAAA;EAAA,QAAA,EAAA,SAAA,UAAA;EAAA,SAAA,EAAA,OAAA,QAAA;EAAA,MAAA,EAAA,gBAAA,wCAAA;EAAA,eAAA;EAAA,UAAA;EAAA,UAHV;EAAE,UAAA;CAAA,CAAA;;AAGD,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAS,YAAA,CAAA;EANrB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,YAAY;GACZ,UAAU;GACV,MAAM,EAAE,OAAO,wCAAuC;EACvD,CAAA;;;;GAEE,MAAA;GAAM,MAAA,CAAA,EAAE,UAAU,KAAI,CAAE;;EACxB,OAAA,CAAA,EAAA,MAAA,OAAA,CAAA"}
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@revolist/angular-charts",
3
+ "version": "3.0.3",
4
+ "description": "Angular components for RevoGrid Charts",
5
+ "type": "module",
6
+ "license": "Commercial",
7
+ "sideEffects": false,
8
+ "module": "fesm2022/revolist-angular-charts.mjs",
9
+ "types": "types/revolist-angular-charts.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./types/revolist-angular-charts.d.ts",
13
+ "default": "./fesm2022/revolist-angular-charts.mjs"
14
+ },
15
+ "./package.json": {
16
+ "default": "./package.json"
17
+ }
18
+ },
19
+ "dependencies": {
20
+ "@revolist/charts": "workspace:*",
21
+ "tslib": "^2.8.1"
22
+ },
23
+ "peerDependencies": {
24
+ "@angular/core": "^22.1.0",
25
+ "@angular/common": "^22.1.0",
26
+ "rxjs": "^7.8.0"
27
+ },
28
+ "publishConfig": {
29
+ "registry": "https://registry.npmjs.org/",
30
+ "access": "public"
31
+ },
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "https://github.com/revolist/revogrid-pro.git",
35
+ "directory": "packages/charts/packages/angular-charts"
36
+ },
37
+ "typings": "types/revolist-angular-charts.d.ts"
38
+ }
@@ -0,0 +1,24 @@
1
+ import * as i0 from "@angular/core";
2
+ import { AfterViewInit, EventEmitter, OnChanges, OnDestroy } from "@angular/core";
3
+ import { ChartComponentOptions } from "@revolist/charts/framework";
4
+ import { ChartRef } from "@revolist/charts";
5
+ export declare class RevoChart implements AfterViewInit, OnChanges, OnDestroy {
6
+ options: ChartComponentOptions;
7
+ readonly ready: EventEmitter<ChartRef>;
8
+ private readonly host;
9
+ private readonly platform;
10
+ private controller?;
11
+ ngAfterViewInit(): void;
12
+ ngOnChanges(): void;
13
+ ngOnDestroy(): void;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<RevoChart, never>;
15
+ static ɵcmp: i0.ɵɵComponentDeclaration<RevoChart, "revo-chart", never, {
16
+ "options": {
17
+ "alias": "options";
18
+ "required": true;
19
+ };
20
+ }, {
21
+ "ready": "ready";
22
+ }, never, never, true, never>;
23
+ }
24
+ export type { ChartComponentOptions, ChartRef };
package/package.json CHANGED
@@ -1,6 +1,52 @@
1
1
  {
2
2
  "name": "@revolist/angular-charts",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "3.0.3",
4
+ "description": "Angular components for RevoGrid Charts",
5
+ "type": "module",
6
+ "license": "Commercial",
7
+ "files": [
8
+ "dist",
9
+ "README.md"
10
+ ],
11
+ "sideEffects": false,
12
+ "module": "./dist/fesm2022/revolist-angular-charts.mjs",
13
+ "types": "./dist/types/revolist-angular-charts.d.ts",
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/types/revolist-angular-charts.d.ts",
17
+ "default": "./dist/fesm2022/revolist-angular-charts.mjs"
18
+ }
19
+ },
20
+ "dependencies": {
21
+ "tslib": "^2.8.1",
22
+ "@revolist/charts": "3.0.3"
23
+ },
24
+ "peerDependencies": {
25
+ "@angular/core": "^22.1.0",
26
+ "@angular/common": "^22.1.0",
27
+ "rxjs": "^7.8.0"
28
+ },
29
+ "devDependencies": {
30
+ "@angular/core": "^22.1.0",
31
+ "@angular/common": "22.1.0",
32
+ "rxjs": "^7.8.0",
33
+ "typescript": "~6.0.3",
34
+ "@angular/compiler": "^22.1.0",
35
+ "@angular/compiler-cli": "^22.1.0",
36
+ "ng-packagr": "^22.0.0"
37
+ },
38
+ "publishConfig": {
39
+ "registry": "https://registry.npmjs.org/",
40
+ "access": "public"
41
+ },
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "https://github.com/revolist/revogrid-pro.git",
45
+ "directory": "packages/charts/packages/angular-charts"
46
+ },
47
+ "scripts": {
48
+ "build": "ng-packagr -p ng-package.json && node ../../../../scripts/build/finalize-angular-charts.mjs",
49
+ "lint": "ngc -p tsconfig.json --noEmit",
50
+ "test": "node --test --test-name-pattern=\"^angular charts\" ../../../../.github/workflows/chart-frameworks.test.mjs"
51
+ }
6
52
  }