gui/src/components/MiningResultDensity.js
/***
     * When updating the props, according canvas needs to be updated.
     * Remove original canvas and draw a new one.
     * @param props {Object} from React.Component
     */
When updating the props, according canvas needs to be updated.
Remove original canvas and draw a new one.
@param props {Object} from React.Component
When updating the props according canvas needs to be updated . Remove original canvas and draw a new one . @param props { Object } from React . Component
updateCanvas(props) {
        const svgRoot = d3.select("#mining-result-density");
        let baseGroup = d3.select("#mining-result-density-base");
        baseGroup.remove();
        baseGroup = svgRoot
            .append("g")
            .attr("id", "mining-result-density-base");
        this.renderSvg(baseGroup, props);
    }
updateCanvas ( props ) { const svgRoot = d3 . select ( "#mining-result-density" ) ; let baseGroup = d3 . select ( "#mining-result-density-base" ) ; baseGroup . remove ( ) ; baseGroup = svgRoot . append ( "g" ) . attr ( "id" , "mining-result-density-base" ) ; this . renderSvg ( baseGroup , props ) ; }
When updating the props, according canvas needs to be updated.
When updating the props according canvas needs to be updated .