@parca/profile 0.16.0 → 0.16.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/dist/Callgraph/Edge/index.d.ts +22 -0
- package/dist/Callgraph/Edge/index.js +30 -0
- package/dist/Callgraph/Node/index.d.ts +19 -0
- package/dist/Callgraph/Node/index.js +37 -0
- package/dist/Callgraph/index.d.ts +8 -0
- package/dist/Callgraph/index.js +137 -0
- package/dist/Callgraph/mockData/index.d.ts +148 -0
- package/dist/Callgraph/mockData/index.js +577 -0
- package/dist/Callgraph/utils.d.ts +19 -0
- package/dist/Callgraph/utils.js +82 -0
- package/dist/GraphTooltip/index.d.ts +19 -0
- package/dist/GraphTooltip/index.js +119 -0
- package/dist/IcicleGraph.d.ts +35 -0
- package/dist/IcicleGraph.js +139 -0
- package/dist/MatchersInput/index.d.ts +23 -0
- package/dist/MatchersInput/index.js +479 -0
- package/dist/MetricsCircle/index.d.ts +7 -0
- package/dist/MetricsCircle/index.js +18 -0
- package/dist/MetricsGraph/index.d.ts +35 -0
- package/dist/MetricsGraph/index.js +349 -0
- package/dist/MetricsSeries/index.d.ts +11 -0
- package/dist/MetricsSeries/index.js +21 -0
- package/dist/ProfileExplorer/ProfileExplorerCompare.d.ts +19 -0
- package/dist/ProfileExplorer/ProfileExplorerCompare.js +38 -0
- package/dist/ProfileExplorer/ProfileExplorerSingle.d.ts +15 -0
- package/dist/ProfileExplorer/ProfileExplorerSingle.js +19 -0
- package/dist/ProfileExplorer/index.d.ts +9 -0
- package/dist/ProfileExplorer/index.js +203 -0
- package/dist/ProfileIcicleGraph.d.ts +10 -0
- package/dist/ProfileIcicleGraph.js +28 -0
- package/dist/ProfileMetricsGraph/index.d.ts +22 -0
- package/dist/ProfileMetricsGraph/index.js +127 -0
- package/dist/ProfileSVG.module.css +3 -0
- package/dist/ProfileSelector/CompareButton.d.ts +5 -0
- package/dist/ProfileSelector/CompareButton.js +41 -0
- package/dist/ProfileSelector/MergeButton.d.ts +5 -0
- package/dist/ProfileSelector/MergeButton.js +41 -0
- package/dist/ProfileSelector/index.d.ts +29 -0
- package/dist/ProfileSelector/index.js +133 -0
- package/dist/ProfileSource.d.ts +88 -0
- package/dist/ProfileSource.js +239 -0
- package/dist/ProfileTypeSelector/index.d.ts +20 -0
- package/dist/ProfileTypeSelector/index.js +138 -0
- package/dist/ProfileView.d.ts +39 -0
- package/dist/ProfileView.js +111 -0
- package/dist/ProfileView.styles.css +3 -0
- package/dist/ProfileViewWithData.d.ts +11 -0
- package/dist/ProfileViewWithData.js +116 -0
- package/dist/TopTable.d.ts +9 -0
- package/dist/TopTable.js +140 -0
- package/dist/TopTable.styles.css +7 -0
- package/dist/components/DiffLegend.d.ts +2 -0
- package/dist/components/DiffLegend.js +62 -0
- package/dist/components/ProfileShareButton/ResultBox.d.ts +6 -0
- package/dist/components/ProfileShareButton/ResultBox.js +46 -0
- package/dist/components/ProfileShareButton/index.d.ts +7 -0
- package/dist/components/ProfileShareButton/index.js +119 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +64 -0
- package/dist/styles.css +1 -0
- package/dist/useDelayedLoader.d.ts +5 -0
- package/dist/useDelayedLoader.js +33 -0
- package/dist/useQuery.d.ts +13 -0
- package/dist/useQuery.js +41 -0
- package/dist/utils.d.ts +4 -0
- package/dist/utils.js +83 -0
- package/package.json +12 -8
- package/src/Callgraph/Edge/index.tsx +59 -0
- package/src/Callgraph/Node/index.tsx +66 -0
- package/src/Callgraph/index.tsx +169 -0
- package/src/Callgraph/mockData/index.ts +605 -0
- package/src/Callgraph/utils.ts +116 -0
- package/src/GraphTooltip/index.tsx +245 -0
- package/src/IcicleGraph.tsx +3 -3
- package/src/MatchersInput/index.tsx +698 -0
- package/src/MetricsCircle/index.tsx +28 -0
- package/src/MetricsGraph/index.tsx +614 -0
- package/src/MetricsSeries/index.tsx +38 -0
- package/src/ProfileExplorer/ProfileExplorerCompare.tsx +109 -0
- package/src/ProfileExplorer/ProfileExplorerSingle.tsx +72 -0
- package/src/ProfileExplorer/index.tsx +377 -0
- package/src/ProfileMetricsGraph/index.tsx +143 -0
- package/src/ProfileSelector/CompareButton.tsx +72 -0
- package/src/ProfileSelector/MergeButton.tsx +72 -0
- package/src/ProfileSelector/index.tsx +270 -0
- package/src/ProfileTypeSelector/index.tsx +180 -0
- package/src/ProfileView.tsx +2 -7
- package/src/index.tsx +11 -0
- package/src/useQuery.tsx +1 -0
- package/tailwind.config.js +8 -0
- package/tsconfig.json +7 -3
- package/typings.d.ts +14 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,46 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.16.22](https://github.com/parca-dev/parca/compare/ui-v0.16.20...ui-v0.16.22) (2022-09-27)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @parca/profile
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.16.21](https://github.com/parca-dev/parca/compare/ui-v0.16.20...ui-v0.16.21) (2022-09-27)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @parca/profile
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [0.16.20](https://github.com/parca-dev/parca/compare/ui-v0.16.19...ui-v0.16.20) (2022-09-27)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @parca/profile
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [0.16.19](https://github.com/parca-dev/parca/compare/ui-v0.16.18...ui-v0.16.19) (2022-09-26)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @parca/profile
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## [0.16.16](https://github.com/parca-dev/parca/compare/ui-v0.16.15...ui-v0.16.16) (2022-09-26)
|
|
39
|
+
|
|
40
|
+
**Note:** Version bump only for package @parca/profile
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
6
46
|
# [0.16.0](https://github.com/parca-dev/parca/compare/ui-v0.15.26...ui-v0.16.0) (2022-09-13)
|
|
7
47
|
|
|
8
48
|
**Note:** Version bump only for package @parca/profile
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface IEdge {
|
|
2
|
+
source: number;
|
|
3
|
+
target: number;
|
|
4
|
+
color: string;
|
|
5
|
+
points: string;
|
|
6
|
+
}
|
|
7
|
+
interface Props {
|
|
8
|
+
edge: IEdge;
|
|
9
|
+
sourceNode: {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
};
|
|
13
|
+
targetNode: {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
};
|
|
17
|
+
xScale: (x: number) => number;
|
|
18
|
+
yScale: (y: number) => number;
|
|
19
|
+
nodeRadius: number;
|
|
20
|
+
}
|
|
21
|
+
declare const Edge: ({ edge, sourceNode, targetNode, xScale, yScale, nodeRadius }: Props) => JSX.Element;
|
|
22
|
+
export default Edge;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Copyright 2022 The Parca Authors
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
import { Arrow } from 'react-konva';
|
|
15
|
+
import { parseEdgePos } from '../utils';
|
|
16
|
+
var Edge = function (_a) {
|
|
17
|
+
var edge = _a.edge, sourceNode = _a.sourceNode, targetNode = _a.targetNode, xScale = _a.xScale, yScale = _a.yScale, nodeRadius = _a.nodeRadius;
|
|
18
|
+
var points = edge.points, color = edge.color, source = edge.source, target = edge.target;
|
|
19
|
+
var scaledPoints = parseEdgePos({
|
|
20
|
+
pos: points,
|
|
21
|
+
xScale: xScale,
|
|
22
|
+
yScale: yScale,
|
|
23
|
+
source: [sourceNode.x, sourceNode.y],
|
|
24
|
+
target: [targetNode.x, targetNode.y],
|
|
25
|
+
nodeRadius: nodeRadius,
|
|
26
|
+
isSelfLoop: source === target,
|
|
27
|
+
});
|
|
28
|
+
return (_jsx(Arrow, { points: scaledPoints, bezier: true, stroke: color, strokeWidth: 3, pointerLength: 10, pointerWidth: 10, fill: color, opacity: 0.8 }));
|
|
29
|
+
};
|
|
30
|
+
export default Edge;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface INode {
|
|
2
|
+
id: number;
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
data: {
|
|
6
|
+
id: string;
|
|
7
|
+
};
|
|
8
|
+
color: string;
|
|
9
|
+
mouseX?: number;
|
|
10
|
+
mouseY?: number;
|
|
11
|
+
}
|
|
12
|
+
interface Props {
|
|
13
|
+
node: INode;
|
|
14
|
+
hoveredNode: INode | null;
|
|
15
|
+
setHoveredNode: (node: INode | null) => void;
|
|
16
|
+
nodeRadius: number;
|
|
17
|
+
}
|
|
18
|
+
declare const Node: ({ node, hoveredNode, setHoveredNode, nodeRadius, }: Props) => JSX.Element;
|
|
19
|
+
export default Node;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
// Copyright 2022 The Parca Authors
|
|
14
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
15
|
+
// you may not use this file except in compliance with the License.
|
|
16
|
+
// You may obtain a copy of the License at
|
|
17
|
+
//
|
|
18
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
19
|
+
//
|
|
20
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
21
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
22
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
23
|
+
// See the License for the specific language governing permissions and
|
|
24
|
+
// limitations under the License.
|
|
25
|
+
import { Circle } from 'react-konva';
|
|
26
|
+
var Node = function (_a) {
|
|
27
|
+
var node = _a.node, hoveredNode = _a.hoveredNode, setHoveredNode = _a.setHoveredNode, defaultRadius = _a.nodeRadius;
|
|
28
|
+
var id = node.data.id, x = node.x, y = node.y, color = node.color;
|
|
29
|
+
var hoverRadius = defaultRadius + 3;
|
|
30
|
+
var isHovered = Boolean(hoveredNode) && (hoveredNode === null || hoveredNode === void 0 ? void 0 : hoveredNode.data.id) === id;
|
|
31
|
+
return (_jsx(Circle, { x: +x, y: +y, draggable: true, radius: isHovered ? hoverRadius : defaultRadius, fill: color, onMouseOver: function () {
|
|
32
|
+
setHoveredNode(__assign(__assign({}, node), { mouseX: x, mouseY: y }));
|
|
33
|
+
}, onMouseOut: function () {
|
|
34
|
+
setHoveredNode(null);
|
|
35
|
+
} }));
|
|
36
|
+
};
|
|
37
|
+
export default Node;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (_) try {
|
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
49
|
+
// Copyright 2022 The Parca Authors
|
|
50
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
51
|
+
// you may not use this file except in compliance with the License.
|
|
52
|
+
// You may obtain a copy of the License at
|
|
53
|
+
//
|
|
54
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
55
|
+
//
|
|
56
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
57
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
58
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
59
|
+
// See the License for the specific language governing permissions and
|
|
60
|
+
// limitations under the License.
|
|
61
|
+
import { useState, useEffect, useRef } from 'react';
|
|
62
|
+
import graphviz from 'graphviz-wasm';
|
|
63
|
+
import * as d3 from 'd3';
|
|
64
|
+
import { Stage, Layer } from 'react-konva';
|
|
65
|
+
import Tooltip from '../GraphTooltip';
|
|
66
|
+
import { jsonToDot } from './utils';
|
|
67
|
+
import Node from './Node';
|
|
68
|
+
import Edge from './Edge';
|
|
69
|
+
var Callgraph = function (_a) {
|
|
70
|
+
var _b, _c;
|
|
71
|
+
var graph = _a.graph, sampleUnit = _a.sampleUnit, width = _a.width;
|
|
72
|
+
var containerRef = useRef(null);
|
|
73
|
+
var _d = useState(null), graphData = _d[0], setGraphData = _d[1];
|
|
74
|
+
var _e = useState(null), hoveredNode = _e[0], setHoveredNode = _e[1];
|
|
75
|
+
var rawNodes = graph.nodes, total = graph.cumulative;
|
|
76
|
+
var nodeRadius = 12;
|
|
77
|
+
useEffect(function () {
|
|
78
|
+
var getDataWithPositions = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
79
|
+
var dataAsDot, jsonGraph;
|
|
80
|
+
return __generator(this, function (_a) {
|
|
81
|
+
switch (_a.label) {
|
|
82
|
+
case 0:
|
|
83
|
+
dataAsDot = jsonToDot({ graph: graph, width: width, nodeRadius: nodeRadius });
|
|
84
|
+
// 2. Use Graphviz-WASM to translate the 'dot' graph to a 'JSON' graph
|
|
85
|
+
return [4 /*yield*/, graphviz.loadWASM()];
|
|
86
|
+
case 1:
|
|
87
|
+
// 2. Use Graphviz-WASM to translate the 'dot' graph to a 'JSON' graph
|
|
88
|
+
_a.sent(); // need to load the WASM instance and wait for it
|
|
89
|
+
jsonGraph = graphviz.layout(dataAsDot, 'json', 'dot');
|
|
90
|
+
setGraphData(jsonGraph);
|
|
91
|
+
return [2 /*return*/];
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}); };
|
|
95
|
+
if (width !== null) {
|
|
96
|
+
void getDataWithPositions();
|
|
97
|
+
}
|
|
98
|
+
}, [graph, width]);
|
|
99
|
+
// 3. Render the graph with calculated layout in Canvas container
|
|
100
|
+
if (width == null || graphData == null)
|
|
101
|
+
return _jsx(_Fragment, {});
|
|
102
|
+
var height = width;
|
|
103
|
+
var _f = JSON.parse(graphData), objects = _f.objects, gvizEdges = _f.edges, boundingBox = _f.bb;
|
|
104
|
+
var cumulatives = objects
|
|
105
|
+
.filter(function (node) { return node !== undefined; })
|
|
106
|
+
.map(function (node) { return node.cumulative; });
|
|
107
|
+
if (cumulatives.length === 0) {
|
|
108
|
+
cumulatives.push('0');
|
|
109
|
+
}
|
|
110
|
+
var valueRange = d3.extent(cumulatives).map(function (value) { return parseInt(value); });
|
|
111
|
+
var colorScale = d3
|
|
112
|
+
.scaleSequentialLog(d3.interpolateRdGy)
|
|
113
|
+
.domain(valueRange)
|
|
114
|
+
.range(['lightgrey', 'red']);
|
|
115
|
+
var graphBB = boundingBox.split(',');
|
|
116
|
+
var xScale = d3
|
|
117
|
+
.scaleLinear()
|
|
118
|
+
.domain([0, Number(graphBB[2])])
|
|
119
|
+
.range([0, width]);
|
|
120
|
+
var yScale = d3
|
|
121
|
+
.scaleLinear()
|
|
122
|
+
.domain([0, Number(graphBB[3])])
|
|
123
|
+
.range([0, height]);
|
|
124
|
+
var nodes = objects.map(function (object) {
|
|
125
|
+
var _a;
|
|
126
|
+
var pos = object.pos.split(',');
|
|
127
|
+
return __assign(__assign({}, object), { id: object._gvid, x: xScale(parseInt(pos[0])), y: yScale(parseInt(pos[1])), color: colorScale(Number(object.cumulative)), data: (_a = rawNodes.find(function (n) { return n.id === object.name; })) !== null && _a !== void 0 ? _a : { id: 'n0' } });
|
|
128
|
+
});
|
|
129
|
+
var edges = gvizEdges.map(function (edge) { return (__assign(__assign({}, edge), { source: edge.head, target: edge.tail, points: edge.pos, color: colorScale(+edge.cumulative) })); });
|
|
130
|
+
return (_jsx("div", __assign({ className: "relative" }, { children: _jsxs("div", __assign({ className: "w-[".concat(width, "px] h-[").concat(height, "px]"), ref: containerRef }, { children: [_jsx(Stage, __assign({ width: width, height: height }, { children: _jsxs(Layer, { children: [edges.map(function (edge) {
|
|
131
|
+
var _a, _b;
|
|
132
|
+
var sourceNode = (_a = nodes.find(function (n) { return n.id === edge.source; })) !== null && _a !== void 0 ? _a : { x: 0, y: 0 };
|
|
133
|
+
var targetNode = (_b = nodes.find(function (n) { return n.id === edge.target; })) !== null && _b !== void 0 ? _b : { x: 0, y: 0 };
|
|
134
|
+
return (_jsx(Edge, { edge: edge, xScale: xScale, yScale: yScale, sourceNode: sourceNode, targetNode: targetNode, nodeRadius: nodeRadius }, "edge-".concat(edge.source, "-").concat(edge.target)));
|
|
135
|
+
}), nodes.map(function (node) { return (_jsx(Node, { node: node, hoveredNode: hoveredNode, setHoveredNode: setHoveredNode, nodeRadius: nodeRadius }, "node-".concat(node.data.id))); })] }) })), _jsx(Tooltip, { hoveringNode: rawNodes.find(function (n) { return n.id === (hoveredNode === null || hoveredNode === void 0 ? void 0 : hoveredNode.data.id); }), unit: sampleUnit, total: +total, isFixed: false, x: (_b = hoveredNode === null || hoveredNode === void 0 ? void 0 : hoveredNode.mouseX) !== null && _b !== void 0 ? _b : 0, y: (_c = hoveredNode === null || hoveredNode === void 0 ? void 0 : hoveredNode.mouseY) !== null && _c !== void 0 ? _c : 0, contextElement: containerRef.current })] })) })));
|
|
136
|
+
};
|
|
137
|
+
export default Callgraph;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
export declare const dotGraph = "{\n n1 [Label = \"n1\"];\n n2 [Label = \"n2\"];\n n3 [Label = \"n3\"];\n n1 -- n2;\n n1 -- n3;\n n2 -- n2;\n}";
|
|
2
|
+
export declare const jsonGraph: {
|
|
3
|
+
total: string;
|
|
4
|
+
unit: string;
|
|
5
|
+
nodes: {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
value: number;
|
|
9
|
+
}[];
|
|
10
|
+
edges: {
|
|
11
|
+
id: string;
|
|
12
|
+
source: string;
|
|
13
|
+
target: string;
|
|
14
|
+
label: string;
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
export declare const graphvizDot = "\ndigraph {\n N1 [id=\"node1\"]\n N2 [id=\"node2\"]\n N3 [id=\"node3\"]\n N4 [id=\"node4\"]\n N1 -> N2 [id=\"e1\" label=\"e1 fdskjao fdjksaol\"]\n N2 -> N3 [id=\"e2\" label=\"e2\"]\n N3 -> N4 [id=\"e3\" label=\"e3\"]\n N3 -> N1 [id=\"e4\" label=\"e4\"]\n }";
|
|
18
|
+
export declare const jsonGraphWithGraphvizPositions: {
|
|
19
|
+
name: string;
|
|
20
|
+
directed: boolean;
|
|
21
|
+
strict: boolean;
|
|
22
|
+
_draw_: ({
|
|
23
|
+
op: string;
|
|
24
|
+
grad: string;
|
|
25
|
+
color: string;
|
|
26
|
+
points?: undefined;
|
|
27
|
+
} | {
|
|
28
|
+
op: string;
|
|
29
|
+
points: number[][];
|
|
30
|
+
grad?: undefined;
|
|
31
|
+
color?: undefined;
|
|
32
|
+
})[];
|
|
33
|
+
bb: string;
|
|
34
|
+
xdotversion: string;
|
|
35
|
+
_subgraph_cnt: number;
|
|
36
|
+
objects: {
|
|
37
|
+
_gvid: number;
|
|
38
|
+
name: string;
|
|
39
|
+
Label: string;
|
|
40
|
+
_draw_: ({
|
|
41
|
+
op: string;
|
|
42
|
+
grad: string;
|
|
43
|
+
color: string;
|
|
44
|
+
rect?: undefined;
|
|
45
|
+
} | {
|
|
46
|
+
op: string;
|
|
47
|
+
rect: number[];
|
|
48
|
+
grad?: undefined;
|
|
49
|
+
color?: undefined;
|
|
50
|
+
})[];
|
|
51
|
+
_ldraw_: ({
|
|
52
|
+
op: string;
|
|
53
|
+
size: number;
|
|
54
|
+
face: string;
|
|
55
|
+
grad?: undefined;
|
|
56
|
+
color?: undefined;
|
|
57
|
+
pt?: undefined;
|
|
58
|
+
align?: undefined;
|
|
59
|
+
width?: undefined;
|
|
60
|
+
text?: undefined;
|
|
61
|
+
} | {
|
|
62
|
+
op: string;
|
|
63
|
+
grad: string;
|
|
64
|
+
color: string;
|
|
65
|
+
size?: undefined;
|
|
66
|
+
face?: undefined;
|
|
67
|
+
pt?: undefined;
|
|
68
|
+
align?: undefined;
|
|
69
|
+
width?: undefined;
|
|
70
|
+
text?: undefined;
|
|
71
|
+
} | {
|
|
72
|
+
op: string;
|
|
73
|
+
pt: number[];
|
|
74
|
+
align: string;
|
|
75
|
+
width: number;
|
|
76
|
+
text: string;
|
|
77
|
+
size?: undefined;
|
|
78
|
+
face?: undefined;
|
|
79
|
+
grad?: undefined;
|
|
80
|
+
color?: undefined;
|
|
81
|
+
})[];
|
|
82
|
+
fillcolor: string;
|
|
83
|
+
fixedsize: string;
|
|
84
|
+
fontcolor: string;
|
|
85
|
+
height: string;
|
|
86
|
+
label: string;
|
|
87
|
+
margin: string;
|
|
88
|
+
pos: string;
|
|
89
|
+
shape: string;
|
|
90
|
+
style: string;
|
|
91
|
+
width: string;
|
|
92
|
+
}[];
|
|
93
|
+
edges: {
|
|
94
|
+
_gvid: number;
|
|
95
|
+
tail: number;
|
|
96
|
+
head: number;
|
|
97
|
+
_draw_: ({
|
|
98
|
+
op: string;
|
|
99
|
+
grad: string;
|
|
100
|
+
color: string;
|
|
101
|
+
points?: undefined;
|
|
102
|
+
} | {
|
|
103
|
+
op: string;
|
|
104
|
+
points: number[][];
|
|
105
|
+
grad?: undefined;
|
|
106
|
+
color?: undefined;
|
|
107
|
+
})[];
|
|
108
|
+
_hdraw_: ({
|
|
109
|
+
op: string;
|
|
110
|
+
style: string;
|
|
111
|
+
grad?: undefined;
|
|
112
|
+
color?: undefined;
|
|
113
|
+
points?: undefined;
|
|
114
|
+
} | {
|
|
115
|
+
op: string;
|
|
116
|
+
grad: string;
|
|
117
|
+
color: string;
|
|
118
|
+
style?: undefined;
|
|
119
|
+
points?: undefined;
|
|
120
|
+
} | {
|
|
121
|
+
op: string;
|
|
122
|
+
points: number[][];
|
|
123
|
+
style?: undefined;
|
|
124
|
+
grad?: undefined;
|
|
125
|
+
color?: undefined;
|
|
126
|
+
})[];
|
|
127
|
+
pos: string;
|
|
128
|
+
}[];
|
|
129
|
+
};
|
|
130
|
+
export declare const nodeWithMetaData: (id: string, name: string) => {
|
|
131
|
+
id: string;
|
|
132
|
+
cumulative: number;
|
|
133
|
+
meta: any;
|
|
134
|
+
};
|
|
135
|
+
export declare const jsonGraphWithMetaData: {
|
|
136
|
+
total: string;
|
|
137
|
+
nodes: {
|
|
138
|
+
id: string;
|
|
139
|
+
cumulative: number;
|
|
140
|
+
meta: any;
|
|
141
|
+
}[];
|
|
142
|
+
edges: {
|
|
143
|
+
id: string;
|
|
144
|
+
source: string;
|
|
145
|
+
target: string;
|
|
146
|
+
cumulative: string;
|
|
147
|
+
}[];
|
|
148
|
+
};
|