From 3b7c8963df62496dbd72077b23bd3fefc2b8ad36 Mon Sep 17 00:00:00 2001
From: David Sehnal <david.sehnal@gmail.com>
Date: Tue, 21 Jan 2020 12:51:34 +0100
Subject: [PATCH] mol-theme: include <1 occupancy in default label

---
 src/mol-theme/label.ts | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/mol-theme/label.ts b/src/mol-theme/label.ts
index 3749522e3..63d4afdf7 100644
--- a/src/mol-theme/label.ts
+++ b/src/mol-theme/label.ts
@@ -177,11 +177,13 @@ function _atomicElementLabel(location: StructureElement.Location<Unit.Atomic>, g
     const comp_id = Props.residue.label_comp_id(location)
     const atom_id = Props.atom.label_atom_id(location)
     const alt_id = Props.atom.label_alt_id(location)
+    const occupancy = Props.atom.occupancy(location);
 
     const microHetCompIds = Props.residue.microheterogeneityCompIds(location)
     const compId = granularity === 'residue' && microHetCompIds.length > 1 ?
         `(${microHetCompIds.join('|')})` : comp_id
 
+    
     const label: string[] = []
 
     switch (granularity) {
@@ -205,6 +207,10 @@ function _atomicElementLabel(location: StructureElement.Location<Unit.Atomic>, g
             }
     }
 
+    if (label.length > 0 && occupancy !== 1) {
+        label[0] = `${label[0]} <small>[occupancy</small> <b>${Math.round(100 * occupancy) / 100}</b><small>]</small>`;
+    }
+
     return label.reverse()
 }
 
-- 
GitLab