You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
2.0 KiB
2 lines
2.0 KiB
// https://d3js.org/d3-dsv/ v1.0.10 Copyright 2018 Mike Bostock |
|
!function(r,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(r.d3=r.d3||{})}(this,function(r){"use strict";var n={},t={},e=34,o=10,u=13;function a(r){return new Function("d","return {"+r.map(function(r,n){return JSON.stringify(r)+": d["+n+"]"}).join(",")+"}")}function c(r){var c=new RegExp('["'+r+"\n\r]"),i=r.charCodeAt(0);function f(r,a){var c,f=[],s=r.length,p=0,d=0,l=s<=0,m=!1;function v(){if(l)return t;if(m)return m=!1,n;var a,c,f=p;if(r.charCodeAt(f)===e){for(;p++<s&&r.charCodeAt(p)!==e||r.charCodeAt(++p)===e;);return(a=p)>=s?l=!0:(c=r.charCodeAt(p++))===o?m=!0:c===u&&(m=!0,r.charCodeAt(p)===o&&++p),r.slice(f+1,a-1).replace(/""/g,'"')}for(;p<s;){if((c=r.charCodeAt(a=p++))===o)m=!0;else if(c===u)m=!0,r.charCodeAt(p)===o&&++p;else if(c!==i)continue;return r.slice(f,a)}return l=!0,r.slice(f,s)}for(r.charCodeAt(s-1)===o&&--s,r.charCodeAt(s-1)===u&&--s;(c=v())!==t;){for(var h=[];c!==n&&c!==t;)h.push(c),c=v();a&&null==(h=a(h,d++))||f.push(h)}return f}function s(n){return n.map(p).join(r)}function p(r){return null==r?"":c.test(r+="")?'"'+r.replace(/"/g,'""')+'"':r}return{parse:function(r,n){var t,e,o=f(r,function(r,o){if(t)return t(r,o-1);e=r,t=n?function(r,n){var t=a(r);return function(e,o){return n(t(e),o,r)}}(r,n):a(r)});return o.columns=e||[],o},parseRows:f,format:function(n,t){return null==t&&(t=function(r){var n=Object.create(null),t=[];return r.forEach(function(r){for(var e in r)e in n||t.push(n[e]=e)}),t}(n)),[t.map(p).join(r)].concat(n.map(function(n){return t.map(function(r){return p(n[r])}).join(r)})).join("\n")},formatRows:function(r){return r.map(s).join("\n")}}}var i=c(","),f=i.parse,s=i.parseRows,p=i.format,d=i.formatRows,l=c("\t"),m=l.parse,v=l.parseRows,h=l.format,w=l.formatRows;r.dsvFormat=c,r.csvParse=f,r.csvParseRows=s,r.csvFormat=p,r.csvFormatRows=d,r.tsvParse=m,r.tsvParseRows=v,r.tsvFormat=h,r.tsvFormatRows=w,Object.defineProperty(r,"__esModule",{value:!0})});
|
|
|