From bc18f538a01cbc7f6bad9a1784c10c0a5750055d Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Thu, 23 Aug 2018 01:13:03 -0400 Subject: [PATCH] Use geojson hashcode instead of id for path cache --- modules/svg/helpers.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/svg/helpers.js b/modules/svg/helpers.js index c450e00f8..54929d9eb 100644 --- a/modules/svg/helpers.js +++ b/modules/svg/helpers.js @@ -169,11 +169,11 @@ export function svgPath(projection, graph, isArea) { }; svgpath.geojson = function(d) { - if (d.id !== undefined) { - if (d.id in cache) { - return cache[d.id]; + if (d.__hashcode__ !== undefined) { + if (d.__hashcode__ in cache) { + return cache[d.__hashcode__]; } else { - return cache[d.id] = path(d); + return cache[d.__hashcode__] = path(d); } } else { return path(d);