realchart 0.9.4 → 0.9.5
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/README.md +27 -39
- package/dist/index.d.ts +47 -16
- package/dist/index.esm.js +2 -2
- package/dist/index.js +2 -2
- package/dist/realchart-style.css +8 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,45 +23,33 @@ const chart = RealChart.createChart(document, 'realchart', config);
|
|
|
23
23
|
```ts
|
|
24
24
|
// config
|
|
25
25
|
const config = {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
title: "
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
],
|
|
54
|
-
data2: [
|
|
55
|
-
[1, 7],
|
|
56
|
-
[2, 11],
|
|
57
|
-
[3, 9],
|
|
58
|
-
[4, 10],
|
|
59
|
-
[5, 14.3],
|
|
60
|
-
[6, 13],
|
|
61
|
-
[7, 12.5]
|
|
62
|
-
],
|
|
63
|
-
}
|
|
64
|
-
}
|
|
26
|
+
options: {},
|
|
27
|
+
title: "Axis Breaks",
|
|
28
|
+
xAxis: {
|
|
29
|
+
title: "일일 Daily fat",
|
|
30
|
+
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
|
31
|
+
grid: true
|
|
32
|
+
},
|
|
33
|
+
yAxis: {
|
|
34
|
+
title: "Vertical 수직축 Axis",
|
|
35
|
+
break: [{
|
|
36
|
+
from: 500,
|
|
37
|
+
to: 3000,
|
|
38
|
+
inclusive: false,
|
|
39
|
+
space: 5
|
|
40
|
+
}]
|
|
41
|
+
},
|
|
42
|
+
series: [{
|
|
43
|
+
name: 'column1',
|
|
44
|
+
pointLabel: true,
|
|
45
|
+
data: [499, 128, 180, 345, 3050, 3590, 3840, 3630, 3120, 520, 240, 80]
|
|
46
|
+
}, {
|
|
47
|
+
name: 'column3',
|
|
48
|
+
pointLabel: true,
|
|
49
|
+
data: [64, 138, 164, 408, 3120, 3540, 3875, 3420, 720, 320, 160, 20]
|
|
50
|
+
}]
|
|
51
|
+
};
|
|
52
|
+
const chart = RealChart.createChart(document, 'realchart', config);
|
|
65
53
|
```
|
|
66
54
|
### styles
|
|
67
55
|
|
package/dist/index.d.ts
CHANGED
|
@@ -54,10 +54,10 @@ declare enum VerticalAlign {
|
|
|
54
54
|
BOTTOM = "bottom"
|
|
55
55
|
}
|
|
56
56
|
declare enum SectionDir {
|
|
57
|
-
LEFT =
|
|
58
|
-
TOP =
|
|
59
|
-
BOTTOM =
|
|
60
|
-
RIGHT =
|
|
57
|
+
LEFT = "left",
|
|
58
|
+
TOP = "top",
|
|
59
|
+
BOTTOM = "bottom",
|
|
60
|
+
RIGHT = "right"
|
|
61
61
|
}
|
|
62
62
|
declare enum AlignBase {
|
|
63
63
|
CHART = "chart",
|
|
@@ -90,6 +90,7 @@ interface IPointerHandler {
|
|
|
90
90
|
declare abstract class RcControl extends RcWrappableObject {
|
|
91
91
|
static readonly CLASS_NAME = "rct-control";
|
|
92
92
|
static readonly SHADOW_FILTER = "rr-chart-shadow-filter";
|
|
93
|
+
static _animatable: boolean;
|
|
93
94
|
private _container;
|
|
94
95
|
private _dom;
|
|
95
96
|
private _htmlRoot;
|
|
@@ -101,7 +102,6 @@ declare abstract class RcControl extends RcWrappableObject {
|
|
|
101
102
|
private _testing;
|
|
102
103
|
private _dirty;
|
|
103
104
|
private _requestTimer;
|
|
104
|
-
private _invalidElements;
|
|
105
105
|
private _toAnimation;
|
|
106
106
|
private _invalidateLock;
|
|
107
107
|
private _lockDirty;
|
|
@@ -407,12 +407,15 @@ declare abstract class ChartItem extends RcObject {
|
|
|
407
407
|
set visible(value: boolean);
|
|
408
408
|
style: SVGStyleOrClass;
|
|
409
409
|
load(source: any): ChartItem;
|
|
410
|
+
update(source: any): ChartItem;
|
|
410
411
|
prepareRender(): void;
|
|
411
412
|
protected _changed(): void;
|
|
412
413
|
protected _doLoadSimple(source: any): boolean;
|
|
413
414
|
protected _getDefObjProps(prop: string): any;
|
|
414
415
|
protected _doLoad(source: any): void;
|
|
415
416
|
protected _doLoadProp(prop: string, value: any): boolean;
|
|
417
|
+
protected _doUpdateSimple(source: any): boolean;
|
|
418
|
+
protected _doUpdate(source: any): boolean;
|
|
416
419
|
protected _doPrepareRender(chart: IChart): void;
|
|
417
420
|
}
|
|
418
421
|
declare enum ChartTextEffect {
|
|
@@ -489,12 +492,13 @@ interface IPointPos {
|
|
|
489
492
|
}
|
|
490
493
|
declare class DataPoint {
|
|
491
494
|
static swap(pts: IPointPos[]): IPointPos[];
|
|
492
|
-
source: any;
|
|
493
495
|
index: number;
|
|
494
496
|
vindex: number;
|
|
495
497
|
x: any;
|
|
496
498
|
y: any;
|
|
499
|
+
series: string | number;
|
|
497
500
|
readonly pid: number;
|
|
501
|
+
source: any;
|
|
498
502
|
isNull: boolean;
|
|
499
503
|
xValue: number;
|
|
500
504
|
yValue: number;
|
|
@@ -509,11 +513,13 @@ declare class DataPoint {
|
|
|
509
513
|
get xAbs(): number;
|
|
510
514
|
ariaHint(): string;
|
|
511
515
|
labelCount(): number;
|
|
516
|
+
assignTo(proxy: any): void;
|
|
512
517
|
getProp(fld: string | number): any;
|
|
513
518
|
parse(series: ISeries): void;
|
|
514
519
|
getLabel(index: number): any;
|
|
515
520
|
getValueOf: (traget: any, param: string) => any;
|
|
516
521
|
swap(): void;
|
|
522
|
+
protected _assignTo(proxy: any): any;
|
|
517
523
|
protected _colorIndex(): number;
|
|
518
524
|
protected _readArray(series: ISeries, v: any[]): void;
|
|
519
525
|
protected _readObject(series: ISeries, v: any): void;
|
|
@@ -536,12 +542,14 @@ declare class DataPointCollection {
|
|
|
536
542
|
|
|
537
543
|
interface ILegendSource {
|
|
538
544
|
visible: boolean;
|
|
545
|
+
legendMarker(): RcElement;
|
|
539
546
|
legendColor(): string;
|
|
540
547
|
legendLabel(): string;
|
|
541
548
|
}
|
|
542
549
|
declare class LegendItem extends ChartItem {
|
|
543
550
|
legend: Legend;
|
|
544
551
|
source: ILegendSource;
|
|
552
|
+
static readonly MARKER_SIZE = 12;
|
|
545
553
|
constructor(legend: Legend, source: ILegendSource);
|
|
546
554
|
text(): string;
|
|
547
555
|
}
|
|
@@ -586,6 +594,10 @@ declare class Legend extends ChartItem {
|
|
|
586
594
|
getLayout(): LegendLayout;
|
|
587
595
|
getMaxWidth(domain: number): number;
|
|
588
596
|
getMaxHeight(domain: number): number;
|
|
597
|
+
getLeft(doamin: number): number;
|
|
598
|
+
getRight(doamin: number): number;
|
|
599
|
+
getTop(doamin: number): number;
|
|
600
|
+
getBottom(doamin: number): number;
|
|
589
601
|
protected _doLoad(src: any): void;
|
|
590
602
|
protected _doPrepareRender(chart: IChart): void;
|
|
591
603
|
private $_collectItems;
|
|
@@ -620,6 +632,7 @@ declare class DataPointLabel extends FormattableText {
|
|
|
620
632
|
distance: number;
|
|
621
633
|
constructor(chart: IChart);
|
|
622
634
|
getText(value: any): string;
|
|
635
|
+
protected _doLoad(source: any): void;
|
|
623
636
|
}
|
|
624
637
|
interface IPlottingItem {
|
|
625
638
|
index: number;
|
|
@@ -710,7 +723,7 @@ interface ISeries extends IPlottingItem {
|
|
|
710
723
|
getValue(point: DataPoint, axis: IAxis): number;
|
|
711
724
|
isVisible(p: DataPoint): boolean;
|
|
712
725
|
}
|
|
713
|
-
interface
|
|
726
|
+
interface IPointStyleCallbackArgs {
|
|
714
727
|
series: string | number;
|
|
715
728
|
count: number;
|
|
716
729
|
vcount: number;
|
|
@@ -723,7 +736,7 @@ interface IPointStyleArgs {
|
|
|
723
736
|
xValue: any;
|
|
724
737
|
yValue: any;
|
|
725
738
|
}
|
|
726
|
-
type PointStyleCallback = (args:
|
|
739
|
+
type PointStyleCallback = (args: IPointStyleCallbackArgs) => SVGStyleOrClass;
|
|
727
740
|
declare abstract class Series extends ChartItem implements ISeries, ILegendSource {
|
|
728
741
|
static _loadSeries(chart: IChart, src: any, defType?: string): Series;
|
|
729
742
|
readonly name: string;
|
|
@@ -741,7 +754,8 @@ declare abstract class Series extends ChartItem implements ISeries, ILegendSourc
|
|
|
741
754
|
_maxValue: number;
|
|
742
755
|
_referents: Series[];
|
|
743
756
|
_calcedColor: string;
|
|
744
|
-
|
|
757
|
+
private _legendMarker;
|
|
758
|
+
protected _pointArgs: IPointStyleCallbackArgs;
|
|
745
759
|
constructor(chart: IChart, name?: string);
|
|
746
760
|
abstract _type(): string;
|
|
747
761
|
zOrder: number;
|
|
@@ -756,6 +770,7 @@ declare abstract class Series extends ChartItem implements ISeries, ILegendSourc
|
|
|
756
770
|
color: string;
|
|
757
771
|
pointColors: boolean | string[];
|
|
758
772
|
clipped: boolean;
|
|
773
|
+
displayInLegend: boolean;
|
|
759
774
|
pointStyleCallback: PointStyleCallback;
|
|
760
775
|
contains(p: DataPoint): boolean;
|
|
761
776
|
getPoints(): DataPointCollection;
|
|
@@ -768,6 +783,8 @@ declare abstract class Series extends ChartItem implements ISeries, ILegendSourc
|
|
|
768
783
|
defaultYAxisType(): string;
|
|
769
784
|
clusterable(): boolean;
|
|
770
785
|
displayName(): string;
|
|
786
|
+
legendMarker(): RcElement;
|
|
787
|
+
setLegendMarker(elt: RcElement): void;
|
|
771
788
|
legendColor(): string;
|
|
772
789
|
legendLabel(): string;
|
|
773
790
|
ignoreAxisBase(axis: IAxis): boolean;
|
|
@@ -794,9 +811,9 @@ declare abstract class Series extends ChartItem implements ISeries, ILegendSourc
|
|
|
794
811
|
getLabelOff(off: number): number;
|
|
795
812
|
referBy(ref: Series): void;
|
|
796
813
|
setPointVisible(p: DataPoint, visible: boolean): void;
|
|
797
|
-
protected _createPointArgs():
|
|
798
|
-
protected _preparePointArgs(args:
|
|
799
|
-
protected _getPointStyleArgs(args:
|
|
814
|
+
protected _createPointArgs(): IPointStyleCallbackArgs;
|
|
815
|
+
protected _preparePointArgs(args: IPointStyleCallbackArgs): void;
|
|
816
|
+
protected _getPointStyleArgs(args: IPointStyleCallbackArgs, p: DataPoint): void;
|
|
800
817
|
getPointStyle(p: DataPoint): any;
|
|
801
818
|
_referOtherSeries(series: Series): boolean;
|
|
802
819
|
protected _getField(axis: IAxis): any;
|
|
@@ -852,6 +869,7 @@ declare abstract class SeriesGroup<T extends Series> extends ChartItem implement
|
|
|
852
869
|
layout: SeriesGroupLayout;
|
|
853
870
|
xAxis: string | number;
|
|
854
871
|
yAxis: string | number;
|
|
872
|
+
displayInLegend: boolean;
|
|
855
873
|
get series(): T[];
|
|
856
874
|
needAxes(): boolean;
|
|
857
875
|
isEmpty(): boolean;
|
|
@@ -1013,6 +1031,7 @@ declare abstract class Axis extends ChartItem implements IAxis {
|
|
|
1013
1031
|
protected abstract _createLabelModel(): AxisLabel;
|
|
1014
1032
|
protected abstract _doPrepareRender(): void;
|
|
1015
1033
|
protected abstract _doBuildTicks(min: number, max: number, length: number): IAxisTick[];
|
|
1034
|
+
isBased(): boolean;
|
|
1016
1035
|
disconnect(): void;
|
|
1017
1036
|
collectValues(): void;
|
|
1018
1037
|
collectReferentsValues(): void;
|
|
@@ -1164,6 +1183,7 @@ declare class ChartOptions extends ChartItem {
|
|
|
1164
1183
|
credits: Credits;
|
|
1165
1184
|
}
|
|
1166
1185
|
interface IChartEventListener {
|
|
1186
|
+
onModelChanged?(chart: Chart, item: ChartItem): void;
|
|
1167
1187
|
onVisibleChanged?(chart: Chart, item: ChartItem): void;
|
|
1168
1188
|
onPointVisibleChange?(chart: Chart, series: Series, point: DataPoint): void;
|
|
1169
1189
|
}
|
|
@@ -1225,9 +1245,9 @@ declare class Chart extends RcEventProvider<IChartEventListener> implements ICha
|
|
|
1225
1245
|
_getSeriesType(type: string): any;
|
|
1226
1246
|
_getAxisType(type: string): any;
|
|
1227
1247
|
getAxesGap(): number;
|
|
1248
|
+
_modelChanged(item: ChartItem): void;
|
|
1228
1249
|
_visibleChanged(item: ChartItem): void;
|
|
1229
1250
|
_pointVisibleChanged(series: Series, point: DataPoint): void;
|
|
1230
|
-
_modelChanged(item: ChartItem): void;
|
|
1231
1251
|
}
|
|
1232
1252
|
|
|
1233
1253
|
declare abstract class GroupElement extends RcElement {
|
|
@@ -1282,6 +1302,7 @@ declare abstract class ChartElement<T extends ChartItem> extends RcElement {
|
|
|
1282
1302
|
_debugRect: RectElement;
|
|
1283
1303
|
constructor(doc: Document, styleName?: any);
|
|
1284
1304
|
chart(): IChart;
|
|
1305
|
+
protected _prepareStyleOrClass(model: T): void;
|
|
1285
1306
|
measure(doc: Document, model: T, hintWidth: number, hintHeight: number, phase: number): ISize;
|
|
1286
1307
|
layout(param?: any): ChartElement<ChartItem>;
|
|
1287
1308
|
resizeByMeasured(): ChartElement<ChartItem>;
|
|
@@ -1409,9 +1430,11 @@ type LabelLayoutInfo = {
|
|
|
1409
1430
|
declare abstract class SeriesView<T extends Series> extends ChartElement<T> {
|
|
1410
1431
|
static readonly POINT_CLASS = "rct-point";
|
|
1411
1432
|
static readonly DATA_FOUCS = "focus";
|
|
1433
|
+
static readonly LEGEND_MARKER = "rct-legend-item-marker";
|
|
1412
1434
|
protected _pointContainer: PointContainer;
|
|
1413
1435
|
protected _labelContainer: PointLabelContainer;
|
|
1414
1436
|
private _trendLineView;
|
|
1437
|
+
protected _legendMarker: RcElement;
|
|
1415
1438
|
protected _visPoints: DataPoint[];
|
|
1416
1439
|
protected _inverted: boolean;
|
|
1417
1440
|
protected _animatable: boolean;
|
|
@@ -1432,13 +1455,17 @@ declare abstract class SeriesView<T extends Series> extends ChartElement<T> {
|
|
|
1432
1455
|
clicked(elt: Element): void;
|
|
1433
1456
|
protected _doPointClicked(view: IPointView): void;
|
|
1434
1457
|
protected _getColor(): string;
|
|
1458
|
+
prepareSeries(doc: Document, model: T): void;
|
|
1459
|
+
protected _prepareStyleOrClass(model: T): void;
|
|
1435
1460
|
protected _doMeasure(doc: Document, model: T, hintWidth: number, hintHeight: number, phase: number): ISize;
|
|
1436
1461
|
protected _doLayout(): void;
|
|
1437
1462
|
protected abstract _prepareSeries(doc: Document, model: T): void;
|
|
1438
1463
|
protected abstract _renderSeries(width: number, height: number): void;
|
|
1439
|
-
protected
|
|
1464
|
+
protected _getLegendMarker(doc: Document): RcElement;
|
|
1465
|
+
protected _createLegendMarker(doc: Document, size: number): RcElement;
|
|
1466
|
+
protected _collectVisPoints(model: T): DataPoint[];
|
|
1440
1467
|
private $_setColorIndex;
|
|
1441
|
-
protected _setPointStyle(v: RcElement, p: DataPoint, styles?: any[]): void;
|
|
1468
|
+
protected _setPointStyle(v: RcElement, model: T, p: DataPoint, styles?: any[]): void;
|
|
1442
1469
|
protected _labelViews(): PointLabelContainer;
|
|
1443
1470
|
protected _getViewRate(): number;
|
|
1444
1471
|
protected _animating(): boolean;
|
|
@@ -1510,6 +1537,7 @@ declare class BodyView extends ChartElement<Body> {
|
|
|
1510
1537
|
private _crosshairLines;
|
|
1511
1538
|
private _focused;
|
|
1512
1539
|
constructor(doc: Document, owner: IPlottingOwner);
|
|
1540
|
+
prepareSeries(doc: Document, chart: IChart): void;
|
|
1513
1541
|
prepareGuideContainers(): void;
|
|
1514
1542
|
pointerMoved(p: IPoint, target: EventTarget): void;
|
|
1515
1543
|
private $_setFocused;
|
|
@@ -1584,6 +1612,7 @@ declare class ChartControl extends RcControl implements IChartEventListener {
|
|
|
1584
1612
|
private _model;
|
|
1585
1613
|
private _chartView;
|
|
1586
1614
|
constructor(doc: Document, container: string | HTMLDivElement);
|
|
1615
|
+
onModelChanged(chart: Chart, item: ChartItem): void;
|
|
1587
1616
|
onVisibleChanged(chart: Chart, item: ChartItem): void;
|
|
1588
1617
|
onPointVisibleChanged(chart: Chart, series: Series, point: DataPoint): void;
|
|
1589
1618
|
get model(): Chart;
|
|
@@ -1606,11 +1635,13 @@ declare class RcChartControl {
|
|
|
1606
1635
|
declare class Globals {
|
|
1607
1636
|
static getVersion(): string;
|
|
1608
1637
|
static setDebugging(debug: boolean): void;
|
|
1638
|
+
static setAnimatable(value: boolean): void;
|
|
1609
1639
|
static createChart(doc: Document, container: string | HTMLDivElement, config: any): RcChartControl;
|
|
1610
1640
|
}
|
|
1611
1641
|
|
|
1612
1642
|
declare const getVersion: typeof Globals.getVersion;
|
|
1613
1643
|
declare const setDebugging: typeof Globals.setDebugging;
|
|
1644
|
+
declare const setAnimatable: typeof Globals.setAnimatable;
|
|
1614
1645
|
declare const createChart: typeof Globals.createChart;
|
|
1615
1646
|
|
|
1616
|
-
export { RcChartControl, createChart, getVersion, setDebugging };
|
|
1647
|
+
export { RcChartControl, createChart, getVersion, setAnimatable, setDebugging };
|