UNPKG

d3plus-common

Version:

Common functions and methods used across D3plus modules.

10 lines 403 B
/** @function stylize @desc Applies each key/value in an object as a style. @param {D3selection} elem The D3 element to apply the styles to. @param {Object} styles An object of key/value style pairs. */ export default function (e) { var s = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; for (var k in s) if ({}.hasOwnProperty.call(s, k)) e.style(k, s[k]); }