未验证 提交 fa7b60a8 编写于 作者: P Peter Pan 提交者: GitHub

fix: round color map indicator (#967)

上级 5937df7f
......@@ -68,11 +68,13 @@ const ColorMap: FunctionComponent<ColorMapProps & WithStyled> = ({indicators, da
const colorByIndicator = useMemo(() => indicators.find(i => i.name === colorBy), [colorBy, indicators]);
const colorByExtent = useMemo(
const colorByExtent = useMemo<[number, number]>(
() =>
colorByIndicator
? d3.extent(data.map(row => +row[colorByIndicator.group][colorByIndicator.name]))
: ([0, 0] as [number, number]),
? (d3
.extent(data.map(row => +row[colorByIndicator.group][colorByIndicator.name]))
.map((v: number | undefined) => Math.round((v ?? 0) * 1000) / 1000) as [number, number])
: [0, 0],
[colorByIndicator, data]
);
......
......@@ -35,6 +35,6 @@ export default () =>
},
metrics: {
accuracy: b[index % b.length],
loss: 100 - index * 0.2
loss: 100 - index * 0.2111111111111
}
}));
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册