-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #126 from FormidableLabs/timeline-network-visualize
Timeline network visualization
- Loading branch information
Showing
28 changed files
with
975 additions
and
389 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+151 Bytes
src/panel/__image_snapshots__/TimelineDuration - Alive: basic-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+128 Bytes
src/panel/__image_snapshots__/TimelineDuration - Network: error-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+126 Bytes
src/panel/__image_snapshots__/TimelineDuration - Network: fetching-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+128 Bytes
src/panel/__image_snapshots__/TimelineDuration - Network: success-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-104 Bytes
src/panel/__image_snapshots__/TimelineRequest - fetching-snap.png
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+323 Bytes
src/panel/__image_snapshots__/TimelineRow - network success-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/panel/pages/timeline/components/TimelineDuration.fixture.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
import { | ||
TimelineAliveDuration, | ||
TimelineNetworkDuration, | ||
} from "./TimelineDuration"; | ||
|
||
const Wrapper = styled.div` | ||
display: flex; | ||
padding: 100px; | ||
background: ${(props) => props.theme.dark["0"]}; | ||
flex-grow: 1; | ||
> :first-child { | ||
width: 100px; | ||
} | ||
`; | ||
|
||
export default { | ||
"Alive: basic": ( | ||
<Wrapper> | ||
<TimelineAliveDuration data-snapshot /> | ||
</Wrapper> | ||
), | ||
"Network: fetching": ( | ||
<Wrapper> | ||
<TimelineNetworkDuration data-snapshot state="fetching" /> | ||
</Wrapper> | ||
), | ||
"Network: success": ( | ||
<Wrapper> | ||
<TimelineNetworkDuration data-snapshot state="success" /> | ||
</Wrapper> | ||
), | ||
"Network: error": ( | ||
<Wrapper> | ||
<TimelineNetworkDuration data-snapshot state="error" /> | ||
</Wrapper> | ||
), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,43 @@ | ||
import styled from "styled-components"; | ||
import React, { FC, ComponentProps } from "react"; | ||
import { useTooltip, TimelineTooltip } from "./TimelineTooltip"; | ||
|
||
export const TimelineDuration = styled.div` | ||
export const TimelineAliveDuration = styled.div` | ||
height: 20px; | ||
background: ${(props) => props.theme.dark["+1"]}; | ||
`; | ||
|
||
type NetworkState = "fetching" | "success" | "error"; | ||
|
||
export const NetworkDuration = styled.div` | ||
height: 10px; | ||
&[data-state="fetching"] { | ||
background: ${(props) => props.theme.blue["-1"]}; | ||
} | ||
&[data-state="success"] { | ||
background: ${(props) => props.theme.green["0"]}; | ||
} | ||
&[data-state="error"] { | ||
background: ${(props) => props.theme.red["0"]}; | ||
} | ||
`; | ||
|
||
export const TimelineNetworkDuration: FC< | ||
{ state: NetworkState } & ComponentProps<typeof NetworkDuration> | ||
> = ({ state, ...props }) => { | ||
const { ref, tooltipProps, isVisible } = useTooltip(); | ||
|
||
return ( | ||
<> | ||
<NetworkDuration data-state={state} ref={ref} {...props} /> | ||
{isVisible && ( | ||
<TimelineTooltip {...tooltipProps}> | ||
{`Network state: ${state}`} | ||
</TimelineTooltip> | ||
)} | ||
</> | ||
); | ||
}; |
38 changes: 38 additions & 0 deletions
38
src/panel/pages/timeline/components/TimelineNetworkDuration.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React, { FC, ComponentProps } from "react"; | ||
import styled from "styled-components"; | ||
import { useTooltip, TimelineTooltip } from "./TimelineTooltip"; | ||
|
||
type NetworkState = "fetching" | "success" | "error"; | ||
|
||
export const NetworkDuration = styled.div` | ||
height: 10px; | ||
&[data-state="fetching"] { | ||
background: ${(props) => props.theme.blue["-1"]}; | ||
} | ||
&[data-state="success"] { | ||
background: ${(props) => props.theme.green["0"]}; | ||
} | ||
&[data-state="error"] { | ||
background: ${(props) => props.theme.red["0"]}; | ||
} | ||
`; | ||
|
||
export const TimelineNetworkDuration: FC< | ||
{ state: NetworkState } & ComponentProps<typeof NetworkDuration> | ||
> = ({ state, ...props }) => { | ||
const { ref, tooltipProps, isVisible } = useTooltip(); | ||
|
||
return ( | ||
<> | ||
<NetworkDuration data-state={state} ref={ref} {...props} /> | ||
{isVisible && ( | ||
<TimelineTooltip {...tooltipProps}> | ||
{`Network state: ${state}`} | ||
</TimelineTooltip> | ||
)} | ||
</> | ||
); | ||
}; |
53 changes: 0 additions & 53 deletions
53
src/panel/pages/timeline/components/TimelineRequest.fixture.tsx
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.