@parca/profile 0.19.140 → 0.19.143

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 (182) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/dist/GraphTooltipArrow/Content.js +224 -30
  3. package/dist/GraphTooltipArrow/DockedGraphTooltip/index.js +192 -33
  4. package/dist/GraphTooltipArrow/ExpandOnHoverValue.js +53 -3
  5. package/dist/GraphTooltipArrow/index.d.ts.map +1 -1
  6. package/dist/GraphTooltipArrow/index.js +86 -56
  7. package/dist/GraphTooltipArrow/useGraphTooltip/index.js +37 -37
  8. package/dist/GraphTooltipArrow/useGraphTooltipMetaInfo/index.js +94 -68
  9. package/dist/MatchersInput/SuggestionItem.js +91 -12
  10. package/dist/MatchersInput/SuggestionsList.d.ts +2 -1
  11. package/dist/MatchersInput/SuggestionsList.d.ts.map +1 -1
  12. package/dist/MatchersInput/SuggestionsList.js +371 -157
  13. package/dist/MatchersInput/SuggestionsList.test.d.ts +2 -0
  14. package/dist/MatchersInput/SuggestionsList.test.d.ts.map +1 -0
  15. package/dist/MatchersInput/index.js +308 -115
  16. package/dist/MetricsCircle/index.js +39 -3
  17. package/dist/MetricsGraph/MetricsContextMenu/index.js +119 -19
  18. package/dist/MetricsGraph/MetricsInfoPanel/index.js +81 -20
  19. package/dist/MetricsGraph/MetricsTooltip/index.d.ts.map +1 -1
  20. package/dist/MetricsGraph/MetricsTooltip/index.js +107 -74
  21. package/dist/MetricsGraph/index.js +552 -203
  22. package/dist/MetricsGraph/useMetricsGraphDimensions.js +46 -25
  23. package/dist/MetricsGraph/utils/colorMapping.js +24 -17
  24. package/dist/MetricsSeries/index.js +70 -7
  25. package/dist/PreSelectedMatchers/index.d.ts.map +1 -1
  26. package/dist/PreSelectedMatchers/index.js +249 -102
  27. package/dist/ProfileExplorer/ProfileExplorerCompare.d.ts.map +1 -1
  28. package/dist/ProfileExplorer/ProfileExplorerCompare.js +240 -45
  29. package/dist/ProfileExplorer/ProfileExplorerSingle.js +98 -11
  30. package/dist/ProfileExplorer/index.js +183 -32
  31. package/dist/ProfileFlameChart/SamplesStrips/SamplesGraph/index.js +333 -148
  32. package/dist/ProfileFlameChart/SamplesStrips/SamplesStrips.stories.js +69 -35
  33. package/dist/ProfileFlameChart/SamplesStrips/index.js +645 -134
  34. package/dist/ProfileFlameChart/SamplesStrips/labelSetUtils.js +114 -55
  35. package/dist/ProfileFlameChart/index.js +260 -126
  36. package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenu.js +283 -85
  37. package/dist/ProfileFlameGraph/FlameGraphArrow/ContextMenuWrapper.js +56 -20
  38. package/dist/ProfileFlameGraph/FlameGraphArrow/FlameGraphNodes.js +211 -140
  39. package/dist/ProfileFlameGraph/FlameGraphArrow/MemoizedTooltip.js +133 -38
  40. package/dist/ProfileFlameGraph/FlameGraphArrow/MiniMap.js +261 -216
  41. package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.d.ts.map +1 -1
  42. package/dist/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.js +71 -45
  43. package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.d.ts.map +1 -1
  44. package/dist/ProfileFlameGraph/FlameGraphArrow/TooltipContext.js +58 -28
  45. package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.d.ts.map +1 -1
  46. package/dist/ProfileFlameGraph/FlameGraphArrow/ZoomControls.js +59 -8
  47. package/dist/ProfileFlameGraph/FlameGraphArrow/index.js +396 -179
  48. package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.d.ts.map +1 -1
  49. package/dist/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.js +68 -50
  50. package/dist/ProfileFlameGraph/FlameGraphArrow/useMappingList.js +62 -38
  51. package/dist/ProfileFlameGraph/FlameGraphArrow/useNodeColor.js +14 -6
  52. package/dist/ProfileFlameGraph/FlameGraphArrow/useScrollViewport.js +124 -82
  53. package/dist/ProfileFlameGraph/FlameGraphArrow/useVisibleNodes.js +160 -98
  54. package/dist/ProfileFlameGraph/FlameGraphArrow/useZoom.js +232 -112
  55. package/dist/ProfileFlameGraph/FlameGraphArrow/utils.js +137 -114
  56. package/dist/ProfileFlameGraph/benchmarks/benchdata/populateData.js +85 -0
  57. package/dist/ProfileFlameGraph/index.js +322 -147
  58. package/dist/ProfileMetricsGraph/hooks/useQueryRange.js +140 -32
  59. package/dist/ProfileMetricsGraph/index.js +515 -256
  60. package/dist/ProfileSelector/CompareButton.js +132 -12
  61. package/dist/ProfileSelector/MetricsGraphSection.js +228 -63
  62. package/dist/ProfileSelector/index.d.ts +1 -1
  63. package/dist/ProfileSelector/index.d.ts.map +1 -1
  64. package/dist/ProfileSelector/index.js +734 -142
  65. package/dist/ProfileSelector/useAutoQuerySelector.d.ts +1 -3
  66. package/dist/ProfileSelector/useAutoQuerySelector.d.ts.map +1 -1
  67. package/dist/ProfileSelector/useAutoQuerySelector.js +280 -132
  68. package/dist/ProfileSource.js +230 -163
  69. package/dist/ProfileTypeSelector/index.js +214 -125
  70. package/dist/ProfileView/components/ActionButtons/GroupByDropdown.js +50 -4
  71. package/dist/ProfileView/components/ActionButtons/SortByDropdown.js +137 -32
  72. package/dist/ProfileView/components/ColorStackLegend.js +182 -54
  73. package/dist/ProfileView/components/DashboardItems/index.js +87 -28
  74. package/dist/ProfileView/components/DashboardLayout/index.js +108 -16
  75. package/dist/ProfileView/components/DiffLegend.js +172 -29
  76. package/dist/ProfileView/components/GroupByLabelsDropdown/index.js +199 -55
  77. package/dist/ProfileView/components/InvertCallStack/index.js +97 -9
  78. package/dist/ProfileView/components/ProfileFilters/filterPresets.js +260 -315
  79. package/dist/ProfileView/components/ProfileFilters/index.js +518 -215
  80. package/dist/ProfileView/components/ProfileFilters/useProfileFilters.js +370 -306
  81. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.js +191 -118
  82. package/dist/ProfileView/components/ProfileHeader/index.js +105 -11
  83. package/dist/ProfileView/components/ShareButton/ResultBox.js +119 -16
  84. package/dist/ProfileView/components/ShareButton/index.js +352 -62
  85. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.d.ts.map +1 -1
  86. package/dist/ProfileView/components/Toolbars/MultiLevelDropdown.js +664 -192
  87. package/dist/ProfileView/components/Toolbars/SwitchMenuItem.js +94 -7
  88. package/dist/ProfileView/components/Toolbars/TableColumnsDropdown.js +196 -155
  89. package/dist/ProfileView/components/Toolbars/index.js +441 -21
  90. package/dist/ProfileView/components/ViewSelector/Dropdown.js +233 -22
  91. package/dist/ProfileView/components/ViewSelector/index.js +186 -82
  92. package/dist/ProfileView/components/VisualizationContainer/index.d.ts.map +1 -1
  93. package/dist/ProfileView/components/VisualizationContainer/index.js +52 -7
  94. package/dist/ProfileView/components/VisualizationPanel.js +185 -8
  95. package/dist/ProfileView/context/DashboardContext.js +74 -26
  96. package/dist/ProfileView/context/ProfileViewContext.js +56 -15
  97. package/dist/ProfileView/hooks/useAutoSelectDimension.js +71 -41
  98. package/dist/ProfileView/hooks/useProfileMetadata.js +50 -18
  99. package/dist/ProfileView/hooks/useResetFlameGraphState.js +31 -10
  100. package/dist/ProfileView/hooks/useResetStateOnProfileTypeChange.js +71 -27
  101. package/dist/ProfileView/hooks/useResetStateOnSeriesChange.js +53 -17
  102. package/dist/ProfileView/hooks/useVisualizationState.js +229 -69
  103. package/dist/ProfileView/index.js +383 -45
  104. package/dist/ProfileView/types/visualization.js +1 -13
  105. package/dist/ProfileView/utils/colorUtils.js +8 -7
  106. package/dist/ProfileViewWithData.js +319 -225
  107. package/dist/QueryControls/index.js +418 -47
  108. package/dist/Sandwich/components/CalleesSection.js +54 -4
  109. package/dist/Sandwich/components/CallersSection.js +97 -27
  110. package/dist/Sandwich/components/TableSection.js +77 -4
  111. package/dist/Sandwich/index.js +125 -12
  112. package/dist/Sandwich/utils/processRowData.js +48 -39
  113. package/dist/SelectWithRefresh/index.js +102 -28
  114. package/dist/SimpleMatchers/Select.js +520 -187
  115. package/dist/SimpleMatchers/index.js +590 -288
  116. package/dist/SourceView/Highlighter.js +230 -70
  117. package/dist/SourceView/LineNo.js +72 -17
  118. package/dist/SourceView/index.js +177 -101
  119. package/dist/SourceView/lang-detector/ext-to-lang.json +798 -798
  120. package/dist/SourceView/lang-detector/index.js +28 -14
  121. package/dist/SourceView/useSelectedLineRange.js +72 -20
  122. package/dist/Table/ColorCell.js +42 -1
  123. package/dist/Table/ColumnsVisibility.js +114 -6
  124. package/dist/Table/MoreDropdown.js +107 -21
  125. package/dist/Table/TableContextMenu.js +144 -134
  126. package/dist/Table/TableContextMenuWrapper.js +59 -14
  127. package/dist/Table/hooks/useColorManagement.js +58 -16
  128. package/dist/Table/hooks/useTableConfiguration.d.ts.map +1 -1
  129. package/dist/Table/hooks/useTableConfiguration.js +323 -167
  130. package/dist/Table/index.js +217 -123
  131. package/dist/Table/utils/functions.js +169 -144
  132. package/dist/Table/utils/topAndBottomExpandedRowModel.js +69 -52
  133. package/dist/TimelineGuide/index.js +209 -16
  134. package/dist/TopTable/benchmarks/benchdata/populateData.js +91 -0
  135. package/dist/TopTable/index.js +325 -121
  136. package/dist/contexts/LabelsQueryProvider.js +94 -32
  137. package/dist/contexts/UnifiedLabelsContext.js +114 -49
  138. package/dist/contexts/utils.js +37 -15
  139. package/dist/hooks/urlParsers.js +27 -15
  140. package/dist/hooks/useColorBy.js +47 -10
  141. package/dist/hooks/useCompareModeMeta.js +112 -62
  142. package/dist/hooks/useDashboardItems.js +52 -11
  143. package/dist/hooks/useLabels.js +295 -52
  144. package/dist/hooks/useQueryState.d.ts +1 -1
  145. package/dist/hooks/useQueryState.d.ts.map +1 -1
  146. package/dist/hooks/useQueryState.js +375 -329
  147. package/dist/index.js +11 -6
  148. package/dist/testdata/fg-diff.json +3750 -0
  149. package/dist/testdata/fg-simple.json +1879 -0
  150. package/dist/testdata/link_data.json +56 -0
  151. package/dist/testdata/tabular.json +30 -0
  152. package/dist/testdata/test_flamegraph.json +26846 -0
  153. package/dist/testdata/test_graph.json +53 -0
  154. package/dist/useDelayedLoader.js +32 -18
  155. package/dist/useGrpcQuery/index.js +71 -11
  156. package/dist/useHasProfileData.js +90 -12
  157. package/dist/useQuery.js +205 -64
  158. package/dist/useSumBy.d.ts.map +1 -1
  159. package/dist/useSumBy.js +294 -138
  160. package/dist/utils.js +62 -30
  161. package/package.json +9 -9
  162. package/src/GraphTooltipArrow/index.tsx +3 -0
  163. package/src/MatchersInput/SuggestionsList.test.tsx +70 -0
  164. package/src/MatchersInput/SuggestionsList.tsx +11 -10
  165. package/src/MatchersInput/index.tsx +1 -1
  166. package/src/MetricsGraph/MetricsTooltip/index.tsx +22 -34
  167. package/src/PreSelectedMatchers/index.tsx +3 -0
  168. package/src/ProfileExplorer/ProfileExplorerCompare.tsx +9 -2
  169. package/src/ProfileFlameGraph/FlameGraphArrow/TextWithEllipsis.tsx +3 -0
  170. package/src/ProfileFlameGraph/FlameGraphArrow/TooltipContext.tsx +3 -0
  171. package/src/ProfileFlameGraph/FlameGraphArrow/ZoomControls.tsx +3 -0
  172. package/src/ProfileFlameGraph/FlameGraphArrow/useBatchedRendering.ts +3 -0
  173. package/src/ProfileSelector/index.tsx +31 -9
  174. package/src/ProfileSelector/useAutoQuerySelector.ts +64 -42
  175. package/src/ProfileView/components/Toolbars/MultiLevelDropdown.tsx +3 -0
  176. package/src/ProfileView/components/VisualizationContainer/index.tsx +3 -0
  177. package/src/Table/hooks/useTableConfiguration.tsx +7 -13
  178. package/src/hooks/useQueryState.ts +18 -3
  179. package/src/useDelayedLoader.ts +10 -10
  180. package/src/useSumBy.ts +12 -18
  181. package/dist/ProfileView/components/ProfileFilters/useProfileFiltersUrlState.test.js +0 -455
  182. package/dist/hooks/useQueryState.test.js +0 -868
@@ -1,4 +1,10 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
4
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
7
+ import { c as _c } from "react-compiler-runtime";
2
8
  // Copyright 2022 The Parca Authors
3
9
  // Licensed under the Apache License, Version 2.0 (the "License");
4
10
  // you may not use this file except in compliance with the License.
@@ -11,178 +17,328 @@ import { jsx as _jsx } from "react/jsx-runtime";
11
17
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
18
  // See the License for the specific language governing permissions and
13
19
  // limitations under the License.
14
- import { useEffect, useMemo, useState } from 'react';
20
+
21
+ import { useMemo } from 'react';
15
22
  import { createColumnHelper } from '@tanstack/table-core';
16
23
  import { useQueryState } from 'nuqs';
17
24
  import { valueFormatter } from '@parca/utilities';
18
25
  import { tableColumnsParser } from '../../hooks/urlParsers';
19
26
  import { ColorCell } from '../ColorCell';
20
27
  import { addPlusSign, ratioString } from '../utils/functions';
21
- export function useTableConfiguration({ unit = '', total, filtered, compareMode, }) {
22
- const columnHelper = createColumnHelper();
23
- const [tableColumns] = useQueryState('table_columns', tableColumnsParser);
24
- const [columnVisibility, setColumnVisibility] = useState(() => {
25
- return {
26
- color: true,
27
- flat: true,
28
- flatPercentage: false,
29
- flatDiff: compareMode,
30
- flatDiffPercentage: false,
31
- cumulative: true,
32
- cumulativePercentage: false,
33
- cumulativeDiff: compareMode,
34
- cumulativeDiffPercentage: false,
35
- name: true,
36
- functionSystemName: false,
37
- functionFileName: false,
38
- mappingFile: false,
39
- };
28
+ import { jsx as _jsx } from "react/jsx-runtime";
29
+ export function useTableConfiguration(t0) {
30
+ var $ = _c(44);
31
+ var t1 = t0.unit,
32
+ total = t0.total,
33
+ filtered = t0.filtered,
34
+ compareMode = t0.compareMode;
35
+ var unit = t1 === undefined ? "" : t1;
36
+ var t2;
37
+ if ($[0] === Symbol["for"]("react.memo_cache_sentinel")) {
38
+ t2 = createColumnHelper();
39
+ $[0] = t2;
40
+ } else {
41
+ t2 = $[0];
42
+ }
43
+ var columnHelper = t2;
44
+ var _useQueryState = useQueryState("table_columns", tableColumnsParser),
45
+ _useQueryState2 = _slicedToArray(_useQueryState, 1),
46
+ tableColumns = _useQueryState2[0];
47
+ var defaults;
48
+ if ($[1] !== compareMode || $[2] !== tableColumns) {
49
+ defaults = {
50
+ color: true,
51
+ flat: true,
52
+ flatPercentage: false,
53
+ flatDiff: compareMode,
54
+ flatDiffPercentage: false,
55
+ cumulative: true,
56
+ cumulativePercentage: false,
57
+ cumulativeDiff: compareMode,
58
+ cumulativeDiffPercentage: false,
59
+ name: true,
60
+ functionSystemName: false,
61
+ functionFileName: false,
62
+ mappingFile: false
63
+ };
64
+ if (Array.isArray(tableColumns)) {
65
+ Object.keys(defaults).forEach(function (column) {
66
+ defaults[column] = tableColumns.includes(column);
67
+ });
68
+ }
69
+ $[1] = compareMode;
70
+ $[2] = tableColumns;
71
+ $[3] = defaults;
72
+ } else {
73
+ defaults = $[3];
74
+ }
75
+ var columnVisibility = defaults;
76
+ var t3;
77
+ if ($[4] === Symbol["for"]("react.memo_cache_sentinel")) {
78
+ t3 = columnHelper.accessor("colorProperty", {
79
+ id: "color",
80
+ header: "",
81
+ cell: _temp,
82
+ size: 10,
83
+ enableSorting: false
84
+ });
85
+ $[4] = t3;
86
+ } else {
87
+ t3 = $[4];
88
+ }
89
+ var t4;
90
+ if ($[5] !== unit) {
91
+ t4 = columnHelper.accessor("flat", {
92
+ id: "flat",
93
+ header: "Flat",
94
+ cell: function cell(info_0) {
95
+ return valueFormatter(info_0.getValue(), unit, 2);
96
+ },
97
+ size: 80,
98
+ meta: {
99
+ align: "right"
100
+ },
101
+ invertSorting: true
102
+ });
103
+ $[5] = unit;
104
+ $[6] = t4;
105
+ } else {
106
+ t4 = $[6];
107
+ }
108
+ var t5;
109
+ if ($[7] !== filtered || $[8] !== total) {
110
+ t5 = columnHelper.accessor("flat", {
111
+ id: "flatPercentage",
112
+ header: "Flat (%)",
113
+ cell: function cell(info_1) {
114
+ return ratioString(info_1.getValue(), total, filtered);
115
+ },
116
+ size: 120,
117
+ meta: {
118
+ align: "right"
119
+ },
120
+ invertSorting: true
121
+ });
122
+ $[7] = filtered;
123
+ $[8] = total;
124
+ $[9] = t5;
125
+ } else {
126
+ t5 = $[9];
127
+ }
128
+ var t6;
129
+ if ($[10] !== unit) {
130
+ t6 = columnHelper.accessor("flatDiff", {
131
+ id: "flatDiff",
132
+ header: "Flat Diff",
133
+ cell: function cell(info_2) {
134
+ return addPlusSign(valueFormatter(info_2.getValue(), unit, 2));
135
+ },
136
+ size: 120,
137
+ meta: {
138
+ align: "right"
139
+ },
140
+ invertSorting: true
141
+ });
142
+ $[10] = unit;
143
+ $[11] = t6;
144
+ } else {
145
+ t6 = $[11];
146
+ }
147
+ var t7;
148
+ if ($[12] !== filtered || $[13] !== total) {
149
+ t7 = columnHelper.accessor("flatDiff", {
150
+ id: "flatDiffPercentage",
151
+ header: "Flat Diff (%)",
152
+ cell: function cell(info_3) {
153
+ return ratioString(info_3.getValue(), total, filtered);
154
+ },
155
+ size: 120,
156
+ meta: {
157
+ align: "right"
158
+ },
159
+ invertSorting: true
160
+ });
161
+ $[12] = filtered;
162
+ $[13] = total;
163
+ $[14] = t7;
164
+ } else {
165
+ t7 = $[14];
166
+ }
167
+ var t8;
168
+ if ($[15] !== unit) {
169
+ t8 = columnHelper.accessor("cumulative", {
170
+ id: "cumulative",
171
+ header: "Cumulative",
172
+ cell: function cell(info_4) {
173
+ return valueFormatter(info_4.getValue(), unit, 2);
174
+ },
175
+ size: 150,
176
+ meta: {
177
+ align: "right"
178
+ },
179
+ invertSorting: true
180
+ });
181
+ $[15] = unit;
182
+ $[16] = t8;
183
+ } else {
184
+ t8 = $[16];
185
+ }
186
+ var t9;
187
+ if ($[17] !== filtered || $[18] !== total) {
188
+ t9 = columnHelper.accessor("cumulative", {
189
+ id: "cumulativePercentage",
190
+ header: "Cumulative (%)",
191
+ cell: function cell(info_5) {
192
+ return ratioString(info_5.getValue(), total, filtered);
193
+ },
194
+ size: 150,
195
+ meta: {
196
+ align: "right"
197
+ },
198
+ invertSorting: true
199
+ });
200
+ $[17] = filtered;
201
+ $[18] = total;
202
+ $[19] = t9;
203
+ } else {
204
+ t9 = $[19];
205
+ }
206
+ var t10;
207
+ if ($[20] !== unit) {
208
+ t10 = columnHelper.accessor("cumulativeDiff", {
209
+ id: "cumulativeDiff",
210
+ header: "Cumulative Diff",
211
+ cell: function cell(info_6) {
212
+ return addPlusSign(valueFormatter(info_6.getValue(), unit, 2));
213
+ },
214
+ size: 170,
215
+ meta: {
216
+ align: "right"
217
+ },
218
+ invertSorting: true
40
219
  });
41
- useEffect(() => {
42
- if (Array.isArray(tableColumns)) {
43
- setColumnVisibility(prevState => {
44
- const newState = { ...prevState };
45
- Object.keys(newState).forEach(column => {
46
- newState[column] = tableColumns.includes(column);
47
- });
48
- return newState;
49
- });
50
- }
51
- }, [tableColumns]);
52
- const columns = useMemo(() => {
53
- const baseColumns = [
54
- columnHelper.accessor('colorProperty', {
55
- id: 'color',
56
- header: '',
57
- cell: info => {
58
- const color = info.getValue();
59
- return _jsx(ColorCell, { color: color.color, mappingFile: color.mappingFile });
60
- },
61
- size: 10,
62
- enableSorting: false,
63
- }),
64
- columnHelper.accessor('flat', {
65
- id: 'flat',
66
- header: 'Flat',
67
- cell: info => valueFormatter(info.getValue(), unit, 2),
68
- size: 80,
69
- meta: {
70
- align: 'right',
71
- },
72
- invertSorting: true,
73
- }),
74
- columnHelper.accessor('flat', {
75
- id: 'flatPercentage',
76
- header: 'Flat (%)',
77
- cell: info => {
78
- return ratioString(info.getValue(), total, filtered);
79
- },
80
- size: 120,
81
- meta: {
82
- align: 'right',
83
- },
84
- invertSorting: true,
85
- }),
86
- columnHelper.accessor('flatDiff', {
87
- id: 'flatDiff',
88
- header: 'Flat Diff',
89
- cell: info => addPlusSign(valueFormatter(info.getValue(), unit, 2)),
90
- size: 120,
91
- meta: {
92
- align: 'right',
93
- },
94
- invertSorting: true,
95
- }),
96
- columnHelper.accessor('flatDiff', {
97
- id: 'flatDiffPercentage',
98
- header: 'Flat Diff (%)',
99
- cell: info => {
100
- return ratioString(info.getValue(), total, filtered);
101
- },
102
- size: 120,
103
- meta: {
104
- align: 'right',
105
- },
106
- invertSorting: true,
107
- }),
108
- columnHelper.accessor('cumulative', {
109
- id: 'cumulative',
110
- header: 'Cumulative',
111
- cell: info => valueFormatter(info.getValue(), unit, 2),
112
- size: 150,
113
- meta: {
114
- align: 'right',
115
- },
116
- invertSorting: true,
117
- }),
118
- columnHelper.accessor('cumulative', {
119
- id: 'cumulativePercentage',
120
- header: 'Cumulative (%)',
121
- cell: info => {
122
- return ratioString(info.getValue(), total, filtered);
123
- },
124
- size: 150,
125
- meta: {
126
- align: 'right',
127
- },
128
- invertSorting: true,
129
- }),
130
- columnHelper.accessor('cumulativeDiff', {
131
- id: 'cumulativeDiff',
132
- header: 'Cumulative Diff',
133
- cell: info => addPlusSign(valueFormatter(info.getValue(), unit, 2)),
134
- size: 170,
135
- meta: {
136
- align: 'right',
137
- },
138
- invertSorting: true,
139
- }),
140
- columnHelper.accessor('cumulativeDiff', {
141
- id: 'cumulativeDiffPercentage',
142
- header: 'Cumulative Diff (%)',
143
- cell: info => {
144
- return ratioString(info.getValue(), total, filtered);
145
- },
146
- size: 170,
147
- meta: {
148
- align: 'right',
149
- },
150
- invertSorting: true,
151
- }),
152
- columnHelper.accessor('name', {
153
- id: 'name',
154
- header: 'Name',
155
- cell: info => info.getValue(),
156
- }),
157
- columnHelper.accessor('functionSystemName', {
158
- id: 'functionSystemName',
159
- header: 'Function System Name',
160
- cell: info => info.getValue(),
161
- }),
162
- columnHelper.accessor('functionFileName', {
163
- id: 'functionFileName',
164
- header: 'Function File Name',
165
- cell: info => info.getValue(),
166
- }),
167
- columnHelper.accessor('mappingFile', {
168
- id: 'mappingFile',
169
- header: 'Mapping File',
170
- cell: info => info.getValue(),
171
- }),
172
- ];
173
- return baseColumns;
174
- }, [unit, total, filtered, columnHelper]);
175
- const initialSorting = useMemo(() => {
176
- return [
177
- {
178
- id: compareMode ? 'flatDiff' : 'flat',
179
- desc: false,
180
- },
181
- ];
182
- }, [compareMode]);
183
- return {
184
- columns,
185
- initialSorting,
186
- columnVisibility,
220
+ $[20] = unit;
221
+ $[21] = t10;
222
+ } else {
223
+ t10 = $[21];
224
+ }
225
+ var t11;
226
+ if ($[22] !== filtered || $[23] !== total) {
227
+ t11 = columnHelper.accessor("cumulativeDiff", {
228
+ id: "cumulativeDiffPercentage",
229
+ header: "Cumulative Diff (%)",
230
+ cell: function cell(info_7) {
231
+ return ratioString(info_7.getValue(), total, filtered);
232
+ },
233
+ size: 170,
234
+ meta: {
235
+ align: "right"
236
+ },
237
+ invertSorting: true
238
+ });
239
+ $[22] = filtered;
240
+ $[23] = total;
241
+ $[24] = t11;
242
+ } else {
243
+ t11 = $[24];
244
+ }
245
+ var t12;
246
+ var t13;
247
+ var t14;
248
+ var t15;
249
+ if ($[25] === Symbol["for"]("react.memo_cache_sentinel")) {
250
+ t12 = columnHelper.accessor("name", {
251
+ id: "name",
252
+ header: "Name",
253
+ cell: _temp2
254
+ });
255
+ t13 = columnHelper.accessor("functionSystemName", {
256
+ id: "functionSystemName",
257
+ header: "Function System Name",
258
+ cell: _temp3
259
+ });
260
+ t14 = columnHelper.accessor("functionFileName", {
261
+ id: "functionFileName",
262
+ header: "Function File Name",
263
+ cell: _temp4
264
+ });
265
+ t15 = columnHelper.accessor("mappingFile", {
266
+ id: "mappingFile",
267
+ header: "Mapping File",
268
+ cell: _temp5
269
+ });
270
+ $[25] = t12;
271
+ $[26] = t13;
272
+ $[27] = t14;
273
+ $[28] = t15;
274
+ } else {
275
+ t12 = $[25];
276
+ t13 = $[26];
277
+ t14 = $[27];
278
+ t15 = $[28];
279
+ }
280
+ var t16;
281
+ if ($[29] !== t10 || $[30] !== t11 || $[31] !== t4 || $[32] !== t5 || $[33] !== t6 || $[34] !== t7 || $[35] !== t8 || $[36] !== t9) {
282
+ t16 = [t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15];
283
+ $[29] = t10;
284
+ $[30] = t11;
285
+ $[31] = t4;
286
+ $[32] = t5;
287
+ $[33] = t6;
288
+ $[34] = t7;
289
+ $[35] = t8;
290
+ $[36] = t9;
291
+ $[37] = t16;
292
+ } else {
293
+ t16 = $[37];
294
+ }
295
+ var baseColumns = t16;
296
+ var columns = baseColumns;
297
+ var t17 = compareMode ? "flatDiff" : "flat";
298
+ var t18;
299
+ if ($[38] !== t17) {
300
+ t18 = [{
301
+ id: t17,
302
+ desc: false
303
+ }];
304
+ $[38] = t17;
305
+ $[39] = t18;
306
+ } else {
307
+ t18 = $[39];
308
+ }
309
+ var initialSorting = t18;
310
+ var t19;
311
+ if ($[40] !== columnVisibility || $[41] !== columns || $[42] !== initialSorting) {
312
+ t19 = {
313
+ columns: columns,
314
+ initialSorting: initialSorting,
315
+ columnVisibility: columnVisibility
187
316
  };
317
+ $[40] = columnVisibility;
318
+ $[41] = columns;
319
+ $[42] = initialSorting;
320
+ $[43] = t19;
321
+ } else {
322
+ t19 = $[43];
323
+ }
324
+ return t19;
325
+ }
326
+ function _temp5(info_11) {
327
+ return info_11.getValue();
328
+ }
329
+ function _temp4(info_10) {
330
+ return info_10.getValue();
331
+ }
332
+ function _temp3(info_9) {
333
+ return info_9.getValue();
334
+ }
335
+ function _temp2(info_8) {
336
+ return info_8.getValue();
188
337
  }
338
+ function _temp(info) {
339
+ var color = info.getValue();
340
+ return /*#__PURE__*/_jsx(ColorCell, {
341
+ color: color.color,
342
+ mappingFile: color.mappingFile
343
+ });
344
+ }