Closed curran closed 3 weeks ago
import { scaleLinear, max, color } from 'd3'; export const renderCircles = ( selection, { descendants, fileSizeOpacityScale, fillColors }, ) => { // Define the gradients const defs = selection.append('defs'); const uniqueFillColors = Object.values(fillColors); uniqueFillColors.forEach((fillColor) => { defs .append('radialGradient') .attr('id', `gradient-${fillColor.replace('#', '')}`) .selectAll('stop') .data([ { offset: '0%', color: color(fillColor).brighter(1.5).toString(), }, { offset: '70%', color: fillColor }, { offset: '100%', color: color(fillColor).darker(1.5).toString(), }, ]) .enter() .append('stop') .attr('offset', (d) => d.offset) .attr('stop-color', (d) => d.color); }); };
Reference PR: https://github.com/vizhub-core/vzcode/pull/710/files
Maybe this got solved with that other unknown type issue!