値関数内からデータムの親配列にアクセスする必要があります。より高いレベルにスコープされた変数を使用せずにそれを行う方法はありますか?
言い換えると、
var data = ["a", "b", "c"],
svg = d3.select("svg");
svg.selectAll("rect").data(data).enter().append("rect")
.attr("x", function(d, i) {
// how do I access `d's` parent array from here
// without using the closure variable `data`?
});
編集:
私の現実の状況はより複雑であり、このタイプの閉鎖を作成するのは私の場合は厄介なので、私は閉鎖を避けています。