overview: one endpoint, live projections and a response cache (m36)
This commit is contained in:
@@ -2,7 +2,7 @@ import * as stylex from "@stylexjs/stylex";
|
||||
import { Group } from "@visx/group";
|
||||
import { BarStack } from "@visx/shape";
|
||||
import { formatTime } from "@/lib/format";
|
||||
import type { Bucket, StatsTimeseries } from "@/lib/types";
|
||||
import type { Bucket } from "@/lib/types";
|
||||
import { styles as shared } from "@/ui/styles";
|
||||
import { colors } from "@/ui/tokens.stylex";
|
||||
import {
|
||||
@@ -103,7 +103,17 @@ function tooltipOf(column: Column): TooltipContent {
|
||||
};
|
||||
}
|
||||
|
||||
export default function TimeseriesChart({ data }: { data: StatsTimeseries }) {
|
||||
/**
|
||||
* The slice of the Overview body this chart draws. Declared here rather than
|
||||
* taken whole, so what the chart reads is stated where it is read.
|
||||
*/
|
||||
export interface TimeseriesData {
|
||||
since: number;
|
||||
bucket_seconds: number;
|
||||
buckets: Bucket[];
|
||||
}
|
||||
|
||||
export default function TimeseriesChart({ data }: { data: TimeseriesData }) {
|
||||
const [containerRef, width] = useMeasuredWidth();
|
||||
// A hover survives a re-render only while it still names the same bucket at
|
||||
// the same place: a poll that rolls the window, or a resize, retires it.
|
||||
|
||||
Reference in New Issue
Block a user