diff options
| author | IEatChili <nanunguyen99@gmail.com> | 2024-06-27 13:55:55 -0400 |
|---|---|---|
| committer | IEatChili <nanunguyen99@gmail.com> | 2024-06-27 13:55:55 -0400 |
| commit | 7e13e1df797f1d3358f553802527bf42c5574e81 (patch) | |
| tree | 3380a64a114295da09ff828b8574dba3f673ab52 /src/client/views/collections/collectionFreeForm | |
| parent | 3190f1eb07a47a5e1ccdd20e346b47094118292d (diff) | |
feat: added grid of collections when sorting
Diffstat (limited to 'src/client/views/collections/collectionFreeForm')
| -rw-r--r-- | src/client/views/collections/collectionFreeForm/MarqueeView.tsx | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx index 197681f62..07e3acb1d 100644 --- a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx +++ b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx @@ -461,17 +461,32 @@ export class MarqueeView extends ObservableReactComponent<SubCollectionViewProps // Create new collections associated with each label and get the embeddings for the labels. let x_offset = 0; + let y_offset = 0; + let row_count = 0; for (const label of labelGroups) { const newCollection = this.getCollection([], undefined, false); + newCollection._width = 900; + newCollection._height = 900; + newCollection._x = this.Bounds.left; + newCollection._y = this.Bounds.top; newCollection._freeform_panX = this.Bounds.left + this.Bounds.width / 2; newCollection._freeform_panY = this.Bounds.top + this.Bounds.height / 2; - console.log(newCollection._x); + newCollection._x = (newCollection._x as number) + x_offset; + newCollection._y = (newCollection._y as number) + y_offset; + x_offset += (newCollection._width as number) + 40; + row_count += 1; + if (row_count == 3) { + y_offset += (newCollection._height as number) + 40; + x_offset = 0; + row_count = 0; + } labelToCollection.set(label, newCollection); this._props.addDocument?.(newCollection); - //newCollection._x = (newCollection._x as number) + x_offset; - //x_offset += newCollection._width as number; + console.log('added collection!'); } + console.log(labelToCollection); + for (const doc of selectedImages) { if (doc[DocData].data_label) { Doc.AddDocToList(labelToCollection.get(doc[DocData].data_label as string)!, undefined, doc); |
