Skip to content

Commit 2d95e57

Browse files
committed
feat: implement analytics component
1 parent 34e4abb commit 2d95e57

28 files changed

+4226
-1619
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ __pycache__/
3737
/doc/_apidoc/
3838
/build
3939
/public/cesium/
40+
docs/

package-lock.json

Lines changed: 1436 additions & 1560 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,44 +26,44 @@
2626
}
2727
},
2828
"dependencies": {
29-
"@aws-sdk/client-dynamodb": "^3.971.0",
30-
"@aws-sdk/client-s3": "^3.971.0",
31-
"@aws-sdk/client-sagemaker": "^3.971.0",
32-
"@aws-sdk/client-sqs": "^3.971.0",
33-
"@aws-sdk/client-sts": "^3.971.0",
34-
"@aws-sdk/credential-providers": "^3.971.0",
35-
"@aws-sdk/util-dynamodb": "^3.971.0",
29+
"@aws-sdk/client-dynamodb": "^3.997.0",
30+
"@aws-sdk/client-s3": "^3.997.0",
31+
"@aws-sdk/client-sagemaker": "^3.997.0",
32+
"@aws-sdk/client-sqs": "^3.997.0",
33+
"@aws-sdk/client-sts": "^3.997.0",
34+
"@aws-sdk/credential-providers": "^3.997.0",
35+
"@aws-sdk/util-dynamodb": "^3.996.1",
3636
"config-ini-parser": "^1.6.1",
37-
"electron-updater": "^6.7.3",
38-
"resium": "^1.19.2",
37+
"electron-updater": "^6.8.3",
38+
"resium": "^1.19.4",
3939
"uuid": "^13.0.0"
4040
},
4141
"devDependencies": {
42-
"@playwright/test": "^1.57.0",
42+
"@playwright/test": "^1.58.2",
4343
"@types/jest": "^30.0.0",
44-
"@types/react": "^19.2.9",
44+
"@types/react": "^19.2.14",
4545
"@types/react-dom": "^19.2.3",
4646
"@types/uuid": "^11.0.0",
47-
"@typescript-eslint/eslint-plugin": "^8.53.1",
48-
"@vitejs/plugin-react": "^5.1.2",
49-
"cesium": "^1.137.0",
50-
"electron": "^40.0.0",
51-
"electron-builder": "^26.5.0",
52-
"eslint": "^9.39.2",
47+
"@typescript-eslint/eslint-plugin": "^8.56.1",
48+
"@vitejs/plugin-react": "^5.1.4",
49+
"cesium": "^1.138.0",
50+
"electron": "^40.6.1",
51+
"electron-builder": "^26.8.1",
52+
"eslint": "^10.0.2",
5353
"eslint-config-prettier": "^10.1.8",
5454
"eslint-import-resolver-typescript": "^4.4.4",
5555
"eslint-plugin-import": "^2.32.0",
56-
"eslint-plugin-jest": "^29.12.1",
56+
"eslint-plugin-jest": "^29.15.0",
5757
"eslint-plugin-prettier": "^5.5.5",
5858
"eslint-plugin-promise": "^7.2.1",
5959
"eslint-plugin-simple-import-sort": "^12.1.1",
6060
"jest": "^30.2.0",
6161
"lint-staged": "^16.2.7",
62-
"patch-package": "^8.0.0",
63-
"prettier": "^3.8.0",
64-
"react": "^19.2.3",
65-
"react-dom": "^19.2.3",
66-
"sass": "^1.97.2",
62+
"patch-package": "^8.0.1",
63+
"prettier": "^3.8.1",
64+
"react": "^19.2.4",
65+
"react-dom": "^19.2.4",
66+
"sass": "^1.97.3",
6767
"ts-jest": "^29.4.6",
6868
"typescript": "^5.9.3",
6969
"vite": "^7.3.1",

src/App.tsx

Lines changed: 52 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import Logo from "@/components/Logo";
1414
import FeaturePopup, { type FeaturePopupData } from "@/components/FeaturePopup";
1515
import ConfigWarnings from "@/components/alert/ConfigWarnings";
1616
import { ResourceProvider } from "@/context/ResourceContext";
17+
import { AnalyticsProvider } from "@/context/AnalyticsContext";
18+
import { AnalyticsPanel } from "@/components/analytics";
1719
import type { ImageRequestState } from "@/types";
1820

1921
/** Natural Earth II fallback (offline, bundled with Cesium) */
@@ -45,6 +47,7 @@ const App = () => {
4547

4648
const [baseLayer, setBaseLayer] = useState<Cesium.ImageryLayer | null>(null);
4749
const [featurePopupData, setFeaturePopupData] = useState<FeaturePopupData | null>(null);
50+
const [showAnalytics, setShowAnalytics] = useState(false);
4851

4952
// Callback for feature clicks -- called from cesiumHelper
5053
const handleFeaturePopup = useCallback((data: FeaturePopupData | null) => {
@@ -101,22 +104,56 @@ const App = () => {
101104
fullscreenButton={false}
102105
>
103106
<ResourceProvider>
104-
<Logo />
105-
<OsmlTray
106-
imageRequestStatus={imageRequestStatus}
107-
setImageRequestStatus={setImageRequestStatus}
108-
onFeatureClick={handleFeaturePopup}
109-
/>
110-
<StatusDisplay
111-
imageRequestStatus={imageRequestStatus}
112-
setImageRequestStatus={setImageRequestStatus}
113-
/>
114-
{featurePopupData && (
115-
<FeaturePopup
116-
data={featurePopupData}
117-
onClose={() => setFeaturePopupData(null)}
107+
<AnalyticsProvider>
108+
<Logo />
109+
<OsmlTray
110+
imageRequestStatus={imageRequestStatus}
111+
setImageRequestStatus={setImageRequestStatus}
112+
onFeatureClick={handleFeaturePopup}
118113
/>
119-
)}
114+
<div className="analytics-toggle">
115+
<button
116+
onClick={() => setShowAnalytics((prev) => !prev)}
117+
title="Toggle Analytics Panel"
118+
style={{
119+
background: showAnalytics ? "rgba(0, 115, 187, 0.3)" : "rgba(12, 15, 22, 0.7)",
120+
backdropFilter: "blur(12px)",
121+
WebkitBackdropFilter: "blur(12px)",
122+
border: "1px solid rgba(255, 255, 255, 0.1)",
123+
borderRadius: "10px",
124+
padding: "8px 12px",
125+
cursor: "pointer",
126+
color: "rgba(255, 255, 255, 0.8)",
127+
fontSize: "13px",
128+
fontFamily: "inherit",
129+
display: "flex",
130+
alignItems: "center",
131+
gap: "6px",
132+
transition: "all 0.15s ease",
133+
}}
134+
>
135+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
136+
<rect x="1" y="8" width="3" height="7" rx="1" fill="currentColor" opacity="0.6" />
137+
<rect x="5.5" y="5" width="3" height="10" rx="1" fill="currentColor" opacity="0.7" />
138+
<rect x="10" y="2" width="3" height="13" rx="1" fill="currentColor" opacity="0.9" />
139+
</svg>
140+
Analytics
141+
</button>
142+
</div>
143+
{showAnalytics && (
144+
<AnalyticsPanel onClose={() => setShowAnalytics(false)} />
145+
)}
146+
<StatusDisplay
147+
imageRequestStatus={imageRequestStatus}
148+
setImageRequestStatus={setImageRequestStatus}
149+
/>
150+
{featurePopupData && (
151+
<FeaturePopup
152+
data={featurePopupData}
153+
onClose={() => setFeaturePopupData(null)}
154+
/>
155+
)}
156+
</AnalyticsProvider>
120157
</ResourceProvider>
121158
</ResiumViewer>
122159
</>

0 commit comments

Comments
 (0)