[addon] Permanent colors

So I think it was the latest update but my permanent color no longer “sticks” after the segment is updated. Essentially I have the color set when I pull a new cell, but as soon as it edits it reverts to a random color.

Here’s the console error:

userscript.html?name…1b-aa2d46307a34:198 Uncaught (in promise) ReferenceError: color is not defined
    at getRootIdCallback (userscript.html?name…aa2d46307a34:198:23)
    at userscript.html?name…aa2d46307a34:212:46
    at Dock.js:530:13
getRootIdCallback	@	userscript.html?name…1b-aa2d46307a34:198
(anonymous)	@	userscript.html?name…1b-aa2d46307a34:212
(anonymous)	@	Dock.js:530
Promise.then (async)		
getRootId	@	Dock.js:528
(anonymous)	@	userscript.html?name…1b-aa2d46307a34:212
(anonymous)	@	Dock.js:35
Promise.then (async)		
globalThis.fetch	@	Dock.js:34
authFetchOk	@	base.ts:64
authFetchWithSharedValue	@	base.ts:143
authFetch	@	frontend.ts:162
mergeSegments	@	frontend.ts:135
(anonymous)	@	segmentation_user_la…r_with_graph.ts:421
safeToSubmit	@	segmentation_user_la…r_with_graph.ts:387
mergeSelectSecond	@	segmentation_user_la…r_with_graph.ts:420
handleAction	@	segmentation_user_la…r_with_graph.ts:303
invokeAction	@	layer.ts:551
onMousedown	@	rendered_data_panel.ts:654
1 Like

Sorry about that regression. I was doing some clean up and moved part of a function into a separate function, but didn’t give that new function all parameters it needed (namely “color”).
It should be fixed in v. 0.1.4.2.

3 Likes

v. 0.1.5

2 bug fixes here:

  1. There was a problem, that an array containing segment ids and colors associated with them was constantly growing with each “permanented” color. In my case it had over 2000 entries. It wasn’t a problem for now, but sooner or later it would be. Now the array is cleared with each new claimed cell.

  2. The addon worked only for layers (tabs) with specific names, which had to be added case-by-case. Now it should be more universal and work with all layers of type “segmentation_with_graph”.

1 Like

v. 0.1.6.1

Another attempt at fixing segments IDs and colors associated with them. This time it should work (hopefully). It also performs a one time clean-up of the whole history of states saved in localStorage (only the segment IDs part), so it should free up some localStorage space.
It hit the limit in my browser, but it probably will hit the limit sooner or later to all the players (with our without any of my scripts) and then the Neuroglancer will try to free some space up and hit the limit again, etc. The clean up should buy us some time (not that it’s important, just saying, how it works internally).

1 Like

v 0.1.7
Fixed an error causing that segmentIDs and colors associated with them weren’t removed from current state after claiming a new cell, when user hadn’t have the graph layer active.

v 0.1.8

This version has some simplified code. That simplification should also lead to fixing problems with color labels not matching actual color (in the right panel) and fixing the problem, that sometimes the tracked segment was changing its color (especially, when there were some splitting or merging done on segments other than the tracked one).

2 Likes