I'm wondering if the browser will immediately block to render when the points attribute is updated? Depending on the performance hit here, it might be worth building up the new points as a standalone string first, to avoid unsetting-then-resetting. This would also allow addPoint to not need to lookup the points attribute for each new point added.

Perhaps a cleaner function might be setPoints([..]) that takes an array of points?