cl-react-graph
Version:
15 lines (13 loc) • 366 B
text/typescript
import { ISVGLineStyle } from '../Histogram';
/**
* Apply style object to a d3 selection
* @param {Object} selection D3 selection
* @param {Object} style Css styling
* @return {Object} selection
*/
export default (selection, style: ISVGLineStyle) => {
Object.keys(style).forEach((k: string) => {
selection.attr(k, style[k]);
});
return selection;
};