src/charts/heatmap.js
function drawBoxes() {
            boxes = svg.select('.chart-group').selectAll('.box').data(data);

            boxes.enter()
              .append('rect')
                .classed('box', true)
                .attr('width', boxSize)
                .attr('height', boxSize)
                .attr('x', ({hour}) => hour * boxSize)
                .attr('y', ({day}) => day * boxSize)
                .style('opacity', boxInitialOpacity)
                .style('fill', boxInitialColor)
                .style('stroke', boxBorderColor)
                .style('stroke-width', boxBorderSize)
                .transition()
                    .duration(animationDuration)
                    .style('fill', ({value}) => colorScale(value))
                    .style('opacity', boxFinalOpacity);

            boxes.exit().remove();
        }
function drawBoxes() {
            boxes = svg.select('.chart-group').selectAll('.box').data(data);

            boxes.enter()
              .append('rect')
                .classed('box', true)
                .attr('width', boxSize)
                .attr('height', boxSize)
                .attr('x', ({hour}) => hour * boxSize)
                .attr('y', ({day}) => day * boxSize)
                .style('opacity', boxInitialOpacity)
                .style('fill', boxInitialColor)
                .style('stroke', boxBorderColor)
                .style('stroke-width', boxBorderSize)
                .transition()
                    .duration(animationDuration)
                    .style('fill', ({value}) => colorScale(value))
                    .style('opacity', boxFinalOpacity);

            boxes.exit().remove();
        }
function drawBoxes ( ) { boxes = svg . select ( '.chart-group' ) . selectAll ( '.box' ) . data ( data ) ; boxes . enter ( ) . append ( 'rect' ) . classed ( 'box' , true ) . attr ( 'width' , boxSize ) . attr ( 'height' , boxSize ) . attr ( 'x' , ( { hour } ) => hour * boxSize ) . attr ( 'y' , ( { day } ) => day * boxSize ) . style ( 'opacity' , boxInitialOpacity ) . style ( 'fill' , boxInitialColor ) . style ( 'stroke' , boxBorderColor ) . style ( 'stroke-width' , boxBorderSize ) . transition ( ) . duration ( animationDuration ) . style ( 'fill' , ( { value } ) => colorScale ( value ) ) . style ( 'opacity' , boxFinalOpacity ) ; boxes . exit ( ) . remove ( ) ; }
Draws the boxes of the heatmap
Draws the boxes of the heatmap