NRC-Research / SNAP-issues

This repository was created to provide a public location to record and display the status of "issues" for the SNAP application. The SNAP developers will acknowledge, provide (and maybe request) feedback on the reported issues, and in general use the information to improve SNAP code.
3 stars 0 forks source link

Suggestion for Programmatic Layer Control in Animation Model #85

Open NRCgg opened 1 month ago

NRCgg commented 1 month ago

Discussed in https://github.com/NRC-Research/SNAP-issues/discussions/84

Originally posted by **rradnev1** May 20, 2024 Dear SNAP development team, I'd like to suggest adding programmatic layer control to the animation model. This would allow users to change the layer of drawn elements using Python scripting or a similar mechanism. This enhancement would enable more dynamic and interactive visualizations, such as animations where components automatically appear or disappear based on certain conditions. Sincerely, Radko

@rradnev1

NRCgg commented 1 month ago

@rradnev1 Posted this as a discussion but I think it relates directly to Issue #82

WDunsford commented 1 month ago

This is a SNAP core animation enhancement. I propose instead of the suggested enhancement, add an additional data channel to the display beans, with a "hidden" range of values, and a "shown" range of values. Then, when the view is locked, the display bean would use the value of that channel to determine whether or not to paint. This avoids having to either somehow reference a display bean in the python data source script, or spin up a python instance for every display bean in the view.

NRCgg commented 1 month ago

HAHA, @WDunsford comment is good but in plain/common language that us users can understand! Here is my attempt at a Plain English version of your comment -please let me know if I have something wrong!

The improvement requires changing the SNAP core code; this is not merely an "Animation plugin" change.

The display elements/objects in the animation model are actually implementations of "JavaBeans", or "Display beans", or just "beans" in this context. SNAP display elements (beans) have a property called "Channels" that is used organize data used to communicate information to/from the display elements. The developer is proposing that instead of the "layer" approach mentioned in the original suggestion, that a data property "channel" be added that can be used to control whether the display element is visible or not. This "view/hide" data channel property could be used programmatically to control the display elements visibility.

WDunsford commented 1 month ago

@NRCgg Basically. We're talking in-house about also supporting hiding or showing whole layers, to simplify the process when you have a lot to update. We've had a request for "scenarios" which allow for remembering values (#66) that could also be taken into account.