Toggling Label Visibility in Complex Molecular Scenes

When working on large molecular systems or building presentations with SAMSON, clarity is critical. You might not always want every label to be visible—especially when they start cluttering your scene. Fortunately, the label attribute space in the Node Specification Language (NSL) makes it simple to filter and control label visibility in a way that works for your specific modeling needs.

This blog post walks you through how to find and manipulate visibility-related attributes of labels—such as hiding or showing them selectively—using the Label attribute space (la), which exclusively targets label nodes.

Understanding Label Attributes

The label attribute space inherits many useful properties from the general node attribute space (like hidden, name, and visible). For the label-specific context, you just prefix them using la. For example, la.v filters all visible label nodes.

Main Visibility Attributes

  • la.v: Targets labels that are currently visible. Combine with not to select hidden labels: not la.v.
  • la.vf: Stands for visibility flag. This is useful if you want to manage labels that have been manually set as visible/invisible regardless of their parent nodes.
  • la.h: Refers to whether the label nodes are hidden. Again, not la.h lets you focus on those that are shown.

Why Care About Visibility Flags?

In large systems, labels can overwhelm the visual space. Showing only selected ones can make your presentations or analyses more informative and less crowded.

For instance, if you’ve created several labels to highlight binding pockets but only want to show those that contain the letter “L” in their name, you could use:

This will target all label nodes whose name begins with “L” and are visible.

Examples

Here are a few common use-cases for controlling label visibility:

  • la.vf false: All labels whose visibility flag is off, meaning they were likely hidden manually or by script.
  • not la.h and not la.sf: Labels that aren’t hidden and aren’t selected — sometimes helpful for batch scripts that act only on a certain group.

Whether you’re scripting selection filters or trying to clean up your view for screenshots or simulations, mastering these visibility flags can save a lot of time.

Recap

The label attribute space in SAMSON’s NSL provides a flexible strategy for managing visibility in complex molecular scenes. It offers fine control over what appears in your workspace and helps you keep things clear and intentional.

To explore all available label attributes in SAMSON, visit the official documentation page: https://documentation.samson-connect.net/users/latest/nsl/label/

SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.

Comments are closed.