gralobe 1.0.67 → 1.0.68

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/dist/index.d.ts CHANGED
@@ -177,6 +177,10 @@ export declare class GlobeViz implements GlobeVizAPI {
177
177
  private resizeObserver;
178
178
  private lastContainerWidth;
179
179
  private lastContainerHeight;
180
+ private hoverTooltip;
181
+ private currentHoveredFeature;
182
+ private lastHoverTime;
183
+ private readonly HOVER_THROTTLE_MS;
180
184
  /** Promise that resolves when fully initialized */
181
185
  ready: Promise<void>;
182
186
  private resolveReady;
@@ -199,9 +203,37 @@ export declare class GlobeViz implements GlobeVizAPI {
199
203
  toGlobe(): void;
200
204
  toFlat(): void;
201
205
  /**
202
- * Setup mouse interactions (Click to Zoom, etc.)
206
+ * Setup mouse interactions (Click to Zoom, Hover, etc.)
203
207
  */
204
208
  private setupInteraction;
209
+ /**
210
+ * Create the hover tooltip element
211
+ */
212
+ private createHoverTooltip;
213
+ /**
214
+ * Handle hover interactions with throttling for performance
215
+ */
216
+ private handleHover;
217
+ /**
218
+ * Find feature at given lat/lon using point-in-polygon test
219
+ */
220
+ private findFeatureAtLatLon;
221
+ /**
222
+ * Check if a point is inside a feature geometry
223
+ */
224
+ private isPointInFeature;
225
+ /**
226
+ * Ray casting algorithm for point-in-polygon test
227
+ */
228
+ private isPointInPolygon;
229
+ /**
230
+ * Show hover tooltip at mouse position
231
+ */
232
+ private showHoverTooltip;
233
+ /**
234
+ * Hide hover tooltip
235
+ */
236
+ private hideHoverTooltip;
205
237
  setMorph(value: number): void;
206
238
  getMorph(): number;
207
239
  setStatistic(idOrData: string | StatisticData): void;
@@ -229,6 +261,11 @@ export declare class GlobeViz implements GlobeVizAPI {
229
261
  recordGif(options?: ExportOptions): Promise<void>;
230
262
  recordVideo(options?: ExportOptions): Promise<void>;
231
263
  setEffects(effects: Partial<EffectsConfig>): void;
264
+ /**
265
+ * Update hover configuration
266
+ * @param hover - Partial hover configuration to merge
267
+ */
268
+ setHover(hover: Partial<HoverConfig>): void;
232
269
  setMarkers(data: MarkerData[], config?: MarkerConfig): void;
233
270
  setUrbanData(points: {
234
271
  lat: number;
@@ -281,6 +318,8 @@ export declare interface GlobeVizAPI {
281
318
  recordVideo(options?: ExportOptions): Promise<void>;
282
319
  /** Update effects configuration */
283
320
  setEffects(effects: Partial<EffectsConfig>): void;
321
+ /** Update hover configuration */
322
+ setHover(hover: Partial<HoverConfig>): void;
284
323
  /** Set marker data for city-level visualization */
285
324
  setMarkers(data: MarkerData[], config?: MarkerConfig): void;
286
325
  /** Set urban city data for visualization */
@@ -430,6 +469,48 @@ export declare interface GlobeVizConfig {
430
469
  * Callback for loading progress (0-1)
431
470
  */
432
471
  onLoadProgress?: (progress: number, status?: string) => void;
472
+ /**
473
+ * Callback when hovering over a feature
474
+ */
475
+ onHover?: (featureId: string | null, featureName: string | null, value?: number) => void;
476
+ /**
477
+ * Hover information configuration
478
+ */
479
+ hover?: HoverConfig;
480
+ }
481
+
482
+ /**
483
+ * Configuration for hover information display
484
+ */
485
+ export declare interface HoverConfig {
486
+ /**
487
+ * Enable hover information tooltip
488
+ * @default true
489
+ */
490
+ enabled?: boolean;
491
+ /**
492
+ * Minimum zoom level (camera distance) for hover to activate.
493
+ * Value between 0 and 1, where 0 means always show and 1 means only when very close.
494
+ * Maps to camera distance: 0 = 400 (far), 1 = 50 (close)
495
+ * @default 0 (always show)
496
+ */
497
+ minZoom?: number;
498
+ /**
499
+ * Show the feature value in the tooltip (if available)
500
+ * @default true
501
+ */
502
+ showValue?: boolean;
503
+ /**
504
+ * Custom tooltip style
505
+ */
506
+ style?: {
507
+ /** Background color */
508
+ background?: string;
509
+ /** Text color */
510
+ color?: string;
511
+ /** Border color */
512
+ borderColor?: string;
513
+ };
433
514
  }
434
515
 
435
516
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gralobe",
3
- "version": "1.0.67",
3
+ "version": "1.0.68",
4
4
  "description": "Interactive 3D globe visualization with statistics, smooth flat map ↔ globe transitions, and country labels",
5
5
  "type": "module",
6
6
  "main": "./dist/gralobe.umd.cjs",