Normalize color string before using them as IDs (#32713)

This commit is contained in:
Oscar Kilhed 2021-04-06 13:35:44 +02:00 committed by GitHub
parent 5289603a59
commit cf699d8ad1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -144,7 +144,7 @@ export const PieChartSvg: FC<SvgProps> = ({
}
const getValue = (d: FieldDisplay) => d.display.numeric;
const getGradientId = (color: string) => `${componentInstanceId}-${color}`;
const getGradientId = (color: string) => `${componentInstanceId}-${tinycolor(color).toHex()}`;
const getGradientColor = (color: string) => {
return `url(#${getGradientId(color)})`;
};