function bindButtonToConfiguration(elementId, newAttr, keys) {
        keys = keys || _.keys(newAttr);
        d3.select(elementId).on("click", function() {
            if (d3.select(elementId).classed("disabled")) return;
            configuration.save(newAttr);
        });
        configuration.on("change", function(model) {
            var attr = model.attributes;
            d3.select(elementId).classed("highlighted", _.isEqual(_.pick(attr, keys), _.pick(newAttr, keys)));
        });
    }
Registers a click event handler for the specified DOM element which modifies the configuration to have
the attributes represented by newAttr. An event listener is also registered for configuration change events,
so when a change occurs the button becomes highlighted (i.e., class ".highlighted" is assigned or removed) if
the configuration matches the attributes for this button. The set of attributes used for the matching is taken
from newAttr, unless a custom set of keys is provided.