dhx-chart 7.2.4 → 7.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
  import { IEventSystem } from "../../ts-common/events";
2
2
  import { View } from "../../ts-common/view";
3
- import { DataCollection, DataEvents } from "../../ts-data";
3
+ import { DataCollection, DataEvents, TreeCollection } from "../../ts-data";
4
4
  import { ChartEvents, IChart, IChartConfig, ISeria } from "./types";
5
5
  export declare class Chart extends View implements IChart {
6
- data: DataCollection;
6
+ data: DataCollection | TreeCollection;
7
7
  events: IEventSystem<DataEvents | ChartEvents>;
8
8
  config: IChartConfig;
9
9
  private _layers;
@@ -1,5 +1,5 @@
1
1
  import { IContainerConfig } from "../../../ts-common/core";
2
- export declare function getDefaultColor(index?: number): string;
2
+ export declare function getDefaultColor(index?: number, isTreeMapRange?: boolean): string;
3
3
  declare type Locator = (data: any) => number | string;
4
4
  export declare function locator(value: string | Locator): Locator;
5
5
  export declare function log10(x: number): number;
@@ -32,6 +32,7 @@ interface ITextObj {
32
32
  export declare function linearGradient(grad: IGradient, id: string): any;
33
33
  export declare function getRadialGradient(opts: any, stops: IStop[], id: string): any;
34
34
  export declare function euclideanDistance(x1: number, y1: number, x2: number, y2: number): number;
35
+ export declare function roundToTwoNumAfterPoint(p: number): number;
35
36
  export declare function verticalCenteredText(text: string): any;
36
37
  export declare function verticalTopText(text: string): any;
37
38
  export declare function verticalBottomText(text: string): any;
@@ -0,0 +1,30 @@
1
+ import { IFitPosition } from "../../../ts-common/html";
2
+ import { TreeCollection } from "../../../ts-data";
3
+ import { ITreeMapConfig, PointData, SvgElement } from "../types";
4
+ import BaseSeria from "./BaseSeria";
5
+ export default class TreeMap extends BaseSeria {
6
+ config: ITreeMapConfig;
7
+ protected _data: TreeCollection;
8
+ private _sum;
9
+ private _maxLevel;
10
+ private _aspectRatio;
11
+ private _layout;
12
+ private _headerHeight;
13
+ private _textLocator;
14
+ private _valueLocator;
15
+ scaleReady(sizes: IFitPosition): IFitPosition;
16
+ toggle(id?: string): void;
17
+ dataReady(): PointData[];
18
+ paint(width: number, height: number): SvgElement;
19
+ private _drawBar;
20
+ private _getBar;
21
+ protected _setDefaults(config: ITreeMapConfig): void;
22
+ protected _defaultLocator(v: any): any[];
23
+ private _getSerie;
24
+ private _getDataLevel;
25
+ private _getMaxLevel;
26
+ private _getDeepParent;
27
+ private _getLayoutObj;
28
+ private _recountParentArea;
29
+ private _toggleGroup;
30
+ }
@@ -9,6 +9,7 @@ import radar from "./Radar";
9
9
  import scatter from "./Scatter";
10
10
  import spline from "./Spline";
11
11
  import splineArea from "./SplineArea";
12
+ import treeMap from "./TreeMap";
12
13
  declare const seriesTypes: {
13
14
  line: typeof line;
14
15
  spline: typeof spline;
@@ -21,5 +22,6 @@ declare const seriesTypes: {
21
22
  radar: typeof radar;
22
23
  bar: typeof bar;
23
24
  xbar: typeof xbar;
25
+ treeMap: typeof treeMap;
24
26
  };
25
27
  export default seriesTypes;
@@ -19,7 +19,7 @@ export interface IChartConfig {
19
19
  maxPoints?: number;
20
20
  data?: DataCollection<any> | any[];
21
21
  }
22
- export declare type ChartType = "bar" | "line" | "spline" | "scatter" | "area" | "donut" | "pie" | "pie3D" | "radar" | "xbar" | "splineArea";
22
+ export declare type ChartType = "bar" | "line" | "spline" | "scatter" | "area" | "donut" | "pie" | "pie3D" | "radar" | "xbar" | "splineArea" | "treeMap";
23
23
  export declare enum ChartEvents {
24
24
  toggleSeries = "toggleSeries",
25
25
  chartMouseMove = "chartMouseMove",
@@ -53,6 +53,7 @@ export interface ISeria extends ILikeSeria {
53
53
  getClosest(x: number, y: number): [number, number, number, string];
54
54
  getClosestVertical(x: number): [number, number, number, string, number];
55
55
  }
56
+ export declare type TreeDirectionType = "asc" | "desc";
56
57
  export interface ISeriaConfig {
57
58
  id?: string;
58
59
  type?: ChartType;
@@ -60,6 +61,7 @@ export interface ISeriaConfig {
60
61
  pointColor?: string;
61
62
  dashed?: boolean;
62
63
  scales?: ScaleType[];
64
+ stroke?: string;
63
65
  strokeWidth?: number;
64
66
  value?: string;
65
67
  name?: string;
@@ -79,6 +81,9 @@ export interface ISeriaConfig {
79
81
  baseLine?: number;
80
82
  tooltipType?: TooltipType;
81
83
  stacked?: boolean;
84
+ direction?: TreeDirectionType;
85
+ treeSeries?: ITreeSeries[];
86
+ legendType?: LegendType;
82
87
  }
83
88
  export declare type SeriaConfig = ISeriaConfig | INoScaleConfig;
84
89
  export interface IScale extends IComposable {
@@ -129,12 +134,26 @@ export interface ILegendConfig {
129
134
  };
130
135
  size?: number;
131
136
  form?: Shape;
137
+ type?: LegendType;
132
138
  itemPadding?: number;
133
139
  halign?: HorizontalPosition;
134
140
  valign?: VerticalPosition;
135
141
  series?: string[];
142
+ treeSeries?: ITreeSeries[];
136
143
  margin?: number;
144
+ direction?: LegendDirection;
137
145
  $seriesInfo?: ISeria[];
146
+ $sizes?: LegendSizes;
147
+ }
148
+ export interface ITreeSeries {
149
+ less?: number | string;
150
+ from?: number | string;
151
+ to?: number | string;
152
+ greater?: number | string;
153
+ color?: string;
154
+ active?: boolean;
155
+ id?: string;
156
+ name?: string;
138
157
  }
139
158
  export interface ILegendDrawData {
140
159
  id: string;
@@ -155,7 +174,7 @@ export interface IComposeLayer {
155
174
  add(obj: any): void;
156
175
  clear(): void;
157
176
  getSizes(): IFitPosition;
158
- toVDOM(width: number, height: number, events: IEventSystem<DataEvents | ChartEvents>): void;
177
+ toVDOM(width: number, height: number): void;
159
178
  }
160
179
  export interface IRadarConfig extends ISeriaConfig {
161
180
  radius?: number;
@@ -174,12 +193,17 @@ export interface IRadarScaleDrawData {
174
193
  zebra: boolean;
175
194
  attribute: string;
176
195
  }
196
+ export interface ITreeMapConfig extends ISeriaConfig {
197
+ paddings?: number;
198
+ text?: string;
199
+ }
177
200
  export interface IAxisCreatorConfig {
178
201
  max?: number;
179
202
  min?: number;
180
203
  log?: boolean;
181
204
  padding?: number;
182
205
  maxTicks?: number;
206
+ type?: string;
183
207
  }
184
208
  export interface IAxisScale {
185
209
  min: number;
@@ -211,6 +235,12 @@ export declare type SvgElement = any;
211
235
  export declare type Shape = "rect" | "circle";
212
236
  export declare type HorizontalPosition = "left" | "center" | "right";
213
237
  export declare type VerticalPosition = "top" | "middle" | "bottom";
238
+ export declare type LegendDirection = "row" | "column";
239
+ export declare type LegendType = "groupName" | "range";
240
+ export declare type LegendSizes = {
241
+ width: number;
242
+ height: number;
243
+ };
214
244
  export interface ILikeSeria extends IComposable {
215
245
  getPoints(): PointData[];
216
246
  seriesShift?(size?: number): number;
@@ -225,7 +255,10 @@ export declare type SmartLocator = Locator | string;
225
255
  export interface IStacker extends IComposable, ILikeSeria {
226
256
  add(seria: ISeria): void;
227
257
  }
228
- export declare type PointData = [number, number, string, number, number];
258
+ export declare type PointData = [number, number, string, number | string, number, TreePointData?];
259
+ export declare type TreePointData = {
260
+ items: PointData[];
261
+ };
229
262
  export interface IGridRenderConfig {
230
263
  targetLine?: number;
231
264
  dashed: boolean;
@@ -27,6 +27,7 @@ export declare class Combobox extends View implements ICombobox {
27
27
  clear(): void | boolean;
28
28
  getValue<T extends boolean = false>(asArray?: T): T extends true ? string[] : string;
29
29
  setValue(ids: Id[] | Id): void | boolean;
30
+ addOption(value: string): void;
30
31
  destructor(): void;
31
32
  /** @deprecated See a documentation: https://docs.dhtmlx.com/ */
32
33
  setState(state: State): void;
@@ -1,3 +1,4 @@
1
1
  export declare function selectAllView(): any;
2
2
  export declare function unselectAllView(): any;
3
- export declare function emptyListView(): any;
3
+ export declare function emptyListView(value?: string): any;
4
+ export declare function emptyListHeight(value: string, width: number): number;
@@ -3,5 +3,6 @@ declare const _default: {
3
3
  selectAll: string;
4
4
  unselectAll: string;
5
5
  selectedItems: string;
6
+ createItem: string;
6
7
  };
7
8
  export default _default;
@@ -22,6 +22,8 @@ export interface IComboboxConfig {
22
22
  hiddenLabel?: boolean;
23
23
  css?: string;
24
24
  value?: string | string[];
25
+ newOptions?: boolean;
26
+ htmlEnable?: boolean;
25
27
  /** @deprecated See a documentation: https://docs.dhtmlx.com/ */
26
28
  cellHeight?: number;
27
29
  /** @deprecated See a documentation: https://docs.dhtmlx.com/ */
@@ -33,15 +35,6 @@ export interface IComboboxConfig {
33
35
  /** @deprecated See a documentation: https://docs.dhtmlx.com/ */
34
36
  readonly?: boolean;
35
37
  }
36
- export interface IComboFilterConfig {
37
- data?: DataCollection<any> | any[];
38
- readonly?: boolean;
39
- template?: (item: any) => string;
40
- filter?: (item: any, input: string) => boolean;
41
- placeholder?: string;
42
- virtual?: boolean;
43
- multiselection?: boolean;
44
- }
45
38
  export declare enum ComboboxEvents {
46
39
  change = "change",
47
40
  focus = "focus",
@@ -82,6 +75,7 @@ export interface ICombobox {
82
75
  blur(): void;
83
76
  getValue(asArray?: boolean): Id[] | string;
84
77
  setValue(ids: Id[] | Id): void;
78
+ addOption(value: string): void;
85
79
  /** @deprecated See a documentation: https://docs.dhtmlx.com/ */
86
80
  setState(state: State): void;
87
81
  }
@@ -5,6 +5,8 @@ export interface IFocusManager {
5
5
  declare class FocusManager implements IFocusManager {
6
6
  private _activeWidgetId;
7
7
  private _initHandler;
8
+ private _removeFocusClass;
9
+ private _addFocusClass;
8
10
  constructor();
9
11
  getFocusId(): string;
10
12
  setFocusId(id: string): void;
@@ -13,4 +13,5 @@ export declare class Loader {
13
13
  private _addToChain;
14
14
  private _findPrevState;
15
15
  private _removeFromOrder;
16
+ private _getUniqueOrder;
16
17
  }
@@ -19,8 +19,8 @@ export declare class DataCollection<T extends IDataItem = IDataItem> implements
19
19
  protected _meta: any;
20
20
  protected _range: [number, number];
21
21
  protected _loaded: boolean;
22
+ protected _initOrder: T[];
22
23
  private _changes;
23
- private _initOrder;
24
24
  private _loader;
25
25
  constructor(config?: any, events?: IEventSystem<any>);
26
26
  protected _reset(): void;
@@ -29,7 +29,7 @@ export declare class DataCollection<T extends IDataItem = IDataItem> implements
29
29
  remove(id: Id | Id[]): void;
30
30
  removeAll(): void;
31
31
  exists(id: Id): boolean;
32
- getNearId(id: Id): string | number;
32
+ getNearId(id: Id): Id;
33
33
  getItem(id: Id): T;
34
34
  update(id: Id, newItem: IUpdateObject, silent?: boolean): void;
35
35
  getIndex(id: Id): number;
@@ -41,7 +41,7 @@ export declare class DataCollection<T extends IDataItem = IDataItem> implements
41
41
  findAll(conf: IFilterMode | DataCallback<T>): any[];
42
42
  sort(rule?: ISortMode, config?: ISortConfig): void;
43
43
  copy(id: Id | Id[], index: number, target?: IDataCollection | ITreeCollection, targetId?: Id): Id | Id[];
44
- move(id: Id | Id[], index: number, target?: DataCollection | TreeCollection, targetId?: Id): Id | Id[];
44
+ move(id: Id | Id[], index: number, target?: DataCollection | TreeCollection, targetId?: Id, newId?: Id): Id | Id[];
45
45
  forEach(callback: DataCallback<T>): void;
46
46
  load(url: IDataProxy | string, driver?: IDataDriver | DataDriver): Promise<any>;
47
47
  parse(data: T[], driver?: DataDriver | IDataDriver): any;
@@ -62,7 +62,7 @@ export declare class DataCollection<T extends IDataItem = IDataItem> implements
62
62
  protected _add(newItem: IDataItem, index: number): Id;
63
63
  protected _remove(id: Id): void;
64
64
  protected _copy(id: Id, index: number, target?: IDataCollection | ITreeCollection, targetId?: Id, key?: number): Id;
65
- protected _move(id: Id, index: number, target?: IDataCollection | ITreeCollection, targetId?: Id, key?: number): Id;
65
+ protected _move(id: Id, index: number, target?: IDataCollection | ITreeCollection, targetId?: Id, key?: number, newId?: Id): Id;
66
66
  protected _addCore(obj: IDataItem, index: number): Id;
67
67
  protected _removeCore(id: Id): void;
68
68
  protected _parse_data(data: any[]): void;
@@ -47,7 +47,7 @@ export declare class TreeCollection<T extends IDataItem = IDataItem> extends Dat
47
47
  protected _reset(id?: Id): void;
48
48
  protected _removeCore(id: any): void;
49
49
  protected _addToOrder(_order: any, obj: any, index: number): void;
50
- protected _parse_data(data: any, parent?: string | number): void;
50
+ protected _parse_data(data: any, parent?: Id): void;
51
51
  private _fastDeleteChilds;
52
52
  private _recursiveFilter;
53
53
  private _serialize;
@@ -200,6 +200,7 @@ export interface IDragConfig {
200
200
  export interface ICopyObject {
201
201
  id: Id;
202
202
  component: IObjWithData;
203
+ newId?: Id;
203
204
  }
204
205
  export declare enum DataEvents {
205
206
  afterAdd = "afteradd",
@@ -211,7 +212,8 @@ export declare enum DataEvents {
211
212
  load = "load",
212
213
  loadError = "loaderror",
213
214
  beforeLazyLoad = "beforelazyload",
214
- afterLazyLoad = "afterlazyload"
215
+ afterLazyLoad = "afterlazyload",
216
+ dataRequest = "dataRequest"
215
217
  }
216
218
  export interface IDataEventsHandlersMap {
217
219
  [key: string]: (...args: any[]) => any;
@@ -225,6 +227,7 @@ export interface IDataEventsHandlersMap {
225
227
  [DataEvents.loadError]: (response: any) => void;
226
228
  [DataEvents.beforeLazyLoad]: () => boolean | void;
227
229
  [DataEvents.afterLazyLoad]: (from: number, count: number) => void;
230
+ [DataEvents.dataRequest]: (from: number, to: number) => void;
228
231
  }
229
232
  export declare enum DragEvents {
230
233
  beforeDrag = "beforeDrag",
@@ -1,9 +1,9 @@
1
1
  import { IEventSystem } from "../../ts-common/events";
2
2
  import { IKeyManager } from "../../ts-common/KeyManager";
3
3
  import { IAlign } from "../../ts-common/html";
4
- import { IDataCollection, IDragConfig, ICsvDriverConfig, IDataItem, IDragInfo } from "../../ts-data";
4
+ import { IDataCollection, IDragConfig, ICsvDriverConfig, IDataItem, IDragInfo, DataCollection } from "../../ts-data";
5
5
  import { Exporter } from "./Exporter";
6
- import { IComboFilterConfig, Combobox } from "../../ts-combobox";
6
+ import { Combobox } from "../../ts-combobox";
7
7
  import { IHandlers, Id } from "../../ts-common/types";
8
8
  import { ScrollView } from "../../ts-common/ScrollView";
9
9
  export interface IGridConfig extends IDragConfig {
@@ -135,6 +135,9 @@ export interface IProGrid extends IGrid {
135
135
  scrollView: ScrollView;
136
136
  }
137
137
  export declare type EditorType = "input" | "select" | "datePicker" | "checkbox" | "combobox" | "multiselect" | "textarea";
138
+ export interface IComboEditorConfig {
139
+ newOptions?: boolean;
140
+ }
138
141
  export interface ICellRect extends ICoords, ISizes {
139
142
  }
140
143
  export declare type colType = "string" | "number" | "boolean" | "date" | "percent" | any;
@@ -148,6 +151,7 @@ export interface ICol {
148
151
  mark?: IMark | MarkFunction;
149
152
  type?: colType;
150
153
  editorType?: EditorType;
154
+ editorConfig?: IComboEditorConfig;
151
155
  editable?: boolean;
152
156
  resizable?: boolean;
153
157
  sortable?: boolean;
@@ -189,10 +193,20 @@ export interface IHeader {
189
193
  css?: any;
190
194
  content?: fixedRowContent | footerMethods;
191
195
  filterConfig?: IComboFilterConfig;
196
+ customFilter?: (item: any, input: string) => boolean;
192
197
  align?: IAlign;
193
198
  headerSort?: boolean;
194
199
  sortAs?: SortFunction;
195
200
  }
201
+ export interface IComboFilterConfig {
202
+ data?: DataCollection<any> | any[];
203
+ readonly?: boolean;
204
+ template?: (item: any) => string;
205
+ filter?: (item: any, input: string) => boolean;
206
+ placeholder?: string;
207
+ virtual?: boolean;
208
+ multiselection?: boolean;
209
+ }
196
210
  export declare type SortFunction = (cellValue: any) => string | number;
197
211
  export interface IFooter {
198
212
  text?: string | number;
@@ -22,6 +22,7 @@ export declare class Cell extends View implements ICell {
22
22
  expand(): void;
23
23
  collapse(): void;
24
24
  toggle(): void;
25
+ protected _checkNextSize(cell?: ICell): any;
25
26
  getParent(): ILayout;
26
27
  destructor(): void;
27
28
  getWidget(): IViewLike;
@@ -31,9 +32,11 @@ export declare class Cell extends View implements ICell {
31
32
  toVDOM(nodes?: any[]): any;
32
33
  protected _getCss(_content?: boolean): string;
33
34
  protected _initHandlers(): void;
35
+ protected _getCollapsedSize(cell: ICell, nextCell: ICell): number;
34
36
  protected _getCollapseIcon(): "dxi dxi-chevron-up" | "dxi dxi-chevron-down" | "dxi dxi-chevron-right" | "dxi dxi-chevron-left";
35
37
  protected _isLastCell(): boolean;
36
38
  protected _getNextCell(): any;
39
+ protected _getAnyFlexCell(): any;
37
40
  protected _getResizerView(): any;
38
41
  protected _isXDirection(): any;
39
42
  protected _calculateStyle(): any;
@@ -33,6 +33,8 @@ export interface ICellConfig {
33
33
  full?: boolean;
34
34
  init?: (c: ICell, cfg: ICellConfig | IView) => void;
35
35
  $fixed?: boolean;
36
+ $autoWidth?: boolean;
37
+ $autoHeight?: boolean;
36
38
  }
37
39
  export interface ILayoutConfig extends ICellConfig {
38
40
  rows?: ICellConfig[] | ILayoutConfig[];
@@ -20,6 +20,7 @@ export declare class List extends View implements IList {
20
20
  private _topOffset;
21
21
  private _visibleHeight;
22
22
  private _touch;
23
+ protected _changed: boolean;
23
24
  constructor(node: HTMLElement | string, config?: IListConfig);
24
25
  protected _didRedraw(vm: any): void;
25
26
  private _dblClick;
@@ -19,6 +19,7 @@ export interface IListConfig extends IDragConfig {
19
19
  eventHandlers?: {
20
20
  [key: string]: any;
21
21
  };
22
+ htmlEnable?: boolean;
22
23
  /** @deprecated See a documentation: https://docs.dhtmlx.com/ */
23
24
  editing?: boolean;
24
25
  /** @deprecated See a documentation: https://docs.dhtmlx.com/ */
@@ -5,6 +5,7 @@ export interface IBaseProps {
5
5
  css?: string;
6
6
  buttonsAlignment?: IAlign;
7
7
  blockerCss?: string;
8
+ htmlEnable?: boolean;
8
9
  }
9
10
  export interface IAlertProps extends IBaseProps {
10
11
  buttons?: [string];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dhx-chart",
3
- "version": "7.2.4",
3
+ "version": "7.3.1",
4
4
  "description": "dhtmlxChart widget",
5
5
  "homepage":"https://docs.dhtmlx.com/chart",
6
6
  "license":"GPL",
package/readme.txt CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
3
 
4
- dhtmlxChart v.7.2.4 Standard
4
+ dhtmlxChart v.7.3.1 Standard
5
5
  This software is covered by GPL-2.0 License. Usage without proper license is prohibited.
6
6
 
7
7
  (c) XB Software.
package/whatsnew.txt CHANGED
@@ -1,6 +1,26 @@
1
- Version 7.2.4 (October 13, 2021)
1
+ Version 7.3.1 (March 17, 2022)
2
2
  ----------------------------
3
3
 
4
+ Version 7.3.0 (January 19, 2022)
5
+ ----------------------------
6
+
7
+ ### New functionality
8
+
9
+ - New Treemap chart
10
+ - The ability to arrange legend items vertically or horizontally via the direction property of the legend
11
+
12
+ ### Fixes
13
+
14
+ - Fix the incorrect display of Radar chart if the values in the data set are the same
15
+ - Fix the issue with displaying an empty tooltip in Line chart
16
+ - Fix the issue with the type of the value property in a data set
17
+
18
+ Version 7.2.5 (October 28, 2021)
19
+ ----------------------------
20
+
21
+ Version 7.2.4 (October 13, 2021)
22
+ ----------------------------
23
+
4
24
  Version 7.2.3 (September 27, 2021)
5
25
  ----------------------------
6
26