@eclipse-scout/chart
Version:
Eclipse Scout chart
141 lines • 7.85 kB
TypeScript
/// <reference types="jquery" />
import { Column, Event, EventListener, IconDesc, InitModelOf, Table, TableControl, TableMatrixDateGroup, TableMatrixKeyAxis, TableMatrixNumberGroup, TableMatrixResult } from '@eclipse-scout/core';
import { Chart, ChartTableControlEventMap, ChartTableControlLayout, ChartTableControlModel } from '../../index';
import { BubbleDataPoint, ChartData, ChartType as ChartJsType } from 'chart.js';
import { ChartConfig, ClickObject } from '../../chart/Chart';
export declare class ChartTableControl extends TableControl implements ChartTableControlModel {
model: ChartTableControlModel;
eventMap: ChartTableControlEventMap;
self: ChartTableControl;
chartAggregation: TableControlChartAggregation;
chartGroup1: TableControlChartGroup;
chartGroup2: TableControlChartGroup;
chartType: TableControlChartType;
oldChartType: TableControlChartType;
chart: Chart;
chartColorScheme: string;
xAxis: TableMatrixKeyAxis;
yAxis: TableMatrixKeyAxis;
dateGroup: (TableMatrixDateGroup | string)[][];
$chartSelect: JQuery;
$axisSelectContainer: JQuery;
$xAxisSelect: JQuery;
$yAxisSelect: JQuery;
$dataSelect: JQuery;
protected _chartTypeMap: Record<TableControlChartType, JQuery>;
protected _aggregationMap: Record<string, JQuery>;
protected _chartGroup1Map: Record<string, JQuery>;
protected _chartGroup2Map: Record<string, JQuery>;
protected _tableUpdatedHandler: (e: Event<Table>) => void;
protected _tableColumnStructureChangedHandler: () => void;
protected _chartValueClickedHandler: () => void;
protected _filterRemovedListener: EventListener;
protected _tableUpdatedTimeOutId: number;
constructor();
static DATE_GROUP_FLAG: number;
static MAX_AXIS_COUNT: number;
protected _init(model: InitModelOf<this>): void;
protected _destroy(): void;
protected _computeEnabled(inheritAccessibility: boolean, parentEnabled: boolean): boolean;
protected _renderChart(): void;
protected _createLayout(): ChartTableControlLayout;
protected _renderChartType(): void;
protected _selectChartType(): void;
protected _renderChartGroup1(): void;
protected _renderChartGroup2(): void;
protected _renderChartGroup(groupId: 1 | 2): void;
protected _renderChartAggregation(): void;
protected _getAggregationCssClass(): string;
protected _renderChartSelect(cssClass: string, chartType: TableControlChartType, iconId: string): void;
/**
* Appends a chart selection divs to this.$contentContainer and sets the this.$chartSelect property.
**/
protected _renderChartSelectContainer(): void;
protected _getSupportedChartTypes(): TableControlChartType[];
protected _onClickChartType(event: JQuery.ClickEvent): void;
protected _onClickChartGroup(event: JQuery.ClickEvent): void;
protected _onClickAggregation(event: JQuery.ClickEvent): void;
protected _nextDateModifier(modifier: TableMatrixDateGroup): TableMatrixDateGroup;
protected _nextModifier(modifier: TableMatrixNumberGroup): TableMatrixNumberGroup;
setChartAggregation(chartAggregation: TableControlChartAggregation): void;
protected _setChartAggregation(chartAggregation: TableControlChartAggregation): void;
setChartGroup1(chartGroup: TableControlChartGroup): void;
protected _setChartGroup1(chartGroup: TableControlChartGroup): void;
setChartGroup2(chartGroup: TableControlChartGroup): void;
protected _setChartGroup2(chartGroup: TableControlChartGroup): void;
protected _setChartGroup(groupId: 1 | 2, chartGroup: TableControlChartGroup): void;
protected _changeProperty(prop: string, value: any): void;
setChartType(chartType: TableControlChartType): void;
protected _hasColumns(): boolean;
protected _columns(): Column[];
protected _axisCount(columnCount: (number | Column<any>)[][], column: Column<any>): number;
protected _plainAxisText(column: Column<any>, text: string): string;
protected _renderContent($parent: JQuery): void;
protected _addListeners(): void;
protected _renderAxisSelectorsContainer(): void;
protected _renderAxisSelectors(): (number | Column<any>)[][];
protected _initializeSelection(columnCount: (number | Column<any>)[][]): void;
/**
* Applies the default column selection for the specified chartGroup.
* The implementation only considers columns that are part of the specified columnCount matrix and $candidates array.
* From all these columns the last match that is lower or equal to the specified maxIndex is set as default chart group.
*
* @param chartGroup The number of the chart group (1 or 2) for which the default column should be set.
* @param columnCount Column-count matrix as returned by TableMatrix#columnCount(). Holds possible grouping columns.
* @param $candidates jQuery array holding all axis columns that could be used as default.
* @param maxIndex The maximum column index to use as default column for the specified chartGroup.
*/
protected _setDefaultSelectionForGroup(chartGroup: 1 | 2, columnCount: (number | Column<any>)[][], $candidates: JQuery, maxIndex: number): void;
protected _getDefaultSelectedColumn(columnCount: (number | Column<any>)[][], $candidates: JQuery, maxIndex: number): Column<any>;
protected _existsInAxisColumns($candidates: JQuery, columnToSearch: Column<any>): boolean;
protected _getDefaultChartGroup(column: Column<any>): TableControlChartGroup;
protected _renderChartParts(): void;
protected _drawChart(): void;
protected _hideChart(): void;
protected _getDatasetLabel(): string;
protected _calculateValues(): TableMatrixResult;
protected _getXAxis(): TableMatrixKeyAxis;
protected _getYAxis(): TableMatrixKeyAxis;
protected _computeData(iconClasses: string[], cube: TableMatrixResult): ChartData;
protected _computeBubbleData(iconClasses: string[], cube: TableMatrixResult): {
value: BubbleDataPoint;
deterministicKey: TableControlDeterministicKey;
}[];
protected _handleIconLabel(label: string, axis: TableMatrixKeyAxis, iconClasses: string[]): string;
protected _adjustFont(config: ChartConfig, iconClasses: string[]): void;
protected _adjustLabels(config: ChartConfig): void;
protected _formatLabel(label: number, axis: TableMatrixKeyAxis): string;
protected _adjustConfig(config: ChartConfig): void;
protected _adjustClickable(config: ChartConfig): void;
protected _isChartClickable(): boolean;
protected _adjustBubble(config: ChartConfig): void;
protected _adjustPie(config: ChartConfig): void;
protected _adjustScales(config: ChartConfig): void;
protected _computeCheckedItems(deterministicKeys: TableControlDeterministicKey[]): ClickObject[];
protected _onChartValueClick(): void;
protected _axisContentForColumn(column: Column<any>): {
text: string;
icon?: IconDesc;
};
protected _removeContent(): void;
protected _removeScrollbars(): void;
protected _removeListeners(): void;
protected _onTableUpdated(event?: Event<Table>): void;
protected _onTableColumnStructureChanged(): void;
}
export type TableControlChartType = typeof Chart.Type['BAR' | 'BAR_HORIZONTAL' | 'LINE' | 'PIE' | 'BUBBLE'];
export type TableControlChartAggregation = {
id?: string;
modifier?: TableMatrixNumberGroup;
};
export type TableControlChartGroup = {
id?: string;
modifier?: TableMatrixNumberGroup | TableMatrixDateGroup;
};
export type TableControlDeterministicKey = (number | string) | (number | string)[];
declare module 'chart.js' {
interface ChartDatasetProperties<TType extends ChartJsType, TData> {
deterministicKeys?: TableControlDeterministicKey[];
}
}
//# sourceMappingURL=ChartTableControl.d.ts.map