From 2b58d68c720a6c03650d405ad065914aecc89b33 Mon Sep 17 00:00:00 2001
From: David Sehnal <david.sehnal@gmail.com>
Date: Tue, 26 Feb 2019 13:03:42 +0100
Subject: [PATCH] Proteopedia wrapper fix

---
 src/examples/proteopedia-wrapper/annotation.ts | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/src/examples/proteopedia-wrapper/annotation.ts b/src/examples/proteopedia-wrapper/annotation.ts
index e161d2ef8..66bf2ea7c 100644
--- a/src/examples/proteopedia-wrapper/annotation.ts
+++ b/src/examples/proteopedia-wrapper/annotation.ts
@@ -9,8 +9,8 @@ import { Model, ElementIndex, ResidueIndex } from 'mol-model/structure';
 import { Color } from 'mol-util/color';
 
 const EvolutionaryConservationPalette: Color[] = [
-    [255, 255, 150], // 9
-    [160, 37, 96],
+    [255, 255, 129], // insufficient
+    [160, 37, 96], // 9
     [240, 125, 171],
     [250, 201, 222],
     [252, 237, 244],
@@ -20,7 +20,6 @@ const EvolutionaryConservationPalette: Color[] = [
     [140, 255, 255],
     [16, 200, 209] // 1
 ].reverse().map(([r, g, b]) => Color.fromRgb(r, g, b));
-// const EvolutionaryConservationInsufficientColor = Color(0xcccc00);
 const EvolutionaryConservationDefaultColor = Color(0x999999);
 
 export const EvolutionaryConservation = CustomElementProperty.create<number>({
@@ -61,15 +60,13 @@ export const EvolutionaryConservation = CustomElementProperty.create<number>({
     },
     coloring: {
         getColor(e: number) {
-            // TODO
-            // if (e === 10) return EvolutionaryConservationInsufficientColor;
-            if (e < 0 || e > 9) return EvolutionaryConservationDefaultColor;
-            return EvolutionaryConservationPalette[e];
+            if (e < 1 || e > 10) return EvolutionaryConservationDefaultColor;
+            return EvolutionaryConservationPalette[e - 1];
         },
         defaultColor: EvolutionaryConservationDefaultColor
     },
     format(e) {
-        if (e === 0) return `Evolutionary Conservation: InsufficientData`;
+        if (e === 10) return `Evolutionary Conservation: InsufficientData`;
         return e ? `Evolutionary Conservation: ${e}` : void 0;
     }
 });
\ No newline at end of file
-- 
GitLab