@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,428 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
declare var module: { id: string };
|
|
4
|
+
|
|
5
|
+
interface PlaygroundChartType {
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface PlaygroundSurface {
|
|
11
|
+
id: string;
|
|
12
|
+
label: string;
|
|
13
|
+
description: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface PlaygroundState {
|
|
17
|
+
type: string;
|
|
18
|
+
theme: string;
|
|
19
|
+
height: number;
|
|
20
|
+
showLegend: boolean;
|
|
21
|
+
showTooltip: boolean;
|
|
22
|
+
showNumber: boolean;
|
|
23
|
+
reducedMotion: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const CHART_TYPES: PlaygroundChartType[] = [
|
|
27
|
+
{ value: 'line', label: 'Line' },
|
|
28
|
+
{ value: 'area', label: 'Area' },
|
|
29
|
+
{ value: 'stacked-area', label: 'Stacked area' },
|
|
30
|
+
{ value: 'bar', label: 'Bar' },
|
|
31
|
+
{ value: 'bar-3d', label: 'Bar 3D' },
|
|
32
|
+
{ value: 'combo', label: 'Combo' },
|
|
33
|
+
{ value: 'sparkline', label: 'Sparkline' },
|
|
34
|
+
{ value: 'scatter', label: 'Scatter' },
|
|
35
|
+
{ value: 'gauge', label: 'Gauge' },
|
|
36
|
+
{ value: 'gauge-semicircle', label: 'Gauge semicircle' },
|
|
37
|
+
{ value: 'radial-progress', label: 'Radial progress' },
|
|
38
|
+
{ value: 'thermometer', label: 'Thermometer' },
|
|
39
|
+
{ value: 'thermometer-horizontal', label: 'Thermometer horizontal' },
|
|
40
|
+
{ value: 'battery', label: 'Battery' },
|
|
41
|
+
{ value: 'pie', label: 'Pie' },
|
|
42
|
+
{ value: 'donut', label: 'Donut' }
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
@Component({
|
|
46
|
+
moduleId: module.id,
|
|
47
|
+
selector: 'playground-panel',
|
|
48
|
+
templateUrl: './playground.component.html',
|
|
49
|
+
styleUrls: ['./playground.component.css']
|
|
50
|
+
})
|
|
51
|
+
export class PlaygroundComponent {
|
|
52
|
+
chartTypes: PlaygroundChartType[] = CHART_TYPES;
|
|
53
|
+
|
|
54
|
+
surfaces: PlaygroundSurface[] = [
|
|
55
|
+
{
|
|
56
|
+
id: 'component',
|
|
57
|
+
label: 'Component',
|
|
58
|
+
description: 'Render the chart directly with <revive-infinity-chart> when the chart block itself is part of the template.'
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: 'dashboard',
|
|
62
|
+
label: 'Dashboard',
|
|
63
|
+
description: 'Attach the directive to a dedicated chart slot inside a dashboard card while the shell stays fully custom.'
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: 'widget',
|
|
67
|
+
label: 'Widget',
|
|
68
|
+
description: 'Preview how compact gauges, donuts, and small analytics cards feel in tighter layout slots.'
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: 'dark-panel',
|
|
72
|
+
label: 'Dark panel',
|
|
73
|
+
description: 'Check dark product chrome quickly without leaving the docs surface.'
|
|
74
|
+
}
|
|
75
|
+
];
|
|
76
|
+
|
|
77
|
+
activeSurface: string = 'component';
|
|
78
|
+
copyButtonLabel: string = 'Copy code';
|
|
79
|
+
|
|
80
|
+
state: PlaygroundState = {
|
|
81
|
+
type: 'line',
|
|
82
|
+
theme: 'light',
|
|
83
|
+
height: 320,
|
|
84
|
+
showLegend: true,
|
|
85
|
+
showTooltip: true,
|
|
86
|
+
showNumber: true,
|
|
87
|
+
reducedMotion: false
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
previewConfig: Object = {};
|
|
91
|
+
generatedCode: string = '';
|
|
92
|
+
|
|
93
|
+
constructor() {
|
|
94
|
+
this.applyPlaygroundState(false);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
setSurface(surfaceId: string): void {
|
|
98
|
+
if (this.activeSurface === surfaceId) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
this.activeSurface = surfaceId;
|
|
103
|
+
this.applyPlaygroundState(false);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
applyPlaygroundState(useRandomData: boolean): void {
|
|
107
|
+
this.state.height = Number(this.state.height);
|
|
108
|
+
this.previewConfig = this.buildPreviewConfig(useRandomData);
|
|
109
|
+
this.generatedCode = this.buildGeneratedCode();
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
shuffleData(): void {
|
|
113
|
+
this.applyPlaygroundState(true);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
copyCode(): void {
|
|
117
|
+
var textarea = document.createElement('textarea');
|
|
118
|
+
|
|
119
|
+
textarea.value = this.generatedCode;
|
|
120
|
+
textarea.setAttribute('readonly', 'true');
|
|
121
|
+
textarea.style.position = 'absolute';
|
|
122
|
+
textarea.style.left = '-9999px';
|
|
123
|
+
document.body.appendChild(textarea);
|
|
124
|
+
textarea.select();
|
|
125
|
+
|
|
126
|
+
try {
|
|
127
|
+
document.execCommand('copy');
|
|
128
|
+
this.copyButtonLabel = 'Copied';
|
|
129
|
+
} catch (error) {
|
|
130
|
+
this.copyButtonLabel = 'Copy failed';
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
document.body.removeChild(textarea);
|
|
134
|
+
|
|
135
|
+
setTimeout(() => {
|
|
136
|
+
this.copyButtonLabel = 'Copy code';
|
|
137
|
+
}, 1200);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
isSurfaceActive(surfaceId: string): boolean {
|
|
141
|
+
return this.activeSurface === surfaceId;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
getActiveSurfaceDescription(): string {
|
|
145
|
+
var i: number;
|
|
146
|
+
|
|
147
|
+
for (i = 0; i < this.surfaces.length; i += 1) {
|
|
148
|
+
if (this.surfaces[i].id === this.activeSurface) {
|
|
149
|
+
return this.surfaces[i].description;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
return '';
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
private buildPreviewConfig(useRandomData: boolean): Object {
|
|
157
|
+
var config: any = this.createChartPreset(this.state.type, useRandomData);
|
|
158
|
+
var forcedTheme: string | null = this.activeSurface === 'dark-panel' ? 'dark' : null;
|
|
159
|
+
|
|
160
|
+
config.theme = forcedTheme || this.state.theme;
|
|
161
|
+
config.showLegend = this.state.showLegend;
|
|
162
|
+
config.showTooltip = this.state.showTooltip;
|
|
163
|
+
config.showNumber = this.state.showNumber;
|
|
164
|
+
config.animation = {
|
|
165
|
+
enabled: !this.state.reducedMotion,
|
|
166
|
+
duration: this.state.reducedMotion ? 0 : 600,
|
|
167
|
+
mode: this.state.reducedMotion ? 'none' : 'subtle'
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
if (this.activeSurface === 'widget') {
|
|
171
|
+
config.layout = Object.assign({}, config.layout || {}, {
|
|
172
|
+
cornerRadius: 18
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if (this.activeSurface === 'dark-panel') {
|
|
177
|
+
config.colors = Object.assign({}, config.colors || {}, {
|
|
178
|
+
surface: '#091323',
|
|
179
|
+
surfaceAlt: '#111b2f',
|
|
180
|
+
plotBackground: '#0d182a',
|
|
181
|
+
plotBorder: '#203451',
|
|
182
|
+
border: '#1f334f',
|
|
183
|
+
text: '#d4def0',
|
|
184
|
+
mutedText: '#8ea1bb',
|
|
185
|
+
title: '#f8fbff'
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
return config;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
private createChartPreset(type: string, useRandomData: boolean): Object {
|
|
193
|
+
var jitter = useRandomData ? this.randomBetween(-4, 6) : 0;
|
|
194
|
+
|
|
195
|
+
if (type === 'gauge' || type === 'gauge-semicircle' || type === 'radial-progress' || type === 'thermometer' || type === 'thermometer-horizontal' || type === 'battery') {
|
|
196
|
+
return {
|
|
197
|
+
type: type,
|
|
198
|
+
title: {
|
|
199
|
+
text: this.chartLabel(type),
|
|
200
|
+
subtitle: 'Interactive wrapper preview'
|
|
201
|
+
},
|
|
202
|
+
data: [
|
|
203
|
+
{
|
|
204
|
+
label: 'Status',
|
|
205
|
+
value: 72 + jitter
|
|
206
|
+
}
|
|
207
|
+
],
|
|
208
|
+
gauge: {
|
|
209
|
+
min: 0,
|
|
210
|
+
max: 100,
|
|
211
|
+
unit: '%',
|
|
212
|
+
bands: [
|
|
213
|
+
{ from: 0, to: 55, color: '#22c55e', label: 'Healthy' },
|
|
214
|
+
{ from: 55, to: 80, color: '#f59e0b', label: 'Attention' },
|
|
215
|
+
{ from: 80, to: 100, color: '#ef4444', label: 'Critical' }
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (type === 'pie' || type === 'donut') {
|
|
222
|
+
return {
|
|
223
|
+
type: type,
|
|
224
|
+
title: {
|
|
225
|
+
text: this.chartLabel(type),
|
|
226
|
+
subtitle: 'Interactive wrapper preview'
|
|
227
|
+
},
|
|
228
|
+
data: [
|
|
229
|
+
{ label: 'New', value: 42 + jitter, color: '#2563eb' },
|
|
230
|
+
{ label: 'Expansion', value: 28 + this.randomBetween(-3, 4), color: '#10b981' },
|
|
231
|
+
{ label: 'Renewal', value: 18 + this.randomBetween(-2, 3), color: '#f59e0b' },
|
|
232
|
+
{ label: 'Recovery', value: 12 + this.randomBetween(-2, 2), color: '#ef4444' }
|
|
233
|
+
]
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
if (type === 'scatter') {
|
|
238
|
+
return {
|
|
239
|
+
type: type,
|
|
240
|
+
title: {
|
|
241
|
+
text: this.chartLabel(type),
|
|
242
|
+
subtitle: 'Interactive wrapper preview'
|
|
243
|
+
},
|
|
244
|
+
series: [
|
|
245
|
+
{
|
|
246
|
+
name: 'Correlation',
|
|
247
|
+
data: [
|
|
248
|
+
{ x: 6, y: 16 + jitter },
|
|
249
|
+
{ x: 12, y: 23 + jitter },
|
|
250
|
+
{ x: 18, y: 29 + jitter },
|
|
251
|
+
{ x: 22, y: 31 + jitter },
|
|
252
|
+
{ x: 30, y: 40 + jitter }
|
|
253
|
+
]
|
|
254
|
+
}
|
|
255
|
+
]
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
if (type === 'sparkline') {
|
|
260
|
+
return {
|
|
261
|
+
type: type,
|
|
262
|
+
title: {
|
|
263
|
+
text: this.chartLabel(type),
|
|
264
|
+
subtitle: 'Interactive wrapper preview'
|
|
265
|
+
},
|
|
266
|
+
data: [18, 22, 20, 27, 29, 31, 34].map(function (value: number) {
|
|
267
|
+
return value + jitter;
|
|
268
|
+
}),
|
|
269
|
+
showLegend: false
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
if (type === 'bar' || type === 'bar-3d') {
|
|
274
|
+
return {
|
|
275
|
+
type: type,
|
|
276
|
+
title: {
|
|
277
|
+
text: this.chartLabel(type),
|
|
278
|
+
subtitle: 'Interactive wrapper preview'
|
|
279
|
+
},
|
|
280
|
+
labels: ['North', 'South', 'West', 'Global'],
|
|
281
|
+
series: [
|
|
282
|
+
{ name: 'Revenue', data: [22 + jitter, 31 + jitter, 27 + jitter, 38 + jitter] },
|
|
283
|
+
{ name: 'Plan', data: [18 + jitter, 26 + jitter, 24 + jitter, 32 + jitter], color: '#22c55e' }
|
|
284
|
+
]
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
if (type === 'combo') {
|
|
289
|
+
return {
|
|
290
|
+
type: type,
|
|
291
|
+
title: {
|
|
292
|
+
text: this.chartLabel(type),
|
|
293
|
+
subtitle: 'Interactive wrapper preview'
|
|
294
|
+
},
|
|
295
|
+
labels: ['Q1', 'Q2', 'Q3', 'Q4'],
|
|
296
|
+
series: [
|
|
297
|
+
{ name: 'Revenue', type: 'bar', data: [24 + jitter, 32 + jitter, 28 + jitter, 40 + jitter] },
|
|
298
|
+
{ name: 'Growth', type: 'line', data: [18 + jitter, 27 + jitter, 31 + jitter, 38 + jitter], color: '#38bdf8' }
|
|
299
|
+
]
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
return {
|
|
304
|
+
type: type,
|
|
305
|
+
title: {
|
|
306
|
+
text: this.chartLabel(type),
|
|
307
|
+
subtitle: 'Interactive wrapper preview'
|
|
308
|
+
},
|
|
309
|
+
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
|
|
310
|
+
series: [
|
|
311
|
+
{ name: 'Current', data: [14 + jitter, 18 + jitter, 17 + jitter, 26 + jitter, 29 + jitter, 34 + jitter] },
|
|
312
|
+
{ name: 'Plan', data: [12 + jitter, 16 + jitter, 19 + jitter, 23 + jitter, 28 + jitter, 31 + jitter], color: '#38bdf8' }
|
|
313
|
+
]
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
private buildGeneratedCode(): string {
|
|
318
|
+
var moduleSnippet: string[] = [
|
|
319
|
+
'// app.module.ts',
|
|
320
|
+
"import { BrowserModule } from '@angular/platform-browser';",
|
|
321
|
+
"import { NgModule } from '@angular/core';",
|
|
322
|
+
"import { InfinityChartsModule } from '@revivejs/angular-infinity-charts';",
|
|
323
|
+
"import { AppComponent } from './app.component';",
|
|
324
|
+
'',
|
|
325
|
+
'@NgModule({',
|
|
326
|
+
' declarations: [AppComponent],',
|
|
327
|
+
' imports: [BrowserModule, InfinityChartsModule.forRoot()],',
|
|
328
|
+
' bootstrap: [AppComponent]',
|
|
329
|
+
'})',
|
|
330
|
+
'export class AppModule {}',
|
|
331
|
+
''
|
|
332
|
+
];
|
|
333
|
+
|
|
334
|
+
return moduleSnippet.concat(this.buildTemplateDrivenSnippet()).join('\n');
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
private buildTemplateDrivenSnippet(): string[] {
|
|
338
|
+
return [
|
|
339
|
+
'// app.component.ts',
|
|
340
|
+
"import { Component } from '@angular/core';",
|
|
341
|
+
'',
|
|
342
|
+
'@Component({',
|
|
343
|
+
" selector: 'app-root',",
|
|
344
|
+
" templateUrl: './app.component.html'",
|
|
345
|
+
'})',
|
|
346
|
+
'export class AppComponent {',
|
|
347
|
+
' chartConfig = ' + this.stringifyCode(this.previewConfig, 2) + ';',
|
|
348
|
+
'}',
|
|
349
|
+
'',
|
|
350
|
+
'// app.component.html',
|
|
351
|
+
this.activeSurface === 'component'
|
|
352
|
+
? '<revive-infinity-chart [config]="chartConfig" style="display:block;height:' + this.state.height + 'px;"></revive-infinity-chart>'
|
|
353
|
+
: '<div class="chart-slot" [reviveInfinityChart]="chartConfig" style="height:' + this.state.height + 'px;"></div>'
|
|
354
|
+
];
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
private chartLabel(type: string): string {
|
|
358
|
+
var i: number;
|
|
359
|
+
|
|
360
|
+
for (i = 0; i < this.chartTypes.length; i += 1) {
|
|
361
|
+
if (this.chartTypes[i].value === type) {
|
|
362
|
+
return this.chartTypes[i].label;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
return type;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
private stringifyCode(value: any, indent: number): string {
|
|
370
|
+
var spaces = this.pad(indent);
|
|
371
|
+
var innerSpaces = this.pad(indent + 2);
|
|
372
|
+
var keys: string[];
|
|
373
|
+
var i: number;
|
|
374
|
+
var lines: string[];
|
|
375
|
+
|
|
376
|
+
if (value === null) {
|
|
377
|
+
return 'null';
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
if (typeof value === 'string') {
|
|
381
|
+
return "'" + String(value).split("'").join("\\'") + "'";
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
if (typeof value === 'number' || typeof value === 'boolean') {
|
|
385
|
+
return String(value);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
if (Array.isArray(value)) {
|
|
389
|
+
if (!value.length) {
|
|
390
|
+
return '[]';
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
lines = ['['];
|
|
394
|
+
|
|
395
|
+
for (i = 0; i < value.length; i += 1) {
|
|
396
|
+
lines.push(innerSpaces + this.stringifyCode(value[i], indent + 2) + (i < value.length - 1 ? ',' : ''));
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
lines.push(spaces + ']');
|
|
400
|
+
return lines.join('\n');
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
keys = Object.keys(value);
|
|
404
|
+
|
|
405
|
+
if (!keys.length) {
|
|
406
|
+
return '{}';
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
lines = ['{'];
|
|
410
|
+
|
|
411
|
+
for (i = 0; i < keys.length; i += 1) {
|
|
412
|
+
lines.push(
|
|
413
|
+
innerSpaces + keys[i] + ': ' + this.stringifyCode(value[keys[i]], indent + 2) + (i < keys.length - 1 ? ',' : '')
|
|
414
|
+
);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
lines.push(spaces + '}');
|
|
418
|
+
return lines.join('\n');
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
private pad(length: number): string {
|
|
422
|
+
return new Array(length + 1).join(' ');
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
private randomBetween(min: number, max: number): number {
|
|
426
|
+
return Math.round(min + (Math.random() * (max - min)));
|
|
427
|
+
}
|
|
428
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>@revivejs/angular-infinity-charts · Angular 2</title>
|
|
6
|
+
<base href="./" />
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
8
|
+
<link rel="stylesheet" href="./styles.css" />
|
|
9
|
+
<script src="https://unpkg.com/core-js@2.6.12/client/shim.min.js"></script>
|
|
10
|
+
<script src="https://unpkg.com/zone.js@0.7.8/dist/zone.js"></script>
|
|
11
|
+
<script src="https://unpkg.com/reflect-metadata@0.1.13/Reflect.js"></script>
|
|
12
|
+
<script src="https://unpkg.com/systemjs@0.19.47/dist/system.src.js"></script>
|
|
13
|
+
<script src="./systemjs.config.js"></script>
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<app-root>
|
|
17
|
+
<div class="boot-shell">
|
|
18
|
+
<div class="boot-card">
|
|
19
|
+
<div class="boot-loader"></div>
|
|
20
|
+
<p>Booting Angular 2 docs…</p>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</app-root>
|
|
24
|
+
<script>
|
|
25
|
+
System.import('app').catch(function (error) {
|
|
26
|
+
console.error(error);
|
|
27
|
+
document.body.innerHTML = '<pre style="padding:16px;white-space:pre-wrap;">' + String(error) + '</pre>';
|
|
28
|
+
});
|
|
29
|
+
</script>
|
|
30
|
+
</body>
|
|
31
|
+
</html>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
2
|
+
|
|
3
|
+
import { AppModule } from './app/app.module';
|
|
4
|
+
|
|
5
|
+
platformBrowserDynamic().bootstrapModule(AppModule).catch(function (error: any) {
|
|
6
|
+
console.error(error);
|
|
7
|
+
document.body.innerHTML = '<pre style="padding:16px;white-space:pre-wrap;">' + String(error) + '</pre>';
|
|
8
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
html,
|
|
2
|
+
body {
|
|
3
|
+
margin: 0;
|
|
4
|
+
min-height: 100%;
|
|
5
|
+
font-family: "Segoe UI", Arial, sans-serif;
|
|
6
|
+
background:
|
|
7
|
+
radial-gradient(circle at top left, rgba(59, 130, 246, 0.16), transparent 28%),
|
|
8
|
+
linear-gradient(180deg, #f8fbff, #edf4ff);
|
|
9
|
+
color: #0f172a;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
body {
|
|
13
|
+
min-height: 100vh;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.boot-shell {
|
|
17
|
+
display: grid;
|
|
18
|
+
place-items: center;
|
|
19
|
+
min-height: 100vh;
|
|
20
|
+
padding: 24px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.boot-card {
|
|
24
|
+
display: grid;
|
|
25
|
+
place-items: center;
|
|
26
|
+
gap: 16px;
|
|
27
|
+
padding: 28px 32px;
|
|
28
|
+
border-radius: 24px;
|
|
29
|
+
border: 1px solid rgba(15, 23, 42, 0.08);
|
|
30
|
+
background: rgba(255, 255, 255, 0.92);
|
|
31
|
+
box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.boot-loader {
|
|
35
|
+
width: 42px;
|
|
36
|
+
height: 42px;
|
|
37
|
+
border-radius: 999px;
|
|
38
|
+
border: 3px solid rgba(37, 99, 235, 0.18);
|
|
39
|
+
border-top-color: #2563eb;
|
|
40
|
+
animation: spin 0.9s linear infinite;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@keyframes spin {
|
|
44
|
+
to {
|
|
45
|
+
transform: rotate(360deg);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
(function (global) {
|
|
2
|
+
System.config({
|
|
3
|
+
transpiler: 'ts',
|
|
4
|
+
typescriptOptions: {
|
|
5
|
+
target: 'es5',
|
|
6
|
+
module: 'commonjs',
|
|
7
|
+
moduleResolution: 'node',
|
|
8
|
+
sourceMap: true,
|
|
9
|
+
emitDecoratorMetadata: true,
|
|
10
|
+
experimentalDecorators: true,
|
|
11
|
+
removeComments: false,
|
|
12
|
+
noImplicitAny: false
|
|
13
|
+
},
|
|
14
|
+
meta: {
|
|
15
|
+
typescript: {
|
|
16
|
+
exports: 'ts'
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
paths: {
|
|
20
|
+
'npm:': 'https://unpkg.com/'
|
|
21
|
+
},
|
|
22
|
+
map: {
|
|
23
|
+
app: '.',
|
|
24
|
+
'@angular/core': 'npm:@angular/core@2.4.10/bundles/core.umd.js',
|
|
25
|
+
'@angular/common': 'npm:@angular/common@2.4.10/bundles/common.umd.js',
|
|
26
|
+
'@angular/compiler': 'npm:@angular/compiler@2.4.10/bundles/compiler.umd.js',
|
|
27
|
+
'@angular/platform-browser': 'npm:@angular/platform-browser@2.4.10/bundles/platform-browser.umd.js',
|
|
28
|
+
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic@2.4.10/bundles/platform-browser-dynamic.umd.js',
|
|
29
|
+
'@angular/forms': 'npm:@angular/forms@2.4.10/bundles/forms.umd.js',
|
|
30
|
+
'@angular/http': 'npm:@angular/http@2.4.10/bundles/http.umd.js',
|
|
31
|
+
rxjs: 'npm:rxjs@5.5.12',
|
|
32
|
+
ts: 'npm:plugin-typescript@5.3.3/lib/plugin.js',
|
|
33
|
+
typescript: 'npm:typescript@2.4.2/lib/typescript.js',
|
|
34
|
+
'@revivejs/angular-infinity-charts': 'vendor/angular-infinity-charts',
|
|
35
|
+
'@revivejs/infinity-charts': 'vendor/infinity-charts'
|
|
36
|
+
},
|
|
37
|
+
packages: {
|
|
38
|
+
app: {
|
|
39
|
+
main: './main.ts',
|
|
40
|
+
defaultExtension: 'ts'
|
|
41
|
+
},
|
|
42
|
+
rxjs: {
|
|
43
|
+
defaultExtension: 'js'
|
|
44
|
+
},
|
|
45
|
+
'@revivejs/angular-infinity-charts': {
|
|
46
|
+
main: './index.js',
|
|
47
|
+
defaultExtension: 'js'
|
|
48
|
+
},
|
|
49
|
+
'@revivejs/infinity-charts': {
|
|
50
|
+
main: './index.js',
|
|
51
|
+
defaultExtension: 'js'
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
})(this);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkangular_infinity_charts_docs_angular21=self.webpackChunkangular_infinity_charts_docs_angular21||[]).push([[37,180,323,418,561,704,799,942],{3509(x,y,u){u.d(y,{cT:()=>g,pl:()=>p,zc:()=>o});var s=u(8264);const g=(l,t,e,a)=>{if(!t.title.text&&!t.title.subtitle)return[];const i={start:"start",center:"middle",end:"end"},n={start:e.header.x+12,center:e.header.x+e.header.width/2,end:e.header.x+e.header.width-12}[t.title.align];return[(0,s.qu)(`${l}-title-group`,[t.title.text?(0,s.qn)(`${l}-title`,t.title.text,{class:"ic-title",x:n,y:e.header.y+24,fill:a.title,"font-family":a.fontFamily,"font-size":a.fontSize+3,"font-weight":700,"text-anchor":i[t.title.align]}):(0,s.qu)(`${l}-title-empty`),t.title.subtitle?(0,s.qn)(`${l}-subtitle`,t.title.subtitle,{class:"ic-subtitle",x:n,y:e.header.y+44,fill:a.mutedText,"font-family":a.fontFamily,"font-size":a.fontSize,"text-anchor":i[t.title.align]}):(0,s.qu)(`${l}-subtitle-empty`)])]},o=(l,t,e,a,r)=>{const i=e.legend;if(!t.legend.show||0===r.length||!i)return[];const n="left"===t.legend.position||"right"===t.legend.position,c=n?i.width-20:112,_=((l,t,e)=>"center"===l?t.x+(t.width-e)/2:"end"===l?t.x+t.width-e:t.x+12)(t.legend.align,i,n?c:c*r.length),d=r.flatMap((h,$)=>{const w=n?i.x+10:_+$*c,f=n?i.y+18+24*$:i.y+18;return[(0,s.FU)(`${l}-legend-dot-${h.id}`,{class:"ic-legend-dot",cx:w+6,cy:f-4,r:5,fill:h.color}),(0,s.qn)(`${l}-legend-label-${h.id}`,h.label,{class:"ic-legend-label",x:w+18,y:f,fill:a.legendText,"font-family":a.fontFamily,"font-size":a.fontSize})]});return[(0,s.qu)(`${l}-legend`,d)]},p=({idPrefix:l,thresholds:t,frame:e,theme:a,yScale:r})=>{const i=t.filter(n=>"y"===(n.axis??"y")).flatMap((n,c)=>{const _=n.color??a.threshold,d=r.scale(n.value);return[(0,s.Vj)(`${l}-threshold-${n.id??c}`,{class:"ic-threshold-line",x1:e.plot.x,y1:d,x2:e.plot.x+e.plot.width,y2:d,stroke:_,"stroke-width":1.5,"stroke-dasharray":n.dasharray??"7 7",opacity:.92}),n.label?(0,s.qn)(`${l}-threshold-label-${n.id??c}`,n.label,{class:"ic-threshold-label",x:e.plot.x+e.plot.width-4,y:d-6,fill:_,"font-family":a.fontFamily,"font-size":a.fontSize-1,"text-anchor":"end","font-weight":600}):(0,s.qu)(`${l}-threshold-label-empty-${c}`)]});return i.length?[(0,s.qu)(`${l}-thresholds`,i)]:[]}},2239(x,y,u){u.d(y,{J:()=>b,_:()=>g});const s=o=>[o.seriesName,o.label,void 0!==o.value?String(o.value):void 0,o.detail].filter(Boolean).join(", "),b=o=>({"data-ic-interactive":"true","data-ic-payload":JSON.stringify(o),"aria-label":s(o)}),g={cursor:"pointer"}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkangular_infinity_charts_docs_angular21=self.webpackChunkangular_infinity_charts_docs_angular21||[]).push([[37,180,323,418,561,704,799,942],{3509(x,y,u){u.d(y,{cT:()=>g,pl:()=>p,zc:()=>o});var s=u(8264);const g=(l,t,e,a)=>{if(!t.title.text&&!t.title.subtitle)return[];const i={start:"start",center:"middle",end:"end"},n={start:e.header.x+12,center:e.header.x+e.header.width/2,end:e.header.x+e.header.width-12}[t.title.align];return[(0,s.qu)(`${l}-title-group`,[t.title.text?(0,s.qn)(`${l}-title`,t.title.text,{class:"ic-title",x:n,y:e.header.y+24,fill:a.title,"font-family":a.fontFamily,"font-size":a.fontSize+3,"font-weight":700,"text-anchor":i[t.title.align]}):(0,s.qu)(`${l}-title-empty`),t.title.subtitle?(0,s.qn)(`${l}-subtitle`,t.title.subtitle,{class:"ic-subtitle",x:n,y:e.header.y+44,fill:a.mutedText,"font-family":a.fontFamily,"font-size":a.fontSize,"text-anchor":i[t.title.align]}):(0,s.qu)(`${l}-subtitle-empty`)])]},o=(l,t,e,a,r)=>{const i=e.legend;if(!t.legend.show||0===r.length||!i)return[];const n="left"===t.legend.position||"right"===t.legend.position,c=n?i.width-20:112,_=((l,t,e)=>"center"===l?t.x+(t.width-e)/2:"end"===l?t.x+t.width-e:t.x+12)(t.legend.align,i,n?c:c*r.length),d=r.flatMap((h,$)=>{const w=n?i.x+10:_+$*c,f=n?i.y+18+24*$:i.y+18;return[(0,s.FU)(`${l}-legend-dot-${h.id}`,{class:"ic-legend-dot",cx:w+6,cy:f-4,r:5,fill:h.color}),(0,s.qn)(`${l}-legend-label-${h.id}`,h.label,{class:"ic-legend-label",x:w+18,y:f,fill:a.legendText,"font-family":a.fontFamily,"font-size":a.fontSize})]});return[(0,s.qu)(`${l}-legend`,d)]},p=({idPrefix:l,thresholds:t,frame:e,theme:a,yScale:r})=>{const i=t.filter(n=>"y"===(n.axis??"y")).flatMap((n,c)=>{const _=n.color??a.threshold,d=r.scale(n.value);return[(0,s.Vj)(`${l}-threshold-${n.id??c}`,{class:"ic-threshold-line",x1:e.plot.x,y1:d,x2:e.plot.x+e.plot.width,y2:d,stroke:_,"stroke-width":1.5,"stroke-dasharray":n.dasharray??"7 7",opacity:.92}),n.label?(0,s.qn)(`${l}-threshold-label-${n.id??c}`,n.label,{class:"ic-threshold-label",x:e.plot.x+e.plot.width-4,y:d-6,fill:_,"font-family":a.fontFamily,"font-size":a.fontSize-1,"text-anchor":"end","font-weight":600}):(0,s.qu)(`${l}-threshold-label-empty-${c}`)]});return i.length?[(0,s.qu)(`${l}-thresholds`,i)]:[]}},2239(x,y,u){u.d(y,{J:()=>b,_:()=>g});const s=o=>[o.seriesName,o.label,void 0!==o.value?String(o.value):void 0,o.detail].filter(Boolean).join(", "),b=o=>({"data-ic-interactive":"true","data-ic-payload":JSON.stringify(o),"aria-label":s(o)}),g={cursor:"pointer"}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkangular_infinity_charts_docs_angular21=self.webpackChunkangular_infinity_charts_docs_angular21||[]).push([[37,180,323,418,561,704,799,942],{3509(x,y,u){u.d(y,{cT:()=>g,pl:()=>p,zc:()=>o});var s=u(8264);const g=(l,t,e,a)=>{if(!t.title.text&&!t.title.subtitle)return[];const i={start:"start",center:"middle",end:"end"},n={start:e.header.x+12,center:e.header.x+e.header.width/2,end:e.header.x+e.header.width-12}[t.title.align];return[(0,s.qu)(`${l}-title-group`,[t.title.text?(0,s.qn)(`${l}-title`,t.title.text,{class:"ic-title",x:n,y:e.header.y+24,fill:a.title,"font-family":a.fontFamily,"font-size":a.fontSize+3,"font-weight":700,"text-anchor":i[t.title.align]}):(0,s.qu)(`${l}-title-empty`),t.title.subtitle?(0,s.qn)(`${l}-subtitle`,t.title.subtitle,{class:"ic-subtitle",x:n,y:e.header.y+44,fill:a.mutedText,"font-family":a.fontFamily,"font-size":a.fontSize,"text-anchor":i[t.title.align]}):(0,s.qu)(`${l}-subtitle-empty`)])]},o=(l,t,e,a,r)=>{const i=e.legend;if(!t.legend.show||0===r.length||!i)return[];const n="left"===t.legend.position||"right"===t.legend.position,c=n?i.width-20:112,_=((l,t,e)=>"center"===l?t.x+(t.width-e)/2:"end"===l?t.x+t.width-e:t.x+12)(t.legend.align,i,n?c:c*r.length),d=r.flatMap((h,$)=>{const w=n?i.x+10:_+$*c,f=n?i.y+18+24*$:i.y+18;return[(0,s.FU)(`${l}-legend-dot-${h.id}`,{class:"ic-legend-dot",cx:w+6,cy:f-4,r:5,fill:h.color}),(0,s.qn)(`${l}-legend-label-${h.id}`,h.label,{class:"ic-legend-label",x:w+18,y:f,fill:a.legendText,"font-family":a.fontFamily,"font-size":a.fontSize})]});return[(0,s.qu)(`${l}-legend`,d)]},p=({idPrefix:l,thresholds:t,frame:e,theme:a,yScale:r})=>{const i=t.filter(n=>"y"===(n.axis??"y")).flatMap((n,c)=>{const _=n.color??a.threshold,d=r.scale(n.value);return[(0,s.Vj)(`${l}-threshold-${n.id??c}`,{class:"ic-threshold-line",x1:e.plot.x,y1:d,x2:e.plot.x+e.plot.width,y2:d,stroke:_,"stroke-width":1.5,"stroke-dasharray":n.dasharray??"7 7",opacity:.92}),n.label?(0,s.qn)(`${l}-threshold-label-${n.id??c}`,n.label,{class:"ic-threshold-label",x:e.plot.x+e.plot.width-4,y:d-6,fill:_,"font-family":a.fontFamily,"font-size":a.fontSize-1,"text-anchor":"end","font-weight":600}):(0,s.qu)(`${l}-threshold-label-empty-${c}`)]});return i.length?[(0,s.qu)(`${l}-thresholds`,i)]:[]}},2239(x,y,u){u.d(y,{J:()=>b,_:()=>g});const s=o=>[o.seriesName,o.label,void 0!==o.value?String(o.value):void 0,o.detail].filter(Boolean).join(", "),b=o=>({"data-ic-interactive":"true","data-ic-payload":JSON.stringify(o),"aria-label":s(o)}),g={cursor:"pointer"}}}]);
|