UNPKG

dagre-d3-es

Version:

<p align="center"> <a href="https://tbo47.github.io/" ><img src="https://img.shields.io/badge/created_by-tbo47-blue.svg" alt="Created by tbo47"></a> <a href="https://www.npmjs.com/dagre-d3-es"><img src="https://img.shields.io/npm/v/dagre-d3-es.svg?log

20 lines (14 loc) 471 B
import * as d3 from 'd3'; import * as util from './util.js'; export { positionNodes }; function positionNodes(selection, g) { var created = selection.filter(function () { return !d3.select(this).classed('update'); }); function translate(v) { var node = g.node(v); return 'translate(' + node.x + ',' + node.y + ')'; } created.attr('transform', translate); util.applyTransition(selection, g).style('opacity', 1).attr('transform', translate); }