berkmancenter / dotplot

Telling a story through dots
GNU General Public License v3.0
51 stars 27 forks source link

Use better node IDs and class names #85

Closed jdcc closed 7 years ago

jdcc commented 7 years ago

Don't use raw text values as the node ids or class names. You end up with all sorts of escaping issues, which you've already encountered judging by all the select("[id=... shenanigans. It also opens you up to XSS attacks and makes the document unnecessarily large. Instead, construct a simple map from text values to generated IDs or class names. The D3 ordinal scales can help you out with this.

jdcc commented 7 years ago

Did this as part of refactor.