realchart 0.9.33 → 0.9.35

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.
package/dist/index.d.ts CHANGED
@@ -514,7 +514,7 @@ declare class SvgRichText {
514
514
  setFormat(value: string): void;
515
515
  lines(): SvgLine[];
516
516
  build(view: TextElement, maxWidth: number, maxHeight: number, target: any, domain: IRichTextDomain): void;
517
- layout(view: TextElement, align: Align, width: number, height: number, padding: Sides): void;
517
+ layout(tv: TextElement, align: Align, width: number, height: number, pad: Sides): void;
518
518
  $_parse(fmt: string): void;
519
519
  }
520
520
 
@@ -523,6 +523,13 @@ declare enum PaletteMode {
523
523
  SHUFFLE = "shuffle",
524
524
  RANDOM = "random"
525
525
  }
526
+ declare enum SeriesLoadAnimation {
527
+ DEFAULT = "default",
528
+ REVEAL = "reveal",
529
+ GROW = "grow",
530
+ SPREAD = "spread",
531
+ FADEIN = "fadein"
532
+ }
526
533
 
527
534
  interface IAssetItem {
528
535
  id: string;
@@ -643,6 +650,129 @@ declare class BackgroundImage extends ChartItem {
643
650
  style: SVGStyleOrClass;
644
651
  }
645
652
 
653
+ declare enum AnnotationScope {
654
+ CHART = "chart",
655
+ CONTAINER = "container"
656
+ }
657
+ declare abstract class Annotation extends ChartItem {
658
+ inBody: boolean;
659
+ private _width;
660
+ private _height;
661
+ private _widthDim;
662
+ private _heightDim;
663
+ _x: number;
664
+ _y: number;
665
+ _w: number;
666
+ _h: number;
667
+ constructor(chart: IChart, inBody: boolean);
668
+ abstract _type(): string;
669
+ front: boolean;
670
+ name: string;
671
+ align: Align;
672
+ verticalAlign: VerticalAlign;
673
+ offsetX: number;
674
+ offsetY: number;
675
+ rotation: number;
676
+ scope: AnnotationScope;
677
+ loadAnimation: IAnnotationAnimation;
678
+ backgroundStyle: SVGStyleOrClass;
679
+ noClip: boolean;
680
+ x1: number | Date;
681
+ x2: number | Date;
682
+ y1: number | Date;
683
+ y2: number | Date;
684
+ get width(): RtPercentSize;
685
+ set width(value: RtPercentSize);
686
+ get height(): RtPercentSize;
687
+ set height(value: RtPercentSize);
688
+ getSize(wDomain: number, hDomain: number): ISize;
689
+ getPosition(inverted: boolean, left: number, top: number, wDomain: number, hDomain: number, width: number, height: number): IPoint;
690
+ update(): void;
691
+ protected _doPrepareRender(chart: IChart): void;
692
+ }
693
+
694
+ declare enum ZoomType {
695
+ NONE = "none",
696
+ X = "x",
697
+ Y = "y",
698
+ BOTH = "both"
699
+ }
700
+ declare class ZoomButton extends ChartItem {
701
+ body: Body;
702
+ constructor(body: Body);
703
+ isVisible(): boolean;
704
+ }
705
+ declare class BodySplit extends ChartItem {
706
+ body: Body;
707
+ constructor(body: Body);
708
+ size: number;
709
+ }
710
+ interface IPolar {
711
+ start: number;
712
+ total: number;
713
+ cx: number;
714
+ cy: number;
715
+ rd: number;
716
+ }
717
+ declare class Body extends ChartItem {
718
+ private _radius;
719
+ private _centerX;
720
+ private _centerY;
721
+ private _annotations;
722
+ private _radiusDim;
723
+ private _cxDim;
724
+ private _cyDim;
725
+ private _rd;
726
+ private _cx;
727
+ private _cy;
728
+ constructor(chart: IChart);
729
+ split: BodySplit;
730
+ get radius(): RtPercentSize;
731
+ set radius(value: RtPercentSize);
732
+ innerRadius: RtPercentSize;
733
+ get centerX(): RtPercentSize;
734
+ set centerX(value: RtPercentSize);
735
+ get centerY(): RtPercentSize;
736
+ set centerY(value: RtPercentSize);
737
+ circular: boolean;
738
+ image: BackgroundImage;
739
+ zoomType: ZoomType;
740
+ zoomButton: ZoomButton;
741
+ canZoom(): boolean;
742
+ calcRadius(width: number, height: number): number;
743
+ setPolar(width: number, height: number): Body;
744
+ getPolar(axis: Axis): IPolar;
745
+ isZoomed(): boolean;
746
+ '@config annotation': Annotation[];
747
+ getAnnotations(): Annotation[];
748
+ getAnnotation(name: string): Annotation;
749
+ protected _doLoadProp(prop: string, value: any): boolean;
750
+ protected _doPrepareRender(chart: IChart): void;
751
+ private $_loadAnnotations;
752
+ }
753
+
754
+ type RcAnimationEndHandler = (ani: RcAnimation) => void;
755
+ declare abstract class RcAnimation {
756
+ static readonly DURATION = 700;
757
+ static readonly SHORT_DURATION = 300;
758
+ delay: number;
759
+ duration: number;
760
+ easing: string;
761
+ endHandler: RcAnimationEndHandler;
762
+ private _easing;
763
+ private _started;
764
+ private _timer;
765
+ private _handler;
766
+ start(endHandler?: RcAnimationEndHandler): RcAnimation;
767
+ stop(): void;
768
+ protected _start(duration: number, delay?: number, easing?: string): void;
769
+ protected _stop(): void;
770
+ protected _doStart(): void;
771
+ protected _doStop(): void;
772
+ protected _canUpdate(): boolean;
773
+ protected abstract _doUpdate(rate: number): boolean;
774
+ }
775
+
646
776
  declare enum Shape {
647
777
  CIRCLE = "circle",
648
778
  DIAMOND = "diamond",
@@ -688,91 +818,6 @@ declare class ChartDataCollection {
688
818
  load(source: any): void;
689
819
  }
690
820
 
691
- type RcAnimationEndHandler = (ani: RcAnimation) => void;
692
- declare abstract class RcAnimation {
693
- static readonly DURATION = 700;
694
- static readonly SHORT_DURATION = 300;
695
- delay: number;
696
- duration: number;
697
- easing: string;
698
- endHandler: RcAnimationEndHandler;
699
- private _easing;
700
- private _started;
701
- private _timer;
702
- private _handler;
703
- start(endHandler?: RcAnimationEndHandler): RcAnimation;
704
- stop(): void;
705
- protected _start(duration: number, delay?: number, easing?: string): void;
706
- protected _stop(): void;
707
- protected _doStart(): void;
708
- protected _doStop(): void;
709
- protected _canUpdate(): boolean;
710
- protected abstract _doUpdate(rate: number): boolean;
711
- }
712
-
713
- declare class DataPoint {
714
- index: number;
715
- vindex: number;
716
- x: any;
717
- y: any;
718
- series: string | number;
719
- readonly pid: number;
720
- source: any;
721
- isNull: boolean;
722
- xValue: number;
723
- yValue: number;
724
- yRate: number;
725
- visible: boolean;
726
- color: string;
727
- xPos: number;
728
- yPos: number;
729
- yGroup: number;
730
- drillDown: any[] | object;
731
- range: IValueRange;
732
- zValue: number;
733
- label: any;
734
- ani: RcAnimation;
735
- yPrev: number;
736
- yNew: number;
737
- constructor(source: any);
738
- ariaHint(): string;
739
- labelCount(): number;
740
- getValue(): number;
741
- proxy(): any;
742
- assignTo(proxy?: any): any;
743
- getProp(fld: string | number): any;
744
- parse(series: ISeries): void;
745
- getLabel(index: number): any;
746
- swap(): void;
747
- getTooltipPos(): IPoint;
748
- updateValue(value: number, animation: RcAnimation): void;
749
- cleanValue(): void;
750
- getTooltip(param: string): any;
751
- protected _assignTo(proxy: any): any;
752
- protected _readArray(series: ISeries, v: any[]): void;
753
- protected _readObject(series: ISeries, v: any): void;
754
- protected _readSingle(v: any): void;
755
- }
756
- declare class DataPointCollection {
757
- protected _owner: ISeries;
758
- private _points;
759
- constructor(owner: ISeries);
760
- get count(): number;
761
- isEmpty(): boolean;
762
- get(index: number): DataPoint;
763
- pointAt(xValue: number | any): DataPoint;
764
- contains(p: DataPoint): boolean;
765
- load(source: any): void;
766
- clear(): void;
767
- add(p: DataPoint): void;
768
- remove(p: DataPoint): boolean;
769
- getProps(prop: string | number): any[];
770
- getCategories(axis: string): any[];
771
- getProxies(): any[];
772
- forEach(callback: (p: DataPoint, i?: number) => any): void;
773
- getPoints(xAxis: IAxis, yAxis: IAxis): DataPoint[];
774
- }
775
-
776
821
  declare abstract class Widget extends ChartItem {
777
822
  protected _doLoad(source: any): void;
778
823
  protected _doPrepareRender(chart: IChart): void;
@@ -844,9 +889,11 @@ declare class DataPointLabel extends IconedText {
844
889
  textAlign: Align;
845
890
  offset: number;
846
891
  distance: number;
892
+ textField: string;
847
893
  textCallback: (point: any) => string;
848
894
  visibleCallback: (point: any) => boolean;
849
895
  styleCallback: (point: any) => SVGStyleOrClass;
896
+ getValue(p: DataPoint, index: number): any;
850
897
  getTextDomain(p: DataPoint): IRichTextDomain;
851
898
  getText(value: any): string;
852
899
  getOffset(): number;
@@ -976,7 +1023,7 @@ declare abstract class Series extends ChartItem implements ISeries, IChartDataLi
976
1023
  _yFielder: (src: any) => any;
977
1024
  _zFielder: (src: any) => any;
978
1025
  _colorFielder: (src: any) => any;
979
- _dataDirty: boolean;
1026
+ _dataSourceDirty: boolean;
980
1027
  _cdata: ChartData;
981
1028
  protected _points: DataPointCollection;
982
1029
  _runPoints: DataPoint[];
@@ -1035,6 +1082,8 @@ declare abstract class Series extends ChartItem implements ISeries, IChartDataLi
1035
1082
  visibleInLegend: boolean;
1036
1083
  visibleInNavigator: boolean;
1037
1084
  tooltipText: string;
1085
+ tooltipCallback: (args: any) => string;
1086
+ loadAnimation: SeriesLoadAnimation;
1038
1087
  pointStyleCallback: PointStyleCallback;
1039
1088
  onPointClick: PointClickCallback;
1040
1089
  contains(p: DataPoint): boolean;
@@ -1052,6 +1101,7 @@ declare abstract class Series extends ChartItem implements ISeries, IChartDataLi
1052
1101
  legendMarker(doc: Document, size: number): RcElement;
1053
1102
  legendColor(): string;
1054
1103
  legendLabel(): string;
1104
+ styleLegendMarker(marker: RcElement): void;
1055
1105
  canMixWith(other: IPlottingItem): boolean;
1056
1106
  getBaseValue(axis: IAxis): number;
1057
1107
  isBased(axis: IAxis): boolean;
@@ -1110,6 +1160,7 @@ declare abstract class Series extends ChartItem implements ISeries, IChartDataLi
1110
1160
  _colorByPoint(): boolean;
1111
1161
  protected _createFielder(f: any): (v: any) => any;
1112
1162
  protected _createFielders(): void;
1163
+ protected _defaultLoadAnimation(): SeriesLoadAnimation;
1113
1164
  protected _doLoad(src: any): void;
1114
1165
  protected _doLoadData(src: any): any[];
1115
1166
  _loadPoints(data: any): void;
@@ -1232,88 +1283,67 @@ declare abstract class SeriesGroup<T extends Series> extends ChartItem implement
1232
1283
  private $_collectFill;
1233
1284
  }
1234
1285
 
1235
- declare enum AnnotationScope {
1236
- CHART = "chart",
1237
- CONTAINER = "container"
1238
- }
1239
- declare abstract class Annotation extends ChartItem {
1240
- _seriesObj: ISeries;
1241
- constructor(chart: IChart);
1242
- abstract _type(): string;
1243
- front: boolean;
1244
- name: string;
1245
- align: Align;
1246
- verticalAlign: VerticalAlign;
1247
- offsetX: number;
1248
- offsetY: number;
1249
- rotation: number;
1250
- scope: AnnotationScope;
1251
- series: string;
1252
- loadAnimation: IAnnotationAnimation;
1253
- backgroundStyle: SVGStyleOrClass;
1254
- getPosition(inverted: boolean, left: number, top: number, wDomain: number, hDomain: number, width: number, height: number): IPoint;
1255
- update(): void;
1256
- protected _doPrepareRender(chart: IChart): void;
1257
- }
1258
-
1259
- declare enum ZoomType {
1260
- NONE = "none",
1261
- X = "x",
1262
- Y = "y",
1263
- BOTH = "both"
1264
- }
1265
- declare class ZoomButton extends ChartItem {
1266
- body: Body;
1267
- constructor(body: Body);
1268
- isVisible(): boolean;
1269
- }
1270
- declare class BodySplit extends ChartItem {
1271
- body: Body;
1272
- constructor(body: Body);
1273
- size: number;
1274
- }
1275
- interface IPolar {
1276
- start: number;
1277
- total: number;
1278
- cx: number;
1279
- cy: number;
1280
- rd: number;
1286
+ declare class DataPoint {
1287
+ index: number;
1288
+ vindex: number;
1289
+ x: any;
1290
+ y: any;
1291
+ series: string | number;
1292
+ readonly pid: number;
1293
+ source: any;
1294
+ isNull: boolean;
1295
+ xValue: number;
1296
+ yValue: number;
1297
+ yRate: number;
1298
+ visible: boolean;
1299
+ color: string;
1300
+ xPos: number;
1301
+ yPos: number;
1302
+ yGroup: number;
1303
+ drillDown: any[] | object;
1304
+ range: IValueRange;
1305
+ zValue: number;
1306
+ yLabel: any;
1307
+ ani: RcAnimation;
1308
+ yPrev: number;
1309
+ yNew: number;
1310
+ constructor(source: any);
1311
+ ariaHint(): string;
1312
+ labelCount(): number;
1313
+ getValue(): number;
1314
+ proxy(): any;
1315
+ assignTo(proxy?: any): any;
1316
+ getProp(fld: string | number): any;
1317
+ parse(series: ISeries): void;
1318
+ getLabelValue(index: number): any;
1319
+ swap(): void;
1320
+ getTooltipPos(): IPoint;
1321
+ updateValue(value: number, animation: RcAnimation): void;
1322
+ cleanValue(): void;
1323
+ getTooltip(param: string): any;
1324
+ protected _assignTo(proxy: any): any;
1325
+ protected _readArray(series: ISeries, v: any[]): void;
1326
+ protected _readObject(series: ISeries, v: any): void;
1327
+ protected _readSingle(v: any): void;
1281
1328
  }
1282
- declare class Body extends ChartItem {
1283
- private _radius;
1284
- private _centerX;
1285
- private _centerY;
1286
- private _annotations;
1287
- private _radiusDim;
1288
- private _cxDim;
1289
- private _cyDim;
1290
- private _rd;
1291
- private _cx;
1292
- private _cy;
1293
- constructor(chart: IChart);
1294
- split: BodySplit;
1295
- get radius(): RtPercentSize;
1296
- set radius(value: RtPercentSize);
1297
- innerRadius: RtPercentSize;
1298
- get centerX(): RtPercentSize;
1299
- set centerX(value: RtPercentSize);
1300
- get centerY(): RtPercentSize;
1301
- set centerY(value: RtPercentSize);
1302
- circular: boolean;
1303
- image: BackgroundImage;
1304
- zoomType: ZoomType;
1305
- zoomButton: ZoomButton;
1306
- canZoom(): boolean;
1307
- calcRadius(width: number, height: number): number;
1308
- setPolar(width: number, height: number): Body;
1309
- getPolar(axis: Axis): IPolar;
1310
- isZoomed(): boolean;
1311
- '@config annotation': Annotation[];
1312
- getAnnotations(): Annotation[];
1313
- getAnnotation(name: string): Annotation;
1314
- protected _doLoadProp(prop: string, value: any): boolean;
1315
- protected _doPrepareRender(chart: IChart): void;
1316
- private $_loadAnnotations;
1329
+ declare class DataPointCollection {
1330
+ protected _owner: ISeries;
1331
+ private _points;
1332
+ constructor(owner: ISeries);
1333
+ get count(): number;
1334
+ isEmpty(): boolean;
1335
+ get(index: number): DataPoint;
1336
+ pointAt(xValue: number | any): DataPoint;
1337
+ contains(p: DataPoint): boolean;
1338
+ load(source: any): void;
1339
+ clear(): void;
1340
+ add(p: DataPoint): void;
1341
+ remove(p: DataPoint): boolean;
1342
+ getProps(prop: string | number): any[];
1343
+ getCategories(axis: string): any[];
1344
+ getProxies(): any[];
1345
+ forEach(callback: (p: DataPoint, i?: number) => any): void;
1346
+ getPoints(xAxis: IAxis, yAxis: IAxis): DataPoint[];
1317
1347
  }
1318
1348
 
1319
1349
  declare class Title extends ChartItem {
@@ -1350,8 +1380,6 @@ declare abstract class GaugeBase extends Widget {
1350
1380
  private _right;
1351
1381
  private _top;
1352
1382
  private _bottom;
1353
- row: number;
1354
- col: number;
1355
1383
  index: number;
1356
1384
  private _sizeDim;
1357
1385
  private _widthDim;
@@ -1363,6 +1391,8 @@ declare abstract class GaugeBase extends Widget {
1363
1391
  constructor(chart: IChart);
1364
1392
  abstract _type(): string;
1365
1393
  name: string;
1394
+ row: number;
1395
+ col: number;
1366
1396
  get left(): RtPercentSize;
1367
1397
  set left(value: RtPercentSize);
1368
1398
  get right(): RtPercentSize;
@@ -1377,7 +1407,7 @@ declare abstract class GaugeBase extends Widget {
1377
1407
  set height(value: RtPercentSize);
1378
1408
  get size(): RtPercentSize;
1379
1409
  set size(value: RtPercentSize);
1380
- paneStyle: SVGStyleOrClass;
1410
+ backgroundStyle: SVGStyleOrClass;
1381
1411
  getSize(width: number, height: number): ISize;
1382
1412
  getLeft(doamin: number): number;
1383
1413
  getRight(doamin: number): number;
@@ -1417,7 +1447,7 @@ declare class GaugeCollection {
1417
1447
  private _visibles;
1418
1448
  private _gauges;
1419
1449
  constructor(chart: IChart);
1420
- get count(): number;
1450
+ isEmpty(): boolean;
1421
1451
  get firstGauge(): Gauge;
1422
1452
  getVisibles(): GaugeBase[];
1423
1453
  getPaneVisibles(row: number, col: number): GaugeBase[];
@@ -2069,7 +2099,7 @@ declare class RcChartControl {
2069
2099
  private _proxy;
2070
2100
  private _exporter;
2071
2101
  private constructor();
2072
- load(config: any, animate?: boolean): void;
2102
+ load(config: any, animate?: boolean, callback?: () => void): void;
2073
2103
  render(now?: boolean): void;
2074
2104
  get xAxis(): RcChartAxis;
2075
2105
  getXAxis(name: string | number): RcChartAxis;
@@ -2132,7 +2162,7 @@ declare class Globals {
2132
2162
  static setDebugging(debug: boolean): void;
2133
2163
  static setLogging(logging: boolean): void;
2134
2164
  static setAnimatable(value: boolean): void;
2135
- static createChart(doc: Document, container: string | HTMLDivElement, config: any, animate?: boolean): RcChartControl;
2165
+ static createChart(doc: Document, container: string | HTMLDivElement, config: any, animate?: boolean, callback?: () => void): RcChartControl;
2136
2166
  static createData(options?: IRcChartDataOptions, rows?: any[]): RcChartData;
2137
2167
  }
2138
2168