@viamrobotics/motion-tools 1.19.1 → 1.21.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.
Files changed (32) hide show
  1. package/dist/buf/draw/v1/metadata_pb.d.ts +39 -0
  2. package/dist/buf/draw/v1/metadata_pb.js +55 -0
  3. package/dist/buf/draw/v1/service_connect.d.ts +34 -1
  4. package/dist/buf/draw/v1/service_connect.js +34 -1
  5. package/dist/buf/draw/v1/service_pb.d.ts +136 -0
  6. package/dist/buf/draw/v1/service_pb.js +201 -0
  7. package/dist/components/Entities/Arrows/ArrowGroups.svelte +1 -0
  8. package/dist/components/Entities/Arrows/Arrows.svelte +1 -1
  9. package/dist/components/Entities/Points.svelte +23 -23
  10. package/dist/components/Entities/hooks/useEntityEvents.svelte.js +18 -1
  11. package/dist/components/FileDrop/FileDrop.svelte +8 -1
  12. package/dist/components/PCD.svelte +9 -1
  13. package/dist/components/PCD.svelte.d.ts +2 -0
  14. package/dist/components/SceneProviders.svelte +2 -0
  15. package/dist/components/Snapshot.svelte +12 -7
  16. package/dist/components/overlay/AddRelationship.svelte +25 -3
  17. package/dist/components/overlay/Details.svelte +293 -227
  18. package/dist/draw.d.ts +22 -9
  19. package/dist/draw.js +71 -41
  20. package/dist/ecs/relations.js +1 -1
  21. package/dist/ecs/traits.d.ts +2 -0
  22. package/dist/ecs/traits.js +2 -0
  23. package/dist/hooks/useDrawService.svelte.d.ts +2 -0
  24. package/dist/hooks/useDrawService.svelte.js +139 -20
  25. package/dist/hooks/useRelationships.svelte.d.ts +12 -0
  26. package/dist/hooks/useRelationships.svelte.js +78 -0
  27. package/dist/hooks/useWorldState.svelte.js +10 -4
  28. package/dist/metadata.d.ts +7 -3
  29. package/dist/metadata.js +26 -2
  30. package/dist/snapshot.d.ts +6 -1
  31. package/dist/snapshot.js +10 -5
  32. package/package.json +5 -2
@@ -48,6 +48,39 @@ export declare class Chunks extends Message<Chunks> {
48
48
  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Chunks;
49
49
  static equals(a: Chunks | PlainMessage<Chunks> | undefined, b: Chunks | PlainMessage<Chunks> | undefined): boolean;
50
50
  }
51
+ /**
52
+ * A directed link from a source entity to a target entity.
53
+ *
54
+ * @generated from message draw.v1.Relationship
55
+ */
56
+ export declare class Relationship extends Message<Relationship> {
57
+ /**
58
+ * UUID of the target entity this relationship points to.
59
+ *
60
+ * @generated from field: bytes target_uuid = 1;
61
+ */
62
+ targetUuid: Uint8Array<ArrayBuffer>;
63
+ /**
64
+ * Free-form link type (e.g. "HoverLink"). Clients decide how to interpret.
65
+ *
66
+ * @generated from field: string type = 2;
67
+ */
68
+ type: string;
69
+ /**
70
+ * Optional filtrex expression (variable: `index`). Defaults to "index".
71
+ *
72
+ * @generated from field: optional string index_mapping = 3;
73
+ */
74
+ indexMapping?: string;
75
+ constructor(data?: PartialMessage<Relationship>);
76
+ static readonly runtime: typeof proto3;
77
+ static readonly typeName = "draw.v1.Relationship";
78
+ static readonly fields: FieldList;
79
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Relationship;
80
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Relationship;
81
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Relationship;
82
+ static equals(a: Relationship | PlainMessage<Relationship> | undefined, b: Relationship | PlainMessage<Relationship> | undefined): boolean;
83
+ }
51
84
  /**
52
85
  * @generated from message draw.v1.Metadata
53
86
  */
@@ -92,6 +125,12 @@ export declare class Metadata extends Message<Metadata> {
92
125
  * @generated from field: optional draw.v1.Chunks chunks = 6;
93
126
  */
94
127
  chunks?: Chunks;
128
+ /**
129
+ * Directed relationships from this entity to other entities.
130
+ *
131
+ * @generated from field: repeated draw.v1.Relationship relationships = 7;
132
+ */
133
+ relationships: Relationship[];
95
134
  constructor(data?: PartialMessage<Metadata>);
96
135
  static readonly runtime: typeof proto3;
97
136
  static readonly typeName = "draw.v1.Metadata";
@@ -72,6 +72,54 @@ export class Chunks extends Message {
72
72
  return proto3.util.equals(Chunks, a, b);
73
73
  }
74
74
  }
75
+ /**
76
+ * A directed link from a source entity to a target entity.
77
+ *
78
+ * @generated from message draw.v1.Relationship
79
+ */
80
+ export class Relationship extends Message {
81
+ /**
82
+ * UUID of the target entity this relationship points to.
83
+ *
84
+ * @generated from field: bytes target_uuid = 1;
85
+ */
86
+ targetUuid = new Uint8Array(0);
87
+ /**
88
+ * Free-form link type (e.g. "HoverLink"). Clients decide how to interpret.
89
+ *
90
+ * @generated from field: string type = 2;
91
+ */
92
+ type = "";
93
+ /**
94
+ * Optional filtrex expression (variable: `index`). Defaults to "index".
95
+ *
96
+ * @generated from field: optional string index_mapping = 3;
97
+ */
98
+ indexMapping;
99
+ constructor(data) {
100
+ super();
101
+ proto3.util.initPartial(data, this);
102
+ }
103
+ static runtime = proto3;
104
+ static typeName = "draw.v1.Relationship";
105
+ static fields = proto3.util.newFieldList(() => [
106
+ { no: 1, name: "target_uuid", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
107
+ { no: 2, name: "type", kind: "scalar", T: 9 /* ScalarType.STRING */ },
108
+ { no: 3, name: "index_mapping", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
109
+ ]);
110
+ static fromBinary(bytes, options) {
111
+ return new Relationship().fromBinary(bytes, options);
112
+ }
113
+ static fromJson(jsonValue, options) {
114
+ return new Relationship().fromJson(jsonValue, options);
115
+ }
116
+ static fromJsonString(jsonString, options) {
117
+ return new Relationship().fromJsonString(jsonString, options);
118
+ }
119
+ static equals(a, b) {
120
+ return proto3.util.equals(Relationship, a, b);
121
+ }
122
+ }
75
123
  /**
76
124
  * @generated from message draw.v1.Metadata
77
125
  */
@@ -116,6 +164,12 @@ export class Metadata extends Message {
116
164
  * @generated from field: optional draw.v1.Chunks chunks = 6;
117
165
  */
118
166
  chunks;
167
+ /**
168
+ * Directed relationships from this entity to other entities.
169
+ *
170
+ * @generated from field: repeated draw.v1.Relationship relationships = 7;
171
+ */
172
+ relationships = [];
119
173
  constructor(data) {
120
174
  super();
121
175
  proto3.util.initPartial(data, this);
@@ -129,6 +183,7 @@ export class Metadata extends Message {
129
183
  { no: 4, name: "show_axes_helper", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
130
184
  { no: 5, name: "invisible", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
131
185
  { no: 6, name: "chunks", kind: "message", T: Chunks, opt: true },
186
+ { no: 7, name: "relationships", kind: "message", T: Relationship, repeated: true },
132
187
  ]);
133
188
  static fromBinary(bytes, options) {
134
189
  return new Metadata().fromBinary(bytes, options);
@@ -1,4 +1,4 @@
1
- import { AddEntityRequest, AddEntityResponse, RemoveAllDrawingsRequest, RemoveAllDrawingsResponse, RemoveAllRequest, RemoveAllResponse, RemoveAllTransformsRequest, RemoveAllTransformsResponse, RemoveEntityRequest, RemoveEntityResponse, SetSceneRequest, SetSceneResponse, StreamEntityChangesRequest, StreamEntityChangesResponse, StreamSceneChangesRequest, StreamSceneChangesResponse, UpdateEntityRequest, UpdateEntityResponse } from "./service_pb";
1
+ import { AddEntityRequest, AddEntityResponse, CreateRelationshipRequest, CreateRelationshipResponse, DeleteRelationshipRequest, DeleteRelationshipResponse, GetEntityChunkRequest, GetEntityChunkResponse, RemoveAllDrawingsRequest, RemoveAllDrawingsResponse, RemoveAllRequest, RemoveAllResponse, RemoveAllTransformsRequest, RemoveAllTransformsResponse, RemoveEntityRequest, RemoveEntityResponse, SetSceneRequest, SetSceneResponse, StreamEntityChangesRequest, StreamEntityChangesResponse, StreamSceneChangesRequest, StreamSceneChangesResponse, UpdateEntityRequest, UpdateEntityResponse } from "./service_pb";
2
2
  import { MethodKind } from "@bufbuild/protobuf";
3
3
  /**
4
4
  * DrawService provides visualization APIs for managing transforms and custom drawing primitives
@@ -107,5 +107,38 @@ export declare const DrawService: {
107
107
  readonly O: typeof RemoveAllResponse;
108
108
  readonly kind: MethodKind.Unary;
109
109
  };
110
+ /**
111
+ * Create or replace a relationship from a source entity to a target entity.
112
+ *
113
+ * @generated from rpc draw.v1.DrawService.CreateRelationship
114
+ */
115
+ readonly createRelationship: {
116
+ readonly name: "CreateRelationship";
117
+ readonly I: typeof CreateRelationshipRequest;
118
+ readonly O: typeof CreateRelationshipResponse;
119
+ readonly kind: MethodKind.Unary;
120
+ };
121
+ /**
122
+ * Delete a relationship from a source entity to a target entity.
123
+ *
124
+ * @generated from rpc draw.v1.DrawService.DeleteRelationship
125
+ */
126
+ readonly deleteRelationship: {
127
+ readonly name: "DeleteRelationship";
128
+ readonly I: typeof DeleteRelationshipRequest;
129
+ readonly O: typeof DeleteRelationshipResponse;
130
+ readonly kind: MethodKind.Unary;
131
+ };
132
+ /**
133
+ * Get a chunk of a chunked entity's data by element offset.
134
+ *
135
+ * @generated from rpc draw.v1.DrawService.GetEntityChunk
136
+ */
137
+ readonly getEntityChunk: {
138
+ readonly name: "GetEntityChunk";
139
+ readonly I: typeof GetEntityChunkRequest;
140
+ readonly O: typeof GetEntityChunkResponse;
141
+ readonly kind: MethodKind.Unary;
142
+ };
110
143
  };
111
144
  };
@@ -2,7 +2,7 @@
2
2
  // @generated from file draw/v1/service.proto (package draw.v1, syntax proto3)
3
3
  /* eslint-disable */
4
4
  // @ts-nocheck
5
- import { AddEntityRequest, AddEntityResponse, RemoveAllDrawingsRequest, RemoveAllDrawingsResponse, RemoveAllRequest, RemoveAllResponse, RemoveAllTransformsRequest, RemoveAllTransformsResponse, RemoveEntityRequest, RemoveEntityResponse, SetSceneRequest, SetSceneResponse, StreamEntityChangesRequest, StreamEntityChangesResponse, StreamSceneChangesRequest, StreamSceneChangesResponse, UpdateEntityRequest, UpdateEntityResponse } from "./service_pb";
5
+ import { AddEntityRequest, AddEntityResponse, CreateRelationshipRequest, CreateRelationshipResponse, DeleteRelationshipRequest, DeleteRelationshipResponse, GetEntityChunkRequest, GetEntityChunkResponse, RemoveAllDrawingsRequest, RemoveAllDrawingsResponse, RemoveAllRequest, RemoveAllResponse, RemoveAllTransformsRequest, RemoveAllTransformsResponse, RemoveEntityRequest, RemoveEntityResponse, SetSceneRequest, SetSceneResponse, StreamEntityChangesRequest, StreamEntityChangesResponse, StreamSceneChangesRequest, StreamSceneChangesResponse, UpdateEntityRequest, UpdateEntityResponse } from "./service_pb";
6
6
  import { MethodKind } from "@bufbuild/protobuf";
7
7
  /**
8
8
  * DrawService provides visualization APIs for managing transforms and custom drawing primitives
@@ -111,5 +111,38 @@ export const DrawService = {
111
111
  O: RemoveAllResponse,
112
112
  kind: MethodKind.Unary,
113
113
  },
114
+ /**
115
+ * Create or replace a relationship from a source entity to a target entity.
116
+ *
117
+ * @generated from rpc draw.v1.DrawService.CreateRelationship
118
+ */
119
+ createRelationship: {
120
+ name: "CreateRelationship",
121
+ I: CreateRelationshipRequest,
122
+ O: CreateRelationshipResponse,
123
+ kind: MethodKind.Unary,
124
+ },
125
+ /**
126
+ * Delete a relationship from a source entity to a target entity.
127
+ *
128
+ * @generated from rpc draw.v1.DrawService.DeleteRelationship
129
+ */
130
+ deleteRelationship: {
131
+ name: "DeleteRelationship",
132
+ I: DeleteRelationshipRequest,
133
+ O: DeleteRelationshipResponse,
134
+ kind: MethodKind.Unary,
135
+ },
136
+ /**
137
+ * Get a chunk of a chunked entity's data by element offset.
138
+ *
139
+ * @generated from rpc draw.v1.DrawService.GetEntityChunk
140
+ */
141
+ getEntityChunk: {
142
+ name: "GetEntityChunk",
143
+ I: GetEntityChunkRequest,
144
+ O: GetEntityChunkResponse,
145
+ kind: MethodKind.Unary,
146
+ },
114
147
  }
115
148
  };
@@ -3,6 +3,7 @@ import { FieldMask, Message, proto3 } from "@bufbuild/protobuf";
3
3
  import { Transform } from "../../common/v1/common_pb";
4
4
  import { Drawing } from "./drawing_pb";
5
5
  import { SceneMetadata } from "./scene_pb";
6
+ import { Relationship } from "./metadata_pb";
6
7
  /**
7
8
  * @generated from enum draw.v1.EntityChangeType
8
9
  */
@@ -365,3 +366,138 @@ export declare class RemoveAllResponse extends Message<RemoveAllResponse> {
365
366
  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): RemoveAllResponse;
366
367
  static equals(a: RemoveAllResponse | PlainMessage<RemoveAllResponse> | undefined, b: RemoveAllResponse | PlainMessage<RemoveAllResponse> | undefined): boolean;
367
368
  }
369
+ /**
370
+ * @generated from message draw.v1.CreateRelationshipRequest
371
+ */
372
+ export declare class CreateRelationshipRequest extends Message<CreateRelationshipRequest> {
373
+ /**
374
+ * @generated from field: bytes source_uuid = 1;
375
+ */
376
+ sourceUuid: Uint8Array<ArrayBuffer>;
377
+ /**
378
+ * @generated from field: draw.v1.Relationship relationship = 2;
379
+ */
380
+ relationship?: Relationship;
381
+ constructor(data?: PartialMessage<CreateRelationshipRequest>);
382
+ static readonly runtime: typeof proto3;
383
+ static readonly typeName = "draw.v1.CreateRelationshipRequest";
384
+ static readonly fields: FieldList;
385
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): CreateRelationshipRequest;
386
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): CreateRelationshipRequest;
387
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): CreateRelationshipRequest;
388
+ static equals(a: CreateRelationshipRequest | PlainMessage<CreateRelationshipRequest> | undefined, b: CreateRelationshipRequest | PlainMessage<CreateRelationshipRequest> | undefined): boolean;
389
+ }
390
+ /**
391
+ * @generated from message draw.v1.CreateRelationshipResponse
392
+ */
393
+ export declare class CreateRelationshipResponse extends Message<CreateRelationshipResponse> {
394
+ constructor(data?: PartialMessage<CreateRelationshipResponse>);
395
+ static readonly runtime: typeof proto3;
396
+ static readonly typeName = "draw.v1.CreateRelationshipResponse";
397
+ static readonly fields: FieldList;
398
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): CreateRelationshipResponse;
399
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): CreateRelationshipResponse;
400
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): CreateRelationshipResponse;
401
+ static equals(a: CreateRelationshipResponse | PlainMessage<CreateRelationshipResponse> | undefined, b: CreateRelationshipResponse | PlainMessage<CreateRelationshipResponse> | undefined): boolean;
402
+ }
403
+ /**
404
+ * @generated from message draw.v1.DeleteRelationshipRequest
405
+ */
406
+ export declare class DeleteRelationshipRequest extends Message<DeleteRelationshipRequest> {
407
+ /**
408
+ * @generated from field: bytes source_uuid = 1;
409
+ */
410
+ sourceUuid: Uint8Array<ArrayBuffer>;
411
+ /**
412
+ * @generated from field: bytes target_uuid = 2;
413
+ */
414
+ targetUuid: Uint8Array<ArrayBuffer>;
415
+ constructor(data?: PartialMessage<DeleteRelationshipRequest>);
416
+ static readonly runtime: typeof proto3;
417
+ static readonly typeName = "draw.v1.DeleteRelationshipRequest";
418
+ static readonly fields: FieldList;
419
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): DeleteRelationshipRequest;
420
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): DeleteRelationshipRequest;
421
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): DeleteRelationshipRequest;
422
+ static equals(a: DeleteRelationshipRequest | PlainMessage<DeleteRelationshipRequest> | undefined, b: DeleteRelationshipRequest | PlainMessage<DeleteRelationshipRequest> | undefined): boolean;
423
+ }
424
+ /**
425
+ * @generated from message draw.v1.DeleteRelationshipResponse
426
+ */
427
+ export declare class DeleteRelationshipResponse extends Message<DeleteRelationshipResponse> {
428
+ constructor(data?: PartialMessage<DeleteRelationshipResponse>);
429
+ static readonly runtime: typeof proto3;
430
+ static readonly typeName = "draw.v1.DeleteRelationshipResponse";
431
+ static readonly fields: FieldList;
432
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): DeleteRelationshipResponse;
433
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): DeleteRelationshipResponse;
434
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): DeleteRelationshipResponse;
435
+ static equals(a: DeleteRelationshipResponse | PlainMessage<DeleteRelationshipResponse> | undefined, b: DeleteRelationshipResponse | PlainMessage<DeleteRelationshipResponse> | undefined): boolean;
436
+ }
437
+ /**
438
+ * @generated from message draw.v1.GetEntityChunkRequest
439
+ */
440
+ export declare class GetEntityChunkRequest extends Message<GetEntityChunkRequest> {
441
+ /**
442
+ * @generated from field: bytes uuid = 1;
443
+ */
444
+ uuid: Uint8Array<ArrayBuffer>;
445
+ /**
446
+ * @generated from field: uint32 start = 2;
447
+ */
448
+ start: number;
449
+ constructor(data?: PartialMessage<GetEntityChunkRequest>);
450
+ static readonly runtime: typeof proto3;
451
+ static readonly typeName = "draw.v1.GetEntityChunkRequest";
452
+ static readonly fields: FieldList;
453
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): GetEntityChunkRequest;
454
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): GetEntityChunkRequest;
455
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): GetEntityChunkRequest;
456
+ static equals(a: GetEntityChunkRequest | PlainMessage<GetEntityChunkRequest> | undefined, b: GetEntityChunkRequest | PlainMessage<GetEntityChunkRequest> | undefined): boolean;
457
+ }
458
+ /**
459
+ * @generated from message draw.v1.GetEntityChunkResponse
460
+ */
461
+ export declare class GetEntityChunkResponse extends Message<GetEntityChunkResponse> {
462
+ /**
463
+ * The entity that is being chunked.
464
+ *
465
+ * @generated from oneof draw.v1.GetEntityChunkResponse.entity
466
+ */
467
+ entity: {
468
+ /**
469
+ * @generated from field: viam.common.v1.Transform transform = 1;
470
+ */
471
+ value: Transform;
472
+ case: "transform";
473
+ } | {
474
+ /**
475
+ * @generated from field: draw.v1.Drawing drawing = 2;
476
+ */
477
+ value: Drawing;
478
+ case: "drawing";
479
+ } | {
480
+ case: undefined;
481
+ value?: undefined;
482
+ };
483
+ /**
484
+ * The element offset this chunk starts at.
485
+ *
486
+ * @generated from field: uint32 start = 3;
487
+ */
488
+ start: number;
489
+ /**
490
+ * True when this is the last available chunk AND all data has been received from the producer.
491
+ *
492
+ * @generated from field: bool done = 4;
493
+ */
494
+ done: boolean;
495
+ constructor(data?: PartialMessage<GetEntityChunkResponse>);
496
+ static readonly runtime: typeof proto3;
497
+ static readonly typeName = "draw.v1.GetEntityChunkResponse";
498
+ static readonly fields: FieldList;
499
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): GetEntityChunkResponse;
500
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): GetEntityChunkResponse;
501
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): GetEntityChunkResponse;
502
+ static equals(a: GetEntityChunkResponse | PlainMessage<GetEntityChunkResponse> | undefined, b: GetEntityChunkResponse | PlainMessage<GetEntityChunkResponse> | undefined): boolean;
503
+ }
@@ -6,6 +6,7 @@ import { FieldMask, Message, proto3 } from "@bufbuild/protobuf";
6
6
  import { Transform } from "../../common/v1/common_pb";
7
7
  import { Drawing } from "./drawing_pb";
8
8
  import { SceneMetadata } from "./scene_pb";
9
+ import { Relationship } from "./metadata_pb";
9
10
  /**
10
11
  * @generated from enum draw.v1.EntityChangeType
11
12
  */
@@ -557,3 +558,203 @@ export class RemoveAllResponse extends Message {
557
558
  return proto3.util.equals(RemoveAllResponse, a, b);
558
559
  }
559
560
  }
561
+ /**
562
+ * @generated from message draw.v1.CreateRelationshipRequest
563
+ */
564
+ export class CreateRelationshipRequest extends Message {
565
+ /**
566
+ * @generated from field: bytes source_uuid = 1;
567
+ */
568
+ sourceUuid = new Uint8Array(0);
569
+ /**
570
+ * @generated from field: draw.v1.Relationship relationship = 2;
571
+ */
572
+ relationship;
573
+ constructor(data) {
574
+ super();
575
+ proto3.util.initPartial(data, this);
576
+ }
577
+ static runtime = proto3;
578
+ static typeName = "draw.v1.CreateRelationshipRequest";
579
+ static fields = proto3.util.newFieldList(() => [
580
+ { no: 1, name: "source_uuid", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
581
+ { no: 2, name: "relationship", kind: "message", T: Relationship },
582
+ ]);
583
+ static fromBinary(bytes, options) {
584
+ return new CreateRelationshipRequest().fromBinary(bytes, options);
585
+ }
586
+ static fromJson(jsonValue, options) {
587
+ return new CreateRelationshipRequest().fromJson(jsonValue, options);
588
+ }
589
+ static fromJsonString(jsonString, options) {
590
+ return new CreateRelationshipRequest().fromJsonString(jsonString, options);
591
+ }
592
+ static equals(a, b) {
593
+ return proto3.util.equals(CreateRelationshipRequest, a, b);
594
+ }
595
+ }
596
+ /**
597
+ * @generated from message draw.v1.CreateRelationshipResponse
598
+ */
599
+ export class CreateRelationshipResponse extends Message {
600
+ constructor(data) {
601
+ super();
602
+ proto3.util.initPartial(data, this);
603
+ }
604
+ static runtime = proto3;
605
+ static typeName = "draw.v1.CreateRelationshipResponse";
606
+ static fields = proto3.util.newFieldList(() => []);
607
+ static fromBinary(bytes, options) {
608
+ return new CreateRelationshipResponse().fromBinary(bytes, options);
609
+ }
610
+ static fromJson(jsonValue, options) {
611
+ return new CreateRelationshipResponse().fromJson(jsonValue, options);
612
+ }
613
+ static fromJsonString(jsonString, options) {
614
+ return new CreateRelationshipResponse().fromJsonString(jsonString, options);
615
+ }
616
+ static equals(a, b) {
617
+ return proto3.util.equals(CreateRelationshipResponse, a, b);
618
+ }
619
+ }
620
+ /**
621
+ * @generated from message draw.v1.DeleteRelationshipRequest
622
+ */
623
+ export class DeleteRelationshipRequest extends Message {
624
+ /**
625
+ * @generated from field: bytes source_uuid = 1;
626
+ */
627
+ sourceUuid = new Uint8Array(0);
628
+ /**
629
+ * @generated from field: bytes target_uuid = 2;
630
+ */
631
+ targetUuid = new Uint8Array(0);
632
+ constructor(data) {
633
+ super();
634
+ proto3.util.initPartial(data, this);
635
+ }
636
+ static runtime = proto3;
637
+ static typeName = "draw.v1.DeleteRelationshipRequest";
638
+ static fields = proto3.util.newFieldList(() => [
639
+ { no: 1, name: "source_uuid", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
640
+ { no: 2, name: "target_uuid", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
641
+ ]);
642
+ static fromBinary(bytes, options) {
643
+ return new DeleteRelationshipRequest().fromBinary(bytes, options);
644
+ }
645
+ static fromJson(jsonValue, options) {
646
+ return new DeleteRelationshipRequest().fromJson(jsonValue, options);
647
+ }
648
+ static fromJsonString(jsonString, options) {
649
+ return new DeleteRelationshipRequest().fromJsonString(jsonString, options);
650
+ }
651
+ static equals(a, b) {
652
+ return proto3.util.equals(DeleteRelationshipRequest, a, b);
653
+ }
654
+ }
655
+ /**
656
+ * @generated from message draw.v1.DeleteRelationshipResponse
657
+ */
658
+ export class DeleteRelationshipResponse extends Message {
659
+ constructor(data) {
660
+ super();
661
+ proto3.util.initPartial(data, this);
662
+ }
663
+ static runtime = proto3;
664
+ static typeName = "draw.v1.DeleteRelationshipResponse";
665
+ static fields = proto3.util.newFieldList(() => []);
666
+ static fromBinary(bytes, options) {
667
+ return new DeleteRelationshipResponse().fromBinary(bytes, options);
668
+ }
669
+ static fromJson(jsonValue, options) {
670
+ return new DeleteRelationshipResponse().fromJson(jsonValue, options);
671
+ }
672
+ static fromJsonString(jsonString, options) {
673
+ return new DeleteRelationshipResponse().fromJsonString(jsonString, options);
674
+ }
675
+ static equals(a, b) {
676
+ return proto3.util.equals(DeleteRelationshipResponse, a, b);
677
+ }
678
+ }
679
+ /**
680
+ * @generated from message draw.v1.GetEntityChunkRequest
681
+ */
682
+ export class GetEntityChunkRequest extends Message {
683
+ /**
684
+ * @generated from field: bytes uuid = 1;
685
+ */
686
+ uuid = new Uint8Array(0);
687
+ /**
688
+ * @generated from field: uint32 start = 2;
689
+ */
690
+ start = 0;
691
+ constructor(data) {
692
+ super();
693
+ proto3.util.initPartial(data, this);
694
+ }
695
+ static runtime = proto3;
696
+ static typeName = "draw.v1.GetEntityChunkRequest";
697
+ static fields = proto3.util.newFieldList(() => [
698
+ { no: 1, name: "uuid", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
699
+ { no: 2, name: "start", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
700
+ ]);
701
+ static fromBinary(bytes, options) {
702
+ return new GetEntityChunkRequest().fromBinary(bytes, options);
703
+ }
704
+ static fromJson(jsonValue, options) {
705
+ return new GetEntityChunkRequest().fromJson(jsonValue, options);
706
+ }
707
+ static fromJsonString(jsonString, options) {
708
+ return new GetEntityChunkRequest().fromJsonString(jsonString, options);
709
+ }
710
+ static equals(a, b) {
711
+ return proto3.util.equals(GetEntityChunkRequest, a, b);
712
+ }
713
+ }
714
+ /**
715
+ * @generated from message draw.v1.GetEntityChunkResponse
716
+ */
717
+ export class GetEntityChunkResponse extends Message {
718
+ /**
719
+ * The entity that is being chunked.
720
+ *
721
+ * @generated from oneof draw.v1.GetEntityChunkResponse.entity
722
+ */
723
+ entity = { case: undefined };
724
+ /**
725
+ * The element offset this chunk starts at.
726
+ *
727
+ * @generated from field: uint32 start = 3;
728
+ */
729
+ start = 0;
730
+ /**
731
+ * True when this is the last available chunk AND all data has been received from the producer.
732
+ *
733
+ * @generated from field: bool done = 4;
734
+ */
735
+ done = false;
736
+ constructor(data) {
737
+ super();
738
+ proto3.util.initPartial(data, this);
739
+ }
740
+ static runtime = proto3;
741
+ static typeName = "draw.v1.GetEntityChunkResponse";
742
+ static fields = proto3.util.newFieldList(() => [
743
+ { no: 1, name: "transform", kind: "message", T: Transform, oneof: "entity" },
744
+ { no: 2, name: "drawing", kind: "message", T: Drawing, oneof: "entity" },
745
+ { no: 3, name: "start", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
746
+ { no: 4, name: "done", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
747
+ ]);
748
+ static fromBinary(bytes, options) {
749
+ return new GetEntityChunkResponse().fromBinary(bytes, options);
750
+ }
751
+ static fromJson(jsonValue, options) {
752
+ return new GetEntityChunkResponse().fromJson(jsonValue, options);
753
+ }
754
+ static fromJsonString(jsonString, options) {
755
+ return new GetEntityChunkResponse().fromJsonString(jsonString, options);
756
+ }
757
+ static equals(a, b) {
758
+ return proto3.util.equals(GetEntityChunkResponse, a, b);
759
+ }
760
+ }
@@ -41,6 +41,7 @@
41
41
  }
42
42
 
43
43
  const onRemove = (entity: Entity) => {
44
+ map.get(entity)?.dispose()
44
45
  map.delete(entity)
45
46
  }
46
47
 
@@ -43,12 +43,12 @@
43
43
  name={entity}
44
44
  {...events}
45
45
  raycast={raycastFunction}
46
+ visible={invisible.current !== true}
46
47
  >
47
48
  <T
48
49
  is={arrows.headMesh}
49
50
  bvh={{ enabled: false }}
50
51
  raycast={() => null}
51
- visible={invisible.current !== true}
52
52
  />
53
53
  <T
54
54
  is={arrows.shaftMesh}
@@ -33,6 +33,8 @@
33
33
  const opacity = useTrait(() => entity, traits.Opacity)
34
34
  const invisible = useTrait(() => entity, traits.Invisible)
35
35
  const showAxesHelper = useTrait(() => entity, traits.ShowAxesHelper)
36
+ const renderOrder = useTrait(() => entity, traits.RenderOrder)
37
+ const materialProps = useTrait(() => entity, traits.Material)
36
38
 
37
39
  const pointSize = $derived(
38
40
  entityPointSize.current ? entityPointSize.current * 0.001 : settings.current.pointSize
@@ -61,41 +63,38 @@
61
63
  })
62
64
 
63
65
  /**
64
- * Points transparancy is very costly for the GPU, so we turn it on conservatively
66
+ * Points transparency is very costly for the GPU, so we turn it on conservatively.
67
+ * Uniform opacity (entity trait) and per-vertex RGBA alpha are both considered here
68
+ * to avoid the two sources conflicting with each other.
65
69
  */
66
70
  $effect.pre(() => {
67
- if (opacity.current !== undefined && opacity.current < 1) {
68
- material.transparent = true
69
- material.opacity = opacity.current
70
-
71
- return () => {
72
- material.transparent = false
73
- material.opacity = 1
74
- }
75
- }
76
- })
77
-
78
- $effect.pre(() => {
79
- const colors = geometry.current?.getAttribute('color')
71
+ const vertexColors = geometry.current?.getAttribute('color')
80
72
  const positions = geometry.current?.getAttribute('position')
81
73
 
82
- material.vertexColors = colors !== undefined
74
+ material.vertexColors = vertexColors !== undefined
83
75
 
84
- if (colors && positions) {
85
- const hasAlphaChannel = positions.array.length / colors.array.length === 0.75
76
+ const hasUniformOpacity = opacity.current !== undefined && opacity.current < 1
77
+ material.opacity = hasUniformOpacity ? opacity.current! : 1
86
78
 
87
- let transparent = false
79
+ let hasVertexAlpha = false
80
+ if (vertexColors && positions) {
81
+ const hasAlphaChannel = positions.array.length / vertexColors.array.length === 0.75
88
82
  if (hasAlphaChannel) {
89
- for (let i = 3, l = colors.array.length; i < l; i += 4) {
90
- if (colors.array[i] < 1) {
91
- transparent = true
83
+ for (let i = 3, l = vertexColors.array.length; i < l; i += 4) {
84
+ if (vertexColors.array[i] < 1) {
85
+ hasVertexAlpha = true
92
86
  break
93
87
  }
94
88
  }
95
89
  }
96
-
97
- material.transparent = transparent
98
90
  }
91
+
92
+ material.transparent = hasUniformOpacity || hasVertexAlpha
93
+ })
94
+
95
+ $effect.pre(() => {
96
+ material.depthTest = materialProps.current?.depthTest ?? true
97
+ material.depthWrite = materialProps.current?.depthWrite ?? true
99
98
  })
100
99
 
101
100
  $effect.pre(() => {
@@ -132,6 +131,7 @@
132
131
  name={entity}
133
132
  bvh={{ maxDepth: 40, maxLeafSize: 20 }}
134
133
  visible={invisible.current !== true}
134
+ renderOrder={renderOrder.current}
135
135
  {...events}
136
136
  >
137
137
  <T is={geometry.current} />