stdlib icon indicating copy to clipboard operation
stdlib copied to clipboard

dsv type option

Open mbostock opened this issue 3 years ago • 1 comments

Screen Shot 2022-09-07 at 6 40 32 PM

Open questions (with my inclination):

  • Should we pass-through columns that are not mentioned without typing? (Yes. At the end?)
  • Should we support the “drop” type, if we want to suppress a column? (Yes if pass-through is default.)
  • Should we support the “auto” type, with the same behavior as d3.autoType for a single column? (Maybe.)
  • Should we support the “bigint” type? (Probably.)
  • Should we require ISO 8601 for dates rather than using the lax Date constructor? (Probably.)
  • Any special handling for the empty string? (Probably not.)
  • Should we use the Function constructor to make this faster, like d3-dsv does? (Maybe.)
  • Or should we use Object.fromEntries? (Probably slower.)

mbostock avatar Sep 08 '22 01:09 mbostock

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.

enjalot avatar Sep 08 '22 13:09 enjalot