WandbChart API#
Bases: AnyWidget
Live line chart that polls wandb for metric data via the GraphQL API.
Renders a Canvas-based chart that auto-updates while runs are active. Supports multiple runs for side-by-side comparison and optional rolling smoothing (rolling mean, exponential moving average, or gaussian) with raw data shown behind the smoothed line.
Examples:
import wandb
from wigglystuff import WandbChart, EnvConfig
config = EnvConfig(["WANDB_API_KEY"])
config.require_valid()
run = wandb.init(project="my-project")
chart = WandbChart(
api_key=config["WANDB_API_KEY"],
entity=run.entity,
project=run.project,
runs=[run],
key="loss",
)
chart
Create a WandbChart widget.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
api_key
|
Your wandb API key. |
required | |
entity
|
The wandb entity (user or team). |
required | |
project
|
The wandb project name. |
required | |
runs
|
Optional[Sequence[Any]]
|
A list of wandb Run objects or dicts with |
None
|
key
|
The metric key to chart (e.g. |
required | |
poll_seconds
|
Seconds between polling updates, or |
required | |
smoothing_kind
|
Type of smoothing: |
required | |
smoothing_param
|
Smoothing parameter, or |
required | |
show_slider
|
Whether to show the smoothing slider in the UI. |
required | |
width
|
Chart width in pixels. |
required | |
height
|
Chart height in pixels. |
required | |
**kwargs
|
Any
|
Forwarded to |
{}
|
Source code in wigglystuff/wandb_chart.py
Synced traitlets#
| Traitlet | Type | Notes |
|---|---|---|
api_key |
str |
Your wandb API key. |
entity |
str |
The wandb entity (user or team). |
project |
str |
The wandb project name. |
key |
str |
The metric key to chart (e.g. "loss"). |
poll_seconds |
int \| None |
Seconds between polling updates, or None for manual refresh (default: 5). |
smoothing_kind |
str |
Type of smoothing: "rolling", "exponential", or "gaussian" (default: "gaussian"). |
smoothing_param |
float \| None |
Smoothing parameter, or None for no smoothing. |
show_slider |
bool |
Whether to show the smoothing slider (default: True). |
width |
int |
Chart width in pixels (default: 700). |
height |
int |
Chart height in pixels (default: 300). |