Timing Waterfall

Request timing waterfall web component: one stacked bar and a legend showing where a request's time went (DNS, connect, waiting, download).

  • 2.9 KB gzipped
  • @lit-material/timing-waterfall 1.8.0
  • Renders on the server

Example

Install

npm install @lit-material/timing-waterfall @lit-material/tokens
import "@lit-material/timing-waterfall";

Link @lit-material/tokens/css/index.css once per page for the colour, type and shape tokens. Install guide

API

<lit-material-timing-waterfall>

Where a request's time went: one stacked bar, a segment per phase in proportion to its time, and a legend with each phase's milliseconds and the total. Give it timings (DNS, connect, waiting, download — a reused connection says so) or your own phases.

Properties

PropertyAttributeTypeDefaultDescription
timingstimingsRequestTimings | nullnullDNS, connect, waiting and download times (HITOP's report shape).
phasesphasesTimingPhase[][]Your own phases instead of timings.
hideLegendhide-legendbooleanfalseHide the legend and show the bar only.

CSS parts

PartDescription
barThe bar.
segmentEach segment.
legendThe legend.

CSS custom properties

PropertyDescription
--lit-material-timing-waterfall-dnsThe DNS segment's colour.
--lit-material-timing-waterfall-connectThe connect segment's colour.
--lit-material-timing-waterfall-waitThe waiting segment's colour.
--lit-material-timing-waterfall-downloadThe download segment's colour.
--lit-material-timing-waterfall-trackThe bar's background (default: surface container).
--lit-material-timing-waterfall-heightThe bar's height (default 8px).

Source on GitHub npm