dotdata_widgets 0.1.2 → 0.1.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/README.md +27 -3
- package/css/colors.css +4 -0
- package/css/typography.css +9 -0
- package/css/widget.css +39 -4
- package/dist/index.js +74 -1
- package/lib/components/accordion/Accordion.js +47 -13
- package/lib/components/accordion/index.js +18 -1
- package/lib/components/input/index.js +18 -1
- package/lib/components/input/input.js +11 -3
- package/lib/extension.js +18 -1
- package/lib/feature/feature-details/FeatureCorrelatedFeaturesTable.js +22 -0
- package/lib/feature/feature-details/FeatureDistributionChart.js +218 -0
- package/lib/feature/feature-details/FeatureStatisticsTable.js +44 -0
- package/lib/feature/feature-details/index.js +20 -0
- package/lib/feature/feature-explanation/FeatureExplanation.js +48 -0
- package/lib/feature/feature-explanation/components/ColoredExplanationBlock.js +36 -0
- package/lib/feature/feature-explanation/components/ColumnExplanationBlock.js +12 -0
- package/lib/feature/feature-explanation/components/DataSlotExplanationBlock.js +12 -0
- package/lib/feature/feature-explanation/components/PetExplanationBlock.js +11 -0
- package/lib/feature/feature-explanation/components/TextExplanationBlock.js +10 -0
- package/lib/feature/feature-explanation/components/TextWithDataSlotContextExplanationBlock.js +10 -0
- package/lib/feature/feature-explanation/components/TopicExplanationBlock.js +10 -0
- package/lib/feature/feature-explanation/components/UnknownExplanationBlock.js +10 -0
- package/lib/feature/feature-likes/feature-likes.js +38 -0
- package/lib/feature/feature-likes/index.js +18 -0
- package/lib/feature-descriptor/context/fd-domains-descriptions-selection.context.js +37 -0
- package/lib/feature-descriptor/context/index.js +18 -0
- package/lib/feature-descriptor/domains-descriptors-tree/components/column-tree-item.js +16 -0
- package/lib/feature-descriptor/domains-descriptors-tree/components/descriptions-tree-item.js +50 -0
- package/lib/feature-descriptor/domains-descriptors-tree/components/index.js +18 -0
- package/lib/feature-descriptor/domains-descriptors-tree/components/tree-item-label.js +56 -0
- package/lib/feature-descriptor/domains-descriptors-tree/components/type-tree-item.js +19 -0
- package/lib/feature-descriptor/domains-descriptors-tree/context/domains-descriptions-tree-item-selection-context.js +56 -0
- package/lib/feature-descriptor/domains-descriptors-tree/context/index.js +18 -0
- package/lib/feature-descriptor/domains-descriptors-tree/domains-descriptions-tree.js +44 -0
- package/lib/feature-descriptor/domains-descriptors-tree/index.js +21 -0
- package/lib/feature-descriptor/domains-descriptors-tree/models/domains-descriptions-tree.model.js +37 -0
- package/lib/feature-descriptor/domains-descriptors-tree/models/index.js +18 -0
- package/lib/feature-descriptor/domains-descriptors-tree/utils/create-domain-predicate.js +16 -0
- package/lib/feature-descriptor/domains-descriptors-tree/utils/filter-domains-descriptions-tree.js +23 -0
- package/lib/feature-descriptor/domains-descriptors-tree/utils/index.js +19 -0
- package/lib/feature-descriptor/feature-details/FeatureCorrelatedFeaturesTable.js +21 -13
- package/lib/feature-descriptor/feature-details/FeatureDistributionChart.js +36 -8
- package/lib/feature-descriptor/feature-details/FeatureStatisticsTable.js +25 -17
- package/lib/feature-descriptor/feature-details/index.js +20 -3
- package/lib/feature-descriptor/feature-explanation/FeatureExplanation.js +40 -32
- package/lib/feature-descriptor/feature-explanation/components/ColoredExplanationBlock.js +17 -9
- package/lib/feature-descriptor/feature-explanation/components/ColumnExplanationBlock.js +12 -4
- package/lib/feature-descriptor/feature-explanation/components/DataSlotExplanationBlock.js +12 -4
- package/lib/feature-descriptor/feature-explanation/components/PetExplanationBlock.js +11 -3
- package/lib/feature-descriptor/feature-explanation/components/TextExplanationBlock.js +10 -2
- package/lib/feature-descriptor/feature-explanation/components/TextWithDataSlotContextExplanationBlock.js +10 -2
- package/lib/feature-descriptor/feature-explanation/components/TopicExplanationBlock.js +10 -2
- package/lib/feature-descriptor/feature-explanation/components/UnknownExplanationBlock.js +10 -2
- package/lib/feature-descriptor/feature-exploration-path/exploration-path-header.js +38 -0
- package/lib/feature-descriptor/feature-exploration-path/exploration-path-join-list.js +28 -0
- package/lib/feature-descriptor/feature-exploration-path/index.js +19 -0
- package/lib/feature-descriptors-domain/context/feature-domain-descriptions-selection.context.js +37 -0
- package/lib/feature-descriptors-domain/context/feature-domain-selection.context.js +37 -0
- package/lib/feature-descriptors-domain/context/index.js +19 -0
- package/lib/feature-descriptors-domain/exploration-path/exploration-path-header.js +15 -7
- package/lib/feature-descriptors-domain/exploration-path/exploration-path-join-list.js +11 -3
- package/lib/feature-descriptors-domain/exploration-path/index.js +19 -2
- package/lib/feature-descriptors-domain/fd-grouped-domain-tree.js +81 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions/components/column-tree-item.js +17 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions/components/descriptions-tree-item.js +49 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions/components/index.js +18 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions/components/selection-indicator-with-label.js +40 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions/components/type-tree-item.js +16 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions/feature-descriptor-domain-descriptions-context.js +43 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions/feature-descriptor-domain-descriptions-tree.js +57 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions/index.js +18 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions-tree/components/column-tree-item.js +17 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions-tree/components/description-tree-item.js +2 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions-tree/components/descriptions-tree-item.js +49 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions-tree/components/index.js +18 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions-tree/components/selection-indicator-with-label.js +19 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions-tree/components/tree-item-label.js +15 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions-tree/components/tree-level-item.js +54 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions-tree/components/type-tree-item.js +16 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions-tree/feature-descriptor-domain-descriptions-tree.js +55 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions-tree/feature-descriptor-domain-descriptions-tree.model.js +2 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions-tree/index.js +18 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions-tree/utils/filter-domain-descriptions.js +21 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions-tree/utils/index.js +18 -0
- package/lib/feature-descriptors-domain/feature-descriptor-grouped-domain-tree.js +87 -0
- package/lib/feature-descriptors-domain/feature-domain-descriptions/components/column-tree-item.js +16 -0
- package/lib/feature-descriptors-domain/feature-domain-descriptions/components/descriptions-tree-item.js +50 -0
- package/lib/feature-descriptors-domain/feature-domain-descriptions/components/index.js +18 -0
- package/lib/feature-descriptors-domain/feature-domain-descriptions/components/selection-indicator-with-label.js +67 -0
- package/lib/feature-descriptors-domain/feature-domain-descriptions/components/type-tree-item.js +19 -0
- package/lib/feature-descriptors-domain/feature-domain-descriptions/feature-domain-descriptions-context.js +37 -0
- package/lib/feature-descriptors-domain/feature-domain-descriptions/feature-domain-descriptions-tree.js +51 -0
- package/lib/feature-descriptors-domain/feature-domain-descriptions/index.js +18 -0
- package/lib/feature-descriptors-domain/feature-exploration-path/exploration-path-header.js +38 -0
- package/lib/feature-descriptors-domain/feature-exploration-path/exploration-path-join-list.js +36 -0
- package/lib/feature-descriptors-domain/feature-exploration-path/index.js +19 -0
- package/lib/feature-descriptors-domain/grouped-domains-descriptions-list.js +28 -17
- package/lib/feature-descriptors-domain/selected-feature-domain-context.js +2 -0
- package/lib/feature-descriptors-domain/utils/filter-domain-descriptions.js +23 -0
- package/lib/feature-descriptors-domain/utils/filter-grouped-domain-descriptions.js +23 -0
- package/lib/feature-descriptors-domain/utils/index.js +18 -0
- package/lib/index.js +19 -2
- package/lib/models/column/column.js +3 -1
- package/lib/models/column/index.js +18 -1
- package/lib/models/feature/feature-histogram.js +8 -4
- package/lib/models/feature/feature-leaderboard.js +3 -1
- package/lib/models/feature/feature-metric.js +16 -0
- package/lib/models/feature/feature.js +3 -12
- package/lib/models/feature/index.js +20 -2
- package/lib/models/feature-descriptor/feature-descriptor.js +3 -0
- package/lib/models/feature-descriptor/feature-descriptors-domain.js +3 -0
- package/lib/models/feature-descriptor-domain/fd-domains-description.js +3 -0
- package/lib/models/feature-descriptor-domain/fd-join-description.js +3 -0
- package/lib/models/feature-descriptor-domain/index.js +19 -0
- package/lib/models/feature-descriptors-domain/fd-domain-description.js +9 -1
- package/lib/models/feature-descriptors-domain/fd-grouped-domain-descriptions.js +3 -1
- package/lib/models/feature-descriptors-domain/index.js +19 -2
- package/lib/models/feature-explanation/feature-explanation.model.js +6 -2
- package/lib/models/feature-explanation/index.js +18 -1
- package/lib/models/feature-leaderboard/feature-leaderboard.js +3 -1
- package/lib/models/feature-leaderboard/index.js +18 -1
- package/lib/models/feature-space/exploration-path.js +3 -0
- package/lib/models/feature-space/feature-space-description.js +3 -0
- package/lib/models/feature-space/feature-space.js +3 -1
- package/lib/models/feature-space/grouped-domains-descriptions.js +3 -0
- package/lib/models/feature-space/index.js +20 -1
- package/lib/models/index.js +1 -0
- package/lib/plugin.js +33 -7
- package/lib/utils/asserations.js +6 -1
- package/lib/utils/index.js +20 -3
- package/lib/utils/localize.js +8 -4
- package/lib/utils/model-transform-hook.js +21 -0
- package/lib/utils/object/extract-property.js +6 -1
- package/lib/utils/object/index.js +19 -2
- package/lib/utils/object/is-set.js +8 -2
- package/lib/utils/set.js +14 -0
- package/lib/utils/widget/index.js +19 -2
- package/lib/utils/widget/widget-model-context.js +36 -7
- package/lib/utils/widget/widget-model.js +14 -8
- package/lib/utils/widget-model/index.js +19 -0
- package/lib/utils/widget-model/widget-model-context.js +42 -0
- package/lib/utils/widget-model/widget-model.js +30 -0
- package/lib/utils/widget-theme/index.js +18 -0
- package/lib/utils/widget-theme/widget-theme.js +99 -0
- package/lib/version.js +6 -2
- package/lib/widgets/FeatureLeaderboardWidget.js +27 -15
- package/lib/widgets/FeatureSpaceWidget.js +27 -15
- package/lib/widgets/feature-leaderboard/FeatureLeaderboardEntries.js +17 -9
- package/lib/widgets/feature-leaderboard/FeatureLeaderboardOverview.js +15 -18
- package/lib/widgets/feature-leaderboard/FeatureLeaderboardView.js +26 -14
- package/lib/widgets/feature-leaderboard/components/leaderboard-feature-likes.js +50 -0
- package/lib/widgets/feature-leaderboard/entry-item/FeatureLeaderboardEntryDetails.js +22 -14
- package/lib/widgets/feature-leaderboard/entry-item/FeatureLeaderboardEntryHeader.js +35 -0
- package/lib/widgets/feature-leaderboard/entry-item/FeatureLeaderboardEntryItem.js +17 -15
- package/lib/widgets/feature-leaderboard/leaderboard-entry/FeatureLeaderboardEntry.js +22 -0
- package/lib/widgets/feature-leaderboard/leaderboard-entry/FeatureLeaderboardEntryDetails.js +23 -0
- package/lib/widgets/feature-leaderboard/leaderboard-entry/FeatureLeaderboardEntryRow.js +29 -0
- package/lib/widgets/feature-leaderboard/leaderboard-overview/overview-metric-slider.js +2 -0
- package/lib/widgets/feature-leaderboard/leaderboard-overview/overview-slider.js +62 -0
- package/lib/widgets/feature-space/FeatureDomainsDescriptions.js +82 -0
- package/lib/widgets/feature-space/FeatureExplorationPaths.js +14 -35
- package/lib/widgets/feature-space/FeatureSpaceDomain.js +75 -0
- package/lib/widgets/feature-space/FeatureSpaceDomainDescriptions.js +80 -0
- package/lib/widgets/feature-space/FeatureSpaceDomainsDescriptions.js +63 -28
- package/lib/widgets/feature-space/FeatureSpaceView.js +47 -10
- package/lib/widgets/index.js +20 -3
- package/package.json +8 -3
- package/LICENSE.txt +0 -27
- package/lib/hooks/index.js +0 -1
- package/lib/hooks/widget-model.js +0 -1
- package/lib/utils/widget/widget-context-wrapper.js +0 -9
- package/lib/widget.js +0 -34
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FeatureLikes = exports.FeatureLike = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const ThumbUpOffAlt_1 = __importDefault(require("@mui/icons-material/ThumbUpOffAlt"));
|
|
9
|
+
const ThumbDownOffAlt_1 = __importDefault(require("@mui/icons-material/ThumbDownOffAlt"));
|
|
10
|
+
var FeatureLike;
|
|
11
|
+
(function (FeatureLike) {
|
|
12
|
+
FeatureLike[FeatureLike["Neutral"] = 0] = "Neutral";
|
|
13
|
+
FeatureLike[FeatureLike["Liked"] = 1] = "Liked";
|
|
14
|
+
FeatureLike[FeatureLike["Disliked"] = 2] = "Disliked";
|
|
15
|
+
})(FeatureLike = exports.FeatureLike || (exports.FeatureLike = {}));
|
|
16
|
+
const FeatureLikes = ({ liked, toggleIsLiked, toggleIsDisliked }) => {
|
|
17
|
+
return (react_1.default.createElement("span", { style: {
|
|
18
|
+
display: 'flex',
|
|
19
|
+
alignItems: 'center',
|
|
20
|
+
justifyContent: 'center',
|
|
21
|
+
} },
|
|
22
|
+
react_1.default.createElement(ThumbUpOffAlt_1.default, { onClick: toggleIsLiked, sx: {
|
|
23
|
+
cursor: 'pointer',
|
|
24
|
+
fontSize: '18px',
|
|
25
|
+
color: liked === FeatureLike.Liked
|
|
26
|
+
? 'var( --c-green-600)'
|
|
27
|
+
: 'var( --c-grey-600)',
|
|
28
|
+
} }),
|
|
29
|
+
react_1.default.createElement(ThumbDownOffAlt_1.default, { onClick: toggleIsDisliked, sx: {
|
|
30
|
+
cursor: 'pointer',
|
|
31
|
+
fontSize: '18px',
|
|
32
|
+
color: liked === FeatureLike.Disliked
|
|
33
|
+
? 'var(--c-red-600)'
|
|
34
|
+
: 'var( --c-grey-600)',
|
|
35
|
+
} })));
|
|
36
|
+
};
|
|
37
|
+
exports.FeatureLikes = FeatureLikes;
|
|
38
|
+
//# sourceMappingURL=feature-likes.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./feature-likes"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.useFdDomainsDescriptionsSelection = exports.FdDomainsDescriptionsSelectionContext = void 0;
|
|
27
|
+
const React = __importStar(require("react"));
|
|
28
|
+
exports.FdDomainsDescriptionsSelectionContext = React.createContext(undefined);
|
|
29
|
+
function useFdDomainsDescriptionsSelection() {
|
|
30
|
+
const context = React.useContext(exports.FdDomainsDescriptionsSelectionContext);
|
|
31
|
+
if (context === undefined) {
|
|
32
|
+
throw new Error('useFdDomainsDescriptionsSelection must be used within a FdDomainsDescriptionsSelectionContext');
|
|
33
|
+
}
|
|
34
|
+
return context;
|
|
35
|
+
}
|
|
36
|
+
exports.useFdDomainsDescriptionsSelection = useFdDomainsDescriptionsSelection;
|
|
37
|
+
//# sourceMappingURL=fd-domains-descriptions-selection.context.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./fd-domains-descriptions-selection.context"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ColumnTreeItem = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const TreeItem_1 = __importDefault(require("@mui/lab/TreeItem"));
|
|
9
|
+
const descriptions_tree_item_1 = require("./descriptions-tree-item");
|
|
10
|
+
const tree_item_label_1 = require("./tree-item-label");
|
|
11
|
+
const ColumnTreeItem = ({ column }) => {
|
|
12
|
+
return column.descriptions.length === 1 ? (react_1.default.createElement(descriptions_tree_item_1.DescriptionsTreeItem, { descriptions: column.descriptions })) : (react_1.default.createElement(TreeItem_1.default, { nodeId: column.nodeId, label: react_1.default.createElement(tree_item_label_1.TreeItemLabel, { label: column.summary, nodeId: column.nodeId, managedDescriptions: column.descriptions }) },
|
|
13
|
+
react_1.default.createElement(descriptions_tree_item_1.DescriptionsTreeItem, { descriptions: column.descriptions })));
|
|
14
|
+
};
|
|
15
|
+
exports.ColumnTreeItem = ColumnTreeItem;
|
|
16
|
+
//# sourceMappingURL=column-tree-item.js.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DescriptionsTreeItem = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const react_virtual_1 = require("@tanstack/react-virtual");
|
|
9
|
+
const material_1 = require("@mui/material");
|
|
10
|
+
const tree_item_label_1 = require("./tree-item-label");
|
|
11
|
+
const listLeftIndentation = '31px';
|
|
12
|
+
const DescriptionsVirtualList = ({ descriptions, }) => {
|
|
13
|
+
const parentRef = react_1.default.useRef(null);
|
|
14
|
+
const rowVirtualizer = (0, react_virtual_1.useVirtualizer)({
|
|
15
|
+
count: descriptions.length,
|
|
16
|
+
getScrollElement: () => parentRef.current,
|
|
17
|
+
estimateSize: () => 25,
|
|
18
|
+
overscan: 5,
|
|
19
|
+
});
|
|
20
|
+
return (react_1.default.createElement("div", { ref: parentRef, style: {
|
|
21
|
+
height: `${Math.min(25 * descriptions.length, 500)}px`,
|
|
22
|
+
overflowY: 'auto',
|
|
23
|
+
overflowX: 'hidden',
|
|
24
|
+
} },
|
|
25
|
+
react_1.default.createElement("div", { style: {
|
|
26
|
+
height: `${rowVirtualizer.getTotalSize()}px`,
|
|
27
|
+
position: 'relative',
|
|
28
|
+
} }, rowVirtualizer.getVirtualItems().map(virtualRow => (react_1.default.createElement("div", { key: virtualRow.index, style: {
|
|
29
|
+
position: 'absolute',
|
|
30
|
+
top: 0,
|
|
31
|
+
right: 0,
|
|
32
|
+
left: listLeftIndentation,
|
|
33
|
+
height: `${virtualRow.size}px`,
|
|
34
|
+
transform: `translateY(${virtualRow.start}px)`,
|
|
35
|
+
} },
|
|
36
|
+
react_1.default.createElement(tree_item_label_1.TreeItemLabel, { label: descriptions[virtualRow.index].description, nodeId: descriptions[virtualRow.index].nodeId, managedDescriptions: [descriptions[virtualRow.index]] })))))));
|
|
37
|
+
};
|
|
38
|
+
const DescriptionsList = ({ descriptions }) => {
|
|
39
|
+
return (react_1.default.createElement(react_1.default.Fragment, null, descriptions.map(description => (react_1.default.createElement(tree_item_label_1.TreeItemLabel, { key: description.id, label: description.description, nodeId: description.nodeId, managedDescriptions: [description] })))));
|
|
40
|
+
};
|
|
41
|
+
const DescriptionsTreeItem = ({ descriptions, }) => {
|
|
42
|
+
const [isVirtualListVisible, setIsVirtualListVisible] = react_1.default.useState(() => false);
|
|
43
|
+
const [limitedDescriptions] = react_1.default.useState(() => descriptions.length < 6 ? descriptions : descriptions.slice(0, 3));
|
|
44
|
+
const isWithShowMore = descriptions.length >= 6;
|
|
45
|
+
return isVirtualListVisible ? (react_1.default.createElement(DescriptionsVirtualList, { descriptions: descriptions })) : (react_1.default.createElement("div", { style: { marginLeft: listLeftIndentation } },
|
|
46
|
+
react_1.default.createElement(DescriptionsList, { descriptions: limitedDescriptions }),
|
|
47
|
+
isWithShowMore ? (react_1.default.createElement(material_1.Button, { sx: { textTransform: 'lowercase', display: 'block' }, size: "small", onClick: () => setIsVirtualListVisible(true) }, "more")) : null));
|
|
48
|
+
};
|
|
49
|
+
exports.DescriptionsTreeItem = DescriptionsTreeItem;
|
|
50
|
+
//# sourceMappingURL=descriptions-tree-item.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./type-tree-item"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TreeItemLabel = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const material_1 = require("@mui/material");
|
|
9
|
+
const lodash_1 = require("lodash");
|
|
10
|
+
const _utils_1 = require("../../../utils");
|
|
11
|
+
const context_1 = require("../../context");
|
|
12
|
+
const context_2 = require("../context");
|
|
13
|
+
var SelectionIndicator;
|
|
14
|
+
(function (SelectionIndicator) {
|
|
15
|
+
SelectionIndicator["Checked"] = "checked";
|
|
16
|
+
SelectionIndicator["Unchecked"] = "unchecked";
|
|
17
|
+
SelectionIndicator["Indeterminate"] = "indeterminate";
|
|
18
|
+
})(SelectionIndicator || (SelectionIndicator = {}));
|
|
19
|
+
const TreeItemLabel = props => {
|
|
20
|
+
const [checked, setChecked] = react_1.default.useState(() => SelectionIndicator.Checked);
|
|
21
|
+
const [selectedDomainDescriptionsIds, setSelectedDomainDescriptionsIds] = (0, context_1.useFdDomainsDescriptionsSelection)();
|
|
22
|
+
const [selectedTreeItems, { toggleTreeItemSelection }] = (0, context_2.useDomainsDescriptionsTreeItemSelection)();
|
|
23
|
+
const handleChange = (isChecked) => {
|
|
24
|
+
const ids = isChecked
|
|
25
|
+
? (0, lodash_1.union)([
|
|
26
|
+
...selectedDomainDescriptionsIds,
|
|
27
|
+
...props.managedDescriptions.map((0, _utils_1.extractProperty)('id')),
|
|
28
|
+
])
|
|
29
|
+
: (0, lodash_1.without)(selectedDomainDescriptionsIds, ...props.managedDescriptions.map((0, _utils_1.extractProperty)('id')));
|
|
30
|
+
setSelectedDomainDescriptionsIds(ids);
|
|
31
|
+
};
|
|
32
|
+
react_1.default.useEffect(() => {
|
|
33
|
+
const managedNotSelectedIds = (0, lodash_1.without)(props.managedDescriptions.map((0, _utils_1.extractProperty)('id')), ...selectedDomainDescriptionsIds).length;
|
|
34
|
+
const areAllChecked = managedNotSelectedIds === 0;
|
|
35
|
+
const areAllUnselected = managedNotSelectedIds === props.managedDescriptions.length;
|
|
36
|
+
setChecked(areAllChecked
|
|
37
|
+
? SelectionIndicator.Checked
|
|
38
|
+
: areAllUnselected
|
|
39
|
+
? SelectionIndicator.Unchecked
|
|
40
|
+
: SelectionIndicator.Indeterminate);
|
|
41
|
+
}, [selectedDomainDescriptionsIds]);
|
|
42
|
+
function isSelected() {
|
|
43
|
+
return (0, _utils_1.isSet)(selectedTreeItems[props.nodeId]);
|
|
44
|
+
}
|
|
45
|
+
return (react_1.default.createElement(material_1.FormControlLabel, { className: `text-ellipsis selection-indicator ${isSelected() ? 'selected' : ''}`, sx: { display: 'block' }, control: react_1.default.createElement(material_1.Checkbox, { sx: { paddingBlock: '2px' }, checked: checked === SelectionIndicator.Checked, indeterminate: checked === SelectionIndicator.Indeterminate, onClick: event => {
|
|
46
|
+
event.stopPropagation();
|
|
47
|
+
handleChange(event.target
|
|
48
|
+
.checked);
|
|
49
|
+
} }), label: props.label, onClick: event => {
|
|
50
|
+
toggleTreeItemSelection(props.nodeId, props.managedDescriptions.flatMap((0, _utils_1.extractProperty)('domains')));
|
|
51
|
+
event.stopPropagation();
|
|
52
|
+
event.preventDefault();
|
|
53
|
+
} }));
|
|
54
|
+
};
|
|
55
|
+
exports.TreeItemLabel = TreeItemLabel;
|
|
56
|
+
//# sourceMappingURL=tree-item-label.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TypeTreeItem = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const TreeItem_1 = __importDefault(require("@mui/lab/TreeItem"));
|
|
9
|
+
const _utils_1 = require("../../../utils");
|
|
10
|
+
const column_tree_item_1 = require("./column-tree-item");
|
|
11
|
+
const tree_item_label_1 = require("./tree-item-label");
|
|
12
|
+
const TypeTreeItem = ({ type }) => {
|
|
13
|
+
return type.columns.length === 1 ? (react_1.default.createElement(column_tree_item_1.ColumnTreeItem, { column: type.columns[0] })) : (react_1.default.createElement(TreeItem_1.default, { nodeId: type.nodeId, classes: {
|
|
14
|
+
focused: 'tree-item-focused',
|
|
15
|
+
selected: 'tree-item-focused',
|
|
16
|
+
}, label: react_1.default.createElement(tree_item_label_1.TreeItemLabel, { label: type.summary, nodeId: type.nodeId, managedDescriptions: type.columns.flatMap((0, _utils_1.extractProperty)('descriptions')) }) }, type.columns.map((column, idx) => (react_1.default.createElement(column_tree_item_1.ColumnTreeItem, { key: column.nodeId, column: column })))));
|
|
17
|
+
};
|
|
18
|
+
exports.TypeTreeItem = TypeTreeItem;
|
|
19
|
+
//# sourceMappingURL=type-tree-item.js.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.DomainsDescriptionsTreeItemSelectionContextProvider = exports.useDomainsDescriptionsTreeItemSelection = exports.DomainsDescriptionsTreeItemSelectionContext = void 0;
|
|
27
|
+
const lodash_1 = require("lodash");
|
|
28
|
+
const React = __importStar(require("react"));
|
|
29
|
+
const _utils_1 = require("../../../utils");
|
|
30
|
+
exports.DomainsDescriptionsTreeItemSelectionContext = React.createContext(undefined);
|
|
31
|
+
function useDomainsDescriptionsTreeItemSelection() {
|
|
32
|
+
const context = React.useContext(exports.DomainsDescriptionsTreeItemSelectionContext);
|
|
33
|
+
if (context === undefined) {
|
|
34
|
+
throw new Error('useDomainsDescriptionsTreeItemSelection must be used within a DomainsDescriptionsTreeItemSelectionContext');
|
|
35
|
+
}
|
|
36
|
+
return context;
|
|
37
|
+
}
|
|
38
|
+
exports.useDomainsDescriptionsTreeItemSelection = useDomainsDescriptionsTreeItemSelection;
|
|
39
|
+
function DomainsDescriptionsTreeItemSelectionContextProvider(props) {
|
|
40
|
+
const [selectedTreeItems, setSelectedTreeItems] = React.useState(() => ({}));
|
|
41
|
+
function toggleTreeItemSelection(nodeId, domains) {
|
|
42
|
+
if ((0, _utils_1.isSet)(selectedTreeItems[nodeId])) {
|
|
43
|
+
const { [nodeId]: _remove, ...rest } = selectedTreeItems;
|
|
44
|
+
setSelectedTreeItems(rest);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
setSelectedTreeItems({
|
|
48
|
+
...selectedTreeItems,
|
|
49
|
+
[nodeId]: (0, lodash_1.uniqBy)(domains, JSON.stringify),
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return (React.createElement(exports.DomainsDescriptionsTreeItemSelectionContext.Provider, { value: [selectedTreeItems, { toggleTreeItemSelection }], ...props }));
|
|
54
|
+
}
|
|
55
|
+
exports.DomainsDescriptionsTreeItemSelectionContextProvider = DomainsDescriptionsTreeItemSelectionContextProvider;
|
|
56
|
+
//# sourceMappingURL=domains-descriptions-tree-item-selection-context.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./domains-descriptions-tree-item-selection-context"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DomainsDescriptionsTree = exports.FeatureDomainDescriptionsTreeHeader = void 0;
|
|
7
|
+
const lodash_1 = require("lodash");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const TreeView_1 = __importDefault(require("@mui/lab/TreeView"));
|
|
10
|
+
const material_1 = require("@mui/material");
|
|
11
|
+
const UnfoldLess_1 = __importDefault(require("@mui/icons-material/UnfoldLess"));
|
|
12
|
+
const UnfoldMore_1 = __importDefault(require("@mui/icons-material/UnfoldMore"));
|
|
13
|
+
const ExpandMore_1 = __importDefault(require("@mui/icons-material/ExpandMore"));
|
|
14
|
+
const ChevronRight_1 = __importDefault(require("@mui/icons-material/ChevronRight"));
|
|
15
|
+
const _utils_1 = require("../../utils");
|
|
16
|
+
const components_1 = require("./components");
|
|
17
|
+
const ToggleIcon = (props) => props.allNodeIds.length === props.expandedNodes.length ? (react_1.default.createElement(UnfoldLess_1.default, { sx: { marginRight: '-10px' } })) : (react_1.default.createElement(UnfoldMore_1.default, { sx: { marginRight: '-10px' } }));
|
|
18
|
+
const FeatureDomainDescriptionsTreeHeader = (props) => react_1.default.createElement(react_1.default.Fragment, null, props.children);
|
|
19
|
+
exports.FeatureDomainDescriptionsTreeHeader = FeatureDomainDescriptionsTreeHeader;
|
|
20
|
+
const DomainsDescriptionsTree = ({ descriptionsTree, children }) => {
|
|
21
|
+
const [allNodeIds, setAllNodeIds] = react_1.default.useState(() => getAllNodeIds(descriptionsTree));
|
|
22
|
+
const [expandedNodes, setExpandedNodes] = react_1.default.useState(() => []);
|
|
23
|
+
react_1.default.useEffect(() => {
|
|
24
|
+
setAllNodeIds(getAllNodeIds(descriptionsTree));
|
|
25
|
+
}, [descriptionsTree]);
|
|
26
|
+
return (react_1.default.createElement("div", { className: "domains-descriptions-tree" },
|
|
27
|
+
react_1.default.createElement("div", { className: "domains-descriptions-tree-header" },
|
|
28
|
+
react_1.default.createElement(material_1.Button, { className: "toggle-all-nodes-btn", variant: "outlined", startIcon: react_1.default.createElement(ToggleIcon, { allNodeIds: allNodeIds, expandedNodes: expandedNodes }), onClick: () => setExpandedNodes((0, lodash_1.isEmpty)(expandedNodes) ? allNodeIds : []) }),
|
|
29
|
+
react_1.default.Children.toArray(children)
|
|
30
|
+
.filter(react_1.default.isValidElement)
|
|
31
|
+
.filter(child => child?.type === exports.FeatureDomainDescriptionsTreeHeader)),
|
|
32
|
+
react_1.default.createElement("div", null,
|
|
33
|
+
react_1.default.createElement(TreeView_1.default, { defaultCollapseIcon: react_1.default.createElement(ExpandMore_1.default, null), defaultExpandIcon: react_1.default.createElement(ChevronRight_1.default, null), disabledItemsFocusable: false, multiSelect: true, expanded: expandedNodes, onNodeToggle: (_, nodeIds) => setExpandedNodes(nodeIds) }, descriptionsTree.types.map(type => (react_1.default.createElement(components_1.TypeTreeItem, { key: type.nodeId, type: type })))))));
|
|
34
|
+
};
|
|
35
|
+
exports.DomainsDescriptionsTree = DomainsDescriptionsTree;
|
|
36
|
+
function getAllNodeIds(tree) {
|
|
37
|
+
return tree.types
|
|
38
|
+
.map(({ columns, nodeId }, typeIdx) => [
|
|
39
|
+
nodeId,
|
|
40
|
+
columns.map((0, _utils_1.extractProperty)('nodeId')),
|
|
41
|
+
])
|
|
42
|
+
.flat(2);
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=domains-descriptions-tree.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./domains-descriptions-tree"), exports);
|
|
18
|
+
__exportStar(require("./models"), exports);
|
|
19
|
+
__exportStar(require("./context"), exports);
|
|
20
|
+
__exportStar(require("./utils"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
package/lib/feature-descriptor/domains-descriptors-tree/models/domains-descriptions-tree.model.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DescriptionsTree = void 0;
|
|
4
|
+
const _utils_1 = require("../../../utils");
|
|
5
|
+
var DescriptionsTree;
|
|
6
|
+
(function (DescriptionsTree) {
|
|
7
|
+
function appendGroupId(groups, prefix) {
|
|
8
|
+
const id = DescriptionsTree.createGroupId(prefix);
|
|
9
|
+
return {
|
|
10
|
+
types: groups.types.map((type, typeIdx) => {
|
|
11
|
+
return {
|
|
12
|
+
nodeId: id({ typeIdx }),
|
|
13
|
+
summary: type.summary,
|
|
14
|
+
columns: type.columns.map((column, columnIdx) => ({
|
|
15
|
+
nodeId: id({ typeIdx, columnIdx }),
|
|
16
|
+
summary: column.summary,
|
|
17
|
+
descriptions: column.descriptions.map((description, descriptionIdx) => ({
|
|
18
|
+
...description,
|
|
19
|
+
nodeId: id({ typeIdx, columnIdx, descriptionIdx }),
|
|
20
|
+
})),
|
|
21
|
+
})),
|
|
22
|
+
};
|
|
23
|
+
}),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
DescriptionsTree.appendGroupId = appendGroupId;
|
|
27
|
+
function createGroupId(prefix) {
|
|
28
|
+
return (props) => [
|
|
29
|
+
(0, _utils_1.isSet)(prefix) && `${prefix}_`,
|
|
30
|
+
(0, _utils_1.isSet)(props.typeIdx) && `t${props.typeIdx}`,
|
|
31
|
+
(0, _utils_1.isSet)(props.columnIdx) && `c${props.columnIdx}`,
|
|
32
|
+
(0, _utils_1.isSet)(props.descriptionIdx) && `d${props.descriptionIdx}`,
|
|
33
|
+
].join('');
|
|
34
|
+
}
|
|
35
|
+
DescriptionsTree.createGroupId = createGroupId;
|
|
36
|
+
})(DescriptionsTree = exports.DescriptionsTree || (exports.DescriptionsTree = {}));
|
|
37
|
+
//# sourceMappingURL=domains-descriptions-tree.model.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./domains-descriptions-tree.model"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createDomainPredicate = void 0;
|
|
4
|
+
function createDomainPredicate(selectedDomains, selectedJoinIds) {
|
|
5
|
+
const joinIds = new Set(selectedJoinIds);
|
|
6
|
+
const domainIds = Object.values(selectedDomains).flatMap(d => d.filter(({ joinId }) => (joinIds.size ? joinIds.has(joinId) : true)));
|
|
7
|
+
return (description) => {
|
|
8
|
+
return domainIds.length
|
|
9
|
+
? description.domains.some(x => domainIds.find(({ domainIdx, joinId }) => x.joinId === joinId && x.domainIdx === domainIdx))
|
|
10
|
+
: joinIds.size
|
|
11
|
+
? description.domains.some(({ joinId }) => joinIds.has(joinId))
|
|
12
|
+
: true;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
exports.createDomainPredicate = createDomainPredicate;
|
|
16
|
+
//# sourceMappingURL=create-domain-predicate.js.map
|
package/lib/feature-descriptor/domains-descriptors-tree/utils/filter-domains-descriptions-tree.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.filterDomainsDescriptionsTree = void 0;
|
|
4
|
+
const isNotEmpty = (arr) => arr.length > 0;
|
|
5
|
+
function filterDomainsDescriptionsTree(domains, predicateFn) {
|
|
6
|
+
return {
|
|
7
|
+
types: domains.types
|
|
8
|
+
.map(({ summary, columns, nodeId }) => ({
|
|
9
|
+
summary,
|
|
10
|
+
nodeId,
|
|
11
|
+
columns: columns
|
|
12
|
+
.map(column => ({
|
|
13
|
+
summary: column.summary,
|
|
14
|
+
nodeId: column.nodeId,
|
|
15
|
+
descriptions: column.descriptions.filter(predicateFn),
|
|
16
|
+
}))
|
|
17
|
+
.filter(({ descriptions }) => isNotEmpty(descriptions)),
|
|
18
|
+
}))
|
|
19
|
+
.filter(({ columns }) => isNotEmpty(columns)),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
exports.filterDomainsDescriptionsTree = filterDomainsDescriptionsTree;
|
|
23
|
+
//# sourceMappingURL=filter-domains-descriptions-tree.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./filter-domains-descriptions-tree"), exports);
|
|
18
|
+
__exportStar(require("./create-domain-predicate"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export const FeatureCorrelatedFeaturesTable = ({ correlatedFeatures }) => {
|
|
5
|
-
return (React.createElement("table", { className: "table", style: { width: '100%' } },
|
|
6
|
-
React.createElement("tr", null,
|
|
7
|
-
React.createElement("th", { className: "label-bold" }, "Name"),
|
|
8
|
-
React.createElement("th", { className: "label-bold" }, "Correlation"),
|
|
9
|
-
React.createElement("th", { className: "label-bold" }, "Explanation")),
|
|
10
|
-
correlatedFeatures.map(([{ id, explanation }, correlation]) => (React.createElement("tr", null,
|
|
11
|
-
React.createElement("td", null, id),
|
|
12
|
-
React.createElement("td", null, Localize.formatNumber(correlation)),
|
|
13
|
-
React.createElement("td", null, React.createElement(FeatureExplanation, { explanationBlocks: explanation.tokens })))))));
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
4
|
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FeatureCorrelatedFeaturesTable = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const FeatureExplanation_1 = require("../feature-explanation/FeatureExplanation");
|
|
9
|
+
const _utils_1 = require("../../utils");
|
|
10
|
+
const FeatureCorrelatedFeaturesTable = ({ correlatedFeatures }) => {
|
|
11
|
+
return (react_1.default.createElement("table", { className: "table", style: { width: '100%' } },
|
|
12
|
+
react_1.default.createElement("tr", null,
|
|
13
|
+
react_1.default.createElement("th", { className: "label-bold" }, "Name"),
|
|
14
|
+
react_1.default.createElement("th", { className: "label-bold" }, "Correlation"),
|
|
15
|
+
react_1.default.createElement("th", { className: "label-bold" }, "Explanation")),
|
|
16
|
+
correlatedFeatures.map(([{ id, explanation }, correlation]) => (react_1.default.createElement("tr", null,
|
|
17
|
+
react_1.default.createElement("td", null, id),
|
|
18
|
+
react_1.default.createElement("td", null, _utils_1.Localize.formatNumber(correlation)),
|
|
19
|
+
react_1.default.createElement("td", null, react_1.default.createElement(FeatureExplanation_1.FeatureExplanation, { explanationBlocks: explanation.tokens })))))));
|
|
20
|
+
};
|
|
21
|
+
exports.FeatureCorrelatedFeaturesTable = FeatureCorrelatedFeaturesTable;
|
|
22
|
+
//# sourceMappingURL=FeatureCorrelatedFeaturesTable.js.map
|