Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error started appearing after recent release to 4.7.1 #96

Closed
jodibean opened this issue Mar 6, 2017 · 2 comments
Closed

Error started appearing after recent release to 4.7.1 #96

jodibean opened this issue Mar 6, 2017 · 2 comments

Comments

@jodibean
Copy link

jodibean commented Mar 6, 2017

Greetings!

We have some geoJSON files that are giving us unexpected errors after the recent release of 4.7.1. Not all of them are failing, which is strange. All of the ones that are failing validate in a geoJSON validator just fine. No changes have been made to these files in the last 4 months.

The error we receive is "Error: attribute d: Expected number, "MNaN,NaNLNaN,NaN"
Our code is below. And the JSON is attached.
0157_02_json.txt

Any idea why this is happening?
`
vm.projection = d3.geoMercator().rotate([0, vm.rotation]);
vm.path = d3.geoPath()
.projection(vm.projection.fitExtent([[0, 0], [vm.w, vm.h]], json));

            vm.svg.selectAll(".room")
                .data(vm.rooms)
                .enter().append("path")
                .attr("class", "room")
                .attr("d", vm.path)
                .attr("fill", "#fff")
                .attr("stroke", "none")
                .attr("id", function (d) {
                    return d.properties.loc;
                })
                .on("mouseover", function (d) {
                    vm.div.transition()
                        .duration(90)
                        .style("opacity", 1);
                    vm.div.html(d.properties.room)
                        .style("left", (d3.event.pageX) + "px")
                        .style("top", (d3.event.pageY - 28) + "px");
                })
                .on("mouseout", function (d) {
                    vm.div.transition()
                        .duration(90)
                        .style("opacity", 0);
                })
                .on('click', function (d) {
                    d3.selectAll(".room").attr("fill", "#fff").attr("stroke", "none");
                    d3.select(this).attr("fill", "#BBDEFB").attr("stroke-width", "2").attr("stroke", "#FF5722");
                    vm.handleClick(d);
                });`
@mbostock
Copy link
Member

mbostock commented Mar 6, 2017

I wasn’t initially able to reproduce this…

untitled 10

However, I discovered if you set the rotation to be greater than 85° (which probably not coincidentally is the latitudinal limit of the default clip extent), then it breaks. This is probably related to the Mercator fixes in d3-geo@1.6.1, so I am moving the issue there.

@mbostock
Copy link
Member

mbostock commented Mar 6, 2017

Moved to d3/d3-geo#89.

@mbostock mbostock closed this as completed Mar 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants