Browse Source

mol-util: palette fix missing valueLabel function

David Sehnal 5 years ago
parent
commit
9d413bf0eb
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/mol-util/color/palette.ts

+ 1 - 1
src/mol-util/color/palette.ts

@@ -80,7 +80,7 @@ export function getPalette(count: number, props: PaletteProps) {
             count = Math.min(count, props.palette.params.maxCount)
             count = Math.min(count, props.palette.params.maxCount)
             colors = distinctColors(count, props.palette.params)
             colors = distinctColors(count, props.palette.params)
         }
         }
-        const { valueLabel } = props.palette.params
+        const valueLabel = props.palette.params.valueLabel || (i => '' + i);
         const colorsLength = colors.length
         const colorsLength = colors.length
         const table: [string, Color][] = []
         const table: [string, Color][] = []
         for (let i = 0; i < count; ++i) {
         for (let i = 0; i < count; ++i) {