{"_id":"@alihaider_719/pointcloud-viewer","_rev":"3-417ca35d3c5fbad63fd86f2e8afafe98","name":"@alihaider_719/pointcloud-viewer","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@alihaider_719/pointcloud-viewer","version":"1.0.0","keywords":["point-cloud","potree","3d","viewer","lidar","webgpu","webgl","las","laz"],"author":{"name":"Ali Haider, Saad"},"license":"MIT","_id":"@alihaider_719/pointcloud-viewer@1.0.0","maintainers":[{"name":"alihaider_719","email":"alihaiderawan1245@gmail.com"}],"homepage":"https://github.com/AliHaider-09/pointcloud_viewer#readme","bugs":{"url":"https://github.com/AliHaider-09/pointcloud_viewer/issues"},"dist":{"shasum":"d9515c06ef4eca0b72d12fcda1921ea6385874ba","tarball":"https://registry.npmjs.org/@alihaider_719/pointcloud-viewer/-/pointcloud-viewer-1.0.0.tgz","fileCount":235,"integrity":"sha512-nD6XPZz1vfAuYpoHN1DmSWeVP3HHZy79y77AKuJut1qM+uhCpFZ3B3kghLUODDgyUsnV3spoZswBGCzjeB5Q6A==","signatures":[{"sig":"MEYCIQDEnSeixXY9lc3CoHXR05Ti9Lh5j/FUEwcD/7Vi1ZPOuwIhAJwdX2ZvdiCRQqF0pIHhbj7iSO1zoG+FLOTblX8KdEqk","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4767769},"main":"index.html","engines":{"node":">=18"},"gitHead":"4daeb7f0dcdaace97435e42906c40f859ef2bd3c","_npmUser":{"name":"alihaider_719","email":"alihaiderawan1245@gmail.com"},"repository":{"url":"git+https://github.com/AliHaider-09/pointcloud_viewer.git","type":"git"},"_npmVersion":"10.8.3","description":"Standalone, embeddable 3D point cloud viewer built on Potree 2.x. WebGPU + WebGL fallback, zero external dependencies, configurable API, theming via CSS variables.","directories":{},"_nodeVersion":"20.15.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/pointcloud-viewer_1.0.0_1776942696091_0.25680244979811095","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@alihaider_719/pointcloud-viewer","version":"1.0.1","keywords":["point-cloud","potree","3d","viewer","lidar","webgpu","webgl","las","laz"],"author":{"name":"Ali Haider, Saad"},"license":"MIT","_id":"@alihaider_719/pointcloud-viewer@1.0.1","maintainers":[{"name":"alihaider_719","email":"alihaiderawan1245@gmail.com"}],"homepage":"https://github.com/AliHaider-09/pointcloud_viewer#readme","bugs":{"url":"https://github.com/AliHaider-09/pointcloud_viewer/issues"},"dist":{"shasum":"ea6853b16c23af8ac257f82ef8e4e63e24ade025","tarball":"https://registry.npmjs.org/@alihaider_719/pointcloud-viewer/-/pointcloud-viewer-1.0.1.tgz","fileCount":236,"integrity":"sha512-FDbm1jWxqHe178xg/7Hd2NfsjUAKug0t+BKIM8o2YF2iZP/xM+aALIVNY335aAMJJgDF2OMbFD+fPBtALE4iQw==","signatures":[{"sig":"MEYCIQDFkLJBYot03e9wy8b2Ys+hcS7/jX83tY4a2gBs0fVTgwIhAPhQ0I+vHbl0ouV9myuT3gYS9SKs3Fzbvz+xOexEgid0","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4771411},"main":"index.html","engines":{"node":">=18"},"gitHead":"c766e5dc2d931ac30cf6fa13cb2b1e471ad67847","_npmUser":{"name":"alihaider_719","email":"alihaiderawan1245@gmail.com"},"repository":{"url":"git+https://github.com/AliHaider-09/pointcloud_viewer.git","type":"git"},"_npmVersion":"10.8.3","description":"Standalone, embeddable 3D point cloud viewer built on Potree 2.x. WebGPU + WebGL fallback, zero external dependencies, configurable API, theming via CSS variables.","directories":{},"_nodeVersion":"20.15.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/pointcloud-viewer_1.0.1_1777010213609_0.02663455298960149","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@alihaider_719/pointcloud-viewer","version":"1.0.2","description":"Standalone, embeddable 3D point cloud viewer built on Potree 2.x. WebGPU + WebGL fallback, zero external dependencies, configurable API, theming via CSS variables.","main":"index.html","keywords":["point-cloud","potree","3d","viewer","lidar","webgpu","webgl","las","laz"],"author":{"name":"Ali Haider, Saad"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/AliHaider-09/pointcloud_viewer.git"},"bugs":{"url":"https://github.com/AliHaider-09/pointcloud_viewer/issues"},"homepage":"https://github.com/AliHaider-09/pointcloud_viewer#readme","engines":{"node":">=18"},"_id":"@alihaider_719/pointcloud-viewer@1.0.2","gitHead":"c766e5dc2d931ac30cf6fa13cb2b1e471ad67847","_nodeVersion":"20.15.1","_npmVersion":"10.8.3","dist":{"integrity":"sha512-RCKg5RovBVqh78vLYKY0mrHT9emWHVhQct6Uu0UrP4hiFb4LI/spFV+y9/RqNgvywA0bVHykcyQKdVniOA0GZg==","shasum":"f0c155667999d854b73348ec80e05f8152ac87b5","tarball":"https://registry.npmjs.org/@alihaider_719/pointcloud-viewer/-/pointcloud-viewer-1.0.2.tgz","fileCount":236,"unpackedSize":4771401,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCXKYJhP+bIx6Aq9hp+eUv/64G3KU6KowbGuFtJk01CNgIhAOjikTOAl/R1lgMYnYhCQztiej8gj1d65qL/TlrY7eG2"}]},"_npmUser":{"name":"alihaider_719","email":"alihaiderawan1245@gmail.com"},"directories":{},"maintainers":[{"name":"alihaider_719","email":"alihaiderawan1245@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pointcloud-viewer_1.0.2_1777012173073_0.18965673266848104"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-23T11:11:35.998Z","modified":"2026-04-24T06:29:33.485Z","1.0.0":"2026-04-23T11:11:36.332Z","1.0.1":"2026-04-24T05:56:53.828Z","1.0.2":"2026-04-24T06:29:33.381Z"},"bugs":{"url":"https://github.com/AliHaider-09/pointcloud_viewer/issues"},"author":{"name":"Ali Haider, Saad"},"license":"MIT","homepage":"https://github.com/AliHaider-09/pointcloud_viewer#readme","keywords":["point-cloud","potree","3d","viewer","lidar","webgpu","webgl","las","laz"],"repository":{"type":"git","url":"git+https://github.com/AliHaider-09/pointcloud_viewer.git"},"description":"Standalone, embeddable 3D point cloud viewer built on Potree 2.x. WebGPU + WebGL fallback, zero external dependencies, configurable API, theming via CSS variables.","maintainers":[{"name":"alihaider_719","email":"alihaiderawan1245@gmail.com"}],"readme":"# pointcloud_viewer\n\nStandalone, embeddable 3D point cloud viewer built on Potree 2.x. Drop it in an iframe — no auth, no backend, no build step required.\n\n**WebGPU** on supported browsers (Chrome/Edge ≥ 113), **WebGL** fallback everywhere else. Zero external runtime dependencies — all libraries bundled locally.\n\n---\n\n## Install\n\n```bash\nnpm install @alihaider_719/pointcloud-viewer\n```\n\n---\n\n## Important — Must Be Served via HTTP\n\nThe viewer uses ES modules and `importmap`, which **do not work when opened as a local file** (`file://`). You must serve the package through an HTTP server.\n\n### Quick local test (no install needed)\n\n```bash\n# Using npx serve\nnpx serve node_modules/@alihaider_719/pointcloud-viewer\n\n# Using Python\npython -m http.server 3001 --directory node_modules/@alihaider_719/pointcloud-viewer\n\n# Using Node.js http-server\nnpx http-server node_modules/@alihaider_719/pointcloud-viewer -p 3001\n```\n\nThen open in Chrome or Edge:\n\n```\nhttp://localhost:3001/demo.html\n```\n\nOr load any point cloud directly:\n\n```\nhttp://localhost:3001/index.html?url=https://your-cdn.com/scan/metadata.json\n```\n\n---\n\n## Embed in a Web App\n\n### Vanilla HTML\n\n```html\n<iframe\n  src=\"/node_modules/@alihaider_719/pointcloud-viewer/index.html?url=https://your-cdn.com/scan/metadata.json\"\n  width=\"100%\"\n  height=\"600\"\n  allow=\"fullscreen\"\n></iframe>\n```\n\n> The viewer folder must be reachable at the path you reference. If your app serves `node_modules/` statically, the path above works as-is. Otherwise copy the package to your `public/` or `static/` folder.\n\n### React\n\n```jsx\nexport function PointCloudViewer({ url }) {\n  return (\n    <iframe\n      src={`/pointcloud-viewer/index.html?url=${encodeURIComponent(url)}`}\n      style={{ width: '100%', height: '600px', border: 'none' }}\n      allow=\"fullscreen\"\n      title=\"Point Cloud Viewer\"\n    />\n  );\n}\n```\n\nCopy the package into `public/pointcloud-viewer/` so Next.js / Vite serves it statically.\n\n### Vue\n\n```html\n<template>\n  <iframe\n    :src=\"`/pointcloud-viewer/index.html?url=${encodeURIComponent(url)}`\"\n    style=\"width:100%;height:600px;border:none\"\n    allow=\"fullscreen\"\n    title=\"Point Cloud Viewer\"\n  />\n</template>\n```\n\n---\n\n## URL Parameters\n\n| Parameter        | Description                                    | Default            |\n| ---------------- | ---------------------------------------------- | ------------------ |\n| `url`            | Path to `metadata.json` **(required)**         | —                  |\n| `name`           | Display name shown in the viewer               | `\"Point Cloud\"`    |\n| `projectId`      | Project UUID — enables measurement persistence | —                  |\n| `apiBase`        | API base URL for measurement CRUD              | `\"\"` (same-origin) |\n| `authToken`      | Bearer token for cross-origin API calls        | —                  |\n| `parentOrigin`   | Locks postMessage to a specific origin         | `\"*\"`              |\n| `showBackButton` | Show back navigation button (`1` to enable)    | `0`                |\n| `fallback`       | Force WebGL renderer (`1` to force)            | `0`                |\n\n---\n\n## Events (viewer → parent)\n\n```js\nwindow.addEventListener('message', (e) => {\n  if (e.source !== iframe.contentWindow) return;\n  switch (e.data?.type) {\n    case 'potree-ready':\n      console.log('Renderer:', e.data.renderer); // \"webgpu\" | \"webgl\"\n      break;\n    case 'potree-error':\n      console.error(e.data.code, e.data.message);\n      break;\n    case 'potree-measurement-change':\n      console.log(e.data.action, e.data.measurement);\n      break;\n    case 'potree-navigate-back':\n      history.back();\n      break;\n  }\n});\n```\n\n| Event                       | When                                  | Payload                             |\n| --------------------------- | ------------------------------------- | ----------------------------------- |\n| `potree-ready`              | First frame rendered                  | `{ renderer: \"webgpu\" \\| \"webgl\" }` |\n| `potree-error`              | Viewer fails to initialize            | `{ code, message }`                 |\n| `potree-measurement-change` | Measurement saved / renamed / deleted | `{ action, measurement }`           |\n| `potree-navigate-back`      | Back button clicked                   | —                                   |\n\n## Messages (parent → viewer)\n\n```js\n// Refresh auth token at runtime\niframe.contentWindow.postMessage(\n  { type: 'potree-set-auth-token', token: 'new-token' },\n  'https://yourapp.com'\n);\n```\n\n---\n\n## Measurement Persistence\n\nTo persist measurements to your own backend, pass `apiBase`, `projectId`, and `authToken`:\n\n```html\n<iframe src=\"/pointcloud-viewer/index.html\n  ?url=https://cdn.example.com/scan/metadata.json\n  &apiBase=https://api.example.com\n  &projectId=abc-123\n  &authToken=eyJhbG...\n  &parentOrigin=https://yourapp.com\">\n</iframe>\n```\n\nExpected endpoints:\n\n```\nGET    {apiBase}/api/projects/{projectId}/measurements\nPOST   {apiBase}/api/projects/{projectId}/measurements\nPATCH  {apiBase}/api/projects/{projectId}/measurements/{id}\nDELETE {apiBase}/api/projects/{projectId}/measurements/{id}\n```\n\nWithout `projectId`, measurements work in memory with no API calls.\n\n---\n\n## Theming\n\nOverride any of the 15 CSS variables to rebrand the viewer:\n\n```css\n/* Full dark theme example */\n:root {\n  --potree-accent-color: #10b981;\n  --potree-sidebar-bg: rgba(15, 23, 42, 0.88);\n  --potree-text-color: #f1f5f9;\n  --potree-font-family: 'Inter', system-ui, sans-serif;\n}\n```\n\n| Variable                      | Purpose                      | Default                            |\n| ----------------------------- | ---------------------------- | ---------------------------------- |\n| `--potree-accent-color`       | Primary brand color          | `#3B82F6`                          |\n| `--potree-sidebar-bg`         | Sidebar + toolbar background | `rgba(255,255,255,0.85)`           |\n| `--potree-sidebar-blur`       | Backdrop blur strength       | `16px`                             |\n| `--potree-text-color`         | All sidebar/toolbar text     | `#000`                             |\n| `--potree-font-family`        | Viewer font                  | `'Poppins', system-ui, sans-serif` |\n| `--potree-surface`            | Dropdown background          | `#fff`                             |\n| `--potree-input-bg`           | Input / select background    | `#f8fafc`                          |\n| `--potree-button-bg`          | Default button background    | `#f1f5f9`                          |\n| `--potree-border-color`       | Subtle dividers              | `rgba(0,0,0,0.1)`                  |\n| `--potree-border-strong`      | Input / button borders       | `#e2e8f0`                          |\n| `--potree-accent-hover-bg`    | Button hover background      | `#e0e7ff`                          |\n| `--potree-accent-tint-soft`   | Row hover tint               | `rgba(59,130,246,0.06)`            |\n| `--potree-accent-tint-medium` | Focus box-shadow             | `rgba(59,130,246,0.15)`            |\n| `--potree-accent-tint-strong` | Range slider fill            | `rgba(59,130,246,0.4)`             |\n| `--potree-row-divider`        | Table row underlines         | `rgba(0,0,0,0.06)`                 |\n\n---\n\n## Browser Support\n\n| Renderer       | Browsers                              |\n| -------------- | ------------------------------------- |\n| WebGPU         | Chrome / Edge ≥ 113, Safari ≥ 18      |\n| WebGL fallback | All other modern browsers (Firefox, etc.) |\n\n---\n\n## What's Included\n\n- Potree 2.x renderer (WebGPU + WebGL)\n- Viewing tools — RGB, Intensity, Elevation, point size, FPV / Orbit\n- Measurement system — distance, area, point, vertex editing\n- Clip view — volume box, face selection, ortho 2D, interactive gizmo\n- Magnifier cursor, dynamic point budget, height profile tool\n- All dependencies bundled locally (Three.js, es-module-shims, gl-matrix, proj4, brotli, laz-perf, tween, Poppins)\n- GDPR-compliant — no external font or CDN requests at runtime\n- Fully offline-capable once served\n\n## What's NOT Included\n\n- Authentication / login\n- File upload\n- Project dashboard\n- Cloud storage integration\n\n---\n\n## License\n\nMIT © Ali Haider, Saad\n\nBuilt on [Potree](https://github.com/potree/potree) · [Three.js](https://threejs.org) · [laz-perf](https://github.com/connormanning/laz-perf)\n","readmeFilename":"README.md"}