How to use the d3-dsv/src/dsv function in d3-dsv

To help you get started, we’ve selected a few d3-dsv examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mhkeller / indian-ocean / src / helpers / discernParser.js View on Github external
export default function discernParser (filePath, opts_) {
  if (opts_ && opts_.delimiter === true) {
    return dsvFormat(filePath).parse
  }
  var format = discernFormat(filePath)
  var parser = parsers[format]
  // If we don't have a parser for this format, return as text
  if (typeof parser === 'undefined') {
    parser = parsers['txt']
  }
  return parser
}
github mhkeller / indian-ocean / src / parsers / psv.js View on Github external
export default function (str, parserOptions) {
  parserOptions = parserOptions || {}
  return dsvFormat('|').parse(str, parserOptions.map)
}
github mhkeller / indian-ocean / src / formatters / psv.js View on Github external
export default function (file, writeOptions) {
  writeOptions = writeOptions || {}
  file = formattingPreflight(file, 'psv')
  try {
    return dsvFormat('|').format(file, writeOptions.columns)
  } catch (err) {
    parseError('psv')
  }
}