@viamrobotics/motion-tools 1.23.1 → 1.24.0

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/README.md CHANGED
@@ -4,14 +4,12 @@
4
4
 
5
5
  ## Documentation
6
6
 
7
- 📚 **[viamrobotics.github.io/visualization](https://viamrobotics.github.io/visualization/)** is the canonical guide. It covers:
7
+ 📚 **[viamrobotics.github.io/visualization](https://viamrobotics.github.io/visualization/)** is our guide to a few popular use cases. It covers:
8
8
 
9
9
  - [Running locally](https://viamrobotics.github.io/visualization/guides/local-usage/) — set up the app and drive it from Go via `client/api`.
10
- - [Embedding `<MotionTools />`](https://viamrobotics.github.io/visualization/guides/embedding/) — drop the visualizer into your own Svelte app.
11
- - [Implementing WorldStateStoreService](https://viamrobotics.github.io/visualization/guides/worldstatestore/) — produce `Transform`s for a Viam WSS module with `draw`.
12
- - API reference for [`client/api`](https://viamrobotics.github.io/visualization/api/client-api/) and [`draw`](https://viamrobotics.github.io/visualization/api/draw/).
13
- - [v1 → v2 migration guide](https://viamrobotics.github.io/visualization/migration/v1-to-v2/).
14
- - A live [playground](https://viamrobotics.github.io/visualization/playground/) rendering a baked snapshot.
10
+ - [Embedding `<Visualizer />`](https://viamrobotics.github.io/visualization/guides/embedding/) — drop the visualizer into your own Svelte app.
11
+ - [Implementing WorldStateStoreService](https://viamrobotics.github.io/visualization/guides/worldstatestore/) — produce `Transform`s for a Viam WorldStateStoreService module with `draw`.
12
+ - A live [playground](https://viamrobotics.github.io/visualization/playground/snapshot) rendering a snapshot.
15
13
 
16
14
  ## Quick start
17
15
 
@@ -14,12 +14,21 @@
14
14
  renderOrder?: number
15
15
  depthTest?: boolean
16
16
  depthWrite?: boolean
17
+ color?: { r: number; g: number; b: number }
17
18
  interactionLayers?: InteractionLayerValue[]
18
19
  oncreate?: (positions: Float32Array, colors: Uint8Array | undefined) => void
19
20
  }
20
21
 
21
- let { data, name, renderOrder, depthTest, depthWrite, interactionLayers, oncreate }: Props =
22
- $props()
22
+ let {
23
+ data,
24
+ name,
25
+ renderOrder,
26
+ depthTest,
27
+ depthWrite,
28
+ color,
29
+ interactionLayers,
30
+ oncreate,
31
+ }: Props = $props()
23
32
 
24
33
  const world = useWorld()
25
34
 
@@ -41,11 +50,16 @@
41
50
  if (renderOrder) {
42
51
  entityTraits.push(traits.RenderOrder(renderOrder))
43
52
  }
53
+
44
54
  if (depthTest !== undefined || depthWrite !== undefined) {
45
55
  entityTraits.push(
46
56
  traits.Material({ depthTest: depthTest ?? true, depthWrite: depthWrite ?? true })
47
57
  )
48
58
  }
59
+ if (color !== undefined) {
60
+ geometry.deleteAttribute('color')
61
+ entityTraits.push(traits.Color({ r: color.r, g: color.g, b: color.b }))
62
+ }
49
63
  if (interactionLayers?.includes('selectTool')) {
50
64
  entityTraits.push(traits.SelectToolInteractionLayer)
51
65
  }
@@ -5,6 +5,11 @@ interface Props {
5
5
  renderOrder?: number;
6
6
  depthTest?: boolean;
7
7
  depthWrite?: boolean;
8
+ color?: {
9
+ r: number;
10
+ g: number;
11
+ b: number;
12
+ };
8
13
  interactionLayers?: InteractionLayerValue[];
9
14
  oncreate?: (positions: Float32Array, colors: Uint8Array | undefined) => void;
10
15
  }
@@ -338,7 +338,7 @@
338
338
  {#if entity}
339
339
  <div
340
340
  id="details-panel"
341
- class="border-medium bg-extralight absolute top-0 right-0 z-4 m-2 w-70 border p-2 text-xs dark:text-black"
341
+ class="border-medium bg-extralight absolute top-0 right-0 z-4 m-2 w-70 border p-2 text-xs dark:text-white"
342
342
  use:draggable={{
343
343
  bounds: 'body',
344
344
  handle: dragElement,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viamrobotics/motion-tools",
3
- "version": "1.23.1",
3
+ "version": "1.24.0",
4
4
  "description": "Motion visualization with Viam",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -12,7 +12,7 @@
12
12
  "@dimforge/rapier3d-compat": "0.18.2",
13
13
  "@eslint/compat": "2.0.2",
14
14
  "@eslint/js": "10.0.1",
15
- "@playwright/test": "1.55.0",
15
+ "@playwright/test": "1.55.1",
16
16
  "@sentry/sveltekit": "10.10.0",
17
17
  "@skeletonlabs/skeleton": "3.2.0",
18
18
  "@skeletonlabs/skeleton-svelte": "1.5.1",
@@ -70,7 +70,7 @@
70
70
  "svelte-virtuallists": "1.4.2",
71
71
  "tailwindcss": "4.1.13",
72
72
  "three": "0.183.2",
73
- "threlte-uikit": "1.2.1",
73
+ "threlte-uikit": "^2.0.0",
74
74
  "tsx": "4.20.5",
75
75
  "type-fest": "^5.0.1",
76
76
  "typescript": "5.9.2",
@@ -78,7 +78,7 @@
78
78
  "vite": "7.3.2",
79
79
  "vite-plugin-devtools-json": "1.0.0",
80
80
  "vite-plugin-glsl": "^1.5.5",
81
- "vite-plugin-mkcert": "1.17.8",
81
+ "vite-plugin-mkcert": "1.17.9",
82
82
  "vitest": "3.2.4"
83
83
  },
84
84
  "peerDependencies": {