Skip to main content

Function: Trajectory()

Trajectory(__namedParameters): ReactElement<unknown, string | JSXElementConstructor<any>> | null

Defined in: packages/sdvplot/src/react/three.tsx:188

A team-coloured tube along a 3D path (a pitch, a ball flight) in a react-three-fiber scene: trajectoryTube as one mesh, radius round in the points' world units, drawn unlit and not tone-mapped so the team's colour shows as it is. Put it inside your <Canvas>, over a <Surface3D> in the same units. three and @react-three/fiber load when it first renders, never with sdvplot/react; a missing peer throws OptionalDependencyError then (kept until the page reloads, so installing the peer needs a reload), and a bad radius or colour throws InputError. With team, the team's league must be loaded for its colour: until it is, the tube draws nothing (one warning), and in the browser it loads the league and then draws. A server render draws nothing.

See it drawn in the Three.js guide (sdvplot/three/statcast-pitches in the gallery).

Parameters​

__namedParameters​

TrajectoryProps

Returns​

ReactElement<unknown, string | JSXElementConstructor<any>> | null