@revivejs/angular-infinity-charts 2.0.0 → 21.0.0
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/dist/LICENSE +21 -0
- package/dist/README.md +254 -0
- package/dist/fesm2022/revivejs-angular-infinity-charts.mjs +520 -0
- package/dist/fesm2022/revivejs-angular-infinity-charts.mjs.map +1 -0
- package/dist/types/revivejs-angular-infinity-charts.d.ts +300 -0
- package/docs/.nojekyll +0 -0
- package/docs/angular-2/app/app.component.css +325 -0
- package/docs/angular-2/app/app.component.html +185 -0
- package/docs/angular-2/app/app.component.ts +243 -0
- package/docs/angular-2/app/app.module.ts +18 -0
- package/docs/angular-2/app/data/api.ts +14 -0
- package/docs/angular-2/app/data/release-line.ts +7 -0
- package/docs/angular-2/app/playground.component.css +250 -0
- package/docs/angular-2/app/playground.component.html +112 -0
- package/docs/angular-2/app/playground.component.ts +428 -0
- package/docs/angular-2/index.html +31 -0
- package/docs/angular-2/main.ts +8 -0
- package/docs/angular-2/styles.css +47 -0
- package/docs/angular-2/systemjs.config.js +55 -0
- package/docs/angular-21/180.8cbb300931475cea.js +1 -0
- package/docs/angular-21/323.8cbb300931475cea.js +1 -0
- package/docs/angular-21/37.8cbb300931475cea.js +1 -0
- package/docs/angular-21/3rdpartylicenses.txt +402 -0
- package/docs/angular-21/418.8cbb300931475cea.js +1 -0
- package/docs/angular-21/541.120110ba2fead634.js +1 -0
- package/docs/angular-21/561.8cbb300931475cea.js +1 -0
- package/docs/angular-21/639.5c36f0da162f2724.js +1 -0
- package/docs/angular-21/704.8cbb300931475cea.js +1 -0
- package/docs/angular-21/799.8cbb300931475cea.js +1 -0
- package/docs/angular-21/84.5baca81d04c90457.js +1 -0
- package/docs/angular-21/942.8cbb300931475cea.js +1 -0
- package/docs/angular-21/common.4fd5fdcf7b48f062.js +1 -0
- package/docs/angular-21/index.html +19 -0
- package/docs/angular-21/main.4daffff4ca1c294e.js +1 -0
- package/docs/angular-21/polyfills.37944fe611f86dfa.js +1 -0
- package/docs/angular-21/runtime.4d8a748cbea51380.js +1 -0
- package/docs/angular-21/styles.d345eaa39dd99983.css +1 -0
- package/docs/index.html +289 -0
- package/package.json +90 -17
- /package/{index.d.ts → docs/angular-2/vendor/angular-infinity-charts/index.d.ts} +0 -0
- /package/{index.js → docs/angular-2/vendor/angular-infinity-charts/index.js} +0 -0
- /package/{index.js.map → docs/angular-2/vendor/angular-infinity-charts/index.js.map} +0 -0
- /package/{src → docs/angular-2/vendor/angular-infinity-charts/src}/InfinityChartComponent.d.ts +0 -0
- /package/{src → docs/angular-2/vendor/angular-infinity-charts/src}/InfinityChartComponent.js +0 -0
- /package/{src → docs/angular-2/vendor/angular-infinity-charts/src}/InfinityChartComponent.js.map +0 -0
- /package/{src → docs/angular-2/vendor/angular-infinity-charts/src}/InfinityChartController.d.ts +0 -0
- /package/{src → docs/angular-2/vendor/angular-infinity-charts/src}/InfinityChartController.js +0 -0
- /package/{src → docs/angular-2/vendor/angular-infinity-charts/src}/InfinityChartController.js.map +0 -0
- /package/{src → docs/angular-2/vendor/angular-infinity-charts/src}/InfinityChartDirective.d.ts +0 -0
- /package/{src → docs/angular-2/vendor/angular-infinity-charts/src}/InfinityChartDirective.js +0 -0
- /package/{src → docs/angular-2/vendor/angular-infinity-charts/src}/InfinityChartDirective.js.map +0 -0
- /package/{src → docs/angular-2/vendor/angular-infinity-charts/src}/InfinityChartService.d.ts +0 -0
- /package/{src → docs/angular-2/vendor/angular-infinity-charts/src}/InfinityChartService.js +0 -0
- /package/{src → docs/angular-2/vendor/angular-infinity-charts/src}/InfinityChartService.js.map +0 -0
- /package/{src → docs/angular-2/vendor/angular-infinity-charts/src}/public_api.d.ts +0 -0
- /package/{src → docs/angular-2/vendor/angular-infinity-charts/src}/public_api.js +0 -0
- /package/{src → docs/angular-2/vendor/angular-infinity-charts/src}/public_api.js.map +0 -0
- /package/{src → docs/angular-2/vendor/angular-infinity-charts/src}/types.d.ts +0 -0
- /package/{src → docs/angular-2/vendor/angular-infinity-charts/src}/types.js +0 -0
- /package/{src → docs/angular-2/vendor/angular-infinity-charts/src}/types.js.map +0 -0
- /package/{vendor → docs/angular-2/vendor}/infinity-charts/index.js +0 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
<div class="shell">
|
|
2
|
+
<section class="hero">
|
|
3
|
+
<div class="hero-card hero-main">
|
|
4
|
+
<span class="badge">Angular {{ releaseLine.angular }} · @revivejs/infinity-charts {{ releaseLine.coreVersion }}</span>
|
|
5
|
+
<h1>@revivejs/angular-infinity-charts</h1>
|
|
6
|
+
<p>
|
|
7
|
+
A maintained Angular wrapper around the ReviveJS chart engine. Use a component for direct templates,
|
|
8
|
+
a directive for dashboard slots and widget shells, and a service for imperative chart creation.
|
|
9
|
+
</p>
|
|
10
|
+
<div class="feature-grid">
|
|
11
|
+
<div class="feature">
|
|
12
|
+
<strong>Component API</strong>
|
|
13
|
+
Render a chart declaratively with a clean Angular input/output shape.
|
|
14
|
+
</div>
|
|
15
|
+
<div class="feature">
|
|
16
|
+
<strong>Directive API</strong>
|
|
17
|
+
Turn existing dashboard panels and widget slots into real chart hosts.
|
|
18
|
+
</div>
|
|
19
|
+
<div class="feature">
|
|
20
|
+
<strong>Service API</strong>
|
|
21
|
+
Mount charts programmatically in modals, detached slots, or service-driven flows.
|
|
22
|
+
</div>
|
|
23
|
+
<div class="feature">
|
|
24
|
+
<strong>Core fidelity</strong>
|
|
25
|
+
Keep the Infinity Charts engine, chart catalog, theme system, and live update methods intact.
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="cta-row">
|
|
29
|
+
<a class="btn" href="#demos">See demos</a>
|
|
30
|
+
<a class="btn secondary" href="https://github.com/alexandroit/angular-infinity-charts#readme" target="_blank">README</a>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div class="hero-card hero-setup">
|
|
35
|
+
<h2>Setup in 3 steps</h2>
|
|
36
|
+
|
|
37
|
+
<div class="step">
|
|
38
|
+
<span class="step-num">1</span>
|
|
39
|
+
<div>
|
|
40
|
+
<strong>Install</strong>
|
|
41
|
+
<pre [textContent]="installSnippet"></pre>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<div class="step">
|
|
46
|
+
<span class="step-num">2</span>
|
|
47
|
+
<div>
|
|
48
|
+
<strong>Register the module</strong>
|
|
49
|
+
<pre [textContent]="moduleSnippet"></pre>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<div class="step">
|
|
54
|
+
<span class="step-num">3</span>
|
|
55
|
+
<div>
|
|
56
|
+
<strong>Use the wrapper</strong>
|
|
57
|
+
<pre [textContent]="directiveSnippet"></pre>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</section>
|
|
62
|
+
|
|
63
|
+
<section class="layout" id="demos">
|
|
64
|
+
<div class="panels">
|
|
65
|
+
<article class="panel">
|
|
66
|
+
<div class="panel-header">
|
|
67
|
+
<h2>Core wrapper demos</h2>
|
|
68
|
+
<p>The first Angular line already covers the main chart integration patterns teams need in dashboards and product analytics.</p>
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
<div class="demo-grid">
|
|
72
|
+
<section class="demo-card">
|
|
73
|
+
<h3>Standalone component</h3>
|
|
74
|
+
<p>Use the component when the chart itself is the primary content block in your Angular template.</p>
|
|
75
|
+
<pre class="code" [textContent]="componentSnippet"></pre>
|
|
76
|
+
<revive-infinity-chart
|
|
77
|
+
class="chart-frame"
|
|
78
|
+
[style.display]="'block'"
|
|
79
|
+
[style.height.px]="320"
|
|
80
|
+
[config]="lineChartConfig"
|
|
81
|
+
(create)="onCreate('Standalone component')"
|
|
82
|
+
(ready)="onReady('Standalone component')"
|
|
83
|
+
(updated)="onUpdated('Standalone component')"
|
|
84
|
+
(destroyed)="onDestroyed('Standalone component')"></revive-infinity-chart>
|
|
85
|
+
</section>
|
|
86
|
+
|
|
87
|
+
<section class="demo-card">
|
|
88
|
+
<h3>Directive on an analytics card</h3>
|
|
89
|
+
<p>The directive is a strong fit when an existing dashboard shell already owns spacing, chrome, and surrounding context.</p>
|
|
90
|
+
<pre class="code" [textContent]="directiveSnippet"></pre>
|
|
91
|
+
<div class="controls">
|
|
92
|
+
<button (click)="toggleCardTheme()">Toggle card theme</button>
|
|
93
|
+
</div>
|
|
94
|
+
<div class="analytics-card" [class.is-dark]="cardTheme === 'dark'">
|
|
95
|
+
<div class="analytics-head">
|
|
96
|
+
<span>Q2 sales motion</span>
|
|
97
|
+
<strong>{{ cardTheme === 'dark' ? 'Dark panel' : 'Light panel' }}</strong>
|
|
98
|
+
</div>
|
|
99
|
+
<div class="chart-slot"
|
|
100
|
+
[style.height.px]="300"
|
|
101
|
+
[reviveInfinityChart]="cardChartConfig"
|
|
102
|
+
(create)="onCreate('Directive card')"
|
|
103
|
+
(ready)="onReady('Directive card')"
|
|
104
|
+
(updated)="onUpdated('Directive card')"
|
|
105
|
+
(destroyed)="onDestroyed('Directive card')"></div>
|
|
106
|
+
</div>
|
|
107
|
+
</section>
|
|
108
|
+
|
|
109
|
+
<section class="demo-card">
|
|
110
|
+
<h3>Service-driven mount</h3>
|
|
111
|
+
<p>Programmatic chart creation is useful for modal bodies, detached panels, and controller-style workflows.</p>
|
|
112
|
+
<div class="controls">
|
|
113
|
+
<button (click)="mountServiceChart()">
|
|
114
|
+
{{ serviceChartMounted ? 'Destroy service chart' : 'Mount service chart' }}
|
|
115
|
+
</button>
|
|
116
|
+
</div>
|
|
117
|
+
<pre class="code" [textContent]="serviceSnippet"></pre>
|
|
118
|
+
<div class="service-shell">
|
|
119
|
+
<div class="service-slot" id="service-chart-slot"></div>
|
|
120
|
+
</div>
|
|
121
|
+
</section>
|
|
122
|
+
|
|
123
|
+
<section class="demo-card">
|
|
124
|
+
<h3>Live update methods</h3>
|
|
125
|
+
<p>The wrapper keeps the underlying chart instance methods available, so appending data and resizing remain straightforward.</p>
|
|
126
|
+
<div class="controls">
|
|
127
|
+
<button (click)="appendRealtimePoint()">Append point</button>
|
|
128
|
+
<button class="ghost-button" (click)="toggleRealtimeTheme()">Toggle theme</button>
|
|
129
|
+
</div>
|
|
130
|
+
<revive-infinity-chart
|
|
131
|
+
#realtimeChart
|
|
132
|
+
class="chart-frame"
|
|
133
|
+
[style.display]="'block'"
|
|
134
|
+
[style.height.px]="300"
|
|
135
|
+
[config]="realtimeChartConfig"
|
|
136
|
+
(create)="onCreate('Realtime chart')"
|
|
137
|
+
(ready)="onReady('Realtime chart')"
|
|
138
|
+
(updated)="onUpdated('Realtime chart')"
|
|
139
|
+
(destroyed)="onDestroyed('Realtime chart')"></revive-infinity-chart>
|
|
140
|
+
</section>
|
|
141
|
+
</div>
|
|
142
|
+
</article>
|
|
143
|
+
|
|
144
|
+
<article class="panel">
|
|
145
|
+
<div class="panel-header">
|
|
146
|
+
<h2>API reference</h2>
|
|
147
|
+
<p>The wrapper stays intentionally thin so Angular owns structure while the Infinity Charts core owns rendering, theming, and live updates.</p>
|
|
148
|
+
</div>
|
|
149
|
+
<div class="api-grid">
|
|
150
|
+
<section class="api-card" *ngFor="let item of apiCards">
|
|
151
|
+
<h3>{{ item.title }}</h3>
|
|
152
|
+
<p>{{ item.summary }}</p>
|
|
153
|
+
</section>
|
|
154
|
+
</div>
|
|
155
|
+
</article>
|
|
156
|
+
|
|
157
|
+
<playground-panel></playground-panel>
|
|
158
|
+
</div>
|
|
159
|
+
|
|
160
|
+
<aside class="sidebar">
|
|
161
|
+
<section class="sidebar-card">
|
|
162
|
+
<div class="panel-header">
|
|
163
|
+
<h2>Event log</h2>
|
|
164
|
+
<button class="ghost-button" (click)="clearLog()">Clear</button>
|
|
165
|
+
</div>
|
|
166
|
+
<div class="log-list">
|
|
167
|
+
<div class="log-item" *ngFor="let log of logs">{{ log }}</div>
|
|
168
|
+
</div>
|
|
169
|
+
</section>
|
|
170
|
+
|
|
171
|
+
<section class="sidebar-card">
|
|
172
|
+
<div class="panel-header">
|
|
173
|
+
<h2>Release line</h2>
|
|
174
|
+
</div>
|
|
175
|
+
<ul class="release-meta">
|
|
176
|
+
<li><strong>Angular:</strong> {{ releaseLine.angular }}</li>
|
|
177
|
+
<li><strong>Package:</strong> {{ releaseLine.packageVersion }}</li>
|
|
178
|
+
<li><strong>Core:</strong> {{ releaseLine.coreVersion }}</li>
|
|
179
|
+
<li><strong>Runtime:</strong> {{ releaseLine.runtimeTarget }}</li>
|
|
180
|
+
<li><strong>Docs path:</strong> {{ releaseLine.docsPath }}</li>
|
|
181
|
+
</ul>
|
|
182
|
+
</section>
|
|
183
|
+
</aside>
|
|
184
|
+
</section>
|
|
185
|
+
</div>
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { Component, OnDestroy, ViewChild } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
InfinityChartComponent,
|
|
5
|
+
InfinityChartService
|
|
6
|
+
} from '@revivejs/angular-infinity-charts';
|
|
7
|
+
import { API_CARDS } from './data/api';
|
|
8
|
+
import { RELEASE_LINE } from './data/release-line';
|
|
9
|
+
|
|
10
|
+
declare var module: { id: string };
|
|
11
|
+
|
|
12
|
+
@Component({
|
|
13
|
+
moduleId: module.id,
|
|
14
|
+
selector: 'app-root',
|
|
15
|
+
templateUrl: './app.component.html',
|
|
16
|
+
styleUrls: ['./app.component.css']
|
|
17
|
+
})
|
|
18
|
+
export class AppComponent implements OnDestroy {
|
|
19
|
+
@ViewChild('realtimeChart')
|
|
20
|
+
realtimeChart: InfinityChartComponent;
|
|
21
|
+
|
|
22
|
+
apiCards = API_CARDS;
|
|
23
|
+
releaseLine = RELEASE_LINE;
|
|
24
|
+
logs: string[] = [];
|
|
25
|
+
|
|
26
|
+
installSnippet: string = "npm install @revivejs/angular-infinity-charts";
|
|
27
|
+
moduleSnippet: string = "import { InfinityChartsModule } from '@revivejs/angular-infinity-charts';\n\n@NgModule({\n imports: [InfinityChartsModule.forRoot()]\n})";
|
|
28
|
+
componentSnippet: string = "<revive-infinity-chart\n [config]=\"lineChartConfig\"\n style=\"display:block;height:320px;\">\n</revive-infinity-chart>";
|
|
29
|
+
directiveSnippet: string = "<div class=\"chart-slot\"\n [reviveInfinityChart]=\"barCardConfig\"\n style=\"height:320px;\">\n</div>";
|
|
30
|
+
serviceSnippet: string = "const chart = this.chartService.create(target, {\n type: 'donut',\n title: 'Revenue mix',\n data: [\n { label: 'New', value: 42 },\n { label: 'Expansion', value: 28 },\n { label: 'Renewal', value: 19 }\n ],\n theme: 'light'\n});\n\nchart.ready().then(() => console.log('Chart ready'));";
|
|
31
|
+
|
|
32
|
+
lineChartConfig: Object = this.createLineChartConfig();
|
|
33
|
+
cardChartConfig: Object = this.createBarCardConfig('light');
|
|
34
|
+
realtimeChartConfig: Object = this.createRealtimeConfig('light');
|
|
35
|
+
|
|
36
|
+
cardTheme: string = 'light';
|
|
37
|
+
serviceChartMounted: boolean = false;
|
|
38
|
+
serviceChart: any = null;
|
|
39
|
+
realtimePointIndex: number = 7;
|
|
40
|
+
realtimeTheme: string = 'light';
|
|
41
|
+
|
|
42
|
+
constructor(private chartService: InfinityChartService) {
|
|
43
|
+
this.log('Angular 2 docs loaded successfully.');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
ngOnDestroy(): void {
|
|
47
|
+
if (this.serviceChart) {
|
|
48
|
+
this.serviceChart.destroy();
|
|
49
|
+
this.serviceChart = null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
onCreate(label: string): void {
|
|
54
|
+
this.log(label + ' created.');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
onReady(label: string): void {
|
|
58
|
+
this.log(label + ' ready.');
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
onUpdated(label: string): void {
|
|
62
|
+
this.log(label + ' updated.');
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
onDestroyed(label: string): void {
|
|
66
|
+
this.log(label + ' destroyed.');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
toggleCardTheme(): void {
|
|
70
|
+
this.cardTheme = this.cardTheme === 'light' ? 'dark' : 'light';
|
|
71
|
+
this.cardChartConfig = this.createBarCardConfig(this.cardTheme);
|
|
72
|
+
this.log('Directive card switched to ' + this.cardTheme + ' theme.');
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
mountServiceChart(): void {
|
|
76
|
+
var slot = document.getElementById('service-chart-slot');
|
|
77
|
+
|
|
78
|
+
if (!slot) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (this.serviceChart) {
|
|
83
|
+
this.serviceChart.destroy();
|
|
84
|
+
this.serviceChart = null;
|
|
85
|
+
this.serviceChartMounted = false;
|
|
86
|
+
this.log('Service chart destroyed.');
|
|
87
|
+
slot.innerHTML = '';
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
this.serviceChart = this.chartService.create(slot, {
|
|
92
|
+
type: 'donut',
|
|
93
|
+
title: {
|
|
94
|
+
text: 'Revenue mix',
|
|
95
|
+
subtitle: 'Mounted from the service'
|
|
96
|
+
},
|
|
97
|
+
data: [
|
|
98
|
+
{ label: 'New', value: 42, color: '#2563eb' },
|
|
99
|
+
{ label: 'Expansion', value: 28, color: '#10b981' },
|
|
100
|
+
{ label: 'Renewal', value: 19, color: '#f59e0b' },
|
|
101
|
+
{ label: 'Recovery', value: 11, color: '#ef4444' }
|
|
102
|
+
],
|
|
103
|
+
theme: 'light',
|
|
104
|
+
showLegend: true
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
this.serviceChartMounted = true;
|
|
108
|
+
this.log('Service chart created.');
|
|
109
|
+
|
|
110
|
+
this.serviceChart.ready().then(() => {
|
|
111
|
+
this.log('Service chart ready.');
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
appendRealtimePoint(): void {
|
|
116
|
+
var value: number;
|
|
117
|
+
|
|
118
|
+
if (!this.realtimeChart) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
value = 96 + Math.round(Math.random() * 28);
|
|
123
|
+
this.realtimePointIndex += 1;
|
|
124
|
+
this.realtimeChart.appendData({
|
|
125
|
+
label: 'T' + this.realtimePointIndex,
|
|
126
|
+
value: value
|
|
127
|
+
});
|
|
128
|
+
this.log('Realtime point appended: ' + value + '.');
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
toggleRealtimeTheme(): void {
|
|
132
|
+
this.realtimeTheme = this.realtimeTheme === 'light' ? 'dark' : 'light';
|
|
133
|
+
this.realtimeChartConfig = this.createRealtimeConfig(this.realtimeTheme);
|
|
134
|
+
this.log('Realtime example switched to ' + this.realtimeTheme + ' theme.');
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
clearLog(): void {
|
|
138
|
+
this.logs = [];
|
|
139
|
+
this.log('Log cleared.');
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
private createLineChartConfig(): Object {
|
|
143
|
+
return {
|
|
144
|
+
type: 'line',
|
|
145
|
+
title: {
|
|
146
|
+
text: 'Monthly recurring revenue',
|
|
147
|
+
subtitle: 'Standalone component example'
|
|
148
|
+
},
|
|
149
|
+
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
|
|
150
|
+
series: [
|
|
151
|
+
{ name: 'Revenue', data: [14, 18, 17, 26, 29, 34] },
|
|
152
|
+
{ name: 'Plan', data: [12, 16, 19, 23, 28, 31], color: '#38bdf8' }
|
|
153
|
+
],
|
|
154
|
+
thresholds: [
|
|
155
|
+
{
|
|
156
|
+
value: 28,
|
|
157
|
+
axis: 'y',
|
|
158
|
+
label: 'Target',
|
|
159
|
+
color: '#f59e0b'
|
|
160
|
+
}
|
|
161
|
+
],
|
|
162
|
+
theme: 'dark',
|
|
163
|
+
legend: {
|
|
164
|
+
show: true,
|
|
165
|
+
position: 'bottom'
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
private createBarCardConfig(theme: string): Object {
|
|
171
|
+
var config: any = {
|
|
172
|
+
type: 'bar',
|
|
173
|
+
title: {
|
|
174
|
+
text: 'Pipeline by segment',
|
|
175
|
+
subtitle: 'Directive-driven dashboard slot'
|
|
176
|
+
},
|
|
177
|
+
labels: ['SMB', 'Mid-market', 'Enterprise', 'Partners'],
|
|
178
|
+
series: [
|
|
179
|
+
{ name: 'Qualified', data: [18, 26, 22, 14] },
|
|
180
|
+
{ name: 'Closed', data: [9, 14, 16, 7], color: '#22c55e' }
|
|
181
|
+
],
|
|
182
|
+
legend: {
|
|
183
|
+
show: true,
|
|
184
|
+
position: 'bottom'
|
|
185
|
+
},
|
|
186
|
+
theme: theme
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
if (theme === 'dark') {
|
|
190
|
+
config.colors = {
|
|
191
|
+
surface: '#0b1220',
|
|
192
|
+
surfaceAlt: '#111a2d',
|
|
193
|
+
plotBackground: '#0f1a2c',
|
|
194
|
+
plotBorder: '#1e3352',
|
|
195
|
+
border: '#203451',
|
|
196
|
+
text: '#d8e3f3',
|
|
197
|
+
mutedText: '#93a5be',
|
|
198
|
+
title: '#f8fbff'
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return config;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
private createRealtimeConfig(theme: string): Object {
|
|
206
|
+
var config: any = {
|
|
207
|
+
type: 'line',
|
|
208
|
+
title: {
|
|
209
|
+
text: 'Realtime throughput',
|
|
210
|
+
subtitle: 'Wrapper methods stay available through the component instance'
|
|
211
|
+
},
|
|
212
|
+
labels: ['T1', 'T2', 'T3', 'T4', 'T5', 'T6'],
|
|
213
|
+
data: [98, 104, 102, 118, 111, 120],
|
|
214
|
+
theme: theme,
|
|
215
|
+
realtime: {
|
|
216
|
+
enabled: true,
|
|
217
|
+
maxPoints: 10
|
|
218
|
+
},
|
|
219
|
+
showLegend: false
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
if (theme === 'dark') {
|
|
223
|
+
config.colors = {
|
|
224
|
+
surface: '#08111d',
|
|
225
|
+
surfaceAlt: '#102038',
|
|
226
|
+
plotBackground: '#0b1728',
|
|
227
|
+
plotBorder: '#1d3250',
|
|
228
|
+
border: '#1d3250',
|
|
229
|
+
text: '#cbd7e8',
|
|
230
|
+
mutedText: '#8ba0bb',
|
|
231
|
+
title: '#f8fbff'
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
return config;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
private log(message: string): void {
|
|
239
|
+
var timestamp = new Date().toLocaleTimeString();
|
|
240
|
+
this.logs.unshift('[' + timestamp + '] ' + message);
|
|
241
|
+
this.logs = this.logs.slice(0, 14);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BrowserModule } from '@angular/platform-browser';
|
|
2
|
+
import { NgModule } from '@angular/core';
|
|
3
|
+
import { FormsModule } from '@angular/forms';
|
|
4
|
+
|
|
5
|
+
import { InfinityChartsModule } from '@revivejs/angular-infinity-charts';
|
|
6
|
+
import { AppComponent } from './app.component';
|
|
7
|
+
import { PlaygroundComponent } from './playground.component';
|
|
8
|
+
|
|
9
|
+
@NgModule({
|
|
10
|
+
declarations: [AppComponent, PlaygroundComponent],
|
|
11
|
+
imports: [
|
|
12
|
+
BrowserModule,
|
|
13
|
+
FormsModule,
|
|
14
|
+
InfinityChartsModule.forRoot()
|
|
15
|
+
],
|
|
16
|
+
bootstrap: [AppComponent]
|
|
17
|
+
})
|
|
18
|
+
export class AppModule {}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const API_CARDS = [
|
|
2
|
+
{
|
|
3
|
+
title: 'InfinityChartComponent',
|
|
4
|
+
summary: 'Use <revive-infinity-chart> when the chart itself should be rendered declaratively inside the Angular template.'
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
title: 'InfinityChartDirective',
|
|
8
|
+
summary: 'Use [reviveInfinityChart] when an existing slot, dashboard card, widget shell, or analytics panel should become a chart host.'
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
title: 'InfinityChartService',
|
|
12
|
+
summary: 'Create charts programmatically for modal slots, detached surfaces, fullscreen views, or service-driven workflows.'
|
|
13
|
+
}
|
|
14
|
+
];
|