@reltio/components 1.4.1998 → 1.4.2000
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/cjs/UpSetChart/UpSetChart.d.ts +5 -8
- package/cjs/UpSetChart/UpSetChart.js +61 -5
- package/cjs/UpSetChart/UpSetChart.test.js +198 -0
- package/cjs/UpSetChart/components/IntersectionsChart/IntersectionsChart.d.ts +15 -0
- package/cjs/UpSetChart/components/IntersectionsChart/IntersectionsChart.js +66 -0
- package/cjs/UpSetChart/components/IntersectionsChart/index.d.ts +1 -0
- package/cjs/UpSetChart/components/IntersectionsChart/index.js +5 -0
- package/cjs/UpSetChart/components/IntersectionsChart/styles.d.ts +1 -0
- package/cjs/UpSetChart/components/IntersectionsChart/styles.js +32 -0
- package/cjs/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.d.ts +10 -0
- package/cjs/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.js +64 -0
- package/cjs/UpSetChart/components/IntersectionsChartAxis/index.d.ts +1 -0
- package/cjs/UpSetChart/components/IntersectionsChartAxis/index.js +5 -0
- package/cjs/UpSetChart/components/IntersectionsChartAxis/styles.d.ts +1 -0
- package/cjs/UpSetChart/components/IntersectionsChartAxis/styles.js +32 -0
- package/cjs/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.d.ts +13 -0
- package/cjs/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.js +56 -0
- package/cjs/UpSetChart/components/IntersectionsMatrix/index.d.ts +1 -0
- package/cjs/UpSetChart/components/IntersectionsMatrix/index.js +5 -0
- package/cjs/UpSetChart/components/IntersectionsMatrix/styles.d.ts +1 -0
- package/cjs/UpSetChart/components/IntersectionsMatrix/styles.js +27 -0
- package/cjs/UpSetChart/components/SetsChart/SetsChart.d.ts +15 -0
- package/cjs/UpSetChart/components/SetsChart/SetsChart.js +58 -0
- package/cjs/UpSetChart/components/SetsChart/index.d.ts +1 -0
- package/cjs/UpSetChart/components/SetsChart/index.js +5 -0
- package/cjs/UpSetChart/components/SetsChart/styles.d.ts +1 -0
- package/cjs/UpSetChart/components/SetsChart/styles.js +43 -0
- package/cjs/UpSetChart/components/SetsChartAxis/SetsChartAxis.d.ts +6 -0
- package/cjs/UpSetChart/components/SetsChartAxis/SetsChartAxis.js +20 -0
- package/cjs/UpSetChart/components/SetsChartAxis/index.d.ts +1 -0
- package/cjs/UpSetChart/components/SetsChartAxis/index.js +5 -0
- package/cjs/UpSetChart/components/SetsChartAxis/styles.d.ts +1 -0
- package/cjs/UpSetChart/components/SetsChartAxis/styles.js +17 -0
- package/cjs/UpSetChart/constants.d.ts +16 -3
- package/cjs/UpSetChart/constants.js +20 -4
- package/cjs/UpSetChart/gameOfThrones.test-data.d.ts +4 -0
- package/cjs/UpSetChart/gameOfThrones.test-data.js +26 -0
- package/cjs/UpSetChart/helpers.d.ts +20 -0
- package/cjs/UpSetChart/helpers.js +127 -0
- package/cjs/UpSetChart/styles.d.ts +4 -1
- package/cjs/UpSetChart/styles.js +11 -12
- package/cjs/UpSetChart/types.d.ts +16 -0
- package/cjs/UpSetChart/types.js +2 -0
- package/cjs/UpSetChart/useUpSetChartSizes.d.ts +20 -0
- package/cjs/UpSetChart/useUpSetChartSizes.js +34 -0
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.test-data.d.ts +36 -0
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.test-data.js +288 -0
- package/cjs/features/crosswalks/AttributesTable/AttributesTable.test.js +708 -370
- package/cjs/features/crosswalks/ColoredBlock/ColoredBlock.test.js +77 -15
- package/cjs/features/crosswalks/CopyableValueField/CopyableValueField.test.js +85 -15
- package/cjs/features/crosswalks/CrosswalkAttributes/CrosswalkAttributes.test.js +265 -193
- package/cjs/features/crosswalks/CrosswalkDateEditor/CrosswalkDateEditor.test.js +106 -12
- package/cjs/features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.test.js +21 -9
- package/cjs/features/crosswalks/CrosswalkEditor/CrosswalkEditor.test.js +190 -90
- package/cjs/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +323 -225
- package/cjs/features/crosswalks/ShowDependentLink/ShowDependentLink.test.js +75 -12
- package/cjs/features/crosswalks/SourceCrosswalksRow/SourceCrosswalksRow.test.js +171 -138
- package/esm/UpSetChart/UpSetChart.d.ts +5 -8
- package/esm/UpSetChart/UpSetChart.js +38 -5
- package/esm/UpSetChart/UpSetChart.test.js +193 -0
- package/esm/UpSetChart/components/IntersectionsChart/IntersectionsChart.d.ts +15 -0
- package/esm/UpSetChart/components/IntersectionsChart/IntersectionsChart.js +39 -0
- package/esm/UpSetChart/components/IntersectionsChart/index.d.ts +1 -0
- package/esm/UpSetChart/components/IntersectionsChart/index.js +1 -0
- package/esm/UpSetChart/components/IntersectionsChart/styles.d.ts +1 -0
- package/esm/UpSetChart/components/IntersectionsChart/styles.js +29 -0
- package/esm/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.d.ts +10 -0
- package/esm/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.js +34 -0
- package/esm/UpSetChart/components/IntersectionsChartAxis/index.d.ts +1 -0
- package/esm/UpSetChart/components/IntersectionsChartAxis/index.js +1 -0
- package/esm/UpSetChart/components/IntersectionsChartAxis/styles.d.ts +1 -0
- package/esm/UpSetChart/components/IntersectionsChartAxis/styles.js +29 -0
- package/esm/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.d.ts +13 -0
- package/esm/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.js +26 -0
- package/esm/UpSetChart/components/IntersectionsMatrix/index.d.ts +1 -0
- package/esm/UpSetChart/components/IntersectionsMatrix/index.js +1 -0
- package/esm/UpSetChart/components/IntersectionsMatrix/styles.d.ts +1 -0
- package/esm/UpSetChart/components/IntersectionsMatrix/styles.js +24 -0
- package/esm/UpSetChart/components/SetsChart/SetsChart.d.ts +15 -0
- package/esm/UpSetChart/components/SetsChart/SetsChart.js +31 -0
- package/esm/UpSetChart/components/SetsChart/index.d.ts +1 -0
- package/esm/UpSetChart/components/SetsChart/index.js +1 -0
- package/esm/UpSetChart/components/SetsChart/styles.d.ts +1 -0
- package/esm/UpSetChart/components/SetsChart/styles.js +40 -0
- package/esm/UpSetChart/components/SetsChartAxis/SetsChartAxis.d.ts +6 -0
- package/esm/UpSetChart/components/SetsChartAxis/SetsChartAxis.js +13 -0
- package/esm/UpSetChart/components/SetsChartAxis/index.d.ts +1 -0
- package/esm/UpSetChart/components/SetsChartAxis/index.js +1 -0
- package/esm/UpSetChart/components/SetsChartAxis/styles.d.ts +1 -0
- package/esm/UpSetChart/components/SetsChartAxis/styles.js +14 -0
- package/esm/UpSetChart/constants.d.ts +16 -3
- package/esm/UpSetChart/constants.js +19 -3
- package/esm/UpSetChart/gameOfThrones.test-data.d.ts +4 -0
- package/esm/UpSetChart/gameOfThrones.test-data.js +23 -0
- package/esm/UpSetChart/helpers.d.ts +20 -0
- package/esm/UpSetChart/helpers.js +120 -0
- package/esm/UpSetChart/styles.d.ts +4 -1
- package/esm/UpSetChart/styles.js +11 -12
- package/esm/UpSetChart/types.d.ts +16 -0
- package/esm/UpSetChart/useUpSetChartSizes.d.ts +20 -0
- package/esm/UpSetChart/useUpSetChartSizes.js +30 -0
- package/esm/features/crosswalks/AttributesTable/AttributesTable.test-data.d.ts +36 -0
- package/esm/features/crosswalks/AttributesTable/AttributesTable.test-data.js +283 -0
- package/esm/features/crosswalks/AttributesTable/AttributesTable.test.js +711 -350
- package/esm/features/crosswalks/ColoredBlock/ColoredBlock.test.js +77 -15
- package/esm/features/crosswalks/CopyableValueField/CopyableValueField.test.js +85 -15
- package/esm/features/crosswalks/CrosswalkAttributes/CrosswalkAttributes.test.js +266 -194
- package/esm/features/crosswalks/CrosswalkDateEditor/CrosswalkDateEditor.test.js +106 -12
- package/esm/features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.test.js +21 -9
- package/esm/features/crosswalks/CrosswalkEditor/CrosswalkEditor.test.js +190 -90
- package/esm/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +324 -226
- package/esm/features/crosswalks/ShowDependentLink/ShowDependentLink.test.js +75 -12
- package/esm/features/crosswalks/SourceCrosswalksRow/SourceCrosswalksRow.test.js +171 -138
- package/package.json +1 -1
- package/cjs/features/crosswalks/AttributesTable/IntegrationAttributesTable.test-data.d.ts +0 -3
- package/cjs/features/crosswalks/AttributesTable/IntegrationAttributesTable.test-data.js +0 -52
- package/cjs/features/crosswalks/AttributesTable/IntegrationAttributesTable.test.js +0 -323
- package/cjs/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.js +0 -142
- package/cjs/features/crosswalks/AttributesTable/components/AttributeValuesRenderer/AttributeValuesRenderer.test.js +0 -146
- package/cjs/features/crosswalks/AttributesTable/components/AttributesHeadCellRenderer/AttributesHeadCellRenderer.test.d.ts +0 -1
- package/cjs/features/crosswalks/AttributesTable/components/AttributesHeadCellRenderer/AttributesHeadCellRenderer.test.js +0 -50
- package/cjs/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.d.ts +0 -1
- package/cjs/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.js +0 -58
- package/cjs/features/crosswalks/AttributesTable/components/CountRenderer/CountRenderer.test.d.ts +0 -1
- package/cjs/features/crosswalks/AttributesTable/components/CountRenderer/CountRenderer.test.js +0 -14
- package/cjs/features/crosswalks/AttributesTable/components/ImageAttributesRenderer/ImageAttributesRenderer.test.d.ts +0 -1
- package/cjs/features/crosswalks/AttributesTable/components/ImageAttributesRenderer/ImageAttributesRenderer.test.js +0 -110
- package/cjs/features/crosswalks/AttributesTable/components/NestedAttributesRenderer/NestedAttributesRenderer.test.d.ts +0 -1
- package/cjs/features/crosswalks/AttributesTable/components/NestedAttributesRenderer/NestedAttributesRenderer.test.js +0 -111
- package/cjs/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.test.d.ts +0 -1
- package/cjs/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.test.js +0 -67
- package/cjs/features/crosswalks/AttributesTable/components/ReferenceAttributesRenderer/ReferenceAttributesRenderer.test.d.ts +0 -1
- package/cjs/features/crosswalks/AttributesTable/components/ReferenceAttributesRenderer/ReferenceAttributesRenderer.test.js +0 -193
- package/cjs/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.test.d.ts +0 -1
- package/cjs/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.test.js +0 -22
- package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.test.d.ts +0 -1
- package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.test.js +0 -58
- package/cjs/features/crosswalks/AttributesTable/components/SimpleAttributesRenderer/SimpleAttributesRenderer.test.d.ts +0 -1
- package/cjs/features/crosswalks/AttributesTable/components/SimpleAttributesRenderer/SimpleAttributesRenderer.test.js +0 -69
- package/cjs/features/crosswalks/CrosswalkDateEditor/IntegrationCrosswalkDateEditor.test.d.ts +0 -1
- package/cjs/features/crosswalks/CrosswalkDateEditor/IntegrationCrosswalkDateEditor.test.js +0 -137
- package/cjs/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.test.d.ts +0 -1
- package/cjs/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.test.js +0 -56
- package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test-data.d.ts +0 -3
- package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test-data.js +0 -47
- package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test.d.ts +0 -1
- package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test.js +0 -318
- package/esm/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.d.ts +0 -1
- package/esm/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.js +0 -137
- package/esm/features/crosswalks/AttributesTable/components/AttributeValuesRenderer/AttributeValuesRenderer.test.d.ts +0 -1
- package/esm/features/crosswalks/AttributesTable/components/AttributeValuesRenderer/AttributeValuesRenderer.test.js +0 -141
- package/esm/features/crosswalks/AttributesTable/components/AttributesHeadCellRenderer/AttributesHeadCellRenderer.test.d.ts +0 -1
- package/esm/features/crosswalks/AttributesTable/components/AttributesHeadCellRenderer/AttributesHeadCellRenderer.test.js +0 -45
- package/esm/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.d.ts +0 -1
- package/esm/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.js +0 -53
- package/esm/features/crosswalks/AttributesTable/components/CountRenderer/CountRenderer.test.d.ts +0 -1
- package/esm/features/crosswalks/AttributesTable/components/CountRenderer/CountRenderer.test.js +0 -9
- package/esm/features/crosswalks/AttributesTable/components/ImageAttributesRenderer/ImageAttributesRenderer.test.d.ts +0 -1
- package/esm/features/crosswalks/AttributesTable/components/ImageAttributesRenderer/ImageAttributesRenderer.test.js +0 -105
- package/esm/features/crosswalks/AttributesTable/components/NestedAttributesRenderer/NestedAttributesRenderer.test.d.ts +0 -1
- package/esm/features/crosswalks/AttributesTable/components/NestedAttributesRenderer/NestedAttributesRenderer.test.js +0 -106
- package/esm/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.test.d.ts +0 -1
- package/esm/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.test.js +0 -62
- package/esm/features/crosswalks/AttributesTable/components/ReferenceAttributesRenderer/ReferenceAttributesRenderer.test.d.ts +0 -1
- package/esm/features/crosswalks/AttributesTable/components/ReferenceAttributesRenderer/ReferenceAttributesRenderer.test.js +0 -188
- package/esm/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.test.d.ts +0 -1
- package/esm/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.test.js +0 -17
- package/esm/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.test.d.ts +0 -1
- package/esm/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.test.js +0 -53
- package/esm/features/crosswalks/AttributesTable/components/SimpleAttributesRenderer/SimpleAttributesRenderer.test.d.ts +0 -1
- package/esm/features/crosswalks/AttributesTable/components/SimpleAttributesRenderer/SimpleAttributesRenderer.test.js +0 -64
- package/esm/features/crosswalks/CrosswalkDateEditor/IntegrationCrosswalkDateEditor.test.d.ts +0 -1
- package/esm/features/crosswalks/CrosswalkDateEditor/IntegrationCrosswalkDateEditor.test.js +0 -132
- package/esm/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.test.d.ts +0 -1
- package/esm/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.test.js +0 -28
- /package/cjs/{features/crosswalks/AttributesTable/IntegrationAttributesTable.test.d.ts → UpSetChart/UpSetChart.test.d.ts} +0 -0
- /package/{cjs/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.d.ts → esm/UpSetChart/UpSetChart.test.d.ts} +0 -0
- /package/{cjs/features/crosswalks/AttributesTable/components/AttributeValuesRenderer/AttributeValuesRenderer.test.d.ts → esm/UpSetChart/types.js} +0 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useStyles = void 0;
|
|
4
|
+
var styles_1 = require("@mui/styles");
|
|
5
|
+
var constants_1 = require("../../constants");
|
|
6
|
+
exports.useStyles = (0, styles_1.makeStyles)(function () { return ({
|
|
7
|
+
circle: {
|
|
8
|
+
strokeWidth: '2px',
|
|
9
|
+
fill: '#EEEEEE',
|
|
10
|
+
stroke: '#EEEEEE',
|
|
11
|
+
transition: 'fill ease-in-out 0.3s'
|
|
12
|
+
},
|
|
13
|
+
activeCircle: {
|
|
14
|
+
fill: constants_1.PRIMARY_COLOR
|
|
15
|
+
},
|
|
16
|
+
dimmedCircle: {
|
|
17
|
+
fill: constants_1.DIMMED_COLOR
|
|
18
|
+
},
|
|
19
|
+
link: {
|
|
20
|
+
stroke: constants_1.PRIMARY_COLOR,
|
|
21
|
+
strokeWidth: '2px',
|
|
22
|
+
transition: 'stroke ease-in-out 0.3s'
|
|
23
|
+
},
|
|
24
|
+
dimmedLine: {
|
|
25
|
+
stroke: constants_1.DIMMED_COLOR
|
|
26
|
+
}
|
|
27
|
+
}); });
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ScaleBand } from 'd3-scale';
|
|
3
|
+
import { DataSet } from '../../types';
|
|
4
|
+
type Props = {
|
|
5
|
+
sets: DataSet[];
|
|
6
|
+
width: number;
|
|
7
|
+
yScale: ScaleBand<string>;
|
|
8
|
+
labels: string[];
|
|
9
|
+
transform?: string;
|
|
10
|
+
hoverAreaWidth: number;
|
|
11
|
+
hoveredElements?: string[];
|
|
12
|
+
onSetHover: (set: DataSet) => void;
|
|
13
|
+
};
|
|
14
|
+
export declare const SetsChart: ({ sets, width, yScale, transform, labels, hoveredElements, hoverAreaWidth, onSetHover }: Props) => React.JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
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.SetsChart = void 0;
|
|
27
|
+
var react_1 = __importStar(require("react"));
|
|
28
|
+
var d3_scale_1 = require("d3-scale");
|
|
29
|
+
var SetsChartAxis_1 = require("../SetsChartAxis");
|
|
30
|
+
var constants_1 = require("../../constants");
|
|
31
|
+
var styles_1 = require("./styles");
|
|
32
|
+
var SetsChart = function (_a) {
|
|
33
|
+
var sets = _a.sets, width = _a.width, yScale = _a.yScale, transform = _a.transform, labels = _a.labels, hoveredElements = _a.hoveredElements, hoverAreaWidth = _a.hoverAreaWidth, onSetHover = _a.onSetHover;
|
|
34
|
+
var styles = (0, styles_1.useStyles)();
|
|
35
|
+
var containerRef = react_1.default.useRef(null);
|
|
36
|
+
var xScale = (0, react_1.useMemo)(function () {
|
|
37
|
+
var maxSetSize = sets.length > 0 ? Math.max.apply(Math, sets.map(function (set) { return set.size; })) : 0;
|
|
38
|
+
return (0, d3_scale_1.scaleLinear)().domain([0, maxSetSize]).range([0, width]);
|
|
39
|
+
}, [width, sets]);
|
|
40
|
+
return (react_1.default.createElement("g", { ref: containerRef, transform: transform },
|
|
41
|
+
react_1.default.createElement(SetsChartAxis_1.SetsChartAxis, { width: width }),
|
|
42
|
+
sets.map(function (set, i) {
|
|
43
|
+
var name = set.name, size = set.size, elements = set.elements;
|
|
44
|
+
var label = labels[i];
|
|
45
|
+
var height = yScale.bandwidth();
|
|
46
|
+
var y = yScale(name) + height / 2 - constants_1.SET_BAR_HEIGHT / 2;
|
|
47
|
+
var lineY = yScale(name) + height;
|
|
48
|
+
var barSize = hoveredElements ? elements.filter(function (el) { return hoveredElements.includes(el); }).length : size;
|
|
49
|
+
return (react_1.default.createElement("g", { key: "set-group-".concat(i) },
|
|
50
|
+
react_1.default.createElement("rect", { className: styles.setsBarBackground, x: 0, y: y, width: width, height: constants_1.SET_BAR_HEIGHT }),
|
|
51
|
+
react_1.default.createElement("rect", { className: styles.setsBarDimmed, x: width - xScale(size), y: y, width: xScale(size), height: constants_1.SET_BAR_HEIGHT }),
|
|
52
|
+
react_1.default.createElement("rect", { className: styles.setsBar, x: width - xScale(barSize), y: y, width: xScale(barSize), height: constants_1.SET_BAR_HEIGHT }),
|
|
53
|
+
i !== sets.length - 1 && (react_1.default.createElement("line", { className: styles.gridLine, x1: 0, x2: hoverAreaWidth, y1: lineY, y2: lineY })),
|
|
54
|
+
react_1.default.createElement("text", { className: styles.setsLabel, x: width + constants_1.TEXT_GAP, y: yScale(name) + height / 2 }, label),
|
|
55
|
+
react_1.default.createElement("rect", { className: styles.hoverBar, "data-reltio-id": "set-hover-area", x: -constants_1.GAP_BEFORE_LEFT_BAR + 1, y: yScale(name), width: hoverAreaWidth - 2, height: height, onMouseEnter: function () { return onSetHover(set); }, onMouseLeave: function () { return onSetHover(null); } })));
|
|
56
|
+
})));
|
|
57
|
+
};
|
|
58
|
+
exports.SetsChart = SetsChart;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SetsChart } from './SetsChart';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SetsChart = void 0;
|
|
4
|
+
var SetsChart_1 = require("./SetsChart");
|
|
5
|
+
Object.defineProperty(exports, "SetsChart", { enumerable: true, get: function () { return SetsChart_1.SetsChart; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"setsBarBackground" | "setsBarDimmed" | "setsBar" | "hoverBar" | "setsLabel" | "gridLine">;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useStyles = void 0;
|
|
4
|
+
var styles_1 = require("@mui/styles");
|
|
5
|
+
var constants_1 = require("../../constants");
|
|
6
|
+
exports.useStyles = (0, styles_1.makeStyles)(function () { return ({
|
|
7
|
+
setsBarBackground: {
|
|
8
|
+
fill: constants_1.PRIMARY_COLOR,
|
|
9
|
+
opacity: 0.08,
|
|
10
|
+
transition: 'x ease-in-out 0.3s, width ease-in-out 0.3s'
|
|
11
|
+
},
|
|
12
|
+
setsBarDimmed: {
|
|
13
|
+
fill: constants_1.DIMMED_COLOR,
|
|
14
|
+
transition: 'x ease-in-out 0.3s, width ease-in-out 0.3s'
|
|
15
|
+
},
|
|
16
|
+
setsBar: {
|
|
17
|
+
fill: constants_1.PRIMARY_COLOR,
|
|
18
|
+
transition: 'x ease-in-out 0.3s, width ease-in-out 0.3s'
|
|
19
|
+
},
|
|
20
|
+
hoverBar: {
|
|
21
|
+
fill: 'transparent',
|
|
22
|
+
strokeWidth: '1px',
|
|
23
|
+
cursor: 'pointer',
|
|
24
|
+
stroke: constants_1.PRIMARY_COLOR,
|
|
25
|
+
opacity: 0,
|
|
26
|
+
transition: 'opacity ease-in-out 0.3s',
|
|
27
|
+
'&:hover': {
|
|
28
|
+
opacity: 1
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
setsLabel: {
|
|
32
|
+
fontSize: constants_1.SET_LABEL_SIZE,
|
|
33
|
+
fill: constants_1.TEXT_COLOR,
|
|
34
|
+
textAnchor: 'start',
|
|
35
|
+
dominantBaseline: 'middle',
|
|
36
|
+
transition: 'all ease-in-out 0.3s'
|
|
37
|
+
},
|
|
38
|
+
gridLine: {
|
|
39
|
+
stroke: '#000000',
|
|
40
|
+
opacity: 0.04,
|
|
41
|
+
strokeWidth: '1px'
|
|
42
|
+
}
|
|
43
|
+
}); });
|
|
@@ -0,0 +1,20 @@
|
|
|
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.SetsChartAxis = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var styles_1 = require("./styles");
|
|
9
|
+
var SetsChartAxis = function (_a) {
|
|
10
|
+
var width = _a.width;
|
|
11
|
+
var styles = (0, styles_1.useStyles)();
|
|
12
|
+
return (react_1.default.createElement("g", null,
|
|
13
|
+
react_1.default.createElement("g", { transform: "translate(0,0)" },
|
|
14
|
+
react_1.default.createElement("line", { y2: -6, className: styles.axisTick }),
|
|
15
|
+
react_1.default.createElement("text", { x: 0, y: -9, className: styles.axisTickLabel }, "100%")),
|
|
16
|
+
react_1.default.createElement("g", { transform: "translate(".concat(width, ",0)") },
|
|
17
|
+
react_1.default.createElement("line", { y2: -6, className: styles.axisTick }),
|
|
18
|
+
react_1.default.createElement("text", { x: 0, y: -9, className: styles.axisTickLabel }, "0%"))));
|
|
19
|
+
};
|
|
20
|
+
exports.SetsChartAxis = SetsChartAxis;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SetsChartAxis } from './SetsChartAxis';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SetsChartAxis = void 0;
|
|
4
|
+
var SetsChartAxis_1 = require("./SetsChartAxis");
|
|
5
|
+
Object.defineProperty(exports, "SetsChartAxis", { enumerable: true, get: function () { return SetsChartAxis_1.SetsChartAxis; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"axisTick" | "axisTickLabel">;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useStyles = void 0;
|
|
4
|
+
var styles_1 = require("@mui/styles");
|
|
5
|
+
exports.useStyles = (0, styles_1.makeStyles)(function () { return ({
|
|
6
|
+
axisTick: {
|
|
7
|
+
stroke: '#000000',
|
|
8
|
+
strokeWidth: '1px',
|
|
9
|
+
opacity: 0.54
|
|
10
|
+
},
|
|
11
|
+
axisTickLabel: {
|
|
12
|
+
fontSize: '10px',
|
|
13
|
+
fill: '#000000',
|
|
14
|
+
opacity: 0.54,
|
|
15
|
+
textAnchor: 'middle'
|
|
16
|
+
}
|
|
17
|
+
}); });
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const SECONDARY_COLOR = "rgba(0, 0, 102, 0.2)";
|
|
1
|
+
export declare const PRIMARY_COLOR = "#000066";
|
|
2
|
+
export declare const DIMMED_COLOR = "#CCCCE0";
|
|
4
3
|
export declare const TEXT_COLOR = "rgba(0, 0, 0, 0.87)";
|
|
4
|
+
export declare const TOP_GAP = 24;
|
|
5
|
+
export declare const TEXT_GAP = 16;
|
|
6
|
+
export declare const GAP_BETWEEN_TABLE_AND_CHART = 8;
|
|
7
|
+
export declare const GAP_BEFORE_LEFT_BAR = 12;
|
|
8
|
+
export declare const AXIS_TICK_LABEL_SIZE = "12px";
|
|
9
|
+
export declare const SET_LABEL_SIZE = "13px";
|
|
10
|
+
export declare const SET_BAR_HEIGHT = 12;
|
|
11
|
+
export declare const MATRIX_ROW_HEIGHT = 29;
|
|
12
|
+
export declare const MIN_MATRIX_COLUMN_WIDTH = 28;
|
|
13
|
+
export declare const MIN_INTERSECTION_CHART_HEIGHT = 120;
|
|
14
|
+
export declare const MIN_SETS_CHART_WIDTH = 100;
|
|
15
|
+
export declare const MAX_SETS_CHART_WIDTH = 200;
|
|
16
|
+
export declare const MAX_CHARACTERS = 20;
|
|
17
|
+
export declare const MIN_CHARACTERS = 8;
|
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
exports.PRIMARY_COLOR = '
|
|
6
|
-
exports.
|
|
3
|
+
exports.MIN_CHARACTERS = exports.MAX_CHARACTERS = exports.MAX_SETS_CHART_WIDTH = exports.MIN_SETS_CHART_WIDTH = exports.MIN_INTERSECTION_CHART_HEIGHT = exports.MIN_MATRIX_COLUMN_WIDTH = exports.MATRIX_ROW_HEIGHT = exports.SET_BAR_HEIGHT = exports.SET_LABEL_SIZE = exports.AXIS_TICK_LABEL_SIZE = exports.GAP_BEFORE_LEFT_BAR = exports.GAP_BETWEEN_TABLE_AND_CHART = exports.TEXT_GAP = exports.TOP_GAP = exports.TEXT_COLOR = exports.DIMMED_COLOR = exports.PRIMARY_COLOR = void 0;
|
|
4
|
+
// Colors
|
|
5
|
+
exports.PRIMARY_COLOR = '#000066';
|
|
6
|
+
exports.DIMMED_COLOR = '#CCCCE0';
|
|
7
7
|
exports.TEXT_COLOR = 'rgba(0, 0, 0, 0.87)';
|
|
8
|
+
// Gaps
|
|
9
|
+
exports.TOP_GAP = 24;
|
|
10
|
+
exports.TEXT_GAP = 16;
|
|
11
|
+
exports.GAP_BETWEEN_TABLE_AND_CHART = 8;
|
|
12
|
+
exports.GAP_BEFORE_LEFT_BAR = 12;
|
|
13
|
+
// Sizes
|
|
14
|
+
exports.AXIS_TICK_LABEL_SIZE = '12px';
|
|
15
|
+
exports.SET_LABEL_SIZE = '13px';
|
|
16
|
+
exports.SET_BAR_HEIGHT = 12;
|
|
17
|
+
exports.MATRIX_ROW_HEIGHT = 29;
|
|
18
|
+
exports.MIN_MATRIX_COLUMN_WIDTH = 28;
|
|
19
|
+
exports.MIN_INTERSECTION_CHART_HEIGHT = 120;
|
|
20
|
+
exports.MIN_SETS_CHART_WIDTH = 100;
|
|
21
|
+
exports.MAX_SETS_CHART_WIDTH = 200;
|
|
22
|
+
exports.MAX_CHARACTERS = 20;
|
|
23
|
+
exports.MIN_CHARACTERS = 8;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gameOfThronesData = void 0;
|
|
4
|
+
exports.gameOfThronesData = [
|
|
5
|
+
{ name: 'Alton Lannister', sets: ['was killed', 'Lannister', 'male'] },
|
|
6
|
+
{ name: 'Arya Stark', sets: ['Stark', 'female'] },
|
|
7
|
+
{ name: 'Bran Stark', sets: ['royal', 'Stark', 'male'] },
|
|
8
|
+
{ name: 'Benjen Stark', sets: ['was killed', 'Stark', 'male'] },
|
|
9
|
+
{ name: 'Brandon Stark', sets: ['was killed', 'Stark'] },
|
|
10
|
+
{ name: 'Catelyn Stark', sets: ['was killed', 'Stark', 'female'] },
|
|
11
|
+
{ name: 'Cersei Lannister', sets: ['royal', 'was killed', 'Lannister', 'female'] },
|
|
12
|
+
{ name: 'Eddard Stark', sets: ['was killed', 'Stark', 'male'] },
|
|
13
|
+
{ name: 'Jaime Lannister', sets: ['was killed', 'Lannister', 'male'] },
|
|
14
|
+
{ name: 'Jon Snow', sets: ['royal', 'was killed', 'Stark', 'male'] },
|
|
15
|
+
{ name: 'Kevan Lannister', sets: ['was killed', 'Lannister', 'male'] },
|
|
16
|
+
{ name: 'Lancel Lannister', sets: ['was killed', 'Lannister', 'male'] },
|
|
17
|
+
{ name: 'Lyanna Stark', sets: ['was killed', 'Stark', 'female'] },
|
|
18
|
+
{ name: 'Martyn Lannister', sets: ['was killed', 'Lannister', 'male'] },
|
|
19
|
+
{ name: 'Rickard Stark', sets: ['was killed', 'Stark', 'male'] },
|
|
20
|
+
{ name: 'Rickon Stark', sets: ['was killed', 'Stark', 'male'] },
|
|
21
|
+
{ name: 'Robb Stark', sets: ['royal', 'was killed', 'Stark', 'male'] },
|
|
22
|
+
{ name: 'Sansa Stark', sets: ['royal', 'Stark', 'female'] },
|
|
23
|
+
{ name: 'Tyrion Lannister', sets: ['Lannister', 'male'] },
|
|
24
|
+
{ name: 'Tywin Lannister', sets: ['was killed', 'Lannister', 'male'] },
|
|
25
|
+
{ name: 'Willem Lannister', sets: ['was killed', 'Lannister', 'male'] }
|
|
26
|
+
];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ScaleBand } from 'd3-scale';
|
|
2
|
+
import { DataSet, Intersection, UpSetChartData } from './types';
|
|
3
|
+
export declare const findIntersections: (data: UpSetChartData) => {
|
|
4
|
+
intersections: Intersection[];
|
|
5
|
+
sets: DataSet[];
|
|
6
|
+
};
|
|
7
|
+
export declare const getMatrixData: (xScale: ScaleBand<string>, yScale: ScaleBand<string>, intersections: Intersection[], sets: DataSet[]) => {
|
|
8
|
+
circles: {
|
|
9
|
+
cx: number;
|
|
10
|
+
cy: number;
|
|
11
|
+
isPresent: boolean;
|
|
12
|
+
intersectionIndex: number;
|
|
13
|
+
}[];
|
|
14
|
+
lines: any[];
|
|
15
|
+
};
|
|
16
|
+
export declare const truncateLabels: (sets: DataSet[], maxLabelsWidth: number) => {
|
|
17
|
+
labels: string[];
|
|
18
|
+
maxWidth: number;
|
|
19
|
+
};
|
|
20
|
+
export declare const calculateTicksWidth: (ticks: number[]) => number;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.calculateTicksWidth = exports.truncateLabels = exports.getMatrixData = exports.findIntersections = void 0;
|
|
13
|
+
var constants_1 = require("./constants");
|
|
14
|
+
var findIntersections = function (data) {
|
|
15
|
+
var setsCombinations = {};
|
|
16
|
+
var individualSets = {};
|
|
17
|
+
data.forEach(function (_a) {
|
|
18
|
+
var name = _a.name, sets = _a.sets;
|
|
19
|
+
sets.forEach(function (set) {
|
|
20
|
+
if (!individualSets[set]) {
|
|
21
|
+
individualSets[set] = [];
|
|
22
|
+
}
|
|
23
|
+
individualSets[set].push(name);
|
|
24
|
+
});
|
|
25
|
+
var generateCombinations = function (subset, index) {
|
|
26
|
+
if (index === sets.length) {
|
|
27
|
+
if (subset.length > 0) {
|
|
28
|
+
var key = subset.sort().join(',');
|
|
29
|
+
if (!setsCombinations[key]) {
|
|
30
|
+
setsCombinations[key] = [];
|
|
31
|
+
}
|
|
32
|
+
setsCombinations[key].push(name);
|
|
33
|
+
}
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
generateCombinations(subset, index + 1);
|
|
37
|
+
generateCombinations(__spreadArray(__spreadArray([], subset, true), [sets[index]], false), index + 1);
|
|
38
|
+
};
|
|
39
|
+
generateCombinations([], 0);
|
|
40
|
+
});
|
|
41
|
+
var intersections = Object.entries(setsCombinations)
|
|
42
|
+
.map(function (_a, index) {
|
|
43
|
+
var key = _a[0], elements = _a[1];
|
|
44
|
+
return ({
|
|
45
|
+
index: index,
|
|
46
|
+
sets: key.split(','),
|
|
47
|
+
size: elements.length,
|
|
48
|
+
elements: elements
|
|
49
|
+
});
|
|
50
|
+
})
|
|
51
|
+
.sort(function (a, b) { return b.size - a.size; });
|
|
52
|
+
var sets = Object.entries(individualSets).map(function (_a, index) {
|
|
53
|
+
var name = _a[0], elements = _a[1];
|
|
54
|
+
return ({
|
|
55
|
+
index: index,
|
|
56
|
+
name: name,
|
|
57
|
+
size: elements.length,
|
|
58
|
+
elements: elements
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
return { intersections: intersections, sets: sets };
|
|
62
|
+
};
|
|
63
|
+
exports.findIntersections = findIntersections;
|
|
64
|
+
var getMatrixData = function (xScale, yScale, intersections, sets) {
|
|
65
|
+
var circles = intersections.flatMap(function (intersection, i) {
|
|
66
|
+
return sets.map(function (set) { return ({
|
|
67
|
+
cx: xScale(String(i)) + xScale.bandwidth() / 2,
|
|
68
|
+
cy: yScale(set.name) + yScale.bandwidth() / 2,
|
|
69
|
+
isPresent: intersection.sets.includes(set.name),
|
|
70
|
+
intersectionIndex: intersection.index
|
|
71
|
+
}); });
|
|
72
|
+
});
|
|
73
|
+
var lines = intersections.reduce(function (acc, intersection, i) {
|
|
74
|
+
var activeSetIndices = intersection.sets
|
|
75
|
+
.map(function (name) { return sets.findIndex(function (set) { return set.name === name; }); })
|
|
76
|
+
.filter(function (i) { return i >= 0; })
|
|
77
|
+
.sort(function (a, b) { return a - b; });
|
|
78
|
+
if (activeSetIndices.length > 1) {
|
|
79
|
+
var firstIdx = activeSetIndices[0];
|
|
80
|
+
var lastIdx = activeSetIndices[activeSetIndices.length - 1];
|
|
81
|
+
var x = xScale(String(i)) + xScale.bandwidth() / 2;
|
|
82
|
+
var y1 = yScale(sets[firstIdx].name) + yScale.bandwidth() / 2;
|
|
83
|
+
var y2 = yScale(sets[lastIdx].name) + yScale.bandwidth() / 2;
|
|
84
|
+
return __spreadArray(__spreadArray([], acc, true), [{ x: x, y1: y1, y2: y2, intersectionIndex: intersection.index }], false);
|
|
85
|
+
}
|
|
86
|
+
return acc;
|
|
87
|
+
}, []);
|
|
88
|
+
return { circles: circles, lines: lines };
|
|
89
|
+
};
|
|
90
|
+
exports.getMatrixData = getMatrixData;
|
|
91
|
+
var truncateLabels = function (sets, maxLabelsWidth) {
|
|
92
|
+
var newTruncatedLabels = [];
|
|
93
|
+
var maxWidth = 0;
|
|
94
|
+
var tempSvgElement = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
|
95
|
+
document.body.appendChild(tempSvgElement);
|
|
96
|
+
var tempTextElement = document.createElementNS('http://www.w3.org/2000/svg', 'text');
|
|
97
|
+
tempTextElement.setAttribute('font-size', constants_1.SET_LABEL_SIZE);
|
|
98
|
+
tempSvgElement.appendChild(tempTextElement);
|
|
99
|
+
sets.forEach(function (_a) {
|
|
100
|
+
var name = _a.name;
|
|
101
|
+
var truncatedText = name.length > constants_1.MAX_CHARACTERS ? name.slice(0, constants_1.MAX_CHARACTERS) + '...' : name;
|
|
102
|
+
tempTextElement.textContent = truncatedText;
|
|
103
|
+
while (tempTextElement.getBBox().width > maxLabelsWidth && truncatedText.length > constants_1.MIN_CHARACTERS) {
|
|
104
|
+
truncatedText = truncatedText.slice(0, -4) + '...';
|
|
105
|
+
tempTextElement.textContent = truncatedText;
|
|
106
|
+
}
|
|
107
|
+
newTruncatedLabels.push(truncatedText);
|
|
108
|
+
maxWidth = Math.max(maxWidth, tempTextElement.getBBox().width);
|
|
109
|
+
});
|
|
110
|
+
document.body.removeChild(tempSvgElement);
|
|
111
|
+
return { labels: newTruncatedLabels, maxWidth: maxWidth };
|
|
112
|
+
};
|
|
113
|
+
exports.truncateLabels = truncateLabels;
|
|
114
|
+
var calculateTicksWidth = function (ticks) {
|
|
115
|
+
var tempSvgElement = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
|
116
|
+
var tempTextElement = document.createElementNS('http://www.w3.org/2000/svg', 'text');
|
|
117
|
+
tempTextElement.setAttribute('font-size', constants_1.AXIS_TICK_LABEL_SIZE);
|
|
118
|
+
tempSvgElement.appendChild(tempTextElement);
|
|
119
|
+
document.body.appendChild(tempSvgElement);
|
|
120
|
+
var maxWidth = ticks.reduce(function (maxWidth, tick) {
|
|
121
|
+
tempTextElement.textContent = String(tick);
|
|
122
|
+
return Math.max(maxWidth, tempTextElement.getBBox().width);
|
|
123
|
+
}, 0);
|
|
124
|
+
document.body.removeChild(tempSvgElement);
|
|
125
|
+
return maxWidth;
|
|
126
|
+
};
|
|
127
|
+
exports.calculateTicksWidth = calculateTicksWidth;
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export declare const useStyles: (props
|
|
1
|
+
export declare const useStyles: (props: {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
}) => import("@mui/styles").ClassNameMap<"svg" | "wrapper">;
|
package/cjs/UpSetChart/styles.js
CHANGED
|
@@ -2,18 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useStyles = void 0;
|
|
4
4
|
var styles_1 = require("@mui/styles");
|
|
5
|
-
exports.useStyles = (0, styles_1.makeStyles)(function (
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
exports.useStyles = (0, styles_1.makeStyles)(function () { return ({
|
|
6
|
+
wrapper: function (_a) {
|
|
7
|
+
var width = _a.width, height = _a.height;
|
|
8
|
+
return ({
|
|
9
|
+
width: width,
|
|
10
|
+
height: height,
|
|
11
|
+
display: 'flex',
|
|
12
|
+
overflow: 'auto'
|
|
13
|
+
});
|
|
8
14
|
},
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
axisTick: {
|
|
13
|
-
fontSize: '12px !important'
|
|
14
|
-
},
|
|
15
|
-
chartLabel: {
|
|
16
|
-
fill: "".concat(theme.palette.text.secondary, " !important"),
|
|
17
|
-
fontSize: '10px !important'
|
|
15
|
+
svg: {
|
|
16
|
+
flexShrink: '0'
|
|
18
17
|
}
|
|
19
18
|
}); });
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type UpSetChartData = {
|
|
2
|
+
name: string;
|
|
3
|
+
sets: string[];
|
|
4
|
+
}[];
|
|
5
|
+
export type Intersection = {
|
|
6
|
+
index: number;
|
|
7
|
+
sets: string[];
|
|
8
|
+
size: number;
|
|
9
|
+
elements: string[];
|
|
10
|
+
};
|
|
11
|
+
export type DataSet = {
|
|
12
|
+
index: number;
|
|
13
|
+
name: string;
|
|
14
|
+
size: number;
|
|
15
|
+
elements: string[];
|
|
16
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DataSet, Intersection } from './types';
|
|
2
|
+
type Props = {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
intersections: Intersection[];
|
|
6
|
+
sets: DataSet[];
|
|
7
|
+
};
|
|
8
|
+
export declare const useUpSetChartSizes: ({ width, height, intersections, sets }: Props) => {
|
|
9
|
+
labels: string[];
|
|
10
|
+
svgWidth: number;
|
|
11
|
+
svgHeight: number;
|
|
12
|
+
intersectionsChartWidth: number;
|
|
13
|
+
intersectionsChartHeight: number;
|
|
14
|
+
matrixY: number;
|
|
15
|
+
matrixHeight: number;
|
|
16
|
+
maxLabelsWidth: number;
|
|
17
|
+
leftPadding: number;
|
|
18
|
+
setsChartWidth: number;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useUpSetChartSizes = void 0;
|
|
4
|
+
var constants_1 = require("./constants");
|
|
5
|
+
var helpers_1 = require("./helpers");
|
|
6
|
+
var useUpSetChartSizes = function (_a) {
|
|
7
|
+
var width = _a.width, height = _a.height, intersections = _a.intersections, sets = _a.sets;
|
|
8
|
+
var minMatrixWidth = intersections.length * constants_1.MIN_MATRIX_COLUMN_WIDTH * 1.2;
|
|
9
|
+
var matrixHeight = sets.length * constants_1.MATRIX_ROW_HEIGHT;
|
|
10
|
+
var availableLabelsWidth = width - minMatrixWidth - constants_1.TEXT_GAP * 2 - constants_1.GAP_BEFORE_LEFT_BAR - constants_1.MIN_SETS_CHART_WIDTH;
|
|
11
|
+
var _b = (0, helpers_1.truncateLabels)(sets, availableLabelsWidth), labels = _b.labels, labelsWidth = _b.maxWidth;
|
|
12
|
+
var availableSetsChartWidth = width - minMatrixWidth - constants_1.TEXT_GAP * 2 - constants_1.GAP_BEFORE_LEFT_BAR - labelsWidth;
|
|
13
|
+
var setsChartWidth = Math.min(Math.max(availableSetsChartWidth, constants_1.MIN_SETS_CHART_WIDTH), constants_1.MAX_SETS_CHART_WIDTH);
|
|
14
|
+
var maxLabelsWidth = width - minMatrixWidth - constants_1.TEXT_GAP * 2 - constants_1.GAP_BEFORE_LEFT_BAR - setsChartWidth;
|
|
15
|
+
var leftPadding = setsChartWidth + labelsWidth + constants_1.TEXT_GAP * 2 + constants_1.GAP_BEFORE_LEFT_BAR;
|
|
16
|
+
var intersectionsChartWidth = Math.max(minMatrixWidth, width - leftPadding);
|
|
17
|
+
var intersectionsChartHeight = Math.max(constants_1.MIN_INTERSECTION_CHART_HEIGHT, height - constants_1.TOP_GAP - matrixHeight - constants_1.GAP_BETWEEN_TABLE_AND_CHART);
|
|
18
|
+
var svgWidth = leftPadding + intersectionsChartWidth;
|
|
19
|
+
var svgHeight = intersectionsChartHeight + matrixHeight + constants_1.TOP_GAP + constants_1.GAP_BETWEEN_TABLE_AND_CHART;
|
|
20
|
+
var matrixY = svgHeight - matrixHeight - 1;
|
|
21
|
+
return {
|
|
22
|
+
labels: labels,
|
|
23
|
+
svgWidth: svgWidth,
|
|
24
|
+
svgHeight: svgHeight,
|
|
25
|
+
intersectionsChartWidth: intersectionsChartWidth,
|
|
26
|
+
intersectionsChartHeight: intersectionsChartHeight,
|
|
27
|
+
matrixY: matrixY,
|
|
28
|
+
matrixHeight: matrixHeight,
|
|
29
|
+
maxLabelsWidth: maxLabelsWidth,
|
|
30
|
+
leftPadding: leftPadding,
|
|
31
|
+
setsChartWidth: setsChartWidth
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
exports.useUpSetChartSizes = useUpSetChartSizes;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Entity, Metadata } from '@reltio/mdm-sdk';
|
|
2
|
+
export declare const createEntity: () => Entity;
|
|
3
|
+
export declare const createMetadata: () => Metadata;
|
|
4
|
+
export declare const selectedAttributeTypes: ({
|
|
5
|
+
description: string;
|
|
6
|
+
label: string;
|
|
7
|
+
name: string;
|
|
8
|
+
type: string;
|
|
9
|
+
uri: string;
|
|
10
|
+
attributes?: undefined;
|
|
11
|
+
access?: undefined;
|
|
12
|
+
referencedAttributeURIs?: undefined;
|
|
13
|
+
} | {
|
|
14
|
+
label: string;
|
|
15
|
+
name: string;
|
|
16
|
+
type: string;
|
|
17
|
+
uri: string;
|
|
18
|
+
attributes: {
|
|
19
|
+
label: string;
|
|
20
|
+
name: string;
|
|
21
|
+
type: string;
|
|
22
|
+
uri: string;
|
|
23
|
+
}[];
|
|
24
|
+
description?: undefined;
|
|
25
|
+
access?: undefined;
|
|
26
|
+
referencedAttributeURIs?: undefined;
|
|
27
|
+
} | {
|
|
28
|
+
label: string;
|
|
29
|
+
name: string;
|
|
30
|
+
access: string[];
|
|
31
|
+
type: string;
|
|
32
|
+
referencedAttributeURIs: string[];
|
|
33
|
+
uri: string;
|
|
34
|
+
description?: undefined;
|
|
35
|
+
attributes?: undefined;
|
|
36
|
+
})[];
|