@buley/hexgrid-3d 3.1.0 → 3.2.1
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/HexGridEnhanced.d.ts +15 -0
- package/dist/HexGridEnhanced.d.ts.map +1 -0
- package/dist/HexGridEnhanced.js +1 -0
- package/dist/Snapshot.d.ts +594 -0
- package/dist/Snapshot.d.ts.map +1 -0
- package/dist/Snapshot.js +757 -0
- package/dist/adapters/DashAdapter.d.ts +18 -0
- package/dist/adapters/DashAdapter.d.ts.map +1 -0
- package/dist/adapters/DashAdapter.js +42 -0
- package/dist/adapters.d.ts +53 -0
- package/dist/adapters.d.ts.map +1 -0
- package/dist/adapters.js +14 -0
- package/dist/algorithms/AdvancedStatistics.d.ts +52 -0
- package/dist/algorithms/AdvancedStatistics.d.ts.map +1 -0
- package/dist/algorithms/AdvancedStatistics.js +307 -0
- package/dist/algorithms/BayesianStatistics.d.ts +86 -0
- package/dist/algorithms/BayesianStatistics.d.ts.map +1 -0
- package/dist/algorithms/BayesianStatistics.js +263 -0
- package/dist/algorithms/FlowField.d.ts +55 -0
- package/dist/algorithms/FlowField.d.ts.map +1 -0
- package/dist/algorithms/FlowField.js +80 -0
- package/dist/algorithms/FlowField3D.d.ts +166 -0
- package/dist/algorithms/FlowField3D.d.ts.map +1 -0
- package/dist/algorithms/FlowField3D.js +327 -0
- package/dist/algorithms/FluidEngineFactory.d.ts +15 -0
- package/dist/algorithms/FluidEngineFactory.d.ts.map +1 -0
- package/dist/algorithms/FluidEngineFactory.js +41 -0
- package/dist/algorithms/FluidSimulation.d.ts +41 -0
- package/dist/algorithms/FluidSimulation.d.ts.map +1 -0
- package/dist/algorithms/FluidSimulation.js +74 -0
- package/dist/algorithms/FluidSimulation3D.d.ts +137 -0
- package/dist/algorithms/FluidSimulation3D.d.ts.map +1 -0
- package/dist/algorithms/FluidSimulation3D.js +464 -0
- package/dist/algorithms/FluidSimulation3DGPU.d.ts +41 -0
- package/dist/algorithms/FluidSimulation3DGPU.d.ts.map +1 -0
- package/dist/algorithms/FluidSimulation3DGPU.js +468 -0
- package/dist/algorithms/FluidSimulationWebNN.d.ts +56 -0
- package/dist/algorithms/FluidSimulationWebNN.d.ts.map +1 -0
- package/dist/algorithms/FluidSimulationWebNN.js +84 -0
- package/dist/algorithms/GraphAlgorithms.d.ts +48 -0
- package/dist/algorithms/GraphAlgorithms.d.ts.map +1 -0
- package/dist/algorithms/GraphAlgorithms.js +122 -0
- package/dist/algorithms/OutlierDetection.d.ts +49 -0
- package/dist/algorithms/OutlierDetection.d.ts.map +1 -0
- package/dist/algorithms/OutlierDetection.js +284 -0
- package/dist/algorithms/ParticleSystem.d.ts +36 -0
- package/dist/algorithms/ParticleSystem.d.ts.map +1 -0
- package/dist/algorithms/ParticleSystem.js +59 -0
- package/dist/algorithms/ParticleSystem3D.d.ts +206 -0
- package/dist/algorithms/ParticleSystem3D.d.ts.map +1 -0
- package/dist/algorithms/ParticleSystem3D.js +371 -0
- package/dist/algorithms/index.d.ts +19 -0
- package/dist/algorithms/index.d.ts.map +1 -0
- package/{src/algorithms/index.ts → dist/algorithms/index.js} +4 -2
- package/dist/compat.d.ts +24 -0
- package/dist/compat.d.ts.map +1 -0
- package/dist/compat.js +88 -0
- package/dist/components/HexGrid.d.ts +5 -0
- package/dist/components/HexGrid.d.ts.map +1 -0
- package/dist/components/HexGrid.js +39 -0
- package/dist/components/NarrationOverlay.d.ts +16 -0
- package/dist/components/NarrationOverlay.d.ts.map +1 -0
- package/dist/components/NarrationOverlay.js +132 -0
- package/{src/components/index.ts → dist/components/index.d.ts} +1 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +1 -0
- package/dist/features.d.ts +54 -0
- package/dist/features.d.ts.map +1 -0
- package/dist/features.js +74 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/{src/index.ts → dist/index.js} +0 -9
- package/dist/lib/narration.d.ts +12 -0
- package/dist/lib/narration.d.ts.map +1 -0
- package/dist/lib/narration.js +8 -0
- package/dist/lib/stats-tracker.d.ts +7 -0
- package/dist/lib/stats-tracker.d.ts.map +1 -0
- package/dist/lib/stats-tracker.js +22 -0
- package/dist/lib/theme-colors.d.ts +7 -0
- package/dist/lib/theme-colors.d.ts.map +1 -0
- package/dist/lib/theme-colors.js +10 -0
- package/dist/math/HexCoordinates.d.ts +140 -0
- package/dist/math/HexCoordinates.d.ts.map +1 -0
- package/dist/math/HexCoordinates.js +741 -0
- package/dist/math/Matrix4.d.ts +9 -0
- package/dist/math/Matrix4.d.ts.map +1 -0
- package/dist/math/Matrix4.js +19 -0
- package/dist/math/Quaternion.d.ts +11 -0
- package/dist/math/Quaternion.d.ts.map +1 -0
- package/dist/math/Quaternion.js +23 -0
- package/dist/math/SpatialIndex.d.ts +34 -0
- package/dist/math/SpatialIndex.d.ts.map +1 -0
- package/dist/math/SpatialIndex.js +75 -0
- package/dist/math/Vector3.d.ts +110 -0
- package/dist/math/Vector3.d.ts.map +1 -0
- package/dist/math/Vector3.js +426 -0
- package/dist/math/index.d.ts +11 -0
- package/dist/math/index.d.ts.map +1 -0
- package/{src/math/index.ts → dist/math/index.js} +0 -1
- package/dist/note-adapter.d.ts +44 -0
- package/dist/note-adapter.d.ts.map +1 -0
- package/dist/note-adapter.js +86 -0
- package/dist/ontology-adapter.d.ts +13 -0
- package/dist/ontology-adapter.d.ts.map +1 -0
- package/dist/ontology-adapter.js +65 -0
- package/dist/stores/index.d.ts +2 -0
- package/dist/stores/index.d.ts.map +1 -0
- package/dist/stores/uiStore.d.ts +18 -0
- package/dist/stores/uiStore.d.ts.map +1 -0
- package/dist/stores/uiStore.js +77 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types.d.ts +126 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +4 -0
- package/dist/utils/image-utils.d.ts +13 -0
- package/dist/utils/image-utils.d.ts.map +1 -0
- package/dist/utils/image-utils.js +23 -0
- package/dist/wasm/HexGridWasmWrapper.d.ts +131 -0
- package/dist/wasm/HexGridWasmWrapper.d.ts.map +1 -0
- package/dist/wasm/HexGridWasmWrapper.js +610 -0
- package/dist/wasm/index.d.ts +7 -0
- package/dist/wasm/index.d.ts.map +1 -0
- package/{src/wasm/index.ts → dist/wasm/index.js} +0 -1
- package/dist/webgpu/WebGPUContext.d.ts +20 -0
- package/dist/webgpu/WebGPUContext.d.ts.map +1 -0
- package/dist/webgpu/WebGPUContext.js +60 -0
- package/dist/webnn/WebNNContext.d.ts +38 -0
- package/dist/webnn/WebNNContext.d.ts.map +1 -0
- package/dist/webnn/WebNNContext.js +66 -0
- package/dist/workers/hexgrid-math.d.ts +79 -0
- package/dist/workers/hexgrid-math.d.ts.map +1 -0
- package/dist/workers/hexgrid-math.js +136 -0
- package/dist/workers/hexgrid-worker.worker.d.ts +35 -0
- package/dist/workers/hexgrid-worker.worker.d.ts.map +1 -0
- package/dist/workers/hexgrid-worker.worker.js +2014 -0
- package/package.json +24 -7
- package/.eslintrc.json +0 -28
- package/build_log.txt +0 -500
- package/build_src_log.txt +0 -8
- package/examples/basic-usage.tsx +0 -52
- package/public/hexgrid-worker.js +0 -2475
- package/rust/Cargo.toml +0 -41
- package/rust/src/lib.rs +0 -740
- package/rust/src/math.rs +0 -574
- package/rust/src/spatial.rs +0 -245
- package/rust/src/statistics.rs +0 -496
- package/site/.eslintrc.json +0 -3
- package/site/DEPLOYMENT.md +0 -196
- package/site/INDEX.md +0 -127
- package/site/QUICK_START.md +0 -86
- package/site/README.md +0 -85
- package/site/SITE_SUMMARY.md +0 -180
- package/site/next.config.js +0 -12
- package/site/package.json +0 -26
- package/site/src/app/docs/page.tsx +0 -272
- package/site/src/app/examples/page.tsx +0 -151
- package/site/src/app/globals.css +0 -160
- package/site/src/app/layout.tsx +0 -39
- package/site/src/app/page.tsx +0 -235
- package/site/tsconfig.json +0 -29
- package/site/vercel.json +0 -6
- package/src/HexGridEnhanced.ts +0 -16
- package/src/Snapshot.ts +0 -1607
- package/src/adapters/DashAdapter.ts +0 -57
- package/src/adapters.ts +0 -63
- package/src/algorithms/AdvancedStatistics.ts +0 -362
- package/src/algorithms/BayesianStatistics.ts +0 -348
- package/src/algorithms/FlowField.ts +0 -150
- package/src/algorithms/FlowField3D.ts +0 -573
- package/src/algorithms/FluidEngineFactory.ts +0 -44
- package/src/algorithms/FluidSimulation.ts +0 -115
- package/src/algorithms/FluidSimulation3D.ts +0 -664
- package/src/algorithms/FluidSimulation3DGPU.ts +0 -408
- package/src/algorithms/FluidSimulationWebNN.ts +0 -141
- package/src/algorithms/GraphAlgorithms.ts +0 -191
- package/src/algorithms/OutlierDetection.ts +0 -425
- package/src/algorithms/ParticleSystem.ts +0 -95
- package/src/algorithms/ParticleSystem3D.ts +0 -567
- package/src/compat.ts +0 -96
- package/src/components/HexGrid.tsx +0 -61
- package/src/components/NarrationOverlay.tsx +0 -309
- package/src/features.ts +0 -125
- package/src/lib/narration.ts +0 -17
- package/src/lib/stats-tracker.ts +0 -25
- package/src/lib/theme-colors.ts +0 -12
- package/src/math/HexCoordinates.ts +0 -863
- package/src/math/Matrix4.ts +0 -25
- package/src/math/Quaternion.ts +0 -37
- package/src/math/SpatialIndex.ts +0 -114
- package/src/math/Vector3.ts +0 -540
- package/src/note-adapter.ts +0 -132
- package/src/ontology-adapter.ts +0 -84
- package/src/stores/uiStore.ts +0 -85
- package/src/types/index.ts +0 -3
- package/src/types/shared-utils.d.ts +0 -10
- package/src/types/wgsl.d.ts +0 -4
- package/src/types.ts +0 -164
- package/src/utils/image-utils.ts +0 -28
- package/src/wasm/HexGridWasmWrapper.ts +0 -801
- package/src/webgpu/WebGPUContext.ts +0 -71
- package/src/webgpu/shaders/fluid_sim.wgsl +0 -140
- package/src/webnn/WebNNContext.ts +0 -99
- package/src/workers/hexgrid-math.ts +0 -182
- package/src/workers/hexgrid-worker.worker.ts +0 -2781
- package/tsconfig.json +0 -26
- /package/{src/stores/index.ts → dist/stores/index.js} +0 -0
package/dist/compat.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Backward compatibility layer for Photo and GridItem
|
|
3
|
+
*
|
|
4
|
+
* Provides conversion utilities to ensure existing Photo-based code
|
|
5
|
+
* continues to work while new code can use GridItem.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Convert Photo to GridItem for backward compatibility
|
|
9
|
+
*/
|
|
10
|
+
export function photoToGridItem(photo) {
|
|
11
|
+
return {
|
|
12
|
+
id: photo.id,
|
|
13
|
+
type: 'photo',
|
|
14
|
+
imageUrl: photo.imageUrl,
|
|
15
|
+
thumbnailUrl: photo.thumbnailUrl,
|
|
16
|
+
title: photo.title,
|
|
17
|
+
alt: photo.alt,
|
|
18
|
+
description: photo.description,
|
|
19
|
+
category: photo.category,
|
|
20
|
+
data: photo,
|
|
21
|
+
// Map all Photo fields
|
|
22
|
+
url: photo.imageUrl,
|
|
23
|
+
userId: photo.userId,
|
|
24
|
+
username: photo.username,
|
|
25
|
+
videoUrl: photo.videoUrl,
|
|
26
|
+
platform: photo.platform,
|
|
27
|
+
author: photo.author,
|
|
28
|
+
authorUrl: photo.authorUrl,
|
|
29
|
+
likes: photo.likes,
|
|
30
|
+
views: photo.views,
|
|
31
|
+
comments: photo.comments,
|
|
32
|
+
dominantColor: photo.dominantColor,
|
|
33
|
+
source: photo.source,
|
|
34
|
+
sourceUrl: photo.sourceUrl,
|
|
35
|
+
createdAt: photo.createdAt,
|
|
36
|
+
velocity: photo.velocity,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Convert GridItem back to Photo if possible
|
|
41
|
+
*/
|
|
42
|
+
export function gridItemToPhoto(item) {
|
|
43
|
+
// If item contains original Photo data, return it
|
|
44
|
+
if (item.type === 'photo' && item.data) {
|
|
45
|
+
return item.data;
|
|
46
|
+
}
|
|
47
|
+
// Fallback: construct Photo from GridItem fields
|
|
48
|
+
if (item.imageUrl || item.url) {
|
|
49
|
+
return {
|
|
50
|
+
id: item.id,
|
|
51
|
+
title: item.title ?? '',
|
|
52
|
+
alt: item.alt ?? item.title ?? '',
|
|
53
|
+
imageUrl: item.imageUrl || item.url || '',
|
|
54
|
+
category: item.category ?? 'uncategorized',
|
|
55
|
+
description: item.description,
|
|
56
|
+
source: item.source || 'unknown',
|
|
57
|
+
sourceUrl: item.sourceUrl,
|
|
58
|
+
createdAt: item.createdAt,
|
|
59
|
+
thumbnailUrl: item.thumbnailUrl,
|
|
60
|
+
userId: item.userId,
|
|
61
|
+
username: item.username,
|
|
62
|
+
videoUrl: item.videoUrl,
|
|
63
|
+
platform: item.platform,
|
|
64
|
+
author: item.author,
|
|
65
|
+
authorUrl: item.authorUrl,
|
|
66
|
+
likes: item.likes,
|
|
67
|
+
views: item.views,
|
|
68
|
+
comments: item.comments,
|
|
69
|
+
dominantColor: item.dominantColor,
|
|
70
|
+
velocity: item.velocity,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Convert an array of Photos to GridItems
|
|
77
|
+
*/
|
|
78
|
+
export function photosToGridItems(photos) {
|
|
79
|
+
return photos.map(photoToGridItem);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Convert an array of GridItems to Photos (filtering out non-photo items)
|
|
83
|
+
*/
|
|
84
|
+
export function gridItemsToPhotos(items) {
|
|
85
|
+
return items
|
|
86
|
+
.map(gridItemToPhoto)
|
|
87
|
+
.filter((photo) => photo !== null);
|
|
88
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HexGrid.d.ts","sourceRoot":"","sources":["../../src/components/HexGrid.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAqD9D;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { FluidEngineFactory } from '../algorithms/FluidEngineFactory';
|
|
4
|
+
export function HexGrid(props) {
|
|
5
|
+
const canvasRef = useRef(null);
|
|
6
|
+
const [engine, setEngine] = useState(null);
|
|
7
|
+
const [error, setError] = useState(null);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
// Initialize Fluid Engine
|
|
10
|
+
const initEngine = async () => {
|
|
11
|
+
try {
|
|
12
|
+
const fluidEngine = await FluidEngineFactory.create({
|
|
13
|
+
width: 64,
|
|
14
|
+
height: 64,
|
|
15
|
+
depth: 64,
|
|
16
|
+
viscosity: 0.0001,
|
|
17
|
+
diffusion: 0.00001
|
|
18
|
+
});
|
|
19
|
+
setEngine(fluidEngine);
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
console.error("Failed to init fluid engine", err);
|
|
23
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
initEngine();
|
|
27
|
+
return () => {
|
|
28
|
+
// Cleanup if engine has cleanup method
|
|
29
|
+
if (engine && 'clear' in engine) {
|
|
30
|
+
engine.clear();
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}, []);
|
|
34
|
+
if (error) {
|
|
35
|
+
return _jsxs("div", { className: "text-red-500", children: ["Error initializing simulation: ", error] });
|
|
36
|
+
}
|
|
37
|
+
return (_jsxs("div", { className: "hexgrid-container", style: { width: '100%', height: '100%', position: 'relative' }, children: [_jsx("canvas", { ref: canvasRef, width: 800, height: 600, style: { width: '100%', height: '100%' } }), _jsxs("div", { style: { position: 'absolute', top: 10, left: 10, background: 'rgba(0,0,0,0.5)', color: 'white', padding: '5px', pointerEvents: 'none' }, children: ["Engine: ", engine ? engine.constructor.name : 'Initializing...'] })] }));
|
|
38
|
+
}
|
|
39
|
+
export default HexGrid;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Narration Overlay Component
|
|
3
|
+
*
|
|
4
|
+
* Displays play-by-play narration messages with sparklines in a NOC dashboard style.
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { NarrationMessage } from '@/lib/narration';
|
|
8
|
+
import { StatsTracker } from '@/lib/stats-tracker';
|
|
9
|
+
export interface NarrationOverlayProps {
|
|
10
|
+
messages: NarrationMessage[];
|
|
11
|
+
statsTracker: StatsTracker | null;
|
|
12
|
+
isVisible: boolean;
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const NarrationOverlay: React.FC<NarrationOverlayProps>;
|
|
16
|
+
//# sourceMappingURL=NarrationOverlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NarrationOverlay.d.ts","sourceRoot":"","sources":["../../src/components/NarrationOverlay.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAkS5D,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Narration Overlay Component
|
|
4
|
+
*
|
|
5
|
+
* Displays play-by-play narration messages with sparklines in a NOC dashboard style.
|
|
6
|
+
*/
|
|
7
|
+
import { useEffect, useRef } from 'react';
|
|
8
|
+
import { getAccentRgba, getAccentHex } from '@/lib/theme-colors';
|
|
9
|
+
export const NarrationOverlay = ({ messages, statsTracker, isVisible, onClose, }) => {
|
|
10
|
+
const messagesEndRef = useRef(null);
|
|
11
|
+
const scrollContainerRef = useRef(null);
|
|
12
|
+
// Auto-scroll to latest message
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (messagesEndRef.current && scrollContainerRef.current) {
|
|
15
|
+
scrollContainerRef.current.scrollTop =
|
|
16
|
+
scrollContainerRef.current.scrollHeight;
|
|
17
|
+
}
|
|
18
|
+
}, [messages]);
|
|
19
|
+
// Always render the overlay so fade-out can animate smoothly.
|
|
20
|
+
// Toggle visibility via styles.
|
|
21
|
+
const currentStats = statsTracker?.getCurrentStats();
|
|
22
|
+
const allTimeRecords = statsTracker?.getAllTimeRecords();
|
|
23
|
+
const leaderboard = statsTracker?.getLeaderboard(10);
|
|
24
|
+
return (_jsxs("div", { style: {
|
|
25
|
+
position: 'fixed',
|
|
26
|
+
right: 12,
|
|
27
|
+
top: 80,
|
|
28
|
+
width: 400,
|
|
29
|
+
maxHeight: 'calc(100vh - 100px)',
|
|
30
|
+
background: 'rgba(0, 0, 0, 0.85)',
|
|
31
|
+
border: `1px solid ${getAccentRgba(0.3)}`,
|
|
32
|
+
borderRadius: 8,
|
|
33
|
+
padding: '12px',
|
|
34
|
+
zIndex: 10000,
|
|
35
|
+
display: 'flex',
|
|
36
|
+
flexDirection: 'column',
|
|
37
|
+
fontFamily: "'Courier New', monospace",
|
|
38
|
+
fontSize: 12,
|
|
39
|
+
color: getAccentHex(),
|
|
40
|
+
boxShadow: `0 0 20px ${getAccentRgba(0.2)}`,
|
|
41
|
+
// Fade transition
|
|
42
|
+
transition: 'opacity 220ms ease, transform 220ms ease',
|
|
43
|
+
opacity: isVisible ? 1 : 0,
|
|
44
|
+
transform: isVisible ? 'translateY(0px)' : 'translateY(-6px)',
|
|
45
|
+
pointerEvents: isVisible ? 'auto' : 'none',
|
|
46
|
+
}, children: [_jsxs("div", { style: {
|
|
47
|
+
display: 'flex',
|
|
48
|
+
justifyContent: 'space-between',
|
|
49
|
+
alignItems: 'center',
|
|
50
|
+
marginBottom: 8,
|
|
51
|
+
}, children: [_jsx("div", { style: { fontWeight: 'bold', fontSize: 14 }, children: "Play-by-Play Narration" }), _jsx("button", { onClick: onClose, style: {
|
|
52
|
+
background: 'transparent',
|
|
53
|
+
border: '1px solid rgba(0, 255, 255, 0.3)',
|
|
54
|
+
color: '#00ffff',
|
|
55
|
+
cursor: 'pointer',
|
|
56
|
+
padding: '4px 8px',
|
|
57
|
+
borderRadius: 4,
|
|
58
|
+
fontSize: 11,
|
|
59
|
+
}, children: "\u00D7" })] }), currentStats && (_jsxs("details", { style: { marginBottom: 8, fontSize: 11 }, children: [_jsx("summary", { style: { cursor: 'pointer', color: '#00ffff', marginBottom: 4 }, children: "Stats Dashboard" }), _jsxs("div", { style: {
|
|
60
|
+
padding: '8px',
|
|
61
|
+
background: 'rgba(0, 255, 255, 0.05)',
|
|
62
|
+
borderRadius: 4,
|
|
63
|
+
}, children: [_jsxs("div", { style: {
|
|
64
|
+
display: 'flex',
|
|
65
|
+
justifyContent: 'space-between',
|
|
66
|
+
marginBottom: 4,
|
|
67
|
+
}, children: [_jsx("span", { children: "Generation:" }), _jsx("span", { style: { fontVariantNumeric: 'tabular-nums' }, children: currentStats.generation })] }), _jsxs("div", { style: {
|
|
68
|
+
display: 'flex',
|
|
69
|
+
justifyContent: 'space-between',
|
|
70
|
+
marginBottom: 4,
|
|
71
|
+
}, children: [_jsx("span", { children: "Active Memes:" }), _jsx("span", { style: { fontVariantNumeric: 'tabular-nums' }, children: currentStats.activeMemesCount })] }), _jsxs("div", { style: {
|
|
72
|
+
display: 'flex',
|
|
73
|
+
justifyContent: 'space-between',
|
|
74
|
+
marginBottom: 4,
|
|
75
|
+
}, children: [_jsx("span", { children: "Total Hexes:" }), _jsx("span", { style: { fontVariantNumeric: 'tabular-nums' }, children: currentStats.totalHexesInfected })] }), _jsxs("div", { style: {
|
|
76
|
+
display: 'flex',
|
|
77
|
+
justifyContent: 'space-between',
|
|
78
|
+
marginBottom: 4,
|
|
79
|
+
}, children: [_jsx("span", { children: "Birth/Death Ratio:" }), _jsx("span", { style: { fontVariantNumeric: 'tabular-nums' }, children: currentStats.populationStability.toFixed(2) })] }), allTimeRecords && (_jsxs("div", { style: {
|
|
80
|
+
marginTop: 8,
|
|
81
|
+
paddingTop: 8,
|
|
82
|
+
borderTop: '1px solid rgba(0, 255, 255, 0.2)',
|
|
83
|
+
}, children: [_jsx("div", { style: { fontSize: 10, color: '#00ffff', marginBottom: 4 }, children: "All-Time Records:" }), _jsxs("div", { style: { fontSize: 10, marginBottom: 2 }, children: ["Highest Territory: ", allTimeRecords.highestTerritory.value] }), _jsxs("div", { style: { fontSize: 10, marginBottom: 2 }, children: ["Longest Streak: ", allTimeRecords.longestSurvivalStreak.value] })] }))] })] })), leaderboard && leaderboard.length > 0 && (_jsxs("details", { style: { marginBottom: 8, fontSize: 11 }, children: [_jsx("summary", { style: { cursor: 'pointer', color: '#00ffff', marginBottom: 4 }, children: "Top 10 Leaderboard" }), _jsx("div", { style: {
|
|
84
|
+
padding: '8px',
|
|
85
|
+
background: 'rgba(0, 255, 255, 0.05)',
|
|
86
|
+
borderRadius: 4,
|
|
87
|
+
}, children: leaderboard.map((entry, i) => (_jsxs("div", { style: {
|
|
88
|
+
display: 'flex',
|
|
89
|
+
justifyContent: 'space-between',
|
|
90
|
+
marginBottom: 2,
|
|
91
|
+
fontSize: 10,
|
|
92
|
+
color: i < 3 ? '#00ff00' : '#00ffff',
|
|
93
|
+
}, children: [_jsxs("span", { children: [i + 1, ". ", entry.photoId.slice(0, 20), "..."] }), _jsxs("span", { style: { fontVariantNumeric: 'tabular-nums' }, children: [entry.territory, " hexes"] })] }, entry.photoId))) })] })), _jsxs("div", { ref: scrollContainerRef, style: {
|
|
94
|
+
flex: 1,
|
|
95
|
+
overflowY: 'auto',
|
|
96
|
+
maxHeight: '400px',
|
|
97
|
+
padding: '8px',
|
|
98
|
+
background: 'rgba(0, 0, 0, 0.3)',
|
|
99
|
+
borderRadius: 4,
|
|
100
|
+
}, children: [messages.length === 0 ? (_jsx("div", { style: {
|
|
101
|
+
color: 'rgba(0, 255, 255, 0.5)',
|
|
102
|
+
fontStyle: 'italic',
|
|
103
|
+
textAlign: 'center',
|
|
104
|
+
padding: '20px',
|
|
105
|
+
}, children: "No narration yet. Evolution in progress..." })) : (messages.map((msg, index) => (_jsxs("div", { style: {
|
|
106
|
+
marginBottom: 8,
|
|
107
|
+
padding: '6px',
|
|
108
|
+
background: msg.priority >= 8
|
|
109
|
+
? 'rgba(255, 165, 0, 0.1)'
|
|
110
|
+
: 'rgba(0, 255, 255, 0.05)',
|
|
111
|
+
borderRadius: 4,
|
|
112
|
+
borderLeft: `2px solid ${msg.priority >= 8 ? '#ffaa00' : '#00ffff'}`,
|
|
113
|
+
fontSize: 11,
|
|
114
|
+
lineHeight: 1.4,
|
|
115
|
+
}, children: [_jsxs("div", { style: {
|
|
116
|
+
display: 'flex',
|
|
117
|
+
justifyContent: 'space-between',
|
|
118
|
+
marginBottom: 2,
|
|
119
|
+
}, children: [_jsxs("span", { style: { color: 'rgba(0, 255, 255, 0.7)', fontSize: 10 }, children: ["Gen ", msg.generation] }), _jsx("span", { style: { color: 'rgba(0, 255, 255, 0.5)', fontSize: 9 }, children: new Date(msg.timestamp).toLocaleTimeString() })] }), _jsxs("div", { style: { fontFamily: "'Courier New', monospace" }, children: [msg.text, msg.sparkline && (_jsx("div", { style: {
|
|
120
|
+
marginTop: 4,
|
|
121
|
+
fontFamily: "'Courier New', monospace",
|
|
122
|
+
fontSize: 14,
|
|
123
|
+
color: msg.eventType === 'slam_dunk' ||
|
|
124
|
+
msg.eventType === 'on_fire'
|
|
125
|
+
? '#00ff00'
|
|
126
|
+
: msg.eventType === 'decline' ||
|
|
127
|
+
msg.eventType === 'missed_shot'
|
|
128
|
+
? '#ff4444'
|
|
129
|
+
: '#00ffff',
|
|
130
|
+
letterSpacing: '2px',
|
|
131
|
+
}, children: msg.sparkline }))] })] }, `${msg.generation}-${index}`)))), _jsx("div", { ref: messagesEndRef })] })] }));
|
|
132
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HexGrid } from './HexGrid';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feature flags for HexGrid 3D
|
|
3
|
+
*
|
|
4
|
+
* Allows enabling/disabling features at runtime for different client environments
|
|
5
|
+
*/
|
|
6
|
+
export interface HexGridFeatureFlags {
|
|
7
|
+
/** Enable/disable play-by-play narration overlay */
|
|
8
|
+
enableNarration?: boolean;
|
|
9
|
+
/** Enable/disable statistics tracking and display */
|
|
10
|
+
enableStats?: boolean;
|
|
11
|
+
/** Enable/disable debug panel */
|
|
12
|
+
enableDebugPanel?: boolean;
|
|
13
|
+
/** Enable/disable camera controls UI */
|
|
14
|
+
enableCameraControls?: boolean;
|
|
15
|
+
/** Enable/disable worker-based rendering */
|
|
16
|
+
enableWorker?: boolean;
|
|
17
|
+
/** Enable/disable texture/image loading */
|
|
18
|
+
enableTextures?: boolean;
|
|
19
|
+
/** Enable/disable evolution/animation system */
|
|
20
|
+
enableEvolution?: boolean;
|
|
21
|
+
/** Enable/disable autoplay functionality */
|
|
22
|
+
enableAutoplay?: boolean;
|
|
23
|
+
/** Enable/disable user interactions (clicks, drags) */
|
|
24
|
+
enableInteractions?: boolean;
|
|
25
|
+
/** Enable/disable keyboard shortcuts */
|
|
26
|
+
enableKeyboardShortcuts?: boolean;
|
|
27
|
+
/** Enable/disable performance telemetry */
|
|
28
|
+
enableTelemetry?: boolean;
|
|
29
|
+
/** Enable/disable sheen/visual effects */
|
|
30
|
+
enableVisualEffects?: boolean;
|
|
31
|
+
/** Enable/disable leaderboard system */
|
|
32
|
+
enableLeaderboard?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Default feature flags - all features enabled
|
|
36
|
+
*/
|
|
37
|
+
export declare const DEFAULT_FEATURE_FLAGS: Required<HexGridFeatureFlags>;
|
|
38
|
+
/**
|
|
39
|
+
* Minimal feature flags - only core visualization
|
|
40
|
+
*/
|
|
41
|
+
export declare const MINIMAL_FEATURE_FLAGS: Required<HexGridFeatureFlags>;
|
|
42
|
+
/**
|
|
43
|
+
* Performance-focused feature flags
|
|
44
|
+
*/
|
|
45
|
+
export declare const PERFORMANCE_FEATURE_FLAGS: Required<HexGridFeatureFlags>;
|
|
46
|
+
/**
|
|
47
|
+
* Merge user-provided flags with defaults
|
|
48
|
+
*/
|
|
49
|
+
export declare function mergeFeatureFlags(userFlags?: Partial<HexGridFeatureFlags>): Required<HexGridFeatureFlags>;
|
|
50
|
+
/**
|
|
51
|
+
* Check if a feature is enabled
|
|
52
|
+
*/
|
|
53
|
+
export declare function isFeatureEnabled(flags: HexGridFeatureFlags, feature: keyof HexGridFeatureFlags): boolean;
|
|
54
|
+
//# sourceMappingURL=features.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../src/features.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,mBAAmB;IAClC,oDAAoD;IACpD,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,qDAAqD;IACrD,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,iCAAiC;IACjC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,wCAAwC;IACxC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B,4CAA4C;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB,2CAA2C;IAC3C,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,gDAAgD;IAChD,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,4CAA4C;IAC5C,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,uDAAuD;IACvD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B,wCAAwC;IACxC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAElC,2CAA2C;IAC3C,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,0CAA0C;IAC1C,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B,wCAAwC;IACxC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,mBAAmB,CAc/D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,mBAAmB,CAc/D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,mBAAmB,CAcnE,CAAC;AAEF;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GACvC,QAAQ,CAAC,mBAAmB,CAAC,CAK/B;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,mBAAmB,EAC1B,OAAO,EAAE,MAAM,mBAAmB,GACjC,OAAO,CAET"}
|
package/dist/features.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feature flags for HexGrid 3D
|
|
3
|
+
*
|
|
4
|
+
* Allows enabling/disabling features at runtime for different client environments
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Default feature flags - all features enabled
|
|
8
|
+
*/
|
|
9
|
+
export const DEFAULT_FEATURE_FLAGS = {
|
|
10
|
+
enableNarration: true,
|
|
11
|
+
enableStats: true,
|
|
12
|
+
enableDebugPanel: true,
|
|
13
|
+
enableCameraControls: true,
|
|
14
|
+
enableWorker: true,
|
|
15
|
+
enableTextures: true,
|
|
16
|
+
enableEvolution: true,
|
|
17
|
+
enableAutoplay: true,
|
|
18
|
+
enableInteractions: true,
|
|
19
|
+
enableKeyboardShortcuts: true,
|
|
20
|
+
enableTelemetry: true,
|
|
21
|
+
enableVisualEffects: true,
|
|
22
|
+
enableLeaderboard: true,
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Minimal feature flags - only core visualization
|
|
26
|
+
*/
|
|
27
|
+
export const MINIMAL_FEATURE_FLAGS = {
|
|
28
|
+
enableNarration: false,
|
|
29
|
+
enableStats: false,
|
|
30
|
+
enableDebugPanel: false,
|
|
31
|
+
enableCameraControls: false,
|
|
32
|
+
enableWorker: true,
|
|
33
|
+
enableTextures: true,
|
|
34
|
+
enableEvolution: false,
|
|
35
|
+
enableAutoplay: false,
|
|
36
|
+
enableInteractions: true,
|
|
37
|
+
enableKeyboardShortcuts: false,
|
|
38
|
+
enableTelemetry: false,
|
|
39
|
+
enableVisualEffects: false,
|
|
40
|
+
enableLeaderboard: false,
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Performance-focused feature flags
|
|
44
|
+
*/
|
|
45
|
+
export const PERFORMANCE_FEATURE_FLAGS = {
|
|
46
|
+
enableNarration: false,
|
|
47
|
+
enableStats: true,
|
|
48
|
+
enableDebugPanel: false,
|
|
49
|
+
enableCameraControls: true,
|
|
50
|
+
enableWorker: true,
|
|
51
|
+
enableTextures: true,
|
|
52
|
+
enableEvolution: true,
|
|
53
|
+
enableAutoplay: false,
|
|
54
|
+
enableInteractions: true,
|
|
55
|
+
enableKeyboardShortcuts: true,
|
|
56
|
+
enableTelemetry: false,
|
|
57
|
+
enableVisualEffects: false,
|
|
58
|
+
enableLeaderboard: false,
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Merge user-provided flags with defaults
|
|
62
|
+
*/
|
|
63
|
+
export function mergeFeatureFlags(userFlags) {
|
|
64
|
+
return {
|
|
65
|
+
...DEFAULT_FEATURE_FLAGS,
|
|
66
|
+
...userFlags,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Check if a feature is enabled
|
|
71
|
+
*/
|
|
72
|
+
export function isFeatureEnabled(flags, feature) {
|
|
73
|
+
return flags[feature] !== false;
|
|
74
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './components';
|
|
2
|
+
export * from './stores';
|
|
3
|
+
export * from './features';
|
|
4
|
+
export * from './workers/hexgrid-math';
|
|
5
|
+
export * from './utils/image-utils';
|
|
6
|
+
export type { WorkerDebug, Photo, GridItem } from './types';
|
|
7
|
+
export * from './math';
|
|
8
|
+
export * from './algorithms';
|
|
9
|
+
export * from './HexGridEnhanced';
|
|
10
|
+
export * from './wasm';
|
|
11
|
+
export * from './Snapshot';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAG3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AAGpC,YAAY,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAG5D,cAAc,QAAQ,CAAC;AAGvB,cAAc,cAAc,CAAC;AAG7B,cAAc,mBAAmB,CAAC;AAGlC,cAAc,QAAQ,CAAC;AAGvB,cAAc,YAAY,CAAC"}
|
|
@@ -2,25 +2,16 @@
|
|
|
2
2
|
export * from './components';
|
|
3
3
|
export * from './stores';
|
|
4
4
|
export * from './features';
|
|
5
|
-
|
|
6
5
|
// Export pure mathematical functions
|
|
7
6
|
export * from './workers/hexgrid-math';
|
|
8
7
|
export * from './utils/image-utils';
|
|
9
|
-
|
|
10
|
-
// Export additional types that aren't in components/stores
|
|
11
|
-
export type { WorkerDebug, Photo, GridItem } from './types';
|
|
12
|
-
|
|
13
8
|
// Math library
|
|
14
9
|
export * from './math';
|
|
15
|
-
|
|
16
10
|
// Algorithms (graph, clustering, flow, particles, fluid)
|
|
17
11
|
export * from './algorithms';
|
|
18
|
-
|
|
19
12
|
// Enhanced HexGrid
|
|
20
13
|
export * from './HexGridEnhanced';
|
|
21
|
-
|
|
22
14
|
// WASM acceleration layer
|
|
23
15
|
export * from './wasm';
|
|
24
|
-
|
|
25
16
|
// Unified Snapshot API
|
|
26
17
|
export * from './Snapshot';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface NarrationMessage {
|
|
2
|
+
generation: number;
|
|
3
|
+
timestamp: string;
|
|
4
|
+
priority: number;
|
|
5
|
+
text: string;
|
|
6
|
+
eventType?: string;
|
|
7
|
+
sparkline?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class NarrationManager {
|
|
10
|
+
static getInstance(): any;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=narration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"narration.d.ts","sourceRoot":"","sources":["../../src/lib/narration.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,gBAAgB;IAC3B,MAAM,CAAC,WAAW,IAAI,GAAG;CAM1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stats-tracker.d.ts","sourceRoot":"","sources":["../../src/lib/stats-tracker.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAY;IACvB,MAAM,CAAC,WAAW,IAAI,YAAY;IAIlC,eAAe,IAAI,GAAG;IAStB,iBAAiB,IAAI,GAAG;IAOxB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,EAAE;CAGrC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export class StatsTracker {
|
|
2
|
+
static getInstance() {
|
|
3
|
+
return new StatsTracker();
|
|
4
|
+
}
|
|
5
|
+
getCurrentStats() {
|
|
6
|
+
return {
|
|
7
|
+
generation: 1,
|
|
8
|
+
activeMemesCount: 10,
|
|
9
|
+
totalHexesInfected: 100,
|
|
10
|
+
populationStability: 0.5
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
getAllTimeRecords() {
|
|
14
|
+
return {
|
|
15
|
+
highestTerritory: { value: 100 },
|
|
16
|
+
longestSurvivalStreak: { value: 50 }
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
getLeaderboard(limit) {
|
|
20
|
+
return [];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-colors.d.ts","sourceRoot":"","sources":["../../src/lib/theme-colors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;;;CAGvB,CAAC;AAEF,wBAAgB,aAAa,CAAC,KAAK,GAAE,MAAU,GAAG,MAAM,CAEvD;AAED,wBAAgB,YAAY,IAAI,MAAM,CAErC"}
|