vega-datasets
Advanced tools
Comparing version 2.5.3 to 2.5.4
@@ -8,7 +8,6 @@ (function (global, factory) { | ||
var EOL = {}, | ||
EOF = {}, | ||
QUOTE = 34, | ||
NEWLINE = 10, | ||
RETURN = 13; | ||
EOF = {}, | ||
QUOTE = 34, | ||
NEWLINE = 10, | ||
RETURN = 13; | ||
function objectConverter(columns) { | ||
@@ -19,3 +18,2 @@ return new Function("d", "return {" + columns.map(function (name, i) { | ||
} | ||
function customConverter(columns, f) { | ||
@@ -26,8 +24,8 @@ var object = objectConverter(columns); | ||
}; | ||
} // Compute unique columns in order of discovery. | ||
} | ||
// Compute unique columns in order of discovery. | ||
function inferColumns(rows) { | ||
var columnSet = Object.create(null), | ||
columns = []; | ||
columns = []; | ||
rows.forEach(function (row) { | ||
@@ -42,65 +40,57 @@ for (var column in row) { | ||
} | ||
function pad(value, width) { | ||
var s = value + "", | ||
length = s.length; | ||
length = s.length; | ||
return length < width ? new Array(width - length + 1).join(0) + s : s; | ||
} | ||
function formatYear(year) { | ||
return year < 0 ? "-" + pad(-year, 6) : year > 9999 ? "+" + pad(year, 6) : pad(year, 4); | ||
} | ||
function formatDate(date) { | ||
var hours = date.getUTCHours(), | ||
minutes = date.getUTCMinutes(), | ||
seconds = date.getUTCSeconds(), | ||
milliseconds = date.getUTCMilliseconds(); | ||
minutes = date.getUTCMinutes(), | ||
seconds = date.getUTCSeconds(), | ||
milliseconds = date.getUTCMilliseconds(); | ||
return isNaN(date) ? "Invalid Date" : formatYear(date.getUTCFullYear()) + "-" + pad(date.getUTCMonth() + 1, 2) + "-" + pad(date.getUTCDate(), 2) + (milliseconds ? "T" + pad(hours, 2) + ":" + pad(minutes, 2) + ":" + pad(seconds, 2) + "." + pad(milliseconds, 3) + "Z" : seconds ? "T" + pad(hours, 2) + ":" + pad(minutes, 2) + ":" + pad(seconds, 2) + "Z" : minutes || hours ? "T" + pad(hours, 2) + ":" + pad(minutes, 2) + "Z" : ""); | ||
} | ||
function dsv (delimiter) { | ||
var reFormat = new RegExp("[\"" + delimiter + "\n\r]"), | ||
DELIMITER = delimiter.charCodeAt(0); | ||
DELIMITER = delimiter.charCodeAt(0); | ||
function parse(text, f) { | ||
var convert, | ||
columns, | ||
rows = parseRows(text, function (row, i) { | ||
if (convert) return convert(row, i - 1); | ||
columns = row, convert = f ? customConverter(row, f) : objectConverter(row); | ||
}); | ||
columns, | ||
rows = parseRows(text, function (row, i) { | ||
if (convert) return convert(row, i - 1); | ||
columns = row, convert = f ? customConverter(row, f) : objectConverter(row); | ||
}); | ||
rows.columns = columns || []; | ||
return rows; | ||
} | ||
function parseRows(text, f) { | ||
var rows = [], | ||
// output rows | ||
N = text.length, | ||
I = 0, | ||
// current character index | ||
n = 0, | ||
// current line number | ||
t, | ||
// current token | ||
eof = N <= 0, | ||
// current token followed by EOF? | ||
eol = false; // current token followed by EOL? | ||
// output rows | ||
N = text.length, | ||
I = 0, | ||
// current character index | ||
n = 0, | ||
// current line number | ||
t, | ||
// current token | ||
eof = N <= 0, | ||
// current token followed by EOF? | ||
eol = false; // current token followed by EOL? | ||
// Strip the trailing newline. | ||
if (text.charCodeAt(N - 1) === NEWLINE) --N; | ||
if (text.charCodeAt(N - 1) === RETURN) --N; | ||
function token() { | ||
if (eof) return EOF; | ||
if (eol) return eol = false, EOL; // Unescape quotes. | ||
if (eol) return eol = false, EOL; | ||
// Unescape quotes. | ||
var i, | ||
j = I, | ||
c; | ||
j = I, | ||
c; | ||
if (text.charCodeAt(j) === QUOTE) { | ||
while (I++ < N && text.charCodeAt(I) !== QUOTE || text.charCodeAt(++I) === QUOTE); | ||
if ((i = I) >= N) eof = true;else if ((c = text.charCodeAt(I++)) === NEWLINE) eol = true;else if (c === RETURN) { | ||
@@ -111,5 +101,5 @@ eol = true; | ||
return text.slice(j + 1, i - 1).replace(/""/g, "\""); | ||
} // Find next delimiter or newline. | ||
} | ||
// Find next delimiter or newline. | ||
while (I < N) { | ||
@@ -121,20 +111,15 @@ if ((c = text.charCodeAt(i = I++)) === NEWLINE) eol = true;else if (c === RETURN) { | ||
return text.slice(j, i); | ||
} // Return last token before EOF. | ||
} | ||
// Return last token before EOF. | ||
return eof = true, text.slice(j, N); | ||
} | ||
while ((t = token()) !== EOF) { | ||
var row = []; | ||
while (t !== EOL && t !== EOF) row.push(t), t = token(); | ||
if (f && (row = f(row, n++)) == null) continue; | ||
rows.push(row); | ||
} | ||
return rows; | ||
} | ||
function preformatBody(rows, columns) { | ||
@@ -147,3 +132,2 @@ return rows.map(function (row) { | ||
} | ||
function format(rows, columns) { | ||
@@ -153,3 +137,2 @@ if (columns == null) columns = inferColumns(rows); | ||
} | ||
function formatBody(rows, columns) { | ||
@@ -159,15 +142,11 @@ if (columns == null) columns = inferColumns(rows); | ||
} | ||
function formatRows(rows) { | ||
return rows.map(formatRow).join("\n"); | ||
} | ||
function formatRow(row) { | ||
return row.map(formatValue).join(delimiter); | ||
} | ||
function formatValue(value) { | ||
return value == null ? "" : value instanceof Date ? formatDate(value) : reFormat.test(value += "") ? "\"" + value.replace(/"/g, "\"\"") + "\"" : value; | ||
} | ||
return { | ||
@@ -190,4 +169,4 @@ parse: parse, | ||
var value = object[key].trim(), | ||
number, | ||
m; | ||
number, | ||
m; | ||
if (!value) value = null;else if (value === "true") value = true;else if (value === "false") value = false;else if (value === "NaN") value = NaN;else if (!isNaN(number = +value)) value = number;else if (m = value.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)) { | ||
@@ -199,9 +178,9 @@ if (fixtz && !!m[4] && !m[7]) value = value.replace(/-/g, "/").replace(/T/, " "); | ||
} | ||
return object; | ||
} // https://github.com/d3/d3-dsv/issues/45 | ||
} | ||
// https://github.com/d3/d3-dsv/issues/45 | ||
const fixtz = new Date("2019-01-01T00:00").getHours() || new Date("2019-07-01T00:00").getHours(); | ||
var version = "2.5.2"; | ||
var version = "2.5.4"; | ||
@@ -283,9 +262,6 @@ var urls = { | ||
}; | ||
for (const name of Object.keys(urls)) { | ||
const url = urls[name]; | ||
const f = async function () { | ||
const result = await fetch(url); | ||
if (name.endsWith(".json")) { | ||
@@ -299,3 +275,2 @@ return await result.json(); | ||
}; | ||
f.url = url; | ||
@@ -302,0 +277,0 @@ data[name] = f; |
@@ -1,2 +0,2 @@ | ||
!function(t,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s():"function"==typeof define&&define.amd?define(s):(t="undefined"!=typeof globalThis?globalThis:t||self).vegaDatasets=s()}(this,(function(){"use strict";var t={},s={};function e(t){return new Function("d","return {"+t.map((function(t,s){return JSON.stringify(t)+": d["+s+'] || ""'})).join(",")+"}")}function n(t){var s=Object.create(null),e=[];return t.forEach((function(t){for(var n in t)n in s||e.push(s[n]=n)})),e}function a(t,s){var e=t+"",n=e.length;return n<s?new Array(s-n+1).join(0)+e:e}function d(t){var s,e=t.getUTCHours(),n=t.getUTCMinutes(),d=t.getUTCSeconds(),o=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((s=t.getUTCFullYear())<0?"-"+a(-s,6):s>9999?"+"+a(s,6):a(s,4))+"-"+a(t.getUTCMonth()+1,2)+"-"+a(t.getUTCDate(),2)+(o?"T"+a(e,2)+":"+a(n,2)+":"+a(d,2)+"."+a(o,3)+"Z":d?"T"+a(e,2)+":"+a(n,2)+":"+a(d,2)+"Z":n||e?"T"+a(e,2)+":"+a(n,2)+"Z":"")}var o=function(a){var o=new RegExp('["'+a+"\n\r]"),r=a.charCodeAt(0);function i(e,n){var a,d=[],o=e.length,i=0,c=0,p=o<=0,v=!1;function l(){if(p)return s;if(v)return v=!1,t;var n,a,d=i;if(34===e.charCodeAt(d)){for(;i++<o&&34!==e.charCodeAt(i)||34===e.charCodeAt(++i););return(n=i)>=o?p=!0:10===(a=e.charCodeAt(i++))?v=!0:13===a&&(v=!0,10===e.charCodeAt(i)&&++i),e.slice(d+1,n-1).replace(/""/g,'"')}for(;i<o;){if(10===(a=e.charCodeAt(n=i++)))v=!0;else if(13===a)v=!0,10===e.charCodeAt(i)&&++i;else if(a!==r)continue;return e.slice(d,n)}return p=!0,e.slice(d,o)}for(10===e.charCodeAt(o-1)&&--o,13===e.charCodeAt(o-1)&&--o;(a=l())!==s;){for(var j=[];a!==t&&a!==s;)j.push(a),a=l();n&&null==(j=n(j,c++))||d.push(j)}return d}function c(t,s){return t.map((function(t){return s.map((function(s){return v(t[s])})).join(a)}))}function p(t){return t.map(v).join(a)}function v(t){return null==t?"":t instanceof Date?d(t):o.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,s){var n,a,d=i(t,(function(t,d){if(n)return n(t,d-1);a=t,n=s?function(t,s){var n=e(t);return function(e,a){return s(n(e),a,t)}}(t,s):e(t)}));return d.columns=a||[],d},parseRows:i,format:function(t,s){return null==s&&(s=n(t)),[s.map(v).join(a)].concat(c(t,s)).join("\n")},formatBody:function(t,s){return null==s&&(s=n(t)),c(t,s).join("\n")},formatRows:function(t){return t.map(p).join("\n")},formatRow:p,formatValue:v}}(",").parse;function r(t){for(var s in t){var e,n,a=t[s].trim();if(a)if("true"===a)a=!0;else if("false"===a)a=!1;else if("NaN"===a)a=NaN;else if(isNaN(e=+a)){if(!(n=a.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)))continue;i&&n[4]&&!n[7]&&(a=a.replace(/-/g,"/").replace(/T/," ")),a=new Date(a)}else a=e;else a=null;t[s]=a}return t}const i=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours();var c="2.5.2",p={"annual-precip.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/annual-precip.json","anscombe.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/anscombe.json","barley.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/barley.json","budget.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/budget.json","budgets.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/budgets.json","burtin.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/burtin.json","cars.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/cars.json","countries.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/countries.json","crimea.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/crimea.json","driving.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/driving.json","earthquakes.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/earthquakes.json","flare-dependencies.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/flare-dependencies.json","flare.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/flare.json","flights-10k.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/flights-10k.json","flights-200k.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/flights-200k.json","flights-20k.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/flights-20k.json","flights-2k.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/flights-2k.json","flights-5k.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/flights-5k.json","football.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/football.json","gapminder.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/gapminder.json","income.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/income.json","jobs.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/jobs.json","londonBoroughs.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/londonBoroughs.json","londonCentroids.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/londonCentroids.json","londonTubeLines.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/londonTubeLines.json","miserables.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/miserables.json","monarchs.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/monarchs.json","movies.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/movies.json","normal-2d.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/normal-2d.json","obesity.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/obesity.json","ohlc.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/ohlc.json","penguins.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/penguins.json","platformer-terrain.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/platformer-terrain.json","points.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/points.json","political-contributions.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/political-contributions.json","population.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/population.json","udistrict.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/udistrict.json","unemployment-across-industries.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/unemployment-across-industries.json","uniform-2d.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/uniform-2d.json","us-10m.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/us-10m.json","us-state-capitals.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/us-state-capitals.json","volcano.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/volcano.json","weather.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/weather.json","wheat.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/wheat.json","world-110m.json":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/world-110m.json","airports.csv":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/airports.csv","birdstrikes.csv":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/birdstrikes.csv","co2-concentration.csv":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/co2-concentration.csv","disasters.csv":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/disasters.csv","flights-3m.csv":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/flights-3m.csv","flights-airport.csv":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/flights-airport.csv","gapminder-health-income.csv":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/gapminder-health-income.csv","github.csv":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/github.csv","iowa-electricity.csv":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/iowa-electricity.csv","la-riots.csv":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/la-riots.csv","lookup_groups.csv":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/lookup_groups.csv","lookup_people.csv":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/lookup_people.csv","population_engineers_hurricanes.csv":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/population_engineers_hurricanes.csv","seattle-weather-hourly-normals.csv":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/seattle-weather-hourly-normals.csv","seattle-weather.csv":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/seattle-weather.csv","sp500-2000.csv":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/sp500-2000.csv","sp500.csv":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/sp500.csv","stocks.csv":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/stocks.csv","us-employment.csv":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/us-employment.csv","weather.csv":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/weather.csv","windvectors.csv":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/windvectors.csv","zipcodes.csv":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/zipcodes.csv","unemployment.tsv":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/unemployment.tsv","flights-200k.arrow":"https://cdn.jsdelivr.net/npm/vega-datasets@2.5.2/data/flights-200k.arrow"};const v={version:c};for(const t of Object.keys(p)){const s=p[t],e=async function(){const e=await fetch(s);return t.endsWith(".json")?await e.json():t.endsWith(".csv")?o(await e.text(),r):await e.text()};e.url=s,v[t]=e}return v})); | ||
!function(t,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s():"function"==typeof define&&define.amd?define(s):(t="undefined"!=typeof globalThis?globalThis:t||self).vegaDatasets=s()}(this,(function(){"use strict";var t={},s={},e=34,n=10,a=13;function d(t){return new Function("d","return {"+t.map((function(t,s){return JSON.stringify(t)+": d["+s+'] || ""'})).join(",")+"}")}function o(t){var s=Object.create(null),e=[];return t.forEach((function(t){for(var n in t)n in s||e.push(s[n]=n)})),e}function r(t,s){var e=t+"",n=e.length;return n<s?new Array(s-n+1).join(0)+e:e}function i(t){var s,e=t.getUTCHours(),n=t.getUTCMinutes(),a=t.getUTCSeconds(),d=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((s=t.getUTCFullYear())<0?"-"+r(-s,6):s>9999?"+"+r(s,6):r(s,4))+"-"+r(t.getUTCMonth()+1,2)+"-"+r(t.getUTCDate(),2)+(d?"T"+r(e,2)+":"+r(n,2)+":"+r(a,2)+"."+r(d,3)+"Z":a?"T"+r(e,2)+":"+r(n,2)+":"+r(a,2)+"Z":n||e?"T"+r(e,2)+":"+r(n,2)+"Z":"")}var c=function(r){var c=new RegExp('["'+r+"\n\r]"),p=r.charCodeAt(0);function v(d,o){var r,i=[],c=d.length,v=0,l=0,j=c<=0,h=!1;function u(){if(j)return s;if(h)return h=!1,t;var o,r,i=v;if(d.charCodeAt(i)===e){for(;v++<c&&d.charCodeAt(v)!==e||d.charCodeAt(++v)===e;);return(o=v)>=c?j=!0:(r=d.charCodeAt(v++))===n?h=!0:r===a&&(h=!0,d.charCodeAt(v)===n&&++v),d.slice(i+1,o-1).replace(/""/g,'"')}for(;v<c;){if((r=d.charCodeAt(o=v++))===n)h=!0;else if(r===a)h=!0,d.charCodeAt(v)===n&&++v;else if(r!==p)continue;return d.slice(i,o)}return j=!0,d.slice(i,c)}for(d.charCodeAt(c-1)===n&&--c,d.charCodeAt(c-1)===a&&--c;(r=u())!==s;){for(var m=[];r!==t&&r!==s;)m.push(r),r=u();o&&null==(m=o(m,l++))||i.push(m)}return i}function l(t,s){return t.map((function(t){return s.map((function(s){return h(t[s])})).join(r)}))}function j(t){return t.map(h).join(r)}function h(t){return null==t?"":t instanceof Date?i(t):c.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,s){var e,n,a=v(t,(function(t,a){if(e)return e(t,a-1);n=t,e=s?function(t,s){var e=d(t);return function(n,a){return s(e(n),a,t)}}(t,s):d(t)}));return a.columns=n||[],a},parseRows:v,format:function(t,s){return null==s&&(s=o(t)),[s.map(h).join(r)].concat(l(t,s)).join("\n")},formatBody:function(t,s){return null==s&&(s=o(t)),l(t,s).join("\n")},formatRows:function(t){return t.map(j).join("\n")},formatRow:j,formatValue:h}}(",").parse;function p(t){for(var s in t){var e,n,a=t[s].trim();if(a)if("true"===a)a=!0;else if("false"===a)a=!1;else if("NaN"===a)a=NaN;else if(isNaN(e=+a)){if(!(n=a.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)))continue;v&&n[4]&&!n[7]&&(a=a.replace(/-/g,"/").replace(/T/," ")),a=new Date(a)}else a=e;else a=null;t[s]=a}return t}const v=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours();var l="2.5.4",j={"annual-precip.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/annual-precip.json`,"anscombe.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/anscombe.json`,"barley.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/barley.json`,"budget.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/budget.json`,"budgets.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/budgets.json`,"burtin.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/burtin.json`,"cars.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/cars.json`,"countries.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/countries.json`,"crimea.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/crimea.json`,"driving.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/driving.json`,"earthquakes.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/earthquakes.json`,"flare-dependencies.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/flare-dependencies.json`,"flare.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/flare.json`,"flights-10k.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/flights-10k.json`,"flights-200k.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/flights-200k.json`,"flights-20k.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/flights-20k.json`,"flights-2k.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/flights-2k.json`,"flights-5k.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/flights-5k.json`,"football.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/football.json`,"gapminder.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/gapminder.json`,"income.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/income.json`,"jobs.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/jobs.json`,"londonBoroughs.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/londonBoroughs.json`,"londonCentroids.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/londonCentroids.json`,"londonTubeLines.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/londonTubeLines.json`,"miserables.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/miserables.json`,"monarchs.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/monarchs.json`,"movies.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/movies.json`,"normal-2d.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/normal-2d.json`,"obesity.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/obesity.json`,"ohlc.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/ohlc.json`,"penguins.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/penguins.json`,"platformer-terrain.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/platformer-terrain.json`,"points.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/points.json`,"political-contributions.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/political-contributions.json`,"population.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/population.json`,"udistrict.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/udistrict.json`,"unemployment-across-industries.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/unemployment-across-industries.json`,"uniform-2d.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/uniform-2d.json`,"us-10m.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/us-10m.json`,"us-state-capitals.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/us-state-capitals.json`,"volcano.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/volcano.json`,"weather.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/weather.json`,"wheat.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/wheat.json`,"world-110m.json":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/world-110m.json`,"airports.csv":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/airports.csv`,"birdstrikes.csv":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/birdstrikes.csv`,"co2-concentration.csv":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/co2-concentration.csv`,"disasters.csv":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/disasters.csv`,"flights-3m.csv":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/flights-3m.csv`,"flights-airport.csv":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/flights-airport.csv`,"gapminder-health-income.csv":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/gapminder-health-income.csv`,"github.csv":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/github.csv`,"iowa-electricity.csv":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/iowa-electricity.csv`,"la-riots.csv":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/la-riots.csv`,"lookup_groups.csv":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/lookup_groups.csv`,"lookup_people.csv":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/lookup_people.csv`,"population_engineers_hurricanes.csv":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/population_engineers_hurricanes.csv`,"seattle-weather-hourly-normals.csv":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/seattle-weather-hourly-normals.csv`,"seattle-weather.csv":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/seattle-weather.csv`,"sp500-2000.csv":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/sp500-2000.csv`,"sp500.csv":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/sp500.csv`,"stocks.csv":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/stocks.csv`,"us-employment.csv":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/us-employment.csv`,"weather.csv":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/weather.csv`,"windvectors.csv":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/windvectors.csv`,"zipcodes.csv":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/zipcodes.csv`,"unemployment.tsv":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/unemployment.tsv`,"flights-200k.arrow":`https://cdn.jsdelivr.net/npm/vega-datasets@${l}/data/flights-200k.arrow`};const h={version:l};for(const t of Object.keys(j)){const s=j[t],e=async function(){const e=await fetch(s);return t.endsWith(".json")?await e.json():t.endsWith(".csv")?c(await e.text(),p):await e.text()};e.url=s,h[t]=e}return h})); | ||
//# sourceMappingURL=vega-datasets.min.js.map |
@@ -9,3 +9,2 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { | ||
} | ||
if (info.done) { | ||
@@ -17,18 +16,14 @@ resolve(value); | ||
} | ||
function _asyncToGenerator(fn) { | ||
return function () { | ||
var self = this, | ||
args = arguments; | ||
args = arguments; | ||
return new Promise(function (resolve, reject) { | ||
var gen = fn.apply(self, args); | ||
function _next(value) { | ||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); | ||
} | ||
function _throw(err) { | ||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); | ||
} | ||
_next(undefined); | ||
@@ -49,3 +44,2 @@ }); | ||
var undefined$1; // More compressible than void 0. | ||
var $Symbol = typeof Symbol === "function" ? Symbol : {}; | ||
@@ -55,3 +49,2 @@ var iteratorSymbol = $Symbol.iterator || "@@iterator"; | ||
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; | ||
function wrap(innerFn, outerFn, self, tryLocsList) { | ||
@@ -61,8 +54,11 @@ // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. | ||
var generator = Object.create(protoGenerator.prototype); | ||
var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next, | ||
var context = new Context(tryLocsList || []); | ||
// The ._invoke method unifies the implementations of the .next, | ||
// .throw, and .return methods. | ||
generator._invoke = makeInvokeMethod(innerFn, self, context); | ||
return generator; | ||
} // Try/catch helper to minimize deoptimizations. Returns a completion | ||
} | ||
// Try/catch helper to minimize deoptimizations. Returns a completion | ||
// record like context.tryEntries[i].completion. This interface could | ||
@@ -77,4 +73,2 @@ // have been (and was previously) designed to take a closure to be | ||
// has a stable shape and so hopefully should be cheap to allocate. | ||
function tryCatch(fn, obj, arg) { | ||
@@ -93,31 +87,27 @@ try { | ||
} | ||
var GenStateSuspendedStart = "suspendedStart"; | ||
var GenStateSuspendedYield = "suspendedYield"; | ||
var GenStateExecuting = "executing"; | ||
var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as | ||
var GenStateCompleted = "completed"; | ||
// Returning this object from the innerFn has the same effect as | ||
// breaking out of the dispatch switch statement. | ||
var ContinueSentinel = {}; | ||
var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and | ||
// Dummy constructor functions that we use as the .constructor and | ||
// .constructor.prototype properties for functions that return Generator | ||
// objects. For full spec compliance, you may wish to configure your | ||
// minifier not to mangle the names of these two functions. | ||
function Generator() {} | ||
function GeneratorFunction() {} | ||
function GeneratorFunctionPrototype() {} | ||
function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that | ||
// This is a polyfill for %IteratorPrototype% for environments that | ||
// don't natively support it. | ||
var IteratorPrototype = {}; | ||
IteratorPrototype[iteratorSymbol] = function () { | ||
return this; | ||
}; | ||
var getProto = Object.getPrototypeOf; | ||
var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); | ||
if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { | ||
@@ -128,9 +118,9 @@ // This environment has a native %IteratorPrototype%; use it instead | ||
} | ||
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); | ||
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; | ||
GeneratorFunctionPrototype.constructor = GeneratorFunction; | ||
GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction"; // Helper for defining the .next, .throw, and .return methods of the | ||
GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction"; | ||
// Helper for defining the .next, .throw, and .return methods of the | ||
// Iterator interface in terms of a single ._invoke method. | ||
function defineIteratorMethods(prototype) { | ||
@@ -143,10 +133,9 @@ ["next", "throw", "return"].forEach(function (method) { | ||
} | ||
function isGeneratorFunction(genFun) { | ||
var ctor = typeof genFun === "function" && genFun.constructor; | ||
return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can | ||
return ctor ? ctor === GeneratorFunction || | ||
// For the native GeneratorFunction constructor, the best we can | ||
// do is to check its .name property. | ||
(ctor.displayName || ctor.name) === "GeneratorFunction" : false; | ||
} | ||
function mark(genFun) { | ||
@@ -157,3 +146,2 @@ if (Object.setPrototypeOf) { | ||
genFun.__proto__ = GeneratorFunctionPrototype; | ||
if (!(toStringTagSymbol in genFun)) { | ||
@@ -163,10 +151,10 @@ genFun[toStringTagSymbol] = "GeneratorFunction"; | ||
} | ||
genFun.prototype = Object.create(Gp); | ||
return genFun; | ||
} | ||
// Within the body of any async function, `await x` is transformed to | ||
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test | ||
// `hasOwn.call(value, "__await")` to determine if the yielded value is | ||
// meant to be awaited. | ||
function awrap(arg) { | ||
@@ -177,7 +165,5 @@ return { | ||
} | ||
function AsyncIterator(generator, PromiseImpl) { | ||
function invoke(method, arg, resolve, reject) { | ||
var record = tryCatch(generator[method], generator, arg); | ||
if (record.type === "throw") { | ||
@@ -188,3 +174,2 @@ reject(record.arg); | ||
var value = result.value; | ||
if (value && typeof value === "object" && hasOwn.call(value, "__await")) { | ||
@@ -197,3 +182,2 @@ return PromiseImpl.resolve(value.__await).then(function (value) { | ||
} | ||
return PromiseImpl.resolve(value).then(function (unwrapped) { | ||
@@ -212,5 +196,3 @@ // When a yielded Promise is resolved, its final value becomes | ||
} | ||
var previousPromise; | ||
function enqueue(method, arg) { | ||
@@ -222,4 +204,4 @@ function callInvokeWithMethodAndArg() { | ||
} | ||
return previousPromise = // If enqueue has been called before, then we want to wait until | ||
return previousPromise = | ||
// If enqueue has been called before, then we want to wait until | ||
// all previous Promises have been resolved before calling invoke, | ||
@@ -236,21 +218,20 @@ // so that results are always delivered in the correct order. If | ||
// important to get this right, even though it requires care. | ||
previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later | ||
previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, | ||
// Avoid propagating failures to Promises returned by later | ||
// invocations of the iterator. | ||
callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); | ||
} // Define the unified helper method that is used to implement .next, | ||
} | ||
// Define the unified helper method that is used to implement .next, | ||
// .throw, and .return (see defineIteratorMethods). | ||
this._invoke = enqueue; | ||
} | ||
defineIteratorMethods(AsyncIterator.prototype); | ||
AsyncIterator.prototype[asyncIteratorSymbol] = function () { | ||
return this; | ||
}; // Note that simple async functions are implemented on top of | ||
}; | ||
// Note that simple async functions are implemented on top of | ||
// AsyncIterator objects; they just return a Promise for the value of | ||
// the final result produced by the iterator. | ||
function async(innerFn, outerFn, self, tryLocsList, PromiseImpl) { | ||
@@ -264,3 +245,2 @@ if (PromiseImpl === void 0) PromiseImpl = Promise; | ||
} | ||
function makeInvokeMethod(innerFn, self, context) { | ||
@@ -272,22 +252,17 @@ var state = GenStateSuspendedStart; | ||
} | ||
if (state === GenStateCompleted) { | ||
if (method === "throw") { | ||
throw arg; | ||
} // Be forgiving, per 25.3.3.3.3 of the spec: | ||
} | ||
// Be forgiving, per 25.3.3.3.3 of the spec: | ||
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume | ||
return doneResult(); | ||
} | ||
context.method = method; | ||
context.arg = arg; | ||
while (true) { | ||
var delegate = context.delegate; | ||
if (delegate) { | ||
var delegateResult = maybeInvokeDelegate(delegate, context); | ||
if (delegateResult) { | ||
@@ -298,3 +273,2 @@ if (delegateResult === ContinueSentinel) continue; | ||
} | ||
if (context.method === "next") { | ||
@@ -309,3 +283,2 @@ // Setting context._sent for legacy support of Babel's | ||
} | ||
context.dispatchException(context.arg); | ||
@@ -315,6 +288,4 @@ } else if (context.method === "return") { | ||
} | ||
state = GenStateExecuting; | ||
var record = tryCatch(innerFn, self, context); | ||
if (record.type === "normal") { | ||
@@ -324,7 +295,5 @@ // If an exception is thrown from innerFn, we leave state === | ||
state = context.done ? GenStateCompleted : GenStateSuspendedYield; | ||
if (record.arg === ContinueSentinel) { | ||
continue; | ||
} | ||
return { | ||
@@ -335,5 +304,5 @@ value: record.arg, | ||
} else if (record.type === "throw") { | ||
state = GenStateCompleted; // Dispatch the exception by looping back around to the | ||
state = GenStateCompleted; | ||
// Dispatch the exception by looping back around to the | ||
// context.dispatchException(context.arg) call above. | ||
context.method = "throw"; | ||
@@ -344,11 +313,10 @@ context.arg = record.arg; | ||
}; | ||
} // Call delegate.iterator[context.method](context.arg) and handle the | ||
} | ||
// Call delegate.iterator[context.method](context.arg) and handle the | ||
// result, either by returning a { value, done } result from the | ||
// delegate iterator, or by modifying context.method and context.arg, | ||
// setting context.delegate to null, and returning the ContinueSentinel. | ||
function maybeInvokeDelegate(delegate, context) { | ||
var method = delegate.iterator[context.method]; | ||
if (method === undefined$1) { | ||
@@ -358,3 +326,2 @@ // A .throw or .return when the delegate iterator has no .throw | ||
context.delegate = null; | ||
if (context.method === "throw") { | ||
@@ -368,3 +335,2 @@ // Note: ["return"] must be used for ES3 parsing compatibility. | ||
maybeInvokeDelegate(delegate, context); | ||
if (context.method === "throw") { | ||
@@ -376,12 +342,8 @@ // If maybeInvokeDelegate(context) changed context.method from | ||
} | ||
context.method = "throw"; | ||
context.arg = new TypeError("The iterator does not provide a 'throw' method"); | ||
} | ||
return ContinueSentinel; | ||
} | ||
var record = tryCatch(method, delegate.iterator, context.arg); | ||
if (record.type === "throw") { | ||
@@ -393,5 +355,3 @@ context.method = "throw"; | ||
} | ||
var info = record.arg; | ||
if (!info) { | ||
@@ -403,9 +363,11 @@ context.method = "throw"; | ||
} | ||
if (info.done) { | ||
// Assign the result of the finished delegate to the temporary | ||
// variable specified by delegate.resultName (see delegateYield). | ||
context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield). | ||
context[delegate.resultName] = info.value; | ||
context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the | ||
// Resume execution at the desired location (see delegateYield). | ||
context.next = delegate.nextLoc; | ||
// If context.method was "throw" but the delegate handled the | ||
// exception, let the outer generator proceed normally. If | ||
@@ -416,3 +378,2 @@ // context.method was "next", forget context.arg since it has been | ||
// outer generator. | ||
if (context.method !== "return") { | ||
@@ -425,14 +386,16 @@ context.method = "next"; | ||
return info; | ||
} // The delegate iterator is finished, so forget it and continue with | ||
} | ||
// The delegate iterator is finished, so forget it and continue with | ||
// the outer generator. | ||
context.delegate = null; | ||
return ContinueSentinel; | ||
} // Define Generator.prototype.{next,throw,return} in terms of the | ||
} | ||
// Define Generator.prototype.{next,throw,return} in terms of the | ||
// unified ._invoke helper method. | ||
defineIteratorMethods(Gp); | ||
Gp[toStringTagSymbol] = "Generator"; | ||
defineIteratorMethods(Gp); | ||
Gp[toStringTagSymbol] = "Generator"; // A Generator should always return itself as the iterator object when the | ||
// A Generator should always return itself as the iterator object when the | ||
// @@iterator function is called on it. Some browsers' implementations of the | ||
@@ -442,11 +405,8 @@ // iterator prototype chain incorrectly implement this, causing the Generator | ||
// See https://github.com/facebook/regenerator/issues/274 for more details. | ||
Gp[iteratorSymbol] = function () { | ||
return this; | ||
}; | ||
Gp.toString = function () { | ||
return "[object Generator]"; | ||
}; | ||
function pushTryEntry(locs) { | ||
@@ -456,7 +416,5 @@ var entry = { | ||
}; | ||
if (1 in locs) { | ||
entry.catchLoc = locs[1]; | ||
} | ||
if (2 in locs) { | ||
@@ -466,6 +424,4 @@ entry.finallyLoc = locs[2]; | ||
} | ||
this.tryEntries.push(entry); | ||
} | ||
function resetTryEntry(entry) { | ||
@@ -477,3 +433,2 @@ var record = entry.completion || {}; | ||
} | ||
function Context(tryLocsList) { | ||
@@ -489,17 +444,14 @@ // The root entry object (effectively a try statement without a catch | ||
} | ||
function keys(object) { | ||
var keys = []; | ||
for (var key in object) { | ||
keys.push(key); | ||
} | ||
keys.reverse(); | ||
keys.reverse(); // Rather than returning an object with a next method, we keep | ||
// Rather than returning an object with a next method, we keep | ||
// things simple and return the next function itself. | ||
return function next() { | ||
while (keys.length) { | ||
var key = keys.pop(); | ||
if (key in object) { | ||
@@ -510,7 +462,7 @@ next.value = key; | ||
} | ||
} // To avoid creating an additional object, we just hang the .value | ||
} | ||
// To avoid creating an additional object, we just hang the .value | ||
// and .done properties off the next function object itself. This | ||
// also ensures that the minifier will not anonymize the function. | ||
next.done = true; | ||
@@ -520,36 +472,30 @@ return next; | ||
} | ||
function values(iterable) { | ||
if (iterable) { | ||
var iteratorMethod = iterable[iteratorSymbol]; | ||
if (iteratorMethod) { | ||
return iteratorMethod.call(iterable); | ||
} | ||
if (typeof iterable.next === "function") { | ||
return iterable; | ||
} | ||
if (!isNaN(iterable.length)) { | ||
var i = -1, | ||
next = function next() { | ||
while (++i < iterable.length) { | ||
if (hasOwn.call(iterable, i)) { | ||
next.value = iterable[i]; | ||
next.done = false; | ||
return next; | ||
next = function next() { | ||
while (++i < iterable.length) { | ||
if (hasOwn.call(iterable, i)) { | ||
next.value = iterable[i]; | ||
next.done = false; | ||
return next; | ||
} | ||
} | ||
} | ||
next.value = undefined$1; | ||
next.done = true; | ||
return next; | ||
}; | ||
next.value = undefined$1; | ||
next.done = true; | ||
return next; | ||
}; | ||
return next.next = next; | ||
} | ||
} // Return an iterator with no values. | ||
} | ||
// Return an iterator with no values. | ||
return { | ||
@@ -559,3 +505,2 @@ next: doneResult | ||
} | ||
function doneResult() { | ||
@@ -567,3 +512,2 @@ return { | ||
} | ||
Context.prototype = { | ||
@@ -573,5 +517,5 @@ constructor: Context, | ||
this.prev = 0; | ||
this.next = 0; // Resetting context._sent for legacy support of Babel's | ||
this.next = 0; | ||
// Resetting context._sent for legacy support of Babel's | ||
// function.sent implementation. | ||
this.sent = this._sent = undefined$1; | ||
@@ -583,3 +527,2 @@ this.done = false; | ||
this.tryEntries.forEach(resetTryEntry); | ||
if (!skipTempReset) { | ||
@@ -598,7 +541,5 @@ for (var name in this) { | ||
var rootRecord = rootEntry.completion; | ||
if (rootRecord.type === "throw") { | ||
throw rootRecord.arg; | ||
} | ||
return this.rval; | ||
@@ -610,5 +551,3 @@ }, | ||
} | ||
var context = this; | ||
function handle(loc, caught) { | ||
@@ -618,3 +557,2 @@ record.type = "throw"; | ||
context.next = loc; | ||
if (caught) { | ||
@@ -626,10 +564,7 @@ // If the dispatched exception was caught by a catch block, | ||
} | ||
return !!caught; | ||
} | ||
for (var i = this.tryEntries.length - 1; i >= 0; --i) { | ||
var entry = this.tryEntries[i]; | ||
var record = entry.completion; | ||
if (entry.tryLoc === "root") { | ||
@@ -641,7 +576,5 @@ // Exception thrown outside of any try block that could handle | ||
} | ||
if (entry.tryLoc <= this.prev) { | ||
var hasCatch = hasOwn.call(entry, "catchLoc"); | ||
var hasFinally = hasOwn.call(entry, "finallyLoc"); | ||
if (hasCatch && hasFinally) { | ||
@@ -670,3 +603,2 @@ if (this.prev < entry.catchLoc) { | ||
var entry = this.tryEntries[i]; | ||
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { | ||
@@ -677,3 +609,2 @@ var finallyEntry = entry; | ||
} | ||
if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) { | ||
@@ -684,7 +615,5 @@ // Ignore the finally entry if control is not jumping to a | ||
} | ||
var record = finallyEntry ? finallyEntry.completion : {}; | ||
record.type = type; | ||
record.arg = arg; | ||
if (finallyEntry) { | ||
@@ -695,3 +624,2 @@ this.method = "next"; | ||
} | ||
return this.complete(record); | ||
@@ -703,3 +631,2 @@ }, | ||
} | ||
if (record.type === "break" || record.type === "continue") { | ||
@@ -714,3 +641,2 @@ this.next = record.arg; | ||
} | ||
return ContinueSentinel; | ||
@@ -721,3 +647,2 @@ }, | ||
var entry = this.tryEntries[i]; | ||
if (entry.finallyLoc === finallyLoc) { | ||
@@ -733,6 +658,4 @@ this.complete(entry.completion, entry.afterLoc); | ||
var entry = this.tryEntries[i]; | ||
if (entry.tryLoc === tryLoc) { | ||
var record = entry.completion; | ||
if (record.type === "throw") { | ||
@@ -742,9 +665,8 @@ var thrown = record.arg; | ||
} | ||
return thrown; | ||
} | ||
} // The context.catch method must only be called with a location | ||
} | ||
// The context.catch method must only be called with a location | ||
// argument that corresponds to a known catch block. | ||
throw new Error("illegal catch attempt"); | ||
@@ -758,3 +680,2 @@ }, | ||
}; | ||
if (this.method === "next") { | ||
@@ -765,7 +686,7 @@ // Deliberately forget the last sent value so that we don't | ||
} | ||
return ContinueSentinel; | ||
} | ||
}; // Export a default namespace that plays well with Rollup | ||
}; | ||
// Export a default namespace that plays well with Rollup | ||
var _regeneratorRuntime = { | ||
@@ -783,7 +704,6 @@ wrap, | ||
var EOL = {}, | ||
EOF = {}, | ||
QUOTE = 34, | ||
NEWLINE = 10, | ||
RETURN = 13; | ||
EOF = {}, | ||
QUOTE = 34, | ||
NEWLINE = 10, | ||
RETURN = 13; | ||
function objectConverter(columns) { | ||
@@ -794,3 +714,2 @@ return new Function("d", "return {" + columns.map(function (name, i) { | ||
} | ||
function customConverter(columns, f) { | ||
@@ -801,8 +720,8 @@ var object = objectConverter(columns); | ||
}; | ||
} // Compute unique columns in order of discovery. | ||
} | ||
// Compute unique columns in order of discovery. | ||
function inferColumns(rows) { | ||
var columnSet = Object.create(null), | ||
columns = []; | ||
columns = []; | ||
rows.forEach(function (row) { | ||
@@ -817,66 +736,57 @@ for (var column in row) { | ||
} | ||
function pad(value, width) { | ||
var s = value + "", | ||
length = s.length; | ||
length = s.length; | ||
return length < width ? new Array(width - length + 1).join(0) + s : s; | ||
} | ||
function formatYear(year) { | ||
return year < 0 ? "-" + pad(-year, 6) : year > 9999 ? "+" + pad(year, 6) : pad(year, 4); | ||
} | ||
function formatDate(date) { | ||
var hours = date.getUTCHours(), | ||
minutes = date.getUTCMinutes(), | ||
seconds = date.getUTCSeconds(), | ||
milliseconds = date.getUTCMilliseconds(); | ||
minutes = date.getUTCMinutes(), | ||
seconds = date.getUTCSeconds(), | ||
milliseconds = date.getUTCMilliseconds(); | ||
return isNaN(date) ? "Invalid Date" : formatYear(date.getUTCFullYear()) + "-" + pad(date.getUTCMonth() + 1, 2) + "-" + pad(date.getUTCDate(), 2) + (milliseconds ? "T" + pad(hours, 2) + ":" + pad(minutes, 2) + ":" + pad(seconds, 2) + "." + pad(milliseconds, 3) + "Z" : seconds ? "T" + pad(hours, 2) + ":" + pad(minutes, 2) + ":" + pad(seconds, 2) + "Z" : minutes || hours ? "T" + pad(hours, 2) + ":" + pad(minutes, 2) + "Z" : ""); | ||
} | ||
function dsv (delimiter) { | ||
var reFormat = new RegExp("[\"" + delimiter + "\n\r]"), | ||
DELIMITER = delimiter.charCodeAt(0); | ||
DELIMITER = delimiter.charCodeAt(0); | ||
function parse(text, f) { | ||
var convert, | ||
columns, | ||
rows = parseRows(text, function (row, i) { | ||
if (convert) return convert(row, i - 1); | ||
columns = row, convert = f ? customConverter(row, f) : objectConverter(row); | ||
}); | ||
columns, | ||
rows = parseRows(text, function (row, i) { | ||
if (convert) return convert(row, i - 1); | ||
columns = row, convert = f ? customConverter(row, f) : objectConverter(row); | ||
}); | ||
rows.columns = columns || []; | ||
return rows; | ||
} | ||
function parseRows(text, f) { | ||
var rows = [], | ||
// output rows | ||
N = text.length, | ||
I = 0, | ||
// current character index | ||
n = 0, | ||
// current line number | ||
t, | ||
// current token | ||
eof = N <= 0, | ||
// current token followed by EOF? | ||
eol = false; // current token followed by EOL? | ||
// output rows | ||
N = text.length, | ||
I = 0, | ||
// current character index | ||
n = 0, | ||
// current line number | ||
t, | ||
// current token | ||
eof = N <= 0, | ||
// current token followed by EOF? | ||
eol = false; // current token followed by EOL? | ||
// Strip the trailing newline. | ||
if (text.charCodeAt(N - 1) === NEWLINE) --N; | ||
if (text.charCodeAt(N - 1) === RETURN) --N; | ||
function token() { | ||
if (eof) return EOF; | ||
if (eol) return eol = false, EOL; // Unescape quotes. | ||
if (eol) return eol = false, EOL; | ||
// Unescape quotes. | ||
var i, | ||
j = I, | ||
c; | ||
j = I, | ||
c; | ||
if (text.charCodeAt(j) === QUOTE) { | ||
while (I++ < N && text.charCodeAt(I) !== QUOTE || text.charCodeAt(++I) === QUOTE) { | ||
} | ||
while (I++ < N && text.charCodeAt(I) !== QUOTE || text.charCodeAt(++I) === QUOTE); | ||
if ((i = I) >= N) eof = true;else if ((c = text.charCodeAt(I++)) === NEWLINE) eol = true;else if (c === RETURN) { | ||
@@ -887,5 +797,5 @@ eol = true; | ||
return text.slice(j + 1, i - 1).replace(/""/g, "\""); | ||
} // Find next delimiter or newline. | ||
} | ||
// Find next delimiter or newline. | ||
while (I < N) { | ||
@@ -897,22 +807,15 @@ if ((c = text.charCodeAt(i = I++)) === NEWLINE) eol = true;else if (c === RETURN) { | ||
return text.slice(j, i); | ||
} // Return last token before EOF. | ||
} | ||
// Return last token before EOF. | ||
return eof = true, text.slice(j, N); | ||
} | ||
while ((t = token()) !== EOF) { | ||
var row = []; | ||
while (t !== EOL && t !== EOF) { | ||
row.push(t), t = token(); | ||
} | ||
while (t !== EOL && t !== EOF) row.push(t), t = token(); | ||
if (f && (row = f(row, n++)) == null) continue; | ||
rows.push(row); | ||
} | ||
return rows; | ||
} | ||
function preformatBody(rows, columns) { | ||
@@ -925,3 +828,2 @@ return rows.map(function (row) { | ||
} | ||
function format(rows, columns) { | ||
@@ -931,3 +833,2 @@ if (columns == null) columns = inferColumns(rows); | ||
} | ||
function formatBody(rows, columns) { | ||
@@ -937,15 +838,11 @@ if (columns == null) columns = inferColumns(rows); | ||
} | ||
function formatRows(rows) { | ||
return rows.map(formatRow).join("\n"); | ||
} | ||
function formatRow(row) { | ||
return row.map(formatValue).join(delimiter); | ||
} | ||
function formatValue(value) { | ||
return value == null ? "" : value instanceof Date ? formatDate(value) : reFormat.test(value += "") ? "\"" + value.replace(/"/g, "\"\"") + "\"" : value; | ||
} | ||
return { | ||
@@ -983,4 +880,4 @@ parse: parse, | ||
var value = object[key].trim(), | ||
number, | ||
m; | ||
number, | ||
m; | ||
if (!value) value = null;else if (value === "true") value = true;else if (value === "false") value = false;else if (value === "NaN") value = NaN;else if (!isNaN(number = +value)) value = number;else if (m = value.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)) { | ||
@@ -992,6 +889,6 @@ if (fixtz && !!m[4] && !m[7]) value = value.replace(/-/g, "/").replace(/T/, " "); | ||
} | ||
return object; | ||
} // https://github.com/d3/d3-dsv/issues/45 | ||
} | ||
// https://github.com/d3/d3-dsv/issues/45 | ||
var fixtz = new Date("2019-01-01T00:00").getHours() || new Date("2019-07-01T00:00").getHours(); | ||
@@ -1001,21 +898,21 @@ | ||
__proto__: null, | ||
dsvFormat: dsv, | ||
csvParse: csvParse, | ||
csvParseRows: csvParseRows, | ||
autoType: autoType, | ||
csvFormat: csvFormat, | ||
csvFormatBody: csvFormatBody, | ||
csvFormatRow: csvFormatRow, | ||
csvFormatRows: csvFormatRows, | ||
csvFormatRow: csvFormatRow, | ||
csvFormatValue: csvFormatValue, | ||
tsvParse: tsvParse, | ||
tsvParseRows: tsvParseRows, | ||
csvParse: csvParse, | ||
csvParseRows: csvParseRows, | ||
dsvFormat: dsv, | ||
tsvFormat: tsvFormat, | ||
tsvFormatBody: tsvFormatBody, | ||
tsvFormatRow: tsvFormatRow, | ||
tsvFormatRows: tsvFormatRows, | ||
tsvFormatRow: tsvFormatRow, | ||
tsvFormatValue: tsvFormatValue, | ||
autoType: autoType | ||
tsvParse: tsvParse, | ||
tsvParseRows: tsvParseRows | ||
}); | ||
var version = "2.5.2"; | ||
var version = "2.5.4"; | ||
@@ -1097,7 +994,5 @@ var urls = { | ||
}; | ||
var _loop = function _loop() { | ||
var name = _arr[_i]; | ||
var url = urls[name]; | ||
var f = /*#__PURE__*/function () { | ||
@@ -1107,52 +1002,39 @@ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() { | ||
return _regeneratorRuntime.wrap(function _callee$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
_context.next = 2; | ||
return fetch(url); | ||
case 2: | ||
result = _context.sent; | ||
if (!name.endsWith(".json")) { | ||
_context.next = 9; | ||
break; | ||
} | ||
_context.next = 6; | ||
return result.json(); | ||
case 6: | ||
return _context.abrupt("return", _context.sent); | ||
case 9: | ||
if (!name.endsWith(".csv")) { | ||
_context.next = 18; | ||
break; | ||
} | ||
_context.t0 = d3; | ||
_context.next = 13; | ||
return result.text(); | ||
case 13: | ||
_context.t1 = _context.sent; | ||
_context.t2 = autoType; | ||
return _context.abrupt("return", _context.t0.csvParse.call(_context.t0, _context.t1, _context.t2)); | ||
case 18: | ||
_context.next = 20; | ||
return result.text(); | ||
case 20: | ||
return _context.abrupt("return", _context.sent); | ||
case 21: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
while (1) switch (_context.prev = _context.next) { | ||
case 0: | ||
_context.next = 2; | ||
return fetch(url); | ||
case 2: | ||
result = _context.sent; | ||
if (!name.endsWith(".json")) { | ||
_context.next = 9; | ||
break; | ||
} | ||
_context.next = 6; | ||
return result.json(); | ||
case 6: | ||
return _context.abrupt("return", _context.sent); | ||
case 9: | ||
if (!name.endsWith(".csv")) { | ||
_context.next = 18; | ||
break; | ||
} | ||
_context.t0 = d3; | ||
_context.next = 13; | ||
return result.text(); | ||
case 13: | ||
_context.t1 = _context.sent; | ||
_context.t2 = autoType; | ||
return _context.abrupt("return", _context.t0.csvParse.call(_context.t0, _context.t1, _context.t2)); | ||
case 18: | ||
_context.next = 20; | ||
return result.text(); | ||
case 20: | ||
return _context.abrupt("return", _context.sent); | ||
case 21: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
}, _callee); | ||
})); | ||
return function f() { | ||
@@ -1162,7 +1044,5 @@ return _ref.apply(this, arguments); | ||
}(); | ||
f.url = url; | ||
data[name] = f; | ||
}; | ||
for (var _i = 0, _arr = Object.keys(urls); _i < _arr.length; _i++) { | ||
@@ -1169,0 +1049,0 @@ _loop(); |
{ | ||
"name": "vega-datasets", | ||
"version": "2.5.3", | ||
"version": "2.5.4", | ||
"description": "Common repository for example datasets used by Vega related projects.", | ||
@@ -25,21 +25,20 @@ "license": "BSD-3-Clause", | ||
"devDependencies": { | ||
"@auto-it/conventional-commits": "^10.37.6", | ||
"@auto-it/first-time-contributor": "^10.37.6", | ||
"@babel/core": "^7.19.3", | ||
"@babel/plugin-transform-runtime": "^7.19.1", | ||
"@babel/preset-env": "^7.19.3", | ||
"@babel/core": "^7.20.12", | ||
"@babel/plugin-transform-runtime": "^7.19.6", | ||
"@babel/preset-env": "^7.20.2", | ||
"@babel/preset-typescript": "^7.18.6", | ||
"@babel/runtime": "^7.19.0", | ||
"@rollup/plugin-json": "^4.1.0", | ||
"@rollup/plugin-node-resolve": "^14.1.0", | ||
"@types/d3-dsv": "^3.0.0", | ||
"auto": "^10.37.6", | ||
"@babel/runtime": "^7.20.13", | ||
"@release-it/conventional-changelog": "^5.1.1", | ||
"@rollup/plugin-json": "^6.0.0", | ||
"@rollup/plugin-node-resolve": "^15.0.1", | ||
"@types/d3-dsv": "^3.0.1", | ||
"d3-dsv": "^3.0.1", | ||
"datalib": "^1.9.3", | ||
"rollup": "^2.79.1", | ||
"release-it": "^15.6.0", | ||
"rollup": "^3.15.0", | ||
"rollup-plugin-bundle-size": "^1.0.3", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"rollup-plugin-ts": "^3.0.2", | ||
"terser": "^5.15.0", | ||
"typescript": "^4.8.4" | ||
"rollup-plugin-ts": "^3.2.0", | ||
"terser": "^5.16.3", | ||
"typescript": "^4.9.5" | ||
}, | ||
@@ -51,4 +50,4 @@ "scripts": { | ||
"github": "python scripts/github.py", | ||
"release": "yarn build && auto shipit" | ||
"release": "release-it" | ||
} | ||
} |
@@ -65,9 +65,4 @@ # Vega Datasets | ||
## Release Process | ||
## Release process | ||
Publishing is handled by a 2-branch [pre-release process](https://intuit.github.io/auto/docs/generated/shipit#next-branch-default), configured in `publish.yml`. All changes should be based off the default `next` branch, and are published automatically. | ||
- PRs made into the default branch that [would trigger a version bump](https://intuit.github.io/auto/docs/generated/conventional-commits) are auto-deployed to the `next` pre-release tag on NPM. The result can be installed with `npm install vega-datasets/@next`. | ||
- When merging into `next`, please use the `squash and merge` strategy. | ||
- To release a new stable version, open a PR from `next` into `stable` using this [compare link](https://github.com/vega/vega-datasets/compare/stable...next). | ||
- When merging from `next` into `stable`, please use the `create a merge commit` strategy. | ||
To make a release, run `npm run release`. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18
241531
35303750
68