Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
protected createIcon(childCount: number, backColor: string, format: (_: any) => any) {
const borderColor = d3Hsl(backColor);
borderColor.opacity = 0.5;
return new DivIcon({
className: "cluster-circle",
iconSize: new Point(40, 40),
html: `<div style="opacity:${this.opacity()};background-color:${borderColor.toString()}"><div style="background-color:${backColor}"><span style="color:${Palette.textColor(backColor)}">${format(childCount)}</span></div></div>`
});
}
return function (this: ColumnType, row: RowType, cell: any, cellElement: HTMLElement): HTMLElement | void {
const pal = palettes[this.idx];
if (pal) {
const background = pal.palette(cell, pal.min, pal.max);
d3Select(cellElement)
.style("background", background)
.style("color", Palette.textColor(background))
;
}
cellElement.innerText = defaultFormatter.call(this, cell, row);
};
}
INDChart.prototype.textColor = function (row: any[], column: string, value: number): string {
return Palette.textColor(this.fillColor(row, column, value));
};
I2DChart.prototype.textColor = function (row: any[], column, value): string {
return Palette.textColor(this.fillColor(row, column, value));
};