var width = 800 var height = 400 var svg = d3.select("body").append("svg") .attr("width", width) .attr("height", height); var text = svg.append("g") .attr("transform", "translate(400, 30)") .append("text") .style("alignment-baseline", "hanging") .style("user-select", "none") .style("font-size", "120%") .style("fill", "grey") var callback = function() { text.text(Date.now()) } var btn = button() .x(10) // X Location .y(20) // Y Location .labels(["First label", "Second label"]) // Array of round-robin labels .callback(callback) // User callback on click .fontSize(70) // Font Size .color("lightgrey") // Button text color .fill("steelblue") // Button fill .fillHighlight("cyan") // Button fill when highlighted .opacity(0.8) // Opacity svg.call(btn)