maplibre-gl-lidar 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +395 -0
- package/dist/LidarControl-BFJN1DIQ.js +37815 -0
- package/dist/LidarControl-BFJN1DIQ.js.map +1 -0
- package/dist/LidarControl-CQjIl4U5.cjs +37814 -0
- package/dist/LidarControl-CQjIl4U5.cjs.map +1 -0
- package/dist/index.cjs +21 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.mjs +21 -0
- package/dist/index.mjs.map +1 -0
- package/dist/laz-perf.wasm +0 -0
- package/dist/laz_rs_wasm_bg.wasm +0 -0
- package/dist/libs/laz_rs_wasm_bg.wasm +0 -0
- package/dist/maplibre-gl-lidar.css +570 -0
- package/dist/react.cjs +179 -0
- package/dist/react.cjs.map +1 -0
- package/dist/react.mjs +179 -0
- package/dist/react.mjs.map +1 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/lib/colorizers/ColorScheme.d.ts +60 -0
- package/dist/types/lib/colorizers/ColorScheme.d.ts.map +1 -0
- package/dist/types/lib/colorizers/index.d.ts +3 -0
- package/dist/types/lib/colorizers/index.d.ts.map +1 -0
- package/dist/types/lib/colorizers/types.d.ts +17 -0
- package/dist/types/lib/colorizers/types.d.ts.map +1 -0
- package/dist/types/lib/core/DeckOverlay.d.ts +64 -0
- package/dist/types/lib/core/DeckOverlay.d.ts.map +1 -0
- package/dist/types/lib/core/LidarControl.d.ts +318 -0
- package/dist/types/lib/core/LidarControl.d.ts.map +1 -0
- package/dist/types/lib/core/LidarControlReact.d.ts +35 -0
- package/dist/types/lib/core/LidarControlReact.d.ts.map +1 -0
- package/dist/types/lib/core/ViewportManager.d.ts +105 -0
- package/dist/types/lib/core/ViewportManager.d.ts.map +1 -0
- package/dist/types/lib/core/types.d.ts +235 -0
- package/dist/types/lib/core/types.d.ts.map +1 -0
- package/dist/types/lib/gui/DualRangeSlider.d.ts +46 -0
- package/dist/types/lib/gui/DualRangeSlider.d.ts.map +1 -0
- package/dist/types/lib/gui/FileInput.d.ts +44 -0
- package/dist/types/lib/gui/FileInput.d.ts.map +1 -0
- package/dist/types/lib/gui/PanelBuilder.d.ts +117 -0
- package/dist/types/lib/gui/PanelBuilder.d.ts.map +1 -0
- package/dist/types/lib/gui/RangeSlider.d.ts +50 -0
- package/dist/types/lib/gui/RangeSlider.d.ts.map +1 -0
- package/dist/types/lib/gui/index.d.ts +7 -0
- package/dist/types/lib/gui/index.d.ts.map +1 -0
- package/dist/types/lib/hooks/index.d.ts +3 -0
- package/dist/types/lib/hooks/index.d.ts.map +1 -0
- package/dist/types/lib/hooks/useLidarState.d.ts +52 -0
- package/dist/types/lib/hooks/useLidarState.d.ts.map +1 -0
- package/dist/types/lib/hooks/usePointCloud.d.ts +53 -0
- package/dist/types/lib/hooks/usePointCloud.d.ts.map +1 -0
- package/dist/types/lib/layers/PointCloudManager.d.ts +136 -0
- package/dist/types/lib/layers/PointCloudManager.d.ts.map +1 -0
- package/dist/types/lib/layers/index.d.ts +3 -0
- package/dist/types/lib/layers/index.d.ts.map +1 -0
- package/dist/types/lib/layers/types.d.ts +71 -0
- package/dist/types/lib/layers/types.d.ts.map +1 -0
- package/dist/types/lib/loaders/CopcStreamingLoader.d.ts +217 -0
- package/dist/types/lib/loaders/CopcStreamingLoader.d.ts.map +1 -0
- package/dist/types/lib/loaders/PointCloudLoader.d.ts +61 -0
- package/dist/types/lib/loaders/PointCloudLoader.d.ts.map +1 -0
- package/dist/types/lib/loaders/index.d.ts +5 -0
- package/dist/types/lib/loaders/index.d.ts.map +1 -0
- package/dist/types/lib/loaders/streaming-types.d.ts +122 -0
- package/dist/types/lib/loaders/streaming-types.d.ts.map +1 -0
- package/dist/types/lib/loaders/types.d.ts +83 -0
- package/dist/types/lib/loaders/types.d.ts.map +1 -0
- package/dist/types/lib/utils/helpers.d.ts +91 -0
- package/dist/types/lib/utils/helpers.d.ts.map +1 -0
- package/dist/types/lib/utils/index.d.ts +2 -0
- package/dist/types/lib/utils/index.d.ts.map +1 -0
- package/dist/types/react.d.ts +6 -0
- package/dist/types/react.d.ts.map +1 -0
- package/package.json +118 -0
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { Map } from 'maplibre-gl';
|
|
2
|
+
/**
|
|
3
|
+
* COPC loading mode options
|
|
4
|
+
*/
|
|
5
|
+
export type CopcLoadingMode = 'full' | 'dynamic';
|
|
6
|
+
/**
|
|
7
|
+
* Color scheme options for point cloud visualization
|
|
8
|
+
*/
|
|
9
|
+
export type ColorSchemeType = 'elevation' | 'intensity' | 'classification' | 'rgb';
|
|
10
|
+
/**
|
|
11
|
+
* Custom color scheme configuration
|
|
12
|
+
*/
|
|
13
|
+
export interface ColorSchemeConfig {
|
|
14
|
+
type: 'gradient' | 'categorical';
|
|
15
|
+
attribute: string;
|
|
16
|
+
colors?: string[];
|
|
17
|
+
domain?: [number, number];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Color scheme can be a preset string or custom configuration
|
|
21
|
+
*/
|
|
22
|
+
export type ColorScheme = ColorSchemeType | ColorSchemeConfig;
|
|
23
|
+
/**
|
|
24
|
+
* Point cloud bounding box
|
|
25
|
+
*/
|
|
26
|
+
export interface PointCloudBounds {
|
|
27
|
+
minX: number;
|
|
28
|
+
maxX: number;
|
|
29
|
+
minY: number;
|
|
30
|
+
maxY: number;
|
|
31
|
+
minZ: number;
|
|
32
|
+
maxZ: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Information about a loaded point cloud
|
|
36
|
+
*/
|
|
37
|
+
export interface PointCloudInfo {
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
pointCount: number;
|
|
41
|
+
bounds: PointCloudBounds;
|
|
42
|
+
hasRGB: boolean;
|
|
43
|
+
hasIntensity: boolean;
|
|
44
|
+
hasClassification: boolean;
|
|
45
|
+
source: string;
|
|
46
|
+
/** WKT string describing the coordinate reference system */
|
|
47
|
+
wkt?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Options for configuring the LidarControl
|
|
51
|
+
*/
|
|
52
|
+
export interface LidarControlOptions {
|
|
53
|
+
/**
|
|
54
|
+
* Whether the control panel should start collapsed
|
|
55
|
+
* @default true
|
|
56
|
+
*/
|
|
57
|
+
collapsed?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Position of the control on the map
|
|
60
|
+
* @default 'top-right'
|
|
61
|
+
*/
|
|
62
|
+
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
63
|
+
/**
|
|
64
|
+
* Title displayed in the control header
|
|
65
|
+
* @default 'LiDAR Viewer'
|
|
66
|
+
*/
|
|
67
|
+
title?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Width of the control panel in pixels
|
|
70
|
+
* @default 320
|
|
71
|
+
*/
|
|
72
|
+
panelWidth?: number;
|
|
73
|
+
/**
|
|
74
|
+
* Maximum height of the control panel in pixels.
|
|
75
|
+
* When content exceeds this height, a vertical scrollbar appears.
|
|
76
|
+
* @default 500
|
|
77
|
+
*/
|
|
78
|
+
panelMaxHeight?: number;
|
|
79
|
+
/**
|
|
80
|
+
* Custom CSS class name for the control container
|
|
81
|
+
*/
|
|
82
|
+
className?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Point size in pixels
|
|
85
|
+
* @default 2
|
|
86
|
+
*/
|
|
87
|
+
pointSize?: number;
|
|
88
|
+
/**
|
|
89
|
+
* Point cloud opacity (0-1)
|
|
90
|
+
* @default 1.0
|
|
91
|
+
*/
|
|
92
|
+
opacity?: number;
|
|
93
|
+
/**
|
|
94
|
+
* Color scheme for visualization
|
|
95
|
+
* @default 'elevation'
|
|
96
|
+
*/
|
|
97
|
+
colorScheme?: ColorScheme;
|
|
98
|
+
/**
|
|
99
|
+
* Whether to use percentile range (2-98%) for elevation/intensity coloring.
|
|
100
|
+
* When true, outliers are clipped for better color distribution.
|
|
101
|
+
* @default true
|
|
102
|
+
*/
|
|
103
|
+
usePercentile?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Maximum number of points to display
|
|
106
|
+
* @default 1000000
|
|
107
|
+
*/
|
|
108
|
+
pointBudget?: number;
|
|
109
|
+
/**
|
|
110
|
+
* Elevation range filter [min, max] or null for no filter
|
|
111
|
+
* @default null
|
|
112
|
+
*/
|
|
113
|
+
elevationRange?: [number, number] | null;
|
|
114
|
+
/**
|
|
115
|
+
* Whether points are pickable (enables hover/click interactions)
|
|
116
|
+
* @default false
|
|
117
|
+
*/
|
|
118
|
+
pickable?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Whether to automatically zoom to the data extent after loading
|
|
121
|
+
* @default true
|
|
122
|
+
*/
|
|
123
|
+
autoZoom?: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* List of attribute names to display in the pick point info panel.
|
|
126
|
+
* If not specified or empty, all available attributes will be shown.
|
|
127
|
+
* Example: ['GpsTime', 'ReturnNumber', 'Classification', 'Intensity']
|
|
128
|
+
* @default undefined (show all)
|
|
129
|
+
*/
|
|
130
|
+
pickInfoFields?: string[];
|
|
131
|
+
/**
|
|
132
|
+
* Whether Z offset adjustment is enabled
|
|
133
|
+
* @default false
|
|
134
|
+
*/
|
|
135
|
+
zOffsetEnabled?: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Z offset value in meters (shifts point cloud vertically)
|
|
138
|
+
* @default 0
|
|
139
|
+
*/
|
|
140
|
+
zOffset?: number;
|
|
141
|
+
/**
|
|
142
|
+
* Loading mode for COPC files: 'full' loads entire file, 'dynamic' streams based on viewport
|
|
143
|
+
* @default 'full'
|
|
144
|
+
*/
|
|
145
|
+
copcLoadingMode?: CopcLoadingMode;
|
|
146
|
+
/**
|
|
147
|
+
* Point budget for streaming mode (maximum points in memory)
|
|
148
|
+
* @default 5000000
|
|
149
|
+
*/
|
|
150
|
+
streamingPointBudget?: number;
|
|
151
|
+
/**
|
|
152
|
+
* Maximum concurrent requests for streaming mode
|
|
153
|
+
* @default 4
|
|
154
|
+
*/
|
|
155
|
+
streamingMaxConcurrentRequests?: number;
|
|
156
|
+
/**
|
|
157
|
+
* Debounce time for viewport changes in streaming mode (ms)
|
|
158
|
+
* @default 150
|
|
159
|
+
*/
|
|
160
|
+
streamingViewportDebounceMs?: number;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Internal state of the LiDAR control
|
|
164
|
+
*/
|
|
165
|
+
export interface LidarState {
|
|
166
|
+
collapsed: boolean;
|
|
167
|
+
panelWidth: number;
|
|
168
|
+
panelMaxHeight: number;
|
|
169
|
+
pointClouds: PointCloudInfo[];
|
|
170
|
+
activePointCloudId: string | null;
|
|
171
|
+
pointSize: number;
|
|
172
|
+
opacity: number;
|
|
173
|
+
colorScheme: ColorScheme;
|
|
174
|
+
/** Whether to use percentile range (2-98%) for elevation/intensity coloring */
|
|
175
|
+
usePercentile: boolean;
|
|
176
|
+
elevationRange: [number, number] | null;
|
|
177
|
+
pointBudget: number;
|
|
178
|
+
pickable: boolean;
|
|
179
|
+
loading: boolean;
|
|
180
|
+
error: string | null;
|
|
181
|
+
/** List of attribute names to show in pick info, or undefined to show all */
|
|
182
|
+
pickInfoFields?: string[];
|
|
183
|
+
/** Whether Z offset adjustment is enabled */
|
|
184
|
+
zOffsetEnabled: boolean;
|
|
185
|
+
/** Z offset value in meters */
|
|
186
|
+
zOffset: number;
|
|
187
|
+
/** Whether streaming mode is active */
|
|
188
|
+
streamingActive?: boolean;
|
|
189
|
+
/** Current streaming progress */
|
|
190
|
+
streamingProgress?: {
|
|
191
|
+
loadedNodes: number;
|
|
192
|
+
loadedPoints: number;
|
|
193
|
+
queueSize: number;
|
|
194
|
+
isLoading: boolean;
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Event types emitted by the LiDAR control
|
|
199
|
+
*/
|
|
200
|
+
export type LidarControlEvent = 'collapse' | 'expand' | 'statechange' | 'load' | 'loadstart' | 'loaderror' | 'unload' | 'stylechange' | 'streamingprogress' | 'streamingstart' | 'streamingstop' | 'budgetreached';
|
|
201
|
+
/**
|
|
202
|
+
* Event data passed to event handlers
|
|
203
|
+
*/
|
|
204
|
+
export interface LidarEventData {
|
|
205
|
+
type: LidarControlEvent;
|
|
206
|
+
state: LidarState;
|
|
207
|
+
pointCloud?: PointCloudInfo;
|
|
208
|
+
error?: Error;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Event handler function type
|
|
212
|
+
*/
|
|
213
|
+
export type LidarControlEventHandler = (event: LidarEventData) => void;
|
|
214
|
+
/**
|
|
215
|
+
* Props for the React wrapper component
|
|
216
|
+
*/
|
|
217
|
+
export interface LidarControlReactProps extends LidarControlOptions {
|
|
218
|
+
/**
|
|
219
|
+
* MapLibre GL map instance
|
|
220
|
+
*/
|
|
221
|
+
map: Map;
|
|
222
|
+
/**
|
|
223
|
+
* Callback fired when the control state changes
|
|
224
|
+
*/
|
|
225
|
+
onStateChange?: (state: LidarState) => void;
|
|
226
|
+
/**
|
|
227
|
+
* Callback fired when a point cloud is loaded
|
|
228
|
+
*/
|
|
229
|
+
onLoad?: (pointCloud: PointCloudInfo) => void;
|
|
230
|
+
/**
|
|
231
|
+
* Callback fired when an error occurs
|
|
232
|
+
*/
|
|
233
|
+
onError?: (error: Error) => void;
|
|
234
|
+
}
|
|
235
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAEvC;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,SAAS,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,WAAW,GAAG,gBAAgB,GAAG,KAAK,CAAC;AAEnF;;GAEG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AE,KAAK,KAAK,IAAI,CAAC;CAClC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for creating a dual-handle range slider
|
|
3
|
+
*/
|
|
4
|
+
export interface DualRangeSliderOptions {
|
|
5
|
+
label: string;
|
|
6
|
+
min: number;
|
|
7
|
+
max: number;
|
|
8
|
+
step: number;
|
|
9
|
+
valueLow: number;
|
|
10
|
+
valueHigh: number;
|
|
11
|
+
onChange: (low: number, high: number) => void;
|
|
12
|
+
formatValue?: (value: number) => string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Creates a dual-handle range slider for selecting a range.
|
|
16
|
+
*/
|
|
17
|
+
export declare class DualRangeSlider {
|
|
18
|
+
private _options;
|
|
19
|
+
private _sliderLow?;
|
|
20
|
+
private _sliderHigh?;
|
|
21
|
+
private _valueDisplay?;
|
|
22
|
+
constructor(options: DualRangeSliderOptions);
|
|
23
|
+
/**
|
|
24
|
+
* Renders the dual slider element.
|
|
25
|
+
*
|
|
26
|
+
* @returns The slider container element
|
|
27
|
+
*/
|
|
28
|
+
render(): HTMLElement;
|
|
29
|
+
/**
|
|
30
|
+
* Sets the slider range programmatically.
|
|
31
|
+
*/
|
|
32
|
+
setRange(low: number, high: number): void;
|
|
33
|
+
/**
|
|
34
|
+
* Updates the min/max bounds of the slider.
|
|
35
|
+
*/
|
|
36
|
+
setBounds(min: number, max: number): void;
|
|
37
|
+
/**
|
|
38
|
+
* Gets the current range values.
|
|
39
|
+
*/
|
|
40
|
+
getRange(): [number, number];
|
|
41
|
+
/**
|
|
42
|
+
* Formats the range for display.
|
|
43
|
+
*/
|
|
44
|
+
private _formatRange;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=DualRangeSlider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DualRangeSlider.d.ts","sourceRoot":"","sources":["../../../../src/lib/gui/DualRangeSlider.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CACzC;AAED;;GAEG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAyB;IACzC,OAAO,CAAC,UAAU,CAAC,CAAmB;IACtC,OAAO,CAAC,WAAW,CAAC,CAAmB;IACvC,OAAO,CAAC,aAAa,CAAC,CAAc;gBAExB,OAAO,EAAE,sBAAsB;IAI3C;;;;OAIG;IACH,MAAM,IAAI,WAAW;IA+KrB;;OAEG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAYzC;;OAEG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAazC;;OAEG;IACH,QAAQ,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;IAM5B;;OAEG;IACH,OAAO,CAAC,YAAY;CAIrB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for creating a file input
|
|
3
|
+
*/
|
|
4
|
+
export interface FileInputOptions {
|
|
5
|
+
accept?: string;
|
|
6
|
+
onChange: (file: File) => void;
|
|
7
|
+
label?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Creates a styled file input with drag-and-drop support.
|
|
11
|
+
*/
|
|
12
|
+
export declare class FileInput {
|
|
13
|
+
private _options;
|
|
14
|
+
private _input?;
|
|
15
|
+
private _label?;
|
|
16
|
+
constructor(options: FileInputOptions);
|
|
17
|
+
/**
|
|
18
|
+
* Renders the file input element.
|
|
19
|
+
*
|
|
20
|
+
* @returns The file input container element
|
|
21
|
+
*/
|
|
22
|
+
render(): HTMLElement;
|
|
23
|
+
/**
|
|
24
|
+
* Sets the label text.
|
|
25
|
+
*
|
|
26
|
+
* @param text - New label text
|
|
27
|
+
*/
|
|
28
|
+
setLabel(text: string): void;
|
|
29
|
+
/**
|
|
30
|
+
* Resets the label to default.
|
|
31
|
+
*/
|
|
32
|
+
resetLabel(): void;
|
|
33
|
+
/**
|
|
34
|
+
* Enables or disables the input.
|
|
35
|
+
*
|
|
36
|
+
* @param enabled - Whether to enable
|
|
37
|
+
*/
|
|
38
|
+
setEnabled(enabled: boolean): void;
|
|
39
|
+
/**
|
|
40
|
+
* Checks if a file has a valid extension.
|
|
41
|
+
*/
|
|
42
|
+
private _isValidFile;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=FileInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileInput.d.ts","sourceRoot":"","sources":["../../../../src/lib/gui/FileInput.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAmB;IACnC,OAAO,CAAC,MAAM,CAAC,CAAmB;IAClC,OAAO,CAAC,MAAM,CAAC,CAAc;gBAEjB,OAAO,EAAE,gBAAgB;IAQrC;;;;OAIG;IACH,MAAM,IAAI,WAAW;IA6DrB;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAS5B;;OAEG;IACH,UAAU,IAAI,IAAI;IAIlB;;;;OAIG;IACH,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAUlC;;OAEG;IACH,OAAO,CAAC,YAAY;CAMrB"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { LidarState, ColorScheme } from '../core/types';
|
|
2
|
+
/**
|
|
3
|
+
* Callbacks for panel interactions
|
|
4
|
+
*/
|
|
5
|
+
export interface PanelBuilderCallbacks {
|
|
6
|
+
onFileSelect: (file: File) => void;
|
|
7
|
+
onUrlSubmit: (url: string) => void;
|
|
8
|
+
onPointSizeChange: (size: number) => void;
|
|
9
|
+
onOpacityChange: (opacity: number) => void;
|
|
10
|
+
onColorSchemeChange: (scheme: ColorScheme) => void;
|
|
11
|
+
onUsePercentileChange: (usePercentile: boolean) => void;
|
|
12
|
+
onElevationRangeChange: (range: [number, number] | null) => void;
|
|
13
|
+
onPickableChange: (pickable: boolean) => void;
|
|
14
|
+
onZOffsetEnabledChange: (enabled: boolean) => void;
|
|
15
|
+
onZOffsetChange: (offset: number) => void;
|
|
16
|
+
onUnload: (id: string) => void;
|
|
17
|
+
onZoomTo: (id: string) => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Builds and manages the LiDAR control panel UI.
|
|
21
|
+
*/
|
|
22
|
+
export declare class PanelBuilder {
|
|
23
|
+
private _callbacks;
|
|
24
|
+
private _state;
|
|
25
|
+
private _contentElement?;
|
|
26
|
+
private _fileInput?;
|
|
27
|
+
private _urlInput?;
|
|
28
|
+
private _loadButton?;
|
|
29
|
+
private _colorSelect?;
|
|
30
|
+
private _percentileCheckbox?;
|
|
31
|
+
private _percentileGroup?;
|
|
32
|
+
private _pointSizeSlider?;
|
|
33
|
+
private _opacitySlider?;
|
|
34
|
+
private _pointCloudsList?;
|
|
35
|
+
private _pickableCheckbox?;
|
|
36
|
+
private _elevationSlider?;
|
|
37
|
+
private _elevationCheckbox?;
|
|
38
|
+
private _zOffsetCheckbox?;
|
|
39
|
+
private _zOffsetSlider?;
|
|
40
|
+
private _zOffsetSliderContainer?;
|
|
41
|
+
private _loadingIndicator?;
|
|
42
|
+
private _errorMessage?;
|
|
43
|
+
constructor(callbacks: PanelBuilderCallbacks, initialState: LidarState);
|
|
44
|
+
/**
|
|
45
|
+
* Builds and returns the panel content.
|
|
46
|
+
*
|
|
47
|
+
* @returns The panel content element
|
|
48
|
+
*/
|
|
49
|
+
build(): HTMLElement;
|
|
50
|
+
/**
|
|
51
|
+
* Updates the UI to reflect the current state.
|
|
52
|
+
*
|
|
53
|
+
* @param state - New state
|
|
54
|
+
*/
|
|
55
|
+
updateState(state: LidarState): void;
|
|
56
|
+
/**
|
|
57
|
+
* Updates the loading progress display.
|
|
58
|
+
*
|
|
59
|
+
* @param progress - Progress value (0-100)
|
|
60
|
+
* @param message - Optional progress message
|
|
61
|
+
*/
|
|
62
|
+
updateLoadingProgress(progress: number, message?: string): void;
|
|
63
|
+
/**
|
|
64
|
+
* Builds the file input section.
|
|
65
|
+
*/
|
|
66
|
+
private _buildFileSection;
|
|
67
|
+
/**
|
|
68
|
+
* Builds the styling controls section.
|
|
69
|
+
*/
|
|
70
|
+
private _buildStylingSection;
|
|
71
|
+
/**
|
|
72
|
+
* Builds the elevation filter controls with checkbox and dual slider.
|
|
73
|
+
*/
|
|
74
|
+
private _buildElevationFilter;
|
|
75
|
+
/**
|
|
76
|
+
* Builds the Z offset control with checkbox and slider.
|
|
77
|
+
*/
|
|
78
|
+
private _buildZOffsetControl;
|
|
79
|
+
/**
|
|
80
|
+
* Gets the elevation bounds from loaded point clouds.
|
|
81
|
+
*/
|
|
82
|
+
private _getElevationBounds;
|
|
83
|
+
/**
|
|
84
|
+
* Builds the percentile checkbox control for elevation/intensity coloring.
|
|
85
|
+
*/
|
|
86
|
+
private _buildPercentileCheckbox;
|
|
87
|
+
/**
|
|
88
|
+
* Updates the visibility of the percentile checkbox based on color scheme.
|
|
89
|
+
* Only shows for elevation and intensity color schemes.
|
|
90
|
+
*/
|
|
91
|
+
private _updatePercentileVisibility;
|
|
92
|
+
/**
|
|
93
|
+
* Builds the pickable checkbox control.
|
|
94
|
+
*/
|
|
95
|
+
private _buildPickableCheckbox;
|
|
96
|
+
/**
|
|
97
|
+
* Builds the loaded point clouds list.
|
|
98
|
+
*/
|
|
99
|
+
private _buildPointCloudsList;
|
|
100
|
+
/**
|
|
101
|
+
* Updates the point clouds list display.
|
|
102
|
+
*/
|
|
103
|
+
private _updatePointCloudsList;
|
|
104
|
+
/**
|
|
105
|
+
* Builds a single point cloud list item.
|
|
106
|
+
*/
|
|
107
|
+
private _buildPointCloudItem;
|
|
108
|
+
/**
|
|
109
|
+
* Builds the loading indicator.
|
|
110
|
+
*/
|
|
111
|
+
private _buildLoadingIndicator;
|
|
112
|
+
/**
|
|
113
|
+
* Builds the error message display.
|
|
114
|
+
*/
|
|
115
|
+
private _buildErrorMessage;
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=PanelBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PanelBuilder.d.ts","sourceRoot":"","sources":["../../../../src/lib/gui/PanelBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAkB,MAAM,eAAe,CAAC;AAM7E;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,mBAAmB,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IACnD,qBAAqB,EAAE,CAAC,aAAa,EAAE,OAAO,KAAK,IAAI,CAAC;IACxD,sBAAsB,EAAE,CAAC,KAAK,EAAE,CAAC,MAAM,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IAAI,WAAW;IA2BpB;;;;OAIG;IACH,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAkFpC;;;;;OAKG;IACH,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IAe/D;;OAEG;IACH,OAAO,CAAC,iBAAiB;IA2DzB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IA0E5B;;OAEG;IACH,OAAO,CAAC,qBAAqB;IA0E7B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAiE5B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAoB3B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAuChC;;;OAGG;IACH,OAAO,CAAC,2BAA2B;IAOnC;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAiC9B;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAmB7B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAkB9B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IA6C5B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAe9B;;OAEG;IACH,OAAO,CAAC,kBAAkB;CAO3B"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for creating a range slider
|
|
3
|
+
*/
|
|
4
|
+
export interface RangeSliderOptions {
|
|
5
|
+
label: string;
|
|
6
|
+
min: number;
|
|
7
|
+
max: number;
|
|
8
|
+
step: number;
|
|
9
|
+
value: number;
|
|
10
|
+
onChange: (value: number) => void;
|
|
11
|
+
formatValue?: (value: number) => string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Creates a styled range slider with label and value display.
|
|
15
|
+
*/
|
|
16
|
+
export declare class RangeSlider {
|
|
17
|
+
private _options;
|
|
18
|
+
private _slider?;
|
|
19
|
+
private _valueDisplay?;
|
|
20
|
+
constructor(options: RangeSliderOptions);
|
|
21
|
+
/**
|
|
22
|
+
* Renders the slider element.
|
|
23
|
+
*
|
|
24
|
+
* @returns The slider container element
|
|
25
|
+
*/
|
|
26
|
+
render(): HTMLElement;
|
|
27
|
+
/**
|
|
28
|
+
* Sets the slider value programmatically.
|
|
29
|
+
*
|
|
30
|
+
* @param value - New value
|
|
31
|
+
*/
|
|
32
|
+
setValue(value: number): void;
|
|
33
|
+
/**
|
|
34
|
+
* Gets the current value.
|
|
35
|
+
*
|
|
36
|
+
* @returns Current slider value
|
|
37
|
+
*/
|
|
38
|
+
getValue(): number;
|
|
39
|
+
/**
|
|
40
|
+
* Enables or disables the slider.
|
|
41
|
+
*
|
|
42
|
+
* @param enabled - Whether to enable
|
|
43
|
+
*/
|
|
44
|
+
setEnabled(enabled: boolean): void;
|
|
45
|
+
/**
|
|
46
|
+
* Formats the value for display.
|
|
47
|
+
*/
|
|
48
|
+
private _formatValue;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=RangeSlider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RangeSlider.d.ts","sourceRoot":"","sources":["../../../../src/lib/gui/RangeSlider.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CACzC;AAED;;GAEG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAqB;IACrC,OAAO,CAAC,OAAO,CAAC,CAAmB;IACnC,OAAO,CAAC,aAAa,CAAC,CAAc;gBAExB,OAAO,EAAE,kBAAkB;IAIvC;;;;OAIG;IACH,MAAM,IAAI,WAAW;IAwCrB;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAS7B;;;;OAIG;IACH,QAAQ,IAAI,MAAM;IAIlB;;;;OAIG;IACH,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAMlC;;OAEG;IACH,OAAO,CAAC,YAAY;CAMrB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { PanelBuilder } from './PanelBuilder';
|
|
2
|
+
export type { PanelBuilderCallbacks } from './PanelBuilder';
|
|
3
|
+
export { RangeSlider } from './RangeSlider';
|
|
4
|
+
export type { RangeSliderOptions } from './RangeSlider';
|
|
5
|
+
export { FileInput } from './FileInput';
|
|
6
|
+
export type { FileInputOptions } from './FileInput';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/gui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { LidarState, ColorScheme } from '../core/types';
|
|
2
|
+
/**
|
|
3
|
+
* Custom hook for managing LiDAR state in React applications.
|
|
4
|
+
*
|
|
5
|
+
* This hook provides a simple way to track and update the state
|
|
6
|
+
* of a LidarControl from React components.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* function MyComponent() {
|
|
11
|
+
* const { state, setPointSize, setColorScheme, toggle } = useLidarState();
|
|
12
|
+
*
|
|
13
|
+
* return (
|
|
14
|
+
* <div>
|
|
15
|
+
* <button onClick={toggle}>
|
|
16
|
+
* {state.collapsed ? 'Expand' : 'Collapse'}
|
|
17
|
+
* </button>
|
|
18
|
+
* <button onClick={() => setColorScheme('intensity')}>
|
|
19
|
+
* Show Intensity
|
|
20
|
+
* </button>
|
|
21
|
+
* <LidarControlReact
|
|
22
|
+
* map={map}
|
|
23
|
+
* collapsed={state.collapsed}
|
|
24
|
+
* pointSize={state.pointSize}
|
|
25
|
+
* colorScheme={state.colorScheme}
|
|
26
|
+
* onStateChange={(newState) => setState(newState)}
|
|
27
|
+
* />
|
|
28
|
+
* </div>
|
|
29
|
+
* );
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @param initialState - Optional initial state values
|
|
34
|
+
* @returns Object containing state and update functions
|
|
35
|
+
*/
|
|
36
|
+
export declare function useLidarState(initialState?: Partial<LidarState>): {
|
|
37
|
+
state: LidarState;
|
|
38
|
+
setState: import('react').Dispatch<import('react').SetStateAction<LidarState>>;
|
|
39
|
+
setCollapsed: (collapsed: boolean) => void;
|
|
40
|
+
setPanelWidth: (panelWidth: number) => void;
|
|
41
|
+
setPointSize: (pointSize: number) => void;
|
|
42
|
+
setOpacity: (opacity: number) => void;
|
|
43
|
+
setColorScheme: (colorScheme: ColorScheme) => void;
|
|
44
|
+
setUsePercentile: (usePercentile: boolean) => void;
|
|
45
|
+
setElevationRange: (elevationRange: [number, number] | null) => void;
|
|
46
|
+
setPointBudget: (pointBudget: number) => void;
|
|
47
|
+
setZOffsetEnabled: (zOffsetEnabled: boolean) => void;
|
|
48
|
+
setZOffset: (zOffset: number) => void;
|
|
49
|
+
reset: () => void;
|
|
50
|
+
toggle: () => void;
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=useLidarState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLidarState.d.ts","sourceRoot":"","sources":["../../../../src/lib/hooks/useLidarState.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAwB7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,aAAa,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC;;;8BASjB,OAAO;gCAOL,MAAM;8BAOR,MAAM;0BAOV,MAAM;kCAOE,WAAW;sCAOP,OAAO;wCAOL,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;kCAO7B,MAAM;wCAOA,OAAO;0BAOrB,MAAM;;;EAkChD"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { PointCloudData, LoaderOptions } from '../loaders/types';
|
|
2
|
+
/**
|
|
3
|
+
* Result of the usePointCloud hook
|
|
4
|
+
*/
|
|
5
|
+
interface UsePointCloudResult {
|
|
6
|
+
/** The loaded point cloud data or null */
|
|
7
|
+
data: PointCloudData | null;
|
|
8
|
+
/** Whether loading is in progress */
|
|
9
|
+
loading: boolean;
|
|
10
|
+
/** Error if loading failed */
|
|
11
|
+
error: Error | null;
|
|
12
|
+
/** Loading progress (0-1) */
|
|
13
|
+
progress: number;
|
|
14
|
+
/** Function to load a point cloud */
|
|
15
|
+
load: (source: string | File | ArrayBuffer) => Promise<PointCloudData | null>;
|
|
16
|
+
/** Function to reset the state */
|
|
17
|
+
reset: () => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Custom hook for loading point cloud data in React applications.
|
|
21
|
+
*
|
|
22
|
+
* This hook provides a simple way to load point cloud files
|
|
23
|
+
* with loading state and error handling.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* function PointCloudLoader() {
|
|
28
|
+
* const { data, loading, error, load, reset } = usePointCloud();
|
|
29
|
+
*
|
|
30
|
+
* const handleFile = async (file: File) => {
|
|
31
|
+
* const result = await load(file);
|
|
32
|
+
* if (result) {
|
|
33
|
+
* console.log(`Loaded ${result.pointCount} points`);
|
|
34
|
+
* }
|
|
35
|
+
* };
|
|
36
|
+
*
|
|
37
|
+
* return (
|
|
38
|
+
* <div>
|
|
39
|
+
* <input type="file" onChange={(e) => handleFile(e.target.files?.[0])} />
|
|
40
|
+
* {loading && <p>Loading...</p>}
|
|
41
|
+
* {error && <p>Error: {error.message}</p>}
|
|
42
|
+
* {data && <p>Loaded {data.pointCount} points</p>}
|
|
43
|
+
* </div>
|
|
44
|
+
* );
|
|
45
|
+
* }
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @param options - Optional loader options
|
|
49
|
+
* @returns Object containing state and functions
|
|
50
|
+
*/
|
|
51
|
+
export declare function usePointCloud(options?: Partial<LoaderOptions>): UsePointCloudResult;
|
|
52
|
+
export {};
|
|
53
|
+
//# sourceMappingURL=usePointCloud.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePointCloud.d.ts","sourceRoot":"","sources":["../../../../src/lib/hooks/usePointCloud.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtE;;GAEG;AACH,UAAU,mBAAmB;IAC3B,0CAA0C;IAC1C,IAAI,EAAE,cAAc,GAAG,IAAI,CAAC;IAC5B,qCAAqC;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,8BAA8B;IAC9B,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,6BAA6B;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,qCAAqC;IACrC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,WAAW,KAAK,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC9E,kCAAkC;IAClC,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,mBAAmB,CAoCnF"}
|