function colorScale(nodeMetric) {
        var curMetric = d3.select('#metricSelect').property('value');
        var colorSchemeUsed = setColors();
        var metric_range = allMax[curMetric] - allMin[curMetric];
        var proportion_of_total = nodeMetric/1;
        
        if (metric_range != 0){
            proportion_of_total = (nodeMetric - allMin[curMetric])/metric_range;
        }
//         return colorSchemeUsed;
        if (proportion_of_total > 0.9) { return colorSchemeUsed[0]; }
        if (proportion_of_total > 0.7) { return colorSchemeUsed[1]; }
        if (proportion_of_total > 0.5) { return colorSchemeUsed[2]; }
        if (proportion_of_total > 0.3) { return colorSchemeUsed[3]; }
        if (proportion_of_total > 0.1) { return colorSchemeUsed[4]; }
        else { return colorSchemeUsed[5]; }
    }
// Update colorScale with min and max
Update colorScale with min and max
Update colorScale with min and max
function colorScale(nodeMetric) {
        var curMetric = d3.select('#metricSelect').property('value');
        var colorSchemeUsed = setColors();
        var metric_range = allMax[curMetric] - allMin[curMetric];
        var proportion_of_total = nodeMetric/1;
        if (metric_range != 0){
            proportion_of_total = (nodeMetric - allMin[curMetric])/metric_range;
        }
        if (proportion_of_total > 0.9) { return colorSchemeUsed[0]; }
        if (proportion_of_total > 0.7) { return colorSchemeUsed[1]; }
        if (proportion_of_total > 0.5) { return colorSchemeUsed[2]; }
        if (proportion_of_total > 0.3) { return colorSchemeUsed[3]; }
        if (proportion_of_total > 0.1) { return colorSchemeUsed[4]; }
        else { return colorSchemeUsed[5]; }
    }
function colorScale ( nodeMetric ) { var curMetric = d3 . select ( '#metricSelect' ) . property ( 'value' ) ; var colorSchemeUsed = setColors ( ) ; var metric_range = allMax [ curMetric ] - allMin [ curMetric ] ; var proportion_of_total = nodeMetric / 1 ; if ( metric_range != 0 ) { proportion_of_total = ( nodeMetric - allMin [ curMetric ] ) / metric_range ; } if ( proportion_of_total > 0.9 ) { return colorSchemeUsed [ 0 ] ; } if ( proportion_of_total > 0.7 ) { return colorSchemeUsed [ 1 ] ; } if ( proportion_of_total > 0.5 ) { return colorSchemeUsed [ 2 ] ; } if ( proportion_of_total > 0.3 ) { return colorSchemeUsed [ 3 ] ; } if ( proportion_of_total > 0.1 ) { return colorSchemeUsed [ 4 ] ; } else { return colorSchemeUsed [ 5 ] ; } }
Update colorScale with min and max
Update colorScale with min and max
//         return colorSchemeUsed;