Three.js + Vue 3 .glb viewer, with buttons to cluster objects by shape or color.
- Version: 1.0.1
- Repo: https://github.com/richplastow/cluster-viewer
- Homepage: https://richplastow.com/cluster-viewer
- A bare-bones solution, with tidy code and a presentable UI
- Keep within the
npm init vue@latest
guardrails, for a 'standard' Vue 3 app - The app is simple enough not to need a UI library or global state system
- Allows for slightly updated versions of the glTF models to be swapped in
- Heads toward a more general purpose app, which can deal with any glTF model
- Accessibility: Add aria-roles, and test and improve text-to-speech and keyboard access
- Internationalization: Currently UI text is hard coded in British English
- Tests and Documentation: More unit tests and end-to-end tests, and better JSDoc documentation throughout (also, refactoring)
- Performance: In terms of bundle/chink size, Lighthouse TTI, animation FPS
- Orbit Controls: Limit how far the user can zoom, and provide a reset
- SEO: Add Open Graph metadata, for better searchability and social media previews - and then add a share button
- Offline Mode: for iOS's 'Add to Home Screen', maybe with a service worker
- Icons: A full set of icons and native theme, eg using RealFaviconGenerator
- Error Handling: Show user-friendly error popups on unhandled exceptions, or Sentry ...the usage analytics would be interesting
- Tidier Clusters: They should stack up in size-order, and all sit on the ground plane
- Model Upload: Let the user upload or link to any glTF file
- Settings Popup: For example, set language, theme and animation speed
VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).
TypeScript cannot handle type information for .vue
imports by default, so we replace the tsc
CLI with vue-tsc
for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue
types.
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:
- Disable the built-in TypeScript Extension
- Run
Extensions: Show Built-in Extensions
from VSCode's command palette - Find
TypeScript and JavaScript Language Features
, right click and selectDisable (Workspace)
- Run
- Reload the VSCode window by running
Developer: Reload Window
from the command palette.
See Vite Configuration Reference.
npm install
npm run dev
npm start
Run Unit Tests with Vitest
npm run test:unit
Run End-to-End Tests with Playwright
# Install browsers for the first run
npx playwright install
# When testing on CI, must build the project first
npm run build
# Runs the end-to-end tests
npm run test
# Runs the tests only on Chromium
npm run test -- --project=chromium
# And also just a specific file's tests
npm run test -- e2e/02-screenshots.spec.ts --project=chromium
# Runs the tests in debug mode
npm run test -- --debug
Lint with ESLint
npm run lint