feat: always store volume rendering depth samples in JSON state if volume rendering is enabled#854
Conversation
|
I'd be inclined to bump the default for new layers but not modify existing states. |
|
Thanks @jbms, I changed the scope of this PR to instead focus on always storing the number of depth samples from volume rendering in the JSON state if volume rendering is enabled. So now the JSON state should contain the number of volume rendering samples if it was either changed from the default, or never changed from the default, but volume rendering is active. This should allow us to make future changes to the volume rendering number of samples more readily without affecting existing states that have volume rendering in use |
|
On preserving state behavior, should we consider removing TrackableValue's return of undefined when the value is the same as the default? State size is one concern. If trackablevalue.tojson had a return this.volumeRenderingDepthSamplesTarget.toJSON(
isVolumeRenderingActive,
); |
That's a great idea for the Though a lot of classes just implement being a |
|
Good point, would require a lot of changes, for example neuroglancer/src/display_context.ts Line 400 in 64c47bd Would need to add a !force check where it returns undefined |
Always store the number of depth samples from volume rendering in the JSON state if volume rendering is enabled. Now the JSON state should contain the number of volume rendering samples if it was either changed from the default, or never changed from the default, but volume rendering is active.
This should allow us to make future changes to the volume rendering number of samples more readily without affecting existing states that have volume rendering in use.