How to use the d3-dsv.tsv 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 BRCAChallenge / brca-exchange / website / web_loaders / dsv-loader / index.js View on Github external
/*global require: false, module: false */
'use strict';

var loaderUtils = require('loader-utils');
var tsv = require('d3-dsv').tsv;
var _ = require('underscore');

function indexOfOrThrow(a, v) {
	var r = _.indexOf(a, v);
	if (r === -1) {
		throw new Error("No key named " + v);
	}
	return r;
}

function keyValue(indices, row) {
	return JSON.stringify(_.pick(row, indices));
}

module.exports = function(text) {
	this.cacheable();