sandbox/sandbox.js
function setNewDataTypes() {
    let chartType = getCurrentType();
    let dataTypes = Object.keys(defaultData[chartType]);

    let dataSelector = d3.select(`.${dataSelectorClass}`)
        .selectAll('option')
        .data(dataTypes);

    dataSelector.enter().append('option')
        .merge(dataSelector)
            .attr('value', (d) => d)
            .text((d) => d);

    dataSelector.exit().remove();
}
function setNewDataTypes() {
    let chartType = getCurrentType();
    let dataTypes = Object.keys(defaultData[chartType]);

    let dataSelector = d3.select(`.${dataSelectorClass}`)
        .selectAll('option')
        .data(dataTypes);

    dataSelector.enter().append('option')
        .merge(dataSelector)
            .attr('value', (d) => d)
            .text((d) => d);

    dataSelector.exit().remove();
}
function setNewDataTypes ( ) { let chartType = getCurrentType ( ) ; let dataTypes = Object . keys ( defaultData [ chartType ] ) ; let dataSelector = d3 . select ( ` ${ dataSelectorClass } ` ) . selectAll ( 'option' ) . data ( dataTypes ) ; dataSelector . enter ( ) . append ( 'option' ) . merge ( dataSelector ) . attr ( 'value' , ( d ) => d ) . text ( ( d ) => d ) ; dataSelector . exit ( ) . remove ( ) ; }
Reads from the constants file to fill the data type selelctor with the data types of that chart
Reads from the constants file to fill the data type selelctor with the data types of that chart