RuntimeError: circular definition after drag end

After a rectangle is repositioned using drag I need to re-draw the chart to resolve any overlaps.
This creates a RuntimeError: circular definition d3 v6 due to circular dependencies which are not allowed with ES6. Is there a workaround for this?

function draw() {
var Enter = group.enter()
                .attr("class", "lefthand")
                .attr("width", function (d) { return xt(new Date(d.finish)) - xt(new Date(d.start)) })
                .attr("x", function (d) { return xt(d.start) })
                .attr("y", function (d) { return env.yScale(d.sub) - lineHeight / 2 })
                    .on("start", dragstartedl)
                    .on("drag", draggedl)
                    .on("end", dragendedl))

function dragended(d) {

            event = null

Solved this by making a series of selections and updating specific attributes e.g.


Previous code didn’t utilise d3 properly, it was basically a full re-run of the chart