@oliasoft-open-source/charts-library 5.9.0-beta-7 → 5.9.0-beta-8
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 +16 -16
- package/dist/index.js +154 -155
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -904,6 +904,22 @@ export declare type UnusedParameter = unknown | any;
|
|
|
904
904
|
export { }
|
|
905
905
|
|
|
906
906
|
|
|
907
|
+
declare module 'chart.js' {
|
|
908
|
+
interface PluginOptionsByType<TType extends ChartType> {
|
|
909
|
+
annotationDraggerPlugin?: AnnotationDraggerPluginOptions;
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
|
|
914
|
+
declare module 'chart.js' {
|
|
915
|
+
interface PluginOptionsByType<TType extends ChartType> {
|
|
916
|
+
calloutConnectorPlugin?: {
|
|
917
|
+
enableCalloutAnnotation?: boolean;
|
|
918
|
+
};
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
|
|
907
923
|
/**
|
|
908
924
|
* Vertical Markers Plugin
|
|
909
925
|
*
|
|
@@ -955,19 +971,3 @@ declare module 'chart.js' {
|
|
|
955
971
|
} | TVerticalMarkersOptions;
|
|
956
972
|
}
|
|
957
973
|
}
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
declare module 'chart.js' {
|
|
961
|
-
interface PluginOptionsByType<TType extends ChartType> {
|
|
962
|
-
annotationDraggerPlugin?: AnnotationDraggerPluginOptions;
|
|
963
|
-
}
|
|
964
|
-
}
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
declare module 'chart.js' {
|
|
968
|
-
interface PluginOptionsByType<TType extends ChartType> {
|
|
969
|
-
calloutConnectorPlugin?: {
|
|
970
|
-
enableCalloutAnnotation?: boolean;
|
|
971
|
-
};
|
|
972
|
-
}
|
|
973
|
-
}
|
package/dist/index.js
CHANGED
|
@@ -18627,6 +18627,146 @@ function drawElement(ctx, chartArea, state, item) {
|
|
|
18627
18627
|
invokeHook(state, el, "afterDraw");
|
|
18628
18628
|
} else el.draw(ctx, chartArea);
|
|
18629
18629
|
}
|
|
18630
|
+
var MouseEvents = /* @__PURE__ */ function(MouseEvents) {
|
|
18631
|
+
MouseEvents["MOUSEDOWN"] = "mousedown";
|
|
18632
|
+
MouseEvents["MOUSEMOVE"] = "mousemove";
|
|
18633
|
+
MouseEvents["MOUSEUP"] = "mouseup";
|
|
18634
|
+
return MouseEvents;
|
|
18635
|
+
}({});
|
|
18636
|
+
var AnnotationType$1 = /* @__PURE__ */ function(AnnotationType) {
|
|
18637
|
+
AnnotationType["POINT"] = "point";
|
|
18638
|
+
AnnotationType["BOX"] = "box";
|
|
18639
|
+
AnnotationType["LINE"] = "line";
|
|
18640
|
+
AnnotationType["ELLIPSE"] = "ellipse";
|
|
18641
|
+
AnnotationType["LABEL"] = "label";
|
|
18642
|
+
return AnnotationType;
|
|
18643
|
+
}({});
|
|
18644
|
+
var DragAxis = /* @__PURE__ */ function(DragAxis) {
|
|
18645
|
+
DragAxis["X"] = "x";
|
|
18646
|
+
DragAxis["Y"] = "y";
|
|
18647
|
+
DragAxis["Both"] = "both";
|
|
18648
|
+
return DragAxis;
|
|
18649
|
+
}({});
|
|
18650
|
+
//#endregion
|
|
18651
|
+
//#region src/components/common/plugins/gradient-background-plugin/enums.ts
|
|
18652
|
+
var GradientDirection = /* @__PURE__ */ function(GradientDirection) {
|
|
18653
|
+
GradientDirection[GradientDirection["TopToBottom"] = 0] = "TopToBottom";
|
|
18654
|
+
GradientDirection[GradientDirection["BottomToTop"] = 1] = "BottomToTop";
|
|
18655
|
+
GradientDirection[GradientDirection["LeftToRight"] = 2] = "LeftToRight";
|
|
18656
|
+
GradientDirection[GradientDirection["RightToLeft"] = 3] = "RightToLeft";
|
|
18657
|
+
GradientDirection[GradientDirection["TopLeftToBottomRight"] = 4] = "TopLeftToBottomRight";
|
|
18658
|
+
GradientDirection[GradientDirection["BottomRightToTopLeft"] = 5] = "BottomRightToTopLeft";
|
|
18659
|
+
GradientDirection[GradientDirection["BottomLeftToTopRight"] = 6] = "BottomLeftToTopRight";
|
|
18660
|
+
GradientDirection[GradientDirection["TopRightToBottomLeft"] = 7] = "TopRightToBottomLeft";
|
|
18661
|
+
return GradientDirection;
|
|
18662
|
+
}({});
|
|
18663
|
+
//#endregion
|
|
18664
|
+
//#region src/components/common/enums.ts
|
|
18665
|
+
var AxisType = /* @__PURE__ */ function(AxisType) {
|
|
18666
|
+
AxisType["X"] = "x";
|
|
18667
|
+
AxisType["Y"] = "y";
|
|
18668
|
+
return AxisType;
|
|
18669
|
+
}({});
|
|
18670
|
+
var Position = /* @__PURE__ */ function(Position) {
|
|
18671
|
+
Position["Bottom"] = "bottom";
|
|
18672
|
+
Position["Top"] = "top";
|
|
18673
|
+
Position["Left"] = "left";
|
|
18674
|
+
Position["Right"] = "right";
|
|
18675
|
+
Position["TopRight"] = "top-right";
|
|
18676
|
+
Position["TopLeft"] = "top-left";
|
|
18677
|
+
Position["BottomLeft"] = "bottom-left";
|
|
18678
|
+
Position["BottomRight"] = "bottom-right";
|
|
18679
|
+
return Position;
|
|
18680
|
+
}({});
|
|
18681
|
+
var ChartType = /* @__PURE__ */ function(ChartType) {
|
|
18682
|
+
ChartType["LINE"] = "line";
|
|
18683
|
+
ChartType["BAR"] = "bar";
|
|
18684
|
+
ChartType["PIE"] = "pie";
|
|
18685
|
+
ChartType["SCATTER"] = "scatter";
|
|
18686
|
+
ChartType["Line"] = "line";
|
|
18687
|
+
ChartType["Bar"] = "bar";
|
|
18688
|
+
ChartType["Pie"] = "pie";
|
|
18689
|
+
ChartType["Scatter"] = "scatter";
|
|
18690
|
+
return ChartType;
|
|
18691
|
+
}({});
|
|
18692
|
+
var CursorStyle = /* @__PURE__ */ function(CursorStyle) {
|
|
18693
|
+
CursorStyle["Pointer"] = "pointer";
|
|
18694
|
+
CursorStyle["Initial"] = "initial";
|
|
18695
|
+
CursorStyle["Grab"] = "grab";
|
|
18696
|
+
CursorStyle["Grabbing"] = "grabbing";
|
|
18697
|
+
CursorStyle["Crosshair"] = "crosshair";
|
|
18698
|
+
CursorStyle["Move"] = "move";
|
|
18699
|
+
return CursorStyle;
|
|
18700
|
+
}({});
|
|
18701
|
+
var ScaleType = /* @__PURE__ */ function(ScaleType) {
|
|
18702
|
+
ScaleType["Category"] = "category";
|
|
18703
|
+
ScaleType["Linear"] = "linear";
|
|
18704
|
+
ScaleType["Logarithmic"] = "logarithmic";
|
|
18705
|
+
return ScaleType;
|
|
18706
|
+
}({});
|
|
18707
|
+
var ChartDirection = /* @__PURE__ */ function(ChartDirection) {
|
|
18708
|
+
ChartDirection["VERTICAL"] = "vertical";
|
|
18709
|
+
ChartDirection["HORIZONTAL"] = "horizontal";
|
|
18710
|
+
ChartDirection["Vertical"] = "vertical";
|
|
18711
|
+
ChartDirection["Horizontal"] = "horizontal";
|
|
18712
|
+
return ChartDirection;
|
|
18713
|
+
}({});
|
|
18714
|
+
var TooltipLabel = /* @__PURE__ */ function(TooltipLabel) {
|
|
18715
|
+
TooltipLabel["Y"] = "yLabel";
|
|
18716
|
+
TooltipLabel["X"] = "xLabel";
|
|
18717
|
+
return TooltipLabel;
|
|
18718
|
+
}({});
|
|
18719
|
+
var AlignOptions = /* @__PURE__ */ function(AlignOptions) {
|
|
18720
|
+
AlignOptions["End"] = "end";
|
|
18721
|
+
AlignOptions["Start"] = "start";
|
|
18722
|
+
AlignOptions["Center"] = "center";
|
|
18723
|
+
AlignOptions["Right"] = "right";
|
|
18724
|
+
AlignOptions["Left"] = "left";
|
|
18725
|
+
return AlignOptions;
|
|
18726
|
+
}({});
|
|
18727
|
+
var PointType = /* @__PURE__ */ function(PointType) {
|
|
18728
|
+
PointType["Casing"] = "casing";
|
|
18729
|
+
return PointType;
|
|
18730
|
+
}({});
|
|
18731
|
+
var AnnotationType = /* @__PURE__ */ function(AnnotationType) {
|
|
18732
|
+
AnnotationType["Box"] = "box";
|
|
18733
|
+
AnnotationType["Ellipse"] = "ellipse";
|
|
18734
|
+
AnnotationType["Line"] = "line";
|
|
18735
|
+
AnnotationType["Text"] = "text";
|
|
18736
|
+
AnnotationType["Label"] = "label";
|
|
18737
|
+
return AnnotationType;
|
|
18738
|
+
}({});
|
|
18739
|
+
var PointStyle = /* @__PURE__ */ function(PointStyle) {
|
|
18740
|
+
PointStyle["Circle"] = "circle";
|
|
18741
|
+
PointStyle["Square"] = "rect";
|
|
18742
|
+
PointStyle["Diamond"] = "rectRot";
|
|
18743
|
+
PointStyle["Triangle"] = "triangle";
|
|
18744
|
+
return PointStyle;
|
|
18745
|
+
}({});
|
|
18746
|
+
var ChartHoverMode = /* @__PURE__ */ function(ChartHoverMode) {
|
|
18747
|
+
ChartHoverMode["Nearest"] = "nearest";
|
|
18748
|
+
return ChartHoverMode;
|
|
18749
|
+
}({});
|
|
18750
|
+
var PanZoomMode = /* @__PURE__ */ function(PanZoomMode) {
|
|
18751
|
+
PanZoomMode["X"] = "x";
|
|
18752
|
+
PanZoomMode["Y"] = "y";
|
|
18753
|
+
PanZoomMode["XY"] = "xy";
|
|
18754
|
+
PanZoomMode["Z"] = "z";
|
|
18755
|
+
return PanZoomMode;
|
|
18756
|
+
}({});
|
|
18757
|
+
var Key = /* @__PURE__ */ function(Key) {
|
|
18758
|
+
Key["Shift"] = "Shift";
|
|
18759
|
+
return Key;
|
|
18760
|
+
}({});
|
|
18761
|
+
var Events = /* @__PURE__ */ function(Events) {
|
|
18762
|
+
Events["Mousemove"] = "mousemove";
|
|
18763
|
+
Events["Mouseout"] = "mouseout";
|
|
18764
|
+
Events["Click"] = "click";
|
|
18765
|
+
Events["Touchstart"] = "touchstart";
|
|
18766
|
+
Events["Touchmove"] = "touchmove";
|
|
18767
|
+
Events["Dblclick"] = "dblclick";
|
|
18768
|
+
return Events;
|
|
18769
|
+
}({});
|
|
18630
18770
|
//#endregion
|
|
18631
18771
|
//#region src/components/line-chart/plugins/line-chart.minor-gridlines-plugin.ts
|
|
18632
18772
|
var MINOR_TICKS_PER_MAJOR = 10;
|
|
@@ -18639,7 +18779,7 @@ var getLargestMajorTickWidth = (majorTickPositions) => {
|
|
|
18639
18779
|
};
|
|
18640
18780
|
var isValidPosition = (minorTickPosition, majorTickPositions, scale) => {
|
|
18641
18781
|
const { axis, left, top, right, bottom } = scale ?? {};
|
|
18642
|
-
const isHorizontal = axis ===
|
|
18782
|
+
const isHorizontal = axis === AxisType.X;
|
|
18643
18783
|
const start = isHorizontal ? left : top;
|
|
18644
18784
|
const end = isHorizontal ? right : bottom;
|
|
18645
18785
|
const isAfterStart = minorTickPosition > start;
|
|
@@ -18665,7 +18805,7 @@ var drawMinorTicksForScale = (scale) => {
|
|
|
18665
18805
|
const config = chart?.config;
|
|
18666
18806
|
if (!config?.options?.scales?.[scale?.id]?.grid?.drawOnChartArea) return;
|
|
18667
18807
|
if (config?.options?.indexAxis === scale?.axis) return;
|
|
18668
|
-
const isHorizontal = scale?.axis ===
|
|
18808
|
+
const isHorizontal = scale?.axis === AxisType.X;
|
|
18669
18809
|
const majorTickPositions = scale?.ticks?.map((_, index) => scale?.getPixelForTick(index))?.sort((a, b) => a - b);
|
|
18670
18810
|
const minorTickPositions = getMinorTickPositions(majorTickPositions, scale);
|
|
18671
18811
|
ctx?.save?.();
|
|
@@ -18770,146 +18910,6 @@ var GRADIENT_COLORS = [
|
|
|
18770
18910
|
color: "rgba(255,182,193,0.8)"
|
|
18771
18911
|
}
|
|
18772
18912
|
];
|
|
18773
|
-
var MouseEvents = /* @__PURE__ */ function(MouseEvents) {
|
|
18774
|
-
MouseEvents["MOUSEDOWN"] = "mousedown";
|
|
18775
|
-
MouseEvents["MOUSEMOVE"] = "mousemove";
|
|
18776
|
-
MouseEvents["MOUSEUP"] = "mouseup";
|
|
18777
|
-
return MouseEvents;
|
|
18778
|
-
}({});
|
|
18779
|
-
var AnnotationType$1 = /* @__PURE__ */ function(AnnotationType) {
|
|
18780
|
-
AnnotationType["POINT"] = "point";
|
|
18781
|
-
AnnotationType["BOX"] = "box";
|
|
18782
|
-
AnnotationType["LINE"] = "line";
|
|
18783
|
-
AnnotationType["ELLIPSE"] = "ellipse";
|
|
18784
|
-
AnnotationType["LABEL"] = "label";
|
|
18785
|
-
return AnnotationType;
|
|
18786
|
-
}({});
|
|
18787
|
-
var DragAxis = /* @__PURE__ */ function(DragAxis) {
|
|
18788
|
-
DragAxis["X"] = "x";
|
|
18789
|
-
DragAxis["Y"] = "y";
|
|
18790
|
-
DragAxis["Both"] = "both";
|
|
18791
|
-
return DragAxis;
|
|
18792
|
-
}({});
|
|
18793
|
-
//#endregion
|
|
18794
|
-
//#region src/components/common/plugins/gradient-background-plugin/enums.ts
|
|
18795
|
-
var GradientDirection = /* @__PURE__ */ function(GradientDirection) {
|
|
18796
|
-
GradientDirection[GradientDirection["TopToBottom"] = 0] = "TopToBottom";
|
|
18797
|
-
GradientDirection[GradientDirection["BottomToTop"] = 1] = "BottomToTop";
|
|
18798
|
-
GradientDirection[GradientDirection["LeftToRight"] = 2] = "LeftToRight";
|
|
18799
|
-
GradientDirection[GradientDirection["RightToLeft"] = 3] = "RightToLeft";
|
|
18800
|
-
GradientDirection[GradientDirection["TopLeftToBottomRight"] = 4] = "TopLeftToBottomRight";
|
|
18801
|
-
GradientDirection[GradientDirection["BottomRightToTopLeft"] = 5] = "BottomRightToTopLeft";
|
|
18802
|
-
GradientDirection[GradientDirection["BottomLeftToTopRight"] = 6] = "BottomLeftToTopRight";
|
|
18803
|
-
GradientDirection[GradientDirection["TopRightToBottomLeft"] = 7] = "TopRightToBottomLeft";
|
|
18804
|
-
return GradientDirection;
|
|
18805
|
-
}({});
|
|
18806
|
-
//#endregion
|
|
18807
|
-
//#region src/components/common/enums.ts
|
|
18808
|
-
var AxisType = /* @__PURE__ */ function(AxisType) {
|
|
18809
|
-
AxisType["X"] = "x";
|
|
18810
|
-
AxisType["Y"] = "y";
|
|
18811
|
-
return AxisType;
|
|
18812
|
-
}({});
|
|
18813
|
-
var Position = /* @__PURE__ */ function(Position) {
|
|
18814
|
-
Position["Bottom"] = "bottom";
|
|
18815
|
-
Position["Top"] = "top";
|
|
18816
|
-
Position["Left"] = "left";
|
|
18817
|
-
Position["Right"] = "right";
|
|
18818
|
-
Position["TopRight"] = "top-right";
|
|
18819
|
-
Position["TopLeft"] = "top-left";
|
|
18820
|
-
Position["BottomLeft"] = "bottom-left";
|
|
18821
|
-
Position["BottomRight"] = "bottom-right";
|
|
18822
|
-
return Position;
|
|
18823
|
-
}({});
|
|
18824
|
-
var ChartType = /* @__PURE__ */ function(ChartType) {
|
|
18825
|
-
ChartType["LINE"] = "line";
|
|
18826
|
-
ChartType["BAR"] = "bar";
|
|
18827
|
-
ChartType["PIE"] = "pie";
|
|
18828
|
-
ChartType["SCATTER"] = "scatter";
|
|
18829
|
-
ChartType["Line"] = "line";
|
|
18830
|
-
ChartType["Bar"] = "bar";
|
|
18831
|
-
ChartType["Pie"] = "pie";
|
|
18832
|
-
ChartType["Scatter"] = "scatter";
|
|
18833
|
-
return ChartType;
|
|
18834
|
-
}({});
|
|
18835
|
-
var CursorStyle = /* @__PURE__ */ function(CursorStyle) {
|
|
18836
|
-
CursorStyle["Pointer"] = "pointer";
|
|
18837
|
-
CursorStyle["Initial"] = "initial";
|
|
18838
|
-
CursorStyle["Grab"] = "grab";
|
|
18839
|
-
CursorStyle["Grabbing"] = "grabbing";
|
|
18840
|
-
CursorStyle["Crosshair"] = "crosshair";
|
|
18841
|
-
CursorStyle["Move"] = "move";
|
|
18842
|
-
return CursorStyle;
|
|
18843
|
-
}({});
|
|
18844
|
-
var ScaleType = /* @__PURE__ */ function(ScaleType) {
|
|
18845
|
-
ScaleType["Category"] = "category";
|
|
18846
|
-
ScaleType["Linear"] = "linear";
|
|
18847
|
-
ScaleType["Logarithmic"] = "logarithmic";
|
|
18848
|
-
return ScaleType;
|
|
18849
|
-
}({});
|
|
18850
|
-
var ChartDirection = /* @__PURE__ */ function(ChartDirection) {
|
|
18851
|
-
ChartDirection["VERTICAL"] = "vertical";
|
|
18852
|
-
ChartDirection["HORIZONTAL"] = "horizontal";
|
|
18853
|
-
ChartDirection["Vertical"] = "vertical";
|
|
18854
|
-
ChartDirection["Horizontal"] = "horizontal";
|
|
18855
|
-
return ChartDirection;
|
|
18856
|
-
}({});
|
|
18857
|
-
var TooltipLabel = /* @__PURE__ */ function(TooltipLabel) {
|
|
18858
|
-
TooltipLabel["Y"] = "yLabel";
|
|
18859
|
-
TooltipLabel["X"] = "xLabel";
|
|
18860
|
-
return TooltipLabel;
|
|
18861
|
-
}({});
|
|
18862
|
-
var AlignOptions = /* @__PURE__ */ function(AlignOptions) {
|
|
18863
|
-
AlignOptions["End"] = "end";
|
|
18864
|
-
AlignOptions["Start"] = "start";
|
|
18865
|
-
AlignOptions["Center"] = "center";
|
|
18866
|
-
AlignOptions["Right"] = "right";
|
|
18867
|
-
AlignOptions["Left"] = "left";
|
|
18868
|
-
return AlignOptions;
|
|
18869
|
-
}({});
|
|
18870
|
-
var PointType = /* @__PURE__ */ function(PointType) {
|
|
18871
|
-
PointType["Casing"] = "casing";
|
|
18872
|
-
return PointType;
|
|
18873
|
-
}({});
|
|
18874
|
-
var AnnotationType = /* @__PURE__ */ function(AnnotationType) {
|
|
18875
|
-
AnnotationType["Box"] = "box";
|
|
18876
|
-
AnnotationType["Ellipse"] = "ellipse";
|
|
18877
|
-
AnnotationType["Line"] = "line";
|
|
18878
|
-
AnnotationType["Text"] = "text";
|
|
18879
|
-
AnnotationType["Label"] = "label";
|
|
18880
|
-
return AnnotationType;
|
|
18881
|
-
}({});
|
|
18882
|
-
var PointStyle = /* @__PURE__ */ function(PointStyle) {
|
|
18883
|
-
PointStyle["Circle"] = "circle";
|
|
18884
|
-
PointStyle["Square"] = "rect";
|
|
18885
|
-
PointStyle["Diamond"] = "rectRot";
|
|
18886
|
-
PointStyle["Triangle"] = "triangle";
|
|
18887
|
-
return PointStyle;
|
|
18888
|
-
}({});
|
|
18889
|
-
var ChartHoverMode = /* @__PURE__ */ function(ChartHoverMode) {
|
|
18890
|
-
ChartHoverMode["Nearest"] = "nearest";
|
|
18891
|
-
return ChartHoverMode;
|
|
18892
|
-
}({});
|
|
18893
|
-
var PanZoomMode = /* @__PURE__ */ function(PanZoomMode) {
|
|
18894
|
-
PanZoomMode["X"] = "x";
|
|
18895
|
-
PanZoomMode["Y"] = "y";
|
|
18896
|
-
PanZoomMode["XY"] = "xy";
|
|
18897
|
-
PanZoomMode["Z"] = "z";
|
|
18898
|
-
return PanZoomMode;
|
|
18899
|
-
}({});
|
|
18900
|
-
var Key = /* @__PURE__ */ function(Key) {
|
|
18901
|
-
Key["Shift"] = "Shift";
|
|
18902
|
-
return Key;
|
|
18903
|
-
}({});
|
|
18904
|
-
var Events = /* @__PURE__ */ function(Events) {
|
|
18905
|
-
Events["Mousemove"] = "mousemove";
|
|
18906
|
-
Events["Mouseout"] = "mouseout";
|
|
18907
|
-
Events["Click"] = "click";
|
|
18908
|
-
Events["Touchstart"] = "touchstart";
|
|
18909
|
-
Events["Touchmove"] = "touchmove";
|
|
18910
|
-
Events["Dblclick"] = "dblclick";
|
|
18911
|
-
return Events;
|
|
18912
|
-
}({});
|
|
18913
18913
|
//#endregion
|
|
18914
18914
|
//#region src/components/common/helpers/chart-border-plugin.ts
|
|
18915
18915
|
/**
|
|
@@ -21648,8 +21648,8 @@ var calculateMaxWidth = (initialMaxWidth, chartAreaWidth) => {
|
|
|
21648
21648
|
var getLegendDimensions = (chart) => {
|
|
21649
21649
|
const { legend } = chart ?? {};
|
|
21650
21650
|
return {
|
|
21651
|
-
legendWidth: legend && legend?.display && legend?.options?.position ===
|
|
21652
|
-
legendHeight: legend && legend.display && (legend?.options?.position ===
|
|
21651
|
+
legendWidth: legend && legend?.display && legend?.options?.position === Position.Left ? legend?.width + legend?.options?.labels?.padding * 2 : 0,
|
|
21652
|
+
legendHeight: legend && legend.display && (legend?.options?.position === Position.Top || legend?.options?.position === Position.Bottom) ? legend?.height + legend?.options?.labels?.padding * 2 : 0
|
|
21653
21653
|
};
|
|
21654
21654
|
};
|
|
21655
21655
|
/**
|
|
@@ -21863,14 +21863,14 @@ var updateAnnotationPositionWithinBounds = (axis, newPosition, activeAnnotation,
|
|
|
21863
21863
|
yScaleID
|
|
21864
21864
|
})) return;
|
|
21865
21865
|
if (activeAnnotation.type === AnnotationType$1.POINT || activeAnnotation.type === AnnotationType$1.LABEL) {
|
|
21866
|
-
if (axis ===
|
|
21867
|
-
else if (axis ===
|
|
21866
|
+
if (axis === DragAxis.X) activeAnnotation.xValue = newPosition;
|
|
21867
|
+
else if (axis === DragAxis.Y) activeAnnotation.yValue = newPosition;
|
|
21868
21868
|
} else if (activeAnnotation.type === AnnotationType$1.BOX && metrics) {
|
|
21869
|
-
if (axis ===
|
|
21869
|
+
if (axis === DragAxis.X && metrics.width) {
|
|
21870
21870
|
activeAnnotation.xMin = newPosition - metrics.width / 2;
|
|
21871
21871
|
activeAnnotation.xMax = newPosition + metrics.width / 2;
|
|
21872
21872
|
}
|
|
21873
|
-
if (axis ===
|
|
21873
|
+
if (axis === DragAxis.Y && metrics.height) {
|
|
21874
21874
|
activeAnnotation.yMin = newPosition - metrics.height / 2;
|
|
21875
21875
|
activeAnnotation.yMax = newPosition + metrics.height / 2;
|
|
21876
21876
|
}
|
|
@@ -21886,7 +21886,7 @@ var setAnnotationBorderWidth = (chart, annotationId, borderWidth) => {
|
|
|
21886
21886
|
var handleAnnotationMouseDown = (event, canvas, scales, annotations, setDraggingState, hoveredAnnotationId) => {
|
|
21887
21887
|
const annotation = hoveredAnnotationId ? annotations?.[hoveredAnnotationId] : null;
|
|
21888
21888
|
if (!annotation) return;
|
|
21889
|
-
const { xScaleID =
|
|
21889
|
+
const { xScaleID = AxisType.X, yScaleID = AxisType.Y } = annotation;
|
|
21890
21890
|
const { x, y } = getMousePositionInCoordinates(event, canvas, scales, xScaleID, yScaleID);
|
|
21891
21891
|
const metrics = calculateAnnotationMetricsInValues(annotation);
|
|
21892
21892
|
if (annotation && annotation.enableDrag && !isNil(metrics.centerY) && !isNil(metrics.centerX)) {
|
|
@@ -21904,7 +21904,7 @@ var handleAnnotationMouseMove = (event, canvas, scales, isDragging, activeAnnota
|
|
|
21904
21904
|
const annotationId = activeAnnotation?.id;
|
|
21905
21905
|
setAnnotationBorderWidth(chart, annotationId, BORDER_WIDTH.HOVERED);
|
|
21906
21906
|
const dragAxis = activeAnnotation?.dragAxis ?? DragAxis.Both;
|
|
21907
|
-
const { xScaleID =
|
|
21907
|
+
const { xScaleID = AxisType.X, yScaleID = AxisType.Y } = activeAnnotation;
|
|
21908
21908
|
const { x, y } = getMousePositionInCoordinates(event, canvas, scales, xScaleID, yScaleID);
|
|
21909
21909
|
const metrics = calculateAnnotationMetricsInValues(activeAnnotation);
|
|
21910
21910
|
let newCenterX = x - dragStartX;
|
|
@@ -21964,7 +21964,7 @@ var annotationLabel = (ctx, annotations, scales) => {
|
|
|
21964
21964
|
Object.values(annotations).forEach((annotation) => {
|
|
21965
21965
|
if (annotation.type === AnnotationType$1.POINT && !isNil(annotation?.label) && annotation?.label?.display) {
|
|
21966
21966
|
const { content, font, color, position, padding } = annotation?.label ?? {};
|
|
21967
|
-
const { xScaleID =
|
|
21967
|
+
const { xScaleID = AxisType.X, yScaleID = AxisType.Y } = annotation;
|
|
21968
21968
|
ctx?.save?.();
|
|
21969
21969
|
ctx.font = font;
|
|
21970
21970
|
ctx.fillStyle = color;
|
|
@@ -23171,7 +23171,7 @@ var PieChart = (props) => {
|
|
|
23171
23171
|
maintainAspectRatio: options.chartStyling.maintainAspectRatio,
|
|
23172
23172
|
animation: options.chartStyling.performanceMode ? false : { duration: ANIMATION_DURATION.FAST },
|
|
23173
23173
|
hover: {
|
|
23174
|
-
mode:
|
|
23174
|
+
mode: ChartHoverMode.Nearest,
|
|
23175
23175
|
intersect: true
|
|
23176
23176
|
},
|
|
23177
23177
|
onHover,
|
|
@@ -37042,7 +37042,7 @@ var useBarChartConfig = (_chartRef, chart) => {
|
|
|
37042
37042
|
backgroundColor: annotation?.color || COLORS[index],
|
|
37043
37043
|
borderColor: annotation?.color || COLORS[index],
|
|
37044
37044
|
data: [],
|
|
37045
|
-
type:
|
|
37045
|
+
type: ChartType.BAR
|
|
37046
37046
|
})) : [];
|
|
37047
37047
|
const barDatasetsCopy = [...datasets, ...annotationsDatasets];
|
|
37048
37048
|
return barDatasetsCopy?.map((barDataset, index) => {
|
|
@@ -37077,8 +37077,7 @@ var useBarChartConfig = (_chartRef, chart) => {
|
|
|
37077
37077
|
setPointHover(true);
|
|
37078
37078
|
if (interactions?.onHover) {
|
|
37079
37079
|
const { index, datasetIndex } = hoveredItems?.[0] ?? {};
|
|
37080
|
-
|
|
37081
|
-
interactions?.onHover(evt, datasetIndex, index, generatedDataset);
|
|
37080
|
+
interactions?.onHover(evt, datasetIndex, index, generatedDatasets);
|
|
37082
37081
|
}
|
|
37083
37082
|
}
|
|
37084
37083
|
}, [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oliasoft-open-source/charts-library",
|
|
3
|
-
"version": "5.9.0-beta-
|
|
3
|
+
"version": "5.9.0-beta-8",
|
|
4
4
|
"description": "React Chart Library (based on Chart.js and react-chart-js-2)",
|
|
5
5
|
"homepage": "https://gitlab.com/oliasoft-open-source/charts-library",
|
|
6
6
|
"bugs": {
|