@unovis/angular 1.3.4-beta.2 → 1.4.0-beta.1

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.
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Component, Input, ViewChild, ContentChildren, ContentChild, NgModule } from '@angular/core';
3
- import { Tooltip, Direction, XYContainer, Crosshair, Axis, SingleContainer, Area, Brush, ChordDiagram, Donut, FreeBrush, Graph, GroupedBar, Line, NestedDonut, Sankey, Scatter, StackedBar, Timeline, XYLabels, TopoJSONMap, LeafletMap, LeafletFlowMap, BulletLegend } from '@unovis/ts';
3
+ import { Tooltip, Annotations, Direction, XYContainer, Crosshair, Axis, SingleContainer, Area, Brush, ChordDiagram, Donut, FreeBrush, Graph, GroupedBar, Line, NestedDonut, Sankey, Scatter, StackedBar, Timeline, XYLabels, TopoJSONMap, LeafletMap, LeafletFlowMap, BulletLegend } from '@unovis/ts';
4
4
 
5
5
  class VisGenericComponent {
6
6
  }
@@ -58,6 +58,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
58
58
  type: Input
59
59
  }] } });
60
60
 
61
+ // !!! This code was automatically generated. You should not change it !!!
62
+ class VisAnnotationsComponent {
63
+ ngAfterViewInit() {
64
+ this.component = new Annotations(this.getConfig());
65
+ }
66
+ ngOnChanges(changes) {
67
+ var _a, _b;
68
+ (_a = this.component) === null || _a === void 0 ? void 0 : _a.setConfig(this.getConfig());
69
+ (_b = this.componentContainer) === null || _b === void 0 ? void 0 : _b.render();
70
+ }
71
+ getConfig() {
72
+ const { items } = this;
73
+ const config = { items };
74
+ const keys = Object.keys(config);
75
+ keys.forEach(key => { if (config[key] === undefined)
76
+ delete config[key]; });
77
+ return config;
78
+ }
79
+ }
80
+ VisAnnotationsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: VisAnnotationsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
81
+ VisAnnotationsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: VisAnnotationsComponent, selector: "vis-annotations", inputs: { items: "items" }, providers: [{ provide: VisGenericComponent, useExisting: VisAnnotationsComponent }], usesOnChanges: true, ngImport: i0, template: '', isInline: true });
82
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: VisAnnotationsComponent, decorators: [{
83
+ type: Component,
84
+ args: [{
85
+ selector: 'vis-annotations',
86
+ template: '',
87
+ // eslint-disable-next-line no-use-before-define
88
+ providers: [{ provide: VisGenericComponent, useExisting: VisAnnotationsComponent }],
89
+ }]
90
+ }], propDecorators: { items: [{
91
+ type: Input
92
+ }] } });
93
+
61
94
  class VisXYContainerComponent {
62
95
  constructor() {
63
96
  /** Constraint the minimum value of the Y scale domain.
@@ -112,13 +145,14 @@ class VisXYContainerComponent {
112
145
  (_b = this.chart) === null || _b === void 0 ? void 0 : _b.updateContainer(this.getConfig());
113
146
  }
114
147
  getConfig() {
115
- var _a;
148
+ var _a, _b;
116
149
  const { duration, margin, padding, scaleByDomain, autoMargin, width, height, xScale, xDomain, xDomainMinConstraint, xDomainMaxConstraint, xRange, yScale, yDomain, yDomainMinConstraint, yDomainMaxConstraint, yRange, yDirection, ariaLabel, } = this;
117
150
  const visComponents = this.visComponents.toArray().map(d => d.component);
118
151
  const crosshair = visComponents.find(c => c instanceof Crosshair);
119
152
  const tooltip = (_a = this.tooltipComponent) === null || _a === void 0 ? void 0 : _a.component;
120
153
  const xAxis = visComponents.find(c => { var _a; return c instanceof Axis && ((_a = c === null || c === void 0 ? void 0 : c.config) === null || _a === void 0 ? void 0 : _a.type) === 'x'; });
121
154
  const yAxis = visComponents.find(c => { var _a; return c instanceof Axis && ((_a = c === null || c === void 0 ? void 0 : c.config) === null || _a === void 0 ? void 0 : _a.type) === 'y'; });
155
+ const annotations = (_b = this.annotationsComponent) === null || _b === void 0 ? void 0 : _b.component;
122
156
  const components = visComponents.filter(c => !(c instanceof Crosshair) && !(c instanceof Tooltip) && !(c instanceof Axis));
123
157
  return {
124
158
  components,
@@ -131,6 +165,7 @@ class VisXYContainerComponent {
131
165
  yAxis,
132
166
  tooltip,
133
167
  crosshair,
168
+ annotations,
134
169
  scaleByDomain,
135
170
  autoMargin,
136
171
  xScale,
@@ -158,7 +193,7 @@ class VisXYContainerComponent {
158
193
  }
159
194
  }
160
195
  VisXYContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: VisXYContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
161
- VisXYContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: VisXYContainerComponent, selector: "vis-xy-container", inputs: { width: "width", height: "height", xScale: "xScale", xDomain: "xDomain", xDomainMinConstraint: "xDomainMinConstraint", xDomainMaxConstraint: "xDomainMaxConstraint", xRange: "xRange", yScale: "yScale", yDomain: "yDomain", yDomainMinConstraint: "yDomainMinConstraint", yDomainMaxConstraint: "yDomainMaxConstraint", yRange: "yRange", yDirection: "yDirection", preventEmptyDomain: "preventEmptyDomain", duration: "duration", margin: "margin", padding: "padding", scaleByDomain: "scaleByDomain", autoMargin: "autoMargin", ariaLabel: "ariaLabel", data: "data" }, queries: [{ propertyName: "tooltipComponent", first: true, predicate: VisTooltipComponent, descendants: true }, { propertyName: "visComponents", predicate: VisXYComponent }], viewQueries: [{ propertyName: "containerRef", first: true, predicate: ["container"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `<div #container class="unovis-xy-container">
196
+ VisXYContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: VisXYContainerComponent, selector: "vis-xy-container", inputs: { width: "width", height: "height", xScale: "xScale", xDomain: "xDomain", xDomainMinConstraint: "xDomainMinConstraint", xDomainMaxConstraint: "xDomainMaxConstraint", xRange: "xRange", yScale: "yScale", yDomain: "yDomain", yDomainMinConstraint: "yDomainMinConstraint", yDomainMaxConstraint: "yDomainMaxConstraint", yRange: "yRange", yDirection: "yDirection", preventEmptyDomain: "preventEmptyDomain", duration: "duration", margin: "margin", padding: "padding", scaleByDomain: "scaleByDomain", autoMargin: "autoMargin", ariaLabel: "ariaLabel", data: "data" }, queries: [{ propertyName: "tooltipComponent", first: true, predicate: VisTooltipComponent, descendants: true }, { propertyName: "annotationsComponent", first: true, predicate: VisAnnotationsComponent, descendants: true }, { propertyName: "visComponents", predicate: VisXYComponent }], viewQueries: [{ propertyName: "containerRef", first: true, predicate: ["container"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `<div #container class="unovis-xy-container">
162
197
  <ng-content></ng-content>
163
198
  </div>`, isInline: true, styles: [".unovis-xy-container { width: 100%; height: 100%; position: relative; }"] });
164
199
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: VisXYContainerComponent, decorators: [{
@@ -179,6 +214,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
179
214
  }], tooltipComponent: [{
180
215
  type: ContentChild,
181
216
  args: [VisTooltipComponent]
217
+ }], annotationsComponent: [{
218
+ type: ContentChild,
219
+ args: [VisAnnotationsComponent]
182
220
  }], width: [{
183
221
  type: Input
184
222
  }], height: [{
@@ -258,18 +296,19 @@ class VisSingleContainerComponent {
258
296
  (_b = this.chart) === null || _b === void 0 ? void 0 : _b.updateContainer(this.getConfig());
259
297
  }
260
298
  getConfig() {
261
- var _a, _b;
299
+ var _a, _b, _c;
262
300
  const { width, height, duration, margin, ariaLabel } = this;
263
301
  const component = (_a = this.visComponent) === null || _a === void 0 ? void 0 : _a.component;
264
302
  const tooltip = (_b = this.tooltipComponent) === null || _b === void 0 ? void 0 : _b.component;
265
- return { width, height, duration, margin, component, tooltip, ariaLabel };
303
+ const annotations = (_c = this.annotationsComponent) === null || _c === void 0 ? void 0 : _c.component;
304
+ return { width, height, duration, margin, component, tooltip, ariaLabel, annotations };
266
305
  }
267
306
  ngOnDestroy() {
268
307
  this.chart.destroy();
269
308
  }
270
309
  }
271
310
  VisSingleContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: VisSingleContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
272
- VisSingleContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: VisSingleContainerComponent, selector: "vis-single-container", inputs: { width: "width", height: "height", margin: "margin", duration: "duration", ariaLabel: "ariaLabel", data: "data" }, queries: [{ propertyName: "visComponent", first: true, predicate: VisCoreComponent, descendants: true }, { propertyName: "tooltipComponent", first: true, predicate: VisTooltipComponent, descendants: true }], viewQueries: [{ propertyName: "containerRef", first: true, predicate: ["container"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `<div #container class="unovis-single-container">
311
+ VisSingleContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: VisSingleContainerComponent, selector: "vis-single-container", inputs: { width: "width", height: "height", margin: "margin", duration: "duration", ariaLabel: "ariaLabel", data: "data" }, queries: [{ propertyName: "visComponent", first: true, predicate: VisCoreComponent, descendants: true }, { propertyName: "tooltipComponent", first: true, predicate: VisTooltipComponent, descendants: true }, { propertyName: "annotationsComponent", first: true, predicate: VisAnnotationsComponent, descendants: true }], viewQueries: [{ propertyName: "containerRef", first: true, predicate: ["container"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `<div #container class="unovis-single-container">
273
312
  <ng-content></ng-content>
274
313
  </div>`, isInline: true, styles: [".unovis-single-container { width: 100%; height: 100%; position: relative; }"] });
275
314
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: VisSingleContainerComponent, decorators: [{
@@ -290,6 +329,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
290
329
  }], tooltipComponent: [{
291
330
  type: ContentChild,
292
331
  args: [VisTooltipComponent]
332
+ }], annotationsComponent: [{
333
+ type: ContentChild,
334
+ args: [VisAnnotationsComponent]
293
335
  }], width: [{
294
336
  type: Input
295
337
  }], height: [{
@@ -1342,7 +1384,7 @@ class VisNestedDonutComponent {
1342
1384
  }
1343
1385
  }
1344
1386
  VisNestedDonutComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: VisNestedDonutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1345
- VisNestedDonutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: VisNestedDonutComponent, selector: "vis-nested-donut", inputs: { duration: "duration", events: "events", attributes: "attributes", angleRange: "angleRange", direction: "direction", value: "value", centralLabel: "centralLabel", centralSubLabel: "centralSubLabel", centralSubLabelWrap: "centralSubLabelWrap", showBackground: "showBackground", sort: "sort", layers: "layers", layerSettings: "layerSettings", layerPadding: "layerPadding", cornerRadius: "cornerRadius", emptySegmentAngle: "emptySegmentAngle", hideOverflowingSegmentLabels: "hideOverflowingSegmentLabels", segmentColor: "segmentColor", segmentLabel: "segmentLabel", segmentLabelColor: "segmentLabelColor", showEmptySegments: "showEmptySegments", data: "data" }, providers: [{ provide: VisCoreComponent, useExisting: VisNestedDonutComponent }], usesOnChanges: true, ngImport: i0, template: '', isInline: true });
1387
+ VisNestedDonutComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: VisNestedDonutComponent, selector: "vis-nested-donut", inputs: { duration: "duration", events: "events", attributes: "attributes", angleRange: "angleRange", direction: "direction", value: "value", centralLabel: "centralLabel", centralSubLabel: "centralSubLabel", centralSubLabelWrap: "centralSubLabelWrap", showBackground: "showBackground", sort: "sort", layers: "layers", layerSettings: "layerSettings", layerPadding: "layerPadding", cornerRadius: "cornerRadius", emptySegmentAngle: "emptySegmentAngle", hideOverflowingSegmentLabels: "hideOverflowingSegmentLabels", segmentColor: "segmentColor", segmentLabel: "segmentLabel", segmentLabelColor: "segmentLabelColor", showEmptySegments: "showEmptySegments", showSegmentLabels: "showSegmentLabels", data: "data" }, providers: [{ provide: VisCoreComponent, useExisting: VisNestedDonutComponent }], usesOnChanges: true, ngImport: i0, template: '', isInline: true });
1346
1388
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: VisNestedDonutComponent, decorators: [{
1347
1389
  type: Component,
1348
1390
  args: [{
@@ -1393,6 +1435,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
1393
1435
  type: Input
1394
1436
  }], showEmptySegments: [{
1395
1437
  type: Input
1438
+ }], showSegmentLabels: [{
1439
+ type: Input
1396
1440
  }], data: [{
1397
1441
  type: Input
1398
1442
  }] } });