plotly.js
Version:
The open source javascript graphing library that powers plotly
13 lines (10 loc) • 408 B
JavaScript
// works with our CSS cursor classes (see css/_cursor.scss)
// to apply cursors to d3 single-element selections.
// omit cursor to revert to the default.
module.exports = function setCursor(el3, csr) {
(el3.attr('class') || '').split(' ').forEach(function(cls) {
if(cls.indexOf('cursor-') === 0) el3.classed(cls, false);
});
if(csr) el3.classed('cursor-' + csr, true);
};
;