1- import { Component , ElementRef , Renderer , IterableDiffers , KeyValueDiffers , ChangeDetectorRef } from "@angular/core" ;
1+ import { Component , ElementRef , Renderer , IterableDiffers , KeyValueDiffers , ChangeDetectorRef , Input } from "@angular/core" ;
22import { 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} )
1010export 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