Skip to content

Refactor TreeMap to DiffableMap #8626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 99 commits into from
May 26, 2025
Merged
Show file tree
Hide file tree
Changes from 82 commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
f7c5de3
allow to toggle visibility of each segment via custom segment colors
philippotto Apr 16, 2025
8b0dda2
Merge remote-tracking branch 'origin/master' into segment-checkboxes
philippotto Apr 17, 2025
0907106
allow to toggle segments and groups
philippotto Apr 22, 2025
a3f42df
linting
philippotto Apr 22, 2025
17d7e75
backend: add UpdateSegmentVisibilityVolumeAction, UpdateSegmentGroupV…
fm3 Apr 22, 2025
41dff63
Merge branch 'master' of github.com:scalableminds/webknossos into seg…
philippotto Apr 23, 2025
5b788a9
integrate updateSegmentVisibility update action
philippotto Apr 23, 2025
7fd0fe3
implement toggle compaction and integrate updateSegmentGroupVisibilit…
philippotto Apr 24, 2025
cfed403
warn user when too many custom segment colors exist; don't show check…
philippotto Apr 24, 2025
c5c7057
move titleRender to own method
philippotto Apr 24, 2025
38e94e1
implement hideUnregisteredSegments and only-show-this-segment etc in …
philippotto Apr 24, 2025
ff5eeba
fix saving of hideUnregisteredSegments
philippotto Apr 24, 2025
887d983
fix typing
philippotto Apr 24, 2025
f96979a
Merge branch 'master' of github.com:scalableminds/webknossos into seg…
philippotto Apr 29, 2025
1ab070b
remove unlisted segments group prototype again
philippotto Apr 29, 2025
8947bd8
expose hide unlisted segments in left sidebar and add show-all-segmen…
philippotto Apr 29, 2025
ef8db6d
remove -2 handling for unlisted group stuff
philippotto Apr 29, 2025
41ae2f8
fix visibility when removing segment from list; refactor toggling
philippotto Apr 29, 2025
2c814ac
hide checkboxes when proofreading and selectiveVisibilityInProofreadi…
philippotto Apr 29, 2025
bcf42d2
write and parse tree and segment isVisible in NMLs
fm3 Apr 29, 2025
aa22e0a
fix support for view only
philippotto Apr 29, 2025
f17e101
add missing volumetracing_action_helpers.ts module
philippotto Apr 29, 2025
f0f7c40
fix warning because of non-string value in radio button component for…
philippotto Apr 29, 2025
91f1ec5
use fast tooltip to avoid findDOMNode warning
philippotto Apr 29, 2025
8d3b12f
fmt backend
philippotto Apr 29, 2025
221489c
fix warning when opening context menu by restructuring hooks
philippotto Apr 30, 2025
963f55e
refactor context info in context menu
philippotto Apr 30, 2025
e6f75e2
lint
philippotto Apr 30, 2025
e600a26
add some position when a segment is registered by toggling its visibi…
philippotto Apr 30, 2025
f70d32e
update screenshots (the selective rendering is done via hovering where
philippotto May 2, 2025
ff63e2c
Merge branch 'master' of github.com:scalableminds/webknossos into seg…
philippotto May 2, 2025
28ee637
implement benchmark for segment list scrolling; improve perf a little…
philippotto May 2, 2025
47006a6
Merge branch 'master' of github.com:scalableminds/webknossos into seg…
philippotto May 7, 2025
a0ed2c5
clean up unnecessary isChecked property
philippotto May 7, 2025
59be1b2
use extracted vars
philippotto May 8, 2025
64a7cc8
add comments
philippotto May 8, 2025
ca9d106
linting
philippotto May 8, 2025
ed407f8
integrate some code rabbit feedback
philippotto May 8, 2025
2f9ee91
Merge branch 'master' of github.com:scalableminds/webknossos into seg…
philippotto May 9, 2025
3387f1e
format
philippotto May 9, 2025
933c37f
added docstrings to DiffableMap
hotzenklotz May 12, 2025
28f65d1
extended unit tests for diffable map
hotzenklotz May 12, 2025
d989686
Merge branch 'master' of github.com:scalableminds/webknossos into seg…
hotzenklotz May 13, 2025
bb5d7c6
add missing type to merge
hotzenklotz May 13, 2025
17cdb00
Merge branch 'segment-checkboxes' into treemap_to_diffablemap
hotzenklotz May 13, 2025
3321fa3
WIP refactor treemap as diffablemap
hotzenklotz May 13, 2025
1704be9
delete commented code
philippotto May 14, 2025
ea1ca80
merge defaultDatasetViewConfiguration with defaultDatasetViewConfigur…
philippotto May 15, 2025
5021bef
incorporate feedback
philippotto May 15, 2025
e924833
WIP refactor Treemaps as diffablemaps
hotzenklotz May 15, 2025
d347b9d
WIP more refactoring
hotzenklotz May 15, 2025
6e06b7b
WIP more refactoring
hotzenklotz May 15, 2025
0033452
WIP even more refactoring
hotzenklotz May 15, 2025
af9da31
fixed more stuff
hotzenklotz May 16, 2025
8d16784
update changelog
philippotto May 19, 2025
66af964
merge segment-checkboxes --> treemap_to_diffablemap
hotzenklotz May 19, 2025
828164f
fix more tests
hotzenklotz May 19, 2025
9dc8406
fix more tests
hotzenklotz May 19, 2025
052d0bd
fix more tests and types
hotzenklotz May 19, 2025
7615d03
fix remaining tests
hotzenklotz May 19, 2025
e6139c5
Merge remote-tracking branch 'origin' into treemap_to_diffablemap
hotzenklotz May 19, 2025
e5aa4b1
unify proto property setting using withIsVisible
fm3 May 20, 2025
bb316c5
fix array buffer related TS problems
philippotto May 20, 2025
9ee61e6
Merge branch 'segment-checkboxes' into treemap_to_diffablemap
hotzenklotz May 20, 2025
ab59615
fix remaining type errors
hotzenklotz May 20, 2025
764dd9d
formatting
hotzenklotz May 20, 2025
26091b5
add Toast.info to global mocks
hotzenklotz May 20, 2025
4113fc2
fix incorrect copy of TypedArray (buffer offsets may differ; slice is…
philippotto May 20, 2025
da4dced
Merge branch 'treemap_to_diffablemap' of github.com:scalableminds/web…
philippotto May 20, 2025
2cd4c91
Merge branch 'master' of github.com:scalableminds/webknossos into tre…
hotzenklotz May 20, 2025
6ba5806
Merge branch 'treemap_to_diffablemap' of github.com:scalableminds/web…
hotzenklotz May 20, 2025
f4f19a3
changelog
hotzenklotz May 20, 2025
66eed68
fix tree visibility toggle
hotzenklotz May 21, 2025
d7fa6be
fix tree group toggling
hotzenklotz May 21, 2025
6a7e3b8
Update frontend/javascripts/viewer/view/right-border-tabs/connectome_…
hotzenklotz May 22, 2025
c36b627
Update frontend/javascripts/libs/diffable_map.ts
hotzenklotz May 22, 2025
cd7001d
Update frontend/javascripts/viewer/view/right-border-tabs/connectome_…
hotzenklotz May 22, 2025
5cd2d55
Update frontend/javascripts/viewer/model/reducers/skeletontracing_red…
hotzenklotz May 22, 2025
d1bd11b
Update frontend/javascripts/libs/diffable_map.ts
hotzenklotz May 22, 2025
74b00b7
update can-i-use / browser capabilites list
hotzenklotz May 22, 2025
f0af714
add PR feedback
hotzenklotz May 22, 2025
648c153
move tree type definitions into separate file to avoid cyclic dependency
hotzenklotz May 22, 2025
af12381
misc fixes
philippotto May 22, 2025
fc83ae3
clean unused code
hotzenklotz May 22, 2025
a010b9a
Merge branch 'master' into treemap_to_diffablemap
hotzenklotz May 22, 2025
d61e4ac
add warnings to the mutable methods of diffable map
philippotto May 22, 2025
4b858c6
Merge branch 'treemap_to_diffablemap' of github.com:scalableminds/web…
philippotto May 22, 2025
750a393
fix Object.values(props.trees) in three places, which TS did not comp…
philippotto May 22, 2025
f7d72bb
more fixes
philippotto May 22, 2025
2eaa11a
forbid usage of Object.keys/values/entries on DiffableMap and EdgeCol…
philippotto May 23, 2025
e5719e8
use toArray
philippotto May 23, 2025
31cfa4d
use toArray instead of Array.from
philippotto May 23, 2025
34dfda2
convert more foreach to for loops
philippotto May 23, 2025
ef2d600
two more foreach -> for loop
philippotto May 23, 2025
820cc9b
use clone and mutableSet instead of repeated immutable sets
philippotto May 23, 2025
8f2cd4b
refactor chain reducer a bit
philippotto May 23, 2025
b6b8650
add reducer tests for toggling of trees and fix them
philippotto May 23, 2025
7f9d740
simplify chain reduce in tests
philippotto May 23, 2025
47e1ea2
avoid ts-expect error
philippotto May 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- Updated to Typescript from version `5.5` to `5.8`. [#8613](https://github.com/scalableminds/webknossos/pull/8613)
- Updated Voxelytics log streaming to also include the `log_path` attribute. [#8615](https://github.com/scalableminds/webknossos/pull/8615)
- When creating or uploading a non-task volume annotation layer with a fallback segmentation layer, the annotation layer’s bounding box will now be limited to that layer’s, instead of the whole dataset’s. [#7580](https://github.com/scalableminds/webknossos/pull/7580)
- Refactored the `skeletonTracing.TreeMap` structure to use `DiffableMap` type. [#8626](https://github.com/scalableminds/webknossos/pull/8626)

### Fixed
- When selecting a skeleton node in a viewport, its tree is focused and scrolled to in the skeleton tab, even if its parent group was collapsed before. [#8585](https://github.com/scalableminds/webknossos/pull/8585)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import ErrorHandling from "libs/error_handling";
import { readFileAsText } from "libs/read_file";
import Toast from "libs/toast";
import { SoftError } from "libs/utils";
import * as Utils from "libs/utils";
import _ from "lodash";
import type { Vector3 } from "viewer/constants";
import { parseNml } from "viewer/model/helpers/nml_helpers";
Expand Down Expand Up @@ -180,8 +179,14 @@ async function parseNmlFiles(fileList: FileList): Promise<Partial<WizardContext>
}

for (const [tree1, tree2] of _.zip(
Utils.values(trees1).sort((a, b) => a.treeId - b.treeId),
Utils.values(trees2).sort((a, b) => a.treeId - b.treeId),
trees1
.values()
.toArray()
.sort((a, b) => a.treeId - b.treeId),
trees2
.values()
.toArray()
.sort((a, b) => a.treeId - b.treeId),
)) {
if (tree1 == null || tree2 == null) {
// Satisfy TS. This should not happen, as we checked before that both tree collections
Expand Down
1 change: 1 addition & 0 deletions frontend/javascripts/libs/browser_feature_check.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default function checkBrowserFeatures() {
Object.fromEntries([]);
new BigUint64Array(1);
"hello".replaceAll("l", "k");
new Map([[1, 2]]).values().map((v) => v);
[].at(0);
} catch (exception) {
Toast.warning(
Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/libs/cuckoo/abstract_cuckoo_table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let cachedNullTexture: UpdatableTexture | undefined;
export abstract class AbstractCuckooTable<K, V, Entry extends [K, V]> {
entryCapacity: number;
entryCount: number = 0;
protected table!: Uint32Array;
protected table!: Uint32Array<ArrayBuffer>;
protected seeds!: number[];
protected seedSubscribers: Array<SeedSubscriberFn> = [];
_texture: UpdatableTexture;
Expand Down
Loading
Loading