package.src.lib.setcursor.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plotly.js Show documentation
Show all versions of plotly.js Show documentation
The open source javascript graphing library that powers plotly
The newest version!
'use strict';
// 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);
};