metreex-analysis.js
/**
 * Creates a set of buttons, in the target div, each associated with a specific author. Each button toggles the visibility of all elements associated with that author and the class name given.
 * @param {String} target Name of HTML div that the buttons should be appended to
 * @param {Array} authors Array of authors to create toggles for
 * @param {String} pointClassName Class name associated with the elements targeted by the created toggles
 */
Creates a set of buttons, in the target div, each associated with a specific author. Each button toggles the visibility of all elements associated with that author and the class name given.
@param {String} target Name of HTML div that the buttons should be appended to
@param {Array} authors Array of authors to create toggles for
@param {String} pointClassName Class name associated with the elements targeted by the created toggles
Creates a set of buttons in the target div each associated with a specific author . Each button toggles the visibility of all elements associated with that author and the class name given . @param { String } target Name of HTML div that the buttons should be appended to @param { Array } authors Array of authors to create toggles for @param { String } pointClassName Class name associated with the elements targeted by the created toggles
function createAuthorPlotPointToggles(target, authors, pointClassName){
    d3.select(target).selectAll("#input")
        .data(authors)
        .enter()
        .append("input")
        .attr("type", "button")
        .attr("value", function(elem){return "Toggle " + elem + " point visibility"})
        .on("click",function(elem){
            var selection = d3.selectAll(pointClassName + "." + (elem.replace(/ /g,".")));
            if (selection.style("display") !== "none")  selection.style("display","none");
            else selection.style("display","block");
        });
}
function createAuthorPlotPointToggles ( target , authors , pointClassName ) { d3 . select ( target ) . selectAll ( "#input" ) . data ( authors ) . enter ( ) . append ( "input" ) . attr ( "type" , "button" ) . attr ( "value" , function ( elem ) { return "Toggle " + elem + " point visibility" } ) . on ( "click" , function ( elem ) { var selection = d3 . selectAll ( pointClassName + "." + ( elem . replace ( / / g , "." ) ) ) ; if ( selection . style ( "display" ) !== "none" ) selection . style ( "display" , "none" ) ; else selection . style ( "display" , "block" ) ; } ) ; }
Creates a set of buttons, in the target div, each associated with a specific author.
Creates a set of buttons in the target div each associated with a specific author .