@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
| Parameter | Type | Description |
|---|---|---|
props | IntensityGraphProps | See 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
| Parameter | Type | Description |
|---|---|---|
props | IsoluxGraphProps | See 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
| Parameter | Type | Description |
|---|---|---|
props | { validation: PhotometryValidation; strict: boolean; } | The validation result and whether strict validation is enabled. |
props.validation | PhotometryValidation | - |
props.strict | boolean | - |
Returns
Element
PhotometryInfoPanel()
function PhotometryInfoPanel(props): Element;
Shared React inspection surface: the data is the same model consumed by the CLI.
Parameters
| Parameter | Type | Description |
|---|---|---|
props | PhotometryInfoPanelProps | See PhotometryInfoPanelProps. |
Returns
Element
ViewerSettingsPanel()
function ViewerSettingsPanel(props): Element;
Shared React controls for the custom element, React viewer, and embedded applications.
Parameters
| Parameter | Type | Description |
|---|---|---|
props | ViewerSettingsPanelProps | See 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
| Parameter | Type | Description |
|---|---|---|
props | LightViewerProps | See 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
| Property | Type | Description | Inherited 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? | boolean | Use C0–C180 and C90–C270 when planes are omitted and axis is vertical. | IntensityCurveOptions.principalPlanes |
samples? | number | Odd sample count includes nadir in complete opposed-plane vertical cuts. | IntensityCurveOptions.samples |
lampTilt? | number | Lamp-dependent IES correction angle, independent of fixture aiming. | IntensityCurveOptions.lampTilt |
profile | IESProfile | Type C profile to plot. | - |
projection? | "polar" | "cartesian" | "topology" | Polar or Cartesian intensity cuts, or a 3D intensity topology. Defaults to polar. | - |
upAxis? | UpAxis | Vertical axis of the topology view. | - |
topologyProjection? | "orthographic" | "perspective" | Camera projection of the topology view. | - |
viewAzimuth? | number | Topology camera azimuth in degrees. | - |
viewElevation? | number | Topology camera elevation in degrees. | - |
surface? | "filled" | "wireframe" | "both" | Topology surface style. | - |
horizontalSegments? | number | Topology mesh segments around the horizontal C angle. | - |
verticalSegments? | number | Topology mesh segments along the vertical gamma angle. | - |
logScale? | boolean | Polar radius and Cartesian intensity axis span three decades on a log scale. Defaults to false. | - |
aspectRatio? | number | Viewbox 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
| Property | Type | Description | Inherited from |
|---|---|---|---|
mountingHeight? | number | - | IsoluxOptions.mountingHeight |
extent? | number | Point2 | Full ground width/depth in metres, centered below the fixture. | IsoluxOptions.extent |
resolution? | number | Point2 | Grid points per axis, not cells; default 51, maximum 201. | IsoluxOptions.resolution |
aimAngle? | number | Aim away from nadir toward azimuth, in degrees. Does not alter the lamp correction. | IsoluxOptions.aimAngle |
azimuth? | number | Ground direction measured from +X toward +Z; also orients the C0 plane. | IsoluxOptions.azimuth |
lampTilt? | number | - | IsoluxOptions.lampTilt |
profile | IESProfile | Type 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? | number | Lowest 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? | boolean | Draw the lux heatmap beneath the contours. Defaults to true. | - |
aspectRatio? | number | Viewbox 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
| Property | Type |
|---|---|
valid | boolean |
diagnostics | PhotometryDiagnostic[] |
PhotometryInfoPanelProps
Props for PhotometryInfoPanel.
Properties
| Property | Type | Description |
|---|---|---|
inspection | PhotometryInspection | null | Result of inspectPhotometry from @ies-tools/core, or null before a file loads. |
validation | PhotometryValidation | null | Result of validatePhotometry from @ies-tools/core. |
fileName? | string | - |
fileSize? | number | Source size in bytes. |
inspectionError? | string | null | Parse or inspection failure to display. |
viewerError? | string | null | Viewer failure to display. |
strict? | boolean | Whether strict validation is enabled. |
onStrictChange? | (value) => void | Shows a strict-validation checkbox when provided. |
ViewerSettingsPanelProps
Props for ViewerSettingsPanel.
Properties
| Property | Type | Description |
|---|---|---|
settings | ViewerSettings | Current settings to display. |
mode? | SettingsPanelMode | - |
onChange | (patch) => void | Called with each changed setting. |
onModeChange | (mode) => void | Called when the user opens or closes the panel. |
onError? | (error) => void | Called when an entered value is rejected. |
LightViewerProps
Props for LightViewer. Viewer settings such as exposure and showWall may be passed directly.
Extends
Partial<ViewerSettings>
Properties
| Property | Type | Description | Overrides | Inherited from |
|---|---|---|---|---|
document? | PhotometricDocument | A native-source document takes precedence, followed by profile, text, iesText, and src. | - | - |
text? | string | Raw IES or EULUMDAT source text; the format is detected automatically. | - | - |
format? | PhotometryFormat | Explicit ies or ldt input hint for text and src. | - | - |
lampSetIndex? | number | Zero-based LDT alternative lamp configuration. | - | - |
profile? | IESProfile | Parsed compatible profile; takes precedence over text and URL sources. | - | - |
iesText? | string | Compatibility alias for text. | - | - |
src? | string | URL to fetch; the request is cancelled when the component unmounts or the source changes. | - | - |
exposure? | number | Nonnegative display exposure. Defaults to 1. | ViewerSettings.exposure | - |
settingsPanel? | SettingsPanelMode | Initial state of the built-in options panel. Defaults to closed. | - | - |
className? | string | Wrapper class name. | - | - |
style? | CSSProperties | Wrapper style; the default height is 480 pixels. | - | - |
onLoad? | (profile, info) => void | Called after each source loads, with the normalized profile and its native document. | - | - |
onError? | (error) => void | Called with load and rendering errors; errors are also shown in the component. | - | - |
onSettingsChange? | (detail) => void | Called when the user changes a setting in the options panel. | - | - |
showWall? | boolean | Show the back wall. Defaults to true. | - | ViewerSettings.showWall |
wallDistance? | number | Wall distance from the luminaire in meters. Defaults to 2. | - | ViewerSettings.wallDistance |
floorDistance? | number | Floor 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? | boolean | Show 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
ViewerSettingsChangeDetail
Properties
| Property | Type |
|---|---|
settings | ViewerSettings |
previousSettings | ViewerSettings |
PhotometryLoadInfo
Properties
| Property | Type |
|---|---|
document | PhotometricDocument |
sourceFormat | PhotometryFormat |
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>;