@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.
Files changed (178) hide show
  1. package/cjs/UpSetChart/UpSetChart.d.ts +5 -8
  2. package/cjs/UpSetChart/UpSetChart.js +61 -5
  3. package/cjs/UpSetChart/UpSetChart.test.js +198 -0
  4. package/cjs/UpSetChart/components/IntersectionsChart/IntersectionsChart.d.ts +15 -0
  5. package/cjs/UpSetChart/components/IntersectionsChart/IntersectionsChart.js +66 -0
  6. package/cjs/UpSetChart/components/IntersectionsChart/index.d.ts +1 -0
  7. package/cjs/UpSetChart/components/IntersectionsChart/index.js +5 -0
  8. package/cjs/UpSetChart/components/IntersectionsChart/styles.d.ts +1 -0
  9. package/cjs/UpSetChart/components/IntersectionsChart/styles.js +32 -0
  10. package/cjs/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.d.ts +10 -0
  11. package/cjs/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.js +64 -0
  12. package/cjs/UpSetChart/components/IntersectionsChartAxis/index.d.ts +1 -0
  13. package/cjs/UpSetChart/components/IntersectionsChartAxis/index.js +5 -0
  14. package/cjs/UpSetChart/components/IntersectionsChartAxis/styles.d.ts +1 -0
  15. package/cjs/UpSetChart/components/IntersectionsChartAxis/styles.js +32 -0
  16. package/cjs/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.d.ts +13 -0
  17. package/cjs/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.js +56 -0
  18. package/cjs/UpSetChart/components/IntersectionsMatrix/index.d.ts +1 -0
  19. package/cjs/UpSetChart/components/IntersectionsMatrix/index.js +5 -0
  20. package/cjs/UpSetChart/components/IntersectionsMatrix/styles.d.ts +1 -0
  21. package/cjs/UpSetChart/components/IntersectionsMatrix/styles.js +27 -0
  22. package/cjs/UpSetChart/components/SetsChart/SetsChart.d.ts +15 -0
  23. package/cjs/UpSetChart/components/SetsChart/SetsChart.js +58 -0
  24. package/cjs/UpSetChart/components/SetsChart/index.d.ts +1 -0
  25. package/cjs/UpSetChart/components/SetsChart/index.js +5 -0
  26. package/cjs/UpSetChart/components/SetsChart/styles.d.ts +1 -0
  27. package/cjs/UpSetChart/components/SetsChart/styles.js +43 -0
  28. package/cjs/UpSetChart/components/SetsChartAxis/SetsChartAxis.d.ts +6 -0
  29. package/cjs/UpSetChart/components/SetsChartAxis/SetsChartAxis.js +20 -0
  30. package/cjs/UpSetChart/components/SetsChartAxis/index.d.ts +1 -0
  31. package/cjs/UpSetChart/components/SetsChartAxis/index.js +5 -0
  32. package/cjs/UpSetChart/components/SetsChartAxis/styles.d.ts +1 -0
  33. package/cjs/UpSetChart/components/SetsChartAxis/styles.js +17 -0
  34. package/cjs/UpSetChart/constants.d.ts +16 -3
  35. package/cjs/UpSetChart/constants.js +20 -4
  36. package/cjs/UpSetChart/gameOfThrones.test-data.d.ts +4 -0
  37. package/cjs/UpSetChart/gameOfThrones.test-data.js +26 -0
  38. package/cjs/UpSetChart/helpers.d.ts +20 -0
  39. package/cjs/UpSetChart/helpers.js +127 -0
  40. package/cjs/UpSetChart/styles.d.ts +4 -1
  41. package/cjs/UpSetChart/styles.js +11 -12
  42. package/cjs/UpSetChart/types.d.ts +16 -0
  43. package/cjs/UpSetChart/types.js +2 -0
  44. package/cjs/UpSetChart/useUpSetChartSizes.d.ts +20 -0
  45. package/cjs/UpSetChart/useUpSetChartSizes.js +34 -0
  46. package/cjs/features/crosswalks/AttributesTable/AttributesTable.test-data.d.ts +36 -0
  47. package/cjs/features/crosswalks/AttributesTable/AttributesTable.test-data.js +288 -0
  48. package/cjs/features/crosswalks/AttributesTable/AttributesTable.test.js +708 -370
  49. package/cjs/features/crosswalks/ColoredBlock/ColoredBlock.test.js +77 -15
  50. package/cjs/features/crosswalks/CopyableValueField/CopyableValueField.test.js +85 -15
  51. package/cjs/features/crosswalks/CrosswalkAttributes/CrosswalkAttributes.test.js +265 -193
  52. package/cjs/features/crosswalks/CrosswalkDateEditor/CrosswalkDateEditor.test.js +106 -12
  53. package/cjs/features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.test.js +21 -9
  54. package/cjs/features/crosswalks/CrosswalkEditor/CrosswalkEditor.test.js +190 -90
  55. package/cjs/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +323 -225
  56. package/cjs/features/crosswalks/ShowDependentLink/ShowDependentLink.test.js +75 -12
  57. package/cjs/features/crosswalks/SourceCrosswalksRow/SourceCrosswalksRow.test.js +171 -138
  58. package/esm/UpSetChart/UpSetChart.d.ts +5 -8
  59. package/esm/UpSetChart/UpSetChart.js +38 -5
  60. package/esm/UpSetChart/UpSetChart.test.js +193 -0
  61. package/esm/UpSetChart/components/IntersectionsChart/IntersectionsChart.d.ts +15 -0
  62. package/esm/UpSetChart/components/IntersectionsChart/IntersectionsChart.js +39 -0
  63. package/esm/UpSetChart/components/IntersectionsChart/index.d.ts +1 -0
  64. package/esm/UpSetChart/components/IntersectionsChart/index.js +1 -0
  65. package/esm/UpSetChart/components/IntersectionsChart/styles.d.ts +1 -0
  66. package/esm/UpSetChart/components/IntersectionsChart/styles.js +29 -0
  67. package/esm/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.d.ts +10 -0
  68. package/esm/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.js +34 -0
  69. package/esm/UpSetChart/components/IntersectionsChartAxis/index.d.ts +1 -0
  70. package/esm/UpSetChart/components/IntersectionsChartAxis/index.js +1 -0
  71. package/esm/UpSetChart/components/IntersectionsChartAxis/styles.d.ts +1 -0
  72. package/esm/UpSetChart/components/IntersectionsChartAxis/styles.js +29 -0
  73. package/esm/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.d.ts +13 -0
  74. package/esm/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.js +26 -0
  75. package/esm/UpSetChart/components/IntersectionsMatrix/index.d.ts +1 -0
  76. package/esm/UpSetChart/components/IntersectionsMatrix/index.js +1 -0
  77. package/esm/UpSetChart/components/IntersectionsMatrix/styles.d.ts +1 -0
  78. package/esm/UpSetChart/components/IntersectionsMatrix/styles.js +24 -0
  79. package/esm/UpSetChart/components/SetsChart/SetsChart.d.ts +15 -0
  80. package/esm/UpSetChart/components/SetsChart/SetsChart.js +31 -0
  81. package/esm/UpSetChart/components/SetsChart/index.d.ts +1 -0
  82. package/esm/UpSetChart/components/SetsChart/index.js +1 -0
  83. package/esm/UpSetChart/components/SetsChart/styles.d.ts +1 -0
  84. package/esm/UpSetChart/components/SetsChart/styles.js +40 -0
  85. package/esm/UpSetChart/components/SetsChartAxis/SetsChartAxis.d.ts +6 -0
  86. package/esm/UpSetChart/components/SetsChartAxis/SetsChartAxis.js +13 -0
  87. package/esm/UpSetChart/components/SetsChartAxis/index.d.ts +1 -0
  88. package/esm/UpSetChart/components/SetsChartAxis/index.js +1 -0
  89. package/esm/UpSetChart/components/SetsChartAxis/styles.d.ts +1 -0
  90. package/esm/UpSetChart/components/SetsChartAxis/styles.js +14 -0
  91. package/esm/UpSetChart/constants.d.ts +16 -3
  92. package/esm/UpSetChart/constants.js +19 -3
  93. package/esm/UpSetChart/gameOfThrones.test-data.d.ts +4 -0
  94. package/esm/UpSetChart/gameOfThrones.test-data.js +23 -0
  95. package/esm/UpSetChart/helpers.d.ts +20 -0
  96. package/esm/UpSetChart/helpers.js +120 -0
  97. package/esm/UpSetChart/styles.d.ts +4 -1
  98. package/esm/UpSetChart/styles.js +11 -12
  99. package/esm/UpSetChart/types.d.ts +16 -0
  100. package/esm/UpSetChart/useUpSetChartSizes.d.ts +20 -0
  101. package/esm/UpSetChart/useUpSetChartSizes.js +30 -0
  102. package/esm/features/crosswalks/AttributesTable/AttributesTable.test-data.d.ts +36 -0
  103. package/esm/features/crosswalks/AttributesTable/AttributesTable.test-data.js +283 -0
  104. package/esm/features/crosswalks/AttributesTable/AttributesTable.test.js +711 -350
  105. package/esm/features/crosswalks/ColoredBlock/ColoredBlock.test.js +77 -15
  106. package/esm/features/crosswalks/CopyableValueField/CopyableValueField.test.js +85 -15
  107. package/esm/features/crosswalks/CrosswalkAttributes/CrosswalkAttributes.test.js +266 -194
  108. package/esm/features/crosswalks/CrosswalkDateEditor/CrosswalkDateEditor.test.js +106 -12
  109. package/esm/features/crosswalks/CrosswalkDragLayer/CrosswalkDragLayer.test.js +21 -9
  110. package/esm/features/crosswalks/CrosswalkEditor/CrosswalkEditor.test.js +190 -90
  111. package/esm/features/crosswalks/CrosswalkRow/CrosswalkRow.test.js +324 -226
  112. package/esm/features/crosswalks/ShowDependentLink/ShowDependentLink.test.js +75 -12
  113. package/esm/features/crosswalks/SourceCrosswalksRow/SourceCrosswalksRow.test.js +171 -138
  114. package/package.json +1 -1
  115. package/cjs/features/crosswalks/AttributesTable/IntegrationAttributesTable.test-data.d.ts +0 -3
  116. package/cjs/features/crosswalks/AttributesTable/IntegrationAttributesTable.test-data.js +0 -52
  117. package/cjs/features/crosswalks/AttributesTable/IntegrationAttributesTable.test.js +0 -323
  118. package/cjs/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.js +0 -142
  119. package/cjs/features/crosswalks/AttributesTable/components/AttributeValuesRenderer/AttributeValuesRenderer.test.js +0 -146
  120. package/cjs/features/crosswalks/AttributesTable/components/AttributesHeadCellRenderer/AttributesHeadCellRenderer.test.d.ts +0 -1
  121. package/cjs/features/crosswalks/AttributesTable/components/AttributesHeadCellRenderer/AttributesHeadCellRenderer.test.js +0 -50
  122. package/cjs/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.d.ts +0 -1
  123. package/cjs/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.js +0 -58
  124. package/cjs/features/crosswalks/AttributesTable/components/CountRenderer/CountRenderer.test.d.ts +0 -1
  125. package/cjs/features/crosswalks/AttributesTable/components/CountRenderer/CountRenderer.test.js +0 -14
  126. package/cjs/features/crosswalks/AttributesTable/components/ImageAttributesRenderer/ImageAttributesRenderer.test.d.ts +0 -1
  127. package/cjs/features/crosswalks/AttributesTable/components/ImageAttributesRenderer/ImageAttributesRenderer.test.js +0 -110
  128. package/cjs/features/crosswalks/AttributesTable/components/NestedAttributesRenderer/NestedAttributesRenderer.test.d.ts +0 -1
  129. package/cjs/features/crosswalks/AttributesTable/components/NestedAttributesRenderer/NestedAttributesRenderer.test.js +0 -111
  130. package/cjs/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.test.d.ts +0 -1
  131. package/cjs/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.test.js +0 -67
  132. package/cjs/features/crosswalks/AttributesTable/components/ReferenceAttributesRenderer/ReferenceAttributesRenderer.test.d.ts +0 -1
  133. package/cjs/features/crosswalks/AttributesTable/components/ReferenceAttributesRenderer/ReferenceAttributesRenderer.test.js +0 -193
  134. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.test.d.ts +0 -1
  135. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.test.js +0 -22
  136. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.test.d.ts +0 -1
  137. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.test.js +0 -58
  138. package/cjs/features/crosswalks/AttributesTable/components/SimpleAttributesRenderer/SimpleAttributesRenderer.test.d.ts +0 -1
  139. package/cjs/features/crosswalks/AttributesTable/components/SimpleAttributesRenderer/SimpleAttributesRenderer.test.js +0 -69
  140. package/cjs/features/crosswalks/CrosswalkDateEditor/IntegrationCrosswalkDateEditor.test.d.ts +0 -1
  141. package/cjs/features/crosswalks/CrosswalkDateEditor/IntegrationCrosswalkDateEditor.test.js +0 -137
  142. package/cjs/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.test.d.ts +0 -1
  143. package/cjs/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.test.js +0 -56
  144. package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test-data.d.ts +0 -3
  145. package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test-data.js +0 -47
  146. package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test.d.ts +0 -1
  147. package/esm/features/crosswalks/AttributesTable/IntegrationAttributesTable.test.js +0 -318
  148. package/esm/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.d.ts +0 -1
  149. package/esm/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.js +0 -137
  150. package/esm/features/crosswalks/AttributesTable/components/AttributeValuesRenderer/AttributeValuesRenderer.test.d.ts +0 -1
  151. package/esm/features/crosswalks/AttributesTable/components/AttributeValuesRenderer/AttributeValuesRenderer.test.js +0 -141
  152. package/esm/features/crosswalks/AttributesTable/components/AttributesHeadCellRenderer/AttributesHeadCellRenderer.test.d.ts +0 -1
  153. package/esm/features/crosswalks/AttributesTable/components/AttributesHeadCellRenderer/AttributesHeadCellRenderer.test.js +0 -45
  154. package/esm/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.d.ts +0 -1
  155. package/esm/features/crosswalks/AttributesTable/components/ConfirmEditIgnoredDialog/ConfirmEditIgnoredDialog.test.js +0 -53
  156. package/esm/features/crosswalks/AttributesTable/components/CountRenderer/CountRenderer.test.d.ts +0 -1
  157. package/esm/features/crosswalks/AttributesTable/components/CountRenderer/CountRenderer.test.js +0 -9
  158. package/esm/features/crosswalks/AttributesTable/components/ImageAttributesRenderer/ImageAttributesRenderer.test.d.ts +0 -1
  159. package/esm/features/crosswalks/AttributesTable/components/ImageAttributesRenderer/ImageAttributesRenderer.test.js +0 -105
  160. package/esm/features/crosswalks/AttributesTable/components/NestedAttributesRenderer/NestedAttributesRenderer.test.d.ts +0 -1
  161. package/esm/features/crosswalks/AttributesTable/components/NestedAttributesRenderer/NestedAttributesRenderer.test.js +0 -106
  162. package/esm/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.test.d.ts +0 -1
  163. package/esm/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.test.js +0 -62
  164. package/esm/features/crosswalks/AttributesTable/components/ReferenceAttributesRenderer/ReferenceAttributesRenderer.test.d.ts +0 -1
  165. package/esm/features/crosswalks/AttributesTable/components/ReferenceAttributesRenderer/ReferenceAttributesRenderer.test.js +0 -188
  166. package/esm/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.test.d.ts +0 -1
  167. package/esm/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.test.js +0 -17
  168. package/esm/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.test.d.ts +0 -1
  169. package/esm/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.test.js +0 -53
  170. package/esm/features/crosswalks/AttributesTable/components/SimpleAttributesRenderer/SimpleAttributesRenderer.test.d.ts +0 -1
  171. package/esm/features/crosswalks/AttributesTable/components/SimpleAttributesRenderer/SimpleAttributesRenderer.test.js +0 -64
  172. package/esm/features/crosswalks/CrosswalkDateEditor/IntegrationCrosswalkDateEditor.test.d.ts +0 -1
  173. package/esm/features/crosswalks/CrosswalkDateEditor/IntegrationCrosswalkDateEditor.test.js +0 -132
  174. package/esm/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.test.d.ts +0 -1
  175. package/esm/features/crosswalks/CrosswalkDragLayer/components/CrosswalkDragPreview/CrosswalkDragPreview.test.js +0 -28
  176. /package/cjs/{features/crosswalks/AttributesTable/IntegrationAttributesTable.test.d.ts → UpSetChart/UpSetChart.test.d.ts} +0 -0
  177. /package/{cjs/features/crosswalks/AttributesTable/components/AddAttributesButton/AddAttributesButton.test.d.ts → esm/UpSetChart/UpSetChart.test.d.ts} +0 -0
  178. /package/{cjs/features/crosswalks/AttributesTable/components/AttributeValuesRenderer/AttributeValuesRenderer.test.d.ts → esm/UpSetChart/types.js} +0 -0
@@ -1,4 +1,20 @@
1
- export var NOT_MEMBER_COLOR = 'rgb(238, 238, 238)';
2
- export var PRIMARY_COLOR = 'rgb(0, 0, 102)';
3
- export var SECONDARY_COLOR = 'rgba(0, 0, 102, 0.2)';
1
+ // Colors
2
+ export var PRIMARY_COLOR = '#000066';
3
+ export var DIMMED_COLOR = '#CCCCE0';
4
4
  export var TEXT_COLOR = 'rgba(0, 0, 0, 0.87)';
5
+ // Gaps
6
+ export var TOP_GAP = 24;
7
+ export var TEXT_GAP = 16;
8
+ export var GAP_BETWEEN_TABLE_AND_CHART = 8;
9
+ export var GAP_BEFORE_LEFT_BAR = 12;
10
+ // Sizes
11
+ export var AXIS_TICK_LABEL_SIZE = '12px';
12
+ export var SET_LABEL_SIZE = '13px';
13
+ export var SET_BAR_HEIGHT = 12;
14
+ export var MATRIX_ROW_HEIGHT = 29;
15
+ export var MIN_MATRIX_COLUMN_WIDTH = 28;
16
+ export var MIN_INTERSECTION_CHART_HEIGHT = 120;
17
+ export var MIN_SETS_CHART_WIDTH = 100;
18
+ export var MAX_SETS_CHART_WIDTH = 200;
19
+ export var MAX_CHARACTERS = 20;
20
+ export var MIN_CHARACTERS = 8;
@@ -0,0 +1,4 @@
1
+ export declare const gameOfThronesData: {
2
+ name: string;
3
+ sets: string[];
4
+ }[];
@@ -0,0 +1,23 @@
1
+ export var gameOfThronesData = [
2
+ { name: 'Alton Lannister', sets: ['was killed', 'Lannister', 'male'] },
3
+ { name: 'Arya Stark', sets: ['Stark', 'female'] },
4
+ { name: 'Bran Stark', sets: ['royal', 'Stark', 'male'] },
5
+ { name: 'Benjen Stark', sets: ['was killed', 'Stark', 'male'] },
6
+ { name: 'Brandon Stark', sets: ['was killed', 'Stark'] },
7
+ { name: 'Catelyn Stark', sets: ['was killed', 'Stark', 'female'] },
8
+ { name: 'Cersei Lannister', sets: ['royal', 'was killed', 'Lannister', 'female'] },
9
+ { name: 'Eddard Stark', sets: ['was killed', 'Stark', 'male'] },
10
+ { name: 'Jaime Lannister', sets: ['was killed', 'Lannister', 'male'] },
11
+ { name: 'Jon Snow', sets: ['royal', 'was killed', 'Stark', 'male'] },
12
+ { name: 'Kevan Lannister', sets: ['was killed', 'Lannister', 'male'] },
13
+ { name: 'Lancel Lannister', sets: ['was killed', 'Lannister', 'male'] },
14
+ { name: 'Lyanna Stark', sets: ['was killed', 'Stark', 'female'] },
15
+ { name: 'Martyn Lannister', sets: ['was killed', 'Lannister', 'male'] },
16
+ { name: 'Rickard Stark', sets: ['was killed', 'Stark', 'male'] },
17
+ { name: 'Rickon Stark', sets: ['was killed', 'Stark', 'male'] },
18
+ { name: 'Robb Stark', sets: ['royal', 'was killed', 'Stark', 'male'] },
19
+ { name: 'Sansa Stark', sets: ['royal', 'Stark', 'female'] },
20
+ { name: 'Tyrion Lannister', sets: ['Lannister', 'male'] },
21
+ { name: 'Tywin Lannister', sets: ['was killed', 'Lannister', 'male'] },
22
+ { name: 'Willem Lannister', sets: ['was killed', 'Lannister', 'male'] }
23
+ ];
@@ -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,120 @@
1
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
2
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3
+ if (ar || !(i in from)) {
4
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
5
+ ar[i] = from[i];
6
+ }
7
+ }
8
+ return to.concat(ar || Array.prototype.slice.call(from));
9
+ };
10
+ import { AXIS_TICK_LABEL_SIZE, MAX_CHARACTERS, MIN_CHARACTERS, SET_LABEL_SIZE } from './constants';
11
+ export var findIntersections = function (data) {
12
+ var setsCombinations = {};
13
+ var individualSets = {};
14
+ data.forEach(function (_a) {
15
+ var name = _a.name, sets = _a.sets;
16
+ sets.forEach(function (set) {
17
+ if (!individualSets[set]) {
18
+ individualSets[set] = [];
19
+ }
20
+ individualSets[set].push(name);
21
+ });
22
+ var generateCombinations = function (subset, index) {
23
+ if (index === sets.length) {
24
+ if (subset.length > 0) {
25
+ var key = subset.sort().join(',');
26
+ if (!setsCombinations[key]) {
27
+ setsCombinations[key] = [];
28
+ }
29
+ setsCombinations[key].push(name);
30
+ }
31
+ return;
32
+ }
33
+ generateCombinations(subset, index + 1);
34
+ generateCombinations(__spreadArray(__spreadArray([], subset, true), [sets[index]], false), index + 1);
35
+ };
36
+ generateCombinations([], 0);
37
+ });
38
+ var intersections = Object.entries(setsCombinations)
39
+ .map(function (_a, index) {
40
+ var key = _a[0], elements = _a[1];
41
+ return ({
42
+ index: index,
43
+ sets: key.split(','),
44
+ size: elements.length,
45
+ elements: elements
46
+ });
47
+ })
48
+ .sort(function (a, b) { return b.size - a.size; });
49
+ var sets = Object.entries(individualSets).map(function (_a, index) {
50
+ var name = _a[0], elements = _a[1];
51
+ return ({
52
+ index: index,
53
+ name: name,
54
+ size: elements.length,
55
+ elements: elements
56
+ });
57
+ });
58
+ return { intersections: intersections, sets: sets };
59
+ };
60
+ export var getMatrixData = function (xScale, yScale, intersections, sets) {
61
+ var circles = intersections.flatMap(function (intersection, i) {
62
+ return sets.map(function (set) { return ({
63
+ cx: xScale(String(i)) + xScale.bandwidth() / 2,
64
+ cy: yScale(set.name) + yScale.bandwidth() / 2,
65
+ isPresent: intersection.sets.includes(set.name),
66
+ intersectionIndex: intersection.index
67
+ }); });
68
+ });
69
+ var lines = intersections.reduce(function (acc, intersection, i) {
70
+ var activeSetIndices = intersection.sets
71
+ .map(function (name) { return sets.findIndex(function (set) { return set.name === name; }); })
72
+ .filter(function (i) { return i >= 0; })
73
+ .sort(function (a, b) { return a - b; });
74
+ if (activeSetIndices.length > 1) {
75
+ var firstIdx = activeSetIndices[0];
76
+ var lastIdx = activeSetIndices[activeSetIndices.length - 1];
77
+ var x = xScale(String(i)) + xScale.bandwidth() / 2;
78
+ var y1 = yScale(sets[firstIdx].name) + yScale.bandwidth() / 2;
79
+ var y2 = yScale(sets[lastIdx].name) + yScale.bandwidth() / 2;
80
+ return __spreadArray(__spreadArray([], acc, true), [{ x: x, y1: y1, y2: y2, intersectionIndex: intersection.index }], false);
81
+ }
82
+ return acc;
83
+ }, []);
84
+ return { circles: circles, lines: lines };
85
+ };
86
+ export var truncateLabels = function (sets, maxLabelsWidth) {
87
+ var newTruncatedLabels = [];
88
+ var maxWidth = 0;
89
+ var tempSvgElement = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
90
+ document.body.appendChild(tempSvgElement);
91
+ var tempTextElement = document.createElementNS('http://www.w3.org/2000/svg', 'text');
92
+ tempTextElement.setAttribute('font-size', SET_LABEL_SIZE);
93
+ tempSvgElement.appendChild(tempTextElement);
94
+ sets.forEach(function (_a) {
95
+ var name = _a.name;
96
+ var truncatedText = name.length > MAX_CHARACTERS ? name.slice(0, MAX_CHARACTERS) + '...' : name;
97
+ tempTextElement.textContent = truncatedText;
98
+ while (tempTextElement.getBBox().width > maxLabelsWidth && truncatedText.length > MIN_CHARACTERS) {
99
+ truncatedText = truncatedText.slice(0, -4) + '...';
100
+ tempTextElement.textContent = truncatedText;
101
+ }
102
+ newTruncatedLabels.push(truncatedText);
103
+ maxWidth = Math.max(maxWidth, tempTextElement.getBBox().width);
104
+ });
105
+ document.body.removeChild(tempSvgElement);
106
+ return { labels: newTruncatedLabels, maxWidth: maxWidth };
107
+ };
108
+ export var calculateTicksWidth = function (ticks) {
109
+ var tempSvgElement = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
110
+ var tempTextElement = document.createElementNS('http://www.w3.org/2000/svg', 'text');
111
+ tempTextElement.setAttribute('font-size', AXIS_TICK_LABEL_SIZE);
112
+ tempSvgElement.appendChild(tempTextElement);
113
+ document.body.appendChild(tempSvgElement);
114
+ var maxWidth = ticks.reduce(function (maxWidth, tick) {
115
+ tempTextElement.textContent = String(tick);
116
+ return Math.max(maxWidth, tempTextElement.getBBox().width);
117
+ }, 0);
118
+ document.body.removeChild(tempSvgElement);
119
+ return maxWidth;
120
+ };
@@ -1 +1,4 @@
1
- export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"setLabel" | "barLabel" | "axisTick" | "chartLabel">;
1
+ export declare const useStyles: (props: {
2
+ width: number;
3
+ height: number;
4
+ }) => import("@mui/styles").ClassNameMap<"svg" | "wrapper">;
@@ -1,16 +1,15 @@
1
1
  import { makeStyles } from '@mui/styles';
2
- export var useStyles = makeStyles(function (theme) { return ({
3
- setLabel: {
4
- fontSize: '13px !important'
2
+ export var useStyles = makeStyles(function () { return ({
3
+ wrapper: function (_a) {
4
+ var width = _a.width, height = _a.height;
5
+ return ({
6
+ width: width,
7
+ height: height,
8
+ display: 'flex',
9
+ overflow: 'auto'
10
+ });
5
11
  },
6
- barLabel: {
7
- fontSize: '12px !important'
8
- },
9
- axisTick: {
10
- fontSize: '12px !important'
11
- },
12
- chartLabel: {
13
- fill: "".concat(theme.palette.text.secondary, " !important"),
14
- fontSize: '10px !important'
12
+ svg: {
13
+ flexShrink: '0'
15
14
  }
16
15
  }); });
@@ -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,30 @@
1
+ import { GAP_BEFORE_LEFT_BAR, GAP_BETWEEN_TABLE_AND_CHART, MATRIX_ROW_HEIGHT, MAX_SETS_CHART_WIDTH, MIN_INTERSECTION_CHART_HEIGHT, MIN_MATRIX_COLUMN_WIDTH, MIN_SETS_CHART_WIDTH, TEXT_GAP, TOP_GAP } from './constants';
2
+ import { truncateLabels } from './helpers';
3
+ export var useUpSetChartSizes = function (_a) {
4
+ var width = _a.width, height = _a.height, intersections = _a.intersections, sets = _a.sets;
5
+ var minMatrixWidth = intersections.length * MIN_MATRIX_COLUMN_WIDTH * 1.2;
6
+ var matrixHeight = sets.length * MATRIX_ROW_HEIGHT;
7
+ var availableLabelsWidth = width - minMatrixWidth - TEXT_GAP * 2 - GAP_BEFORE_LEFT_BAR - MIN_SETS_CHART_WIDTH;
8
+ var _b = truncateLabels(sets, availableLabelsWidth), labels = _b.labels, labelsWidth = _b.maxWidth;
9
+ var availableSetsChartWidth = width - minMatrixWidth - TEXT_GAP * 2 - GAP_BEFORE_LEFT_BAR - labelsWidth;
10
+ var setsChartWidth = Math.min(Math.max(availableSetsChartWidth, MIN_SETS_CHART_WIDTH), MAX_SETS_CHART_WIDTH);
11
+ var maxLabelsWidth = width - minMatrixWidth - TEXT_GAP * 2 - GAP_BEFORE_LEFT_BAR - setsChartWidth;
12
+ var leftPadding = setsChartWidth + labelsWidth + TEXT_GAP * 2 + GAP_BEFORE_LEFT_BAR;
13
+ var intersectionsChartWidth = Math.max(minMatrixWidth, width - leftPadding);
14
+ var intersectionsChartHeight = Math.max(MIN_INTERSECTION_CHART_HEIGHT, height - TOP_GAP - matrixHeight - GAP_BETWEEN_TABLE_AND_CHART);
15
+ var svgWidth = leftPadding + intersectionsChartWidth;
16
+ var svgHeight = intersectionsChartHeight + matrixHeight + TOP_GAP + GAP_BETWEEN_TABLE_AND_CHART;
17
+ var matrixY = svgHeight - matrixHeight - 1;
18
+ return {
19
+ labels: labels,
20
+ svgWidth: svgWidth,
21
+ svgHeight: svgHeight,
22
+ intersectionsChartWidth: intersectionsChartWidth,
23
+ intersectionsChartHeight: intersectionsChartHeight,
24
+ matrixY: matrixY,
25
+ matrixHeight: matrixHeight,
26
+ maxLabelsWidth: maxLabelsWidth,
27
+ leftPadding: leftPadding,
28
+ setsChartWidth: setsChartWidth
29
+ };
30
+ };
@@ -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
+ })[];
@@ -0,0 +1,283 @@
1
+ export var createEntity = function () {
2
+ return {
3
+ uri: 'entities/01L2n5z',
4
+ type: 'configuration/entityTypes/HCP',
5
+ label: 'entity label',
6
+ attributes: {
7
+ Boolean: [
8
+ {
9
+ ov: true,
10
+ type: 'configuration/entityTypes/HCP/attributes/Boolean',
11
+ uri: 'entities/01L2n5z/attributes/Boolean/5nmc3Cp',
12
+ value: 'true'
13
+ }
14
+ ],
15
+ TextField: [
16
+ {
17
+ ov: true,
18
+ type: 'configuration/entityTypes/HCP/attributes/TextField',
19
+ uri: 'entities/01L2n5z/attributes/TextField/5noU1aB',
20
+ value: 'text field value'
21
+ },
22
+ {
23
+ ov: false,
24
+ type: 'configuration/entityTypes/HCP/attributes/TextField',
25
+ uri: 'entities/01L2n5z/attributes/TextField/5noU1aB',
26
+ value: 'another text value',
27
+ ignored: true
28
+ }
29
+ ],
30
+ DeepNested: [
31
+ {
32
+ label: 'Nested Label',
33
+ value: {
34
+ FirstLevelNestedSub1: [
35
+ {
36
+ type: 'configuration/entityTypes/HCP/attributes/DeepNested/attributes/FirstLevelNestedSub1',
37
+ ov: true,
38
+ value: '123',
39
+ uri: 'entities/01L2n5z/attributes/DeepNested/1ZAtO4T6/FirstLevelNestedSub1/1ZAtO8jM'
40
+ }
41
+ ]
42
+ },
43
+ ov: true,
44
+ uri: 'entities/01L2n5z/attributes/DeepNested/1ZAtO4T6'
45
+ }
46
+ ],
47
+ Address: [
48
+ {
49
+ label: 'Reference Address',
50
+ relationshipLabel: 'new address',
51
+ refEntity: {
52
+ objectURI: 'entities/2EpaVt0k',
53
+ type: 'configuration/entityTypes/Location',
54
+ crosswalks: []
55
+ },
56
+ refRelation: {
57
+ objectURI: 'relations/1GrMXM4O',
58
+ type: 'configuration/relationTypes/HasAddress',
59
+ crosswalks: []
60
+ },
61
+ uri: 'entities/2Vek4DnE/attributes/Address/1GrMXM4O',
62
+ value: {
63
+ AddressLine1: [
64
+ {
65
+ ov: true,
66
+ type: 'configuration/entityTypes/Location/attributes/AddressLine1',
67
+ uri: 'entities/2Vek4DnE/attributes/Address/1GrMXM4O/AddressLine1/2GcBL4K00',
68
+ value: 'address line 1 value'
69
+ }
70
+ ]
71
+ },
72
+ startObjectCrosswalks: []
73
+ }
74
+ ],
75
+ ImageGallery: [
76
+ {
77
+ label: '',
78
+ value: {
79
+ UrlThumbnail: [
80
+ {
81
+ type: 'configuration/entityTypes/HCP/attributes/ImageGallery/attributes/UrlThumbnail',
82
+ ov: true,
83
+ value: 'https://s3.amazonaws.com/reltio.qa.ih/thumbnailInew/5iWrjreLxiT2avDKoX3fQmqCu.png',
84
+ uri: 'entities/01L2n5z/attributes/ImageGallery/1IozCV9I/UrlThumbnail/1IozCdfo'
85
+ }
86
+ ]
87
+ },
88
+ ov: true,
89
+ uri: 'entities/01L2n5z/attributes/ImageGallery/1IozCV9I'
90
+ }
91
+ ]
92
+ },
93
+ crosswalks: [
94
+ {
95
+ attributes: [
96
+ 'entities/01L2n5z/attributes/TextField/5noU1aB',
97
+ 'entities/01L2n5z/attributes/Boolean/5nmc3Cp'
98
+ ],
99
+ type: 'configuration/sources/Reltio',
100
+ uri: 'entities/01L2n5z/crosswalks/7F10sMx',
101
+ value: '01L2n5z'
102
+ }
103
+ ]
104
+ };
105
+ };
106
+ export var createMetadata = function () {
107
+ return {
108
+ entityTypes: [
109
+ {
110
+ uri: 'configuration/entityTypes/HCP',
111
+ label: 'HCP',
112
+ attributes: [
113
+ {
114
+ label: 'Boolean',
115
+ name: 'Boolean',
116
+ type: 'Boolean',
117
+ uri: 'configuration/entityTypes/HCP/attributes/Boolean'
118
+ },
119
+ {
120
+ label: 'String Label',
121
+ name: 'TextField',
122
+ type: 'String',
123
+ uri: 'configuration/entityTypes/HCP/attributes/TextField'
124
+ },
125
+ {
126
+ label: 'Affiliated with',
127
+ name: 'affiliatedwith',
128
+ type: 'String',
129
+ uri: 'configuration/entityTypes/HCP/attributes/affiliatedwith',
130
+ hidden: true
131
+ },
132
+ {
133
+ label: 'String Label 2',
134
+ name: 'TextField 2',
135
+ type: 'String',
136
+ uri: 'configuration/entityTypes/HCP/attributes/TextField2'
137
+ },
138
+ {
139
+ label: 'Hidden',
140
+ name: 'Hidden',
141
+ type: 'String',
142
+ uri: 'configuration/entityTypes/HCP/attributes/Hidden',
143
+ hidden: true
144
+ },
145
+ {
146
+ label: 'Nested',
147
+ name: 'Nested',
148
+ type: 'Nested',
149
+ uri: 'configuration/entityTypes/HCP/attributes/Nested'
150
+ },
151
+ {
152
+ label: 'Nested attribute',
153
+ name: 'DeepNested',
154
+ type: 'Nested',
155
+ uri: 'configuration/entityTypes/HCP/attributes/DeepNested'
156
+ },
157
+ {
158
+ label: 'Reference',
159
+ name: 'Reference',
160
+ type: 'Reference',
161
+ uri: 'configuration/entityTypes/HCP/attributes/Reference'
162
+ },
163
+ {
164
+ label: 'Image',
165
+ name: 'Image',
166
+ type: 'Image',
167
+ uri: 'configuration/entityTypes/HCP/attributes/Image'
168
+ }
169
+ ],
170
+ survivorshipGroups: [
171
+ {
172
+ uri: 'configuration/entityTypes/HCP/survivorshipGroups/default',
173
+ default: true,
174
+ mapping: [
175
+ {
176
+ attribute: 'configuration/entityTypes/HCP/attributes/TextField',
177
+ survivorshipStrategy: 'LUD'
178
+ },
179
+ {
180
+ attribute: 'configuration/entityTypes/HCP/attributes/Boolean',
181
+ survivorshipStrategy: 'Frequency'
182
+ },
183
+ {
184
+ attribute: 'configuration/entityTypes/HCP/attributes/DeepNested',
185
+ survivorshipStrategy: 'SRC_SYS'
186
+ },
187
+ {
188
+ attribute: 'configuration/entityTypes/HCP/attributes/ImageGallery',
189
+ primaryAttributeUri: 'configuration/entityTypes/HCP/attributes/OtherAttributeWinner',
190
+ survivorshipStrategy: 'OtherAttributeWinnerCrosswalk'
191
+ },
192
+ {
193
+ attribute: 'configuration/entityTypes/Location/attributes/Address',
194
+ comparisonAttributeUri: 'configuration/relationTypes/HasAddress/attributes/Status',
195
+ survivorshipStrategy: 'MinValue'
196
+ }
197
+ ]
198
+ }
199
+ ]
200
+ }
201
+ ],
202
+ survivorshipStrategies: [
203
+ {
204
+ uri: 'configuration/survivorshipStrategies/LUD',
205
+ label: 'Recency'
206
+ },
207
+ {
208
+ uri: 'configuration/survivorshipStrategies/Frequency',
209
+ label: 'Frequency'
210
+ },
211
+ {
212
+ uri: 'configuration/survivorshipStrategies/SRC_SYS',
213
+ label: 'Source system'
214
+ },
215
+ {
216
+ uri: 'configuration/survivorshipStrategies/OtherAttributeWinnerCrosswalk',
217
+ label: 'Other Attribute Winner Crosswalk'
218
+ },
219
+ {
220
+ uri: 'configuration/survivorshipStrategies/MinValue',
221
+ label: 'Minimum value'
222
+ }
223
+ ],
224
+ sources: [
225
+ {
226
+ uri: 'configuration/sources/Reltio',
227
+ label: 'Reltio'
228
+ }
229
+ ]
230
+ };
231
+ };
232
+ export var selectedAttributeTypes = [
233
+ {
234
+ description: 'String Attribute',
235
+ label: 'String Label',
236
+ name: 'TextField',
237
+ type: 'String',
238
+ uri: 'configuration/entityTypes/HCP/attributes/TextField'
239
+ },
240
+ {
241
+ description: 'Yes or No',
242
+ label: 'Boolean',
243
+ name: 'Boolean',
244
+ type: 'Boolean',
245
+ uri: 'configuration/entityTypes/HCP/attributes/Boolean'
246
+ },
247
+ {
248
+ label: 'Nested attribute',
249
+ name: 'DeepNested',
250
+ type: 'Nested',
251
+ uri: 'configuration/entityTypes/HCP/attributes/DeepNested',
252
+ attributes: [
253
+ {
254
+ label: 'Int_HCP',
255
+ name: 'FirstLevelNestedSub1',
256
+ type: 'Int',
257
+ uri: 'configuration/entityTypes/HCP/attributes/DeepNested/attributes/FirstLevelNestedSub1'
258
+ }
259
+ ]
260
+ },
261
+ {
262
+ label: 'Address',
263
+ name: 'Address',
264
+ access: ['READ'],
265
+ type: 'Reference',
266
+ referencedAttributeURIs: ['configuration/entityTypes/Location/attributes/AddressLine1'],
267
+ uri: 'configuration/entityTypes/Location/attributes/Address'
268
+ },
269
+ {
270
+ label: 'Image Gallery',
271
+ name: 'ImageGallery',
272
+ type: 'Image',
273
+ uri: 'configuration/entityTypes/HCP/attributes/ImageGallery',
274
+ attributes: [
275
+ {
276
+ label: 'Small image url (S3)',
277
+ name: 'UrlThumbnail',
278
+ type: 'String',
279
+ uri: 'configuration/entityTypes/HCP/attributes/ImageGallery/attributes/UrlThumbnail'
280
+ }
281
+ ]
282
+ }
283
+ ];