Skip to content

Commit 2d93765

Browse files
committed
Merge remote-tracking branch 'origin/master' into dkamburov/fix-268
2 parents 64fde08 + 6cef52b commit 2d93765

File tree

18 files changed

+1222
-939
lines changed

18 files changed

+1222
-939
lines changed

src/igdatachart/igdatachart.component.ts

Lines changed: 456 additions & 443 deletions
Large diffs are not rendered by default.
Lines changed: 61 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,80 @@
1-
import { Component, ElementRef, Renderer, IterableDiffers, KeyValueDiffers, ChangeDetectorRef } from "@angular/core";
1+
import { Component, ElementRef, Renderer, IterableDiffers, KeyValueDiffers, ChangeDetectorRef, Input } from "@angular/core";
22
import { IgControlBase } from "../igcontrolbase/igcontrolbase";
33

44
@Component({
5-
selector: "ig-doughnut-chart",
6-
template: "<ng-content></ng-content>",
7-
inputs: ["widgetId", "options", "changeDetectionInterval","disabled","create","width","height","tooltipTemplate","maxRecCount","dataSource","dataSourceType","dataSourceUrl","responseTotalRecCountKey","responseDataKey","series","allowSliceSelection","isSurfaceInteractionDisabled","allowSliceExplosion","innerExtent","selectedStyle"],
8-
outputs: ["dataBinding","dataBound","updateTooltip","hideTooltip","tooltipShowing","tooltipShown","tooltipHiding","tooltipHidden","browserNotSupported","sliceClick","holeDimensionsChanged"]
5+
selector: "ig-doughnut-chart",
6+
template: "<ng-content></ng-content>",
7+
inputs: ["widgetId", "options", "changeDetectionInterval", "disabled", "create", "width", "height", "tooltipTemplate", "maxRecCount", "dataSource", "dataSourceType", "dataSourceUrl", "responseTotalRecCountKey", "responseDataKey", "series", "allowSliceSelection", "isSurfaceInteractionDisabled", "allowSliceExplosion", "innerExtent", "selectedStyle"],
8+
outputs: ["dataBinding", "dataBound", "updateTooltip", "hideTooltip", "tooltipShowing", "tooltipShown", "tooltipHiding", "tooltipHidden", "browserNotSupported", "sliceClick", "holeDimensionsChanged"]
99
})
1010
export class IgDoughnutChartComponent extends IgControlBase<IgDoughnutChart> {
11-
constructor(el: ElementRef, renderer: Renderer, differs: IterableDiffers, kvalDiffers: KeyValueDiffers, cdr: ChangeDetectorRef) { super(el, renderer, differs, kvalDiffers, cdr); }
11+
constructor(el: ElementRef, renderer: Renderer, differs: IterableDiffers, kvalDiffers: KeyValueDiffers, cdr: ChangeDetectorRef) { super(el, renderer, differs, kvalDiffers, cdr); }
1212

1313

14+
@Input()
15+
public set dataSource(value: any) {
16+
this._dataSource = value;
17+
const chart = jQuery(this._el).data(this._widgetName);
18+
if (chart) {
19+
jQuery(this._el)[this._widgetName]("option", "dataSource", this._dataSource);
20+
}
21+
};
22+
23+
private _dataSource: any;
24+
1425
ngOnInit() {
15-
Object.defineProperty(this, "dataSource", {
16-
set: this.createSetter("dataSource"),
17-
enumerable: true,
18-
configurable: true
19-
});
26+
if (this._dataSource === null || this._dataSource === undefined) {
27+
this._dataSource = this.options["dataSource"];
28+
}
29+
if (!this.options["dataSource"] && this._dataSource) {
30+
this.options["dataSource"] = this._dataSource;
31+
}
2032
super.ngOnInit();
2133
}
2234

23-
/**
24-
* Adds a new series to the doughnut chart.
25-
*
26-
* @param seriesObj The series object to be added.
27-
*/
28-
public addSeries(seriesObj: Object): void { return; } ;
35+
/**
36+
* Adds a new series to the doughnut chart.
37+
*
38+
* @param seriesObj The series object to be added.
39+
*/
40+
public addSeries(seriesObj: Object): void { return; };
2941

30-
/**
31-
* Removes the specified series from the doughnut chart.
32-
*
33-
* @param seriesObj The series object identifying the series to be removed.
34-
*/
35-
public removeSeries(seriesObj: Object): void { return; } ;
42+
/**
43+
* Removes the specified series from the doughnut chart.
44+
*
45+
* @param seriesObj The series object identifying the series to be removed.
46+
*/
47+
public removeSeries(seriesObj: Object): void { return; };
3648

37-
/**
38-
* Updates the series with the specified name with the specified new property values.
39-
*
40-
* @param value The series object identifying the series to be updated.
41-
*/
42-
public updateSeries(value: Object): void { return; } ;
49+
/**
50+
* Updates the series with the specified name with the specified new property values.
51+
*
52+
* @param value The series object identifying the series to be updated.
53+
*/
54+
public updateSeries(value: Object): void { return; };
4355

44-
/**
45-
* Returns the center of the doughnut chart.
46-
*/
47-
public getCenterCoordinates(): Object { return; } ;
56+
/**
57+
* Returns the center of the doughnut chart.
58+
*/
59+
public getCenterCoordinates(): Object { return; };
4860

49-
/**
50-
* Returns the radius of the chart's hole.
51-
*/
52-
public getHoleRadius(): number { return; } ;
61+
/**
62+
* Returns the radius of the chart's hole.
63+
*/
64+
public getHoleRadius(): number { return; };
5365

54-
/**
55-
* Returns information about how the doughnut chart is rendered.
56-
*/
57-
public exportVisualData(): Object { return; } ;
66+
/**
67+
* Returns information about how the doughnut chart is rendered.
68+
*/
69+
public exportVisualData(): Object { return; };
5870

59-
/**
60-
* Causes all of the series that have pending changes e.g. by changed property values to be rendered immediately.
61-
*/
62-
public flush(): void { return; } ;
71+
/**
72+
* Causes all of the series that have pending changes e.g. by changed property values to be rendered immediately.
73+
*/
74+
public flush(): void { return; };
6375

64-
/**
65-
* Destroys the widget.
66-
*/
67-
public destroy(): void { return; } ;
76+
/**
77+
* Destroys the widget.
78+
*/
79+
public destroy(): void { return; };
6880
}
Lines changed: 60 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,69 @@
1-
import { Component, ElementRef, Renderer, IterableDiffers, KeyValueDiffers, ChangeDetectorRef } from "@angular/core";
1+
import { Component, ElementRef, Renderer, IterableDiffers, KeyValueDiffers, ChangeDetectorRef, Input } from "@angular/core";
22
import { IgControlBase } from "../igcontrolbase/igcontrolbase";
33

44
@Component({
5-
selector: "ig-funnel-chart",
6-
template: "<ng-content></ng-content>",
7-
inputs: ["widgetId", "options", "changeDetectionInterval","disabled","create","width","height","tooltipTemplate","maxRecCount","dataSource","dataSourceType","dataSourceUrl","responseTotalRecCountKey","responseDataKey","bezierPoints","legend","valueMemberPath","brushes","outlines","bottomEdgeWidth","innerLabelMemberPath","outerLabelMemberPath","innerLabelVisibility","outerLabelVisibility","outerLabelAlignment","funnelSliceDisplay","formatInnerLabel","formatOuterLabel","transitionDuration","isInverted","useBezierCurve","allowSliceSelection","useUnselectedStyle","selectedSliceStyle","unselectedSliceStyle","legendItemBadgeTemplate","useOuterLabelsForLegend","textStyle","outerLabelTextStyle","outlineThickness","pixelScalingRatio","outerLabelTextColor","textColor"],
8-
outputs: ["dataBinding","dataBound","updateTooltip","hideTooltip","sliceClicked"]
5+
selector: "ig-funnel-chart",
6+
template: "<ng-content></ng-content>",
7+
inputs: ["widgetId", "options", "changeDetectionInterval", "disabled", "create", "width", "height", "tooltipTemplate", "maxRecCount", "dataSource", "dataSourceType", "dataSourceUrl", "responseTotalRecCountKey", "responseDataKey", "bezierPoints", "legend", "valueMemberPath", "brushes", "outlines", "bottomEdgeWidth", "innerLabelMemberPath", "outerLabelMemberPath", "innerLabelVisibility", "outerLabelVisibility", "outerLabelAlignment", "funnelSliceDisplay", "formatInnerLabel", "formatOuterLabel", "transitionDuration", "isInverted", "useBezierCurve", "allowSliceSelection", "useUnselectedStyle", "selectedSliceStyle", "unselectedSliceStyle", "legendItemBadgeTemplate", "useOuterLabelsForLegend", "textStyle", "outerLabelTextStyle", "outlineThickness", "pixelScalingRatio", "outerLabelTextColor", "textColor"],
8+
outputs: ["dataBinding", "dataBound", "updateTooltip", "hideTooltip", "sliceClicked"]
99
})
1010
export class IgFunnelChartComponent extends IgControlBase<IgFunnelChart> {
11-
constructor(el: ElementRef, renderer: Renderer, differs: IterableDiffers, kvalDiffers: KeyValueDiffers, cdr: ChangeDetectorRef) { super(el, renderer, differs, kvalDiffers, cdr); }
12-
13-
ngOnInit() {
14-
Object.defineProperty(this, "dataSource", {
15-
set: this.createSetter("dataSource"),
16-
enumerable: true,
17-
configurable: true
18-
});
11+
constructor(el: ElementRef, renderer: Renderer, differs: IterableDiffers, kvalDiffers: KeyValueDiffers, cdr: ChangeDetectorRef) { super(el, renderer, differs, kvalDiffers, cdr); }
12+
13+
@Input()
14+
public set dataSource(value: any) {
15+
this._dataSource = value;
16+
const chart = jQuery(this._el).data(this._widgetName);
17+
if (chart) {
18+
jQuery(this._el)[this._widgetName]("option", "dataSource", this._dataSource);
19+
}
20+
};
21+
22+
private _dataSource: any;
23+
24+
ngOnInit() {
25+
if (this._dataSource === null || this._dataSource === undefined) {
26+
this._dataSource = this.options["dataSource"];
27+
}
28+
if (!this.options["dataSource"] && this._dataSource) {
29+
this.options["dataSource"] = this._dataSource;
30+
}
1931
super.ngOnInit();
2032
}
2133

22-
/**
23-
* Gets array of selected slice items.
24-
*
25-
* @param selection Array or selected slice items.
26-
* @return array|object If parameter is undefined, then array of selected items is returned. Otherwise, it returns reference to igFunnelChart.
27-
*/
28-
public selectedSliceItems(selection?: any[]): any[] { return; } ;
29-
30-
/**
31-
* Gets sets array of indexes of selected slices.
32-
*
33-
* @param selection Array or selected slice indexes.
34-
* @return array|object If parameter is undefined, then array of selected indexes is returned. Otherwise, it returns reference to igFunnelChart.
35-
*/
36-
public selectedSliceIndexes(selection?: any[]): any[] { return; } ;
37-
38-
/**
39-
* Checks if slice is selected.
40-
*
41-
* @param slice Index of slice or reference to slice-data-item.
42-
*/
43-
public isSelected(slice: Object): boolean { return; } ;
44-
45-
/**
46-
* Toggles selected state of slice.
47-
*
48-
* @param slice Index of slice or reference to slice-data-item.
49-
*/
50-
public toggleSelection(slice: Object): Object { return; } ;
51-
public exportVisualData(): void { return; } ;
52-
53-
/**
54-
* Destroys widget.
55-
*/
56-
public destroy(): void { return; } ;
34+
/**
35+
* Gets array of selected slice items.
36+
*
37+
* @param selection Array or selected slice items.
38+
* @return array|object If parameter is undefined, then array of selected items is returned. Otherwise, it returns reference to igFunnelChart.
39+
*/
40+
public selectedSliceItems(selection?: any[]): any[] { return; };
41+
42+
/**
43+
* Gets sets array of indexes of selected slices.
44+
*
45+
* @param selection Array or selected slice indexes.
46+
* @return array|object If parameter is undefined, then array of selected indexes is returned. Otherwise, it returns reference to igFunnelChart.
47+
*/
48+
public selectedSliceIndexes(selection?: any[]): any[] { return; };
49+
50+
/**
51+
* Checks if slice is selected.
52+
*
53+
* @param slice Index of slice or reference to slice-data-item.
54+
*/
55+
public isSelected(slice: Object): boolean { return; };
56+
57+
/**
58+
* Toggles selected state of slice.
59+
*
60+
* @param slice Index of slice or reference to slice-data-item.
61+
*/
62+
public toggleSelection(slice: Object): Object { return; };
63+
public exportVisualData(): void { return; };
64+
65+
/**
66+
* Destroys widget.
67+
*/
68+
public destroy(): void { return; };
5769
}

0 commit comments

Comments
 (0)