bertinPointsStyle = new g.Style({
drawFun: (cells, cg, r) => {
cells = cells.filter((c) => c.ind);
const z = cg.view.z;
cells.sort((c1, c2) => (c2.y == c1.y ? c1.x - c2.x : c2.y - c1.y));
const ext = d3.extent(cells, (c) => +c.ind);
if (!randomColor) cg.ctx.fillStyle = fillColor;
if (strokeWidthPix) {
cg.ctx.strokeStyle = strokeColor;
cg.ctx.lineWidth = strokeWidthPix * z;
}
for (let c of cells) {
const sG = radiusFactor * r * scale((c.ind - ext[0]) / (ext[1] - ext[0]));
if (randomColor)
cg.ctx.fillStyle = "rgb(" + r255() + "," + r255() + "," + r255() + ")";
cg.ctx.beginPath();
cg.ctx.arc(c.x + r / 2, c.y + r / 2, sG * 0.5, 0, 2 * Math.PI, false);
cg.ctx.fill();
if (strokeWidthPix) cg.ctx.stroke();
}
}
})