Skip to main content

@ies-tools/viewer/react

Functions​

IntensityGraph()​

function IntensityGraph(props): Element;

SVG photometric intensity diagrams: complete polar or Cartesian cuts, or a 3D intensity topology. Needs no GPU; all geometry is also available through @ies-tools/viewer/graphs.

Parameters​

ParameterTypeDescription
propsIntensityGraphPropsSee IntensityGraphProps.

Returns​

Element

Example​

<IntensityGraph profile={profile} principalPlanes />
<IntensityGraph profile={profile} projection="cartesian" planes={[0, 45, 90]} />

IsoluxGraph()​

function IsoluxGraph(props): Element;

SVG ground-plane illuminance heatmap with lux contours, for a fixture at a mounting height and aim.

Parameters​

ParameterTypeDescription
propsIsoluxGraphPropsSee IsoluxGraphProps.

Returns​

Element

Example​

<IsoluxGraph profile={profile} mountingHeight={3} extent={[12, 8]} aimAngle={30} />

ValidationChecks()​

function ValidationChecks(props): Element;

Validation status and diagnostic list, as shown in PhotometryInfoPanel.

Parameters​

ParameterTypeDescription
props{ validation: PhotometryValidation; strict: boolean; }The validation result and whether strict validation is enabled.
props.validationPhotometryValidation-
props.strictboolean-

Returns​

Element


PhotometryInfoPanel()​

function PhotometryInfoPanel(props): Element;

Shared React inspection surface: the data is the same model consumed by the CLI.

Parameters​

ParameterTypeDescription
propsPhotometryInfoPanelPropsSee PhotometryInfoPanelProps.

Returns​

Element


ViewerSettingsPanel()​

function ViewerSettingsPanel(props): Element;

Shared React controls for the custom element, React viewer, and embedded applications.

Parameters​

ParameterTypeDescription
propsViewerSettingsPanelPropsSee ViewerSettingsPanelProps.

Returns​

Element


LightViewer()​

function LightViewer(props): Element;

Interactive Three.js preview of a luminaire lighting a floor and wall. Requires WebGL2 on a hardware GPU.

Parameters​

ParameterTypeDescription
propsLightViewerPropsSee LightViewerProps.

Returns​

Element

Example​

<LightViewer src="/lights/luminaire.ldt" lampSetIndex={0} exposure={1.5} onError={console.error} />

Interfaces​

IntensityGraphProps​

Props for IntensityGraph.

Extends​

  • IntensityCurveOptions

Properties​

PropertyTypeDescriptionInherited from
axis?GraphAxis-IntensityCurveOptions.axis
angle?number-IntensityCurveOptions.angle
planes?readonly number[]Fixed planes: azimuth for vertical sweeps; vertical angle for horizontal sweeps.IntensityCurveOptions.planes
principalPlanes?booleanUse C0–C180 and C90–C270 when planes are omitted and axis is vertical.IntensityCurveOptions.principalPlanes
samples?numberOdd sample count includes nadir in complete opposed-plane vertical cuts.IntensityCurveOptions.samples
lampTilt?numberLamp-dependent IES correction angle, independent of fixture aiming.IntensityCurveOptions.lampTilt
profileIESProfileType C profile to plot.-
projection?"polar" | "cartesian" | "topology"Polar or Cartesian intensity cuts, or a 3D intensity topology. Defaults to polar.-
upAxis?UpAxisVertical axis of the topology view.-
topologyProjection?"orthographic" | "perspective"Camera projection of the topology view.-
viewAzimuth?numberTopology camera azimuth in degrees.-
viewElevation?numberTopology camera elevation in degrees.-
surface?"filled" | "wireframe" | "both"Topology surface style.-
horizontalSegments?numberTopology mesh segments around the horizontal C angle.-
verticalSegments?numberTopology mesh segments along the vertical gamma angle.-
logScale?booleanPolar radius and Cartesian intensity axis span three decades on a log scale. Defaults to false.-
aspectRatio?numberViewbox width / height; the background fills it and the graph is centered (Cartesian plots widen). Defaults to the native layout.-
className?string--
style?CSSProperties--

IsoluxGraphProps​

Props for IsoluxGraph.

Extends​

  • IsoluxOptions

Properties​

PropertyTypeDescriptionInherited from
mountingHeight?number-IsoluxOptions.mountingHeight
extent?number | Point2Full ground width/depth in metres, centered below the fixture.IsoluxOptions.extent
resolution?number | Point2Grid points per axis, not cells; default 51, maximum 201.IsoluxOptions.resolution
aimAngle?numberAim away from nadir toward azimuth, in degrees. Does not alter the lamp correction.IsoluxOptions.aimAngle
azimuth?numberGround direction measured from +X toward +Z; also orients the C0 plane.IsoluxOptions.azimuth
lampTilt?number-IsoluxOptions.lampTilt
profileIESProfileType C profile to evaluate.-
contourLevels?readonly number[]Absolute lux levels. Omit for a 1-2-5 series from minContour; [] hides contours.-
contours?readonly number[]Deprecated Alias of contourLevels.-
minContour?numberLowest automatic 1-2-5 contour level in lux. Defaults to 1.-
colorScale?"linear" | "log"Heatmap colour mapping. log (default) keeps low-light spill visible; linear maps lux proportionally.-
heatmap?booleanDraw the lux heatmap beneath the contours. Defaults to true.-
aspectRatio?numberViewbox width / height; the background fills it and the graph is centered. Defaults to the native layout.-
className?string--
style?CSSProperties--

PhotometryValidation​

Validation result shown by PhotometryInfoPanel and ValidationChecks.

Properties​

PropertyType
validboolean
diagnosticsPhotometryDiagnostic[]

PhotometryInfoPanelProps​

Props for PhotometryInfoPanel.

Properties​

PropertyTypeDescription
inspectionPhotometryInspection | nullResult of inspectPhotometry from @ies-tools/core, or null before a file loads.
validationPhotometryValidation | nullResult of validatePhotometry from @ies-tools/core.
fileName?string-
fileSize?numberSource size in bytes.
inspectionError?string | nullParse or inspection failure to display.
viewerError?string | nullViewer failure to display.
strict?booleanWhether strict validation is enabled.
onStrictChange?(value) => voidShows a strict-validation checkbox when provided.

ViewerSettingsPanelProps​

Props for ViewerSettingsPanel.

Properties​

PropertyTypeDescription
settingsViewerSettingsCurrent settings to display.
mode?SettingsPanelMode-
onChange(patch) => voidCalled with each changed setting.
onModeChange(mode) => voidCalled when the user opens or closes the panel.
onError?(error) => voidCalled when an entered value is rejected.

LightViewerProps​

Props for LightViewer. Viewer settings such as exposure and showWall may be passed directly.

Extends​

Properties​

PropertyTypeDescriptionOverridesInherited from
document?PhotometricDocumentA native-source document takes precedence, followed by profile, text, iesText, and src.--
text?stringRaw IES or EULUMDAT source text; the format is detected automatically.--
format?PhotometryFormatExplicit ies or ldt input hint for text and src.--
lampSetIndex?numberZero-based LDT alternative lamp configuration.--
profile?IESProfileParsed compatible profile; takes precedence over text and URL sources.--
iesText?stringCompatibility alias for text.--
src?stringURL to fetch; the request is cancelled when the component unmounts or the source changes.--
exposure?numberNonnegative display exposure. Defaults to 1.ViewerSettings.exposure-
settingsPanel?SettingsPanelModeInitial state of the built-in options panel. Defaults to closed.--
className?stringWrapper class name.--
style?CSSPropertiesWrapper style; the default height is 480 pixels.--
onLoad?(profile, info) => voidCalled after each source loads, with the normalized profile and its native document.--
onError?(error) => voidCalled with load and rendering errors; errors are also shown in the component.--
onSettingsChange?(detail) => voidCalled when the user changes a setting in the options panel.--
showWall?booleanShow the back wall. Defaults to true.-ViewerSettings.showWall
wallDistance?numberWall distance from the luminaire in meters. Defaults to 2.-ViewerSettings.wallDistance
floorDistance?numberFloor distance below the luminaire in meters. Defaults to 2.-ViewerSettings.floorDistance
toneMapping?"aces" | "agx" | "neutral" | "reinhard" | "cineon" | "linear" | "none"Tone mapping operator. Defaults to aces.-ViewerSettings.toneMapping
helper?booleanShow the blue beam-extent helper lines (cone or spheres). Defaults to true.-ViewerSettings.helper

ViewerSettings​

Scene and display settings shared by the React viewer and <light-viewer>.

Properties​

PropertyTypeDescription
showWallbooleanShow the back wall. Defaults to true.
wallDistancenumberWall distance from the luminaire in meters. Defaults to 2.
floorDistancenumberFloor distance below the luminaire in meters. Defaults to 2.
toneMapping"aces" | "agx" | "neutral" | "reinhard" | "cineon" | "linear" | "none"Tone mapping operator. Defaults to aces.
exposurenumberNonnegative display exposure. Defaults to 1.
helperbooleanShow the blue beam-extent helper lines (cone or spheres). Defaults to true.

ViewerSettingsChangeDetail​

Properties​

PropertyType
settingsViewerSettings
previousSettingsViewerSettings

PhotometryLoadInfo​

Properties​

PropertyType
documentPhotometricDocument
sourceFormatPhotometryFormat

Type Aliases​

GraphAxis​

type GraphAxis = "vertical" | "horizontal";

UpAxis​

type UpAxis = "x" | "y" | "z";

Point2​

type Point2 = [number, number];

SettingsPanelMode​

type SettingsPanelMode = "open" | "closed" | "hidden";

open shows the panel, closed shows only its toggle button, and hidden shows neither.


ToneMappingName​

type ToneMappingName = typeof TONE_MAPPING_OPTIONS[number]["value"];

PhotometryFormat​

type PhotometryFormat = "ies" | "ldt";

Variables​

TONE_MAPPING_OPTIONS​

const TONE_MAPPING_OPTIONS: readonly [{
value: "aces";
label: "ACES Filmic";
}, {
value: "agx";
label: "AgX";
}, {
value: "neutral";
label: "Neutral";
}, {
value: "reinhard";
label: "Reinhard";
}, {
value: "cineon";
label: "Cineon";
}, {
value: "linear";
label: "Linear";
}, {
value: "none";
label: "None";
}];

DEFAULT_VIEWER_SETTINGS​

const DEFAULT_VIEWER_SETTINGS: Readonly<ViewerSettings>;