08-27-周三_17-09-29

This commit is contained in:
2025-08-27 17:10:05 +08:00
commit 86df397d8f
12735 changed files with 1145479 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import d3 from 'd3'
import _ from 'lodash'
import util from './util'
function positionEdgeLabels (selection, g) {
const created = selection.filter(function () { return !d3.select(this).classed('update') })
function translate (e) {
const edge = g.edge(e)
return _.has(edge, 'x') ? 'translate(' + edge.x + ',' + edge.y + ')' : ''
}
created.attr('transform', translate)
util.applyTransition(selection, g)
.style('opacity', 1)
.attr('transform', translate)
}
export default positionEdgeLabels