ソースを参照

mol-util: palette fix missing valueLabel function

David Sehnal 5 年 前
コミット
9d413bf0eb
1 ファイル変更1 行追加1 行削除
  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)
             colors = distinctColors(count, props.palette.params)
         }
-        const { valueLabel } = props.palette.params
+        const valueLabel = props.palette.params.valueLabel || (i => '' + i);
         const colorsLength = colors.length
         const table: [string, Color][] = []
         for (let i = 0; i < count; ++i) {