PitchKit
API Reference@pitchkit/coreInterfaces

KdeLayer

Defined in: packages/core/src/scene/types.ts:164

A smooth 2D kernel density estimate (mplsoccer's kdeplot), evaluated on a grid and painted as a continuous surface. Unlike the binned layers, low-density areas fade out rather than being filled with colorMin, so the pitch stays visible underneath. Canvas-rendered.

Type Parameters

Type ParameterDefault type
Tunknown

Properties

PropertyModifierTypeDescriptionDefined in
bandwidth?readonlynumberKernel bandwidth in provider units; omitted = Silverman's rule of thumb per axis.packages/core/src/scene/types.ts:174
colorMax?readonlystring-packages/core/src/scene/types.ts:176
colorMin?readonlystring-packages/core/src/scene/types.ts:175
datareadonlyreadonly T[]-packages/core/src/scene/types.ts:166
maxOpacity?readonlynumberOpacity at the densest cell; density fades linearly to fully transparent at zero.packages/core/src/scene/types.ts:178
resolution?readonlynumberGrid cells per axis the estimate is sampled on; higher = smoother, slower.packages/core/src/scene/types.ts:172
typereadonly"kde"-packages/core/src/scene/types.ts:165
weight?readonlyAccessor<T, number>Omitted = every point counts equally; provided = each point's contribution is scaled by this.packages/core/src/scene/types.ts:170
xreadonlyAccessor<T, number>-packages/core/src/scene/types.ts:167
yreadonlyAccessor<T, number>-packages/core/src/scene/types.ts:168

On this page