victory-legend 36.8.1 → 36.8.2
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/CHANGELOG.md +6 -0
- package/dist/victory-legend.js +89 -143
- package/dist/victory-legend.min.js +1 -1
- package/es/helper-methods.d.ts +6 -0
- package/es/index.d.ts +2 -59
- package/es/index.js +1 -1
- package/es/victory-legend.d.ts +114 -0
- package/es/victory-legend.js +60 -113
- package/lib/helper-methods.d.ts +6 -0
- package/lib/index.d.ts +2 -59
- package/lib/index.js +11 -8
- package/lib/victory-legend.d.ts +114 -0
- package/lib/victory-legend.js +61 -116
- package/package.json +5 -2
- package/src/{helper-methods.js → helper-methods.ts} +2 -2
- package/src/index.ts +1 -0
- package/src/victory-legend.tsx +194 -0
- package/src/index.d.ts +0 -59
- package/src/index.js +0 -1
- package/src/victory-legend.js +0 -240
package/CHANGELOG.md
CHANGED
package/dist/victory-legend.js
CHANGED
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
return /******/ (() => { // webpackBootstrap
|
|
12
12
|
/******/ var __webpack_modules__ = ({
|
|
13
13
|
|
|
14
|
-
/***/ "./helper-methods.
|
|
14
|
+
/***/ "./helper-methods.ts":
|
|
15
15
|
/*!***************************!*\
|
|
16
|
-
!*** ./helper-methods.
|
|
16
|
+
!*** ./helper-methods.ts ***!
|
|
17
17
|
\***************************/
|
|
18
18
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
19
19
|
|
|
@@ -417,30 +417,27 @@ var getBaseProps = function (props, fallbackProps) {
|
|
|
417
417
|
|
|
418
418
|
/***/ }),
|
|
419
419
|
|
|
420
|
-
/***/ "./victory-legend.
|
|
421
|
-
|
|
422
|
-
!*** ./victory-legend.
|
|
423
|
-
|
|
420
|
+
/***/ "./victory-legend.tsx":
|
|
421
|
+
/*!****************************!*\
|
|
422
|
+
!*** ./victory-legend.tsx ***!
|
|
423
|
+
\****************************/
|
|
424
424
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
425
425
|
|
|
426
426
|
"use strict";
|
|
427
427
|
__webpack_require__.r(__webpack_exports__);
|
|
428
428
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
429
|
-
/* harmony export */ "
|
|
429
|
+
/* harmony export */ "VictoryLegend": () => (/* binding */ VictoryLegend)
|
|
430
430
|
/* harmony export */ });
|
|
431
431
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
432
432
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
433
|
-
/* harmony import */ var
|
|
434
|
-
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
|
|
435
|
-
/* harmony import */ var _helper_methods__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./helper-methods */ "./helper-methods.js");
|
|
433
|
+
/* harmony import */ var _helper_methods__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./helper-methods */ "./helper-methods.ts");
|
|
436
434
|
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/helpers.js");
|
|
437
|
-
/* harmony import */ var
|
|
438
|
-
/* harmony import */ var
|
|
439
|
-
/* harmony import */ var
|
|
440
|
-
/* harmony import */ var
|
|
441
|
-
/* harmony import */ var
|
|
442
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-
|
|
443
|
-
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/add-events.js");
|
|
435
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-primitives/border.js");
|
|
436
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-container/victory-container.js");
|
|
437
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-primitives/point.js");
|
|
438
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-label/victory-label.js");
|
|
439
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-theme/victory-theme.js");
|
|
440
|
+
/* harmony import */ var victory_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! victory-core */ "../../victory-core/es/victory-util/add-events.js");
|
|
444
441
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
445
442
|
|
|
446
443
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -476,7 +473,6 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
476
473
|
|
|
477
474
|
|
|
478
475
|
|
|
479
|
-
|
|
480
476
|
var fallbackProps = {
|
|
481
477
|
orientation: "vertical",
|
|
482
478
|
titleOrientation: "top",
|
|
@@ -489,20 +485,20 @@ var defaultLegendData = [{
|
|
|
489
485
|
name: "Series 1"
|
|
490
486
|
}, {
|
|
491
487
|
name: "Series 2"
|
|
492
|
-
}];
|
|
488
|
+
}]; // eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
493
489
|
|
|
494
|
-
var
|
|
495
|
-
_inherits(
|
|
490
|
+
var VictoryLegendBase = /*#__PURE__*/function (_React$Component) {
|
|
491
|
+
_inherits(VictoryLegendBase, _React$Component);
|
|
496
492
|
|
|
497
|
-
var _super = _createSuper(
|
|
493
|
+
var _super = _createSuper(VictoryLegendBase);
|
|
498
494
|
|
|
499
|
-
function
|
|
500
|
-
_classCallCheck(this,
|
|
495
|
+
function VictoryLegendBase() {
|
|
496
|
+
_classCallCheck(this, VictoryLegendBase);
|
|
501
497
|
|
|
502
498
|
return _super.apply(this, arguments);
|
|
503
499
|
}
|
|
504
500
|
|
|
505
|
-
_createClass(
|
|
501
|
+
_createClass(VictoryLegendBase, [{
|
|
506
502
|
key: "renderChildren",
|
|
507
503
|
value: function renderChildren(props) {
|
|
508
504
|
var _this = this;
|
|
@@ -510,147 +506,95 @@ var VictoryLegend = /*#__PURE__*/function (_React$Component) {
|
|
|
510
506
|
var dataComponent = props.dataComponent,
|
|
511
507
|
labelComponent = props.labelComponent,
|
|
512
508
|
title = props.title;
|
|
513
|
-
var
|
|
514
|
-
if (_dataKey === "all") {
|
|
515
|
-
return undefined;
|
|
516
|
-
}
|
|
509
|
+
var children = [];
|
|
517
510
|
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
if (_dataKey === "all") {
|
|
524
|
-
return undefined;
|
|
525
|
-
}
|
|
511
|
+
if (props.borderComponent) {
|
|
512
|
+
var borderProps = this.getComponentProps(props.borderComponent, "border", "all");
|
|
513
|
+
var borderComponent = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(props.borderComponent, borderProps);
|
|
514
|
+
children.push(borderComponent);
|
|
515
|
+
}
|
|
526
516
|
|
|
527
|
-
|
|
517
|
+
if (dataComponent) {
|
|
518
|
+
var dataComponents = this.dataKeys.map(function (_dataKey, index) {
|
|
519
|
+
if (_dataKey === "all") {
|
|
520
|
+
return undefined;
|
|
521
|
+
}
|
|
528
522
|
|
|
529
|
-
|
|
530
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(labelComponent, labelProps);
|
|
531
|
-
}
|
|
523
|
+
var dataProps = _this.getComponentProps(dataComponent, "data", index);
|
|
532
524
|
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
525
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(dataComponent, dataProps);
|
|
526
|
+
}).filter(function (comp) {
|
|
527
|
+
return comp !== undefined;
|
|
528
|
+
});
|
|
529
|
+
children.push.apply(children, _toConsumableArray(dataComponents));
|
|
530
|
+
}
|
|
537
531
|
|
|
538
|
-
if (title) {
|
|
539
|
-
var titleProps = this.getComponentProps(
|
|
532
|
+
if (title && props.titleComponent) {
|
|
533
|
+
var titleProps = this.getComponentProps(title, "title", "all");
|
|
540
534
|
var titleComponent = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(props.titleComponent, titleProps);
|
|
541
|
-
|
|
535
|
+
children.push(titleComponent);
|
|
542
536
|
}
|
|
543
537
|
|
|
544
|
-
|
|
538
|
+
if (labelComponent) {
|
|
539
|
+
var labelComponents = this.dataKeys.map(function (_dataKey, index) {
|
|
540
|
+
if (_dataKey === "all") {
|
|
541
|
+
return undefined;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
var labelProps = _this.getComponentProps(labelComponent, "labels", index);
|
|
545
|
+
|
|
546
|
+
if (labelProps.text !== undefined && labelProps.text !== null) {
|
|
547
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(labelComponent, labelProps);
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
return undefined;
|
|
551
|
+
}).filter(function (comp) {
|
|
552
|
+
return comp !== undefined;
|
|
553
|
+
});
|
|
554
|
+
children.push.apply(children, _toConsumableArray(labelComponents));
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
return children;
|
|
545
558
|
}
|
|
546
559
|
}, {
|
|
547
560
|
key: "render",
|
|
548
561
|
value: function render() {
|
|
562
|
+
// @ts-expect-error Property 'role' does not exist on type 'Function'.
|
|
563
|
+
// Ref: https://github.com/microsoft/TypeScript/issues/32452
|
|
549
564
|
var role = this.constructor.role;
|
|
550
565
|
var props = victory_core__WEBPACK_IMPORTED_MODULE_1__.modifyProps(this.props, fallbackProps, role);
|
|
551
|
-
var children =
|
|
566
|
+
var children = this.renderChildren(props);
|
|
552
567
|
return props.standalone ? this.renderContainer(props.containerComponent, children) : /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().cloneElement(props.groupComponent, {}, children);
|
|
553
568
|
}
|
|
554
569
|
}]);
|
|
555
570
|
|
|
556
|
-
return
|
|
571
|
+
return VictoryLegendBase;
|
|
557
572
|
}((react__WEBPACK_IMPORTED_MODULE_0___default().Component));
|
|
558
573
|
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
borderComponent: (
|
|
563
|
-
borderPadding: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_2___default().number), prop_types__WEBPACK_IMPORTED_MODULE_2___default().shape({
|
|
564
|
-
top: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().number),
|
|
565
|
-
bottom: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().number),
|
|
566
|
-
left: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().number),
|
|
567
|
-
right: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().number)
|
|
568
|
-
})]),
|
|
569
|
-
centerTitle: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),
|
|
570
|
-
colorScale: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_2___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_2___default().string)), prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOf(["grayscale", "qualitative", "heatmap", "warm", "cool", "red", "green", "blue"])]),
|
|
571
|
-
containerComponent: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().element),
|
|
572
|
-
data: prop_types__WEBPACK_IMPORTED_MODULE_2___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_2___default().shape({
|
|
573
|
-
name: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string.isRequired),
|
|
574
|
-
label: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().object),
|
|
575
|
-
symbol: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().object)
|
|
576
|
-
})),
|
|
577
|
-
dataComponent: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().element),
|
|
578
|
-
eventKey: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_2___default().func), victory_core__WEBPACK_IMPORTED_MODULE_3__.allOfType([victory_core__WEBPACK_IMPORTED_MODULE_3__.integer, victory_core__WEBPACK_IMPORTED_MODULE_3__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string)]),
|
|
579
|
-
events: prop_types__WEBPACK_IMPORTED_MODULE_2___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_2___default().shape({
|
|
580
|
-
target: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOf(["data", "labels", "parent"]),
|
|
581
|
-
eventKey: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_2___default().array), victory_core__WEBPACK_IMPORTED_MODULE_3__.allOfType([victory_core__WEBPACK_IMPORTED_MODULE_3__.integer, victory_core__WEBPACK_IMPORTED_MODULE_3__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string)]),
|
|
582
|
-
eventHandlers: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().object)
|
|
583
|
-
})),
|
|
584
|
-
externalEventMutations: prop_types__WEBPACK_IMPORTED_MODULE_2___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_2___default().shape({
|
|
585
|
-
callback: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().func),
|
|
586
|
-
childName: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_2___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_2___default().array)]),
|
|
587
|
-
eventKey: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_2___default().array), victory_core__WEBPACK_IMPORTED_MODULE_3__.allOfType([victory_core__WEBPACK_IMPORTED_MODULE_3__.integer, victory_core__WEBPACK_IMPORTED_MODULE_3__.nonNegative]), (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string)]),
|
|
588
|
-
mutation: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().func),
|
|
589
|
-
target: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_2___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_2___default().array)])
|
|
590
|
-
})),
|
|
591
|
-
groupComponent: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().element),
|
|
592
|
-
gutter: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_2___default().number), prop_types__WEBPACK_IMPORTED_MODULE_2___default().shape({
|
|
593
|
-
left: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().number),
|
|
594
|
-
right: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().number)
|
|
595
|
-
})]),
|
|
596
|
-
height: victory_core__WEBPACK_IMPORTED_MODULE_3__.nonNegative,
|
|
597
|
-
itemsPerRow: victory_core__WEBPACK_IMPORTED_MODULE_3__.nonNegative,
|
|
598
|
-
labelComponent: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().element),
|
|
599
|
-
name: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
|
|
600
|
-
orientation: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOf(["horizontal", "vertical"]),
|
|
601
|
-
padding: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_2___default().number), prop_types__WEBPACK_IMPORTED_MODULE_2___default().shape({
|
|
602
|
-
top: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().number),
|
|
603
|
-
bottom: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().number),
|
|
604
|
-
left: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().number),
|
|
605
|
-
right: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().number)
|
|
606
|
-
})]),
|
|
607
|
-
rowGutter: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_2___default().number), prop_types__WEBPACK_IMPORTED_MODULE_2___default().shape({
|
|
608
|
-
top: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().number),
|
|
609
|
-
bottom: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().number)
|
|
610
|
-
})]),
|
|
611
|
-
sharedEvents: prop_types__WEBPACK_IMPORTED_MODULE_2___default().shape({
|
|
612
|
-
events: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().array),
|
|
613
|
-
getEventState: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().func)
|
|
614
|
-
}),
|
|
615
|
-
standalone: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),
|
|
616
|
-
style: prop_types__WEBPACK_IMPORTED_MODULE_2___default().shape({
|
|
617
|
-
border: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().object),
|
|
618
|
-
data: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().object),
|
|
619
|
-
labels: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().object),
|
|
620
|
-
parent: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().object),
|
|
621
|
-
title: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().object)
|
|
622
|
-
}),
|
|
623
|
-
symbolSpacer: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().number),
|
|
624
|
-
theme: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().object),
|
|
625
|
-
title: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_2___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_2___default().array)]),
|
|
626
|
-
titleComponent: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().element),
|
|
627
|
-
titleOrientation: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOf(["top", "bottom", "left", "right"]),
|
|
628
|
-
width: victory_core__WEBPACK_IMPORTED_MODULE_3__.nonNegative,
|
|
629
|
-
x: victory_core__WEBPACK_IMPORTED_MODULE_3__.nonNegative,
|
|
630
|
-
y: victory_core__WEBPACK_IMPORTED_MODULE_3__.nonNegative
|
|
631
|
-
};
|
|
632
|
-
VictoryLegend.defaultProps = {
|
|
633
|
-
borderComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_4__.Border, null),
|
|
574
|
+
VictoryLegendBase.displayName = "VictoryLegend";
|
|
575
|
+
VictoryLegendBase.role = "legend";
|
|
576
|
+
VictoryLegendBase.defaultProps = {
|
|
577
|
+
borderComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_2__.Border, null),
|
|
634
578
|
data: defaultLegendData,
|
|
635
|
-
containerComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
636
|
-
dataComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
579
|
+
containerComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_3__.VictoryContainer, null),
|
|
580
|
+
dataComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_4__.Point, null),
|
|
637
581
|
groupComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", null),
|
|
638
|
-
labelComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
582
|
+
labelComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_5__.VictoryLabel, null),
|
|
639
583
|
standalone: true,
|
|
640
|
-
theme:
|
|
641
|
-
titleComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
584
|
+
theme: victory_core__WEBPACK_IMPORTED_MODULE_6__.VictoryTheme.grayscale,
|
|
585
|
+
titleComponent: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(victory_core__WEBPACK_IMPORTED_MODULE_5__.VictoryLabel, null)
|
|
642
586
|
};
|
|
643
587
|
|
|
644
|
-
|
|
645
|
-
return (0,
|
|
588
|
+
VictoryLegendBase.getBaseProps = function (props) {
|
|
589
|
+
return (0,_helper_methods__WEBPACK_IMPORTED_MODULE_7__.getBaseProps)(props, fallbackProps);
|
|
646
590
|
};
|
|
647
591
|
|
|
648
|
-
|
|
649
|
-
return (0,
|
|
592
|
+
VictoryLegendBase.getDimensions = function (props) {
|
|
593
|
+
return (0,_helper_methods__WEBPACK_IMPORTED_MODULE_7__.getDimensions)(props, fallbackProps);
|
|
650
594
|
};
|
|
651
595
|
|
|
652
|
-
|
|
653
|
-
|
|
596
|
+
VictoryLegendBase.expectedComponents = ["borderComponent", "containerComponent", "dataComponent", "groupComponent", "labelComponent", "titleComponent"];
|
|
597
|
+
var VictoryLegend = (0,victory_core__WEBPACK_IMPORTED_MODULE_8__.addEvents)(VictoryLegendBase);
|
|
654
598
|
|
|
655
599
|
/***/ }),
|
|
656
600
|
|
|
@@ -8390,7 +8334,7 @@ var getCalculatedProps = function (props) {
|
|
|
8390
8334
|
verticalAnchor: verticalAnchor,
|
|
8391
8335
|
dx: dx,
|
|
8392
8336
|
dy: dy,
|
|
8393
|
-
originalDy: props.dy,
|
|
8337
|
+
originalDy: _victory_util_helpers__WEBPACK_IMPORTED_MODULE_4__.evaluateProp(props.dy, props),
|
|
8394
8338
|
transform: transform,
|
|
8395
8339
|
x: x,
|
|
8396
8340
|
y: y
|
|
@@ -10473,13 +10417,15 @@ function addEvents(WrappedComponent) {
|
|
|
10473
10417
|
return undefined;
|
|
10474
10418
|
}
|
|
10475
10419
|
|
|
10420
|
+
var currentProps = component && typeof component === "object" && "props" in component ? component.props : undefined;
|
|
10421
|
+
|
|
10476
10422
|
if (this.hasEvents) {
|
|
10477
10423
|
var baseEvents = this.getEvents(this.props, type, key);
|
|
10478
10424
|
|
|
10479
10425
|
var componentProps = lodash_defaults__WEBPACK_IMPORTED_MODULE_7___default()({
|
|
10480
10426
|
index: index,
|
|
10481
10427
|
key: id
|
|
10482
|
-
}, this.getEventState(key, type), this.getSharedEventState(key, type),
|
|
10428
|
+
}, this.getEventState(key, type), this.getSharedEventState(key, type), currentProps, baseProps, {
|
|
10483
10429
|
id: id
|
|
10484
10430
|
});
|
|
10485
10431
|
|
|
@@ -10493,7 +10439,7 @@ function addEvents(WrappedComponent) {
|
|
|
10493
10439
|
return lodash_defaults__WEBPACK_IMPORTED_MODULE_7___default()({
|
|
10494
10440
|
index: index,
|
|
10495
10441
|
key: id
|
|
10496
|
-
},
|
|
10442
|
+
}, currentProps, baseProps, {
|
|
10497
10443
|
id: id
|
|
10498
10444
|
});
|
|
10499
10445
|
}
|
|
@@ -20915,13 +20861,13 @@ var __webpack_exports__ = {};
|
|
|
20915
20861
|
(() => {
|
|
20916
20862
|
"use strict";
|
|
20917
20863
|
/*!******************!*\
|
|
20918
|
-
!*** ./index.
|
|
20864
|
+
!*** ./index.ts ***!
|
|
20919
20865
|
\******************/
|
|
20920
20866
|
__webpack_require__.r(__webpack_exports__);
|
|
20921
20867
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
20922
|
-
/* harmony export */ "VictoryLegend": () => (/* reexport safe */ _victory_legend__WEBPACK_IMPORTED_MODULE_0__
|
|
20868
|
+
/* harmony export */ "VictoryLegend": () => (/* reexport safe */ _victory_legend__WEBPACK_IMPORTED_MODULE_0__.VictoryLegend)
|
|
20923
20869
|
/* harmony export */ });
|
|
20924
|
-
/* harmony import */ var _victory_legend__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./victory-legend */ "./victory-legend.
|
|
20870
|
+
/* harmony import */ var _victory_legend__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./victory-legend */ "./victory-legend.tsx");
|
|
20925
20871
|
|
|
20926
20872
|
})();
|
|
20927
20873
|
|