/*! * devextreme-angular-test * Version: 17.2.8 * Build date: Mon Feb 05 2018 * * Copyright (c) 2012 - 2018 Developer Express Inc. ALL RIGHTS RESERVED * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file in the root of the project for details. * * https://github.com/DevExpress/devextreme-angular */ import { Component, NgModule, ElementRef, NgZone, Input, Output, OnDestroy, Injector, EventEmitter, OnChanges, DoCheck, SimpleChanges, ContentChildren, QueryList } from '@angular/core'; import DevExpress from 'devextreme/bundles/dx.all'; import DxPolarChart from 'devextreme/viz/polar_chart'; import { DxComponent } from '../core/component'; import { DxTemplateHost } from '../core/template-host'; import { DxTemplateModule } from '../core/template'; import { EventsRegistrator } from '../core/events-strategy'; import { NestedOptionHost } from '../core/nested-option'; import { WatcherHelper } from '../core/watcher-helper'; import { IterableDifferHelper } from '../core/iterable-differ-helper'; import { DxoAdaptiveLayoutModule } from './nested/adaptive-layout'; import { DxoAnimationModule } from './nested/animation'; import { DxoArgumentAxisModule } from './nested/argument-axis'; import { DxiConstantLineModule } from './nested/constant-line-dxi'; import { DxoLabelModule } from './nested/label'; import { DxoFontModule } from './nested/font'; import { DxoConstantLineStyleModule } from './nested/constant-line-style'; import { DxoGridModule } from './nested/grid'; import { DxoFormatModule } from './nested/format'; import { DxoMinorGridModule } from './nested/minor-grid'; import { DxoMinorTickModule } from './nested/minor-tick'; import { DxoMinorTickIntervalModule } from './nested/minor-tick-interval'; import { DxiStripModule } from './nested/strip-dxi'; import { DxoStripStyleModule } from './nested/strip-style'; import { DxoTickModule } from './nested/tick'; import { DxoTickIntervalModule } from './nested/tick-interval'; import { DxoCommonAxisSettingsModule } from './nested/common-axis-settings'; import { DxoCommonSeriesSettingsModule } from './nested/common-series-settings'; import { DxoAreaModule } from './nested/area'; import { DxoBorderModule } from './nested/border'; import { DxoHoverStyleModule } from './nested/hover-style'; import { DxoHatchingModule } from './nested/hatching'; import { DxoConnectorModule } from './nested/connector'; import { DxoPointModule } from './nested/point'; import { DxoImageModule } from './nested/image'; import { DxoSelectionStyleModule } from './nested/selection-style'; import { DxoValueErrorBarModule } from './nested/value-error-bar'; import { DxoBarModule } from './nested/bar'; import { DxoArgumentFormatModule } from './nested/argument-format'; import { DxoLineModule } from './nested/line'; import { DxoScatterModule } from './nested/scatter'; import { DxoStackedbarModule } from './nested/stackedbar'; import { DxoDataPrepareSettingsModule } from './nested/data-prepare-settings'; import { DxoExportModule } from './nested/export'; import { DxoLegendModule } from './nested/legend'; import { DxoMarginModule } from './nested/margin'; import { DxoLoadingIndicatorModule } from './nested/loading-indicator'; import { DxiSeriesModule } from './nested/series-dxi'; import { DxoSeriesTemplateModule } from './nested/series-template'; import { DxoSizeModule } from './nested/size'; import { DxoTitleModule } from './nested/title'; import { DxoSubtitleModule } from './nested/subtitle'; import { DxoTooltipModule } from './nested/tooltip'; import { DxoShadowModule } from './nested/shadow'; import { DxoValueAxisModule } from './nested/value-axis'; import { DxiSeriesComponent } from './nested/series-dxi'; /** * The PolarChart is a widget that visualizes data in a polar coordinate system. */ @Component({ selector: 'dx-polar-chart', template: '', styles: [ ' :host { display: block; }'], providers: [ DxTemplateHost, WatcherHelper, NestedOptionHost, IterableDifferHelper ] }) export class DxPolarChartComponent extends DxComponent implements OnDestroy, OnChanges, DoCheck { instance: DxPolarChart; /** * Specifies adaptive layout options. */ @Input() get adaptiveLayout(): any { return this._getOption('adaptiveLayout'); } set adaptiveLayout(value: any) { this._setOption('adaptiveLayout', value); } /** * Specifies animation options. */ @Input() get animation(): boolean| { duration?: number, easing?: string, enabled?: boolean, maxPointCountSupported?: number } { return this._getOption('animation'); } set animation(value: boolean| { duration?: number, easing?: string, enabled?: boolean, maxPointCountSupported?: number }) { this._setOption('animation', value); } /** * Specifies argument axis options for the PolarChart widget. */ @Input() get argumentAxis(): any { return this._getOption('argumentAxis'); } set argumentAxis(value: any) { this._setOption('argumentAxis', value); } /** * Specifies a common bar width as a percentage from 0 to 1. */ @Input() get barWidth(): number { return this._getOption('barWidth'); } set barWidth(value: number) { this._setOption('barWidth', value); } /** * An object defining the configuration options that are common for all axes of the PolarChart widget. */ @Input() get commonAxisSettings(): any { return this._getOption('commonAxisSettings'); } set commonAxisSettings(value: any) { this._setOption('commonAxisSettings', value); } /** * An object defining the configuration options that are common for all series of the PolarChart widget. */ @Input() get commonSeriesSettings(): any { return this._getOption('commonSeriesSettings'); } set commonSeriesSettings(value: any) { this._setOption('commonSeriesSettings', value); } /** * Specifies the color of the parent page element. */ @Input() get containerBackgroundColor(): string { return this._getOption('containerBackgroundColor'); } set containerBackgroundColor(value: string) { this._setOption('containerBackgroundColor', value); } /** * Customizes the appearance of an individual point label. */ @Input() get customizeLabel(): Function { return this._getOption('customizeLabel'); } set customizeLabel(value: Function) { this._setOption('customizeLabel', value); } /** * Customizes the appearance of an individual series point. */ @Input() get customizePoint(): Function { return this._getOption('customizePoint'); } set customizePoint(value: Function) { this._setOption('customizePoint', value); } /** * An object providing options for managing data from a data source. */ @Input() get dataPrepareSettings(): any { return this._getOption('dataPrepareSettings'); } set dataPrepareSettings(value: any) { this._setOption('dataPrepareSettings', value); } /** * Specifies the widget's data origin. */ @Input() get dataSource(): DevExpress.data.DataSource| DevExpress.data.DataSourceOptions| string| Array { return this._getOption('dataSource'); } set dataSource(value: DevExpress.data.DataSource| DevExpress.data.DataSourceOptions| string| Array) { this._setOption('dataSource', value); } /** * Specifies the attributes to be attached to the widget's root element. */ @Input() get elementAttr(): any { return this._getOption('elementAttr'); } set elementAttr(value: any) { this._setOption('elementAttr', value); } /** * Specifies whether or not all bars in a series must have the same angle, or may have different angles if any points in other series are missing. */ @Input() get equalBarWidth(): boolean { return this._getOption('equalBarWidth'); } set equalBarWidth(value: boolean) { this._setOption('equalBarWidth', value); } /** * Configures the exporting and printing features. */ @Input() get export(): any { return this._getOption('export'); } set export(value: any) { this._setOption('export', value); } /** * Specifies the options of a chart's legend. */ @Input() get legend(): any { return this._getOption('legend'); } set legend(value: any) { this._setOption('legend', value); } /** * Configures the loading indicator. */ @Input() get loadingIndicator(): any { return this._getOption('loadingIndicator'); } set loadingIndicator(value: any) { this._setOption('loadingIndicator', value); } /** * Generates space around the widget. */ @Input() get margin(): any { return this._getOption('margin'); } set margin(value: any) { this._setOption('margin', value); } /** * Forces the widget to treat negative values as zeroes. Applies to stacked-like series only. */ @Input() get negativesAsZeroes(): boolean { return this._getOption('negativesAsZeroes'); } set negativesAsZeroes(value: boolean) { this._setOption('negativesAsZeroes', value); } /** * Sets the name of the palette to be used in the chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ @Input() get palette(): string| Array { return this._getOption('palette'); } set palette(value: string| Array) { this._setOption('palette', value); } /** * Notifies the widget that it is embedded into an HTML page that uses a tag modifying the path. */ @Input() get pathModified(): boolean { return this._getOption('pathModified'); } set pathModified(value: boolean) { this._setOption('pathModified', value); } /** * Specifies whether a single point or multiple points can be selected in the chart. */ @Input() get pointSelectionMode(): string { return this._getOption('pointSelectionMode'); } set pointSelectionMode(value: string) { this._setOption('pointSelectionMode', value); } /** * Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ @Input() get redrawOnResize(): boolean { return this._getOption('redrawOnResize'); } set redrawOnResize(value: boolean) { this._setOption('redrawOnResize', value); } /** * Specifies how the chart must behave when series point labels overlap. */ @Input() get resolveLabelOverlapping(): string { return this._getOption('resolveLabelOverlapping'); } set resolveLabelOverlapping(value: string) { this._setOption('resolveLabelOverlapping', value); } /** * Switches the widget to a right-to-left representation. */ @Input() get rtlEnabled(): boolean { return this._getOption('rtlEnabled'); } set rtlEnabled(value: boolean) { this._setOption('rtlEnabled', value); } /** * Specifies options for PolarChart widget series. */ @Input() get series(): any| Array { return this._getOption('series'); } set series(value: any| Array) { this._setOption('series', value); } /** * Specifies whether a single series or multiple series can be selected in the chart. */ @Input() get seriesSelectionMode(): string { return this._getOption('seriesSelectionMode'); } set seriesSelectionMode(value: string) { this._setOption('seriesSelectionMode', value); } /** * Defines options for the series template. */ @Input() get seriesTemplate(): any { return this._getOption('seriesTemplate'); } set seriesTemplate(value: any) { this._setOption('seriesTemplate', value); } /** * Specifies the widget's size in pixels. */ @Input() get size(): any { return this._getOption('size'); } set size(value: any) { this._setOption('size', value); } /** * Sets the name of the theme the widget uses. */ @Input() get theme(): string { return this._getOption('theme'); } set theme(value: string) { this._setOption('theme', value); } /** * Configures the widget's title. */ @Input() get title(): string| { font?: DevExpress.viz.Font, horizontalAlignment?: string, margin?: number| { bottom?: number, left?: number, right?: number, top?: number }, placeholderSize?: number, subtitle?: string| { font?: DevExpress.viz.Font, text?: string }, text?: string, verticalAlignment?: string } { return this._getOption('title'); } set title(value: string| { font?: DevExpress.viz.Font, horizontalAlignment?: string, margin?: number| { bottom?: number, left?: number, right?: number, top?: number }, placeholderSize?: number, subtitle?: string| { font?: DevExpress.viz.Font, text?: string }, text?: string, verticalAlignment?: string }) { this._setOption('title', value); } /** * Configures tooltips. */ @Input() get tooltip(): any { return this._getOption('tooltip'); } set tooltip(value: any) { this._setOption('tooltip', value); } /** * Indicates whether or not to display a "spider web". */ @Input() get useSpiderWeb(): boolean { return this._getOption('useSpiderWeb'); } set useSpiderWeb(value: boolean) { this._setOption('useSpiderWeb', value); } /** * Specifies value axis options for the PolarChart widget. */ @Input() get valueAxis(): any { return this._getOption('valueAxis'); } set valueAxis(value: any) { this._setOption('valueAxis', value); } /** * A handler for the argumentAxisClick event. */ @Output() onArgumentAxisClick: EventEmitter; /** * A handler for the disposing event. Executed when the widget is removed from the DOM using the remove(), empty(), or html() jQuery methods only. */ @Output() onDisposing: EventEmitter; /** * A handler for the done event. */ @Output() onDone: EventEmitter; /** * A handler for the drawn event. Executed when the widget has finished drawing itself. */ @Output() onDrawn: EventEmitter; /** * A handler for the exported event. Executed after data from the widget is exported. */ @Output() onExported: EventEmitter; /** * A handler for the exporting event. Executed before data from the widget is exported. */ @Output() onExporting: EventEmitter; /** * A handler for the fileSaving event. Executed before a file with exported data is saved on the user's local storage. */ @Output() onFileSaving: EventEmitter; /** * A handler for the incidentOccurred event. Executed when an error or warning appears in the widget. */ @Output() onIncidentOccurred: EventEmitter; /** * A handler for the initialized event. Executed only once, after the widget is initialized. */ @Output() onInitialized: EventEmitter; /** * A handler for the legendClick event. */ @Output() onLegendClick: EventEmitter; /** * A handler for the optionChanged event. Executed after an option of the widget is changed. */ @Output() onOptionChanged: EventEmitter; /** * A handler for the pointClick event. */ @Output() onPointClick: EventEmitter; /** * A handler for the pointHoverChanged event. */ @Output() onPointHoverChanged: EventEmitter; /** * A handler for the pointSelectionChanged event. */ @Output() onPointSelectionChanged: EventEmitter; /** * A handler for the seriesClick event. */ @Output() onSeriesClick: EventEmitter; /** * A handler for the seriesHoverChanged event. */ @Output() onSeriesHoverChanged: EventEmitter; /** * A handler for the seriesSelectionChanged event. */ @Output() onSeriesSelectionChanged: EventEmitter; /** * A handler for the tooltipHidden event. */ @Output() onTooltipHidden: EventEmitter; /** * A handler for the tooltipShown event. */ @Output() onTooltipShown: EventEmitter; /** * A handler for the adaptiveLayoutChange event. */ @Output() adaptiveLayoutChange: EventEmitter; /** * A handler for the animationChange event. */ @Output() animationChange: EventEmitter; /** * A handler for the argumentAxisChange event. */ @Output() argumentAxisChange: EventEmitter; /** * A handler for the barWidthChange event. */ @Output() barWidthChange: EventEmitter; /** * A handler for the commonAxisSettingsChange event. */ @Output() commonAxisSettingsChange: EventEmitter; /** * A handler for the commonSeriesSettingsChange event. */ @Output() commonSeriesSettingsChange: EventEmitter; /** * A handler for the containerBackgroundColorChange event. */ @Output() containerBackgroundColorChange: EventEmitter; /** * A handler for the customizeLabelChange event. */ @Output() customizeLabelChange: EventEmitter; /** * A handler for the customizePointChange event. */ @Output() customizePointChange: EventEmitter; /** * A handler for the dataPrepareSettingsChange event. */ @Output() dataPrepareSettingsChange: EventEmitter; /** * A handler for the dataSourceChange event. */ @Output() dataSourceChange: EventEmitter>; /** * A handler for the elementAttrChange event. */ @Output() elementAttrChange: EventEmitter; /** * A handler for the equalBarWidthChange event. */ @Output() equalBarWidthChange: EventEmitter; /** * A handler for the exportChange event. */ @Output() exportChange: EventEmitter; /** * A handler for the legendChange event. */ @Output() legendChange: EventEmitter; /** * A handler for the loadingIndicatorChange event. */ @Output() loadingIndicatorChange: EventEmitter; /** * A handler for the marginChange event. */ @Output() marginChange: EventEmitter; /** * A handler for the negativesAsZeroesChange event. */ @Output() negativesAsZeroesChange: EventEmitter; /** * A handler for the paletteChange event. */ @Output() paletteChange: EventEmitter>; /** * A handler for the pathModifiedChange event. */ @Output() pathModifiedChange: EventEmitter; /** * A handler for the pointSelectionModeChange event. */ @Output() pointSelectionModeChange: EventEmitter; /** * A handler for the redrawOnResizeChange event. */ @Output() redrawOnResizeChange: EventEmitter; /** * A handler for the resolveLabelOverlappingChange event. */ @Output() resolveLabelOverlappingChange: EventEmitter; /** * A handler for the rtlEnabledChange event. */ @Output() rtlEnabledChange: EventEmitter; /** * A handler for the seriesChange event. */ @Output() seriesChange: EventEmitter>; /** * A handler for the seriesSelectionModeChange event. */ @Output() seriesSelectionModeChange: EventEmitter; /** * A handler for the seriesTemplateChange event. */ @Output() seriesTemplateChange: EventEmitter; /** * A handler for the sizeChange event. */ @Output() sizeChange: EventEmitter; /** * A handler for the themeChange event. */ @Output() themeChange: EventEmitter; /** * A handler for the titleChange event. */ @Output() titleChange: EventEmitter; /** * A handler for the tooltipChange event. */ @Output() tooltipChange: EventEmitter; /** * A handler for the useSpiderWebChange event. */ @Output() useSpiderWebChange: EventEmitter; /** * A handler for the valueAxisChange event. */ @Output() valueAxisChange: EventEmitter; @ContentChildren(DxiSeriesComponent) get seriesChildren(): QueryList { return this._getOption('series'); } set seriesChildren(value) { this.setChildren('series', value); } constructor(elementRef: ElementRef, ngZone: NgZone, templateHost: DxTemplateHost, injector: Injector, private _watcherHelper: WatcherHelper, private _idh: IterableDifferHelper, optionHost: NestedOptionHost) { super(elementRef, ngZone, templateHost, _watcherHelper); injector.get(EventsRegistrator); this._createEventEmitters([ { subscribe: 'argumentAxisClick', emit: 'onArgumentAxisClick' }, { subscribe: 'disposing', emit: 'onDisposing' }, { subscribe: 'done', emit: 'onDone' }, { subscribe: 'drawn', emit: 'onDrawn' }, { subscribe: 'exported', emit: 'onExported' }, { subscribe: 'exporting', emit: 'onExporting' }, { subscribe: 'fileSaving', emit: 'onFileSaving' }, { subscribe: 'incidentOccurred', emit: 'onIncidentOccurred' }, { subscribe: 'initialized', emit: 'onInitialized' }, { subscribe: 'legendClick', emit: 'onLegendClick' }, { subscribe: 'optionChanged', emit: 'onOptionChanged' }, { subscribe: 'pointClick', emit: 'onPointClick' }, { subscribe: 'pointHoverChanged', emit: 'onPointHoverChanged' }, { subscribe: 'pointSelectionChanged', emit: 'onPointSelectionChanged' }, { subscribe: 'seriesClick', emit: 'onSeriesClick' }, { subscribe: 'seriesHoverChanged', emit: 'onSeriesHoverChanged' }, { subscribe: 'seriesSelectionChanged', emit: 'onSeriesSelectionChanged' }, { subscribe: 'tooltipHidden', emit: 'onTooltipHidden' }, { subscribe: 'tooltipShown', emit: 'onTooltipShown' }, { emit: 'adaptiveLayoutChange' }, { emit: 'animationChange' }, { emit: 'argumentAxisChange' }, { emit: 'barWidthChange' }, { emit: 'commonAxisSettingsChange' }, { emit: 'commonSeriesSettingsChange' }, { emit: 'containerBackgroundColorChange' }, { emit: 'customizeLabelChange' }, { emit: 'customizePointChange' }, { emit: 'dataPrepareSettingsChange' }, { emit: 'dataSourceChange' }, { emit: 'elementAttrChange' }, { emit: 'equalBarWidthChange' }, { emit: 'exportChange' }, { emit: 'legendChange' }, { emit: 'loadingIndicatorChange' }, { emit: 'marginChange' }, { emit: 'negativesAsZeroesChange' }, { emit: 'paletteChange' }, { emit: 'pathModifiedChange' }, { emit: 'pointSelectionModeChange' }, { emit: 'redrawOnResizeChange' }, { emit: 'resolveLabelOverlappingChange' }, { emit: 'rtlEnabledChange' }, { emit: 'seriesChange' }, { emit: 'seriesSelectionModeChange' }, { emit: 'seriesTemplateChange' }, { emit: 'sizeChange' }, { emit: 'themeChange' }, { emit: 'titleChange' }, { emit: 'tooltipChange' }, { emit: 'useSpiderWebChange' }, { emit: 'valueAxisChange' } ]); this._idh.setHost(this); optionHost.setHost(this); } protected _createInstance(element, options) { return new DxPolarChart(element, options); } ngOnDestroy() { this._destroyWidget(); } ngOnChanges(changes: SimpleChanges) { super.ngOnChanges(changes); this.setupChanges('dataSource', changes); this.setupChanges('palette', changes); this.setupChanges('series', changes); } setupChanges(prop: string, changes: SimpleChanges) { if (!(prop in this._optionsToUpdate)) { this._idh.setup(prop, changes); } } ngDoCheck() { this._idh.doCheck('dataSource'); this._idh.doCheck('palette'); this._idh.doCheck('series'); this._watcherHelper.checkWatchers(); super.ngDoCheck(); } _setOption(name: string, value: any) { let isSetup = this._idh.setupSingle(name, value); let isChanged = this._idh.getChanges(name, value) !== null; if (isSetup || isChanged) { super._setOption(name, value); } } } @NgModule({ imports: [ DxoAdaptiveLayoutModule, DxoAnimationModule, DxoArgumentAxisModule, DxiConstantLineModule, DxoLabelModule, DxoFontModule, DxoConstantLineStyleModule, DxoGridModule, DxoFormatModule, DxoMinorGridModule, DxoMinorTickModule, DxoMinorTickIntervalModule, DxiStripModule, DxoStripStyleModule, DxoTickModule, DxoTickIntervalModule, DxoCommonAxisSettingsModule, DxoCommonSeriesSettingsModule, DxoAreaModule, DxoBorderModule, DxoHoverStyleModule, DxoHatchingModule, DxoConnectorModule, DxoPointModule, DxoImageModule, DxoSelectionStyleModule, DxoValueErrorBarModule, DxoBarModule, DxoArgumentFormatModule, DxoLineModule, DxoScatterModule, DxoStackedbarModule, DxoDataPrepareSettingsModule, DxoExportModule, DxoLegendModule, DxoMarginModule, DxoLoadingIndicatorModule, DxiSeriesModule, DxoSeriesTemplateModule, DxoSizeModule, DxoTitleModule, DxoSubtitleModule, DxoTooltipModule, DxoShadowModule, DxoValueAxisModule, DxTemplateModule ], declarations: [ DxPolarChartComponent ], exports: [ DxPolarChartComponent, DxoAdaptiveLayoutModule, DxoAnimationModule, DxoArgumentAxisModule, DxiConstantLineModule, DxoLabelModule, DxoFontModule, DxoConstantLineStyleModule, DxoGridModule, DxoFormatModule, DxoMinorGridModule, DxoMinorTickModule, DxoMinorTickIntervalModule, DxiStripModule, DxoStripStyleModule, DxoTickModule, DxoTickIntervalModule, DxoCommonAxisSettingsModule, DxoCommonSeriesSettingsModule, DxoAreaModule, DxoBorderModule, DxoHoverStyleModule, DxoHatchingModule, DxoConnectorModule, DxoPointModule, DxoImageModule, DxoSelectionStyleModule, DxoValueErrorBarModule, DxoBarModule, DxoArgumentFormatModule, DxoLineModule, DxoScatterModule, DxoStackedbarModule, DxoDataPrepareSettingsModule, DxoExportModule, DxoLegendModule, DxoMarginModule, DxoLoadingIndicatorModule, DxiSeriesModule, DxoSeriesTemplateModule, DxoSizeModule, DxoTitleModule, DxoSubtitleModule, DxoTooltipModule, DxoShadowModule, DxoValueAxisModule, DxTemplateModule ], providers: [EventsRegistrator] }) export class DxPolarChartModule { }