Skip to main content
Version: v0.1.0

PointCloud

Static file loader with progressive rendering. Accepts PLY, XYZ, LAS, and (with loaderFactory) LAZ.

import { PointCloud } from "pointflow";

Quick example

<PointCloud
src="/scans/building.ply"
colorBy="intensity"
maxPoints={2_000_000}
/>

Props

Required

PropTypeDescription
srcPointCloudSourceURL string, File, Blob, URL, or Request.

Capacity

PropTypeDefaultDescription
maxPointsnumberFrom file header, or 1,000,000Maximum retained points. Excess points are drop-oldest evicted.

Rendering

PropTypeDefaultDescription
colorBystringFirst attributeAttribute key to colour by.
rendererBackend"auto" | "webgpu" | "webgl""auto"
frustumCullingbooleantrue
autoLodbooleanAuto (on above 500k)
lodLevelnumber0Fixed LOD level.
visualRefreshRateHznumber8Lower default than streaming because files don't change.
adaptiveRefreshbooleanfalse
adaptiveIngestbooleanfalse

Parser

PropTypeDefaultDescription
chunkSizenumber10_000Points parsed per batch. Smaller = smoother progressive rendering.
loaderFactory() => WorkerStandard loaderPass createLazLoader from pointflow/laz to add LAZ support.

Point picking

PropTypeDefaultDescription
onPointPick(pt: PickedPoint) => voidundefined
pickRadiusnumber8
pickStrategyPickStrategy"highestImportance"

Lifecycle

PropTypeDescription
onLoadControls({ abort }) => voidReceive an abort() function for cancellation.
onLoadTelemetry(event) => voidPer-phase load events: start, header, chunk, done, error, abort.
onError(err: Error) => voidCalled on load failure.
onRendererResolved(backend) => void
renderMetricsRefReact.MutableRefObject<...>
configPointFlowConfig

PointCloudSource type

type PointCloudSource = string | URL | Request | File | Blob;

Load telemetry phases

PhaseWhen it fires
startFile fetch or read begins.
headerFile header parsed (format, point count, attributes known).
chunkA batch of points ingested. progress is 0–1.
doneAll points ingested. progress is 1.
errorLoad failed.
abortLoad cancelled via abort().

PointCloudDropzone

PointCloudDropzone gives you a drag-and-drop area that feeds into PointCloud:

import { PointCloud, PointCloudDropzone } from "pointflow";
import { useState } from "react";

export function DropScene() {
const [src, setSrc] = useState<File | null>(null);

return (
<>
<PointCloudDropzone onSourceChange={setSrc} />
{src && <PointCloud src={src} />}
</>
);
}

PointCloudDropzone accepts standard HTML div props plus onSourceChange: (source: File) => void.