米国のzipcode topojsonファイルを読み込んだ後、d3.jsでエラーが発生します。 groupdata
は、この行に定義されていない:topojsonでUS Zipコードをマッピングする際のエラー
function bind(group, groupData) {
var i, n = group.length, m = groupData.length, n0 = Math.min(n, m), updateNodes = new Array(m), enterNodes = new Array(m), exitNodes = new Array(n), node, nodeData;
のエラーで:
Uncaught TypeError: Cannot read property 'length' of undefined
パスを呼び出して、作成された私のコードは次のとおりです。
d3.json("data/us-atlas/us-zipcodes.json", function(error, topology) {
svg.selectAll("path")
.data(topojson.feature(topology, topology.objects.zipcodes).features)
.enter()
.append("path")
.attr("d", path)
});
私はジップコードtopojsonファイルを生成しましたこのレポから:https://github.com/mbostock/us-atlas。ロード時にトポロジオブジェクトを検査すると、topology.objects.zipcodesの下に32893の円が表示されます。
私は、クロロプル例であるhttp://bl.ocks.org/mbostock/4060606で郡をうまく積み込み、それと同様のパターンを使っています。
私はd3.jsバージョン3.2.8とtopojson.jsバージョン1.2.3を使用しています。
アイデア?それは悪い郵便番号ファイルですか、それとも間違っていると思いますか?
を使用すると、[要旨](https://gist.github.com/を持っている場合)私たちを助けるかもしれないあなたのコードを示す。 – Hugolpz