@oliasoft-open-source/charts-library 4.3.0-beta-3 → 4.3.0-beta-4
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.js
CHANGED
|
@@ -22218,6 +22218,9 @@ const reducer$1 = (state, action) => {
|
|
|
22218
22218
|
if (draft.enableDragPoints) {
|
|
22219
22219
|
draft.enableDragPoints = false;
|
|
22220
22220
|
}
|
|
22221
|
+
if (draft.enableDragAnnotation) {
|
|
22222
|
+
draft.enableDragAnnotation = false;
|
|
22223
|
+
}
|
|
22221
22224
|
break;
|
|
22222
22225
|
}
|
|
22223
22226
|
case TOGGLE_PAN: {
|
|
@@ -22228,6 +22231,9 @@ const reducer$1 = (state, action) => {
|
|
|
22228
22231
|
if (draft.enableDragPoints) {
|
|
22229
22232
|
draft.enableDragPoints = false;
|
|
22230
22233
|
}
|
|
22234
|
+
if (draft.enableDragAnnotation) {
|
|
22235
|
+
draft.enableDragAnnotation = false;
|
|
22236
|
+
}
|
|
22231
22237
|
break;
|
|
22232
22238
|
}
|
|
22233
22239
|
case TOGGLE_POINTS: {
|
|
@@ -22272,6 +22278,9 @@ const reducer$1 = (state, action) => {
|
|
|
22272
22278
|
if (draft.zoomEnabled) {
|
|
22273
22279
|
draft.zoomEnabled = false;
|
|
22274
22280
|
}
|
|
22281
|
+
if (draft.enableDragAnnotation) {
|
|
22282
|
+
draft.enableDragAnnotation = false;
|
|
22283
|
+
}
|
|
22275
22284
|
break;
|
|
22276
22285
|
}
|
|
22277
22286
|
case TOGGLE_DRAG_ANNOTATION: {
|
|
@@ -22285,7 +22294,8 @@ const reducer$1 = (state, action) => {
|
|
|
22285
22294
|
break;
|
|
22286
22295
|
}
|
|
22287
22296
|
case DISABLE_DRAG_OPTIONS: {
|
|
22288
|
-
if (draft.enableDragPoints || draft.panEnabled || draft.zoomEnabled) {
|
|
22297
|
+
if (draft.enableDragAnnotation || draft.enableDragPoints || draft.panEnabled || draft.zoomEnabled) {
|
|
22298
|
+
draft.enableDragAnnotation = false;
|
|
22289
22299
|
draft.enableDragPoints = false;
|
|
22290
22300
|
draft.panEnabled = false;
|
|
22291
22301
|
draft.zoomEnabled = false;
|
|
@@ -22469,6 +22479,7 @@ const DEFAULT_COLOR = "hsl(60, 10.34482759%, 12.5%)";
|
|
|
22469
22479
|
const LEGEND_LABEL_BOX_SIZE = 12;
|
|
22470
22480
|
const TOOLTIP_PADDING = 8;
|
|
22471
22481
|
const TOOLTIP_BOX_PADDING = 4;
|
|
22482
|
+
const TRANSPARENT = "transparent";
|
|
22472
22483
|
const LOGARITHMIC_STEPS = [1, 10, 100, 1e3, 1e4];
|
|
22473
22484
|
const COLORS = [
|
|
22474
22485
|
"#3366cc",
|
|
@@ -25397,9 +25408,14 @@ const generateAnnotations = (annotationsData) => {
|
|
|
25397
25408
|
[AnnotationType.LINE]: color2,
|
|
25398
25409
|
[AnnotationType.POINT]: color2,
|
|
25399
25410
|
[AnnotationType.BOX]: color2
|
|
25400
|
-
}[type] ||
|
|
25411
|
+
}[type] || TRANSPARENT;
|
|
25401
25412
|
const borderWidth = type === AnnotationType.LINE ? BORDER_WIDTH.INITIAL : 0;
|
|
25402
25413
|
const borderDash = type === AnnotationType.LINE ? ANNOTATION_DASH : void 0;
|
|
25414
|
+
const defLabel = {
|
|
25415
|
+
content: ann == null ? void 0 : ann.label,
|
|
25416
|
+
display: true,
|
|
25417
|
+
font: { weight: "normal" }
|
|
25418
|
+
};
|
|
25403
25419
|
const label = {
|
|
25404
25420
|
[AnnotationType.LINE]: {
|
|
25405
25421
|
backgroundColor: color2,
|
|
@@ -25408,23 +25424,20 @@ const generateAnnotations = (annotationsData) => {
|
|
|
25408
25424
|
position: Position.Top
|
|
25409
25425
|
},
|
|
25410
25426
|
[AnnotationType.POINT]: {
|
|
25411
|
-
backgroundColor: ((_a2 = ann == null ? void 0 : ann.labelConfig) == null ? void 0 : _a2.backgroundColor) ??
|
|
25427
|
+
backgroundColor: ((_a2 = ann == null ? void 0 : ann.labelConfig) == null ? void 0 : _a2.backgroundColor) ?? TRANSPARENT,
|
|
25412
25428
|
content: ann == null ? void 0 : ann.label,
|
|
25413
25429
|
display: !!(ann == null ? void 0 : ann.label),
|
|
25414
25430
|
position: ((_b2 = ann == null ? void 0 : ann.labelConfig) == null ? void 0 : _b2.position) ?? Position.Bottom,
|
|
25415
|
-
color: ((_c2 = ann == null ? void 0 : ann.labelConfig) == null ? void 0 : _c2.color) ??
|
|
25416
|
-
font: ((_d2 = ann == null ? void 0 : ann.labelConfig) == null ? void 0 : _d2.font) ?? `
|
|
25431
|
+
color: ((_c2 = ann == null ? void 0 : ann.labelConfig) == null ? void 0 : _c2.color) ?? DEFAULT_COLOR,
|
|
25432
|
+
font: ((_d2 = ann == null ? void 0 : ann.labelConfig) == null ? void 0 : _d2.font) ?? `12px ${DEFAULT_FONT_FAMILY}`,
|
|
25417
25433
|
borderWidth: BORDER_WIDTH.INITIAL,
|
|
25418
25434
|
padding: 5,
|
|
25419
25435
|
borderRadius: 3,
|
|
25420
|
-
borderColor: ((_e2 = ann == null ? void 0 : ann.labelConfig) == null ? void 0 : _e2.borderColor) ??
|
|
25436
|
+
borderColor: ((_e2 = ann == null ? void 0 : ann.labelConfig) == null ? void 0 : _e2.borderColor) ?? TRANSPARENT
|
|
25421
25437
|
},
|
|
25422
|
-
[AnnotationType.BOX]:
|
|
25423
|
-
|
|
25424
|
-
|
|
25425
|
-
font: { weight: "normal" }
|
|
25426
|
-
}
|
|
25427
|
-
}[type] || "transparent";
|
|
25438
|
+
[AnnotationType.BOX]: defLabel,
|
|
25439
|
+
[AnnotationType.ELLIPSE]: defLabel
|
|
25440
|
+
}[type] || defLabel;
|
|
25428
25441
|
const enter = ({
|
|
25429
25442
|
element
|
|
25430
25443
|
}, {
|
|
@@ -26183,7 +26196,6 @@ const annotationLabel = (ctx, annotations, scales) => {
|
|
|
26183
26196
|
var _a2;
|
|
26184
26197
|
if (annotation2.type === AnnotationType.POINT && !isNil(annotation2 == null ? void 0 : annotation2.label) && ((_a2 = annotation2 == null ? void 0 : annotation2.label) == null ? void 0 : _a2.display)) {
|
|
26185
26198
|
const { content, font, color: color2, position, padding } = (annotation2 == null ? void 0 : annotation2.label) ?? {};
|
|
26186
|
-
console.log(cloneDeep(annotation2));
|
|
26187
26199
|
ctx.save();
|
|
26188
26200
|
ctx.font = font;
|
|
26189
26201
|
ctx.fillStyle = color2;
|