yaph / d3-geomap

A library for creating geographical maps based on D3.js
https://d3-geomap.github.io/
MIT License
132 stars 45 forks source link

Cannot read property "replace" of undefined #58

Closed dpraul closed 4 years ago

dpraul commented 5 years ago

With version 3.2.0 we are getting the following error:

TypeError: Cannot read property "replace" of undefined on this line: https://github.com/yaph/d3-geomap/blob/09f3dce59e891664b802989b77c5edcbdd8f955f/src/js/geomap.js#L126

I believe this is because we don't have data for every point on our map, and chose to leave some empty. In version 3.1.0 this would set some of the path classes to .unit.unit-undefined - which we reasoned as okay. Not sure if the solution here should be on our end or on the d3-geomap end.

yaph commented 5 years ago

I'm not sure to be honest. My knee-jerk reaction is to fix this in d3-geomap, but obviously the library cannot handle all potential data issues. In any case I won't be able to create a new release before next week. Also this screams for finally adding tests to the library.

yaph commented 5 years ago

Can you send me a sample (a few lines) of the CSV file, with which you experienced the issue. I'd like to add a test for it, before fixing the issue and creating the next release.

yaph commented 4 years ago

This should be fixed in release 3.3.0.

dpraul commented 4 years ago

Delayed response: yep, this appears to be fixed! Thanks for putting the care toward it