mirror of
https://github.com/niespodd/browser-fingerprinting.git
synced 2021-11-01 22:44:07 +03:00
startTime & endTime for perf vis
This commit is contained in:
1
docs/assets/index.feb49b7d.js
Normal file
1
docs/assets/index.feb49b7d.js
Normal file
File diff suppressed because one or more lines are too long
@@ -11,7 +11,7 @@
|
||||
break-inside: avoid;
|
||||
}
|
||||
</style>
|
||||
<script type="module" crossorigin src="assets/index.e17f1f40.js"></script>
|
||||
<script type="module" crossorigin src="assets/index.feb49b7d.js"></script>
|
||||
<link rel="modulepreload" href="assets/vendor.0d07671f.js">
|
||||
<link rel="stylesheet" href="assets/index.f44316bf.css">
|
||||
</head>
|
||||
|
||||
@@ -16,6 +16,7 @@ const TIMING_COLOR = {
|
||||
const TimelineVisualisation = ({ data }) => {
|
||||
const timelineWrapper = React.useRef(undefined);
|
||||
const [svgDimensions, setSvgDimensions] = React.useState(undefined);
|
||||
const [timings, setTimings] = React.useState({undefined});
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!timelineWrapper.current) return;
|
||||
@@ -30,6 +31,11 @@ const TimelineVisualisation = ({ data }) => {
|
||||
const maxW = Math.max(...data.map((d) => d.startTime + d.duration));
|
||||
const W = maxW - minW;
|
||||
|
||||
setTimings({
|
||||
startTime: minW,
|
||||
endTime: maxW,
|
||||
});
|
||||
|
||||
return data.map((e) => {
|
||||
return {
|
||||
x: ((e.startTime - minW)/W) * width,
|
||||
@@ -42,6 +48,7 @@ const TimelineVisualisation = ({ data }) => {
|
||||
|
||||
return (
|
||||
<div ref={timelineWrapper} style={{ marginTop: '8px' }}>
|
||||
<Text mb={2}>Start time <Code>{timings.startTime}</Code>, end time <Code>{timings.endTime}</Code></Text>
|
||||
{svgDimensions && normalizedData && (
|
||||
<svg {...svgDimensions}>
|
||||
<Group>
|
||||
|
||||
Reference in New Issue
Block a user