Closed ericemc3 closed 3 years ago
We designed the behavior of d3.autoType based on JavaScript. If it’s not what you want, you should implement your own row conversion function. Changing this behavior now would not be backwards-compatible, and also we wanted a strong precedent for the behavior so that it’s easier for folks to remember how d3.autoType behaves.
If you want to skip a specific field when using d3.autoType, consider using destructuring spread:
d3.csvParse(string, ({id, ...rest}) => ({id, ...d3.autoType(rest)}))
Is there a reason, besides performance, for d3.autotype skipping leading 0? d3.autoType({id: "06075"}) => 6075
d3.autotype is quite convenient. Could a test on leading 0 be added to avoid string to number conversion here?