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

27
node_modules/vega-event-selector/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,27 @@
Copyright (c) 2015-2018, University of Washington Interactive Data Lab
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

11
node_modules/vega-event-selector/README.md generated vendored Normal file
View File

@@ -0,0 +1,11 @@
# vega-event-selector
A CSS-inspired language to select, sequence, and compose DOM events into event streams.
Exports the following method:
<a name="selector" href="#selector">#</a>
vega.<b>selector</b>(<i>selector</i>[, <i>source</i>, <i>marks</i>])
[<>](https://github.com/vega/vega/blob/master/packages/vega-event-selector/src/event-selector.js "Source")
Takes an [event _selector_ string](https://vega.github.io/vega/docs/event-streams/#selector) as input and returns a parsed [event stream object](https://vega.github.io/vega/docs/event-streams/#object) definition. The optional _source_ argument takes a string indicating the source value to use by default (normally `"view"`). The optional _marks_ argument takes an object whose keys will be treated as the legal mark types, so long as the corresponding values are truthy. For more, see the [Vega Event Stream documentation](https://vega.github.io/vega/docs/event-streams).

View File

@@ -0,0 +1,220 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = global || self, factory(global.vega = {}));
}(this, (function (exports) { 'use strict';
/**
* Parse an event selector string.
* Returns an array of event stream definitions.
*/
function eventSelector(selector, source, marks) {
DEFAULT_SOURCE = source || VIEW;
MARKS = marks || DEFAULT_MARKS;
return parseMerge(selector.trim()).map(parseSelector);
}
var VIEW = 'view',
LBRACK = '[',
RBRACK = ']',
LBRACE = '{',
RBRACE = '}',
COLON = ':',
COMMA = ',',
NAME = '@',
GT = '>',
ILLEGAL = /[[\]{}]/,
DEFAULT_SOURCE,
MARKS,
DEFAULT_MARKS = {
'*': 1,
arc: 1,
area: 1,
group: 1,
image: 1,
line: 1,
path: 1,
rect: 1,
rule: 1,
shape: 1,
symbol: 1,
text: 1,
trail: 1
};
function isMarkType(type) {
return MARKS[type];
}
function find(s, i, endChar, pushChar, popChar) {
var count = 0,
n = s.length,
c;
for (; i<n; ++i) {
c = s[i];
if (!count && c === endChar) return i;
else if (popChar && popChar.indexOf(c) >= 0) --count;
else if (pushChar && pushChar.indexOf(c) >= 0) ++count;
}
return i;
}
function parseMerge(s) {
var output = [],
start = 0,
n = s.length,
i = 0;
while (i < n) {
i = find(s, i, COMMA, LBRACK + LBRACE, RBRACK + RBRACE);
output.push(s.substring(start, i).trim());
start = ++i;
}
if (output.length === 0) {
throw 'Empty event selector: ' + s;
}
return output;
}
function parseSelector(s) {
return s[0] === '['
? parseBetween(s)
: parseStream(s);
}
function parseBetween(s) {
var n = s.length,
i = 1,
b, stream;
i = find(s, i, RBRACK, LBRACK, RBRACK);
if (i === n) {
throw 'Empty between selector: ' + s;
}
b = parseMerge(s.substring(1, i));
if (b.length !== 2) {
throw 'Between selector must have two elements: ' + s;
}
s = s.slice(i + 1).trim();
if (s[0] !== GT) {
throw 'Expected \'>\' after between selector: ' + s;
}
b = b.map(parseSelector);
stream = parseSelector(s.slice(1).trim());
if (stream.between) {
return {
between: b,
stream: stream
};
} else {
stream.between = b;
}
return stream;
}
function parseStream(s) {
var stream = {source: DEFAULT_SOURCE},
source = [],
throttle = [0, 0],
markname = 0,
start = 0,
n = s.length,
i = 0, j,
filter;
// extract throttle from end
if (s[n-1] === RBRACE) {
i = s.lastIndexOf(LBRACE);
if (i >= 0) {
try {
throttle = parseThrottle(s.substring(i+1, n-1));
} catch (e) {
throw 'Invalid throttle specification: ' + s;
}
s = s.slice(0, i).trim();
n = s.length;
} else throw 'Unmatched right brace: ' + s;
i = 0;
}
if (!n) throw s;
// set name flag based on first char
if (s[0] === NAME) markname = ++i;
// extract first part of multi-part stream selector
j = find(s, i, COLON);
if (j < n) {
source.push(s.substring(start, j).trim());
start = i = ++j;
}
// extract remaining part of stream selector
i = find(s, i, LBRACK);
if (i === n) {
source.push(s.substring(start, n).trim());
} else {
source.push(s.substring(start, i).trim());
filter = [];
start = ++i;
if (start === n) throw 'Unmatched left bracket: ' + s;
}
// extract filters
while (i < n) {
i = find(s, i, RBRACK);
if (i === n) throw 'Unmatched left bracket: ' + s;
filter.push(s.substring(start, i).trim());
if (i < n-1 && s[++i] !== LBRACK) throw 'Expected left bracket: ' + s;
start = ++i;
}
// marshall event stream specification
if (!(n = source.length) || ILLEGAL.test(source[n-1])) {
throw 'Invalid event selector: ' + s;
}
if (n > 1) {
stream.type = source[1];
if (markname) {
stream.markname = source[0].slice(1);
} else if (isMarkType(source[0])) {
stream.marktype = source[0];
} else {
stream.source = source[0];
}
} else {
stream.type = source[0];
}
if (stream.type.slice(-1) === '!') {
stream.consume = true;
stream.type = stream.type.slice(0, -1);
}
if (filter != null) stream.filter = filter;
if (throttle[0]) stream.throttle = throttle[0];
if (throttle[1]) stream.debounce = throttle[1];
return stream;
}
function parseThrottle(s) {
var a = s.split(COMMA);
if (!s.length || a.length > 2) throw s;
return a.map(function(_) {
var x = +_;
if (x !== x) throw s;
return x;
});
}
exports.selector = eventSelector;
Object.defineProperty(exports, '__esModule', { value: true });
})));

View File

@@ -0,0 +1 @@
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).vega={})}(this,(function(e){"use strict";var t,r,n="view",i=/[[\]{}]/,o={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};function s(e,t,r,n,i){for(var o,s=0,f=e.length;t<f;++t){if(o=e[t],!s&&o===r)return t;i&&i.indexOf(o)>=0?--s:n&&n.indexOf(o)>=0&&++s}return t}function f(e){for(var t=[],r=0,n=e.length,i=0;i<n;)i=s(e,i,",","[{","]}"),t.push(e.substring(r,i).trim()),r=++i;if(0===t.length)throw"Empty event selector: "+e;return t}function u(e){return"["===e[0]?function(e){var t,r,n=e.length,i=1;if((i=s(e,i,"]","[","]"))===n)throw"Empty between selector: "+e;if(2!==(t=f(e.substring(1,i))).length)throw"Between selector must have two elements: "+e;if(">"!==(e=e.slice(i+1).trim())[0])throw"Expected '>' after between selector: "+e;if(t=t.map(u),(r=u(e.slice(1).trim())).between)return{between:t,stream:r};r.between=t;return r}(e):function(e){var n,o,f={source:t},u=[],c=[0,0],l=0,a=0,h=e.length,p=0;if("}"===e[h-1]){if(!((p=e.lastIndexOf("{"))>=0))throw"Unmatched right brace: "+e;try{c=function(e){var t=e.split(",");if(!e.length||t.length>2)throw e;return t.map((function(t){var r=+t;if(r!=r)throw e;return r}))}(e.substring(p+1,h-1))}catch(t){throw"Invalid throttle specification: "+e}e=e.slice(0,p).trim(),h=e.length,p=0}if(!h)throw e;"@"===e[0]&&(l=++p);(n=s(e,p,":"))<h&&(u.push(e.substring(a,n).trim()),a=p=++n);if((p=s(e,p,"["))===h)u.push(e.substring(a,h).trim());else if(u.push(e.substring(a,p).trim()),o=[],(a=++p)===h)throw"Unmatched left bracket: "+e;for(;p<h;){if((p=s(e,p,"]"))===h)throw"Unmatched left bracket: "+e;if(o.push(e.substring(a,p).trim()),p<h-1&&"["!==e[++p])throw"Expected left bracket: "+e;a=++p}if(!(h=u.length)||i.test(u[h-1]))throw"Invalid event selector: "+e;h>1?(f.type=u[1],l?f.markname=u[0].slice(1):(m=u[0],r[m]?f.marktype=u[0]:f.source=u[0])):f.type=u[0];var m;"!"===f.type.slice(-1)&&(f.consume=!0,f.type=f.type.slice(0,-1));null!=o&&(f.filter=o);c[0]&&(f.throttle=c[0]);c[1]&&(f.debounce=c[1]);return f}(e)}e.selector=function(e,i,s){return t=i||n,r=s||o,f(e.trim()).map(u)},Object.defineProperty(e,"__esModule",{value:!0})}));

1
node_modules/vega-event-selector/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export function selector(selectorName: string, source: string): any[];

1
node_modules/vega-event-selector/index.js generated vendored Normal file
View File

@@ -0,0 +1 @@
export {default as selector} from './src/event-selector';

64
node_modules/vega-event-selector/package.json generated vendored Normal file
View File

@@ -0,0 +1,64 @@
{
"_from": "vega-event-selector@~2.0.3",
"_id": "vega-event-selector@2.0.3",
"_inBundle": false,
"_integrity": "sha512-rUnAvBSy5tkk+0MELY7qICTgjMNjH/DDNIH603q3GRi+bBRCd4MlJxWrPYBhwZIYpmr6XCe130lZ90/F5SgVfA==",
"_location": "/vega-event-selector",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "vega-event-selector@~2.0.3",
"name": "vega-event-selector",
"escapedName": "vega-event-selector",
"rawSpec": "~2.0.3",
"saveSpec": null,
"fetchSpec": "~2.0.3"
},
"_requiredBy": [
"/vega",
"/vega-lite",
"/vega-parser"
],
"_resolved": "https://registry.npmjs.org/vega-event-selector/-/vega-event-selector-2.0.3.tgz",
"_shasum": "760c61af7ab5c325d3274fd3ab284d067ff16f8c",
"_spec": "vega-event-selector@~2.0.3",
"_where": "/home/prabhatdev/Documents/opensource/gitHubStats/waka-readme-stats/node_modules/vega",
"author": {
"name": "Arvind Satyanarayan",
"url": "http://arvindsatya.com"
},
"bugs": {
"url": "https://github.com/vega/vega/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "A CSS-inspired language to select, sequence, and compose DOM events.",
"gitHead": "35e31c5c6b54db9dc3a577b5adad8d15ec274d32",
"homepage": "https://github.com/vega/vega#readme",
"keywords": [
"vega",
"event",
"selector"
],
"license": "BSD-3-Clause",
"main": "build/vega-event-selector.js",
"module": "index",
"name": "vega-event-selector",
"repository": {
"type": "git",
"url": "git+https://github.com/vega/vega.git"
},
"scripts": {
"build": "yarn rollup",
"postbuild": "terser build/vega-event-selector.js -c -m -o build/vega-event-selector.min.js",
"postpublish": "git push && git push --tags",
"prebuild": "rimraf build && mkdir build",
"prepublishOnly": "yarn test && yarn build",
"pretest": "yarn prebuild && yarn rollup",
"rollup": "rollup -f umd -n vega -o build/vega-event-selector.js -- index.js",
"test": "tape 'test/**/*-test.js'"
},
"types": "index.d.ts",
"version": "2.0.3"
}

208
node_modules/vega-event-selector/src/event-selector.js generated vendored Normal file
View File

@@ -0,0 +1,208 @@
/**
* Parse an event selector string.
* Returns an array of event stream definitions.
*/
export default function(selector, source, marks) {
DEFAULT_SOURCE = source || VIEW;
MARKS = marks || DEFAULT_MARKS;
return parseMerge(selector.trim()).map(parseSelector);
}
var VIEW = 'view',
LBRACK = '[',
RBRACK = ']',
LBRACE = '{',
RBRACE = '}',
COLON = ':',
COMMA = ',',
NAME = '@',
GT = '>',
ILLEGAL = /[[\]{}]/,
DEFAULT_SOURCE,
MARKS,
DEFAULT_MARKS = {
'*': 1,
arc: 1,
area: 1,
group: 1,
image: 1,
line: 1,
path: 1,
rect: 1,
rule: 1,
shape: 1,
symbol: 1,
text: 1,
trail: 1
};
function isMarkType(type) {
return MARKS[type];
}
function find(s, i, endChar, pushChar, popChar) {
var count = 0,
n = s.length,
c;
for (; i<n; ++i) {
c = s[i];
if (!count && c === endChar) return i;
else if (popChar && popChar.indexOf(c) >= 0) --count;
else if (pushChar && pushChar.indexOf(c) >= 0) ++count;
}
return i;
}
function parseMerge(s) {
var output = [],
start = 0,
n = s.length,
i = 0;
while (i < n) {
i = find(s, i, COMMA, LBRACK + LBRACE, RBRACK + RBRACE);
output.push(s.substring(start, i).trim());
start = ++i;
}
if (output.length === 0) {
throw 'Empty event selector: ' + s;
}
return output;
}
function parseSelector(s) {
return s[0] === '['
? parseBetween(s)
: parseStream(s);
}
function parseBetween(s) {
var n = s.length,
i = 1,
b, stream;
i = find(s, i, RBRACK, LBRACK, RBRACK);
if (i === n) {
throw 'Empty between selector: ' + s;
}
b = parseMerge(s.substring(1, i));
if (b.length !== 2) {
throw 'Between selector must have two elements: ' + s;
}
s = s.slice(i + 1).trim();
if (s[0] !== GT) {
throw 'Expected \'>\' after between selector: ' + s;
}
b = b.map(parseSelector);
stream = parseSelector(s.slice(1).trim());
if (stream.between) {
return {
between: b,
stream: stream
};
} else {
stream.between = b;
}
return stream;
}
function parseStream(s) {
var stream = {source: DEFAULT_SOURCE},
source = [],
throttle = [0, 0],
markname = 0,
start = 0,
n = s.length,
i = 0, j,
filter;
// extract throttle from end
if (s[n-1] === RBRACE) {
i = s.lastIndexOf(LBRACE);
if (i >= 0) {
try {
throttle = parseThrottle(s.substring(i+1, n-1));
} catch (e) {
throw 'Invalid throttle specification: ' + s;
}
s = s.slice(0, i).trim();
n = s.length;
} else throw 'Unmatched right brace: ' + s;
i = 0;
}
if (!n) throw s;
// set name flag based on first char
if (s[0] === NAME) markname = ++i;
// extract first part of multi-part stream selector
j = find(s, i, COLON);
if (j < n) {
source.push(s.substring(start, j).trim());
start = i = ++j;
}
// extract remaining part of stream selector
i = find(s, i, LBRACK);
if (i === n) {
source.push(s.substring(start, n).trim());
} else {
source.push(s.substring(start, i).trim());
filter = [];
start = ++i;
if (start === n) throw 'Unmatched left bracket: ' + s;
}
// extract filters
while (i < n) {
i = find(s, i, RBRACK);
if (i === n) throw 'Unmatched left bracket: ' + s;
filter.push(s.substring(start, i).trim());
if (i < n-1 && s[++i] !== LBRACK) throw 'Expected left bracket: ' + s;
start = ++i;
}
// marshall event stream specification
if (!(n = source.length) || ILLEGAL.test(source[n-1])) {
throw 'Invalid event selector: ' + s;
}
if (n > 1) {
stream.type = source[1];
if (markname) {
stream.markname = source[0].slice(1);
} else if (isMarkType(source[0])) {
stream.marktype = source[0];
} else {
stream.source = source[0];
}
} else {
stream.type = source[0];
}
if (stream.type.slice(-1) === '!') {
stream.consume = true;
stream.type = stream.type.slice(0, -1);
}
if (filter != null) stream.filter = filter;
if (throttle[0]) stream.throttle = throttle[0];
if (throttle[1]) stream.debounce = throttle[1];
return stream;
}
function parseThrottle(s) {
var a = s.split(COMMA);
if (!s.length || a.length > 2) throw s;
return a.map(function(_) {
var x = +_;
if (x !== x) throw s;
return x;
});
}