Heatbox - hiro-nyon/cesium-heatbox GitHub Wiki
日本語 | English
Main class of CesiumJS Heatbox. Provides 3D voxel-based heatmap visualization in CesiumJS environments. Refer to HeatboxOptions for the full option catalogue with defaults.
Clear the heatmap and internal state.
Create heatmap from entities (async). Resolves with the statistics snapshot calculated by getStatistics.
| Name | Type | Description |
|---|---|---|
| entities | Array.<Cesium.Entity> | Target entities array / 対象エンティティ配列 |
Create a classification legend (Phase 5).
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
| container | HTMLElement | null | 追加先コンテナ(省略時はbodyに追加) |
Destroy the instance and release event listeners.
Destroy legend UI.
Alias for destroy() to match examples and tests.
Fit view to data bounds with smart camera positioning.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
| bounds | HeatboxBounds | null | null | Target bounds(省略時は現在のデータ境界) | |
| options | HeatboxFitViewOptions | {} | Fit view options / フィットビュー設定 |
Get bounds info if available.
Get debug information.
Get effective normalized options snapshot.
Get current options.
Get statistics information.
Hide performance overlay
Set heatmap data and render. Calculates bounds, prepares the voxel grid, runs classification, and finally renders.
| Name | Type | Description |
|---|---|---|
| entities | Array.<Cesium.Entity> | Target entities array / 対象エンティティ配列 |
Enable or disable performance overlay at runtime.
| Name | Type | Attributes | Description |
|---|---|---|---|
| enabled | boolean | true to enable, false to disable | |
| options | PerformanceOverlayConfig | Optional overlay options to apply / 追加設定 |
Toggle visibility.
| Name | Type | Description |
|---|---|---|
| show | boolean | true to show / 表示する場合は true |
Show performance overlay
Toggle performance overlay visibility
Update legend contents using latest classifier.
Update options and re-render if applicable.
| Name | Type | Description |
|---|---|---|
| newOptions | HeatboxOptions | New options (partial allowed) / 新しいオプション(部分指定可) |
Filter entity array (utility static method).
| Name | Type | Description |
|---|---|---|
| entities | Array.<Cesium.Entity> | Entity array / エンティティ配列 |
| predicate | function | Predicate function / フィルタ関数 |
Get configuration profile details
| Name | Type | Description |
|---|---|---|
| profileName | string | Profile name / プロファイル名 Returned object shares the same keys as HeatboxOptions plus an optional description. 戻り値は HeatboxOptions と同じキーに加えて description フィールドを含みます。 |
Get list of available configuration profiles
// 1. Initialize Heatbox
const viewer = new Cesium.Viewer('cesiumContainer');
const heatbox = new Heatbox(viewer, { voxelSize: 30, opacity: 0.8 });
// 2. Collect entities (example)
const entities = viewer.entities.values; // or build your own array
// 3. Create heatmap from entities
const stats = await heatbox.createFromEntities(entities);
console.log('rendered voxels:', stats.renderedVoxels);// Adaptive outline width control
const options = {
outlineWidthResolver: ({ voxel, isTopN, normalizedDensity }) => {
if (isTopN) return 6; // TopN: thick outline
if (normalizedDensity > 0.7) return 1; // Dense: thin
return 3; // Sparse: normal
},
voxelGap: 1.5, // Gap between voxels (meters)
outlineOpacity: 0.8 // Outline transparency
};CesiumJS Heatbox メインクラス。 CesiumJS 環境で 3D ボクセルベースのヒートマップ可視化を提供します。 利用可能なオプションと既定値は HeatboxOptions を参照してください。
ヒートマップと内部状態をクリアします。
エンティティからヒートマップを作成(非同期 API)。 描画完了後に getStatistics と同じ統計スナップショットを返します。
| 名前 | 型 | 説明 |
|---|---|---|
| entities | Array.<Cesium.Entity> | Target entities array / 対象エンティティ配列 |
分類用の凡例UIを生成します。
| 名前 | 型 | 属性 | 既定値 | 説明 |
|---|---|---|---|---|
| container | HTMLElement | null | 追加先コンテナ(省略時はbodyに追加) |
インスタンスを破棄し、イベントリスナーを解放します。
凡例UIを破棄します。
互換性のための別名。destroy() を呼び出します。
データ境界にスマートなカメラ位置でビューをフィットします。 実装メモ(v0.1.12):
- 描画とカメラ移動の競合を避けるため、
viewer.scene.postRenderで1回だけ実行します。 - 矩形境界(経緯度)から
Cesium.Rectangle→Cesium.BoundingSphereを生成し、camera.flyToBoundingSphere+HeadingPitchRangeで安定的にズームします。 - 俯角は安全範囲にクランプ(既定: -35°, 範囲: [-85°, -10°])。
- 失敗時は
viewer.zoomTo(viewer.entities)へフォールバックします。
| 名前 | 型 | 属性 | 既定値 | 説明 |
|---|---|---|---|---|
| bounds | HeatboxBounds | null | null | Target bounds(省略時は現在のデータ境界) | |
| options | HeatboxFitViewOptions | {} | Fit view options / フィットビュー設定 |
境界情報を取得します(未作成の場合は null)。
デバッグ情報を取得します。
正規化済みオプションのスナップショットを取得します。
現在のオプションを取得します。
統計情報を取得します(未作成の場合は null)。
パフォーマンスオーバーレイを非表示
ヒートマップデータを設定し、境界計算→ボクセル分類→描画の順で処理します。
| 名前 | 型 | 説明 |
|---|---|---|
| entities | Array.<Cesium.Entity> | Target entities array / 対象エンティティ配列 |
実行時にパフォーマンスオーバーレイを有効/無効化します。
| 名前 | 型 | 属性 | 説明 |
|---|---|---|---|
| enabled | boolean | true to enable, false to disable | |
| options | PerformanceOverlayConfig | Optional overlay options to apply / 追加設定 |
表示/非表示を切り替えます。
| 名前 | 型 | 説明 |
|---|---|---|
| show | boolean | true to show / 表示する場合は true |
パフォーマンスオーバーレイを表示
パフォーマンスオーバーレイの表示/非表示切り替え
最新の分類状態で凡例を更新します。
オプションを更新し、必要に応じて再描画します。
| 名前 | 型 | 説明 |
|---|---|---|
| newOptions | HeatboxOptions | New options (partial allowed) / 新しいオプション(部分指定可) |
エンティティ配列をフィルタします(ユーティリティ・静的メソッド)。
| 名前 | 型 | 説明 |
|---|---|---|
| entities | Array.<Cesium.Entity> | Entity array / エンティティ配列 |
| predicate | function | Predicate function / フィルタ関数 |
設定プロファイルの詳細を取得
| 名前 | 型 | 説明 |
|---|---|---|
| profileName | string | Profile name / プロファイル名 Returned object shares the same keys as HeatboxOptions plus an optional description. 戻り値は HeatboxOptions と同じキーに加えて description フィールドを含みます。 |
利用可能な設定プロファイルの一覧を取得