roughStyle = new g.Style({
drawFun: (cells, cg, resolution) => {
const z = cg.view.z;
const min = d3.min(cells, (c) => +c.ind);
const max = d3.max(cells, (c) => +c.ind);
for (let cell of cells) {
if (!cell.ind) continue;
let t = (cell.ind - min) / (max - min);
t = scale(t);
t = t < 0 ? 0 : t > 1 ? 1 : t;
const col = colorRamp(t);
rc.rectangle(cell.x, cell.y, resolution, resolution, {
fillStyle: fillType,
stroke: "none",
fill: col,
roughness: roughness,
bowing: bowing,
hachureAngle: 40,
fillWeight: z * 1.5,
hachureGap: z * 8
});
}
}
})