Bar graph added.

This commit is contained in:
prabhatdev
2020-07-28 00:48:25 +05:30
parent d0a6e2667d
commit 194b41124d
3468 changed files with 640611 additions and 169 deletions

239
node_modules/vega-format/build/vega-format.js generated vendored Normal file
View File

@@ -0,0 +1,239 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-array'), require('d3-format'), require('vega-time'), require('vega-util'), require('d3-time-format')) :
typeof define === 'function' && define.amd ? define(['exports', 'd3-array', 'd3-format', 'vega-time', 'vega-util', 'd3-time-format'], factory) :
(global = global || self, factory(global.vega = {}, global.d3, global.d3, global.vega, global.vega, global.d3));
}(this, (function (exports, d3Array, d3Format, vegaTime, vegaUtil, d3TimeFormat) { 'use strict';
function memoize(method) {
const cache = {};
return spec => cache[spec] || (cache[spec] = method(spec));
}
function trimZeroes(numberFormat, decimalChar) {
return x => {
var str = numberFormat(x),
dec = str.indexOf(decimalChar),
idx, end;
if (dec < 0) return str;
idx = rightmostDigit(str, dec);
end = idx < str.length ? str.slice(idx) : '';
while (--idx > dec) if (str[idx] !== '0') { ++idx; break; }
return str.slice(0, idx) + end;
};
}
function rightmostDigit(str, dec) {
var i = str.lastIndexOf('e'), c;
if (i > 0) return i;
for (i=str.length; --i > dec;) {
c = str.charCodeAt(i);
if (c >= 48 && c <= 57) return i + 1; // is digit
}
}
function numberLocale(locale) {
const format = memoize(locale.format),
formatPrefix = locale.formatPrefix;
return {
format,
formatPrefix,
formatFloat(spec) {
var s = d3Format.formatSpecifier(spec || ',');
if (s.precision == null) {
s.precision = 12;
switch (s.type) {
case '%': s.precision -= 2; break;
case 'e': s.precision -= 1; break;
}
return trimZeroes(
format(s), // number format
format('.1f')(1)[1] // decimal point character
);
} else {
return format(s);
}
},
formatSpan(start, stop, count, specifier) {
specifier = d3Format.formatSpecifier(specifier == null ? ',f' : specifier);
const step = d3Array.tickStep(start, stop, count),
value = Math.max(Math.abs(start), Math.abs(stop));
let precision;
if (specifier.precision == null) {
switch (specifier.type) {
case 's': {
if (!isNaN(precision = d3Format.precisionPrefix(step, value))) {
specifier.precision = precision;
}
return formatPrefix(specifier, value);
}
case '':
case 'e':
case 'g':
case 'p':
case 'r': {
if (!isNaN(precision = d3Format.precisionRound(step, value))) {
specifier.precision = precision - (specifier.type === 'e');
}
break;
}
case 'f':
case '%': {
if (!isNaN(precision = d3Format.precisionFixed(step))) {
specifier.precision = precision - (specifier.type === '%') * 2;
}
break;
}
}
}
return format(specifier);
}
};
}
let defaultNumberLocale;
resetNumberFormatDefaultLocale();
function resetNumberFormatDefaultLocale() {
return defaultNumberLocale = numberLocale({
format: d3Format.format,
formatPrefix: d3Format.formatPrefix
});
}
function numberFormatLocale(definition) {
return numberLocale(d3Format.formatLocale(definition));
}
function numberFormatDefaultLocale(definition) {
return arguments.length
? (defaultNumberLocale = numberFormatLocale(definition))
: defaultNumberLocale;
}
function timeMultiFormat(format, interval, spec) {
spec = spec || {};
if (!vegaUtil.isObject(spec)) {
vegaUtil.error(`Invalid time multi-format specifier: ${spec}`);
}
const second = interval(vegaTime.SECONDS),
minute = interval(vegaTime.MINUTES),
hour = interval(vegaTime.HOURS),
day = interval(vegaTime.DATE),
week = interval(vegaTime.WEEK),
month = interval(vegaTime.MONTH),
quarter = interval(vegaTime.QUARTER),
year = interval(vegaTime.YEAR),
L = format(spec[vegaTime.MILLISECONDS] || '.%L'),
S = format(spec[vegaTime.SECONDS] || ':%S'),
M = format(spec[vegaTime.MINUTES] || '%I:%M'),
H = format(spec[vegaTime.HOURS] || '%I %p'),
d = format(spec[vegaTime.DATE] || spec[vegaTime.DAY] || '%a %d'),
w = format(spec[vegaTime.WEEK] || '%b %d'),
m = format(spec[vegaTime.MONTH] || '%B'),
q = format(spec[vegaTime.QUARTER] || '%B'),
y = format(spec[vegaTime.YEAR] || '%Y');
return date => (
second(date) < date ? L :
minute(date) < date ? S :
hour(date) < date ? M :
day(date) < date ? H :
month(date) < date ? (week(date) < date ? d : w) :
year(date) < date ? (quarter(date) < date ? m : q) :
y)(date);
}
function timeLocale(locale) {
const timeFormat = memoize(locale.format),
utcFormat = memoize(locale.utcFormat);
return {
timeFormat: spec => vegaUtil.isString(spec)
? timeFormat(spec)
: timeMultiFormat(timeFormat, vegaTime.timeInterval, spec),
utcFormat: spec => vegaUtil.isString(spec)
? utcFormat(spec)
: timeMultiFormat(utcFormat, vegaTime.utcInterval, spec),
timeParse: memoize(locale.parse),
utcParse: memoize(locale.utcParse)
};
}
let defaultTimeLocale;
resetTimeFormatDefaultLocale();
function resetTimeFormatDefaultLocale() {
return defaultTimeLocale = timeLocale({
format: d3TimeFormat.timeFormat,
parse: d3TimeFormat.timeParse,
utcFormat: d3TimeFormat.utcFormat,
utcParse: d3TimeFormat.utcParse
});
}
function timeFormatLocale(definition) {
return timeLocale(d3TimeFormat.timeFormatLocale(definition));
}
function timeFormatDefaultLocale(definition) {
return arguments.length
? (defaultTimeLocale = timeFormatLocale(definition))
: defaultTimeLocale;
}
const createLocale = (number, time) => vegaUtil.extend({}, number, time);
function locale(numberSpec, timeSpec) {
const number = numberSpec
? numberFormatLocale(numberSpec)
: numberFormatDefaultLocale();
const time = timeSpec
? timeFormatLocale(timeSpec)
: timeFormatDefaultLocale();
return createLocale(number, time);
}
function defaultLocale(numberSpec, timeSpec) {
const args = arguments.length;
if (args && args !== 2) {
vegaUtil.error('defaultLocale expects either zero or two arguments.');
}
return args
? createLocale(
numberFormatDefaultLocale(numberSpec),
timeFormatDefaultLocale(timeSpec)
)
: createLocale(
numberFormatDefaultLocale(),
timeFormatDefaultLocale()
);
}
function resetDefaultLocale() {
resetNumberFormatDefaultLocale();
resetTimeFormatDefaultLocale();
return defaultLocale();
}
exports.defaultLocale = defaultLocale;
exports.locale = locale;
exports.numberFormatDefaultLocale = numberFormatDefaultLocale;
exports.numberFormatLocale = numberFormatLocale;
exports.resetDefaultLocale = resetDefaultLocale;
exports.resetNumberFormatDefaultLocale = resetNumberFormatDefaultLocale;
exports.resetTimeFormatDefaultLocale = resetTimeFormatDefaultLocale;
exports.timeFormatDefaultLocale = timeFormatDefaultLocale;
exports.timeFormatLocale = timeFormatLocale;
Object.defineProperty(exports, '__esModule', { value: true });
})));

1
node_modules/vega-format/build/vega-format.min.js generated vendored Normal file
View File

@@ -0,0 +1 @@
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("d3-array"),require("d3-format"),require("vega-time"),require("vega-util"),require("d3-time-format")):"function"==typeof define&&define.amd?define(["exports","d3-array","d3-format","vega-time","vega-util","d3-time-format"],t):t((e=e||self).vega={},e.d3,e.d3,e.vega,e.vega,e.d3)}(this,(function(e,t,r,a,i,n){"use strict";function o(e){const t={};return r=>t[r]||(t[r]=e(r))}function c(e){const a=o(e.format),i=e.formatPrefix;return{format:a,formatPrefix:i,formatFloat(e){var t,i,n=r.formatSpecifier(e||",");if(null==n.precision){switch(n.precision=12,n.type){case"%":n.precision-=2;break;case"e":n.precision-=1}return t=a(n),i=a(".1f")(1)[1],e=>{var r,a,n=t(e),o=n.indexOf(i);if(o<0)return n;for(a=(r=function(e,t){var r,a=e.lastIndexOf("e");if(a>0)return a;for(a=e.length;--a>t;)if((r=e.charCodeAt(a))>=48&&r<=57)return a+1}(n,o))<n.length?n.slice(r):"";--r>o;)if("0"!==n[r]){++r;break}return n.slice(0,r)+a}}return a(n)},formatSpan(e,n,o,c){c=r.formatSpecifier(null==c?",f":c);const u=t.tickStep(e,n,o),f=Math.max(Math.abs(e),Math.abs(n));let s;if(null==c.precision)switch(c.type){case"s":return isNaN(s=r.precisionPrefix(u,f))||(c.precision=s),i(c,f);case"":case"e":case"g":case"p":case"r":isNaN(s=r.precisionRound(u,f))||(c.precision=s-("e"===c.type));break;case"f":case"%":isNaN(s=r.precisionFixed(u))||(c.precision=s-2*("%"===c.type))}return a(c)}}}let u,f;function s(){return u=c({format:r.format,formatPrefix:r.formatPrefix})}function m(e){return c(r.formatLocale(e))}function l(e){return arguments.length?u=m(e):u}function p(e,t,r){r=r||{},i.isObject(r)||i.error("Invalid time multi-format specifier: "+r);const n=t(a.SECONDS),o=t(a.MINUTES),c=t(a.HOURS),u=t(a.DATE),f=t(a.WEEK),s=t(a.MONTH),m=t(a.QUARTER),l=t(a.YEAR),p=e(r[a.MILLISECONDS]||".%L"),d=e(r[a.SECONDS]||":%S"),S=e(r[a.MINUTES]||"%I:%M"),g=e(r[a.HOURS]||"%I %p"),E=e(r[a.DATE]||r[a.DAY]||"%a %d"),F=e(r[a.WEEK]||"%b %d"),v=e(r[a.MONTH]||"%B"),x=e(r[a.QUARTER]||"%B"),L=e(r[a.YEAR]||"%Y");return e=>(n(e)<e?p:o(e)<e?d:c(e)<e?S:u(e)<e?g:s(e)<e?f(e)<e?E:F:l(e)<e?m(e)<e?v:x:L)(e)}function d(e){const t=o(e.format),r=o(e.utcFormat);return{timeFormat:e=>i.isString(e)?t(e):p(t,a.timeInterval,e),utcFormat:e=>i.isString(e)?r(e):p(r,a.utcInterval,e),timeParse:o(e.parse),utcParse:o(e.utcParse)}}function S(){return f=d({format:n.timeFormat,parse:n.timeParse,utcFormat:n.utcFormat,utcParse:n.utcParse})}function g(e){return d(n.timeFormatLocale(e))}function E(e){return arguments.length?f=g(e):f}s(),S();const F=(e,t)=>i.extend({},e,t);function v(e,t){const r=arguments.length;return r&&2!==r&&i.error("defaultLocale expects either zero or two arguments."),r?F(l(e),E(t)):F(l(),E())}e.defaultLocale=v,e.locale=function(e,t){const r=e?m(e):l(),a=t?g(t):E();return F(r,a)},e.numberFormatDefaultLocale=l,e.numberFormatLocale=m,e.resetDefaultLocale=function(){return s(),S(),v()},e.resetNumberFormatDefaultLocale=s,e.resetTimeFormatDefaultLocale=S,e.timeFormatDefaultLocale=E,e.timeFormatLocale=g,Object.defineProperty(e,"__esModule",{value:!0})}));