observablehq / stdlib

The Observable standard library.
https://observablehq.com/@observablehq/standard-library
ISC License
957 stars 83 forks source link

dsv type option #301

Open mbostock opened 1 year ago

mbostock commented 1 year ago
Screen Shot 2022-09-07 at 6 40 32 PM

Open questions (with my inclination):

enjalot commented 1 year ago

Should we pass-through columns that are not mentioned without typing? (Yes. At the end?)

I agree that unmentioned columns be included by default

Should we support the “drop” type, if we want to suppress a column? (Yes if pass-through is default.)

I agree, nice to explicitly drop unwanted columns (also documents the decision nicely)

Should we support the “auto” type, with the same behavior as d3.autoType for a single column? (Maybe.)

I don't think so. The primary interface for this implies that auto already suggested the type for the column. I like this level of interface being explicit.

Should we support the “bigint” type? (Probably.)

Seems like something we want to support across the platform better right?

Should we require ISO 8601 for dates rather than using the lax Date constructor? (Probably.)

i agree, we should standardize. if someone wants a variation the inline function is easy to use.

Any special handling for the empty string? (Probably not.)

I don't think so.

Should we use the Function constructor to make this faster, like d3-dsv does? (Maybe.) Or should we use Object.fromEntries? (Probably slower.)

Don't have a strong opinion, but making it as fast as possible seems a worthy goal.