Join diagnostics

Six data rows against Natural Earth country names. Three are the spellings real datasets actually publish, and they fail. Every other library renders them grey and says nothing, so the developer spends an hour diffing strings. The report below is map.diagnoseJoin().report(), and the same thing prints to the console in dev mode without being asked for.

Why matching is exact by default

Silent fuzzy matching trades an obvious failure for a plausible wrong answer, which is worse: nobody audits a map that looks fine. So normalisation, a curated alias table and edit distance are used to explain failures, and fuzzyJoin: true applies them only when asked, logging every substitution it made. One repair is applied unasked, because it is lossless and unambiguous: a FIPS or GEOID code that lost its leading zero in a spreadsheet.

series: [{ joinBy: 'name', data: messyData, fuzzyJoin: false }]

map.diagnoseJoin()   // { matched, unmatchedData, unmatchedFeatures, applied, sharedKeys, report() }