diff --git a/src/igcontrolbase/igcontrolbase.ts b/src/igcontrolbase/igcontrolbase.ts index b3e4d91..b128040 100644 --- a/src/igcontrolbase/igcontrolbase.ts +++ b/src/igcontrolbase/igcontrolbase.ts @@ -3,184 +3,184 @@ import { ElementRef, EventEmitter, Renderer, IterableDiffers, DoCheck, SimpleCha declare var jQuery: any; var NODES = { - "ig-text-editor": "div", - "ig-numeric-editor": "input", - "ig-percent-editor": "input", - "ig-mask-editor": "input", - "ig-date-picker": "input", - "ig-time-picker": "input", - "ig-date-editor": "input", - "ig-currency-editor": "input", - "ig-checkbox-editor": "input", - "ig-html-editor": "div", - "ig-combo": "input", - "ig-grid": "table", - "ig-tree-grid": "table", - "ig-hierarchical-grid": "table", - "ig-pivot-data-selector": "div", - "ig-pivot-grid": "table", - "ig-data-chart": "div", - "ig-pie-chart": "div", - "ig-doughnut-chart": "div", - "ig-funnel-chart": "div", - "ig-radial-gauge": "div", - "ig-sparkline": "div", - "ig-zoombar": "div", - "ig-map": "div", - "ig-bullet-graph": "div", - "ig-linear-gauge": "div", - "ig-q-r-code-barcode": "div", - "ig-validator": "div", - "ig-upload": "div", - "ig-popover": "div", - "ig-rating": "div", - "ig-video-player": "div", - "ig-radial-menu": "div", - "ig-split-button": "div", - "ig-notifier": "div", - "ig-tree": "div", - "ig-dialog": "div", - "ig-splitter": "div", - "ig-layout-manager": "div", - "ig-tile-manager": "div", - "ig-spreadsheet": "div", - "ig-scheduler": "div" + "ig-text-editor": "div", + "ig-numeric-editor": "input", + "ig-percent-editor": "input", + "ig-mask-editor": "input", + "ig-date-picker": "input", + "ig-time-picker": "input", + "ig-date-editor": "input", + "ig-currency-editor": "input", + "ig-checkbox-editor": "input", + "ig-html-editor": "div", + "ig-combo": "input", + "ig-grid": "table", + "ig-tree-grid": "table", + "ig-hierarchical-grid": "table", + "ig-pivot-data-selector": "div", + "ig-pivot-grid": "table", + "ig-data-chart": "div", + "ig-pie-chart": "div", + "ig-doughnut-chart": "div", + "ig-funnel-chart": "div", + "ig-radial-gauge": "div", + "ig-sparkline": "div", + "ig-zoombar": "div", + "ig-map": "div", + "ig-bullet-graph": "div", + "ig-linear-gauge": "div", + "ig-q-r-code-barcode": "div", + "ig-validator": "div", + "ig-upload": "div", + "ig-popover": "div", + "ig-rating": "div", + "ig-video-player": "div", + "ig-radial-menu": "div", + "ig-split-button": "div", + "ig-notifier": "div", + "ig-tree": "div", + "ig-dialog": "div", + "ig-splitter": "div", + "ig-layout-manager": "div", + "ig-tile-manager": "div", + "ig-spreadsheet": "div", + "ig-scheduler": "div" }; export class IgControlBase implements DoCheck { - @Input() - public options:any = {}; + @Input() + public options: any = {}; - protected _differs: any; - protected _el: any; - protected _widgetName: string; - protected _differ: any; - protected _optsDiffer: any; - protected _kvalDiffers:any; - protected _events: Map; - private _evtEmmiters : any = {}; - private _nativeElement:any; - public widgetId: string; + protected _differs: any; + protected _el: any; + protected _widgetName: string; + protected _differ: any; + protected _optsDiffer: any; + protected _kvalDiffers: any; + protected _events: Map; + private _evtEmmiters: any = {}; + private _nativeElement: any; + public widgetId: string; - constructor(el: ElementRef, renderer: Renderer, differs: IterableDiffers, public kvalDiffers: KeyValueDiffers, public cdr: ChangeDetectorRef) { - this._differs = differs; - this._nativeElement = el.nativeElement; - this._widgetName = this.convertToCamelCase(el.nativeElement.nodeName.toLowerCase());//ig-grid -> igGrid - this._el = el.nativeElement.appendChild(document.createElement(NODES[el.nativeElement.nodeName.toLowerCase()])); + constructor(el: ElementRef, renderer: Renderer, differs: IterableDiffers, public kvalDiffers: KeyValueDiffers, public cdr: ChangeDetectorRef) { + this._differs = differs; + this._nativeElement = el.nativeElement; + this._widgetName = this.convertToCamelCase(el.nativeElement.nodeName.toLowerCase());//ig-grid -> igGrid + this._el = el.nativeElement.appendChild(document.createElement(NODES[el.nativeElement.nodeName.toLowerCase()])); - for (var propt in jQuery.ui[this._widgetName].prototype.events) { - this[propt] = new EventEmitter(); - //cahcing the event emmitters for cases when the event name is the same as a method name. - this._evtEmmiters[propt] = this[propt]; - } - } + for (var propt in jQuery.ui[this._widgetName].prototype.events) { + this[propt] = new EventEmitter(); + //cahcing the event emmitters for cases when the event name is the same as a method name. + this._evtEmmiters[propt] = this[propt]; + } + } - createSetter(name) { - return function (value) { - this.options[name] = value; - if (this._config) { - this._config[name] = value; - } - if (jQuery.ui[this._widgetName] && - jQuery.ui[this._widgetName].prototype.options && - jQuery.ui[this._widgetName].prototype.options.hasOwnProperty(name) && - jQuery(this._el).data(this._widgetName)) { - jQuery(this._el)[this._widgetName]("option", name, value); - } - } - } + createSetter(name) { + return function (value) { + this.options[name] = value; + if (this._config) { + this._config[name] = value; + } + if (jQuery.ui[this._widgetName] && + jQuery.ui[this._widgetName].prototype.options && + jQuery.ui[this._widgetName].prototype.options.hasOwnProperty(name) && + jQuery(this._el).data(this._widgetName)) { + jQuery(this._el)[this._widgetName]("option", name, value); + } + } + } - ngOnInit() { - var evtName; - let that = this; - this._events = new Map(); - - for (var opt in jQuery.ui[this._widgetName].prototype.options) { - //copy root level options into this.options - if(this[opt] && typeof this[opt] !== "function"){ - this.options[opt] = this[opt]; - } - } + ngOnInit() { + var evtName; + let that = this; + this._events = new Map(); - for (var opt in jQuery.ui[this._widgetName].prototype.options) { - if(opt !== "dataSource") { - Object.defineProperty(this, opt, { - set: this.createSetter(opt), - enumerable: true, - configurable: true - }); - } - } + for (var opt in jQuery.ui[this._widgetName].prototype.options) { + //copy root level options into this.options + if (this[opt] && typeof this[opt] !== "function") { + this.options[opt] = this[opt]; + } + } - var propNames = jQuery.ui[this._widgetName].prototype; - for(var name in propNames ) { - if(name.indexOf("_") !== 0 && typeof jQuery.ui[this._widgetName].prototype[name] === "function" - && name !== "dataSource"){ + for (var opt in jQuery.ui[this._widgetName].prototype.options) { + if (opt !== "dataSource") { + Object.defineProperty(this, opt, { + set: this.createSetter(opt), + enumerable: true, + configurable: true + }); + } + } + + var propNames = jQuery.ui[this._widgetName].prototype; + for (var name in propNames) { + if (name.indexOf("_") !== 0 && typeof jQuery.ui[this._widgetName].prototype[name] === "function" + && name !== "dataSource") { Object.defineProperty(that, name, { get: that.createMethodGetter(name) }); } - } - //events binding - for (var propt in jQuery.ui[this._widgetName].prototype.events) { - evtName = this._widgetName.toLowerCase() + propt.toLowerCase(); - this._events[evtName] = propt; - jQuery(this._el).on(evtName, function (evt, ui) { - var emmiter = that._evtEmmiters[that._events[evt.type]]; - emmiter.emit({ event: evt, ui: ui }); - }); - } + } + //events binding + for (var propt in jQuery.ui[this._widgetName].prototype.events) { + evtName = this._widgetName.toLowerCase() + propt.toLowerCase(); + this._events[evtName] = propt; + jQuery(this._el).on(evtName, function (evt, ui) { + var emmiter = that._evtEmmiters[that._events[evt.type]]; + emmiter.emit({ event: evt, ui: ui }); + }); + } - jQuery(this._el).attr("id", this.widgetId); - jQuery(this._el)[this._widgetName](this.options); - } - createMethodGetter(name) { - return function () { - var widget = jQuery(this._el).data(this._widgetName); - return jQuery.proxy(widget[name], widget); - } - } + jQuery(this._el).attr("id", this.widgetId); + jQuery(this._el)[this._widgetName](this.options); + } + createMethodGetter(name) { + return function () { + var widget = jQuery(this._el).data(this._widgetName); + return jQuery.proxy(widget[name], widget); + } + } - ngDoCheck() { - if (this._optsDiffer) { + ngDoCheck() { + if (this._optsDiffer) { const changes = this._optsDiffer.diff(this.options); if (changes) { - changes.forEachChangedItem((change: any) => { - this[change.key] = change.currentValue; - }); + changes.forEachChangedItem((change: any) => { + this[change.key] = change.currentValue; + }); } } - } - public ngOnChanges(changes: SimpleChanges): void { - const opts = "options"; + } + public ngOnChanges(changes: SimpleChanges): void { + const opts = "options"; if (opts in changes) { - const value = changes[opts].currentValue; - //options have been changed. Destroy and re-create widget. - if(jQuery(this._el).data(this._widgetName)){ - jQuery(this._el)[this._widgetName]("destroy"); - jQuery(this._el)[this._widgetName](this.options); - } - try { + const value = changes[opts].currentValue; + //options have been changed. Destroy and re-create widget. + if (jQuery(this._el).data(this._widgetName)) { + jQuery(this._el)[this._widgetName]("destroy"); + jQuery(this._el)[this._widgetName](this.options); + } + try { this._optsDiffer = this.kvalDiffers.find({}).create(); } catch (e) { - throw new Error("Only binding to object is supported for options property."); - } - } - } - public markForCheck(){ - this.cdr.markForCheck(); - } + throw new Error("Only binding to object is supported for options property."); + } + } + } + public markForCheck() { + this.cdr.markForCheck(); + } - convertToCamelCase(str) { - //convert hyphen to camelCase - return str.replace(/-([a-z])/g, function (group) { - return group[1].toUpperCase(); - }); - } + convertToCamelCase(str) { + //convert hyphen to camelCase + return str.replace(/-([a-z])/g, function (group) { + return group[1].toUpperCase(); + }); + } - ngOnDestroy() { - jQuery(this._el)[this._widgetName]("destroy"); - jQuery(this._el).remove(); - jQuery(this._nativeElement).remove(); - } + ngOnDestroy() { + jQuery(this._el)[this._widgetName]("destroy"); + jQuery(this._el).remove(); + jQuery(this._nativeElement).remove(); + } } \ No newline at end of file diff --git a/src/igdatachart/igdatachart.component.ts b/src/igdatachart/igdatachart.component.ts index 37fbe44..b5c6ff1 100644 --- a/src/igdatachart/igdatachart.component.ts +++ b/src/igdatachart/igdatachart.component.ts @@ -1,456 +1,469 @@ -import { Component, ElementRef, Renderer, IterableDiffers, KeyValueDiffers, ChangeDetectorRef } from "@angular/core"; +import { Component, ElementRef, Renderer, IterableDiffers, KeyValueDiffers, ChangeDetectorRef, Input } from "@angular/core"; import { IgControlBase } from "../igcontrolbase/igcontrolbase"; @Component({ - selector: "ig-data-chart", - template: "", - inputs: ["widgetId", "options", "changeDetectionInterval","disabled","create","isPagePanningAllowed","syncChannel","synchronizeVertically","synchronizeHorizontally","crosshairPoint","windowRect","horizontalZoomable","verticalZoomable","windowResponse","windowRectMinWidth","overviewPlusDetailPaneVisibility","crosshairVisibility","plotAreaBackground","defaultInteraction","dragModifier","panModifier","previewRect","windowPositionHorizontal","windowPositionVertical","windowScaleHorizontal","windowScaleVertical","circleMarkerTemplate","triangleMarkerTemplate","pyramidMarkerTemplate","squareMarkerTemplate","diamondMarkerTemplate","pentagonMarkerTemplate","hexagonMarkerTemplate","tetragramMarkerTemplate","pentagramMarkerTemplate","hexagramMarkerTemplate","topMargin","leftMargin","rightMargin","bottomMargin","autoMarginWidth","autoMarginHeight","isSquare","gridMode","brushes","markerBrushes","outlines","markerOutlines","width","height","size","dataSource","dataSourceUrl","dataSourceType","responseDataKey","isSurfaceInteractionDisabled","animateSeriesWhenAxisRangeChanges","title","subtitle","titleTextStyle","titleTopMargin","titleLeftMargin","titleRightMargin","titleBottomMargin","subtitleTextStyle","subtitleTopMargin","subtitleLeftMargin","subtitleRightMargin","subtitleBottomMargin","titleTextColor","subtitleTextColor","titleHorizontalAlignment","subtitleHorizontalAlignment","highlightingTransitionDuration","useTiledZooming","preferHigherResolutionTiles","pixelScalingRatio","zoomTileCacheSize","contentHitTestMode","legend","axes","series","theme"], - outputs: ["tooltipShowing","tooltipShown","tooltipHiding","tooltipHidden","browserNotSupported","seriesCursorMouseMove","seriesMouseLeftButtonDown","seriesMouseLeftButtonUp","seriesMouseMove","seriesMouseEnter","seriesMouseLeave","windowRectChanged","gridAreaRectChanged","refreshCompleted","axisRangeChanged","typicalBasedOn","progressiveLoadStatusChanged","assigningCategoryStyle","assigningCategoryMarkerStyle"] + selector: "ig-data-chart", + template: "", + inputs: ["widgetId", "options", "changeDetectionInterval","disabled","create","isPagePanningAllowed","syncChannel","synchronizeVertically","synchronizeHorizontally","crosshairPoint","windowRect","horizontalZoomable","verticalZoomable","windowResponse","windowRectMinWidth","overviewPlusDetailPaneVisibility","crosshairVisibility","plotAreaBackground","defaultInteraction","dragModifier","panModifier","previewRect","windowPositionHorizontal","windowPositionVertical","windowScaleHorizontal","windowScaleVertical","circleMarkerTemplate","triangleMarkerTemplate","pyramidMarkerTemplate","squareMarkerTemplate","diamondMarkerTemplate","pentagonMarkerTemplate","hexagonMarkerTemplate","tetragramMarkerTemplate","pentagramMarkerTemplate","hexagramMarkerTemplate","topMargin","leftMargin","rightMargin","bottomMargin","autoMarginWidth","autoMarginHeight","isSquare","gridMode","brushes","markerBrushes","outlines","markerOutlines","width","height","size","dataSource","dataSourceUrl","dataSourceType","responseDataKey","isSurfaceInteractionDisabled","animateSeriesWhenAxisRangeChanges","title","subtitle","titleTextStyle","titleTopMargin","titleLeftMargin","titleRightMargin","titleBottomMargin","subtitleTextStyle","subtitleTopMargin","subtitleLeftMargin","subtitleRightMargin","subtitleBottomMargin","titleTextColor","subtitleTextColor","titleHorizontalAlignment","subtitleHorizontalAlignment","highlightingTransitionDuration","useTiledZooming","preferHigherResolutionTiles","pixelScalingRatio","zoomTileCacheSize","contentHitTestMode","legend","axes","series","theme"], + outputs: ["tooltipShowing","tooltipShown","tooltipHiding","tooltipHidden","browserNotSupported","seriesCursorMouseMove","seriesMouseLeftButtonDown","seriesMouseLeftButtonUp","seriesMouseMove","seriesMouseEnter","seriesMouseLeave","windowRectChanged","gridAreaRectChanged","refreshCompleted","axisRangeChanged","typicalBasedOn","progressiveLoadStatusChanged","assigningCategoryStyle","assigningCategoryMarkerStyle"] }) export class IgDataChartComponent extends IgControlBase { - constructor(el: ElementRef, renderer: Renderer, differs: IterableDiffers, kvalDiffers: KeyValueDiffers, cdr: ChangeDetectorRef) { super(el, renderer, differs, kvalDiffers, cdr); } + constructor(el: ElementRef, renderer: Renderer, differs: IterableDiffers, kvalDiffers: KeyValueDiffers, cdr: ChangeDetectorRef) { super(el, renderer, differs, kvalDiffers, cdr); } + + + @Input() + public set dataSource(value: any) { + this._dataSource = value; + const chart = jQuery(this._el).data(this._widgetName); + if (chart) { + jQuery(this._el)[this._widgetName]("option", "dataSource", this._dataSource); + } + }; + + private _dataSource: any; ngOnInit() { - Object.defineProperty(this, "dataSource", { - set: this.createSetter("dataSource"), - enumerable: true, - configurable: true - }); + if (this._dataSource === null || this._dataSource === undefined) { + this._dataSource = this.options["dataSource"]; + } + if (!this.options["dataSource"] && this._dataSource) { + this.options["dataSource"] = this._dataSource; + } super.ngOnInit(); } public option(): void { return; } ; - /** - * Returns the element holding the chart. - */ - public widget(): void { return; } ; - - /** - * Returns the ID of parent element holding the chart. - */ - public id(): string { return; } ; - - /** - * Exports the chart to a PNG image. - * - * @param width The width of the image. - * @param height The height of the image. - */ - public exportImage(width?: Object, height?: Object): Object { return; } ; - - /** - * Destroys the widget. - */ - public destroy(): void { return; } ; - - /** - * Notify the chart that styles it draws colors from may have been updated. - */ - public styleUpdated(): Object { return; } ; - - /** - * Resets the zoom level of the chart to default. - */ - public resetZoom(): Object { return; } ; - - /** - * Adds a new item to the data source and notifies the chart. - * - * @param item The item that we want to add to the data source. - * @param targetName The name of the series or axis bound to the data source. This is required only when the data is bound to series or axis. If the data is bound to dataSource of igDataChart, the second parameter should not be set. - */ - public addItem(item: Object, targetName: string): void { return; } ; - - /** - * Inserts a new item to the data source and notifies the chart. - * - * @param item the new item that we want to insert in the data source. - * @param index The index in the data source where the new item will be inserted. - * @param targetName The name of the series or axis bound to the data source. - */ - public insertItem(item: Object, index: number, targetName: string): void { return; } ; - - /** - * Deletes an item from the data source and notifies the chart. - * - * @param index The index in the data source from where the item will be been removed. - * @param targetName The name of the series or axis bound to the data source. This is required only when the data is bound to series or axis. If the data is bound to dataSource of igDataChart, the second parameter should not be set. - */ - public removeItem(index: number, targetName: string): void { return; } ; - - /** - * Updates an item in the data source and notifies the chart. - * - * @param index The index of the item in the data source that we want to change. - * @param item The new item object that will be set in the data source. - * @param targetName The name of the series or axis bound to the data source. - */ - public setItem(index: number, item: Object, targetName: string): void { return; } ; - - /** - * Notifies the chart that an item has been set in an associated data source. - * - * @param dataSource The data source in which the change happened. - * @param index The index in the items source that has been changed. - * @param newItem the new item that has been set in the collection. - * @param oldItem the old item that has been overwritten in the collection. - */ - public notifySetItem(dataSource: Object, index: number, newItem: Object, oldItem: Object): Object { return; } ; - - /** - * Notifies the chart that the items have been cleared from an associated data source. - * It's not necessary to notify more than one target of a change if they share the same items source. - * - * @param dataSource The data source in which the change happened. - */ - public notifyClearItems(dataSource: Object): Object { return; } ; - - /** - * Notifies the target axis or series that an item has been inserted at the specified index in its data source. - * It's not necessary to notify more than one target of a change if they share the same items source. - * - * @param dataSource The data source in which the change happened. - * @param index The index in the items source where the new item has been inserted. - * @param newItem the new item that has been set in the collection. - */ - public notifyInsertItem(dataSource: Object, index: number, newItem: Object): Object { return; } ; - - /** - * Notifies the target axis or series that an item has been removed from the specified index in its data source. - * It's not necessary to notify more than one target of a change if they share the same items source. - * - * @param dataSource The data source in which the change happened. - * @param index The index in the items source from where the old item has been removed. - * @param oldItem the old item that has been removed from the collection. - */ - public notifyRemoveItem(dataSource: Object, index: number, oldItem: Object): Object { return; } ; - - /** - * Notifies the target axis or series that it should scroll the requested data item into view. - * - * @param targetName The name of the axis or series notify. - * @param item The data item to bring into view, if possible. - */ - public scrollIntoView(targetName: string, item: Object): Object { return; } ; - - /** - * Notifies the target axis that it should scale the requested value into chart space from axis space. - * For example you can use this method if you want to find where value 50 of the x axis stands scaled to chart's width. - * - * @param targetName The name of the axis to notify. - * @param unscaledValue The value in axis space to translate into chart space. - */ - public scaleValue(targetName: string, unscaledValue: number): number { return; } ; - - /** - * Notifies the target axis that it should unscale the requested value into axis space from chart space. - * For example you can use this method if you want to find what is the value of x axis unscaled from 0 width of the chart. - * - * @param targetName The name of the axis to notify. - * @param scaledValue The value in chart space to translate into axis space. - */ - public unscaleValue(targetName: string, scaledValue: number): number { return; } ; - - /** - * For the target axis, if using enhanced interval management and precise interval fitting, this will reset the cached maximum label width, and recalculate using the current labels. - * - * @param targetName The name of the axis to notify. - */ - public resetCachedEnhancedInterval(targetName: string): Object { return; } ; - - /** - * Notifies the target series that something that affects its visual properties has changed and the visual output needs a repaint. - * - * @param targetName The name of the series to notify. - */ - public notifyVisualPropertiesChanged(targetName: string): Object { return; } ; - - /** - * Forces any pending deferred work to render on the chart before continuing - */ - public flush(): void { return; } ; - - /** - * Exports visual data from the chart to aid in unit testing - */ - public exportVisualData(): void { return; } ; - - /** - * Gets the actual minimum value of the target numeric or date time axis - * - * @param targetName The name of the axis from which to get the minimum value. - */ - public getActualMinimumValue(targetName: string): void { return; } ; - - /** - * Gets the actual maximum value of the target numeric or date time axis - * - * @param targetName The name of the axis from which to get the maximum value. - */ - public getActualMaximumValue(targetName: string): void { return; } ; - - /** - * Gets the actual interval of the target numeric or date time axis - * - * @param targetName The name of the axis from which to get the interval. - */ - public getActualInterval(targetName: string): void { return; } ; - - /** - * Creates a print preview page with the chart, hiding all other elements on the page. - */ - public print(): void { return; } ; - - /** - * Indicates that a series should render, even though no option has been modified that would normally cause it to refresh. - * - * @param targetName The name of the series to render. - * @param animate Whether the change should be animated, if possible. - */ - public renderSeries(targetName: string, animate: boolean): void { return; } ; - - /** - * Gets the item item index associated with the specified world position. - * - * @param targetName The name of the series to target. - * @param worldPoint The world position (in the form {x: [number from 0 to 1], y: [number from 0 to 1]} ) that represents a position in the space of the axes. - */ - public getItemIndex(targetName: string, worldPoint: Object): number { return; } ; - - /** - * Gets the item that is the best match for the specified world coordinates. - * - * @param targetName The name of the series to target. - * @param worldPoint The world position (in the form {x: [number from 0 to 1], y: [number from 0 to 1]} ) that represents a position in the space of the axes. - */ - public getItem(targetName: string, worldPoint: Object): Object { return; } ; - - /** - * For a category plotted series, gets the current width of the items within the categories. This only returns a value if the items have some form of width (e.g. columns, bars, etc.) otherwise 0 is returned. - * - * @param targetName The name of the series to target. - */ - public getItemSpan(targetName: string): number { return; } ; - - /** - * If possible, will return the best available main value of the series for a given world coordinate. - * - * @param targetName The name of the series to target. - * @param worldPoint The world position (in the form {x: [number from 0 to 1], y: [number from 0 to 1]} ) that represents a position in the space of the axes. - * @param useInterpolation If true, interpolation should be used to get in-between values, rather than only the actual values in the data set. - * @param skipUnknowns If true, unknown values should be skipped. - */ - public getSeriesValue(targetName: string, worldPoint: Object, useInterpolation: boolean, skipUnknowns: boolean): number { return; } ; - - /** - * If possible, will return the best available value bounding box within the series that has the best value match for the world position provided. - * - * @param targetName The name of the series to target. - * @param worldPoint The world position (in the form {x: [number from 0 to 1], y: [number from 0 to 1]} ) that represents a position in the space of the axes. - */ - public getSeriesValueBoundingBox(targetName: string, worldPoint: Object): Object { return; } ; - - /** - * If possible, will return the best available value fine grained bounding boxes within the series that have the best value match for the world position provided. - * - * @param targetName The name of the series to target. - * @param worldPoint The world position (in the form {x: [number from 0 to 1], y: [number from 0 to 1]} ) that represents a position in the space of the axes. - */ - public getSeriesValueFineGrainedBoundingBoxes(targetName: string, worldPoint: Object): Object { return; } ; - - /** - * If possible, will return the best available main value position of the series for a given world coordinate. - * - * @param targetName The name of the series to target. - * @param worldPoint The world position (in the form {x: [number from 0 to 1], y: [number from 0 to 1]} ) that represents a position in the space of the axes. - * @param useInterpolation If true, interpolation should be used to get in-between values, rather than only the actual values in the data set. - * @param skipUnknowns If true, unknown values should be skipped. - */ - public getSeriesValuePosition(targetName: string, worldPoint: Object, useInterpolation: boolean, skipUnknowns: boolean): Object { return; } ; - - /** - * If possible, will return the best available main value position of the series for a given world coordinate. - * - * @param targetName The name of the series to target. - * @param seriesPoint The series pixel position (in the form {x: [number], y: [number]} that represents a position within the pixel space of the series. - * @param useInterpolation If true, interpolation should be used to get in-between values, rather than only the actual values in the data set. - * @param skipUnknowns If true, unknown values should be skipped. - */ - public getSeriesValuePositionFromSeriesPixel(targetName: string, seriesPoint: Object, useInterpolation: boolean, skipUnknowns: boolean): Object { return; } ; - - /** - * If possible, will return the best available main value of the series for a given world coordinate. - * - * @param targetName The name of the series to target. - * @param seriesPoint The series pixel position (in the form {x: [number], y: [number]} ) that represents a position in the pixel space of the series. - * @param useInterpolation If true, interpolation should be used to get in-between values, rather than only the actual values in the data set. - * @param skipUnknowns If true, unknown values should be skipped. - */ - public getSeriesValueFromSeriesPixel(targetName: string, seriesPoint: Object, useInterpolation: boolean, skipUnknowns: boolean): number { return; } ; - - /** - * If possible, will return the best available value bounding box within the series that has the best value match for the given series pixel coordinate. - * - * @param targetName The name of the series to target. - * @param seriesPoint The series pixel position (in the form {x: [number], y: [number]} ) that represents a position in the pixel space of the series. - */ - public getSeriesValueBoundingBoxFromSeriesPixel(targetName: string, seriesPoint: Object): Object { return; } ; - - /** - * If possible, will return the best available value fine grained bounding boxes within the series that have the best value match for series pixel position provided. - * - * @param targetName The name of the series to target. - * @param worldPoint The series pixel position (in the form {x: [number], y: [number]} ) that represents a position in the pixel space of the series. - */ - public getSeriesValueFineGrainedBoundingBoxesFromSeriesPixel(targetName: string, worldPoint: Object): Object { return; } ; - - /** - * If possible, will return the best available high value of the series for a given world coordinate. - * - * @param targetName The name of the series to target. - * @param worldPoint The world position (in the form {x: [number from 0 to 1], y: [number from 0 to 1]} ) that represents a position in the space of the axes. - * @param useInterpolation If true, interpolation should be used to get in-between values, rather than only the actual values in the data set. - * @param skipUnknowns If true, unknown values should be skipped. - */ - public getSeriesHighValue(targetName: string, worldPoint: Object, useInterpolation: boolean, skipUnknowns: boolean): number { return; } ; - - /** - * If possible, will return the best available high value position of the series for a given world coordinate. - * - * @param targetName The name of the series to target. - * @param worldPoint The world position (in the form {x: [number from 0 to 1], y: [number from 0 to 1]} ) that represents a position in the space of the axes. - * @param useInterpolation If true, interpolation should be used to get in-between values, rather than only the actual values in the data set. - * @param skipUnknowns If true, unknown values should be skipped. - */ - public getSeriesHighValuePosition(targetName: string, worldPoint: Object, useInterpolation: boolean, skipUnknowns: boolean): Object { return; } ; - - /** - * If possible, will return the best available high value position of the series for a given world coordinate. - * - * @param targetName The name of the series to target. - * @param seriesPoint The series pixel position (in the form {x: [number], y: [number]} that represents a position within the pixel space of the series. - * @param useInterpolation If true, interpolation should be used to get in-between values, rather than only the actual values in the data set. - * @param skipUnknowns If true, unknown values should be skipped. - */ - public getSeriesHighValuePositionFromSeriesPixel(targetName: string, seriesPoint: Object, useInterpolation: boolean, skipUnknowns: boolean): Object { return; } ; - - /** - * If possible, will return the best available high value of the series for a given world coordinate. - * - * @param targetName The name of the series to target. - * @param seriesPoint The series pixel position (in the form {x: [number], y: [number]} ) that represents a position in the pixel space of the series. - * @param useInterpolation If true, interpolation should be used to get in-between values, rather than only the actual values in the data set. - * @param skipUnknowns If true, unknown values should be skipped. - */ - public getSeriesHighValueFromSeriesPixel(targetName: string, seriesPoint: Object, useInterpolation: boolean, skipUnknowns: boolean): number { return; } ; - - /** - * If possible, will return the best available low value of the series for a given world coordinate. - * - * @param targetName The name of the series to target. - * @param worldPoint The world position (in the form {x: [number from 0 to 1], y: [number from 0 to 1]} ) that represents a position in the space of the axes. - * @param useInterpolation If true, interpolation should be used to get in-between values, rather than only the actual values in the data set. - * @param skipUnknowns If true, unknown values should be skipped. - */ - public getSeriesLowValue(targetName: string, worldPoint: Object, useInterpolation: boolean, skipUnknowns: boolean): number { return; } ; - - /** - * If possible, will return the best available low value position of the series for a given world coordinate. - * - * @param targetName The name of the series to target. - * @param worldPoint The world position (in the form {x: [number from 0 to 1], y: [number from 0 to 1]} ) that represents a position in the space of the axes. - * @param useInterpolation If true, interpolation should be used to get in-between values, rather than only the actual values in the data set. - * @param skipUnknowns If true, unknown values should be skipped. - */ - public getSeriesLowValuePosition(targetName: string, worldPoint: Object, useInterpolation: boolean, skipUnknowns: boolean): Object { return; } ; - - /** - * If possible, will return the best available low value position of the series for a given world coordinate. - * - * @param targetName The name of the series to target. - * @param seriesPoint The series pixel position (in the form {x: [number], y: [number]} that represents a position within the pixel space of the series. - * @param useInterpolation If true, interpolation should be used to get in-between values, rather than only the actual values in the data set. - * @param skipUnknowns If true, unknown values should be skipped. - */ - public getSeriesLowValuePositionFromSeriesPixel(targetName: string, seriesPoint: Object, useInterpolation: boolean, skipUnknowns: boolean): Object { return; } ; - - /** - * If possible, will return the best available low value of the series for a given world coordinate. - * - * @param targetName The name of the series to target. - * @param seriesPoint The series pixel position (in the form {x: [number], y: [number]} ) that represents a position in the pixel space of the series. - * @param useInterpolation If true, interpolation should be used to get in-between values, rather than only the actual values in the data set. - * @param skipUnknowns If true, unknown values should be skipped. - */ - public getSeriesLowValueFromSeriesPixel(targetName: string, seriesPoint: Object, useInterpolation: boolean, skipUnknowns: boolean): number { return; } ; - - /** - * Gets the item item index associated with the specified series pixel coordinate. - * - * @param targetName The name of the series to target. - * @param seriesPoint The world position (in the form {x: [number from 0 to 1], y: [number from 0 to 1]} ) that represents a position in the space of the axes. - */ - public getItemIndexFromSeriesPixel(targetName: string, seriesPoint: Object): number { return; } ; - - /** - * Gets the item that is the best match for the specified world coordinates. - * - * @param targetName The name of the series to target. - * @param seriesPoint The series pixel position (in the form {x: [number], y: [number]} ) that represents a position in the pixel space of the series. - */ - public getItemFromSeriesPixel(targetName: string, seriesPoint: Object): Object { return; } ; - - /** - * Gets the category offset for a series, if applicable. - * - * @param targetName The name of the series to target. - */ - public getSeriesOffsetValue(targetName: string): number { return; } ; - - /** - * Gets the category width for a series, if applicable. - * - * @param targetName The name of the series to target. - */ - public getSeriesCategoryWidth(targetName: string): number { return; } ; - - /** - * Replays the transition in animation for a series, if applicable. - * - * @param targetName The name of the series to target. - */ - public replayTransitionIn(targetName: string): Object { return; } ; - - /** - * Simulates a hover interaction over a given point in the viewport of a series. - * - * @param targetName The name of the series to target. - * @param seriesPoint The point at which to hover. Should have an x property with type number and a y property with type number. - */ - public simulateHover(targetName: string, seriesPoint: Object): Object { return; } ; - - /** - * Moves the cursor point of the target annotation layer to the desired world coordinates. - * - * @param targetName The name of the series to target. - * @param worldPoint The point to which to move the cursor. Should have an x property with type number and a y property with type number. - */ - public moveCursorPoint(targetName: string, worldPoint: Object): Object { return; } ; - - /** - * Manually starts a tiled zoom if one isn't already running. - */ - public startTiledZoomingIfNecessary(): void { return; } ; - - /** - * Manually ends a tiled zoom if one is running. - */ - public endTiledZoomingIfRunning(): void { return; } ; - - /** - * Clears the tile zoom tile cache so that new tiles will be generated. Only applies if the viewer is using a tile based zoom. - */ - public clearTileZoomCache(): void { return; } ; - } + /** + * Returns the element holding the chart. + */ + public widget(): void { return; } ; + + /** + * Returns the ID of parent element holding the chart. + */ + public id(): string { return; } ; + + /** + * Exports the chart to a PNG image. + * + * @param width The width of the image. + * @param height The height of the image. + */ + public exportImage(width?: Object, height?: Object): Object { return; } ; + + /** + * Destroys the widget. + */ + public destroy(): void { return; } ; + + /** + * Notify the chart that styles it draws colors from may have been updated. + */ + public styleUpdated(): Object { return; } ; + + /** + * Resets the zoom level of the chart to default. + */ + public resetZoom(): Object { return; } ; + + /** + * Adds a new item to the data source and notifies the chart. + * + * @param item The item that we want to add to the data source. + * @param targetName The name of the series or axis bound to the data source. This is required only when the data is bound to series or axis. If the data is bound to dataSource of igDataChart, the second parameter should not be set. + */ + public addItem(item: Object, targetName: string): void { return; } ; + + /** + * Inserts a new item to the data source and notifies the chart. + * + * @param item the new item that we want to insert in the data source. + * @param index The index in the data source where the new item will be inserted. + * @param targetName The name of the series or axis bound to the data source. + */ + public insertItem(item: Object, index: number, targetName: string): void { return; } ; + + /** + * Deletes an item from the data source and notifies the chart. + * + * @param index The index in the data source from where the item will be been removed. + * @param targetName The name of the series or axis bound to the data source. This is required only when the data is bound to series or axis. If the data is bound to dataSource of igDataChart, the second parameter should not be set. + */ + public removeItem(index: number, targetName: string): void { return; } ; + + /** + * Updates an item in the data source and notifies the chart. + * + * @param index The index of the item in the data source that we want to change. + * @param item The new item object that will be set in the data source. + * @param targetName The name of the series or axis bound to the data source. + */ + public setItem(index: number, item: Object, targetName: string): void { return; } ; + + /** + * Notifies the chart that an item has been set in an associated data source. + * + * @param dataSource The data source in which the change happened. + * @param index The index in the items source that has been changed. + * @param newItem the new item that has been set in the collection. + * @param oldItem the old item that has been overwritten in the collection. + */ + public notifySetItem(dataSource: Object, index: number, newItem: Object, oldItem: Object): Object { return; } ; + + /** + * Notifies the chart that the items have been cleared from an associated data source. + * It's not necessary to notify more than one target of a change if they share the same items source. + * + * @param dataSource The data source in which the change happened. + */ + public notifyClearItems(dataSource: Object): Object { return; } ; + + /** + * Notifies the target axis or series that an item has been inserted at the specified index in its data source. + * It's not necessary to notify more than one target of a change if they share the same items source. + * + * @param dataSource The data source in which the change happened. + * @param index The index in the items source where the new item has been inserted. + * @param newItem the new item that has been set in the collection. + */ + public notifyInsertItem(dataSource: Object, index: number, newItem: Object): Object { return; } ; + + /** + * Notifies the target axis or series that an item has been removed from the specified index in its data source. + * It's not necessary to notify more than one target of a change if they share the same items source. + * + * @param dataSource The data source in which the change happened. + * @param index The index in the items source from where the old item has been removed. + * @param oldItem the old item that has been removed from the collection. + */ + public notifyRemoveItem(dataSource: Object, index: number, oldItem: Object): Object { return; } ; + + /** + * Notifies the target axis or series that it should scroll the requested data item into view. + * + * @param targetName The name of the axis or series notify. + * @param item The data item to bring into view, if possible. + */ + public scrollIntoView(targetName: string, item: Object): Object { return; } ; + + /** + * Notifies the target axis that it should scale the requested value into chart space from axis space. + * For example you can use this method if you want to find where value 50 of the x axis stands scaled to chart's width. + * + * @param targetName The name of the axis to notify. + * @param unscaledValue The value in axis space to translate into chart space. + */ + public scaleValue(targetName: string, unscaledValue: number): number { return; } ; + + /** + * Notifies the target axis that it should unscale the requested value into axis space from chart space. + * For example you can use this method if you want to find what is the value of x axis unscaled from 0 width of the chart. + * + * @param targetName The name of the axis to notify. + * @param scaledValue The value in chart space to translate into axis space. + */ + public unscaleValue(targetName: string, scaledValue: number): number { return; } ; + + /** + * For the target axis, if using enhanced interval management and precise interval fitting, this will reset the cached maximum label width, and recalculate using the current labels. + * + * @param targetName The name of the axis to notify. + */ + public resetCachedEnhancedInterval(targetName: string): Object { return; } ; + + /** + * Notifies the target series that something that affects its visual properties has changed and the visual output needs a repaint. + * + * @param targetName The name of the series to notify. + */ + public notifyVisualPropertiesChanged(targetName: string): Object { return; } ; + + /** + * Forces any pending deferred work to render on the chart before continuing + */ + public flush(): void { return; } ; + + /** + * Exports visual data from the chart to aid in unit testing + */ + public exportVisualData(): void { return; } ; + + /** + * Gets the actual minimum value of the target numeric or date time axis + * + * @param targetName The name of the axis from which to get the minimum value. + */ + public getActualMinimumValue(targetName: string): void { return; } ; + + /** + * Gets the actual maximum value of the target numeric or date time axis + * + * @param targetName The name of the axis from which to get the maximum value. + */ + public getActualMaximumValue(targetName: string): void { return; } ; + + /** + * Gets the actual interval of the target numeric or date time axis + * + * @param targetName The name of the axis from which to get the interval. + */ + public getActualInterval(targetName: string): void { return; } ; + + /** + * Creates a print preview page with the chart, hiding all other elements on the page. + */ + public print(): void { return; } ; + + /** + * Indicates that a series should render, even though no option has been modified that would normally cause it to refresh. + * + * @param targetName The name of the series to render. + * @param animate Whether the change should be animated, if possible. + */ + public renderSeries(targetName: string, animate: boolean): void { return; } ; + + /** + * Gets the item item index associated with the specified world position. + * + * @param targetName The name of the series to target. + * @param worldPoint The world position (in the form {x: [number from 0 to 1], y: [number from 0 to 1]} ) that represents a position in the space of the axes. + */ + public getItemIndex(targetName: string, worldPoint: Object): number { return; } ; + + /** + * Gets the item that is the best match for the specified world coordinates. + * + * @param targetName The name of the series to target. + * @param worldPoint The world position (in the form {x: [number from 0 to 1], y: [number from 0 to 1]} ) that represents a position in the space of the axes. + */ + public getItem(targetName: string, worldPoint: Object): Object { return; } ; + + /** + * For a category plotted series, gets the current width of the items within the categories. This only returns a value if the items have some form of width (e.g. columns, bars, etc.) otherwise 0 is returned. + * + * @param targetName The name of the series to target. + */ + public getItemSpan(targetName: string): number { return; } ; + + /** + * If possible, will return the best available main value of the series for a given world coordinate. + * + * @param targetName The name of the series to target. + * @param worldPoint The world position (in the form {x: [number from 0 to 1], y: [number from 0 to 1]} ) that represents a position in the space of the axes. + * @param useInterpolation If true, interpolation should be used to get in-between values, rather than only the actual values in the data set. + * @param skipUnknowns If true, unknown values should be skipped. + */ + public getSeriesValue(targetName: string, worldPoint: Object, useInterpolation: boolean, skipUnknowns: boolean): number { return; } ; + + /** + * If possible, will return the best available value bounding box within the series that has the best value match for the world position provided. + * + * @param targetName The name of the series to target. + * @param worldPoint The world position (in the form {x: [number from 0 to 1], y: [number from 0 to 1]} ) that represents a position in the space of the axes. + */ + public getSeriesValueBoundingBox(targetName: string, worldPoint: Object): Object { return; } ; + + /** + * If possible, will return the best available value fine grained bounding boxes within the series that have the best value match for the world position provided. + * + * @param targetName The name of the series to target. + * @param worldPoint The world position (in the form {x: [number from 0 to 1], y: [number from 0 to 1]} ) that represents a position in the space of the axes. + */ + public getSeriesValueFineGrainedBoundingBoxes(targetName: string, worldPoint: Object): Object { return; } ; + + /** + * If possible, will return the best available main value position of the series for a given world coordinate. + * + * @param targetName The name of the series to target. + * @param worldPoint The world position (in the form {x: [number from 0 to 1], y: [number from 0 to 1]} ) that represents a position in the space of the axes. + * @param useInterpolation If true, interpolation should be used to get in-between values, rather than only the actual values in the data set. + * @param skipUnknowns If true, unknown values should be skipped. + */ + public getSeriesValuePosition(targetName: string, worldPoint: Object, useInterpolation: boolean, skipUnknowns: boolean): Object { return; } ; + + /** + * If possible, will return the best available main value position of the series for a given world coordinate. + * + * @param targetName The name of the series to target. + * @param seriesPoint The series pixel position (in the form {x: [number], y: [number]} that represents a position within the pixel space of the series. + * @param useInterpolation If true, interpolation should be used to get in-between values, rather than only the actual values in the data set. + * @param skipUnknowns If true, unknown values should be skipped. + */ + public getSeriesValuePositionFromSeriesPixel(targetName: string, seriesPoint: Object, useInterpolation: boolean, skipUnknowns: boolean): Object { return; } ; + + /** + * If possible, will return the best available main value of the series for a given world coordinate. + * + * @param targetName The name of the series to target. + * @param seriesPoint The series pixel position (in the form {x: [number], y: [number]} ) that represents a position in the pixel space of the series. + * @param useInterpolation If true, interpolation should be used to get in-between values, rather than only the actual values in the data set. + * @param skipUnknowns If true, unknown values should be skipped. + */ + public getSeriesValueFromSeriesPixel(targetName: string, seriesPoint: Object, useInterpolation: boolean, skipUnknowns: boolean): number { return; } ; + + /** + * If possible, will return the best available value bounding box within the series that has the best value match for the given series pixel coordinate. + * + * @param targetName The name of the series to target. + * @param seriesPoint The series pixel position (in the form {x: [number], y: [number]} ) that represents a position in the pixel space of the series. + */ + public getSeriesValueBoundingBoxFromSeriesPixel(targetName: string, seriesPoint: Object): Object { return; } ; + + /** + * If possible, will return the best available value fine grained bounding boxes within the series that have the best value match for series pixel position provided. + * + * @param targetName The name of the series to target. + * @param worldPoint The series pixel position (in the form {x: [number], y: [number]} ) that represents a position in the pixel space of the series. + */ + public getSeriesValueFineGrainedBoundingBoxesFromSeriesPixel(targetName: string, worldPoint: Object): Object { return; } ; + + /** + * If possible, will return the best available high value of the series for a given world coordinate. + * + * @param targetName The name of the series to target. + * @param worldPoint The world position (in the form {x: [number from 0 to 1], y: [number from 0 to 1]} ) that represents a position in the space of the axes. + * @param useInterpolation If true, interpolation should be used to get in-between values, rather than only the actual values in the data set. + * @param skipUnknowns If true, unknown values should be skipped. + */ + public getSeriesHighValue(targetName: string, worldPoint: Object, useInterpolation: boolean, skipUnknowns: boolean): number { return; } ; + + /** + * If possible, will return the best available high value position of the series for a given world coordinate. + * + * @param targetName The name of the series to target. + * @param worldPoint The world position (in the form {x: [number from 0 to 1], y: [number from 0 to 1]} ) that represents a position in the space of the axes. + * @param useInterpolation If true, interpolation should be used to get in-between values, rather than only the actual values in the data set. + * @param skipUnknowns If true, unknown values should be skipped. + */ + public getSeriesHighValuePosition(targetName: string, worldPoint: Object, useInterpolation: boolean, skipUnknowns: boolean): Object { return; } ; + + /** + * If possible, will return the best available high value position of the series for a given world coordinate. + * + * @param targetName The name of the series to target. + * @param seriesPoint The series pixel position (in the form {x: [number], y: [number]} that represents a position within the pixel space of the series. + * @param useInterpolation If true, interpolation should be used to get in-between values, rather than only the actual values in the data set. + * @param skipUnknowns If true, unknown values should be skipped. + */ + public getSeriesHighValuePositionFromSeriesPixel(targetName: string, seriesPoint: Object, useInterpolation: boolean, skipUnknowns: boolean): Object { return; } ; + + /** + * If possible, will return the best available high value of the series for a given world coordinate. + * + * @param targetName The name of the series to target. + * @param seriesPoint The series pixel position (in the form {x: [number], y: [number]} ) that represents a position in the pixel space of the series. + * @param useInterpolation If true, interpolation should be used to get in-between values, rather than only the actual values in the data set. + * @param skipUnknowns If true, unknown values should be skipped. + */ + public getSeriesHighValueFromSeriesPixel(targetName: string, seriesPoint: Object, useInterpolation: boolean, skipUnknowns: boolean): number { return; } ; + + /** + * If possible, will return the best available low value of the series for a given world coordinate. + * + * @param targetName The name of the series to target. + * @param worldPoint The world position (in the form {x: [number from 0 to 1], y: [number from 0 to 1]} ) that represents a position in the space of the axes. + * @param useInterpolation If true, interpolation should be used to get in-between values, rather than only the actual values in the data set. + * @param skipUnknowns If true, unknown values should be skipped. + */ + public getSeriesLowValue(targetName: string, worldPoint: Object, useInterpolation: boolean, skipUnknowns: boolean): number { return; } ; + + /** + * If possible, will return the best available low value position of the series for a given world coordinate. + * + * @param targetName The name of the series to target. + * @param worldPoint The world position (in the form {x: [number from 0 to 1], y: [number from 0 to 1]} ) that represents a position in the space of the axes. + * @param useInterpolation If true, interpolation should be used to get in-between values, rather than only the actual values in the data set. + * @param skipUnknowns If true, unknown values should be skipped. + */ + public getSeriesLowValuePosition(targetName: string, worldPoint: Object, useInterpolation: boolean, skipUnknowns: boolean): Object { return; } ; + + /** + * If possible, will return the best available low value position of the series for a given world coordinate. + * + * @param targetName The name of the series to target. + * @param seriesPoint The series pixel position (in the form {x: [number], y: [number]} that represents a position within the pixel space of the series. + * @param useInterpolation If true, interpolation should be used to get in-between values, rather than only the actual values in the data set. + * @param skipUnknowns If true, unknown values should be skipped. + */ + public getSeriesLowValuePositionFromSeriesPixel(targetName: string, seriesPoint: Object, useInterpolation: boolean, skipUnknowns: boolean): Object { return; } ; + + /** + * If possible, will return the best available low value of the series for a given world coordinate. + * + * @param targetName The name of the series to target. + * @param seriesPoint The series pixel position (in the form {x: [number], y: [number]} ) that represents a position in the pixel space of the series. + * @param useInterpolation If true, interpolation should be used to get in-between values, rather than only the actual values in the data set. + * @param skipUnknowns If true, unknown values should be skipped. + */ + public getSeriesLowValueFromSeriesPixel(targetName: string, seriesPoint: Object, useInterpolation: boolean, skipUnknowns: boolean): number { return; } ; + + /** + * Gets the item item index associated with the specified series pixel coordinate. + * + * @param targetName The name of the series to target. + * @param seriesPoint The world position (in the form {x: [number from 0 to 1], y: [number from 0 to 1]} ) that represents a position in the space of the axes. + */ + public getItemIndexFromSeriesPixel(targetName: string, seriesPoint: Object): number { return; } ; + + /** + * Gets the item that is the best match for the specified world coordinates. + * + * @param targetName The name of the series to target. + * @param seriesPoint The series pixel position (in the form {x: [number], y: [number]} ) that represents a position in the pixel space of the series. + */ + public getItemFromSeriesPixel(targetName: string, seriesPoint: Object): Object { return; } ; + + /** + * Gets the category offset for a series, if applicable. + * + * @param targetName The name of the series to target. + */ + public getSeriesOffsetValue(targetName: string): number { return; } ; + + /** + * Gets the category width for a series, if applicable. + * + * @param targetName The name of the series to target. + */ + public getSeriesCategoryWidth(targetName: string): number { return; } ; + + /** + * Replays the transition in animation for a series, if applicable. + * + * @param targetName The name of the series to target. + */ + public replayTransitionIn(targetName: string): Object { return; } ; + + /** + * Simulates a hover interaction over a given point in the viewport of a series. + * + * @param targetName The name of the series to target. + * @param seriesPoint The point at which to hover. Should have an x property with type number and a y property with type number. + */ + public simulateHover(targetName: string, seriesPoint: Object): Object { return; } ; + + /** + * Moves the cursor point of the target annotation layer to the desired world coordinates. + * + * @param targetName The name of the series to target. + * @param worldPoint The point to which to move the cursor. Should have an x property with type number and a y property with type number. + */ + public moveCursorPoint(targetName: string, worldPoint: Object): Object { return; } ; + + /** + * Manually starts a tiled zoom if one isn't already running. + */ + public startTiledZoomingIfNecessary(): void { return; } ; + + /** + * Manually ends a tiled zoom if one is running. + */ + public endTiledZoomingIfRunning(): void { return; } ; + + /** + * Clears the tile zoom tile cache so that new tiles will be generated. Only applies if the viewer is using a tile based zoom. + */ + public clearTileZoomCache(): void { return; } ; +} diff --git a/src/igdoughnutchart/igdoughnutchart.component.ts b/src/igdoughnutchart/igdoughnutchart.component.ts index feb8811..6b3c61f 100644 --- a/src/igdoughnutchart/igdoughnutchart.component.ts +++ b/src/igdoughnutchart/igdoughnutchart.component.ts @@ -1,68 +1,80 @@ -import { Component, ElementRef, Renderer, IterableDiffers, KeyValueDiffers, ChangeDetectorRef } from "@angular/core"; +import { Component, ElementRef, Renderer, IterableDiffers, KeyValueDiffers, ChangeDetectorRef, Input } from "@angular/core"; import { IgControlBase } from "../igcontrolbase/igcontrolbase"; @Component({ - selector: "ig-doughnut-chart", - template: "", - inputs: ["widgetId", "options", "changeDetectionInterval","disabled","create","width","height","tooltipTemplate","maxRecCount","dataSource","dataSourceType","dataSourceUrl","responseTotalRecCountKey","responseDataKey","series","allowSliceSelection","isSurfaceInteractionDisabled","allowSliceExplosion","innerExtent","selectedStyle"], - outputs: ["dataBinding","dataBound","updateTooltip","hideTooltip","tooltipShowing","tooltipShown","tooltipHiding","tooltipHidden","browserNotSupported","sliceClick","holeDimensionsChanged"] + selector: "ig-doughnut-chart", + template: "", + inputs: ["widgetId", "options", "changeDetectionInterval", "disabled", "create", "width", "height", "tooltipTemplate", "maxRecCount", "dataSource", "dataSourceType", "dataSourceUrl", "responseTotalRecCountKey", "responseDataKey", "series", "allowSliceSelection", "isSurfaceInteractionDisabled", "allowSliceExplosion", "innerExtent", "selectedStyle"], + outputs: ["dataBinding", "dataBound", "updateTooltip", "hideTooltip", "tooltipShowing", "tooltipShown", "tooltipHiding", "tooltipHidden", "browserNotSupported", "sliceClick", "holeDimensionsChanged"] }) export class IgDoughnutChartComponent extends IgControlBase { - constructor(el: ElementRef, renderer: Renderer, differs: IterableDiffers, kvalDiffers: KeyValueDiffers, cdr: ChangeDetectorRef) { super(el, renderer, differs, kvalDiffers, cdr); } + constructor(el: ElementRef, renderer: Renderer, differs: IterableDiffers, kvalDiffers: KeyValueDiffers, cdr: ChangeDetectorRef) { super(el, renderer, differs, kvalDiffers, cdr); } + @Input() + public set dataSource(value: any) { + this._dataSource = value; + const chart = jQuery(this._el).data(this._widgetName); + if (chart) { + jQuery(this._el)[this._widgetName]("option", "dataSource", this._dataSource); + } + }; + + private _dataSource: any; + ngOnInit() { - Object.defineProperty(this, "dataSource", { - set: this.createSetter("dataSource"), - enumerable: true, - configurable: true - }); + if (this._dataSource === null || this._dataSource === undefined) { + this._dataSource = this.options["dataSource"]; + } + if (!this.options["dataSource"] && this._dataSource) { + this.options["dataSource"] = this._dataSource; + } super.ngOnInit(); } - /** - * Adds a new series to the doughnut chart. - * - * @param seriesObj The series object to be added. - */ - public addSeries(seriesObj: Object): void { return; } ; + /** + * Adds a new series to the doughnut chart. + * + * @param seriesObj The series object to be added. + */ + public addSeries(seriesObj: Object): void { return; }; - /** - * Removes the specified series from the doughnut chart. - * - * @param seriesObj The series object identifying the series to be removed. - */ - public removeSeries(seriesObj: Object): void { return; } ; + /** + * Removes the specified series from the doughnut chart. + * + * @param seriesObj The series object identifying the series to be removed. + */ + public removeSeries(seriesObj: Object): void { return; }; - /** - * Updates the series with the specified name with the specified new property values. - * - * @param value The series object identifying the series to be updated. - */ - public updateSeries(value: Object): void { return; } ; + /** + * Updates the series with the specified name with the specified new property values. + * + * @param value The series object identifying the series to be updated. + */ + public updateSeries(value: Object): void { return; }; - /** - * Returns the center of the doughnut chart. - */ - public getCenterCoordinates(): Object { return; } ; + /** + * Returns the center of the doughnut chart. + */ + public getCenterCoordinates(): Object { return; }; - /** - * Returns the radius of the chart's hole. - */ - public getHoleRadius(): number { return; } ; + /** + * Returns the radius of the chart's hole. + */ + public getHoleRadius(): number { return; }; - /** - * Returns information about how the doughnut chart is rendered. - */ - public exportVisualData(): Object { return; } ; + /** + * Returns information about how the doughnut chart is rendered. + */ + public exportVisualData(): Object { return; }; - /** - * Causes all of the series that have pending changes e.g. by changed property values to be rendered immediately. - */ - public flush(): void { return; } ; + /** + * Causes all of the series that have pending changes e.g. by changed property values to be rendered immediately. + */ + public flush(): void { return; }; - /** - * Destroys the widget. - */ - public destroy(): void { return; } ; + /** + * Destroys the widget. + */ + public destroy(): void { return; }; } \ No newline at end of file diff --git a/src/igfunnelchart/igfunnelchart.component.ts b/src/igfunnelchart/igfunnelchart.component.ts index a7f52b5..c9b0c9e 100644 --- a/src/igfunnelchart/igfunnelchart.component.ts +++ b/src/igfunnelchart/igfunnelchart.component.ts @@ -1,57 +1,69 @@ -import { Component, ElementRef, Renderer, IterableDiffers, KeyValueDiffers, ChangeDetectorRef } from "@angular/core"; +import { Component, ElementRef, Renderer, IterableDiffers, KeyValueDiffers, ChangeDetectorRef, Input } from "@angular/core"; import { IgControlBase } from "../igcontrolbase/igcontrolbase"; @Component({ - selector: "ig-funnel-chart", - template: "", - 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"], - outputs: ["dataBinding","dataBound","updateTooltip","hideTooltip","sliceClicked"] + selector: "ig-funnel-chart", + template: "", + 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"], + outputs: ["dataBinding", "dataBound", "updateTooltip", "hideTooltip", "sliceClicked"] }) export class IgFunnelChartComponent extends IgControlBase { - constructor(el: ElementRef, renderer: Renderer, differs: IterableDiffers, kvalDiffers: KeyValueDiffers, cdr: ChangeDetectorRef) { super(el, renderer, differs, kvalDiffers, cdr); } - - ngOnInit() { - Object.defineProperty(this, "dataSource", { - set: this.createSetter("dataSource"), - enumerable: true, - configurable: true - }); + constructor(el: ElementRef, renderer: Renderer, differs: IterableDiffers, kvalDiffers: KeyValueDiffers, cdr: ChangeDetectorRef) { super(el, renderer, differs, kvalDiffers, cdr); } + + @Input() + public set dataSource(value: any) { + this._dataSource = value; + const chart = jQuery(this._el).data(this._widgetName); + if (chart) { + jQuery(this._el)[this._widgetName]("option", "dataSource", this._dataSource); + } + }; + + private _dataSource: any; + + ngOnInit() { + if (this._dataSource === null || this._dataSource === undefined) { + this._dataSource = this.options["dataSource"]; + } + if (!this.options["dataSource"] && this._dataSource) { + this.options["dataSource"] = this._dataSource; + } super.ngOnInit(); } - /** - * Gets array of selected slice items. - * - * @param selection Array or selected slice items. - * @return array|object If parameter is undefined, then array of selected items is returned. Otherwise, it returns reference to igFunnelChart. - */ - public selectedSliceItems(selection?: any[]): any[] { return; } ; - - /** - * Gets sets array of indexes of selected slices. - * - * @param selection Array or selected slice indexes. - * @return array|object If parameter is undefined, then array of selected indexes is returned. Otherwise, it returns reference to igFunnelChart. - */ - public selectedSliceIndexes(selection?: any[]): any[] { return; } ; - - /** - * Checks if slice is selected. - * - * @param slice Index of slice or reference to slice-data-item. - */ - public isSelected(slice: Object): boolean { return; } ; - - /** - * Toggles selected state of slice. - * - * @param slice Index of slice or reference to slice-data-item. - */ - public toggleSelection(slice: Object): Object { return; } ; - public exportVisualData(): void { return; } ; - - /** - * Destroys widget. - */ - public destroy(): void { return; } ; + /** + * Gets array of selected slice items. + * + * @param selection Array or selected slice items. + * @return array|object If parameter is undefined, then array of selected items is returned. Otherwise, it returns reference to igFunnelChart. + */ + public selectedSliceItems(selection?: any[]): any[] { return; }; + + /** + * Gets sets array of indexes of selected slices. + * + * @param selection Array or selected slice indexes. + * @return array|object If parameter is undefined, then array of selected indexes is returned. Otherwise, it returns reference to igFunnelChart. + */ + public selectedSliceIndexes(selection?: any[]): any[] { return; }; + + /** + * Checks if slice is selected. + * + * @param slice Index of slice or reference to slice-data-item. + */ + public isSelected(slice: Object): boolean { return; }; + + /** + * Toggles selected state of slice. + * + * @param slice Index of slice or reference to slice-data-item. + */ + public toggleSelection(slice: Object): Object { return; }; + public exportVisualData(): void { return; }; + + /** + * Destroys widget. + */ + public destroy(): void { return; }; } \ No newline at end of file diff --git a/src/igmap/igmap.component.ts b/src/igmap/igmap.component.ts index 7f59133..37306ba 100644 --- a/src/igmap/igmap.component.ts +++ b/src/igmap/igmap.component.ts @@ -1,225 +1,237 @@ -import { Component, Renderer, IterableDiffers, ElementRef, KeyValueDiffers, ChangeDetectorRef } from "@angular/core"; +import { Component, Renderer, IterableDiffers, ElementRef, KeyValueDiffers, ChangeDetectorRef, Input } from "@angular/core"; import { IgControlBase } from "../igcontrolbase/igcontrolbase"; @Component({ - selector: "ig-map", - template: "", - inputs: ["widgetId", "options", "changeDetectionInterval","disabled","create","width","height","dataSource","dataSourceUrl","dataSourceType","responseDataKey","autoMarginWidth","autoMarginHeight","crosshairVisibility","crosshairPoint","plotAreaBackground","defaultInteraction","dragModifier","panModifier","previewRect","windowRect","zoomable","windowScale","windowResponse","windowRectMinWidth","windowPositionHorizontal","windowPositionVertical","circleMarkerTemplate","triangleMarkerTemplate","pyramidMarkerTemplate","squareMarkerTemplate","diamondMarkerTemplate","pentagonMarkerTemplate","hexagonMarkerTemplate","tetragramMarkerTemplate","pentagramMarkerTemplate","hexagramMarkerTemplate","overviewPlusDetailPaneBackgroundImageUri","useTiledZooming","preferHigherResolutionTiles","zoomTileCacheSize","backgroundContent","series","theme"], - outputs: ["tooltipShowing","tooltipShown","tooltipHiding","tooltipHidden","browserNotSupported","seriesCursorMouseMove","seriesMouseLeftButtonDown","seriesMouseLeftButtonUp","seriesMouseMove","seriesMouseEnter","seriesMouseLeave","windowRectChanged","gridAreaRectChanged","refreshCompleted","triangulationStatusChanged"] + selector: "ig-map", + template: "", + inputs: ["widgetId", "options", "changeDetectionInterval","disabled","create","width","height","dataSource","dataSourceUrl","dataSourceType","responseDataKey","autoMarginWidth","autoMarginHeight","crosshairVisibility","crosshairPoint","plotAreaBackground","defaultInteraction","dragModifier","panModifier","previewRect","windowRect","zoomable","windowScale","windowResponse","windowRectMinWidth","windowPositionHorizontal","windowPositionVertical","circleMarkerTemplate","triangleMarkerTemplate","pyramidMarkerTemplate","squareMarkerTemplate","diamondMarkerTemplate","pentagonMarkerTemplate","hexagonMarkerTemplate","tetragramMarkerTemplate","pentagramMarkerTemplate","hexagramMarkerTemplate","overviewPlusDetailPaneBackgroundImageUri","useTiledZooming","preferHigherResolutionTiles","zoomTileCacheSize","backgroundContent","series","theme"], + outputs: ["tooltipShowing","tooltipShown","tooltipHiding","tooltipHidden","browserNotSupported","seriesCursorMouseMove","seriesMouseLeftButtonDown","seriesMouseLeftButtonUp","seriesMouseMove","seriesMouseEnter","seriesMouseLeave","windowRectChanged","gridAreaRectChanged","refreshCompleted","triangulationStatusChanged"] }) export class IgMapComponent extends IgControlBase { - constructor(el: ElementRef, renderer: Renderer, differs: IterableDiffers, kvalDiffers: KeyValueDiffers, cdr: ChangeDetectorRef) { super(el, renderer, differs, kvalDiffers, cdr); } public option(): void { return; } ; + constructor(el: ElementRef, renderer: Renderer, differs: IterableDiffers, kvalDiffers: KeyValueDiffers, cdr: ChangeDetectorRef) { super(el, renderer, differs, kvalDiffers, cdr); } public option(): void { return; } ; + + @Input() + public set dataSource(value: any) { + this._dataSource = value; + const map = jQuery(this._el).data(this._widgetName); + if (map) { + jQuery(this._el)[this._widgetName]("option", "dataSource", this._dataSource); + } + }; + + private _dataSource: any; ngOnInit() { - Object.defineProperty(this, "dataSource", { - set: this.createSetter("dataSource"), - enumerable: true, - configurable: true - }); + if (this._dataSource === null || this._dataSource === undefined) { + this._dataSource = this.options["dataSource"]; + } + if (!this.options["dataSource"] && this._dataSource) { + this.options["dataSource"] = this._dataSource; + } super.ngOnInit(); } - /** - * Destroys the widget. - */ - public destroy(): void { return; } ; - - /** - * Returns the ID of parent element holding the map. - */ - public id(): string { return; } ; - - /** - * Exports the map to a PNG image. - * - * @param width The width of the image. - * @param height The height of the image. - */ - public exportImage(width?: Object, height?: Object): Object { return; } ; - - /** - * Notify the map that styles it draws colors from may have been updated. - */ - public styleUpdated(): Object { return; } ; - - /** - * Resets the zoom level of the map to default. - */ - public resetZoom(): Object { return; } ; - - /** - * Adds a new item to the data source and notifies the map. - * - * @param item The item that we want to add to the data source. - * @param targetName The name of the series bound to the data source. - */ - public addItem(item: Object, targetName: string): void { return; } ; - - /** - * Inserts a new item to the data source and notifies the map. - * - * @param item the new item that we want to insert in the data source. - * @param index The index in the data source where the new item will be inserted. - * @param targetName The name of the series bound to the data source. - */ - public insertItem(item: Object, index: number, targetName: string): void { return; } ; - - /** - * Deletes an item from the data source and notifies the map. - * - * @param index The index in the data source from where the item will be been removed. - * @param targetName The name of the series bound to the data source. - */ - public removeItem(index: number, targetName: string): void { return; } ; - - /** - * Updates an item in the data source and notifies the map. - * - * @param index The index of the item in the data source that we want to change. - * @param item The new item object that will be set in the data source. - * @param targetName The name of the series bound to the data source. - */ - public setItem(index: number, item: Object, targetName: string): void { return; } ; - - /** - * Notifies the the map that an item has been set in an associated data source. - * - * @param dataSource The data source in which the change happened. - * @param index The index in the items source that has been changed. - * @param newItem the new item that has been set in the collection. - * @param oldItem the old item that has been overwritten in the collection. - */ - public notifySetItem(dataSource: Object, index: number, newItem: Object, oldItem: Object): Object { return; } ; - - /** - * Notifies the the map that the items have been cleared from an associated data source. - * It's not necessary to notify more than one target of a change if they share the same items source. - * - * @param dataSource The data source in which the change happened. - */ - public notifyClearItems(dataSource: Object): Object { return; } ; - - /** - * Notifies the the target series that an item has been inserted at the specified index in its data source. - * It's not necessary to notify more than one target of a change if they share the same items source. - * - * @param dataSource The data source in which the change happened. - * @param index The index in the items source where the new item has been inserted. - * @param newItem the new item that has been set in the collection. - */ - public notifyInsertItem(dataSource: Object, index: number, newItem: Object): Object { return; } ; - - /** - * Notifies the the target series that an item has been removed from the specified index in its data source. - * It's not necessary to notify more than one target of a change if they share the same items source. - * - * @param dataSource The data source in which the change happened. - * @param index The index in the items source from where the old item has been removed. - * @param oldItem the old item that has been removed from the collection. - */ - public notifyRemoveItem(dataSource: Object, index: number, oldItem: Object): Object { return; } ; - - /** - * Notifies the target series or axis that it should scroll the requested data item into view. - * - * @param targetName The name of the series or axis notify. - * @param item The data item to bring into view, if possible. - */ - public scrollIntoView(targetName: string, item: Object): Object { return; } ; - - /** - * Either xAxis or yAxis (longitude or latitude) that it should scale the requested value into map space from axis space. - * For example you can use this method if you want to find where longitude 50 stands scaled to map's width. - * - * @param targetName Either xAxis or yAxis to notify. - * @param unscaledValue The value in axis space to translate into map space. - */ - public scaleValue(targetName: string, unscaledValue: number): number { return; } ; - - /** - * Either xAxis or yAxis (longitude or latitude) that it should unscale the requested value into axis space from map space. - * For example you can use this method if you want to find what is the longitude unscaled from 0 width of the map. - * - * @param targetName Either xAxis or yAxis to notify. - * @param scaledValue The value in map space to translate into axis space. - */ - public unscaleValue(targetName: string, scaledValue: number): number { return; } ; - - /** - * Manually starts a tiled zoom if one isn't already running. - */ - public startTiledZoomingIfNecessary(): void { return; } ; - - /** - * Manually ends a tiled zoom if one is running. - */ - public endTiledZoomingIfRunning(): void { return; } ; - - /** - * Clears the tile zoom tile cache so that new tiles will be generated. Only applies if the viewer is using a tile based zoom.. - */ - public clearTileZoomCache(): void { return; } ; - - /** - * Forces any pending deferred work to render on the map before continuing - */ - public flush(): void { return; } ; - - /** - * Exports visual data from the map to aid in unit testing - */ - public exportVisualData(): void { return; } ; - - /** - * Gets the actual minimum value of the target xAxis or yAxis - * - * @param targetName - */ - public getActualMinimumValue(targetName: Object): void { return; } ; - - /** - * Gets the actual maximum value of the target xAxis or yAxis - * - * @param targetName - */ - public getActualMaximumValue(targetName: Object): void { return; } ; - - /** - * Notifies the map that the container was resized - */ - public notifyContainerResized(): void { return; } ; - - /** - * Zoom in to the geographic region specified, when possible (may need to wait fior map to be initialized). - * - * @param rect The geographic area rectangle. - */ - public zoomToGeographic(rect: Object): Object { return; } ; - - /** - * Given the current plot area of the control and a geographic region, get the WindowRect that would encompass that geographic region. - * - * @param rect The geographic area rectangle. - */ - public getGeographicFromZoom(rect: Object): Object { return; } ; - - /** - * Given the current plot area of the control and a geographic region, get the WindowRect that would encompass that geographic region. - * - * @param rect The geographic area rectangle. - */ - public getZoomFromGeographic(rect: Object): Object { return; } ; - - /** - * Creates a print preview page with the map, hiding all other elements on the page. - */ - public print(): void { return; } ; - - /** - * Indicates that a series should render, even though no option has been modified that would normally cause it to refresh. - * - * @param targetName The name of the series to render. - * @param animate Whether the change should be animated, if possible. - */ - public renderSeries(targetName: string, animate: boolean): void { return; } ; + /** + * Destroys the widget. + */ + public destroy(): void { return; } ; + + /** + * Returns the ID of parent element holding the map. + */ + public id(): string { return; } ; + + /** + * Exports the map to a PNG image. + * + * @param width The width of the image. + * @param height The height of the image. + */ + public exportImage(width?: Object, height?: Object): Object { return; } ; + + /** + * Notify the map that styles it draws colors from may have been updated. + */ + public styleUpdated(): Object { return; } ; + + /** + * Resets the zoom level of the map to default. + */ + public resetZoom(): Object { return; } ; + + /** + * Adds a new item to the data source and notifies the map. + * + * @param item The item that we want to add to the data source. + * @param targetName The name of the series bound to the data source. + */ + public addItem(item: Object, targetName: string): void { return; } ; + + /** + * Inserts a new item to the data source and notifies the map. + * + * @param item the new item that we want to insert in the data source. + * @param index The index in the data source where the new item will be inserted. + * @param targetName The name of the series bound to the data source. + */ + public insertItem(item: Object, index: number, targetName: string): void { return; } ; + + /** + * Deletes an item from the data source and notifies the map. + * + * @param index The index in the data source from where the item will be been removed. + * @param targetName The name of the series bound to the data source. + */ + public removeItem(index: number, targetName: string): void { return; } ; + + /** + * Updates an item in the data source and notifies the map. + * + * @param index The index of the item in the data source that we want to change. + * @param item The new item object that will be set in the data source. + * @param targetName The name of the series bound to the data source. + */ + public setItem(index: number, item: Object, targetName: string): void { return; } ; + + /** + * Notifies the the map that an item has been set in an associated data source. + * + * @param dataSource The data source in which the change happened. + * @param index The index in the items source that has been changed. + * @param newItem the new item that has been set in the collection. + * @param oldItem the old item that has been overwritten in the collection. + */ + public notifySetItem(dataSource: Object, index: number, newItem: Object, oldItem: Object): Object { return; } ; + + /** + * Notifies the the map that the items have been cleared from an associated data source. + * It's not necessary to notify more than one target of a change if they share the same items source. + * + * @param dataSource The data source in which the change happened. + */ + public notifyClearItems(dataSource: Object): Object { return; } ; + + /** + * Notifies the the target series that an item has been inserted at the specified index in its data source. + * It's not necessary to notify more than one target of a change if they share the same items source. + * + * @param dataSource The data source in which the change happened. + * @param index The index in the items source where the new item has been inserted. + * @param newItem the new item that has been set in the collection. + */ + public notifyInsertItem(dataSource: Object, index: number, newItem: Object): Object { return; } ; + + /** + * Notifies the the target series that an item has been removed from the specified index in its data source. + * It's not necessary to notify more than one target of a change if they share the same items source. + * + * @param dataSource The data source in which the change happened. + * @param index The index in the items source from where the old item has been removed. + * @param oldItem the old item that has been removed from the collection. + */ + public notifyRemoveItem(dataSource: Object, index: number, oldItem: Object): Object { return; } ; + + /** + * Notifies the target series or axis that it should scroll the requested data item into view. + * + * @param targetName The name of the series or axis notify. + * @param item The data item to bring into view, if possible. + */ + public scrollIntoView(targetName: string, item: Object): Object { return; } ; + + /** + * Either xAxis or yAxis (longitude or latitude) that it should scale the requested value into map space from axis space. + * For example you can use this method if you want to find where longitude 50 stands scaled to map's width. + * + * @param targetName Either xAxis or yAxis to notify. + * @param unscaledValue The value in axis space to translate into map space. + */ + public scaleValue(targetName: string, unscaledValue: number): number { return; } ; + + /** + * Either xAxis or yAxis (longitude or latitude) that it should unscale the requested value into axis space from map space. + * For example you can use this method if you want to find what is the longitude unscaled from 0 width of the map. + * + * @param targetName Either xAxis or yAxis to notify. + * @param scaledValue The value in map space to translate into axis space. + */ + public unscaleValue(targetName: string, scaledValue: number): number { return; } ; + + /** + * Manually starts a tiled zoom if one isn't already running. + */ + public startTiledZoomingIfNecessary(): void { return; } ; + + /** + * Manually ends a tiled zoom if one is running. + */ + public endTiledZoomingIfRunning(): void { return; } ; + + /** + * Clears the tile zoom tile cache so that new tiles will be generated. Only applies if the viewer is using a tile based zoom.. + */ + public clearTileZoomCache(): void { return; } ; + + /** + * Forces any pending deferred work to render on the map before continuing + */ + public flush(): void { return; } ; + + /** + * Exports visual data from the map to aid in unit testing + */ + public exportVisualData(): void { return; } ; + + /** + * Gets the actual minimum value of the target xAxis or yAxis + * + * @param targetName + */ + public getActualMinimumValue(targetName: Object): void { return; } ; + + /** + * Gets the actual maximum value of the target xAxis or yAxis + * + * @param targetName + */ + public getActualMaximumValue(targetName: Object): void { return; } ; + + /** + * Notifies the map that the container was resized + */ + public notifyContainerResized(): void { return; } ; + + /** + * Zoom in to the geographic region specified, when possible (may need to wait fior map to be initialized). + * + * @param rect The geographic area rectangle. + */ + public zoomToGeographic(rect: Object): Object { return; } ; + + /** + * Given the current plot area of the control and a geographic region, get the WindowRect that would encompass that geographic region. + * + * @param rect The geographic area rectangle. + */ + public getGeographicFromZoom(rect: Object): Object { return; } ; + + /** + * Given the current plot area of the control and a geographic region, get the WindowRect that would encompass that geographic region. + * + * @param rect The geographic area rectangle. + */ + public getZoomFromGeographic(rect: Object): Object { return; } ; + + /** + * Creates a print preview page with the map, hiding all other elements on the page. + */ + public print(): void { return; } ; + + /** + * Indicates that a series should render, even though no option has been modified that would normally cause it to refresh. + * + * @param targetName The name of the series to render. + * @param animate Whether the change should be animated, if possible. + */ + public renderSeries(targetName: string, animate: boolean): void { return; } ; } \ No newline at end of file diff --git a/src/igpiechart/igpiechart.component.ts b/src/igpiechart/igpiechart.component.ts index 77f178a..35624dc 100644 --- a/src/igpiechart/igpiechart.component.ts +++ b/src/igpiechart/igpiechart.component.ts @@ -1,85 +1,97 @@ import { IgControlBase } from "../igcontrolbase/igcontrolbase"; -import { ElementRef, Renderer, IterableDiffers, Component, KeyValueDiffers, ChangeDetectorRef } from "@angular/core"; +import { ElementRef, Renderer, IterableDiffers, Component, KeyValueDiffers, ChangeDetectorRef, Input } from "@angular/core"; @Component({ - selector: "ig-pie-chart", - template: "", - inputs: ["widgetId", "options", "changeDetectionInterval","disabled","create","width","height","dataSource","dataSourceUrl","dataSourceType","responseDataKey","valueMemberPath","labelMemberPath","dataValue","dataLabel","labelsPosition","labelOuterColor","labelInnerColor","selectionMode","selectedItem","selectedItems","leaderLineVisibility","leaderLineType","leaderLineMargin","othersCategoryThreshold","formatLabel","othersCategoryStyle","othersCategoryType","othersCategoryText","explodedRadius","radiusFactor","allowSliceSelection","allowSliceExplosion","explodedSlices","selectedSlices","showTooltip","tooltipTemplate","legend","labelExtent","startAngle","sweepDirection","selectedStyle","brushes","outlines","legendItemTemplate","legendItemBadgeTemplate","textStyle","theme"], - outputs: ["tooltipShowing","tooltipShown","tooltipHiding","tooltipHidden","browserNotSupported","sliceClick","labelClick","selectedItemChanging","selectedItemChanged","selectedItemsChanging","selectedItemsChanged"] + selector: "ig-pie-chart", + template: "", + inputs: ["widgetId", "options", "changeDetectionInterval","disabled","create","width","height","dataSource","dataSourceUrl","dataSourceType","responseDataKey","valueMemberPath","labelMemberPath","dataValue","dataLabel","labelsPosition","labelOuterColor","labelInnerColor","selectionMode","selectedItem","selectedItems","leaderLineVisibility","leaderLineType","leaderLineMargin","othersCategoryThreshold","formatLabel","othersCategoryStyle","othersCategoryType","othersCategoryText","explodedRadius","radiusFactor","allowSliceSelection","allowSliceExplosion","explodedSlices","selectedSlices","showTooltip","tooltipTemplate","legend","labelExtent","startAngle","sweepDirection","selectedStyle","brushes","outlines","legendItemTemplate","legendItemBadgeTemplate","textStyle","theme"], + outputs: ["tooltipShowing","tooltipShown","tooltipHiding","tooltipHidden","browserNotSupported","sliceClick","labelClick","selectedItemChanging","selectedItemChanged","selectedItemsChanging","selectedItemsChanged"] }) export class IgPieChartComponent extends IgControlBase { - constructor(el: ElementRef, renderer: Renderer, differs: IterableDiffers, kvalDiffers: KeyValueDiffers, cdr: ChangeDetectorRef) { super(el, renderer, differs, kvalDiffers, cdr); } public option(): void { return; } ; + constructor(el: ElementRef, renderer: Renderer, differs: IterableDiffers, kvalDiffers: KeyValueDiffers, cdr: ChangeDetectorRef) { super(el, renderer, differs, kvalDiffers, cdr); } public option(): void { return; } ; //public option(): void { return; } ; + @Input() + public set dataSource(value: any) { + this._dataSource = value; + const chart = jQuery(this._el).data(this._widgetName); + if (chart) { + jQuery(this._el)[this._widgetName]("option", "dataSource", this._dataSource); + } + }; + + private _dataSource: any; + ngOnInit() { - Object.defineProperty(this, "dataSource", { - set: this.createSetter("dataSource"), - enumerable: true, - configurable: true - }); + if (this._dataSource === null || this._dataSource === undefined) { + this._dataSource = this.options["dataSource"]; + } + if (!this.options["dataSource"] && this._dataSource) { + this.options["dataSource"] = this._dataSource; + } super.ngOnInit(); } - /** - * Adds a new item to the data source and notifies the chart. - * - * @param item the new item that will be added to the data source. - */ - public addItem(item: Object): void { return; } ; + /** + * Adds a new item to the data source and notifies the chart. + * + * @param item the new item that will be added to the data source. + */ + public addItem(item: Object): void { return; } ; - /** - * Inserts a new item to the data source and notifies the chart. - * - * @param item the new item that will be inserted in the data source. - * @param index The index in the data source where the new item will be inserted. - */ - public insertItem(item: Object, index: number): void { return; } ; + /** + * Inserts a new item to the data source and notifies the chart. + * + * @param item the new item that will be inserted in the data source. + * @param index The index in the data source where the new item will be inserted. + */ + public insertItem(item: Object, index: number): void { return; } ; - /** - * Deletes an item from the data source and notifies the chart. - * - * @param index The index in the data source from where the item will be been removed. - */ - public removeItem(index: number): void { return; } ; + /** + * Deletes an item from the data source and notifies the chart. + * + * @param index The index in the data source from where the item will be been removed. + */ + public removeItem(index: number): void { return; } ; - /** - * Updates an item in the data source and notifies the chart. - * - * @param index The index in the data source that we want to change. - * @param item the new item that we want to set in the data source. - */ - public setItem(index: number, item: Object): void { return; } ; + /** + * Updates an item in the data source and notifies the chart. + * + * @param index The index in the data source that we want to change. + * @param item the new item that we want to set in the data source. + */ + public setItem(index: number, item: Object): void { return; } ; - /** - * Exports the chart to a PNG image. - * - * @param width The width of the image. - * @param height The height of the image. - */ - public exportImage(width?: Object, height?: Object): Object { return; } ; + /** + * Exports the chart to a PNG image. + * + * @param width The width of the image. + * @param height The height of the image. + */ + public exportImage(width?: Object, height?: Object): Object { return; } ; - /** - * Destroys the widget. - */ - public destroy(): void { return; } ; + /** + * Destroys the widget. + */ + public destroy(): void { return; } ; - /** - * Returns the ID of parent element holding the chart. - */ - public id(): string { return; } ; + /** + * Returns the ID of parent element holding the chart. + */ + public id(): string { return; } ; - /** - * Returns the element holding the chart. - */ - public widget(): void { return; } ; + /** + * Returns the element holding the chart. + */ + public widget(): void { return; } ; - /** - * Creates a print preview page with the chart, hiding all other elements on the page. - */ - public print(): void { return; } ; + /** + * Creates a print preview page with the chart, hiding all other elements on the page. + */ + public print(): void { return; } ; - /** - * Exports visual data from the pie chart to aid in unit testing - */ - public exportVisualData(): void { return; } ; + /** + * Exports visual data from the pie chart to aid in unit testing + */ + public exportVisualData(): void { return; } ; } \ No newline at end of file diff --git a/src/igpivotdataselector/igpivotdataselector.component.ts b/src/igpivotdataselector/igpivotdataselector.component.ts index 0195691..63d8b3d 100644 --- a/src/igpivotdataselector/igpivotdataselector.component.ts +++ b/src/igpivotdataselector/igpivotdataselector.component.ts @@ -1,34 +1,46 @@ -import { Component, ElementRef, Renderer, IterableDiffers, KeyValueDiffers, ChangeDetectorRef } from "@angular/core"; +import { Component, ElementRef, Renderer, IterableDiffers, KeyValueDiffers, ChangeDetectorRef, Input } from "@angular/core"; import { IgControlBase } from "../igcontrolbase/igcontrolbase"; @Component({ - selector: "ig-pivot-data-selector", - template: "", - inputs: ["widgetId", "options", "changeDetectionInterval","disabled","create","width","height","dataSource","dataSourceOptions","deferUpdate","dragAndDropSettings","dropDownParent","disableRowsDropArea","disableColumnsDropArea","disableMeasuresDropArea","disableFiltersDropArea","customMoveValidation"], - outputs: ["dataSelectorRendered","dataSourceInitialized","dataSourceUpdated","deferUpdateChanged","dragStart","drag","dragStop","metadataDropping","metadataDropped","metadataRemoving","metadataRemoved","filterDropDownOpening","filterDropDownOpened","filterMembersLoaded","filterDropDownOk","filterDropDownClosing","filterDropDownClosed"] + selector: "ig-pivot-data-selector", + template: "", + inputs: ["widgetId", "options", "changeDetectionInterval","disabled","create","width","height","dataSource","dataSourceOptions","deferUpdate","dragAndDropSettings","dropDownParent","disableRowsDropArea","disableColumnsDropArea","disableMeasuresDropArea","disableFiltersDropArea","customMoveValidation"], + outputs: ["dataSelectorRendered","dataSourceInitialized","dataSourceUpdated","deferUpdateChanged","dragStart","drag","dragStop","metadataDropping","metadataDropped","metadataRemoving","metadataRemoved","filterDropDownOpening","filterDropDownOpened","filterMembersLoaded","filterDropDownOk","filterDropDownClosing","filterDropDownClosed"] }) export class IgPivotDataSelectorComponent extends IgControlBase { - constructor(el: ElementRef, renderer: Renderer, differs: IterableDiffers, kvalDiffers: KeyValueDiffers, cdr: ChangeDetectorRef) { super(el, renderer, differs, kvalDiffers, cdr); } public option(): void { return; } ; + constructor(el: ElementRef, renderer: Renderer, differs: IterableDiffers, kvalDiffers: KeyValueDiffers, cdr: ChangeDetectorRef) { super(el, renderer, differs, kvalDiffers, cdr); } public option(): void { return; } ; + + @Input() + public set dataSource(value: any) { + this._dataSource = value; + const widget = jQuery(this._el).data(this._widgetName); + if (widget) { + jQuery(this._el)[this._widgetName]("option", "dataSource", this._dataSource); + } + }; + + private _dataSource: any; ngOnInit() { - Object.defineProperty(this, "dataSource", { - set: this.createSetter("dataSource"), - enumerable: true, - configurable: true - }); + if (this._dataSource === null || this._dataSource === undefined) { + this._dataSource = this.options["dataSource"]; + } + if (!this.options["dataSource"] && this._dataSource) { + this.options["dataSource"] = this._dataSource; + } super.ngOnInit(); } - /** - * Updates the data source. - */ - public update(): void { return; } ; + /** + * Updates the data source. + */ + public update(): void { return; } ; - /** - * Destroy is part of the jQuery UI widget API and does the following: - * 1. Remove custom CSS classes that were added. - * 2. Unwrap any wrapping elements such as scrolling divs and other containers. - * 3. Unbind all events that were bound. - */ - public destroy(): void { return; } ; + /** + * Destroy is part of the jQuery UI widget API and does the following: + * 1. Remove custom CSS classes that were added. + * 2. Unwrap any wrapping elements such as scrolling divs and other containers. + * 3. Unbind all events that were bound. + */ + public destroy(): void { return; } ; } \ No newline at end of file diff --git a/src/igpivotgrid/igpivotgrid.component.ts b/src/igpivotgrid/igpivotgrid.component.ts index 03ef2e4..f3077b9 100644 --- a/src/igpivotgrid/igpivotgrid.component.ts +++ b/src/igpivotgrid/igpivotgrid.component.ts @@ -1,75 +1,86 @@ -import { Component, Renderer, ElementRef, IterableDiffers, KeyValueDiffers, ChangeDetectorRef } from "@angular/core"; +import { Component, Renderer, ElementRef, IterableDiffers, KeyValueDiffers, ChangeDetectorRef, Input } from "@angular/core"; import { IgControlBase } from "../igcontrolbase/igcontrolbase"; @Component({ - selector: "ig-pivot-grid", - template: "", - inputs: ["widgetId", "options", "changeDetectionInterval","disabled","create","width","height","dataSource","dataSourceOptions","deferUpdate","isParentInFrontForColumns","isParentInFrontForRows","compactColumnHeaders","compactRowHeaders","rowHeadersLayout","compactColumnHeaderIndentation","compactRowHeaderIndentation","rowHeaderLinkGroupIndentation","treeRowHeaderIndentation","defaultRowHeaderWidth","allowSorting","firstSortDirection","allowHeaderRowsSorting","allowHeaderColumnsSorting","levelSortDirections","defaultLevelSortBehavior","firstLevelSortDirection","gridOptions","dragAndDropSettings","dropDownParent","disableRowsDropArea","disableColumnsDropArea","disableMeasuresDropArea","disableFiltersDropArea","hideRowsDropArea","hideColumnsDropArea","hideMeasuresDropArea","hideFiltersDropArea","customMoveValidation"], - outputs: ["dataSourceInitialized","dataSourceUpdated","pivotGridHeadersRendered","pivotGridRendered","tupleMemberExpanding","tupleMemberExpanded","tupleMemberCollapsing","tupleMemberCollapsed","sorting","sorted","headersSorting","headersSorted","dragStart","drag","dragStop","metadataDropping","metadataDropped","metadataRemoving","metadataRemoved","filterDropDownOpening","filterDropDownOpened","filterMembersLoaded","filterDropDownOk","filterDropDownClosing","filterDropDownClosed"] + selector: "ig-pivot-grid", + template: "", + inputs: ["widgetId", "options", "changeDetectionInterval","disabled","create","width","height","dataSource","dataSourceOptions","deferUpdate","isParentInFrontForColumns","isParentInFrontForRows","compactColumnHeaders","compactRowHeaders","rowHeadersLayout","compactColumnHeaderIndentation","compactRowHeaderIndentation","rowHeaderLinkGroupIndentation","treeRowHeaderIndentation","defaultRowHeaderWidth","allowSorting","firstSortDirection","allowHeaderRowsSorting","allowHeaderColumnsSorting","levelSortDirections","defaultLevelSortBehavior","firstLevelSortDirection","gridOptions","dragAndDropSettings","dropDownParent","disableRowsDropArea","disableColumnsDropArea","disableMeasuresDropArea","disableFiltersDropArea","hideRowsDropArea","hideColumnsDropArea","hideMeasuresDropArea","hideFiltersDropArea","customMoveValidation"], + outputs: ["dataSourceInitialized","dataSourceUpdated","pivotGridHeadersRendered","pivotGridRendered","tupleMemberExpanding","tupleMemberExpanded","tupleMemberCollapsing","tupleMemberCollapsed","sorting","sorted","headersSorting","headersSorted","dragStart","drag","dragStop","metadataDropping","metadataDropped","metadataRemoving","metadataRemoved","filterDropDownOpening","filterDropDownOpened","filterMembersLoaded","filterDropDownOk","filterDropDownClosing","filterDropDownClosed"] }) export class IgPivotGridComponent extends IgControlBase { - constructor(el: ElementRef, renderer: Renderer, differs: IterableDiffers, kvalDiffers: KeyValueDiffers, cdr: ChangeDetectorRef) { super(el, renderer, differs, kvalDiffers, cdr); } public option(): void { return; } ; + constructor(el: ElementRef, renderer: Renderer, differs: IterableDiffers, kvalDiffers: KeyValueDiffers, cdr: ChangeDetectorRef) { super(el, renderer, differs, kvalDiffers, cdr); } public option(): void { return; } ; + + @Input() + public set dataSource(value: any) { + this._dataSource = value; + const widget = jQuery(this._el).data(this._widgetName); + if (widget) { + jQuery(this._el)[this._widgetName]("option", "dataSource", this._dataSource); + } + }; + + private _dataSource: any; ngOnInit() { - Object.defineProperty(this, "dataSource", { - set: this.createSetter("dataSource"), - enumerable: true, - configurable: true - }); + if (this._dataSource === null || this._dataSource === undefined) { + this._dataSource = this.options["dataSource"]; + } + if (!this.options["dataSource"] && this._dataSource) { + this.options["dataSource"] = this._dataSource; + } super.ngOnInit(); } - /** - * Returns the igGrid instance used to render the OLAP data. - */ - public grid(): Object { return; } ; - - /** - * Triggers an update on the data source and the igPivotGrid. - */ - public updateGrid(): void { return; } ; + /** + * Returns the igGrid instance used to render the OLAP data. + */ + public grid(): Object { return; } ; - /** - * Expands a member from the data source and returns true if the expand succeeds. If the data source has a pending update, the method will return false. Note that igPivotGrid to will display the expanded result after the data source is updated. - * - * @param tupleLocation The name of the parent axis - 'columnAxis' or 'rowAxis'. - * @param tupleIndex The index of the containing tuple. This index should correspond to the position of the tuple in the original unsorted result of the data source. - * @param memberIndex The index of the member in the tuple. This index should correspond to the position of the member in the original unsorted result of the data source. - * @param shouldUpdate A flag indicating whether the data source should be updated after the expand. - */ - public expandTupleMember(tupleLocation: string, tupleIndex: number, memberIndex: number, shouldUpdate?: boolean): boolean { return; } ; + /** + * Triggers an update on the data source and the igPivotGrid. + */ + public updateGrid(): void { return; } ; - /** - * Collapses a member from the data source and returns true if the collapse succeeds. If the data source has a pending update, the method will return false. Note that igPivotGrid to will display the expanded result after the data source is updated. - * - * @param tupleLocation The name of the parent axis - 'columnAxis' or 'rowAxis'. - * @param tupleIndex The index of the containing tuple. This index should correspond to the position of the tuple in the original unsorted result of the data source. - * @param memberIndex The index of the member in the tuple. This index should correspond to the position of the member in the original unsorted result of the data source. - * @param shouldUpdate A flag indicating whether the data source should be updated after the expand. - */ - public collapseTupleMember(tupleLocation: string, tupleIndex: number, memberIndex: number, shouldUpdate?: boolean): boolean { return; } ; + /** + * Expands a member from the data source and returns true if the expand succeeds. If the data source has a pending update, the method will return false. Note that igPivotGrid to will display the expanded result after the data source is updated. + * + * @param tupleLocation The name of the parent axis - 'columnAxis' or 'rowAxis'. + * @param tupleIndex The index of the containing tuple. This index should correspond to the position of the tuple in the original unsorted result of the data source. + * @param memberIndex The index of the member in the tuple. This index should correspond to the position of the member in the original unsorted result of the data source. + * @param shouldUpdate A flag indicating whether the data source should be updated after the expand. + */ + public expandTupleMember(tupleLocation: string, tupleIndex: number, memberIndex: number, shouldUpdate?: boolean): boolean { return; } ; - /** - * Returns an array with the applied sort directions on the igPivotGrid's columns. The returned array contains objects with the following properties: - * memberNames: The names of the members in the tuple. - * tupleIndex: The index of the tuple on the column axis in the original unsorted result. - * sortDirection: The direction of the sort - ascending or descending. - */ - public appliedColumnSortDirections(): any[] { return; } ; + /** + * Collapses a member from the data source and returns true if the collapse succeeds. If the data source has a pending update, the method will return false. Note that igPivotGrid to will display the expanded result after the data source is updated. + * + * @param tupleLocation The name of the parent axis - 'columnAxis' or 'rowAxis'. + * @param tupleIndex The index of the containing tuple. This index should correspond to the position of the tuple in the original unsorted result of the data source. + * @param memberIndex The index of the member in the tuple. This index should correspond to the position of the member in the original unsorted result of the data source. + * @param shouldUpdate A flag indicating whether the data source should be updated after the expand. + */ + public collapseTupleMember(tupleLocation: string, tupleIndex: number, memberIndex: number, shouldUpdate?: boolean): boolean { return; } ; - /** - * Returns an array with the applied level sort direction items, which were used for the sorting of the header cells. The returned array contains objects with the following properties: - * levelUniqueName: Specifies the unique name of the level, which was sorted. - * sortDirection: The direction of the header sort - ascending or descending. - */ - public appliedLevelSortDirections(): any[] { return; } ; + /** + * Returns an array with the applied sort directions on the igPivotGrid's columns. The returned array contains objects with the following properties: + * memberNames: The names of the members in the tuple. + * tupleIndex: The index of the tuple on the column axis in the original unsorted result. + * sortDirection: The direction of the sort - ascending or descending. + */ + public appliedColumnSortDirections(): any[] { return; } ; - /** - * Destroy is part of the jQuery UI widget API and does the following: - * 1. Remove custom CSS classes that were added. - * 2. Unwrap any wrapping elements such as scrolling divs and other containers. - * 3. Unbind all events that were bound. - */ - public destroy(): void { return; } ; - } + /** + * Returns an array with the applied level sort direction items, which were used for the sorting of the header cells. The returned array contains objects with the following properties: + * levelUniqueName: Specifies the unique name of the level, which was sorted. + * sortDirection: The direction of the header sort - ascending or descending. + */ + public appliedLevelSortDirections(): any[] { return; } ; + /** + * Destroy is part of the jQuery UI widget API and does the following: + * 1. Remove custom CSS classes that were added. + * 2. Unwrap any wrapping elements such as scrolling divs and other containers. + * 3. Unbind all events that were bound. + */ + public destroy(): void { return; } ; +} diff --git a/src/igsparkline/igsparkline.component.ts b/src/igsparkline/igsparkline.component.ts index c6403dd..f489a3d 100644 --- a/src/igsparkline/igsparkline.component.ts +++ b/src/igsparkline/igsparkline.component.ts @@ -1,25 +1,37 @@ -import { Component, ElementRef, Renderer, IterableDiffers, KeyValueDiffers, ChangeDetectorRef } from "@angular/core"; +import { Component, ElementRef, Renderer, IterableDiffers, KeyValueDiffers, ChangeDetectorRef, Input } from "@angular/core"; import { IgControlBase } from "../igcontrolbase/igcontrolbase"; @Component({ - selector: "ig-sparkline", - template: "", - inputs: ["widgetId", "options", "changeDetectionInterval","disabled","create","width","height","tooltipTemplate","maxRecCount","dataSource","dataSourceType","dataSourceUrl","responseTotalRecCountKey","responseDataKey","brush","negativeBrush","markerBrush","negativeMarkerBrush","firstMarkerBrush","lastMarkerBrush","highMarkerBrush","lowMarkerBrush","trendLineBrush","horizontalAxisBrush","verticalAxisBrush","normalRangeFill","horizontalAxisVisibility","verticalAxisVisibility","markerVisibility","negativeMarkerVisibility","firstMarkerVisibility","lastMarkerVisibility","lowMarkerVisibility","highMarkerVisibility","normalRangeVisibility","displayNormalRangeInFront","markerSize","firstMarkerSize","lastMarkerSize","highMarkerSize","lowMarkerSize","negativeMarkerSize","lineThickness","valueMemberPath","labelMemberPath","trendLineType","trendLinePeriod","trendLineThickness","normalRangeMinimum","normalRangeMaximum","displayType","unknownValuePlotting","verticalAxisLabel","horizontalAxisLabel","formatLabel","pixelScalingRatio"], - outputs: ["dataBinding","dataBound","updateTooltip","hideTooltip"] + selector: "ig-sparkline", + template: "", + inputs: ["widgetId", "options", "changeDetectionInterval","disabled","create","width","height","tooltipTemplate","maxRecCount","dataSource","dataSourceType","dataSourceUrl","responseTotalRecCountKey","responseDataKey","brush","negativeBrush","markerBrush","negativeMarkerBrush","firstMarkerBrush","lastMarkerBrush","highMarkerBrush","lowMarkerBrush","trendLineBrush","horizontalAxisBrush","verticalAxisBrush","normalRangeFill","horizontalAxisVisibility","verticalAxisVisibility","markerVisibility","negativeMarkerVisibility","firstMarkerVisibility","lastMarkerVisibility","lowMarkerVisibility","highMarkerVisibility","normalRangeVisibility","displayNormalRangeInFront","markerSize","firstMarkerSize","lastMarkerSize","highMarkerSize","lowMarkerSize","negativeMarkerSize","lineThickness","valueMemberPath","labelMemberPath","trendLineType","trendLinePeriod","trendLineThickness","normalRangeMinimum","normalRangeMaximum","displayType","unknownValuePlotting","verticalAxisLabel","horizontalAxisLabel","formatLabel","pixelScalingRatio"], + outputs: ["dataBinding","dataBound","updateTooltip","hideTooltip"] }) export class IgSparklineComponent extends IgControlBase { - constructor(el: ElementRef, renderer: Renderer, differs: IterableDiffers, kvalDiffers: KeyValueDiffers, cdr: ChangeDetectorRef) { - super(el, renderer, differs, kvalDiffers, cdr); + constructor(el: ElementRef, renderer: Renderer, differs: IterableDiffers, kvalDiffers: KeyValueDiffers, cdr: ChangeDetectorRef) { + super(el, renderer, differs, kvalDiffers, cdr); } + @Input() + public set dataSource(value: any) { + this._dataSource = value; + const widget = jQuery(this._el).data(this._widgetName); + if (widget) { + jQuery(this._el)[this._widgetName]("option", "dataSource", this._dataSource); + } + }; + + private _dataSource: any; + ngOnInit() { - Object.defineProperty(this, "dataSource", { - set: this.createSetter("dataSource"), - enumerable: true, - configurable: true - }); + if (this._dataSource === null || this._dataSource === undefined) { + this._dataSource = this.options["dataSource"]; + } + if (!this.options["dataSource"] && this._dataSource) { + this.options["dataSource"] = this._dataSource; + } super.ngOnInit(); } - public destroy(): void { return; } ; + public destroy(): void { return; } ; } \ No newline at end of file diff --git a/src/igtilemanager/igtilemanager.component.ts b/src/igtilemanager/igtilemanager.component.ts index 9e6aa76..756988e 100644 --- a/src/igtilemanager/igtilemanager.component.ts +++ b/src/igtilemanager/igtilemanager.component.ts @@ -1,4 +1,4 @@ -import { ElementRef, Renderer, IterableDiffers, Component, KeyValueDiffers, ChangeDetectorRef } from "@angular/core"; +import { ElementRef, Renderer, IterableDiffers, Component, KeyValueDiffers, ChangeDetectorRef, Input } from "@angular/core"; import { IgContentControlBase } from "../igcontrolbase/igcontentcontrolbase"; @Component({ @@ -12,12 +12,24 @@ export class IgTileManagerComponent extends IgContentControlBase super(el, renderer, differs, kvalDiffers, cdr); } + @Input() + public set dataSource(value: any) { + this._dataSource = value; + const widget = jQuery(this._el).data(this._widgetName); + if (widget) { + jQuery(this._el)[this._widgetName]("option", "dataSource", this._dataSource); + } + }; + + private _dataSource: any; + ngOnInit() { - Object.defineProperty(this, "dataSource", { - set: this.createSetter("dataSource"), - enumerable: true, - configurable: true - }); + if (this._dataSource === null || this._dataSource === undefined) { + this._dataSource = this.options["dataSource"]; + } + if (!this.options["dataSource"] && this._dataSource) { + this.options["dataSource"] = this._dataSource; + } super.ngOnInit(); } diff --git a/tests/unit/igdatachart/chart.spec.ts b/tests/unit/igdatachart/chart.spec.ts index d7633c3..a612819 100644 --- a/tests/unit/igdatachart/chart.spec.ts +++ b/tests/unit/igdatachart/chart.spec.ts @@ -81,6 +81,22 @@ export function main() { done(); }); }); + + it('should allow initializing data source as a top level option', (done) => { + var template = '
'; + TestBed.overrideComponent(TestComponent, { + set: { + template: template + } + }); + TestBed.compileComponents().then(() => { + let fixture = TestBed.createComponent(TestComponent); + fixture.detectChanges(); + expect($(fixture.debugElement.nativeElement).find("#datachart1").igDataChart("option", "dataSource")[0].Pop1995) + .toBe(1216); + done(); + }); + }); }); } @@ -91,6 +107,7 @@ export function main() { class TestComponent { public opts: any; public opts1: any; + public opts2: any; private zoombarOpts: any; public data: Array; @ViewChild(Infragistics.IgDataChartComponent) public viewChild: Infragistics.IgDataChartComponent; @@ -153,6 +170,29 @@ class TestComponent { valueMemberPath: "Pop2015" }] }; + this.opts2 = { + axes: [{ + name: "NameAxis", + type: "categoryX", + title: "Country", + label: "CountryName" + }, + { + name: "PopulationAxis", + type: "numericY", + minimumvalue: 0, + title: "Milions of People" + }], + series: [{ + name: "2015Population", + type: "column", + isHighlightingEnabled: true, + isTransitionInEnabled: true, + xAxis: "NameAxis", + yAxis: "PopulationAxis", + valueMemberPath: "Pop2015" + }] + }; this.zoombarOpts = { target: "#datachart1" }; diff --git a/tests/unit/igdoughnutchart/doughnutchart.spec.ts b/tests/unit/igdoughnutchart/doughnutchart.spec.ts index 631904c..99797b1 100644 --- a/tests/unit/igdoughnutchart/doughnutchart.spec.ts +++ b/tests/unit/igdoughnutchart/doughnutchart.spec.ts @@ -10,10 +10,10 @@ export function main() { declarations: [Infragistics.IgDoughnutChartComponent, TestComponent] }); }); - + it('should initialize correctly', (done) => { - var template = '
'; - TestBed.overrideComponent(TestComponent, { + var template = '
'; + TestBed.overrideComponent(TestComponent, { set: { template: template } @@ -25,6 +25,22 @@ export function main() { done(); }); }); + + it('should allow initializing data source as a top level option', (done) => { + var template = '
'; + TestBed.overrideComponent(TestComponent, { + set: { + template: template + } + }); + TestBed.compileComponents().then(() => { + let fixture = TestBed.createComponent(TestComponent); + fixture.detectChanges(); + expect($(fixture.debugElement.nativeElement).find("#chart1").igDoughnutChart("option", "dataSource")[0].Pop1990) + .toBe(1141); + done(); + }); + }); }); } @@ -34,28 +50,28 @@ export function main() { }) class TestComponent { private opts: any; - private data:any; - + private data: any; + @ViewChild(Infragistics.IgDoughnutChartComponent) public viewChild: Infragistics.IgDoughnutChartComponent; - + constructor() { this.data = [ - { "CountryName": "China", "Pop1990": 1141, "Pop2008": 1333, "Pop2025": 1458 }, - { "CountryName": "India", "Pop1990": 849, "Pop2008": 1140, "Pop2025": 1398 }, - { "CountryName": "United States", "Pop1990": 250, "Pop2008": 304, "Pop2025": 352 }, - { "CountryName": "Indonesia", "Pop1990": 178, "Pop2008": 228, "Pop2025": 273 }, - { "CountryName": "Brazil", "Pop1990": 150, "Pop2008": 192, "Pop2025": 223 } - ]; + { "CountryName": "China", "Pop1990": 1141, "Pop2008": 1333, "Pop2025": 1458 }, + { "CountryName": "India", "Pop1990": 849, "Pop2008": 1140, "Pop2025": 1398 }, + { "CountryName": "United States", "Pop1990": 250, "Pop2008": 304, "Pop2025": 352 }, + { "CountryName": "Indonesia", "Pop1990": 178, "Pop2008": 228, "Pop2025": 273 }, + { "CountryName": "Brazil", "Pop1990": 150, "Pop2008": 192, "Pop2025": 223 } + ]; this.opts = { width: "500px", - height: "500px", - series: - [{ - name: "Pop1990", - labelMemberPath: "CountryName", - valueMemberPath: "Pop1990", - dataSource: this.data - }] - }; + height: "500px", + series: + [{ + name: "Pop1990", + labelMemberPath: "CountryName", + valueMemberPath: "Pop1990", + dataSource: this.data + }] + }; } } \ No newline at end of file diff --git a/tests/unit/igfunnerchart/funnelchart.spec.ts b/tests/unit/igfunnerchart/funnelchart.spec.ts index 2ac4155..75477f2 100644 --- a/tests/unit/igfunnerchart/funnelchart.spec.ts +++ b/tests/unit/igfunnerchart/funnelchart.spec.ts @@ -26,6 +26,22 @@ export function main() { done(); }); }); + + it('should allow initializing data source as a top level option', (done) => { + var template = '
'; + TestBed.overrideComponent(TestComponent, { + set: { + template: template + } + }); + TestBed.compileComponents().then(() => { + let fixture = TestBed.createComponent(TestComponent); + fixture.detectChanges(); + expect($(fixture.debugElement.nativeElement).find("#chart1").igFunnelChart("option", "dataSource")[0].Budget) + .toBe(30); + done(); + }); + }); }); } diff --git a/tests/unit/igmap/map.spec.ts b/tests/unit/igmap/map.spec.ts index 58e0015..9533f81 100644 --- a/tests/unit/igmap/map.spec.ts +++ b/tests/unit/igmap/map.spec.ts @@ -27,6 +27,22 @@ export function main() { done(); }); }); + + it('should allow initializing data source as a top level option', (done) => { + var template = '
'; + TestBed.overrideComponent(TestComponent, { + set: { + template: template + } + }); + TestBed.compileComponents().then(() => { + let fixture = TestBed.createComponent(TestComponent); + fixture.detectChanges(); + expect($(fixture.debugElement.nativeElement).find("#map1").igMap("option", "dataSource")[0].Latitude) + .toBe(52.21); + done(); + }); + }); }); } @@ -37,6 +53,9 @@ export function main() { class TestComponent { @ViewChild(Infragistics.IgMapComponent) public viewChild: Infragistics.IgMapComponent; + data: any[]; + constructor() { + this.data = [{ Name: "Warsaw", Country: "Poland", Latitude: 52.21, Longitude: 21 }]; } } \ No newline at end of file diff --git a/tests/unit/igpiechart/piechart.spec.ts b/tests/unit/igpiechart/piechart.spec.ts index e79fd72..d199559 100644 --- a/tests/unit/igpiechart/piechart.spec.ts +++ b/tests/unit/igpiechart/piechart.spec.ts @@ -27,6 +27,22 @@ export function main() { done(); }); }); + + it('should allow initializing data source as a top level option', (done) => { + var template = '
'; + TestBed.overrideComponent(TestComponent, { + set: { + template: template + } + }); + TestBed.compileComponents().then(() => { + let fixture = TestBed.createComponent(TestComponent); + fixture.detectChanges(); + expect($(fixture.debugElement.nativeElement).find("#chart1").igPieChart("option", "dataSource")[0].Budget) + .toBe(60); + done(); + }); + }); }); } diff --git a/tests/unit/igpivotdataselector/pivotdataselector.spec.ts b/tests/unit/igpivotdataselector/pivotdataselector.spec.ts index 7e9d1e9..f227c50 100644 --- a/tests/unit/igpivotdataselector/pivotdataselector.spec.ts +++ b/tests/unit/igpivotdataselector/pivotdataselector.spec.ts @@ -28,6 +28,22 @@ export function main() { }); }); + it('should allow initializing data source as a top level option', (done) => { + var template = '
'; + TestBed.overrideComponent(TestComponent, { + set: { + template: template + } + }); + TestBed.compileComponents().then(() => { + let fixture = TestBed.createComponent(TestComponent); + fixture.detectChanges(); + expect($(fixture.debugElement.nativeElement).find("#pds").igPivotDataSelector("option", "dataSource")[0].UnitPrice) + .toBe(12.81); + done(); + }); + }); + }); } diff --git a/tests/unit/igpivotgrid/pivotgrid.spec.ts b/tests/unit/igpivotgrid/pivotgrid.spec.ts index 0b5c38e..4638299 100644 --- a/tests/unit/igpivotgrid/pivotgrid.spec.ts +++ b/tests/unit/igpivotgrid/pivotgrid.spec.ts @@ -27,6 +27,21 @@ export function main() { done(); }); }); + it('should allow initializing data source as a top level option', (done) => { + var template = '
'; + TestBed.overrideComponent(TestComponent, { + set: { + template: template + } + }); + TestBed.compileComponents().then(() => { + let fixture = TestBed.createComponent(TestComponent); + fixture.detectChanges(); + expect($(fixture.debugElement.nativeElement).find("#pivot1").igPivotGrid("option", "dataSource")[0].UnitPrice) + .toBe(12.81); + done(); + }); + }); }); } diff --git a/tests/unit/igsparkline/sparkline.spec.ts b/tests/unit/igsparkline/sparkline.spec.ts index 2d6a841..e74d1b8 100644 --- a/tests/unit/igsparkline/sparkline.spec.ts +++ b/tests/unit/igsparkline/sparkline.spec.ts @@ -29,6 +29,21 @@ export function main() { }); }); + it('should allow initializing data source as a top level option', (done) => { + var template = '
'; + TestBed.overrideComponent(TestComponent, { + set: { + template: template + } + }); + TestBed.compileComponents().then(() => { + let fixture = TestBed.createComponent(TestComponent); + fixture.detectChanges(); + expect($(fixture.debugElement.nativeElement).find("#sparkLine").igSparkline("option", "dataSource")[0].ExtendedPrice) + .toBe(168.0000); + done(); + }); + }); }); } @@ -38,10 +53,13 @@ export function main() { }) class TestComponent { private opts: any; + private data: any[]; @ViewChild(Infragistics.IgSparklineComponent) public viewChild: Infragistics.IgSparklineComponent; constructor() { + this.data = [{ "OrderDate": "\/Date(836452800000)\/", "ExtendedPrice": 168.0000, "Freight": 32.3800 }]; + this.opts = { dataSource: [ { "OrderDate": "\/Date(836452800000)\/", "ExtendedPrice": 168.0000, "Freight": 32.3800 }, diff --git a/tests/unit/igtilemanager/tilemanager.spec.ts b/tests/unit/igtilemanager/tilemanager.spec.ts index babb8f4..4563c79 100644 --- a/tests/unit/igtilemanager/tilemanager.spec.ts +++ b/tests/unit/igtilemanager/tilemanager.spec.ts @@ -28,6 +28,22 @@ export function main() { done(); }); }); + + it('should allow initializing data source as a top level option', (done) => { + var template = '
'; + TestBed.overrideComponent(TestComponent, { + set: { + template: template + } + }); + TestBed.compileComponents().then(() => { + let fixture = TestBed.createComponent(TestComponent); + fixture.detectChanges(); + expect($(fixture.debugElement.nativeElement).find("#tm1").igTileManager("option", "dataSource").data()[0].name) + .toBe("foo"); + done(); + }); + }); }); } @@ -38,10 +54,13 @@ export function main() { class TestComponent { private opts: any; private cdi = 10; + data: any[]; @ViewChild(Infragistics.IgTileManagerComponent) public viewChild: Infragistics.IgTileManagerComponent; constructor() { + this.data = [{name:"foo"}]; + this.opts = { //dataSource: candidates.getData(), marginLeft: 10,