Making Labels Work for You: Controlling Visibility in Molecular Models

When working on complex molecular systems, labels can quickly turn from helpful markers into overwhelming visual noise. This is especially true when large biomolecular assemblies or intricate materials simulations are involved. If you’ve ever found yourself zooming in and out or scrolling endlessly to figure out which label belongs to what—this post is for you.

Thankfully, in SAMSON’s Node Specification Language (NSL), label nodes come with a set of visibility-related attributes that give you precise control over what’s shown and when. This lets you focus on analyzing your systems rather than navigating clutter.

Label Node Visibility: What You Can Control

The label attribute space (short name: la) lets you filter and interact with only label nodes. Using this space, you can adjust several attributes inherited from the general node attribute space. Here’s a closer look at those directly related to label visibility:

  • visible (v): Whether the label is currently visible in the view.
  • visibilityFlag (vf): Tracks whether visibility has been programmatically toggled.
  • hidden (h): Specifies whether the label is hidden from the scene.

These three attributes work together to help you selectively hide, show, or toggle label nodes in NSL queries. Here’s how to use them effectively:

Practical Examples

Let’s say you’re preparing a publication image and want to hide all labels that clutter the view. You can write:

This selects all label nodes that are not visible. You can then update them, move them, or apply further actions programmatically.

If you’re refining your scene and want to display only specifically tagged label nodes you named earlier:

This line identifies all labels starting with Voltage that are currently hidden, allowing you to selectively make them visible again.

Understanding the Differences

  • hidden operates like a direct instruction to hide the node, often used by users or Extensions.
  • visible reflects whether or not the node is currently rendered, which can depend on other flags or context.
  • visibilityFlag relates to more advanced visibility logic, like inheritance or rendering rules in substructures.

By combining these attributes logically, you can adapt the workspace to what matters most at any given time—highlighting labels useful for debugging interaction maps, or hiding labels in high-detail rendering scenes, for example.

These tools are especially helpful for larger projects shared across teams, where clarity and custom views improve communication and reproducibility.

To learn more about label attributes in SAMSON’s NSL, including selection flags and naming conventions, visit the full documentation: https://documentation.samson-connect.net/users/latest/nsl/label/.

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

Comments are closed.