From d468735fd2b3251f6f4143ab31be791320716212 Mon Sep 17 00:00:00 2001 From: Shaheen Sharifian Date: Tue, 7 Aug 2018 09:28:53 -0700 Subject: [PATCH] release 0.20.4 dca8c55a61df7a8ca246b9e385a30f10cc228105 --- build/compassql.js | 12629 +++++++++++++++++++++++++++++ build/compassql.js.map | 1 + build/compassql.min.js | 7 + build/compassql.min.js.map | 1 + build/src/constraint/base.js | 72 + build/src/constraint/encoding.js | 49 + build/src/constraint/field.js | 369 + build/src/constraint/index.js | 7 + build/src/constraint/spec.js | 767 ++ build/src/constraint/value.js | 31 + build/src/query/encoding.js | 206 + build/src/query/expandedtype.js | 16 + build/src/query/groupby.js | 74 + build/src/query/index.js | 15 + build/src/query/normalize.js | 32 + build/src/query/query.js | 3 + build/src/query/shorthand.js | 476 ++ build/src/query/spec.js | 156 + build/src/query/transform.js | 3 + build/src/ranking/aggregation.js | 87 + build/src/ranking/fieldorder.js | 54 + build/src/ranking/ranking.js | 100 + 22 files changed, 15155 insertions(+) create mode 100644 build/compassql.js create mode 100644 build/compassql.js.map create mode 100644 build/compassql.min.js create mode 100644 build/compassql.min.js.map create mode 100644 build/src/constraint/base.js create mode 100644 build/src/constraint/encoding.js create mode 100644 build/src/constraint/field.js create mode 100644 build/src/constraint/index.js create mode 100644 build/src/constraint/spec.js create mode 100644 build/src/constraint/value.js create mode 100644 build/src/query/encoding.js create mode 100644 build/src/query/expandedtype.js create mode 100644 build/src/query/groupby.js create mode 100644 build/src/query/index.js create mode 100644 build/src/query/normalize.js create mode 100644 build/src/query/query.js create mode 100644 build/src/query/shorthand.js create mode 100644 build/src/query/spec.js create mode 100644 build/src/query/transform.js create mode 100644 build/src/ranking/aggregation.js create mode 100644 build/src/ranking/fieldorder.js create mode 100644 build/src/ranking/ranking.js diff --git a/build/compassql.js b/build/compassql.js new file mode 100644 index 00000000..85f77c4b --- /dev/null +++ b/build/compassql.js @@ -0,0 +1,12629 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.cql = {}))); +}(this, (function (exports) { 'use strict'; + + var encoding$5 = /*#__PURE__*/Object.freeze({ + get default () { return encoding$4; }, + get __moduleExports () { return encoding$3; }, + get isValueQuery () { return encoding_1$3; }, + get isFieldQuery () { return encoding_2$1; }, + get isAutoCountQuery () { return encoding_3$1; }, + get isDisabledAutoCountQuery () { return encoding_4$1; }, + get isEnabledAutoCountQuery () { return encoding_5$1; }, + get toEncoding () { return encoding_6$1; }, + get toValueDef () { return encoding_7$1; }, + get toFieldDef () { return encoding_8; }, + get isContinuous () { return encoding_9; }, + get isMeasure () { return encoding_10; }, + get isDimension () { return encoding_11; }, + get scaleType () { return encoding_12; } + }); + + var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + function unwrapExports (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; + } + + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } + + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. All rights reserved. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use + this file except in compliance with the License. You may obtain a copy of the + License at http://www.apache.org/licenses/LICENSE-2.0 + + THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED + WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, + MERCHANTABLITY OR NON-INFRINGEMENT. + + See the Apache Version 2.0 License for specific language governing permissions + and limitations under the License. + ***************************************************************************** */ + /* global Reflect, Promise */ + + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + + function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + } + + var __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + + function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; + } + + function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + } + + function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } + } + + function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); + } + + function __awaiter(thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + } + + function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + } + + function __exportStar(m, exports) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; + } + + function __values(o) { + var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; + if (m) return m.call(o); + return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + } + + function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; + } + + function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; + } + + function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); + } + + function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } + } + + function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; }; } + } + + function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator]; + return m ? m.call(o) : typeof __values === "function" ? __values(o) : o[Symbol.iterator](); + } + + function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; + } + function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result.default = mod; + return result; + } + + function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; + } + + var tslib_es6 = /*#__PURE__*/Object.freeze({ + __extends: __extends, + __assign: __assign, + __rest: __rest, + __decorate: __decorate, + __param: __param, + __metadata: __metadata, + __awaiter: __awaiter, + __generator: __generator, + __exportStar: __exportStar, + __values: __values, + __read: __read, + __spread: __spread, + __await: __await, + __asyncGenerator: __asyncGenerator, + __asyncDelegator: __asyncDelegator, + __asyncValues: __asyncValues, + __makeTemplateObject: __makeTemplateObject, + __importStar: __importStar, + __importDefault: __importDefault + }); + + var at, // The index of the current character + ch, // The current character + escapee = { + '"': '"', + '\\': '\\', + '/': '/', + b: '\b', + f: '\f', + n: '\n', + r: '\r', + t: '\t' + }, + text, + + error = function (m) { + // Call error when something is wrong. + throw { + name: 'SyntaxError', + message: m, + at: at, + text: text + }; + }, + + next = function (c) { + // If a c parameter is provided, verify that it matches the current character. + if (c && c !== ch) { + error("Expected '" + c + "' instead of '" + ch + "'"); + } + + // Get the next character. When there are no more characters, + // return the empty string. + + ch = text.charAt(at); + at += 1; + return ch; + }, + + number = function () { + // Parse a number value. + var number, + string = ''; + + if (ch === '-') { + string = '-'; + next('-'); + } + while (ch >= '0' && ch <= '9') { + string += ch; + next(); + } + if (ch === '.') { + string += '.'; + while (next() && ch >= '0' && ch <= '9') { + string += ch; + } + } + if (ch === 'e' || ch === 'E') { + string += ch; + next(); + if (ch === '-' || ch === '+') { + string += ch; + next(); + } + while (ch >= '0' && ch <= '9') { + string += ch; + next(); + } + } + number = +string; + if (!isFinite(number)) { + error("Bad number"); + } else { + return number; + } + }, + + string = function () { + // Parse a string value. + var hex, + i, + string = '', + uffff; + + // When parsing for string values, we must look for " and \ characters. + if (ch === '"') { + while (next()) { + if (ch === '"') { + next(); + return string; + } else if (ch === '\\') { + next(); + if (ch === 'u') { + uffff = 0; + for (i = 0; i < 4; i += 1) { + hex = parseInt(next(), 16); + if (!isFinite(hex)) { + break; + } + uffff = uffff * 16 + hex; + } + string += String.fromCharCode(uffff); + } else if (typeof escapee[ch] === 'string') { + string += escapee[ch]; + } else { + break; + } + } else { + string += ch; + } + } + } + error("Bad string"); + }, + + white = function () { + + // Skip whitespace. + + while (ch && ch <= ' ') { + next(); + } + }, + + word = function () { + + // true, false, or null. + + switch (ch) { + case 't': + next('t'); + next('r'); + next('u'); + next('e'); + return true; + case 'f': + next('f'); + next('a'); + next('l'); + next('s'); + next('e'); + return false; + case 'n': + next('n'); + next('u'); + next('l'); + next('l'); + return null; + } + error("Unexpected '" + ch + "'"); + }, + + value$1, // Place holder for the value function. + + array = function () { + + // Parse an array value. + + var array = []; + + if (ch === '[') { + next('['); + white(); + if (ch === ']') { + next(']'); + return array; // empty array + } + while (ch) { + array.push(value$1()); + white(); + if (ch === ']') { + next(']'); + return array; + } + next(','); + white(); + } + } + error("Bad array"); + }, + + object = function () { + + // Parse an object value. + + var key, + object = {}; + + if (ch === '{') { + next('{'); + white(); + if (ch === '}') { + next('}'); + return object; // empty object + } + while (ch) { + key = string(); + white(); + next(':'); + if (Object.hasOwnProperty.call(object, key)) { + error('Duplicate key "' + key + '"'); + } + object[key] = value$1(); + white(); + if (ch === '}') { + next('}'); + return object; + } + next(','); + white(); + } + } + error("Bad object"); + }; + + value$1 = function () { + + // Parse a JSON value. It could be an object, an array, a string, a number, + // or a word. + + white(); + switch (ch) { + case '{': + return object(); + case '[': + return array(); + case '"': + return string(); + case '-': + return number(); + default: + return ch >= '0' && ch <= '9' ? number() : word(); + } + }; + + // Return the json_parse function. It will have access to all of the above + // functions and variables. + + var parse = function (source, reviver) { + var result; + + text = source; + at = 0; + ch = ' '; + result = value$1(); + white(); + if (ch) { + error("Syntax error"); + } + + // If there is a reviver function, we recursively walk the new structure, + // passing each name/value pair to the reviver function for possible + // transformation, starting with a temporary root object that holds the result + // in an empty key. If there is not a reviver function, we simply return the + // result. + + return typeof reviver === 'function' ? (function walk(holder, key) { + var k, v, value = holder[key]; + if (value && typeof value === 'object') { + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = walk(value, k); + if (v !== undefined) { + value[k] = v; + } else { + delete value[k]; + } + } + } + } + return reviver.call(holder, key, value); + }({'': result}, '')) : result; + }; + + var parse$1 = /*#__PURE__*/Object.freeze({ + default: parse, + __moduleExports: parse + }); + + var escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + gap, + indent, + meta = { // table of character substitutions + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '"' : '\\"', + '\\': '\\\\' + }, + rep; + + function quote(string) { + // If the string contains no control characters, no quote characters, and no + // backslash characters, then we can safely slap some quotes around it. + // Otherwise we must also replace the offending characters with safe escape + // sequences. + + escapable.lastIndex = 0; + return escapable.test(string) ? '"' + string.replace(escapable, function (a) { + var c = meta[a]; + return typeof c === 'string' ? c : + '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }) + '"' : '"' + string + '"'; + } + + function str(key, holder) { + // Produce a string from holder[key]. + var i, // The loop counter. + k, // The member key. + v, // The member value. + length, + mind = gap, + partial, + value = holder[key]; + + // If the value has a toJSON method, call it to obtain a replacement value. + if (value && typeof value === 'object' && + typeof value.toJSON === 'function') { + value = value.toJSON(key); + } + + // If we were called with a replacer function, then call the replacer to + // obtain a replacement value. + if (typeof rep === 'function') { + value = rep.call(holder, key, value); + } + + // What happens next depends on the value's type. + switch (typeof value) { + case 'string': + return quote(value); + + case 'number': + // JSON numbers must be finite. Encode non-finite numbers as null. + return isFinite(value) ? String(value) : 'null'; + + case 'boolean': + case 'null': + // If the value is a boolean or null, convert it to a string. Note: + // typeof null does not produce 'null'. The case is included here in + // the remote chance that this gets fixed someday. + return String(value); + + case 'object': + if (!value) return 'null'; + gap += indent; + partial = []; + + // Array.isArray + if (Object.prototype.toString.apply(value) === '[object Array]') { + length = value.length; + for (i = 0; i < length; i += 1) { + partial[i] = str(i, value) || 'null'; + } + + // Join all of the elements together, separated with commas, and + // wrap them in brackets. + v = partial.length === 0 ? '[]' : gap ? + '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : + '[' + partial.join(',') + ']'; + gap = mind; + return v; + } + + // If the replacer is an array, use it to select the members to be + // stringified. + if (rep && typeof rep === 'object') { + length = rep.length; + for (i = 0; i < length; i += 1) { + k = rep[i]; + if (typeof k === 'string') { + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } + else { + // Otherwise, iterate through all of the keys in the object. + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } + + // Join all of the member texts together, separated with commas, + // and wrap them in braces. + + v = partial.length === 0 ? '{}' : gap ? + '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : + '{' + partial.join(',') + '}'; + gap = mind; + return v; + } + } + + var stringify = function (value, replacer, space) { + var i; + gap = ''; + indent = ''; + + // If the space parameter is a number, make an indent string containing that + // many spaces. + if (typeof space === 'number') { + for (i = 0; i < space; i += 1) { + indent += ' '; + } + } + // If the space parameter is a string, it will be used as the indent string. + else if (typeof space === 'string') { + indent = space; + } + + // If there is a replacer, it must be a function or an array. + // Otherwise, throw an error. + rep = replacer; + if (replacer && typeof replacer !== 'function' + && (typeof replacer !== 'object' || typeof replacer.length !== 'number')) { + throw new Error('JSON.stringify'); + } + + // Make a fake root object containing our value under the key of ''. + // Return the result of stringifying the value. + return str('', {'': value}); + }; + + var stringify$1 = /*#__PURE__*/Object.freeze({ + default: stringify, + __moduleExports: stringify + }); + + var require$$0 = ( parse$1 && parse ) || parse$1; + + var require$$1 = ( stringify$1 && stringify ) || stringify$1; + + var parse$2 = require$$0; + var stringify$2 = require$$1; + + var jsonify = { + parse: parse$2, + stringify: stringify$2 + }; + + var jsonify$1 = /*#__PURE__*/Object.freeze({ + default: jsonify, + __moduleExports: jsonify, + parse: parse$2, + stringify: stringify$2 + }); + + var require$$0$1 = ( jsonify$1 && jsonify ) || jsonify$1; + + var json = typeof JSON !== 'undefined' ? JSON : require$$0$1; + + var jsonStableStringify = function (obj, opts) { + if (!opts) opts = {}; + if (typeof opts === 'function') opts = { cmp: opts }; + var space = opts.space || ''; + if (typeof space === 'number') space = Array(space+1).join(' '); + var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false; + var replacer = opts.replacer || function(key, value) { return value; }; + + var cmp = opts.cmp && (function (f) { + return function (node) { + return function (a, b) { + var aobj = { key: a, value: node[a] }; + var bobj = { key: b, value: node[b] }; + return f(aobj, bobj); + }; + }; + })(opts.cmp); + + var seen = []; + return (function stringify (parent, key, node, level) { + var indent = space ? ('\n' + new Array(level + 1).join(space)) : ''; + var colonSeparator = space ? ': ' : ':'; + + if (node && node.toJSON && typeof node.toJSON === 'function') { + node = node.toJSON(); + } + + node = replacer.call(parent, key, node); + + if (node === undefined) { + return; + } + if (typeof node !== 'object' || node === null) { + return json.stringify(node); + } + if (isArray(node)) { + var out = []; + for (var i = 0; i < node.length; i++) { + var item = stringify(node, i, node[i], level+1) || json.stringify(null); + out.push(indent + space + item); + } + return '[' + out.join(',') + indent + ']'; + } + else { + if (seen.indexOf(node) !== -1) { + if (cycles) return json.stringify('__cycle__'); + throw new TypeError('Converting circular structure to JSON'); + } + else seen.push(node); + + var keys = objectKeys(node).sort(cmp && cmp(node)); + var out = []; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = stringify(node, key, node[key], level+1); + + if(!value) continue; + + var keyValue = json.stringify(key) + + colonSeparator + + value; + out.push(indent + space + keyValue); + } + seen.splice(seen.indexOf(node), 1); + return '{' + out.join(',') + indent + '}'; + } + })({ '': obj }, '', obj, 0); + }; + + var isArray = Array.isArray || function (x) { + return {}.toString.call(x) === '[object Array]'; + }; + + var objectKeys = Object.keys || function (obj) { + var has = Object.prototype.hasOwnProperty || function () { return true }; + var keys = []; + for (var key in obj) { + if (has.call(obj, key)) keys.push(key); + } + return keys; + }; + + var jsonStableStringify$1 = /*#__PURE__*/Object.freeze({ + default: jsonStableStringify, + __moduleExports: jsonStableStringify + }); + + function accessor(fn, fields, name) { + fn.fields = fields || []; + fn.fname = name; + return fn; + } + + function accessorName(fn) { + return fn == null ? null : fn.fname; + } + + function accessorFields(fn) { + return fn == null ? null : fn.fields; + } + + function error$1(message) { + throw Error(message); + } + + function splitAccessPath(p) { + var path = [], + q = null, + b = 0, + n = p.length, + s = '', + i, j, c; + + p = p + ''; + + function push() { + path.push(s + p.substring(i, j)); + s = ''; + i = j + 1; + } + + for (i=j=0; j i) { + push(); + } else { + i = j + 1; + } + } else if (c === '[') { + if (j > i) push(); + b = i = j + 1; + } else if (c === ']') { + if (!b) error$1('Access path missing open bracket: ' + p); + if (b > 0) push(); + b = 0; + i = j + 1; + } + } + + if (b) error$1('Access path missing closing bracket: ' + p); + if (q) error$1('Access path missing closing quote: ' + p); + + if (j > i) { + j++; + push(); + } + + return path; + } + + var isArray$1 = Array.isArray; + + function isObject(_) { + return _ === Object(_); + } + + function isString(_) { + return typeof _ === 'string'; + } + + function $(x) { + return isArray$1(x) ? '[' + x.map($) + ']' + : isObject(x) || isString(x) ? + // Output valid JSON and JS source strings. + // See http://timelessrepo.com/json-isnt-a-javascript-subset + JSON.stringify(x).replace('\u2028','\\u2028').replace('\u2029', '\\u2029') + : x; + } + + function field(field, name) { + var path = splitAccessPath(field), + code = 'return _[' + path.map($).join('][') + '];'; + + return accessor( + Function('_', code), + [(field = path.length===1 ? path[0] : field)], + name || field + ); + } + + var empty = []; + + var id = field('id'); + + var identity = accessor(function(_) { return _; }, empty, 'identity'); + + var zero = accessor(function() { return 0; }, empty, 'zero'); + + var one = accessor(function() { return 1; }, empty, 'one'); + + var truthy = accessor(function() { return true; }, empty, 'true'); + + var falsy = accessor(function() { return false; }, empty, 'false'); + + function log(method, level, input) { + var args = [level].concat([].slice.call(input)); + console[method].apply(console, args); // eslint-disable-line no-console + } + + var None = 0; + var Error$1 = 1; + var Warn = 2; + var Info = 3; + var Debug = 4; + + function logger(_) { + var level = _ || None; + return { + level: function(_) { + if (arguments.length) { + level = +_; + return this; + } else { + return level; + } + }, + error: function() { + if (level >= Error$1) log('error', 'ERROR', arguments); + return this; + }, + warn: function() { + if (level >= Warn) log('warn', 'WARN', arguments); + return this; + }, + info: function() { + if (level >= Info) log('log', 'INFO', arguments); + return this; + }, + debug: function() { + if (level >= Debug) log('log', 'DEBUG', arguments); + return this; + } + } + } + + function peek(array) { + return array[array.length - 1]; + } + + function toNumber(_) { + return _ == null || _ === '' ? null : +_; + } + + function exp(sign) { + return function(x) { return sign * Math.exp(x); }; + } + + function log$1(sign) { + return function(x) { return Math.log(sign * x); }; + } + + function pow(exponent) { + return function(x) { + return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent); + }; + } + + function pan(domain, delta, lift, ground) { + var d0 = lift(domain[0]), + d1 = lift(peek(domain)), + dd = (d1 - d0) * delta; + + return [ + ground(d0 - dd), + ground(d1 - dd) + ]; + } + + function panLinear(domain, delta) { + return pan(domain, delta, toNumber, identity); + } + + function panLog(domain, delta) { + var sign = Math.sign(domain[0]); + return pan(domain, delta, log$1(sign), exp(sign)); + } + + function panPow(domain, delta, exponent) { + return pan(domain, delta, pow(exponent), pow(1/exponent)); + } + + function zoom(domain, anchor, scale, lift, ground) { + var d0 = lift(domain[0]), + d1 = lift(peek(domain)), + da = anchor != null ? lift(anchor) : (d0 + d1) / 2; + + return [ + ground(da + (d0 - da) * scale), + ground(da + (d1 - da) * scale) + ]; + } + + function zoomLinear(domain, anchor, scale) { + return zoom(domain, anchor, scale, toNumber, identity); + } + + function zoomLog(domain, anchor, scale) { + var sign = Math.sign(domain[0]); + return zoom(domain, anchor, scale, log$1(sign), exp(sign)); + } + + function zoomPow(domain, anchor, scale, exponent) { + return zoom(domain, anchor, scale, pow(exponent), pow(1/exponent)); + } + + function array$1(_) { + return _ != null ? (isArray$1(_) ? _ : [_]) : []; + } + + function isFunction(_) { + return typeof _ === 'function'; + } + + function compare(fields, orders) { + var idx = [], + cmp = (fields = array$1(fields)).map(function(f, i) { + if (f == null) { + return null; + } else { + idx.push(i); + return isFunction(f) ? f + : splitAccessPath(f).map($).join(']['); + } + }), + n = idx.length - 1, + ord = array$1(orders), + code = 'var u,v;return ', + i, j, f, u, v, d, t, lt, gt; + + if (n < 0) return null; + + for (j=0; j<=n; ++j) { + i = idx[j]; + f = cmp[i]; + + if (isFunction(f)) { + d = 'f' + i; + u = '(u=this.' + d + '(a))'; + v = '(v=this.' + d + '(b))'; + (t = t || {})[d] = f; + } else { + u = '(u=a['+f+'])'; + v = '(v=b['+f+'])'; + } + + d = '((v=v instanceof Date?+v:v),(u=u instanceof Date?+u:u))'; + + if (ord[i] !== 'descending') { + gt = 1; + lt = -1; + } else { + gt = -1; + lt = 1; + } + + code += '(' + u+'<'+v+'||u==null)&&v!=null?' + lt + + ':(u>v||v==null)&&u!=null?' + gt + + ':'+d+'!==u&&v===v?' + lt + + ':v!==v&&u===u?' + gt + + (i < n ? ':' : ':0'); + } + + f = Function('a', 'b', code + ';'); + if (t) f = f.bind(t); + + fields = fields.reduce(function(map, field) { + if (isFunction(field)) { + (accessorFields(field) || []).forEach(function(_) { map[_] = 1; }); + } else if (field != null) { + map[field + ''] = 1; + } + return map; + }, {}); + + return accessor(f, Object.keys(fields)); + } + + function constant(_) { + return isFunction(_) ? _ : function() { return _; }; + } + + function debounce(delay, handler) { + var tid, evt; + + function callback() { + handler(evt); + tid = evt = null; + } + + return function(e) { + evt = e; + if (tid) clearTimeout(tid); + tid = setTimeout(callback, delay); + }; + } + + function extend(_) { + for (var x, k, i=1, len=arguments.length; i= b) { + a = c = b; + break; + } + } + u = v = i; + while (++i < n) { + b = array[i]; + if (b != null) { + if (a > b) { + a = b; + u = i; + } + if (c < b) { + c = b; + v = i; + } + } + } + } else { + while (++i < n) { + b = f(array[i], i, array); + if (b != null && b >= b) { + a = c = b; + break; + } + } + u = v = i; + while (++i < n) { + b = f(array[i], i, array); + if (b != null) { + if (a > b) { + a = b; + u = i; + } + if (c < b) { + c = b; + v = i; + } + } + } + } + + return [u, v]; + } + + var NULL = {}; + + function fastmap(input) { + var obj = {}, + map, + test; + + function has(key) { + return obj.hasOwnProperty(key) && obj[key] !== NULL; + } + + map = { + size: 0, + empty: 0, + object: obj, + has: has, + get: function(key) { + return has(key) ? obj[key] : undefined; + }, + set: function(key, value) { + if (!has(key)) { + ++map.size; + if (obj[key] === NULL) --map.empty; + } + obj[key] = value; + return this; + }, + delete: function(key) { + if (has(key)) { + --map.size; + ++map.empty; + obj[key] = NULL; + } + return this; + }, + clear: function() { + map.size = map.empty = 0; + map.object = obj = {}; + }, + test: function(_) { + if (arguments.length) { + test = _; + return map; + } else { + return test; + } + }, + clean: function() { + var next = {}, + size = 0, + key, value; + for (key in obj) { + value = obj[key]; + if (value !== NULL && (!test || !test(value))) { + next[key] = value; + ++size; + } + } + map.size = size; + map.empty = 0; + map.object = (obj = next); + } + }; + + if (input) Object.keys(input).forEach(function(key) { + map.set(key, input[key]); + }); + + return map; + } + + function inherits(child, parent) { + var proto = (child.prototype = Object.create(parent.prototype)); + proto.constructor = child; + return proto; + } + + function isBoolean(_) { + return typeof _ === 'boolean'; + } + + function isDate(_) { + return Object.prototype.toString.call(_) === '[object Date]'; + } + + function isNumber(_) { + return typeof _ === 'number'; + } + + function isRegExp(_) { + return Object.prototype.toString.call(_) === '[object RegExp]'; + } + + function key(fields, flat) { + if (fields) { + fields = flat + ? array$1(fields).map(function(f) { return f.replace(/\\(.)/g, '$1'); }) + : array$1(fields); + } + + var fn = !(fields && fields.length) + ? function() { return ''; } + : Function('_', 'return \'\'+' + + fields.map(function(f) { + return '_[' + (flat + ? $(f) + : splitAccessPath(f).map($).join('][') + ) + ']'; + }).join('+\'|\'+') + ';'); + + return accessor(fn, fields, 'key'); + } + + function merge(compare, array0, array1, output) { + var n0 = array0.length, + n1 = array1.length; + + if (!n1) return array0; + if (!n0) return array1; + + var merged = output || new array0.constructor(n0 + n1), + i0 = 0, i1 = 0, i = 0; + + for (; i0 0 + ? array1[i1++] + : array0[i0++]; + } + + for (; i0= 0) s += str; + return s; + } + + function pad(str, length, padchar, align) { + var c = padchar || ' ', + s = str + '', + n = length - s.length; + + return n <= 0 ? s + : align === 'left' ? repeat(c, n) + s + : align === 'center' ? repeat(c, ~~(n/2)) + s + repeat(c, Math.ceil(n/2)) + : s + repeat(c, n); + } + + function toBoolean(_) { + return _ == null || _ === '' ? null : !_ || _ === 'false' || _ === '0' ? false : !!_; + } + + function defaultParser(_) { + return isNumber(_) ? _ : isDate(_) ? _ : Date.parse(_); + } + + function toDate(_, parser) { + parser = parser || defaultParser; + return _ == null || _ === '' ? null : parser(_); + } + + function toString(_) { + return _ == null || _ === '' ? null : _ + ''; + } + + function toSet(_) { + for (var s={}, i=0, n=_.length; i -1; + } + exports.contains = contains; + /** Returns the array without the elements in item */ + function without(array, excludedItems) { + return array.filter(function (item) { return !contains(excludedItems, item); }); + } + exports.without = without; + function union(array, other) { + return array.concat(without(other, array)); + } + exports.union = union; + /** + * Returns true if any item returns true. + */ + function some(arr, f) { + var i = 0; + for (var k = 0; k < arr.length; k++) { + if (f(arr[k], k, i++)) { + return true; + } + } + return false; + } + exports.some = some; + /** + * Returns true if all items return true. + */ + function every(arr, f) { + var i = 0; + for (var k = 0; k < arr.length; k++) { + if (!f(arr[k], k, i++)) { + return false; + } + } + return true; + } + exports.every = every; + function flatten(arrays) { + return [].concat.apply([], arrays); + } + exports.flatten = flatten; + /** + * recursively merges src into dest + */ + function mergeDeep(dest) { + var src = []; + for (var _i = 1; _i < arguments.length; _i++) { + src[_i - 1] = arguments[_i]; + } + for (var _a = 0, src_1 = src; _a < src_1.length; _a++) { + var s = src_1[_a]; + dest = deepMerge_(dest, s); + } + return dest; + } + exports.mergeDeep = mergeDeep; + // recursively merges src into dest + function deepMerge_(dest, src) { + if (typeof src !== 'object' || src === null) { + return dest; + } + for (var p in src) { + if (!src.hasOwnProperty(p)) { + continue; + } + if (src[p] === undefined) { + continue; + } + if (typeof src[p] !== 'object' || vega_util_1.isArray(src[p]) || src[p] === null) { + dest[p] = src[p]; + } + else if (typeof dest[p] !== 'object' || dest[p] === null) { + dest[p] = mergeDeep(vega_util_1.isArray(src[p].constructor) ? [] : {}, src[p]); + } + else { + mergeDeep(dest[p], src[p]); + } + } + return dest; + } + function unique(values, f) { + var results = []; + var u = {}; + var v; + for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { + var val = values_1[_i]; + v = f(val); + if (v in u) { + continue; + } + u[v] = 1; + results.push(val); + } + return results; + } + exports.unique = unique; + /** + * Returns true if the two dictionaries disagree. Applies only to defined values. + */ + function differ(dict, other) { + for (var key in dict) { + if (dict.hasOwnProperty(key)) { + if (other[key] && dict[key] && other[key] !== dict[key]) { + return true; + } + } + } + return false; + } + exports.differ = differ; + function hasIntersection(a, b) { + for (var key in a) { + if (key in b) { + return true; + } + } + return false; + } + exports.hasIntersection = hasIntersection; + function isNumeric(num) { + return !isNaN(num); + } + exports.isNumeric = isNumeric; + function differArray(array, other) { + if (array.length !== other.length) { + return true; + } + array.sort(); + other.sort(); + for (var i = 0; i < array.length; i++) { + if (other[i] !== array[i]) { + return true; + } + } + return false; + } + exports.differArray = differArray; + // This is a stricter version of Object.keys but with better types. See https://github.com/Microsoft/TypeScript/pull/12253#issuecomment-263132208 + exports.keys = Object.keys; + function vals(x) { + var _vals = []; + for (var k in x) { + if (x.hasOwnProperty(k)) { + _vals.push(x[k]); + } + } + return _vals; + } + exports.vals = vals; + function flagKeys(f) { + return exports.keys(f); + } + exports.flagKeys = flagKeys; + function duplicate(obj) { + return JSON.parse(JSON.stringify(obj)); + } + exports.duplicate = duplicate; + function isBoolean(b) { + return b === true || b === false; + } + exports.isBoolean = isBoolean; + /** + * Convert a string into a valid variable name + */ + function varName(s) { + // Replace non-alphanumeric characters (anything besides a-zA-Z0-9_) with _ + var alphanumericS = s.replace(/\W/g, '_'); + // Add _ if the string has leading numbers. + return (s.match(/^\d+/) ? '_' : '') + alphanumericS; + } + exports.varName = varName; + function logicalExpr(op, cb) { + if (logical_1$1.isLogicalNot(op)) { + return '!(' + logicalExpr(op.not, cb) + ')'; + } + else if (logical_1$1.isLogicalAnd(op)) { + return '(' + op.and.map(function (and) { return logicalExpr(and, cb); }).join(') && (') + ')'; + } + else if (logical_1$1.isLogicalOr(op)) { + return '(' + op.or.map(function (or) { return logicalExpr(or, cb); }).join(') || (') + ')'; + } + else { + return cb(op); + } + } + exports.logicalExpr = logicalExpr; + /** + * Delete nested property of an object, and delete the ancestors of the property if they become empty. + */ + function deleteNestedProperty(obj, orderedProps) { + if (orderedProps.length === 0) { + return true; + } + var prop = orderedProps.shift(); + if (deleteNestedProperty(obj[prop], orderedProps)) { + delete obj[prop]; + } + return Object.keys(obj).length === 0; + } + exports.deleteNestedProperty = deleteNestedProperty; + function titlecase(s) { + return s.charAt(0).toUpperCase() + s.substr(1); + } + exports.titlecase = titlecase; + /** + * Converts a path to an access path. + */ + function accessPath(path) { + return "[" + vega_util_1.splitAccessPath(path).map(vega_util_1.stringValue).join('][') + "]"; + } + exports.accessPath = accessPath; + + }); + + var util$1 = unwrapExports(util); + var util_1 = util.pick; + var util_2 = util.omit; + var util_3 = util.stringify; + var util_4 = util.hash; + var util_5 = util.contains; + var util_6 = util.without; + var util_7 = util.union; + var util_8 = util.some; + var util_9 = util.every; + var util_10 = util.flatten; + var util_11 = util.mergeDeep; + var util_12 = util.unique; + var util_13 = util.differ; + var util_14 = util.hasIntersection; + var util_15 = util.isNumeric; + var util_16 = util.differArray; + var util_17 = util.keys; + var util_18 = util.vals; + var util_19 = util.flagKeys; + var util_20 = util.duplicate; + var util_21 = util.isBoolean; + var util_22 = util.varName; + var util_23 = util.logicalExpr; + var util_24 = util.deleteNestedProperty; + var util_25 = util.titlecase; + var util_26 = util.accessPath; + + var util$2 = /*#__PURE__*/Object.freeze({ + default: util$1, + __moduleExports: util, + pick: util_1, + omit: util_2, + stringify: util_3, + hash: util_4, + contains: util_5, + without: util_6, + union: util_7, + some: util_8, + every: util_9, + flatten: util_10, + mergeDeep: util_11, + unique: util_12, + differ: util_13, + hasIntersection: util_14, + isNumeric: util_15, + differArray: util_16, + keys: util_17, + vals: util_18, + flagKeys: util_19, + duplicate: util_20, + isBoolean: util_21, + varName: util_22, + logicalExpr: util_23, + deleteNestedProperty: util_24, + titlecase: util_25, + accessPath: util_26 + }); + + var tslib_1 = ( tslib_es6 && undefined ) || tslib_es6; + + var util$3 = ( util$2 && util$1 ) || util$2; + + var channel = createCommonjsModule(function (module, exports) { + /* + * Constants and utilities for encoding channels (Visual variables) + * such as 'x', 'y', 'color'. + */ + Object.defineProperty(exports, "__esModule", { value: true }); + + + var Channel; + (function (Channel) { + // Facet + Channel.ROW = 'row'; + Channel.COLUMN = 'column'; + // Position + Channel.X = 'x'; + Channel.Y = 'y'; + Channel.X2 = 'x2'; + Channel.Y2 = 'y2'; + // Geo Position + Channel.LATITUDE = 'latitude'; + Channel.LONGITUDE = 'longitude'; + Channel.LATITUDE2 = 'latitude2'; + Channel.LONGITUDE2 = 'longitude2'; + // Mark property with scale + Channel.COLOR = 'color'; + Channel.FILL = 'fill'; + Channel.STROKE = 'stroke'; + Channel.SHAPE = 'shape'; + Channel.SIZE = 'size'; + Channel.OPACITY = 'opacity'; + // Non-scale channel + Channel.TEXT = 'text'; + Channel.ORDER = 'order'; + Channel.DETAIL = 'detail'; + Channel.KEY = 'key'; + Channel.TOOLTIP = 'tooltip'; + Channel.HREF = 'href'; + })(Channel = exports.Channel || (exports.Channel = {})); + exports.X = Channel.X; + exports.Y = Channel.Y; + exports.X2 = Channel.X2; + exports.Y2 = Channel.Y2; + exports.LATITUDE = Channel.LATITUDE; + exports.LATITUDE2 = Channel.LATITUDE2; + exports.LONGITUDE = Channel.LONGITUDE; + exports.LONGITUDE2 = Channel.LONGITUDE2; + exports.ROW = Channel.ROW; + exports.COLUMN = Channel.COLUMN; + exports.SHAPE = Channel.SHAPE; + exports.SIZE = Channel.SIZE; + exports.COLOR = Channel.COLOR; + exports.FILL = Channel.FILL; + exports.STROKE = Channel.STROKE; + exports.TEXT = Channel.TEXT; + exports.DETAIL = Channel.DETAIL; + exports.KEY = Channel.KEY; + exports.ORDER = Channel.ORDER; + exports.OPACITY = Channel.OPACITY; + exports.TOOLTIP = Channel.TOOLTIP; + exports.HREF = Channel.HREF; + exports.GEOPOSITION_CHANNEL_INDEX = { + longitude: 1, + longitude2: 1, + latitude: 1, + latitude2: 1, + }; + exports.GEOPOSITION_CHANNELS = util$3.flagKeys(exports.GEOPOSITION_CHANNEL_INDEX); + var UNIT_CHANNEL_INDEX = tslib_1.__assign({ + // position + x: 1, y: 1, x2: 1, y2: 1 }, exports.GEOPOSITION_CHANNEL_INDEX, { + // color + color: 1, fill: 1, stroke: 1, + // other non-position with scale + opacity: 1, size: 1, shape: 1, + // channels without scales + order: 1, text: 1, detail: 1, key: 1, tooltip: 1, href: 1 }); + function isColorChannel(channel) { + return channel === 'color' || channel === 'fill' || channel === 'stroke'; + } + exports.isColorChannel = isColorChannel; + var FACET_CHANNEL_INDEX = { + row: 1, + column: 1 + }; + var CHANNEL_INDEX = tslib_1.__assign({}, UNIT_CHANNEL_INDEX, FACET_CHANNEL_INDEX); + exports.CHANNELS = util$3.flagKeys(CHANNEL_INDEX); + var _o = CHANNEL_INDEX.order, _d = CHANNEL_INDEX.detail, SINGLE_DEF_CHANNEL_INDEX = tslib_1.__rest(CHANNEL_INDEX, ["order", "detail"]); + /** + * Channels that cannot have an array of channelDef. + * model.fieldDef, getFieldDef only work for these channels. + * + * (The only two channels that can have an array of channelDefs are "detail" and "order". + * Since there can be multiple fieldDefs for detail and order, getFieldDef/model.fieldDef + * are not applicable for them. Similarly, selection projection won't work with "detail" and "order".) + */ + exports.SINGLE_DEF_CHANNELS = util$3.flagKeys(SINGLE_DEF_CHANNEL_INDEX); + function isChannel(str) { + return !!CHANNEL_INDEX[str]; + } + exports.isChannel = isChannel; + // CHANNELS without COLUMN, ROW + exports.UNIT_CHANNELS = util$3.flagKeys(UNIT_CHANNEL_INDEX); + // NONPOSITION_CHANNELS = UNIT_CHANNELS without X, Y, X2, Y2; + var _x = UNIT_CHANNEL_INDEX.x, _y = UNIT_CHANNEL_INDEX.y, + // x2 and y2 share the same scale as x and y + _x2 = UNIT_CHANNEL_INDEX.x2, _y2 = UNIT_CHANNEL_INDEX.y2, _latitude = UNIT_CHANNEL_INDEX.latitude, _longitude = UNIT_CHANNEL_INDEX.longitude, _latitude2 = UNIT_CHANNEL_INDEX.latitude2, _longitude2 = UNIT_CHANNEL_INDEX.longitude2, + // The rest of unit channels then have scale + NONPOSITION_CHANNEL_INDEX = tslib_1.__rest(UNIT_CHANNEL_INDEX, ["x", "y", "x2", "y2", "latitude", "longitude", "latitude2", "longitude2"]); + exports.NONPOSITION_CHANNELS = util$3.flagKeys(NONPOSITION_CHANNEL_INDEX); + // POSITION_SCALE_CHANNELS = X and Y; + var POSITION_SCALE_CHANNEL_INDEX = { x: 1, y: 1 }; + exports.POSITION_SCALE_CHANNELS = util$3.flagKeys(POSITION_SCALE_CHANNEL_INDEX); + // NON_POSITION_SCALE_CHANNEL = SCALE_CHANNELS without X, Y + var + // x2 and y2 share the same scale as x and y + // text and tooltip have format instead of scale, + // href has neither format, nor scale + _t = NONPOSITION_CHANNEL_INDEX.text, _tt = NONPOSITION_CHANNEL_INDEX.tooltip, _hr = NONPOSITION_CHANNEL_INDEX.href, + // detail and order have no scale + _dd = NONPOSITION_CHANNEL_INDEX.detail, _k = NONPOSITION_CHANNEL_INDEX.key, _oo = NONPOSITION_CHANNEL_INDEX.order, NONPOSITION_SCALE_CHANNEL_INDEX = tslib_1.__rest(NONPOSITION_CHANNEL_INDEX, ["text", "tooltip", "href", "detail", "key", "order"]); + exports.NONPOSITION_SCALE_CHANNELS = util$3.flagKeys(NONPOSITION_SCALE_CHANNEL_INDEX); + // Declare SCALE_CHANNEL_INDEX + var SCALE_CHANNEL_INDEX = tslib_1.__assign({}, POSITION_SCALE_CHANNEL_INDEX, NONPOSITION_SCALE_CHANNEL_INDEX); + /** List of channels with scales */ + exports.SCALE_CHANNELS = util$3.flagKeys(SCALE_CHANNEL_INDEX); + function isScaleChannel(channel) { + return !!SCALE_CHANNEL_INDEX[channel]; + } + exports.isScaleChannel = isScaleChannel; + /** + * Return whether a channel supports a particular mark type. + * @param channel channel name + * @param mark the mark type + * @return whether the mark supports the channel + */ + function supportMark(channel, mark) { + return mark in getSupportedMark(channel); + } + exports.supportMark = supportMark; + /** + * Return a dictionary showing whether a channel supports mark type. + * @param channel + * @return A dictionary mapping mark types to boolean values. + */ + function getSupportedMark(channel) { + switch (channel) { + case exports.COLOR: + case exports.FILL: + case exports.STROKE: + case exports.DETAIL: + case exports.KEY: + case exports.TOOLTIP: + case exports.HREF: + case exports.ORDER: // TODO: revise (order might not support rect, which is not stackable?) + case exports.OPACITY: + case exports.ROW: + case exports.COLUMN: + return { + point: true, tick: true, rule: true, circle: true, square: true, + bar: true, rect: true, line: true, trail: true, area: true, text: true, geoshape: true + }; + case exports.X: + case exports.Y: + case exports.LATITUDE: + case exports.LONGITUDE: + return { + point: true, tick: true, rule: true, circle: true, square: true, + bar: true, rect: true, line: true, trail: true, area: true, text: true + }; + case exports.X2: + case exports.Y2: + case exports.LATITUDE2: + case exports.LONGITUDE2: + return { + rule: true, bar: true, rect: true, area: true + }; + case exports.SIZE: + return { + point: true, tick: true, rule: true, circle: true, square: true, + bar: true, text: true, line: true, trail: true + }; + case exports.SHAPE: + return { point: true, geoshape: true }; + case exports.TEXT: + return { text: true }; + } + } + exports.getSupportedMark = getSupportedMark; + function rangeType(channel) { + switch (channel) { + case exports.X: + case exports.Y: + case exports.SIZE: + case exports.OPACITY: + // X2 and Y2 use X and Y scales, so they similarly have continuous range. + case exports.X2: + case exports.Y2: + return 'continuous'; + case exports.ROW: + case exports.COLUMN: + case exports.SHAPE: + // TEXT, TOOLTIP, and HREF have no scale but have discrete output + case exports.TEXT: + case exports.TOOLTIP: + case exports.HREF: + return 'discrete'; + // Color can be either continuous or discrete, depending on scale type. + case exports.COLOR: + case exports.FILL: + case exports.STROKE: + return 'flexible'; + // No scale, no range type. + case exports.LATITUDE: + case exports.LONGITUDE: + case exports.LATITUDE2: + case exports.LONGITUDE2: + case exports.DETAIL: + case exports.KEY: + case exports.ORDER: + return undefined; + } + /* istanbul ignore next: should never reach here. */ + throw new Error('rangeType not implemented for ' + channel); + } + exports.rangeType = rangeType; + + }); + + var channel$1 = unwrapExports(channel); + var channel_1 = channel.Channel; + var channel_2 = channel.X; + var channel_3 = channel.Y; + var channel_4 = channel.X2; + var channel_5 = channel.Y2; + var channel_6 = channel.LATITUDE; + var channel_7 = channel.LATITUDE2; + var channel_8 = channel.LONGITUDE; + var channel_9 = channel.LONGITUDE2; + var channel_10 = channel.ROW; + var channel_11 = channel.COLUMN; + var channel_12 = channel.SHAPE; + var channel_13 = channel.SIZE; + var channel_14 = channel.COLOR; + var channel_15 = channel.FILL; + var channel_16 = channel.STROKE; + var channel_17 = channel.TEXT; + var channel_18 = channel.DETAIL; + var channel_19 = channel.KEY; + var channel_20 = channel.ORDER; + var channel_21 = channel.OPACITY; + var channel_22 = channel.TOOLTIP; + var channel_23 = channel.HREF; + var channel_24 = channel.GEOPOSITION_CHANNEL_INDEX; + var channel_25 = channel.GEOPOSITION_CHANNELS; + var channel_26 = channel.isColorChannel; + var channel_27 = channel.CHANNELS; + var channel_28 = channel.SINGLE_DEF_CHANNELS; + var channel_29 = channel.isChannel; + var channel_30 = channel.UNIT_CHANNELS; + var channel_31 = channel.NONPOSITION_CHANNELS; + var channel_32 = channel.POSITION_SCALE_CHANNELS; + var channel_33 = channel.NONPOSITION_SCALE_CHANNELS; + var channel_34 = channel.SCALE_CHANNELS; + var channel_35 = channel.isScaleChannel; + var channel_36 = channel.supportMark; + var channel_37 = channel.getSupportedMark; + var channel_38 = channel.rangeType; + + var channel$2 = /*#__PURE__*/Object.freeze({ + default: channel$1, + __moduleExports: channel, + Channel: channel_1, + X: channel_2, + Y: channel_3, + X2: channel_4, + Y2: channel_5, + LATITUDE: channel_6, + LATITUDE2: channel_7, + LONGITUDE: channel_8, + LONGITUDE2: channel_9, + ROW: channel_10, + COLUMN: channel_11, + SHAPE: channel_12, + SIZE: channel_13, + COLOR: channel_14, + FILL: channel_15, + STROKE: channel_16, + TEXT: channel_17, + DETAIL: channel_18, + KEY: channel_19, + ORDER: channel_20, + OPACITY: channel_21, + TOOLTIP: channel_22, + HREF: channel_23, + GEOPOSITION_CHANNEL_INDEX: channel_24, + GEOPOSITION_CHANNELS: channel_25, + isColorChannel: channel_26, + CHANNELS: channel_27, + SINGLE_DEF_CHANNELS: channel_28, + isChannel: channel_29, + UNIT_CHANNELS: channel_30, + NONPOSITION_CHANNELS: channel_31, + POSITION_SCALE_CHANNELS: channel_32, + NONPOSITION_SCALE_CHANNELS: channel_33, + SCALE_CHANNELS: channel_34, + isScaleChannel: channel_35, + supportMark: channel_36, + getSupportedMark: channel_37, + rangeType: channel_38 + }); + + var axis = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + + exports.AXIS_PARTS = ['domain', 'grid', 'labels', 'ticks', 'title']; + /** + * A dictionary listing whether a certain axis property is applicable for only main axes or only grid axes. + * (Properties not listed are applicable for both) + */ + exports.AXIS_PROPERTY_TYPE = { + grid: 'grid', + gridScale: 'grid', + domain: 'main', + labels: 'main', + labelFlush: 'main', + labelOverlap: 'main', + minExtent: 'main', + maxExtent: 'main', + offset: 'main', + ticks: 'main', + title: 'main', + values: 'both', + scale: 'both', + zindex: 'both' // this is actually set afterward, so it doesn't matter + }; + var COMMON_AXIS_PROPERTIES_INDEX = { + orient: 1, + domain: 1, + format: 1, + grid: 1, + labelBound: 1, + labelFlush: 1, + labelPadding: 1, + labels: 1, + labelOverlap: 1, + maxExtent: 1, + minExtent: 1, + offset: 1, + position: 1, + tickCount: 1, + ticks: 1, + tickSize: 1, + title: 1, + titlePadding: 1, + values: 1, + zindex: 1, + }; + var AXIS_PROPERTIES_INDEX = tslib_1.__assign({}, COMMON_AXIS_PROPERTIES_INDEX, { encoding: 1, labelAngle: 1, titleMaxLength: 1 }); + var VG_AXIS_PROPERTIES_INDEX = tslib_1.__assign({ scale: 1 }, COMMON_AXIS_PROPERTIES_INDEX, { gridScale: 1, encode: 1 }); + function isAxisProperty(prop) { + return !!AXIS_PROPERTIES_INDEX[prop]; + } + exports.isAxisProperty = isAxisProperty; + exports.VG_AXIS_PROPERTIES = util$3.flagKeys(VG_AXIS_PROPERTIES_INDEX); + // Export for dependent projects + exports.AXIS_PROPERTIES = util$3.flagKeys(AXIS_PROPERTIES_INDEX); + + }); + + var axis$1 = unwrapExports(axis); + var axis_1 = axis.AXIS_PARTS; + var axis_2 = axis.AXIS_PROPERTY_TYPE; + var axis_3 = axis.isAxisProperty; + var axis_4 = axis.VG_AXIS_PROPERTIES; + var axis_5 = axis.AXIS_PROPERTIES; + + var axis$2 = /*#__PURE__*/Object.freeze({ + default: axis$1, + __moduleExports: axis, + AXIS_PARTS: axis_1, + AXIS_PROPERTY_TYPE: axis_2, + isAxisProperty: axis_3, + VG_AXIS_PROPERTIES: axis_4, + AXIS_PROPERTIES: axis_5 + }); + + var log$2 = createCommonjsModule(function (module, exports) { + /** + * Vega-Lite's singleton logger utility. + */ + Object.defineProperty(exports, "__esModule", { value: true }); + + + /** + * Main (default) Vega Logger instance for Vega-Lite + */ + var main = vega_util_1.logger(vega_util_1.Warn); + var current = main; + /** + * Logger tool for checking if the code throws correct warning + */ + var LocalLogger = /** @class */ (function () { + function LocalLogger() { + this.warns = []; + this.infos = []; + this.debugs = []; + } + LocalLogger.prototype.level = function () { + return this; + }; + LocalLogger.prototype.warn = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + (_a = this.warns).push.apply(_a, args); + return this; + var _a; + }; + LocalLogger.prototype.info = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + (_a = this.infos).push.apply(_a, args); + return this; + var _a; + }; + LocalLogger.prototype.debug = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + (_a = this.debugs).push.apply(_a, args); + return this; + var _a; + }; + return LocalLogger; + }()); + exports.LocalLogger = LocalLogger; + function wrap(f) { + return function () { + current = new LocalLogger(); + f(current); + reset(); + }; + } + exports.wrap = wrap; + /** + * Set the singleton logger to be a custom logger + */ + function set(newLogger) { + current = newLogger; + return current; + } + exports.set = set; + /** + * Reset the main logger to use the default Vega Logger + */ + function reset() { + current = main; + return current; + } + exports.reset = reset; + function warn() { + var _ = []; + for (var _i = 0; _i < arguments.length; _i++) { + _[_i] = arguments[_i]; + } + current.warn.apply(current, arguments); + } + exports.warn = warn; + function info() { + var _ = []; + for (var _i = 0; _i < arguments.length; _i++) { + _[_i] = arguments[_i]; + } + current.info.apply(current, arguments); + } + exports.info = info; + function debug() { + var _ = []; + for (var _i = 0; _i < arguments.length; _i++) { + _[_i] = arguments[_i]; + } + current.debug.apply(current, arguments); + } + exports.debug = debug; + /** + * Collection of all Vega-Lite Error Messages + */ + var message; + (function (message) { + message.INVALID_SPEC = 'Invalid spec'; + // FIT + message.FIT_NON_SINGLE = 'Autosize "fit" only works for single views and layered views.'; + message.CANNOT_FIX_RANGE_STEP_WITH_FIT = 'Cannot use a fixed value of "rangeStep" when "autosize" is "fit".'; + // SELECTION + function cannotProjectOnChannelWithoutField(channel) { + return "Cannot project a selection on encoding channel \"" + channel + "\", which has no field."; + } + message.cannotProjectOnChannelWithoutField = cannotProjectOnChannelWithoutField; + function nearestNotSupportForContinuous(mark) { + return "The \"nearest\" transform is not supported for " + mark + " marks."; + } + message.nearestNotSupportForContinuous = nearestNotSupportForContinuous; + function selectionNotFound(name) { + return "Cannot find a selection named \"" + name + "\""; + } + message.selectionNotFound = selectionNotFound; + message.SCALE_BINDINGS_CONTINUOUS = 'Scale bindings are currently only supported for scales with unbinned, continuous domains.'; + // REPEAT + function noSuchRepeatedValue(field) { + return "Unknown repeated value \"" + field + "\"."; + } + message.noSuchRepeatedValue = noSuchRepeatedValue; + // CONCAT + message.CONCAT_CANNOT_SHARE_AXIS = 'Axes cannot be shared in concatenated views.'; + // REPEAT + message.REPEAT_CANNOT_SHARE_AXIS = 'Axes cannot be shared in repeated views.'; + // TITLE + function cannotSetTitleAnchor(type) { + return "Cannot set title \"anchor\" for a " + type + " spec"; + } + message.cannotSetTitleAnchor = cannotSetTitleAnchor; + // DATA + function unrecognizedParse(p) { + return "Unrecognized parse \"" + p + "\"."; + } + message.unrecognizedParse = unrecognizedParse; + function differentParse(field, local, ancestor) { + return "An ancestor parsed field \"" + field + "\" as " + ancestor + " but a child wants to parse the field as " + local + "."; + } + message.differentParse = differentParse; + // TRANSFORMS + function invalidTransformIgnored(transform) { + return "Ignoring an invalid transform: " + util$3.stringify(transform) + "."; + } + message.invalidTransformIgnored = invalidTransformIgnored; + message.NO_FIELDS_NEEDS_AS = 'If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.'; + // ENCODING & FACET + function encodingOverridden(channels) { + return "Layer's shared " + channels.join(',') + " channel " + (channels.length === 1 ? 'is' : 'are') + " overriden"; + } + message.encodingOverridden = encodingOverridden; + function projectionOverridden(opt) { + var parentProjection = opt.parentProjection, projection = opt.projection; + return "Layer's shared projection " + util$3.stringify(parentProjection) + " is overridden by a child projection " + util$3.stringify(projection) + "."; + } + message.projectionOverridden = projectionOverridden; + function primitiveChannelDef(channel, type, value) { + return "Channel " + channel + " is a " + type + ". Converted to {value: " + util$3.stringify(value) + "}."; + } + message.primitiveChannelDef = primitiveChannelDef; + function invalidFieldType(type) { + return "Invalid field type \"" + type + "\""; + } + message.invalidFieldType = invalidFieldType; + function nonZeroScaleUsedWithLengthMark(mark, channel, opt) { + var scaleText = opt.scaleType ? opt.scaleType + " scale" : + opt.zeroFalse ? 'scale with zero=false' : + 'scale with custom domain that excludes zero'; + return "A " + scaleText + " is used with " + mark + " mark. This can be misleading as the " + (channel === 'x' ? 'width' : 'height') + " of the " + mark + " can be arbitrary based on the scale domain. You may want to use point mark instead."; + } + message.nonZeroScaleUsedWithLengthMark = nonZeroScaleUsedWithLengthMark; + function invalidFieldTypeForCountAggregate(type, aggregate) { + return "Invalid field type \"" + type + "\" for aggregate: \"" + aggregate + "\", using \"quantitative\" instead."; + } + message.invalidFieldTypeForCountAggregate = invalidFieldTypeForCountAggregate; + function invalidAggregate(aggregate) { + return "Invalid aggregation operator \"" + aggregate + "\""; + } + message.invalidAggregate = invalidAggregate; + function emptyOrInvalidFieldType(type, channel, newType) { + return "Invalid field type \"" + type + "\" for channel \"" + channel + "\", using \"" + newType + "\" instead."; + } + message.emptyOrInvalidFieldType = emptyOrInvalidFieldType; + function droppingColor(type, opt) { + var fill = opt.fill, stroke = opt.stroke; + return "Dropping color " + type + " as the plot also has " + (fill && stroke ? 'fill and stroke' : fill ? 'fill' : 'stroke'); + } + message.droppingColor = droppingColor; + function emptyFieldDef(fieldDef, channel) { + return "Dropping " + util$3.stringify(fieldDef) + " from channel \"" + channel + "\" since it does not contain data field or value."; + } + message.emptyFieldDef = emptyFieldDef; + function latLongDeprecated(channel, type, newChannel) { + return channel + "-encoding with type " + type + " is deprecated. Replacing with " + newChannel + "-encoding."; + } + message.latLongDeprecated = latLongDeprecated; + message.LINE_WITH_VARYING_SIZE = 'Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.'; + function incompatibleChannel(channel, markOrFacet, when) { + return channel + " dropped as it is incompatible with \"" + markOrFacet + "\"" + (when ? " when " + when : '') + "."; + } + message.incompatibleChannel = incompatibleChannel; + function invalidEncodingChannel(channel) { + return channel + "-encoding is dropped as " + channel + " is not a valid encoding channel."; + } + message.invalidEncodingChannel = invalidEncodingChannel; + function facetChannelShouldBeDiscrete(channel) { + return channel + " encoding should be discrete (ordinal / nominal / binned)."; + } + message.facetChannelShouldBeDiscrete = facetChannelShouldBeDiscrete; + function discreteChannelCannotEncode(channel, type) { + return "Using discrete channel \"" + channel + "\" to encode \"" + type + "\" field can be misleading as it does not encode " + (type === 'ordinal' ? 'order' : 'magnitude') + "."; + } + message.discreteChannelCannotEncode = discreteChannelCannotEncode; + // Mark + message.BAR_WITH_POINT_SCALE_AND_RANGESTEP_NULL = 'Bar mark should not be used with point scale when rangeStep is null. Please use band scale instead.'; + function lineWithRange(hasX2, hasY2) { + var channels = hasX2 && hasY2 ? 'x2 and y2' : hasX2 ? 'x2' : 'y2'; + return "Line mark is for continuous lines and thus cannot be used with " + channels + ". We will use the rule mark (line segments) instead."; + } + message.lineWithRange = lineWithRange; + function unclearOrientContinuous(mark) { + return "Cannot clearly determine orientation for \"" + mark + "\" since both x and y channel encode continuous fields. In this case, we use vertical by default"; + } + message.unclearOrientContinuous = unclearOrientContinuous; + function unclearOrientDiscreteOrEmpty(mark) { + return "Cannot clearly determine orientation for \"" + mark + "\" since both x and y channel encode discrete or empty fields."; + } + message.unclearOrientDiscreteOrEmpty = unclearOrientDiscreteOrEmpty; + function orientOverridden(original, actual) { + return "Specified orient \"" + original + "\" overridden with \"" + actual + "\""; + } + message.orientOverridden = orientOverridden; + // SCALE + message.CANNOT_UNION_CUSTOM_DOMAIN_WITH_FIELD_DOMAIN = 'custom domain scale cannot be unioned with default field-based domain'; + function cannotUseScalePropertyWithNonColor(prop) { + return "Cannot use the scale property \"" + prop + "\" with non-color channel."; + } + message.cannotUseScalePropertyWithNonColor = cannotUseScalePropertyWithNonColor; + function unaggregateDomainHasNoEffectForRawField(fieldDef) { + return "Using unaggregated domain with raw field has no effect (" + util$3.stringify(fieldDef) + ")."; + } + message.unaggregateDomainHasNoEffectForRawField = unaggregateDomainHasNoEffectForRawField; + function unaggregateDomainWithNonSharedDomainOp(aggregate) { + return "Unaggregated domain not applicable for \"" + aggregate + "\" since it produces values outside the origin domain of the source data."; + } + message.unaggregateDomainWithNonSharedDomainOp = unaggregateDomainWithNonSharedDomainOp; + function unaggregatedDomainWithLogScale(fieldDef) { + return "Unaggregated domain is currently unsupported for log scale (" + util$3.stringify(fieldDef) + ")."; + } + message.unaggregatedDomainWithLogScale = unaggregatedDomainWithLogScale; + function cannotUseSizeFieldWithBandSize(positionChannel) { + return "Using size field when " + positionChannel + "-channel has a band scale is not supported."; + } + message.cannotUseSizeFieldWithBandSize = cannotUseSizeFieldWithBandSize; + function cannotApplySizeToNonOrientedMark(mark) { + return "Cannot apply size to non-oriented mark \"" + mark + "\"."; + } + message.cannotApplySizeToNonOrientedMark = cannotApplySizeToNonOrientedMark; + function rangeStepDropped(channel) { + return "rangeStep for \"" + channel + "\" is dropped as top-level " + (channel === 'x' ? 'width' : 'height') + " is provided."; + } + message.rangeStepDropped = rangeStepDropped; + function scaleTypeNotWorkWithChannel(channel, scaleType, defaultScaleType) { + return "Channel \"" + channel + "\" does not work with \"" + scaleType + "\" scale. We are using \"" + defaultScaleType + "\" scale instead."; + } + message.scaleTypeNotWorkWithChannel = scaleTypeNotWorkWithChannel; + function scaleTypeNotWorkWithFieldDef(scaleType, defaultScaleType) { + return "FieldDef does not work with \"" + scaleType + "\" scale. We are using \"" + defaultScaleType + "\" scale instead."; + } + message.scaleTypeNotWorkWithFieldDef = scaleTypeNotWorkWithFieldDef; + function scalePropertyNotWorkWithScaleType(scaleType, propName, channel) { + return channel + "-scale's \"" + propName + "\" is dropped as it does not work with " + scaleType + " scale."; + } + message.scalePropertyNotWorkWithScaleType = scalePropertyNotWorkWithScaleType; + function scaleTypeNotWorkWithMark(mark, scaleType) { + return "Scale type \"" + scaleType + "\" does not work with mark \"" + mark + "\"."; + } + message.scaleTypeNotWorkWithMark = scaleTypeNotWorkWithMark; + function mergeConflictingProperty(property, propertyOf, v1, v2) { + return "Conflicting " + propertyOf + " property \"" + property + "\" (" + util$3.stringify(v1) + " and " + util$3.stringify(v2) + "). Using " + util$3.stringify(v1) + "."; + } + message.mergeConflictingProperty = mergeConflictingProperty; + function independentScaleMeansIndependentGuide(channel) { + return "Setting the scale to be independent for \"" + channel + "\" means we also have to set the guide (axis or legend) to be independent."; + } + message.independentScaleMeansIndependentGuide = independentScaleMeansIndependentGuide; + function conflictedDomain(channel) { + return "Cannot set " + channel + "-scale's \"domain\" as it is binned. Please use \"bin\"'s \"extent\" instead."; + } + message.conflictedDomain = conflictedDomain; + function domainSortDropped(sort) { + return "Dropping sort property " + util$3.stringify(sort) + " as unioned domains only support boolean or op 'count'."; + } + message.domainSortDropped = domainSortDropped; + message.UNABLE_TO_MERGE_DOMAINS = 'Unable to merge domains'; + message.MORE_THAN_ONE_SORT = 'Domains that should be unioned has conflicting sort properties. Sort will be set to true.'; + // AXIS + message.INVALID_CHANNEL_FOR_AXIS = 'Invalid channel for axis.'; + // STACK + function cannotStackRangedMark(channel) { + return "Cannot stack \"" + channel + "\" if there is already \"" + channel + "2\""; + } + message.cannotStackRangedMark = cannotStackRangedMark; + function cannotStackNonLinearScale(scaleType) { + return "Cannot stack non-linear scale (" + scaleType + ")"; + } + message.cannotStackNonLinearScale = cannotStackNonLinearScale; + function stackNonSummativeAggregate(aggregate) { + return "Stacking is applied even though the aggregate function is non-summative (\"" + aggregate + "\")"; + } + message.stackNonSummativeAggregate = stackNonSummativeAggregate; + // TIMEUNIT + function invalidTimeUnit(unitName, value) { + return "Invalid " + unitName + ": " + util$3.stringify(value); + } + message.invalidTimeUnit = invalidTimeUnit; + function dayReplacedWithDate(fullTimeUnit) { + return "Time unit \"" + fullTimeUnit + "\" is not supported. We are replacing it with " + fullTimeUnit.replace('day', 'date') + "."; + } + message.dayReplacedWithDate = dayReplacedWithDate; + function droppedDay(d) { + return "Dropping day from datetime " + util$3.stringify(d) + " as day cannot be combined with other units."; + } + message.droppedDay = droppedDay; + })(message = exports.message || (exports.message = {})); + + }); + + var log$3 = unwrapExports(log$2); + var log_1 = log$2.LocalLogger; + var log_2 = log$2.wrap; + var log_3 = log$2.set; + var log_4 = log$2.reset; + var log_5 = log$2.warn; + var log_6 = log$2.info; + var log_7 = log$2.debug; + var log_8 = log$2.message; + + var log$4 = /*#__PURE__*/Object.freeze({ + default: log$3, + __moduleExports: log$2, + LocalLogger: log_1, + wrap: log_2, + set: log_3, + reset: log_4, + warn: log_5, + info: log_6, + debug: log_7, + message: log_8 + }); + + var channel_1$1 = ( channel$2 && channel$1 ) || channel$2; + + var log$5 = ( log$4 && log$3 ) || log$4; + + var scale = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + var ScaleType; + (function (ScaleType) { + // Continuous - Quantitative + ScaleType.LINEAR = 'linear'; + ScaleType.BIN_LINEAR = 'bin-linear'; + ScaleType.LOG = 'log'; + ScaleType.POW = 'pow'; + ScaleType.SQRT = 'sqrt'; + // Continuous - Time + ScaleType.TIME = 'time'; + ScaleType.UTC = 'utc'; + // sequential + ScaleType.SEQUENTIAL = 'sequential'; + // Quantile, Quantize, threshold + ScaleType.QUANTILE = 'quantile'; + ScaleType.QUANTIZE = 'quantize'; + ScaleType.THRESHOLD = 'threshold'; + ScaleType.ORDINAL = 'ordinal'; + ScaleType.BIN_ORDINAL = 'bin-ordinal'; + ScaleType.POINT = 'point'; + ScaleType.BAND = 'band'; + })(ScaleType = exports.ScaleType || (exports.ScaleType = {})); + /** + * Index for scale categories -- only scale of the same categories can be merged together. + * Current implementation is trying to be conservative and avoid merging scale type that might not work together + */ + var SCALE_CATEGORY_INDEX = { + linear: 'numeric', + log: 'numeric', + pow: 'numeric', + sqrt: 'numeric', + 'bin-linear': 'bin-linear', + time: 'time', + utc: 'time', + sequential: 'sequential', + ordinal: 'ordinal', + 'bin-ordinal': 'bin-ordinal', + point: 'ordinal-position', + band: 'ordinal-position' + }; + exports.SCALE_TYPES = util$3.keys(SCALE_CATEGORY_INDEX); + /** + * Whether the two given scale types can be merged together. + */ + function scaleCompatible(scaleType1, scaleType2) { + var scaleCategory1 = SCALE_CATEGORY_INDEX[scaleType1]; + var scaleCategory2 = SCALE_CATEGORY_INDEX[scaleType2]; + return scaleCategory1 === scaleCategory2 || + (scaleCategory1 === 'ordinal-position' && scaleCategory2 === 'time') || + (scaleCategory2 === 'ordinal-position' && scaleCategory1 === 'time'); + } + exports.scaleCompatible = scaleCompatible; + /** + * Index for scale precedence -- high score = higher priority for merging. + */ + var SCALE_PRECEDENCE_INDEX = { + // numeric + linear: 0, + log: 1, + pow: 1, + sqrt: 1, + // time + time: 0, + utc: 0, + // ordinal-position -- these have higher precedence than continuous scales as they support more types of data + point: 10, + band: 11, + // non grouped types + 'bin-linear': 0, + sequential: 0, + ordinal: 0, + 'bin-ordinal': 0, + }; + /** + * Return scale categories -- only scale of the same categories can be merged together. + */ + function scaleTypePrecedence(scaleType) { + return SCALE_PRECEDENCE_INDEX[scaleType]; + } + exports.scaleTypePrecedence = scaleTypePrecedence; + exports.CONTINUOUS_TO_CONTINUOUS_SCALES = ['linear', 'bin-linear', 'log', 'pow', 'sqrt', 'time', 'utc']; + var CONTINUOUS_TO_CONTINUOUS_INDEX = vega_util_1.toSet(exports.CONTINUOUS_TO_CONTINUOUS_SCALES); + exports.CONTINUOUS_DOMAIN_SCALES = exports.CONTINUOUS_TO_CONTINUOUS_SCALES.concat(['sequential' /* TODO add 'quantile', 'quantize', 'threshold'*/]); + var CONTINUOUS_DOMAIN_INDEX = vega_util_1.toSet(exports.CONTINUOUS_DOMAIN_SCALES); + exports.DISCRETE_DOMAIN_SCALES = ['ordinal', 'bin-ordinal', 'point', 'band']; + var DISCRETE_DOMAIN_INDEX = vega_util_1.toSet(exports.DISCRETE_DOMAIN_SCALES); + var BIN_SCALES_INDEX = vega_util_1.toSet(['bin-linear', 'bin-ordinal']); + exports.TIME_SCALE_TYPES = ['time', 'utc']; + function hasDiscreteDomain(type) { + return type in DISCRETE_DOMAIN_INDEX; + } + exports.hasDiscreteDomain = hasDiscreteDomain; + function isBinScale(type) { + return type in BIN_SCALES_INDEX; + } + exports.isBinScale = isBinScale; + function hasContinuousDomain(type) { + return type in CONTINUOUS_DOMAIN_INDEX; + } + exports.hasContinuousDomain = hasContinuousDomain; + function isContinuousToContinuous(type) { + return type in CONTINUOUS_TO_CONTINUOUS_INDEX; + } + exports.isContinuousToContinuous = isContinuousToContinuous; + exports.defaultScaleConfig = { + textXRangeStep: 90, + rangeStep: 21, + pointPadding: 0.5, + bandPaddingInner: 0.1, + facetSpacing: 16, + minBandSize: 2, + minFontSize: 8, + maxFontSize: 40, + minOpacity: 0.3, + maxOpacity: 0.8, + // FIXME: revise if these *can* become ratios of rangeStep + minSize: 9, + minStrokeWidth: 1, + maxStrokeWidth: 4 + }; + function isExtendedScheme(scheme) { + return scheme && !!scheme['name']; + } + exports.isExtendedScheme = isExtendedScheme; + function isSelectionDomain(domain) { + return domain && domain['selection']; + } + exports.isSelectionDomain = isSelectionDomain; + var SCALE_PROPERTY_INDEX = { + type: 1, + domain: 1, + range: 1, + rangeStep: 1, + scheme: 1, + // Other properties + reverse: 1, + round: 1, + // quantitative / time + clamp: 1, + nice: 1, + // quantitative + base: 1, + exponent: 1, + interpolate: 1, + zero: 1, + // band/point + padding: 1, + paddingInner: 1, + paddingOuter: 1 + }; + exports.SCALE_PROPERTIES = util$3.flagKeys(SCALE_PROPERTY_INDEX); + var NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTY_INDEX = tslib_1.__rest(SCALE_PROPERTY_INDEX, ["type", "domain", "range", "rangeStep", "scheme"]); + exports.NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTIES = util$3.flagKeys(NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTY_INDEX); + function scaleTypeSupportProperty(scaleType, propName) { + switch (propName) { + case 'type': + case 'domain': + case 'reverse': + case 'range': + return true; + case 'scheme': + return util$3.contains(['sequential', 'ordinal', 'bin-ordinal', 'quantile', 'quantize'], scaleType); + case 'interpolate': + // FIXME(https://github.com/vega/vega-lite/issues/2902) how about ordinal? + return util$3.contains(['linear', 'bin-linear', 'pow', 'log', 'sqrt', 'utc', 'time'], scaleType); + case 'round': + return isContinuousToContinuous(scaleType) || scaleType === 'band' || scaleType === 'point'; + case 'padding': + return isContinuousToContinuous(scaleType) || util$3.contains(['point', 'band'], scaleType); + case 'paddingOuter': + case 'rangeStep': + return util$3.contains(['point', 'band'], scaleType); + case 'paddingInner': + return scaleType === 'band'; + case 'clamp': + return isContinuousToContinuous(scaleType) || scaleType === 'sequential'; + case 'nice': + return isContinuousToContinuous(scaleType) || scaleType === 'sequential' || scaleType === 'quantize'; + case 'exponent': + return scaleType === 'pow'; + case 'base': + return scaleType === 'log'; + case 'zero': + return hasContinuousDomain(scaleType) && !util$3.contains([ + 'log', + 'time', 'utc', + 'bin-linear', + 'threshold', + 'quantile' // quantile depends on distribution so zero does not matter + ], scaleType); + } + /* istanbul ignore next: should never reach here*/ + throw new Error("Invalid scale property " + propName + "."); + } + exports.scaleTypeSupportProperty = scaleTypeSupportProperty; + /** + * Returns undefined if the input channel supports the input scale property name + */ + function channelScalePropertyIncompatability(channel, propName) { + switch (propName) { + case 'interpolate': + case 'scheme': + if (!channel_1$1.isColorChannel(channel)) { + return log$5.message.cannotUseScalePropertyWithNonColor(channel); + } + return undefined; + case 'type': + case 'domain': + case 'range': + case 'base': + case 'exponent': + case 'nice': + case 'padding': + case 'paddingInner': + case 'paddingOuter': + case 'rangeStep': + case 'reverse': + case 'round': + case 'clamp': + case 'zero': + return undefined; // GOOD! + } + /* istanbul ignore next: it should never reach here */ + throw new Error("Invalid scale property \"" + propName + "\"."); + } + exports.channelScalePropertyIncompatability = channelScalePropertyIncompatability; + function channelSupportScaleType(channel, scaleType) { + switch (channel) { + case channel_1$1.Channel.X: + case channel_1$1.Channel.Y: + case channel_1$1.Channel.SIZE: // TODO: size and opacity can support ordinal with more modification + case channel_1$1.Channel.OPACITY: + // Although it generally doesn't make sense to use band with size and opacity, + // it can also work since we use band: 0.5 to get midpoint. + return isContinuousToContinuous(scaleType) || util$3.contains(['band', 'point'], scaleType); + case channel_1$1.Channel.COLOR: + case channel_1$1.Channel.FILL: + case channel_1$1.Channel.STROKE: + return scaleType !== 'band'; // band does not make sense with color + case channel_1$1.Channel.SHAPE: + return scaleType === 'ordinal'; // shape = lookup only + } + /* istanbul ignore next: it should never reach here */ + return false; + } + exports.channelSupportScaleType = channelSupportScaleType; + + }); + + var scale$1 = unwrapExports(scale); + var scale_1 = scale.ScaleType; + var scale_2 = scale.SCALE_TYPES; + var scale_3 = scale.scaleCompatible; + var scale_4 = scale.scaleTypePrecedence; + var scale_5 = scale.CONTINUOUS_TO_CONTINUOUS_SCALES; + var scale_6 = scale.CONTINUOUS_DOMAIN_SCALES; + var scale_7 = scale.DISCRETE_DOMAIN_SCALES; + var scale_8 = scale.TIME_SCALE_TYPES; + var scale_9 = scale.hasDiscreteDomain; + var scale_10 = scale.isBinScale; + var scale_11 = scale.hasContinuousDomain; + var scale_12 = scale.isContinuousToContinuous; + var scale_13 = scale.defaultScaleConfig; + var scale_14 = scale.isExtendedScheme; + var scale_15 = scale.isSelectionDomain; + var scale_16 = scale.SCALE_PROPERTIES; + var scale_17 = scale.NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTIES; + var scale_18 = scale.scaleTypeSupportProperty; + var scale_19 = scale.channelScalePropertyIncompatability; + var scale_20 = scale.channelSupportScaleType; + + var scale$2 = /*#__PURE__*/Object.freeze({ + default: scale$1, + __moduleExports: scale, + ScaleType: scale_1, + SCALE_TYPES: scale_2, + scaleCompatible: scale_3, + scaleTypePrecedence: scale_4, + CONTINUOUS_TO_CONTINUOUS_SCALES: scale_5, + CONTINUOUS_DOMAIN_SCALES: scale_6, + DISCRETE_DOMAIN_SCALES: scale_7, + TIME_SCALE_TYPES: scale_8, + hasDiscreteDomain: scale_9, + isBinScale: scale_10, + hasContinuousDomain: scale_11, + isContinuousToContinuous: scale_12, + defaultScaleConfig: scale_13, + isExtendedScheme: scale_14, + isSelectionDomain: scale_15, + SCALE_PROPERTIES: scale_16, + NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTIES: scale_17, + scaleTypeSupportProperty: scale_18, + channelScalePropertyIncompatability: scale_19, + channelSupportScaleType: scale_20 + }); + + var legend = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + + exports.defaultLegendConfig = {}; + var COMMON_LEGEND_PROPERTY_INDEX = { + entryPadding: 1, + format: 1, + offset: 1, + orient: 1, + padding: 1, + tickCount: 1, + title: 1, + type: 1, + values: 1, + zindex: 1 + }; + var VG_LEGEND_PROPERTY_INDEX = tslib_1.__assign({}, COMMON_LEGEND_PROPERTY_INDEX, { + // channel scales + opacity: 1, shape: 1, stroke: 1, fill: 1, size: 1, + // encode + encode: 1 }); + exports.LEGEND_PROPERTIES = util$3.flagKeys(COMMON_LEGEND_PROPERTY_INDEX); + exports.VG_LEGEND_PROPERTIES = util$3.flagKeys(VG_LEGEND_PROPERTY_INDEX); + + }); + + var legend$1 = unwrapExports(legend); + var legend_1 = legend.defaultLegendConfig; + var legend_2 = legend.LEGEND_PROPERTIES; + var legend_3 = legend.VG_LEGEND_PROPERTIES; + + var legend$2 = /*#__PURE__*/Object.freeze({ + default: legend$1, + __moduleExports: legend, + defaultLegendConfig: legend_1, + LEGEND_PROPERTIES: legend_2, + VG_LEGEND_PROPERTIES: legend_3 + }); + + var axis_1$1 = ( axis$2 && axis$1 ) || axis$2; + + var scale_1$1 = ( scale$2 && scale$1 ) || scale$2; + + var legend_1$1 = ( legend$2 && legend$1 ) || legend$2; + + var property = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + + + + function isEncodingNestedProp(p) { + return !!p['parent']; + } + exports.isEncodingNestedProp = isEncodingNestedProp; + var ENCODING_TOPLEVEL_PROP_INDEX = { + channel: 1, + aggregate: 1, autoCount: 1, bin: 1, timeUnit: 1, hasFn: 1, + sort: 1, stack: 1, + field: 1, type: 1, + format: 1, scale: 1, axis: 1, legend: 1, + value: 1 + }; + exports.ENCODING_TOPLEVEL_PROPS = util$3.flagKeys(ENCODING_TOPLEVEL_PROP_INDEX); + function isEncodingTopLevelProperty(p) { + return p in ENCODING_TOPLEVEL_PROP_INDEX; + } + exports.isEncodingTopLevelProperty = isEncodingTopLevelProperty; + var ENCODING_NESTED_PROP_PARENT_INDEX = { + bin: 1, + scale: 1, + sort: 1, + axis: 1, + legend: 1 + }; + function isEncodingNestedParent(prop) { + return ENCODING_NESTED_PROP_PARENT_INDEX[prop]; + } + exports.isEncodingNestedParent = isEncodingNestedParent; + // FIXME -- we should not have to manually specify these + exports.BIN_CHILD_PROPS = ['maxbins', 'divide', 'extent', 'base', 'step', 'steps', 'minstep']; + exports.SORT_CHILD_PROPS = ['field', 'op', 'order']; + var BIN_PROPS = exports.BIN_CHILD_PROPS.map(function (c) { + return { parent: 'bin', child: c }; + }); + exports.SORT_PROPS = exports.SORT_CHILD_PROPS.map(function (c) { + return { parent: 'sort', child: c }; + }); + exports.SCALE_PROPS = scale_1$1.SCALE_PROPERTIES.map(function (c) { + return { parent: 'scale', child: c }; + }); + var AXIS_PROPS = axis_1$1.AXIS_PROPERTIES.map(function (c) { + return { parent: 'axis', child: c }; + }); + var LEGEND_PROPS = legend_1$1.LEGEND_PROPERTIES.map(function (c) { + return { parent: 'legend', child: c }; + }); + exports.ENCODING_NESTED_PROPS = [].concat(BIN_PROPS, exports.SORT_PROPS, exports.SCALE_PROPS, AXIS_PROPS, LEGEND_PROPS); + exports.VIEW_PROPS = ['width', 'height', 'background', 'padding', 'title']; + var PROP_KEY_DELIMITER = '.'; + function toKey(p) { + if (isEncodingNestedProp(p)) { + return p.parent + PROP_KEY_DELIMITER + p.child; + } + return p; + } + exports.toKey = toKey; + function fromKey(k) { + var split = k.split(PROP_KEY_DELIMITER); + /* istanbul ignore else */ + if (split.length === 1) { + return k; + } + else if (split.length === 2) { + return { + parent: split[0], + child: split[1] + }; + } + else { + throw 'Invalid property key with ' + split.length + ' dots: ' + k; + } + } + exports.fromKey = fromKey; + var ENCODING_NESTED_PROP_INDEX = exports.ENCODING_NESTED_PROPS.reduce(function (i, prop) { + i[prop.parent] = i[prop.parent] || []; + i[prop.parent][prop.child] = prop; + return i; + }, {}); + // FIXME consider using a more general method + function getEncodingNestedProp(parent, child) { + return (ENCODING_NESTED_PROP_INDEX[parent] || {})[child]; + } + exports.getEncodingNestedProp = getEncodingNestedProp; + function isEncodingProperty(p) { + return isEncodingTopLevelProperty(p) || isEncodingNestedProp(p); + } + exports.isEncodingProperty = isEncodingProperty; + exports.ALL_ENCODING_PROPS = [].concat(exports.ENCODING_TOPLEVEL_PROPS, exports.ENCODING_NESTED_PROPS); + exports.DEFAULT_PROP_PRECEDENCE = [ + 'type', + 'field', + // Field Transform + 'bin', 'timeUnit', 'aggregate', 'autoCount', + // Encoding + 'channel', + // Mark + 'mark', 'stack', + 'scale', 'sort', + 'axis', 'legend', + ].concat(BIN_PROPS, exports.SCALE_PROPS, AXIS_PROPS, LEGEND_PROPS, exports.SORT_PROPS); + var Property; + (function (Property) { + Property.MARK = 'mark'; + Property.TRANSFORM = 'transform'; + // Layout + Property.STACK = 'stack'; + Property.FORMAT = 'format'; + // TODO: sub parts of stack + // Encoding Properties + Property.CHANNEL = 'channel'; + Property.AGGREGATE = 'aggregate'; + Property.AUTOCOUNT = 'autoCount'; + Property.BIN = 'bin'; + Property.HAS_FN = 'hasFn'; + Property.TIMEUNIT = 'timeUnit'; + Property.FIELD = 'field'; + Property.TYPE = 'type'; + Property.SORT = 'sort'; + Property.SCALE = 'scale'; + Property.AXIS = 'axis'; + Property.LEGEND = 'legend'; + Property.WIDTH = 'width'; + Property.HEIGHT = 'height'; + Property.BACKGROUND = 'background'; + Property.PADDING = 'padding'; + Property.TITLE = 'title'; + })(Property = exports.Property || (exports.Property = {})); + + }); + + var property$1 = unwrapExports(property); + var property_1 = property.isEncodingNestedProp; + var property_2 = property.ENCODING_TOPLEVEL_PROPS; + var property_3 = property.isEncodingTopLevelProperty; + var property_4 = property.isEncodingNestedParent; + var property_5 = property.BIN_CHILD_PROPS; + var property_6 = property.SORT_CHILD_PROPS; + var property_7 = property.SORT_PROPS; + var property_8 = property.SCALE_PROPS; + var property_9 = property.ENCODING_NESTED_PROPS; + var property_10 = property.VIEW_PROPS; + var property_11 = property.toKey; + var property_12 = property.fromKey; + var property_13 = property.getEncodingNestedProp; + var property_14 = property.isEncodingProperty; + var property_15 = property.ALL_ENCODING_PROPS; + var property_16 = property.DEFAULT_PROP_PRECEDENCE; + var property_17 = property.Property; + + var property$2 = /*#__PURE__*/Object.freeze({ + default: property$1, + __moduleExports: property, + isEncodingNestedProp: property_1, + ENCODING_TOPLEVEL_PROPS: property_2, + isEncodingTopLevelProperty: property_3, + isEncodingNestedParent: property_4, + BIN_CHILD_PROPS: property_5, + SORT_CHILD_PROPS: property_6, + SORT_PROPS: property_7, + SCALE_PROPS: property_8, + ENCODING_NESTED_PROPS: property_9, + VIEW_PROPS: property_10, + toKey: property_11, + fromKey: property_12, + getEncodingNestedProp: property_13, + isEncodingProperty: property_14, + ALL_ENCODING_PROPS: property_15, + DEFAULT_PROP_PRECEDENCE: property_16, + Property: property_17 + }); + + var util$4 = createCommonjsModule(function (module) { + var u = module.exports; + + // utility functions + + var FNAME = '__name__'; + + u.namedfunc = function(name, f) { return (f[FNAME] = name, f); }; + + u.name = function(f) { return f==null ? null : f[FNAME]; }; + + u.identity = function(x) { return x; }; + + u.true = u.namedfunc('true', function() { return true; }); + + u.false = u.namedfunc('false', function() { return false; }); + + u.duplicate = function(obj) { + return JSON.parse(JSON.stringify(obj)); + }; + + u.equal = function(a, b) { + return JSON.stringify(a) === JSON.stringify(b); + }; + + u.extend = function(obj) { + for (var x, name, i=1, len=arguments.length; i 1 ? + function(x, v) { + for (var i=0; i b || b == null) && a != null ? 1 : + ((b = b instanceof Date ? +b : b), + (a = a instanceof Date ? +a : a)) !== a && b === b ? -1 : + b !== b && a === a ? 1 : 0; + }; + + u.numcmp = function(a, b) { return a - b; }; + + u.stablesort = function(array, sortBy, keyFn) { + var indices = array.reduce(function(idx, v, i) { + return (idx[keyFn(v)] = i, idx); + }, {}); + + array.sort(function(a, b) { + var sa = sortBy(a), + sb = sortBy(b); + return sa < sb ? -1 : sa > sb ? 1 + : (indices[keyFn(a)] - indices[keyFn(b)]); + }); + + return array; + }; + + // permutes an array using a Knuth shuffle + u.permute = function(a) { + var m = a.length, + swap, + i; + + while (m) { + i = Math.floor(Math.random() * m--); + swap = a[m]; + a[m] = a[i]; + a[i] = swap; + } + }; + + // string functions + + u.pad = function(s, length, pos, padchar) { + padchar = padchar || " "; + var d = length - s.length; + if (d <= 0) return s; + switch (pos) { + case 'left': + return strrep(d, padchar) + s; + case 'middle': + case 'center': + return strrep(Math.floor(d/2), padchar) + + s + strrep(Math.ceil(d/2), padchar); + default: + return s + strrep(d, padchar); + } + }; + + function strrep(n, str) { + var s = "", i; + for (i=0; i 4) { + log$5.warn(log$5.message.invalidTimeUnit('quarter', q)); + } + // We accept 1-based quarter, so need to readjust to 0-based quarter + return (q - 1) + ''; + } + else { + // Invalid quarter + throw new Error(log$5.message.invalidTimeUnit('quarter', q)); + } + } + function normalizeMonth(m) { + if (vega_util_1.isNumber(m)) { + // We accept 1-based month, so need to readjust to 0-based month + return (m - 1) + ''; + } + else { + var lowerM = m.toLowerCase(); + var monthIndex = exports.MONTHS.indexOf(lowerM); + if (monthIndex !== -1) { + return monthIndex + ''; // 0 for january, ... + } + var shortM = lowerM.substr(0, 3); + var shortMonthIndex = exports.SHORT_MONTHS.indexOf(shortM); + if (shortMonthIndex !== -1) { + return shortMonthIndex + ''; + } + // Invalid month + throw new Error(log$5.message.invalidTimeUnit('month', m)); + } + } + function normalizeDay(d) { + if (vega_util_1.isNumber(d)) { + // mod so that this can be both 0-based where 0 = sunday + // and 1-based where 7=sunday + return (d % 7) + ''; + } + else { + var lowerD = d.toLowerCase(); + var dayIndex = exports.DAYS.indexOf(lowerD); + if (dayIndex !== -1) { + return dayIndex + ''; // 0 for january, ... + } + var shortD = lowerD.substr(0, 3); + var shortDayIndex = exports.SHORT_DAYS.indexOf(shortD); + if (shortDayIndex !== -1) { + return shortDayIndex + ''; + } + // Invalid day + throw new Error(log$5.message.invalidTimeUnit('day', d)); + } + } + /** + * Return Vega Expression for a particular date time. + * @param d + * @param normalize whether to normalize quarter, month, day. + */ + function dateTimeExpr(d, normalize) { + if (normalize === void 0) { normalize = false; } + var units = []; + if (normalize && d.day !== undefined) { + if (util$3.keys(d).length > 1) { + log$5.warn(log$5.message.droppedDay(d)); + d = util$3.duplicate(d); + delete d.day; + } + } + if (d.year !== undefined) { + units.push(d.year); + } + else if (d.day !== undefined) { + // Set year to 2006 for working with day since January 1 2006 is a Sunday + units.push(SUNDAY_YEAR); + } + else { + units.push(0); + } + if (d.month !== undefined) { + var month = normalize ? normalizeMonth(d.month) : d.month; + units.push(month); + } + else if (d.quarter !== undefined) { + var quarter = normalize ? normalizeQuarter(d.quarter) : d.quarter; + units.push(quarter + '*3'); + } + else { + units.push(0); // months start at zero in JS + } + if (d.date !== undefined) { + units.push(d.date); + } + else if (d.day !== undefined) { + // HACK: Day only works as a standalone unit + // This is only correct because we always set year to 2006 for day + var day = normalize ? normalizeDay(d.day) : d.day; + units.push(day + '+1'); + } + else { + units.push(1); // Date starts at 1 in JS + } + // Note: can't use TimeUnit enum here as importing it will create + // circular dependency problem! + for (var _i = 0, _a = ['hours', 'minutes', 'seconds', 'milliseconds']; _i < _a.length; _i++) { + var timeUnit = _a[_i]; + if (d[timeUnit] !== undefined) { + units.push(d[timeUnit]); + } + else { + units.push(0); + } + } + if (d.utc) { + return "utc(" + units.join(', ') + ")"; + } + else { + return "datetime(" + units.join(', ') + ")"; + } + } + exports.dateTimeExpr = dateTimeExpr; + + }); + + var datetime$1 = unwrapExports(datetime); + var datetime_1 = datetime.isDateTime; + var datetime_2 = datetime.MONTHS; + var datetime_3 = datetime.SHORT_MONTHS; + var datetime_4 = datetime.DAYS; + var datetime_5 = datetime.SHORT_DAYS; + var datetime_6 = datetime.dateTimeExpr; + + var datetime$2 = /*#__PURE__*/Object.freeze({ + default: datetime$1, + __moduleExports: datetime, + isDateTime: datetime_1, + MONTHS: datetime_2, + SHORT_MONTHS: datetime_3, + DAYS: datetime_4, + SHORT_DAYS: datetime_5, + dateTimeExpr: datetime_6 + }); + + var datetime_1$1 = ( datetime$2 && datetime$1 ) || datetime$2; + + var timeunit = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + + + + var TimeUnit; + (function (TimeUnit) { + TimeUnit.YEAR = 'year'; + TimeUnit.MONTH = 'month'; + TimeUnit.DAY = 'day'; + TimeUnit.DATE = 'date'; + TimeUnit.HOURS = 'hours'; + TimeUnit.MINUTES = 'minutes'; + TimeUnit.SECONDS = 'seconds'; + TimeUnit.MILLISECONDS = 'milliseconds'; + TimeUnit.YEARMONTH = 'yearmonth'; + TimeUnit.YEARMONTHDATE = 'yearmonthdate'; + TimeUnit.YEARMONTHDATEHOURS = 'yearmonthdatehours'; + TimeUnit.YEARMONTHDATEHOURSMINUTES = 'yearmonthdatehoursminutes'; + TimeUnit.YEARMONTHDATEHOURSMINUTESSECONDS = 'yearmonthdatehoursminutesseconds'; + // MONTHDATE always include 29 February since we use year 0th (which is a leap year); + TimeUnit.MONTHDATE = 'monthdate'; + TimeUnit.HOURSMINUTES = 'hoursminutes'; + TimeUnit.HOURSMINUTESSECONDS = 'hoursminutesseconds'; + TimeUnit.MINUTESSECONDS = 'minutesseconds'; + TimeUnit.SECONDSMILLISECONDS = 'secondsmilliseconds'; + TimeUnit.QUARTER = 'quarter'; + TimeUnit.YEARQUARTER = 'yearquarter'; + TimeUnit.QUARTERMONTH = 'quartermonth'; + TimeUnit.YEARQUARTERMONTH = 'yearquartermonth'; + TimeUnit.UTCYEAR = 'utcyear'; + TimeUnit.UTCMONTH = 'utcmonth'; + TimeUnit.UTCDAY = 'utcday'; + TimeUnit.UTCDATE = 'utcdate'; + TimeUnit.UTCHOURS = 'utchours'; + TimeUnit.UTCMINUTES = 'utcminutes'; + TimeUnit.UTCSECONDS = 'utcseconds'; + TimeUnit.UTCMILLISECONDS = 'utcmilliseconds'; + TimeUnit.UTCYEARMONTH = 'utcyearmonth'; + TimeUnit.UTCYEARMONTHDATE = 'utcyearmonthdate'; + TimeUnit.UTCYEARMONTHDATEHOURS = 'utcyearmonthdatehours'; + TimeUnit.UTCYEARMONTHDATEHOURSMINUTES = 'utcyearmonthdatehoursminutes'; + TimeUnit.UTCYEARMONTHDATEHOURSMINUTESSECONDS = 'utcyearmonthdatehoursminutesseconds'; + // MONTHDATE always include 29 February since we use year 0th (which is a leap year); + TimeUnit.UTCMONTHDATE = 'utcmonthdate'; + TimeUnit.UTCHOURSMINUTES = 'utchoursminutes'; + TimeUnit.UTCHOURSMINUTESSECONDS = 'utchoursminutesseconds'; + TimeUnit.UTCMINUTESSECONDS = 'utcminutesseconds'; + TimeUnit.UTCSECONDSMILLISECONDS = 'utcsecondsmilliseconds'; + TimeUnit.UTCQUARTER = 'utcquarter'; + TimeUnit.UTCYEARQUARTER = 'utcyearquarter'; + TimeUnit.UTCQUARTERMONTH = 'utcquartermonth'; + TimeUnit.UTCYEARQUARTERMONTH = 'utcyearquartermonth'; + })(TimeUnit = exports.TimeUnit || (exports.TimeUnit = {})); + /** Time Unit that only corresponds to only one part of Date objects. */ + var LOCAL_SINGLE_TIMEUNIT_INDEX = { + year: 1, + quarter: 1, + month: 1, + day: 1, + date: 1, + hours: 1, + minutes: 1, + seconds: 1, + milliseconds: 1 + }; + exports.TIMEUNIT_PARTS = util$3.flagKeys(LOCAL_SINGLE_TIMEUNIT_INDEX); + function isLocalSingleTimeUnit(timeUnit) { + return !!LOCAL_SINGLE_TIMEUNIT_INDEX[timeUnit]; + } + exports.isLocalSingleTimeUnit = isLocalSingleTimeUnit; + var UTC_SINGLE_TIMEUNIT_INDEX = { + utcyear: 1, + utcquarter: 1, + utcmonth: 1, + utcday: 1, + utcdate: 1, + utchours: 1, + utcminutes: 1, + utcseconds: 1, + utcmilliseconds: 1 + }; + function isUtcSingleTimeUnit(timeUnit) { + return !!UTC_SINGLE_TIMEUNIT_INDEX[timeUnit]; + } + exports.isUtcSingleTimeUnit = isUtcSingleTimeUnit; + var LOCAL_MULTI_TIMEUNIT_INDEX = { + yearquarter: 1, + yearquartermonth: 1, + yearmonth: 1, + yearmonthdate: 1, + yearmonthdatehours: 1, + yearmonthdatehoursminutes: 1, + yearmonthdatehoursminutesseconds: 1, + quartermonth: 1, + monthdate: 1, + hoursminutes: 1, + hoursminutesseconds: 1, + minutesseconds: 1, + secondsmilliseconds: 1 + }; + var UTC_MULTI_TIMEUNIT_INDEX = { + utcyearquarter: 1, + utcyearquartermonth: 1, + utcyearmonth: 1, + utcyearmonthdate: 1, + utcyearmonthdatehours: 1, + utcyearmonthdatehoursminutes: 1, + utcyearmonthdatehoursminutesseconds: 1, + utcquartermonth: 1, + utcmonthdate: 1, + utchoursminutes: 1, + utchoursminutesseconds: 1, + utcminutesseconds: 1, + utcsecondsmilliseconds: 1 + }; + var UTC_TIMEUNIT_INDEX = tslib_1.__assign({}, UTC_SINGLE_TIMEUNIT_INDEX, UTC_MULTI_TIMEUNIT_INDEX); + function isUTCTimeUnit(t) { + return !!UTC_TIMEUNIT_INDEX[t]; + } + exports.isUTCTimeUnit = isUTCTimeUnit; + function getLocalTimeUnit(t) { + return t.substr(3); + } + exports.getLocalTimeUnit = getLocalTimeUnit; + var TIMEUNIT_INDEX = tslib_1.__assign({}, LOCAL_SINGLE_TIMEUNIT_INDEX, UTC_SINGLE_TIMEUNIT_INDEX, LOCAL_MULTI_TIMEUNIT_INDEX, UTC_MULTI_TIMEUNIT_INDEX); + exports.TIMEUNITS = util$3.flagKeys(TIMEUNIT_INDEX); + function isTimeUnit(t) { + return !!TIMEUNIT_INDEX[t]; + } + exports.isTimeUnit = isTimeUnit; + var SET_DATE_METHOD = { + year: 'setFullYear', + month: 'setMonth', + date: 'setDate', + hours: 'setHours', + minutes: 'setMinutes', + seconds: 'setSeconds', + milliseconds: 'setMilliseconds', + // Day and quarter have their own special cases + quarter: null, + day: null, + }; + /** + * Converts a date to only have the measurements relevant to the specified unit + * i.e. ('yearmonth', '2000-12-04 07:58:14') -> '2000-12-01 00:00:00' + * Note: the base date is Jan 01 1900 00:00:00 + */ + function convert(unit, date) { + var isUTC = isUTCTimeUnit(unit); + var result = isUTC ? + // start with uniform date + new Date(Date.UTC(0, 0, 1, 0, 0, 0, 0)) : + new Date(0, 0, 1, 0, 0, 0, 0); + for (var _i = 0, TIMEUNIT_PARTS_1 = exports.TIMEUNIT_PARTS; _i < TIMEUNIT_PARTS_1.length; _i++) { + var timeUnitPart = TIMEUNIT_PARTS_1[_i]; + if (containsTimeUnit(unit, timeUnitPart)) { + switch (timeUnitPart) { + case TimeUnit.DAY: + throw new Error('Cannot convert to TimeUnits containing \'day\''); + case TimeUnit.QUARTER: { + var _a = dateMethods('month', isUTC), getDateMethod_1 = _a.getDateMethod, setDateMethod_1 = _a.setDateMethod; + // indicate quarter by setting month to be the first of the quarter i.e. may (4) -> april (3) + result[setDateMethod_1]((Math.floor(date[getDateMethod_1]() / 3)) * 3); + break; + } + default: + var _b = dateMethods(timeUnitPart, isUTC), getDateMethod = _b.getDateMethod, setDateMethod = _b.setDateMethod; + result[setDateMethod](date[getDateMethod]()); + } + } + } + return result; + } + exports.convert = convert; + function dateMethods(singleUnit, isUtc) { + var rawSetDateMethod = SET_DATE_METHOD[singleUnit]; + var setDateMethod = isUtc ? 'setUTC' + rawSetDateMethod.substr(3) : rawSetDateMethod; + var getDateMethod = 'get' + (isUtc ? 'UTC' : '') + rawSetDateMethod.substr(3); + return { setDateMethod: setDateMethod, getDateMethod: getDateMethod }; + } + function getTimeUnitParts(timeUnit) { + return exports.TIMEUNIT_PARTS.reduce(function (parts, part) { + if (containsTimeUnit(timeUnit, part)) { + return parts.concat(part); + } + return parts; + }, []); + } + exports.getTimeUnitParts = getTimeUnitParts; + /** Returns true if fullTimeUnit contains the timeUnit, false otherwise. */ + function containsTimeUnit(fullTimeUnit, timeUnit) { + var index = fullTimeUnit.indexOf(timeUnit); + return index > -1 && + (timeUnit !== TimeUnit.SECONDS || + index === 0 || + fullTimeUnit.charAt(index - 1) !== 'i' // exclude milliseconds + ); + } + exports.containsTimeUnit = containsTimeUnit; + /** + * Returns Vega expresssion for a given timeUnit and fieldRef + */ + function fieldExpr(fullTimeUnit, field) { + var fieldRef = "datum" + util$3.accessPath(field); + var utc = isUTCTimeUnit(fullTimeUnit) ? 'utc' : ''; + function func(timeUnit) { + if (timeUnit === TimeUnit.QUARTER) { + // quarter starting at 0 (0,3,6,9). + return "(" + utc + "quarter(" + fieldRef + ")-1)"; + } + else { + return "" + utc + timeUnit + "(" + fieldRef + ")"; + } + } + var d = exports.TIMEUNIT_PARTS.reduce(function (dateExpr, tu) { + if (containsTimeUnit(fullTimeUnit, tu)) { + dateExpr[tu] = func(tu); + } + return dateExpr; + }, {}); + return datetime_1$1.dateTimeExpr(d); + } + exports.fieldExpr = fieldExpr; + /** + * returns the signal expression used for axis labels for a time unit + */ + function formatExpression(timeUnit, field, shortTimeLabels, isUTCScale) { + if (!timeUnit) { + return undefined; + } + var dateComponents = []; + var expression = ''; + var hasYear = containsTimeUnit(timeUnit, TimeUnit.YEAR); + if (containsTimeUnit(timeUnit, TimeUnit.QUARTER)) { + // special expression for quarter as prefix + expression = "'Q' + quarter(" + field + ")"; + } + if (containsTimeUnit(timeUnit, TimeUnit.MONTH)) { + // By default use short month name + dateComponents.push(shortTimeLabels !== false ? '%b' : '%B'); + } + if (containsTimeUnit(timeUnit, TimeUnit.DAY)) { + dateComponents.push(shortTimeLabels ? '%a' : '%A'); + } + else if (containsTimeUnit(timeUnit, TimeUnit.DATE)) { + dateComponents.push('%d' + (hasYear ? ',' : '')); // add comma if there is year + } + if (hasYear) { + dateComponents.push(shortTimeLabels ? '%y' : '%Y'); + } + var timeComponents = []; + if (containsTimeUnit(timeUnit, TimeUnit.HOURS)) { + timeComponents.push('%H'); + } + if (containsTimeUnit(timeUnit, TimeUnit.MINUTES)) { + timeComponents.push('%M'); + } + if (containsTimeUnit(timeUnit, TimeUnit.SECONDS)) { + timeComponents.push('%S'); + } + if (containsTimeUnit(timeUnit, TimeUnit.MILLISECONDS)) { + timeComponents.push('%L'); + } + var dateTimeComponents = []; + if (dateComponents.length > 0) { + dateTimeComponents.push(dateComponents.join(' ')); + } + if (timeComponents.length > 0) { + dateTimeComponents.push(timeComponents.join(':')); + } + if (dateTimeComponents.length > 0) { + if (expression) { + // Add space between quarter and main time format + expression += " + ' ' + "; + } + // We only use utcFormat for utc scale + // For utc time units, the data is already converted as a part of timeUnit transform. + // Thus, utc time units should use timeFormat to avoid shifting the time twice. + if (isUTCScale) { + expression += "utcFormat(" + field + ", '" + dateTimeComponents.join(' ') + "')"; + } + else { + expression += "timeFormat(" + field + ", '" + dateTimeComponents.join(' ') + "')"; + } + } + // If expression is still an empty string, return undefined instead. + return expression || undefined; + } + exports.formatExpression = formatExpression; + function normalizeTimeUnit(timeUnit) { + if (timeUnit !== 'day' && timeUnit.indexOf('day') >= 0) { + log$5.warn(log$5.message.dayReplacedWithDate(timeUnit)); + return timeUnit.replace('day', 'date'); + } + return timeUnit; + } + exports.normalizeTimeUnit = normalizeTimeUnit; + + }); + + var timeunit$1 = unwrapExports(timeunit); + var timeunit_1 = timeunit.TimeUnit; + var timeunit_2 = timeunit.TIMEUNIT_PARTS; + var timeunit_3 = timeunit.isLocalSingleTimeUnit; + var timeunit_4 = timeunit.isUtcSingleTimeUnit; + var timeunit_5 = timeunit.isUTCTimeUnit; + var timeunit_6 = timeunit.getLocalTimeUnit; + var timeunit_7 = timeunit.TIMEUNITS; + var timeunit_8 = timeunit.isTimeUnit; + var timeunit_9 = timeunit.convert; + var timeunit_10 = timeunit.getTimeUnitParts; + var timeunit_11 = timeunit.containsTimeUnit; + var timeunit_12 = timeunit.fieldExpr; + var timeunit_13 = timeunit.formatExpression; + var timeunit_14 = timeunit.normalizeTimeUnit; + + var timeunit$2 = /*#__PURE__*/Object.freeze({ + default: timeunit$1, + __moduleExports: timeunit, + TimeUnit: timeunit_1, + TIMEUNIT_PARTS: timeunit_2, + isLocalSingleTimeUnit: timeunit_3, + isUtcSingleTimeUnit: timeunit_4, + isUTCTimeUnit: timeunit_5, + getLocalTimeUnit: timeunit_6, + TIMEUNITS: timeunit_7, + isTimeUnit: timeunit_8, + convert: timeunit_9, + getTimeUnitParts: timeunit_10, + containsTimeUnit: timeunit_11, + fieldExpr: timeunit_12, + formatExpression: timeunit_13, + normalizeTimeUnit: timeunit_14 + }); + + var type = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + /** Constants and utilities for data type */ + /** Data type based on level of measurement */ + var Type; + (function (Type) { + Type.QUANTITATIVE = 'quantitative'; + Type.ORDINAL = 'ordinal'; + Type.TEMPORAL = 'temporal'; + Type.NOMINAL = 'nominal'; + Type.LATITUDE = 'latitude'; + Type.LONGITUDE = 'longitude'; + Type.GEOJSON = 'geojson'; + })(Type = exports.Type || (exports.Type = {})); + var TYPE_INDEX = { + quantitative: 1, + ordinal: 1, + temporal: 1, + nominal: 1, + latitude: 1, + longitude: 1, + geojson: 1 + }; + function isType(t) { + return !!TYPE_INDEX[t]; + } + exports.isType = isType; + exports.QUANTITATIVE = Type.QUANTITATIVE; + exports.ORDINAL = Type.ORDINAL; + exports.TEMPORAL = Type.TEMPORAL; + exports.NOMINAL = Type.NOMINAL; + exports.GEOJSON = Type.GEOJSON; + /** + * Get full, lowercase type name for a given type. + * @param type + * @return Full type name. + */ + function getFullName(type) { + if (type) { + type = type.toLowerCase(); + switch (type) { + case 'q': + case exports.QUANTITATIVE: + return 'quantitative'; + case 't': + case exports.TEMPORAL: + return 'temporal'; + case 'o': + case exports.ORDINAL: + return 'ordinal'; + case 'n': + case exports.NOMINAL: + return 'nominal'; + case Type.LATITUDE: + return 'latitude'; + case Type.LONGITUDE: + return 'longitude'; + case exports.GEOJSON: + return 'geojson'; + } + } + // If we get invalid input, return undefined type. + return undefined; + } + exports.getFullName = getFullName; + + }); + + var type$1 = unwrapExports(type); + var type_1 = type.Type; + var type_2 = type.isType; + var type_3 = type.QUANTITATIVE; + var type_4 = type.ORDINAL; + var type_5 = type.TEMPORAL; + var type_6 = type.NOMINAL; + var type_7 = type.GEOJSON; + var type_8 = type.getFullName; + + var type$2 = /*#__PURE__*/Object.freeze({ + default: type$1, + __moduleExports: type, + Type: type_1, + isType: type_2, + QUANTITATIVE: type_3, + ORDINAL: type_4, + TEMPORAL: type_5, + NOMINAL: type_6, + GEOJSON: type_7, + getFullName: type_8 + }); + + var property_1$1 = ( property$2 && property$1 ) || property$2; + + var util_1$2 = ( util$9 && util$8 ) || util$9; + + var mark_1$1 = ( mark$2 && mark$1 ) || mark$2; + + var timeunit_1$1 = ( timeunit$2 && timeunit$1 ) || timeunit$2; + + var type_1$1 = ( type$2 && type$1 ) || type$2; + + var wildcard = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + exports.SHORT_WILDCARD = '?'; + function isWildcard(prop) { + return isShortWildcard(prop) || isWildcardDef(prop); + } + exports.isWildcard = isWildcard; + function isShortWildcard(prop) { + return prop === exports.SHORT_WILDCARD; + } + exports.isShortWildcard = isShortWildcard; + function isWildcardDef(prop) { + return prop !== undefined && prop != null && (!!prop.enum || !!prop.name) && !util_1$2.isArray(prop); + } + exports.isWildcardDef = isWildcardDef; + function initWildcard(prop, defaultName, defaultEnumValues) { + return util_1$2.extend({}, { + name: defaultName, + enum: defaultEnumValues + }, prop === exports.SHORT_WILDCARD ? {} : prop); + } + exports.initWildcard = initWildcard; + /** + * Initial short names from list of full camelCaseNames. + * For each camelCaseNames, return unique short names based on initial (e.g., `ccn`) + */ + function initNestedPropName(fullNames) { + var index = {}; + var has = {}; + var _loop_1 = function (fullName) { + var initialIndices = [0]; + for (var i = 0; i < fullName.length; i++) { + if (fullName.charAt(i).toUpperCase() === fullName.charAt(i)) { + initialIndices.push(i); + } + } + var shortName = initialIndices.map(function (i) { return fullName.charAt(i); }).join('').toLowerCase(); + if (!has[shortName]) { + index[fullName] = shortName; + has[shortName] = true; + return "continue"; + } + // If duplicate, add last character and try again! + if (initialIndices[initialIndices.length - 1] !== fullName.length - 1) { + shortName = initialIndices.concat([fullName.length - 1]).map(function (i) { return fullName.charAt(i); }).join('').toLowerCase(); + if (!has[shortName]) { + index[fullName] = shortName; + has[shortName] = true; + return "continue"; + } + } + for (var i = 1; !index[fullName]; i++) { + var shortNameWithNo = shortName + '_' + i; + if (!has[shortNameWithNo]) { + index[fullName] = shortNameWithNo; + has[shortNameWithNo] = true; + break; + } + } + }; + for (var _i = 0, fullNames_1 = fullNames; _i < fullNames_1.length; _i++) { + var fullName = fullNames_1[_i]; + _loop_1(fullName); + } + return index; + } + exports.DEFAULT_NAME = { + mark: 'm', + channel: 'c', + aggregate: 'a', + autoCount: '#', + hasFn: 'h', + bin: 'b', + sort: 'so', + stack: 'st', + scale: 's', + format: 'f', + axis: 'ax', + legend: 'l', + value: 'v', + timeUnit: 'tu', + field: 'f', + type: 't', + binProps: { + maxbins: 'mb', + min: 'mi', + max: 'ma', + base: 'b', + step: 's', + steps: 'ss', + minstep: 'ms', + divide: 'd' + }, + sortProps: { + field: 'f', + op: 'o', + order: 'or' + }, + scaleProps: initNestedPropName(scale_1$1.SCALE_PROPERTIES), + axisProps: initNestedPropName(axis_1$1.AXIS_PROPERTIES), + legendProps: initNestedPropName(legend_1$1.LEGEND_PROPERTIES) + }; + function getDefaultName(prop) { + if (property_1$1.isEncodingNestedProp(prop)) { + return exports.DEFAULT_NAME[prop.parent] + '-' + exports.DEFAULT_NAME[prop.parent + 'Props'][prop.child]; + } + if (exports.DEFAULT_NAME[prop]) { + return exports.DEFAULT_NAME[prop]; + } + /* istanbul ignore next */ + throw new Error('Default name undefined for ' + prop); + } + exports.getDefaultName = getDefaultName; + var DEFAULT_BOOLEAN_ENUM = [false, true]; + var DEFAULT_BIN_PROPS_ENUM = { + maxbins: [5, 10, 20], + extent: [undefined], + base: [10], + step: [undefined], + steps: [undefined], + minstep: [undefined], + divide: [[5, 2]] + }; + var DEFAULT_SORT_PROPS = { + field: [undefined], + op: ['min', 'mean'], + order: ['ascending', 'descending'] + }; + var DEFAULT_SCALE_PROPS_ENUM = { + type: [undefined, scale_1$1.ScaleType.LOG], + domain: [undefined], + base: [undefined], + exponent: [1, 2], + clamp: DEFAULT_BOOLEAN_ENUM, + nice: DEFAULT_BOOLEAN_ENUM, + reverse: DEFAULT_BOOLEAN_ENUM, + round: DEFAULT_BOOLEAN_ENUM, + zero: DEFAULT_BOOLEAN_ENUM, + padding: [undefined], + paddingInner: [undefined], + paddingOuter: [undefined], + interpolate: [undefined], + range: [undefined], + rangeStep: [17, 21], + scheme: [undefined], + }; + var DEFAULT_AXIS_PROPS_ENUM = { + zindex: [1, 0], + offset: [undefined], + orient: [undefined], + values: [undefined], + encoding: [undefined], + domain: DEFAULT_BOOLEAN_ENUM, + grid: DEFAULT_BOOLEAN_ENUM, + format: [undefined], + labels: DEFAULT_BOOLEAN_ENUM, + labelAngle: [undefined], + labelOverlap: [undefined], + labelPadding: [undefined], + labelBound: [undefined], + labelFlush: [undefined], + maxExtent: [undefined], + minExtent: [undefined], + position: [undefined], + ticks: DEFAULT_BOOLEAN_ENUM, + tickCount: [undefined], + tickSize: [undefined], + title: [undefined], + titleMaxLength: [undefined], + titlePadding: [undefined] + }; + var DEFAULT_LEGEND_PROPS_ENUM = { + entryPadding: [undefined], + orient: ['left', 'right'], + offset: [undefined], + padding: [undefined], + format: [undefined], + values: [undefined], + tickCount: [undefined], + title: [undefined], + type: [undefined], + zindex: [undefined] + }; + // Use FullEnumIndex to make sure we have all properties specified here! + exports.DEFAULT_ENUM_INDEX = { + mark: [mark_1$1.Mark.POINT, mark_1$1.Mark.BAR, mark_1$1.Mark.LINE, mark_1$1.Mark.AREA, mark_1$1.Mark.RECT, mark_1$1.Mark.TICK, mark_1$1.Mark.TEXT], + channel: [channel_1$1.X, channel_1$1.Y, channel_1$1.ROW, channel_1$1.COLUMN, channel_1$1.SIZE, channel_1$1.COLOR], + aggregate: [undefined, 'mean'], + autoCount: DEFAULT_BOOLEAN_ENUM, + bin: DEFAULT_BOOLEAN_ENUM, + hasFn: DEFAULT_BOOLEAN_ENUM, + timeUnit: [undefined, timeunit_1$1.TimeUnit.YEAR, timeunit_1$1.TimeUnit.MONTH, timeunit_1$1.TimeUnit.MINUTES, timeunit_1$1.TimeUnit.SECONDS], + field: [undefined], + type: [type_1$1.Type.NOMINAL, type_1$1.Type.ORDINAL, type_1$1.Type.QUANTITATIVE, type_1$1.Type.TEMPORAL], + sort: ['ascending', 'descending'], + stack: ['zero', 'normalize', 'center', null], + value: [undefined], + format: [undefined], + scale: [true], + axis: DEFAULT_BOOLEAN_ENUM, + legend: DEFAULT_BOOLEAN_ENUM, + binProps: DEFAULT_BIN_PROPS_ENUM, + sortProps: DEFAULT_SORT_PROPS, + scaleProps: DEFAULT_SCALE_PROPS_ENUM, + axisProps: DEFAULT_AXIS_PROPS_ENUM, + legendProps: DEFAULT_LEGEND_PROPS_ENUM + }; + // TODO: rename this to getDefaultEnum + function getDefaultEnumValues(prop, schema, opt) { + if (prop === 'field' || (property_1$1.isEncodingNestedProp(prop) && prop.parent === 'sort' && prop.child === 'field')) { + // For field, by default enumerate all fields + return schema.fieldNames(); + } + var val; + if (property_1$1.isEncodingNestedProp(prop)) { + val = opt.enum[prop.parent + 'Props'][prop.child]; + } + else { + val = opt.enum[prop]; + } + if (val !== undefined) { + return val; + } + /* istanbul ignore next */ + throw new Error('No default enumValues for ' + JSON.stringify(prop)); + } + exports.getDefaultEnumValues = getDefaultEnumValues; + + }); + + var wildcard$1 = unwrapExports(wildcard); + var wildcard_1 = wildcard.SHORT_WILDCARD; + var wildcard_2 = wildcard.isWildcard; + var wildcard_3 = wildcard.isShortWildcard; + var wildcard_4 = wildcard.isWildcardDef; + var wildcard_5 = wildcard.initWildcard; + var wildcard_6 = wildcard.DEFAULT_NAME; + var wildcard_7 = wildcard.getDefaultName; + var wildcard_8 = wildcard.DEFAULT_ENUM_INDEX; + var wildcard_9 = wildcard.getDefaultEnumValues; + + var wildcard$2 = /*#__PURE__*/Object.freeze({ + default: wildcard$1, + __moduleExports: wildcard, + SHORT_WILDCARD: wildcard_1, + isWildcard: wildcard_2, + isShortWildcard: wildcard_3, + isWildcardDef: wildcard_4, + initWildcard: wildcard_5, + DEFAULT_NAME: wildcard_6, + getDefaultName: wildcard_7, + DEFAULT_ENUM_INDEX: wildcard_8, + getDefaultEnumValues: wildcard_9 + }); + + var wildcard_1$1 = ( wildcard$2 && wildcard$1 ) || wildcard$2; + + var config = createCommonjsModule(function (module, exports) { + var __assign = (commonjsGlobal && commonjsGlobal.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + + + + exports.DEFAULT_QUERY_CONFIG = { + verbose: false, + defaultSpecConfig: { + line: { point: true }, + scale: { useUnaggregatedDomain: true } + }, + propertyPrecedence: property_1$1.DEFAULT_PROP_PRECEDENCE.map(property_1$1.toKey), + enum: wildcard_1$1.DEFAULT_ENUM_INDEX, + numberNominalProportion: 0.05, + numberNominalLimit: 40, + // CONSTRAINTS + constraintManuallySpecifiedValue: false, + // Spec Constraints -- See description inside src/constraints/spec.ts + autoAddCount: false, + hasAppropriateGraphicTypeForMark: true, + omitAggregate: false, + omitAggregatePlotWithDimensionOnlyOnFacet: true, + omitAggregatePlotWithoutDimension: false, + omitBarLineAreaWithOcclusion: true, + omitBarTickWithSize: true, + omitMultipleNonPositionalChannels: true, + omitRaw: false, + omitRawContinuousFieldForAggregatePlot: true, + omitRepeatedField: true, + omitNonPositionalOrFacetOverPositionalChannels: true, + omitTableWithOcclusionIfAutoAddCount: true, + omitVerticalDotPlot: false, + omitInvalidStackSpec: true, + omitNonSumStack: true, + preferredBinAxis: channel_1$1.Channel.X, + preferredTemporalAxis: channel_1$1.Channel.X, + preferredOrdinalAxis: channel_1$1.Channel.Y, + preferredNominalAxis: channel_1$1.Channel.Y, + preferredFacet: channel_1$1.Channel.ROW, + // Field Encoding Constraints -- See description inside src/constraint/field.ts + minCardinalityForBin: 15, + maxCardinalityForCategoricalColor: 20, + maxCardinalityForFacet: 20, + maxCardinalityForShape: 6, + timeUnitShouldHaveVariation: true, + typeMatchesSchemaType: true, + // STYLIZE + stylize: true, + smallRangeStepForHighCardinalityOrFacet: { maxCardinality: 10, rangeStep: 12 }, + nominalColorScaleForHighCardinality: { maxCardinality: 10, palette: 'category20' }, + xAxisOnTopForHighYCardinalityWithoutColumn: { maxCardinality: 30 }, + // RANKING PREFERENCE + maxGoodCardinalityForFacet: 5, + maxGoodCardinalityForColor: 7, + // HIGH CARDINALITY STRINGS + minPercentUniqueForKey: .8, + minCardinalityForKey: 50, + }; + function extendConfig(opt) { + return __assign({}, exports.DEFAULT_QUERY_CONFIG, opt, { enum: extendEnumIndex(opt.enum) }); + } + exports.extendConfig = extendConfig; + function extendEnumIndex(enumIndex) { + var enumOpt = __assign({}, wildcard_1$1.DEFAULT_ENUM_INDEX, enumIndex, { binProps: extendNestedEnumIndex(enumIndex, 'bin'), scaleProps: extendNestedEnumIndex(enumIndex, 'scale'), axisProps: extendNestedEnumIndex(enumIndex, 'axis'), legendProps: extendNestedEnumIndex(enumIndex, 'legend') }); + return enumOpt; + } + function extendNestedEnumIndex(enumIndex, prop) { + return __assign({}, wildcard_1$1.DEFAULT_ENUM_INDEX[prop + 'Props'], enumIndex[prop + 'Props']); + } + + }); + + var config$1 = unwrapExports(config); + var config_1 = config.DEFAULT_QUERY_CONFIG; + var config_2 = config.extendConfig; + + var config$2 = /*#__PURE__*/Object.freeze({ + default: config$1, + __moduleExports: config, + DEFAULT_QUERY_CONFIG: config_1, + extendConfig: config_2 + }); + + var aggregate = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + + var AGGREGATE_OP_INDEX = { + argmax: 1, + argmin: 1, + average: 1, + count: 1, + distinct: 1, + max: 1, + mean: 1, + median: 1, + min: 1, + missing: 1, + q1: 1, + q3: 1, + ci0: 1, + ci1: 1, + stderr: 1, + stdev: 1, + stdevp: 1, + sum: 1, + valid: 1, + values: 1, + variance: 1, + variancep: 1, + }; + exports.AGGREGATE_OPS = util$3.flagKeys(AGGREGATE_OP_INDEX); + function isAggregateOp(a) { + return !!AGGREGATE_OP_INDEX[a]; + } + exports.isAggregateOp = isAggregateOp; + exports.COUNTING_OPS = ['count', 'valid', 'missing', 'distinct']; + function isCountingAggregateOp(aggregate) { + return aggregate && util$3.contains(exports.COUNTING_OPS, aggregate); + } + exports.isCountingAggregateOp = isCountingAggregateOp; + /** Additive-based aggregation operations. These can be applied to stack. */ + exports.SUM_OPS = [ + 'count', + 'sum', + 'distinct', + 'valid', + 'missing' + ]; + /** + * Aggregation operators that always produce values within the range [domainMin, domainMax]. + */ + exports.SHARED_DOMAIN_OPS = [ + 'mean', + 'average', + 'median', + 'q1', + 'q3', + 'min', + 'max', + ]; + exports.SHARED_DOMAIN_OP_INDEX = vega_util_1.toSet(exports.SHARED_DOMAIN_OPS); + + }); + + var aggregate$1 = unwrapExports(aggregate); + var aggregate_1 = aggregate.AGGREGATE_OPS; + var aggregate_2 = aggregate.isAggregateOp; + var aggregate_3 = aggregate.COUNTING_OPS; + var aggregate_4 = aggregate.isCountingAggregateOp; + var aggregate_5 = aggregate.SUM_OPS; + var aggregate_6 = aggregate.SHARED_DOMAIN_OPS; + var aggregate_7 = aggregate.SHARED_DOMAIN_OP_INDEX; + + var aggregate$2 = /*#__PURE__*/Object.freeze({ + default: aggregate$1, + __moduleExports: aggregate, + AGGREGATE_OPS: aggregate_1, + isAggregateOp: aggregate_2, + COUNTING_OPS: aggregate_3, + isCountingAggregateOp: aggregate_4, + SUM_OPS: aggregate_5, + SHARED_DOMAIN_OPS: aggregate_6, + SHARED_DOMAIN_OP_INDEX: aggregate_7 + }); + + var bin = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + + + function binToString(bin) { + if (vega_util_1.isBoolean(bin)) { + return 'bin'; + } + return 'bin' + util$3.keys(bin).map(function (p) { return util$3.varName("_" + p + "_" + bin[p]); }).join(''); + } + exports.binToString = binToString; + function autoMaxBins(channel) { + switch (channel) { + case channel_1$1.ROW: + case channel_1$1.COLUMN: + case channel_1$1.SIZE: + case channel_1$1.COLOR: + case channel_1$1.FILL: + case channel_1$1.STROKE: + case channel_1$1.OPACITY: + // Facets and Size shouldn't have too many bins + // We choose 6 like shape to simplify the rule + case channel_1$1.SHAPE: + return 6; // Vega's "shape" has 6 distinct values + default: + return 10; + } + } + exports.autoMaxBins = autoMaxBins; + + }); + + var bin$1 = unwrapExports(bin); + var bin_1 = bin.binToString; + var bin_2 = bin.autoMaxBins; + + var bin$2 = /*#__PURE__*/Object.freeze({ + default: bin$1, + __moduleExports: bin, + binToString: bin_1, + autoMaxBins: bin_2 + }); + + var aggregate_1$1 = ( aggregate$2 && aggregate$1 ) || aggregate$2; + + var bin_1$1 = ( bin$2 && bin$1 ) || bin$2; + + var fielddef = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + function isConditionalSelection(c) { + return c['selection']; + } + exports.isConditionalSelection = isConditionalSelection; + function isRepeatRef(field) { + return field && !vega_util_1.isString(field) && 'repeat' in field; + } + exports.isRepeatRef = isRepeatRef; + function toFieldDefBase(fieldDef) { + var field = fieldDef.field, timeUnit = fieldDef.timeUnit, bin = fieldDef.bin, aggregate = fieldDef.aggregate; + return tslib_1.__assign({}, (timeUnit ? { timeUnit: timeUnit } : {}), (bin ? { bin: bin } : {}), (aggregate ? { aggregate: aggregate } : {}), { field: field }); + } + exports.toFieldDefBase = toFieldDefBase; + function isConditionalDef(channelDef) { + return !!channelDef && !!channelDef.condition; + } + exports.isConditionalDef = isConditionalDef; + /** + * Return if a channelDef is a ConditionalValueDef with ConditionFieldDef + */ + function hasConditionalFieldDef(channelDef) { + return !!channelDef && !!channelDef.condition && !vega_util_1.isArray(channelDef.condition) && isFieldDef(channelDef.condition); + } + exports.hasConditionalFieldDef = hasConditionalFieldDef; + function hasConditionalValueDef(channelDef) { + return !!channelDef && !!channelDef.condition && (vega_util_1.isArray(channelDef.condition) || isValueDef(channelDef.condition)); + } + exports.hasConditionalValueDef = hasConditionalValueDef; + function isFieldDef(channelDef) { + return !!channelDef && (!!channelDef['field'] || channelDef['aggregate'] === 'count'); + } + exports.isFieldDef = isFieldDef; + function isStringFieldDef(fieldDef) { + return isFieldDef(fieldDef) && vega_util_1.isString(fieldDef.field); + } + exports.isStringFieldDef = isStringFieldDef; + function isValueDef(channelDef) { + return channelDef && 'value' in channelDef && channelDef['value'] !== undefined; + } + exports.isValueDef = isValueDef; + function isScaleFieldDef(channelDef) { + return !!channelDef && (!!channelDef['scale'] || !!channelDef['sort']); + } + exports.isScaleFieldDef = isScaleFieldDef; + function vgField(fieldDef, opt) { + if (opt === void 0) { opt = {}; } + var field = fieldDef.field; + var prefix = opt.prefix; + var suffix = opt.suffix; + if (isCount(fieldDef)) { + field = 'count_*'; + } + else { + var fn = undefined; + if (!opt.nofn) { + if (fieldDef.bin) { + fn = bin_1$1.binToString(fieldDef.bin); + suffix = opt.binSuffix || ''; + } + else if (fieldDef.aggregate) { + fn = String(opt.aggregate || fieldDef.aggregate); + } + else if (fieldDef.timeUnit) { + fn = String(fieldDef.timeUnit); + } + } + if (fn) { + field = fn + "_" + field; + } + } + if (suffix) { + field = field + "_" + suffix; + } + if (prefix) { + field = prefix + "_" + field; + } + if (opt.expr) { + field = "" + opt.expr + util$3.accessPath(field); + } + return field; + } + exports.vgField = vgField; + function isDiscrete(fieldDef) { + switch (fieldDef.type) { + case 'nominal': + case 'ordinal': + case 'geojson': + return true; + case 'quantitative': + return !!fieldDef.bin; + case 'latitude': + case 'longitude': + case 'temporal': + return false; + } + throw new Error(log$5.message.invalidFieldType(fieldDef.type)); + } + exports.isDiscrete = isDiscrete; + function isContinuous(fieldDef) { + return !isDiscrete(fieldDef); + } + exports.isContinuous = isContinuous; + function isCount(fieldDef) { + return fieldDef.aggregate === 'count'; + } + exports.isCount = isCount; + function verbalTitleFormatter(fieldDef, config) { + var field = fieldDef.field, bin = fieldDef.bin, timeUnit = fieldDef.timeUnit, aggregate = fieldDef.aggregate; + if (aggregate === 'count') { + return config.countTitle; + } + else if (bin) { + return field + " (binned)"; + } + else if (timeUnit) { + var units = timeunit_1$1.getTimeUnitParts(timeUnit).join('-'); + return field + " (" + units + ")"; + } + else if (aggregate) { + return util$3.titlecase(aggregate) + " of " + field; + } + return field; + } + exports.verbalTitleFormatter = verbalTitleFormatter; + function functionalTitleFormatter(fieldDef, config) { + var fn = fieldDef.aggregate || fieldDef.timeUnit || (fieldDef.bin && 'bin'); + if (fn) { + return fn.toUpperCase() + '(' + fieldDef.field + ')'; + } + else { + return fieldDef.field; + } + } + exports.functionalTitleFormatter = functionalTitleFormatter; + exports.defaultTitleFormatter = function (fieldDef, config) { + switch (config.fieldTitle) { + case 'plain': + return fieldDef.field; + case 'functional': + return functionalTitleFormatter(fieldDef, config); + default: + return verbalTitleFormatter(fieldDef, config); + } + }; + var titleFormatter = exports.defaultTitleFormatter; + function setTitleFormatter(formatter) { + titleFormatter = formatter; + } + exports.setTitleFormatter = setTitleFormatter; + function resetTitleFormatter() { + setTitleFormatter(exports.defaultTitleFormatter); + } + exports.resetTitleFormatter = resetTitleFormatter; + function title(fieldDef, config) { + return titleFormatter(fieldDef, config); + } + exports.title = title; + function defaultType(fieldDef, channel) { + if (fieldDef.timeUnit) { + return 'temporal'; + } + if (fieldDef.bin) { + return 'quantitative'; + } + switch (channel_1$1.rangeType(channel)) { + case 'continuous': + return 'quantitative'; + case 'discrete': + return 'nominal'; + case 'flexible': // color + return 'nominal'; + default: + return 'quantitative'; + } + } + exports.defaultType = defaultType; + /** + * Returns the fieldDef -- either from the outer channelDef or from the condition of channelDef. + * @param channelDef + */ + function getFieldDef(channelDef) { + if (isFieldDef(channelDef)) { + return channelDef; + } + else if (hasConditionalFieldDef(channelDef)) { + return channelDef.condition; + } + return undefined; + } + exports.getFieldDef = getFieldDef; + /** + * Convert type to full, lowercase type, or augment the fieldDef with a default type if missing. + */ + function normalize(channelDef, channel) { + if (vega_util_1.isString(channelDef) || vega_util_1.isNumber(channelDef) || vega_util_1.isBoolean(channelDef)) { + var primitiveType = vega_util_1.isString(channelDef) ? 'string' : + vega_util_1.isNumber(channelDef) ? 'number' : 'boolean'; + log$5.warn(log$5.message.primitiveChannelDef(channel, primitiveType, channelDef)); + return { value: channelDef }; + } + // If a fieldDef contains a field, we need type. + if (isFieldDef(channelDef)) { + return normalizeFieldDef(channelDef, channel); + } + else if (hasConditionalFieldDef(channelDef)) { + return tslib_1.__assign({}, channelDef, { + // Need to cast as normalizeFieldDef normally return FieldDef, but here we know that it is definitely Condition + condition: normalizeFieldDef(channelDef.condition, channel) }); + } + return channelDef; + } + exports.normalize = normalize; + function normalizeFieldDef(fieldDef, channel) { + // Drop invalid aggregate + if (fieldDef.aggregate && !aggregate_1$1.isAggregateOp(fieldDef.aggregate)) { + var aggregate = fieldDef.aggregate, fieldDefWithoutAggregate = tslib_1.__rest(fieldDef, ["aggregate"]); + log$5.warn(log$5.message.invalidAggregate(fieldDef.aggregate)); + fieldDef = fieldDefWithoutAggregate; + } + // Normalize Time Unit + if (fieldDef.timeUnit) { + fieldDef = tslib_1.__assign({}, fieldDef, { timeUnit: timeunit_1$1.normalizeTimeUnit(fieldDef.timeUnit) }); + } + // Normalize bin + if (fieldDef.bin) { + fieldDef = tslib_1.__assign({}, fieldDef, { bin: normalizeBin(fieldDef.bin, channel) }); + } + // Normalize Type + if (fieldDef.type) { + var fullType = type_1$1.getFullName(fieldDef.type); + if (fieldDef.type !== fullType) { + // convert short type to full type + fieldDef = tslib_1.__assign({}, fieldDef, { type: fullType }); + } + if (fieldDef.type !== 'quantitative') { + if (aggregate_1$1.isCountingAggregateOp(fieldDef.aggregate)) { + log$5.warn(log$5.message.invalidFieldTypeForCountAggregate(fieldDef.type, fieldDef.aggregate)); + fieldDef = tslib_1.__assign({}, fieldDef, { type: 'quantitative' }); + } + } + } + else { + // If type is empty / invalid, then augment with default type + var newType = defaultType(fieldDef, channel); + log$5.warn(log$5.message.emptyOrInvalidFieldType(fieldDef.type, channel, newType)); + fieldDef = tslib_1.__assign({}, fieldDef, { type: newType }); + } + var _a = channelCompatibility(fieldDef, channel), compatible = _a.compatible, warning = _a.warning; + if (!compatible) { + log$5.warn(warning); + } + return fieldDef; + } + exports.normalizeFieldDef = normalizeFieldDef; + function normalizeBin(bin, channel) { + if (vega_util_1.isBoolean(bin)) { + return { maxbins: bin_1$1.autoMaxBins(channel) }; + } + else if (!bin.maxbins && !bin.step) { + return tslib_1.__assign({}, bin, { maxbins: bin_1$1.autoMaxBins(channel) }); + } + else { + return bin; + } + } + exports.normalizeBin = normalizeBin; + var COMPATIBLE = { compatible: true }; + function channelCompatibility(fieldDef, channel) { + switch (channel) { + case 'row': + case 'column': + if (isContinuous(fieldDef) && !fieldDef.timeUnit) { + // TODO:(https://github.com/vega/vega-lite/issues/2011): + // with timeUnit it's not always strictly continuous + return { + compatible: false, + warning: log$5.message.facetChannelShouldBeDiscrete(channel) + }; + } + return COMPATIBLE; + case 'x': + case 'y': + case 'color': + case 'fill': + case 'stroke': + case 'text': + case 'detail': + case 'key': + case 'tooltip': + case 'href': + return COMPATIBLE; + case 'longitude': + case 'longitude2': + case 'latitude': + case 'latitude2': + if (fieldDef.type !== type_1$1.QUANTITATIVE) { + return { + compatible: false, + warning: "Channel " + channel + " should not be used with " + fieldDef.type + " field." + }; + } + return COMPATIBLE; + case 'opacity': + case 'size': + case 'x2': + case 'y2': + if (isDiscrete(fieldDef) && !fieldDef.bin) { + return { + compatible: false, + warning: "Channel " + channel + " should not be used with discrete field." + }; + } + return COMPATIBLE; + case 'shape': + if (fieldDef.type !== 'nominal' && fieldDef.type !== 'geojson') { + return { + compatible: false, + warning: 'Shape channel should be used with nominal data or geojson only' + }; + } + return COMPATIBLE; + case 'order': + if (fieldDef.type === 'nominal') { + return { + compatible: false, + warning: "Channel order is inappropriate for nominal field, which has no inherent order." + }; + } + return COMPATIBLE; + } + throw new Error('channelCompatability not implemented for channel ' + channel); + } + exports.channelCompatibility = channelCompatibility; + function isNumberFieldDef(fieldDef) { + return fieldDef.type === 'quantitative' || !!fieldDef.bin; + } + exports.isNumberFieldDef = isNumberFieldDef; + function isTimeFieldDef(fieldDef) { + return fieldDef.type === 'temporal' || !!fieldDef.timeUnit; + } + exports.isTimeFieldDef = isTimeFieldDef; + + }); + + var fielddef$1 = unwrapExports(fielddef); + var fielddef_1 = fielddef.isConditionalSelection; + var fielddef_2 = fielddef.isRepeatRef; + var fielddef_3 = fielddef.toFieldDefBase; + var fielddef_4 = fielddef.isConditionalDef; + var fielddef_5 = fielddef.hasConditionalFieldDef; + var fielddef_6 = fielddef.hasConditionalValueDef; + var fielddef_7 = fielddef.isFieldDef; + var fielddef_8 = fielddef.isStringFieldDef; + var fielddef_9 = fielddef.isValueDef; + var fielddef_10 = fielddef.isScaleFieldDef; + var fielddef_11 = fielddef.vgField; + var fielddef_12 = fielddef.isDiscrete; + var fielddef_13 = fielddef.isContinuous; + var fielddef_14 = fielddef.isCount; + var fielddef_15 = fielddef.verbalTitleFormatter; + var fielddef_16 = fielddef.functionalTitleFormatter; + var fielddef_17 = fielddef.defaultTitleFormatter; + var fielddef_18 = fielddef.setTitleFormatter; + var fielddef_19 = fielddef.resetTitleFormatter; + var fielddef_20 = fielddef.title; + var fielddef_21 = fielddef.defaultType; + var fielddef_22 = fielddef.getFieldDef; + var fielddef_23 = fielddef.normalize; + var fielddef_24 = fielddef.normalizeFieldDef; + var fielddef_25 = fielddef.normalizeBin; + var fielddef_26 = fielddef.channelCompatibility; + var fielddef_27 = fielddef.isNumberFieldDef; + var fielddef_28 = fielddef.isTimeFieldDef; + + var fielddef$2 = /*#__PURE__*/Object.freeze({ + default: fielddef$1, + __moduleExports: fielddef, + isConditionalSelection: fielddef_1, + isRepeatRef: fielddef_2, + toFieldDefBase: fielddef_3, + isConditionalDef: fielddef_4, + hasConditionalFieldDef: fielddef_5, + hasConditionalValueDef: fielddef_6, + isFieldDef: fielddef_7, + isStringFieldDef: fielddef_8, + isValueDef: fielddef_9, + isScaleFieldDef: fielddef_10, + vgField: fielddef_11, + isDiscrete: fielddef_12, + isContinuous: fielddef_13, + isCount: fielddef_14, + verbalTitleFormatter: fielddef_15, + functionalTitleFormatter: fielddef_16, + defaultTitleFormatter: fielddef_17, + setTitleFormatter: fielddef_18, + resetTitleFormatter: fielddef_19, + title: fielddef_20, + defaultType: fielddef_21, + getFieldDef: fielddef_22, + normalize: fielddef_23, + normalizeFieldDef: fielddef_24, + normalizeBin: fielddef_25, + channelCompatibility: fielddef_26, + isNumberFieldDef: fielddef_27, + isTimeFieldDef: fielddef_28 + }); + + var expandedtype = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + var ExpandedType; + (function (ExpandedType) { + ExpandedType.QUANTITATIVE = type_1$1.Type.QUANTITATIVE; + ExpandedType.ORDINAL = type_1$1.Type.ORDINAL; + ExpandedType.TEMPORAL = type_1$1.Type.TEMPORAL; + ExpandedType.NOMINAL = type_1$1.Type.NOMINAL; + ExpandedType.KEY = 'key'; + })(ExpandedType = exports.ExpandedType || (exports.ExpandedType = {})); + function isDiscrete(fieldType) { + return fieldType === type_1$1.Type.ORDINAL || fieldType === type_1$1.Type.NOMINAL || fieldType === ExpandedType.KEY; + } + exports.isDiscrete = isDiscrete; + + }); + + var expandedtype$1 = unwrapExports(expandedtype); + var expandedtype_1 = expandedtype.ExpandedType; + var expandedtype_2 = expandedtype.isDiscrete; + + var expandedtype$2 = /*#__PURE__*/Object.freeze({ + default: expandedtype$1, + __moduleExports: expandedtype, + ExpandedType: expandedtype_1, + isDiscrete: expandedtype_2 + }); + + var type$3 = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + + + var scale_2 = scale_1$1; + + + var util_1 = util$3; + /** + * Determine if there is a specified scale type and if it is appropriate, + * or determine default type if type is unspecified or inappropriate. + */ + // NOTE: CompassQL uses this method. + function scaleType(specifiedType, channel, fieldDef, mark, scaleConfig) { + var defaultScaleType = defaultType(channel, fieldDef, mark, scaleConfig); + if (!channel_1$1.isScaleChannel(channel)) { + // There is no scale for these channels + return null; + } + if (specifiedType !== undefined) { + // Check if explicitly specified scale type is supported by the channel + if (!scale_1$1.channelSupportScaleType(channel, specifiedType)) { + log$5.warn(log$5.message.scaleTypeNotWorkWithChannel(channel, specifiedType, defaultScaleType)); + return defaultScaleType; + } + // Check if explicitly specified scale type is supported by the data type + if (!fieldDefMatchScaleType(specifiedType, fieldDef)) { + log$5.warn(log$5.message.scaleTypeNotWorkWithFieldDef(specifiedType, defaultScaleType)); + return defaultScaleType; + } + return specifiedType; + } + return defaultScaleType; + } + exports.scaleType = scaleType; + /** + * Determine appropriate default scale type. + */ + // NOTE: Voyager uses this method. + function defaultType(channel, fieldDef, mark, scaleConfig) { + switch (fieldDef.type) { + case 'nominal': + case 'ordinal': + if (channel_1$1.isColorChannel(channel) || channel_1$1.rangeType(channel) === 'discrete') { + if (channel === 'shape' && fieldDef.type === 'ordinal') { + log$5.warn(log$5.message.discreteChannelCannotEncode(channel, 'ordinal')); + } + return 'ordinal'; + } + if (util$3.contains(['x', 'y'], channel)) { + if (util$3.contains(['rect', 'bar', 'rule'], mark)) { + // The rect/bar mark should fit into a band. + // For rule, using band scale to make rule align with axis ticks better https://github.com/vega/vega-lite/issues/3429 + return 'band'; + } + if (mark === 'bar') { + return 'band'; + } + } + // Otherwise, use ordinal point scale so we can easily get center positions of the marks. + return 'point'; + case 'temporal': + if (channel_1$1.isColorChannel(channel)) { + return 'sequential'; + } + else if (channel_1$1.rangeType(channel) === 'discrete') { + log$5.warn(log$5.message.discreteChannelCannotEncode(channel, 'temporal')); + // TODO: consider using quantize (equivalent to binning) once we have it + return 'ordinal'; + } + return 'time'; + case 'quantitative': + if (channel_1$1.isColorChannel(channel)) { + if (fieldDef.bin) { + return 'bin-ordinal'; + } + // Use `sequential` as the default color scale for continuous data + // since it supports both array range and scheme range. + return 'sequential'; + } + else if (channel_1$1.rangeType(channel) === 'discrete') { + log$5.warn(log$5.message.discreteChannelCannotEncode(channel, 'quantitative')); + // TODO: consider using quantize (equivalent to binning) once we have it + return 'ordinal'; + } + // x and y use a linear scale because selections don't work with bin scales. + // Binned scales apply discretization but pan/zoom apply transformations to a [min, max] extent domain. + if (fieldDef.bin && channel !== 'x' && channel !== 'y') { + return 'bin-linear'; + } + return 'linear'; + case 'latitude': + case 'longitude': + case 'geojson': + return undefined; + } + /* istanbul ignore next: should never reach this */ + throw new Error(log$5.message.invalidFieldType(fieldDef.type)); + } + function fieldDefMatchScaleType(specifiedType, fieldDef) { + var type = fieldDef.type; + if (util_1.contains([type_1$1.Type.ORDINAL, type_1$1.Type.NOMINAL], type)) { + return specifiedType === undefined || scale_2.hasDiscreteDomain(specifiedType); + } + else if (type === type_1$1.Type.TEMPORAL) { + return util_1.contains([scale_1$1.ScaleType.TIME, scale_1$1.ScaleType.UTC, scale_1$1.ScaleType.SEQUENTIAL, undefined], specifiedType); + } + else if (type === type_1$1.Type.QUANTITATIVE) { + if (fieldDef.bin) { + return util_1.contains([scale_1$1.ScaleType.BIN_LINEAR, scale_1$1.ScaleType.BIN_ORDINAL, scale_1$1.ScaleType.LINEAR], specifiedType); + } + return util_1.contains([scale_1$1.ScaleType.LOG, scale_1$1.ScaleType.POW, scale_1$1.ScaleType.SQRT, scale_1$1.ScaleType.QUANTILE, scale_1$1.ScaleType.QUANTIZE, scale_1$1.ScaleType.LINEAR, scale_1$1.ScaleType.SEQUENTIAL, undefined], specifiedType); + } + return true; + } + exports.fieldDefMatchScaleType = fieldDefMatchScaleType; + + }); + + var type$4 = unwrapExports(type$3); + var type_2$1 = type$3.scaleType; + var type_3$1 = type$3.fieldDefMatchScaleType; + + var type$5 = /*#__PURE__*/Object.freeze({ + default: type$4, + __moduleExports: type$3, + scaleType: type_2$1, + fieldDefMatchScaleType: type_3$1 + }); + + var fielddef_1$1 = ( fielddef$2 && fielddef$1 ) || fielddef$2; + + var encoding = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + function channelHasField(encoding, channel) { + var channelDef = encoding && encoding[channel]; + if (channelDef) { + if (vega_util_1.isArray(channelDef)) { + return util$3.some(channelDef, function (fieldDef) { return !!fieldDef.field; }); + } + else { + return fielddef_1$1.isFieldDef(channelDef) || fielddef_1$1.hasConditionalFieldDef(channelDef); + } + } + return false; + } + exports.channelHasField = channelHasField; + function isAggregate(encoding) { + return util$3.some(channel_1$1.CHANNELS, function (channel) { + if (channelHasField(encoding, channel)) { + var channelDef = encoding[channel]; + if (vega_util_1.isArray(channelDef)) { + return util$3.some(channelDef, function (fieldDef) { return !!fieldDef.aggregate; }); + } + else { + var fieldDef = fielddef_1$1.getFieldDef(channelDef); + return fieldDef && !!fieldDef.aggregate; + } + } + return false; + }); + } + exports.isAggregate = isAggregate; + function normalizeEncoding(encoding, mark) { + return util$3.keys(encoding).reduce(function (normalizedEncoding, channel) { + if (!channel_1$1.isChannel(channel)) { + // Drop invalid channel + log$5.warn(log$5.message.invalidEncodingChannel(channel)); + return normalizedEncoding; + } + if (!channel_1$1.supportMark(channel, mark)) { + // Drop unsupported channel + log$5.warn(log$5.message.incompatibleChannel(channel, mark)); + return normalizedEncoding; + } + // Drop line's size if the field is aggregated. + if (channel === 'size' && mark === 'line') { + var fieldDef = fielddef_1$1.getFieldDef(encoding[channel]); + if (fieldDef && fieldDef.aggregate) { + log$5.warn(log$5.message.LINE_WITH_VARYING_SIZE); + return normalizedEncoding; + } + } + // Drop color if either fill or stroke is specified + if (channel === 'color' && ('fill' in encoding || 'stroke' in encoding)) { + log$5.warn(log$5.message.droppingColor('encoding', { fill: 'fill' in encoding, stroke: 'stroke' in encoding })); + return normalizedEncoding; + } + if (channel === 'detail' || channel === 'order' || (channel === 'tooltip' && vega_util_1.isArray(encoding[channel]))) { + var channelDef = encoding[channel]; + if (channelDef) { + // Array of fieldDefs for detail channel (or production rule) + normalizedEncoding[channel] = (vega_util_1.isArray(channelDef) ? channelDef : [channelDef]) + .reduce(function (defs, fieldDef) { + if (!fielddef_1$1.isFieldDef(fieldDef)) { + log$5.warn(log$5.message.emptyFieldDef(fieldDef, channel)); + } + else { + defs.push(fielddef_1$1.normalizeFieldDef(fieldDef, channel)); + } + return defs; + }, []); + } + } + else { + // FIXME: remove this casting. (I don't know why Typescript doesn't infer this correctly here.) + var channelDef = encoding[channel]; + var fieldDef = fielddef_1$1.getFieldDef(encoding[channel]); + if (fieldDef && util$3.contains([type_1$1.Type.LATITUDE, type_1$1.Type.LONGITUDE], fieldDef.type)) { + var _a = channel, _ = normalizedEncoding[_a], newEncoding = tslib_1.__rest(normalizedEncoding, [typeof _a === "symbol" ? _a : _a + ""]); + var newChannel = channel === 'x' ? 'longitude' : + channel === 'y' ? 'latitude' : + channel === 'x2' ? 'longitude2' : + channel === 'y2' ? 'latitude2' : undefined; + log$5.warn(log$5.message.latLongDeprecated(channel, fieldDef.type, newChannel)); + return tslib_1.__assign({}, newEncoding, (_b = {}, _b[newChannel] = tslib_1.__assign({}, fielddef_1$1.normalize(fieldDef, channel), { type: 'quantitative' }), _b)); + } + if (!fielddef_1$1.isFieldDef(channelDef) && !fielddef_1$1.isValueDef(channelDef) && !fielddef_1$1.isConditionalDef(channelDef)) { + log$5.warn(log$5.message.emptyFieldDef(channelDef, channel)); + return normalizedEncoding; + } + normalizedEncoding[channel] = fielddef_1$1.normalize(channelDef, channel); + } + return normalizedEncoding; + var _b; + }, {}); + } + exports.normalizeEncoding = normalizeEncoding; + function isRanged(encoding) { + return encoding && ((!!encoding.x && !!encoding.x2) || (!!encoding.y && !!encoding.y2)); + } + exports.isRanged = isRanged; + function fieldDefs(encoding) { + var arr = []; + channel_1$1.CHANNELS.forEach(function (channel) { + if (channelHasField(encoding, channel)) { + var channelDef = encoding[channel]; + (vega_util_1.isArray(channelDef) ? channelDef : [channelDef]).forEach(function (def) { + if (fielddef_1$1.isFieldDef(def)) { + arr.push(def); + } + else if (fielddef_1$1.hasConditionalFieldDef(def)) { + arr.push(def.condition); + } + }); + } + }); + return arr; + } + exports.fieldDefs = fieldDefs; + function forEach(mapping, f, thisArg) { + if (!mapping) { + return; + } + var _loop_1 = function (channel) { + if (vega_util_1.isArray(mapping[channel])) { + mapping[channel].forEach(function (channelDef) { + f.call(thisArg, channelDef, channel); + }); + } + else { + f.call(thisArg, mapping[channel], channel); + } + }; + for (var _i = 0, _a = util$3.keys(mapping); _i < _a.length; _i++) { + var channel = _a[_i]; + _loop_1(channel); + } + } + exports.forEach = forEach; + function reduce(mapping, f, init, thisArg) { + if (!mapping) { + return init; + } + return util$3.keys(mapping).reduce(function (r, channel) { + var map = mapping[channel]; + if (vega_util_1.isArray(map)) { + return map.reduce(function (r1, channelDef) { + return f.call(thisArg, r1, channelDef, channel); + }, r); + } + else { + return f.call(thisArg, r, map, channel); + } + }, init); + } + exports.reduce = reduce; + + }); + + var encoding$1 = unwrapExports(encoding); + var encoding_1 = encoding.channelHasField; + var encoding_2 = encoding.isAggregate; + var encoding_3 = encoding.normalizeEncoding; + var encoding_4 = encoding.isRanged; + var encoding_5 = encoding.fieldDefs; + var encoding_6 = encoding.forEach; + var encoding_7 = encoding.reduce; + + var encoding$2 = /*#__PURE__*/Object.freeze({ + default: encoding$1, + __moduleExports: encoding, + channelHasField: encoding_1, + isAggregate: encoding_2, + normalizeEncoding: encoding_3, + isRanged: encoding_4, + fieldDefs: encoding_5, + forEach: encoding_6, + reduce: encoding_7 + }); + + var encoding_1$1 = ( encoding$2 && encoding$1 ) || encoding$2; + + var stack_1 = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + var STACK_OFFSET_INDEX = { + zero: 1, + center: 1, + normalize: 1 + }; + function isStackOffset(s) { + return !!STACK_OFFSET_INDEX[s]; + } + exports.isStackOffset = isStackOffset; + exports.STACKABLE_MARKS = [mark_1$1.BAR, mark_1$1.AREA, mark_1$1.RULE, mark_1$1.POINT, mark_1$1.CIRCLE, mark_1$1.SQUARE, mark_1$1.LINE, mark_1$1.TEXT, mark_1$1.TICK]; + exports.STACK_BY_DEFAULT_MARKS = [mark_1$1.BAR, mark_1$1.AREA]; + function potentialStackedChannel(encoding) { + var xDef = encoding.x; + var yDef = encoding.y; + if (fielddef_1$1.isFieldDef(xDef) && fielddef_1$1.isFieldDef(yDef)) { + if (xDef.type === 'quantitative' && yDef.type === 'quantitative') { + if (xDef.stack) { + return 'x'; + } + else if (yDef.stack) { + return 'y'; + } + // if there is no explicit stacking, only apply stack if there is only one aggregate for x or y + if ((!!xDef.aggregate) !== (!!yDef.aggregate)) { + return xDef.aggregate ? 'x' : 'y'; + } + } + else if (xDef.type === 'quantitative') { + return 'x'; + } + else if (yDef.type === 'quantitative') { + return 'y'; + } + } + else if (fielddef_1$1.isFieldDef(xDef) && xDef.type === 'quantitative') { + return 'x'; + } + else if (fielddef_1$1.isFieldDef(yDef) && yDef.type === 'quantitative') { + return 'y'; + } + return undefined; + } + // Note: CompassQL uses this method and only pass in required properties of each argument object. + // If required properties change, make sure to update CompassQL. + function stack(m, encoding, stackConfig) { + var mark = mark_1$1.isMarkDef(m) ? m.type : m; + // Should have stackable mark + if (!util$3.contains(exports.STACKABLE_MARKS, mark)) { + return null; + } + var fieldChannel = potentialStackedChannel(encoding); + if (!fieldChannel) { + return null; + } + var stackedFieldDef = encoding[fieldChannel]; + var stackedField = fielddef_1$1.isStringFieldDef(stackedFieldDef) ? fielddef_1$1.vgField(stackedFieldDef, {}) : undefined; + var dimensionChannel = fieldChannel === 'x' ? 'y' : 'x'; + var dimensionDef = encoding[dimensionChannel]; + var dimensionField = fielddef_1$1.isStringFieldDef(dimensionDef) ? fielddef_1$1.vgField(dimensionDef, {}) : undefined; + // Should have grouping level of detail that is different from the dimension field + var stackBy = channel_1$1.NONPOSITION_CHANNELS.reduce(function (sc, channel) { + if (encoding_1$1.channelHasField(encoding, channel)) { + var channelDef = encoding[channel]; + (vega_util_1.isArray(channelDef) ? channelDef : [channelDef]).forEach(function (cDef) { + var fieldDef = fielddef_1$1.getFieldDef(cDef); + if (fieldDef.aggregate) { + return; + } + // Check whether the channel's field is identical to x/y's field or if the channel is a repeat + var f = fielddef_1$1.isStringFieldDef(fieldDef) ? fielddef_1$1.vgField(fieldDef, {}) : undefined; + if ( + // if fielddef is a repeat, just include it in the stack by + !f || + // otherwise, the field must be different from x and y fields. + (f !== dimensionField && f !== stackedField)) { + sc.push({ channel: channel, fieldDef: fieldDef }); + } + }); + } + return sc; + }, []); + if (stackBy.length === 0) { + return null; + } + // Automatically determine offset + var offset = undefined; + if (stackedFieldDef.stack !== undefined) { + offset = stackedFieldDef.stack; + } + else if (util$3.contains(exports.STACK_BY_DEFAULT_MARKS, mark)) { + // Bar and Area with sum ops are automatically stacked by default + offset = stackConfig === undefined ? 'zero' : stackConfig; + } + else { + offset = stackConfig; + } + if (!offset || !isStackOffset(offset)) { + return null; + } + // If stacked, check scale type if it is linear + if (stackedFieldDef.scale && stackedFieldDef.scale.type && stackedFieldDef.scale.type !== scale_1$1.ScaleType.LINEAR) { + log$5.warn(log$5.message.cannotStackNonLinearScale(stackedFieldDef.scale.type)); + return null; + } + // Check if it is a ranged mark + if (encoding_1$1.channelHasField(encoding, fieldChannel === channel_1$1.X ? channel_1$1.X2 : channel_1$1.Y2)) { + log$5.warn(log$5.message.cannotStackRangedMark(fieldChannel)); + return null; + } + // Warn if stacking summative aggregate + if (stackedFieldDef.aggregate && !util$3.contains(aggregate_1$1.SUM_OPS, stackedFieldDef.aggregate)) { + log$5.warn(log$5.message.stackNonSummativeAggregate(stackedFieldDef.aggregate)); + } + return { + groupbyChannel: dimensionDef ? dimensionChannel : undefined, + fieldChannel: fieldChannel, + impute: mark_1$1.isPathMark(mark), + stackBy: stackBy, + offset: offset + }; + } + exports.stack = stack; + + }); + + var stack = unwrapExports(stack_1); + var stack_2 = stack_1.isStackOffset; + var stack_3 = stack_1.STACKABLE_MARKS; + var stack_4 = stack_1.STACK_BY_DEFAULT_MARKS; + var stack_5 = stack_1.stack; + + var stack$1 = /*#__PURE__*/Object.freeze({ + default: stack, + __moduleExports: stack_1, + isStackOffset: stack_2, + STACKABLE_MARKS: stack_3, + STACK_BY_DEFAULT_MARKS: stack_4, + stack: stack_5 + }); + + var stack_1$1 = ( stack$1 && stack ) || stack$1; + + var encoding_1$2 = ( encoding$5 && encoding$4 ) || encoding$5; + + var spec = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + /** + * Convert a Vega-Lite's ExtendedUnitSpec into a CompassQL's SpecQuery + * @param {ExtendedUnitSpec} spec + * @returns + */ + function fromSpec(spec) { + return util_1$2.extend(spec.data ? { data: spec.data } : {}, spec.transform ? { transform: spec.transform } : {}, spec.width ? { width: spec.width } : {}, spec.height ? { height: spec.height } : {}, spec.background ? { background: spec.background } : {}, spec.padding ? { padding: spec.padding } : {}, spec.title ? { title: spec.title } : {}, { + mark: spec.mark, + encodings: util_1$2.keys(spec.encoding).map(function (channel) { + var encQ = { channel: channel }; + var channelDef = spec.encoding[channel]; + for (var prop in channelDef) { + if (property_1$1.isEncodingTopLevelProperty(prop) && channelDef[prop] !== undefined) { + // Currently bin, scale, axis, legend only support boolean, but not null. + // Therefore convert null to false. + if (util_1$2.contains(['bin', 'scale', 'axis', 'legend'], prop) && channelDef[prop] === null) { + encQ[prop] = false; + } + else { + encQ[prop] = channelDef[prop]; + } + } + } + if (encoding_1$2.isFieldQuery(encQ) && encQ.aggregate === 'count' && !encQ.field) { + encQ.field = '*'; + } + return encQ; + }) + }, spec.config ? { config: spec.config } : {}); + } + exports.fromSpec = fromSpec; + function isAggregate(specQ) { + return util_1$2.some(specQ.encodings, function (encQ) { + return (encoding_1$2.isFieldQuery(encQ) && !wildcard_1$1.isWildcard(encQ.aggregate) && !!encQ.aggregate) || encoding_1$2.isEnabledAutoCountQuery(encQ); + }); + } + exports.isAggregate = isAggregate; + /** + * @return The Vega-Lite `StackProperties` object that describes the stack + * configuration of `specQ`. Returns `null` if this is not stackable. + */ + function getVlStack(specQ) { + if (!hasRequiredStackProperties(specQ)) { + return null; + } + var encoding = encoding_1$2.toEncoding(specQ.encodings, { schema: null, wildcardMode: 'null' }); + var mark = specQ.mark; + return stack_1$1.stack(mark, encoding, getStackOffset(specQ)); + } + exports.getVlStack = getVlStack; + /** + * @return The `StackOffset` specified in `specQ`, `undefined` if none + * is specified. + */ + function getStackOffset(specQ) { + for (var _i = 0, _a = specQ.encodings; _i < _a.length; _i++) { + var encQ = _a[_i]; + if (encQ[property_1$1.Property.STACK] !== undefined && !wildcard_1$1.isWildcard(encQ[property_1$1.Property.STACK])) { + return encQ[property_1$1.Property.STACK]; + } + } + return undefined; + } + exports.getStackOffset = getStackOffset; + /** + * @return The `Channel` in which `stack` is specified in `specQ`, or + * `null` if none is specified. + */ + function getStackChannel(specQ) { + for (var _i = 0, _a = specQ.encodings; _i < _a.length; _i++) { + var encQ = _a[_i]; + if (encQ[property_1$1.Property.STACK] !== undefined && !wildcard_1$1.isWildcard(encQ.channel)) { + return encQ.channel; + } + } + return null; + } + exports.getStackChannel = getStackChannel; + /** + * Returns true iff the given SpecQuery has the properties defined + * to be a potential Stack spec. + * @param specQ The SpecQuery in question. + */ + function hasRequiredStackProperties(specQ) { + // TODO(haldenl): make this leaner, a lot of encQ properties aren't required for stack. + // TODO(haldenl): check mark, then encodings + if (wildcard_1$1.isWildcard(specQ.mark)) { + return false; + } + var requiredEncodingProps = [property_1$1.Property.STACK, property_1$1.Property.CHANNEL, + property_1$1.Property.MARK, property_1$1.Property.FIELD, property_1$1.Property.AGGREGATE, property_1$1.Property.AUTOCOUNT, property_1$1.Property.SCALE, + property_1$1.getEncodingNestedProp('scale', 'type'), property_1$1.Property.TYPE]; + var exclude = util$6.toMap(util_1$2.without(property_1$1.ALL_ENCODING_PROPS, requiredEncodingProps)); + var encodings = specQ.encodings.filter(function (encQ) { return !encoding_1$2.isDisabledAutoCountQuery(encQ); }); + for (var _i = 0, encodings_1 = encodings; _i < encodings_1.length; _i++) { + var encQ = encodings_1[_i]; + if (objectContainsWildcard(encQ, { exclude: exclude })) { + return false; + } + } + return true; + } + exports.hasRequiredStackProperties = hasRequiredStackProperties; + /** + * Returns true iff the given object does not contain a nested wildcard. + * @param obj The object in question. + * @param opt With optional `exclude` property, which defines properties to + * ignore when testing for wildcards. + */ + // TODO(haldenl): rename to objectHasWildcard, rename prop to obj + function objectContainsWildcard(obj, opt) { + if (opt === void 0) { opt = {}; } + if (!util_1$2.isObject(obj)) { + return false; + } + for (var childProp in obj) { + if (obj.hasOwnProperty(childProp)) { + var wildcard = wildcard_1$1.isWildcard(obj[childProp]); + if ((wildcard && (!opt.exclude || !opt.exclude[childProp])) || + objectContainsWildcard(obj[childProp], opt)) { + return true; + } + } + } + return false; + } + /** + * Returns true iff the given `specQ` contains a wildcard. + * @param specQ The `SpecQuery` in question. + * @param opt With optional `exclude` property, which defines properties to + * ignore when testing for wildcards. + */ + function hasWildcard(specQ, opt) { + if (opt === void 0) { opt = {}; } + var exclude = opt.exclude ? util$6.toMap(opt.exclude.map(property_1$1.toKey)) : {}; + if (wildcard_1$1.isWildcard(specQ.mark) && !exclude['mark']) { + return true; + } + for (var _i = 0, _a = specQ.encodings; _i < _a.length; _i++) { + var encQ = _a[_i]; + if (objectContainsWildcard(encQ, exclude)) { + return true; + } + } + return false; + } + exports.hasWildcard = hasWildcard; + + }); + + var spec$1 = unwrapExports(spec); + var spec_1 = spec.fromSpec; + var spec_2 = spec.isAggregate; + var spec_3 = spec.getVlStack; + var spec_4 = spec.getStackOffset; + var spec_5 = spec.getStackChannel; + var spec_6 = spec.hasRequiredStackProperties; + var spec_7 = spec.hasWildcard; + + var spec$2 = /*#__PURE__*/Object.freeze({ + default: spec$1, + __moduleExports: spec, + fromSpec: spec_1, + isAggregate: spec_2, + getVlStack: spec_3, + getStackOffset: spec_4, + getStackChannel: spec_5, + hasRequiredStackProperties: spec_6, + hasWildcard: spec_7 + }); + + var propindex = createCommonjsModule(function (module, exports) { + var __assign = (commonjsGlobal && commonjsGlobal.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + + + /** + * Dictionary that takes property as a key. + */ + var PropIndex = /** @class */ (function () { + function PropIndex(i) { + if (i === void 0) { i = null; } + this.index = i ? __assign({}, i) : {}; + } + PropIndex.prototype.has = function (p) { + return property_1$1.toKey(p) in this.index; + }; + PropIndex.prototype.get = function (p) { + return this.index[property_1$1.toKey(p)]; + }; + PropIndex.prototype.set = function (p, value) { + this.index[property_1$1.toKey(p)] = value; + return this; + }; + PropIndex.prototype.setByKey = function (key, value) { + this.index[key] = value; + }; + PropIndex.prototype.map = function (f) { + var i = new PropIndex(); + for (var k in this.index) { + i.index[k] = f(this.index[k]); + } + return i; + }; + PropIndex.prototype.size = function () { + return util_1$2.keys(this.index).length; + }; + PropIndex.prototype.duplicate = function () { + return new PropIndex(this.index); + }; + return PropIndex; + }()); + exports.PropIndex = PropIndex; + + }); + + var propindex$1 = unwrapExports(propindex); + var propindex_1 = propindex.PropIndex; + + var propindex$2 = /*#__PURE__*/Object.freeze({ + default: propindex$1, + __moduleExports: propindex, + PropIndex: propindex_1 + }); + + var spec$3 = ( spec$2 && spec$1 ) || spec$2; + + var propindex_1$1 = ( propindex$2 && propindex$1 ) || propindex$2; + + var shorthand = createCommonjsModule(function (module, exports) { + var __assign = (commonjsGlobal && commonjsGlobal.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + function getReplacerIndex(replaceIndex) { + return replaceIndex.map(function (r) { return getReplacer(r); }); + } + exports.getReplacerIndex = getReplacerIndex; + function getReplacer(replace) { + return function (s) { + if (replace[s] !== undefined) { + return replace[s]; + } + return s; + }; + } + exports.getReplacer = getReplacer; + function value(v, replacer) { + if (wildcard_1$1.isWildcard(v)) { + // Return the enum array if it's a full wildcard, or just return SHORT_WILDCARD for short ones. + if (!wildcard_1$1.isShortWildcard(v) && v.enum) { + return wildcard_1$1.SHORT_WILDCARD + JSON.stringify(v.enum); + } + else { + return wildcard_1$1.SHORT_WILDCARD; + } + } + if (replacer) { + return replacer(v); + } + return v; + } + exports.value = value; + function replace(v, replacer) { + if (replacer) { + return replacer(v); + } + return v; + } + exports.replace = replace; + exports.REPLACE_NONE = new propindex_1$1.PropIndex(); + exports.INCLUDE_ALL = + // FIXME: remove manual TRANSFORM concat once we really support enumerating transform. + [].concat(property_1$1.DEFAULT_PROP_PRECEDENCE, property_1$1.SORT_PROPS, [property_1$1.Property.TRANSFORM, property_1$1.Property.STACK], property_1$1.VIEW_PROPS) + .reduce(function (pi, prop) { return pi.set(prop, true); }, new propindex_1$1.PropIndex()); + function vlSpec(vlspec, include, replace) { + if (include === void 0) { include = exports.INCLUDE_ALL; } + if (replace === void 0) { replace = exports.REPLACE_NONE; } + var specQ = spec$3.fromSpec(vlspec); + return spec(specQ, include, replace); + } + exports.vlSpec = vlSpec; + exports.PROPERTY_SUPPORTED_CHANNELS = { + axis: { x: true, y: true, row: true, column: true }, + legend: { color: true, opacity: true, size: true, shape: true }, + scale: { x: true, y: true, color: true, opacity: true, row: true, column: true, size: true, shape: true }, + sort: { x: true, y: true, path: true, order: true }, + stack: { x: true, y: true }, + }; + /** + * Returns a shorthand for a spec query + * @param specQ a spec query + * @param include Dict Set listing property types (key) to be included in the shorthand + * @param replace Dictionary of replace function for values of a particular property type (key) + */ + function spec(specQ, include, replace) { + if (include === void 0) { include = exports.INCLUDE_ALL; } + if (replace === void 0) { replace = exports.REPLACE_NONE; } + var parts = []; + if (include.get(property_1$1.Property.MARK)) { + parts.push(value(specQ.mark, replace.get(property_1$1.Property.MARK))); + } + if (specQ.transform && specQ.transform.length > 0) { + parts.push('transform:' + JSON.stringify(specQ.transform)); + } + var stack; + if (include.get(property_1$1.Property.STACK)) { + stack = spec$3.getVlStack(specQ); + } + if (specQ.encodings) { + var encodings = specQ.encodings.reduce(function (encQs, encQ) { + // Exclude encoding mapping with autoCount=false as they are basically disabled. + if (!encoding_1$2.isDisabledAutoCountQuery(encQ)) { + var str = void 0; + if (!!stack && encQ.channel === stack.fieldChannel) { + str = encoding(__assign({}, encQ, { stack: stack.offset }), include, replace); + } + else { + str = encoding(encQ, include, replace); + } + if (str) { + encQs.push(str); + } + } + return encQs; + }, []) + .sort() // sort at the end to ignore order + .join('|'); + if (encodings) { + parts.push(encodings); + } + } + for (var _i = 0, VIEW_PROPS_1 = property_1$1.VIEW_PROPS; _i < VIEW_PROPS_1.length; _i++) { + var viewProp = VIEW_PROPS_1[_i]; + var propString = viewProp.toString(); + if (include.get(viewProp) && !!specQ[propString]) { + var value_1 = specQ[propString]; + parts.push(propString + "=" + JSON.stringify(value_1)); + } + } + return parts.join('|'); + } + exports.spec = spec; + /** + * Returns a shorthand for an encoding query + * @param encQ an encoding query + * @param include Dict Set listing property types (key) to be included in the shorthand + * @param replace Dictionary of replace function for values of a particular property type (key) + */ + function encoding(encQ, include, replace) { + if (include === void 0) { include = exports.INCLUDE_ALL; } + if (replace === void 0) { replace = exports.REPLACE_NONE; } + var parts = []; + if (include.get(property_1$1.Property.CHANNEL)) { + parts.push(value(encQ.channel, replace.get(property_1$1.Property.CHANNEL))); + } + if (encoding_1$2.isFieldQuery(encQ)) { + var fieldDefStr = fieldDef(encQ, include, replace); + if (fieldDefStr) { + parts.push(fieldDefStr); + } + } + else if (encoding_1$2.isValueQuery(encQ)) { + parts.push(encQ.value); + } + else if (encoding_1$2.isAutoCountQuery(encQ)) { + parts.push('autocount()'); + } + return parts.join(':'); + } + exports.encoding = encoding; + /** + * Returns a field definition shorthand for an encoding query + * @param encQ an encoding query + * @param include Dict Set listing property types (key) to be included in the shorthand + * @param replace Dictionary of replace function for values of a particular property type (key) + */ + function fieldDef(encQ, include, replacer) { + if (include === void 0) { include = exports.INCLUDE_ALL; } + if (replacer === void 0) { replacer = exports.REPLACE_NONE; } + if (include.get(property_1$1.Property.AGGREGATE) && encoding_1$2.isDisabledAutoCountQuery(encQ)) { + return '-'; + } + var fn = func(encQ, include, replacer); + var props = fieldDefProps(encQ, include, replacer); + var fieldAndParams; + if (encoding_1$2.isFieldQuery(encQ)) { + // field + fieldAndParams = include.get('field') ? value(encQ.field, replacer.get('field')) : '...'; + // type + if (include.get(property_1$1.Property.TYPE)) { + if (wildcard_1$1.isWildcard(encQ.type)) { + fieldAndParams += ',' + value(encQ.type, replacer.get(property_1$1.Property.TYPE)); + } + else { + var typeShort = ((encQ.type || type_1$1.Type.QUANTITATIVE) + '').substr(0, 1); + fieldAndParams += ',' + value(typeShort, replacer.get(property_1$1.Property.TYPE)); + } + } + // encoding properties + fieldAndParams += props.map(function (p) { + var val = p.value instanceof Array ? '[' + p.value + ']' : p.value; + return ',' + p.key + '=' + val; + }).join(''); + } + else if (encoding_1$2.isAutoCountQuery(encQ)) { + fieldAndParams = '*,q'; + } + if (!fieldAndParams) { + return null; + } + if (fn) { + var fnPrefix = util$6.isString(fn) ? fn : wildcard_1$1.SHORT_WILDCARD + + (util_1$2.keys(fn).length > 0 ? JSON.stringify(fn) : ''); + return fnPrefix + '(' + fieldAndParams + ')'; + } + return fieldAndParams; + } + exports.fieldDef = fieldDef; + /** + * Return function part of + */ + function func(fieldQ, include, replacer) { + if (include.get(property_1$1.Property.AGGREGATE) && fieldQ.aggregate && !wildcard_1$1.isWildcard(fieldQ.aggregate)) { + return replace(fieldQ.aggregate, replacer.get(property_1$1.Property.AGGREGATE)); + } + else if (include.get(property_1$1.Property.AGGREGATE) && encoding_1$2.isEnabledAutoCountQuery(fieldQ)) { + // autoCount is considered a part of aggregate + return replace('count', replacer.get(property_1$1.Property.AGGREGATE)); + } + else if (include.get(property_1$1.Property.TIMEUNIT) && fieldQ.timeUnit && !wildcard_1$1.isWildcard(fieldQ.timeUnit)) { + return replace(fieldQ.timeUnit, replacer.get(property_1$1.Property.TIMEUNIT)); + } + else if (include.get(property_1$1.Property.BIN) && fieldQ.bin && !wildcard_1$1.isWildcard(fieldQ.bin)) { + return 'bin'; + } + else { + var fn = null; + for (var _i = 0, _a = [property_1$1.Property.AGGREGATE, property_1$1.Property.AUTOCOUNT, property_1$1.Property.TIMEUNIT, property_1$1.Property.BIN]; _i < _a.length; _i++) { + var prop = _a[_i]; + var val = fieldQ[prop]; + if (include.get(prop) && fieldQ[prop] && wildcard_1$1.isWildcard(val)) { + // assign fnEnumIndex[prop] = array of enum values or just "?" if it is SHORT_WILDCARD + fn = fn || {}; + fn[prop] = wildcard_1$1.isShortWildcard(val) ? val : val.enum; + } + } + if (fn && fieldQ.hasFn) { + fn.hasFn = true; + } + return fn; + } + } + /** + * Return key-value of parameters of field defs + */ + function fieldDefProps(fieldQ, include, replacer) { + /** Encoding properties e.g., Scale, Axis, Legend */ + var props = []; + // Parameters of function such as bin will be just top-level properties + if (!util_1$2.isBoolean(fieldQ.bin) && !wildcard_1$1.isShortWildcard(fieldQ.bin)) { + var bin = fieldQ.bin; + for (var child in bin) { + var prop = property_1$1.getEncodingNestedProp('bin', child); + if (prop && include.get(prop) && bin[child] !== undefined) { + props.push({ + key: child, + value: value(bin[child], replacer.get(prop)) + }); + } + } + // Sort to make sure that parameter are ordered consistently + props.sort(function (a, b) { return a.key.localeCompare(b.key); }); + } + for (var _i = 0, _a = [property_1$1.Property.SCALE, property_1$1.Property.SORT, property_1$1.Property.STACK, property_1$1.Property.AXIS, property_1$1.Property.LEGEND]; _i < _a.length; _i++) { + var parent_1 = _a[_i]; + if (!wildcard_1$1.isWildcard(fieldQ.channel) && !exports.PROPERTY_SUPPORTED_CHANNELS[parent_1][fieldQ.channel]) { + continue; + } + if (include.get(parent_1) && fieldQ[parent_1] !== undefined) { + var parentValue = fieldQ[parent_1]; + if (util_1$2.isBoolean(parentValue) || parentValue === null) { + // `scale`, `axis`, `legend` can be false/null. + props.push({ + key: parent_1 + '', + value: parentValue || false // return true or false (false if null) + }); + } + else if (util$6.isString(parentValue)) { + // `sort` can be a string (ascending/descending). + props.push({ + key: parent_1 + '', + value: replace(JSON.stringify(parentValue), replacer.get(parent_1)) + }); + } + else { + var nestedPropChildren = []; + for (var child in parentValue) { + var nestedProp = property_1$1.getEncodingNestedProp(parent_1, child); + if (nestedProp && include.get(nestedProp) && parentValue[child] !== undefined) { + nestedPropChildren.push({ + key: child, + value: value(parentValue[child], replacer.get(nestedProp)) + }); + } + } + if (nestedPropChildren.length > 0) { + var nestedPropObject = nestedPropChildren.sort(function (a, b) { return a.key.localeCompare(b.key); }) + .reduce(function (o, item) { + o[item.key] = item.value; + return o; + }, {}); + // Sort to make sure that parameter are ordered consistently + props.push({ + key: parent_1 + '', + value: JSON.stringify(nestedPropObject) + }); + } + } + } + } + return props; + } + function parse(shorthand) { + // TODO(https://github.com/uwdata/compassql/issues/259): + // Do not split directly, but use an upgraded version of `getClosingBraceIndex()` + var splitShorthand = shorthand.split('|'); + var specQ = { + mark: splitShorthand[0], + encodings: [] + }; + for (var i = 1; i < splitShorthand.length; i++) { + var part = splitShorthand[i]; + var splitPart = splitWithTail(part, ':', 1); + var splitPartKey = splitPart[0]; + var splitPartValue = splitPart[1]; + if (channel_1$1.isChannel(splitPartKey) || splitPartKey === '?') { + var encQ = shorthandParser.encoding(splitPartKey, splitPartValue); + specQ.encodings.push(encQ); + continue; + } + if (splitPartKey === 'transform') { + specQ.transform = JSON.parse(splitPartValue); + continue; + } + } + return specQ; + } + exports.parse = parse; + /** + * Split a string n times into substrings with the specified delimiter and return them as an array. + * @param str The string to be split + * @param delim The delimiter string used to separate the string + * @param number The value used to determine how many times the string is split + */ + function splitWithTail(str, delim, count) { + var result = []; + var lastIndex = 0; + for (var i = 0; i < count; i++) { + var indexOfDelim = str.indexOf(delim, lastIndex); + if (indexOfDelim !== -1) { + result.push(str.substring(lastIndex, indexOfDelim)); + lastIndex = indexOfDelim + 1; + } + else { + break; + } + } + result.push(str.substr(lastIndex)); + // If the specified count is greater than the number of delimiters that exist in the string, + // an empty string will be pushed count minus number of delimiter occurence times. + if (result.length !== count + 1) { + while (result.length !== count + 1) { + result.push(''); + } + } + return result; + } + exports.splitWithTail = splitWithTail; + var shorthandParser; + (function (shorthandParser) { + function encoding(channel, fieldDefShorthand) { + var encQMixins = fieldDefShorthand.indexOf('(') !== -1 ? + fn(fieldDefShorthand) : + rawFieldDef(splitWithTail(fieldDefShorthand, ',', 2)); + return __assign({ channel: channel }, encQMixins); + } + shorthandParser.encoding = encoding; + function rawFieldDef(fieldDefPart) { + var fieldQ = {}; + fieldQ.field = fieldDefPart[0]; + fieldQ.type = type_1$1.getFullName(fieldDefPart[1].toUpperCase()) || '?'; + var partParams = fieldDefPart[2]; + var closingBraceIndex = 0; + var i = 0; + while (i < partParams.length) { + var propEqualSignIndex = partParams.indexOf('=', i); + var parsedValue = void 0; + if (propEqualSignIndex !== -1) { + var prop = partParams.substring(i, propEqualSignIndex); + if (partParams[i + prop.length + 1] === '{') { + var openingBraceIndex = i + prop.length + 1; + closingBraceIndex = getClosingIndex(openingBraceIndex, partParams, '}'); + var value_2 = partParams.substring(openingBraceIndex, closingBraceIndex + 1); + parsedValue = JSON.parse(value_2); + // index after next comma + i = closingBraceIndex + 2; + } + else if (partParams[i + prop.length + 1] === '[') { + // find closing square bracket + var openingBracketIndex = i + prop.length + 1; + var closingBracketIndex = getClosingIndex(openingBracketIndex, partParams, ']'); + var value_3 = partParams.substring(openingBracketIndex, closingBracketIndex + 1); + parsedValue = JSON.parse(value_3); + // index after next comma + i = closingBracketIndex + 2; + } + else { + var propIndex = i; + // Substring until the next comma (or end of the string) + var nextCommaIndex = partParams.indexOf(',', i + prop.length); + if (nextCommaIndex === -1) { + nextCommaIndex = partParams.length; + } + // index after next comma + i = nextCommaIndex + 1; + parsedValue = JSON.parse(partParams.substring(propIndex + prop.length + 1, nextCommaIndex)); + } + if (property_1$1.isEncodingNestedParent(prop)) { + fieldQ[prop] = parsedValue; + } + else { + // prop is a property of the aggregation function such as bin + fieldQ.bin = fieldQ.bin || {}; + fieldQ.bin[prop] = parsedValue; + } + } + else { + // something is wrong with the format of the partParams + // exits loop if don't have then infintie loop + break; + } + } + return fieldQ; + } + shorthandParser.rawFieldDef = rawFieldDef; + function getClosingIndex(openingBraceIndex, str, closingChar) { + for (var i = openingBraceIndex; i < str.length; i++) { + if (str[i] === closingChar) { + return i; + } + } + } + shorthandParser.getClosingIndex = getClosingIndex; + function fn(fieldDefShorthand) { + var fieldQ = {}; + // Aggregate, Bin, TimeUnit as wildcard case + if (fieldDefShorthand[0] === '?') { + var closingBraceIndex = getClosingIndex(1, fieldDefShorthand, '}'); + var fnEnumIndex = JSON.parse(fieldDefShorthand.substring(1, closingBraceIndex + 1)); + for (var encodingProperty in fnEnumIndex) { + if (util_1$2.isArray(fnEnumIndex[encodingProperty])) { + fieldQ[encodingProperty] = { enum: fnEnumIndex[encodingProperty] }; + } + else { + fieldQ[encodingProperty] = fnEnumIndex[encodingProperty]; + } + } + return __assign({}, fieldQ, rawFieldDef(splitWithTail(fieldDefShorthand.substring(closingBraceIndex + 2, fieldDefShorthand.length - 1), ',', 2))); + } + else { + var func_1 = fieldDefShorthand.substring(0, fieldDefShorthand.indexOf('(')); + var insideFn = fieldDefShorthand.substring(func_1.length + 1, fieldDefShorthand.length - 1); + var insideFnParts = splitWithTail(insideFn, ',', 2); + if (aggregate_1$1.isAggregateOp(func_1)) { + return __assign({ aggregate: func_1 }, rawFieldDef(insideFnParts)); + } + else if (timeunit_1$1.isTimeUnit(func_1)) { + return __assign({ timeUnit: func_1 }, rawFieldDef(insideFnParts)); + } + else if (func_1 === 'bin') { + return __assign({ bin: {} }, rawFieldDef(insideFnParts)); + } + } + } + shorthandParser.fn = fn; + })(shorthandParser = exports.shorthandParser || (exports.shorthandParser = {})); + + }); + + var shorthand$1 = unwrapExports(shorthand); + var shorthand_1 = shorthand.getReplacerIndex; + var shorthand_2 = shorthand.getReplacer; + var shorthand_3 = shorthand.value; + var shorthand_4 = shorthand.replace; + var shorthand_5 = shorthand.REPLACE_NONE; + var shorthand_6 = shorthand.INCLUDE_ALL; + var shorthand_7 = shorthand.vlSpec; + var shorthand_8 = shorthand.PROPERTY_SUPPORTED_CHANNELS; + var shorthand_9 = shorthand.spec; + var shorthand_10 = shorthand.encoding; + var shorthand_11 = shorthand.fieldDef; + var shorthand_12 = shorthand.parse; + var shorthand_13 = shorthand.splitWithTail; + var shorthand_14 = shorthand.shorthandParser; + + var shorthand$2 = /*#__PURE__*/Object.freeze({ + default: shorthand$1, + __moduleExports: shorthand, + getReplacerIndex: shorthand_1, + getReplacer: shorthand_2, + value: shorthand_3, + replace: shorthand_4, + REPLACE_NONE: shorthand_5, + INCLUDE_ALL: shorthand_6, + vlSpec: shorthand_7, + PROPERTY_SUPPORTED_CHANNELS: shorthand_8, + spec: shorthand_9, + encoding: shorthand_10, + fieldDef: shorthand_11, + parse: shorthand_12, + splitWithTail: shorthand_13, + shorthandParser: shorthand_14 + }); + + var expandedtype_1$1 = ( expandedtype$2 && expandedtype$1 ) || expandedtype$2; + + var type_2$2 = ( type$5 && type$4 ) || type$5; + + var shorthand_1$1 = ( shorthand$2 && shorthand$1 ) || shorthand$2; + + var encoding$3 = createCommonjsModule(function (module, exports) { + var __assign = (commonjsGlobal && commonjsGlobal.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + function isValueQuery(encQ) { + return encQ !== null && encQ !== undefined && encQ['value'] !== undefined; + } + exports.isValueQuery = isValueQuery; + function isFieldQuery(encQ) { + return encQ !== null && encQ !== undefined && (encQ['field'] || encQ['aggregate'] === 'count'); + } + exports.isFieldQuery = isFieldQuery; + function isAutoCountQuery(encQ) { + return encQ !== null && encQ !== undefined && 'autoCount' in encQ; + } + exports.isAutoCountQuery = isAutoCountQuery; + function isDisabledAutoCountQuery(encQ) { + return isAutoCountQuery(encQ) && encQ.autoCount === false; + } + exports.isDisabledAutoCountQuery = isDisabledAutoCountQuery; + function isEnabledAutoCountQuery(encQ) { + return isAutoCountQuery(encQ) && encQ.autoCount === true; + } + exports.isEnabledAutoCountQuery = isEnabledAutoCountQuery; + var DEFAULT_PROPS = [property_1$1.Property.AGGREGATE, property_1$1.Property.BIN, property_1$1.Property.TIMEUNIT, property_1$1.Property.FIELD, property_1$1.Property.TYPE, property_1$1.Property.SCALE, property_1$1.Property.SORT, property_1$1.Property.AXIS, property_1$1.Property.LEGEND, property_1$1.Property.STACK, property_1$1.Property.FORMAT]; + function toEncoding(encQs, params) { + var _a = params.wildcardMode; + var encoding = {}; + for (var _i = 0, encQs_1 = encQs; _i < encQs_1.length; _i++) { + var encQ = encQs_1[_i]; + if (isDisabledAutoCountQuery(encQ)) { + continue; // Do not include this in the output. + } + var channel = encQ.channel; + // if channel is a wildcard, return null + if (wildcard_1$1.isWildcard(channel)) { + throw new Error('Cannot convert wildcard channel to a fixed channel'); + } + var channelDef = isValueQuery(encQ) ? toValueDef(encQ) : toFieldDef(encQ, params); + if (channelDef === null) { + if (params.wildcardMode === 'null') { + // contains invalid property (e.g., wildcard, thus cannot return a proper spec.) + return null; + } + continue; + } + // Otherwise, we can set the channelDef + encoding[channel] = channelDef; + } + return encoding; + } + exports.toEncoding = toEncoding; + function toValueDef(valueQ) { + var value = valueQ.value; + if (wildcard_1$1.isWildcard(value)) { + return null; + } + return { value: value }; + } + exports.toValueDef = toValueDef; + function toFieldDef(encQ, params) { + if (params === void 0) { params = {}; } + var _a = params.props, props = _a === void 0 ? DEFAULT_PROPS : _a, schema = params.schema, _b = params.wildcardMode, wildcardMode = _b === void 0 ? 'skip' : _b; + if (isFieldQuery(encQ)) { + var fieldDef = {}; + for (var _i = 0, props_1 = props; _i < props_1.length; _i++) { + var prop = props_1[_i]; + var encodingProperty = encQ[prop]; + if (wildcard_1$1.isWildcard(encodingProperty)) { + if (wildcardMode === 'skip') + continue; + return null; + } + if (encodingProperty !== undefined) { + // if the channel supports this prop + var isSupportedByChannel = (!shorthand_1$1.PROPERTY_SUPPORTED_CHANNELS[prop] || shorthand_1$1.PROPERTY_SUPPORTED_CHANNELS[prop][encQ.channel]); + if (!isSupportedByChannel) { + continue; + } + if (property_1$1.isEncodingNestedParent(prop) && util$6.isObject(encodingProperty)) { + encodingProperty = __assign({}, encodingProperty); // Make a shallow copy first + for (var childProp in encodingProperty) { + // ensure nested properties are not wildcard before assigning to field def + if (wildcard_1$1.isWildcard(encodingProperty[childProp])) { + if (wildcardMode === 'null') { + return null; + } + delete encodingProperty[childProp]; // skip + } + } + } + if (prop === 'bin' && encodingProperty === false) { + continue; + } + else if (prop === 'type' && encodingProperty === 'key') { + fieldDef.type = 'nominal'; + } + else { + fieldDef[prop] = encodingProperty; + } + } + if (prop === property_1$1.Property.SCALE && schema && encQ.type === type_1$1.Type.ORDINAL) { + var scale = encQ.scale; + var ordinalDomain = schema.fieldSchema(encQ.field).ordinalDomain; + if (scale !== null && ordinalDomain) { + fieldDef[property_1$1.Property.SCALE] = __assign({ domain: ordinalDomain }, (util$6.isObject(scale) ? scale : {})); + } + } + } + return fieldDef; + } + else { + if (encQ.autoCount === false) { + throw new Error("Cannot convert {autoCount: false} into a field def"); + } + else { + return { + aggregate: 'count', + field: '*', + type: 'quantitative' + }; + } + } + } + exports.toFieldDef = toFieldDef; + /** + * Is a field query continuous field? + * This method is applicable only for fieldQuery without wildcard + */ + function isContinuous(encQ) { + if (isFieldQuery(encQ)) { + return fielddef_1$1.isContinuous(toFieldDef(encQ, { props: ['bin', 'timeUnit', 'field', 'type'] })); + } + return isAutoCountQuery(encQ); + } + exports.isContinuous = isContinuous; + function isMeasure(encQ) { + if (isFieldQuery(encQ)) { + return !isDimension(encQ) && encQ.type !== 'temporal'; + } + return isAutoCountQuery(encQ); + } + exports.isMeasure = isMeasure; + /** + * Is a field query discrete field? + * This method is applicable only for fieldQuery without wildcard + */ + function isDimension(encQ) { + if (isFieldQuery(encQ)) { + var fieldDef = toFieldDef(encQ, { props: ['bin', 'timeUnit', 'type'] }); + return fielddef_1$1.isDiscrete(fieldDef) || !!fieldDef.timeUnit; + } + return false; + } + exports.isDimension = isDimension; + /** + * Returns the true scale type of an encoding. + * @returns {ScaleType} If the scale type was not specified, it is inferred from the encoding's Type. + * @returns {undefined} If the scale type was not specified and Type (or TimeUnit if applicable) is a Wildcard, there is no clear scale type + */ + function scaleType(fieldQ) { + var scale = fieldQ.scale === true || fieldQ.scale === wildcard_1$1.SHORT_WILDCARD ? {} : fieldQ.scale || {}; + var type = fieldQ.type, channel = fieldQ.channel, timeUnit = fieldQ.timeUnit, bin = fieldQ.bin; + // HACK: All of markType, and scaleConfig only affect + // sub-type of ordinal to quantitative scales (point or band) + // Currently, most of scaleType usage in CompassQL doesn't care about this subtle difference. + // Thus, instead of making this method requiring the global mark, + // we will just call it with mark = undefined . + // Thus, currently, we will always get a point scale unless a CompassQuery specifies band. + var markType = undefined; + var scaleConfig = {}; + if (wildcard_1$1.isWildcard(scale.type) || wildcard_1$1.isWildcard(type) || wildcard_1$1.isWildcard(channel) || wildcard_1$1.isWildcard(bin)) { + return undefined; + } + // If scale type is specified, then use scale.type + if (scale.type) { + return scale.type; + } + // if type is fixed and it's not temporal, we can ignore time unit. + if (type === 'temporal' && wildcard_1$1.isWildcard(timeUnit)) { + return undefined; + } + // if type is fixed and it's not quantitative, we can ignore bin + if (type === 'quantitative' && wildcard_1$1.isWildcard(bin)) { + return undefined; + } + var vegaLiteType = type === expandedtype_1$1.ExpandedType.KEY ? 'nominal' : type; + var fieldDef = { type: vegaLiteType, timeUnit: timeUnit, bin: bin }; + return type_2$2.scaleType(scale.type, channel, fieldDef, markType, scaleConfig); + } + exports.scaleType = scaleType; + + }); + + var encoding$4 = unwrapExports(encoding$3); + var encoding_1$3 = encoding$3.isValueQuery; + var encoding_2$1 = encoding$3.isFieldQuery; + var encoding_3$1 = encoding$3.isAutoCountQuery; + var encoding_4$1 = encoding$3.isDisabledAutoCountQuery; + var encoding_5$1 = encoding$3.isEnabledAutoCountQuery; + var encoding_6$1 = encoding$3.toEncoding; + var encoding_7$1 = encoding$3.toValueDef; + var encoding_8 = encoding$3.toFieldDef; + var encoding_9 = encoding$3.isContinuous; + var encoding_10 = encoding$3.isMeasure; + var encoding_11 = encoding$3.isDimension; + var encoding_12 = encoding$3.scaleType; + + var TYPES = '__types__'; + + var PARSERS = { + boolean: util$6.boolean, + integer: util$6.number, + number: util$6.number, + date: util$6.date, + string: function(x) { return x == null || x === '' ? null : x + ''; } + }; + + var TESTS = { + boolean: function(x) { return x==='true' || x==='false' || util$6.isBoolean(x); }, + integer: function(x) { return TESTS.number(x) && (x=+x) === ~~x; }, + number: function(x) { return !isNaN(+x) && !util$6.isDate(x); }, + date: function(x) { return !isNaN(Date.parse(x)); } + }; + + function annotation(data, types) { + if (!types) return data && data[TYPES] || null; + data[TYPES] = types; + } + + function fieldNames(datum) { + return util$6.keys(datum); + } + + function bracket(fieldName) { + return '[' + fieldName + ']'; + } + + function type$6(values, f) { + values = util$6.array(values); + f = util$6.$(f); + var v, i, n; + + // if data array has type annotations, use them + if (values[TYPES]) { + v = f(values[TYPES]); + if (util$6.isString(v)) return v; + } + + for (i=0, n=values.length; !util$6.isValid(v) && i stop) range.push(j); + else while ((j = start + step * ++i) < stop) range.push(j); + return range; + }; + + gen.random = {}; + + gen.random.uniform = function(min, max) { + if (max === undefined) { + max = min === undefined ? 1 : min; + min = 0; + } + var d = max - min; + var f = function() { + return min + d * Math.random(); + }; + f.samples = function(n) { + return gen.zeros(n).map(f); + }; + f.pdf = function(x) { + return (x >= min && x <= max) ? 1/d : 0; + }; + f.cdf = function(x) { + return x < min ? 0 : x > max ? 1 : (x - min) / d; + }; + f.icdf = function(p) { + return (p >= 0 && p <= 1) ? min + p*d : NaN; + }; + return f; + }; + + gen.random.integer = function(a, b) { + if (b === undefined) { + b = a; + a = 0; + } + var d = b - a; + var f = function() { + return a + Math.floor(d * Math.random()); + }; + f.samples = function(n) { + return gen.zeros(n).map(f); + }; + f.pdf = function(x) { + return (x === Math.floor(x) && x >= a && x < b) ? 1/d : 0; + }; + f.cdf = function(x) { + var v = Math.floor(x); + return v < a ? 0 : v >= b ? 1 : (v - a + 1) / d; + }; + f.icdf = function(p) { + return (p >= 0 && p <= 1) ? a - 1 + Math.floor(p*d) : NaN; + }; + return f; + }; + + gen.random.normal = function(mean, stdev) { + mean = mean || 0; + stdev = stdev || 1; + var next; + var f = function() { + var x = 0, y = 0, rds, c; + if (next !== undefined) { + x = next; + next = undefined; + return x; + } + do { + x = Math.random()*2-1; + y = Math.random()*2-1; + rds = x*x + y*y; + } while (rds === 0 || rds > 1); + c = Math.sqrt(-2*Math.log(rds)/rds); // Box-Muller transform + next = mean + y*c*stdev; + return mean + x*c*stdev; + }; + f.samples = function(n) { + return gen.zeros(n).map(f); + }; + f.pdf = function(x) { + var exp = Math.exp(Math.pow(x-mean, 2) / (-2 * Math.pow(stdev, 2))); + return (1 / (stdev * Math.sqrt(2*Math.PI))) * exp; + }; + f.cdf = function(x) { + // Approximation from West (2009) + // Better Approximations to Cumulative Normal Functions + var cd, + z = (x - mean) / stdev, + Z = Math.abs(z); + if (Z > 37) { + cd = 0; + } else { + var sum, exp = Math.exp(-Z*Z/2); + if (Z < 7.07106781186547) { + sum = 3.52624965998911e-02 * Z + 0.700383064443688; + sum = sum * Z + 6.37396220353165; + sum = sum * Z + 33.912866078383; + sum = sum * Z + 112.079291497871; + sum = sum * Z + 221.213596169931; + sum = sum * Z + 220.206867912376; + cd = exp * sum; + sum = 8.83883476483184e-02 * Z + 1.75566716318264; + sum = sum * Z + 16.064177579207; + sum = sum * Z + 86.7807322029461; + sum = sum * Z + 296.564248779674; + sum = sum * Z + 637.333633378831; + sum = sum * Z + 793.826512519948; + sum = sum * Z + 440.413735824752; + cd = cd / sum; + } else { + sum = Z + 0.65; + sum = Z + 4 / sum; + sum = Z + 3 / sum; + sum = Z + 2 / sum; + sum = Z + 1 / sum; + cd = exp / sum / 2.506628274631; + } + } + return z > 0 ? 1 - cd : cd; + }; + f.icdf = function(p) { + // Approximation of Probit function using inverse error function. + if (p <= 0 || p >= 1) return NaN; + var x = 2*p - 1, + v = (8 * (Math.PI - 3)) / (3 * Math.PI * (4-Math.PI)), + a = (2 / (Math.PI*v)) + (Math.log(1 - Math.pow(x,2)) / 2), + b = Math.log(1 - (x*x)) / v, + s = (x > 0 ? 1 : -1) * Math.sqrt(Math.sqrt((a*a) - b) - a); + return mean + stdev * Math.SQRT2 * s; + }; + return f; + }; + + gen.random.bootstrap = function(domain, smooth) { + // Generates a bootstrap sample from a set of observations. + // Smooth bootstrapping adds random zero-centered noise to the samples. + var val = domain.filter(util$6.isValid), + len = val.length, + err = smooth ? gen.random.normal(0, smooth) : null; + var f = function() { + return val[~~(Math.random()*len)] + (err ? err() : 0); + }; + f.samples = function(n) { + return gen.zeros(n).map(f); + }; + return f; + }; + }); + + var generate$1 = /*#__PURE__*/Object.freeze({ + default: generate, + __moduleExports: generate + }); + + var type$8 = ( type$7 && type_1$2 ) || type$7; + + var gen = ( generate$1 && generate ) || generate$1; + + var stats_1 = createCommonjsModule(function (module) { + var stats = module.exports; + + // Collect unique values. + // Output: an array of unique values, in first-observed order + stats.unique = function(values, f, results) { + f = util$6.$(f); + results = results || []; + var u = {}, v, i, n; + for (i=0, n=values.length; i 0 ? Math.pow(mean, 1/c) : 0; + return mean; + }; + + // Compute the harmonic mean of an array of numbers. + stats.mean.harmonic = function(values, f) { + f = util$6.$(f); + var mean = 0, c, n, v, i; + for (i=0, c=0, n=values.length; i b) b = v; + } + } + return [a, b]; + }; + + // Find the integer indices of the minimum and maximum values. + stats.extent.index = function(values, f) { + f = util$6.$(f); + var x = -1, y = -1, a, b, v, i, n = values.length; + for (i=0; i b) { b = v; y = i; } + } + } + return [x, y]; + }; + + // Compute the dot product of two arrays of numbers. + stats.dot = function(values, a, b) { + var sum = 0, i, v; + if (!b) { + if (values.length !== a.length) { + throw Error('Array lengths must match.'); + } + for (i=0; i -1 && p !== v) { + mu = 1 + (i-1 + tie) / 2; + for (; tie -1) { + mu = 1 + (n-1 + tie) / 2; + for (; tie max) max = x; + delta = x - mean; + mean = mean + delta / (++valid); + M2 = M2 + delta * (x - mean); + vals.push(x); + } + } + M2 = M2 / (valid - 1); + sd = Math.sqrt(M2); + + // sort values for median and iqr + vals.sort(util$6.cmp); + + return { + type: type$8(values, f), + unique: u, + count: values.length, + valid: valid, + missing: missing, + distinct: distinct, + min: min, + max: max, + mean: mean, + stdev: sd, + median: (v = stats.quantile(vals, 0.5)), + q1: stats.quantile(vals, 0.25), + q3: stats.quantile(vals, 0.75), + modeskew: sd === 0 ? 0 : (mean - v) / sd + }; + }; + + // Compute profiles for all variables in a data set. + stats.summary = function(data, fields) { + fields = fields || util$6.keys(data[0]); + var s = fields.map(function(f) { + var p = stats.profile(data, util$6.$(f)); + return (p.field = f, p); + }); + return (s.__summary__ = true, s); + }; + }); + var stats_2 = stats_1.summary; + + var stats = /*#__PURE__*/Object.freeze({ + default: stats_1, + __moduleExports: stats_1, + summary: stats_2 + }); + + var d3Time = createCommonjsModule(function (module, exports) { + (function (global, factory) { + factory(exports); + }(commonjsGlobal, function (exports) { + var t0 = new Date; + var t1 = new Date; + function newInterval(floori, offseti, count, field) { + + function interval(date) { + return floori(date = new Date(+date)), date; + } + + interval.floor = interval; + + interval.round = function(date) { + var d0 = new Date(+date), + d1 = new Date(date - 1); + floori(d0), floori(d1), offseti(d1, 1); + return date - d0 < d1 - date ? d0 : d1; + }; + + interval.ceil = function(date) { + return floori(date = new Date(date - 1)), offseti(date, 1), date; + }; + + interval.offset = function(date, step) { + return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date; + }; + + interval.range = function(start, stop, step) { + var range = []; + start = new Date(start - 1); + stop = new Date(+stop); + step = step == null ? 1 : Math.floor(step); + if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date + offseti(start, 1), floori(start); + if (start < stop) range.push(new Date(+start)); + while (offseti(start, step), floori(start), start < stop) range.push(new Date(+start)); + return range; + }; + + interval.filter = function(test) { + return newInterval(function(date) { + while (floori(date), !test(date)) date.setTime(date - 1); + }, function(date, step) { + while (--step >= 0) while (offseti(date, 1), !test(date)); + }); + }; + + if (count) { + interval.count = function(start, end) { + t0.setTime(+start), t1.setTime(+end); + floori(t0), floori(t1); + return Math.floor(count(t0, t1)); + }; + + interval.every = function(step) { + step = Math.floor(step); + return !isFinite(step) || !(step > 0) ? null + : !(step > 1) ? interval + : interval.filter(field + ? function(d) { return field(d) % step === 0; } + : function(d) { return interval.count(0, d) % step === 0; }); + }; + } + + return interval; + } + var millisecond = newInterval(function() { + // noop + }, function(date, step) { + date.setTime(+date + step); + }, function(start, end) { + return end - start; + }); + + // An optimized implementation for this simple case. + millisecond.every = function(k) { + k = Math.floor(k); + if (!isFinite(k) || !(k > 0)) return null; + if (!(k > 1)) return millisecond; + return newInterval(function(date) { + date.setTime(Math.floor(date / k) * k); + }, function(date, step) { + date.setTime(+date + step * k); + }, function(start, end) { + return (end - start) / k; + }); + }; + + var second = newInterval(function(date) { + date.setMilliseconds(0); + }, function(date, step) { + date.setTime(+date + step * 1e3); + }, function(start, end) { + return (end - start) / 1e3; + }, function(date) { + return date.getSeconds(); + }); + + var minute = newInterval(function(date) { + date.setSeconds(0, 0); + }, function(date, step) { + date.setTime(+date + step * 6e4); + }, function(start, end) { + return (end - start) / 6e4; + }, function(date) { + return date.getMinutes(); + }); + + var hour = newInterval(function(date) { + date.setMinutes(0, 0, 0); + }, function(date, step) { + date.setTime(+date + step * 36e5); + }, function(start, end) { + return (end - start) / 36e5; + }, function(date) { + return date.getHours(); + }); + + var day = newInterval(function(date) { + date.setHours(0, 0, 0, 0); + }, function(date, step) { + date.setDate(date.getDate() + step); + }, function(start, end) { + return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * 6e4) / 864e5; + }, function(date) { + return date.getDate() - 1; + }); + + function weekday(i) { + return newInterval(function(date) { + date.setHours(0, 0, 0, 0); + date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7); + }, function(date, step) { + date.setDate(date.getDate() + step * 7); + }, function(start, end) { + return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * 6e4) / 6048e5; + }); + } + + var sunday = weekday(0); + var monday = weekday(1); + var tuesday = weekday(2); + var wednesday = weekday(3); + var thursday = weekday(4); + var friday = weekday(5); + var saturday = weekday(6); + + var month = newInterval(function(date) { + date.setHours(0, 0, 0, 0); + date.setDate(1); + }, function(date, step) { + date.setMonth(date.getMonth() + step); + }, function(start, end) { + return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12; + }, function(date) { + return date.getMonth(); + }); + + var year = newInterval(function(date) { + date.setHours(0, 0, 0, 0); + date.setMonth(0, 1); + }, function(date, step) { + date.setFullYear(date.getFullYear() + step); + }, function(start, end) { + return end.getFullYear() - start.getFullYear(); + }, function(date) { + return date.getFullYear(); + }); + + var utcSecond = newInterval(function(date) { + date.setUTCMilliseconds(0); + }, function(date, step) { + date.setTime(+date + step * 1e3); + }, function(start, end) { + return (end - start) / 1e3; + }, function(date) { + return date.getUTCSeconds(); + }); + + var utcMinute = newInterval(function(date) { + date.setUTCSeconds(0, 0); + }, function(date, step) { + date.setTime(+date + step * 6e4); + }, function(start, end) { + return (end - start) / 6e4; + }, function(date) { + return date.getUTCMinutes(); + }); + + var utcHour = newInterval(function(date) { + date.setUTCMinutes(0, 0, 0); + }, function(date, step) { + date.setTime(+date + step * 36e5); + }, function(start, end) { + return (end - start) / 36e5; + }, function(date) { + return date.getUTCHours(); + }); + + var utcDay = newInterval(function(date) { + date.setUTCHours(0, 0, 0, 0); + }, function(date, step) { + date.setUTCDate(date.getUTCDate() + step); + }, function(start, end) { + return (end - start) / 864e5; + }, function(date) { + return date.getUTCDate() - 1; + }); + + function utcWeekday(i) { + return newInterval(function(date) { + date.setUTCHours(0, 0, 0, 0); + date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7); + }, function(date, step) { + date.setUTCDate(date.getUTCDate() + step * 7); + }, function(start, end) { + return (end - start) / 6048e5; + }); + } + + var utcSunday = utcWeekday(0); + var utcMonday = utcWeekday(1); + var utcTuesday = utcWeekday(2); + var utcWednesday = utcWeekday(3); + var utcThursday = utcWeekday(4); + var utcFriday = utcWeekday(5); + var utcSaturday = utcWeekday(6); + + var utcMonth = newInterval(function(date) { + date.setUTCHours(0, 0, 0, 0); + date.setUTCDate(1); + }, function(date, step) { + date.setUTCMonth(date.getUTCMonth() + step); + }, function(start, end) { + return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12; + }, function(date) { + return date.getUTCMonth(); + }); + + var utcYear = newInterval(function(date) { + date.setUTCHours(0, 0, 0, 0); + date.setUTCMonth(0, 1); + }, function(date, step) { + date.setUTCFullYear(date.getUTCFullYear() + step); + }, function(start, end) { + return end.getUTCFullYear() - start.getUTCFullYear(); + }, function(date) { + return date.getUTCFullYear(); + }); + + var milliseconds = millisecond.range; + var seconds = second.range; + var minutes = minute.range; + var hours = hour.range; + var days = day.range; + var sundays = sunday.range; + var mondays = monday.range; + var tuesdays = tuesday.range; + var wednesdays = wednesday.range; + var thursdays = thursday.range; + var fridays = friday.range; + var saturdays = saturday.range; + var weeks = sunday.range; + var months = month.range; + var years = year.range; + + var utcMillisecond = millisecond; + var utcMilliseconds = milliseconds; + var utcSeconds = utcSecond.range; + var utcMinutes = utcMinute.range; + var utcHours = utcHour.range; + var utcDays = utcDay.range; + var utcSundays = utcSunday.range; + var utcMondays = utcMonday.range; + var utcTuesdays = utcTuesday.range; + var utcWednesdays = utcWednesday.range; + var utcThursdays = utcThursday.range; + var utcFridays = utcFriday.range; + var utcSaturdays = utcSaturday.range; + var utcWeeks = utcSunday.range; + var utcMonths = utcMonth.range; + var utcYears = utcYear.range; + + var version = "0.1.1"; + + exports.version = version; + exports.milliseconds = milliseconds; + exports.seconds = seconds; + exports.minutes = minutes; + exports.hours = hours; + exports.days = days; + exports.sundays = sundays; + exports.mondays = mondays; + exports.tuesdays = tuesdays; + exports.wednesdays = wednesdays; + exports.thursdays = thursdays; + exports.fridays = fridays; + exports.saturdays = saturdays; + exports.weeks = weeks; + exports.months = months; + exports.years = years; + exports.utcMillisecond = utcMillisecond; + exports.utcMilliseconds = utcMilliseconds; + exports.utcSeconds = utcSeconds; + exports.utcMinutes = utcMinutes; + exports.utcHours = utcHours; + exports.utcDays = utcDays; + exports.utcSundays = utcSundays; + exports.utcMondays = utcMondays; + exports.utcTuesdays = utcTuesdays; + exports.utcWednesdays = utcWednesdays; + exports.utcThursdays = utcThursdays; + exports.utcFridays = utcFridays; + exports.utcSaturdays = utcSaturdays; + exports.utcWeeks = utcWeeks; + exports.utcMonths = utcMonths; + exports.utcYears = utcYears; + exports.millisecond = millisecond; + exports.second = second; + exports.minute = minute; + exports.hour = hour; + exports.day = day; + exports.sunday = sunday; + exports.monday = monday; + exports.tuesday = tuesday; + exports.wednesday = wednesday; + exports.thursday = thursday; + exports.friday = friday; + exports.saturday = saturday; + exports.week = sunday; + exports.month = month; + exports.year = year; + exports.utcSecond = utcSecond; + exports.utcMinute = utcMinute; + exports.utcHour = utcHour; + exports.utcDay = utcDay; + exports.utcSunday = utcSunday; + exports.utcMonday = utcMonday; + exports.utcTuesday = utcTuesday; + exports.utcWednesday = utcWednesday; + exports.utcThursday = utcThursday; + exports.utcFriday = utcFriday; + exports.utcSaturday = utcSaturday; + exports.utcWeek = utcSunday; + exports.utcMonth = utcMonth; + exports.utcYear = utcYear; + exports.interval = newInterval; + + })); + }); + + var d3Time$1 = /*#__PURE__*/Object.freeze({ + default: d3Time, + __moduleExports: d3Time + }); + + var d3_time = ( d3Time$1 && d3Time ) || d3Time$1; + + var tempDate = new Date(), + baseDate = new Date(0, 0, 1).setFullYear(0), // Jan 1, 0 AD + utcBaseDate = new Date(Date.UTC(0, 0, 1)).setUTCFullYear(0); + + function date(d) { + return (tempDate.setTime(+d), tempDate); + } + + // create a time unit entry + function entry(type, date, unit, step, min, max) { + var e = { + type: type, + date: date, + unit: unit + }; + if (step) { + e.step = step; + } else { + e.minstep = 1; + } + if (min != null) e.min = min; + if (max != null) e.max = max; + return e; + } + + function create(type, unit, base, step, min, max) { + return entry(type, + function(d) { return unit.offset(base, d); }, + function(d) { return unit.count(base, d); }, + step, min, max); + } + + var locale = [ + create('second', d3_time.second, baseDate), + create('minute', d3_time.minute, baseDate), + create('hour', d3_time.hour, baseDate), + create('day', d3_time.day, baseDate, [1, 7]), + create('month', d3_time.month, baseDate, [1, 3, 6]), + create('year', d3_time.year, baseDate), + + // periodic units + entry('seconds', + function(d) { return new Date(1970, 0, 1, 0, 0, d); }, + function(d) { return date(d).getSeconds(); }, + null, 0, 59 + ), + entry('minutes', + function(d) { return new Date(1970, 0, 1, 0, d); }, + function(d) { return date(d).getMinutes(); }, + null, 0, 59 + ), + entry('hours', + function(d) { return new Date(1970, 0, 1, d); }, + function(d) { return date(d).getHours(); }, + null, 0, 23 + ), + entry('weekdays', + function(d) { return new Date(1970, 0, 4+d); }, + function(d) { return date(d).getDay(); }, + [1], 0, 6 + ), + entry('dates', + function(d) { return new Date(1970, 0, d); }, + function(d) { return date(d).getDate(); }, + [1], 1, 31 + ), + entry('months', + function(d) { return new Date(1970, d % 12, 1); }, + function(d) { return date(d).getMonth(); }, + [1], 0, 11 + ) + ]; + + var utc = [ + create('second', d3_time.utcSecond, utcBaseDate), + create('minute', d3_time.utcMinute, utcBaseDate), + create('hour', d3_time.utcHour, utcBaseDate), + create('day', d3_time.utcDay, utcBaseDate, [1, 7]), + create('month', d3_time.utcMonth, utcBaseDate, [1, 3, 6]), + create('year', d3_time.utcYear, utcBaseDate), + + // periodic units + entry('seconds', + function(d) { return new Date(Date.UTC(1970, 0, 1, 0, 0, d)); }, + function(d) { return date(d).getUTCSeconds(); }, + null, 0, 59 + ), + entry('minutes', + function(d) { return new Date(Date.UTC(1970, 0, 1, 0, d)); }, + function(d) { return date(d).getUTCMinutes(); }, + null, 0, 59 + ), + entry('hours', + function(d) { return new Date(Date.UTC(1970, 0, 1, d)); }, + function(d) { return date(d).getUTCHours(); }, + null, 0, 23 + ), + entry('weekdays', + function(d) { return new Date(Date.UTC(1970, 0, 4+d)); }, + function(d) { return date(d).getUTCDay(); }, + [1], 0, 6 + ), + entry('dates', + function(d) { return new Date(Date.UTC(1970, 0, d)); }, + function(d) { return date(d).getUTCDate(); }, + [1], 1, 31 + ), + entry('months', + function(d) { return new Date(Date.UTC(1970, d % 12, 1)); }, + function(d) { return date(d).getUTCMonth(); }, + [1], 0, 11 + ) + ]; + + var STEPS = [ + [31536e6, 5], // 1-year + [7776e6, 4], // 3-month + [2592e6, 4], // 1-month + [12096e5, 3], // 2-week + [6048e5, 3], // 1-week + [1728e5, 3], // 2-day + [864e5, 3], // 1-day + [432e5, 2], // 12-hour + [216e5, 2], // 6-hour + [108e5, 2], // 3-hour + [36e5, 2], // 1-hour + [18e5, 1], // 30-minute + [9e5, 1], // 15-minute + [3e5, 1], // 5-minute + [6e4, 1], // 1-minute + [3e4, 0], // 30-second + [15e3, 0], // 15-second + [5e3, 0], // 5-second + [1e3, 0] // 1-second + ]; + + function find(units, span, minb, maxb) { + var step = STEPS[0], i, n, bins; + + for (i=1, n=STEPS.length; i step[0]) { + bins = span / step[0]; + if (bins > maxb) { + return units[STEPS[i-1][1]]; + } + if (bins >= minb) { + return units[step[1]]; + } + } + } + return units[STEPS[n-1][1]]; + } + + function toUnitMap(units) { + var map = {}, i, n; + for (i=0, n=units.length; i maxb) { step *= base; } + + // decrease step size if allowed + for (i=0; i= minstep && span / v <= maxb) step = v; + } + } + + // update precision, min and max + v = Math.log(step); + precision = v >= 0 ? 0 : ~~(-v / logb) + 1; + eps = Math.pow(base, -precision - 1); + min = Math.min(min, Math.floor(min / step + eps) * step); + max = Math.ceil(max / step) * step; + + return { + start: min, + stop: max, + step: step, + unit: {precision: precision}, + value: value$2, + index: index + }; + } + + function bisect(a, x, lo, hi) { + while (lo < hi) { + var mid = lo + hi >>> 1; + if (util$6.cmp(a[mid], x) < 0) { lo = mid + 1; } + else { hi = mid; } + } + return lo; + } + + function value$2(v) { + return this.step * Math.floor(v / this.step + EPSILON); + } + + function index(v) { + return Math.floor((v - this.start) / this.step + EPSILON); + } + + function date_value(v) { + return this.unit.date(value$2.call(this, v)); + } + + function date_index(v) { + return index.call(this, this.unit.unit(v)); + } + + bins.date = function(opt) { + if (!opt) { throw Error("Missing date binning options."); } + + // find time step, then bin + var units = opt.utc ? time$2.utc : time$2, + dmin = opt.min, + dmax = opt.max, + maxb = opt.maxbins || 20, + minb = opt.minbins || 4, + span = (+dmax) - (+dmin), + unit = opt.unit ? units[opt.unit] : units.find(span, minb, maxb), + spec = bins({ + min: unit.min != null ? unit.min : unit.unit(dmin), + max: unit.max != null ? unit.max : unit.unit(dmax), + maxbins: maxb, + minstep: unit.minstep, + steps: unit.step + }); + + spec.unit = unit; + spec.index = date_index; + if (!opt.raw) spec.value = date_value; + return spec; + }; + + var bins_1 = bins; + + var bins$1 = /*#__PURE__*/Object.freeze({ + default: bins_1, + __moduleExports: bins_1 + }); + + var stats_1$1 = ( stats && stats_1 ) || stats; + + var dlBin_ = ( bins$1 && bins_1 ) || bins$1; + + var config_1$1 = ( config$2 && config$1 ) || config$2; + + var schema = createCommonjsModule(function (module, exports) { + var __assign = (commonjsGlobal && commonjsGlobal.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + var dlBin = dlBin_; + /** + * Build a Schema object. + * + * @param data - a set of raw data in the same format that Vega-Lite / Vega takes + * Basically, it's an array in the form of: + * + * [ + * {a: 1, b:2}, + * {a: 2, b:3}, + * ... + * ] + * + * @return a Schema object + */ + function build(data, opt, tableSchema) { + if (opt === void 0) { opt = {}; } + if (tableSchema === void 0) { tableSchema = { fields: [] }; } + opt = util_1$2.extend({}, config_1$1.DEFAULT_QUERY_CONFIG, opt); + // create profiles for each variable + var summaries = stats_1$1.summary(data); + var types = type$8.inferAll(data); // inferAll does stronger type inference than summary + var tableSchemaFieldIndex = tableSchema.fields.reduce(function (m, field) { + m[field.name] = field; + return m; + }, {}); + var fieldSchemas = summaries.map(function (fieldProfile, index) { + var name = fieldProfile.field; + // In Table schema, 'date' doesn't include time so use 'datetime' + var type = types[name] === 'date' ? PrimitiveType.DATETIME : types[name]; + var distinct = fieldProfile.distinct; + var vlType; + if (type === PrimitiveType.NUMBER) { + vlType = type_1$1.Type.QUANTITATIVE; + } + else if (type === PrimitiveType.INTEGER) { + // use ordinal or nominal when cardinality of integer type is relatively low and the distinct values are less than an amount specified in options + if ((distinct < opt.numberNominalLimit) && (distinct / fieldProfile.count < opt.numberNominalProportion)) { + vlType = type_1$1.Type.NOMINAL; + } + else { + vlType = type_1$1.Type.QUANTITATIVE; + } + } + else if (type === PrimitiveType.DATETIME) { + vlType = type_1$1.Type.TEMPORAL; + // need to get correct min/max of date data because datalib's summary method does not + // calculate this correctly for date types. + fieldProfile.min = new Date(data[0][name]); + fieldProfile.max = new Date(data[0][name]); + for (var _i = 0, data_1 = data; _i < data_1.length; _i++) { + var dataEntry = data_1[_i]; + var time = new Date(dataEntry[name]).getTime(); + if (time < fieldProfile.min.getTime()) { + fieldProfile.min = new Date(time); + } + if (time > fieldProfile.max.getTime()) { + fieldProfile.max = new Date(time); + } + } + } + else { + vlType = type_1$1.Type.NOMINAL; + } + if (vlType === type_1$1.Type.NOMINAL + && distinct / fieldProfile.count > opt.minPercentUniqueForKey + && fieldProfile.count > opt.minCardinalityForKey) { + vlType = expandedtype_1$1.ExpandedType.KEY; + } + var fieldSchema = { + name: name, + // Need to keep original index for re-exporting TableSchema + originalIndex: index, + vlType: vlType, + type: type, + stats: fieldProfile, + timeStats: {}, + binStats: {} + }; + // extend field schema with table schema field - if present + var orgFieldSchema = tableSchemaFieldIndex[fieldSchema.name]; + fieldSchema = util_1$2.extend(fieldSchema, orgFieldSchema); + return fieldSchema; + }); + // calculate preset bins for quantitative and temporal data + for (var _i = 0, fieldSchemas_1 = fieldSchemas; _i < fieldSchemas_1.length; _i++) { + var fieldSchema = fieldSchemas_1[_i]; + if (fieldSchema.vlType === type_1$1.Type.QUANTITATIVE) { + for (var _a = 0, _b = opt.enum.binProps.maxbins; _a < _b.length; _a++) { + var maxbins = _b[_a]; + fieldSchema.binStats[maxbins] = binSummary(maxbins, fieldSchema.stats); + } + } + else if (fieldSchema.vlType === type_1$1.Type.TEMPORAL) { + for (var _c = 0, _d = opt.enum.timeUnit; _c < _d.length; _c++) { + var unit = _d[_c]; + if (unit !== undefined) { + fieldSchema.timeStats[unit] = timeSummary(unit, fieldSchema.stats); + } + } + } + } + var derivedTableSchema = __assign({}, tableSchema, { fields: fieldSchemas }); + return new Schema(derivedTableSchema); + } + exports.build = build; + // order the field schema when we construct a new Schema + // this orders the fields in the UI + var order = { + 'nominal': 0, + 'key': 1, + 'ordinal': 2, + 'temporal': 3, + 'quantitative': 4 + }; + var Schema = /** @class */ (function () { + function Schema(tableSchema) { + this._tableSchema = tableSchema; + tableSchema.fields.sort(function (a, b) { + // first order by vlType: nominal < temporal < quantitative < ordinal + if (order[a.vlType] < order[b.vlType]) { + return -1; + } + else if (order[a.vlType] > order[b.vlType]) { + return 1; + } + else { + // then order by field (alphabetically) + return a.name.localeCompare(b.name); + } + }); + // Add index for sorting + tableSchema.fields.forEach(function (fieldSchema, index) { return fieldSchema.index = index; }); + this._fieldSchemaIndex = tableSchema.fields.reduce(function (m, fieldSchema) { + m[fieldSchema.name] = fieldSchema; + return m; + }, {}); + } + /** @return a list of the field names (for enumerating). */ + Schema.prototype.fieldNames = function () { + return this._tableSchema.fields.map(function (fieldSchema) { return fieldSchema.name; }); + }; + Object.defineProperty(Schema.prototype, "fieldSchemas", { + /** @return a list of FieldSchemas */ + get: function () { + return this._tableSchema.fields; + }, + enumerable: true, + configurable: true + }); + Schema.prototype.fieldSchema = function (fieldName) { + return this._fieldSchemaIndex[fieldName]; + }; + Schema.prototype.tableSchema = function () { + // the fieldschemas are re-arranged + // but this is not allowed in table schema. + // so we will re-order based on original index. + var tableSchema = util_1$2.duplicate(this._tableSchema); + tableSchema.fields.sort(function (a, b) { return a.originalIndex - b.originalIndex; }); + return tableSchema; + }; + /** + * @return primitive type of the field if exist, otherwise return null + */ + Schema.prototype.primitiveType = function (fieldName) { + return this._fieldSchemaIndex[fieldName] ? this._fieldSchemaIndex[fieldName].type : null; + }; + /** + * @return vlType of measturement of the field if exist, otherwise return null + */ + Schema.prototype.vlType = function (fieldName) { + return this._fieldSchemaIndex[fieldName] ? this._fieldSchemaIndex[fieldName].vlType : null; + }; + /** @return cardinality of the field associated with encQ, null if it doesn't exist. + * @param augmentTimeUnitDomain - TimeUnit field domains will not be augmented if explicitly set to false. + */ + Schema.prototype.cardinality = function (fieldQ, augmentTimeUnitDomain, excludeInvalid) { + if (augmentTimeUnitDomain === void 0) { augmentTimeUnitDomain = true; } + if (excludeInvalid === void 0) { excludeInvalid = false; } + var fieldSchema = this._fieldSchemaIndex[fieldQ.field]; + if (fieldQ.aggregate || (encoding_1$2.isAutoCountQuery(fieldQ) && fieldQ.autoCount)) { + return 1; + } + else if (fieldQ.bin) { + // encQ.bin will either be a boolean or a BinQuery + var bin = void 0; + if (typeof fieldQ.bin === 'boolean') { + // autoMaxBins defaults to 10 if channel is Wildcard + bin = { + maxbins: bin_1$1.autoMaxBins(fieldQ.channel) + }; + } + else if (fieldQ.bin === '?') { + bin = { + enum: [true, false] + }; + } + else { + bin = fieldQ.bin; + } + var maxbins = bin.maxbins; + if (!fieldSchema.binStats[maxbins]) { + // need to calculate + fieldSchema.binStats[maxbins] = binSummary(maxbins, fieldSchema.stats); + } + // don't need to worry about excludeInvalid here because invalid values don't affect linearly binned field's cardinality + return fieldSchema.binStats[maxbins].distinct; + } + else if (fieldQ.timeUnit) { + if (augmentTimeUnitDomain) { + switch (fieldQ.timeUnit) { + // TODO: this should not always be the case once Vega-Lite supports turning off domain augmenting (VL issue #1385) + case timeunit_1$1.TimeUnit.SECONDS: return 60; + case timeunit_1$1.TimeUnit.MINUTES: return 60; + case timeunit_1$1.TimeUnit.HOURS: return 24; + case timeunit_1$1.TimeUnit.DAY: return 7; + case timeunit_1$1.TimeUnit.DATE: return 31; + case timeunit_1$1.TimeUnit.MONTH: return 12; + case timeunit_1$1.TimeUnit.QUARTER: return 4; + case timeunit_1$1.TimeUnit.MILLISECONDS: return 1000; + } + } + var unit = fieldQ.timeUnit; + var timeStats = fieldSchema.timeStats; + // if the cardinality for the timeUnit is not cached, calculate it + if (!timeStats || !timeStats[unit]) { + timeStats = __assign({}, timeStats, (_a = {}, _a[unit] = timeSummary(fieldQ.timeUnit, fieldSchema.stats), _a)); + } + if (excludeInvalid) { + return timeStats[unit].distinct - invalidCount(timeStats[unit].unique, ['Invalid Date', null]); + } + else { + return timeStats[unit].distinct; + } + } + else { + if (fieldSchema) { + if (excludeInvalid) { + return fieldSchema.stats.distinct - invalidCount(fieldSchema.stats.unique, [NaN, null]); + } + else { + return fieldSchema.stats.distinct; + } + } + else { + return null; + } + } + var _a; + }; + /** + * Given an EncodingQuery with a timeUnit, returns true if the date field + * has multiple distinct values for all parts of the timeUnit. Returns undefined + * if the timeUnit is undefined. + * i.e. + * ('yearmonth', [Jan 1 2000, Feb 2 2000] returns false) + * ('yearmonth', [Jan 1 2000, Feb 2 2001] returns true) + */ + Schema.prototype.timeUnitHasVariation = function (fieldQ) { + if (!fieldQ.timeUnit) { + return; + } + // if there is no variation in `date`, there should not be variation in `day` + if (fieldQ.timeUnit === timeunit_1$1.TimeUnit.DAY) { + var dateEncQ = util_1$2.extend({}, fieldQ, { timeUnit: timeunit_1$1.TimeUnit.DATE }); + if (this.cardinality(dateEncQ, false, true) <= 1) { + return false; + } + } + var fullTimeUnit = fieldQ.timeUnit; + for (var _i = 0, TIMEUNIT_PARTS_1 = timeunit_1$1.TIMEUNIT_PARTS; _i < TIMEUNIT_PARTS_1.length; _i++) { + var timeUnitPart = TIMEUNIT_PARTS_1[_i]; + if (timeunit_1$1.containsTimeUnit(fullTimeUnit, timeUnitPart)) { + // Create a clone of encQ, but with singleTimeUnit + var singleUnitEncQ = util_1$2.extend({}, fieldQ, { timeUnit: timeUnitPart }); + if (this.cardinality(singleUnitEncQ, false, true) <= 1) { + return false; + } + } + } + return true; + }; + Schema.prototype.domain = function (fieldQueryParts) { + // TODO: differentiate for field with bin / timeUnit + var fieldSchema = this._fieldSchemaIndex[fieldQueryParts.field]; + var domain = util_1$2.keys(fieldSchema.stats.unique); + if (fieldSchema.vlType === type_1$1.Type.QUANTITATIVE) { + // return [min, max], coerced into number types + return [+fieldSchema.stats.min, +fieldSchema.stats.max]; + } + else if (fieldSchema.type === PrimitiveType.DATETIME) { + // return [min, max] dates + return [fieldSchema.stats.min, fieldSchema.stats.max]; + } + else if (fieldSchema.type === PrimitiveType.INTEGER || + fieldSchema.type === PrimitiveType.NUMBER) { + // coerce non-quantitative numerical data into number type + domain = domain.map(function (x) { return +x; }); + return domain.sort(util_1$2.cmp); + } + else if ((fieldSchema.vlType === type_1$1.Type.ORDINAL) && fieldSchema.ordinalDomain) { + return fieldSchema.ordinalDomain; + } + return domain.map(function (x) { + // Convert 'null' to null as it is encoded similarly in datalib. + // This is wrong when it is a string 'null' but that rarely happens. + return x === 'null' ? null : x; + }).sort(util_1$2.cmp); + }; + /** + * @return a Summary corresponding to the field of the given EncodingQuery + */ + Schema.prototype.stats = function (fieldQ) { + // TODO: differentiate for field with bin / timeUnit vs without + var fieldSchema = this._fieldSchemaIndex[fieldQ.field]; + return fieldSchema ? fieldSchema.stats : null; + }; + return Schema; + }()); + exports.Schema = Schema; + /** + * @return a summary of the binning scheme determined from the given max number of bins + */ + function binSummary(maxbins, summary) { + var bin = dlBin({ + min: summary.min, + max: summary.max, + maxbins: maxbins + }); + // start with summary, pre-binning + var result = util_1$2.extend({}, summary); + result.unique = binUnique(bin, summary.unique); + result.distinct = (bin.stop - bin.start) / bin.step; + result.min = bin.start; + result.max = bin.stop; + return result; + } + /** @return a modified version of the passed summary with unique and distinct set according to the timeunit. + * Maps 'null' (string) keys to the null value and invalid dates to 'Invalid Date' in the unique dictionary. + */ + function timeSummary(timeunit, summary) { + var result = util_1$2.extend({}, summary); + var unique = {}; + util_1$2.keys(summary.unique).forEach(function (dateString) { + // don't convert null value because the Date constructor will actually convert it to a date + var date = (dateString === 'null') ? null : new Date(dateString); + // at this point, `date` is either the null value, a valid Date object, or "Invalid Date" which is a Date + var key; + if (date === null) { + key = null; + } + else if (isNaN(date.getTime())) { + key = 'Invalid Date'; + } + else { + key = ((timeunit === timeunit_1$1.TimeUnit.DAY) ? date.getDay() : timeunit_1$1.convert(timeunit, date)).toString(); + } + unique[key] = (unique[key] || 0) + summary.unique[dateString]; + }); + result.unique = unique; + result.distinct = util_1$2.keys(unique).length; + return result; + } + /** + * @return a new unique object based off of the old unique count and a binning scheme + */ + function binUnique(bin, oldUnique) { + var newUnique = {}; + for (var value in oldUnique) { + var bucket = void 0; + if (value === null) { + bucket = null; + } + else if (isNaN(Number(value))) { + bucket = NaN; + } + else { + bucket = bin.value(Number(value)); + } + newUnique[bucket] = (newUnique[bucket] || 0) + oldUnique[value]; + } + return newUnique; + } + /** @return the number of items in list that occur as keys of unique */ + function invalidCount(unique, list) { + return list.reduce(function (prev, cur) { + return unique[cur] ? prev + 1 : prev; + }, 0); + } + var PrimitiveType; + (function (PrimitiveType) { + PrimitiveType[PrimitiveType["STRING"] = 'string'] = "STRING"; + PrimitiveType[PrimitiveType["NUMBER"] = 'number'] = "NUMBER"; + PrimitiveType[PrimitiveType["INTEGER"] = 'integer'] = "INTEGER"; + PrimitiveType[PrimitiveType["BOOLEAN"] = 'boolean'] = "BOOLEAN"; + PrimitiveType[PrimitiveType["DATETIME"] = 'datetime'] = "DATETIME"; + })(PrimitiveType = exports.PrimitiveType || (exports.PrimitiveType = {})); + + }); + + var schema$1 = unwrapExports(schema); + var schema_1 = schema.build; + var schema_2 = schema.Schema; + var schema_3 = schema.PrimitiveType; + + var schema$2 = /*#__PURE__*/Object.freeze({ + default: schema$1, + __moduleExports: schema, + build: schema_1, + Schema: schema_2, + PrimitiveType: schema_3 + }); + + var base = createCommonjsModule(function (module, exports) { + var __extends = (commonjsGlobal && commonjsGlobal.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + })(); + Object.defineProperty(exports, "__esModule", { value: true }); + + + + /** + * Abstract model for a constraint. + */ + var AbstractConstraintModel = /** @class */ (function () { + function AbstractConstraintModel(constraint) { + this.constraint = constraint; + } + AbstractConstraintModel.prototype.name = function () { + return this.constraint.name; + }; + AbstractConstraintModel.prototype.description = function () { + return this.constraint.description; + }; + AbstractConstraintModel.prototype.properties = function () { + return this.constraint.properties; + }; + AbstractConstraintModel.prototype.strict = function () { + return this.constraint.strict; + }; + return AbstractConstraintModel; + }()); + exports.AbstractConstraintModel = AbstractConstraintModel; + var EncodingConstraintModel = /** @class */ (function (_super) { + __extends(EncodingConstraintModel, _super); + function EncodingConstraintModel(constraint) { + return _super.call(this, constraint) || this; + } + EncodingConstraintModel.prototype.hasAllRequiredPropertiesSpecific = function (encQ) { + return util_1$2.every(this.constraint.properties, function (prop) { + if (property_1$1.isEncodingNestedProp(prop)) { + var parent_1 = prop.parent; + var child = prop.child; + if (!encQ[parent_1]) { + return true; + } + return !wildcard_1$1.isWildcard(encQ[parent_1][child]); + } + if (!encQ[prop]) { + return true; + } + return !wildcard_1$1.isWildcard(encQ[prop]); + }); + }; + EncodingConstraintModel.prototype.satisfy = function (encQ, schema, encWildcardIndex, opt) { + // TODO: Re-order logic to optimize the "allowWildcardForProperties" check + if (!this.constraint.allowWildcardForProperties) { + // TODO: extract as a method and do unit test + if (!this.hasAllRequiredPropertiesSpecific(encQ)) { + return true; + } + } + return this.constraint.satisfy(encQ, schema, encWildcardIndex, opt); + }; + return EncodingConstraintModel; + }(AbstractConstraintModel)); + exports.EncodingConstraintModel = EncodingConstraintModel; + + }); + + var base$1 = unwrapExports(base); + var base_1 = base.AbstractConstraintModel; + var base_2 = base.EncodingConstraintModel; + + var base$2 = /*#__PURE__*/Object.freeze({ + default: base$1, + __moduleExports: base, + AbstractConstraintModel: base_1, + EncodingConstraintModel: base_2 + }); + + var schema_1$1 = ( schema$2 && schema$1 ) || schema$2; + + var base_1$1 = ( base$2 && base$1 ) || base$2; + + var field$1 = createCommonjsModule(function (module, exports) { + var __assign = (commonjsGlobal && commonjsGlobal.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + exports.FIELD_CONSTRAINTS = [ + { + name: 'aggregateOpSupportedByType', + description: 'Aggregate function should be supported by data type.', + properties: [property_1$1.Property.TYPE, property_1$1.Property.AGGREGATE], + allowWildcardForProperties: false, + strict: true, + satisfy: function (fieldQ, _, __, ___) { + if (fieldQ.aggregate) { + return !expandedtype_1$1.isDiscrete(fieldQ.type); + } + // TODO: some aggregate function are actually supported by ordinal + return true; // no aggregate is okay with any type. + } + }, { + name: 'asteriskFieldWithCountOnly', + description: 'Field="*" should be disallowed except aggregate="count"', + properties: [property_1$1.Property.FIELD, property_1$1.Property.AGGREGATE], + allowWildcardForProperties: false, + strict: true, + satisfy: function (fieldQ, _, __, ___) { + return (fieldQ.field === '*') === (fieldQ.aggregate === 'count'); + } + }, { + name: 'minCardinalityForBin', + description: 'binned quantitative field should not have too low cardinality', + properties: [property_1$1.Property.BIN, property_1$1.Property.FIELD, property_1$1.Property.TYPE], + allowWildcardForProperties: false, + strict: true, + satisfy: function (fieldQ, schema, _, opt) { + if (fieldQ.bin && fieldQ.type === type_1$1.Type.QUANTITATIVE) { + // We remove bin so schema can infer the raw unbinned cardinality. + var fieldQwithoutBin = { channel: fieldQ.channel, field: fieldQ.field, type: fieldQ.type }; + return schema.cardinality(fieldQwithoutBin) >= opt.minCardinalityForBin; + } + return true; + } + }, { + name: 'binAppliedForQuantitative', + description: 'bin should be applied to quantitative field only.', + properties: [property_1$1.Property.TYPE, property_1$1.Property.BIN], + allowWildcardForProperties: false, + strict: true, + satisfy: function (fieldQ, _, __, ___) { + if (fieldQ.bin) { + // If binned, the type must be quantitative + return fieldQ.type === type_1$1.Type.QUANTITATIVE; + } + return true; + } + }, { + name: 'channelFieldCompatible', + description: "encoding channel's range type be compatible with channel type.", + properties: [property_1$1.Property.CHANNEL, property_1$1.Property.TYPE, property_1$1.Property.BIN, property_1$1.Property.TIMEUNIT], + allowWildcardForProperties: false, + strict: true, + satisfy: function (fieldQ, schema, encWildcardIndex, opt) { + var fieldDef = __assign({ field: 'f' }, encoding_1$2.toFieldDef(fieldQ, { schema: schema, props: ['bin', 'timeUnit', 'type'] })); + return fielddef_1$1.channelCompatibility(fieldDef, fieldQ.channel).compatible; + } + }, { + name: 'hasFn', + description: 'A field with as hasFn flag should have one of aggregate, timeUnit, or bin.', + properties: [property_1$1.Property.AGGREGATE, property_1$1.Property.BIN, property_1$1.Property.TIMEUNIT], + allowWildcardForProperties: true, + strict: true, + satisfy: function (fieldQ, _, __, ___) { + if (fieldQ.hasFn) { + return !!fieldQ.aggregate || !!fieldQ.bin || !!fieldQ.timeUnit; + } + return true; + } + }, { + name: 'omitScaleZeroWithBinnedField', + description: 'Do not use scale zero with binned field', + properties: [property_1$1.Property.SCALE, property_1$1.getEncodingNestedProp('scale', 'zero'), property_1$1.Property.BIN], + allowWildcardForProperties: false, + strict: true, + satisfy: function (fieldQ, _, __, ___) { + if (fieldQ.bin && fieldQ.scale) { + if (fieldQ.scale.zero === true) { + return false; + } + } + return true; + } + }, { + name: 'onlyOneTypeOfFunction', + description: 'Only of of aggregate, autoCount, timeUnit, or bin should be applied at the same time.', + properties: [property_1$1.Property.AGGREGATE, property_1$1.Property.AUTOCOUNT, property_1$1.Property.TIMEUNIT, property_1$1.Property.BIN], + allowWildcardForProperties: true, + strict: true, + satisfy: function (fieldQ, _, __, ___) { + if (encoding_1$2.isFieldQuery(fieldQ)) { + var numFn = (!wildcard_1$1.isWildcard(fieldQ.aggregate) && !!fieldQ.aggregate ? 1 : 0) + + (!wildcard_1$1.isWildcard(fieldQ.bin) && !!fieldQ.bin ? 1 : 0) + + (!wildcard_1$1.isWildcard(fieldQ.timeUnit) && !!fieldQ.timeUnit ? 1 : 0); + return numFn <= 1; + } + // For autoCount there is always only one type of function + return true; + } + }, { + name: 'timeUnitAppliedForTemporal', + description: 'Time unit should be applied to temporal field only.', + properties: [property_1$1.Property.TYPE, property_1$1.Property.TIMEUNIT], + allowWildcardForProperties: false, + strict: true, + satisfy: function (fieldQ, _, __, ___) { + if (fieldQ.timeUnit && fieldQ.type !== type_1$1.Type.TEMPORAL) { + return false; + } + return true; + } + }, { + name: 'timeUnitShouldHaveVariation', + description: 'A particular time unit should be applied only if they produce unique values.', + properties: [property_1$1.Property.TIMEUNIT, property_1$1.Property.TYPE], + allowWildcardForProperties: false, + strict: false, + satisfy: function (fieldQ, schema, encWildcardIndex, opt) { + if (fieldQ.timeUnit && fieldQ.type === type_1$1.Type.TEMPORAL) { + if (!encWildcardIndex.has('timeUnit') && !opt.constraintManuallySpecifiedValue) { + // Do not have to check this as this is manually specified by users. + return true; + } + return schema.timeUnitHasVariation(fieldQ); + } + return true; + } + }, { + name: 'scalePropertiesSupportedByScaleType', + description: 'Scale properties must be supported by correct scale type', + properties: [].concat(property_1$1.SCALE_PROPS, [property_1$1.Property.SCALE, property_1$1.Property.TYPE]), + allowWildcardForProperties: true, + strict: true, + satisfy: function (fieldQ, _, __, ___) { + if (fieldQ.scale) { + var scale = fieldQ.scale; + // If fieldQ.type is an Wildcard and scale.type is undefined, it is equivalent + // to scale type is Wildcard. If scale type is an Wildcard, we do not yet know + // what the scale type is, and thus can ignore the constraint. + var sType = encoding_1$2.scaleType(fieldQ); + if (sType === undefined || sType === null) { + // If still ambiguous, doesn't check the constraint + return true; + } + for (var scaleProp in scale) { + if (scaleProp === 'type' || scaleProp === 'name' || scaleProp === 'enum') { + // ignore type and properties of wildcards + continue; + } + var sProp = scaleProp; + if (sType === 'point') { + // HACK: our current implementation of scaleType() can return point + // when the scaleType is a band since we didn't pass all parameter to Vega-Lite's scale type method. + if (!scale_1$1.scaleTypeSupportProperty('point', sProp) && !scale_1$1.scaleTypeSupportProperty('band', sProp)) { + return false; + } + } + else if (!scale_1$1.scaleTypeSupportProperty(sType, sProp)) { + return false; + } + } + } + return true; + } + }, { + name: 'scalePropertiesSupportedByChannel', + description: 'Not all scale properties are supported by all encoding channels', + properties: [].concat(property_1$1.SCALE_PROPS, [property_1$1.Property.SCALE, property_1$1.Property.CHANNEL]), + allowWildcardForProperties: true, + strict: true, + satisfy: function (fieldQ, _, __, ___) { + if (fieldQ) { + var channel = fieldQ.channel; + var scale = fieldQ.scale; + if (channel && !wildcard_1$1.isWildcard(channel) && scale) { + if (channel === 'row' || channel === 'column') { + // row / column do not have scale + return false; + } + for (var scaleProp in scale) { + if (!scale.hasOwnProperty(scaleProp)) + continue; + if (scaleProp === 'type' || scaleProp === 'name' || scaleProp === 'enum') { + // ignore type and properties of wildcards + continue; + } + var isSupported = scale_1$1.channelScalePropertyIncompatability(channel, scaleProp) === undefined; + if (!isSupported) { + return false; + } + } + } + } + return true; + } + }, { + name: 'typeMatchesPrimitiveType', + description: 'Data type should be supported by field\'s primitive type.', + properties: [property_1$1.Property.FIELD, property_1$1.Property.TYPE], + allowWildcardForProperties: false, + strict: true, + satisfy: function (fieldQ, schema, encWildcardIndex, opt) { + if (fieldQ.field === '*') { + return true; + } + var primitiveType = schema.primitiveType(fieldQ.field); + var type = fieldQ.type; + if (!encWildcardIndex.has('field') && !encWildcardIndex.has('type') && !opt.constraintManuallySpecifiedValue) { + // Do not have to check this as this is manually specified by users. + return true; + } + switch (primitiveType) { + case schema_1$1.PrimitiveType.BOOLEAN: + case schema_1$1.PrimitiveType.STRING: + return type !== type_1$1.Type.QUANTITATIVE && type !== type_1$1.Type.TEMPORAL; + case schema_1$1.PrimitiveType.NUMBER: + case schema_1$1.PrimitiveType.INTEGER: + return type !== type_1$1.Type.TEMPORAL; + case schema_1$1.PrimitiveType.DATETIME: + // TODO: add NOMINAL, ORDINAL support after we support this in Vega-Lite + return type === type_1$1.Type.TEMPORAL; + case null: + // field does not exist in the schema + return false; + } + throw new Error('Not implemented'); + } + }, + { + name: 'typeMatchesSchemaType', + description: 'Enumerated data type of a field should match the field\'s type in the schema.', + properties: [property_1$1.Property.FIELD, property_1$1.Property.TYPE], + allowWildcardForProperties: false, + strict: false, + satisfy: function (fieldQ, schema, encWildcardIndex, opt) { + if (!encWildcardIndex.has('field') && !encWildcardIndex.has('type') && !opt.constraintManuallySpecifiedValue) { + // Do not have to check this as this is manually specified by users. + return true; + } + if (fieldQ.field === '*') { + return fieldQ.type === type_1$1.Type.QUANTITATIVE; + } + return schema.vlType(fieldQ.field) === fieldQ.type; + } + }, { + name: 'maxCardinalityForCategoricalColor', + description: 'Categorical channel should not have too high cardinality', + properties: [property_1$1.Property.CHANNEL, property_1$1.Property.FIELD], + allowWildcardForProperties: false, + strict: false, + satisfy: function (fieldQ, schema, _, opt) { + // TODO: missing case where ordinal / temporal use categorical color + // (once we do so, need to add Property.BIN, Property.TIMEUNIT) + if (fieldQ.channel === channel_1$1.Channel.COLOR && (fieldQ.type === type_1$1.Type.NOMINAL || fieldQ.type === expandedtype_1$1.ExpandedType.KEY)) { + return schema.cardinality(fieldQ) <= opt.maxCardinalityForCategoricalColor; + } + return true; // other channel is irrelevant to this constraint + } + }, { + name: 'maxCardinalityForFacet', + description: 'Row/column channel should not have too high cardinality', + properties: [property_1$1.Property.CHANNEL, property_1$1.Property.FIELD, property_1$1.Property.BIN, property_1$1.Property.TIMEUNIT], + allowWildcardForProperties: false, + strict: false, + satisfy: function (fieldQ, schema, _, opt) { + if (fieldQ.channel === channel_1$1.Channel.ROW || fieldQ.channel === channel_1$1.Channel.COLUMN) { + return schema.cardinality(fieldQ) <= opt.maxCardinalityForFacet; + } + return true; // other channel is irrelevant to this constraint + } + }, { + name: 'maxCardinalityForShape', + description: 'Shape channel should not have too high cardinality', + properties: [property_1$1.Property.CHANNEL, property_1$1.Property.FIELD, property_1$1.Property.BIN, property_1$1.Property.TIMEUNIT], + allowWildcardForProperties: false, + strict: false, + satisfy: function (fieldQ, schema, _, opt) { + if (fieldQ.channel === channel_1$1.Channel.SHAPE) { + return schema.cardinality(fieldQ) <= opt.maxCardinalityForShape; + } + return true; // other channel is irrelevant to this constraint + } + }, + { + name: 'dataTypeAndFunctionMatchScaleType', + description: 'Scale type must match data type', + properties: [property_1$1.Property.TYPE, property_1$1.Property.SCALE, property_1$1.getEncodingNestedProp('scale', 'type'), property_1$1.Property.TIMEUNIT, property_1$1.Property.BIN], + allowWildcardForProperties: false, + strict: true, + satisfy: function (fieldQ, _, __, ___) { + if (fieldQ.scale) { + var type = fieldQ.type; + var sType = encoding_1$2.scaleType(fieldQ); + if (expandedtype_1$1.isDiscrete(type)) { + return sType === undefined || scale_1$1.hasDiscreteDomain(sType); + } + else if (type === type_1$1.Type.TEMPORAL) { + if (!fieldQ.timeUnit) { + return util_1$2.contains([scale_1$1.ScaleType.TIME, scale_1$1.ScaleType.UTC, undefined], sType); + } + else { + return util_1$2.contains([scale_1$1.ScaleType.TIME, scale_1$1.ScaleType.UTC, undefined], sType) || scale_1$1.hasDiscreteDomain(sType); + } + } + else if (type === type_1$1.Type.QUANTITATIVE) { + if (fieldQ.bin) { + return util_1$2.contains([scale_1$1.ScaleType.LINEAR, undefined], sType); + } + else { + return util_1$2.contains([scale_1$1.ScaleType.LOG, scale_1$1.ScaleType.POW, scale_1$1.ScaleType.SQRT, scale_1$1.ScaleType.QUANTILE, scale_1$1.ScaleType.QUANTIZE, scale_1$1.ScaleType.LINEAR, undefined], sType); + } + } + } + return true; + } + }, + { + name: 'stackIsOnlyUsedWithXY', + description: 'stack should only be allowed for x and y channels', + properties: [property_1$1.Property.STACK, property_1$1.Property.CHANNEL], + allowWildcardForProperties: false, + strict: true, + satisfy: function (fieldQ, _, __, ___) { + if (!!fieldQ.stack) { + return fieldQ.channel === channel_1$1.Channel.X || fieldQ.channel === channel_1$1.Channel.Y; + } + return true; + } + } + ].map(function (ec) { return new base_1$1.EncodingConstraintModel(ec); }); + exports.FIELD_CONSTRAINT_INDEX = exports.FIELD_CONSTRAINTS.reduce(function (m, ec) { + m[ec.name()] = ec; + return m; + }, {}); + exports.FIELD_CONSTRAINTS_BY_PROPERTY = exports.FIELD_CONSTRAINTS.reduce(function (index, c) { + for (var _i = 0, _a = c.properties(); _i < _a.length; _i++) { + var prop = _a[_i]; + // Initialize array and use it + index.set(prop, index.get(prop) || []); + index.get(prop).push(c); + } + return index; + }, new propindex_1$1.PropIndex()); + + }); + + var field$2 = unwrapExports(field$1); + var field_1 = field$1.FIELD_CONSTRAINTS; + var field_2 = field$1.FIELD_CONSTRAINT_INDEX; + var field_3 = field$1.FIELD_CONSTRAINTS_BY_PROPERTY; + + var field$3 = /*#__PURE__*/Object.freeze({ + default: field$2, + __moduleExports: field$1, + FIELD_CONSTRAINTS: field_1, + FIELD_CONSTRAINT_INDEX: field_2, + FIELD_CONSTRAINTS_BY_PROPERTY: field_3 + }); + + var value$3 = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + + + + exports.VALUE_CONSTRAINTS = [ + { + name: 'doesNotSupportConstantValue', + description: 'row, column, x, y, order, and detail should not work with constant values.', + properties: [property_1$1.Property.TYPE, property_1$1.Property.AGGREGATE], + allowWildcardForProperties: false, + strict: true, + satisfy: function (valueQ, _, __, ___) { + return !(util_1$2.contains(['row', 'column', 'x', 'y', 'detail', 'order'], valueQ.channel)); + } + } + ].map(function (ec) { return new base_1$1.EncodingConstraintModel(ec); }); + exports.VALUE_CONSTRAINT_INDEX = exports.VALUE_CONSTRAINTS.reduce(function (m, ec) { + m[ec.name()] = ec; + return m; + }, {}); + exports.VALUE_CONSTRAINTS_BY_PROPERTY = exports.VALUE_CONSTRAINTS.reduce(function (index, c) { + for (var _i = 0, _a = c.properties(); _i < _a.length; _i++) { + var prop = _a[_i]; + index.set(prop, index.get(prop) || []); + index.get(prop).push(c); + } + return index; + }, new propindex_1$1.PropIndex()); + + }); + + var value$4 = unwrapExports(value$3); + var value_1 = value$3.VALUE_CONSTRAINTS; + var value_2 = value$3.VALUE_CONSTRAINT_INDEX; + var value_3 = value$3.VALUE_CONSTRAINTS_BY_PROPERTY; + + var value$5 = /*#__PURE__*/Object.freeze({ + default: value$4, + __moduleExports: value$3, + VALUE_CONSTRAINTS: value_1, + VALUE_CONSTRAINT_INDEX: value_2, + VALUE_CONSTRAINTS_BY_PROPERTY: value_3 + }); + + var field_1$1 = ( field$3 && field$2 ) || field$3; + + var value_1$1 = ( value$5 && value$4 ) || value$5; + + var encoding$6 = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + + + /** + * Check all encoding constraints for a particular property and index tuple + */ + function checkEncoding(prop, wildcard, index, specM, schema, opt) { + // Check encoding constraint + var encodingConstraints = field_1$1.FIELD_CONSTRAINTS_BY_PROPERTY.get(prop) || []; + var encQ = specM.getEncodingQueryByIndex(index); + for (var _i = 0, encodingConstraints_1 = encodingConstraints; _i < encodingConstraints_1.length; _i++) { + var c = encodingConstraints_1[_i]; + // Check if the constraint is enabled + if (c.strict() || !!opt[c.name()]) { + // For strict constraint, or enabled non-strict, check the constraints + var satisfy = c.satisfy(encQ, schema, specM.wildcardIndex.encodings[index], opt); + if (!satisfy) { + var violatedConstraint = '(enc) ' + c.name(); + /* istanbul ignore if */ + if (opt.verbose) { + console.log(violatedConstraint + ' failed with ' + specM.toShorthand() + ' for ' + wildcard.name); + } + return violatedConstraint; + } + } + } + var valueContraints = value_1$1.VALUE_CONSTRAINTS_BY_PROPERTY.get(prop) || []; + for (var _a = 0, valueContraints_1 = valueContraints; _a < valueContraints_1.length; _a++) { + var c = valueContraints_1[_a]; + // Check if the constraint is enabled + if ((c.strict() || !!opt[c.name()]) && encoding_1$2.isValueQuery(encQ)) { + // For strict constraint, or enabled non-strict, check the constraints + var satisfy = c.satisfy(encQ, schema, specM.wildcardIndex.encodings[index], opt); + if (!satisfy) { + var violatedConstraint = '(enc) ' + c.name(); + /* istanbul ignore if */ + if (opt.verbose) { + console.log(violatedConstraint + ' failed with ' + specM.toShorthand() + ' for ' + wildcard.name); + } + return violatedConstraint; + } + } + } + return null; + } + exports.checkEncoding = checkEncoding; + + }); + + var encoding$7 = unwrapExports(encoding$6); + var encoding_2$2 = encoding$6.checkEncoding; + + var encoding$8 = /*#__PURE__*/Object.freeze({ + default: encoding$7, + __moduleExports: encoding$6, + checkEncoding: encoding_2$2 + }); + + var spec$4 = createCommonjsModule(function (module, exports) { + var __extends = (commonjsGlobal && commonjsGlobal.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + })(); + Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + + var NONPOSITION_CHANNELS_INDEX = channel_1$1.NONPOSITION_CHANNELS.reduce(function (m, channel) { + m[channel] = true; + return m; + }, {}); + var SpecConstraintModel = /** @class */ (function (_super) { + __extends(SpecConstraintModel, _super); + function SpecConstraintModel(specConstraint) { + return _super.call(this, specConstraint) || this; + } + SpecConstraintModel.prototype.hasAllRequiredPropertiesSpecific = function (specM) { + return util_1$2.every(this.constraint.properties, function (prop) { + if (prop === property_1$1.Property.MARK) { + return !wildcard_1$1.isWildcard(specM.getMark()); + } + // TODO: transform + if (property_1$1.isEncodingNestedProp(prop)) { + var parent_1 = prop.parent; + var child_1 = prop.child; + return util_1$2.every(specM.getEncodings(), function (encQ) { + if (!encQ[parent_1]) { + return true; + } + return !wildcard_1$1.isWildcard(encQ[parent_1][child_1]); + }); + } + if (!property_1$1.isEncodingProperty(prop)) { + throw new Error('UNIMPLEMENTED'); + } + return util_1$2.every(specM.getEncodings(), function (encQ) { + if (!encQ[prop]) { + return true; + } + return !wildcard_1$1.isWildcard(encQ[prop]); + }); + }); + }; + SpecConstraintModel.prototype.satisfy = function (specM, schema, opt) { + // TODO: Re-order logic to optimize the "allowWildcardForProperties" check + if (!this.constraint.allowWildcardForProperties) { + if (!this.hasAllRequiredPropertiesSpecific(specM)) { + return true; + } + } + return this.constraint.satisfy(specM, schema, opt); + }; + return SpecConstraintModel; + }(base_1$1.AbstractConstraintModel)); + exports.SpecConstraintModel = SpecConstraintModel; + exports.SPEC_CONSTRAINTS = [ + { + name: 'noRepeatedChannel', + description: 'Each encoding channel should only be used once.', + properties: [property_1$1.Property.CHANNEL], + allowWildcardForProperties: true, + strict: true, + satisfy: function (specM, _, __) { + var usedChannel = {}; + // channel for all encodings should be valid + return util_1$2.every(specM.getEncodings(), function (encQ) { + if (!wildcard_1$1.isWildcard(encQ.channel)) { + // If channel is specified, it should no be used already + if (usedChannel[encQ.channel]) { + return false; + } + usedChannel[encQ.channel] = true; + return true; + } + return true; // unspecified channel is valid + }); + } + }, + { + name: 'alwaysIncludeZeroInScaleWithBarMark', + description: 'Do not recommend bar mark if scale does not start at zero', + properties: [property_1$1.Property.MARK, property_1$1.Property.SCALE, property_1$1.getEncodingNestedProp('scale', 'zero'), property_1$1.Property.CHANNEL, property_1$1.Property.TYPE], + allowWildcardForProperties: false, + strict: true, + satisfy: function (specM, _, __) { + var mark = specM.getMark(); + var encodings = specM.getEncodings(); + if (mark === mark_1$1.Mark.BAR) { + for (var _i = 0, encodings_1 = encodings; _i < encodings_1.length; _i++) { + var encQ = encodings_1[_i]; + if (encoding_1$2.isFieldQuery(encQ) && + (encQ.channel === channel_1$1.Channel.X || encQ.channel === channel_1$1.Channel.Y) && + (encQ.type === type_1$1.Type.QUANTITATIVE) && + (encQ.scale && encQ.scale.zero === false)) { + // TODO: zero shouldn't be manually specified + return false; + } + } + } + return true; + } + }, + { + name: 'autoAddCount', + description: 'Automatically adding count only for plots with only ordinal, binned quantitative, or temporal with timeunit fields.', + properties: [property_1$1.Property.BIN, property_1$1.Property.TIMEUNIT, property_1$1.Property.TYPE, property_1$1.Property.AUTOCOUNT], + allowWildcardForProperties: true, + strict: false, + satisfy: function (specM, _, __) { + var hasAutoCount = util_1$2.some(specM.getEncodings(), function (encQ) { return encoding_1$2.isEnabledAutoCountQuery(encQ); }); + if (hasAutoCount) { + // Auto count should only be applied if all fields are nominal, ordinal, temporal with timeUnit, binned quantitative, or autoCount + return util_1$2.every(specM.getEncodings(), function (encQ) { + if (encoding_1$2.isValueQuery(encQ)) { + return true; + } + if (encoding_1$2.isAutoCountQuery(encQ)) { + return true; + } + switch (encQ.type) { + case type_1$1.Type.QUANTITATIVE: + return !!encQ.bin; + case type_1$1.Type.TEMPORAL: + return !!encQ.timeUnit; + case type_1$1.Type.ORDINAL: + case expandedtype_1$1.ExpandedType.KEY: + case type_1$1.Type.NOMINAL: + return true; + } + /* istanbul ignore next */ + throw new Error('Unsupported Type'); + }); + } + else { + var autoCountEncIndex = specM.wildcardIndex.encodingIndicesByProperty.get('autoCount') || []; + var neverHaveAutoCount = util_1$2.every(autoCountEncIndex, function (index) { + var encQ = specM.getEncodingQueryByIndex(index); + return encoding_1$2.isAutoCountQuery(encQ) && !wildcard_1$1.isWildcard(encQ.autoCount); + }); + if (neverHaveAutoCount) { + // If the query surely does not have autoCount + // then one of the field should be + // (1) unbinned quantitative + // (2) temporal without time unit + // (3) nominal or ordinal field + // or at least have potential to be (still ambiguous). + return util_1$2.some(specM.getEncodings(), function (encQ) { + if ((encoding_1$2.isFieldQuery(encQ) || encoding_1$2.isAutoCountQuery(encQ)) && encQ.type === type_1$1.Type.QUANTITATIVE) { + if (encoding_1$2.isDisabledAutoCountQuery(encQ)) { + return false; + } + else { + return encoding_1$2.isFieldQuery(encQ) && (!encQ.bin || wildcard_1$1.isWildcard(encQ.bin)); + } + } + else if (encoding_1$2.isFieldQuery(encQ) && encQ.type === type_1$1.Type.TEMPORAL) { + return !encQ.timeUnit || wildcard_1$1.isWildcard(encQ.timeUnit); + } + return false; // nominal or ordinal + }); + } + } + return true; // no auto count, no constraint + } + }, + { + name: 'channelPermittedByMarkType', + description: 'Each encoding channel should be supported by the mark type', + properties: [property_1$1.Property.CHANNEL, property_1$1.Property.MARK], + allowWildcardForProperties: true, + strict: true, + satisfy: function (specM, _, __) { + var mark = specM.getMark(); + // if mark is unspecified, no need to check + if (wildcard_1$1.isWildcard(mark)) + return true; + // TODO: can optimize this to detect only what's the changed property if needed. + return util_1$2.every(specM.getEncodings(), function (encQ) { + // channel unspecified, no need to check + if (wildcard_1$1.isWildcard(encQ.channel)) + return true; + return channel_1$1.supportMark(encQ.channel, mark); + }); + } + }, + { + name: 'hasAllRequiredChannelsForMark', + description: 'All required channels for the specified mark should be specified', + properties: [property_1$1.Property.CHANNEL, property_1$1.Property.MARK], + allowWildcardForProperties: false, + strict: true, + satisfy: function (specM, _, __) { + var mark = specM.getMark(); + switch (mark) { + case mark_1$1.Mark.AREA: + case mark_1$1.Mark.LINE: + return specM.channelUsed(channel_1$1.Channel.X) && specM.channelUsed(channel_1$1.Channel.Y); + case mark_1$1.Mark.TEXT: + return specM.channelUsed(channel_1$1.Channel.TEXT); + case mark_1$1.Mark.BAR: + case mark_1$1.Mark.CIRCLE: + case mark_1$1.Mark.SQUARE: + case mark_1$1.Mark.TICK: + case mark_1$1.Mark.RULE: + case mark_1$1.Mark.RECT: + return specM.channelUsed(channel_1$1.Channel.X) || specM.channelUsed(channel_1$1.Channel.Y); + case mark_1$1.Mark.POINT: + // This allows generating a point plot if channel was not a wildcard. + return !specM.wildcardIndex.hasProperty(property_1$1.Property.CHANNEL) || + specM.channelUsed(channel_1$1.Channel.X) || specM.channelUsed(channel_1$1.Channel.Y); + } + /* istanbul ignore next */ + throw new Error('hasAllRequiredChannelsForMark not implemented for mark' + JSON.stringify(mark)); + } + }, + { + name: 'omitAggregate', + description: 'Omit aggregate plots.', + properties: [property_1$1.Property.AGGREGATE, property_1$1.Property.AUTOCOUNT], + allowWildcardForProperties: true, + strict: false, + satisfy: function (specM, _, __) { + if (specM.isAggregate()) { + return false; + } + return true; + } + }, + { + name: 'omitAggregatePlotWithDimensionOnlyOnFacet', + description: 'Omit aggregate plots with dimensions only on facets as that leads to inefficient use of space.', + properties: [property_1$1.Property.CHANNEL, property_1$1.Property.AGGREGATE, property_1$1.Property.AUTOCOUNT], + allowWildcardForProperties: false, + strict: false, + satisfy: function (specM, _, opt) { + if (specM.isAggregate()) { + var hasNonFacetDim_1 = false, hasDim_1 = false, hasEnumeratedFacetDim_1 = false; + specM.specQuery.encodings.forEach(function (encQ, index) { + if (encoding_1$2.isValueQuery(encQ) || (encoding_1$2.isDisabledAutoCountQuery(encQ))) + return; // skip unused field + // FieldQuery & !encQ.aggregate + if (encoding_1$2.isFieldQuery(encQ) && !encQ.aggregate) { + hasDim_1 = true; + if (util_1$2.contains([channel_1$1.Channel.ROW, channel_1$1.Channel.COLUMN], encQ.channel)) { + if (specM.wildcardIndex.hasEncodingProperty(index, property_1$1.Property.CHANNEL)) { + hasEnumeratedFacetDim_1 = true; + } + } + else { + hasNonFacetDim_1 = true; + } + } + }); + if (hasDim_1 && !hasNonFacetDim_1) { + if (hasEnumeratedFacetDim_1 || opt.constraintManuallySpecifiedValue) { + return false; + } + } + } + return true; + } + }, + { + name: 'omitAggregatePlotWithoutDimension', + description: 'Aggregate plots without dimension should be omitted', + properties: [property_1$1.Property.AGGREGATE, property_1$1.Property.AUTOCOUNT, property_1$1.Property.BIN, property_1$1.Property.TIMEUNIT, property_1$1.Property.TYPE], + allowWildcardForProperties: false, + strict: false, + satisfy: function (specM, _, __) { + if (specM.isAggregate()) { + // TODO relax + return util_1$2.some(specM.getEncodings(), function (encQ) { + if (encoding_1$2.isDimension(encQ) || (encoding_1$2.isFieldQuery(encQ) && (encQ.type === 'temporal'))) { + return true; + } + return false; + }); + } + return true; + } + }, + { + // TODO: we can be smarter and check if bar has occlusion based on profiling statistics + name: 'omitBarLineAreaWithOcclusion', + description: 'Don\'t use bar, line or area to visualize raw plot as they often lead to occlusion.', + properties: [property_1$1.Property.MARK, property_1$1.Property.AGGREGATE, property_1$1.Property.AUTOCOUNT], + allowWildcardForProperties: false, + strict: false, + satisfy: function (specM, _, __) { + if (util_1$2.contains([mark_1$1.Mark.BAR, mark_1$1.Mark.LINE, mark_1$1.Mark.AREA], specM.getMark())) { + return specM.isAggregate(); + } + return true; + } + }, + { + name: 'omitBarTickWithSize', + description: 'Do not map field to size channel with bar and tick mark', + properties: [property_1$1.Property.CHANNEL, property_1$1.Property.MARK], + allowWildcardForProperties: true, + strict: false, + satisfy: function (specM, _, opt) { + var mark = specM.getMark(); + if (util_1$2.contains([mark_1$1.Mark.TICK, mark_1$1.Mark.BAR], mark)) { + if (specM.channelEncodingField(channel_1$1.Channel.SIZE)) { + if (opt.constraintManuallySpecifiedValue) { + // If size is used and we constraintManuallySpecifiedValue, + // then the spec violates this constraint. + return false; + } + else { + // Otherwise have to search for the size channel and check if it is enumerated + var encodings = specM.specQuery.encodings; + for (var i = 0; i < encodings.length; i++) { + var encQ = encodings[i]; + if (encQ.channel === channel_1$1.Channel.SIZE) { + if (specM.wildcardIndex.hasEncodingProperty(i, property_1$1.Property.CHANNEL)) { + // If enumerated, then this is bad + return false; + } + else { + // If it's manually specified, no need to continue searching, just return. + return true; + } + } + } + } + } + } + return true; // skip + } + }, + { + name: 'omitBarAreaForLogScale', + description: 'Do not use bar and area mark for x and y\'s log scale', + properties: [property_1$1.Property.MARK, property_1$1.Property.CHANNEL, property_1$1.Property.SCALE, property_1$1.getEncodingNestedProp('scale', 'type'), property_1$1.Property.TYPE], + allowWildcardForProperties: false, + strict: true, + satisfy: function (specM, _, __) { + var mark = specM.getMark(); + var encodings = specM.getEncodings(); + // TODO: mark or scale type should be enumerated + if (mark === mark_1$1.Mark.AREA || mark === mark_1$1.Mark.BAR) { + for (var _i = 0, encodings_2 = encodings; _i < encodings_2.length; _i++) { + var encQ = encodings_2[_i]; + if (encoding_1$2.isFieldQuery(encQ) && ((encQ.channel === channel_1$1.Channel.X || encQ.channel === channel_1$1.Channel.Y) && encQ.scale)) { + var sType = encoding_1$2.scaleType(encQ); + if (sType === scale_1$1.ScaleType.LOG) { + return false; + } + } + } + } + return true; + } + }, + { + name: 'omitMultipleNonPositionalChannels', + description: 'Unless manually specified, do not use multiple non-positional encoding channel to avoid over-encoding.', + properties: [property_1$1.Property.CHANNEL], + allowWildcardForProperties: true, + strict: false, + satisfy: function (specM, _, opt) { + // have to use specM.specQuery.encodings insetad of specM.getEncodings() + // since specM.getEncodings() remove encQ with autoCount===false from the array + // and thus might shift the index + var encodings = specM.specQuery.encodings; + var nonPositionChannelCount = 0; + var hasEnumeratedNonPositionChannel = false; + for (var i = 0; i < encodings.length; i++) { + var encQ = encodings[i]; + if (encoding_1$2.isValueQuery(encQ) || (encoding_1$2.isDisabledAutoCountQuery(encQ))) { + continue; // ignore skipped encoding + } + var channel = encQ.channel; + if (!wildcard_1$1.isWildcard(channel)) { + if (NONPOSITION_CHANNELS_INDEX[channel + '']) { + nonPositionChannelCount += 1; + if (specM.wildcardIndex.hasEncodingProperty(i, property_1$1.Property.CHANNEL)) { + hasEnumeratedNonPositionChannel = true; + } + if (nonPositionChannelCount > 1 && + (hasEnumeratedNonPositionChannel || opt.constraintManuallySpecifiedValue)) { + return false; + } + } + } + } + return true; + } + }, + { + name: 'omitNonPositionalOrFacetOverPositionalChannels', + description: 'Do not use non-positional channels unless all positional channels are used', + properties: [property_1$1.Property.CHANNEL], + allowWildcardForProperties: false, + strict: false, + satisfy: function (specM, _, opt) { + var encodings = specM.specQuery.encodings; + var hasNonPositionalChannelOrFacet = false; + var hasEnumeratedNonPositionOrFacetChannel = false; + var hasX = false, hasY = false; + for (var i = 0; i < encodings.length; i++) { + var encQ = encodings[i]; + if (encoding_1$2.isValueQuery(encQ) || (encoding_1$2.isDisabledAutoCountQuery(encQ))) { + continue; // ignore skipped encoding + } + var channel = encQ.channel; + if (channel === channel_1$1.Channel.X) { + hasX = true; + } + else if (channel === channel_1$1.Channel.Y) { + hasY = true; + } + else if (!wildcard_1$1.isWildcard(channel)) { + // All non positional channel / Facet + hasNonPositionalChannelOrFacet = true; + if (specM.wildcardIndex.hasEncodingProperty(i, property_1$1.Property.CHANNEL)) { + hasEnumeratedNonPositionOrFacetChannel = true; + } + } + } + if (hasEnumeratedNonPositionOrFacetChannel || + (opt.constraintManuallySpecifiedValue && hasNonPositionalChannelOrFacet)) { + return hasX && hasY; + } + return true; + } + }, + { + name: 'omitRaw', + description: 'Omit raw plots.', + properties: [property_1$1.Property.AGGREGATE, property_1$1.Property.AUTOCOUNT], + allowWildcardForProperties: false, + strict: false, + satisfy: function (specM, _, __) { + if (!specM.isAggregate()) { + return false; + } + return true; + } + }, + { + name: 'omitRawContinuousFieldForAggregatePlot', + description: 'Aggregate plot should not use raw continuous field as group by values. ' + + '(Quantitative should be binned. Temporal should have time unit.)', + properties: [property_1$1.Property.AGGREGATE, property_1$1.Property.AUTOCOUNT, property_1$1.Property.TIMEUNIT, property_1$1.Property.BIN, property_1$1.Property.TYPE], + allowWildcardForProperties: true, + strict: false, + satisfy: function (specM, _, opt) { + if (specM.isAggregate()) { + var encodings = specM.specQuery.encodings; + for (var i = 0; i < encodings.length; i++) { + var encQ = encodings[i]; + if (encoding_1$2.isValueQuery(encQ) || (encoding_1$2.isDisabledAutoCountQuery(encQ))) + continue; // skip unused encoding + // TODO: aggregate for ordinal and temporal + if (encoding_1$2.isFieldQuery(encQ) && encQ.type === type_1$1.Type.TEMPORAL) { + // Temporal fields should have timeUnit or is still a wildcard + if (!encQ.timeUnit && (specM.wildcardIndex.hasEncodingProperty(i, property_1$1.Property.TIMEUNIT) || + opt.constraintManuallySpecifiedValue)) { + return false; + } + } + if (encQ.type === type_1$1.Type.QUANTITATIVE) { + if (encoding_1$2.isFieldQuery(encQ) && !encQ.bin && !encQ.aggregate) { + // If Raw Q + if (specM.wildcardIndex.hasEncodingProperty(i, property_1$1.Property.BIN) || + specM.wildcardIndex.hasEncodingProperty(i, property_1$1.Property.AGGREGATE) || + specM.wildcardIndex.hasEncodingProperty(i, property_1$1.Property.AUTOCOUNT)) { + // and it's raw from enumeration + return false; + } + if (opt.constraintManuallySpecifiedValue) { + // or if we constraintManuallySpecifiedValue + return false; + } + } + } + } + } + return true; + } + }, + { + name: 'omitRawDetail', + description: 'Do not use detail channel with raw plot.', + properties: [property_1$1.Property.CHANNEL, property_1$1.Property.AGGREGATE, property_1$1.Property.AUTOCOUNT], + allowWildcardForProperties: false, + strict: true, + satisfy: function (specM, _, opt) { + if (specM.isAggregate()) { + return true; + } + return util_1$2.every(specM.specQuery.encodings, function (encQ, index) { + if (encoding_1$2.isValueQuery(encQ) || (encoding_1$2.isDisabledAutoCountQuery(encQ))) + return true; // ignore autoCount field + if (encQ.channel === channel_1$1.Channel.DETAIL) { + // Detail channel for raw plot is not good, except when its enumerated + // or when it's manually specified but we constraintManuallySpecifiedValue. + if (specM.wildcardIndex.hasEncodingProperty(index, property_1$1.Property.CHANNEL) || + opt.constraintManuallySpecifiedValue) { + return false; + } + } + return true; + }); + } + }, + { + name: 'omitRepeatedField', + description: 'Each field should be mapped to only one channel', + properties: [property_1$1.Property.FIELD], + allowWildcardForProperties: true, + strict: false, + satisfy: function (specM, _, opt) { + var fieldUsed = {}; + var fieldEnumerated = {}; + var encodings = specM.specQuery.encodings; + for (var i = 0; i < encodings.length; i++) { + var encQ = encodings[i]; + if (encoding_1$2.isValueQuery(encQ) || encoding_1$2.isAutoCountQuery(encQ)) + continue; + var field = void 0; + if (encQ.field && !wildcard_1$1.isWildcard(encQ.field)) { + field = encQ.field; + } + if (encoding_1$2.isAutoCountQuery(encQ) && !wildcard_1$1.isWildcard(encQ.autoCount)) { + field = 'count_*'; + } + if (field) { + if (specM.wildcardIndex.hasEncodingProperty(i, property_1$1.Property.FIELD)) { + fieldEnumerated[field] = true; + } + // When the field is specified previously, + // if it is enumerated (either previously or in this encQ) + // or if the opt.constraintManuallySpecifiedValue is true, + // then it violates the constraint. + if (fieldUsed[field]) { + if (fieldEnumerated[field] || opt.constraintManuallySpecifiedValue) { + return false; + } + } + fieldUsed[field] = true; + } + } + return true; + } + }, + // TODO: omitShapeWithBin + { + name: 'omitVerticalDotPlot', + description: 'Do not output vertical dot plot.', + properties: [property_1$1.Property.CHANNEL], + allowWildcardForProperties: true, + strict: false, + satisfy: function (specM, _, __) { + var encodings = specM.getEncodings(); + if (encodings.length === 1 && encodings[0].channel === channel_1$1.Channel.Y) { + return false; + } + return true; + } + }, + // EXPENSIVE CONSTRAINTS -- check them later! + { + name: 'hasAppropriateGraphicTypeForMark', + description: 'Has appropriate graphic type for mark', + properties: [property_1$1.Property.CHANNEL, property_1$1.Property.MARK, property_1$1.Property.TYPE, property_1$1.Property.TIMEUNIT, property_1$1.Property.BIN, property_1$1.Property.AGGREGATE, property_1$1.Property.AUTOCOUNT], + allowWildcardForProperties: false, + strict: false, + satisfy: function (specM, _, __) { + var mark = specM.getMark(); + switch (mark) { + case mark_1$1.Mark.AREA: + case mark_1$1.Mark.LINE: + if (specM.isAggregate()) { + var xEncQ_1 = specM.getEncodingQueryByChannel(channel_1$1.Channel.X); + var yEncQ_1 = specM.getEncodingQueryByChannel(channel_1$1.Channel.Y); + var xIsMeasure = encoding_1$2.isMeasure(xEncQ_1); + var yIsMeasure = encoding_1$2.isMeasure(yEncQ_1); + // for aggregate line / area, we need at least one group-by axis and one measure axis. + return xEncQ_1 && yEncQ_1 && (xIsMeasure !== yIsMeasure) && + // and the dimension axis should not be nominal + // TODO: make this clause optional + !(encoding_1$2.isFieldQuery(xEncQ_1) && !xIsMeasure && util_1$2.contains(['nominal', 'key'], xEncQ_1.type)) && + !(encoding_1$2.isFieldQuery(yEncQ_1) && !yIsMeasure && util_1$2.contains(['nominal', 'key'], yEncQ_1.type)); + // TODO: allow connected scatterplot + } + return true; + case mark_1$1.Mark.TEXT: + // FIXME correctly when we add text + return true; + case mark_1$1.Mark.BAR: + case mark_1$1.Mark.TICK: + // Bar and tick should not use size. + if (specM.channelEncodingField(channel_1$1.Channel.SIZE)) { + return false; + } + else { + // Tick and Bar should have one and only one measure + var xEncQ_2 = specM.getEncodingQueryByChannel(channel_1$1.Channel.X); + var yEncQ_2 = specM.getEncodingQueryByChannel(channel_1$1.Channel.Y); + var xIsMeasure = encoding_1$2.isMeasure(xEncQ_2); + var yIsMeasure = encoding_1$2.isMeasure(yEncQ_2); + if (xIsMeasure !== yIsMeasure) { + return true; + } + return false; + } + case mark_1$1.Mark.RECT: + // Until CompassQL supports layering, it only makes sense for + // rect to encode DxD or 1xD (otherwise just use bar). + // Furthermore, color should only be used in a 'heatmap' fashion + // (with a measure field). + var xEncQ = specM.getEncodingQueryByChannel(channel_1$1.Channel.X); + var yEncQ = specM.getEncodingQueryByChannel(channel_1$1.Channel.Y); + var xIsDimension = encoding_1$2.isDimension(xEncQ); + var yIsDimension = encoding_1$2.isDimension(yEncQ); + var colorEncQ = specM.getEncodingQueryByChannel(channel_1$1.Channel.COLOR); + var colorIsQuantitative = encoding_1$2.isMeasure(colorEncQ); + var colorIsOrdinal = encoding_1$2.isFieldQuery(colorEncQ) ? + colorEncQ.type === type_1$1.Type.ORDINAL : false; + var correctChannels = (xIsDimension && yIsDimension) || + (xIsDimension && !specM.channelUsed(channel_1$1.Channel.Y)) || + (yIsDimension && !specM.channelUsed(channel_1$1.Channel.X)); + var correctColor = !colorEncQ || + (colorEncQ && (colorIsQuantitative || colorIsOrdinal)); + return correctChannels && correctColor; + case mark_1$1.Mark.CIRCLE: + case mark_1$1.Mark.POINT: + case mark_1$1.Mark.SQUARE: + case mark_1$1.Mark.RULE: + return true; + } + /* istanbul ignore next */ + throw new Error('hasAllRequiredChannelsForMark not implemented for mark' + mark); + } + }, + { + name: 'omitInvalidStackSpec', + description: 'If stack is specified, must follow Vega-Lite stack rules', + properties: [property_1$1.Property.STACK, property_1$1.Property.FIELD, property_1$1.Property.CHANNEL, property_1$1.Property.MARK, property_1$1.Property.AGGREGATE, property_1$1.Property.AUTOCOUNT, property_1$1.Property.SCALE, property_1$1.getEncodingNestedProp('scale', 'type'), property_1$1.Property.TYPE], + allowWildcardForProperties: false, + strict: true, + satisfy: function (specM, _, __) { + if (!specM.wildcardIndex.hasProperty(property_1$1.Property.STACK)) { + return true; + } + var stackProps = specM.getVlStack(); + if (stackProps === null && specM.getStackOffset() !== null) { + return false; + } + if (stackProps.fieldChannel !== specM.getStackChannel()) { + return false; + } + return true; + } + }, + { + name: 'omitNonSumStack', + description: 'Stack specifications that use non-summative aggregates should be omitted (even implicit ones)', + properties: [property_1$1.Property.CHANNEL, property_1$1.Property.MARK, property_1$1.Property.AGGREGATE, property_1$1.Property.AUTOCOUNT, property_1$1.Property.SCALE, property_1$1.getEncodingNestedProp('scale', 'type'), property_1$1.Property.TYPE], + allowWildcardForProperties: false, + strict: true, + satisfy: function (specM, _, __) { + var specStack = specM.getVlStack(); + if (specStack != null) { + var stackParentEncQ = specM.getEncodingQueryByChannel(specStack.fieldChannel); + if (!util_1$2.contains(aggregate_1$1.SUM_OPS, stackParentEncQ.aggregate)) { + return false; + } + } + return true; + } + }, + { + name: 'omitTableWithOcclusionIfAutoAddCount', + description: 'Plots without aggregation or autocount where x and y are both discrete should be omitted if autoAddCount is enabled as they often lead to occlusion', + properties: [property_1$1.Property.CHANNEL, property_1$1.Property.TYPE, property_1$1.Property.TIMEUNIT, property_1$1.Property.BIN, property_1$1.Property.AGGREGATE, property_1$1.Property.AUTOCOUNT], + allowWildcardForProperties: false, + strict: false, + satisfy: function (specM, _, opt) { + if (opt.autoAddCount) { + var xEncQ = specM.getEncodingQueryByChannel('x'); + var yEncQ = specM.getEncodingQueryByChannel('y'); + if ((!encoding_1$2.isFieldQuery(xEncQ) || encoding_1$2.isDimension(xEncQ)) && + (!encoding_1$2.isFieldQuery(yEncQ) || encoding_1$2.isDimension(yEncQ))) { + if (!specM.isAggregate()) { + return false; + } + else { + return util_1$2.every(specM.getEncodings(), function (encQ) { + var channel = encQ.channel; + if (channel !== channel_1$1.Channel.X && channel !== channel_1$1.Channel.Y && + channel !== channel_1$1.Channel.ROW && channel !== channel_1$1.Channel.COLUMN) { + // Non-position fields should not be unaggreated fields + if (encoding_1$2.isFieldQuery(encQ) && !encQ.aggregate) { + return false; + } + } + return true; + }); + } + } + } + return true; + } + } + ].map(function (sc) { return new SpecConstraintModel(sc); }); + // For testing + exports.SPEC_CONSTRAINT_INDEX = exports.SPEC_CONSTRAINTS.reduce(function (m, c) { + m[c.name()] = c; + return m; + }, {}); + var SPEC_CONSTRAINTS_BY_PROPERTY = exports.SPEC_CONSTRAINTS.reduce(function (index, c) { + for (var _i = 0, _a = c.properties(); _i < _a.length; _i++) { + var prop = _a[_i]; + // Initialize array and use it + index.set(prop, index.get(prop) || []); + index.get(prop).push(c); + } + return index; + }, new propindex_1$1.PropIndex()); + /** + * Check all encoding constraints for a particular property and index tuple + */ + function checkSpec(prop, wildcard, specM, schema, opt) { + // Check encoding constraint + var specConstraints = SPEC_CONSTRAINTS_BY_PROPERTY.get(prop) || []; + for (var _i = 0, specConstraints_1 = specConstraints; _i < specConstraints_1.length; _i++) { + var c = specConstraints_1[_i]; + // Check if the constraint is enabled + if (c.strict() || !!opt[c.name()]) { + // For strict constraint, or enabled non-strict, check the constraints + var satisfy = c.satisfy(specM, schema, opt); + if (!satisfy) { + var violatedConstraint = '(spec) ' + c.name(); + /* istanbul ignore if */ + if (opt.verbose) { + console.log(violatedConstraint + ' failed with ' + specM.toShorthand() + ' for ' + wildcard.name); + } + return violatedConstraint; + } + } + } + return null; + } + exports.checkSpec = checkSpec; + + }); + + var spec$5 = unwrapExports(spec$4); + var spec_1$1 = spec$4.SpecConstraintModel; + var spec_2$1 = spec$4.SPEC_CONSTRAINTS; + var spec_3$1 = spec$4.SPEC_CONSTRAINT_INDEX; + var spec_4$1 = spec$4.checkSpec; + + var spec$6 = /*#__PURE__*/Object.freeze({ + default: spec$5, + __moduleExports: spec$4, + SpecConstraintModel: spec_1$1, + SPEC_CONSTRAINTS: spec_2$1, + SPEC_CONSTRAINT_INDEX: spec_3$1, + checkSpec: spec_4$1 + }); + + var encoding$9 = ( encoding$8 && encoding$7 ) || encoding$8; + + var spec$7 = ( spec$6 && spec$5 ) || spec$6; + + var constraint = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + exports.encoding = encoding$9; + + exports.spec = spec$7; + + }); + + var index$1 = unwrapExports(constraint); + var constraint_1 = constraint.encoding; + var constraint_2 = constraint.spec; + + var constraint$1 = /*#__PURE__*/Object.freeze({ + default: index$1, + __moduleExports: constraint, + encoding: constraint_1, + spec: constraint_2 + }); + + var enumerator = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + var ENUMERATOR_INDEX = new propindex_1$1.PropIndex(); + function getEnumerator(prop) { + return ENUMERATOR_INDEX.get(prop); + } + exports.getEnumerator = getEnumerator; + ENUMERATOR_INDEX.set('mark', function (wildcardIndex, schema, opt) { + return function (answerSet, specM) { + var markWildcard = specM.getMark(); + // enumerate the value + markWildcard.enum.forEach(function (mark) { + specM.setMark(mark); + // Check spec constraint + var violatedSpecConstraint = spec$7.checkSpec('mark', wildcardIndex.mark, specM, schema, opt); + if (!violatedSpecConstraint) { + // emit + answerSet.push(specM.duplicate()); + } + }); + // Reset to avoid side effect + specM.resetMark(); + return answerSet; + }; + }); + property_1$1.ENCODING_TOPLEVEL_PROPS.forEach(function (prop) { + ENUMERATOR_INDEX.set(prop, EncodingPropertyGeneratorFactory(prop)); + }); + property_1$1.ENCODING_NESTED_PROPS.forEach(function (nestedProp) { + ENUMERATOR_INDEX.set(nestedProp, EncodingPropertyGeneratorFactory(nestedProp)); + }); + /** + * @param prop property type. + * @return an answer set reducer factory for the given prop. + */ + function EncodingPropertyGeneratorFactory(prop) { + /** + * @return as reducer that takes a specQueryModel as input and output an answer set array. + */ + return function (wildcardIndex, schema, opt) { + return function (answerSet, specM) { + // index of encoding mappings that require enumeration + var indices = wildcardIndex.encodingIndicesByProperty.get(prop); + function enumerate(jobIndex) { + if (jobIndex === indices.length) { + // emit and terminate + answerSet.push(specM.duplicate()); + return; + } + var index = indices[jobIndex]; + var wildcard = wildcardIndex.encodings[index].get(prop); + var encQ = specM.getEncodingQueryByIndex(index); + var propWildcard = specM.getEncodingProperty(index, prop); + if (encoding_1$2.isValueQuery(encQ) || ( + // TODO: encQ.exclude + // If this encoding query is an excluded autoCount, there is no point enumerating other properties + // for this encoding query because they will be excluded anyway. + // Thus, we can just move on to the next encoding to enumerate. + (encoding_1$2.isDisabledAutoCountQuery(encQ)) || + // nested encoding property might have its parent set to false + // therefore, we no longer have to enumerate them + !propWildcard)) { + enumerate(jobIndex + 1); + } + else { + wildcard.enum.forEach(function (propVal) { + if (propVal === null) { + // our duplicate() method use JSON.stringify, parse and thus can accidentally + // convert undefined in an array into null + propVal = undefined; + } + specM.setEncodingProperty(index, prop, propVal, wildcard); + // Check encoding constraint + var violatedEncodingConstraint = encoding$9.checkEncoding(prop, wildcard, index, specM, schema, opt); + if (violatedEncodingConstraint) { + return; // do not keep searching + } + // Check spec constraint + var violatedSpecConstraint = spec$7.checkSpec(prop, wildcard, specM, schema, opt); + if (violatedSpecConstraint) { + return; // do not keep searching + } + // If qualify all of the constraints, keep enumerating + enumerate(jobIndex + 1); + }); + // Reset to avoid side effect + specM.resetEncodingProperty(index, prop, wildcard); + } + } + // start enumerating from 0 + enumerate(0); + return answerSet; + }; + }; + } + exports.EncodingPropertyGeneratorFactory = EncodingPropertyGeneratorFactory; + + }); + + var enumerator$1 = unwrapExports(enumerator); + var enumerator_1 = enumerator.getEnumerator; + var enumerator_2 = enumerator.EncodingPropertyGeneratorFactory; + + var enumerator$2 = /*#__PURE__*/Object.freeze({ + default: enumerator$1, + __moduleExports: enumerator, + getEnumerator: enumerator_1, + EncodingPropertyGeneratorFactory: enumerator_2 + }); + + var wildcardindex = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + + var WildcardIndex = /** @class */ (function () { + function WildcardIndex() { + this._mark = undefined; + this._encodings = {}; + this._encodingIndicesByProperty = new propindex_1$1.PropIndex(); + } + WildcardIndex.prototype.setEncodingProperty = function (index, prop, wildcard) { + var encodingsIndex = this._encodings; + // Init encoding index and set prop + var encIndex = encodingsIndex[index] = encodingsIndex[index] || new propindex_1$1.PropIndex(); + encIndex.set(prop, wildcard); + // Initialize indicesByProperty[prop] and add index + var indicesByProp = this._encodingIndicesByProperty; + indicesByProp.set(prop, (indicesByProp.get(prop) || [])); + indicesByProp.get(prop).push(index); + return this; + }; + WildcardIndex.prototype.hasEncodingProperty = function (index, prop) { + return !!this._encodings[index] && this._encodings[index].has(prop); + }; + WildcardIndex.prototype.hasProperty = function (prop) { + if (property_1$1.isEncodingProperty(prop)) { + return this.encodingIndicesByProperty.has(prop); + } + else if (prop === 'mark') { + return !!this.mark; + } + /* istanbul ignore next */ + throw new Error('Unimplemented for property ' + prop); + }; + WildcardIndex.prototype.isEmpty = function () { + return !this.mark && this.encodingIndicesByProperty.size() === 0; + }; + WildcardIndex.prototype.setMark = function (mark) { + this._mark = mark; + return this; + }; + Object.defineProperty(WildcardIndex.prototype, "mark", { + get: function () { + return this._mark; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WildcardIndex.prototype, "encodings", { + get: function () { + return this._encodings; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(WildcardIndex.prototype, "encodingIndicesByProperty", { + get: function () { + return this._encodingIndicesByProperty; + }, + enumerable: true, + configurable: true + }); + return WildcardIndex; + }()); + exports.WildcardIndex = WildcardIndex; + + }); + + var wildcardindex$1 = unwrapExports(wildcardindex); + var wildcardindex_1 = wildcardindex.WildcardIndex; + + var wildcardindex$2 = /*#__PURE__*/Object.freeze({ + default: wildcardindex$1, + __moduleExports: wildcardindex, + WildcardIndex: wildcardindex_1 + }); + + var groupby = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + exports.REPLACE_BLANK_FIELDS = { '*': '' }; + exports.REPLACE_XY_CHANNELS = { x: 'xy', y: 'xy' }; + exports.REPLACE_FACET_CHANNELS = { row: 'facet', column: 'facet' }; + exports.REPLACE_MARK_STYLE_CHANNELS = { color: 'style', opacity: 'style', shape: 'style', size: 'style' }; + function isExtendedGroupBy(g) { + return util$6.isObject(g) && !!g['property']; + } + exports.isExtendedGroupBy = isExtendedGroupBy; + function parseGroupBy(groupBy, include, replaceIndex) { + include = include || new propindex_1$1.PropIndex(); + replaceIndex = replaceIndex || new propindex_1$1.PropIndex(); + groupBy.forEach(function (grpBy) { + if (isExtendedGroupBy(grpBy)) { + include.setByKey(grpBy.property, true); + replaceIndex.setByKey(grpBy.property, grpBy.replace); + } + else { + include.setByKey(grpBy, true); + } + }); + return { + include: include, + replaceIndex: replaceIndex, + replacer: shorthand_1$1.getReplacerIndex(replaceIndex) + }; + } + exports.parseGroupBy = parseGroupBy; + function toString(groupBy) { + if (util$6.isArray(groupBy)) { + return groupBy.map(function (g) { + if (isExtendedGroupBy(g)) { + if (g.replace) { + var replaceIndex_1 = util_1$2.keys(g.replace).reduce(function (index, valFrom) { + var valTo = g.replace[valFrom]; + (index[valTo] = index[valTo] || []).push(valFrom); + return index; + }, {}); + return g.property + '[' + util_1$2.keys(replaceIndex_1).map(function (valTo) { + var valsFrom = replaceIndex_1[valTo].sort(); + return valsFrom.join(',') + '=>' + valTo; + }).join(';') + ']'; + } + return g.property; + } + return g; + }).join(','); + } + else { + return groupBy; + } + } + exports.toString = toString; + exports.GROUP_BY_FIELD_TRANSFORM = [ + property_1$1.Property.FIELD, property_1$1.Property.TYPE, + property_1$1.Property.AGGREGATE, property_1$1.Property.BIN, property_1$1.Property.TIMEUNIT, property_1$1.Property.STACK + ]; + exports.GROUP_BY_ENCODING = exports.GROUP_BY_FIELD_TRANSFORM.concat([ + { + property: property_1$1.Property.CHANNEL, + replace: { + 'x': 'xy', 'y': 'xy', + 'color': 'style', 'size': 'style', 'shape': 'style', 'opacity': 'style', + 'row': 'facet', 'column': 'facet' + } + } + ]); + + }); + + var groupby$1 = unwrapExports(groupby); + var groupby_1 = groupby.REPLACE_BLANK_FIELDS; + var groupby_2 = groupby.REPLACE_XY_CHANNELS; + var groupby_3 = groupby.REPLACE_FACET_CHANNELS; + var groupby_4 = groupby.REPLACE_MARK_STYLE_CHANNELS; + var groupby_5 = groupby.isExtendedGroupBy; + var groupby_6 = groupby.parseGroupBy; + var groupby_7 = groupby.GROUP_BY_FIELD_TRANSFORM; + var groupby_8 = groupby.GROUP_BY_ENCODING; + + var groupby$2 = /*#__PURE__*/Object.freeze({ + default: groupby$1, + __moduleExports: groupby, + REPLACE_BLANK_FIELDS: groupby_1, + REPLACE_XY_CHANNELS: groupby_2, + REPLACE_FACET_CHANNELS: groupby_3, + REPLACE_MARK_STYLE_CHANNELS: groupby_4, + isExtendedGroupBy: groupby_5, + parseGroupBy: groupby_6, + GROUP_BY_FIELD_TRANSFORM: groupby_7, + GROUP_BY_ENCODING: groupby_8 + }); + + var groupBy = ( groupby$2 && groupby$1 ) || groupby$2; + + var nest_1 = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + /** + * Registry for all possible grouping key functions. + */ + var groupRegistry = {}; + /** + * Add a grouping function to the registry. + */ + function registerKeyFn(name, keyFn) { + groupRegistry[name] = keyFn; + } + exports.registerKeyFn = registerKeyFn; + exports.FIELD = 'field'; + exports.FIELD_TRANSFORM = 'fieldTransform'; + exports.ENCODING = 'encoding'; + exports.SPEC = 'spec'; + /** + * Group the input spec query model by a key function registered in the group registry + * @return + */ + function nest(specModels, queryNest) { + if (queryNest) { + var rootGroup_1 = { + name: '', + path: '', + items: [], + }; + var groupIndex_1 = {}; + // global `includes` and `replaces` will get augmented by each level's groupBy. + // Upper level's `groupBy` will get cascaded to lower-level groupBy. + // `replace` can be overriden in a lower-level to support different grouping. + var includes_1 = []; + var replaces = []; + var replacers_1 = []; + for (var l = 0; l < queryNest.length; l++) { + includes_1.push(l > 0 ? includes_1[l - 1].duplicate() : new propindex_1$1.PropIndex()); + replaces.push(l > 0 ? replaces[l - 1].duplicate() : new propindex_1$1.PropIndex()); + var groupBy$$1 = queryNest[l].groupBy; + if (util$6.isArray(groupBy$$1)) { + // If group is array, it's an array of extended group by that need to be parsed + var parsedGroupBy = groupBy.parseGroupBy(groupBy$$1, includes_1[l], replaces[l]); + replacers_1.push(parsedGroupBy.replacer); + } + } + // With includes and replacers, now we can construct the nesting tree + specModels.forEach(function (specM) { + var path = ''; + var group = rootGroup_1; + for (var l = 0; l < queryNest.length; l++) { + var groupBy$$1 = group.groupBy = queryNest[l].groupBy; + group.orderGroupBy = queryNest[l].orderGroupBy; + var key = util$6.isArray(groupBy$$1) ? + shorthand_1$1.spec(specM.specQuery, includes_1[l], replacers_1[l]) : + groupRegistry[groupBy$$1](specM.specQuery); + path += '/' + key; + if (!groupIndex_1[path]) { + groupIndex_1[path] = { + name: key, + path: path, + items: [], + }; + group.items.push(groupIndex_1[path]); + } + group = groupIndex_1[path]; + } + group.items.push(specM); + }); + return rootGroup_1; + } + else { + // no nesting, just return a flat group + return { + name: '', + path: '', + items: specModels, + }; + } + } + exports.nest = nest; + // TODO: move this to groupBy, rename properly, and export + var GROUP_BY_FIELD = [property_1$1.Property.FIELD]; + var PARSED_GROUP_BY_FIELD = groupBy.parseGroupBy(GROUP_BY_FIELD); + function getGroupByKey(specM, groupBy$$1) { + return groupRegistry[groupBy$$1](specM); + } + exports.getGroupByKey = getGroupByKey; + registerKeyFn(exports.FIELD, function (specQ) { + return shorthand_1$1.spec(specQ, PARSED_GROUP_BY_FIELD.include, PARSED_GROUP_BY_FIELD.replacer); + }); + exports.PARSED_GROUP_BY_FIELD_TRANSFORM = groupBy.parseGroupBy(groupBy.GROUP_BY_FIELD_TRANSFORM); + registerKeyFn(exports.FIELD_TRANSFORM, function (specQ) { + return shorthand_1$1.spec(specQ, exports.PARSED_GROUP_BY_FIELD_TRANSFORM.include, exports.PARSED_GROUP_BY_FIELD_TRANSFORM.replacer); + }); + exports.PARSED_GROUP_BY_ENCODING = groupBy.parseGroupBy(groupBy.GROUP_BY_ENCODING); + registerKeyFn(exports.ENCODING, function (specQ) { + return shorthand_1$1.spec(specQ, exports.PARSED_GROUP_BY_ENCODING.include, exports.PARSED_GROUP_BY_ENCODING.replacer); + }); + registerKeyFn(exports.SPEC, function (specQ) { return JSON.stringify(specQ); }); + + }); + + var nest = unwrapExports(nest_1); + var nest_2 = nest_1.registerKeyFn; + var nest_3 = nest_1.FIELD; + var nest_4 = nest_1.FIELD_TRANSFORM; + var nest_5 = nest_1.ENCODING; + var nest_6 = nest_1.SPEC; + var nest_7 = nest_1.nest; + var nest_8 = nest_1.getGroupByKey; + var nest_9 = nest_1.PARSED_GROUP_BY_FIELD_TRANSFORM; + var nest_10 = nest_1.PARSED_GROUP_BY_ENCODING; + + var nest$1 = /*#__PURE__*/Object.freeze({ + default: nest, + __moduleExports: nest_1, + registerKeyFn: nest_2, + FIELD: nest_3, + FIELD_TRANSFORM: nest_4, + ENCODING: nest_5, + SPEC: nest_6, + nest: nest_7, + getGroupByKey: nest_8, + PARSED_GROUP_BY_FIELD_TRANSFORM: nest_9, + PARSED_GROUP_BY_ENCODING: nest_10 + }); + + var wildcardindex_1$1 = ( wildcardindex$2 && wildcardindex$1 ) || wildcardindex$2; + + var nest_1$1 = ( nest$1 && nest ) || nest$1; + + var model = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + + + + + + /** + * Internal class for specQuery that provides helper for the enumeration process. + */ + var SpecQueryModel = /** @class */ (function () { + function SpecQueryModel(spec, wildcardIndex, schema, opt, wildcardAssignment) { + this._rankingScore = {}; + this._spec = spec; + this._channelFieldCount = spec.encodings.reduce(function (m, encQ) { + if (!wildcard_1$1.isWildcard(encQ.channel) && (!encoding_1$2.isAutoCountQuery(encQ) || encQ.autoCount !== false)) { + m[encQ.channel + ''] = 1; + } + return m; + }, {}); + this._wildcardIndex = wildcardIndex; + this._assignedWildcardIndex = wildcardAssignment; + this._opt = opt; + this._schema = schema; + } + /** + * Build a WildcardIndex by detecting wildcards + * in the input specQuery and replacing short wildcards ("?") + * with full ones (objects with `name` and `enum` values). + * + * @return a SpecQueryModel that wraps the specQuery and the WildcardIndex. + */ + SpecQueryModel.build = function (specQ, schema, opt) { + var wildcardIndex = new wildcardindex_1$1.WildcardIndex(); + // mark + if (wildcard_1$1.isWildcard(specQ.mark)) { + var name_1 = wildcard_1$1.getDefaultName(property_1$1.Property.MARK); + specQ.mark = wildcard_1$1.initWildcard(specQ.mark, name_1, opt.enum.mark); + wildcardIndex.setMark(specQ.mark); + } + // TODO: transform + // encodings + specQ.encodings.forEach(function (encQ, index) { + if (encoding_1$2.isAutoCountQuery(encQ)) { + // This is only for testing purpose + console.warn('A field with autoCount should not be included as autoCount meant to be an internal object.'); + encQ.type = type_1$1.Type.QUANTITATIVE; // autoCount is always quantitative + } + if (encoding_1$2.isFieldQuery(encQ) && encQ.type === undefined) { + // type is optional -- we automatically augment wildcard if not specified + encQ.type = wildcard_1$1.SHORT_WILDCARD; + } + // For each property of the encodingQuery, enumerate + property_1$1.ENCODING_TOPLEVEL_PROPS.forEach(function (prop) { + if (wildcard_1$1.isWildcard(encQ[prop])) { + // Assign default wildcard name and enum values. + var defaultWildcardName = wildcard_1$1.getDefaultName(prop) + index; + var defaultEnumValues = wildcard_1$1.getDefaultEnumValues(prop, schema, opt); + var wildcard = encQ[prop] = wildcard_1$1.initWildcard(encQ[prop], defaultWildcardName, defaultEnumValues); + // Add index of the encoding mapping to the property's wildcard index. + wildcardIndex.setEncodingProperty(index, prop, wildcard); + } + }); + // For each nested property of the encoding query (e.g., encQ.bin.maxbins) + property_1$1.ENCODING_NESTED_PROPS.forEach(function (prop) { + var propObj = encQ[prop.parent]; // the property object e.g., encQ.bin + if (propObj) { + var child = prop.child; + if (wildcard_1$1.isWildcard(propObj[child])) { + // Assign default wildcard name and enum values. + var defaultWildcardName = wildcard_1$1.getDefaultName(prop) + index; + var defaultEnumValues = wildcard_1$1.getDefaultEnumValues(prop, schema, opt); + var wildcard = propObj[child] = wildcard_1$1.initWildcard(propObj[child], defaultWildcardName, defaultEnumValues); + // Add index of the encoding mapping to the property's wildcard index. + wildcardIndex.setEncodingProperty(index, prop, wildcard); + } + } + }); + }); + // AUTO COUNT + // Add Auto Count Field + if (opt.autoAddCount) { + var channel = { + name: wildcard_1$1.getDefaultName(property_1$1.Property.CHANNEL) + specQ.encodings.length, + enum: wildcard_1$1.getDefaultEnumValues(property_1$1.Property.CHANNEL, schema, opt) + }; + var autoCount = { + name: wildcard_1$1.getDefaultName(property_1$1.Property.AUTOCOUNT) + specQ.encodings.length, + enum: [false, true] + }; + var countEncQ = { + channel: channel, + autoCount: autoCount, + type: type_1$1.Type.QUANTITATIVE + }; + specQ.encodings.push(countEncQ); + var index = specQ.encodings.length - 1; + // Add index of the encoding mapping to the property's wildcard index. + wildcardIndex.setEncodingProperty(index, property_1$1.Property.CHANNEL, channel); + wildcardIndex.setEncodingProperty(index, property_1$1.Property.AUTOCOUNT, autoCount); + } + return new SpecQueryModel(specQ, wildcardIndex, schema, opt, {}); + }; + Object.defineProperty(SpecQueryModel.prototype, "wildcardIndex", { + get: function () { + return this._wildcardIndex; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SpecQueryModel.prototype, "schema", { + get: function () { + return this._schema; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SpecQueryModel.prototype, "specQuery", { + get: function () { + return this._spec; + }, + enumerable: true, + configurable: true + }); + SpecQueryModel.prototype.duplicate = function () { + return new SpecQueryModel(util_1$2.duplicate(this._spec), this._wildcardIndex, this._schema, this._opt, util_1$2.duplicate(this._assignedWildcardIndex)); + }; + SpecQueryModel.prototype.setMark = function (mark) { + var name = this._wildcardIndex.mark.name; + this._assignedWildcardIndex[name] = this._spec.mark = mark; + }; + SpecQueryModel.prototype.resetMark = function () { + var wildcard = this._spec.mark = this._wildcardIndex.mark; + delete this._assignedWildcardIndex[wildcard.name]; + }; + SpecQueryModel.prototype.getMark = function () { + return this._spec.mark; + }; + SpecQueryModel.prototype.getEncodingProperty = function (index, prop) { + var encQ = this._spec.encodings[index]; + if (property_1$1.isEncodingNestedProp(prop)) { + return encQ[prop.parent][prop.child]; + } + return encQ[prop]; // encoding property (non-nested) + }; + SpecQueryModel.prototype.setEncodingProperty = function (index, prop, value, wildcard) { + var encQ = this._spec.encodings[index]; + if (prop === property_1$1.Property.CHANNEL && encQ.channel && !wildcard_1$1.isWildcard(encQ.channel)) { + // If there is an old channel + this._channelFieldCount[encQ.channel]--; + } + if (property_1$1.isEncodingNestedProp(prop)) { + encQ[prop.parent][prop.child] = value; + } + else if (property_1$1.isEncodingNestedParent(prop) && value === true) { + encQ[prop] = util_1$2.extend({}, encQ[prop], // copy all existing properties + { enum: undefined, name: undefined } // except name and values to it no longer an wildcard + ); + } + else { + encQ[prop] = value; + } + this._assignedWildcardIndex[wildcard.name] = value; + if (prop === property_1$1.Property.CHANNEL) { + // If there is a new channel, make sure it exists and add it to the count. + this._channelFieldCount[value] = (this._channelFieldCount[value] || 0) + 1; + } + }; + SpecQueryModel.prototype.resetEncodingProperty = function (index, prop, wildcard) { + var encQ = this._spec.encodings[index]; + if (prop === property_1$1.Property.CHANNEL) { + this._channelFieldCount[encQ.channel]--; + } + // reset it to wildcard + if (property_1$1.isEncodingNestedProp(prop)) { + encQ[prop.parent][prop.child] = wildcard; + } + else { + encQ[prop] = wildcard; + } + // add remove value that is reset from the assignment map + delete this._assignedWildcardIndex[wildcard.name]; + }; + SpecQueryModel.prototype.channelUsed = function (channel) { + // do not include encoding that has autoCount = false because it is not a part of the output spec. + return this._channelFieldCount[channel] > 0; + }; + SpecQueryModel.prototype.channelEncodingField = function (channel) { + var encodingQuery = this.getEncodingQueryByChannel(channel); + return encoding_1$2.isFieldQuery(encodingQuery); + }; + SpecQueryModel.prototype.getEncodings = function () { + // do not include encoding that has autoCount = false because it is not a part of the output spec. + return this._spec.encodings.filter(function (encQ) { return !encoding_1$2.isDisabledAutoCountQuery(encQ); }); + }; + SpecQueryModel.prototype.getEncodingQueryByChannel = function (channel) { + for (var _i = 0, _a = this._spec.encodings; _i < _a.length; _i++) { + var specEncoding = _a[_i]; + if (specEncoding.channel === channel) { + return specEncoding; + } + } + return undefined; + }; + SpecQueryModel.prototype.getEncodingQueryByIndex = function (i) { + return this._spec.encodings[i]; + }; + SpecQueryModel.prototype.isAggregate = function () { + return spec$3.isAggregate(this._spec); + }; + /** + * @return The Vega-Lite `StackProperties` object that describes the stack + * configuration of `this`. Returns `null` if this is not stackable. + */ + SpecQueryModel.prototype.getVlStack = function () { + return spec$3.getVlStack(this._spec); + }; + /** + * @return The `StackOffset` specified in `this`, `undefined` if none + * is specified. + */ + SpecQueryModel.prototype.getStackOffset = function () { + return spec$3.getStackOffset(this._spec); + }; + /** + * @return The `Channel` in which `stack` is specified in `this`, or + * `null` if none is specified. + */ + SpecQueryModel.prototype.getStackChannel = function () { + return spec$3.getStackChannel(this._spec); + }; + SpecQueryModel.prototype.toShorthand = function (groupBy$$1) { + if (groupBy$$1) { + if (util$6.isString(groupBy$$1)) { + return nest_1$1.getGroupByKey(this.specQuery, groupBy$$1); + } + var parsedGroupBy = groupBy.parseGroupBy(groupBy$$1); + return shorthand_1$1.spec(this._spec, parsedGroupBy.include, parsedGroupBy.replacer); + } + return shorthand_1$1.spec(this._spec); + }; + /** + * Convert a query to a Vega-Lite spec if it is completed. + * @return a Vega-Lite spec if completed, null otherwise. + */ + SpecQueryModel.prototype.toSpec = function (data) { + if (wildcard_1$1.isWildcard(this._spec.mark)) + return null; + var spec = {}; + data = data || this._spec.data; + if (data) { + spec.data = data; + } + if (this._spec.transform) { + spec.transform = this._spec.transform; + } + spec.mark = this._spec.mark; + spec.encoding = encoding_1$2.toEncoding(this.specQuery.encodings, { schema: this._schema, wildcardMode: 'null' }); + if (this._spec.width) { + spec.width = this._spec.width; + } + if (this._spec.height) { + spec.height = this._spec.height; + } + if (this._spec.background) { + spec.background = this._spec.background; + } + if (this._spec.padding) { + spec.padding = this._spec.padding; + } + if (this._spec.title) { + spec.title = this._spec.title; + } + if (spec.encoding === null) { + return null; + } + if (this._spec.config || this._opt.defaultSpecConfig) + spec.config = util_1$2.extend({}, this._opt.defaultSpecConfig, this._spec.config); + return spec; + }; + SpecQueryModel.prototype.getRankingScore = function (rankingName) { + return this._rankingScore[rankingName]; + }; + SpecQueryModel.prototype.setRankingScore = function (rankingName, score) { + this._rankingScore[rankingName] = score; + }; + return SpecQueryModel; + }()); + exports.SpecQueryModel = SpecQueryModel; + + }); + + var model$1 = unwrapExports(model); + var model_1 = model.SpecQueryModel; + + var model$2 = /*#__PURE__*/Object.freeze({ + default: model$1, + __moduleExports: model, + SpecQueryModel: model_1 + }); + + var transform = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + }); + + var transform$1 = unwrapExports(transform); + + var transform$2 = /*#__PURE__*/Object.freeze({ + default: transform$1, + __moduleExports: transform + }); + + var normalize_1 = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + /** + * Normalize the non-nested version of the query + * (basically when you have a `groupBy`) + * to a standardize nested. + */ + function normalize(q) { + if (q.groupBy) { + var nest = { + groupBy: q.groupBy + }; + if (q.orderBy) { + nest.orderGroupBy = q.orderBy; + } + var normalizedQ = { + spec: util_1$2.duplicate(q.spec), + nest: [nest], + }; + if (q.chooseBy) { + normalizedQ.chooseBy = q.chooseBy; + } + if (q.config) { + normalizedQ.config = q.config; + } + return normalizedQ; + } + return util_1$2.duplicate(q); // We will cause side effect to q.spec in SpecQueryModel.build + } + exports.normalize = normalize; + + }); + + var normalize = unwrapExports(normalize_1); + var normalize_2 = normalize_1.normalize; + + var normalize$1 = /*#__PURE__*/Object.freeze({ + default: normalize, + __moduleExports: normalize_1, + normalize: normalize_2 + }); + + var transform$3 = ( transform$2 && transform$1 ) || transform$2; + + var normalize_1$1 = ( normalize$1 && normalize ) || normalize$1; + + var query = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + exports.encoding = encoding_1$2; + + exports.groupBy = groupBy; + + exports.shorthand = shorthand_1$1; + + exports.spec = spec$3; + + exports.transform = transform$3; + + exports.normalize = normalize_1$1.normalize; + + }); + + var index$2 = unwrapExports(query); + var query_1 = query.encoding; + var query_2 = query.groupBy; + var query_3 = query.shorthand; + var query_4 = query.spec; + var query_5 = query.transform; + var query_6 = query.normalize; + + var query$1 = /*#__PURE__*/Object.freeze({ + default: index$2, + __moduleExports: query, + encoding: query_1, + groupBy: query_2, + shorthand: query_3, + spec: query_4, + transform: query_5, + normalize: query_6 + }); + + var result = createCommonjsModule(function (module, exports) { + var __assign = (commonjsGlobal && commonjsGlobal.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + function isResultTree(item) { + return item.items !== undefined; + } + exports.isResultTree = isResultTree; + function getTopResultTreeItem(specQuery) { + var topItem = specQuery.items[0]; + while (topItem && isResultTree(topItem)) { + topItem = topItem.items[0]; + } + return topItem; + } + exports.getTopResultTreeItem = getTopResultTreeItem; + function mapLeaves(group, f) { + return __assign({}, group, { items: group.items.map(function (item) { return (isResultTree(item) ? mapLeaves(item, f) : f(item)); }) }); + } + exports.mapLeaves = mapLeaves; + + }); + + var result$1 = unwrapExports(result); + var result_1 = result.isResultTree; + var result_2 = result.getTopResultTreeItem; + var result_3 = result.mapLeaves; + + var result$2 = /*#__PURE__*/Object.freeze({ + default: result$1, + __moduleExports: result, + isResultTree: result_1, + getTopResultTreeItem: result_2, + mapLeaves: result_3 + }); + + var type$9 = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + + + + /** + * Finer grained data types that takes binning and timeUnit into account. + */ + var ExtendedType; + (function (ExtendedType) { + ExtendedType[ExtendedType["Q"] = type_1$1.Type.QUANTITATIVE] = "Q"; + ExtendedType[ExtendedType["BIN_Q"] = 'bin_' + type_1$1.Type.QUANTITATIVE] = "BIN_Q"; + ExtendedType[ExtendedType["T"] = type_1$1.Type.TEMPORAL] = "T"; + /** + * Time Unit Temporal Field with time scale. + */ + ExtendedType[ExtendedType["TIMEUNIT_T"] = 'timeUnit_time'] = "TIMEUNIT_T"; + /** + * Time Unit Temporal Field with ordinal scale. + */ + ExtendedType[ExtendedType["TIMEUNIT_O"] = 'timeUnit_' + type_1$1.Type.ORDINAL] = "TIMEUNIT_O"; + ExtendedType[ExtendedType["O"] = type_1$1.Type.ORDINAL] = "O"; + ExtendedType[ExtendedType["N"] = type_1$1.Type.NOMINAL] = "N"; + ExtendedType[ExtendedType["K"] = expandedtype_1$1.ExpandedType.KEY] = "K"; + ExtendedType[ExtendedType["NONE"] = '-'] = "NONE"; + })(ExtendedType = exports.ExtendedType || (exports.ExtendedType = {})); + exports.Q = ExtendedType.Q; + exports.BIN_Q = ExtendedType.BIN_Q; + exports.T = ExtendedType.T; + exports.TIMEUNIT_T = ExtendedType.TIMEUNIT_T; + exports.TIMEUNIT_O = ExtendedType.TIMEUNIT_O; + exports.O = ExtendedType.O; + exports.N = ExtendedType.N; + exports.K = ExtendedType.K; + exports.NONE = ExtendedType.NONE; + function getExtendedType(fieldQ) { + if (fieldQ.bin) { + return ExtendedType.BIN_Q; + } + else if (fieldQ.timeUnit) { + var sType = encoding_1$2.scaleType(fieldQ); + return scale_1$1.hasDiscreteDomain(sType) ? ExtendedType.TIMEUNIT_O : ExtendedType.TIMEUNIT_T; + } + return fieldQ.type; + } + exports.getExtendedType = getExtendedType; + + }); + + var type$10 = unwrapExports(type$9); + var type_2$4 = type$9.ExtendedType; + var type_3$2 = type$9.Q; + var type_4$1 = type$9.BIN_Q; + var type_5$1 = type$9.T; + var type_6$1 = type$9.TIMEUNIT_T; + var type_7$1 = type$9.TIMEUNIT_O; + var type_8$1 = type$9.O; + var type_9 = type$9.N; + var type_10 = type$9.K; + var type_11 = type$9.NONE; + var type_12 = type$9.getExtendedType; + + var type$11 = /*#__PURE__*/Object.freeze({ + default: type$10, + __moduleExports: type$9, + ExtendedType: type_2$4, + Q: type_3$2, + BIN_Q: type_4$1, + T: type_5$1, + TIMEUNIT_T: type_6$1, + TIMEUNIT_O: type_7$1, + O: type_8$1, + N: type_9, + K: type_10, + NONE: type_11, + getExtendedType: type_12 + }); + + var base$3 = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + var Scorer = /** @class */ (function () { + function Scorer(type) { + this.type = type; + this.scoreIndex = this.initScore(); + } + Scorer.prototype.getFeatureScore = function (feature) { + var type = this.type; + var score = this.scoreIndex[feature]; + if (score !== undefined) { + return { type: type, feature: feature, score: score }; + } + return undefined; + }; + return Scorer; + }()); + exports.Scorer = Scorer; + + }); + + var base$4 = unwrapExports(base$3); + var base_1$2 = base$3.Scorer; + + var base$5 = /*#__PURE__*/Object.freeze({ + default: base$4, + __moduleExports: base$3, + Scorer: base_1$2 + }); + + var type_1$3 = ( type$11 && type$10 ) || type$11; + + var base_1$3 = ( base$5 && base$4 ) || base$5; + + var axis$3 = createCommonjsModule(function (module, exports) { + /** + * Field Type (with Bin and TimeUnit) and Channel Score (Cleveland / Mackinlay based) + */ + var __extends = (commonjsGlobal && commonjsGlobal.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + })(); + var __assign = (commonjsGlobal && commonjsGlobal.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + /** + * Effectiveness Score for preferred axis. + */ + var AxisScorer = /** @class */ (function (_super) { + __extends(AxisScorer, _super); + function AxisScorer() { + return _super.call(this, 'Axis') || this; + } + AxisScorer.prototype.initScore = function (opt) { + if (opt === void 0) { opt = {}; } + opt = __assign({}, config_1$1.DEFAULT_QUERY_CONFIG, opt); + var score = {}; + var preferredAxes = [{ + feature: type_1$3.BIN_Q, + opt: 'preferredBinAxis' + }, { + feature: type_1$3.T, + opt: 'preferredTemporalAxis' + }, { + feature: type_1$3.TIMEUNIT_T, + opt: 'preferredTemporalAxis' + }, { + feature: type_1$3.TIMEUNIT_O, + opt: 'preferredTemporalAxis' + }, { + feature: type_1$3.O, + opt: 'preferredOrdinalAxis' + }, { + feature: type_1$3.N, + opt: 'preferredNominalAxis' + }]; + preferredAxes.forEach(function (pAxis) { + if (opt[pAxis.opt] === channel_1$1.Channel.X) { + // penalize the other axis + score[pAxis.feature + '_' + channel_1$1.Channel.Y] = -0.01; + } + else if (opt[pAxis.opt] === channel_1$1.Channel.Y) { + // penalize the other axis + score[pAxis.feature + '_' + channel_1$1.Channel.X] = -0.01; + } + }); + return score; + }; + AxisScorer.prototype.featurize = function (type, channel) { + return type + '_' + channel; + }; + AxisScorer.prototype.getScore = function (specM, _, __) { + var _this = this; + return specM.getEncodings().reduce(function (features, encQ) { + if (encoding_1$2.isFieldQuery(encQ) || encoding_1$2.isAutoCountQuery(encQ)) { + var type = type_1$3.getExtendedType(encQ); + var feature = _this.featurize(type, encQ.channel); + var featureScore = _this.getFeatureScore(feature); + if (featureScore) { + features.push(featureScore); + } + } + return features; + }, []); + }; + return AxisScorer; + }(base_1$3.Scorer)); + exports.AxisScorer = AxisScorer; + + }); + + var axis$4 = unwrapExports(axis$3); + var axis_1$2 = axis$3.AxisScorer; + + var axis$5 = /*#__PURE__*/Object.freeze({ + default: axis$4, + __moduleExports: axis$3, + AxisScorer: axis_1$2 + }); + + var dimension = createCommonjsModule(function (module, exports) { + var __extends = (commonjsGlobal && commonjsGlobal.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + })(); + Object.defineProperty(exports, "__esModule", { value: true }); + + + /** + * Penalize if facet channels are the only dimensions + */ + var DimensionScorer = /** @class */ (function (_super) { + __extends(DimensionScorer, _super); + function DimensionScorer() { + return _super.call(this, 'Dimension') || this; + } + DimensionScorer.prototype.initScore = function () { + return { + row: -2, + column: -2, + color: 0, + opacity: 0, + size: 0, + shape: 0 + }; + }; + DimensionScorer.prototype.getScore = function (specM, _, __) { + var _this = this; + if (specM.isAggregate()) { + specM.getEncodings().reduce(function (maxFScore, encQ) { + if (encoding_1$2.isAutoCountQuery(encQ) || (encoding_1$2.isFieldQuery(encQ) && !encQ.aggregate)) { + var featureScore = _this.getFeatureScore(encQ.channel + ''); + if (featureScore && featureScore.score > maxFScore.score) { + return featureScore; + } + } + return maxFScore; + }, { type: 'Dimension', feature: 'No Dimension', score: -5 }); + } + return []; + }; + return DimensionScorer; + }(base_1$3.Scorer)); + exports.DimensionScorer = DimensionScorer; + + }); + + var dimension$1 = unwrapExports(dimension); + var dimension_1 = dimension.DimensionScorer; + + var dimension$2 = /*#__PURE__*/Object.freeze({ + default: dimension$1, + __moduleExports: dimension, + DimensionScorer: dimension_1 + }); + + var facet = createCommonjsModule(function (module, exports) { + var __extends = (commonjsGlobal && commonjsGlobal.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + })(); + var __assign = (commonjsGlobal && commonjsGlobal.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + + + + + /** + * Effective Score for preferred facet + */ + var FacetScorer = /** @class */ (function (_super) { + __extends(FacetScorer, _super); + function FacetScorer() { + return _super.call(this, 'Facet') || this; + } + FacetScorer.prototype.initScore = function (opt) { + opt = __assign({}, config_1$1.DEFAULT_QUERY_CONFIG, opt); + var score = {}; + if (opt.preferredFacet === channel_1$1.Channel.ROW) { + // penalize the other axis + score[channel_1$1.Channel.COLUMN] = -0.01; + } + else if (opt.preferredFacet === channel_1$1.Channel.COLUMN) { + // penalize the other axis + score[channel_1$1.Channel.ROW] = -0.01; + } + return score; + }; + FacetScorer.prototype.getScore = function (specM, _, __) { + var _this = this; + return specM.getEncodings().reduce(function (features, encQ) { + if (encoding_1$2.isFieldQuery(encQ) || encoding_1$2.isAutoCountQuery(encQ)) { + var featureScore = _this.getFeatureScore(encQ.channel); + if (featureScore) { + features.push(featureScore); + } + } + return features; + }, []); + }; + return FacetScorer; + }(base_1$3.Scorer)); + exports.FacetScorer = FacetScorer; + + }); + + var facet$1 = unwrapExports(facet); + var facet_1 = facet.FacetScorer; + + var facet$2 = /*#__PURE__*/Object.freeze({ + default: facet$1, + __moduleExports: facet, + FacetScorer: facet_1 + }); + + var sizechannel = createCommonjsModule(function (module, exports) { + var __extends = (commonjsGlobal && commonjsGlobal.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + })(); + Object.defineProperty(exports, "__esModule", { value: true }); + + + /** + * Effectivenss score that penalize size for bar and tick + */ + var SizeChannelScorer = /** @class */ (function (_super) { + __extends(SizeChannelScorer, _super); + function SizeChannelScorer() { + return _super.call(this, 'SizeChannel') || this; + } + SizeChannelScorer.prototype.initScore = function () { + return { + bar_size: -2, + tick_size: -2 + }; + }; + SizeChannelScorer.prototype.getScore = function (specM, _, __) { + var _this = this; + var mark = specM.getMark(); + return specM.getEncodings().reduce(function (featureScores, encQ) { + if (encoding_1$2.isFieldQuery(encQ) || encoding_1$2.isAutoCountQuery(encQ)) { + var feature = mark + '_' + encQ.channel; + var featureScore = _this.getFeatureScore(feature); + if (featureScore) { + featureScores.push(featureScore); + } + } + return featureScores; + }, []); + }; + return SizeChannelScorer; + }(base_1$3.Scorer)); + exports.SizeChannelScorer = SizeChannelScorer; + + }); + + var sizechannel$1 = unwrapExports(sizechannel); + var sizechannel_1 = sizechannel.SizeChannelScorer; + + var sizechannel$2 = /*#__PURE__*/Object.freeze({ + default: sizechannel$1, + __moduleExports: sizechannel, + SizeChannelScorer: sizechannel_1 + }); + + var typechannel = createCommonjsModule(function (module, exports) { + var __extends = (commonjsGlobal && commonjsGlobal.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + })(); + Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + exports.TERRIBLE = -10; + /** + * Effectiveness score for relationship between + * Field Type (with Bin and TimeUnit) and Channel Score (Cleveland / Mackinlay based) + */ + var TypeChannelScorer = /** @class */ (function (_super) { + __extends(TypeChannelScorer, _super); + function TypeChannelScorer() { + return _super.call(this, 'TypeChannel') || this; + } + TypeChannelScorer.prototype.initScore = function () { + var _this = this; + var SCORE = {}; + // Continuous Quantitative / Temporal Fields + var CONTINUOUS_TYPE_CHANNEL_SCORE = { + x: 0, + y: 0, + size: -0.575, + color: -0.725, + text: -2, + opacity: -3, + shape: exports.TERRIBLE, + row: exports.TERRIBLE, + column: exports.TERRIBLE, + detail: 2 * exports.TERRIBLE + }; + [type_1$3.Q, type_1$3.T, type_1$3.TIMEUNIT_T].forEach(function (type) { + util_1$2.keys(CONTINUOUS_TYPE_CHANNEL_SCORE).forEach(function (channel) { + SCORE[_this.featurize(type, channel)] = CONTINUOUS_TYPE_CHANNEL_SCORE[channel]; + }); + }); + // Discretized Quantitative / Temporal Fields / Ordinal + var ORDERED_TYPE_CHANNEL_SCORE = util_1$2.extend({}, CONTINUOUS_TYPE_CHANNEL_SCORE, { + row: -0.75, + column: -0.75, + shape: -3.1, + text: -3.2, + detail: -4 + }); + [type_1$3.BIN_Q, type_1$3.TIMEUNIT_O, type_1$3.O].forEach(function (type) { + util_1$2.keys(ORDERED_TYPE_CHANNEL_SCORE).forEach(function (channel) { + SCORE[_this.featurize(type, channel)] = ORDERED_TYPE_CHANNEL_SCORE[channel]; + }); + }); + var NOMINAL_TYPE_CHANNEL_SCORE = { + x: 0, + y: 0, + color: -0.6, + shape: -0.65, + row: -0.7, + column: -0.7, + text: -0.8, + detail: -2, + size: -3, + opacity: -3.1, + }; + util_1$2.keys(NOMINAL_TYPE_CHANNEL_SCORE).forEach(function (channel) { + SCORE[_this.featurize(type_1$3.N, channel)] = NOMINAL_TYPE_CHANNEL_SCORE[channel]; + SCORE[_this.featurize(type_1$3.K, channel)] = + // Putting key on position or detail isn't terrible + util_1$2.contains(['x', 'y', 'detail'], channel) ? -1 : + NOMINAL_TYPE_CHANNEL_SCORE[channel] - 2; + }); + return SCORE; + }; + TypeChannelScorer.prototype.featurize = function (type, channel) { + return type + '_' + channel; + }; + TypeChannelScorer.prototype.getScore = function (specM, schema, opt) { + var _this = this; + var encodingQueryByField = specM.getEncodings().reduce(function (m, encQ) { + if (encoding_1$2.isFieldQuery(encQ) || encoding_1$2.isAutoCountQuery(encQ)) { + var fieldKey = shorthand_1$1.fieldDef(encQ); + (m[fieldKey] = m[fieldKey] || []).push(encQ); + } + return m; + }, {}); + var features = []; + util_1$2.forEach(encodingQueryByField, function (encQs) { + var bestFieldFeature = encQs.reduce(function (best, encQ) { + if (encoding_1$2.isFieldQuery(encQ) || encoding_1$2.isAutoCountQuery(encQ)) { + var type = type_1$3.getExtendedType(encQ); + var feature = _this.featurize(type, encQ.channel); + var featureScore = _this.getFeatureScore(feature); + if (best === null || featureScore.score > best.score) { + return featureScore; + } + } + return best; + }, null); + features.push(bestFieldFeature); + // TODO: add plus for over-encoding of one field + }); + return features; + }; + return TypeChannelScorer; + }(base_1$3.Scorer)); + exports.TypeChannelScorer = TypeChannelScorer; + + }); + + var typechannel$1 = unwrapExports(typechannel); + var typechannel_1 = typechannel.TERRIBLE; + var typechannel_2 = typechannel.TypeChannelScorer; + + var typechannel$2 = /*#__PURE__*/Object.freeze({ + default: typechannel$1, + __moduleExports: typechannel, + TERRIBLE: typechannel_1, + TypeChannelScorer: typechannel_2 + }); + + var mark$3 = createCommonjsModule(function (module, exports) { + var __extends = (commonjsGlobal && commonjsGlobal.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + })(); + Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + var MarkScorer = /** @class */ (function (_super) { + __extends(MarkScorer, _super); + function MarkScorer() { + return _super.call(this, 'Mark') || this; + } + MarkScorer.prototype.initScore = function () { + return init(); + }; + MarkScorer.prototype.getScore = function (specM, _, __) { + var mark = specM.getMark(); + if (mark === mark_1$1.Mark.CIRCLE || mark === mark_1$1.Mark.SQUARE) { + mark = mark_1$1.Mark.POINT; + } + var xEncQ = specM.getEncodingQueryByChannel(channel_1$1.Channel.X); + var xType = xEncQ ? type_1$3.getExtendedType(xEncQ) : type_1$3.NONE; + var yEncQ = specM.getEncodingQueryByChannel(channel_1$1.Channel.Y); + var yType = yEncQ ? type_1$3.getExtendedType(yEncQ) : type_1$3.NONE; + var isOccluded = !specM.isAggregate(); // FIXME + var feature = xType + '_' + yType + '_' + isOccluded + '_' + mark; + var featureScore = this.getFeatureScore(feature); + return [featureScore]; + }; + return MarkScorer; + }(base_1$3.Scorer)); + exports.MarkScorer = MarkScorer; + function featurize(xType, yType, hasOcclusion, mark) { + return xType + '_' + yType + '_' + hasOcclusion + '_' + mark; + } + exports.featurize = featurize; + function init() { + var MEASURES = [type_1$3.Q, type_1$3.T]; + var DISCRETE = [type_1$3.BIN_Q, type_1$3.TIMEUNIT_O, type_1$3.O, type_1$3.N, type_1$3.K]; + var DISCRETE_OR_NONE = DISCRETE.concat([type_1$3.NONE]); + var SCORE = {}; + // QxQ + MEASURES.forEach(function (xType) { + MEASURES.forEach(function (yType) { + // has occlusion + var occludedQQMark = { + point: 0, + text: -0.2, + tick: -0.5, + rect: -1, + bar: -2, + line: -2, + area: -2, + rule: -2.5 + }; + util_1$2.forEach(occludedQQMark, function (score, mark) { + var feature = featurize(xType, yType, true, mark); + SCORE[feature] = score; + }); + // no occlusion + // TODO: possible to use connected scatter plot + var noOccludedQQMark = { + point: 0, + text: -0.2, + tick: -0.5, + bar: -2, + line: -2, + area: -2, + rule: -2.5 + }; + util_1$2.forEach(noOccludedQQMark, function (score, mark) { + var feature = featurize(xType, yType, false, mark); + SCORE[feature] = score; + }); + }); + }); + // DxQ, QxD + MEASURES.forEach(function (xType) { + // HAS OCCLUSION + DISCRETE_OR_NONE.forEach(function (yType) { + var occludedDimensionMeasureMark = { + tick: 0, + point: -0.2, + text: -0.5, + bar: -2, + line: -2, + area: -2, + rule: -2.5 + }; + util_1$2.forEach(occludedDimensionMeasureMark, function (score, mark) { + var feature = featurize(xType, yType, true, mark); + SCORE[feature] = score; + // also do the inverse + var feature2 = featurize(yType, xType, true, mark); + SCORE[feature2] = score; + }); + }); + [type_1$3.TIMEUNIT_T].forEach(function (yType) { + var occludedDimensionMeasureMark = { + // For Time Dimension with time scale, tick is not good + point: 0, + text: -0.5, + tick: -1, + bar: -2, + line: -2, + area: -2, + rule: -2.5 + }; + util_1$2.forEach(occludedDimensionMeasureMark, function (score, mark) { + var feature = featurize(xType, yType, true, mark); + SCORE[feature] = score; + // also do the inverse + var feature2 = featurize(yType, xType, true, mark); + SCORE[feature2] = score; + }); + }); + // NO OCCLUSION + [type_1$3.NONE, type_1$3.N, type_1$3.O, type_1$3.K].forEach(function (yType) { + var noOccludedQxN = { + bar: 0, + point: -0.2, + tick: -0.25, + text: -0.3, + // Line / Area can mislead trend for N + line: -2, + area: -2, + // Non-sense to use rule here + rule: -2.5 + }; + util_1$2.forEach(noOccludedQxN, function (score, mark) { + var feature = featurize(xType, yType, false, mark); + SCORE[feature] = score; + // also do the inverse + var feature2 = featurize(yType, xType, false, mark); + SCORE[feature2] = score; + }); + }); + [type_1$3.BIN_Q].forEach(function (yType) { + var noOccludedQxBinQ = { + bar: 0, + point: -0.2, + tick: -0.25, + text: -0.3, + // Line / Area isn't the best fit for bin + line: -0.5, + area: -0.5, + // Non-sense to use rule here + rule: -2.5 + }; + util_1$2.forEach(noOccludedQxBinQ, function (score, mark) { + var feature = featurize(xType, yType, false, mark); + SCORE[feature] = score; + // also do the inverse + var feature2 = featurize(yType, xType, false, mark); + SCORE[feature2] = score; + }); + }); + [type_1$3.TIMEUNIT_T, type_1$3.TIMEUNIT_O].forEach(function (yType) { + // For aggregate / surely no occlusion plot, Temporal with time or ordinal + // are not that different. + var noOccludedQxBinQ = { + line: 0, + area: -0.1, + bar: -0.2, + point: -0.3, + tick: -0.35, + text: -0.4, + // Non-sense to use rule here + rule: -2.5 + }; + util_1$2.forEach(noOccludedQxBinQ, function (score, mark) { + var feature = featurize(xType, yType, false, mark); + SCORE[feature] = score; + // also do the inverse + var feature2 = featurize(yType, xType, false, mark); + SCORE[feature2] = score; + }); + }); + }); + [type_1$3.TIMEUNIT_T].forEach(function (xType) { + [type_1$3.TIMEUNIT_T].forEach(function (yType) { + // has occlusion + var ttMark = { + point: 0, + rect: -0.1, + text: -0.5, + tick: -1, + bar: -2, + line: -2, + area: -2, + rule: -2.5 + }; + // No difference between has occlusion and no occlusion + // as most of the time, it will be the occluded case. + util_1$2.forEach(ttMark, function (score, mark) { + var feature = featurize(xType, yType, true, mark); + SCORE[feature] = score; + }); + util_1$2.forEach(ttMark, function (score, mark) { + var feature = featurize(xType, yType, false, mark); + SCORE[feature] = score; + }); + }); + DISCRETE_OR_NONE.forEach(function (yType) { + // has occlusion + var tdMark = { + tick: 0, + point: -0.2, + text: -0.5, + rect: -1, + bar: -2, + line: -2, + area: -2, + rule: -2.5 + }; + // No difference between has occlusion and no occlusion + // as most of the time, it will be the occluded case. + util_1$2.forEach(tdMark, function (score, mark) { + var feature = featurize(xType, yType, true, mark); + SCORE[feature] = score; + }); + util_1$2.forEach(tdMark, function (score, mark) { + var feature = featurize(yType, xType, true, mark); + SCORE[feature] = score; + }); + util_1$2.forEach(tdMark, function (score, mark) { + var feature = featurize(xType, yType, false, mark); + SCORE[feature] = score; + }); + util_1$2.forEach(tdMark, function (score, mark) { + var feature = featurize(yType, xType, false, mark); + SCORE[feature] = score; + }); + }); + }); + // DxD + DISCRETE_OR_NONE.forEach(function (xType) { + DISCRETE_OR_NONE.forEach(function (yType) { + // has occlusion + var ddMark = { + point: 0, + rect: 0, + text: -0.1, + tick: -1, + bar: -2, + line: -2, + area: -2, + rule: -2.5 + }; + util_1$2.forEach(ddMark, function (score, mark) { + var feature = featurize(xType, yType, true, mark); + SCORE[feature] = score; + }); + // same for no occlusion. + util_1$2.forEach(ddMark, function (score, mark) { + var feature = featurize(xType, yType, false, mark); + SCORE[feature] = score; + }); + }); + }); + return SCORE; + } + + }); + + var mark$4 = unwrapExports(mark$3); + var mark_2$1 = mark$3.MarkScorer; + var mark_3$1 = mark$3.featurize; + + var mark$5 = /*#__PURE__*/Object.freeze({ + default: mark$4, + __moduleExports: mark$3, + MarkScorer: mark_2$1, + featurize: mark_3$1 + }); + + var axis_1$3 = ( axis$5 && axis$4 ) || axis$5; + + var dimension_1$1 = ( dimension$2 && dimension$1 ) || dimension$2; + + var facet_1$1 = ( facet$2 && facet$1 ) || facet$2; + + var sizechannel_1$1 = ( sizechannel$2 && sizechannel$1 ) || sizechannel$2; + + var typechannel_1$1 = ( typechannel$2 && typechannel$1 ) || typechannel$2; + + var mark_1$2 = ( mark$5 && mark$4 ) || mark$5; + + var effectiveness_1 = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + + var SCORERS = [ + new axis_1$3.AxisScorer(), + new dimension_1$1.DimensionScorer(), + new facet_1$1.FacetScorer(), + new mark_1$2.MarkScorer(), + new sizechannel_1$1.SizeChannelScorer(), + new typechannel_1$1.TypeChannelScorer() + ]; + // TODO: x/y, row/column preference + // TODO: stacking + // TODO: Channel, Cardinality + // TODO: Penalize over encoding + function effectiveness(specM, schema, opt) { + var features = SCORERS.reduce(function (f, scorer) { + var scores = scorer.getScore(specM, schema, opt); + return f.concat(scores); + }, []); + return { + score: features.reduce(function (s, f) { + return s + f.score; + }, 0), + features: features + }; + } + exports.effectiveness = effectiveness; + + }); + + var index$3 = unwrapExports(effectiveness_1); + var effectiveness_2 = effectiveness_1.effectiveness; + + var effectiveness = /*#__PURE__*/Object.freeze({ + default: index$3, + __moduleExports: effectiveness_1, + effectiveness: effectiveness_2 + }); + + var aggregation = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + + + exports.name = 'aggregationQuality'; + function score(specM, schema, opt) { + var feature = aggregationQualityFeature(specM, schema, opt); + return { + score: feature.score, + features: [feature] + }; + } + exports.score = score; + function aggregationQualityFeature(specM, _, __) { + var encodings = specM.getEncodings(); + if (specM.isAggregate()) { + var isRawContinuous = function (encQ) { + return encoding_1$2.isFieldQuery(encQ) && ((encQ.type === type_1$1.Type.QUANTITATIVE && !encQ.bin && !encQ.aggregate) || + (encQ.type === type_1$1.Type.TEMPORAL && !encQ.timeUnit)); + }; + if (util_1$2.some(encodings, isRawContinuous)) { + // These are plots that pollute continuous fields as dimension. + // They are often intermediate visualizations rather than what users actually want. + return { + type: exports.name, + score: 0.1, + feature: 'Aggregate with raw continuous' + }; + } + if (util_1$2.some(encodings, function (encQ) { return encoding_1$2.isFieldQuery(encQ) && encoding_1$2.isDimension(encQ); })) { + var hasCount = util_1$2.some(encodings, function (encQ) { + return (encoding_1$2.isFieldQuery(encQ) && encQ.aggregate === 'count') || encoding_1$2.isEnabledAutoCountQuery(encQ); + }); + var hasBin = util_1$2.some(encodings, function (encQ) { + return encoding_1$2.isFieldQuery(encQ) && !!encQ.bin; + }); + if (hasCount) { + // If there is count, we might add additional count field, making it a little less simple + // then when we just apply aggregate to Q field + return { + type: exports.name, + score: 0.8, + feature: 'Aggregate with count' + }; + } + else if (hasBin) { + // This is not as good as binning all the Q and show heatmap + return { + type: exports.name, + score: 0.7, + feature: 'Aggregate with bin but without count' + }; + } + else { + return { + type: exports.name, + score: 0.9, + feature: 'Aggregate without count and without bin' + }; + } + } + // no dimension -- often not very useful + return { + type: exports.name, + score: 0.3, + feature: 'Aggregate without dimension' + }; + } + else { + if (util_1$2.some(encodings, function (encQ) { return encoding_1$2.isFieldQuery(encQ) && !encoding_1$2.isDimension(encQ); })) { + // raw plots with measure -- simplest of all! + return { + type: exports.name, + score: 1, + feature: 'Raw with measure' + }; + } + // raw plots with no measure -- often a lot of occlusion + return { + type: exports.name, + score: 0.2, + feature: 'Raw without measure' + }; + } + } + + }); + + var aggregation$1 = unwrapExports(aggregation); + var aggregation_1 = aggregation.name; + var aggregation_2 = aggregation.score; + + var aggregation$2 = /*#__PURE__*/Object.freeze({ + default: aggregation$1, + __moduleExports: aggregation, + name: aggregation_1, + score: aggregation_2 + }); + + var fieldorder = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + exports.name = 'fieldOrder'; + /** + * Return ranking score based on indices of encoded fields in the schema. + * If there are multiple fields, prioritize field on the lower indices of encodings. + * + * For example, to compare two specs with two encodings each, + * first we compare the field on the 0-th index + * and only compare the field on the 1-th index only if the fields on the 0-th index are the same. + */ + function score(specM, schema, _) { + var fieldWildcardIndices = specM.wildcardIndex.encodingIndicesByProperty.get('field'); + if (!fieldWildcardIndices) { + return { + score: 0, + features: [] + }; + } + var encodings = specM.specQuery.encodings; + var numFields = schema.fieldSchemas.length; + var features = []; + var totalScore = 0, base = 1; + for (var i = fieldWildcardIndices.length - 1; i >= 0; i--) { + var index = fieldWildcardIndices[i]; + var encoding = encodings[index]; + // Skip ValueQuery as we only care about order of fields. + var field = void 0; + if (encoding_1$2.isFieldQuery(encoding)) { + field = encoding.field; + } + else { + continue; + } + var fieldWildcard = specM.wildcardIndex.encodings[index].get('field'); + var fieldIndex = schema.fieldSchema(field).index; + // reverse order field with lower index should get higher score and come first + var score_1 = -fieldIndex * base; + totalScore += score_1; + features.push({ + score: score_1, + type: 'fieldOrder', + feature: "field " + fieldWildcard.name + " is " + field + " (#" + fieldIndex + " in the schema)" + }); + base *= numFields; + } + return { + score: totalScore, + features: features + }; + } + exports.score = score; + + }); + + var fieldorder$1 = unwrapExports(fieldorder); + var fieldorder_1 = fieldorder.name; + var fieldorder_2 = fieldorder.score; + + var fieldorder$2 = /*#__PURE__*/Object.freeze({ + default: fieldorder$1, + __moduleExports: fieldorder, + name: fieldorder_1, + score: fieldorder_2 + }); + + var result_1$1 = ( result$2 && result$1 ) || result$2; + + var effectiveness_1$1 = ( effectiveness && index$3 ) || effectiveness; + + var aggregation$3 = ( aggregation$2 && aggregation$1 ) || aggregation$2; + + var fieldOrder = ( fieldorder$2 && fieldorder$1 ) || fieldorder$2; + + var ranking = createCommonjsModule(function (module, exports) { + function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; + } + Object.defineProperty(exports, "__esModule", { value: true }); + + + __export(effectiveness_1$1); + + exports.aggregation = aggregation$3; + + exports.fieldOrder = fieldOrder; + /** + * Registry for all encoding ranking functions + */ + var rankingRegistry = {}; + /** + * Add an ordering function to the registry. + */ + function register(name, keyFn) { + rankingRegistry[name] = keyFn; + } + exports.register = register; + function get(name) { + return rankingRegistry[name]; + } + exports.get = get; + function rank(group, query, schema, level) { + if (!query.nest || level === query.nest.length) { + if (query.orderBy || query.chooseBy) { + group.items.sort(comparatorFactory(query.orderBy || query.chooseBy, schema, query.config)); + if (query.chooseBy) { + if (group.items.length > 0) { + // for chooseBy -- only keep the top-item + group.items.splice(1); + } + } + } + } + else { + // sort lower-level nodes first because our ranking takes top-item in the subgroup + group.items.forEach(function (subgroup) { + rank(subgroup, query, schema, level + 1); + }); + if (query.nest[level].orderGroupBy) { + group.items.sort(groupComparatorFactory(query.nest[level].orderGroupBy, schema, query.config)); + } + } + return group; + } + exports.rank = rank; + function comparatorFactory(name, schema, opt) { + return function (m1, m2) { + if (name instanceof Array) { + return getScoreDifference(name, m1, m2, schema, opt); + } + else { + return getScoreDifference([name], m1, m2, schema, opt); + } + }; + } + exports.comparatorFactory = comparatorFactory; + function groupComparatorFactory(name, schema, opt) { + return function (g1, g2) { + var m1 = result_1$1.getTopResultTreeItem(g1); + var m2 = result_1$1.getTopResultTreeItem(g2); + if (name instanceof Array) { + return getScoreDifference(name, m1, m2, schema, opt); + } + else { + return getScoreDifference([name], m1, m2, schema, opt); + } + }; + } + exports.groupComparatorFactory = groupComparatorFactory; + function getScoreDifference(name, m1, m2, schema, opt) { + for (var _i = 0, name_1 = name; _i < name_1.length; _i++) { + var rankingName = name_1[_i]; + var scoreDifference = getScore(m2, rankingName, schema, opt).score - getScore(m1, rankingName, schema, opt).score; + if (scoreDifference !== 0) { + return scoreDifference; + } + } + return 0; + } + function getScore(model, rankingName, schema, opt) { + if (model.getRankingScore(rankingName) !== undefined) { + return model.getRankingScore(rankingName); + } + var fn = get(rankingName); + var score = fn(model, schema, opt); + model.setRankingScore(rankingName, score); + return score; + } + exports.getScore = getScore; + exports.EFFECTIVENESS = 'effectiveness'; + register(exports.EFFECTIVENESS, effectiveness_1$1.effectiveness); + register(aggregation$3.name, aggregation$3.score); + register(fieldOrder.name, fieldOrder.score); + + }); + + var ranking$1 = unwrapExports(ranking); + var ranking_1 = ranking.aggregation; + var ranking_2 = ranking.fieldOrder; + var ranking_3 = ranking.register; + var ranking_4 = ranking.get; + var ranking_5 = ranking.rank; + var ranking_6 = ranking.comparatorFactory; + var ranking_7 = ranking.groupComparatorFactory; + var ranking_8 = ranking.getScore; + var ranking_9 = ranking.EFFECTIVENESS; + + var ranking$2 = /*#__PURE__*/Object.freeze({ + default: ranking$1, + __moduleExports: ranking, + aggregation: ranking_1, + fieldOrder: ranking_2, + register: ranking_3, + get: ranking_4, + rank: ranking_5, + comparatorFactory: ranking_6, + groupComparatorFactory: ranking_7, + getScore: ranking_8, + EFFECTIVENESS: ranking_9 + }); + + var stylize_1 = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + function stylize(answerSet, schema, opt) { + var encQIndex = {}; + answerSet = answerSet.map(function (specM) { + if (opt.smallRangeStepForHighCardinalityOrFacet) { + specM = smallRangeStepForHighCardinalityOrFacet(specM, schema, encQIndex, opt); + } + if (opt.nominalColorScaleForHighCardinality) { + specM = nominalColorScaleForHighCardinality(specM, schema, encQIndex, opt); + } + if (opt.xAxisOnTopForHighYCardinalityWithoutColumn) { + specM = xAxisOnTopForHighYCardinalityWithoutColumn(specM, schema, encQIndex, opt); + } + return specM; + }); + return answerSet; + } + exports.stylize = stylize; + function smallRangeStepForHighCardinalityOrFacet(specM, schema, encQIndex, opt) { + [channel_1$1.Channel.ROW, channel_1$1.Channel.Y, channel_1$1.Channel.COLUMN, channel_1$1.Channel.X].forEach(function (channel) { + encQIndex[channel] = specM.getEncodingQueryByChannel(channel); + }); + var yEncQ = encQIndex[channel_1$1.Channel.Y]; + if (yEncQ !== undefined && encoding_1$2.isFieldQuery(yEncQ)) { + if (encQIndex[channel_1$1.Channel.ROW] || + schema.cardinality(yEncQ) > opt.smallRangeStepForHighCardinalityOrFacet.maxCardinality) { + // We check for undefined rather than + // yEncQ.scale = yEncQ.scale || {} to cover the case where + // yEncQ.scale has been set to false/null. + // This prevents us from incorrectly overriding scale and + // assigning a rangeStep when scale is set to false. + if (yEncQ.scale === undefined) { + yEncQ.scale = {}; + } + // We do not want to assign a rangeStep if scale is set to false + // and we only apply this if the scale is (or can be) an ordinal scale. + var yScaleType = encoding_1$2.scaleType(yEncQ); + if (yEncQ.scale && (yScaleType === undefined || scale_1$1.hasDiscreteDomain(yScaleType))) { + if (!yEncQ.scale.rangeStep) { + yEncQ.scale.rangeStep = 12; + } + } + } + } + var xEncQ = encQIndex[channel_1$1.Channel.X]; + if (encoding_1$2.isFieldQuery(xEncQ)) { + if (encQIndex[channel_1$1.Channel.COLUMN] || + schema.cardinality(xEncQ) > opt.smallRangeStepForHighCardinalityOrFacet.maxCardinality) { + // Just like y, we don't want to do this if scale is null/false + if (xEncQ.scale === undefined) { + xEncQ.scale = {}; + } + // We do not want to assign a rangeStep if scale is set to false + // and we only apply this if the scale is (or can be) an ordinal scale. + var xScaleType = encoding_1$2.scaleType(xEncQ); + if (xEncQ.scale && (xScaleType === undefined || scale_1$1.hasDiscreteDomain(xScaleType))) { + if (!xEncQ.scale.rangeStep) { + xEncQ.scale.rangeStep = 12; + } + } + } + } + return specM; + } + exports.smallRangeStepForHighCardinalityOrFacet = smallRangeStepForHighCardinalityOrFacet; + function nominalColorScaleForHighCardinality(specM, schema, encQIndex, opt) { + encQIndex[channel_1$1.Channel.COLOR] = specM.getEncodingQueryByChannel(channel_1$1.Channel.COLOR); + var colorEncQ = encQIndex[channel_1$1.Channel.COLOR]; + if (encoding_1$2.isFieldQuery(colorEncQ) && (colorEncQ !== undefined) && (colorEncQ.type === type_1$1.Type.NOMINAL || colorEncQ.type === expandedtype_1$1.ExpandedType.KEY) && + (schema.cardinality(colorEncQ) > opt.nominalColorScaleForHighCardinality.maxCardinality)) { + if (colorEncQ.scale === undefined) { + colorEncQ.scale = {}; + } + if (colorEncQ.scale) { + if (!colorEncQ.scale.range) { + colorEncQ.scale.scheme = opt.nominalColorScaleForHighCardinality.palette; + } + } + } + return specM; + } + exports.nominalColorScaleForHighCardinality = nominalColorScaleForHighCardinality; + function xAxisOnTopForHighYCardinalityWithoutColumn(specM, schema, encQIndex, opt) { + [channel_1$1.Channel.COLUMN, channel_1$1.Channel.X, channel_1$1.Channel.Y].forEach(function (channel) { + encQIndex[channel] = specM.getEncodingQueryByChannel(channel); + }); + if (encQIndex[channel_1$1.Channel.COLUMN] === undefined) { + var xEncQ = encQIndex[channel_1$1.Channel.X]; + var yEncQ = encQIndex[channel_1$1.Channel.Y]; + if (encoding_1$2.isFieldQuery(xEncQ) && encoding_1$2.isFieldQuery(yEncQ) && yEncQ !== undefined && yEncQ.field && scale_1$1.hasDiscreteDomain(encoding_1$2.scaleType(yEncQ))) { + if (xEncQ !== undefined) { + if (schema.cardinality(yEncQ) > opt.xAxisOnTopForHighYCardinalityWithoutColumn.maxCardinality) { + if (xEncQ.axis === undefined) { + xEncQ.axis = {}; + } + if (xEncQ.axis && !xEncQ.axis.orient) { + xEncQ.axis.orient = 'top'; + } + } + } + } + } + return specM; + } + exports.xAxisOnTopForHighYCardinalityWithoutColumn = xAxisOnTopForHighYCardinalityWithoutColumn; + + }); + + var stylize = unwrapExports(stylize_1); + var stylize_2 = stylize_1.stylize; + var stylize_3 = stylize_1.smallRangeStepForHighCardinalityOrFacet; + var stylize_4 = stylize_1.nominalColorScaleForHighCardinality; + var stylize_5 = stylize_1.xAxisOnTopForHighYCardinalityWithoutColumn; + + var stylize$1 = /*#__PURE__*/Object.freeze({ + default: stylize, + __moduleExports: stylize_1, + stylize: stylize_2, + smallRangeStepForHighCardinalityOrFacet: stylize_3, + nominalColorScaleForHighCardinality: stylize_4, + xAxisOnTopForHighYCardinalityWithoutColumn: stylize_5 + }); + + var enumerator_1$1 = ( enumerator$2 && enumerator$1 ) || enumerator$2; + + var model_1$1 = ( model$2 && model$1 ) || model$2; + + var stylize_1$1 = ( stylize$1 && stylize ) || stylize$1; + + var generate_1 = createCommonjsModule(function (module, exports) { + Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + function generate(specQ, schema, opt) { + if (opt === void 0) { opt = config_1$1.DEFAULT_QUERY_CONFIG; } + // 1. Build a SpecQueryModel, which also contains wildcardIndex + var specM = model_1$1.SpecQueryModel.build(specQ, schema, opt); + var wildcardIndex = specM.wildcardIndex; + // 2. Enumerate each of the properties based on propPrecedence. + var answerSet = [specM]; // Initialize Answer Set with only the input spec query. + opt.propertyPrecedence.forEach(function (propKey) { + var prop = property_1$1.fromKey(propKey); + // If the original specQuery contains wildcard for this prop + if (wildcardIndex.hasProperty(prop)) { + // update answerset + var enumerator = enumerator_1$1.getEnumerator(prop); + var reducer = enumerator(wildcardIndex, schema, opt); + answerSet = answerSet.reduce(reducer, []); + } + }); + if (opt.stylize) { + if ((opt.nominalColorScaleForHighCardinality !== null) || + (opt.smallRangeStepForHighCardinalityOrFacet !== null) || + (opt.xAxisOnTopForHighYCardinalityWithoutColumn !== null)) { + return stylize_1$1.stylize(answerSet, schema, opt); + } + } + return answerSet; + } + exports.generate = generate; + + }); + + var generate$2 = unwrapExports(generate_1); + var generate_2 = generate_1.generate; + + var generate$3 = /*#__PURE__*/Object.freeze({ + default: generate$2, + __moduleExports: generate_1, + generate: generate_2 + }); + + var generate_1$1 = ( generate$3 && generate$2 ) || generate$3; + + var ranking_1$1 = ( ranking$2 && ranking$1 ) || ranking$2; + + var recommend_1 = createCommonjsModule(function (module, exports) { + var __assign = (commonjsGlobal && commonjsGlobal.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + Object.defineProperty(exports, "__esModule", { value: true }); + + + + + + function recommend(q, schema, config) { + // 1. Normalize non-nested `groupBy` to always have `groupBy` inside `nest` + // and merge config with the following precedence + // query.config > config > DEFAULT_QUERY_CONFIG + q = __assign({}, normalize_1$1.normalize(q), { config: __assign({}, config_1$1.DEFAULT_QUERY_CONFIG, config, q.config) }); + // 2. Generate + var answerSet = generate_1$1.generate(q.spec, schema, q.config); + var nestedAnswerSet = nest_1$1.nest(answerSet, q.nest); + var result = ranking_1$1.rank(nestedAnswerSet, q, schema, 0); + return { + query: q, + result: result + }; + } + exports.recommend = recommend; + + }); + + var recommend = unwrapExports(recommend_1); + var recommend_2 = recommend_1.recommend; + + var recommend$1 = /*#__PURE__*/Object.freeze({ + default: recommend, + __moduleExports: recommend_1, + recommend: recommend_2 + }); + + var name = "compassql"; + var version = "0.20.4"; + var description = "CompassQL visualization query language"; + var main = "build/compassql.js"; + var unpkg = "build/compassql.min.js"; + var jsdelivr = "build/compassql.min.js"; + var module$1 = "build/src/cql.ts"; + var types = "build/src/cql.d.ts"; + var typings = "./build/src/cql"; + var directories = {"test":"test"}; + var scripts = {"prebuild":"mkdir -p build","build":"tsc && cp package.json build/src/ && rollup -c","build:examples":"npm run build && ./scripts/build-examples.sh","build:examples-only":"./scripts/build-examples.sh","postbuild":"uglifyjs build/compassql.js -cm --source-map build/compassql.min.js.map > build/compassql.min.js","clean":"rm -rf build","deploy":"npm run clean && npm run lint && npm run test && scripts/deploy.sh","lint":"tslint -c tslint.json src/**/*.ts test/**/*.ts","schema":"npm run prebuild && typescript-json-schema --required true src/query.ts Query > build/compassql-schema.json","test":"jest --maxWorkers=4 && npm run lint","test:inspect":"node --inspect-brk ./node_modules/.bin/jest --runInBand","check:examples":"./scripts/check-examples.sh","watch:build":"npm run build && concurrently --kill-others -n Typescript,Rollup 'tsc -w' 'rollup -c -w'","watch:test":"jest --watch"}; + var repository = {"type":"git","url":"git+https://github.com/uwdata/CompassQL.git"}; + var keywords = ["visualization","recommendation"]; + var author = {"name":"UW Interactive Data Lab","url":"http://idl.cs.washington.edu"}; + var collaborators = ["Kanit Wongsuphasawat (http://kanitw.yellowpigz.com)","Dominik Moritz (http://domoritz.de)","Jeffrey Heer (http://jheer.org)"]; + var license = "BSD-3-Clause"; + var bugs = {"url":"https://github.com/uwdata/compassql/issues"}; + var homepage = "https://github.com/uwdata/compassql#readme"; + var devDependencies = {"@types/chai":"^4.1.3","@types/d3":"^4.13.0","@types/jest":"^22.2.3","chai":"^4.1.2","codecov":"~1.0.1","concurrently":"^3.5.1","d3":"~4","exorcist":"~0.4.0","jest":"^22.4.3","rollup":"^0.58.2","rollup-plugin-commonjs":"^9.1.0","rollup-plugin-json":"^2.3.0","rollup-plugin-node-resolve":"^3.3.0","source-map-support":"~0.4.0","ts-jest":"^22.4.4","tslint":"~4.3.1","typescript":"^2.3.4","uglify-js":"~2.6.1","vega-datasets":"latest"}; + var dependencies = {"datalib":"~1.7.0","typescript-json-schema":"^0.9.0","vega-lite":"2.4.0","vega-typings":"^0.2.15"}; + var jest = {"transform":{"^.+\\.tsx?$":"ts-jest"},"testRegex":"(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$","moduleFileExtensions":["ts","tsx","js","jsx","json","node"],"testPathIgnorePatterns":["node_modules","/build","scripts","src"],"coverageDirectory":"./coverage/","collectCoverage":true}; + var _package = { + name: name, + version: version, + description: description, + main: main, + unpkg: unpkg, + jsdelivr: jsdelivr, + module: module$1, + types: types, + typings: typings, + directories: directories, + scripts: scripts, + repository: repository, + keywords: keywords, + author: author, + collaborators: collaborators, + license: license, + bugs: bugs, + homepage: homepage, + devDependencies: devDependencies, + dependencies: dependencies, + jest: jest + }; + + var _package$1 = /*#__PURE__*/Object.freeze({ + name: name, + version: version, + description: description, + main: main, + unpkg: unpkg, + jsdelivr: jsdelivr, + module: module$1, + types: types, + typings: typings, + directories: directories, + scripts: scripts, + repository: repository, + keywords: keywords, + author: author, + collaborators: collaborators, + license: license, + bugs: bugs, + homepage: homepage, + devDependencies: devDependencies, + dependencies: dependencies, + jest: jest, + default: _package + }); + + var constraint$2 = ( constraint$1 && index$1 ) || constraint$1; + + var query$2 = ( query$1 && index$2 ) || query$1; + + var recommend_1$1 = ( recommend$1 && recommend ) || recommend$1; + + var package_json_1 = ( _package$1 && _package ) || _package$1; + + var src = createCommonjsModule(function (module, exports) { + /// + Object.defineProperty(exports, "__esModule", { value: true }); + + exports.config = config_1$1; + + exports.constraint = constraint$2; + + exports.enumerate = enumerator_1$1; + + exports.wildcard = wildcard_1$1; + + exports.model = model_1$1; + + exports.nest = nest_1$1; + + exports.property = property_1$1; + + exports.query = query$2; + + exports.ranking = ranking_1$1; + + exports.result = result_1$1; + + exports.schema = schema_1$1; + + exports.util = util_1$2; + + exports.generate = generate_1$1.generate; + + exports.recommend = recommend_1$1.recommend; + + exports.version = package_json_1.version; + + }); + + var index$4 = unwrapExports(src); + var src_1 = src.config; + var src_2 = src.constraint; + var src_3 = src.enumerate; + var src_4 = src.wildcard; + var src_5 = src.model; + var src_6 = src.nest; + var src_7 = src.property; + var src_8 = src.query; + var src_9 = src.ranking; + var src_10 = src.result; + var src_11 = src.schema; + var src_12 = src.util; + var src_13 = src.generate; + var src_14 = src.recommend; + var src_15 = src.version; + + exports.default = index$4; + exports.config = src_1; + exports.constraint = src_2; + exports.enumerate = src_3; + exports.wildcard = src_4; + exports.model = src_5; + exports.nest = src_6; + exports.property = src_7; + exports.query = src_8; + exports.ranking = src_9; + exports.result = src_10; + exports.schema = src_11; + exports.util = src_12; + exports.generate = src_13; + exports.recommend = src_14; + exports.version = src_15; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=compassql.js.map diff --git a/build/compassql.js.map b/build/compassql.js.map new file mode 100644 index 00000000..49e31dcc --- /dev/null +++ b/build/compassql.js.map @@ -0,0 +1 @@ +{"version":3,"file":"compassql.js","sources":["../node_modules/tslib/tslib.es6.js","../node_modules/jsonify/lib/parse.js","../node_modules/jsonify/lib/stringify.js","../node_modules/jsonify/index.js","../node_modules/json-stable-stringify/index.js","../node_modules/vega-util/src/accessor.js","../node_modules/vega-util/src/error.js","../node_modules/vega-util/src/splitAccessPath.js","../node_modules/vega-util/src/isArray.js","../node_modules/vega-util/src/isObject.js","../node_modules/vega-util/src/isString.js","../node_modules/vega-util/src/stringValue.js","../node_modules/vega-util/src/field.js","../node_modules/vega-util/src/accessors.js","../node_modules/vega-util/src/logger.js","../node_modules/vega-util/src/peek.js","../node_modules/vega-util/src/toNumber.js","../node_modules/vega-util/src/transform.js","../node_modules/vega-util/src/array.js","../node_modules/vega-util/src/isFunction.js","../node_modules/vega-util/src/compare.js","../node_modules/vega-util/src/constant.js","../node_modules/vega-util/src/debounce.js","../node_modules/vega-util/src/extend.js","../node_modules/vega-util/src/extentIndex.js","../node_modules/vega-util/src/fastmap.js","../node_modules/vega-util/src/inherits.js","../node_modules/vega-util/src/isBoolean.js","../node_modules/vega-util/src/isDate.js","../node_modules/vega-util/src/isNumber.js","../node_modules/vega-util/src/isRegExp.js","../node_modules/vega-util/src/key.js","../node_modules/vega-util/src/merge.js","../node_modules/vega-util/src/repeat.js","../node_modules/vega-util/src/pad.js","../node_modules/vega-util/src/toBoolean.js","../node_modules/vega-util/src/toDate.js","../node_modules/vega-util/src/toString.js","../node_modules/vega-util/src/toSet.js","../node_modules/vega-util/src/truncate.js","../node_modules/vega-util/src/visitArray.js","../node_modules/vega-lite/build/src/logical.js","../node_modules/vega-lite/build/src/util.js","../node_modules/vega-lite/build/src/channel.js","../node_modules/vega-lite/build/src/axis.js","../node_modules/vega-lite/build/src/log.js","../node_modules/vega-lite/build/src/scale.js","../node_modules/vega-lite/build/src/legend.js","src/property.js","../node_modules/datalib/src/util.js","src/util.js","../node_modules/vega-lite/build/src/mark.js","../node_modules/vega-lite/build/src/datetime.js","../node_modules/vega-lite/build/src/timeunit.js","../node_modules/vega-lite/build/src/type.js","src/wildcard.js","src/config.js","../node_modules/vega-lite/build/src/aggregate.js","../node_modules/vega-lite/build/src/bin.js","../node_modules/vega-lite/build/src/fielddef.js","src/query/expandedtype.js","../node_modules/vega-lite/build/src/compile/scale/type.js","../node_modules/vega-lite/build/src/encoding.js","../node_modules/vega-lite/build/src/stack.js","src/query/spec.js","src/propindex.js","src/query/shorthand.js","src/query/encoding.js","../node_modules/datalib/src/import/type.js","../node_modules/datalib/src/generate.js","../node_modules/datalib/src/stats.js","../node_modules/datalib/node_modules/d3-time/build/d3-time.js","../node_modules/datalib/src/time.js","../node_modules/datalib/src/bins/bins.js","src/schema.js","src/constraint/base.js","src/constraint/field.js","src/constraint/value.js","src/constraint/encoding.js","src/constraint/spec.js","src/constraint/index.js","src/enumerator.js","src/wildcardindex.js","src/query/groupby.js","src/nest.js","src/model.js","src/query/transform.js","src/query/normalize.js","src/query/index.js","src/result.js","src/ranking/effectiveness/type.js","src/ranking/effectiveness/base.js","src/ranking/effectiveness/axis.js","src/ranking/effectiveness/dimension.js","src/ranking/effectiveness/facet.js","src/ranking/effectiveness/sizechannel.js","src/ranking/effectiveness/typechannel.js","src/ranking/effectiveness/mark.js","src/ranking/effectiveness/index.js","src/ranking/aggregation.js","src/ranking/fieldorder.js","src/ranking/ranking.js","src/stylize.js","src/generate.js","src/recommend.js","src/index.js"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [0, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { if (o[n]) i[n] = function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; }; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator];\r\n return m ? m.call(o) : typeof __values === \"function\" ? __values(o) : o[Symbol.iterator]();\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","var at, // The index of the current character\n ch, // The current character\n escapee = {\n '\"': '\"',\n '\\\\': '\\\\',\n '/': '/',\n b: '\\b',\n f: '\\f',\n n: '\\n',\n r: '\\r',\n t: '\\t'\n },\n text,\n\n error = function (m) {\n // Call error when something is wrong.\n throw {\n name: 'SyntaxError',\n message: m,\n at: at,\n text: text\n };\n },\n \n next = function (c) {\n // If a c parameter is provided, verify that it matches the current character.\n if (c && c !== ch) {\n error(\"Expected '\" + c + \"' instead of '\" + ch + \"'\");\n }\n \n // Get the next character. When there are no more characters,\n // return the empty string.\n \n ch = text.charAt(at);\n at += 1;\n return ch;\n },\n \n number = function () {\n // Parse a number value.\n var number,\n string = '';\n \n if (ch === '-') {\n string = '-';\n next('-');\n }\n while (ch >= '0' && ch <= '9') {\n string += ch;\n next();\n }\n if (ch === '.') {\n string += '.';\n while (next() && ch >= '0' && ch <= '9') {\n string += ch;\n }\n }\n if (ch === 'e' || ch === 'E') {\n string += ch;\n next();\n if (ch === '-' || ch === '+') {\n string += ch;\n next();\n }\n while (ch >= '0' && ch <= '9') {\n string += ch;\n next();\n }\n }\n number = +string;\n if (!isFinite(number)) {\n error(\"Bad number\");\n } else {\n return number;\n }\n },\n \n string = function () {\n // Parse a string value.\n var hex,\n i,\n string = '',\n uffff;\n \n // When parsing for string values, we must look for \" and \\ characters.\n if (ch === '\"') {\n while (next()) {\n if (ch === '\"') {\n next();\n return string;\n } else if (ch === '\\\\') {\n next();\n if (ch === 'u') {\n uffff = 0;\n for (i = 0; i < 4; i += 1) {\n hex = parseInt(next(), 16);\n if (!isFinite(hex)) {\n break;\n }\n uffff = uffff * 16 + hex;\n }\n string += String.fromCharCode(uffff);\n } else if (typeof escapee[ch] === 'string') {\n string += escapee[ch];\n } else {\n break;\n }\n } else {\n string += ch;\n }\n }\n }\n error(\"Bad string\");\n },\n\n white = function () {\n\n// Skip whitespace.\n\n while (ch && ch <= ' ') {\n next();\n }\n },\n\n word = function () {\n\n// true, false, or null.\n\n switch (ch) {\n case 't':\n next('t');\n next('r');\n next('u');\n next('e');\n return true;\n case 'f':\n next('f');\n next('a');\n next('l');\n next('s');\n next('e');\n return false;\n case 'n':\n next('n');\n next('u');\n next('l');\n next('l');\n return null;\n }\n error(\"Unexpected '\" + ch + \"'\");\n },\n\n value, // Place holder for the value function.\n\n array = function () {\n\n// Parse an array value.\n\n var array = [];\n\n if (ch === '[') {\n next('[');\n white();\n if (ch === ']') {\n next(']');\n return array; // empty array\n }\n while (ch) {\n array.push(value());\n white();\n if (ch === ']') {\n next(']');\n return array;\n }\n next(',');\n white();\n }\n }\n error(\"Bad array\");\n },\n\n object = function () {\n\n// Parse an object value.\n\n var key,\n object = {};\n\n if (ch === '{') {\n next('{');\n white();\n if (ch === '}') {\n next('}');\n return object; // empty object\n }\n while (ch) {\n key = string();\n white();\n next(':');\n if (Object.hasOwnProperty.call(object, key)) {\n error('Duplicate key \"' + key + '\"');\n }\n object[key] = value();\n white();\n if (ch === '}') {\n next('}');\n return object;\n }\n next(',');\n white();\n }\n }\n error(\"Bad object\");\n };\n\nvalue = function () {\n\n// Parse a JSON value. It could be an object, an array, a string, a number,\n// or a word.\n\n white();\n switch (ch) {\n case '{':\n return object();\n case '[':\n return array();\n case '\"':\n return string();\n case '-':\n return number();\n default:\n return ch >= '0' && ch <= '9' ? number() : word();\n }\n};\n\n// Return the json_parse function. It will have access to all of the above\n// functions and variables.\n\nmodule.exports = function (source, reviver) {\n var result;\n \n text = source;\n at = 0;\n ch = ' ';\n result = value();\n white();\n if (ch) {\n error(\"Syntax error\");\n }\n\n // If there is a reviver function, we recursively walk the new structure,\n // passing each name/value pair to the reviver function for possible\n // transformation, starting with a temporary root object that holds the result\n // in an empty key. If there is not a reviver function, we simply return the\n // result.\n\n return typeof reviver === 'function' ? (function walk(holder, key) {\n var k, v, value = holder[key];\n if (value && typeof value === 'object') {\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(value, k)) {\n v = walk(value, k);\n if (v !== undefined) {\n value[k] = v;\n } else {\n delete value[k];\n }\n }\n }\n }\n return reviver.call(holder, key, value);\n }({'': result}, '')) : result;\n};\n","var cx = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g,\n escapable = /[\\\\\\\"\\x00-\\x1f\\x7f-\\x9f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g,\n gap,\n indent,\n meta = { // table of character substitutions\n '\\b': '\\\\b',\n '\\t': '\\\\t',\n '\\n': '\\\\n',\n '\\f': '\\\\f',\n '\\r': '\\\\r',\n '\"' : '\\\\\"',\n '\\\\': '\\\\\\\\'\n },\n rep;\n\nfunction quote(string) {\n // If the string contains no control characters, no quote characters, and no\n // backslash characters, then we can safely slap some quotes around it.\n // Otherwise we must also replace the offending characters with safe escape\n // sequences.\n \n escapable.lastIndex = 0;\n return escapable.test(string) ? '\"' + string.replace(escapable, function (a) {\n var c = meta[a];\n return typeof c === 'string' ? c :\n '\\\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);\n }) + '\"' : '\"' + string + '\"';\n}\n\nfunction str(key, holder) {\n // Produce a string from holder[key].\n var i, // The loop counter.\n k, // The member key.\n v, // The member value.\n length,\n mind = gap,\n partial,\n value = holder[key];\n \n // If the value has a toJSON method, call it to obtain a replacement value.\n if (value && typeof value === 'object' &&\n typeof value.toJSON === 'function') {\n value = value.toJSON(key);\n }\n \n // If we were called with a replacer function, then call the replacer to\n // obtain a replacement value.\n if (typeof rep === 'function') {\n value = rep.call(holder, key, value);\n }\n \n // What happens next depends on the value's type.\n switch (typeof value) {\n case 'string':\n return quote(value);\n \n case 'number':\n // JSON numbers must be finite. Encode non-finite numbers as null.\n return isFinite(value) ? String(value) : 'null';\n \n case 'boolean':\n case 'null':\n // If the value is a boolean or null, convert it to a string. Note:\n // typeof null does not produce 'null'. The case is included here in\n // the remote chance that this gets fixed someday.\n return String(value);\n \n case 'object':\n if (!value) return 'null';\n gap += indent;\n partial = [];\n \n // Array.isArray\n if (Object.prototype.toString.apply(value) === '[object Array]') {\n length = value.length;\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || 'null';\n }\n \n // Join all of the elements together, separated with commas, and\n // wrap them in brackets.\n v = partial.length === 0 ? '[]' : gap ?\n '[\\n' + gap + partial.join(',\\n' + gap) + '\\n' + mind + ']' :\n '[' + partial.join(',') + ']';\n gap = mind;\n return v;\n }\n \n // If the replacer is an array, use it to select the members to be\n // stringified.\n if (rep && typeof rep === 'object') {\n length = rep.length;\n for (i = 0; i < length; i += 1) {\n k = rep[i];\n if (typeof k === 'string') {\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (gap ? ': ' : ':') + v);\n }\n }\n }\n }\n else {\n // Otherwise, iterate through all of the keys in the object.\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(value, k)) {\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (gap ? ': ' : ':') + v);\n }\n }\n }\n }\n \n // Join all of the member texts together, separated with commas,\n // and wrap them in braces.\n\n v = partial.length === 0 ? '{}' : gap ?\n '{\\n' + gap + partial.join(',\\n' + gap) + '\\n' + mind + '}' :\n '{' + partial.join(',') + '}';\n gap = mind;\n return v;\n }\n}\n\nmodule.exports = function (value, replacer, space) {\n var i;\n gap = '';\n indent = '';\n \n // If the space parameter is a number, make an indent string containing that\n // many spaces.\n if (typeof space === 'number') {\n for (i = 0; i < space; i += 1) {\n indent += ' ';\n }\n }\n // If the space parameter is a string, it will be used as the indent string.\n else if (typeof space === 'string') {\n indent = space;\n }\n\n // If there is a replacer, it must be a function or an array.\n // Otherwise, throw an error.\n rep = replacer;\n if (replacer && typeof replacer !== 'function'\n && (typeof replacer !== 'object' || typeof replacer.length !== 'number')) {\n throw new Error('JSON.stringify');\n }\n \n // Make a fake root object containing our value under the key of ''.\n // Return the result of stringifying the value.\n return str('', {'': value});\n};\n","exports.parse = require('./lib/parse');\nexports.stringify = require('./lib/stringify');\n","var json = typeof JSON !== 'undefined' ? JSON : require('jsonify');\n\nmodule.exports = function (obj, opts) {\n if (!opts) opts = {};\n if (typeof opts === 'function') opts = { cmp: opts };\n var space = opts.space || '';\n if (typeof space === 'number') space = Array(space+1).join(' ');\n var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;\n var replacer = opts.replacer || function(key, value) { return value; };\n\n var cmp = opts.cmp && (function (f) {\n return function (node) {\n return function (a, b) {\n var aobj = { key: a, value: node[a] };\n var bobj = { key: b, value: node[b] };\n return f(aobj, bobj);\n };\n };\n })(opts.cmp);\n\n var seen = [];\n return (function stringify (parent, key, node, level) {\n var indent = space ? ('\\n' + new Array(level + 1).join(space)) : '';\n var colonSeparator = space ? ': ' : ':';\n\n if (node && node.toJSON && typeof node.toJSON === 'function') {\n node = node.toJSON();\n }\n\n node = replacer.call(parent, key, node);\n\n if (node === undefined) {\n return;\n }\n if (typeof node !== 'object' || node === null) {\n return json.stringify(node);\n }\n if (isArray(node)) {\n var out = [];\n for (var i = 0; i < node.length; i++) {\n var item = stringify(node, i, node[i], level+1) || json.stringify(null);\n out.push(indent + space + item);\n }\n return '[' + out.join(',') + indent + ']';\n }\n else {\n if (seen.indexOf(node) !== -1) {\n if (cycles) return json.stringify('__cycle__');\n throw new TypeError('Converting circular structure to JSON');\n }\n else seen.push(node);\n\n var keys = objectKeys(node).sort(cmp && cmp(node));\n var out = [];\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = stringify(node, key, node[key], level+1);\n\n if(!value) continue;\n\n var keyValue = json.stringify(key)\n + colonSeparator\n + value;\n ;\n out.push(indent + space + keyValue);\n }\n seen.splice(seen.indexOf(node), 1);\n return '{' + out.join(',') + indent + '}';\n }\n })({ '': obj }, '', obj, 0);\n};\n\nvar isArray = Array.isArray || function (x) {\n return {}.toString.call(x) === '[object Array]';\n};\n\nvar objectKeys = Object.keys || function (obj) {\n var has = Object.prototype.hasOwnProperty || function () { return true };\n var keys = [];\n for (var key in obj) {\n if (has.call(obj, key)) keys.push(key);\n }\n return keys;\n};\n","export default function(fn, fields, name) {\n fn.fields = fields || [];\n fn.fname = name;\n return fn;\n}\n\nexport function accessorName(fn) {\n return fn == null ? null : fn.fname;\n}\n\nexport function accessorFields(fn) {\n return fn == null ? null : fn.fields;\n}\n","export default function(message) {\n throw Error(message);\n}\n","import error from './error';\n\nexport default function(p) {\n var path = [],\n q = null,\n b = 0,\n n = p.length,\n s = '',\n i, j, c;\n\n p = p + '';\n\n function push() {\n path.push(s + p.substring(i, j));\n s = '';\n i = j + 1;\n }\n\n for (i=j=0; j i) {\n push();\n } else {\n i = j + 1;\n }\n } else if (c === '[') {\n if (j > i) push();\n b = i = j + 1;\n } else if (c === ']') {\n if (!b) error('Access path missing open bracket: ' + p);\n if (b > 0) push();\n b = 0;\n i = j + 1;\n }\n }\n\n if (b) error('Access path missing closing bracket: ' + p);\n if (q) error('Access path missing closing quote: ' + p);\n\n if (j > i) {\n j++;\n push();\n }\n\n return path;\n}\n","export default Array.isArray;\n","export default function(_) {\n return _ === Object(_);\n}\n","export default function(_) {\n return typeof _ === 'string';\n}\n","import isArray from './isArray';\nimport isObject from './isObject';\nimport isString from './isString';\n\nexport default function $(x) {\n return isArray(x) ? '[' + x.map($) + ']'\n : isObject(x) || isString(x) ?\n // Output valid JSON and JS source strings.\n // See http://timelessrepo.com/json-isnt-a-javascript-subset\n JSON.stringify(x).replace('\\u2028','\\\\u2028').replace('\\u2029', '\\\\u2029')\n : x;\n}\n","import accessor from './accessor';\nimport splitAccessPath from './splitAccessPath';\nimport stringValue from './stringValue';\n\nexport default function(field, name) {\n var path = splitAccessPath(field),\n code = 'return _[' + path.map(stringValue).join('][') + '];';\n\n return accessor(\n Function('_', code),\n [(field = path.length===1 ? path[0] : field)],\n name || field\n );\n}\n","import accessor from './accessor';\nimport field from './field';\n\nvar empty = [];\n\nexport var id = field('id');\n\nexport var identity = accessor(function(_) { return _; }, empty, 'identity');\n\nexport var zero = accessor(function() { return 0; }, empty, 'zero');\n\nexport var one = accessor(function() { return 1; }, empty, 'one');\n\nexport var truthy = accessor(function() { return true; }, empty, 'true');\n\nexport var falsy = accessor(function() { return false; }, empty, 'false');\n","function log(method, level, input) {\n var args = [level].concat([].slice.call(input));\n console[method].apply(console, args); // eslint-disable-line no-console\n}\n\nexport var None = 0;\nexport var Error = 1;\nexport var Warn = 2;\nexport var Info = 3;\nexport var Debug = 4;\n\nexport default function(_) {\n var level = _ || None;\n return {\n level: function(_) {\n if (arguments.length) {\n level = +_;\n return this;\n } else {\n return level;\n }\n },\n error: function() {\n if (level >= Error) log('error', 'ERROR', arguments);\n return this;\n },\n warn: function() {\n if (level >= Warn) log('warn', 'WARN', arguments);\n return this;\n },\n info: function() {\n if (level >= Info) log('log', 'INFO', arguments);\n return this;\n },\n debug: function() {\n if (level >= Debug) log('log', 'DEBUG', arguments);\n return this;\n }\n }\n}\n","export default function(array) {\n return array[array.length - 1];\n}\n","export default function(_) {\n return _ == null || _ === '' ? null : +_;\n}\n","import {identity} from './accessors';\nimport peek from './peek';\nimport toNumber from './toNumber';\n\nfunction exp(sign) {\n return function(x) { return sign * Math.exp(x); };\n}\n\nfunction log(sign) {\n return function(x) { return Math.log(sign * x); };\n}\n\nfunction pow(exponent) {\n return function(x) {\n return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);\n };\n}\n\nfunction pan(domain, delta, lift, ground) {\n var d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n dd = (d1 - d0) * delta;\n\n return [\n ground(d0 - dd),\n ground(d1 - dd)\n ];\n}\n\nexport function panLinear(domain, delta) {\n return pan(domain, delta, toNumber, identity);\n}\n\nexport function panLog(domain, delta) {\n var sign = Math.sign(domain[0]);\n return pan(domain, delta, log(sign), exp(sign));\n}\n\nexport function panPow(domain, delta, exponent) {\n return pan(domain, delta, pow(exponent), pow(1/exponent));\n}\n\nfunction zoom(domain, anchor, scale, lift, ground) {\n var d0 = lift(domain[0]),\n d1 = lift(peek(domain)),\n da = anchor != null ? lift(anchor) : (d0 + d1) / 2;\n\n return [\n ground(da + (d0 - da) * scale),\n ground(da + (d1 - da) * scale)\n ];\n}\n\nexport function zoomLinear(domain, anchor, scale) {\n return zoom(domain, anchor, scale, toNumber, identity);\n}\n\nexport function zoomLog(domain, anchor, scale) {\n var sign = Math.sign(domain[0]);\n return zoom(domain, anchor, scale, log(sign), exp(sign));\n}\n\nexport function zoomPow(domain, anchor, scale, exponent) {\n return zoom(domain, anchor, scale, pow(exponent), pow(1/exponent));\n}\n","import isArray from './isArray';\n\nexport default function(_) {\n return _ != null ? (isArray(_) ? _ : [_]) : [];\n}\n","export default function(_) {\n return typeof _ === 'function';\n}\n","import {default as accessor, accessorFields} from './accessor';\nimport array from './array';\nimport isFunction from './isFunction';\nimport splitAccessPath from './splitAccessPath';\nimport stringValue from './stringValue';\n\nexport default function(fields, orders) {\n var idx = [],\n cmp = (fields = array(fields)).map(function(f, i) {\n if (f == null) {\n return null;\n } else {\n idx.push(i);\n return isFunction(f) ? f\n : splitAccessPath(f).map(stringValue).join('][');\n }\n }),\n n = idx.length - 1,\n ord = array(orders),\n code = 'var u,v;return ',\n i, j, f, u, v, d, t, lt, gt;\n\n if (n < 0) return null;\n\n for (j=0; j<=n; ++j) {\n i = idx[j];\n f = cmp[i];\n\n if (isFunction(f)) {\n d = 'f' + i;\n u = '(u=this.' + d + '(a))';\n v = '(v=this.' + d + '(b))';\n (t = t || {})[d] = f;\n } else {\n u = '(u=a['+f+'])';\n v = '(v=b['+f+'])';\n }\n\n d = '((v=v instanceof Date?+v:v),(u=u instanceof Date?+u:u))';\n\n if (ord[i] !== 'descending') {\n gt = 1;\n lt = -1;\n } else {\n gt = -1;\n lt = 1;\n }\n\n code += '(' + u+'<'+v+'||u==null)&&v!=null?' + lt\n + ':(u>v||v==null)&&u!=null?' + gt\n + ':'+d+'!==u&&v===v?' + lt\n + ':v!==v&&u===u?' + gt\n + (i < n ? ':' : ':0');\n }\n\n f = Function('a', 'b', code + ';');\n if (t) f = f.bind(t);\n\n fields = fields.reduce(function(map, field) {\n if (isFunction(field)) {\n (accessorFields(field) || []).forEach(function(_) { map[_] = 1; });\n } else if (field != null) {\n map[field + ''] = 1;\n }\n return map;\n }, {});\n\n return accessor(f, Object.keys(fields));\n}\n","import isFunction from './isFunction';\n\nexport default function(_) {\n return isFunction(_) ? _ : function() { return _; };\n}\n","export default function(delay, handler) {\n var tid, evt;\n\n function callback() {\n handler(evt);\n tid = evt = null;\n }\n\n return function(e) {\n evt = e;\n if (tid) clearTimeout(tid);\n tid = setTimeout(callback, delay);\n };\n}\n","export default function(_) {\n for (var x, k, i=1, len=arguments.length; i= b) {\n a = c = b;\n break;\n }\n }\n u = v = i;\n while (++i < n) {\n b = array[i];\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n } else {\n while (++i < n) {\n b = f(array[i], i, array);\n if (b != null && b >= b) {\n a = c = b;\n break;\n }\n }\n u = v = i;\n while (++i < n) {\n b = f(array[i], i, array);\n if (b != null) {\n if (a > b) {\n a = b;\n u = i;\n }\n if (c < b) {\n c = b;\n v = i;\n }\n }\n }\n }\n\n return [u, v];\n}\n","var NULL = {};\n\nexport default function(input) {\n var obj = {},\n map,\n test;\n\n function has(key) {\n return obj.hasOwnProperty(key) && obj[key] !== NULL;\n }\n\n map = {\n size: 0,\n empty: 0,\n object: obj,\n has: has,\n get: function(key) {\n return has(key) ? obj[key] : undefined;\n },\n set: function(key, value) {\n if (!has(key)) {\n ++map.size;\n if (obj[key] === NULL) --map.empty;\n }\n obj[key] = value;\n return this;\n },\n delete: function(key) {\n if (has(key)) {\n --map.size;\n ++map.empty;\n obj[key] = NULL;\n }\n return this;\n },\n clear: function() {\n map.size = map.empty = 0;\n map.object = obj = {};\n },\n test: function(_) {\n if (arguments.length) {\n test = _;\n return map;\n } else {\n return test;\n }\n },\n clean: function() {\n var next = {},\n size = 0,\n key, value;\n for (key in obj) {\n value = obj[key];\n if (value !== NULL && (!test || !test(value))) {\n next[key] = value;\n ++size;\n }\n }\n map.size = size;\n map.empty = 0;\n map.object = (obj = next);\n }\n };\n\n if (input) Object.keys(input).forEach(function(key) {\n map.set(key, input[key]);\n });\n\n return map;\n}\n","export default function(child, parent) {\n var proto = (child.prototype = Object.create(parent.prototype));\n proto.constructor = child;\n return proto;\n}\n","export default function(_) {\n return typeof _ === 'boolean';\n}\n","export default function(_) {\n return Object.prototype.toString.call(_) === '[object Date]';\n}\n","export default function(_) {\n return typeof _ === 'number';\n}\n","export default function(_) {\n return Object.prototype.toString.call(_) === '[object RegExp]';\n}\n","import accessor from './accessor';\nimport array from './array';\nimport splitAccessPath from './splitAccessPath';\nimport stringValue from './stringValue';\n\nexport default function(fields, flat) {\n if (fields) {\n fields = flat\n ? array(fields).map(function(f) { return f.replace(/\\\\(.)/g, '$1'); })\n : array(fields);\n }\n\n var fn = !(fields && fields.length)\n ? function() { return ''; }\n : Function('_', 'return \\'\\'+' +\n fields.map(function(f) {\n return '_[' + (flat\n ? stringValue(f)\n : splitAccessPath(f).map(stringValue).join('][')\n ) + ']';\n }).join('+\\'|\\'+') + ';');\n\n return accessor(fn, fields, 'key');\n}\n","export default function(compare, array0, array1, output) {\n var n0 = array0.length,\n n1 = array1.length;\n\n if (!n1) return array0;\n if (!n0) return array1;\n\n var merged = output || new array0.constructor(n0 + n1),\n i0 = 0, i1 = 0, i = 0;\n\n for (; i0 0\n ? array1[i1++]\n : array0[i0++];\n }\n\n for (; i0= 0) s += str;\n return s;\n}\n","import repeat from './repeat';\n\nexport default function(str, length, padchar, align) {\n var c = padchar || ' ',\n s = str + '',\n n = length - s.length;\n\n return n <= 0 ? s\n : align === 'left' ? repeat(c, n) + s\n : align === 'center' ? repeat(c, ~~(n/2)) + s + repeat(c, Math.ceil(n/2))\n : s + repeat(c, n);\n}\n","export default function(_) {\n return _ == null || _ === '' ? null : !_ || _ === 'false' || _ === '0' ? false : !!_;\n}\n","import isDate from './isDate';\nimport isNumber from './isNumber';\n\nfunction defaultParser(_) {\n return isNumber(_) ? _ : isDate(_) ? _ : Date.parse(_);\n}\n\nexport default function(_, parser) {\n parser = parser || defaultParser;\n return _ == null || _ === '' ? null : parser(_);\n}\n","export default function(_) {\n return _ == null || _ === '' ? null : _ + '';\n}\n","export default function(_) {\n for (var s={}, i=0, n=_.length; i -1;\n}\nexports.contains = contains;\n/** Returns the array without the elements in item */\nfunction without(array, excludedItems) {\n return array.filter(function (item) { return !contains(excludedItems, item); });\n}\nexports.without = without;\nfunction union(array, other) {\n return array.concat(without(other, array));\n}\nexports.union = union;\n/**\n * Returns true if any item returns true.\n */\nfunction some(arr, f) {\n var i = 0;\n for (var k = 0; k < arr.length; k++) {\n if (f(arr[k], k, i++)) {\n return true;\n }\n }\n return false;\n}\nexports.some = some;\n/**\n * Returns true if all items return true.\n */\nfunction every(arr, f) {\n var i = 0;\n for (var k = 0; k < arr.length; k++) {\n if (!f(arr[k], k, i++)) {\n return false;\n }\n }\n return true;\n}\nexports.every = every;\nfunction flatten(arrays) {\n return [].concat.apply([], arrays);\n}\nexports.flatten = flatten;\n/**\n * recursively merges src into dest\n */\nfunction mergeDeep(dest) {\n var src = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n src[_i - 1] = arguments[_i];\n }\n for (var _a = 0, src_1 = src; _a < src_1.length; _a++) {\n var s = src_1[_a];\n dest = deepMerge_(dest, s);\n }\n return dest;\n}\nexports.mergeDeep = mergeDeep;\n// recursively merges src into dest\nfunction deepMerge_(dest, src) {\n if (typeof src !== 'object' || src === null) {\n return dest;\n }\n for (var p in src) {\n if (!src.hasOwnProperty(p)) {\n continue;\n }\n if (src[p] === undefined) {\n continue;\n }\n if (typeof src[p] !== 'object' || vega_util_1.isArray(src[p]) || src[p] === null) {\n dest[p] = src[p];\n }\n else if (typeof dest[p] !== 'object' || dest[p] === null) {\n dest[p] = mergeDeep(vega_util_1.isArray(src[p].constructor) ? [] : {}, src[p]);\n }\n else {\n mergeDeep(dest[p], src[p]);\n }\n }\n return dest;\n}\nfunction unique(values, f) {\n var results = [];\n var u = {};\n var v;\n for (var _i = 0, values_1 = values; _i < values_1.length; _i++) {\n var val = values_1[_i];\n v = f(val);\n if (v in u) {\n continue;\n }\n u[v] = 1;\n results.push(val);\n }\n return results;\n}\nexports.unique = unique;\n/**\n * Returns true if the two dictionaries disagree. Applies only to defined values.\n */\nfunction differ(dict, other) {\n for (var key in dict) {\n if (dict.hasOwnProperty(key)) {\n if (other[key] && dict[key] && other[key] !== dict[key]) {\n return true;\n }\n }\n }\n return false;\n}\nexports.differ = differ;\nfunction hasIntersection(a, b) {\n for (var key in a) {\n if (key in b) {\n return true;\n }\n }\n return false;\n}\nexports.hasIntersection = hasIntersection;\nfunction isNumeric(num) {\n return !isNaN(num);\n}\nexports.isNumeric = isNumeric;\nfunction differArray(array, other) {\n if (array.length !== other.length) {\n return true;\n }\n array.sort();\n other.sort();\n for (var i = 0; i < array.length; i++) {\n if (other[i] !== array[i]) {\n return true;\n }\n }\n return false;\n}\nexports.differArray = differArray;\n// This is a stricter version of Object.keys but with better types. See https://github.com/Microsoft/TypeScript/pull/12253#issuecomment-263132208\nexports.keys = Object.keys;\nfunction vals(x) {\n var _vals = [];\n for (var k in x) {\n if (x.hasOwnProperty(k)) {\n _vals.push(x[k]);\n }\n }\n return _vals;\n}\nexports.vals = vals;\nfunction flagKeys(f) {\n return exports.keys(f);\n}\nexports.flagKeys = flagKeys;\nfunction duplicate(obj) {\n return JSON.parse(JSON.stringify(obj));\n}\nexports.duplicate = duplicate;\nfunction isBoolean(b) {\n return b === true || b === false;\n}\nexports.isBoolean = isBoolean;\n/**\n * Convert a string into a valid variable name\n */\nfunction varName(s) {\n // Replace non-alphanumeric characters (anything besides a-zA-Z0-9_) with _\n var alphanumericS = s.replace(/\\W/g, '_');\n // Add _ if the string has leading numbers.\n return (s.match(/^\\d+/) ? '_' : '') + alphanumericS;\n}\nexports.varName = varName;\nfunction logicalExpr(op, cb) {\n if (logical_1.isLogicalNot(op)) {\n return '!(' + logicalExpr(op.not, cb) + ')';\n }\n else if (logical_1.isLogicalAnd(op)) {\n return '(' + op.and.map(function (and) { return logicalExpr(and, cb); }).join(') && (') + ')';\n }\n else if (logical_1.isLogicalOr(op)) {\n return '(' + op.or.map(function (or) { return logicalExpr(or, cb); }).join(') || (') + ')';\n }\n else {\n return cb(op);\n }\n}\nexports.logicalExpr = logicalExpr;\n/**\n * Delete nested property of an object, and delete the ancestors of the property if they become empty.\n */\nfunction deleteNestedProperty(obj, orderedProps) {\n if (orderedProps.length === 0) {\n return true;\n }\n var prop = orderedProps.shift();\n if (deleteNestedProperty(obj[prop], orderedProps)) {\n delete obj[prop];\n }\n return Object.keys(obj).length === 0;\n}\nexports.deleteNestedProperty = deleteNestedProperty;\nfunction titlecase(s) {\n return s.charAt(0).toUpperCase() + s.substr(1);\n}\nexports.titlecase = titlecase;\n/**\n * Converts a path to an access path.\n */\nfunction accessPath(path) {\n return \"[\" + vega_util_1.splitAccessPath(path).map(vega_util_1.stringValue).join('][') + \"]\";\n}\nexports.accessPath = accessPath;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsd0RBQTBEO0FBQzFELHVDQUFvRjtBQUNwRixxQ0FBa0Y7QUFFbEYsSUFBTSxlQUFlLEdBQUcsZ0JBQWdCLENBQUMsU0FBUyxDQUFDL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xuICByZXR1cm4gYFske3NwbGl0QWNjZXNzUGF0aChwYXRoKS5tYXAoc3RyaW5nVmFsdWUpLmpvaW4oJ11bJyl9XWA7XG59XG4iXX0=","\"use strict\";\n/*\n * Constants and utilities for encoding channels (Visual variables)\n * such as 'x', 'y', 'color'.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar tslib_1 = require(\"tslib\");\nvar util_1 = require(\"./util\");\nvar Channel;\n(function (Channel) {\n // Facet\n Channel.ROW = 'row';\n Channel.COLUMN = 'column';\n // Position\n Channel.X = 'x';\n Channel.Y = 'y';\n Channel.X2 = 'x2';\n Channel.Y2 = 'y2';\n // Geo Position\n Channel.LATITUDE = 'latitude';\n Channel.LONGITUDE = 'longitude';\n Channel.LATITUDE2 = 'latitude2';\n Channel.LONGITUDE2 = 'longitude2';\n // Mark property with scale\n Channel.COLOR = 'color';\n Channel.FILL = 'fill';\n Channel.STROKE = 'stroke';\n Channel.SHAPE = 'shape';\n Channel.SIZE = 'size';\n Channel.OPACITY = 'opacity';\n // Non-scale channel\n Channel.TEXT = 'text';\n Channel.ORDER = 'order';\n Channel.DETAIL = 'detail';\n Channel.KEY = 'key';\n Channel.TOOLTIP = 'tooltip';\n Channel.HREF = 'href';\n})(Channel = exports.Channel || (exports.Channel = {}));\nexports.X = Channel.X;\nexports.Y = Channel.Y;\nexports.X2 = Channel.X2;\nexports.Y2 = Channel.Y2;\nexports.LATITUDE = Channel.LATITUDE;\nexports.LATITUDE2 = Channel.LATITUDE2;\nexports.LONGITUDE = Channel.LONGITUDE;\nexports.LONGITUDE2 = Channel.LONGITUDE2;\nexports.ROW = Channel.ROW;\nexports.COLUMN = Channel.COLUMN;\nexports.SHAPE = Channel.SHAPE;\nexports.SIZE = Channel.SIZE;\nexports.COLOR = Channel.COLOR;\nexports.FILL = Channel.FILL;\nexports.STROKE = Channel.STROKE;\nexports.TEXT = Channel.TEXT;\nexports.DETAIL = Channel.DETAIL;\nexports.KEY = Channel.KEY;\nexports.ORDER = Channel.ORDER;\nexports.OPACITY = Channel.OPACITY;\nexports.TOOLTIP = Channel.TOOLTIP;\nexports.HREF = Channel.HREF;\nexports.GEOPOSITION_CHANNEL_INDEX = {\n longitude: 1,\n longitude2: 1,\n latitude: 1,\n latitude2: 1,\n};\nexports.GEOPOSITION_CHANNELS = util_1.flagKeys(exports.GEOPOSITION_CHANNEL_INDEX);\nvar UNIT_CHANNEL_INDEX = tslib_1.__assign({ \n // position\n x: 1, y: 1, x2: 1, y2: 1 }, exports.GEOPOSITION_CHANNEL_INDEX, { \n // color\n color: 1, fill: 1, stroke: 1, \n // other non-position with scale\n opacity: 1, size: 1, shape: 1, \n // channels without scales\n order: 1, text: 1, detail: 1, key: 1, tooltip: 1, href: 1 });\nfunction isColorChannel(channel) {\n return channel === 'color' || channel === 'fill' || channel === 'stroke';\n}\nexports.isColorChannel = isColorChannel;\nvar FACET_CHANNEL_INDEX = {\n row: 1,\n column: 1\n};\nvar CHANNEL_INDEX = tslib_1.__assign({}, UNIT_CHANNEL_INDEX, FACET_CHANNEL_INDEX);\nexports.CHANNELS = util_1.flagKeys(CHANNEL_INDEX);\nvar _o = CHANNEL_INDEX.order, _d = CHANNEL_INDEX.detail, SINGLE_DEF_CHANNEL_INDEX = tslib_1.__rest(CHANNEL_INDEX, [\"order\", \"detail\"]);\n/**\n * Channels that cannot have an array of channelDef.\n * model.fieldDef, getFieldDef only work for these channels.\n *\n * (The only two channels that can have an array of channelDefs are \"detail\" and \"order\".\n * Since there can be multiple fieldDefs for detail and order, getFieldDef/model.fieldDef\n * are not applicable for them. Similarly, selection projection won't work with \"detail\" and \"order\".)\n */\nexports.SINGLE_DEF_CHANNELS = util_1.flagKeys(SINGLE_DEF_CHANNEL_INDEX);\nfunction isChannel(str) {\n return !!CHANNEL_INDEX[str];\n}\nexports.isChannel = isChannel;\n// CHANNELS without COLUMN, ROW\nexports.UNIT_CHANNELS = util_1.flagKeys(UNIT_CHANNEL_INDEX);\n// NONPOSITION_CHANNELS = UNIT_CHANNELS without X, Y, X2, Y2;\nvar _x = UNIT_CHANNEL_INDEX.x, _y = UNIT_CHANNEL_INDEX.y, \n// x2 and y2 share the same scale as x and y\n_x2 = UNIT_CHANNEL_INDEX.x2, _y2 = UNIT_CHANNEL_INDEX.y2, _latitude = UNIT_CHANNEL_INDEX.latitude, _longitude = UNIT_CHANNEL_INDEX.longitude, _latitude2 = UNIT_CHANNEL_INDEX.latitude2, _longitude2 = UNIT_CHANNEL_INDEX.longitude2, \n// The rest of unit channels then have scale\nNONPOSITION_CHANNEL_INDEX = tslib_1.__rest(UNIT_CHANNEL_INDEX, [\"x\", \"y\", \"x2\", \"y2\", \"latitude\", \"longitude\", \"latitude2\", \"longitude2\"]);\nexports.NONPOSITION_CHANNELS = util_1.flagKeys(NONPOSITION_CHANNEL_INDEX);\n// POSITION_SCALE_CHANNELS = X and Y;\nvar POSITION_SCALE_CHANNEL_INDEX = { x: 1, y: 1 };\nexports.POSITION_SCALE_CHANNELS = util_1.flagKeys(POSITION_SCALE_CHANNEL_INDEX);\n// NON_POSITION_SCALE_CHANNEL = SCALE_CHANNELS without X, Y\nvar \n// x2 and y2 share the same scale as x and y\n// text and tooltip have format instead of scale,\n// href has neither format, nor scale\n_t = NONPOSITION_CHANNEL_INDEX.text, _tt = NONPOSITION_CHANNEL_INDEX.tooltip, _hr = NONPOSITION_CHANNEL_INDEX.href, \n// detail and order have no scale\n_dd = NONPOSITION_CHANNEL_INDEX.detail, _k = NONPOSITION_CHANNEL_INDEX.key, _oo = NONPOSITION_CHANNEL_INDEX.order, NONPOSITION_SCALE_CHANNEL_INDEX = tslib_1.__rest(NONPOSITION_CHANNEL_INDEX, [\"text\", \"tooltip\", \"href\", \"detail\", \"key\", \"order\"]);\nexports.NONPOSITION_SCALE_CHANNELS = util_1.flagKeys(NONPOSITION_SCALE_CHANNEL_INDEX);\n// Declare SCALE_CHANNEL_INDEX\nvar SCALE_CHANNEL_INDEX = tslib_1.__assign({}, POSITION_SCALE_CHANNEL_INDEX, NONPOSITION_SCALE_CHANNEL_INDEX);\n/** List of channels with scales */\nexports.SCALE_CHANNELS = util_1.flagKeys(SCALE_CHANNEL_INDEX);\nfunction isScaleChannel(channel) {\n return !!SCALE_CHANNEL_INDEX[channel];\n}\nexports.isScaleChannel = isScaleChannel;\n/**\n * Return whether a channel supports a particular mark type.\n * @param channel channel name\n * @param mark the mark type\n * @return whether the mark supports the channel\n */\nfunction supportMark(channel, mark) {\n return mark in getSupportedMark(channel);\n}\nexports.supportMark = supportMark;\n/**\n * Return a dictionary showing whether a channel supports mark type.\n * @param channel\n * @return A dictionary mapping mark types to boolean values.\n */\nfunction getSupportedMark(channel) {\n switch (channel) {\n case exports.COLOR:\n case exports.FILL:\n case exports.STROKE:\n case exports.DETAIL:\n case exports.KEY:\n case exports.TOOLTIP:\n case exports.HREF:\n case exports.ORDER: // TODO: revise (order might not support rect, which is not stackable?)\n case exports.OPACITY:\n case exports.ROW:\n case exports.COLUMN:\n return {\n point: true, tick: true, rule: true, circle: true, square: true,\n bar: true, rect: true, line: true, trail: true, area: true, text: true, geoshape: true\n };\n case exports.X:\n case exports.Y:\n case exports.LATITUDE:\n case exports.LONGITUDE:\n return {\n point: true, tick: true, rule: true, circle: true, square: true,\n bar: true, rect: true, line: true, trail: true, area: true, text: true\n };\n case exports.X2:\n case exports.Y2:\n case exports.LATITUDE2:\n case exports.LONGITUDE2:\n return {\n rule: true, bar: true, rect: true, area: true\n };\n case exports.SIZE:\n return {\n point: true, tick: true, rule: true, circle: true, square: true,\n bar: true, text: true, line: true, trail: true\n };\n case exports.SHAPE:\n return { point: true, geoshape: true };\n case exports.TEXT:\n return { text: true };\n }\n}\nexports.getSupportedMark = getSupportedMark;\nfunction rangeType(channel) {\n switch (channel) {\n case exports.X:\n case exports.Y:\n case exports.SIZE:\n case exports.OPACITY:\n // X2 and Y2 use X and Y scales, so they similarly have continuous range.\n case exports.X2:\n case exports.Y2:\n return 'continuous';\n case exports.ROW:\n case exports.COLUMN:\n case exports.SHAPE:\n // TEXT, TOOLTIP, and HREF have no scale but have discrete output\n case exports.TEXT:\n case exports.TOOLTIP:\n case exports.HREF:\n return 'discrete';\n // Color can be either continuous or discrete, depending on scale type.\n case exports.COLOR:\n case exports.FILL:\n case exports.STROKE:\n return 'flexible';\n // No scale, no range type.\n case exports.LATITUDE:\n case exports.LONGITUDE:\n case exports.LATITUDE2:\n case exports.LONGITUDE2:\n case exports.DETAIL:\n case exports.KEY:\n case exports.ORDER:\n return undefined;\n }\n /* istanbul ignore next: should never reach here. */\n throw new Error('rangeType not implemented for ' + channel);\n}\nexports.rangeType = rangeType;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hhbm5lbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jaGFubmVsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTs7O0dBR0c7OztBQU1ILCtCQUFzQztBQUV0QyxJQUFpQixPQUFPLENBb0N2QjtBQXBDRCxXQUFpQixPQUFPO0lBQ3RCLFFBQVE7SUFDSyxXQUFHLEdBQVUsS0FBSyxDQUFDO0lBQ25CLGNBQU0sR0FBYSxRQUFRLENBQUM7SUFFekMsV0FBVztJQUNFLFNBQUMsR0FBUSxHQUFHLENBQUM7SUFDYixTQUFDLEdBQVEsR0FBRyxDQUFDO0lBQ2IsVUFBRSxHQUFTLElBQUksQ0FBQztJQUNoQixVQUFFLEdBQVMsSUFBSSxDQUFDO0lBRTdCLGVBQWU7SUFDRixnQkFBUSxHQUFlLFVBQVUsQ0FBQztJQUNsQyxpQkFBUyxHQUFnQixXQUFXLENBQUM7SUFDckMsaUJBQVMsR0FBZ0IsV0FBVyxDQUFDO0lBQ3JDLGtCQUFVLEdBQWlCLFlBQVksQ0FBQztJQUVyRCwyQkFBMkI7SUFDZCxhQUFLLEdBQVksT0FBTyxDQUFDO0lBRXpCLFlBQUksR0FBVy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USVRVREU6XG4gICAgY2FzZSBMT05HSVRVREU6XG4gICAgY2FzZSBMQVRJVFVERTI6XG4gICAgY2FzZSBMT05HSVRVREUyOlxuICAgIGNhc2UgREVUQUlMOlxuICAgIGNhc2UgS0VZOlxuICAgIGNhc2UgT1JERVI6XG4gICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICB9XG4gIC8qIGlzdGFuYnVsIGlnbm9yZSBuZXh0OiBzaG91bGQgbmV2ZXIgcmVhY2ggaGVyZS4gKi9cbiAgdGhyb3cgbmV3IEVycm9yKCdyYW5nZVR5cGUgbm90IGltcGxlbWVudGVkIGZvciAnICsgY2hhbm5lbCk7XG59XG4iXX0=","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar tslib_1 = require(\"tslib\");\nvar util_1 = require(\"./util\");\nexports.AXIS_PARTS = ['domain', 'grid', 'labels', 'ticks', 'title'];\n/**\n * A dictionary listing whether a certain axis property is applicable for only main axes or only grid axes.\n * (Properties not listed are applicable for both)\n */\nexports.AXIS_PROPERTY_TYPE = {\n grid: 'grid',\n gridScale: 'grid',\n domain: 'main',\n labels: 'main',\n labelFlush: 'main',\n labelOverlap: 'main',\n minExtent: 'main',\n maxExtent: 'main',\n offset: 'main',\n ticks: 'main',\n title: 'main',\n values: 'both',\n scale: 'both',\n zindex: 'both' // this is actually set afterward, so it doesn't matter\n};\nvar COMMON_AXIS_PROPERTIES_INDEX = {\n orient: 1,\n domain: 1,\n format: 1,\n grid: 1,\n labelBound: 1,\n labelFlush: 1,\n labelPadding: 1,\n labels: 1,\n labelOverlap: 1,\n maxExtent: 1,\n minExtent: 1,\n offset: 1,\n position: 1,\n tickCount: 1,\n ticks: 1,\n tickSize: 1,\n title: 1,\n titlePadding: 1,\n values: 1,\n zindex: 1,\n};\nvar AXIS_PROPERTIES_INDEX = tslib_1.__assign({}, COMMON_AXIS_PROPERTIES_INDEX, { encoding: 1, labelAngle: 1, titleMaxLength: 1 });\nvar VG_AXIS_PROPERTIES_INDEX = tslib_1.__assign({ scale: 1 }, COMMON_AXIS_PROPERTIES_INDEX, { gridScale: 1, encode: 1 });\nfunction isAxisProperty(prop) {\n return !!AXIS_PROPERTIES_INDEX[prop];\n}\nexports.isAxisProperty = isAxisProperty;\nexports.VG_AXIS_PROPERTIES = util_1.flagKeys(VG_AXIS_PROPERTIES_INDEX);\n// Export for dependent projects\nexports.AXIS_PROPERTIES = util_1.flagKeys(AXIS_PROPERTIES_INDEX);\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXhpcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9heGlzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUVBLCtCQUFzQztBQTJFekIsUUFBQSxVQUFVLEdBQWUsQ0FBQyxRQUFRLEVBQUUsTUFBTSxFQUFFLFFBQVEsRUFBRSxPQUFPLEVBQUUsT0FBTyxDQUFDLENBQUM7QUFJckY7OztHQUdHO0FBQ1UsUUFBQSxrQkFBa0IsR0FHM0I7SUFDRixJQUFJLEVBQUUsTUFBTTtJQUNaLFNBQVMsRUFBRSxNQUFNO0lBRWpCLE1BQU0sRUFBRSxNQUFNO0lBQ2QsTUFBTSxFQUFFLE1BQU07SUFDZCxVQUFVLEVBQUUsTUFBTTtJQUNsQixZQUFZLEVBQUUsTUFBTTtJQUNwQixTQUFTLEVBQUUsTUFBTTtJQUNqQixTQUFTLEVBQUUsTUFBTTtJQUNqQixNQUFNLEVBQUUsTUFBTTtJQUNkLEtBQUssRUFBRSxNQUFNO0lBQ2IsS0FBSyxFQUFFLE1BQU07SUFDYixNQUFNLEVBQUUsTUFBTTtJQUVkLEtBQUssRUFBRSxNQUFNO0lBQ2IsTUFBTSxFQUFFLE1BQU0sQ0FBQyx1REFBdUQ7Q0FDdkUsQ0FBQztBQWtDRixJQUFNLDRCQUE0QixHQUFnQztJQUNoRSxNQUFNLEVBQUUsQ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biAgLyoqXG4gICAqIFNwZWNpZmljIGF4aXMgY29uZmlnIGZvciB4LWF4aXMgYWxvbmcgdGhlIHRvcCBlZGdlIG9mIHRoZSBjaGFydC5cbiAgICovXG4gIGF4aXNUb3A/OiBWZ0F4aXNDb25maWc7XG5cbiAgLyoqXG4gICAqIFNwZWNpZmljIGF4aXMgY29uZmlnIGZvciB4LWF4aXMgYWxvbmcgdGhlIGJvdHRvbSBlZGdlIG9mIHRoZSBjaGFydC5cbiAgICovXG4gIGF4aXNCb3R0b20/OiBWZ0F4aXNDb25maWc7XG5cbiAgLyoqXG4gICAqIFNwZWNpZmljIGF4aXMgY29uZmlnIGZvciBheGVzIHdpdGggXCJiYW5kXCIgc2NhbGVzLlxuICAgKi9cbiAgYXhpc0JhbmQ/OiBWZ0F4aXNDb25maWc7XG59XG4iXX0=","\"use strict\";\n/**\n * Vega-Lite's singleton logger utility.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar vega_util_1 = require(\"vega-util\");\nvar util_1 = require(\"./util\");\n/**\n * Main (default) Vega Logger instance for Vega-Lite\n */\nvar main = vega_util_1.logger(vega_util_1.Warn);\nvar current = main;\n/**\n * Logger tool for checking if the code throws correct warning\n */\nvar LocalLogger = /** @class */ (function () {\n function LocalLogger() {\n this.warns = [];\n this.infos = [];\n this.debugs = [];\n }\n LocalLogger.prototype.level = function () {\n return this;\n };\n LocalLogger.prototype.warn = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n (_a = this.warns).push.apply(_a, args);\n return this;\n var _a;\n };\n LocalLogger.prototype.info = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n (_a = this.infos).push.apply(_a, args);\n return this;\n var _a;\n };\n LocalLogger.prototype.debug = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n (_a = this.debugs).push.apply(_a, args);\n return this;\n var _a;\n };\n return LocalLogger;\n}());\nexports.LocalLogger = LocalLogger;\nfunction wrap(f) {\n return function () {\n current = new LocalLogger();\n f(current);\n reset();\n };\n}\nexports.wrap = wrap;\n/**\n * Set the singleton logger to be a custom logger\n */\nfunction set(newLogger) {\n current = newLogger;\n return current;\n}\nexports.set = set;\n/**\n * Reset the main logger to use the default Vega Logger\n */\nfunction reset() {\n current = main;\n return current;\n}\nexports.reset = reset;\nfunction warn() {\n var _ = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n _[_i] = arguments[_i];\n }\n current.warn.apply(current, arguments);\n}\nexports.warn = warn;\nfunction info() {\n var _ = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n _[_i] = arguments[_i];\n }\n current.info.apply(current, arguments);\n}\nexports.info = info;\nfunction debug() {\n var _ = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n _[_i] = arguments[_i];\n }\n current.debug.apply(current, arguments);\n}\nexports.debug = debug;\n/**\n * Collection of all Vega-Lite Error Messages\n */\nvar message;\n(function (message) {\n message.INVALID_SPEC = 'Invalid spec';\n // FIT\n message.FIT_NON_SINGLE = 'Autosize \"fit\" only works for single views and layered views.';\n message.CANNOT_FIX_RANGE_STEP_WITH_FIT = 'Cannot use a fixed value of \"rangeStep\" when \"autosize\" is \"fit\".';\n // SELECTION\n function cannotProjectOnChannelWithoutField(channel) {\n return \"Cannot project a selection on encoding channel \\\"\" + channel + \"\\\", which has no field.\";\n }\n message.cannotProjectOnChannelWithoutField = cannotProjectOnChannelWithoutField;\n function nearestNotSupportForContinuous(mark) {\n return \"The \\\"nearest\\\" transform is not supported for \" + mark + \" marks.\";\n }\n message.nearestNotSupportForContinuous = nearestNotSupportForContinuous;\n function selectionNotFound(name) {\n return \"Cannot find a selection named \\\"\" + name + \"\\\"\";\n }\n message.selectionNotFound = selectionNotFound;\n message.SCALE_BINDINGS_CONTINUOUS = 'Scale bindings are currently only supported for scales with unbinned, continuous domains.';\n // REPEAT\n function noSuchRepeatedValue(field) {\n return \"Unknown repeated value \\\"\" + field + \"\\\".\";\n }\n message.noSuchRepeatedValue = noSuchRepeatedValue;\n // CONCAT\n message.CONCAT_CANNOT_SHARE_AXIS = 'Axes cannot be shared in concatenated views.';\n // REPEAT\n message.REPEAT_CANNOT_SHARE_AXIS = 'Axes cannot be shared in repeated views.';\n // TITLE\n function cannotSetTitleAnchor(type) {\n return \"Cannot set title \\\"anchor\\\" for a \" + type + \" spec\";\n }\n message.cannotSetTitleAnchor = cannotSetTitleAnchor;\n // DATA\n function unrecognizedParse(p) {\n return \"Unrecognized parse \\\"\" + p + \"\\\".\";\n }\n message.unrecognizedParse = unrecognizedParse;\n function differentParse(field, local, ancestor) {\n return \"An ancestor parsed field \\\"\" + field + \"\\\" as \" + ancestor + \" but a child wants to parse the field as \" + local + \".\";\n }\n message.differentParse = differentParse;\n // TRANSFORMS\n function invalidTransformIgnored(transform) {\n return \"Ignoring an invalid transform: \" + util_1.stringify(transform) + \".\";\n }\n message.invalidTransformIgnored = invalidTransformIgnored;\n message.NO_FIELDS_NEEDS_AS = 'If \"from.fields\" is not specified, \"as\" has to be a string that specifies the key to be used for the data from the secondary source.';\n // ENCODING & FACET\n function encodingOverridden(channels) {\n return \"Layer's shared \" + channels.join(',') + \" channel \" + (channels.length === 1 ? 'is' : 'are') + \" overriden\";\n }\n message.encodingOverridden = encodingOverridden;\n function projectionOverridden(opt) {\n var parentProjection = opt.parentProjection, projection = opt.projection;\n return \"Layer's shared projection \" + util_1.stringify(parentProjection) + \" is overridden by a child projection \" + util_1.stringify(projection) + \".\";\n }\n message.projectionOverridden = projectionOverridden;\n function primitiveChannelDef(channel, type, value) {\n return \"Channel \" + channel + \" is a \" + type + \". Converted to {value: \" + util_1.stringify(value) + \"}.\";\n }\n message.primitiveChannelDef = primitiveChannelDef;\n function invalidFieldType(type) {\n return \"Invalid field type \\\"\" + type + \"\\\"\";\n }\n message.invalidFieldType = invalidFieldType;\n function nonZeroScaleUsedWithLengthMark(mark, channel, opt) {\n var scaleText = opt.scaleType ? opt.scaleType + \" scale\" :\n opt.zeroFalse ? 'scale with zero=false' :\n 'scale with custom domain that excludes zero';\n return \"A \" + scaleText + \" is used with \" + mark + \" mark. This can be misleading as the \" + (channel === 'x' ? 'width' : 'height') + \" of the \" + mark + \" can be arbitrary based on the scale domain. You may want to use point mark instead.\";\n }\n message.nonZeroScaleUsedWithLengthMark = nonZeroScaleUsedWithLengthMark;\n function invalidFieldTypeForCountAggregate(type, aggregate) {\n return \"Invalid field type \\\"\" + type + \"\\\" for aggregate: \\\"\" + aggregate + \"\\\", using \\\"quantitative\\\" instead.\";\n }\n message.invalidFieldTypeForCountAggregate = invalidFieldTypeForCountAggregate;\n function invalidAggregate(aggregate) {\n return \"Invalid aggregation operator \\\"\" + aggregate + \"\\\"\";\n }\n message.invalidAggregate = invalidAggregate;\n function emptyOrInvalidFieldType(type, channel, newType) {\n return \"Invalid field type \\\"\" + type + \"\\\" for channel \\\"\" + channel + \"\\\", using \\\"\" + newType + \"\\\" instead.\";\n }\n message.emptyOrInvalidFieldType = emptyOrInvalidFieldType;\n function droppingColor(type, opt) {\n var fill = opt.fill, stroke = opt.stroke;\n return \"Dropping color \" + type + \" as the plot also has \" + (fill && stroke ? 'fill and stroke' : fill ? 'fill' : 'stroke');\n }\n message.droppingColor = droppingColor;\n function emptyFieldDef(fieldDef, channel) {\n return \"Dropping \" + util_1.stringify(fieldDef) + \" from channel \\\"\" + channel + \"\\\" since it does not contain data field or value.\";\n }\n message.emptyFieldDef = emptyFieldDef;\n function latLongDeprecated(channel, type, newChannel) {\n return channel + \"-encoding with type \" + type + \" is deprecated. Replacing with \" + newChannel + \"-encoding.\";\n }\n message.latLongDeprecated = latLongDeprecated;\n message.LINE_WITH_VARYING_SIZE = 'Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.';\n function incompatibleChannel(channel, markOrFacet, when) {\n return channel + \" dropped as it is incompatible with \\\"\" + markOrFacet + \"\\\"\" + (when ? \" when \" + when : '') + \".\";\n }\n message.incompatibleChannel = incompatibleChannel;\n function invalidEncodingChannel(channel) {\n return channel + \"-encoding is dropped as \" + channel + \" is not a valid encoding channel.\";\n }\n message.invalidEncodingChannel = invalidEncodingChannel;\n function facetChannelShouldBeDiscrete(channel) {\n return channel + \" encoding should be discrete (ordinal / nominal / binned).\";\n }\n message.facetChannelShouldBeDiscrete = facetChannelShouldBeDiscrete;\n function discreteChannelCannotEncode(channel, type) {\n return \"Using discrete channel \\\"\" + channel + \"\\\" to encode \\\"\" + type + \"\\\" field can be misleading as it does not encode \" + (type === 'ordinal' ? 'order' : 'magnitude') + \".\";\n }\n message.discreteChannelCannotEncode = discreteChannelCannotEncode;\n // Mark\n message.BAR_WITH_POINT_SCALE_AND_RANGESTEP_NULL = 'Bar mark should not be used with point scale when rangeStep is null. Please use band scale instead.';\n function lineWithRange(hasX2, hasY2) {\n var channels = hasX2 && hasY2 ? 'x2 and y2' : hasX2 ? 'x2' : 'y2';\n return \"Line mark is for continuous lines and thus cannot be used with \" + channels + \". We will use the rule mark (line segments) instead.\";\n }\n message.lineWithRange = lineWithRange;\n function unclearOrientContinuous(mark) {\n return \"Cannot clearly determine orientation for \\\"\" + mark + \"\\\" since both x and y channel encode continuous fields. In this case, we use vertical by default\";\n }\n message.unclearOrientContinuous = unclearOrientContinuous;\n function unclearOrientDiscreteOrEmpty(mark) {\n return \"Cannot clearly determine orientation for \\\"\" + mark + \"\\\" since both x and y channel encode discrete or empty fields.\";\n }\n message.unclearOrientDiscreteOrEmpty = unclearOrientDiscreteOrEmpty;\n function orientOverridden(original, actual) {\n return \"Specified orient \\\"\" + original + \"\\\" overridden with \\\"\" + actual + \"\\\"\";\n }\n message.orientOverridden = orientOverridden;\n // SCALE\n message.CANNOT_UNION_CUSTOM_DOMAIN_WITH_FIELD_DOMAIN = 'custom domain scale cannot be unioned with default field-based domain';\n function cannotUseScalePropertyWithNonColor(prop) {\n return \"Cannot use the scale property \\\"\" + prop + \"\\\" with non-color channel.\";\n }\n message.cannotUseScalePropertyWithNonColor = cannotUseScalePropertyWithNonColor;\n function unaggregateDomainHasNoEffectForRawField(fieldDef) {\n return \"Using unaggregated domain with raw field has no effect (\" + util_1.stringify(fieldDef) + \").\";\n }\n message.unaggregateDomainHasNoEffectForRawField = unaggregateDomainHasNoEffectForRawField;\n function unaggregateDomainWithNonSharedDomainOp(aggregate) {\n return \"Unaggregated domain not applicable for \\\"\" + aggregate + \"\\\" since it produces values outside the origin domain of the source data.\";\n }\n message.unaggregateDomainWithNonSharedDomainOp = unaggregateDomainWithNonSharedDomainOp;\n function unaggregatedDomainWithLogScale(fieldDef) {\n return \"Unaggregated domain is currently unsupported for log scale (\" + util_1.stringify(fieldDef) + \").\";\n }\n message.unaggregatedDomainWithLogScale = unaggregatedDomainWithLogScale;\n function cannotUseSizeFieldWithBandSize(positionChannel) {\n return \"Using size field when \" + positionChannel + \"-channel has a band scale is not supported.\";\n }\n message.cannotUseSizeFieldWithBandSize = cannotUseSizeFieldWithBandSize;\n function cannotApplySizeToNonOrientedMark(mark) {\n return \"Cannot apply size to non-oriented mark \\\"\" + mark + \"\\\".\";\n }\n message.cannotApplySizeToNonOrientedMark = cannotApplySizeToNonOrientedMark;\n function rangeStepDropped(channel) {\n return \"rangeStep for \\\"\" + channel + \"\\\" is dropped as top-level \" + (channel === 'x' ? 'width' : 'height') + \" is provided.\";\n }\n message.rangeStepDropped = rangeStepDropped;\n function scaleTypeNotWorkWithChannel(channel, scaleType, defaultScaleType) {\n return \"Channel \\\"\" + channel + \"\\\" does not work with \\\"\" + scaleType + \"\\\" scale. We are using \\\"\" + defaultScaleType + \"\\\" scale instead.\";\n }\n message.scaleTypeNotWorkWithChannel = scaleTypeNotWorkWithChannel;\n function scaleTypeNotWorkWithFieldDef(scaleType, defaultScaleType) {\n return \"FieldDef does not work with \\\"\" + scaleType + \"\\\" scale. We are using \\\"\" + defaultScaleType + \"\\\" scale instead.\";\n }\n message.scaleTypeNotWorkWithFieldDef = scaleTypeNotWorkWithFieldDef;\n function scalePropertyNotWorkWithScaleType(scaleType, propName, channel) {\n return channel + \"-scale's \\\"\" + propName + \"\\\" is dropped as it does not work with \" + scaleType + \" scale.\";\n }\n message.scalePropertyNotWorkWithScaleType = scalePropertyNotWorkWithScaleType;\n function scaleTypeNotWorkWithMark(mark, scaleType) {\n return \"Scale type \\\"\" + scaleType + \"\\\" does not work with mark \\\"\" + mark + \"\\\".\";\n }\n message.scaleTypeNotWorkWithMark = scaleTypeNotWorkWithMark;\n function mergeConflictingProperty(property, propertyOf, v1, v2) {\n return \"Conflicting \" + propertyOf + \" property \\\"\" + property + \"\\\" (\" + util_1.stringify(v1) + \" and \" + util_1.stringify(v2) + \"). Using \" + util_1.stringify(v1) + \".\";\n }\n message.mergeConflictingProperty = mergeConflictingProperty;\n function independentScaleMeansIndependentGuide(channel) {\n return \"Setting the scale to be independent for \\\"\" + channel + \"\\\" means we also have to set the guide (axis or legend) to be independent.\";\n }\n message.independentScaleMeansIndependentGuide = independentScaleMeansIndependentGuide;\n function conflictedDomain(channel) {\n return \"Cannot set \" + channel + \"-scale's \\\"domain\\\" as it is binned. Please use \\\"bin\\\"'s \\\"extent\\\" instead.\";\n }\n message.conflictedDomain = conflictedDomain;\n function domainSortDropped(sort) {\n return \"Dropping sort property \" + util_1.stringify(sort) + \" as unioned domains only support boolean or op 'count'.\";\n }\n message.domainSortDropped = domainSortDropped;\n message.UNABLE_TO_MERGE_DOMAINS = 'Unable to merge domains';\n message.MORE_THAN_ONE_SORT = 'Domains that should be unioned has conflicting sort properties. Sort will be set to true.';\n // AXIS\n message.INVALID_CHANNEL_FOR_AXIS = 'Invalid channel for axis.';\n // STACK\n function cannotStackRangedMark(channel) {\n return \"Cannot stack \\\"\" + channel + \"\\\" if there is already \\\"\" + channel + \"2\\\"\";\n }\n message.cannotStackRangedMark = cannotStackRangedMark;\n function cannotStackNonLinearScale(scaleType) {\n return \"Cannot stack non-linear scale (\" + scaleType + \")\";\n }\n message.cannotStackNonLinearScale = cannotStackNonLinearScale;\n function stackNonSummativeAggregate(aggregate) {\n return \"Stacking is applied even though the aggregate function is non-summative (\\\"\" + aggregate + \"\\\")\";\n }\n message.stackNonSummativeAggregate = stackNonSummativeAggregate;\n // TIMEUNIT\n function invalidTimeUnit(unitName, value) {\n return \"Invalid \" + unitName + \": \" + util_1.stringify(value);\n }\n message.invalidTimeUnit = invalidTimeUnit;\n function dayReplacedWithDate(fullTimeUnit) {\n return \"Time unit \\\"\" + fullTimeUnit + \"\\\" is not supported. We are replacing it with \" + fullTimeUnit.replace('day', 'date') + \".\";\n }\n message.dayReplacedWithDate = dayReplacedWithDate;\n function droppedDay(d) {\n return \"Dropping day from datetime \" + util_1.stringify(d) + \" as day cannot be combined with other units.\";\n }\n message.droppedDay = droppedDay;\n})(message = exports.message || (exports.message = {}));\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9nLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2xvZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7O0dBRUc7O0FBR0gsdUNBQXdEO0FBU3hELCtCQUFpQztBQU1qQzs7R0FFRztBQUNILElBQU0sSUFBSSxHQUFHLGtCQUFNLENBQUMsZ0JBQUksQ0FBQyxDQUFDO0FBQzFCLElBQUksT0FBTyxHQUFvQixJQUFJLENBQUM7QUFFcEM7O0dBRUc7QUFDSDtJQUFBO1FBQ1MsVUFBSyxHQUFVLEVBQUUsQ0FBQztRQUNsQixVQUFLLEdBQVUsRUFBRSxDQUFDO1FBQ2xCLFdBQU0sR0FBVSxFQUFFLENBQUM7SUFvQjVCLENBQUM7SUFsQlEsMkJBQUssR0FBWjtRQUNFLE9BQU8sSUFBSSxDQUFDO0lBQ2QsQ0FBQztJQUVNLDBCQUFJLEdBQVg7UUFBWSxjQUFjO2FBQWQsVUFBYyxFQUFkLHFCQUFjLEVBQWQsSUFBYztZQUFkLHlCQUFj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uIGRyb3BwZWREYXkoZDogRGF0ZVRpbWUgfCBEYXRlVGltZUV4cHIpIHtcbiAgICByZXR1cm4gYERyb3BwaW5nIGRheSBmcm9tIGRhdGV0aW1lICR7c3RyaW5naWZ5KGQpfSBhcyBkYXkgY2Fubm90IGJlIGNvbWJpbmVkIHdpdGggb3RoZXIgdW5pdHMuYDtcbiAgfVxufVxuXG4iXX0=","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar tslib_1 = require(\"tslib\");\nvar vega_util_1 = require(\"vega-util\");\nvar channel_1 = require(\"./channel\");\nvar log = require(\"./log\");\nvar util_1 = require(\"./util\");\nvar ScaleType;\n(function (ScaleType) {\n // Continuous - Quantitative\n ScaleType.LINEAR = 'linear';\n ScaleType.BIN_LINEAR = 'bin-linear';\n ScaleType.LOG = 'log';\n ScaleType.POW = 'pow';\n ScaleType.SQRT = 'sqrt';\n // Continuous - Time\n ScaleType.TIME = 'time';\n ScaleType.UTC = 'utc';\n // sequential\n ScaleType.SEQUENTIAL = 'sequential';\n // Quantile, Quantize, threshold\n ScaleType.QUANTILE = 'quantile';\n ScaleType.QUANTIZE = 'quantize';\n ScaleType.THRESHOLD = 'threshold';\n ScaleType.ORDINAL = 'ordinal';\n ScaleType.BIN_ORDINAL = 'bin-ordinal';\n ScaleType.POINT = 'point';\n ScaleType.BAND = 'band';\n})(ScaleType = exports.ScaleType || (exports.ScaleType = {}));\n/**\n * Index for scale categories -- only scale of the same categories can be merged together.\n * Current implementation is trying to be conservative and avoid merging scale type that might not work together\n */\nvar SCALE_CATEGORY_INDEX = {\n linear: 'numeric',\n log: 'numeric',\n pow: 'numeric',\n sqrt: 'numeric',\n 'bin-linear': 'bin-linear',\n time: 'time',\n utc: 'time',\n sequential: 'sequential',\n ordinal: 'ordinal',\n 'bin-ordinal': 'bin-ordinal',\n point: 'ordinal-position',\n band: 'ordinal-position'\n};\nexports.SCALE_TYPES = util_1.keys(SCALE_CATEGORY_INDEX);\n/**\n * Whether the two given scale types can be merged together.\n */\nfunction scaleCompatible(scaleType1, scaleType2) {\n var scaleCategory1 = SCALE_CATEGORY_INDEX[scaleType1];\n var scaleCategory2 = SCALE_CATEGORY_INDEX[scaleType2];\n return scaleCategory1 === scaleCategory2 ||\n (scaleCategory1 === 'ordinal-position' && scaleCategory2 === 'time') ||\n (scaleCategory2 === 'ordinal-position' && scaleCategory1 === 'time');\n}\nexports.scaleCompatible = scaleCompatible;\n/**\n * Index for scale precedence -- high score = higher priority for merging.\n */\nvar SCALE_PRECEDENCE_INDEX = {\n // numeric\n linear: 0,\n log: 1,\n pow: 1,\n sqrt: 1,\n // time\n time: 0,\n utc: 0,\n // ordinal-position -- these have higher precedence than continuous scales as they support more types of data\n point: 10,\n band: 11,\n // non grouped types\n 'bin-linear': 0,\n sequential: 0,\n ordinal: 0,\n 'bin-ordinal': 0,\n};\n/**\n * Return scale categories -- only scale of the same categories can be merged together.\n */\nfunction scaleTypePrecedence(scaleType) {\n return SCALE_PRECEDENCE_INDEX[scaleType];\n}\nexports.scaleTypePrecedence = scaleTypePrecedence;\nexports.CONTINUOUS_TO_CONTINUOUS_SCALES = ['linear', 'bin-linear', 'log', 'pow', 'sqrt', 'time', 'utc'];\nvar CONTINUOUS_TO_CONTINUOUS_INDEX = vega_util_1.toSet(exports.CONTINUOUS_TO_CONTINUOUS_SCALES);\nexports.CONTINUOUS_DOMAIN_SCALES = exports.CONTINUOUS_TO_CONTINUOUS_SCALES.concat(['sequential' /* TODO add 'quantile', 'quantize', 'threshold'*/]);\nvar CONTINUOUS_DOMAIN_INDEX = vega_util_1.toSet(exports.CONTINUOUS_DOMAIN_SCALES);\nexports.DISCRETE_DOMAIN_SCALES = ['ordinal', 'bin-ordinal', 'point', 'band'];\nvar DISCRETE_DOMAIN_INDEX = vega_util_1.toSet(exports.DISCRETE_DOMAIN_SCALES);\nvar BIN_SCALES_INDEX = vega_util_1.toSet(['bin-linear', 'bin-ordinal']);\nexports.TIME_SCALE_TYPES = ['time', 'utc'];\nfunction hasDiscreteDomain(type) {\n return type in DISCRETE_DOMAIN_INDEX;\n}\nexports.hasDiscreteDomain = hasDiscreteDomain;\nfunction isBinScale(type) {\n return type in BIN_SCALES_INDEX;\n}\nexports.isBinScale = isBinScale;\nfunction hasContinuousDomain(type) {\n return type in CONTINUOUS_DOMAIN_INDEX;\n}\nexports.hasContinuousDomain = hasContinuousDomain;\nfunction isContinuousToContinuous(type) {\n return type in CONTINUOUS_TO_CONTINUOUS_INDEX;\n}\nexports.isContinuousToContinuous = isContinuousToContinuous;\nexports.defaultScaleConfig = {\n textXRangeStep: 90,\n rangeStep: 21,\n pointPadding: 0.5,\n bandPaddingInner: 0.1,\n facetSpacing: 16,\n minBandSize: 2,\n minFontSize: 8,\n maxFontSize: 40,\n minOpacity: 0.3,\n maxOpacity: 0.8,\n // FIXME: revise if these *can* become ratios of rangeStep\n minSize: 9,\n minStrokeWidth: 1,\n maxStrokeWidth: 4\n};\nfunction isExtendedScheme(scheme) {\n return scheme && !!scheme['name'];\n}\nexports.isExtendedScheme = isExtendedScheme;\nfunction isSelectionDomain(domain) {\n return domain && domain['selection'];\n}\nexports.isSelectionDomain = isSelectionDomain;\nvar SCALE_PROPERTY_INDEX = {\n type: 1,\n domain: 1,\n range: 1,\n rangeStep: 1,\n scheme: 1,\n // Other properties\n reverse: 1,\n round: 1,\n // quantitative / time\n clamp: 1,\n nice: 1,\n // quantitative\n base: 1,\n exponent: 1,\n interpolate: 1,\n zero: 1,\n // band/point\n padding: 1,\n paddingInner: 1,\n paddingOuter: 1\n};\nexports.SCALE_PROPERTIES = util_1.flagKeys(SCALE_PROPERTY_INDEX);\nvar type = SCALE_PROPERTY_INDEX.type, domain = SCALE_PROPERTY_INDEX.domain, range = SCALE_PROPERTY_INDEX.range, rangeStep = SCALE_PROPERTY_INDEX.rangeStep, scheme = SCALE_PROPERTY_INDEX.scheme, NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTY_INDEX = tslib_1.__rest(SCALE_PROPERTY_INDEX, [\"type\", \"domain\", \"range\", \"rangeStep\", \"scheme\"]);\nexports.NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTIES = util_1.flagKeys(NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTY_INDEX);\nfunction scaleTypeSupportProperty(scaleType, propName) {\n switch (propName) {\n case 'type':\n case 'domain':\n case 'reverse':\n case 'range':\n return true;\n case 'scheme':\n return util_1.contains(['sequential', 'ordinal', 'bin-ordinal', 'quantile', 'quantize'], scaleType);\n case 'interpolate':\n // FIXME(https://github.com/vega/vega-lite/issues/2902) how about ordinal?\n return util_1.contains(['linear', 'bin-linear', 'pow', 'log', 'sqrt', 'utc', 'time'], scaleType);\n case 'round':\n return isContinuousToContinuous(scaleType) || scaleType === 'band' || scaleType === 'point';\n case 'padding':\n return isContinuousToContinuous(scaleType) || util_1.contains(['point', 'band'], scaleType);\n case 'paddingOuter':\n case 'rangeStep':\n return util_1.contains(['point', 'band'], scaleType);\n case 'paddingInner':\n return scaleType === 'band';\n case 'clamp':\n return isContinuousToContinuous(scaleType) || scaleType === 'sequential';\n case 'nice':\n return isContinuousToContinuous(scaleType) || scaleType === 'sequential' || scaleType === 'quantize';\n case 'exponent':\n return scaleType === 'pow';\n case 'base':\n return scaleType === 'log';\n case 'zero':\n return hasContinuousDomain(scaleType) && !util_1.contains([\n 'log',\n 'time', 'utc',\n 'bin-linear',\n 'threshold',\n 'quantile' // quantile depends on distribution so zero does not matter\n ], scaleType);\n }\n /* istanbul ignore next: should never reach here*/\n throw new Error(\"Invalid scale property \" + propName + \".\");\n}\nexports.scaleTypeSupportProperty = scaleTypeSupportProperty;\n/**\n * Returns undefined if the input channel supports the input scale property name\n */\nfunction channelScalePropertyIncompatability(channel, propName) {\n switch (propName) {\n case 'interpolate':\n case 'scheme':\n if (!channel_1.isColorChannel(channel)) {\n return log.message.cannotUseScalePropertyWithNonColor(channel);\n }\n return undefined;\n case 'type':\n case 'domain':\n case 'range':\n case 'base':\n case 'exponent':\n case 'nice':\n case 'padding':\n case 'paddingInner':\n case 'paddingOuter':\n case 'rangeStep':\n case 'reverse':\n case 'round':\n case 'clamp':\n case 'zero':\n return undefined; // GOOD!\n }\n /* istanbul ignore next: it should never reach here */\n throw new Error(\"Invalid scale property \\\"\" + propName + \"\\\".\");\n}\nexports.channelScalePropertyIncompatability = channelScalePropertyIncompatability;\nfunction channelSupportScaleType(channel, scaleType) {\n switch (channel) {\n case channel_1.Channel.X:\n case channel_1.Channel.Y:\n case channel_1.Channel.SIZE: // TODO: size and opacity can support ordinal with more modification\n case channel_1.Channel.OPACITY:\n // Although it generally doesn't make sense to use band with size and opacity,\n // it can also work since we use band: 0.5 to get midpoint.\n return isContinuousToContinuous(scaleType) || util_1.contains(['band', 'point'], scaleType);\n case channel_1.Channel.COLOR:\n case channel_1.Channel.FILL:\n case channel_1.Channel.STROKE:\n return scaleType !== 'band'; // band does not make sense with color\n case channel_1.Channel.SHAPE:\n return scaleType === 'ordinal'; // shape = lookup only\n }\n /* istanbul ignore next: it should never reach here */\n return false;\n}\nexports.channelSupportScaleType = channelSupportScaleType;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NhbGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2NhbGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsdUNBQWdDO0FBQ2hDLHFDQUFrRDtBQUVsRCwyQkFBNkI7QUFDN0IsK0JBQXNEO0FBR3RELElBQWlCLFNBQVMsQ0FzQnpCO0FBdEJELFdBQWlCLFNBQVM7SUFDeEIsNEJBQTRCO0lBQ2YsZ0JBQU0sR0FBYSxRQUFRLENBQUM7SUFDNUIsb0JBQVUsR0FBaUIsWUFBWSxDQUFDO0lBQ3hDLGFBQUcsR0FBVSxLQUFLLENBQUM7SUFDbkIsYUFBRyxHQUFVLEtBQUssQ0FBQztJQUNuQixjQ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vKiBpc3RhbmJ1bCBpZ25vcmUgbmV4dDogaXQgc2hvdWxkIG5ldmVyIHJlYWNoIGhlcmUgKi9cbiAgcmV0dXJuIGZhbHNlO1xufVxuIl19","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar tslib_1 = require(\"tslib\");\nvar util_1 = require(\"./util\");\nexports.defaultLegendConfig = {};\nvar COMMON_LEGEND_PROPERTY_INDEX = {\n entryPadding: 1,\n format: 1,\n offset: 1,\n orient: 1,\n padding: 1,\n tickCount: 1,\n title: 1,\n type: 1,\n values: 1,\n zindex: 1\n};\nvar VG_LEGEND_PROPERTY_INDEX = tslib_1.__assign({}, COMMON_LEGEND_PROPERTY_INDEX, { \n // channel scales\n opacity: 1, shape: 1, stroke: 1, fill: 1, size: 1, \n // encode\n encode: 1 });\nexports.LEGEND_PROPERTIES = util_1.flagKeys(COMMON_LEGEND_PROPERTY_INDEX);\nexports.VG_LEGEND_PROPERTIES = util_1.flagKeys(VG_LEGEND_PROPERTY_INDEX);\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGVnZW5kLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2xlZ2VuZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFFQSwrQkFBc0M7QUF3RXpCLFFBQUEsbUJBQW1CLEdBQWlCLEVBQUUsQ0FBQztBQUVwRCxJQUFNLDRCQUE0QixHQUFvQztJQUNwRSxZQUFZLEVBQUUsQ0FBQztJQUNmLE1BQU0sRUFBRSxDQUFDO0lBQ1QsTUFBTSxFQUFFLENBQUM7SUFDVCxNQUFNLEVBQUUsQ0FBQztJQUNULE9BQU8sRUFBRSxDQUFDO0lBQ1YsU0FBUyxFQUFFLENBQUM7SUFDWixLQUFLLEVBQUUsQ0FBQztJQUNSLElBQUksRUFBRSxDQUFDO0lBQ1AsTUFBTSxFQUFFLENBQUM7SUFDVCxNQ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nZW5kKT4gPSB7XG4gIGVudHJ5UGFkZGluZzogMSxcbiAgZm9ybWF0OiAxLFxuICBvZmZzZXQ6IDEsXG4gIG9yaWVudDogMSxcbiAgcGFkZGluZzogMSxcbiAgdGlja0NvdW50OiAxLFxuICB0aXRsZTogMSxcbiAgdHlwZTogMSxcbiAgdmFsdWVzOiAxLFxuICB6aW5kZXg6IDFcbn07XG5cbmNvbnN0IFZHX0xFR0VORF9QUk9QRVJUWV9JTkRFWDogRmxhZzxrZXlvZiBWZ0xlZ2VuZD4gPSB7XG4gIC4uLkNPTU1PTl9MRUdFTkRfUFJPUEVSVFlfSU5ERVgsXG4gIC8vIGNoYW5uZWwgc2NhbGVzXG4gIG9wYWNpdHk6IDEsXG4gIHNoYXBlOiAxLFxuICBzdHJva2U6IDEsXG4gIGZpbGw6IDEsXG4gIHNpemU6IDEsXG4gIC8vIGVuY29kZVxuICBlbmNvZGU6IDFcbn07XG5cbmV4cG9ydCBjb25zdCBMRUdFTkRfUFJPUEVSVElFUyA9IGZsYWdLZXlzKENPTU1PTl9MRUdFTkRfUFJPUEVSVFlfSU5ERVgpO1xuXG5leHBvcnQgY29uc3QgVkdfTEVHRU5EX1BST1BFUlRJRVMgPSBmbGFnS2V5cyhWR19MRUdFTkRfUFJPUEVSVFlfSU5ERVgpO1xuIl19","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar axis_1 = require(\"vega-lite/build/src/axis\");\nvar scale_1 = require(\"vega-lite/build/src/scale\");\nvar legend_1 = require(\"vega-lite/build/src/legend\");\nvar util_1 = require(\"vega-lite/build/src/util\");\nfunction isEncodingNestedProp(p) {\n return !!p['parent'];\n}\nexports.isEncodingNestedProp = isEncodingNestedProp;\nvar ENCODING_TOPLEVEL_PROP_INDEX = {\n channel: 1,\n aggregate: 1, autoCount: 1, bin: 1, timeUnit: 1, hasFn: 1,\n sort: 1, stack: 1,\n field: 1, type: 1,\n format: 1, scale: 1, axis: 1, legend: 1,\n value: 1\n};\nexports.ENCODING_TOPLEVEL_PROPS = util_1.flagKeys(ENCODING_TOPLEVEL_PROP_INDEX);\nfunction isEncodingTopLevelProperty(p) {\n return p in ENCODING_TOPLEVEL_PROP_INDEX;\n}\nexports.isEncodingTopLevelProperty = isEncodingTopLevelProperty;\nvar ENCODING_NESTED_PROP_PARENT_INDEX = {\n bin: 1,\n scale: 1,\n sort: 1,\n axis: 1,\n legend: 1\n};\nfunction isEncodingNestedParent(prop) {\n return ENCODING_NESTED_PROP_PARENT_INDEX[prop];\n}\nexports.isEncodingNestedParent = isEncodingNestedParent;\n// FIXME -- we should not have to manually specify these\nexports.BIN_CHILD_PROPS = ['maxbins', 'divide', 'extent', 'base', 'step', 'steps', 'minstep'];\nexports.SORT_CHILD_PROPS = ['field', 'op', 'order'];\nvar BIN_PROPS = exports.BIN_CHILD_PROPS.map(function (c) {\n return { parent: 'bin', child: c };\n});\nexports.SORT_PROPS = exports.SORT_CHILD_PROPS.map(function (c) {\n return { parent: 'sort', child: c };\n});\nexports.SCALE_PROPS = scale_1.SCALE_PROPERTIES.map(function (c) {\n return { parent: 'scale', child: c };\n});\nvar AXIS_PROPS = axis_1.AXIS_PROPERTIES.map(function (c) {\n return { parent: 'axis', child: c };\n});\nvar LEGEND_PROPS = legend_1.LEGEND_PROPERTIES.map(function (c) {\n return { parent: 'legend', child: c };\n});\nexports.ENCODING_NESTED_PROPS = [].concat(BIN_PROPS, exports.SORT_PROPS, exports.SCALE_PROPS, AXIS_PROPS, LEGEND_PROPS);\nexports.VIEW_PROPS = ['width', 'height', 'background', 'padding', 'title'];\nvar PROP_KEY_DELIMITER = '.';\nfunction toKey(p) {\n if (isEncodingNestedProp(p)) {\n return p.parent + PROP_KEY_DELIMITER + p.child;\n }\n return p;\n}\nexports.toKey = toKey;\nfunction fromKey(k) {\n var split = k.split(PROP_KEY_DELIMITER);\n /* istanbul ignore else */\n if (split.length === 1) {\n return k;\n }\n else if (split.length === 2) {\n return {\n parent: split[0],\n child: split[1]\n };\n }\n else {\n throw 'Invalid property key with ' + split.length + ' dots: ' + k;\n }\n}\nexports.fromKey = fromKey;\nvar ENCODING_NESTED_PROP_INDEX = exports.ENCODING_NESTED_PROPS.reduce(function (i, prop) {\n i[prop.parent] = i[prop.parent] || [];\n i[prop.parent][prop.child] = prop;\n return i;\n}, {});\n// FIXME consider using a more general method\nfunction getEncodingNestedProp(parent, child) {\n return (ENCODING_NESTED_PROP_INDEX[parent] || {})[child];\n}\nexports.getEncodingNestedProp = getEncodingNestedProp;\nfunction isEncodingProperty(p) {\n return isEncodingTopLevelProperty(p) || isEncodingNestedProp(p);\n}\nexports.isEncodingProperty = isEncodingProperty;\nexports.ALL_ENCODING_PROPS = [].concat(exports.ENCODING_TOPLEVEL_PROPS, exports.ENCODING_NESTED_PROPS);\nexports.DEFAULT_PROP_PRECEDENCE = [\n 'type',\n 'field',\n // Field Transform\n 'bin', 'timeUnit', 'aggregate', 'autoCount',\n // Encoding\n 'channel',\n // Mark\n 'mark', 'stack',\n 'scale', 'sort',\n 'axis', 'legend',\n].concat(BIN_PROPS, exports.SCALE_PROPS, AXIS_PROPS, LEGEND_PROPS, exports.SORT_PROPS);\nvar Property;\n(function (Property) {\n Property.MARK = 'mark';\n Property.TRANSFORM = 'transform';\n // Layout\n Property.STACK = 'stack';\n Property.FORMAT = 'format';\n // TODO: sub parts of stack\n // Encoding Properties\n Property.CHANNEL = 'channel';\n Property.AGGREGATE = 'aggregate';\n Property.AUTOCOUNT = 'autoCount';\n Property.BIN = 'bin';\n Property.HAS_FN = 'hasFn';\n Property.TIMEUNIT = 'timeUnit';\n Property.FIELD = 'field';\n Property.TYPE = 'type';\n Property.SORT = 'sort';\n Property.SCALE = 'scale';\n Property.AXIS = 'axis';\n Property.LEGEND = 'legend';\n Property.WIDTH = 'width';\n Property.HEIGHT = 'height';\n Property.BACKGROUND = 'background';\n Property.PADDING = 'padding';\n Property.TITLE = 'title';\n})(Property = exports.Property || (exports.Property = {}));\n//# sourceMappingURL=property.js.map","var u = module.exports;\n\n// utility functions\n\nvar FNAME = '__name__';\n\nu.namedfunc = function(name, f) { return (f[FNAME] = name, f); };\n\nu.name = function(f) { return f==null ? null : f[FNAME]; };\n\nu.identity = function(x) { return x; };\n\nu.true = u.namedfunc('true', function() { return true; });\n\nu.false = u.namedfunc('false', function() { return false; });\n\nu.duplicate = function(obj) {\n return JSON.parse(JSON.stringify(obj));\n};\n\nu.equal = function(a, b) {\n return JSON.stringify(a) === JSON.stringify(b);\n};\n\nu.extend = function(obj) {\n for (var x, name, i=1, len=arguments.length; i 1 ?\n function(x, v) {\n for (var i=0; i b || b == null) && a != null ? 1 :\n ((b = b instanceof Date ? +b : b),\n (a = a instanceof Date ? +a : a)) !== a && b === b ? -1 :\n b !== b && a === a ? 1 : 0;\n};\n\nu.numcmp = function(a, b) { return a - b; };\n\nu.stablesort = function(array, sortBy, keyFn) {\n var indices = array.reduce(function(idx, v, i) {\n return (idx[keyFn(v)] = i, idx);\n }, {});\n\n array.sort(function(a, b) {\n var sa = sortBy(a),\n sb = sortBy(b);\n return sa < sb ? -1 : sa > sb ? 1\n : (indices[keyFn(a)] - indices[keyFn(b)]);\n });\n\n return array;\n};\n\n// permutes an array using a Knuth shuffle\nu.permute = function(a) {\n var m = a.length,\n swap,\n i;\n\n while (m) {\n i = Math.floor(Math.random() * m--);\n swap = a[m];\n a[m] = a[i];\n a[i] = swap;\n }\n};\n\n// string functions\n\nu.pad = function(s, length, pos, padchar) {\n padchar = padchar || \" \";\n var d = length - s.length;\n if (d <= 0) return s;\n switch (pos) {\n case 'left':\n return strrep(d, padchar) + s;\n case 'middle':\n case 'center':\n return strrep(Math.floor(d/2), padchar) +\n s + strrep(Math.ceil(d/2), padchar);\n default:\n return s + strrep(d, padchar);\n }\n};\n\nfunction strrep(n, str) {\n var s = \"\", i;\n for (i=0; i 4) {\n log.warn(log.message.invalidTimeUnit('quarter', q));\n }\n // We accept 1-based quarter, so need to readjust to 0-based quarter\n return (q - 1) + '';\n }\n else {\n // Invalid quarter\n throw new Error(log.message.invalidTimeUnit('quarter', q));\n }\n}\nfunction normalizeMonth(m) {\n if (vega_util_1.isNumber(m)) {\n // We accept 1-based month, so need to readjust to 0-based month\n return (m - 1) + '';\n }\n else {\n var lowerM = m.toLowerCase();\n var monthIndex = exports.MONTHS.indexOf(lowerM);\n if (monthIndex !== -1) {\n return monthIndex + ''; // 0 for january, ...\n }\n var shortM = lowerM.substr(0, 3);\n var shortMonthIndex = exports.SHORT_MONTHS.indexOf(shortM);\n if (shortMonthIndex !== -1) {\n return shortMonthIndex + '';\n }\n // Invalid month\n throw new Error(log.message.invalidTimeUnit('month', m));\n }\n}\nfunction normalizeDay(d) {\n if (vega_util_1.isNumber(d)) {\n // mod so that this can be both 0-based where 0 = sunday\n // and 1-based where 7=sunday\n return (d % 7) + '';\n }\n else {\n var lowerD = d.toLowerCase();\n var dayIndex = exports.DAYS.indexOf(lowerD);\n if (dayIndex !== -1) {\n return dayIndex + ''; // 0 for january, ...\n }\n var shortD = lowerD.substr(0, 3);\n var shortDayIndex = exports.SHORT_DAYS.indexOf(shortD);\n if (shortDayIndex !== -1) {\n return shortDayIndex + '';\n }\n // Invalid day\n throw new Error(log.message.invalidTimeUnit('day', d));\n }\n}\n/**\n * Return Vega Expression for a particular date time.\n * @param d\n * @param normalize whether to normalize quarter, month, day.\n */\nfunction dateTimeExpr(d, normalize) {\n if (normalize === void 0) { normalize = false; }\n var units = [];\n if (normalize && d.day !== undefined) {\n if (util_1.keys(d).length > 1) {\n log.warn(log.message.droppedDay(d));\n d = util_1.duplicate(d);\n delete d.day;\n }\n }\n if (d.year !== undefined) {\n units.push(d.year);\n }\n else if (d.day !== undefined) {\n // Set year to 2006 for working with day since January 1 2006 is a Sunday\n units.push(SUNDAY_YEAR);\n }\n else {\n units.push(0);\n }\n if (d.month !== undefined) {\n var month = normalize ? normalizeMonth(d.month) : d.month;\n units.push(month);\n }\n else if (d.quarter !== undefined) {\n var quarter = normalize ? normalizeQuarter(d.quarter) : d.quarter;\n units.push(quarter + '*3');\n }\n else {\n units.push(0); // months start at zero in JS\n }\n if (d.date !== undefined) {\n units.push(d.date);\n }\n else if (d.day !== undefined) {\n // HACK: Day only works as a standalone unit\n // This is only correct because we always set year to 2006 for day\n var day = normalize ? normalizeDay(d.day) : d.day;\n units.push(day + '+1');\n }\n else {\n units.push(1); // Date starts at 1 in JS\n }\n // Note: can't use TimeUnit enum here as importing it will create\n // circular dependency problem!\n for (var _i = 0, _a = ['hours', 'minutes', 'seconds', 'milliseconds']; _i < _a.length; _i++) {\n var timeUnit = _a[_i];\n if (d[timeUnit] !== undefined) {\n units.push(d[timeUnit]);\n }\n else {\n units.push(0);\n }\n }\n if (d.utc) {\n return \"utc(\" + units.join(', ') + \")\";\n }\n else {\n return \"datetime(\" + units.join(', ') + \")\";\n }\n}\nexports.dateTimeExpr = dateTimeExpr;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZXRpbWUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZGF0ZXRpbWUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLDZCQUE2Qjs7QUFFN0IsdUNBQW1DO0FBQ25DLDJCQUE2QjtBQUM3QiwrQkFBdUM7QUFHdkM7O0dBRUc7QUFDSCxJQUFNLFdBQVcsR0FBRyxJQUFJLENBQUM7QUE4R3pCLG9CQUEyQixDQUFNO0lBQy9CLE9BQU8sQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsSUFBSSxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsT0FBTyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsS0FBSyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsSUFBSSxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsR0FBRztRQUN4RSxDQUFDLENBQUMsQ0FBQy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biAgICB1bml0cy5wdXNoKGQuZGF0ZSk7XG4gIH0gZWxzZSBpZiAoZC5kYXkgIT09IHVuZGVmaW5lZCkge1xuICAgIC8vIEhBQ0s6IERheSBvbmx5IHdvcmtzIGFzIGEgc3RhbmRhbG9uZSB1bml0XG4gICAgLy8gVGhpcyBpcyBvbmx5IGNvcnJlY3QgYmVjYXVzZSB3ZSBhbHdheXMgc2V0IHllYXIgdG8gMjAwNiBmb3IgZGF5XG4gICAgY29uc3QgZGF5ID0gbm9ybWFsaXplID8gbm9ybWFsaXplRGF5KGQuZGF5KSA6IGQuZGF5O1xuICAgIHVuaXRzLnB1c2goZGF5ICsgJysxJyk7XG4gIH0gZWxzZSB7XG4gICAgdW5pdHMucHVzaCgxKTsgLy8gRGF0ZSBzdGFydHMgYXQgMSBpbiBKU1xuICB9XG5cbiAgLy8gTm90ZTogY2FuJ3QgdXNlIFRpbWVVbml0IGVudW0gaGVyZSBhcyBpbXBvcnRpbmcgaXQgd2lsbCBjcmVhdGVcbiAgLy8gY2lyY3VsYXIgZGVwZW5kZW5jeSBwcm9ibGVtIVxuICBmb3IgKGNvbnN0IHRpbWVVbml0IG9mIFsnaG91cnMnLCAnbWludXRlcycsICdzZWNvbmRzJywgJ21pbGxpc2Vjb25kcyddKSB7XG4gICAgaWYgKGRbdGltZVVuaXRdICE9PSB1bmRlZmluZWQpIHtcbiAgICAgIHVuaXRzLnB1c2goZFt0aW1lVW5pdF0pO1xuICAgIH0gZWxzZSB7XG4gICAgICB1bml0cy5wdXNoKDApO1xuICAgIH1cbiAgfVxuXG4gIGlmIChkLnV0Yykge1xuICAgIHJldHVybiBgdXRjKCR7dW5pdHMuam9pbignLCAnKX0pYDtcbiAgfSBlbHNlIHtcbiAgICByZXR1cm4gYGRhdGV0aW1lKCR7dW5pdHMuam9pbignLCAnKX0pYDtcbiAgfVxufVxuIl19","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar tslib_1 = require(\"tslib\");\nvar datetime_1 = require(\"./datetime\");\nvar log = require(\"./log\");\nvar util_1 = require(\"./util\");\nvar TimeUnit;\n(function (TimeUnit) {\n TimeUnit.YEAR = 'year';\n TimeUnit.MONTH = 'month';\n TimeUnit.DAY = 'day';\n TimeUnit.DATE = 'date';\n TimeUnit.HOURS = 'hours';\n TimeUnit.MINUTES = 'minutes';\n TimeUnit.SECONDS = 'seconds';\n TimeUnit.MILLISECONDS = 'milliseconds';\n TimeUnit.YEARMONTH = 'yearmonth';\n TimeUnit.YEARMONTHDATE = 'yearmonthdate';\n TimeUnit.YEARMONTHDATEHOURS = 'yearmonthdatehours';\n TimeUnit.YEARMONTHDATEHOURSMINUTES = 'yearmonthdatehoursminutes';\n TimeUnit.YEARMONTHDATEHOURSMINUTESSECONDS = 'yearmonthdatehoursminutesseconds';\n // MONTHDATE always include 29 February since we use year 0th (which is a leap year);\n TimeUnit.MONTHDATE = 'monthdate';\n TimeUnit.HOURSMINUTES = 'hoursminutes';\n TimeUnit.HOURSMINUTESSECONDS = 'hoursminutesseconds';\n TimeUnit.MINUTESSECONDS = 'minutesseconds';\n TimeUnit.SECONDSMILLISECONDS = 'secondsmilliseconds';\n TimeUnit.QUARTER = 'quarter';\n TimeUnit.YEARQUARTER = 'yearquarter';\n TimeUnit.QUARTERMONTH = 'quartermonth';\n TimeUnit.YEARQUARTERMONTH = 'yearquartermonth';\n TimeUnit.UTCYEAR = 'utcyear';\n TimeUnit.UTCMONTH = 'utcmonth';\n TimeUnit.UTCDAY = 'utcday';\n TimeUnit.UTCDATE = 'utcdate';\n TimeUnit.UTCHOURS = 'utchours';\n TimeUnit.UTCMINUTES = 'utcminutes';\n TimeUnit.UTCSECONDS = 'utcseconds';\n TimeUnit.UTCMILLISECONDS = 'utcmilliseconds';\n TimeUnit.UTCYEARMONTH = 'utcyearmonth';\n TimeUnit.UTCYEARMONTHDATE = 'utcyearmonthdate';\n TimeUnit.UTCYEARMONTHDATEHOURS = 'utcyearmonthdatehours';\n TimeUnit.UTCYEARMONTHDATEHOURSMINUTES = 'utcyearmonthdatehoursminutes';\n TimeUnit.UTCYEARMONTHDATEHOURSMINUTESSECONDS = 'utcyearmonthdatehoursminutesseconds';\n // MONTHDATE always include 29 February since we use year 0th (which is a leap year);\n TimeUnit.UTCMONTHDATE = 'utcmonthdate';\n TimeUnit.UTCHOURSMINUTES = 'utchoursminutes';\n TimeUnit.UTCHOURSMINUTESSECONDS = 'utchoursminutesseconds';\n TimeUnit.UTCMINUTESSECONDS = 'utcminutesseconds';\n TimeUnit.UTCSECONDSMILLISECONDS = 'utcsecondsmilliseconds';\n TimeUnit.UTCQUARTER = 'utcquarter';\n TimeUnit.UTCYEARQUARTER = 'utcyearquarter';\n TimeUnit.UTCQUARTERMONTH = 'utcquartermonth';\n TimeUnit.UTCYEARQUARTERMONTH = 'utcyearquartermonth';\n})(TimeUnit = exports.TimeUnit || (exports.TimeUnit = {}));\n/** Time Unit that only corresponds to only one part of Date objects. */\nvar LOCAL_SINGLE_TIMEUNIT_INDEX = {\n year: 1,\n quarter: 1,\n month: 1,\n day: 1,\n date: 1,\n hours: 1,\n minutes: 1,\n seconds: 1,\n milliseconds: 1\n};\nexports.TIMEUNIT_PARTS = util_1.flagKeys(LOCAL_SINGLE_TIMEUNIT_INDEX);\nfunction isLocalSingleTimeUnit(timeUnit) {\n return !!LOCAL_SINGLE_TIMEUNIT_INDEX[timeUnit];\n}\nexports.isLocalSingleTimeUnit = isLocalSingleTimeUnit;\nvar UTC_SINGLE_TIMEUNIT_INDEX = {\n utcyear: 1,\n utcquarter: 1,\n utcmonth: 1,\n utcday: 1,\n utcdate: 1,\n utchours: 1,\n utcminutes: 1,\n utcseconds: 1,\n utcmilliseconds: 1\n};\nfunction isUtcSingleTimeUnit(timeUnit) {\n return !!UTC_SINGLE_TIMEUNIT_INDEX[timeUnit];\n}\nexports.isUtcSingleTimeUnit = isUtcSingleTimeUnit;\nvar LOCAL_MULTI_TIMEUNIT_INDEX = {\n yearquarter: 1,\n yearquartermonth: 1,\n yearmonth: 1,\n yearmonthdate: 1,\n yearmonthdatehours: 1,\n yearmonthdatehoursminutes: 1,\n yearmonthdatehoursminutesseconds: 1,\n quartermonth: 1,\n monthdate: 1,\n hoursminutes: 1,\n hoursminutesseconds: 1,\n minutesseconds: 1,\n secondsmilliseconds: 1\n};\nvar UTC_MULTI_TIMEUNIT_INDEX = {\n utcyearquarter: 1,\n utcyearquartermonth: 1,\n utcyearmonth: 1,\n utcyearmonthdate: 1,\n utcyearmonthdatehours: 1,\n utcyearmonthdatehoursminutes: 1,\n utcyearmonthdatehoursminutesseconds: 1,\n utcquartermonth: 1,\n utcmonthdate: 1,\n utchoursminutes: 1,\n utchoursminutesseconds: 1,\n utcminutesseconds: 1,\n utcsecondsmilliseconds: 1\n};\nvar UTC_TIMEUNIT_INDEX = tslib_1.__assign({}, UTC_SINGLE_TIMEUNIT_INDEX, UTC_MULTI_TIMEUNIT_INDEX);\nfunction isUTCTimeUnit(t) {\n return !!UTC_TIMEUNIT_INDEX[t];\n}\nexports.isUTCTimeUnit = isUTCTimeUnit;\nfunction getLocalTimeUnit(t) {\n return t.substr(3);\n}\nexports.getLocalTimeUnit = getLocalTimeUnit;\nvar TIMEUNIT_INDEX = tslib_1.__assign({}, LOCAL_SINGLE_TIMEUNIT_INDEX, UTC_SINGLE_TIMEUNIT_INDEX, LOCAL_MULTI_TIMEUNIT_INDEX, UTC_MULTI_TIMEUNIT_INDEX);\nexports.TIMEUNITS = util_1.flagKeys(TIMEUNIT_INDEX);\nfunction isTimeUnit(t) {\n return !!TIMEUNIT_INDEX[t];\n}\nexports.isTimeUnit = isTimeUnit;\nvar SET_DATE_METHOD = {\n year: 'setFullYear',\n month: 'setMonth',\n date: 'setDate',\n hours: 'setHours',\n minutes: 'setMinutes',\n seconds: 'setSeconds',\n milliseconds: 'setMilliseconds',\n // Day and quarter have their own special cases\n quarter: null,\n day: null,\n};\n/**\n * Converts a date to only have the measurements relevant to the specified unit\n * i.e. ('yearmonth', '2000-12-04 07:58:14') -> '2000-12-01 00:00:00'\n * Note: the base date is Jan 01 1900 00:00:00\n */\nfunction convert(unit, date) {\n var isUTC = isUTCTimeUnit(unit);\n var result = isUTC ?\n // start with uniform date\n new Date(Date.UTC(0, 0, 1, 0, 0, 0, 0)) :\n new Date(0, 0, 1, 0, 0, 0, 0);\n for (var _i = 0, TIMEUNIT_PARTS_1 = exports.TIMEUNIT_PARTS; _i < TIMEUNIT_PARTS_1.length; _i++) {\n var timeUnitPart = TIMEUNIT_PARTS_1[_i];\n if (containsTimeUnit(unit, timeUnitPart)) {\n switch (timeUnitPart) {\n case TimeUnit.DAY:\n throw new Error('Cannot convert to TimeUnits containing \\'day\\'');\n case TimeUnit.QUARTER: {\n var _a = dateMethods('month', isUTC), getDateMethod_1 = _a.getDateMethod, setDateMethod_1 = _a.setDateMethod;\n // indicate quarter by setting month to be the first of the quarter i.e. may (4) -> april (3)\n result[setDateMethod_1]((Math.floor(date[getDateMethod_1]() / 3)) * 3);\n break;\n }\n default:\n var _b = dateMethods(timeUnitPart, isUTC), getDateMethod = _b.getDateMethod, setDateMethod = _b.setDateMethod;\n result[setDateMethod](date[getDateMethod]());\n }\n }\n }\n return result;\n}\nexports.convert = convert;\nfunction dateMethods(singleUnit, isUtc) {\n var rawSetDateMethod = SET_DATE_METHOD[singleUnit];\n var setDateMethod = isUtc ? 'setUTC' + rawSetDateMethod.substr(3) : rawSetDateMethod;\n var getDateMethod = 'get' + (isUtc ? 'UTC' : '') + rawSetDateMethod.substr(3);\n return { setDateMethod: setDateMethod, getDateMethod: getDateMethod };\n}\nfunction getTimeUnitParts(timeUnit) {\n return exports.TIMEUNIT_PARTS.reduce(function (parts, part) {\n if (containsTimeUnit(timeUnit, part)) {\n return parts.concat(part);\n }\n return parts;\n }, []);\n}\nexports.getTimeUnitParts = getTimeUnitParts;\n/** Returns true if fullTimeUnit contains the timeUnit, false otherwise. */\nfunction containsTimeUnit(fullTimeUnit, timeUnit) {\n var index = fullTimeUnit.indexOf(timeUnit);\n return index > -1 &&\n (timeUnit !== TimeUnit.SECONDS ||\n index === 0 ||\n fullTimeUnit.charAt(index - 1) !== 'i' // exclude milliseconds\n );\n}\nexports.containsTimeUnit = containsTimeUnit;\n/**\n * Returns Vega expresssion for a given timeUnit and fieldRef\n */\nfunction fieldExpr(fullTimeUnit, field) {\n var fieldRef = \"datum\" + util_1.accessPath(field);\n var utc = isUTCTimeUnit(fullTimeUnit) ? 'utc' : '';\n function func(timeUnit) {\n if (timeUnit === TimeUnit.QUARTER) {\n // quarter starting at 0 (0,3,6,9).\n return \"(\" + utc + \"quarter(\" + fieldRef + \")-1)\";\n }\n else {\n return \"\" + utc + timeUnit + \"(\" + fieldRef + \")\";\n }\n }\n var d = exports.TIMEUNIT_PARTS.reduce(function (dateExpr, tu) {\n if (containsTimeUnit(fullTimeUnit, tu)) {\n dateExpr[tu] = func(tu);\n }\n return dateExpr;\n }, {});\n return datetime_1.dateTimeExpr(d);\n}\nexports.fieldExpr = fieldExpr;\n/**\n * returns the signal expression used for axis labels for a time unit\n */\nfunction formatExpression(timeUnit, field, shortTimeLabels, isUTCScale) {\n if (!timeUnit) {\n return undefined;\n }\n var dateComponents = [];\n var expression = '';\n var hasYear = containsTimeUnit(timeUnit, TimeUnit.YEAR);\n if (containsTimeUnit(timeUnit, TimeUnit.QUARTER)) {\n // special expression for quarter as prefix\n expression = \"'Q' + quarter(\" + field + \")\";\n }\n if (containsTimeUnit(timeUnit, TimeUnit.MONTH)) {\n // By default use short month name\n dateComponents.push(shortTimeLabels !== false ? '%b' : '%B');\n }\n if (containsTimeUnit(timeUnit, TimeUnit.DAY)) {\n dateComponents.push(shortTimeLabels ? '%a' : '%A');\n }\n else if (containsTimeUnit(timeUnit, TimeUnit.DATE)) {\n dateComponents.push('%d' + (hasYear ? ',' : '')); // add comma if there is year\n }\n if (hasYear) {\n dateComponents.push(shortTimeLabels ? '%y' : '%Y');\n }\n var timeComponents = [];\n if (containsTimeUnit(timeUnit, TimeUnit.HOURS)) {\n timeComponents.push('%H');\n }\n if (containsTimeUnit(timeUnit, TimeUnit.MINUTES)) {\n timeComponents.push('%M');\n }\n if (containsTimeUnit(timeUnit, TimeUnit.SECONDS)) {\n timeComponents.push('%S');\n }\n if (containsTimeUnit(timeUnit, TimeUnit.MILLISECONDS)) {\n timeComponents.push('%L');\n }\n var dateTimeComponents = [];\n if (dateComponents.length > 0) {\n dateTimeComponents.push(dateComponents.join(' '));\n }\n if (timeComponents.length > 0) {\n dateTimeComponents.push(timeComponents.join(':'));\n }\n if (dateTimeComponents.length > 0) {\n if (expression) {\n // Add space between quarter and main time format\n expression += \" + ' ' + \";\n }\n // We only use utcFormat for utc scale\n // For utc time units, the data is already converted as a part of timeUnit transform.\n // Thus, utc time units should use timeFormat to avoid shifting the time twice.\n if (isUTCScale) {\n expression += \"utcFormat(\" + field + \", '\" + dateTimeComponents.join(' ') + \"')\";\n }\n else {\n expression += \"timeFormat(\" + field + \", '\" + dateTimeComponents.join(' ') + \"')\";\n }\n }\n // If expression is still an empty string, return undefined instead.\n return expression || undefined;\n}\nexports.formatExpression = formatExpression;\nfunction normalizeTimeUnit(timeUnit) {\n if (timeUnit !== 'day' && timeUnit.indexOf('day') >= 0) {\n log.warn(log.message.dayReplacedWithDate(timeUnit));\n return timeUnit.replace('day', 'date');\n }\n return timeUnit;\n}\nexports.normalizeTimeUnit = normalizeTimeUnit;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGltZXVuaXQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdGltZXVuaXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsdUNBQXNEO0FBQ3RELDJCQUE2QjtBQUM3QiwrQkFBa0Q7QUFFbEQsSUFBaUIsUUFBUSxDQWlEeEI7QUFqREQsV0FBaUIsUUFBUTtJQUNWLGFBQUksR0FBVyxNQUFNLENBQUM7SUFDdEIsY0F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xuXG5leHBvcnQgZnVuY3Rpb24gbm9ybWFsaXplVGltZVVuaXQodGltZVVuaXQ6IFRpbWVVbml0KTogVGltZVVuaXQge1xuICBpZiAodGltZVVuaXQgIT09ICdkYXknICYmIHRpbWVVbml0LmluZGV4T2YoJ2RheScpID49IDApIHtcbiAgICBsb2cud2Fybihsb2cubWVzc2FnZS5kYXlSZXBsYWNlZFdpdGhEYXRlKHRpbWVVbml0KSk7XG4gICAgcmV0dXJuIHRpbWVVbml0LnJlcGxhY2UoJ2RheScsICdkYXRlJykgYXMgVGltZVVuaXQ7XG4gIH1cbiAgcmV0dXJuIHRpbWVVbml0O1xufVxuIl19","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/** Constants and utilities for data type */\n/** Data type based on level of measurement */\nvar Type;\n(function (Type) {\n Type.QUANTITATIVE = 'quantitative';\n Type.ORDINAL = 'ordinal';\n Type.TEMPORAL = 'temporal';\n Type.NOMINAL = 'nominal';\n Type.LATITUDE = 'latitude';\n Type.LONGITUDE = 'longitude';\n Type.GEOJSON = 'geojson';\n})(Type = exports.Type || (exports.Type = {}));\nvar TYPE_INDEX = {\n quantitative: 1,\n ordinal: 1,\n temporal: 1,\n nominal: 1,\n latitude: 1,\n longitude: 1,\n geojson: 1\n};\nfunction isType(t) {\n return !!TYPE_INDEX[t];\n}\nexports.isType = isType;\nexports.QUANTITATIVE = Type.QUANTITATIVE;\nexports.ORDINAL = Type.ORDINAL;\nexports.TEMPORAL = Type.TEMPORAL;\nexports.NOMINAL = Type.NOMINAL;\nexports.GEOJSON = Type.GEOJSON;\n/**\n * Get full, lowercase type name for a given type.\n * @param type\n * @return Full type name.\n */\nfunction getFullName(type) {\n if (type) {\n type = type.toLowerCase();\n switch (type) {\n case 'q':\n case exports.QUANTITATIVE:\n return 'quantitative';\n case 't':\n case exports.TEMPORAL:\n return 'temporal';\n case 'o':\n case exports.ORDINAL:\n return 'ordinal';\n case 'n':\n case exports.NOMINAL:\n return 'nominal';\n case Type.LATITUDE:\n return 'latitude';\n case Type.LONGITUDE:\n return 'longitude';\n case exports.GEOJSON:\n return 'geojson';\n }\n }\n // If we get invalid input, return undefined type.\n return undefined;\n}\nexports.getFullName = getFullName;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90eXBlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQ0EsNENBQTRDO0FBQzVDLDhDQUE4QztBQUU5QyxJQUFpQixJQUFJLENBU3BCO0FBVEQsV0FBaUIsSUFBSTtJQUNOLGlCQUFZLEdBQW1CLGNBQWMsQ0FBQztJQUM5QyxZQUFPLEdBQWMsU0FBUyxDQUFDO0lBQy9CLGFBQVEsR0FBZSxVQUFVLENBQUM7SUFDbEMsWUFBTyxHQUFjLFNBQVMsQ0FBQztJQUUvQixhQUFRLEdBQWUsVUFBVSxDQUFDO0lBQ2xDLGNBQVMsR0FBZ0IsV0FBVyxDQUFDO0lBQ3JDLFlBQU8sR0FBYyxTQUFTLENBQUM7QUFDOUMsQ0FBQyxFQVRnQixJQUFJLEdBQUosWUFBSSxLQUFKLFlBQUksUUFTcEI7QUFNRCxJQUFNLFVBQVUsR0FBZTtJQUM3QixZQUFZLEVBQUUsQ0FBQztJQUNmLE9BQU8sRUFBRSxDQUFDO0lBQ1YsUUFBUSxFQUFFLENBQUM7SUFDWCxPQUFPLEVBQUUsQ0FBQztJQUNWLFFBQVEsRUFBRSxDQUFDO0lBQ1gsU0FBUyxFQUFFLENBQUM7SUFDWixPQUFPLEVBQUUsQ0FBQztDQUNYLENBQUM7QUFFRixnQkFBdUIsQ0FBTTtJQUMzQixPQUFPLENBQUMsQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDLENBQUM7QUFDekIsQ0FBQztBQUZELHdCQUVDO0FBRVksUUFBQSxZQUFZLEdBQUcsSUFBSSxD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uICAgICAgY2FzZSBOT01JTkFMOlxuICAgICAgICByZXR1cm4gJ25vbWluYWwnO1xuICAgICAgY2FzZSBUeXBlLkxBVElUVURFOlxuICAgICAgICByZXR1cm4gJ2xhdGl0dWRlJztcbiAgICAgIGNhc2UgVHlwZS5MT05HSVRVREU6XG4gICAgICAgIHJldHVybiAnbG9uZ2l0dWRlJztcbiAgICAgIGNhc2UgR0VPSlNPTjpcbiAgICAgICAgcmV0dXJuICdnZW9qc29uJztcbiAgICB9XG4gIH1cbiAgLy8gSWYgd2UgZ2V0IGludmFsaWQgaW5wdXQsIHJldHVybiB1bmRlZmluZWQgdHlwZS5cbiAgcmV0dXJuIHVuZGVmaW5lZDtcbn1cbiJdfQ==","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar property_1 = require(\"./property\");\nvar util_1 = require(\"./util\");\nvar axis_1 = require(\"vega-lite/build/src/axis\");\nvar channel_1 = require(\"vega-lite/build/src/channel\");\nvar mark_1 = require(\"vega-lite/build/src/mark\");\nvar scale_1 = require(\"vega-lite/build/src/scale\");\nvar legend_1 = require(\"vega-lite/build/src/legend\");\nvar timeunit_1 = require(\"vega-lite/build/src/timeunit\");\nvar type_1 = require(\"vega-lite/build/src/type\");\nexports.SHORT_WILDCARD = '?';\nfunction isWildcard(prop) {\n return isShortWildcard(prop) || isWildcardDef(prop);\n}\nexports.isWildcard = isWildcard;\nfunction isShortWildcard(prop) {\n return prop === exports.SHORT_WILDCARD;\n}\nexports.isShortWildcard = isShortWildcard;\nfunction isWildcardDef(prop) {\n return prop !== undefined && prop != null && (!!prop.enum || !!prop.name) && !util_1.isArray(prop);\n}\nexports.isWildcardDef = isWildcardDef;\nfunction initWildcard(prop, defaultName, defaultEnumValues) {\n return util_1.extend({}, {\n name: defaultName,\n enum: defaultEnumValues\n }, prop === exports.SHORT_WILDCARD ? {} : prop);\n}\nexports.initWildcard = initWildcard;\n/**\n * Initial short names from list of full camelCaseNames.\n * For each camelCaseNames, return unique short names based on initial (e.g., `ccn`)\n */\nfunction initNestedPropName(fullNames) {\n var index = {};\n var has = {};\n var _loop_1 = function (fullName) {\n var initialIndices = [0];\n for (var i = 0; i < fullName.length; i++) {\n if (fullName.charAt(i).toUpperCase() === fullName.charAt(i)) {\n initialIndices.push(i);\n }\n }\n var shortName = initialIndices.map(function (i) { return fullName.charAt(i); }).join('').toLowerCase();\n if (!has[shortName]) {\n index[fullName] = shortName;\n has[shortName] = true;\n return \"continue\";\n }\n // If duplicate, add last character and try again!\n if (initialIndices[initialIndices.length - 1] !== fullName.length - 1) {\n shortName = initialIndices.concat([fullName.length - 1]).map(function (i) { return fullName.charAt(i); }).join('').toLowerCase();\n if (!has[shortName]) {\n index[fullName] = shortName;\n has[shortName] = true;\n return \"continue\";\n }\n }\n for (var i = 1; !index[fullName]; i++) {\n var shortNameWithNo = shortName + '_' + i;\n if (!has[shortNameWithNo]) {\n index[fullName] = shortNameWithNo;\n has[shortNameWithNo] = true;\n break;\n }\n }\n };\n for (var _i = 0, fullNames_1 = fullNames; _i < fullNames_1.length; _i++) {\n var fullName = fullNames_1[_i];\n _loop_1(fullName);\n }\n return index;\n}\nexports.DEFAULT_NAME = {\n mark: 'm',\n channel: 'c',\n aggregate: 'a',\n autoCount: '#',\n hasFn: 'h',\n bin: 'b',\n sort: 'so',\n stack: 'st',\n scale: 's',\n format: 'f',\n axis: 'ax',\n legend: 'l',\n value: 'v',\n timeUnit: 'tu',\n field: 'f',\n type: 't',\n binProps: {\n maxbins: 'mb',\n min: 'mi',\n max: 'ma',\n base: 'b',\n step: 's',\n steps: 'ss',\n minstep: 'ms',\n divide: 'd'\n },\n sortProps: {\n field: 'f',\n op: 'o',\n order: 'or'\n },\n scaleProps: initNestedPropName(scale_1.SCALE_PROPERTIES),\n axisProps: initNestedPropName(axis_1.AXIS_PROPERTIES),\n legendProps: initNestedPropName(legend_1.LEGEND_PROPERTIES)\n};\nfunction getDefaultName(prop) {\n if (property_1.isEncodingNestedProp(prop)) {\n return exports.DEFAULT_NAME[prop.parent] + '-' + exports.DEFAULT_NAME[prop.parent + 'Props'][prop.child];\n }\n if (exports.DEFAULT_NAME[prop]) {\n return exports.DEFAULT_NAME[prop];\n }\n /* istanbul ignore next */\n throw new Error('Default name undefined for ' + prop);\n}\nexports.getDefaultName = getDefaultName;\nvar DEFAULT_BOOLEAN_ENUM = [false, true];\nvar DEFAULT_BIN_PROPS_ENUM = {\n maxbins: [5, 10, 20],\n extent: [undefined],\n base: [10],\n step: [undefined],\n steps: [undefined],\n minstep: [undefined],\n divide: [[5, 2]]\n};\nvar DEFAULT_SORT_PROPS = {\n field: [undefined],\n op: ['min', 'mean'],\n order: ['ascending', 'descending']\n};\nvar DEFAULT_SCALE_PROPS_ENUM = {\n type: [undefined, scale_1.ScaleType.LOG],\n domain: [undefined],\n base: [undefined],\n exponent: [1, 2],\n clamp: DEFAULT_BOOLEAN_ENUM,\n nice: DEFAULT_BOOLEAN_ENUM,\n reverse: DEFAULT_BOOLEAN_ENUM,\n round: DEFAULT_BOOLEAN_ENUM,\n zero: DEFAULT_BOOLEAN_ENUM,\n padding: [undefined],\n paddingInner: [undefined],\n paddingOuter: [undefined],\n interpolate: [undefined],\n range: [undefined],\n rangeStep: [17, 21],\n scheme: [undefined],\n};\nvar DEFAULT_AXIS_PROPS_ENUM = {\n zindex: [1, 0],\n offset: [undefined],\n orient: [undefined],\n values: [undefined],\n encoding: [undefined],\n domain: DEFAULT_BOOLEAN_ENUM,\n grid: DEFAULT_BOOLEAN_ENUM,\n format: [undefined],\n labels: DEFAULT_BOOLEAN_ENUM,\n labelAngle: [undefined],\n labelOverlap: [undefined],\n labelPadding: [undefined],\n labelBound: [undefined],\n labelFlush: [undefined],\n maxExtent: [undefined],\n minExtent: [undefined],\n position: [undefined],\n ticks: DEFAULT_BOOLEAN_ENUM,\n tickCount: [undefined],\n tickSize: [undefined],\n title: [undefined],\n titleMaxLength: [undefined],\n titlePadding: [undefined]\n};\nvar DEFAULT_LEGEND_PROPS_ENUM = {\n entryPadding: [undefined],\n orient: ['left', 'right'],\n offset: [undefined],\n padding: [undefined],\n format: [undefined],\n values: [undefined],\n tickCount: [undefined],\n title: [undefined],\n type: [undefined],\n zindex: [undefined]\n};\n// Use FullEnumIndex to make sure we have all properties specified here!\nexports.DEFAULT_ENUM_INDEX = {\n mark: [mark_1.Mark.POINT, mark_1.Mark.BAR, mark_1.Mark.LINE, mark_1.Mark.AREA, mark_1.Mark.RECT, mark_1.Mark.TICK, mark_1.Mark.TEXT],\n channel: [channel_1.X, channel_1.Y, channel_1.ROW, channel_1.COLUMN, channel_1.SIZE, channel_1.COLOR],\n aggregate: [undefined, 'mean'],\n autoCount: DEFAULT_BOOLEAN_ENUM,\n bin: DEFAULT_BOOLEAN_ENUM,\n hasFn: DEFAULT_BOOLEAN_ENUM,\n timeUnit: [undefined, timeunit_1.TimeUnit.YEAR, timeunit_1.TimeUnit.MONTH, timeunit_1.TimeUnit.MINUTES, timeunit_1.TimeUnit.SECONDS],\n field: [undefined],\n type: [type_1.Type.NOMINAL, type_1.Type.ORDINAL, type_1.Type.QUANTITATIVE, type_1.Type.TEMPORAL],\n sort: ['ascending', 'descending'],\n stack: ['zero', 'normalize', 'center', null],\n value: [undefined],\n format: [undefined],\n scale: [true],\n axis: DEFAULT_BOOLEAN_ENUM,\n legend: DEFAULT_BOOLEAN_ENUM,\n binProps: DEFAULT_BIN_PROPS_ENUM,\n sortProps: DEFAULT_SORT_PROPS,\n scaleProps: DEFAULT_SCALE_PROPS_ENUM,\n axisProps: DEFAULT_AXIS_PROPS_ENUM,\n legendProps: DEFAULT_LEGEND_PROPS_ENUM\n};\n// TODO: rename this to getDefaultEnum\nfunction getDefaultEnumValues(prop, schema, opt) {\n if (prop === 'field' || (property_1.isEncodingNestedProp(prop) && prop.parent === 'sort' && prop.child === 'field')) {\n // For field, by default enumerate all fields\n return schema.fieldNames();\n }\n var val;\n if (property_1.isEncodingNestedProp(prop)) {\n val = opt.enum[prop.parent + 'Props'][prop.child];\n }\n else {\n val = opt.enum[prop];\n }\n if (val !== undefined) {\n return val;\n }\n /* istanbul ignore next */\n throw new Error('No default enumValues for ' + JSON.stringify(prop));\n}\nexports.getDefaultEnumValues = getDefaultEnumValues;\n//# sourceMappingURL=wildcard.js.map","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar channel_1 = require(\"vega-lite/build/src/channel\");\nvar property_1 = require(\"./property\");\nvar wildcard_1 = require(\"./wildcard\");\nexports.DEFAULT_QUERY_CONFIG = {\n verbose: false,\n defaultSpecConfig: {\n line: { point: true },\n scale: { useUnaggregatedDomain: true }\n },\n propertyPrecedence: property_1.DEFAULT_PROP_PRECEDENCE.map(property_1.toKey),\n enum: wildcard_1.DEFAULT_ENUM_INDEX,\n numberNominalProportion: 0.05,\n numberNominalLimit: 40,\n // CONSTRAINTS\n constraintManuallySpecifiedValue: false,\n // Spec Constraints -- See description inside src/constraints/spec.ts\n autoAddCount: false,\n hasAppropriateGraphicTypeForMark: true,\n omitAggregate: false,\n omitAggregatePlotWithDimensionOnlyOnFacet: true,\n omitAggregatePlotWithoutDimension: false,\n omitBarLineAreaWithOcclusion: true,\n omitBarTickWithSize: true,\n omitMultipleNonPositionalChannels: true,\n omitRaw: false,\n omitRawContinuousFieldForAggregatePlot: true,\n omitRepeatedField: true,\n omitNonPositionalOrFacetOverPositionalChannels: true,\n omitTableWithOcclusionIfAutoAddCount: true,\n omitVerticalDotPlot: false,\n omitInvalidStackSpec: true,\n omitNonSumStack: true,\n preferredBinAxis: channel_1.Channel.X,\n preferredTemporalAxis: channel_1.Channel.X,\n preferredOrdinalAxis: channel_1.Channel.Y,\n preferredNominalAxis: channel_1.Channel.Y,\n preferredFacet: channel_1.Channel.ROW,\n // Field Encoding Constraints -- See description inside src/constraint/field.ts\n minCardinalityForBin: 15,\n maxCardinalityForCategoricalColor: 20,\n maxCardinalityForFacet: 20,\n maxCardinalityForShape: 6,\n timeUnitShouldHaveVariation: true,\n typeMatchesSchemaType: true,\n // STYLIZE\n stylize: true,\n smallRangeStepForHighCardinalityOrFacet: { maxCardinality: 10, rangeStep: 12 },\n nominalColorScaleForHighCardinality: { maxCardinality: 10, palette: 'category20' },\n xAxisOnTopForHighYCardinalityWithoutColumn: { maxCardinality: 30 },\n // RANKING PREFERENCE\n maxGoodCardinalityForFacet: 5,\n maxGoodCardinalityForColor: 7,\n // HIGH CARDINALITY STRINGS\n minPercentUniqueForKey: .8,\n minCardinalityForKey: 50,\n};\nfunction extendConfig(opt) {\n return __assign({}, exports.DEFAULT_QUERY_CONFIG, opt, { enum: extendEnumIndex(opt.enum) });\n}\nexports.extendConfig = extendConfig;\nfunction extendEnumIndex(enumIndex) {\n var enumOpt = __assign({}, wildcard_1.DEFAULT_ENUM_INDEX, enumIndex, { binProps: extendNestedEnumIndex(enumIndex, 'bin'), scaleProps: extendNestedEnumIndex(enumIndex, 'scale'), axisProps: extendNestedEnumIndex(enumIndex, 'axis'), legendProps: extendNestedEnumIndex(enumIndex, 'legend') });\n return enumOpt;\n}\nfunction extendNestedEnumIndex(enumIndex, prop) {\n return __assign({}, wildcard_1.DEFAULT_ENUM_INDEX[prop + 'Props'], enumIndex[prop + 'Props']);\n}\n//# sourceMappingURL=config.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar vega_util_1 = require(\"vega-util\");\nvar util_1 = require(\"./util\");\nvar AGGREGATE_OP_INDEX = {\n argmax: 1,\n argmin: 1,\n average: 1,\n count: 1,\n distinct: 1,\n max: 1,\n mean: 1,\n median: 1,\n min: 1,\n missing: 1,\n q1: 1,\n q3: 1,\n ci0: 1,\n ci1: 1,\n stderr: 1,\n stdev: 1,\n stdevp: 1,\n sum: 1,\n valid: 1,\n values: 1,\n variance: 1,\n variancep: 1,\n};\nexports.AGGREGATE_OPS = util_1.flagKeys(AGGREGATE_OP_INDEX);\nfunction isAggregateOp(a) {\n return !!AGGREGATE_OP_INDEX[a];\n}\nexports.isAggregateOp = isAggregateOp;\nexports.COUNTING_OPS = ['count', 'valid', 'missing', 'distinct'];\nfunction isCountingAggregateOp(aggregate) {\n return aggregate && util_1.contains(exports.COUNTING_OPS, aggregate);\n}\nexports.isCountingAggregateOp = isCountingAggregateOp;\n/** Additive-based aggregation operations. These can be applied to stack. */\nexports.SUM_OPS = [\n 'count',\n 'sum',\n 'distinct',\n 'valid',\n 'missing'\n];\n/**\n * Aggregation operators that always produce values within the range [domainMin, domainMax].\n */\nexports.SHARED_DOMAIN_OPS = [\n 'mean',\n 'average',\n 'median',\n 'q1',\n 'q3',\n 'min',\n 'max',\n];\nexports.SHARED_DOMAIN_OP_INDEX = vega_util_1.toSet(exports.SHARED_DOMAIN_OPS);\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWdncmVnYXRlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2FnZ3JlZ2F0ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUNBLHVDQUFnQztBQUNoQywrQkFBZ0Q7QUFFaEQsSUFBTSxrQkFBa0IsR0FBc0I7SUFDNUMsTUFBTSxFQUFFLENBQUM7SUFDVCxNQUFNLEVBQUUsQ0FBQztJQUNULE9BQU8sRUFBRSxDQUFDO0lBQ1YsS0FBSyxFQUFFLENBQUM7SUFDUixRQUFRLEVBQUUsQ0FBQztJQUNYLEdBQUcsRUFBRSxDQUFDO0lBQ04sSUFBSSxFQUFFLENBQUM7SUFDUCxNQUFNLEVBQUUsQ0FBQztJQUNULEdBQUcsRUFBRSxDQUFDO0lBQ04sT0FBTyxFQUFFLENBQUM7SUFDVixFQUFFLEVBQUUsQ0FBQztJQUNMLEVBQUUsRUFBRSxDQUFDO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FnZ3JlZ2F0ZSAmJiBjb250YWlucyhDT1VOVElOR19PUFMsIGFnZ3JlZ2F0ZSk7XG59XG5cbi8qKiBBZGRpdGl2ZS1iYXNlZCBhZ2dyZWdhdGlvbiBvcGVyYXRpb25zLiAgVGhlc2UgY2FuIGJlIGFwcGxpZWQgdG8gc3RhY2suICovXG5leHBvcnQgY29uc3QgU1VNX09QUzogQWdncmVnYXRlT3BbXSA9IFtcbiAgICAnY291bnQnLFxuICAgICdzdW0nLFxuICAgICdkaXN0aW5jdCcsXG4gICAgJ3ZhbGlkJyxcbiAgICAnbWlzc2luZydcbl07XG5cbi8qKlxuICogQWdncmVnYXRpb24gb3BlcmF0b3JzIHRoYXQgYWx3YXlzIHByb2R1Y2UgdmFsdWVzIHdpdGhpbiB0aGUgcmFuZ2UgW2RvbWFpbk1pbiwgZG9tYWluTWF4XS5cbiAqL1xuZXhwb3J0IGNvbnN0IFNIQVJFRF9ET01BSU5fT1BTOiBBZ2dyZWdhdGVPcFtdID0gW1xuICAgICdtZWFuJyxcbiAgICAnYXZlcmFnZScsXG4gICAgJ21lZGlhbicsXG4gICAgJ3ExJyxcbiAgICAncTMnLFxuICAgICdtaW4nLFxuICAgICdtYXgnLFxuXTtcblxuZXhwb3J0IGNvbnN0IFNIQVJFRF9ET01BSU5fT1BfSU5ERVggPSB0b1NldChTSEFSRURfRE9NQUlOX09QUyk7XG4iXX0=","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar vega_util_1 = require(\"vega-util\");\nvar channel_1 = require(\"./channel\");\nvar util_1 = require(\"./util\");\nfunction binToString(bin) {\n if (vega_util_1.isBoolean(bin)) {\n return 'bin';\n }\n return 'bin' + util_1.keys(bin).map(function (p) { return util_1.varName(\"_\" + p + \"_\" + bin[p]); }).join('');\n}\nexports.binToString = binToString;\nfunction autoMaxBins(channel) {\n switch (channel) {\n case channel_1.ROW:\n case channel_1.COLUMN:\n case channel_1.SIZE:\n case channel_1.COLOR:\n case channel_1.FILL:\n case channel_1.STROKE:\n case channel_1.OPACITY:\n // Facets and Size shouldn't have too many bins\n // We choose 6 like shape to simplify the rule\n case channel_1.SHAPE:\n return 6; // Vega's \"shape\" has 6 distinct values\n default:\n return 10;\n }\n}\nexports.autoMaxBins = autoMaxBins;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmluLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2Jpbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLHVDQUFvQztBQUNwQyxxQ0FBMEY7QUFDMUYsK0JBQXFDO0FBNkRyQyxxQkFBNEIsR0FBd0I7SUFDbEQsSUFBSSxxQkFBUyxDQUFDLEdBQUcsQ0FBQyxFQUFFO1FBQ2xCLE9BQU8sS0FBSyxDQUFDO0tBQ2Q7SUFDRCxPQUFPLEtBQUssR0FBRyxXQUFJLENBQUMsR0FBRyxDQUFDLENBQUMsR0FBRyxDQUFDLFVBQUEsQ0FBQyxJQUFJLE9BQUEsY0FBTyxDQUFDLE1BQUksQ0FBQyxTQUFJLEdBQUcsQ0FBQyxDQUFDLENBQUcsQ0FBQyxFQUExQixDQUEwQixDQUFDLENBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQyxDQUFDO0FBQ3pFLENBQUM7QUFMRCxrQ0FLQztBQUVELHFCQUE0QixPQUFnQjtJQUMxQyxRQUFRLE9BQU8sRUFBRTtRQUNmLEtBQUssYUFBRyxDQUFDO1FBQ1QsS0FBSyxnQkFBTSxDQUFDO1FBQ1osS0FBSyxjQUFJLENBQUM7UUFDVixLQUFLLGVBQUssQ0FBQztRQUNYLEtBQUssY0FBSSxDQUFDO1FBQ1YsS0FBSyxnQkFBTSxDQUFDO1FBQ1osS0FBSyxpQkFBTyxDQUFDO1FBQ1gsK0NBQStDO1FBQy9DLDhDQUE4QztRQUNoRCxLQUFLLGVBQUs7WUFDUixPQUFPLENBQUMsQ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gaGF2ZSB0b28gbWFueSBiaW5zXG4gICAgICAvLyBXZSBjaG9vc2UgNiBsaWtlIHNoYXBlIHRvIHNpbXBsaWZ5IHRoZSBydWxlXG4gICAgY2FzZSBTSEFQRTpcbiAgICAgIHJldHVybiA2OyAvLyBWZWdhJ3MgXCJzaGFwZVwiIGhhcyA2IGRpc3RpbmN0IHZhbHVlc1xuICAgIGRlZmF1bHQ6XG4gICAgICByZXR1cm4gMTA7XG4gIH1cbn1cbiJdfQ==","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar tslib_1 = require(\"tslib\");\nvar vega_util_1 = require(\"vega-util\");\nvar aggregate_1 = require(\"./aggregate\");\nvar bin_1 = require(\"./bin\");\nvar channel_1 = require(\"./channel\");\nvar log = require(\"./log\");\nvar timeunit_1 = require(\"./timeunit\");\nvar type_1 = require(\"./type\");\nvar util_1 = require(\"./util\");\nfunction isConditionalSelection(c) {\n return c['selection'];\n}\nexports.isConditionalSelection = isConditionalSelection;\nfunction isRepeatRef(field) {\n return field && !vega_util_1.isString(field) && 'repeat' in field;\n}\nexports.isRepeatRef = isRepeatRef;\nfunction toFieldDefBase(fieldDef) {\n var field = fieldDef.field, timeUnit = fieldDef.timeUnit, bin = fieldDef.bin, aggregate = fieldDef.aggregate;\n return tslib_1.__assign({}, (timeUnit ? { timeUnit: timeUnit } : {}), (bin ? { bin: bin } : {}), (aggregate ? { aggregate: aggregate } : {}), { field: field });\n}\nexports.toFieldDefBase = toFieldDefBase;\nfunction isConditionalDef(channelDef) {\n return !!channelDef && !!channelDef.condition;\n}\nexports.isConditionalDef = isConditionalDef;\n/**\n * Return if a channelDef is a ConditionalValueDef with ConditionFieldDef\n */\nfunction hasConditionalFieldDef(channelDef) {\n return !!channelDef && !!channelDef.condition && !vega_util_1.isArray(channelDef.condition) && isFieldDef(channelDef.condition);\n}\nexports.hasConditionalFieldDef = hasConditionalFieldDef;\nfunction hasConditionalValueDef(channelDef) {\n return !!channelDef && !!channelDef.condition && (vega_util_1.isArray(channelDef.condition) || isValueDef(channelDef.condition));\n}\nexports.hasConditionalValueDef = hasConditionalValueDef;\nfunction isFieldDef(channelDef) {\n return !!channelDef && (!!channelDef['field'] || channelDef['aggregate'] === 'count');\n}\nexports.isFieldDef = isFieldDef;\nfunction isStringFieldDef(fieldDef) {\n return isFieldDef(fieldDef) && vega_util_1.isString(fieldDef.field);\n}\nexports.isStringFieldDef = isStringFieldDef;\nfunction isValueDef(channelDef) {\n return channelDef && 'value' in channelDef && channelDef['value'] !== undefined;\n}\nexports.isValueDef = isValueDef;\nfunction isScaleFieldDef(channelDef) {\n return !!channelDef && (!!channelDef['scale'] || !!channelDef['sort']);\n}\nexports.isScaleFieldDef = isScaleFieldDef;\nfunction vgField(fieldDef, opt) {\n if (opt === void 0) { opt = {}; }\n var field = fieldDef.field;\n var prefix = opt.prefix;\n var suffix = opt.suffix;\n if (isCount(fieldDef)) {\n field = 'count_*';\n }\n else {\n var fn = undefined;\n if (!opt.nofn) {\n if (fieldDef.bin) {\n fn = bin_1.binToString(fieldDef.bin);\n suffix = opt.binSuffix || '';\n }\n else if (fieldDef.aggregate) {\n fn = String(opt.aggregate || fieldDef.aggregate);\n }\n else if (fieldDef.timeUnit) {\n fn = String(fieldDef.timeUnit);\n }\n }\n if (fn) {\n field = fn + \"_\" + field;\n }\n }\n if (suffix) {\n field = field + \"_\" + suffix;\n }\n if (prefix) {\n field = prefix + \"_\" + field;\n }\n if (opt.expr) {\n field = \"\" + opt.expr + util_1.accessPath(field);\n }\n return field;\n}\nexports.vgField = vgField;\nfunction isDiscrete(fieldDef) {\n switch (fieldDef.type) {\n case 'nominal':\n case 'ordinal':\n case 'geojson':\n return true;\n case 'quantitative':\n return !!fieldDef.bin;\n case 'latitude':\n case 'longitude':\n case 'temporal':\n return false;\n }\n throw new Error(log.message.invalidFieldType(fieldDef.type));\n}\nexports.isDiscrete = isDiscrete;\nfunction isContinuous(fieldDef) {\n return !isDiscrete(fieldDef);\n}\nexports.isContinuous = isContinuous;\nfunction isCount(fieldDef) {\n return fieldDef.aggregate === 'count';\n}\nexports.isCount = isCount;\nfunction verbalTitleFormatter(fieldDef, config) {\n var field = fieldDef.field, bin = fieldDef.bin, timeUnit = fieldDef.timeUnit, aggregate = fieldDef.aggregate;\n if (aggregate === 'count') {\n return config.countTitle;\n }\n else if (bin) {\n return field + \" (binned)\";\n }\n else if (timeUnit) {\n var units = timeunit_1.getTimeUnitParts(timeUnit).join('-');\n return field + \" (\" + units + \")\";\n }\n else if (aggregate) {\n return util_1.titlecase(aggregate) + \" of \" + field;\n }\n return field;\n}\nexports.verbalTitleFormatter = verbalTitleFormatter;\nfunction functionalTitleFormatter(fieldDef, config) {\n var fn = fieldDef.aggregate || fieldDef.timeUnit || (fieldDef.bin && 'bin');\n if (fn) {\n return fn.toUpperCase() + '(' + fieldDef.field + ')';\n }\n else {\n return fieldDef.field;\n }\n}\nexports.functionalTitleFormatter = functionalTitleFormatter;\nexports.defaultTitleFormatter = function (fieldDef, config) {\n switch (config.fieldTitle) {\n case 'plain':\n return fieldDef.field;\n case 'functional':\n return functionalTitleFormatter(fieldDef, config);\n default:\n return verbalTitleFormatter(fieldDef, config);\n }\n};\nvar titleFormatter = exports.defaultTitleFormatter;\nfunction setTitleFormatter(formatter) {\n titleFormatter = formatter;\n}\nexports.setTitleFormatter = setTitleFormatter;\nfunction resetTitleFormatter() {\n setTitleFormatter(exports.defaultTitleFormatter);\n}\nexports.resetTitleFormatter = resetTitleFormatter;\nfunction title(fieldDef, config) {\n return titleFormatter(fieldDef, config);\n}\nexports.title = title;\nfunction defaultType(fieldDef, channel) {\n if (fieldDef.timeUnit) {\n return 'temporal';\n }\n if (fieldDef.bin) {\n return 'quantitative';\n }\n switch (channel_1.rangeType(channel)) {\n case 'continuous':\n return 'quantitative';\n case 'discrete':\n return 'nominal';\n case 'flexible': // color\n return 'nominal';\n default:\n return 'quantitative';\n }\n}\nexports.defaultType = defaultType;\n/**\n * Returns the fieldDef -- either from the outer channelDef or from the condition of channelDef.\n * @param channelDef\n */\nfunction getFieldDef(channelDef) {\n if (isFieldDef(channelDef)) {\n return channelDef;\n }\n else if (hasConditionalFieldDef(channelDef)) {\n return channelDef.condition;\n }\n return undefined;\n}\nexports.getFieldDef = getFieldDef;\n/**\n * Convert type to full, lowercase type, or augment the fieldDef with a default type if missing.\n */\nfunction normalize(channelDef, channel) {\n if (vega_util_1.isString(channelDef) || vega_util_1.isNumber(channelDef) || vega_util_1.isBoolean(channelDef)) {\n var primitiveType = vega_util_1.isString(channelDef) ? 'string' :\n vega_util_1.isNumber(channelDef) ? 'number' : 'boolean';\n log.warn(log.message.primitiveChannelDef(channel, primitiveType, channelDef));\n return { value: channelDef };\n }\n // If a fieldDef contains a field, we need type.\n if (isFieldDef(channelDef)) {\n return normalizeFieldDef(channelDef, channel);\n }\n else if (hasConditionalFieldDef(channelDef)) {\n return tslib_1.__assign({}, channelDef, { \n // Need to cast as normalizeFieldDef normally return FieldDef, but here we know that it is definitely Condition\n condition: normalizeFieldDef(channelDef.condition, channel) });\n }\n return channelDef;\n}\nexports.normalize = normalize;\nfunction normalizeFieldDef(fieldDef, channel) {\n // Drop invalid aggregate\n if (fieldDef.aggregate && !aggregate_1.isAggregateOp(fieldDef.aggregate)) {\n var aggregate = fieldDef.aggregate, fieldDefWithoutAggregate = tslib_1.__rest(fieldDef, [\"aggregate\"]);\n log.warn(log.message.invalidAggregate(fieldDef.aggregate));\n fieldDef = fieldDefWithoutAggregate;\n }\n // Normalize Time Unit\n if (fieldDef.timeUnit) {\n fieldDef = tslib_1.__assign({}, fieldDef, { timeUnit: timeunit_1.normalizeTimeUnit(fieldDef.timeUnit) });\n }\n // Normalize bin\n if (fieldDef.bin) {\n fieldDef = tslib_1.__assign({}, fieldDef, { bin: normalizeBin(fieldDef.bin, channel) });\n }\n // Normalize Type\n if (fieldDef.type) {\n var fullType = type_1.getFullName(fieldDef.type);\n if (fieldDef.type !== fullType) {\n // convert short type to full type\n fieldDef = tslib_1.__assign({}, fieldDef, { type: fullType });\n }\n if (fieldDef.type !== 'quantitative') {\n if (aggregate_1.isCountingAggregateOp(fieldDef.aggregate)) {\n log.warn(log.message.invalidFieldTypeForCountAggregate(fieldDef.type, fieldDef.aggregate));\n fieldDef = tslib_1.__assign({}, fieldDef, { type: 'quantitative' });\n }\n }\n }\n else {\n // If type is empty / invalid, then augment with default type\n var newType = defaultType(fieldDef, channel);\n log.warn(log.message.emptyOrInvalidFieldType(fieldDef.type, channel, newType));\n fieldDef = tslib_1.__assign({}, fieldDef, { type: newType });\n }\n var _a = channelCompatibility(fieldDef, channel), compatible = _a.compatible, warning = _a.warning;\n if (!compatible) {\n log.warn(warning);\n }\n return fieldDef;\n}\nexports.normalizeFieldDef = normalizeFieldDef;\nfunction normalizeBin(bin, channel) {\n if (vega_util_1.isBoolean(bin)) {\n return { maxbins: bin_1.autoMaxBins(channel) };\n }\n else if (!bin.maxbins && !bin.step) {\n return tslib_1.__assign({}, bin, { maxbins: bin_1.autoMaxBins(channel) });\n }\n else {\n return bin;\n }\n}\nexports.normalizeBin = normalizeBin;\nvar COMPATIBLE = { compatible: true };\nfunction channelCompatibility(fieldDef, channel) {\n switch (channel) {\n case 'row':\n case 'column':\n if (isContinuous(fieldDef) && !fieldDef.timeUnit) {\n // TODO:(https://github.com/vega/vega-lite/issues/2011):\n // with timeUnit it's not always strictly continuous\n return {\n compatible: false,\n warning: log.message.facetChannelShouldBeDiscrete(channel)\n };\n }\n return COMPATIBLE;\n case 'x':\n case 'y':\n case 'color':\n case 'fill':\n case 'stroke':\n case 'text':\n case 'detail':\n case 'key':\n case 'tooltip':\n case 'href':\n return COMPATIBLE;\n case 'longitude':\n case 'longitude2':\n case 'latitude':\n case 'latitude2':\n if (fieldDef.type !== type_1.QUANTITATIVE) {\n return {\n compatible: false,\n warning: \"Channel \" + channel + \" should not be used with \" + fieldDef.type + \" field.\"\n };\n }\n return COMPATIBLE;\n case 'opacity':\n case 'size':\n case 'x2':\n case 'y2':\n if (isDiscrete(fieldDef) && !fieldDef.bin) {\n return {\n compatible: false,\n warning: \"Channel \" + channel + \" should not be used with discrete field.\"\n };\n }\n return COMPATIBLE;\n case 'shape':\n if (fieldDef.type !== 'nominal' && fieldDef.type !== 'geojson') {\n return {\n compatible: false,\n warning: 'Shape channel should be used with nominal data or geojson only'\n };\n }\n return COMPATIBLE;\n case 'order':\n if (fieldDef.type === 'nominal') {\n return {\n compatible: false,\n warning: \"Channel order is inappropriate for nominal field, which has no inherent order.\"\n };\n }\n return COMPATIBLE;\n }\n throw new Error('channelCompatability not implemented for channel ' + channel);\n}\nexports.channelCompatibility = channelCompatibility;\nfunction isNumberFieldDef(fieldDef) {\n return fieldDef.type === 'quantitative' || !!fieldDef.bin;\n}\nexports.isNumberFieldDef = isNumberFieldDef;\nfunction isTimeFieldDef(fieldDef) {\n return fieldDef.type === 'temporal' || !!fieldDef.timeUnit;\n}\nexports.isTimeFieldDef = isTimeFieldDef;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmllbGRkZWYuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZmllbGRkZWYudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBRUEsdUNBQWlFO0FBQ2pFLHlDQUFpRTtBQUVqRSw2QkFBMEQ7QUFDMUQscUNBQTZDO0FBSzdDLDJCQUE2QjtBQU03Qix1Q0FBeUU7QUFDekUsK0JBQXVEO0FBQ3ZELCtCQUE2QztBQStCN0MsZ0NBQTBDLENBQWlCO0lBQ3pELE9BQU8sQ0FBQyxDQUFDLFdBQVcsQ0FBQyxDQUFDO0FBQ3hCLENBQUM7QUFGRCx3REFFQztBQWdERCxxQkFBNEIsS0FBWTtJQUN0QyxPQUFPLEtBQUssSUFBSSxDQUFDLG9CQUFRLENBQUMsS0FBSyxDQUFDLElBQUksUUFBUSxJQUFJLEtBQUssQ0FBQztBQUN4RCxDQUFD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mLnR5cGUgIT09IFFVQU5USVRBVElWRSkge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIGNvbXBhdGlibGU6IGZhbHNlLFxuICAgICAgICAgIHdhcm5pbmc6IGBDaGFubmVsICR7Y2hhbm5lbH0gc2hvdWxkIG5vdCBiZSB1c2VkIHdpdGggJHtmaWVsZERlZi50eXBlfSBmaWVsZC5gXG4gICAgICAgIH07XG4gICAgICB9XG4gICAgICByZXR1cm4gQ09NUEFUSUJMRTtcblxuICAgIGNhc2UgJ29wYWNpdHknOlxuICAgIGNhc2UgJ3NpemUnOlxuICAgIGNhc2UgJ3gyJzpcbiAgICBjYXNlICd5Mic6XG4gICAgICBpZiAoaXNEaXNjcmV0ZShmaWVsZERlZikgJiYgIWZpZWxkRGVmLmJpbikge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIGNvbXBhdGlibGU6IGZhbHNlLFxuICAgICAgICAgIHdhcm5pbmc6IGBDaGFubmVsICR7Y2hhbm5lbH0gc2hvdWxkIG5vdCBiZSB1c2VkIHdpdGggZGlzY3JldGUgZmllbGQuYFxuICAgICAgICB9O1xuICAgICAgfVxuICAgICAgcmV0dXJuIENPTVBBVElCTEU7XG5cbiAgICBjYXNlICdzaGFwZSc6XG4gICAgICBpZiAoZmllbGREZWYudHlwZSAhPT0gJ25vbWluYWwnICYmIGZpZWxkRGVmLnR5cGUgIT09ICdnZW9qc29uJykge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIGNvbXBhdGlibGU6IGZhbHNlLFxuICAgICAgICAgIHdhcm5pbmc6ICdTaGFwZSBjaGFubmVsIHNob3VsZCBiZSB1c2VkIHdpdGggbm9taW5hbCBkYXRhIG9yIGdlb2pzb24gb25seSdcbiAgICAgICAgfTtcbiAgICAgIH1cbiAgICAgIHJldHVybiBDT01QQVRJQkxFO1xuXG4gICAgY2FzZSAnb3JkZXInOlxuICAgICAgaWYgKGZpZWxkRGVmLnR5cGUgPT09ICdub21pbmFsJykge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIGNvbXBhdGlibGU6IGZhbHNlLFxuICAgICAgICAgIHdhcm5pbmc6IGBDaGFubmVsIG9yZGVyIGlzIGluYXBwcm9wcmlhdGUgZm9yIG5vbWluYWwgZmllbGQsIHdoaWNoIGhhcyBubyBpbmhlcmVudCBvcmRlci5gXG4gICAgICAgIH07XG4gICAgICB9XG4gICAgICByZXR1cm4gQ09NUEFUSUJMRTtcbiAgfVxuICB0aHJvdyBuZXcgRXJyb3IoJ2NoYW5uZWxDb21wYXRhYmlsaXR5IG5vdCBpbXBsZW1lbnRlZCBmb3IgY2hhbm5lbCAnICsgY2hhbm5lbCk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBpc051bWJlckZpZWxkRGVmKGZpZWxkRGVmOiBGaWVsZERlZjxhbnk+KSB7XG4gIHJldHVybiBmaWVsZERlZi50eXBlID09PSAncXVhbnRpdGF0aXZlJyB8fCAhIWZpZWxkRGVmLmJpbjtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGlzVGltZUZpZWxkRGVmKGZpZWxkRGVmOiBGaWVsZERlZjxhbnk+KSB7XG4gIHJldHVybiBmaWVsZERlZi50eXBlID09PSAndGVtcG9yYWwnIHx8ICEhZmllbGREZWYudGltZVVuaXQ7XG59XG4iXX0=","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar type_1 = require(\"vega-lite/build/src/type\");\nvar ExpandedType;\n(function (ExpandedType) {\n ExpandedType.QUANTITATIVE = type_1.Type.QUANTITATIVE;\n ExpandedType.ORDINAL = type_1.Type.ORDINAL;\n ExpandedType.TEMPORAL = type_1.Type.TEMPORAL;\n ExpandedType.NOMINAL = type_1.Type.NOMINAL;\n ExpandedType.KEY = 'key';\n})(ExpandedType = exports.ExpandedType || (exports.ExpandedType = {}));\nfunction isDiscrete(fieldType) {\n return fieldType === type_1.Type.ORDINAL || fieldType === type_1.Type.NOMINAL || fieldType === ExpandedType.KEY;\n}\nexports.isDiscrete = isDiscrete;\n//# sourceMappingURL=expandedtype.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar channel_1 = require(\"../../channel\");\nvar log = require(\"../../log\");\nvar scale_1 = require(\"../../scale\");\nvar scale_2 = require(\"../../scale\");\nvar type_1 = require(\"../../type\");\nvar util = require(\"../../util\");\nvar util_1 = require(\"../../util\");\n/**\n * Determine if there is a specified scale type and if it is appropriate,\n * or determine default type if type is unspecified or inappropriate.\n */\n// NOTE: CompassQL uses this method.\nfunction scaleType(specifiedType, channel, fieldDef, mark, scaleConfig) {\n var defaultScaleType = defaultType(channel, fieldDef, mark, scaleConfig);\n if (!channel_1.isScaleChannel(channel)) {\n // There is no scale for these channels\n return null;\n }\n if (specifiedType !== undefined) {\n // Check if explicitly specified scale type is supported by the channel\n if (!scale_1.channelSupportScaleType(channel, specifiedType)) {\n log.warn(log.message.scaleTypeNotWorkWithChannel(channel, specifiedType, defaultScaleType));\n return defaultScaleType;\n }\n // Check if explicitly specified scale type is supported by the data type\n if (!fieldDefMatchScaleType(specifiedType, fieldDef)) {\n log.warn(log.message.scaleTypeNotWorkWithFieldDef(specifiedType, defaultScaleType));\n return defaultScaleType;\n }\n return specifiedType;\n }\n return defaultScaleType;\n}\nexports.scaleType = scaleType;\n/**\n * Determine appropriate default scale type.\n */\n// NOTE: Voyager uses this method.\nfunction defaultType(channel, fieldDef, mark, scaleConfig) {\n switch (fieldDef.type) {\n case 'nominal':\n case 'ordinal':\n if (channel_1.isColorChannel(channel) || channel_1.rangeType(channel) === 'discrete') {\n if (channel === 'shape' && fieldDef.type === 'ordinal') {\n log.warn(log.message.discreteChannelCannotEncode(channel, 'ordinal'));\n }\n return 'ordinal';\n }\n if (util.contains(['x', 'y'], channel)) {\n if (util.contains(['rect', 'bar', 'rule'], mark)) {\n // The rect/bar mark should fit into a band.\n // For rule, using band scale to make rule align with axis ticks better https://github.com/vega/vega-lite/issues/3429\n return 'band';\n }\n if (mark === 'bar') {\n return 'band';\n }\n }\n // Otherwise, use ordinal point scale so we can easily get center positions of the marks.\n return 'point';\n case 'temporal':\n if (channel_1.isColorChannel(channel)) {\n return 'sequential';\n }\n else if (channel_1.rangeType(channel) === 'discrete') {\n log.warn(log.message.discreteChannelCannotEncode(channel, 'temporal'));\n // TODO: consider using quantize (equivalent to binning) once we have it\n return 'ordinal';\n }\n return 'time';\n case 'quantitative':\n if (channel_1.isColorChannel(channel)) {\n if (fieldDef.bin) {\n return 'bin-ordinal';\n }\n // Use `sequential` as the default color scale for continuous data\n // since it supports both array range and scheme range.\n return 'sequential';\n }\n else if (channel_1.rangeType(channel) === 'discrete') {\n log.warn(log.message.discreteChannelCannotEncode(channel, 'quantitative'));\n // TODO: consider using quantize (equivalent to binning) once we have it\n return 'ordinal';\n }\n // x and y use a linear scale because selections don't work with bin scales.\n // Binned scales apply discretization but pan/zoom apply transformations to a [min, max] extent domain.\n if (fieldDef.bin && channel !== 'x' && channel !== 'y') {\n return 'bin-linear';\n }\n return 'linear';\n case 'latitude':\n case 'longitude':\n case 'geojson':\n return undefined;\n }\n /* istanbul ignore next: should never reach this */\n throw new Error(log.message.invalidFieldType(fieldDef.type));\n}\nfunction fieldDefMatchScaleType(specifiedType, fieldDef) {\n var type = fieldDef.type;\n if (util_1.contains([type_1.Type.ORDINAL, type_1.Type.NOMINAL], type)) {\n return specifiedType === undefined || scale_2.hasDiscreteDomain(specifiedType);\n }\n else if (type === type_1.Type.TEMPORAL) {\n return util_1.contains([scale_1.ScaleType.TIME, scale_1.ScaleType.UTC, scale_1.ScaleType.SEQUENTIAL, undefined], specifiedType);\n }\n else if (type === type_1.Type.QUANTITATIVE) {\n if (fieldDef.bin) {\n return util_1.contains([scale_1.ScaleType.BIN_LINEAR, scale_1.ScaleType.BIN_ORDINAL, scale_1.ScaleType.LINEAR], specifiedType);\n }\n return util_1.contains([scale_1.ScaleType.LOG, scale_1.ScaleType.POW, scale_1.ScaleType.SQRT, scale_1.ScaleType.QUANTILE, scale_1.ScaleType.QUANTIZE, scale_1.ScaleType.LINEAR, scale_1.ScaleType.SEQUENTIAL, undefined], specifiedType);\n }\n return true;\n}\nexports.fieldDefMatchScaleType = fieldDefMatchScaleType;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9jb21waWxlL3NjYWxlL3R5cGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSx5Q0FBaUY7QUFFakYsK0JBQWlDO0FBRWpDLHFDQUE0RTtBQUM1RSxxQ0FBOEM7QUFDOUMsbUNBQWdDO0FBQ2hDLGlDQUFtQztBQUNuQyxtQ0FBb0M7QUFLcEM7OztHQUdHO0FBQ0gsb0NBQW9DO0FBQ3BDLG1CQUNFLGFBQXdCLEVBQUUsT0FBZ0IsRUFBRSxRQUEwQixFQUN0RSxJQUFVLEVBQUUsV0FBd0I7SUFHcEMsSUFBTSxnQkFBZ0IsR0FBRyxXQUFXLENBQUMsT0FBTyxFQUFFLFFBQVEsRUFBRSxJQUFJLEVBQUUsV0FBVyxDQUFDLENBQUM7SUFFM0UsSUFBSSxDQUFDLHdCQUFjLENBQUMsT0FBTyxDQUFDLEVBQUU7UUFDNUIsdUNBQXVDO1FBQ3ZDLE9BQU8sSUFBSSxDQUFDO0tBQ2I7SUFDRCxJQUFJLGFBQWEsS0FBSyxTQUFTLEVBQUU7UUFDL0IsdUVBQXVFO1FBQ3ZFLElBQUksQ0FBQywrQkFBdUIsQ0FBQyxPQUFPLEVBQUUsYUFBYSxDQUFDLEVBQUU7WUFDcEQsR0FBRyxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsT0FBTyxDQUFDLDJCQUEyQixDQUFDLE9BQU8sRUFBRSxhQUFhLEVBQUUsZ0JBQWdCLENBQUMsQ0FBQyxDQUFDO1lBQzVGLE9BQU8sZ0JBQWdCLENBQ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ElOQUwsIFR5cGUuTk9NSU5BTF0sIHR5cGUpKSB7XG4gICAgcmV0dXJuIHNwZWNpZmllZFR5cGUgPT09IHVuZGVmaW5lZCB8fCBoYXNEaXNjcmV0ZURvbWFpbihzcGVjaWZpZWRUeXBlKTtcbiAgfSBlbHNlIGlmICh0eXBlID09PSBUeXBlLlRFTVBPUkFMKSB7XG4gICAgcmV0dXJuIGNvbnRhaW5zKFtTY2FsZVR5cGUuVElNRSwgU2NhbGVUeXBlLlVUQywgU2NhbGVUeXBlLlNFUVVFTlRJQUwsIHVuZGVmaW5lZF0sIHNwZWNpZmllZFR5cGUpO1xuICB9IGVsc2UgaWYgKHR5cGUgPT09IFR5cGUuUVVBTlRJVEFUSVZFKSB7XG4gICAgaWYgKGZpZWxkRGVmLmJpbikge1xuICAgICAgcmV0dXJuIGNvbnRhaW5zKFtTY2FsZVR5cGUuQklOX0xJTkVBUiwgU2NhbGVUeXBlLkJJTl9PUkRJTkFMLCBTY2FsZVR5cGUuTElORUFSXSwgc3BlY2lmaWVkVHlwZSk7XG4gICAgfVxuICAgIHJldHVybiBjb250YWlucyhbU2NhbGVUeXBlLkxPRywgU2NhbGVUeXBlLlBPVywgU2NhbGVUeXBlLlNRUlQsIFNjYWxlVHlwZS5RVUFOVElMRSwgU2NhbGVUeXBlLlFVQU5USVpFLCBTY2FsZVR5cGUuTElORUFSLCBTY2FsZVR5cGUuU0VRVUVOVElBTCwgdW5kZWZpbmVkXSwgc3BlY2lmaWVkVHlwZSk7XG4gIH1cblxuICByZXR1cm4gdHJ1ZTtcbn1cbiJdfQ==","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar tslib_1 = require(\"tslib\");\nvar vega_util_1 = require(\"vega-util\");\nvar channel_1 = require(\"./channel\");\nvar fielddef_1 = require(\"./fielddef\");\nvar log = require(\"./log\");\nvar type_1 = require(\"./type\");\nvar util_1 = require(\"./util\");\nfunction channelHasField(encoding, channel) {\n var channelDef = encoding && encoding[channel];\n if (channelDef) {\n if (vega_util_1.isArray(channelDef)) {\n return util_1.some(channelDef, function (fieldDef) { return !!fieldDef.field; });\n }\n else {\n return fielddef_1.isFieldDef(channelDef) || fielddef_1.hasConditionalFieldDef(channelDef);\n }\n }\n return false;\n}\nexports.channelHasField = channelHasField;\nfunction isAggregate(encoding) {\n return util_1.some(channel_1.CHANNELS, function (channel) {\n if (channelHasField(encoding, channel)) {\n var channelDef = encoding[channel];\n if (vega_util_1.isArray(channelDef)) {\n return util_1.some(channelDef, function (fieldDef) { return !!fieldDef.aggregate; });\n }\n else {\n var fieldDef = fielddef_1.getFieldDef(channelDef);\n return fieldDef && !!fieldDef.aggregate;\n }\n }\n return false;\n });\n}\nexports.isAggregate = isAggregate;\nfunction normalizeEncoding(encoding, mark) {\n return util_1.keys(encoding).reduce(function (normalizedEncoding, channel) {\n if (!channel_1.isChannel(channel)) {\n // Drop invalid channel\n log.warn(log.message.invalidEncodingChannel(channel));\n return normalizedEncoding;\n }\n if (!channel_1.supportMark(channel, mark)) {\n // Drop unsupported channel\n log.warn(log.message.incompatibleChannel(channel, mark));\n return normalizedEncoding;\n }\n // Drop line's size if the field is aggregated.\n if (channel === 'size' && mark === 'line') {\n var fieldDef = fielddef_1.getFieldDef(encoding[channel]);\n if (fieldDef && fieldDef.aggregate) {\n log.warn(log.message.LINE_WITH_VARYING_SIZE);\n return normalizedEncoding;\n }\n }\n // Drop color if either fill or stroke is specified\n if (channel === 'color' && ('fill' in encoding || 'stroke' in encoding)) {\n log.warn(log.message.droppingColor('encoding', { fill: 'fill' in encoding, stroke: 'stroke' in encoding }));\n return normalizedEncoding;\n }\n if (channel === 'detail' || channel === 'order' || (channel === 'tooltip' && vega_util_1.isArray(encoding[channel]))) {\n var channelDef = encoding[channel];\n if (channelDef) {\n // Array of fieldDefs for detail channel (or production rule)\n normalizedEncoding[channel] = (vega_util_1.isArray(channelDef) ? channelDef : [channelDef])\n .reduce(function (defs, fieldDef) {\n if (!fielddef_1.isFieldDef(fieldDef)) {\n log.warn(log.message.emptyFieldDef(fieldDef, channel));\n }\n else {\n defs.push(fielddef_1.normalizeFieldDef(fieldDef, channel));\n }\n return defs;\n }, []);\n }\n }\n else {\n // FIXME: remove this casting. (I don't know why Typescript doesn't infer this correctly here.)\n var channelDef = encoding[channel];\n var fieldDef = fielddef_1.getFieldDef(encoding[channel]);\n if (fieldDef && util_1.contains([type_1.Type.LATITUDE, type_1.Type.LONGITUDE], fieldDef.type)) {\n var _a = channel, _ = normalizedEncoding[_a], newEncoding = tslib_1.__rest(normalizedEncoding, [typeof _a === \"symbol\" ? _a : _a + \"\"]);\n var newChannel = channel === 'x' ? 'longitude' :\n channel === 'y' ? 'latitude' :\n channel === 'x2' ? 'longitude2' :\n channel === 'y2' ? 'latitude2' : undefined;\n log.warn(log.message.latLongDeprecated(channel, fieldDef.type, newChannel));\n return tslib_1.__assign({}, newEncoding, (_b = {}, _b[newChannel] = tslib_1.__assign({}, fielddef_1.normalize(fieldDef, channel), { type: 'quantitative' }), _b));\n }\n if (!fielddef_1.isFieldDef(channelDef) && !fielddef_1.isValueDef(channelDef) && !fielddef_1.isConditionalDef(channelDef)) {\n log.warn(log.message.emptyFieldDef(channelDef, channel));\n return normalizedEncoding;\n }\n normalizedEncoding[channel] = fielddef_1.normalize(channelDef, channel);\n }\n return normalizedEncoding;\n var _b;\n }, {});\n}\nexports.normalizeEncoding = normalizeEncoding;\nfunction isRanged(encoding) {\n return encoding && ((!!encoding.x && !!encoding.x2) || (!!encoding.y && !!encoding.y2));\n}\nexports.isRanged = isRanged;\nfunction fieldDefs(encoding) {\n var arr = [];\n channel_1.CHANNELS.forEach(function (channel) {\n if (channelHasField(encoding, channel)) {\n var channelDef = encoding[channel];\n (vega_util_1.isArray(channelDef) ? channelDef : [channelDef]).forEach(function (def) {\n if (fielddef_1.isFieldDef(def)) {\n arr.push(def);\n }\n else if (fielddef_1.hasConditionalFieldDef(def)) {\n arr.push(def.condition);\n }\n });\n }\n });\n return arr;\n}\nexports.fieldDefs = fieldDefs;\nfunction forEach(mapping, f, thisArg) {\n if (!mapping) {\n return;\n }\n var _loop_1 = function (channel) {\n if (vega_util_1.isArray(mapping[channel])) {\n mapping[channel].forEach(function (channelDef) {\n f.call(thisArg, channelDef, channel);\n });\n }\n else {\n f.call(thisArg, mapping[channel], channel);\n }\n };\n for (var _i = 0, _a = util_1.keys(mapping); _i < _a.length; _i++) {\n var channel = _a[_i];\n _loop_1(channel);\n }\n}\nexports.forEach = forEach;\nfunction reduce(mapping, f, init, thisArg) {\n if (!mapping) {\n return init;\n }\n return util_1.keys(mapping).reduce(function (r, channel) {\n var map = mapping[channel];\n if (vega_util_1.isArray(map)) {\n return map.reduce(function (r1, channelDef) {\n return f.call(thisArg, r1, channelDef, channel);\n }, r);\n }\n else {\n return f.call(thisArg, r, map, channel);\n }\n }, init);\n}\nexports.reduce = reduce;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW5jb2RpbmcuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZW5jb2RpbmcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EsdUNBQWtDO0FBQ2xDLHFDQUFvRTtBQUVwRSx1Q0FrQm9CO0FBQ3BCLDJCQUE2QjtBQUU3QiwrQkFBNEI7QUFDNUIsK0JBQTRDO0FBOEk1Qyx5QkFBZ0MsUUFBa0MsRUFBRSxPQUFnQjtJQUNsRixJQUFNLFVBQVUsR0FBRyxRQUFRLElBQUksUUFBUSxDQUFDLE9BQU8sQ0FBQyxDQUFDO0lBQ2pELElBQUksVUFBVSxFQUFFO1FBQ2QsSUFBSSxtQkFBTyxDQUFDLFVBQVUsQ0FBQyxFQUFFO1lBQ3ZCLE9BQU8sV0FBSSxDQUFDLFVBQVUsRUFBRSxVQUFDLFFBQVEsSUFBSyxPQUFBLENBQUMsQ0FBQyxRQUFRLENBQUMsS0FBSyxFQUFoQixDQUF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G4gICAgfVxuICB9XG59XG5cbmV4cG9ydCBmdW5jdGlvbiByZWR1Y2U8VCwgVSBleHRlbmRzIHtbayBpbiBDaGFubmVsXT86IGFueX0+KG1hcHBpbmc6IFUsXG4gICAgZjogKGFjYzogYW55LCBmZDogRmllbGREZWY8c3RyaW5nPiwgYzogQ2hhbm5lbCkgPT4gVSxcbiAgICBpbml0OiBULCB0aGlzQXJnPzogYW55KSB7XG4gIGlmICghbWFwcGluZykge1xuICAgIHJldHVybiBpbml0O1xuICB9XG5cbiAgcmV0dXJuIGtleXMobWFwcGluZykucmVkdWNlKChyLCBjaGFubmVsKSA9PiB7XG4gICAgY29uc3QgbWFwID0gbWFwcGluZ1tjaGFubmVsXTtcbiAgICBpZiAoaXNBcnJheShtYXApKSB7XG4gICAgICByZXR1cm4gbWFwLnJlZHVjZSgocjE6IFQsIGNoYW5uZWxEZWY6IENoYW5uZWxEZWY8c3RyaW5nPikgPT4ge1xuICAgICAgICByZXR1cm4gZi5jYWxsKHRoaXNBcmcsIHIxLCBjaGFubmVsRGVmLCBjaGFubmVsKTtcbiAgICAgIH0sIHIpO1xuICAgIH0gZWxzZSB7XG4gICAgICByZXR1cm4gZi5jYWxsKHRoaXNBcmcsIHIsIG1hcCwgY2hhbm5lbCk7XG4gICAgfVxuICB9LCBpbml0KTtcbn1cbiJdfQ==","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar vega_util_1 = require(\"vega-util\");\nvar aggregate_1 = require(\"./aggregate\");\nvar channel_1 = require(\"./channel\");\nvar encoding_1 = require(\"./encoding\");\nvar fielddef_1 = require(\"./fielddef\");\nvar log = require(\"./log\");\nvar mark_1 = require(\"./mark\");\nvar scale_1 = require(\"./scale\");\nvar util_1 = require(\"./util\");\nvar STACK_OFFSET_INDEX = {\n zero: 1,\n center: 1,\n normalize: 1\n};\nfunction isStackOffset(s) {\n return !!STACK_OFFSET_INDEX[s];\n}\nexports.isStackOffset = isStackOffset;\nexports.STACKABLE_MARKS = [mark_1.BAR, mark_1.AREA, mark_1.RULE, mark_1.POINT, mark_1.CIRCLE, mark_1.SQUARE, mark_1.LINE, mark_1.TEXT, mark_1.TICK];\nexports.STACK_BY_DEFAULT_MARKS = [mark_1.BAR, mark_1.AREA];\nfunction potentialStackedChannel(encoding) {\n var xDef = encoding.x;\n var yDef = encoding.y;\n if (fielddef_1.isFieldDef(xDef) && fielddef_1.isFieldDef(yDef)) {\n if (xDef.type === 'quantitative' && yDef.type === 'quantitative') {\n if (xDef.stack) {\n return 'x';\n }\n else if (yDef.stack) {\n return 'y';\n }\n // if there is no explicit stacking, only apply stack if there is only one aggregate for x or y\n if ((!!xDef.aggregate) !== (!!yDef.aggregate)) {\n return xDef.aggregate ? 'x' : 'y';\n }\n }\n else if (xDef.type === 'quantitative') {\n return 'x';\n }\n else if (yDef.type === 'quantitative') {\n return 'y';\n }\n }\n else if (fielddef_1.isFieldDef(xDef) && xDef.type === 'quantitative') {\n return 'x';\n }\n else if (fielddef_1.isFieldDef(yDef) && yDef.type === 'quantitative') {\n return 'y';\n }\n return undefined;\n}\n// Note: CompassQL uses this method and only pass in required properties of each argument object.\n// If required properties change, make sure to update CompassQL.\nfunction stack(m, encoding, stackConfig) {\n var mark = mark_1.isMarkDef(m) ? m.type : m;\n // Should have stackable mark\n if (!util_1.contains(exports.STACKABLE_MARKS, mark)) {\n return null;\n }\n var fieldChannel = potentialStackedChannel(encoding);\n if (!fieldChannel) {\n return null;\n }\n var stackedFieldDef = encoding[fieldChannel];\n var stackedField = fielddef_1.isStringFieldDef(stackedFieldDef) ? fielddef_1.vgField(stackedFieldDef, {}) : undefined;\n var dimensionChannel = fieldChannel === 'x' ? 'y' : 'x';\n var dimensionDef = encoding[dimensionChannel];\n var dimensionField = fielddef_1.isStringFieldDef(dimensionDef) ? fielddef_1.vgField(dimensionDef, {}) : undefined;\n // Should have grouping level of detail that is different from the dimension field\n var stackBy = channel_1.NONPOSITION_CHANNELS.reduce(function (sc, channel) {\n if (encoding_1.channelHasField(encoding, channel)) {\n var channelDef = encoding[channel];\n (vega_util_1.isArray(channelDef) ? channelDef : [channelDef]).forEach(function (cDef) {\n var fieldDef = fielddef_1.getFieldDef(cDef);\n if (fieldDef.aggregate) {\n return;\n }\n // Check whether the channel's field is identical to x/y's field or if the channel is a repeat\n var f = fielddef_1.isStringFieldDef(fieldDef) ? fielddef_1.vgField(fieldDef, {}) : undefined;\n if (\n // if fielddef is a repeat, just include it in the stack by\n !f ||\n // otherwise, the field must be different from x and y fields.\n (f !== dimensionField && f !== stackedField)) {\n sc.push({ channel: channel, fieldDef: fieldDef });\n }\n });\n }\n return sc;\n }, []);\n if (stackBy.length === 0) {\n return null;\n }\n // Automatically determine offset\n var offset = undefined;\n if (stackedFieldDef.stack !== undefined) {\n offset = stackedFieldDef.stack;\n }\n else if (util_1.contains(exports.STACK_BY_DEFAULT_MARKS, mark)) {\n // Bar and Area with sum ops are automatically stacked by default\n offset = stackConfig === undefined ? 'zero' : stackConfig;\n }\n else {\n offset = stackConfig;\n }\n if (!offset || !isStackOffset(offset)) {\n return null;\n }\n // If stacked, check scale type if it is linear\n if (stackedFieldDef.scale && stackedFieldDef.scale.type && stackedFieldDef.scale.type !== scale_1.ScaleType.LINEAR) {\n log.warn(log.message.cannotStackNonLinearScale(stackedFieldDef.scale.type));\n return null;\n }\n // Check if it is a ranged mark\n if (encoding_1.channelHasField(encoding, fieldChannel === channel_1.X ? channel_1.X2 : channel_1.Y2)) {\n log.warn(log.message.cannotStackRangedMark(fieldChannel));\n return null;\n }\n // Warn if stacking summative aggregate\n if (stackedFieldDef.aggregate && !util_1.contains(aggregate_1.SUM_OPS, stackedFieldDef.aggregate)) {\n log.warn(log.message.stackNonSummativeAggregate(stackedFieldDef.aggregate));\n }\n return {\n groupbyChannel: dimensionDef ? dimensionChannel : undefined,\n fieldChannel: fieldChannel,\n impute: mark_1.isPathMark(mark),\n stackBy: stackBy,\n offset: offset\n };\n}\nexports.stack = stack;\n//# sourceMappingURL=data:application/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l2ZSBhZ2dyZWdhdGVcbiAgaWYgKHN0YWNrZWRGaWVsZERlZi5hZ2dyZWdhdGUgJiYgIWNvbnRhaW5zKFNVTV9PUFMsIHN0YWNrZWRGaWVsZERlZi5hZ2dyZWdhdGUpKSB7XG4gICAgbG9nLndhcm4obG9nLm1lc3NhZ2Uuc3RhY2tOb25TdW1tYXRpdmVBZ2dyZWdhdGUoc3RhY2tlZEZpZWxkRGVmLmFnZ3JlZ2F0ZSkpO1xuICB9XG5cbiAgcmV0dXJuIHtcbiAgICBncm91cGJ5Q2hhbm5lbDogZGltZW5zaW9uRGVmID8gZGltZW5zaW9uQ2hhbm5lbCA6IHVuZGVmaW5lZCxcbiAgICBmaWVsZENoYW5uZWwsXG4gICAgaW1wdXRlOiBpc1BhdGhNYXJrKG1hcmspLFxuICAgIHN0YWNrQnksXG4gICAgb2Zmc2V0XG4gIH07XG59XG4iXX0=","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar stack_1 = require(\"vega-lite/build/src/stack\");\nvar wildcard_1 = require(\"../wildcard\");\nvar property_1 = require(\"../property\");\nvar util_1 = require(\"../util\");\nvar encoding_1 = require(\"./encoding\");\nvar util_2 = require(\"datalib/src/util\");\n/**\n * Convert a Vega-Lite's ExtendedUnitSpec into a CompassQL's SpecQuery\n * @param {ExtendedUnitSpec} spec\n * @returns\n */\nfunction fromSpec(spec) {\n return util_1.extend(spec.data ? { data: spec.data } : {}, spec.transform ? { transform: spec.transform } : {}, spec.width ? { width: spec.width } : {}, spec.height ? { height: spec.height } : {}, spec.background ? { background: spec.background } : {}, spec.padding ? { padding: spec.padding } : {}, spec.title ? { title: spec.title } : {}, {\n mark: spec.mark,\n encodings: util_1.keys(spec.encoding).map(function (channel) {\n var encQ = { channel: channel };\n var channelDef = spec.encoding[channel];\n for (var prop in channelDef) {\n if (property_1.isEncodingTopLevelProperty(prop) && channelDef[prop] !== undefined) {\n // Currently bin, scale, axis, legend only support boolean, but not null.\n // Therefore convert null to false.\n if (util_1.contains(['bin', 'scale', 'axis', 'legend'], prop) && channelDef[prop] === null) {\n encQ[prop] = false;\n }\n else {\n encQ[prop] = channelDef[prop];\n }\n }\n }\n if (encoding_1.isFieldQuery(encQ) && encQ.aggregate === 'count' && !encQ.field) {\n encQ.field = '*';\n }\n return encQ;\n })\n }, spec.config ? { config: spec.config } : {});\n}\nexports.fromSpec = fromSpec;\nfunction isAggregate(specQ) {\n return util_1.some(specQ.encodings, function (encQ) {\n return (encoding_1.isFieldQuery(encQ) && !wildcard_1.isWildcard(encQ.aggregate) && !!encQ.aggregate) || encoding_1.isEnabledAutoCountQuery(encQ);\n });\n}\nexports.isAggregate = isAggregate;\n/**\n * @return The Vega-Lite `StackProperties` object that describes the stack\n * configuration of `specQ`. Returns `null` if this is not stackable.\n */\nfunction getVlStack(specQ) {\n if (!hasRequiredStackProperties(specQ)) {\n return null;\n }\n var encoding = encoding_1.toEncoding(specQ.encodings, { schema: null, wildcardMode: 'null' });\n var mark = specQ.mark;\n return stack_1.stack(mark, encoding, getStackOffset(specQ));\n}\nexports.getVlStack = getVlStack;\n/**\n * @return The `StackOffset` specified in `specQ`, `undefined` if none\n * is specified.\n */\nfunction getStackOffset(specQ) {\n for (var _i = 0, _a = specQ.encodings; _i < _a.length; _i++) {\n var encQ = _a[_i];\n if (encQ[property_1.Property.STACK] !== undefined && !wildcard_1.isWildcard(encQ[property_1.Property.STACK])) {\n return encQ[property_1.Property.STACK];\n }\n }\n return undefined;\n}\nexports.getStackOffset = getStackOffset;\n/**\n * @return The `Channel` in which `stack` is specified in `specQ`, or\n * `null` if none is specified.\n */\nfunction getStackChannel(specQ) {\n for (var _i = 0, _a = specQ.encodings; _i < _a.length; _i++) {\n var encQ = _a[_i];\n if (encQ[property_1.Property.STACK] !== undefined && !wildcard_1.isWildcard(encQ.channel)) {\n return encQ.channel;\n }\n }\n return null;\n}\nexports.getStackChannel = getStackChannel;\n/**\n * Returns true iff the given SpecQuery has the properties defined\n * to be a potential Stack spec.\n * @param specQ The SpecQuery in question.\n */\nfunction hasRequiredStackProperties(specQ) {\n // TODO(haldenl): make this leaner, a lot of encQ properties aren't required for stack.\n // TODO(haldenl): check mark, then encodings\n if (wildcard_1.isWildcard(specQ.mark)) {\n return false;\n }\n var requiredEncodingProps = [property_1.Property.STACK, property_1.Property.CHANNEL,\n property_1.Property.MARK, property_1.Property.FIELD, property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT, property_1.Property.SCALE,\n property_1.getEncodingNestedProp('scale', 'type'), property_1.Property.TYPE];\n var exclude = util_2.toMap(util_1.without(property_1.ALL_ENCODING_PROPS, requiredEncodingProps));\n var encodings = specQ.encodings.filter(function (encQ) { return !encoding_1.isDisabledAutoCountQuery(encQ); });\n for (var _i = 0, encodings_1 = encodings; _i < encodings_1.length; _i++) {\n var encQ = encodings_1[_i];\n if (objectContainsWildcard(encQ, { exclude: exclude })) {\n return false;\n }\n }\n return true;\n}\nexports.hasRequiredStackProperties = hasRequiredStackProperties;\n/**\n * Returns true iff the given object does not contain a nested wildcard.\n * @param obj The object in question.\n * @param opt With optional `exclude` property, which defines properties to\n * ignore when testing for wildcards.\n */\n// TODO(haldenl): rename to objectHasWildcard, rename prop to obj\nfunction objectContainsWildcard(obj, opt) {\n if (opt === void 0) { opt = {}; }\n if (!util_1.isObject(obj)) {\n return false;\n }\n for (var childProp in obj) {\n if (obj.hasOwnProperty(childProp)) {\n var wildcard = wildcard_1.isWildcard(obj[childProp]);\n if ((wildcard && (!opt.exclude || !opt.exclude[childProp])) ||\n objectContainsWildcard(obj[childProp], opt)) {\n return true;\n }\n }\n }\n return false;\n}\n/**\n * Returns true iff the given `specQ` contains a wildcard.\n * @param specQ The `SpecQuery` in question.\n * @param opt With optional `exclude` property, which defines properties to\n * ignore when testing for wildcards.\n */\nfunction hasWildcard(specQ, opt) {\n if (opt === void 0) { opt = {}; }\n var exclude = opt.exclude ? util_2.toMap(opt.exclude.map(property_1.toKey)) : {};\n if (wildcard_1.isWildcard(specQ.mark) && !exclude['mark']) {\n return true;\n }\n for (var _i = 0, _a = specQ.encodings; _i < _a.length; _i++) {\n var encQ = _a[_i];\n if (objectContainsWildcard(encQ, exclude)) {\n return true;\n }\n }\n return false;\n}\nexports.hasWildcard = hasWildcard;\n//# sourceMappingURL=spec.js.map","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = require(\"./util\");\nvar property_1 = require(\"./property\");\n/**\n * Dictionary that takes property as a key.\n */\nvar PropIndex = /** @class */ (function () {\n function PropIndex(i) {\n if (i === void 0) { i = null; }\n this.index = i ? __assign({}, i) : {};\n }\n PropIndex.prototype.has = function (p) {\n return property_1.toKey(p) in this.index;\n };\n PropIndex.prototype.get = function (p) {\n return this.index[property_1.toKey(p)];\n };\n PropIndex.prototype.set = function (p, value) {\n this.index[property_1.toKey(p)] = value;\n return this;\n };\n PropIndex.prototype.setByKey = function (key, value) {\n this.index[key] = value;\n };\n PropIndex.prototype.map = function (f) {\n var i = new PropIndex();\n for (var k in this.index) {\n i.index[k] = f(this.index[k]);\n }\n return i;\n };\n PropIndex.prototype.size = function () {\n return util_1.keys(this.index).length;\n };\n PropIndex.prototype.duplicate = function () {\n return new PropIndex(this.index);\n };\n return PropIndex;\n}());\nexports.PropIndex = PropIndex;\n//# sourceMappingURL=propindex.js.map","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar aggregate_1 = require(\"vega-lite/build/src/aggregate\");\nvar channel_1 = require(\"vega-lite/build/src/channel\");\nvar timeunit_1 = require(\"vega-lite/build/src/timeunit\");\nvar type_1 = require(\"vega-lite/build/src/type\");\nvar util_1 = require(\"datalib/src/util\");\nvar encoding_1 = require(\"./encoding\");\nvar spec_1 = require(\"./spec\");\nvar wildcard_1 = require(\"../wildcard\");\nvar property_1 = require(\"../property\");\nvar propindex_1 = require(\"../propindex\");\nvar util_2 = require(\"../util\");\nfunction getReplacerIndex(replaceIndex) {\n return replaceIndex.map(function (r) { return getReplacer(r); });\n}\nexports.getReplacerIndex = getReplacerIndex;\nfunction getReplacer(replace) {\n return function (s) {\n if (replace[s] !== undefined) {\n return replace[s];\n }\n return s;\n };\n}\nexports.getReplacer = getReplacer;\nfunction value(v, replacer) {\n if (wildcard_1.isWildcard(v)) {\n // Return the enum array if it's a full wildcard, or just return SHORT_WILDCARD for short ones.\n if (!wildcard_1.isShortWildcard(v) && v.enum) {\n return wildcard_1.SHORT_WILDCARD + JSON.stringify(v.enum);\n }\n else {\n return wildcard_1.SHORT_WILDCARD;\n }\n }\n if (replacer) {\n return replacer(v);\n }\n return v;\n}\nexports.value = value;\nfunction replace(v, replacer) {\n if (replacer) {\n return replacer(v);\n }\n return v;\n}\nexports.replace = replace;\nexports.REPLACE_NONE = new propindex_1.PropIndex();\nexports.INCLUDE_ALL = \n// FIXME: remove manual TRANSFORM concat once we really support enumerating transform.\n[].concat(property_1.DEFAULT_PROP_PRECEDENCE, property_1.SORT_PROPS, [property_1.Property.TRANSFORM, property_1.Property.STACK], property_1.VIEW_PROPS)\n .reduce(function (pi, prop) { return pi.set(prop, true); }, new propindex_1.PropIndex());\nfunction vlSpec(vlspec, include, replace) {\n if (include === void 0) { include = exports.INCLUDE_ALL; }\n if (replace === void 0) { replace = exports.REPLACE_NONE; }\n var specQ = spec_1.fromSpec(vlspec);\n return spec(specQ, include, replace);\n}\nexports.vlSpec = vlSpec;\nexports.PROPERTY_SUPPORTED_CHANNELS = {\n axis: { x: true, y: true, row: true, column: true },\n legend: { color: true, opacity: true, size: true, shape: true },\n scale: { x: true, y: true, color: true, opacity: true, row: true, column: true, size: true, shape: true },\n sort: { x: true, y: true, path: true, order: true },\n stack: { x: true, y: true },\n};\n/**\n * Returns a shorthand for a spec query\n * @param specQ a spec query\n * @param include Dict Set listing property types (key) to be included in the shorthand\n * @param replace Dictionary of replace function for values of a particular property type (key)\n */\nfunction spec(specQ, include, replace) {\n if (include === void 0) { include = exports.INCLUDE_ALL; }\n if (replace === void 0) { replace = exports.REPLACE_NONE; }\n var parts = [];\n if (include.get(property_1.Property.MARK)) {\n parts.push(value(specQ.mark, replace.get(property_1.Property.MARK)));\n }\n if (specQ.transform && specQ.transform.length > 0) {\n parts.push('transform:' + JSON.stringify(specQ.transform));\n }\n var stack;\n if (include.get(property_1.Property.STACK)) {\n stack = spec_1.getVlStack(specQ);\n }\n if (specQ.encodings) {\n var encodings = specQ.encodings.reduce(function (encQs, encQ) {\n // Exclude encoding mapping with autoCount=false as they are basically disabled.\n if (!encoding_1.isDisabledAutoCountQuery(encQ)) {\n var str = void 0;\n if (!!stack && encQ.channel === stack.fieldChannel) {\n str = encoding(__assign({}, encQ, { stack: stack.offset }), include, replace);\n }\n else {\n str = encoding(encQ, include, replace);\n }\n if (str) {\n encQs.push(str);\n }\n }\n return encQs;\n }, [])\n .sort() // sort at the end to ignore order\n .join('|');\n if (encodings) {\n parts.push(encodings);\n }\n }\n for (var _i = 0, VIEW_PROPS_1 = property_1.VIEW_PROPS; _i < VIEW_PROPS_1.length; _i++) {\n var viewProp = VIEW_PROPS_1[_i];\n var propString = viewProp.toString();\n if (include.get(viewProp) && !!specQ[propString]) {\n var value_1 = specQ[propString];\n parts.push(propString + \"=\" + JSON.stringify(value_1));\n }\n }\n return parts.join('|');\n}\nexports.spec = spec;\n/**\n * Returns a shorthand for an encoding query\n * @param encQ an encoding query\n * @param include Dict Set listing property types (key) to be included in the shorthand\n * @param replace Dictionary of replace function for values of a particular property type (key)\n */\nfunction encoding(encQ, include, replace) {\n if (include === void 0) { include = exports.INCLUDE_ALL; }\n if (replace === void 0) { replace = exports.REPLACE_NONE; }\n var parts = [];\n if (include.get(property_1.Property.CHANNEL)) {\n parts.push(value(encQ.channel, replace.get(property_1.Property.CHANNEL)));\n }\n if (encoding_1.isFieldQuery(encQ)) {\n var fieldDefStr = fieldDef(encQ, include, replace);\n if (fieldDefStr) {\n parts.push(fieldDefStr);\n }\n }\n else if (encoding_1.isValueQuery(encQ)) {\n parts.push(encQ.value);\n }\n else if (encoding_1.isAutoCountQuery(encQ)) {\n parts.push('autocount()');\n }\n return parts.join(':');\n}\nexports.encoding = encoding;\n/**\n * Returns a field definition shorthand for an encoding query\n * @param encQ an encoding query\n * @param include Dict Set listing property types (key) to be included in the shorthand\n * @param replace Dictionary of replace function for values of a particular property type (key)\n */\nfunction fieldDef(encQ, include, replacer) {\n if (include === void 0) { include = exports.INCLUDE_ALL; }\n if (replacer === void 0) { replacer = exports.REPLACE_NONE; }\n if (include.get(property_1.Property.AGGREGATE) && encoding_1.isDisabledAutoCountQuery(encQ)) {\n return '-';\n }\n var fn = func(encQ, include, replacer);\n var props = fieldDefProps(encQ, include, replacer);\n var fieldAndParams;\n if (encoding_1.isFieldQuery(encQ)) {\n // field\n fieldAndParams = include.get('field') ? value(encQ.field, replacer.get('field')) : '...';\n // type\n if (include.get(property_1.Property.TYPE)) {\n if (wildcard_1.isWildcard(encQ.type)) {\n fieldAndParams += ',' + value(encQ.type, replacer.get(property_1.Property.TYPE));\n }\n else {\n var typeShort = ((encQ.type || type_1.Type.QUANTITATIVE) + '').substr(0, 1);\n fieldAndParams += ',' + value(typeShort, replacer.get(property_1.Property.TYPE));\n }\n }\n // encoding properties\n fieldAndParams += props.map(function (p) {\n var val = p.value instanceof Array ? '[' + p.value + ']' : p.value;\n return ',' + p.key + '=' + val;\n }).join('');\n }\n else if (encoding_1.isAutoCountQuery(encQ)) {\n fieldAndParams = '*,q';\n }\n if (!fieldAndParams) {\n return null;\n }\n if (fn) {\n var fnPrefix = util_1.isString(fn) ? fn : wildcard_1.SHORT_WILDCARD +\n (util_2.keys(fn).length > 0 ? JSON.stringify(fn) : '');\n return fnPrefix + '(' + fieldAndParams + ')';\n }\n return fieldAndParams;\n}\nexports.fieldDef = fieldDef;\n/**\n * Return function part of\n */\nfunction func(fieldQ, include, replacer) {\n if (include.get(property_1.Property.AGGREGATE) && fieldQ.aggregate && !wildcard_1.isWildcard(fieldQ.aggregate)) {\n return replace(fieldQ.aggregate, replacer.get(property_1.Property.AGGREGATE));\n }\n else if (include.get(property_1.Property.AGGREGATE) && encoding_1.isEnabledAutoCountQuery(fieldQ)) {\n // autoCount is considered a part of aggregate\n return replace('count', replacer.get(property_1.Property.AGGREGATE));\n ;\n }\n else if (include.get(property_1.Property.TIMEUNIT) && fieldQ.timeUnit && !wildcard_1.isWildcard(fieldQ.timeUnit)) {\n return replace(fieldQ.timeUnit, replacer.get(property_1.Property.TIMEUNIT));\n }\n else if (include.get(property_1.Property.BIN) && fieldQ.bin && !wildcard_1.isWildcard(fieldQ.bin)) {\n return 'bin';\n }\n else {\n var fn = null;\n for (var _i = 0, _a = [property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT, property_1.Property.TIMEUNIT, property_1.Property.BIN]; _i < _a.length; _i++) {\n var prop = _a[_i];\n var val = fieldQ[prop];\n if (include.get(prop) && fieldQ[prop] && wildcard_1.isWildcard(val)) {\n // assign fnEnumIndex[prop] = array of enum values or just \"?\" if it is SHORT_WILDCARD\n fn = fn || {};\n fn[prop] = wildcard_1.isShortWildcard(val) ? val : val.enum;\n }\n }\n if (fn && fieldQ.hasFn) {\n fn.hasFn = true;\n }\n return fn;\n }\n}\n/**\n * Return key-value of parameters of field defs\n */\nfunction fieldDefProps(fieldQ, include, replacer) {\n /** Encoding properties e.g., Scale, Axis, Legend */\n var props = [];\n // Parameters of function such as bin will be just top-level properties\n if (!util_2.isBoolean(fieldQ.bin) && !wildcard_1.isShortWildcard(fieldQ.bin)) {\n var bin = fieldQ.bin;\n for (var child in bin) {\n var prop = property_1.getEncodingNestedProp('bin', child);\n if (prop && include.get(prop) && bin[child] !== undefined) {\n props.push({\n key: child,\n value: value(bin[child], replacer.get(prop))\n });\n }\n }\n // Sort to make sure that parameter are ordered consistently\n props.sort(function (a, b) { return a.key.localeCompare(b.key); });\n }\n for (var _i = 0, _a = [property_1.Property.SCALE, property_1.Property.SORT, property_1.Property.STACK, property_1.Property.AXIS, property_1.Property.LEGEND]; _i < _a.length; _i++) {\n var parent_1 = _a[_i];\n if (!wildcard_1.isWildcard(fieldQ.channel) && !exports.PROPERTY_SUPPORTED_CHANNELS[parent_1][fieldQ.channel]) {\n continue;\n }\n if (include.get(parent_1) && fieldQ[parent_1] !== undefined) {\n var parentValue = fieldQ[parent_1];\n if (util_2.isBoolean(parentValue) || parentValue === null) {\n // `scale`, `axis`, `legend` can be false/null.\n props.push({\n key: parent_1 + '',\n value: parentValue || false // return true or false (false if null)\n });\n }\n else if (util_1.isString(parentValue)) {\n // `sort` can be a string (ascending/descending).\n props.push({\n key: parent_1 + '',\n value: replace(JSON.stringify(parentValue), replacer.get(parent_1))\n });\n }\n else {\n var nestedPropChildren = [];\n for (var child in parentValue) {\n var nestedProp = property_1.getEncodingNestedProp(parent_1, child);\n if (nestedProp && include.get(nestedProp) && parentValue[child] !== undefined) {\n nestedPropChildren.push({\n key: child,\n value: value(parentValue[child], replacer.get(nestedProp))\n });\n }\n }\n if (nestedPropChildren.length > 0) {\n var nestedPropObject = nestedPropChildren.sort(function (a, b) { return a.key.localeCompare(b.key); })\n .reduce(function (o, item) {\n o[item.key] = item.value;\n return o;\n }, {});\n // Sort to make sure that parameter are ordered consistently\n props.push({\n key: parent_1 + '',\n value: JSON.stringify(nestedPropObject)\n });\n }\n }\n }\n }\n return props;\n}\nfunction parse(shorthand) {\n // TODO(https://github.com/uwdata/compassql/issues/259):\n // Do not split directly, but use an upgraded version of `getClosingBraceIndex()`\n var splitShorthand = shorthand.split('|');\n var specQ = {\n mark: splitShorthand[0],\n encodings: []\n };\n for (var i = 1; i < splitShorthand.length; i++) {\n var part = splitShorthand[i];\n var splitPart = splitWithTail(part, ':', 1);\n var splitPartKey = splitPart[0];\n var splitPartValue = splitPart[1];\n if (channel_1.isChannel(splitPartKey) || splitPartKey === '?') {\n var encQ = shorthandParser.encoding(splitPartKey, splitPartValue);\n specQ.encodings.push(encQ);\n continue;\n }\n if (splitPartKey === 'transform') {\n specQ.transform = JSON.parse(splitPartValue);\n continue;\n }\n }\n return specQ;\n}\nexports.parse = parse;\n/**\n * Split a string n times into substrings with the specified delimiter and return them as an array.\n * @param str The string to be split\n * @param delim The delimiter string used to separate the string\n * @param number The value used to determine how many times the string is split\n */\nfunction splitWithTail(str, delim, count) {\n var result = [];\n var lastIndex = 0;\n for (var i = 0; i < count; i++) {\n var indexOfDelim = str.indexOf(delim, lastIndex);\n if (indexOfDelim !== -1) {\n result.push(str.substring(lastIndex, indexOfDelim));\n lastIndex = indexOfDelim + 1;\n }\n else {\n break;\n }\n }\n result.push(str.substr(lastIndex));\n // If the specified count is greater than the number of delimiters that exist in the string,\n // an empty string will be pushed count minus number of delimiter occurence times.\n if (result.length !== count + 1) {\n while (result.length !== count + 1) {\n result.push('');\n }\n }\n return result;\n}\nexports.splitWithTail = splitWithTail;\nvar shorthandParser;\n(function (shorthandParser) {\n function encoding(channel, fieldDefShorthand) {\n var encQMixins = fieldDefShorthand.indexOf('(') !== -1 ?\n fn(fieldDefShorthand) :\n rawFieldDef(splitWithTail(fieldDefShorthand, ',', 2));\n return __assign({ channel: channel }, encQMixins);\n }\n shorthandParser.encoding = encoding;\n function rawFieldDef(fieldDefPart) {\n var fieldQ = {};\n fieldQ.field = fieldDefPart[0];\n fieldQ.type = type_1.getFullName(fieldDefPart[1].toUpperCase()) || '?';\n var partParams = fieldDefPart[2];\n var closingBraceIndex = 0;\n var i = 0;\n while (i < partParams.length) {\n var propEqualSignIndex = partParams.indexOf('=', i);\n var parsedValue = void 0;\n if (propEqualSignIndex !== -1) {\n var prop = partParams.substring(i, propEqualSignIndex);\n if (partParams[i + prop.length + 1] === '{') {\n var openingBraceIndex = i + prop.length + 1;\n closingBraceIndex = getClosingIndex(openingBraceIndex, partParams, '}');\n var value_2 = partParams.substring(openingBraceIndex, closingBraceIndex + 1);\n parsedValue = JSON.parse(value_2);\n // index after next comma\n i = closingBraceIndex + 2;\n }\n else if (partParams[i + prop.length + 1] === '[') {\n // find closing square bracket\n var openingBracketIndex = i + prop.length + 1;\n var closingBracketIndex = getClosingIndex(openingBracketIndex, partParams, ']');\n var value_3 = partParams.substring(openingBracketIndex, closingBracketIndex + 1);\n parsedValue = JSON.parse(value_3);\n // index after next comma\n i = closingBracketIndex + 2;\n }\n else {\n var propIndex = i;\n // Substring until the next comma (or end of the string)\n var nextCommaIndex = partParams.indexOf(',', i + prop.length);\n if (nextCommaIndex === -1) {\n nextCommaIndex = partParams.length;\n }\n // index after next comma\n i = nextCommaIndex + 1;\n parsedValue = JSON.parse(partParams.substring(propIndex + prop.length + 1, nextCommaIndex));\n }\n if (property_1.isEncodingNestedParent(prop)) {\n fieldQ[prop] = parsedValue;\n }\n else {\n // prop is a property of the aggregation function such as bin\n fieldQ.bin = fieldQ.bin || {};\n fieldQ.bin[prop] = parsedValue;\n }\n }\n else {\n // something is wrong with the format of the partParams\n // exits loop if don't have then infintie loop\n break;\n }\n }\n return fieldQ;\n }\n shorthandParser.rawFieldDef = rawFieldDef;\n function getClosingIndex(openingBraceIndex, str, closingChar) {\n for (var i = openingBraceIndex; i < str.length; i++) {\n if (str[i] === closingChar) {\n return i;\n }\n }\n }\n shorthandParser.getClosingIndex = getClosingIndex;\n function fn(fieldDefShorthand) {\n var fieldQ = {};\n // Aggregate, Bin, TimeUnit as wildcard case\n if (fieldDefShorthand[0] === '?') {\n var closingBraceIndex = getClosingIndex(1, fieldDefShorthand, '}');\n var fnEnumIndex = JSON.parse(fieldDefShorthand.substring(1, closingBraceIndex + 1));\n for (var encodingProperty in fnEnumIndex) {\n if (util_2.isArray(fnEnumIndex[encodingProperty])) {\n fieldQ[encodingProperty] = { enum: fnEnumIndex[encodingProperty] };\n }\n else {\n fieldQ[encodingProperty] = fnEnumIndex[encodingProperty];\n }\n }\n return __assign({}, fieldQ, rawFieldDef(splitWithTail(fieldDefShorthand.substring(closingBraceIndex + 2, fieldDefShorthand.length - 1), ',', 2)));\n }\n else {\n var func_1 = fieldDefShorthand.substring(0, fieldDefShorthand.indexOf('('));\n var insideFn = fieldDefShorthand.substring(func_1.length + 1, fieldDefShorthand.length - 1);\n var insideFnParts = splitWithTail(insideFn, ',', 2);\n if (aggregate_1.isAggregateOp(func_1)) {\n return __assign({ aggregate: func_1 }, rawFieldDef(insideFnParts));\n }\n else if (timeunit_1.isTimeUnit(func_1)) {\n return __assign({ timeUnit: func_1 }, rawFieldDef(insideFnParts));\n }\n else if (func_1 === 'bin') {\n return __assign({ bin: {} }, rawFieldDef(insideFnParts));\n }\n }\n }\n shorthandParser.fn = fn;\n})(shorthandParser = exports.shorthandParser || (exports.shorthandParser = {}));\n//# sourceMappingURL=shorthand.js.map","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar vlFieldDef = require(\"vega-lite/build/src/fielddef\");\nvar type_1 = require(\"vega-lite/build/src/type\");\nvar expandedtype_1 = require(\"./expandedtype\");\nvar type_2 = require(\"vega-lite/build/src/compile/scale/type\");\nvar wildcard_1 = require(\"../wildcard\");\nvar property_1 = require(\"../property\");\nvar shorthand_1 = require(\"./shorthand\");\nvar util_1 = require(\"datalib/src/util\");\nfunction isValueQuery(encQ) {\n return encQ !== null && encQ !== undefined && encQ['value'] !== undefined;\n}\nexports.isValueQuery = isValueQuery;\nfunction isFieldQuery(encQ) {\n return encQ !== null && encQ !== undefined && (encQ['field'] || encQ['aggregate'] === 'count');\n}\nexports.isFieldQuery = isFieldQuery;\nfunction isAutoCountQuery(encQ) {\n return encQ !== null && encQ !== undefined && 'autoCount' in encQ;\n}\nexports.isAutoCountQuery = isAutoCountQuery;\nfunction isDisabledAutoCountQuery(encQ) {\n return isAutoCountQuery(encQ) && encQ.autoCount === false;\n}\nexports.isDisabledAutoCountQuery = isDisabledAutoCountQuery;\nfunction isEnabledAutoCountQuery(encQ) {\n return isAutoCountQuery(encQ) && encQ.autoCount === true;\n}\nexports.isEnabledAutoCountQuery = isEnabledAutoCountQuery;\nvar DEFAULT_PROPS = [property_1.Property.AGGREGATE, property_1.Property.BIN, property_1.Property.TIMEUNIT, property_1.Property.FIELD, property_1.Property.TYPE, property_1.Property.SCALE, property_1.Property.SORT, property_1.Property.AXIS, property_1.Property.LEGEND, property_1.Property.STACK, property_1.Property.FORMAT];\nfunction toEncoding(encQs, params) {\n var _a = params.wildcardMode, wildcardMode = _a === void 0 ? 'skip' : _a;\n var encoding = {};\n for (var _i = 0, encQs_1 = encQs; _i < encQs_1.length; _i++) {\n var encQ = encQs_1[_i];\n if (isDisabledAutoCountQuery(encQ)) {\n continue; // Do not include this in the output.\n }\n var channel = encQ.channel;\n // if channel is a wildcard, return null\n if (wildcard_1.isWildcard(channel)) {\n throw new Error('Cannot convert wildcard channel to a fixed channel');\n }\n var channelDef = isValueQuery(encQ) ? toValueDef(encQ) : toFieldDef(encQ, params);\n if (channelDef === null) {\n if (params.wildcardMode === 'null') {\n // contains invalid property (e.g., wildcard, thus cannot return a proper spec.)\n return null;\n }\n continue;\n }\n // Otherwise, we can set the channelDef\n encoding[channel] = channelDef;\n }\n return encoding;\n}\nexports.toEncoding = toEncoding;\nfunction toValueDef(valueQ) {\n var value = valueQ.value;\n if (wildcard_1.isWildcard(value)) {\n return null;\n }\n return { value: value };\n}\nexports.toValueDef = toValueDef;\nfunction toFieldDef(encQ, params) {\n if (params === void 0) { params = {}; }\n var _a = params.props, props = _a === void 0 ? DEFAULT_PROPS : _a, schema = params.schema, _b = params.wildcardMode, wildcardMode = _b === void 0 ? 'skip' : _b;\n if (isFieldQuery(encQ)) {\n var fieldDef = {};\n for (var _i = 0, props_1 = props; _i < props_1.length; _i++) {\n var prop = props_1[_i];\n var encodingProperty = encQ[prop];\n if (wildcard_1.isWildcard(encodingProperty)) {\n if (wildcardMode === 'skip')\n continue;\n return null;\n }\n if (encodingProperty !== undefined) {\n // if the channel supports this prop\n var isSupportedByChannel = (!shorthand_1.PROPERTY_SUPPORTED_CHANNELS[prop] || shorthand_1.PROPERTY_SUPPORTED_CHANNELS[prop][encQ.channel]);\n if (!isSupportedByChannel) {\n continue;\n }\n if (property_1.isEncodingNestedParent(prop) && util_1.isObject(encodingProperty)) {\n encodingProperty = __assign({}, encodingProperty); // Make a shallow copy first\n for (var childProp in encodingProperty) {\n // ensure nested properties are not wildcard before assigning to field def\n if (wildcard_1.isWildcard(encodingProperty[childProp])) {\n if (wildcardMode === 'null') {\n return null;\n }\n delete encodingProperty[childProp]; // skip\n }\n }\n }\n if (prop === 'bin' && encodingProperty === false) {\n continue;\n }\n else if (prop === 'type' && encodingProperty === 'key') {\n fieldDef.type = 'nominal';\n }\n else {\n fieldDef[prop] = encodingProperty;\n }\n }\n if (prop === property_1.Property.SCALE && schema && encQ.type === type_1.Type.ORDINAL) {\n var scale = encQ.scale;\n var ordinalDomain = schema.fieldSchema(encQ.field).ordinalDomain;\n if (scale !== null && ordinalDomain) {\n fieldDef[property_1.Property.SCALE] = __assign({ domain: ordinalDomain }, (util_1.isObject(scale) ? scale : {}));\n }\n }\n }\n return fieldDef;\n }\n else {\n if (encQ.autoCount === false) {\n throw new Error(\"Cannot convert {autoCount: false} into a field def\");\n }\n else {\n return {\n aggregate: 'count',\n field: '*',\n type: 'quantitative'\n };\n }\n }\n}\nexports.toFieldDef = toFieldDef;\n/**\n * Is a field query continuous field?\n * This method is applicable only for fieldQuery without wildcard\n */\nfunction isContinuous(encQ) {\n if (isFieldQuery(encQ)) {\n return vlFieldDef.isContinuous(toFieldDef(encQ, { props: ['bin', 'timeUnit', 'field', 'type'] }));\n }\n return isAutoCountQuery(encQ);\n}\nexports.isContinuous = isContinuous;\nfunction isMeasure(encQ) {\n if (isFieldQuery(encQ)) {\n return !isDimension(encQ) && encQ.type !== 'temporal';\n }\n return isAutoCountQuery(encQ);\n}\nexports.isMeasure = isMeasure;\n/**\n * Is a field query discrete field?\n * This method is applicable only for fieldQuery without wildcard\n */\nfunction isDimension(encQ) {\n if (isFieldQuery(encQ)) {\n var fieldDef = toFieldDef(encQ, { props: ['bin', 'timeUnit', 'type'] });\n return vlFieldDef.isDiscrete(fieldDef) || !!fieldDef.timeUnit;\n }\n return false;\n}\nexports.isDimension = isDimension;\n/**\n * Returns the true scale type of an encoding.\n * @returns {ScaleType} If the scale type was not specified, it is inferred from the encoding's Type.\n * @returns {undefined} If the scale type was not specified and Type (or TimeUnit if applicable) is a Wildcard, there is no clear scale type\n */\nfunction scaleType(fieldQ) {\n var scale = fieldQ.scale === true || fieldQ.scale === wildcard_1.SHORT_WILDCARD ? {} : fieldQ.scale || {};\n var type = fieldQ.type, channel = fieldQ.channel, timeUnit = fieldQ.timeUnit, bin = fieldQ.bin;\n // HACK: All of markType, and scaleConfig only affect\n // sub-type of ordinal to quantitative scales (point or band)\n // Currently, most of scaleType usage in CompassQL doesn't care about this subtle difference.\n // Thus, instead of making this method requiring the global mark,\n // we will just call it with mark = undefined .\n // Thus, currently, we will always get a point scale unless a CompassQuery specifies band.\n var markType = undefined;\n var scaleConfig = {};\n if (wildcard_1.isWildcard(scale.type) || wildcard_1.isWildcard(type) || wildcard_1.isWildcard(channel) || wildcard_1.isWildcard(bin)) {\n return undefined;\n }\n // If scale type is specified, then use scale.type\n if (scale.type) {\n return scale.type;\n }\n // if type is fixed and it's not temporal, we can ignore time unit.\n if (type === 'temporal' && wildcard_1.isWildcard(timeUnit)) {\n return undefined;\n }\n // if type is fixed and it's not quantitative, we can ignore bin\n if (type === 'quantitative' && wildcard_1.isWildcard(bin)) {\n return undefined;\n }\n var vegaLiteType = type === expandedtype_1.ExpandedType.KEY ? 'nominal' : type;\n var fieldDef = { type: vegaLiteType, timeUnit: timeUnit, bin: bin };\n return type_2.scaleType(scale.type, channel, fieldDef, markType, scaleConfig);\n}\nexports.scaleType = scaleType;\n//# sourceMappingURL=encoding.js.map","var util = require('../util');\n\nvar TYPES = '__types__';\n\nvar PARSERS = {\n boolean: util.boolean,\n integer: util.number,\n number: util.number,\n date: util.date,\n string: function(x) { return x == null || x === '' ? null : x + ''; }\n};\n\nvar TESTS = {\n boolean: function(x) { return x==='true' || x==='false' || util.isBoolean(x); },\n integer: function(x) { return TESTS.number(x) && (x=+x) === ~~x; },\n number: function(x) { return !isNaN(+x) && !util.isDate(x); },\n date: function(x) { return !isNaN(Date.parse(x)); }\n};\n\nfunction annotation(data, types) {\n if (!types) return data && data[TYPES] || null;\n data[TYPES] = types;\n}\n\nfunction fieldNames(datum) {\n return util.keys(datum);\n}\n\nfunction bracket(fieldName) {\n return '[' + fieldName + ']';\n}\n\nfunction type(values, f) {\n values = util.array(values);\n f = util.$(f);\n var v, i, n;\n\n // if data array has type annotations, use them\n if (values[TYPES]) {\n v = f(values[TYPES]);\n if (util.isString(v)) return v;\n }\n\n for (i=0, n=values.length; !util.isValid(v) && i stop) range.push(j);\n else while ((j = start + step * ++i) < stop) range.push(j);\n return range;\n};\n\ngen.random = {};\n\ngen.random.uniform = function(min, max) {\n if (max === undefined) {\n max = min === undefined ? 1 : min;\n min = 0;\n }\n var d = max - min;\n var f = function() {\n return min + d * Math.random();\n };\n f.samples = function(n) {\n return gen.zeros(n).map(f);\n };\n f.pdf = function(x) {\n return (x >= min && x <= max) ? 1/d : 0;\n };\n f.cdf = function(x) {\n return x < min ? 0 : x > max ? 1 : (x - min) / d;\n };\n f.icdf = function(p) {\n return (p >= 0 && p <= 1) ? min + p*d : NaN;\n };\n return f;\n};\n\ngen.random.integer = function(a, b) {\n if (b === undefined) {\n b = a;\n a = 0;\n }\n var d = b - a;\n var f = function() {\n return a + Math.floor(d * Math.random());\n };\n f.samples = function(n) {\n return gen.zeros(n).map(f);\n };\n f.pdf = function(x) {\n return (x === Math.floor(x) && x >= a && x < b) ? 1/d : 0;\n };\n f.cdf = function(x) {\n var v = Math.floor(x);\n return v < a ? 0 : v >= b ? 1 : (v - a + 1) / d;\n };\n f.icdf = function(p) {\n return (p >= 0 && p <= 1) ? a - 1 + Math.floor(p*d) : NaN;\n };\n return f;\n};\n\ngen.random.normal = function(mean, stdev) {\n mean = mean || 0;\n stdev = stdev || 1;\n var next;\n var f = function() {\n var x = 0, y = 0, rds, c;\n if (next !== undefined) {\n x = next;\n next = undefined;\n return x;\n }\n do {\n x = Math.random()*2-1;\n y = Math.random()*2-1;\n rds = x*x + y*y;\n } while (rds === 0 || rds > 1);\n c = Math.sqrt(-2*Math.log(rds)/rds); // Box-Muller transform\n next = mean + y*c*stdev;\n return mean + x*c*stdev;\n };\n f.samples = function(n) {\n return gen.zeros(n).map(f);\n };\n f.pdf = function(x) {\n var exp = Math.exp(Math.pow(x-mean, 2) / (-2 * Math.pow(stdev, 2)));\n return (1 / (stdev * Math.sqrt(2*Math.PI))) * exp;\n };\n f.cdf = function(x) {\n // Approximation from West (2009)\n // Better Approximations to Cumulative Normal Functions\n var cd,\n z = (x - mean) / stdev,\n Z = Math.abs(z);\n if (Z > 37) {\n cd = 0;\n } else {\n var sum, exp = Math.exp(-Z*Z/2);\n if (Z < 7.07106781186547) {\n sum = 3.52624965998911e-02 * Z + 0.700383064443688;\n sum = sum * Z + 6.37396220353165;\n sum = sum * Z + 33.912866078383;\n sum = sum * Z + 112.079291497871;\n sum = sum * Z + 221.213596169931;\n sum = sum * Z + 220.206867912376;\n cd = exp * sum;\n sum = 8.83883476483184e-02 * Z + 1.75566716318264;\n sum = sum * Z + 16.064177579207;\n sum = sum * Z + 86.7807322029461;\n sum = sum * Z + 296.564248779674;\n sum = sum * Z + 637.333633378831;\n sum = sum * Z + 793.826512519948;\n sum = sum * Z + 440.413735824752;\n cd = cd / sum;\n } else {\n sum = Z + 0.65;\n sum = Z + 4 / sum;\n sum = Z + 3 / sum;\n sum = Z + 2 / sum;\n sum = Z + 1 / sum;\n cd = exp / sum / 2.506628274631;\n }\n }\n return z > 0 ? 1 - cd : cd;\n };\n f.icdf = function(p) {\n // Approximation of Probit function using inverse error function.\n if (p <= 0 || p >= 1) return NaN;\n var x = 2*p - 1,\n v = (8 * (Math.PI - 3)) / (3 * Math.PI * (4-Math.PI)),\n a = (2 / (Math.PI*v)) + (Math.log(1 - Math.pow(x,2)) / 2),\n b = Math.log(1 - (x*x)) / v,\n s = (x > 0 ? 1 : -1) * Math.sqrt(Math.sqrt((a*a) - b) - a);\n return mean + stdev * Math.SQRT2 * s;\n };\n return f;\n};\n\ngen.random.bootstrap = function(domain, smooth) {\n // Generates a bootstrap sample from a set of observations.\n // Smooth bootstrapping adds random zero-centered noise to the samples.\n var val = domain.filter(util.isValid),\n len = val.length,\n err = smooth ? gen.random.normal(0, smooth) : null;\n var f = function() {\n return val[~~(Math.random()*len)] + (err ? err() : 0);\n };\n f.samples = function(n) {\n return gen.zeros(n).map(f);\n };\n return f;\n};","var util = require('./util');\nvar type = require('./import/type');\nvar gen = require('./generate');\n\nvar stats = module.exports;\n\n// Collect unique values.\n// Output: an array of unique values, in first-observed order\nstats.unique = function(values, f, results) {\n f = util.$(f);\n results = results || [];\n var u = {}, v, i, n;\n for (i=0, n=values.length; i 0 ? Math.pow(mean, 1/c) : 0;\n return mean;\n};\n\n// Compute the harmonic mean of an array of numbers.\nstats.mean.harmonic = function(values, f) {\n f = util.$(f);\n var mean = 0, c, n, v, i;\n for (i=0, c=0, n=values.length; i b) b = v;\n }\n }\n return [a, b];\n};\n\n// Find the integer indices of the minimum and maximum values.\nstats.extent.index = function(values, f) {\n f = util.$(f);\n var x = -1, y = -1, a, b, v, i, n = values.length;\n for (i=0; i b) { b = v; y = i; }\n }\n }\n return [x, y];\n};\n\n// Compute the dot product of two arrays of numbers.\nstats.dot = function(values, a, b) {\n var sum = 0, i, v;\n if (!b) {\n if (values.length !== a.length) {\n throw Error('Array lengths must match.');\n }\n for (i=0; i -1 && p !== v) {\n mu = 1 + (i-1 + tie) / 2;\n for (; tie -1) {\n mu = 1 + (n-1 + tie) / 2;\n for (; tie max) max = x;\n delta = x - mean;\n mean = mean + delta / (++valid);\n M2 = M2 + delta * (x - mean);\n vals.push(x);\n }\n }\n M2 = M2 / (valid - 1);\n sd = Math.sqrt(M2);\n\n // sort values for median and iqr\n vals.sort(util.cmp);\n\n return {\n type: type(values, f),\n unique: u,\n count: values.length,\n valid: valid,\n missing: missing,\n distinct: distinct,\n min: min,\n max: max,\n mean: mean,\n stdev: sd,\n median: (v = stats.quantile(vals, 0.5)),\n q1: stats.quantile(vals, 0.25),\n q3: stats.quantile(vals, 0.75),\n modeskew: sd === 0 ? 0 : (mean - v) / sd\n };\n};\n\n// Compute profiles for all variables in a data set.\nstats.summary = function(data, fields) {\n fields = fields || util.keys(data[0]);\n var s = fields.map(function(f) {\n var p = stats.profile(data, util.$(f));\n return (p.field = f, p);\n });\n return (s.__summary__ = true, s);\n};\n","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define('d3-time', ['exports'], factory) :\n factory((global.d3_time = {}));\n}(this, function (exports) { 'use strict';\n\n var t0 = new Date;\n var t1 = new Date;\n function newInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = new Date(+date)), date;\n }\n\n interval.floor = interval;\n\n interval.round = function(date) {\n var d0 = new Date(+date),\n d1 = new Date(date - 1);\n floori(d0), floori(d1), offseti(d1, 1);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.ceil = function(date) {\n return floori(date = new Date(date - 1)), offseti(date, 1), date;\n };\n\n interval.offset = function(date, step) {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = function(start, stop, step) {\n var range = [];\n start = new Date(start - 1);\n stop = new Date(+stop);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n offseti(start, 1), floori(start);\n if (start < stop) range.push(new Date(+start));\n while (offseti(start, step), floori(start), start < stop) range.push(new Date(+start));\n return range;\n };\n\n interval.filter = function(test) {\n return newInterval(function(date) {\n while (floori(date), !test(date)) date.setTime(date - 1);\n }, function(date, step) {\n while (--step >= 0) while (offseti(date, 1), !test(date));\n });\n };\n\n if (count) {\n interval.count = function(start, end) {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = function(step) {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? function(d) { return field(d) % step === 0; }\n : function(d) { return interval.count(0, d) % step === 0; });\n };\n }\n\n return interval;\n };\n\n var millisecond = newInterval(function() {\n // noop\n }, function(date, step) {\n date.setTime(+date + step);\n }, function(start, end) {\n return end - start;\n });\n\n // An optimized implementation for this simple case.\n millisecond.every = function(k) {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return newInterval(function(date) {\n date.setTime(Math.floor(date / k) * k);\n }, function(date, step) {\n date.setTime(+date + step * k);\n }, function(start, end) {\n return (end - start) / k;\n });\n };\n\n var second = newInterval(function(date) {\n date.setMilliseconds(0);\n }, function(date, step) {\n date.setTime(+date + step * 1e3);\n }, function(start, end) {\n return (end - start) / 1e3;\n }, function(date) {\n return date.getSeconds();\n });\n\n var minute = newInterval(function(date) {\n date.setSeconds(0, 0);\n }, function(date, step) {\n date.setTime(+date + step * 6e4);\n }, function(start, end) {\n return (end - start) / 6e4;\n }, function(date) {\n return date.getMinutes();\n });\n\n var hour = newInterval(function(date) {\n date.setMinutes(0, 0, 0);\n }, function(date, step) {\n date.setTime(+date + step * 36e5);\n }, function(start, end) {\n return (end - start) / 36e5;\n }, function(date) {\n return date.getHours();\n });\n\n var day = newInterval(function(date) {\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setDate(date.getDate() + step);\n }, function(start, end) {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * 6e4) / 864e5;\n }, function(date) {\n return date.getDate() - 1;\n });\n\n function weekday(i) {\n return newInterval(function(date) {\n date.setHours(0, 0, 0, 0);\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n }, function(date, step) {\n date.setDate(date.getDate() + step * 7);\n }, function(start, end) {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * 6e4) / 6048e5;\n });\n }\n\n var sunday = weekday(0);\n var monday = weekday(1);\n var tuesday = weekday(2);\n var wednesday = weekday(3);\n var thursday = weekday(4);\n var friday = weekday(5);\n var saturday = weekday(6);\n\n var month = newInterval(function(date) {\n date.setHours(0, 0, 0, 0);\n date.setDate(1);\n }, function(date, step) {\n date.setMonth(date.getMonth() + step);\n }, function(start, end) {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n }, function(date) {\n return date.getMonth();\n });\n\n var year = newInterval(function(date) {\n date.setHours(0, 0, 0, 0);\n date.setMonth(0, 1);\n }, function(date, step) {\n date.setFullYear(date.getFullYear() + step);\n }, function(start, end) {\n return end.getFullYear() - start.getFullYear();\n }, function(date) {\n return date.getFullYear();\n });\n\n var utcSecond = newInterval(function(date) {\n date.setUTCMilliseconds(0);\n }, function(date, step) {\n date.setTime(+date + step * 1e3);\n }, function(start, end) {\n return (end - start) / 1e3;\n }, function(date) {\n return date.getUTCSeconds();\n });\n\n var utcMinute = newInterval(function(date) {\n date.setUTCSeconds(0, 0);\n }, function(date, step) {\n date.setTime(+date + step * 6e4);\n }, function(start, end) {\n return (end - start) / 6e4;\n }, function(date) {\n return date.getUTCMinutes();\n });\n\n var utcHour = newInterval(function(date) {\n date.setUTCMinutes(0, 0, 0);\n }, function(date, step) {\n date.setTime(+date + step * 36e5);\n }, function(start, end) {\n return (end - start) / 36e5;\n }, function(date) {\n return date.getUTCHours();\n });\n\n var utcDay = newInterval(function(date) {\n date.setUTCHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setUTCDate(date.getUTCDate() + step);\n }, function(start, end) {\n return (end - start) / 864e5;\n }, function(date) {\n return date.getUTCDate() - 1;\n });\n\n function utcWeekday(i) {\n return newInterval(function(date) {\n date.setUTCHours(0, 0, 0, 0);\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n }, function(date, step) {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, function(start, end) {\n return (end - start) / 6048e5;\n });\n }\n\n var utcSunday = utcWeekday(0);\n var utcMonday = utcWeekday(1);\n var utcTuesday = utcWeekday(2);\n var utcWednesday = utcWeekday(3);\n var utcThursday = utcWeekday(4);\n var utcFriday = utcWeekday(5);\n var utcSaturday = utcWeekday(6);\n\n var utcMonth = newInterval(function(date) {\n date.setUTCHours(0, 0, 0, 0);\n date.setUTCDate(1);\n }, function(date, step) {\n date.setUTCMonth(date.getUTCMonth() + step);\n }, function(start, end) {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n }, function(date) {\n return date.getUTCMonth();\n });\n\n var utcYear = newInterval(function(date) {\n date.setUTCHours(0, 0, 0, 0);\n date.setUTCMonth(0, 1);\n }, function(date, step) {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n }, function(start, end) {\n return end.getUTCFullYear() - start.getUTCFullYear();\n }, function(date) {\n return date.getUTCFullYear();\n });\n\n var milliseconds = millisecond.range;\n var seconds = second.range;\n var minutes = minute.range;\n var hours = hour.range;\n var days = day.range;\n var sundays = sunday.range;\n var mondays = monday.range;\n var tuesdays = tuesday.range;\n var wednesdays = wednesday.range;\n var thursdays = thursday.range;\n var fridays = friday.range;\n var saturdays = saturday.range;\n var weeks = sunday.range;\n var months = month.range;\n var years = year.range;\n\n var utcMillisecond = millisecond;\n var utcMilliseconds = milliseconds;\n var utcSeconds = utcSecond.range;\n var utcMinutes = utcMinute.range;\n var utcHours = utcHour.range;\n var utcDays = utcDay.range;\n var utcSundays = utcSunday.range;\n var utcMondays = utcMonday.range;\n var utcTuesdays = utcTuesday.range;\n var utcWednesdays = utcWednesday.range;\n var utcThursdays = utcThursday.range;\n var utcFridays = utcFriday.range;\n var utcSaturdays = utcSaturday.range;\n var utcWeeks = utcSunday.range;\n var utcMonths = utcMonth.range;\n var utcYears = utcYear.range;\n\n var version = \"0.1.1\";\n\n exports.version = version;\n exports.milliseconds = milliseconds;\n exports.seconds = seconds;\n exports.minutes = minutes;\n exports.hours = hours;\n exports.days = days;\n exports.sundays = sundays;\n exports.mondays = mondays;\n exports.tuesdays = tuesdays;\n exports.wednesdays = wednesdays;\n exports.thursdays = thursdays;\n exports.fridays = fridays;\n exports.saturdays = saturdays;\n exports.weeks = weeks;\n exports.months = months;\n exports.years = years;\n exports.utcMillisecond = utcMillisecond;\n exports.utcMilliseconds = utcMilliseconds;\n exports.utcSeconds = utcSeconds;\n exports.utcMinutes = utcMinutes;\n exports.utcHours = utcHours;\n exports.utcDays = utcDays;\n exports.utcSundays = utcSundays;\n exports.utcMondays = utcMondays;\n exports.utcTuesdays = utcTuesdays;\n exports.utcWednesdays = utcWednesdays;\n exports.utcThursdays = utcThursdays;\n exports.utcFridays = utcFridays;\n exports.utcSaturdays = utcSaturdays;\n exports.utcWeeks = utcWeeks;\n exports.utcMonths = utcMonths;\n exports.utcYears = utcYears;\n exports.millisecond = millisecond;\n exports.second = second;\n exports.minute = minute;\n exports.hour = hour;\n exports.day = day;\n exports.sunday = sunday;\n exports.monday = monday;\n exports.tuesday = tuesday;\n exports.wednesday = wednesday;\n exports.thursday = thursday;\n exports.friday = friday;\n exports.saturday = saturday;\n exports.week = sunday;\n exports.month = month;\n exports.year = year;\n exports.utcSecond = utcSecond;\n exports.utcMinute = utcMinute;\n exports.utcHour = utcHour;\n exports.utcDay = utcDay;\n exports.utcSunday = utcSunday;\n exports.utcMonday = utcMonday;\n exports.utcTuesday = utcTuesday;\n exports.utcWednesday = utcWednesday;\n exports.utcThursday = utcThursday;\n exports.utcFriday = utcFriday;\n exports.utcSaturday = utcSaturday;\n exports.utcWeek = utcSunday;\n exports.utcMonth = utcMonth;\n exports.utcYear = utcYear;\n exports.interval = newInterval;\n\n}));","var d3_time = require('d3-time');\n\nvar tempDate = new Date(),\n baseDate = new Date(0, 0, 1).setFullYear(0), // Jan 1, 0 AD\n utcBaseDate = new Date(Date.UTC(0, 0, 1)).setUTCFullYear(0);\n\nfunction date(d) {\n return (tempDate.setTime(+d), tempDate);\n}\n\n// create a time unit entry\nfunction entry(type, date, unit, step, min, max) {\n var e = {\n type: type,\n date: date,\n unit: unit\n };\n if (step) {\n e.step = step;\n } else {\n e.minstep = 1;\n }\n if (min != null) e.min = min;\n if (max != null) e.max = max;\n return e;\n}\n\nfunction create(type, unit, base, step, min, max) {\n return entry(type,\n function(d) { return unit.offset(base, d); },\n function(d) { return unit.count(base, d); },\n step, min, max);\n}\n\nvar locale = [\n create('second', d3_time.second, baseDate),\n create('minute', d3_time.minute, baseDate),\n create('hour', d3_time.hour, baseDate),\n create('day', d3_time.day, baseDate, [1, 7]),\n create('month', d3_time.month, baseDate, [1, 3, 6]),\n create('year', d3_time.year, baseDate),\n\n // periodic units\n entry('seconds',\n function(d) { return new Date(1970, 0, 1, 0, 0, d); },\n function(d) { return date(d).getSeconds(); },\n null, 0, 59\n ),\n entry('minutes',\n function(d) { return new Date(1970, 0, 1, 0, d); },\n function(d) { return date(d).getMinutes(); },\n null, 0, 59\n ),\n entry('hours',\n function(d) { return new Date(1970, 0, 1, d); },\n function(d) { return date(d).getHours(); },\n null, 0, 23\n ),\n entry('weekdays',\n function(d) { return new Date(1970, 0, 4+d); },\n function(d) { return date(d).getDay(); },\n [1], 0, 6\n ),\n entry('dates',\n function(d) { return new Date(1970, 0, d); },\n function(d) { return date(d).getDate(); },\n [1], 1, 31\n ),\n entry('months',\n function(d) { return new Date(1970, d % 12, 1); },\n function(d) { return date(d).getMonth(); },\n [1], 0, 11\n )\n];\n\nvar utc = [\n create('second', d3_time.utcSecond, utcBaseDate),\n create('minute', d3_time.utcMinute, utcBaseDate),\n create('hour', d3_time.utcHour, utcBaseDate),\n create('day', d3_time.utcDay, utcBaseDate, [1, 7]),\n create('month', d3_time.utcMonth, utcBaseDate, [1, 3, 6]),\n create('year', d3_time.utcYear, utcBaseDate),\n\n // periodic units\n entry('seconds',\n function(d) { return new Date(Date.UTC(1970, 0, 1, 0, 0, d)); },\n function(d) { return date(d).getUTCSeconds(); },\n null, 0, 59\n ),\n entry('minutes',\n function(d) { return new Date(Date.UTC(1970, 0, 1, 0, d)); },\n function(d) { return date(d).getUTCMinutes(); },\n null, 0, 59\n ),\n entry('hours',\n function(d) { return new Date(Date.UTC(1970, 0, 1, d)); },\n function(d) { return date(d).getUTCHours(); },\n null, 0, 23\n ),\n entry('weekdays',\n function(d) { return new Date(Date.UTC(1970, 0, 4+d)); },\n function(d) { return date(d).getUTCDay(); },\n [1], 0, 6\n ),\n entry('dates',\n function(d) { return new Date(Date.UTC(1970, 0, d)); },\n function(d) { return date(d).getUTCDate(); },\n [1], 1, 31\n ),\n entry('months',\n function(d) { return new Date(Date.UTC(1970, d % 12, 1)); },\n function(d) { return date(d).getUTCMonth(); },\n [1], 0, 11\n )\n];\n\nvar STEPS = [\n [31536e6, 5], // 1-year\n [7776e6, 4], // 3-month\n [2592e6, 4], // 1-month\n [12096e5, 3], // 2-week\n [6048e5, 3], // 1-week\n [1728e5, 3], // 2-day\n [864e5, 3], // 1-day\n [432e5, 2], // 12-hour\n [216e5, 2], // 6-hour\n [108e5, 2], // 3-hour\n [36e5, 2], // 1-hour\n [18e5, 1], // 30-minute\n [9e5, 1], // 15-minute\n [3e5, 1], // 5-minute\n [6e4, 1], // 1-minute\n [3e4, 0], // 30-second\n [15e3, 0], // 15-second\n [5e3, 0], // 5-second\n [1e3, 0] // 1-second\n];\n\nfunction find(units, span, minb, maxb) {\n var step = STEPS[0], i, n, bins;\n\n for (i=1, n=STEPS.length; i step[0]) {\n bins = span / step[0];\n if (bins > maxb) {\n return units[STEPS[i-1][1]];\n }\n if (bins >= minb) {\n return units[step[1]];\n }\n }\n }\n return units[STEPS[n-1][1]];\n}\n\nfunction toUnitMap(units) {\n var map = {}, i, n;\n for (i=0, n=units.length; i maxb) { step *= base; }\n\n // decrease step size if allowed\n for (i=0; i= minstep && span / v <= maxb) step = v;\n }\n }\n\n // update precision, min and max\n v = Math.log(step);\n precision = v >= 0 ? 0 : ~~(-v / logb) + 1;\n eps = Math.pow(base, -precision - 1);\n min = Math.min(min, Math.floor(min / step + eps) * step);\n max = Math.ceil(max / step) * step;\n\n return {\n start: min,\n stop: max,\n step: step,\n unit: {precision: precision},\n value: value,\n index: index\n };\n}\n\nfunction bisect(a, x, lo, hi) {\n while (lo < hi) {\n var mid = lo + hi >>> 1;\n if (util.cmp(a[mid], x) < 0) { lo = mid + 1; }\n else { hi = mid; }\n }\n return lo;\n}\n\nfunction value(v) {\n return this.step * Math.floor(v / this.step + EPSILON);\n}\n\nfunction index(v) {\n return Math.floor((v - this.start) / this.step + EPSILON);\n}\n\nfunction date_value(v) {\n return this.unit.date(value.call(this, v));\n}\n\nfunction date_index(v) {\n return index.call(this, this.unit.unit(v));\n}\n\nbins.date = function(opt) {\n if (!opt) { throw Error(\"Missing date binning options.\"); }\n\n // find time step, then bin\n var units = opt.utc ? time.utc : time,\n dmin = opt.min,\n dmax = opt.max,\n maxb = opt.maxbins || 20,\n minb = opt.minbins || 4,\n span = (+dmax) - (+dmin),\n unit = opt.unit ? units[opt.unit] : units.find(span, minb, maxb),\n spec = bins({\n min: unit.min != null ? unit.min : unit.unit(dmin),\n max: unit.max != null ? unit.max : unit.unit(dmax),\n maxbins: maxb,\n minstep: unit.minstep,\n steps: unit.step\n });\n\n spec.unit = unit;\n spec.index = date_index;\n if (!opt.raw) spec.value = date_value;\n return spec;\n};\n\nmodule.exports = bins;\n","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar type_1 = require(\"vega-lite/build/src/type\");\nvar bin_1 = require(\"vega-lite/build/src/bin\");\nvar timeunit_1 = require(\"vega-lite/build/src/timeunit\");\nvar stats_1 = require(\"datalib/src/stats\");\nvar type_2 = require(\"datalib/src/import/type\");\nvar dlBin_ = require(\"datalib/src/bins/bins\");\nvar encoding_1 = require(\"./query/encoding\");\nvar expandedtype_1 = require(\"./query/expandedtype\");\nvar config_1 = require(\"./config\");\nvar util_1 = require(\"./util\");\nvar dlBin = dlBin_;\n/**\n * Build a Schema object.\n *\n * @param data - a set of raw data in the same format that Vega-Lite / Vega takes\n * Basically, it's an array in the form of:\n *\n * [\n * {a: 1, b:2},\n * {a: 2, b:3},\n * ...\n * ]\n *\n * @return a Schema object\n */\nfunction build(data, opt, tableSchema) {\n if (opt === void 0) { opt = {}; }\n if (tableSchema === void 0) { tableSchema = { fields: [] }; }\n opt = util_1.extend({}, config_1.DEFAULT_QUERY_CONFIG, opt);\n // create profiles for each variable\n var summaries = stats_1.summary(data);\n var types = type_2.inferAll(data); // inferAll does stronger type inference than summary\n var tableSchemaFieldIndex = tableSchema.fields.reduce(function (m, field) {\n m[field.name] = field;\n return m;\n }, {});\n var fieldSchemas = summaries.map(function (fieldProfile, index) {\n var name = fieldProfile.field;\n // In Table schema, 'date' doesn't include time so use 'datetime'\n var type = types[name] === 'date' ? PrimitiveType.DATETIME : types[name];\n var distinct = fieldProfile.distinct;\n var vlType;\n if (type === PrimitiveType.NUMBER) {\n vlType = type_1.Type.QUANTITATIVE;\n }\n else if (type === PrimitiveType.INTEGER) {\n // use ordinal or nominal when cardinality of integer type is relatively low and the distinct values are less than an amount specified in options\n if ((distinct < opt.numberNominalLimit) && (distinct / fieldProfile.count < opt.numberNominalProportion)) {\n vlType = type_1.Type.NOMINAL;\n }\n else {\n vlType = type_1.Type.QUANTITATIVE;\n }\n }\n else if (type === PrimitiveType.DATETIME) {\n vlType = type_1.Type.TEMPORAL;\n // need to get correct min/max of date data because datalib's summary method does not\n // calculate this correctly for date types.\n fieldProfile.min = new Date(data[0][name]);\n fieldProfile.max = new Date(data[0][name]);\n for (var _i = 0, data_1 = data; _i < data_1.length; _i++) {\n var dataEntry = data_1[_i];\n var time = new Date(dataEntry[name]).getTime();\n if (time < fieldProfile.min.getTime()) {\n fieldProfile.min = new Date(time);\n }\n if (time > fieldProfile.max.getTime()) {\n fieldProfile.max = new Date(time);\n }\n }\n }\n else {\n vlType = type_1.Type.NOMINAL;\n }\n if (vlType === type_1.Type.NOMINAL\n && distinct / fieldProfile.count > opt.minPercentUniqueForKey\n && fieldProfile.count > opt.minCardinalityForKey) {\n vlType = expandedtype_1.ExpandedType.KEY;\n }\n var fieldSchema = {\n name: name,\n // Need to keep original index for re-exporting TableSchema\n originalIndex: index,\n vlType: vlType,\n type: type,\n stats: fieldProfile,\n timeStats: {},\n binStats: {}\n };\n // extend field schema with table schema field - if present\n var orgFieldSchema = tableSchemaFieldIndex[fieldSchema.name];\n fieldSchema = util_1.extend(fieldSchema, orgFieldSchema);\n return fieldSchema;\n });\n // calculate preset bins for quantitative and temporal data\n for (var _i = 0, fieldSchemas_1 = fieldSchemas; _i < fieldSchemas_1.length; _i++) {\n var fieldSchema = fieldSchemas_1[_i];\n if (fieldSchema.vlType === type_1.Type.QUANTITATIVE) {\n for (var _a = 0, _b = opt.enum.binProps.maxbins; _a < _b.length; _a++) {\n var maxbins = _b[_a];\n fieldSchema.binStats[maxbins] = binSummary(maxbins, fieldSchema.stats);\n }\n }\n else if (fieldSchema.vlType === type_1.Type.TEMPORAL) {\n for (var _c = 0, _d = opt.enum.timeUnit; _c < _d.length; _c++) {\n var unit = _d[_c];\n if (unit !== undefined) {\n fieldSchema.timeStats[unit] = timeSummary(unit, fieldSchema.stats);\n }\n }\n }\n }\n var derivedTableSchema = __assign({}, tableSchema, { fields: fieldSchemas });\n return new Schema(derivedTableSchema);\n}\nexports.build = build;\n// order the field schema when we construct a new Schema\n// this orders the fields in the UI\nvar order = {\n 'nominal': 0,\n 'key': 1,\n 'ordinal': 2,\n 'temporal': 3,\n 'quantitative': 4\n};\nvar Schema = /** @class */ (function () {\n function Schema(tableSchema) {\n this._tableSchema = tableSchema;\n tableSchema.fields.sort(function (a, b) {\n // first order by vlType: nominal < temporal < quantitative < ordinal\n if (order[a.vlType] < order[b.vlType]) {\n return -1;\n }\n else if (order[a.vlType] > order[b.vlType]) {\n return 1;\n }\n else {\n // then order by field (alphabetically)\n return a.name.localeCompare(b.name);\n }\n });\n // Add index for sorting\n tableSchema.fields.forEach(function (fieldSchema, index) { return fieldSchema.index = index; });\n this._fieldSchemaIndex = tableSchema.fields.reduce(function (m, fieldSchema) {\n m[fieldSchema.name] = fieldSchema;\n return m;\n }, {});\n }\n /** @return a list of the field names (for enumerating). */\n Schema.prototype.fieldNames = function () {\n return this._tableSchema.fields.map(function (fieldSchema) { return fieldSchema.name; });\n };\n Object.defineProperty(Schema.prototype, \"fieldSchemas\", {\n /** @return a list of FieldSchemas */\n get: function () {\n return this._tableSchema.fields;\n },\n enumerable: true,\n configurable: true\n });\n Schema.prototype.fieldSchema = function (fieldName) {\n return this._fieldSchemaIndex[fieldName];\n };\n Schema.prototype.tableSchema = function () {\n // the fieldschemas are re-arranged\n // but this is not allowed in table schema.\n // so we will re-order based on original index.\n var tableSchema = util_1.duplicate(this._tableSchema);\n tableSchema.fields.sort(function (a, b) { return a.originalIndex - b.originalIndex; });\n return tableSchema;\n };\n /**\n * @return primitive type of the field if exist, otherwise return null\n */\n Schema.prototype.primitiveType = function (fieldName) {\n return this._fieldSchemaIndex[fieldName] ? this._fieldSchemaIndex[fieldName].type : null;\n };\n /**\n * @return vlType of measturement of the field if exist, otherwise return null\n */\n Schema.prototype.vlType = function (fieldName) {\n return this._fieldSchemaIndex[fieldName] ? this._fieldSchemaIndex[fieldName].vlType : null;\n };\n /** @return cardinality of the field associated with encQ, null if it doesn't exist.\n * @param augmentTimeUnitDomain - TimeUnit field domains will not be augmented if explicitly set to false.\n */\n Schema.prototype.cardinality = function (fieldQ, augmentTimeUnitDomain, excludeInvalid) {\n if (augmentTimeUnitDomain === void 0) { augmentTimeUnitDomain = true; }\n if (excludeInvalid === void 0) { excludeInvalid = false; }\n var fieldSchema = this._fieldSchemaIndex[fieldQ.field];\n if (fieldQ.aggregate || (encoding_1.isAutoCountQuery(fieldQ) && fieldQ.autoCount)) {\n return 1;\n }\n else if (fieldQ.bin) {\n // encQ.bin will either be a boolean or a BinQuery\n var bin = void 0;\n if (typeof fieldQ.bin === 'boolean') {\n // autoMaxBins defaults to 10 if channel is Wildcard\n bin = {\n maxbins: bin_1.autoMaxBins(fieldQ.channel)\n };\n }\n else if (fieldQ.bin === '?') {\n bin = {\n enum: [true, false]\n };\n }\n else {\n bin = fieldQ.bin;\n }\n var maxbins = bin.maxbins;\n if (!fieldSchema.binStats[maxbins]) {\n // need to calculate\n fieldSchema.binStats[maxbins] = binSummary(maxbins, fieldSchema.stats);\n }\n // don't need to worry about excludeInvalid here because invalid values don't affect linearly binned field's cardinality\n return fieldSchema.binStats[maxbins].distinct;\n }\n else if (fieldQ.timeUnit) {\n if (augmentTimeUnitDomain) {\n switch (fieldQ.timeUnit) {\n // TODO: this should not always be the case once Vega-Lite supports turning off domain augmenting (VL issue #1385)\n case timeunit_1.TimeUnit.SECONDS: return 60;\n case timeunit_1.TimeUnit.MINUTES: return 60;\n case timeunit_1.TimeUnit.HOURS: return 24;\n case timeunit_1.TimeUnit.DAY: return 7;\n case timeunit_1.TimeUnit.DATE: return 31;\n case timeunit_1.TimeUnit.MONTH: return 12;\n case timeunit_1.TimeUnit.QUARTER: return 4;\n case timeunit_1.TimeUnit.MILLISECONDS: return 1000;\n }\n }\n var unit = fieldQ.timeUnit;\n var timeStats = fieldSchema.timeStats;\n // if the cardinality for the timeUnit is not cached, calculate it\n if (!timeStats || !timeStats[unit]) {\n timeStats = __assign({}, timeStats, (_a = {}, _a[unit] = timeSummary(fieldQ.timeUnit, fieldSchema.stats), _a));\n }\n if (excludeInvalid) {\n return timeStats[unit].distinct - invalidCount(timeStats[unit].unique, ['Invalid Date', null]);\n }\n else {\n return timeStats[unit].distinct;\n }\n }\n else {\n if (fieldSchema) {\n if (excludeInvalid) {\n return fieldSchema.stats.distinct - invalidCount(fieldSchema.stats.unique, [NaN, null]);\n }\n else {\n return fieldSchema.stats.distinct;\n }\n }\n else {\n return null;\n }\n }\n var _a;\n };\n /**\n * Given an EncodingQuery with a timeUnit, returns true if the date field\n * has multiple distinct values for all parts of the timeUnit. Returns undefined\n * if the timeUnit is undefined.\n * i.e.\n * ('yearmonth', [Jan 1 2000, Feb 2 2000] returns false)\n * ('yearmonth', [Jan 1 2000, Feb 2 2001] returns true)\n */\n Schema.prototype.timeUnitHasVariation = function (fieldQ) {\n if (!fieldQ.timeUnit) {\n return;\n }\n // if there is no variation in `date`, there should not be variation in `day`\n if (fieldQ.timeUnit === timeunit_1.TimeUnit.DAY) {\n var dateEncQ = util_1.extend({}, fieldQ, { timeUnit: timeunit_1.TimeUnit.DATE });\n if (this.cardinality(dateEncQ, false, true) <= 1) {\n return false;\n }\n }\n var fullTimeUnit = fieldQ.timeUnit;\n for (var _i = 0, TIMEUNIT_PARTS_1 = timeunit_1.TIMEUNIT_PARTS; _i < TIMEUNIT_PARTS_1.length; _i++) {\n var timeUnitPart = TIMEUNIT_PARTS_1[_i];\n if (timeunit_1.containsTimeUnit(fullTimeUnit, timeUnitPart)) {\n // Create a clone of encQ, but with singleTimeUnit\n var singleUnitEncQ = util_1.extend({}, fieldQ, { timeUnit: timeUnitPart });\n if (this.cardinality(singleUnitEncQ, false, true) <= 1) {\n return false;\n }\n }\n }\n return true;\n };\n Schema.prototype.domain = function (fieldQueryParts) {\n // TODO: differentiate for field with bin / timeUnit\n var fieldSchema = this._fieldSchemaIndex[fieldQueryParts.field];\n var domain = util_1.keys(fieldSchema.stats.unique);\n if (fieldSchema.vlType === type_1.Type.QUANTITATIVE) {\n // return [min, max], coerced into number types\n return [+fieldSchema.stats.min, +fieldSchema.stats.max];\n }\n else if (fieldSchema.type === PrimitiveType.DATETIME) {\n // return [min, max] dates\n return [fieldSchema.stats.min, fieldSchema.stats.max];\n }\n else if (fieldSchema.type === PrimitiveType.INTEGER ||\n fieldSchema.type === PrimitiveType.NUMBER) {\n // coerce non-quantitative numerical data into number type\n domain = domain.map(function (x) { return +x; });\n return domain.sort(util_1.cmp);\n }\n else if ((fieldSchema.vlType === type_1.Type.ORDINAL) && fieldSchema.ordinalDomain) {\n return fieldSchema.ordinalDomain;\n }\n return domain.map(function (x) {\n // Convert 'null' to null as it is encoded similarly in datalib.\n // This is wrong when it is a string 'null' but that rarely happens.\n return x === 'null' ? null : x;\n }).sort(util_1.cmp);\n };\n /**\n * @return a Summary corresponding to the field of the given EncodingQuery\n */\n Schema.prototype.stats = function (fieldQ) {\n // TODO: differentiate for field with bin / timeUnit vs without\n var fieldSchema = this._fieldSchemaIndex[fieldQ.field];\n return fieldSchema ? fieldSchema.stats : null;\n };\n return Schema;\n}());\nexports.Schema = Schema;\n/**\n * @return a summary of the binning scheme determined from the given max number of bins\n */\nfunction binSummary(maxbins, summary) {\n var bin = dlBin({\n min: summary.min,\n max: summary.max,\n maxbins: maxbins\n });\n // start with summary, pre-binning\n var result = util_1.extend({}, summary);\n result.unique = binUnique(bin, summary.unique);\n result.distinct = (bin.stop - bin.start) / bin.step;\n result.min = bin.start;\n result.max = bin.stop;\n return result;\n}\n/** @return a modified version of the passed summary with unique and distinct set according to the timeunit.\n * Maps 'null' (string) keys to the null value and invalid dates to 'Invalid Date' in the unique dictionary.\n */\nfunction timeSummary(timeunit, summary) {\n var result = util_1.extend({}, summary);\n var unique = {};\n util_1.keys(summary.unique).forEach(function (dateString) {\n // don't convert null value because the Date constructor will actually convert it to a date\n var date = (dateString === 'null') ? null : new Date(dateString);\n // at this point, `date` is either the null value, a valid Date object, or \"Invalid Date\" which is a Date\n var key;\n if (date === null) {\n key = null;\n }\n else if (isNaN(date.getTime())) {\n key = 'Invalid Date';\n }\n else {\n key = ((timeunit === timeunit_1.TimeUnit.DAY) ? date.getDay() : timeunit_1.convert(timeunit, date)).toString();\n }\n unique[key] = (unique[key] || 0) + summary.unique[dateString];\n });\n result.unique = unique;\n result.distinct = util_1.keys(unique).length;\n return result;\n}\n/**\n * @return a new unique object based off of the old unique count and a binning scheme\n */\nfunction binUnique(bin, oldUnique) {\n var newUnique = {};\n for (var value in oldUnique) {\n var bucket = void 0;\n if (value === null) {\n bucket = null;\n }\n else if (isNaN(Number(value))) {\n bucket = NaN;\n }\n else {\n bucket = bin.value(Number(value));\n }\n newUnique[bucket] = (newUnique[bucket] || 0) + oldUnique[value];\n }\n return newUnique;\n}\n/** @return the number of items in list that occur as keys of unique */\nfunction invalidCount(unique, list) {\n return list.reduce(function (prev, cur) {\n return unique[cur] ? prev + 1 : prev;\n }, 0);\n}\nvar PrimitiveType;\n(function (PrimitiveType) {\n PrimitiveType[PrimitiveType[\"STRING\"] = 'string'] = \"STRING\";\n PrimitiveType[PrimitiveType[\"NUMBER\"] = 'number'] = \"NUMBER\";\n PrimitiveType[PrimitiveType[\"INTEGER\"] = 'integer'] = \"INTEGER\";\n PrimitiveType[PrimitiveType[\"BOOLEAN\"] = 'boolean'] = \"BOOLEAN\";\n PrimitiveType[PrimitiveType[\"DATETIME\"] = 'datetime'] = \"DATETIME\";\n})(PrimitiveType = exports.PrimitiveType || (exports.PrimitiveType = {}));\n//# sourceMappingURL=schema.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar property_1 = require(\"../property\");\nvar wildcard_1 = require(\"../wildcard\");\nvar util_1 = require(\"../util\");\n/**\n * Abstract model for a constraint.\n */\nvar AbstractConstraintModel = /** @class */ (function () {\n function AbstractConstraintModel(constraint) {\n this.constraint = constraint;\n }\n AbstractConstraintModel.prototype.name = function () {\n return this.constraint.name;\n };\n AbstractConstraintModel.prototype.description = function () {\n return this.constraint.description;\n };\n AbstractConstraintModel.prototype.properties = function () {\n return this.constraint.properties;\n };\n AbstractConstraintModel.prototype.strict = function () {\n return this.constraint.strict;\n };\n return AbstractConstraintModel;\n}());\nexports.AbstractConstraintModel = AbstractConstraintModel;\nvar EncodingConstraintModel = /** @class */ (function (_super) {\n __extends(EncodingConstraintModel, _super);\n function EncodingConstraintModel(constraint) {\n return _super.call(this, constraint) || this;\n }\n EncodingConstraintModel.prototype.hasAllRequiredPropertiesSpecific = function (encQ) {\n return util_1.every(this.constraint.properties, function (prop) {\n if (property_1.isEncodingNestedProp(prop)) {\n var parent_1 = prop.parent;\n var child = prop.child;\n if (!encQ[parent_1]) {\n return true;\n }\n return !wildcard_1.isWildcard(encQ[parent_1][child]);\n }\n if (!encQ[prop]) {\n return true;\n }\n return !wildcard_1.isWildcard(encQ[prop]);\n });\n };\n EncodingConstraintModel.prototype.satisfy = function (encQ, schema, encWildcardIndex, opt) {\n // TODO: Re-order logic to optimize the \"allowWildcardForProperties\" check\n if (!this.constraint.allowWildcardForProperties) {\n // TODO: extract as a method and do unit test\n if (!this.hasAllRequiredPropertiesSpecific(encQ)) {\n return true;\n }\n }\n return this.constraint.satisfy(encQ, schema, encWildcardIndex, opt);\n };\n return EncodingConstraintModel;\n}(AbstractConstraintModel));\nexports.EncodingConstraintModel = EncodingConstraintModel;\n//# sourceMappingURL=base.js.map","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar channel_1 = require(\"vega-lite/build/src/channel\");\nvar fielddef_1 = require(\"vega-lite/build/src/fielddef\");\nvar scale_1 = require(\"vega-lite/build/src/scale\");\nvar type_1 = require(\"vega-lite/build/src/type\");\nvar expandedtype_1 = require(\"../query/expandedtype\");\nvar property_1 = require(\"../property\");\nvar propindex_1 = require(\"../propindex\");\nvar wildcard_1 = require(\"../wildcard\");\nvar schema_1 = require(\"../schema\");\nvar util_1 = require(\"../util\");\nvar encoding_1 = require(\"../query/encoding\");\nvar base_1 = require(\"./base\");\nexports.FIELD_CONSTRAINTS = [\n {\n name: 'aggregateOpSupportedByType',\n description: 'Aggregate function should be supported by data type.',\n properties: [property_1.Property.TYPE, property_1.Property.AGGREGATE],\n allowWildcardForProperties: false,\n strict: true,\n satisfy: function (fieldQ, _, __, ___) {\n if (fieldQ.aggregate) {\n return !expandedtype_1.isDiscrete(fieldQ.type);\n }\n // TODO: some aggregate function are actually supported by ordinal\n return true; // no aggregate is okay with any type.\n }\n }, {\n name: 'asteriskFieldWithCountOnly',\n description: 'Field=\"*\" should be disallowed except aggregate=\"count\"',\n properties: [property_1.Property.FIELD, property_1.Property.AGGREGATE],\n allowWildcardForProperties: false,\n strict: true,\n satisfy: function (fieldQ, _, __, ___) {\n return (fieldQ.field === '*') === (fieldQ.aggregate === 'count');\n }\n }, {\n name: 'minCardinalityForBin',\n description: 'binned quantitative field should not have too low cardinality',\n properties: [property_1.Property.BIN, property_1.Property.FIELD, property_1.Property.TYPE],\n allowWildcardForProperties: false,\n strict: true,\n satisfy: function (fieldQ, schema, _, opt) {\n if (fieldQ.bin && fieldQ.type === type_1.Type.QUANTITATIVE) {\n // We remove bin so schema can infer the raw unbinned cardinality.\n var fieldQwithoutBin = { channel: fieldQ.channel, field: fieldQ.field, type: fieldQ.type };\n return schema.cardinality(fieldQwithoutBin) >= opt.minCardinalityForBin;\n }\n return true;\n }\n }, {\n name: 'binAppliedForQuantitative',\n description: 'bin should be applied to quantitative field only.',\n properties: [property_1.Property.TYPE, property_1.Property.BIN],\n allowWildcardForProperties: false,\n strict: true,\n satisfy: function (fieldQ, _, __, ___) {\n if (fieldQ.bin) {\n // If binned, the type must be quantitative\n return fieldQ.type === type_1.Type.QUANTITATIVE;\n }\n return true;\n }\n }, {\n name: 'channelFieldCompatible',\n description: \"encoding channel's range type be compatible with channel type.\",\n properties: [property_1.Property.CHANNEL, property_1.Property.TYPE, property_1.Property.BIN, property_1.Property.TIMEUNIT],\n allowWildcardForProperties: false,\n strict: true,\n satisfy: function (fieldQ, schema, encWildcardIndex, opt) {\n var fieldDef = __assign({ field: 'f' }, encoding_1.toFieldDef(fieldQ, { schema: schema, props: ['bin', 'timeUnit', 'type'] }));\n return fielddef_1.channelCompatibility(fieldDef, fieldQ.channel).compatible;\n }\n }, {\n name: 'hasFn',\n description: 'A field with as hasFn flag should have one of aggregate, timeUnit, or bin.',\n properties: [property_1.Property.AGGREGATE, property_1.Property.BIN, property_1.Property.TIMEUNIT],\n allowWildcardForProperties: true,\n strict: true,\n satisfy: function (fieldQ, _, __, ___) {\n if (fieldQ.hasFn) {\n return !!fieldQ.aggregate || !!fieldQ.bin || !!fieldQ.timeUnit;\n }\n return true;\n }\n }, {\n name: 'omitScaleZeroWithBinnedField',\n description: 'Do not use scale zero with binned field',\n properties: [property_1.Property.SCALE, property_1.getEncodingNestedProp('scale', 'zero'), property_1.Property.BIN],\n allowWildcardForProperties: false,\n strict: true,\n satisfy: function (fieldQ, _, __, ___) {\n if (fieldQ.bin && fieldQ.scale) {\n if (fieldQ.scale.zero === true) {\n return false;\n }\n }\n return true;\n }\n }, {\n name: 'onlyOneTypeOfFunction',\n description: 'Only of of aggregate, autoCount, timeUnit, or bin should be applied at the same time.',\n properties: [property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT, property_1.Property.TIMEUNIT, property_1.Property.BIN],\n allowWildcardForProperties: true,\n strict: true,\n satisfy: function (fieldQ, _, __, ___) {\n if (encoding_1.isFieldQuery(fieldQ)) {\n var numFn = (!wildcard_1.isWildcard(fieldQ.aggregate) && !!fieldQ.aggregate ? 1 : 0) +\n (!wildcard_1.isWildcard(fieldQ.bin) && !!fieldQ.bin ? 1 : 0) +\n (!wildcard_1.isWildcard(fieldQ.timeUnit) && !!fieldQ.timeUnit ? 1 : 0);\n return numFn <= 1;\n }\n // For autoCount there is always only one type of function\n return true;\n }\n }, {\n name: 'timeUnitAppliedForTemporal',\n description: 'Time unit should be applied to temporal field only.',\n properties: [property_1.Property.TYPE, property_1.Property.TIMEUNIT],\n allowWildcardForProperties: false,\n strict: true,\n satisfy: function (fieldQ, _, __, ___) {\n if (fieldQ.timeUnit && fieldQ.type !== type_1.Type.TEMPORAL) {\n return false;\n }\n return true;\n }\n }, {\n name: 'timeUnitShouldHaveVariation',\n description: 'A particular time unit should be applied only if they produce unique values.',\n properties: [property_1.Property.TIMEUNIT, property_1.Property.TYPE],\n allowWildcardForProperties: false,\n strict: false,\n satisfy: function (fieldQ, schema, encWildcardIndex, opt) {\n if (fieldQ.timeUnit && fieldQ.type === type_1.Type.TEMPORAL) {\n if (!encWildcardIndex.has('timeUnit') && !opt.constraintManuallySpecifiedValue) {\n // Do not have to check this as this is manually specified by users.\n return true;\n }\n return schema.timeUnitHasVariation(fieldQ);\n }\n return true;\n }\n }, {\n name: 'scalePropertiesSupportedByScaleType',\n description: 'Scale properties must be supported by correct scale type',\n properties: [].concat(property_1.SCALE_PROPS, [property_1.Property.SCALE, property_1.Property.TYPE]),\n allowWildcardForProperties: true,\n strict: true,\n satisfy: function (fieldQ, _, __, ___) {\n if (fieldQ.scale) {\n var scale = fieldQ.scale;\n // If fieldQ.type is an Wildcard and scale.type is undefined, it is equivalent\n // to scale type is Wildcard. If scale type is an Wildcard, we do not yet know\n // what the scale type is, and thus can ignore the constraint.\n var sType = encoding_1.scaleType(fieldQ);\n if (sType === undefined || sType === null) {\n // If still ambiguous, doesn't check the constraint\n return true;\n }\n for (var scaleProp in scale) {\n if (scaleProp === 'type' || scaleProp === 'name' || scaleProp === 'enum') {\n // ignore type and properties of wildcards\n continue;\n }\n var sProp = scaleProp;\n if (sType === 'point') {\n // HACK: our current implementation of scaleType() can return point\n // when the scaleType is a band since we didn't pass all parameter to Vega-Lite's scale type method.\n if (!scale_1.scaleTypeSupportProperty('point', sProp) && !scale_1.scaleTypeSupportProperty('band', sProp)) {\n return false;\n }\n }\n else if (!scale_1.scaleTypeSupportProperty(sType, sProp)) {\n return false;\n }\n }\n }\n return true;\n }\n }, {\n name: 'scalePropertiesSupportedByChannel',\n description: 'Not all scale properties are supported by all encoding channels',\n properties: [].concat(property_1.SCALE_PROPS, [property_1.Property.SCALE, property_1.Property.CHANNEL]),\n allowWildcardForProperties: true,\n strict: true,\n satisfy: function (fieldQ, _, __, ___) {\n if (fieldQ) {\n var channel = fieldQ.channel;\n var scale = fieldQ.scale;\n if (channel && !wildcard_1.isWildcard(channel) && scale) {\n if (channel === 'row' || channel === 'column') {\n // row / column do not have scale\n return false;\n }\n for (var scaleProp in scale) {\n if (!scale.hasOwnProperty(scaleProp))\n continue;\n if (scaleProp === 'type' || scaleProp === 'name' || scaleProp === 'enum') {\n // ignore type and properties of wildcards\n continue;\n }\n var isSupported = scale_1.channelScalePropertyIncompatability(channel, scaleProp) === undefined;\n if (!isSupported) {\n return false;\n }\n }\n }\n }\n return true;\n }\n }, {\n name: 'typeMatchesPrimitiveType',\n description: 'Data type should be supported by field\\'s primitive type.',\n properties: [property_1.Property.FIELD, property_1.Property.TYPE],\n allowWildcardForProperties: false,\n strict: true,\n satisfy: function (fieldQ, schema, encWildcardIndex, opt) {\n if (fieldQ.field === '*') {\n return true;\n }\n var primitiveType = schema.primitiveType(fieldQ.field);\n var type = fieldQ.type;\n if (!encWildcardIndex.has('field') && !encWildcardIndex.has('type') && !opt.constraintManuallySpecifiedValue) {\n // Do not have to check this as this is manually specified by users.\n return true;\n }\n switch (primitiveType) {\n case schema_1.PrimitiveType.BOOLEAN:\n case schema_1.PrimitiveType.STRING:\n return type !== type_1.Type.QUANTITATIVE && type !== type_1.Type.TEMPORAL;\n case schema_1.PrimitiveType.NUMBER:\n case schema_1.PrimitiveType.INTEGER:\n return type !== type_1.Type.TEMPORAL;\n case schema_1.PrimitiveType.DATETIME:\n // TODO: add NOMINAL, ORDINAL support after we support this in Vega-Lite\n return type === type_1.Type.TEMPORAL;\n case null:\n // field does not exist in the schema\n return false;\n }\n throw new Error('Not implemented');\n }\n },\n {\n name: 'typeMatchesSchemaType',\n description: 'Enumerated data type of a field should match the field\\'s type in the schema.',\n properties: [property_1.Property.FIELD, property_1.Property.TYPE],\n allowWildcardForProperties: false,\n strict: false,\n satisfy: function (fieldQ, schema, encWildcardIndex, opt) {\n if (!encWildcardIndex.has('field') && !encWildcardIndex.has('type') && !opt.constraintManuallySpecifiedValue) {\n // Do not have to check this as this is manually specified by users.\n return true;\n }\n if (fieldQ.field === '*') {\n return fieldQ.type === type_1.Type.QUANTITATIVE;\n }\n return schema.vlType(fieldQ.field) === fieldQ.type;\n }\n }, {\n name: 'maxCardinalityForCategoricalColor',\n description: 'Categorical channel should not have too high cardinality',\n properties: [property_1.Property.CHANNEL, property_1.Property.FIELD],\n allowWildcardForProperties: false,\n strict: false,\n satisfy: function (fieldQ, schema, _, opt) {\n // TODO: missing case where ordinal / temporal use categorical color\n // (once we do so, need to add Property.BIN, Property.TIMEUNIT)\n if (fieldQ.channel === channel_1.Channel.COLOR && (fieldQ.type === type_1.Type.NOMINAL || fieldQ.type === expandedtype_1.ExpandedType.KEY)) {\n return schema.cardinality(fieldQ) <= opt.maxCardinalityForCategoricalColor;\n }\n return true; // other channel is irrelevant to this constraint\n }\n }, {\n name: 'maxCardinalityForFacet',\n description: 'Row/column channel should not have too high cardinality',\n properties: [property_1.Property.CHANNEL, property_1.Property.FIELD, property_1.Property.BIN, property_1.Property.TIMEUNIT],\n allowWildcardForProperties: false,\n strict: false,\n satisfy: function (fieldQ, schema, _, opt) {\n if (fieldQ.channel === channel_1.Channel.ROW || fieldQ.channel === channel_1.Channel.COLUMN) {\n return schema.cardinality(fieldQ) <= opt.maxCardinalityForFacet;\n }\n return true; // other channel is irrelevant to this constraint\n }\n }, {\n name: 'maxCardinalityForShape',\n description: 'Shape channel should not have too high cardinality',\n properties: [property_1.Property.CHANNEL, property_1.Property.FIELD, property_1.Property.BIN, property_1.Property.TIMEUNIT],\n allowWildcardForProperties: false,\n strict: false,\n satisfy: function (fieldQ, schema, _, opt) {\n if (fieldQ.channel === channel_1.Channel.SHAPE) {\n return schema.cardinality(fieldQ) <= opt.maxCardinalityForShape;\n }\n return true; // other channel is irrelevant to this constraint\n }\n },\n {\n name: 'dataTypeAndFunctionMatchScaleType',\n description: 'Scale type must match data type',\n properties: [property_1.Property.TYPE, property_1.Property.SCALE, property_1.getEncodingNestedProp('scale', 'type'), property_1.Property.TIMEUNIT, property_1.Property.BIN],\n allowWildcardForProperties: false,\n strict: true,\n satisfy: function (fieldQ, _, __, ___) {\n if (fieldQ.scale) {\n var type = fieldQ.type;\n var sType = encoding_1.scaleType(fieldQ);\n if (expandedtype_1.isDiscrete(type)) {\n return sType === undefined || scale_1.hasDiscreteDomain(sType);\n }\n else if (type === type_1.Type.TEMPORAL) {\n if (!fieldQ.timeUnit) {\n return util_1.contains([scale_1.ScaleType.TIME, scale_1.ScaleType.UTC, undefined], sType);\n }\n else {\n return util_1.contains([scale_1.ScaleType.TIME, scale_1.ScaleType.UTC, undefined], sType) || scale_1.hasDiscreteDomain(sType);\n }\n }\n else if (type === type_1.Type.QUANTITATIVE) {\n if (fieldQ.bin) {\n return util_1.contains([scale_1.ScaleType.LINEAR, undefined], sType);\n }\n else {\n return util_1.contains([scale_1.ScaleType.LOG, scale_1.ScaleType.POW, scale_1.ScaleType.SQRT, scale_1.ScaleType.QUANTILE, scale_1.ScaleType.QUANTIZE, scale_1.ScaleType.LINEAR, undefined], sType);\n }\n }\n }\n return true;\n }\n },\n {\n name: 'stackIsOnlyUsedWithXY',\n description: 'stack should only be allowed for x and y channels',\n properties: [property_1.Property.STACK, property_1.Property.CHANNEL],\n allowWildcardForProperties: false,\n strict: true,\n satisfy: function (fieldQ, _, __, ___) {\n if (!!fieldQ.stack) {\n return fieldQ.channel === channel_1.Channel.X || fieldQ.channel === channel_1.Channel.Y;\n }\n return true;\n }\n }\n].map(function (ec) { return new base_1.EncodingConstraintModel(ec); });\nexports.FIELD_CONSTRAINT_INDEX = exports.FIELD_CONSTRAINTS.reduce(function (m, ec) {\n m[ec.name()] = ec;\n return m;\n}, {});\nexports.FIELD_CONSTRAINTS_BY_PROPERTY = exports.FIELD_CONSTRAINTS.reduce(function (index, c) {\n for (var _i = 0, _a = c.properties(); _i < _a.length; _i++) {\n var prop = _a[_i];\n // Initialize array and use it\n index.set(prop, index.get(prop) || []);\n index.get(prop).push(c);\n }\n return index;\n}, new propindex_1.PropIndex());\n//# sourceMappingURL=field.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar property_1 = require(\"../property\");\nvar propindex_1 = require(\"../propindex\");\nvar util_1 = require(\"../util\");\nvar base_1 = require(\"./base\");\nexports.VALUE_CONSTRAINTS = [\n {\n name: 'doesNotSupportConstantValue',\n description: 'row, column, x, y, order, and detail should not work with constant values.',\n properties: [property_1.Property.TYPE, property_1.Property.AGGREGATE],\n allowWildcardForProperties: false,\n strict: true,\n satisfy: function (valueQ, _, __, ___) {\n return !(util_1.contains(['row', 'column', 'x', 'y', 'detail', 'order'], valueQ.channel));\n }\n }\n].map(function (ec) { return new base_1.EncodingConstraintModel(ec); });\nexports.VALUE_CONSTRAINT_INDEX = exports.VALUE_CONSTRAINTS.reduce(function (m, ec) {\n m[ec.name()] = ec;\n return m;\n}, {});\nexports.VALUE_CONSTRAINTS_BY_PROPERTY = exports.VALUE_CONSTRAINTS.reduce(function (index, c) {\n for (var _i = 0, _a = c.properties(); _i < _a.length; _i++) {\n var prop = _a[_i];\n index.set(prop, index.get(prop) || []);\n index.get(prop).push(c);\n }\n return index;\n}, new propindex_1.PropIndex());\n//# sourceMappingURL=value.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar encoding_1 = require(\"../query/encoding\");\nvar field_1 = require(\"./field\");\nvar value_1 = require(\"./value\");\n/**\n * Check all encoding constraints for a particular property and index tuple\n */\nfunction checkEncoding(prop, wildcard, index, specM, schema, opt) {\n // Check encoding constraint\n var encodingConstraints = field_1.FIELD_CONSTRAINTS_BY_PROPERTY.get(prop) || [];\n var encQ = specM.getEncodingQueryByIndex(index);\n for (var _i = 0, encodingConstraints_1 = encodingConstraints; _i < encodingConstraints_1.length; _i++) {\n var c = encodingConstraints_1[_i];\n // Check if the constraint is enabled\n if (c.strict() || !!opt[c.name()]) {\n // For strict constraint, or enabled non-strict, check the constraints\n var satisfy = c.satisfy(encQ, schema, specM.wildcardIndex.encodings[index], opt);\n if (!satisfy) {\n var violatedConstraint = '(enc) ' + c.name();\n /* istanbul ignore if */\n if (opt.verbose) {\n console.log(violatedConstraint + ' failed with ' + specM.toShorthand() + ' for ' + wildcard.name);\n }\n return violatedConstraint;\n }\n }\n }\n var valueContraints = value_1.VALUE_CONSTRAINTS_BY_PROPERTY.get(prop) || [];\n for (var _a = 0, valueContraints_1 = valueContraints; _a < valueContraints_1.length; _a++) {\n var c = valueContraints_1[_a];\n // Check if the constraint is enabled\n if ((c.strict() || !!opt[c.name()]) && encoding_1.isValueQuery(encQ)) {\n // For strict constraint, or enabled non-strict, check the constraints\n var satisfy = c.satisfy(encQ, schema, specM.wildcardIndex.encodings[index], opt);\n if (!satisfy) {\n var violatedConstraint = '(enc) ' + c.name();\n /* istanbul ignore if */\n if (opt.verbose) {\n console.log(violatedConstraint + ' failed with ' + specM.toShorthand() + ' for ' + wildcard.name);\n }\n return violatedConstraint;\n }\n }\n }\n return null;\n}\nexports.checkEncoding = checkEncoding;\n//# sourceMappingURL=encoding.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar aggregate_1 = require(\"vega-lite/build/src/aggregate\");\nvar channel_1 = require(\"vega-lite/build/src/channel\");\nvar mark_1 = require(\"vega-lite/build/src/mark\");\nvar scale_1 = require(\"vega-lite/build/src/scale\");\nvar type_1 = require(\"vega-lite/build/src/type\");\nvar expandedtype_1 = require(\"../query/expandedtype\");\nvar base_1 = require(\"./base\");\nvar wildcard_1 = require(\"../wildcard\");\nvar property_1 = require(\"../property\");\nvar propindex_1 = require(\"../propindex\");\nvar util_1 = require(\"../util\");\nvar encoding_1 = require(\"../query/encoding\");\nvar NONPOSITION_CHANNELS_INDEX = channel_1.NONPOSITION_CHANNELS.reduce(function (m, channel) {\n m[channel] = true;\n return m;\n}, {});\nvar SpecConstraintModel = /** @class */ (function (_super) {\n __extends(SpecConstraintModel, _super);\n function SpecConstraintModel(specConstraint) {\n return _super.call(this, specConstraint) || this;\n }\n SpecConstraintModel.prototype.hasAllRequiredPropertiesSpecific = function (specM) {\n return util_1.every(this.constraint.properties, function (prop) {\n if (prop === property_1.Property.MARK) {\n return !wildcard_1.isWildcard(specM.getMark());\n }\n // TODO: transform\n if (property_1.isEncodingNestedProp(prop)) {\n var parent_1 = prop.parent;\n var child_1 = prop.child;\n return util_1.every(specM.getEncodings(), function (encQ) {\n if (!encQ[parent_1]) {\n return true;\n }\n return !wildcard_1.isWildcard(encQ[parent_1][child_1]);\n });\n }\n if (!property_1.isEncodingProperty(prop)) {\n throw new Error('UNIMPLEMENTED');\n }\n return util_1.every(specM.getEncodings(), function (encQ) {\n if (!encQ[prop]) {\n return true;\n }\n return !wildcard_1.isWildcard(encQ[prop]);\n });\n });\n };\n SpecConstraintModel.prototype.satisfy = function (specM, schema, opt) {\n // TODO: Re-order logic to optimize the \"allowWildcardForProperties\" check\n if (!this.constraint.allowWildcardForProperties) {\n if (!this.hasAllRequiredPropertiesSpecific(specM)) {\n return true;\n }\n }\n return this.constraint.satisfy(specM, schema, opt);\n };\n return SpecConstraintModel;\n}(base_1.AbstractConstraintModel));\nexports.SpecConstraintModel = SpecConstraintModel;\nexports.SPEC_CONSTRAINTS = [\n {\n name: 'noRepeatedChannel',\n description: 'Each encoding channel should only be used once.',\n properties: [property_1.Property.CHANNEL],\n allowWildcardForProperties: true,\n strict: true,\n satisfy: function (specM, _, __) {\n var usedChannel = {};\n // channel for all encodings should be valid\n return util_1.every(specM.getEncodings(), function (encQ) {\n if (!wildcard_1.isWildcard(encQ.channel)) {\n // If channel is specified, it should no be used already\n if (usedChannel[encQ.channel]) {\n return false;\n }\n usedChannel[encQ.channel] = true;\n return true;\n }\n return true; // unspecified channel is valid\n });\n }\n },\n {\n name: 'alwaysIncludeZeroInScaleWithBarMark',\n description: 'Do not recommend bar mark if scale does not start at zero',\n properties: [property_1.Property.MARK, property_1.Property.SCALE, property_1.getEncodingNestedProp('scale', 'zero'), property_1.Property.CHANNEL, property_1.Property.TYPE],\n allowWildcardForProperties: false,\n strict: true,\n satisfy: function (specM, _, __) {\n var mark = specM.getMark();\n var encodings = specM.getEncodings();\n if (mark === mark_1.Mark.BAR) {\n for (var _i = 0, encodings_1 = encodings; _i < encodings_1.length; _i++) {\n var encQ = encodings_1[_i];\n if (encoding_1.isFieldQuery(encQ) &&\n (encQ.channel === channel_1.Channel.X || encQ.channel === channel_1.Channel.Y) &&\n (encQ.type === type_1.Type.QUANTITATIVE) &&\n (encQ.scale && encQ.scale.zero === false)) {\n // TODO: zero shouldn't be manually specified\n return false;\n }\n }\n }\n return true;\n }\n },\n {\n name: 'autoAddCount',\n description: 'Automatically adding count only for plots with only ordinal, binned quantitative, or temporal with timeunit fields.',\n properties: [property_1.Property.BIN, property_1.Property.TIMEUNIT, property_1.Property.TYPE, property_1.Property.AUTOCOUNT],\n allowWildcardForProperties: true,\n strict: false,\n satisfy: function (specM, _, __) {\n var hasAutoCount = util_1.some(specM.getEncodings(), function (encQ) { return encoding_1.isEnabledAutoCountQuery(encQ); });\n if (hasAutoCount) {\n // Auto count should only be applied if all fields are nominal, ordinal, temporal with timeUnit, binned quantitative, or autoCount\n return util_1.every(specM.getEncodings(), function (encQ) {\n if (encoding_1.isValueQuery(encQ)) {\n return true;\n }\n if (encoding_1.isAutoCountQuery(encQ)) {\n return true;\n }\n switch (encQ.type) {\n case type_1.Type.QUANTITATIVE:\n return !!encQ.bin;\n case type_1.Type.TEMPORAL:\n return !!encQ.timeUnit;\n case type_1.Type.ORDINAL:\n case expandedtype_1.ExpandedType.KEY:\n case type_1.Type.NOMINAL:\n return true;\n }\n /* istanbul ignore next */\n throw new Error('Unsupported Type');\n });\n }\n else {\n var autoCountEncIndex = specM.wildcardIndex.encodingIndicesByProperty.get('autoCount') || [];\n var neverHaveAutoCount = util_1.every(autoCountEncIndex, function (index) {\n var encQ = specM.getEncodingQueryByIndex(index);\n return encoding_1.isAutoCountQuery(encQ) && !wildcard_1.isWildcard(encQ.autoCount);\n });\n if (neverHaveAutoCount) {\n // If the query surely does not have autoCount\n // then one of the field should be\n // (1) unbinned quantitative\n // (2) temporal without time unit\n // (3) nominal or ordinal field\n // or at least have potential to be (still ambiguous).\n return util_1.some(specM.getEncodings(), function (encQ) {\n if ((encoding_1.isFieldQuery(encQ) || encoding_1.isAutoCountQuery(encQ)) && encQ.type === type_1.Type.QUANTITATIVE) {\n if (encoding_1.isDisabledAutoCountQuery(encQ)) {\n return false;\n }\n else {\n return encoding_1.isFieldQuery(encQ) && (!encQ.bin || wildcard_1.isWildcard(encQ.bin));\n }\n }\n else if (encoding_1.isFieldQuery(encQ) && encQ.type === type_1.Type.TEMPORAL) {\n return !encQ.timeUnit || wildcard_1.isWildcard(encQ.timeUnit);\n }\n return false; // nominal or ordinal\n });\n }\n }\n return true; // no auto count, no constraint\n }\n },\n {\n name: 'channelPermittedByMarkType',\n description: 'Each encoding channel should be supported by the mark type',\n properties: [property_1.Property.CHANNEL, property_1.Property.MARK],\n allowWildcardForProperties: true,\n strict: true,\n satisfy: function (specM, _, __) {\n var mark = specM.getMark();\n // if mark is unspecified, no need to check\n if (wildcard_1.isWildcard(mark))\n return true;\n // TODO: can optimize this to detect only what's the changed property if needed.\n return util_1.every(specM.getEncodings(), function (encQ) {\n // channel unspecified, no need to check\n if (wildcard_1.isWildcard(encQ.channel))\n return true;\n return channel_1.supportMark(encQ.channel, mark);\n });\n }\n },\n {\n name: 'hasAllRequiredChannelsForMark',\n description: 'All required channels for the specified mark should be specified',\n properties: [property_1.Property.CHANNEL, property_1.Property.MARK],\n allowWildcardForProperties: false,\n strict: true,\n satisfy: function (specM, _, __) {\n var mark = specM.getMark();\n switch (mark) {\n case mark_1.Mark.AREA:\n case mark_1.Mark.LINE:\n return specM.channelUsed(channel_1.Channel.X) && specM.channelUsed(channel_1.Channel.Y);\n case mark_1.Mark.TEXT:\n return specM.channelUsed(channel_1.Channel.TEXT);\n case mark_1.Mark.BAR:\n case mark_1.Mark.CIRCLE:\n case mark_1.Mark.SQUARE:\n case mark_1.Mark.TICK:\n case mark_1.Mark.RULE:\n case mark_1.Mark.RECT:\n return specM.channelUsed(channel_1.Channel.X) || specM.channelUsed(channel_1.Channel.Y);\n case mark_1.Mark.POINT:\n // This allows generating a point plot if channel was not a wildcard.\n return !specM.wildcardIndex.hasProperty(property_1.Property.CHANNEL) ||\n specM.channelUsed(channel_1.Channel.X) || specM.channelUsed(channel_1.Channel.Y);\n }\n /* istanbul ignore next */\n throw new Error('hasAllRequiredChannelsForMark not implemented for mark' + JSON.stringify(mark));\n }\n },\n {\n name: 'omitAggregate',\n description: 'Omit aggregate plots.',\n properties: [property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT],\n allowWildcardForProperties: true,\n strict: false,\n satisfy: function (specM, _, __) {\n if (specM.isAggregate()) {\n return false;\n }\n return true;\n }\n },\n {\n name: 'omitAggregatePlotWithDimensionOnlyOnFacet',\n description: 'Omit aggregate plots with dimensions only on facets as that leads to inefficient use of space.',\n properties: [property_1.Property.CHANNEL, property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT],\n allowWildcardForProperties: false,\n strict: false,\n satisfy: function (specM, _, opt) {\n if (specM.isAggregate()) {\n var hasNonFacetDim_1 = false, hasDim_1 = false, hasEnumeratedFacetDim_1 = false;\n specM.specQuery.encodings.forEach(function (encQ, index) {\n if (encoding_1.isValueQuery(encQ) || (encoding_1.isDisabledAutoCountQuery(encQ)))\n return; // skip unused field\n // FieldQuery & !encQ.aggregate\n if (encoding_1.isFieldQuery(encQ) && !encQ.aggregate) {\n hasDim_1 = true;\n if (util_1.contains([channel_1.Channel.ROW, channel_1.Channel.COLUMN], encQ.channel)) {\n if (specM.wildcardIndex.hasEncodingProperty(index, property_1.Property.CHANNEL)) {\n hasEnumeratedFacetDim_1 = true;\n }\n }\n else {\n hasNonFacetDim_1 = true;\n }\n }\n });\n if (hasDim_1 && !hasNonFacetDim_1) {\n if (hasEnumeratedFacetDim_1 || opt.constraintManuallySpecifiedValue) {\n return false;\n }\n }\n }\n return true;\n }\n },\n {\n name: 'omitAggregatePlotWithoutDimension',\n description: 'Aggregate plots without dimension should be omitted',\n properties: [property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT, property_1.Property.BIN, property_1.Property.TIMEUNIT, property_1.Property.TYPE],\n allowWildcardForProperties: false,\n strict: false,\n satisfy: function (specM, _, __) {\n if (specM.isAggregate()) {\n // TODO relax\n return util_1.some(specM.getEncodings(), function (encQ) {\n if (encoding_1.isDimension(encQ) || (encoding_1.isFieldQuery(encQ) && (encQ.type === 'temporal'))) {\n return true;\n }\n return false;\n });\n }\n return true;\n }\n },\n {\n // TODO: we can be smarter and check if bar has occlusion based on profiling statistics\n name: 'omitBarLineAreaWithOcclusion',\n description: 'Don\\'t use bar, line or area to visualize raw plot as they often lead to occlusion.',\n properties: [property_1.Property.MARK, property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT],\n allowWildcardForProperties: false,\n strict: false,\n satisfy: function (specM, _, __) {\n if (util_1.contains([mark_1.Mark.BAR, mark_1.Mark.LINE, mark_1.Mark.AREA], specM.getMark())) {\n return specM.isAggregate();\n }\n return true;\n }\n },\n {\n name: 'omitBarTickWithSize',\n description: 'Do not map field to size channel with bar and tick mark',\n properties: [property_1.Property.CHANNEL, property_1.Property.MARK],\n allowWildcardForProperties: true,\n strict: false,\n satisfy: function (specM, _, opt) {\n var mark = specM.getMark();\n if (util_1.contains([mark_1.Mark.TICK, mark_1.Mark.BAR], mark)) {\n if (specM.channelEncodingField(channel_1.Channel.SIZE)) {\n if (opt.constraintManuallySpecifiedValue) {\n // If size is used and we constraintManuallySpecifiedValue,\n // then the spec violates this constraint.\n return false;\n }\n else {\n // Otherwise have to search for the size channel and check if it is enumerated\n var encodings = specM.specQuery.encodings;\n for (var i = 0; i < encodings.length; i++) {\n var encQ = encodings[i];\n if (encQ.channel === channel_1.Channel.SIZE) {\n if (specM.wildcardIndex.hasEncodingProperty(i, property_1.Property.CHANNEL)) {\n // If enumerated, then this is bad\n return false;\n }\n else {\n // If it's manually specified, no need to continue searching, just return.\n return true;\n }\n }\n }\n }\n }\n }\n return true; // skip\n }\n },\n {\n name: 'omitBarAreaForLogScale',\n description: 'Do not use bar and area mark for x and y\\'s log scale',\n properties: [property_1.Property.MARK, property_1.Property.CHANNEL, property_1.Property.SCALE, property_1.getEncodingNestedProp('scale', 'type'), property_1.Property.TYPE],\n allowWildcardForProperties: false,\n strict: true,\n satisfy: function (specM, _, __) {\n var mark = specM.getMark();\n var encodings = specM.getEncodings();\n // TODO: mark or scale type should be enumerated\n if (mark === mark_1.Mark.AREA || mark === mark_1.Mark.BAR) {\n for (var _i = 0, encodings_2 = encodings; _i < encodings_2.length; _i++) {\n var encQ = encodings_2[_i];\n if (encoding_1.isFieldQuery(encQ) && ((encQ.channel === channel_1.Channel.X || encQ.channel === channel_1.Channel.Y) && encQ.scale)) {\n var sType = encoding_1.scaleType(encQ);\n if (sType === scale_1.ScaleType.LOG) {\n return false;\n }\n }\n }\n }\n return true;\n }\n },\n {\n name: 'omitMultipleNonPositionalChannels',\n description: 'Unless manually specified, do not use multiple non-positional encoding channel to avoid over-encoding.',\n properties: [property_1.Property.CHANNEL],\n allowWildcardForProperties: true,\n strict: false,\n satisfy: function (specM, _, opt) {\n // have to use specM.specQuery.encodings insetad of specM.getEncodings()\n // since specM.getEncodings() remove encQ with autoCount===false from the array\n // and thus might shift the index\n var encodings = specM.specQuery.encodings;\n var nonPositionChannelCount = 0;\n var hasEnumeratedNonPositionChannel = false;\n for (var i = 0; i < encodings.length; i++) {\n var encQ = encodings[i];\n if (encoding_1.isValueQuery(encQ) || (encoding_1.isDisabledAutoCountQuery(encQ))) {\n continue; // ignore skipped encoding\n }\n var channel = encQ.channel;\n if (!wildcard_1.isWildcard(channel)) {\n if (NONPOSITION_CHANNELS_INDEX[channel + '']) {\n nonPositionChannelCount += 1;\n if (specM.wildcardIndex.hasEncodingProperty(i, property_1.Property.CHANNEL)) {\n hasEnumeratedNonPositionChannel = true;\n }\n if (nonPositionChannelCount > 1 &&\n (hasEnumeratedNonPositionChannel || opt.constraintManuallySpecifiedValue)) {\n return false;\n }\n }\n }\n }\n return true;\n }\n },\n {\n name: 'omitNonPositionalOrFacetOverPositionalChannels',\n description: 'Do not use non-positional channels unless all positional channels are used',\n properties: [property_1.Property.CHANNEL],\n allowWildcardForProperties: false,\n strict: false,\n satisfy: function (specM, _, opt) {\n var encodings = specM.specQuery.encodings;\n var hasNonPositionalChannelOrFacet = false;\n var hasEnumeratedNonPositionOrFacetChannel = false;\n var hasX = false, hasY = false;\n for (var i = 0; i < encodings.length; i++) {\n var encQ = encodings[i];\n if (encoding_1.isValueQuery(encQ) || (encoding_1.isDisabledAutoCountQuery(encQ))) {\n continue; // ignore skipped encoding\n }\n var channel = encQ.channel;\n if (channel === channel_1.Channel.X) {\n hasX = true;\n }\n else if (channel === channel_1.Channel.Y) {\n hasY = true;\n }\n else if (!wildcard_1.isWildcard(channel)) {\n // All non positional channel / Facet\n hasNonPositionalChannelOrFacet = true;\n if (specM.wildcardIndex.hasEncodingProperty(i, property_1.Property.CHANNEL)) {\n hasEnumeratedNonPositionOrFacetChannel = true;\n }\n }\n }\n if (hasEnumeratedNonPositionOrFacetChannel ||\n (opt.constraintManuallySpecifiedValue && hasNonPositionalChannelOrFacet)) {\n return hasX && hasY;\n }\n return true;\n }\n },\n {\n name: 'omitRaw',\n description: 'Omit raw plots.',\n properties: [property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT],\n allowWildcardForProperties: false,\n strict: false,\n satisfy: function (specM, _, __) {\n if (!specM.isAggregate()) {\n return false;\n }\n return true;\n }\n },\n {\n name: 'omitRawContinuousFieldForAggregatePlot',\n description: 'Aggregate plot should not use raw continuous field as group by values. ' +\n '(Quantitative should be binned. Temporal should have time unit.)',\n properties: [property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT, property_1.Property.TIMEUNIT, property_1.Property.BIN, property_1.Property.TYPE],\n allowWildcardForProperties: true,\n strict: false,\n satisfy: function (specM, _, opt) {\n if (specM.isAggregate()) {\n var encodings = specM.specQuery.encodings;\n for (var i = 0; i < encodings.length; i++) {\n var encQ = encodings[i];\n if (encoding_1.isValueQuery(encQ) || (encoding_1.isDisabledAutoCountQuery(encQ)))\n continue; // skip unused encoding\n // TODO: aggregate for ordinal and temporal\n if (encoding_1.isFieldQuery(encQ) && encQ.type === type_1.Type.TEMPORAL) {\n // Temporal fields should have timeUnit or is still a wildcard\n if (!encQ.timeUnit && (specM.wildcardIndex.hasEncodingProperty(i, property_1.Property.TIMEUNIT) ||\n opt.constraintManuallySpecifiedValue)) {\n return false;\n }\n }\n if (encQ.type === type_1.Type.QUANTITATIVE) {\n if (encoding_1.isFieldQuery(encQ) && !encQ.bin && !encQ.aggregate) {\n // If Raw Q\n if (specM.wildcardIndex.hasEncodingProperty(i, property_1.Property.BIN) ||\n specM.wildcardIndex.hasEncodingProperty(i, property_1.Property.AGGREGATE) ||\n specM.wildcardIndex.hasEncodingProperty(i, property_1.Property.AUTOCOUNT)) {\n // and it's raw from enumeration\n return false;\n }\n if (opt.constraintManuallySpecifiedValue) {\n // or if we constraintManuallySpecifiedValue\n return false;\n }\n }\n }\n }\n }\n return true;\n }\n },\n {\n name: 'omitRawDetail',\n description: 'Do not use detail channel with raw plot.',\n properties: [property_1.Property.CHANNEL, property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT],\n allowWildcardForProperties: false,\n strict: true,\n satisfy: function (specM, _, opt) {\n if (specM.isAggregate()) {\n return true;\n }\n return util_1.every(specM.specQuery.encodings, function (encQ, index) {\n if (encoding_1.isValueQuery(encQ) || (encoding_1.isDisabledAutoCountQuery(encQ)))\n return true; // ignore autoCount field\n if (encQ.channel === channel_1.Channel.DETAIL) {\n // Detail channel for raw plot is not good, except when its enumerated\n // or when it's manually specified but we constraintManuallySpecifiedValue.\n if (specM.wildcardIndex.hasEncodingProperty(index, property_1.Property.CHANNEL) ||\n opt.constraintManuallySpecifiedValue) {\n return false;\n }\n }\n return true;\n });\n }\n },\n {\n name: 'omitRepeatedField',\n description: 'Each field should be mapped to only one channel',\n properties: [property_1.Property.FIELD],\n allowWildcardForProperties: true,\n strict: false,\n satisfy: function (specM, _, opt) {\n var fieldUsed = {};\n var fieldEnumerated = {};\n var encodings = specM.specQuery.encodings;\n for (var i = 0; i < encodings.length; i++) {\n var encQ = encodings[i];\n if (encoding_1.isValueQuery(encQ) || encoding_1.isAutoCountQuery(encQ))\n continue;\n var field = void 0;\n if (encQ.field && !wildcard_1.isWildcard(encQ.field)) {\n field = encQ.field;\n }\n if (encoding_1.isAutoCountQuery(encQ) && !wildcard_1.isWildcard(encQ.autoCount)) {\n field = 'count_*';\n }\n if (field) {\n if (specM.wildcardIndex.hasEncodingProperty(i, property_1.Property.FIELD)) {\n fieldEnumerated[field] = true;\n }\n // When the field is specified previously,\n // if it is enumerated (either previously or in this encQ)\n // or if the opt.constraintManuallySpecifiedValue is true,\n // then it violates the constraint.\n if (fieldUsed[field]) {\n if (fieldEnumerated[field] || opt.constraintManuallySpecifiedValue) {\n return false;\n }\n }\n fieldUsed[field] = true;\n }\n }\n return true;\n }\n },\n // TODO: omitShapeWithBin\n {\n name: 'omitVerticalDotPlot',\n description: 'Do not output vertical dot plot.',\n properties: [property_1.Property.CHANNEL],\n allowWildcardForProperties: true,\n strict: false,\n satisfy: function (specM, _, __) {\n var encodings = specM.getEncodings();\n if (encodings.length === 1 && encodings[0].channel === channel_1.Channel.Y) {\n return false;\n }\n return true;\n }\n },\n // EXPENSIVE CONSTRAINTS -- check them later!\n {\n name: 'hasAppropriateGraphicTypeForMark',\n description: 'Has appropriate graphic type for mark',\n properties: [property_1.Property.CHANNEL, property_1.Property.MARK, property_1.Property.TYPE, property_1.Property.TIMEUNIT, property_1.Property.BIN, property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT],\n allowWildcardForProperties: false,\n strict: false,\n satisfy: function (specM, _, __) {\n var mark = specM.getMark();\n switch (mark) {\n case mark_1.Mark.AREA:\n case mark_1.Mark.LINE:\n if (specM.isAggregate()) {\n var xEncQ_1 = specM.getEncodingQueryByChannel(channel_1.Channel.X);\n var yEncQ_1 = specM.getEncodingQueryByChannel(channel_1.Channel.Y);\n var xIsMeasure = encoding_1.isMeasure(xEncQ_1);\n var yIsMeasure = encoding_1.isMeasure(yEncQ_1);\n // for aggregate line / area, we need at least one group-by axis and one measure axis.\n return xEncQ_1 && yEncQ_1 && (xIsMeasure !== yIsMeasure) &&\n // and the dimension axis should not be nominal\n // TODO: make this clause optional\n !(encoding_1.isFieldQuery(xEncQ_1) && !xIsMeasure && util_1.contains(['nominal', 'key'], xEncQ_1.type)) &&\n !(encoding_1.isFieldQuery(yEncQ_1) && !yIsMeasure && util_1.contains(['nominal', 'key'], yEncQ_1.type));\n // TODO: allow connected scatterplot\n }\n return true;\n case mark_1.Mark.TEXT:\n // FIXME correctly when we add text\n return true;\n case mark_1.Mark.BAR:\n case mark_1.Mark.TICK:\n // Bar and tick should not use size.\n if (specM.channelEncodingField(channel_1.Channel.SIZE)) {\n return false;\n }\n else {\n // Tick and Bar should have one and only one measure\n var xEncQ_2 = specM.getEncodingQueryByChannel(channel_1.Channel.X);\n var yEncQ_2 = specM.getEncodingQueryByChannel(channel_1.Channel.Y);\n var xIsMeasure = encoding_1.isMeasure(xEncQ_2);\n var yIsMeasure = encoding_1.isMeasure(yEncQ_2);\n if (xIsMeasure !== yIsMeasure) {\n return true;\n }\n return false;\n }\n case mark_1.Mark.RECT:\n // Until CompassQL supports layering, it only makes sense for\n // rect to encode DxD or 1xD (otherwise just use bar).\n // Furthermore, color should only be used in a 'heatmap' fashion\n // (with a measure field).\n var xEncQ = specM.getEncodingQueryByChannel(channel_1.Channel.X);\n var yEncQ = specM.getEncodingQueryByChannel(channel_1.Channel.Y);\n var xIsDimension = encoding_1.isDimension(xEncQ);\n var yIsDimension = encoding_1.isDimension(yEncQ);\n var colorEncQ = specM.getEncodingQueryByChannel(channel_1.Channel.COLOR);\n var colorIsQuantitative = encoding_1.isMeasure(colorEncQ);\n var colorIsOrdinal = encoding_1.isFieldQuery(colorEncQ) ?\n colorEncQ.type === type_1.Type.ORDINAL : false;\n var correctChannels = (xIsDimension && yIsDimension) ||\n (xIsDimension && !specM.channelUsed(channel_1.Channel.Y)) ||\n (yIsDimension && !specM.channelUsed(channel_1.Channel.X));\n var correctColor = !colorEncQ ||\n (colorEncQ && (colorIsQuantitative || colorIsOrdinal));\n return correctChannels && correctColor;\n case mark_1.Mark.CIRCLE:\n case mark_1.Mark.POINT:\n case mark_1.Mark.SQUARE:\n case mark_1.Mark.RULE:\n return true;\n }\n /* istanbul ignore next */\n throw new Error('hasAllRequiredChannelsForMark not implemented for mark' + mark);\n }\n },\n {\n name: 'omitInvalidStackSpec',\n description: 'If stack is specified, must follow Vega-Lite stack rules',\n properties: [property_1.Property.STACK, property_1.Property.FIELD, property_1.Property.CHANNEL, property_1.Property.MARK, property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT, property_1.Property.SCALE, property_1.getEncodingNestedProp('scale', 'type'), property_1.Property.TYPE],\n allowWildcardForProperties: false,\n strict: true,\n satisfy: function (specM, _, __) {\n if (!specM.wildcardIndex.hasProperty(property_1.Property.STACK)) {\n return true;\n }\n var stackProps = specM.getVlStack();\n if (stackProps === null && specM.getStackOffset() !== null) {\n return false;\n }\n if (stackProps.fieldChannel !== specM.getStackChannel()) {\n return false;\n }\n return true;\n }\n },\n {\n name: 'omitNonSumStack',\n description: 'Stack specifications that use non-summative aggregates should be omitted (even implicit ones)',\n properties: [property_1.Property.CHANNEL, property_1.Property.MARK, property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT, property_1.Property.SCALE, property_1.getEncodingNestedProp('scale', 'type'), property_1.Property.TYPE],\n allowWildcardForProperties: false,\n strict: true,\n satisfy: function (specM, _, __) {\n var specStack = specM.getVlStack();\n if (specStack != null) {\n var stackParentEncQ = specM.getEncodingQueryByChannel(specStack.fieldChannel);\n if (!util_1.contains(aggregate_1.SUM_OPS, stackParentEncQ.aggregate)) {\n return false;\n }\n }\n return true;\n }\n },\n {\n name: 'omitTableWithOcclusionIfAutoAddCount',\n description: 'Plots without aggregation or autocount where x and y are both discrete should be omitted if autoAddCount is enabled as they often lead to occlusion',\n properties: [property_1.Property.CHANNEL, property_1.Property.TYPE, property_1.Property.TIMEUNIT, property_1.Property.BIN, property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT],\n allowWildcardForProperties: false,\n strict: false,\n satisfy: function (specM, _, opt) {\n if (opt.autoAddCount) {\n var xEncQ = specM.getEncodingQueryByChannel('x');\n var yEncQ = specM.getEncodingQueryByChannel('y');\n if ((!encoding_1.isFieldQuery(xEncQ) || encoding_1.isDimension(xEncQ)) &&\n (!encoding_1.isFieldQuery(yEncQ) || encoding_1.isDimension(yEncQ))) {\n if (!specM.isAggregate()) {\n return false;\n }\n else {\n return util_1.every(specM.getEncodings(), function (encQ) {\n var channel = encQ.channel;\n if (channel !== channel_1.Channel.X && channel !== channel_1.Channel.Y &&\n channel !== channel_1.Channel.ROW && channel !== channel_1.Channel.COLUMN) {\n // Non-position fields should not be unaggreated fields\n if (encoding_1.isFieldQuery(encQ) && !encQ.aggregate) {\n return false;\n }\n }\n return true;\n });\n }\n }\n }\n return true;\n }\n }\n].map(function (sc) { return new SpecConstraintModel(sc); });\n// For testing\nexports.SPEC_CONSTRAINT_INDEX = exports.SPEC_CONSTRAINTS.reduce(function (m, c) {\n m[c.name()] = c;\n return m;\n}, {});\nvar SPEC_CONSTRAINTS_BY_PROPERTY = exports.SPEC_CONSTRAINTS.reduce(function (index, c) {\n for (var _i = 0, _a = c.properties(); _i < _a.length; _i++) {\n var prop = _a[_i];\n // Initialize array and use it\n index.set(prop, index.get(prop) || []);\n index.get(prop).push(c);\n }\n return index;\n}, new propindex_1.PropIndex());\n/**\n * Check all encoding constraints for a particular property and index tuple\n */\nfunction checkSpec(prop, wildcard, specM, schema, opt) {\n // Check encoding constraint\n var specConstraints = SPEC_CONSTRAINTS_BY_PROPERTY.get(prop) || [];\n for (var _i = 0, specConstraints_1 = specConstraints; _i < specConstraints_1.length; _i++) {\n var c = specConstraints_1[_i];\n // Check if the constraint is enabled\n if (c.strict() || !!opt[c.name()]) {\n // For strict constraint, or enabled non-strict, check the constraints\n var satisfy = c.satisfy(specM, schema, opt);\n if (!satisfy) {\n var violatedConstraint = '(spec) ' + c.name();\n /* istanbul ignore if */\n if (opt.verbose) {\n console.log(violatedConstraint + ' failed with ' + specM.toShorthand() + ' for ' + wildcard.name);\n }\n return violatedConstraint;\n }\n }\n }\n return null;\n}\nexports.checkSpec = checkSpec;\n//# sourceMappingURL=spec.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar encoding = require(\"./encoding\");\nexports.encoding = encoding;\nvar spec = require(\"./spec\");\nexports.spec = spec;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar encoding_1 = require(\"./constraint/encoding\");\nvar spec_1 = require(\"./constraint/spec\");\nvar property_1 = require(\"./property\");\nvar propindex_1 = require(\"./propindex\");\nvar encoding_2 = require(\"./query/encoding\");\nvar ENUMERATOR_INDEX = new propindex_1.PropIndex();\nfunction getEnumerator(prop) {\n return ENUMERATOR_INDEX.get(prop);\n}\nexports.getEnumerator = getEnumerator;\nENUMERATOR_INDEX.set('mark', function (wildcardIndex, schema, opt) {\n return function (answerSet, specM) {\n var markWildcard = specM.getMark();\n // enumerate the value\n markWildcard.enum.forEach(function (mark) {\n specM.setMark(mark);\n // Check spec constraint\n var violatedSpecConstraint = spec_1.checkSpec('mark', wildcardIndex.mark, specM, schema, opt);\n if (!violatedSpecConstraint) {\n // emit\n answerSet.push(specM.duplicate());\n }\n });\n // Reset to avoid side effect\n specM.resetMark();\n return answerSet;\n };\n});\nproperty_1.ENCODING_TOPLEVEL_PROPS.forEach(function (prop) {\n ENUMERATOR_INDEX.set(prop, EncodingPropertyGeneratorFactory(prop));\n});\nproperty_1.ENCODING_NESTED_PROPS.forEach(function (nestedProp) {\n ENUMERATOR_INDEX.set(nestedProp, EncodingPropertyGeneratorFactory(nestedProp));\n});\n/**\n * @param prop property type.\n * @return an answer set reducer factory for the given prop.\n */\nfunction EncodingPropertyGeneratorFactory(prop) {\n /**\n * @return as reducer that takes a specQueryModel as input and output an answer set array.\n */\n return function (wildcardIndex, schema, opt) {\n return function (answerSet, specM) {\n // index of encoding mappings that require enumeration\n var indices = wildcardIndex.encodingIndicesByProperty.get(prop);\n function enumerate(jobIndex) {\n if (jobIndex === indices.length) {\n // emit and terminate\n answerSet.push(specM.duplicate());\n return;\n }\n var index = indices[jobIndex];\n var wildcard = wildcardIndex.encodings[index].get(prop);\n var encQ = specM.getEncodingQueryByIndex(index);\n var propWildcard = specM.getEncodingProperty(index, prop);\n if (encoding_2.isValueQuery(encQ) || (\n // TODO: encQ.exclude\n // If this encoding query is an excluded autoCount, there is no point enumerating other properties\n // for this encoding query because they will be excluded anyway.\n // Thus, we can just move on to the next encoding to enumerate.\n (encoding_2.isDisabledAutoCountQuery(encQ)) ||\n // nested encoding property might have its parent set to false\n // therefore, we no longer have to enumerate them\n !propWildcard)) {\n enumerate(jobIndex + 1);\n }\n else {\n wildcard.enum.forEach(function (propVal) {\n if (propVal === null) {\n // our duplicate() method use JSON.stringify, parse and thus can accidentally\n // convert undefined in an array into null\n propVal = undefined;\n }\n specM.setEncodingProperty(index, prop, propVal, wildcard);\n // Check encoding constraint\n var violatedEncodingConstraint = encoding_1.checkEncoding(prop, wildcard, index, specM, schema, opt);\n if (violatedEncodingConstraint) {\n return; // do not keep searching\n }\n // Check spec constraint\n var violatedSpecConstraint = spec_1.checkSpec(prop, wildcard, specM, schema, opt);\n if (violatedSpecConstraint) {\n return; // do not keep searching\n }\n // If qualify all of the constraints, keep enumerating\n enumerate(jobIndex + 1);\n });\n // Reset to avoid side effect\n specM.resetEncodingProperty(index, prop, wildcard);\n }\n }\n // start enumerating from 0\n enumerate(0);\n return answerSet;\n };\n };\n}\nexports.EncodingPropertyGeneratorFactory = EncodingPropertyGeneratorFactory;\n//# sourceMappingURL=enumerator.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar property_1 = require(\"./property\");\nvar propindex_1 = require(\"./propindex\");\nvar WildcardIndex = /** @class */ (function () {\n function WildcardIndex() {\n this._mark = undefined;\n this._encodings = {};\n this._encodingIndicesByProperty = new propindex_1.PropIndex();\n }\n WildcardIndex.prototype.setEncodingProperty = function (index, prop, wildcard) {\n var encodingsIndex = this._encodings;\n // Init encoding index and set prop\n var encIndex = encodingsIndex[index] = encodingsIndex[index] || new propindex_1.PropIndex();\n encIndex.set(prop, wildcard);\n // Initialize indicesByProperty[prop] and add index\n var indicesByProp = this._encodingIndicesByProperty;\n indicesByProp.set(prop, (indicesByProp.get(prop) || []));\n indicesByProp.get(prop).push(index);\n return this;\n };\n WildcardIndex.prototype.hasEncodingProperty = function (index, prop) {\n return !!this._encodings[index] && this._encodings[index].has(prop);\n };\n WildcardIndex.prototype.hasProperty = function (prop) {\n if (property_1.isEncodingProperty(prop)) {\n return this.encodingIndicesByProperty.has(prop);\n }\n else if (prop === 'mark') {\n return !!this.mark;\n }\n /* istanbul ignore next */\n throw new Error('Unimplemented for property ' + prop);\n };\n WildcardIndex.prototype.isEmpty = function () {\n return !this.mark && this.encodingIndicesByProperty.size() === 0;\n };\n WildcardIndex.prototype.setMark = function (mark) {\n this._mark = mark;\n return this;\n };\n Object.defineProperty(WildcardIndex.prototype, \"mark\", {\n get: function () {\n return this._mark;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(WildcardIndex.prototype, \"encodings\", {\n get: function () {\n return this._encodings;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(WildcardIndex.prototype, \"encodingIndicesByProperty\", {\n get: function () {\n return this._encodingIndicesByProperty;\n },\n enumerable: true,\n configurable: true\n });\n return WildcardIndex;\n}());\nexports.WildcardIndex = WildcardIndex;\n//# sourceMappingURL=wildcardindex.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = require(\"datalib/src/util\");\nvar shorthand_1 = require(\"./shorthand\");\nvar property_1 = require(\"../property\");\nvar propindex_1 = require(\"../propindex\");\nvar util_2 = require(\"../util\");\nexports.REPLACE_BLANK_FIELDS = { '*': '' };\nexports.REPLACE_XY_CHANNELS = { x: 'xy', y: 'xy' };\nexports.REPLACE_FACET_CHANNELS = { row: 'facet', column: 'facet' };\nexports.REPLACE_MARK_STYLE_CHANNELS = { color: 'style', opacity: 'style', shape: 'style', size: 'style' };\nfunction isExtendedGroupBy(g) {\n return util_1.isObject(g) && !!g['property'];\n}\nexports.isExtendedGroupBy = isExtendedGroupBy;\nfunction parseGroupBy(groupBy, include, replaceIndex) {\n include = include || new propindex_1.PropIndex();\n replaceIndex = replaceIndex || new propindex_1.PropIndex();\n groupBy.forEach(function (grpBy) {\n if (isExtendedGroupBy(grpBy)) {\n include.setByKey(grpBy.property, true);\n replaceIndex.setByKey(grpBy.property, grpBy.replace);\n }\n else {\n include.setByKey(grpBy, true);\n }\n });\n return {\n include: include,\n replaceIndex: replaceIndex,\n replacer: shorthand_1.getReplacerIndex(replaceIndex)\n };\n}\nexports.parseGroupBy = parseGroupBy;\nfunction toString(groupBy) {\n if (util_1.isArray(groupBy)) {\n return groupBy.map(function (g) {\n if (isExtendedGroupBy(g)) {\n if (g.replace) {\n var replaceIndex_1 = util_2.keys(g.replace).reduce(function (index, valFrom) {\n var valTo = g.replace[valFrom];\n (index[valTo] = index[valTo] || []).push(valFrom);\n return index;\n }, {});\n return g.property + '[' + util_2.keys(replaceIndex_1).map(function (valTo) {\n var valsFrom = replaceIndex_1[valTo].sort();\n return valsFrom.join(',') + '=>' + valTo;\n }).join(';') + ']';\n }\n return g.property;\n }\n return g;\n }).join(',');\n }\n else {\n return groupBy;\n }\n}\nexports.toString = toString;\nexports.GROUP_BY_FIELD_TRANSFORM = [\n property_1.Property.FIELD, property_1.Property.TYPE,\n property_1.Property.AGGREGATE, property_1.Property.BIN, property_1.Property.TIMEUNIT, property_1.Property.STACK\n];\nexports.GROUP_BY_ENCODING = exports.GROUP_BY_FIELD_TRANSFORM.concat([\n {\n property: property_1.Property.CHANNEL,\n replace: {\n 'x': 'xy', 'y': 'xy',\n 'color': 'style', 'size': 'style', 'shape': 'style', 'opacity': 'style',\n 'row': 'facet', 'column': 'facet'\n }\n }\n]);\n//# sourceMappingURL=groupby.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = require(\"datalib/src/util\");\nvar property_1 = require(\"./property\");\nvar propindex_1 = require(\"./propindex\");\nvar groupby_1 = require(\"./query/groupby\");\nvar shorthand_1 = require(\"./query/shorthand\");\n/**\n * Registry for all possible grouping key functions.\n */\nvar groupRegistry = {};\n/**\n * Add a grouping function to the registry.\n */\nfunction registerKeyFn(name, keyFn) {\n groupRegistry[name] = keyFn;\n}\nexports.registerKeyFn = registerKeyFn;\nexports.FIELD = 'field';\nexports.FIELD_TRANSFORM = 'fieldTransform';\nexports.ENCODING = 'encoding';\nexports.SPEC = 'spec';\n/**\n * Group the input spec query model by a key function registered in the group registry\n * @return\n */\nfunction nest(specModels, queryNest) {\n if (queryNest) {\n var rootGroup_1 = {\n name: '',\n path: '',\n items: [],\n };\n var groupIndex_1 = {};\n // global `includes` and `replaces` will get augmented by each level's groupBy.\n // Upper level's `groupBy` will get cascaded to lower-level groupBy.\n // `replace` can be overriden in a lower-level to support different grouping.\n var includes_1 = [];\n var replaces = [];\n var replacers_1 = [];\n for (var l = 0; l < queryNest.length; l++) {\n includes_1.push(l > 0 ? includes_1[l - 1].duplicate() : new propindex_1.PropIndex());\n replaces.push(l > 0 ? replaces[l - 1].duplicate() : new propindex_1.PropIndex());\n var groupBy = queryNest[l].groupBy;\n if (util_1.isArray(groupBy)) {\n // If group is array, it's an array of extended group by that need to be parsed\n var parsedGroupBy = groupby_1.parseGroupBy(groupBy, includes_1[l], replaces[l]);\n replacers_1.push(parsedGroupBy.replacer);\n }\n }\n // With includes and replacers, now we can construct the nesting tree\n specModels.forEach(function (specM) {\n var path = '';\n var group = rootGroup_1;\n for (var l = 0; l < queryNest.length; l++) {\n var groupBy = group.groupBy = queryNest[l].groupBy;\n group.orderGroupBy = queryNest[l].orderGroupBy;\n var key = util_1.isArray(groupBy) ?\n shorthand_1.spec(specM.specQuery, includes_1[l], replacers_1[l]) :\n groupRegistry[groupBy](specM.specQuery);\n path += '/' + key;\n if (!groupIndex_1[path]) {\n groupIndex_1[path] = {\n name: key,\n path: path,\n items: [],\n };\n group.items.push(groupIndex_1[path]);\n }\n group = groupIndex_1[path];\n }\n group.items.push(specM);\n });\n return rootGroup_1;\n }\n else {\n // no nesting, just return a flat group\n return {\n name: '',\n path: '',\n items: specModels,\n };\n }\n}\nexports.nest = nest;\n// TODO: move this to groupBy, rename properly, and export\nvar GROUP_BY_FIELD = [property_1.Property.FIELD];\nvar PARSED_GROUP_BY_FIELD = groupby_1.parseGroupBy(GROUP_BY_FIELD);\nfunction getGroupByKey(specM, groupBy) {\n return groupRegistry[groupBy](specM);\n}\nexports.getGroupByKey = getGroupByKey;\nregisterKeyFn(exports.FIELD, function (specQ) {\n return shorthand_1.spec(specQ, PARSED_GROUP_BY_FIELD.include, PARSED_GROUP_BY_FIELD.replacer);\n});\nexports.PARSED_GROUP_BY_FIELD_TRANSFORM = groupby_1.parseGroupBy(groupby_1.GROUP_BY_FIELD_TRANSFORM);\nregisterKeyFn(exports.FIELD_TRANSFORM, function (specQ) {\n return shorthand_1.spec(specQ, exports.PARSED_GROUP_BY_FIELD_TRANSFORM.include, exports.PARSED_GROUP_BY_FIELD_TRANSFORM.replacer);\n});\nexports.PARSED_GROUP_BY_ENCODING = groupby_1.parseGroupBy(groupby_1.GROUP_BY_ENCODING);\nregisterKeyFn(exports.ENCODING, function (specQ) {\n return shorthand_1.spec(specQ, exports.PARSED_GROUP_BY_ENCODING.include, exports.PARSED_GROUP_BY_ENCODING.replacer);\n});\nregisterKeyFn(exports.SPEC, function (specQ) { return JSON.stringify(specQ); });\n//# sourceMappingURL=nest.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar type_1 = require(\"vega-lite/build/src/type\");\nvar property_1 = require(\"./property\");\nvar wildcard_1 = require(\"./wildcard\");\nvar wildcardindex_1 = require(\"./wildcardindex\");\nvar spec_1 = require(\"./query/spec\");\nvar encoding_1 = require(\"./query/encoding\");\nvar groupby_1 = require(\"./query/groupby\");\nvar shorthand_1 = require(\"./query/shorthand\");\nvar util_1 = require(\"./util\");\nvar util_2 = require(\"datalib/src/util\");\nvar nest_1 = require(\"./nest\");\n/**\n * Internal class for specQuery that provides helper for the enumeration process.\n */\nvar SpecQueryModel = /** @class */ (function () {\n function SpecQueryModel(spec, wildcardIndex, schema, opt, wildcardAssignment) {\n this._rankingScore = {};\n this._spec = spec;\n this._channelFieldCount = spec.encodings.reduce(function (m, encQ) {\n if (!wildcard_1.isWildcard(encQ.channel) && (!encoding_1.isAutoCountQuery(encQ) || encQ.autoCount !== false)) {\n m[encQ.channel + ''] = 1;\n }\n return m;\n }, {});\n this._wildcardIndex = wildcardIndex;\n this._assignedWildcardIndex = wildcardAssignment;\n this._opt = opt;\n this._schema = schema;\n }\n /**\n * Build a WildcardIndex by detecting wildcards\n * in the input specQuery and replacing short wildcards (\"?\")\n * with full ones (objects with `name` and `enum` values).\n *\n * @return a SpecQueryModel that wraps the specQuery and the WildcardIndex.\n */\n SpecQueryModel.build = function (specQ, schema, opt) {\n var wildcardIndex = new wildcardindex_1.WildcardIndex();\n // mark\n if (wildcard_1.isWildcard(specQ.mark)) {\n var name_1 = wildcard_1.getDefaultName(property_1.Property.MARK);\n specQ.mark = wildcard_1.initWildcard(specQ.mark, name_1, opt.enum.mark);\n wildcardIndex.setMark(specQ.mark);\n }\n // TODO: transform\n // encodings\n specQ.encodings.forEach(function (encQ, index) {\n if (encoding_1.isAutoCountQuery(encQ)) {\n // This is only for testing purpose\n console.warn('A field with autoCount should not be included as autoCount meant to be an internal object.');\n encQ.type = type_1.Type.QUANTITATIVE; // autoCount is always quantitative\n }\n if (encoding_1.isFieldQuery(encQ) && encQ.type === undefined) {\n // type is optional -- we automatically augment wildcard if not specified\n encQ.type = wildcard_1.SHORT_WILDCARD;\n }\n // For each property of the encodingQuery, enumerate\n property_1.ENCODING_TOPLEVEL_PROPS.forEach(function (prop) {\n if (wildcard_1.isWildcard(encQ[prop])) {\n // Assign default wildcard name and enum values.\n var defaultWildcardName = wildcard_1.getDefaultName(prop) + index;\n var defaultEnumValues = wildcard_1.getDefaultEnumValues(prop, schema, opt);\n var wildcard = encQ[prop] = wildcard_1.initWildcard(encQ[prop], defaultWildcardName, defaultEnumValues);\n // Add index of the encoding mapping to the property's wildcard index.\n wildcardIndex.setEncodingProperty(index, prop, wildcard);\n }\n });\n // For each nested property of the encoding query (e.g., encQ.bin.maxbins)\n property_1.ENCODING_NESTED_PROPS.forEach(function (prop) {\n var propObj = encQ[prop.parent]; // the property object e.g., encQ.bin\n if (propObj) {\n var child = prop.child;\n if (wildcard_1.isWildcard(propObj[child])) {\n // Assign default wildcard name and enum values.\n var defaultWildcardName = wildcard_1.getDefaultName(prop) + index;\n var defaultEnumValues = wildcard_1.getDefaultEnumValues(prop, schema, opt);\n var wildcard = propObj[child] = wildcard_1.initWildcard(propObj[child], defaultWildcardName, defaultEnumValues);\n // Add index of the encoding mapping to the property's wildcard index.\n wildcardIndex.setEncodingProperty(index, prop, wildcard);\n }\n }\n });\n });\n // AUTO COUNT\n // Add Auto Count Field\n if (opt.autoAddCount) {\n var channel = {\n name: wildcard_1.getDefaultName(property_1.Property.CHANNEL) + specQ.encodings.length,\n enum: wildcard_1.getDefaultEnumValues(property_1.Property.CHANNEL, schema, opt)\n };\n var autoCount = {\n name: wildcard_1.getDefaultName(property_1.Property.AUTOCOUNT) + specQ.encodings.length,\n enum: [false, true]\n };\n var countEncQ = {\n channel: channel,\n autoCount: autoCount,\n type: type_1.Type.QUANTITATIVE\n };\n specQ.encodings.push(countEncQ);\n var index = specQ.encodings.length - 1;\n // Add index of the encoding mapping to the property's wildcard index.\n wildcardIndex.setEncodingProperty(index, property_1.Property.CHANNEL, channel);\n wildcardIndex.setEncodingProperty(index, property_1.Property.AUTOCOUNT, autoCount);\n }\n return new SpecQueryModel(specQ, wildcardIndex, schema, opt, {});\n };\n Object.defineProperty(SpecQueryModel.prototype, \"wildcardIndex\", {\n get: function () {\n return this._wildcardIndex;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SpecQueryModel.prototype, \"schema\", {\n get: function () {\n return this._schema;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SpecQueryModel.prototype, \"specQuery\", {\n get: function () {\n return this._spec;\n },\n enumerable: true,\n configurable: true\n });\n SpecQueryModel.prototype.duplicate = function () {\n return new SpecQueryModel(util_1.duplicate(this._spec), this._wildcardIndex, this._schema, this._opt, util_1.duplicate(this._assignedWildcardIndex));\n };\n SpecQueryModel.prototype.setMark = function (mark) {\n var name = this._wildcardIndex.mark.name;\n this._assignedWildcardIndex[name] = this._spec.mark = mark;\n };\n SpecQueryModel.prototype.resetMark = function () {\n var wildcard = this._spec.mark = this._wildcardIndex.mark;\n delete this._assignedWildcardIndex[wildcard.name];\n };\n SpecQueryModel.prototype.getMark = function () {\n return this._spec.mark;\n };\n SpecQueryModel.prototype.getEncodingProperty = function (index, prop) {\n var encQ = this._spec.encodings[index];\n if (property_1.isEncodingNestedProp(prop)) {\n return encQ[prop.parent][prop.child];\n }\n return encQ[prop]; // encoding property (non-nested)\n };\n SpecQueryModel.prototype.setEncodingProperty = function (index, prop, value, wildcard) {\n var encQ = this._spec.encodings[index];\n if (prop === property_1.Property.CHANNEL && encQ.channel && !wildcard_1.isWildcard(encQ.channel)) {\n // If there is an old channel\n this._channelFieldCount[encQ.channel]--;\n }\n if (property_1.isEncodingNestedProp(prop)) {\n encQ[prop.parent][prop.child] = value;\n }\n else if (property_1.isEncodingNestedParent(prop) && value === true) {\n encQ[prop] = util_1.extend({}, encQ[prop], // copy all existing properties\n { enum: undefined, name: undefined } // except name and values to it no longer an wildcard\n );\n }\n else {\n encQ[prop] = value;\n }\n this._assignedWildcardIndex[wildcard.name] = value;\n if (prop === property_1.Property.CHANNEL) {\n // If there is a new channel, make sure it exists and add it to the count.\n this._channelFieldCount[value] = (this._channelFieldCount[value] || 0) + 1;\n }\n };\n SpecQueryModel.prototype.resetEncodingProperty = function (index, prop, wildcard) {\n var encQ = this._spec.encodings[index];\n if (prop === property_1.Property.CHANNEL) {\n this._channelFieldCount[encQ.channel]--;\n }\n // reset it to wildcard\n if (property_1.isEncodingNestedProp(prop)) {\n encQ[prop.parent][prop.child] = wildcard;\n }\n else {\n encQ[prop] = wildcard;\n }\n // add remove value that is reset from the assignment map\n delete this._assignedWildcardIndex[wildcard.name];\n };\n SpecQueryModel.prototype.channelUsed = function (channel) {\n // do not include encoding that has autoCount = false because it is not a part of the output spec.\n return this._channelFieldCount[channel] > 0;\n };\n SpecQueryModel.prototype.channelEncodingField = function (channel) {\n var encodingQuery = this.getEncodingQueryByChannel(channel);\n return encoding_1.isFieldQuery(encodingQuery);\n };\n SpecQueryModel.prototype.getEncodings = function () {\n // do not include encoding that has autoCount = false because it is not a part of the output spec.\n return this._spec.encodings.filter(function (encQ) { return !encoding_1.isDisabledAutoCountQuery(encQ); });\n };\n SpecQueryModel.prototype.getEncodingQueryByChannel = function (channel) {\n for (var _i = 0, _a = this._spec.encodings; _i < _a.length; _i++) {\n var specEncoding = _a[_i];\n if (specEncoding.channel === channel) {\n return specEncoding;\n }\n }\n return undefined;\n };\n SpecQueryModel.prototype.getEncodingQueryByIndex = function (i) {\n return this._spec.encodings[i];\n };\n SpecQueryModel.prototype.isAggregate = function () {\n return spec_1.isAggregate(this._spec);\n };\n /**\n * @return The Vega-Lite `StackProperties` object that describes the stack\n * configuration of `this`. Returns `null` if this is not stackable.\n */\n SpecQueryModel.prototype.getVlStack = function () {\n return spec_1.getVlStack(this._spec);\n };\n /**\n * @return The `StackOffset` specified in `this`, `undefined` if none\n * is specified.\n */\n SpecQueryModel.prototype.getStackOffset = function () {\n return spec_1.getStackOffset(this._spec);\n };\n /**\n * @return The `Channel` in which `stack` is specified in `this`, or\n * `null` if none is specified.\n */\n SpecQueryModel.prototype.getStackChannel = function () {\n return spec_1.getStackChannel(this._spec);\n };\n SpecQueryModel.prototype.toShorthand = function (groupBy) {\n if (groupBy) {\n if (util_2.isString(groupBy)) {\n return nest_1.getGroupByKey(this.specQuery, groupBy);\n }\n var parsedGroupBy = groupby_1.parseGroupBy(groupBy);\n return shorthand_1.spec(this._spec, parsedGroupBy.include, parsedGroupBy.replacer);\n }\n return shorthand_1.spec(this._spec);\n };\n /**\n * Convert a query to a Vega-Lite spec if it is completed.\n * @return a Vega-Lite spec if completed, null otherwise.\n */\n SpecQueryModel.prototype.toSpec = function (data) {\n if (wildcard_1.isWildcard(this._spec.mark))\n return null;\n var spec = {};\n data = data || this._spec.data;\n if (data) {\n spec.data = data;\n }\n if (this._spec.transform) {\n spec.transform = this._spec.transform;\n }\n spec.mark = this._spec.mark;\n spec.encoding = encoding_1.toEncoding(this.specQuery.encodings, { schema: this._schema, wildcardMode: 'null' });\n if (this._spec.width) {\n spec.width = this._spec.width;\n }\n if (this._spec.height) {\n spec.height = this._spec.height;\n }\n if (this._spec.background) {\n spec.background = this._spec.background;\n }\n if (this._spec.padding) {\n spec.padding = this._spec.padding;\n }\n if (this._spec.title) {\n spec.title = this._spec.title;\n }\n if (spec.encoding === null) {\n return null;\n }\n if (this._spec.config || this._opt.defaultSpecConfig)\n spec.config = util_1.extend({}, this._opt.defaultSpecConfig, this._spec.config);\n return spec;\n };\n SpecQueryModel.prototype.getRankingScore = function (rankingName) {\n return this._rankingScore[rankingName];\n };\n SpecQueryModel.prototype.setRankingScore = function (rankingName, score) {\n this._rankingScore[rankingName] = score;\n };\n return SpecQueryModel;\n}());\nexports.SpecQueryModel = SpecQueryModel;\n//# sourceMappingURL=model.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=transform.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = require(\"../util\");\n/**\n * Normalize the non-nested version of the query\n * (basically when you have a `groupBy`)\n * to a standardize nested.\n */\nfunction normalize(q) {\n if (q.groupBy) {\n var nest = {\n groupBy: q.groupBy\n };\n if (q.orderBy) {\n nest.orderGroupBy = q.orderBy;\n }\n var normalizedQ = {\n spec: util_1.duplicate(q.spec),\n nest: [nest],\n };\n if (q.chooseBy) {\n normalizedQ.chooseBy = q.chooseBy;\n }\n if (q.config) {\n normalizedQ.config = q.config;\n }\n return normalizedQ;\n }\n return util_1.duplicate(q); // We will cause side effect to q.spec in SpecQueryModel.build\n}\nexports.normalize = normalize;\n//# sourceMappingURL=normalize.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar encoding = require(\"./encoding\");\nexports.encoding = encoding;\nvar groupBy = require(\"./groupby\");\nexports.groupBy = groupBy;\nvar shorthand = require(\"./shorthand\");\nexports.shorthand = shorthand;\nvar spec = require(\"./spec\");\nexports.spec = spec;\nvar transform = require(\"./transform\");\nexports.transform = transform;\nvar normalize_1 = require(\"./normalize\");\nexports.normalize = normalize_1.normalize;\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction isResultTree(item) {\n return item.items !== undefined;\n}\nexports.isResultTree = isResultTree;\nfunction getTopResultTreeItem(specQuery) {\n var topItem = specQuery.items[0];\n while (topItem && isResultTree(topItem)) {\n topItem = topItem.items[0];\n }\n return topItem;\n}\nexports.getTopResultTreeItem = getTopResultTreeItem;\nfunction mapLeaves(group, f) {\n return __assign({}, group, { items: group.items.map(function (item) { return (isResultTree(item) ? mapLeaves(item, f) : f(item)); }) });\n}\nexports.mapLeaves = mapLeaves;\n//# sourceMappingURL=result.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar scale_1 = require(\"vega-lite/build/src/scale\");\nvar type_1 = require(\"vega-lite/build/src/type\");\nvar encoding_1 = require(\"../../query/encoding\");\nvar expandedtype_1 = require(\"../../query/expandedtype\");\n/**\n * Finer grained data types that takes binning and timeUnit into account.\n */\nvar ExtendedType;\n(function (ExtendedType) {\n ExtendedType[ExtendedType[\"Q\"] = type_1.Type.QUANTITATIVE] = \"Q\";\n ExtendedType[ExtendedType[\"BIN_Q\"] = 'bin_' + type_1.Type.QUANTITATIVE] = \"BIN_Q\";\n ExtendedType[ExtendedType[\"T\"] = type_1.Type.TEMPORAL] = \"T\";\n /**\n * Time Unit Temporal Field with time scale.\n */\n ExtendedType[ExtendedType[\"TIMEUNIT_T\"] = 'timeUnit_time'] = \"TIMEUNIT_T\";\n /**\n * Time Unit Temporal Field with ordinal scale.\n */\n ExtendedType[ExtendedType[\"TIMEUNIT_O\"] = 'timeUnit_' + type_1.Type.ORDINAL] = \"TIMEUNIT_O\";\n ExtendedType[ExtendedType[\"O\"] = type_1.Type.ORDINAL] = \"O\";\n ExtendedType[ExtendedType[\"N\"] = type_1.Type.NOMINAL] = \"N\";\n ExtendedType[ExtendedType[\"K\"] = expandedtype_1.ExpandedType.KEY] = \"K\";\n ExtendedType[ExtendedType[\"NONE\"] = '-'] = \"NONE\";\n})(ExtendedType = exports.ExtendedType || (exports.ExtendedType = {}));\nexports.Q = ExtendedType.Q;\nexports.BIN_Q = ExtendedType.BIN_Q;\nexports.T = ExtendedType.T;\nexports.TIMEUNIT_T = ExtendedType.TIMEUNIT_T;\nexports.TIMEUNIT_O = ExtendedType.TIMEUNIT_O;\nexports.O = ExtendedType.O;\nexports.N = ExtendedType.N;\nexports.K = ExtendedType.K;\nexports.NONE = ExtendedType.NONE;\nfunction getExtendedType(fieldQ) {\n if (fieldQ.bin) {\n return ExtendedType.BIN_Q;\n }\n else if (fieldQ.timeUnit) {\n var sType = encoding_1.scaleType(fieldQ);\n return scale_1.hasDiscreteDomain(sType) ? ExtendedType.TIMEUNIT_O : ExtendedType.TIMEUNIT_T;\n }\n return fieldQ.type;\n}\nexports.getExtendedType = getExtendedType;\n//# sourceMappingURL=type.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Scorer = /** @class */ (function () {\n function Scorer(type) {\n this.type = type;\n this.scoreIndex = this.initScore();\n }\n Scorer.prototype.getFeatureScore = function (feature) {\n var type = this.type;\n var score = this.scoreIndex[feature];\n if (score !== undefined) {\n return { type: type, feature: feature, score: score };\n }\n return undefined;\n };\n return Scorer;\n}());\nexports.Scorer = Scorer;\n//# sourceMappingURL=base.js.map","\"use strict\";\n/**\n * Field Type (with Bin and TimeUnit) and Channel Score (Cleveland / Mackinlay based)\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar channel_1 = require(\"vega-lite/build/src/channel\");\nvar config_1 = require(\"../../config\");\nvar encoding_1 = require(\"../../query/encoding\");\nvar type_1 = require(\"./type\");\nvar base_1 = require(\"./base\");\n/**\n * Effectiveness Score for preferred axis.\n */\nvar AxisScorer = /** @class */ (function (_super) {\n __extends(AxisScorer, _super);\n function AxisScorer() {\n return _super.call(this, 'Axis') || this;\n }\n AxisScorer.prototype.initScore = function (opt) {\n if (opt === void 0) { opt = {}; }\n opt = __assign({}, config_1.DEFAULT_QUERY_CONFIG, opt);\n var score = {};\n var preferredAxes = [{\n feature: type_1.BIN_Q,\n opt: 'preferredBinAxis'\n }, {\n feature: type_1.T,\n opt: 'preferredTemporalAxis'\n }, {\n feature: type_1.TIMEUNIT_T,\n opt: 'preferredTemporalAxis'\n }, {\n feature: type_1.TIMEUNIT_O,\n opt: 'preferredTemporalAxis'\n }, {\n feature: type_1.O,\n opt: 'preferredOrdinalAxis'\n }, {\n feature: type_1.N,\n opt: 'preferredNominalAxis'\n }];\n preferredAxes.forEach(function (pAxis) {\n if (opt[pAxis.opt] === channel_1.Channel.X) {\n // penalize the other axis\n score[pAxis.feature + '_' + channel_1.Channel.Y] = -0.01;\n }\n else if (opt[pAxis.opt] === channel_1.Channel.Y) {\n // penalize the other axis\n score[pAxis.feature + '_' + channel_1.Channel.X] = -0.01;\n }\n });\n return score;\n };\n AxisScorer.prototype.featurize = function (type, channel) {\n return type + '_' + channel;\n };\n AxisScorer.prototype.getScore = function (specM, _, __) {\n var _this = this;\n return specM.getEncodings().reduce(function (features, encQ) {\n if (encoding_1.isFieldQuery(encQ) || encoding_1.isAutoCountQuery(encQ)) {\n var type = type_1.getExtendedType(encQ);\n var feature = _this.featurize(type, encQ.channel);\n var featureScore = _this.getFeatureScore(feature);\n if (featureScore) {\n features.push(featureScore);\n }\n }\n return features;\n }, []);\n };\n return AxisScorer;\n}(base_1.Scorer));\nexports.AxisScorer = AxisScorer;\n//# sourceMappingURL=axis.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar base_1 = require(\"./base\");\nvar encoding_1 = require(\"../../query/encoding\");\n/**\n * Penalize if facet channels are the only dimensions\n */\nvar DimensionScorer = /** @class */ (function (_super) {\n __extends(DimensionScorer, _super);\n function DimensionScorer() {\n return _super.call(this, 'Dimension') || this;\n }\n DimensionScorer.prototype.initScore = function () {\n return {\n row: -2,\n column: -2,\n color: 0,\n opacity: 0,\n size: 0,\n shape: 0\n };\n };\n DimensionScorer.prototype.getScore = function (specM, _, __) {\n var _this = this;\n if (specM.isAggregate()) {\n specM.getEncodings().reduce(function (maxFScore, encQ) {\n if (encoding_1.isAutoCountQuery(encQ) || (encoding_1.isFieldQuery(encQ) && !encQ.aggregate)) {\n var featureScore = _this.getFeatureScore(encQ.channel + '');\n if (featureScore && featureScore.score > maxFScore.score) {\n return featureScore;\n }\n }\n return maxFScore;\n }, { type: 'Dimension', feature: 'No Dimension', score: -5 });\n }\n return [];\n };\n return DimensionScorer;\n}(base_1.Scorer));\nexports.DimensionScorer = DimensionScorer;\n//# sourceMappingURL=dimension.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar base_1 = require(\"./base\");\nvar config_1 = require(\"../../config\");\nvar encoding_1 = require(\"../../query/encoding\");\nvar channel_1 = require(\"vega-lite/build/src/channel\");\n/**\n * Effective Score for preferred facet\n */\nvar FacetScorer = /** @class */ (function (_super) {\n __extends(FacetScorer, _super);\n function FacetScorer() {\n return _super.call(this, 'Facet') || this;\n }\n FacetScorer.prototype.initScore = function (opt) {\n opt = __assign({}, config_1.DEFAULT_QUERY_CONFIG, opt);\n var score = {};\n if (opt.preferredFacet === channel_1.Channel.ROW) {\n // penalize the other axis\n score[channel_1.Channel.COLUMN] = -0.01;\n }\n else if (opt.preferredFacet === channel_1.Channel.COLUMN) {\n // penalize the other axis\n score[channel_1.Channel.ROW] = -0.01;\n }\n return score;\n };\n FacetScorer.prototype.getScore = function (specM, _, __) {\n var _this = this;\n return specM.getEncodings().reduce(function (features, encQ) {\n if (encoding_1.isFieldQuery(encQ) || encoding_1.isAutoCountQuery(encQ)) {\n var featureScore = _this.getFeatureScore(encQ.channel);\n if (featureScore) {\n features.push(featureScore);\n }\n }\n return features;\n }, []);\n };\n return FacetScorer;\n}(base_1.Scorer));\nexports.FacetScorer = FacetScorer;\n;\n//# sourceMappingURL=facet.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar base_1 = require(\"./base\");\nvar encoding_1 = require(\"../../query/encoding\");\n/**\n * Effectivenss score that penalize size for bar and tick\n */\nvar SizeChannelScorer = /** @class */ (function (_super) {\n __extends(SizeChannelScorer, _super);\n function SizeChannelScorer() {\n return _super.call(this, 'SizeChannel') || this;\n }\n SizeChannelScorer.prototype.initScore = function () {\n return {\n bar_size: -2,\n tick_size: -2\n };\n };\n SizeChannelScorer.prototype.getScore = function (specM, _, __) {\n var _this = this;\n var mark = specM.getMark();\n return specM.getEncodings().reduce(function (featureScores, encQ) {\n if (encoding_1.isFieldQuery(encQ) || encoding_1.isAutoCountQuery(encQ)) {\n var feature = mark + '_' + encQ.channel;\n var featureScore = _this.getFeatureScore(feature);\n if (featureScore) {\n featureScores.push(featureScore);\n }\n }\n return featureScores;\n }, []);\n };\n return SizeChannelScorer;\n}(base_1.Scorer));\nexports.SizeChannelScorer = SizeChannelScorer;\n//# sourceMappingURL=sizechannel.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar shorthand_1 = require(\"../../query/shorthand\");\nvar encoding_1 = require(\"../../query/encoding\");\nvar util_1 = require(\"../../util\");\nvar type_1 = require(\"./type\");\nvar base_1 = require(\"./base\");\nexports.TERRIBLE = -10;\n/**\n * Effectiveness score for relationship between\n * Field Type (with Bin and TimeUnit) and Channel Score (Cleveland / Mackinlay based)\n */\nvar TypeChannelScorer = /** @class */ (function (_super) {\n __extends(TypeChannelScorer, _super);\n function TypeChannelScorer() {\n return _super.call(this, 'TypeChannel') || this;\n }\n TypeChannelScorer.prototype.initScore = function () {\n var _this = this;\n var SCORE = {};\n // Continuous Quantitative / Temporal Fields\n var CONTINUOUS_TYPE_CHANNEL_SCORE = {\n x: 0,\n y: 0,\n size: -0.575,\n color: -0.725,\n text: -2,\n opacity: -3,\n shape: exports.TERRIBLE,\n row: exports.TERRIBLE,\n column: exports.TERRIBLE,\n detail: 2 * exports.TERRIBLE\n };\n [type_1.Q, type_1.T, type_1.TIMEUNIT_T].forEach(function (type) {\n util_1.keys(CONTINUOUS_TYPE_CHANNEL_SCORE).forEach(function (channel) {\n SCORE[_this.featurize(type, channel)] = CONTINUOUS_TYPE_CHANNEL_SCORE[channel];\n });\n });\n // Discretized Quantitative / Temporal Fields / Ordinal\n var ORDERED_TYPE_CHANNEL_SCORE = util_1.extend({}, CONTINUOUS_TYPE_CHANNEL_SCORE, {\n row: -0.75,\n column: -0.75,\n shape: -3.1,\n text: -3.2,\n detail: -4\n });\n [type_1.BIN_Q, type_1.TIMEUNIT_O, type_1.O].forEach(function (type) {\n util_1.keys(ORDERED_TYPE_CHANNEL_SCORE).forEach(function (channel) {\n SCORE[_this.featurize(type, channel)] = ORDERED_TYPE_CHANNEL_SCORE[channel];\n });\n });\n var NOMINAL_TYPE_CHANNEL_SCORE = {\n x: 0,\n y: 0,\n color: -0.6,\n shape: -0.65,\n row: -0.7,\n column: -0.7,\n text: -0.8,\n detail: -2,\n size: -3,\n opacity: -3.1,\n };\n util_1.keys(NOMINAL_TYPE_CHANNEL_SCORE).forEach(function (channel) {\n SCORE[_this.featurize(type_1.N, channel)] = NOMINAL_TYPE_CHANNEL_SCORE[channel];\n SCORE[_this.featurize(type_1.K, channel)] =\n // Putting key on position or detail isn't terrible\n util_1.contains(['x', 'y', 'detail'], channel) ? -1 :\n NOMINAL_TYPE_CHANNEL_SCORE[channel] - 2;\n });\n return SCORE;\n };\n TypeChannelScorer.prototype.featurize = function (type, channel) {\n return type + '_' + channel;\n };\n TypeChannelScorer.prototype.getScore = function (specM, schema, opt) {\n var _this = this;\n var encodingQueryByField = specM.getEncodings().reduce(function (m, encQ) {\n if (encoding_1.isFieldQuery(encQ) || encoding_1.isAutoCountQuery(encQ)) {\n var fieldKey = shorthand_1.fieldDef(encQ);\n (m[fieldKey] = m[fieldKey] || []).push(encQ);\n }\n return m;\n }, {});\n var features = [];\n util_1.forEach(encodingQueryByField, function (encQs) {\n var bestFieldFeature = encQs.reduce(function (best, encQ) {\n if (encoding_1.isFieldQuery(encQ) || encoding_1.isAutoCountQuery(encQ)) {\n var type = type_1.getExtendedType(encQ);\n var feature = _this.featurize(type, encQ.channel);\n var featureScore = _this.getFeatureScore(feature);\n if (best === null || featureScore.score > best.score) {\n return featureScore;\n }\n }\n return best;\n }, null);\n features.push(bestFieldFeature);\n // TODO: add plus for over-encoding of one field\n });\n return features;\n };\n return TypeChannelScorer;\n}(base_1.Scorer));\nexports.TypeChannelScorer = TypeChannelScorer;\n//# sourceMappingURL=typechannel.js.map","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar channel_1 = require(\"vega-lite/build/src/channel\");\nvar mark_1 = require(\"vega-lite/build/src/mark\");\nvar util_1 = require(\"../../util\");\nvar type_1 = require(\"./type\");\nvar base_1 = require(\"./base\");\nvar MarkScorer = /** @class */ (function (_super) {\n __extends(MarkScorer, _super);\n function MarkScorer() {\n return _super.call(this, 'Mark') || this;\n }\n MarkScorer.prototype.initScore = function () {\n return init();\n };\n MarkScorer.prototype.getScore = function (specM, _, __) {\n var mark = specM.getMark();\n if (mark === mark_1.Mark.CIRCLE || mark === mark_1.Mark.SQUARE) {\n mark = mark_1.Mark.POINT;\n }\n var xEncQ = specM.getEncodingQueryByChannel(channel_1.Channel.X);\n var xType = xEncQ ? type_1.getExtendedType(xEncQ) : type_1.NONE;\n var yEncQ = specM.getEncodingQueryByChannel(channel_1.Channel.Y);\n var yType = yEncQ ? type_1.getExtendedType(yEncQ) : type_1.NONE;\n var isOccluded = !specM.isAggregate(); // FIXME\n var feature = xType + '_' + yType + '_' + isOccluded + '_' + mark;\n var featureScore = this.getFeatureScore(feature);\n return [featureScore];\n };\n return MarkScorer;\n}(base_1.Scorer));\nexports.MarkScorer = MarkScorer;\nfunction featurize(xType, yType, hasOcclusion, mark) {\n return xType + '_' + yType + '_' + hasOcclusion + '_' + mark;\n}\nexports.featurize = featurize;\nfunction init() {\n var MEASURES = [type_1.Q, type_1.T];\n var DISCRETE = [type_1.BIN_Q, type_1.TIMEUNIT_O, type_1.O, type_1.N, type_1.K];\n var DISCRETE_OR_NONE = DISCRETE.concat([type_1.NONE]);\n var SCORE = {};\n // QxQ\n MEASURES.forEach(function (xType) {\n MEASURES.forEach(function (yType) {\n // has occlusion\n var occludedQQMark = {\n point: 0,\n text: -0.2,\n tick: -0.5,\n rect: -1,\n bar: -2,\n line: -2,\n area: -2,\n rule: -2.5\n };\n util_1.forEach(occludedQQMark, function (score, mark) {\n var feature = featurize(xType, yType, true, mark);\n SCORE[feature] = score;\n });\n // no occlusion\n // TODO: possible to use connected scatter plot\n var noOccludedQQMark = {\n point: 0,\n text: -0.2,\n tick: -0.5,\n bar: -2,\n line: -2,\n area: -2,\n rule: -2.5\n };\n util_1.forEach(noOccludedQQMark, function (score, mark) {\n var feature = featurize(xType, yType, false, mark);\n SCORE[feature] = score;\n });\n });\n });\n // DxQ, QxD\n MEASURES.forEach(function (xType) {\n // HAS OCCLUSION\n DISCRETE_OR_NONE.forEach(function (yType) {\n var occludedDimensionMeasureMark = {\n tick: 0,\n point: -0.2,\n text: -0.5,\n bar: -2,\n line: -2,\n area: -2,\n rule: -2.5\n };\n util_1.forEach(occludedDimensionMeasureMark, function (score, mark) {\n var feature = featurize(xType, yType, true, mark);\n SCORE[feature] = score;\n // also do the inverse\n var feature2 = featurize(yType, xType, true, mark);\n SCORE[feature2] = score;\n });\n });\n [type_1.TIMEUNIT_T].forEach(function (yType) {\n var occludedDimensionMeasureMark = {\n // For Time Dimension with time scale, tick is not good\n point: 0,\n text: -0.5,\n tick: -1,\n bar: -2,\n line: -2,\n area: -2,\n rule: -2.5\n };\n util_1.forEach(occludedDimensionMeasureMark, function (score, mark) {\n var feature = featurize(xType, yType, true, mark);\n SCORE[feature] = score;\n // also do the inverse\n var feature2 = featurize(yType, xType, true, mark);\n SCORE[feature2] = score;\n });\n });\n // NO OCCLUSION\n [type_1.NONE, type_1.N, type_1.O, type_1.K].forEach(function (yType) {\n var noOccludedQxN = {\n bar: 0,\n point: -0.2,\n tick: -0.25,\n text: -0.3,\n // Line / Area can mislead trend for N\n line: -2,\n area: -2,\n // Non-sense to use rule here\n rule: -2.5\n };\n util_1.forEach(noOccludedQxN, function (score, mark) {\n var feature = featurize(xType, yType, false, mark);\n SCORE[feature] = score;\n // also do the inverse\n var feature2 = featurize(yType, xType, false, mark);\n SCORE[feature2] = score;\n });\n });\n [type_1.BIN_Q].forEach(function (yType) {\n var noOccludedQxBinQ = {\n bar: 0,\n point: -0.2,\n tick: -0.25,\n text: -0.3,\n // Line / Area isn't the best fit for bin\n line: -0.5,\n area: -0.5,\n // Non-sense to use rule here\n rule: -2.5\n };\n util_1.forEach(noOccludedQxBinQ, function (score, mark) {\n var feature = featurize(xType, yType, false, mark);\n SCORE[feature] = score;\n // also do the inverse\n var feature2 = featurize(yType, xType, false, mark);\n SCORE[feature2] = score;\n });\n });\n [type_1.TIMEUNIT_T, type_1.TIMEUNIT_O].forEach(function (yType) {\n // For aggregate / surely no occlusion plot, Temporal with time or ordinal\n // are not that different.\n var noOccludedQxBinQ = {\n line: 0,\n area: -0.1,\n bar: -0.2,\n point: -0.3,\n tick: -0.35,\n text: -0.4,\n // Non-sense to use rule here\n rule: -2.5\n };\n util_1.forEach(noOccludedQxBinQ, function (score, mark) {\n var feature = featurize(xType, yType, false, mark);\n SCORE[feature] = score;\n // also do the inverse\n var feature2 = featurize(yType, xType, false, mark);\n SCORE[feature2] = score;\n });\n });\n });\n [type_1.TIMEUNIT_T].forEach(function (xType) {\n [type_1.TIMEUNIT_T].forEach(function (yType) {\n // has occlusion\n var ttMark = {\n point: 0,\n rect: -0.1,\n text: -0.5,\n tick: -1,\n bar: -2,\n line: -2,\n area: -2,\n rule: -2.5\n };\n // No difference between has occlusion and no occlusion\n // as most of the time, it will be the occluded case.\n util_1.forEach(ttMark, function (score, mark) {\n var feature = featurize(xType, yType, true, mark);\n SCORE[feature] = score;\n });\n util_1.forEach(ttMark, function (score, mark) {\n var feature = featurize(xType, yType, false, mark);\n SCORE[feature] = score;\n });\n });\n DISCRETE_OR_NONE.forEach(function (yType) {\n // has occlusion\n var tdMark = {\n tick: 0,\n point: -0.2,\n text: -0.5,\n rect: -1,\n bar: -2,\n line: -2,\n area: -2,\n rule: -2.5\n };\n // No difference between has occlusion and no occlusion\n // as most of the time, it will be the occluded case.\n util_1.forEach(tdMark, function (score, mark) {\n var feature = featurize(xType, yType, true, mark);\n SCORE[feature] = score;\n });\n util_1.forEach(tdMark, function (score, mark) {\n var feature = featurize(yType, xType, true, mark);\n SCORE[feature] = score;\n });\n util_1.forEach(tdMark, function (score, mark) {\n var feature = featurize(xType, yType, false, mark);\n SCORE[feature] = score;\n });\n util_1.forEach(tdMark, function (score, mark) {\n var feature = featurize(yType, xType, false, mark);\n SCORE[feature] = score;\n });\n });\n });\n // DxD\n DISCRETE_OR_NONE.forEach(function (xType) {\n DISCRETE_OR_NONE.forEach(function (yType) {\n // has occlusion\n var ddMark = {\n point: 0,\n rect: 0,\n text: -0.1,\n tick: -1,\n bar: -2,\n line: -2,\n area: -2,\n rule: -2.5\n };\n util_1.forEach(ddMark, function (score, mark) {\n var feature = featurize(xType, yType, true, mark);\n SCORE[feature] = score;\n });\n // same for no occlusion.\n util_1.forEach(ddMark, function (score, mark) {\n var feature = featurize(xType, yType, false, mark);\n SCORE[feature] = score;\n });\n });\n });\n return SCORE;\n}\n//# sourceMappingURL=mark.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar axis_1 = require(\"./axis\");\nvar dimension_1 = require(\"./dimension\");\nvar facet_1 = require(\"./facet\");\nvar sizechannel_1 = require(\"./sizechannel\");\nvar typechannel_1 = require(\"./typechannel\");\nvar mark_1 = require(\"./mark\");\nvar SCORERS = [\n new axis_1.AxisScorer(),\n new dimension_1.DimensionScorer(),\n new facet_1.FacetScorer(),\n new mark_1.MarkScorer(),\n new sizechannel_1.SizeChannelScorer(),\n new typechannel_1.TypeChannelScorer()\n];\n// TODO: x/y, row/column preference\n// TODO: stacking\n// TODO: Channel, Cardinality\n// TODO: Penalize over encoding\nfunction effectiveness(specM, schema, opt) {\n var features = SCORERS.reduce(function (f, scorer) {\n var scores = scorer.getScore(specM, schema, opt);\n return f.concat(scores);\n }, []);\n return {\n score: features.reduce(function (s, f) {\n return s + f.score;\n }, 0),\n features: features\n };\n}\nexports.effectiveness = effectiveness;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar type_1 = require(\"vega-lite/build/src/type\");\nvar util_1 = require(\"../util\");\nvar encoding_1 = require(\"../query/encoding\");\nexports.name = 'aggregationQuality';\nfunction score(specM, schema, opt) {\n var feature = aggregationQualityFeature(specM, schema, opt);\n return {\n score: feature.score,\n features: [feature]\n };\n}\nexports.score = score;\nfunction aggregationQualityFeature(specM, _, __) {\n var encodings = specM.getEncodings();\n if (specM.isAggregate()) {\n var isRawContinuous = function (encQ) {\n return encoding_1.isFieldQuery(encQ) && ((encQ.type === type_1.Type.QUANTITATIVE && !encQ.bin && !encQ.aggregate) ||\n (encQ.type === type_1.Type.TEMPORAL && !encQ.timeUnit));\n };\n if (util_1.some(encodings, isRawContinuous)) {\n // These are plots that pollute continuous fields as dimension.\n // They are often intermediate visualizations rather than what users actually want.\n return {\n type: exports.name,\n score: 0.1,\n feature: 'Aggregate with raw continuous'\n };\n }\n if (util_1.some(encodings, function (encQ) { return encoding_1.isFieldQuery(encQ) && encoding_1.isDimension(encQ); })) {\n var hasCount = util_1.some(encodings, function (encQ) {\n return (encoding_1.isFieldQuery(encQ) && encQ.aggregate === 'count') || encoding_1.isEnabledAutoCountQuery(encQ);\n });\n var hasBin = util_1.some(encodings, function (encQ) {\n return encoding_1.isFieldQuery(encQ) && !!encQ.bin;\n });\n if (hasCount) {\n // If there is count, we might add additional count field, making it a little less simple\n // then when we just apply aggregate to Q field\n return {\n type: exports.name,\n score: 0.8,\n feature: 'Aggregate with count'\n };\n }\n else if (hasBin) {\n // This is not as good as binning all the Q and show heatmap\n return {\n type: exports.name,\n score: 0.7,\n feature: 'Aggregate with bin but without count'\n };\n }\n else {\n return {\n type: exports.name,\n score: 0.9,\n feature: 'Aggregate without count and without bin'\n };\n }\n }\n // no dimension -- often not very useful\n return {\n type: exports.name,\n score: 0.3,\n feature: 'Aggregate without dimension'\n };\n }\n else {\n if (util_1.some(encodings, function (encQ) { return encoding_1.isFieldQuery(encQ) && !encoding_1.isDimension(encQ); })) {\n // raw plots with measure -- simplest of all!\n return {\n type: exports.name,\n score: 1,\n feature: 'Raw with measure'\n };\n }\n // raw plots with no measure -- often a lot of occlusion\n return {\n type: exports.name,\n score: 0.2,\n feature: 'Raw without measure'\n };\n }\n}\n//# sourceMappingURL=aggregation.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar encoding_1 = require(\"../query/encoding\");\nexports.name = 'fieldOrder';\n/**\n * Return ranking score based on indices of encoded fields in the schema.\n * If there are multiple fields, prioritize field on the lower indices of encodings.\n *\n * For example, to compare two specs with two encodings each,\n * first we compare the field on the 0-th index\n * and only compare the field on the 1-th index only if the fields on the 0-th index are the same.\n */\nfunction score(specM, schema, _) {\n var fieldWildcardIndices = specM.wildcardIndex.encodingIndicesByProperty.get('field');\n if (!fieldWildcardIndices) {\n return {\n score: 0,\n features: []\n };\n }\n var encodings = specM.specQuery.encodings;\n var numFields = schema.fieldSchemas.length;\n var features = [];\n var totalScore = 0, base = 1;\n for (var i = fieldWildcardIndices.length - 1; i >= 0; i--) {\n var index = fieldWildcardIndices[i];\n var encoding = encodings[index];\n // Skip ValueQuery as we only care about order of fields.\n var field = void 0;\n if (encoding_1.isFieldQuery(encoding)) {\n field = encoding.field;\n }\n else {\n continue;\n }\n var fieldWildcard = specM.wildcardIndex.encodings[index].get('field');\n var fieldIndex = schema.fieldSchema(field).index;\n // reverse order field with lower index should get higher score and come first\n var score_1 = -fieldIndex * base;\n totalScore += score_1;\n features.push({\n score: score_1,\n type: 'fieldOrder',\n feature: \"field \" + fieldWildcard.name + \" is \" + field + \" (#\" + fieldIndex + \" in the schema)\"\n });\n base *= numFields;\n }\n return {\n score: totalScore,\n features: features\n };\n}\nexports.score = score;\n//# sourceMappingURL=fieldorder.js.map","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar result_1 = require(\"../result\");\nvar effectiveness_1 = require(\"./effectiveness\");\n__export(require(\"./effectiveness\"));\nvar aggregation = require(\"./aggregation\");\nexports.aggregation = aggregation;\nvar fieldOrder = require(\"./fieldorder\");\nexports.fieldOrder = fieldOrder;\n/**\n * Registry for all encoding ranking functions\n */\nvar rankingRegistry = {};\n/**\n * Add an ordering function to the registry.\n */\nfunction register(name, keyFn) {\n rankingRegistry[name] = keyFn;\n}\nexports.register = register;\nfunction get(name) {\n return rankingRegistry[name];\n}\nexports.get = get;\nfunction rank(group, query, schema, level) {\n if (!query.nest || level === query.nest.length) {\n if (query.orderBy || query.chooseBy) {\n group.items.sort(comparatorFactory(query.orderBy || query.chooseBy, schema, query.config));\n if (query.chooseBy) {\n if (group.items.length > 0) {\n // for chooseBy -- only keep the top-item\n group.items.splice(1);\n }\n }\n }\n }\n else {\n // sort lower-level nodes first because our ranking takes top-item in the subgroup\n group.items.forEach(function (subgroup) {\n rank(subgroup, query, schema, level + 1);\n });\n if (query.nest[level].orderGroupBy) {\n group.items.sort(groupComparatorFactory(query.nest[level].orderGroupBy, schema, query.config));\n }\n }\n return group;\n}\nexports.rank = rank;\nfunction comparatorFactory(name, schema, opt) {\n return function (m1, m2) {\n if (name instanceof Array) {\n return getScoreDifference(name, m1, m2, schema, opt);\n }\n else {\n return getScoreDifference([name], m1, m2, schema, opt);\n }\n };\n}\nexports.comparatorFactory = comparatorFactory;\nfunction groupComparatorFactory(name, schema, opt) {\n return function (g1, g2) {\n var m1 = result_1.getTopResultTreeItem(g1);\n var m2 = result_1.getTopResultTreeItem(g2);\n if (name instanceof Array) {\n return getScoreDifference(name, m1, m2, schema, opt);\n }\n else {\n return getScoreDifference([name], m1, m2, schema, opt);\n }\n };\n}\nexports.groupComparatorFactory = groupComparatorFactory;\nfunction getScoreDifference(name, m1, m2, schema, opt) {\n for (var _i = 0, name_1 = name; _i < name_1.length; _i++) {\n var rankingName = name_1[_i];\n var scoreDifference = getScore(m2, rankingName, schema, opt).score - getScore(m1, rankingName, schema, opt).score;\n if (scoreDifference !== 0) {\n return scoreDifference;\n }\n }\n return 0;\n}\nfunction getScore(model, rankingName, schema, opt) {\n if (model.getRankingScore(rankingName) !== undefined) {\n return model.getRankingScore(rankingName);\n }\n var fn = get(rankingName);\n var score = fn(model, schema, opt);\n model.setRankingScore(rankingName, score);\n return score;\n}\nexports.getScore = getScore;\nexports.EFFECTIVENESS = 'effectiveness';\nregister(exports.EFFECTIVENESS, effectiveness_1.effectiveness);\nregister(aggregation.name, aggregation.score);\nregister(fieldOrder.name, fieldOrder.score);\n//# sourceMappingURL=ranking.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar channel_1 = require(\"vega-lite/build/src/channel\");\nvar scale_1 = require(\"vega-lite/build/src/scale\");\nvar type_1 = require(\"vega-lite/build/src/type\");\nvar encoding_1 = require(\"./query/encoding\");\nvar expandedtype_1 = require(\"./query/expandedtype\");\nfunction stylize(answerSet, schema, opt) {\n var encQIndex = {};\n answerSet = answerSet.map(function (specM) {\n if (opt.smallRangeStepForHighCardinalityOrFacet) {\n specM = smallRangeStepForHighCardinalityOrFacet(specM, schema, encQIndex, opt);\n }\n if (opt.nominalColorScaleForHighCardinality) {\n specM = nominalColorScaleForHighCardinality(specM, schema, encQIndex, opt);\n }\n if (opt.xAxisOnTopForHighYCardinalityWithoutColumn) {\n specM = xAxisOnTopForHighYCardinalityWithoutColumn(specM, schema, encQIndex, opt);\n }\n return specM;\n });\n return answerSet;\n}\nexports.stylize = stylize;\nfunction smallRangeStepForHighCardinalityOrFacet(specM, schema, encQIndex, opt) {\n [channel_1.Channel.ROW, channel_1.Channel.Y, channel_1.Channel.COLUMN, channel_1.Channel.X].forEach(function (channel) {\n encQIndex[channel] = specM.getEncodingQueryByChannel(channel);\n });\n var yEncQ = encQIndex[channel_1.Channel.Y];\n if (yEncQ !== undefined && encoding_1.isFieldQuery(yEncQ)) {\n if (encQIndex[channel_1.Channel.ROW] ||\n schema.cardinality(yEncQ) > opt.smallRangeStepForHighCardinalityOrFacet.maxCardinality) {\n // We check for undefined rather than\n // yEncQ.scale = yEncQ.scale || {} to cover the case where\n // yEncQ.scale has been set to false/null.\n // This prevents us from incorrectly overriding scale and\n // assigning a rangeStep when scale is set to false.\n if (yEncQ.scale === undefined) {\n yEncQ.scale = {};\n }\n // We do not want to assign a rangeStep if scale is set to false\n // and we only apply this if the scale is (or can be) an ordinal scale.\n var yScaleType = encoding_1.scaleType(yEncQ);\n if (yEncQ.scale && (yScaleType === undefined || scale_1.hasDiscreteDomain(yScaleType))) {\n if (!yEncQ.scale.rangeStep) {\n yEncQ.scale.rangeStep = 12;\n }\n }\n }\n }\n var xEncQ = encQIndex[channel_1.Channel.X];\n if (encoding_1.isFieldQuery(xEncQ)) {\n if (encQIndex[channel_1.Channel.COLUMN] ||\n schema.cardinality(xEncQ) > opt.smallRangeStepForHighCardinalityOrFacet.maxCardinality) {\n // Just like y, we don't want to do this if scale is null/false\n if (xEncQ.scale === undefined) {\n xEncQ.scale = {};\n }\n // We do not want to assign a rangeStep if scale is set to false\n // and we only apply this if the scale is (or can be) an ordinal scale.\n var xScaleType = encoding_1.scaleType(xEncQ);\n if (xEncQ.scale && (xScaleType === undefined || scale_1.hasDiscreteDomain(xScaleType))) {\n if (!xEncQ.scale.rangeStep) {\n xEncQ.scale.rangeStep = 12;\n }\n }\n }\n }\n return specM;\n}\nexports.smallRangeStepForHighCardinalityOrFacet = smallRangeStepForHighCardinalityOrFacet;\nfunction nominalColorScaleForHighCardinality(specM, schema, encQIndex, opt) {\n encQIndex[channel_1.Channel.COLOR] = specM.getEncodingQueryByChannel(channel_1.Channel.COLOR);\n var colorEncQ = encQIndex[channel_1.Channel.COLOR];\n if (encoding_1.isFieldQuery(colorEncQ) && (colorEncQ !== undefined) && (colorEncQ.type === type_1.Type.NOMINAL || colorEncQ.type === expandedtype_1.ExpandedType.KEY) &&\n (schema.cardinality(colorEncQ) > opt.nominalColorScaleForHighCardinality.maxCardinality)) {\n if (colorEncQ.scale === undefined) {\n colorEncQ.scale = {};\n }\n if (colorEncQ.scale) {\n if (!colorEncQ.scale.range) {\n colorEncQ.scale.scheme = opt.nominalColorScaleForHighCardinality.palette;\n }\n }\n }\n return specM;\n}\nexports.nominalColorScaleForHighCardinality = nominalColorScaleForHighCardinality;\nfunction xAxisOnTopForHighYCardinalityWithoutColumn(specM, schema, encQIndex, opt) {\n [channel_1.Channel.COLUMN, channel_1.Channel.X, channel_1.Channel.Y].forEach(function (channel) {\n encQIndex[channel] = specM.getEncodingQueryByChannel(channel);\n });\n if (encQIndex[channel_1.Channel.COLUMN] === undefined) {\n var xEncQ = encQIndex[channel_1.Channel.X];\n var yEncQ = encQIndex[channel_1.Channel.Y];\n if (encoding_1.isFieldQuery(xEncQ) && encoding_1.isFieldQuery(yEncQ) && yEncQ !== undefined && yEncQ.field && scale_1.hasDiscreteDomain(encoding_1.scaleType(yEncQ))) {\n if (xEncQ !== undefined) {\n if (schema.cardinality(yEncQ) > opt.xAxisOnTopForHighYCardinalityWithoutColumn.maxCardinality) {\n if (xEncQ.axis === undefined) {\n xEncQ.axis = {};\n }\n if (xEncQ.axis && !xEncQ.axis.orient) {\n xEncQ.axis.orient = 'top';\n }\n }\n }\n }\n }\n return specM;\n}\nexports.xAxisOnTopForHighYCardinalityWithoutColumn = xAxisOnTopForHighYCardinalityWithoutColumn;\n//# sourceMappingURL=stylize.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar config_1 = require(\"./config\");\nvar enumerator_1 = require(\"./enumerator\");\nvar model_1 = require(\"./model\");\nvar property_1 = require(\"./property\");\nvar stylize_1 = require(\"./stylize\");\nfunction generate(specQ, schema, opt) {\n if (opt === void 0) { opt = config_1.DEFAULT_QUERY_CONFIG; }\n // 1. Build a SpecQueryModel, which also contains wildcardIndex\n var specM = model_1.SpecQueryModel.build(specQ, schema, opt);\n var wildcardIndex = specM.wildcardIndex;\n // 2. Enumerate each of the properties based on propPrecedence.\n var answerSet = [specM]; // Initialize Answer Set with only the input spec query.\n opt.propertyPrecedence.forEach(function (propKey) {\n var prop = property_1.fromKey(propKey);\n // If the original specQuery contains wildcard for this prop\n if (wildcardIndex.hasProperty(prop)) {\n // update answerset\n var enumerator = enumerator_1.getEnumerator(prop);\n var reducer = enumerator(wildcardIndex, schema, opt);\n answerSet = answerSet.reduce(reducer, []);\n }\n });\n if (opt.stylize) {\n if ((opt.nominalColorScaleForHighCardinality !== null) ||\n (opt.smallRangeStepForHighCardinalityOrFacet !== null) ||\n (opt.xAxisOnTopForHighYCardinalityWithoutColumn !== null)) {\n return stylize_1.stylize(answerSet, schema, opt);\n }\n }\n return answerSet;\n}\nexports.generate = generate;\n//# sourceMappingURL=generate.js.map","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar config_1 = require(\"./config\");\nvar generate_1 = require(\"./generate\");\nvar nest_1 = require(\"./nest\");\nvar normalize_1 = require(\"./query/normalize\");\nvar ranking_1 = require(\"./ranking/ranking\");\nfunction recommend(q, schema, config) {\n // 1. Normalize non-nested `groupBy` to always have `groupBy` inside `nest`\n // and merge config with the following precedence\n // query.config > config > DEFAULT_QUERY_CONFIG\n q = __assign({}, normalize_1.normalize(q), { config: __assign({}, config_1.DEFAULT_QUERY_CONFIG, config, q.config) });\n // 2. Generate\n var answerSet = generate_1.generate(q.spec, schema, q.config);\n var nestedAnswerSet = nest_1.nest(answerSet, q.nest);\n var result = ranking_1.rank(nestedAnswerSet, q, schema, 0);\n return {\n query: q,\n result: result\n };\n}\nexports.recommend = recommend;\n//# sourceMappingURL=recommend.js.map","\"use strict\";\n/// \nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar config = require(\"./config\");\nexports.config = config;\nvar constraint = require(\"./constraint\");\nexports.constraint = constraint;\nvar enumerate = require(\"./enumerator\");\nexports.enumerate = enumerate;\nvar wildcard = require(\"./wildcard\");\nexports.wildcard = wildcard;\nvar model = require(\"./model\");\nexports.model = model;\nvar nest = require(\"./nest\");\nexports.nest = nest;\nvar property = require(\"./property\");\nexports.property = property;\nvar query = require(\"./query\");\nexports.query = query;\nvar ranking = require(\"./ranking/ranking\");\nexports.ranking = ranking;\nvar result = require(\"./result\");\nexports.result = result;\nvar schema = require(\"./schema\");\nexports.schema = schema;\nvar util = require(\"./util\");\nexports.util = util;\nvar generate_1 = require(\"./generate\");\nexports.generate = generate_1.generate;\nvar recommend_1 = require(\"./recommend\");\nexports.recommend = recommend_1.recommend;\nvar package_json_1 = require(\"./package.json\");\nexports.version = package_json_1.version;\n//# sourceMappingURL=index.js.map"],"names":["value","require$$0","error","isArray","stringValue","Error","log","array","logical_1","util_1","channel_1","scale_1","axis_1","legend_1","datetime_1","property_1","mark_1","timeunit_1","type_1","this","wildcard_1","bin_1","aggregate_1","util","fielddef_1","encoding_1","stack_1","util_2","propindex_1","spec_1","shorthand_1","vlFieldDef","expandedtype_1","type_2","type","time","config_1","stats_1","schema_1","base_1","field_1","value_1","encoding","spec","encoding_2","groupBy","groupby_1","wildcardindex_1","nest_1","shorthand","transform","normalize_1","dimension_1","facet_1","sizechannel_1","typechannel_1","effectiveness_1","aggregation","result_1","model_1","enumerator_1","stylize_1","generate_1","ranking_1","config","constraint","enumerate","wildcard","model","nest","property","query","ranking","result","schema","recommend_1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAA;CACA;CACA;CACA;CACA;;CAEA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;CAEtB,YAAY,GAAGC,QAAI,CAAC;;CAEpB,gBAAgB,GAAGC,YAAQ,CAAC;;CAE5B,aAAa,GAAGC,OAAK,CAAC;;CAEtB,eAAe,GAAGC,WAAO,CAAC;;CAE1B,cAAc,GAAGC,UAAM,CAAC;;CAExB,cAAc,GAAGC,UAAM,CAAC;;CAExB,YAAY,GAAGnD,QAAI,CAAC;;CAEpB,gBAAgB,GAAGuC,YAAU,CAAC,QAAQ,CAAC;;CAEvC,iBAAiB,GAAGa,aAAW,CAAC,SAAS,CAAC;;CAE1C,eAAe,GAAG,cAAc,CAAC,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/build/compassql.min.js b/build/compassql.min.js new file mode 100644 index 00000000..5d5476a0 --- /dev/null +++ b/build/compassql.min.js @@ -0,0 +1,7 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.cql={})}(this,function(e){"use strict";function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function n(e,t){return t={exports:{}},e(t,t.exports),t.exports}function r(e,t){function n(){this.constructor=e}Be(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function i(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i=0;u--)(i=e[u])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function a(e,t){return function(n,r){t(n,r,e)}}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function s(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{s(r.next(e))}catch(t){o(t)}}function u(e){try{s(r["throw"](e))}catch(t){o(t)}}function s(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(a,u)}s((r=r.apply(e,t||[])).next())})}function c(e,t){function n(e){return function(t){return r([e,t])}}function r(n){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,o&&(a=o[2&n[0]?"return":n[0]?"throw":"next"])&&!(a=a.call(o,n[1])).done)return a;switch(o=0,a&&(n=[0,a.value]),n[0]){case 0:case 1:a=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,o=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(a=s.trys,!(a=a.length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){s=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function f(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(u){i={error:u}}finally{try{r&&!r.done&&(n=o["return"])&&n.call(o)}finally{if(i)throw i.error}}return a}function p(){for(var e=[],t=0;t1||i(e,t)})})}function i(e,t){try{o(l[e](t))}catch(n){s(d[0][3],n)}}function o(e){e.value instanceof y?Promise.resolve(e.value.v).then(a,u):s(d[0][2],e)}function a(e){i("next",e)}function u(e){i("throw",e)}function s(e,t){e(t),d.shift(),d.length&&i(d[0][0],d[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var c,l=n.apply(e,t||[]),d=[];return c={},r("next"),r("throw"),r("return"),c[Symbol.asyncIterator]=function(){return this},c}function h(e){function t(t,i){e[t]&&(n[t]=function(n){return(r=!r)?{value:y(e[t](n)),done:"return"===t}:i?i(n):n})}var n,r;return n={},t("next"),t("throw",function(e){throw e}),t("return"),n[Symbol.iterator]=function(){return this},n}function m(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator];return t?t.call(e):"function"==typeof d?d(e):e[Symbol.iterator]()}function E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function T(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function v(e){return e&&e.__esModule?e:{"default":e}}function _(e){return it.lastIndex=0,it.test(e)?'"'+e.replace(it,function(e){var t=ot[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function O(e,t){var n,r,i,o,a,u=Ze,s=t[e];switch(s&&"object"==typeof s&&"function"==typeof s.toJSON&&(s=s.toJSON(e)),"function"==typeof tt&&(s=tt.call(t,e,s)),typeof s){case"string":return _(s);case"number":return isFinite(s)?String(s):"null";case"boolean":case"null":return String(s);case"object":if(!s)return"null";if(Ze+=et,a=[],"[object Array]"===Object.prototype.toString.apply(s)){for(o=s.length,n=0;nn&&t(),u=n=r+1):"]"===i&&(u||P("Access path missing open bracket: "+e),u>0&&t(),u=0,n=r+1):r>n?t():n=r+1}return u&&P("Access path missing closing bracket: "+e),a&&P("Access path missing closing quote: "+e),r>n&&(r++,t()),o}function I(e){return e===Object(e)}function b(e){return"string"==typeof e}function R(e){return vt(e)?"["+e.map(R)+"]":I(e)||b(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function D(e,t){var n=C(e),r="return _["+n.map(R).join("][")+"];";return S(Function("_",r),[e=1===n.length?n[0]:e],t||e)}function L(e,t,n){var r=[t].concat([].slice.call(n));console[e].apply(console,r)}function M(e){var t=e||It;return{level:function(e){return arguments.length?(t=+e,this):t},error:function(){return t>=bt&&L("error","ERROR",arguments),this},warn:function(){return t>=Rt&&L("warn","WARN",arguments),this},info:function(){return t>=Dt&&L("log","INFO",arguments),this},debug:function(){return t>=Lt&&L("log","DEBUG",arguments),this}}}function U(e){return e[e.length-1]}function x(e){return null==e||""===e?null:+e}function F(e){return function(t){return e*Math.exp(t)}}function w(e){return function(t){return Math.log(e*t)}}function k(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function j(e,t,n,r){var i=n(e[0]),o=n(U(e)),a=(o-i)*t;return[r(i-a),r(o-a)]}function G(e,t){return j(e,t,x,St)}function B(e,t){var n=Math.sign(e[0]);return j(e,t,w(n),F(n))}function H(e,t,n){return j(e,t,k(n),k(1/n))}function Y(e,t,n,r,i){var o=r(e[0]),a=r(U(e)),u=null!=t?r(t):(o+a)/2;return[i(u+(o-u)*n),i(u+(a-u)*n)]}function W(e,t,n){return Y(e,t,n,x,St)}function Q(e,t,n){var r=Math.sign(e[0]);return Y(e,t,n,w(r),F(r))}function z(e,t,n,r){return Y(e,t,n,k(r),k(1/r))}function V(e){return null!=e?vt(e)?e:[e]:[]}function K(e){return"function"==typeof e}function q(e,t){var n,r,i,o,a,u,s,c,l,d=[],f=(e=V(e)).map(function(e,t){return null==e?null:(d.push(t),K(e)?e:C(e).map(R).join("]["))}),p=d.length-1,y=V(t),g="var u,v;return ";if(p<0)return null;for(r=0;r<=p;++r)n=d[r],i=f[n],K(i)?(u="f"+n,o="(u=this."+u+"(a))",a="(v=this."+u+"(b))",(s=s||{})[u]=i):(o="(u=a["+i+"])",a="(v=b["+i+"])"),u="((v=v instanceof Date?+v:v),(u=u instanceof Date?+u:u))","descending"!==y[n]?(l=1,c=-1):(l=-1,c=1),g+="("+o+"<"+a+"||u==null)&&v!=null?"+c+":(u>v||v==null)&&u!=null?"+l+":"+u+"!==u&&v===v?"+c+":v!==v&&u===u?"+l+(n=r){n=i=r;break}for(o=a=u;++ur&&(n=r,o=u),i=r){n=i=r;break}for(o=a=u;++ur&&(n=r,o=u),i0?n[s++]:t[u++];for(;u=0;)n+=e;return n}function ce(e,t,n,r){var i=n||" ",o=e+"",a=t-o.length;return a<=0?o:"left"===r?se(i,a)+o:"center"===r?se(i,~~(a/2))+o+se(i,Math.ceil(a/2)):o+se(i,a)}function le(e){return null==e||""===e?null:!(!e||"false"===e||"0"===e)&&!!e}function de(e){return ie(e)?e:re(e)?e:Date.parse(e)}function fe(e,t){return t=t||de,null==e||""===e?null:t(e)}function pe(e){return null==e||""===e?null:e+""}function ye(e){for(var t={},n=0,r=e.length;nu[0]){if(a=t/u[0],a>r)return e[Rc[i-1][1]];if(a>=n)return e[u[1]]}return e[Rc[o-1][1]]}function Ie(e){var t,n,r={};for(t=0,n=e.length;ts;)t*=c;for(a=0;a=r&&y/o<=s&&(t=o)}return o=Math.log(t),i=o>=0?0:~~(-o/l)+1,u=Math.pow(c,-i-1),f=Math.min(f,Math.floor(f/t+u)*t),p=Math.ceil(p/t)*t,{start:f,stop:p,step:t,unit:{precision:i},value:De,index:Le}}function Re(e,t,n,r){for(;n>>1;Bi.cmp(e[i],t)<0?n=i+1:r=i}return n}function De(e){return this.step*Math.floor(e/this.step+xc)}function Le(e){return Math.floor((e-this.start)/this.step+xc)}function Me(e){return this.unit.date(De.call(this,e))}function Ue(e){return Le.call(this,this.unit.unit(e))}var xe,Fe,we,ke,je=Object.freeze({get default(){return Xs},get __moduleExports(){return qs},get isValueQuery(){return $s},get isFieldQuery(){return Js},get isAutoCountQuery(){return Zs},get isDisabledAutoCountQuery(){return ec},get isEnabledAutoCountQuery(){return tc},get toEncoding(){return nc},get toValueDef(){return rc},get toFieldDef(){return ic},get isContinuous(){return oc},get isMeasure(){return ac},get isDimension(){return uc},get scaleType(){return sc}}),Ge="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Be=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},He=Object.assign||function(e){for(var t,n=1,r=arguments.length;n="0"&&Fe<="9";)t+=Fe,ze();if("."===Fe)for(t+=".";ze()&&Fe>="0"&&Fe<="9";)t+=Fe;if("e"===Fe||"E"===Fe)for(t+=Fe,ze(),"-"!==Fe&&"+"!==Fe||(t+=Fe,ze());Fe>="0"&&Fe<="9";)t+=Fe,ze();return e=+t,isFinite(e)?e:void Qe("Bad number")},Ke=function(){var e,t,n,r="";if('"'===Fe)for(;ze();){if('"'===Fe)return ze(),r;if("\\"===Fe)if(ze(),"u"===Fe){for(n=0,t=0;t<4&&(e=parseInt(ze(),16),isFinite(e));t+=1)n=16*n+e;r+=String.fromCharCode(n)}else{if("string"!=typeof We[Fe])break;r+=We[Fe]}else r+=Fe}Qe("Bad string")},qe=function(){for(;Fe&&Fe<=" ";)ze()},Xe=function(){switch(Fe){case"t":return ze("t"),ze("r"),ze("u"),ze("e"),!0;case"f":return ze("f"),ze("a"),ze("l"),ze("s"),ze("e"),!1;case"n":return ze("n"),ze("u"),ze("l"),ze("l"),null}Qe("Unexpected '"+Fe+"'")},$e=function(){var e=[];if("["===Fe){if(ze("["),qe(),"]"===Fe)return ze("]"),e;for(;Fe;){if(e.push(ke()),qe(),"]"===Fe)return ze("]"),e;ze(","),qe()}}Qe("Bad array")},Je=function(){var e,t={};if("{"===Fe){if(ze("{"),qe(),"}"===Fe)return ze("}"),t;for(;Fe;){if(e=Ke(),qe(),ze(":"),Object.hasOwnProperty.call(t,e)&&Qe('Duplicate key "'+e+'"'),t[e]=ke(),qe(),"}"===Fe)return ze("}"),t;ze(","),qe()}}Qe("Bad object")};ke=function(){switch(qe(),Fe){case"{":return Je();case"[":return $e();case'"':return Ke();case"-":return Ve();default:return Fe>="0"&&Fe<="9"?Ve():Xe()}};var Ze,et,tt,nt=function(e,t){var n;return we=e,xe=0,Fe=" ",n=ke(),qe(),Fe&&Qe("Syntax error"),"function"==typeof t?function r(e,n){var i,o,a=e[n];if(a&&"object"==typeof a)for(i in a)Object.prototype.hasOwnProperty.call(a,i)&&(o=r(a,i),void 0!==o?a[i]=o:delete a[i]);return t.call(e,n,a)}({"":n},""):n},rt=Object.freeze({"default":nt,__moduleExports:nt}),it=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,ot={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},at=function(e,t,n){var r;if(Ze="",et="","number"==typeof n)for(r=0;r-1}function a(e,t){return e.filter(function(e){return!o(t,e)})}function u(e,t){return e.concat(a(t,e))}function s(e,t){for(var n=0,r=0;r1?function(e,n){for(var r=0;rt||null==t)&&null!=e?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0)},r.numcmp=function(e,t){return e-t},r.stablesort=function(e,t,n){var r=e.reduce(function(e,t,r){return e[n(t)]=r,e},{});return e.sort(function(e,i){var o=t(e),a=t(i);return oa?1:r[n(e)]-r[n(i)]}),e},r.permute=function(e){for(var t,n,r=e.length;r;)n=Math.floor(Math.random()*r--),t=e[r],e[r]=e[n],e[n]=t},r.pad=function(e,n,r,i){i=i||" ";var o=n-e.length;if(o<=0)return e;switch(r){case"left":return t(o,i)+e;case"middle":case"center":return t(Math.floor(o/2),i)+e+t(Math.ceil(o/2),i);default:return e+t(o,i)}},r.truncate=function(e,t,r,i,o){var a=e.length;if(a<=t)return e;o=void 0!==o?String(o):"…";var u=Math.max(0,t-o.length);switch(r){case"left":return o+(i?n(e,u,1):e.slice(a-u));case"middle":case"center":var s=Math.ceil(u/2),c=Math.floor(u/2);return(i?n(e,s):e.slice(0,s))+o+(i?n(e,c,1):e.slice(a-c));default:return(i?n(e,u):e.slice(0,u))+o}};var u=/([\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u2028\u2029\u3000\uFEFF])/}),Di=Ri.isArray,Li=Ri.cmp,Mi=Ri.keys,Ui=Ri.duplicate,xi=Ri.extend,Fi=Ri.isObject,wi=Ri.isBoolean,ki=Ri.toMap,ji=Ri.isString,Gi=Object.freeze({"default":Ri,__moduleExports:Ri,isArray:Di,cmp:Li,keys:Mi,duplicate:Ui,extend:xi,isObject:Fi,isBoolean:wi,toMap:ki,isString:ji}),Bi=Gi&&Ri||Gi,Hi=n(function(e,t){function n(e,t){return e.indexOf(t)!==-1}function r(e,t){for(var n=0;n4&&Dr.warn(Dr.message.invalidTimeUnit("quarter",e)),e-1+"";throw new Error(Dr.message.invalidTimeUnit("quarter",e))}function i(e){if(Wt.isNumber(e))return e-1+"";var n=e.toLowerCase(),r=t.MONTHS.indexOf(n);if(r!==-1)return r+"";var i=n.substr(0,3),o=t.SHORT_MONTHS.indexOf(i);if(o!==-1)return o+"";throw new Error(Dr.message.invalidTimeUnit("month",e))}function o(e){if(Wt.isNumber(e))return e%7+"";var n=e.toLowerCase(),r=t.DAYS.indexOf(n);if(r!==-1)return r+"";var i=n.substr(0,3),o=t.SHORT_DAYS.indexOf(i);if(o!==-1)return o+"";throw new Error(Dr.message.invalidTimeUnit("day",e))}function a(e,t){void 0===t&&(t=!1);var n=[];if(t&&void 0!==e.day&&Sn.keys(e).length>1&&(Dr.warn(Dr.message.droppedDay(e)),e=Sn.duplicate(e),delete e.day),void 0!==e.year?n.push(e.year):void 0!==e.day?n.push(u):n.push(0),void 0!==e.month){var a=t?i(e.month):e.month;n.push(a)}else if(void 0!==e.quarter){var s=t?r(e.quarter):e.quarter;n.push(s+"*3")}else n.push(0);if(void 0!==e.date)n.push(e.date);else if(void 0!==e.day){var c=t?o(e.day):e.day;n.push(c+"+1")}else n.push(1);for(var l=0,d=["hours","minutes","seconds","milliseconds"];l-1&&(t!==y.SECONDS||0===n||"i"!==e.charAt(n-1))}function d(e,n){function r(e){return e===y.QUARTER?"("+a+"quarter("+o+")-1)":""+a+e+"("+o+")"}var o="datum"+Sn.accessPath(n),a=i(e)?"utc":"",u=t.TIMEUNIT_PARTS.reduce(function(t,n){return l(e,n)&&(t[n]=r(n)),t},{});return Wo.dateTimeExpr(u)}function f(e,t,n,r){if(e){var i=[],o="",a=l(e,y.YEAR);l(e,y.QUARTER)&&(o="'Q' + quarter("+t+")"),l(e,y.MONTH)&&i.push(n!==!1?"%b":"%B"),l(e,y.DAY)?i.push(n?"%a":"%A"):l(e,y.DATE)&&i.push("%d"+(a?",":"")),a&&i.push(n?"%y":"%Y");var u=[];l(e,y.HOURS)&&u.push("%H"),l(e,y.MINUTES)&&u.push("%M"),l(e,y.SECONDS)&&u.push("%S"),l(e,y.MILLISECONDS)&&u.push("%L");var s=[];return i.length>0&&s.push(i.join(" ")),u.length>0&&s.push(u.join(":")),s.length>0&&(o&&(o+=" + ' ' + "),o+=r?"utcFormat("+t+", '"+s.join(" ")+"')":"timeFormat("+t+", '"+s.join(" ")+"')"),o||void 0}}function p(e){return"day"!==e&&e.indexOf("day")>=0?(Dr.warn(Dr.message.dayReplacedWithDate(e)),e.replace("day","date")):e}Object.defineProperty(t,"__esModule",{value:!0});var y;!function(e){e.YEAR="year",e.MONTH="month",e.DAY="day",e.DATE="date",e.HOURS="hours",e.MINUTES="minutes",e.SECONDS="seconds",e.MILLISECONDS="milliseconds",e.YEARMONTH="yearmonth",e.YEARMONTHDATE="yearmonthdate",e.YEARMONTHDATEHOURS="yearmonthdatehours",e.YEARMONTHDATEHOURSMINUTES="yearmonthdatehoursminutes",e.YEARMONTHDATEHOURSMINUTESSECONDS="yearmonthdatehoursminutesseconds",e.MONTHDATE="monthdate",e.HOURSMINUTES="hoursminutes",e.HOURSMINUTESSECONDS="hoursminutesseconds",e.MINUTESSECONDS="minutesseconds",e.SECONDSMILLISECONDS="secondsmilliseconds",e.QUARTER="quarter",e.YEARQUARTER="yearquarter",e.QUARTERMONTH="quartermonth",e.YEARQUARTERMONTH="yearquartermonth",e.UTCYEAR="utcyear",e.UTCMONTH="utcmonth",e.UTCDAY="utcday",e.UTCDATE="utcdate",e.UTCHOURS="utchours",e.UTCMINUTES="utcminutes",e.UTCSECONDS="utcseconds",e.UTCMILLISECONDS="utcmilliseconds",e.UTCYEARMONTH="utcyearmonth",e.UTCYEARMONTHDATE="utcyearmonthdate",e.UTCYEARMONTHDATEHOURS="utcyearmonthdatehours",e.UTCYEARMONTHDATEHOURSMINUTES="utcyearmonthdatehoursminutes",e.UTCYEARMONTHDATEHOURSMINUTESSECONDS="utcyearmonthdatehoursminutesseconds",e.UTCMONTHDATE="utcmonthdate",e.UTCHOURSMINUTES="utchoursminutes",e.UTCHOURSMINUTESSECONDS="utchoursminutesseconds",e.UTCMINUTESSECONDS="utcminutesseconds",e.UTCSECONDSMILLISECONDS="utcsecondsmilliseconds",e.UTCQUARTER="utcquarter",e.UTCYEARQUARTER="utcyearquarter",e.UTCQUARTERMONTH="utcquartermonth",e.UTCYEARQUARTERMONTH="utcyearquartermonth"}(y=t.TimeUnit||(t.TimeUnit={}));var g={year:1,quarter:1,month:1,day:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};t.TIMEUNIT_PARTS=Sn.flagKeys(g),t.isLocalSingleTimeUnit=n;var h={utcyear:1,utcquarter:1,utcmonth:1,utcday:1,utcdate:1,utchours:1,utcminutes:1,utcseconds:1,utcmilliseconds:1};t.isUtcSingleTimeUnit=r;var m={yearquarter:1,yearquartermonth:1,yearmonth:1,yearmonthdate:1,yearmonthdatehours:1,yearmonthdatehoursminutes:1,yearmonthdatehoursminutesseconds:1,quartermonth:1,monthdate:1,hoursminutes:1,hoursminutesseconds:1,minutesseconds:1,secondsmilliseconds:1},E={utcyearquarter:1,utcyearquartermonth:1,utcyearmonth:1,utcyearmonthdate:1,utcyearmonthdatehours:1,utcyearmonthdatehoursminutes:1,utcyearmonthdatehoursminutesseconds:1,utcquartermonth:1,utcmonthdate:1,utchoursminutes:1,utchoursminutesseconds:1,utcminutesseconds:1,utcsecondsmilliseconds:1},T=On.__assign({},h,E);t.isUTCTimeUnit=i,t.getLocalTimeUnit=o;var v=On.__assign({},g,h,m,E);t.TIMEUNITS=Sn.flagKeys(v),t.isTimeUnit=a;var _={year:"setFullYear",month:"setMonth",date:"setDate",hours:"setHours",minutes:"setMinutes",seconds:"setSeconds",milliseconds:"setMilliseconds",quarter:null,day:null};t.convert=u,t.getTimeUnitParts=c,t.containsTimeUnit=l,t.fieldExpr=d,t.formatExpression=f,t.normalizeTimeUnit=p}),zo=t(Qo),Vo=Qo.TimeUnit,Ko=Qo.TIMEUNIT_PARTS,qo=Qo.isLocalSingleTimeUnit,Xo=Qo.isUtcSingleTimeUnit,$o=Qo.isUTCTimeUnit,Jo=Qo.getLocalTimeUnit,Zo=Qo.TIMEUNITS,ea=Qo.isTimeUnit,ta=Qo.convert,na=Qo.getTimeUnitParts,ra=Qo.containsTimeUnit,ia=Qo.fieldExpr,oa=Qo.formatExpression,aa=Qo.normalizeTimeUnit,ua=Object.freeze({"default":zo,__moduleExports:Qo,TimeUnit:Vo,TIMEUNIT_PARTS:Ko,isLocalSingleTimeUnit:qo,isUtcSingleTimeUnit:Xo,isUTCTimeUnit:$o,getLocalTimeUnit:Jo,TIMEUNITS:Zo,isTimeUnit:ea,convert:ta,getTimeUnitParts:na,containsTimeUnit:ra,fieldExpr:ia,formatExpression:oa,normalizeTimeUnit:aa}),sa=n(function(e,t){function n(e){return!!o[e]}function r(e){if(e)switch(e=e.toLowerCase()){case"q":case t.QUANTITATIVE:return"quantitative";case"t":case t.TEMPORAL:return"temporal";case"o":case t.ORDINAL:return"ordinal";case"n":case t.NOMINAL:return"nominal";case i.LATITUDE:return"latitude";case i.LONGITUDE:return"longitude";case t.GEOJSON:return"geojson"}}Object.defineProperty(t,"__esModule",{value:!0});var i;!function(e){e.QUANTITATIVE="quantitative",e.ORDINAL="ordinal",e.TEMPORAL="temporal",e.NOMINAL="nominal",e.LATITUDE="latitude",e.LONGITUDE="longitude",e.GEOJSON="geojson"}(i=t.Type||(t.Type={}));var o={quantitative:1,ordinal:1,temporal:1,nominal:1,latitude:1,longitude:1,geojson:1};t.isType=n,t.QUANTITATIVE=i.QUANTITATIVE,t.ORDINAL=i.ORDINAL,t.TEMPORAL=i.TEMPORAL,t.NOMINAL=i.NOMINAL,t.GEOJSON=i.GEOJSON,t.getFullName=r}),ca=t(sa),la=sa.Type,da=sa.isType,fa=sa.QUANTITATIVE,pa=sa.ORDINAL,ya=sa.TEMPORAL,ga=sa.NOMINAL,ha=sa.GEOJSON,ma=sa.getFullName,Ea=Object.freeze({"default":ca,__moduleExports:sa,Type:la,isType:da,QUANTITATIVE:fa,ORDINAL:pa,TEMPORAL:ya,NOMINAL:ga,GEOJSON:ha,getFullName:ma}),Ta=bi&&di||bi,va=io&&Yi||io,_a=Uo&&ao||Uo,Oa=ua&&zo||ua,Sa=Ea&&ca||Ea,Na=n(function(e,t){function n(e){return r(e)||i(e)}function r(e){return e===t.SHORT_WILDCARD}function i(e){ +return!(void 0===e||null==e||!e["enum"]&&!e.name||va.isArray(e))}function o(e,n,r){return va.extend({},{name:n,"enum":r},e===t.SHORT_WILDCARD?{}:e)}function a(e){for(var t={},n={},r=function(e){for(var r=[0],i=0;i0&&o.push("transform:"+JSON.stringify(e.transform));var a;if(n.get(Ta.Property.STACK)&&(a=Cs.getVlStack(e)),e.encodings){var u=e.encodings.reduce(function(e,t){if(!fs.isDisabledAutoCountQuery(t)){var i=void 0;i=a&&t.channel===a.fieldChannel?s(y({},t,{stack:a.offset}),n,r):s(t,n,r),i&&e.push(i)}return e},[]).sort().join("|");u&&o.push(u)}for(var c=0,l=Ta.VIEW_PROPS;c0?JSON.stringify(a):"");return c+"("+o+")"}return o}function l(e,t,n){if(t.get(Ta.Property.AGGREGATE)&&e.aggregate&&!Fa.isWildcard(e.aggregate))return o(e.aggregate,n.get(Ta.Property.AGGREGATE));if(t.get(Ta.Property.AGGREGATE)&&fs.isEnabledAutoCountQuery(e))return o("count",n.get(Ta.Property.AGGREGATE));if(t.get(Ta.Property.TIMEUNIT)&&e.timeUnit&&!Fa.isWildcard(e.timeUnit))return o(e.timeUnit,n.get(Ta.Property.TIMEUNIT));if(t.get(Ta.Property.BIN)&&e.bin&&!Fa.isWildcard(e.bin))return"bin";for(var r=null,i=0,a=[Ta.Property.AGGREGATE,Ta.Property.AUTOCOUNT,Ta.Property.TIMEUNIT,Ta.Property.BIN];i0){var h=y.sort(function(e,t){return e.key.localeCompare(t.key)}).reduce(function(e,t){return e[t.key]=t.value,e},{});a.push({key:f+"",value:JSON.stringify(h)})}}}}return a}function f(e){for(var t=e.split("|"),n={mark:t[0],encodings:[]},r=1;rt;)i.push(r);else for(;(r=e+n*++o)=e&&t<=n?1/r:0},i.cdf=function(t){return tn?1:(t-e)/r},i.icdf=function(t){return t>=0&&t<=1?e+t*r:NaN},i},t.random.integer=function(e,n){void 0===n&&(n=e,e=0);var r=n-e,i=function(){return e+Math.floor(r*Math.random())};return i.samples=function(e){return t.zeros(e).map(i)},i.pdf=function(t){return t===Math.floor(t)&&t>=e&&t=n?1:(i-e+1)/r},i.icdf=function(t){return t>=0&&t<=1?e-1+Math.floor(t*r):NaN},i},t.random.normal=function(e,n){e=e||0,n=n||1;var r,i=function(){var t,i,o=0,a=0;if(void 0!==r)return o=r,r=void 0,o;do o=2*Math.random()-1,a=2*Math.random()-1,t=o*o+a*a;while(0===t||t>1);return i=Math.sqrt(-2*Math.log(t)/t),r=e+a*i*n,e+o*i*n};return i.samples=function(e){return t.zeros(e).map(i)},i.pdf=function(t){var r=Math.exp(Math.pow(t-e,2)/(-2*Math.pow(n,2)));return 1/(n*Math.sqrt(2*Math.PI))*r},i.cdf=function(t){var r,i=(t-e)/n,o=Math.abs(i);if(o>37)r=0;else{var a,u=Math.exp(-o*o/2);o<7.07106781186547?(a=.0352624965998911*o+.700383064443688,a=a*o+6.37396220353165,a=a*o+33.912866078383,a=a*o+112.079291497871,a=a*o+221.213596169931,a=a*o+220.206867912376,r=u*a,a=.0883883476483184*o+1.75566716318264,a=a*o+16.064177579207,a=a*o+86.7807322029461,a=a*o+296.564248779674,a=a*o+637.333633378831,a=a*o+793.826512519948,a=a*o+440.413735824752,r/=a):(a=o+.65,a=o+4/a,a=o+3/a,a=o+2/a,a=o+1/a,r=u/a/2.506628274631)}return i>0?1-r:r},i.icdf=function(t){if(t<=0||t>=1)return NaN;var r=2*t-1,i=8*(Math.PI-3)/(3*Math.PI*(4-Math.PI)),o=2/(Math.PI*i)+Math.log(1-Math.pow(r,2))/2,a=Math.log(1-r*r)/i,u=(r>0?1:-1)*Math.sqrt(Math.sqrt(o*o-a)-o);return e+n*Math.SQRT2*u},i},t.random.bootstrap=function(e,n){var r=e.filter(Bi.isValid),i=r.length,o=n?t.random.normal(0,n):null,a=function(){return r[~~(Math.random()*i)]+(o?o():0)};return a.samples=function(e){return t.zeros(e).map(a)},a}}),hc=Object.freeze({"default":gc,__moduleExports:gc}),mc=yc&&fc||yc,Ec=hc&&gc||hc,Tc=n(function(e){function t(e,t,n){var r=e&&e.nullh||0,o=Ec.random.normal(0,1),a=i.mean(t,n),u=i.stdev(t,n)/Math.sqrt(i.count.valid(t,n));if(0===u)return a-r===0?1:0;var s=(a-r)/u;return 2*o.cdf(-Math.abs(s))}function n(e,t,n,r){var o,a=r?t.map(Bi.$(n)):t,u=r?t.map(Bi.$(r)):n,s=i.count(a),c=i.count(u),l=Array();if(s!==c)throw Error("Array lengths must match.");for(o=0;o0?Math.pow(a,1/n):0},i.mean.harmonic=function(e,t){t=Bi.$(t);var n,r,i,o,a=0;for(o=0,n=0,r=e.length;or&&(r=i));return[n,r]},i.extent.index=function(e,t){t=Bi.$(t);var n,r,i,o,a=-1,u=-1,s=e.length;for(o=0;or&&(r=i,u=o));return[a,u]},i.dot=function(e,t,n){var r,i,o=0;if(n)for(t=Bi.$(t),n=Bi.$(n),r=0;r-1&&c!==r){for(i=1+(n-1+s)/2;s-1)for(i=1+(a-1+s)/2;sp)&&(p=u),n=u-s,s+=n/++c,y+=n*(u-s),g.push(u));return y/=c-1,r=Math.sqrt(y),g.sort(Bi.cmp),{type:mc(e,t),unique:h,count:e.length,valid:c,missing:l,distinct:d,min:f,max:p,mean:s,stdev:r,median:a=i.quantile(g,.5),q1:i.quantile(g,.25),q3:i.quantile(g,.75),modeskew:0===r?0:(s-a)/r}},i.summary=function(e,t){t=t||Bi.keys(e[0]);var n=t.map(function(t){var n=i.profile(e,Bi.$(t));return n.field=t,n});return n.__summary__=!0,n}}),vc=Tc.summary,_c=Object.freeze({"default":Tc,__moduleExports:Tc,summary:vc}),Oc=n(function(e,t){!function(e,n){n(t)}(Ge,function(e){function t(e,n,r,a){function u(t){return e(t=new Date((+t))),t}return u.floor=u,u.round=function(t){var r=new Date((+t)),i=new Date(t-1);return e(r),e(i),n(i,1),t-r0))return o;for(n(t,1),e(t),t=0;)for(;n(e,1),!r(e););})},r&&(u.count=function(t,n){return i.setTime(+t),o.setTime(+n),e(i),e(o),Math.floor(r(i,o))},u.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?u.filter(a?function(t){return a(t)%e===0}:function(t){return u.count(0,t)%e===0}):u:null}),u}function n(e){return t(function(t){t.setHours(0,0,0,0),t.setDate(t.getDate()-(t.getDay()+7-e)%7)},function(e,t){e.setDate(e.getDate()+7*t)},function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/6048e5})}function r(e){return t(function(t){t.setUTCHours(0,0,0,0),t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7)},function(e,t){e.setUTCDate(e.getUTCDate()+7*t)},function(e,t){return(t-e)/6048e5})}var i=new Date,o=new Date,a=t(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});a.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?t(function(t){t.setTime(Math.floor(t/e)*e)},function(t,n){t.setTime(+t+n*e)},function(t,n){return(n-t)/e}):a:null};var u=t(function(e){e.setMilliseconds(0)},function(e,t){e.setTime(+e+1e3*t)},function(e,t){return(t-e)/1e3},function(e){return e.getSeconds()}),s=t(function(e){e.setSeconds(0,0)},function(e,t){e.setTime(+e+6e4*t)},function(e,t){return(t-e)/6e4},function(e){return e.getMinutes()}),c=t(function(e){e.setMinutes(0,0,0)},function(e,t){e.setTime(+e+36e5*t)},function(e,t){return(t-e)/36e5},function(e){return e.getHours()}),l=t(function(e){e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t)},function(e,t){return(t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5},function(e){return e.getDate()-1}),d=n(0),f=n(1),p=n(2),y=n(3),g=n(4),h=n(5),m=n(6),E=t(function(e){e.setHours(0,0,0,0),e.setDate(1)},function(e,t){e.setMonth(e.getMonth()+t)},function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())},function(e){return e.getMonth()}),T=t(function(e){e.setHours(0,0,0,0),e.setMonth(0,1)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()}),v=t(function(e){e.setUTCMilliseconds(0)},function(e,t){e.setTime(+e+1e3*t)},function(e,t){return(t-e)/1e3},function(e){return e.getUTCSeconds()}),_=t(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+6e4*t)},function(e,t){return(t-e)/6e4},function(e){return e.getUTCMinutes()}),O=t(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+36e5*t)},function(e,t){return(t-e)/36e5},function(e){return e.getUTCHours()}),S=t(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/864e5},function(e){return e.getUTCDate()-1}),N=r(0),A=r(1),P=r(2),C=r(3),I=r(4),b=r(5),R=r(6),D=t(function(e){e.setUTCHours(0,0,0,0),e.setUTCDate(1)},function(e,t){e.setUTCMonth(e.getUTCMonth()+t)},function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())},function(e){return e.getUTCMonth()}),L=t(function(e){e.setUTCHours(0,0,0,0),e.setUTCMonth(0,1)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()}),M=a.range,U=u.range,x=s.range,F=c.range,w=l.range,k=d.range,j=f.range,G=p.range,B=y.range,H=g.range,Y=h.range,W=m.range,Q=d.range,z=E.range,V=T.range,K=a,q=M,X=v.range,$=_.range,J=O.range,Z=S.range,ee=N.range,te=A.range,ne=P.range,re=C.range,ie=I.range,oe=b.range,ae=R.range,ue=N.range,se=D.range,ce=L.range,le="0.1.1";e.version=le,e.milliseconds=M,e.seconds=U,e.minutes=x,e.hours=F,e.days=w,e.sundays=k,e.mondays=j,e.tuesdays=G,e.wednesdays=B,e.thursdays=H,e.fridays=Y,e.saturdays=W,e.weeks=Q,e.months=z,e.years=V,e.utcMillisecond=K,e.utcMilliseconds=q,e.utcSeconds=X,e.utcMinutes=$,e.utcHours=J,e.utcDays=Z,e.utcSundays=ee,e.utcMondays=te,e.utcTuesdays=ne,e.utcWednesdays=re,e.utcThursdays=ie,e.utcFridays=oe,e.utcSaturdays=ae,e.utcWeeks=ue,e.utcMonths=se,e.utcYears=ce,e.millisecond=a,e.second=u,e.minute=s,e.hour=c,e.day=l,e.sunday=d,e.monday=f,e.tuesday=p,e.wednesday=y,e.thursday=g,e.friday=h,e.saturday=m,e.week=d,e.month=E,e.year=T,e.utcSecond=v,e.utcMinute=_,e.utcHour=O,e.utcDay=S,e.utcSunday=N,e.utcMonday=A,e.utcTuesday=P,e.utcWednesday=C,e.utcThursday=I,e.utcFriday=b,e.utcSaturday=R,e.utcWeek=N,e.utcMonth=D,e.utcYear=L,e.interval=t})}),Sc=Object.freeze({"default":Oc,__moduleExports:Oc}),Nc=Sc&&Oc||Sc,Ac=new Date,Pc=new Date(0,0,1).setFullYear(0),Cc=new Date(Date.UTC(0,0,1)).setUTCFullYear(0),Ic=[Pe("second",Nc.second,Pc),Pe("minute",Nc.minute,Pc),Pe("hour",Nc.hour,Pc),Pe("day",Nc.day,Pc,[1,7]),Pe("month",Nc.month,Pc,[1,3,6]),Pe("year",Nc.year,Pc),Ae("seconds",function(e){return new Date(1970,0,1,0,0,e)},function(e){return Ne(e).getSeconds()},null,0,59),Ae("minutes",function(e){return new Date(1970,0,1,0,e)},function(e){return Ne(e).getMinutes()},null,0,59),Ae("hours",function(e){return new Date(1970,0,1,e)},function(e){return Ne(e).getHours()},null,0,23),Ae("weekdays",function(e){return new Date(1970,0,4+e)},function(e){return Ne(e).getDay()},[1],0,6),Ae("dates",function(e){return new Date(1970,0,e)},function(e){return Ne(e).getDate()},[1],1,31),Ae("months",function(e){return new Date(1970,e%12,1)},function(e){return Ne(e).getMonth()},[1],0,11)],bc=[Pe("second",Nc.utcSecond,Cc),Pe("minute",Nc.utcMinute,Cc),Pe("hour",Nc.utcHour,Cc),Pe("day",Nc.utcDay,Cc,[1,7]),Pe("month",Nc.utcMonth,Cc,[1,3,6]),Pe("year",Nc.utcYear,Cc),Ae("seconds",function(e){return new Date(Date.UTC(1970,0,1,0,0,e))},function(e){return Ne(e).getUTCSeconds()},null,0,59),Ae("minutes",function(e){return new Date(Date.UTC(1970,0,1,0,e))},function(e){return Ne(e).getUTCMinutes()},null,0,59),Ae("hours",function(e){return new Date(Date.UTC(1970,0,1,e))},function(e){return Ne(e).getUTCHours()},null,0,23),Ae("weekdays",function(e){return new Date(Date.UTC(1970,0,4+e))},function(e){return Ne(e).getUTCDay()},[1],0,6),Ae("dates",function(e){return new Date(Date.UTC(1970,0,e))},function(e){return Ne(e).getUTCDate()},[1],1,31),Ae("months",function(e){return new Date(Date.UTC(1970,e%12,1))},function(e){return Ne(e).getUTCMonth()},[1],0,11)],Rc=[[31536e6,5],[7776e6,4],[2592e6,4],[12096e5,3],[6048e5,3],[1728e5,3],[864e5,3],[432e5,2],[216e5,2],[108e5,2],[36e5,2],[18e5,1],[9e5,1],[3e5,1],[6e4,1],[3e4,0],[15e3,0],[5e3,0],[1e3,0]],Dc=Ie(Ic),Lc=Ie(bc);Dc.utc=Lc;var Mc=Object.freeze({"default":Dc,__moduleExports:Dc,utc:Lc}),Uc=Mc&&Dc||Mc,xc=1e-15;be.date=function(e){if(!e)throw Error("Missing date binning options.");var t=e.utc?Uc.utc:Uc,n=e.min,r=e.max,i=e.maxbins||20,o=e.minbins||4,a=+r-+n,u=e.unit?t[e.unit]:t.find(a,o,i),s=be({min:null!=u.min?u.min:u.unit(n),max:null!=u.max?u.max:u.unit(r),maxbins:i,minstep:u.minstep,steps:u.step});return s.unit=u,s.index=Ue,e.raw||(s.value=Me),s};var Fc=be,wc=Object.freeze({"default":Fc,__moduleExports:Fc}),kc=_c&&Tc||_c,jc=wc&&Fc||wc,Gc=Ba&&ka||Ba,Bc=n(function(e,t){function n(e,t,n){void 0===t&&(t={}),void 0===n&&(n={fields:[]}),t=va.extend({},Gc.DEFAULT_QUERY_CONFIG,t);for(var o=kc.summary(e),a=mc.inferAll(e),s=n.fields.reduce(function(e,t){return e[t.name]=t,e},{}),c=o.map(function(n,r){var i,o=n.field,u="date"===a[o]?d.DATETIME:a[o],c=n.distinct;if(u===d.NUMBER)i=Sa.Type.QUANTITATIVE;else if(u===d.INTEGER)i=cn.max.getTime()&&(n.max=new Date(y))}}else i=Sa.Type.NOMINAL;i===Sa.Type.NOMINAL&&c/n.count>t.minPercentUniqueForKey&&n.count>t.minCardinalityForKey&&(i=zs.ExpandedType.KEY);var g={name:o,originalIndex:r,vlType:i,type:u,stats:n,timeStats:{},binStats:{}},h=s[g.name];return g=va.extend(g,h)}),f=0,p=c;fc[t.vlType]?1:e.name.localeCompare(t.name)}),e.fields.forEach(function(e,t){return e.index=t}),this._fieldSchemaIndex=e.fields.reduce(function(e,t){return e[t.name]=t,e},{})}return e.prototype.fieldNames=function(){return this._tableSchema.fields.map(function(e){return e.name})},Object.defineProperty(e.prototype,"fieldSchemas",{get:function(){return this._tableSchema.fields},enumerable:!0,configurable:!0}),e.prototype.fieldSchema=function(e){return this._fieldSchemaIndex[e]},e.prototype.tableSchema=function(){var e=va.duplicate(this._tableSchema);return e.fields.sort(function(e,t){return e.originalIndex-t.originalIndex}),e},e.prototype.primitiveType=function(e){return this._fieldSchemaIndex[e]?this._fieldSchemaIndex[e].type:null},e.prototype.vlType=function(e){return this._fieldSchemaIndex[e]?this._fieldSchemaIndex[e].vlType:null},e.prototype.cardinality=function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!1);var o=this._fieldSchemaIndex[e.field];if(e.aggregate||fs.isAutoCountQuery(e)&&e.autoCount)return 1;if(e.bin){var s=void 0;s="boolean"==typeof e.bin?{maxbins:iu.autoMaxBins(e.channel)}:"?"===e.bin?{"enum":[!0,!1]}:e.bin;var c=s.maxbins;return o.binStats[c]||(o.binStats[c]=r(c,o.stats)),o.binStats[c].distinct}if(e.timeUnit){if(t)switch(e.timeUnit){case Oa.TimeUnit.SECONDS:return 60;case Oa.TimeUnit.MINUTES:return 60;case Oa.TimeUnit.HOURS:return 24;case Oa.TimeUnit.DAY:return 7;case Oa.TimeUnit.DATE:return 31;case Oa.TimeUnit.MONTH:return 12;case Oa.TimeUnit.QUARTER:return 4;case Oa.TimeUnit.MILLISECONDS:return 1e3}var l=e.timeUnit,d=o.timeStats;return d&&d[l]||(d=u({},d,(f={},f[l]=i(e.timeUnit,o.stats),f))),n?d[l].distinct-a(d[l].unique,["Invalid Date",null]):d[l].distinct}return o?n?o.stats.distinct-a(o.stats.unique,[NaN,null]):o.stats.distinct:null;var f},e.prototype.timeUnitHasVariation=function(e){if(e.timeUnit){if(e.timeUnit===Oa.TimeUnit.DAY){var t=va.extend({},e,{timeUnit:Oa.TimeUnit.DATE});if(this.cardinality(t,!1,!0)<=1)return!1}for(var n=e.timeUnit,r=0,i=Oa.TIMEUNIT_PARTS;r=r.minCardinalityForBin}return!0}},{name:"binAppliedForQuantitative",description:"bin should be applied to quantitative field only.",properties:[Ta.Property.TYPE,Ta.Property.BIN],allowWildcardForProperties:!1,strict:!0,satisfy:function(e,t,n,r){return!e.bin||e.type===Sa.Type.QUANTITATIVE}},{name:"channelFieldCompatible",description:"encoding channel's range type be compatible with channel type.",properties:[Ta.Property.CHANNEL,Ta.Property.TYPE,Ta.Property.BIN,Ta.Property.TIMEUNIT],allowWildcardForProperties:!1,strict:!0,satisfy:function(e,t,r,i){var o=n({field:"f"},fs.toFieldDef(e,{schema:t,props:["bin","timeUnit","type"]}));return zu.channelCompatibility(o,e.channel).compatible}},{name:"hasFn",description:"A field with as hasFn flag should have one of aggregate, timeUnit, or bin.",properties:[Ta.Property.AGGREGATE,Ta.Property.BIN,Ta.Property.TIMEUNIT],allowWildcardForProperties:!0,strict:!0,satisfy:function(e,t,n,r){return!e.hasFn||(!!e.aggregate||!!e.bin||!!e.timeUnit)}},{name:"omitScaleZeroWithBinnedField",description:"Do not use scale zero with binned field",properties:[Ta.Property.SCALE,Ta.getEncodingNestedProp("scale","zero"),Ta.Property.BIN],allowWildcardForProperties:!1,strict:!0,satisfy:function(e,t,n,r){return!e.bin||!e.scale||e.scale.zero!==!0}},{name:"onlyOneTypeOfFunction",description:"Only of of aggregate, autoCount, timeUnit, or bin should be applied at the same time.",properties:[Ta.Property.AGGREGATE,Ta.Property.AUTOCOUNT,Ta.Property.TIMEUNIT,Ta.Property.BIN],allowWildcardForProperties:!0,strict:!0,satisfy:function(e,t,n,r){if(fs.isFieldQuery(e)){var i=(!Fa.isWildcard(e.aggregate)&&e.aggregate?1:0)+(!Fa.isWildcard(e.bin)&&e.bin?1:0)+(!Fa.isWildcard(e.timeUnit)&&e.timeUnit?1:0);return i<=1}return!0}},{name:"timeUnitAppliedForTemporal",description:"Time unit should be applied to temporal field only.",properties:[Ta.Property.TYPE,Ta.Property.TIMEUNIT],allowWildcardForProperties:!1,strict:!0,satisfy:function(e,t,n,r){return!e.timeUnit||e.type===Sa.Type.TEMPORAL}},{name:"timeUnitShouldHaveVariation",description:"A particular time unit should be applied only if they produce unique values.",properties:[Ta.Property.TIMEUNIT,Ta.Property.TYPE],allowWildcardForProperties:!1,strict:!1,satisfy:function(e,t,n,r){return!e.timeUnit||e.type!==Sa.Type.TEMPORAL||(!n.has("timeUnit")&&!r.constraintManuallySpecifiedValue||t.timeUnitHasVariation(e))}},{name:"scalePropertiesSupportedByScaleType",description:"Scale properties must be supported by correct scale type",properties:[].concat(Ta.SCALE_PROPS,[Ta.Property.SCALE,Ta.Property.TYPE]),allowWildcardForProperties:!0,strict:!0,satisfy:function(e,t,n,r){if(e.scale){var i=e.scale,o=fs.scaleType(e);if(void 0===o||null===o)return!0;for(var a in i)if("type"!==a&&"name"!==a&&"enum"!==a){var u=a;if("point"===o){if(!si.scaleTypeSupportProperty("point",u)&&!si.scaleTypeSupportProperty("band",u))return!1; +}else if(!si.scaleTypeSupportProperty(o,u))return!1}}return!0}},{name:"scalePropertiesSupportedByChannel",description:"Not all scale properties are supported by all encoding channels",properties:[].concat(Ta.SCALE_PROPS,[Ta.Property.SCALE,Ta.Property.CHANNEL]),allowWildcardForProperties:!0,strict:!0,satisfy:function(e,t,n,r){if(e){var i=e.channel,o=e.scale;if(i&&!Fa.isWildcard(i)&&o){if("row"===i||"column"===i)return!1;for(var a in o)if(o.hasOwnProperty(a)&&"type"!==a&&"name"!==a&&"enum"!==a){var u=void 0===si.channelScalePropertyIncompatability(i,a);if(!u)return!1}}}return!0}},{name:"typeMatchesPrimitiveType",description:"Data type should be supported by field's primitive type.",properties:[Ta.Property.FIELD,Ta.Property.TYPE],allowWildcardForProperties:!1,strict:!0,satisfy:function(e,t,n,r){if("*"===e.field)return!0;var i=t.primitiveType(e.field),o=e.type;if(!n.has("field")&&!n.has("type")&&!r.constraintManuallySpecifiedValue)return!0;switch(i){case Jc.PrimitiveType.BOOLEAN:case Jc.PrimitiveType.STRING:return o!==Sa.Type.QUANTITATIVE&&o!==Sa.Type.TEMPORAL;case Jc.PrimitiveType.NUMBER:case Jc.PrimitiveType.INTEGER:return o!==Sa.Type.TEMPORAL;case Jc.PrimitiveType.DATETIME:return o===Sa.Type.TEMPORAL;case null:return!1}throw new Error("Not implemented")}},{name:"typeMatchesSchemaType",description:"Enumerated data type of a field should match the field's type in the schema.",properties:[Ta.Property.FIELD,Ta.Property.TYPE],allowWildcardForProperties:!1,strict:!1,satisfy:function(e,t,n,r){return!(n.has("field")||n.has("type")||r.constraintManuallySpecifiedValue)||("*"===e.field?e.type===Sa.Type.QUANTITATIVE:t.vlType(e.field)===e.type)}},{name:"maxCardinalityForCategoricalColor",description:"Categorical channel should not have too high cardinality",properties:[Ta.Property.CHANNEL,Ta.Property.FIELD],allowWildcardForProperties:!1,strict:!1,satisfy:function(e,t,n,r){return e.channel!==Rr.Channel.COLOR||e.type!==Sa.Type.NOMINAL&&e.type!==zs.ExpandedType.KEY||t.cardinality(e)<=r.maxCardinalityForCategoricalColor}},{name:"maxCardinalityForFacet",description:"Row/column channel should not have too high cardinality",properties:[Ta.Property.CHANNEL,Ta.Property.FIELD,Ta.Property.BIN,Ta.Property.TIMEUNIT],allowWildcardForProperties:!1,strict:!1,satisfy:function(e,t,n,r){return e.channel!==Rr.Channel.ROW&&e.channel!==Rr.Channel.COLUMN||t.cardinality(e)<=r.maxCardinalityForFacet}},{name:"maxCardinalityForShape",description:"Shape channel should not have too high cardinality",properties:[Ta.Property.CHANNEL,Ta.Property.FIELD,Ta.Property.BIN,Ta.Property.TIMEUNIT],allowWildcardForProperties:!1,strict:!1,satisfy:function(e,t,n,r){return e.channel!==Rr.Channel.SHAPE||t.cardinality(e)<=r.maxCardinalityForShape}},{name:"dataTypeAndFunctionMatchScaleType",description:"Scale type must match data type",properties:[Ta.Property.TYPE,Ta.Property.SCALE,Ta.getEncodingNestedProp("scale","type"),Ta.Property.TIMEUNIT,Ta.Property.BIN],allowWildcardForProperties:!1,strict:!0,satisfy:function(e,t,n,r){if(e.scale){var i=e.type,o=fs.scaleType(e);if(zs.isDiscrete(i))return void 0===o||si.hasDiscreteDomain(o);if(i===Sa.Type.TEMPORAL)return e.timeUnit?va.contains([si.ScaleType.TIME,si.ScaleType.UTC,void 0],o)||si.hasDiscreteDomain(o):va.contains([si.ScaleType.TIME,si.ScaleType.UTC,void 0],o);if(i===Sa.Type.QUANTITATIVE)return e.bin?va.contains([si.ScaleType.LINEAR,void 0],o):va.contains([si.ScaleType.LOG,si.ScaleType.POW,si.ScaleType.SQRT,si.ScaleType.QUANTILE,si.ScaleType.QUANTIZE,si.ScaleType.LINEAR,void 0],o)}return!0}},{name:"stackIsOnlyUsedWithXY",description:"stack should only be allowed for x and y channels",properties:[Ta.Property.STACK,Ta.Property.CHANNEL],allowWildcardForProperties:!1,strict:!0,satisfy:function(e,t,n,r){return!e.stack||(e.channel===Rr.Channel.X||e.channel===Rr.Channel.Y)}}].map(function(e){return new Zc.EncodingConstraintModel(e)}),t.FIELD_CONSTRAINT_INDEX=t.FIELD_CONSTRAINTS.reduce(function(e,t){return e[t.name()]=t,e},{}),t.FIELD_CONSTRAINTS_BY_PROPERTY=t.FIELD_CONSTRAINTS.reduce(function(e,t){for(var n=0,r=t.properties();n1&&(a||n.constraintManuallySpecifiedValue)))return!1}}return!0}},{name:"omitNonPositionalOrFacetOverPositionalChannels",description:"Do not use non-positional channels unless all positional channels are used",properties:[Ta.Property.CHANNEL],allowWildcardForProperties:!1,strict:!1,satisfy:function(e,t,n){for(var r=e.specQuery.encodings,i=!1,o=!1,a=!1,u=!1,s=0;s"+e}).join(";")+"]"}return e.property}return e}).join(","):e}Object.defineProperty(t,"__esModule",{value:!0}),t.REPLACE_BLANK_FIELDS={"*":""},t.REPLACE_XY_CHANNELS={x:"xy",y:"xy"},t.REPLACE_FACET_CHANNELS={row:"facet",column:"facet"},t.REPLACE_MARK_STYLE_CHANNELS={color:"style",opacity:"style",shape:"style",size:"style"},t.isExtendedGroupBy=n,t.parseGroupBy=r,t.toString=i,t.GROUP_BY_FIELD_TRANSFORM=[Ta.Property.FIELD,Ta.Property.TYPE,Ta.Property.AGGREGATE,Ta.Property.BIN,Ta.Property.TIMEUNIT,Ta.Property.STACK],t.GROUP_BY_ENCODING=t.GROUP_BY_FIELD_TRANSFORM.concat([{property:Ta.Property.CHANNEL,replace:{x:"xy",y:"xy",color:"style",size:"style",shape:"style",opacity:"style",row:"facet",column:"facet"}}])}),Hl=t(Bl),Yl=Bl.REPLACE_BLANK_FIELDS,Wl=Bl.REPLACE_XY_CHANNELS,Ql=Bl.REPLACE_FACET_CHANNELS,zl=Bl.REPLACE_MARK_STYLE_CHANNELS,Vl=Bl.isExtendedGroupBy,Kl=Bl.parseGroupBy,ql=Bl.GROUP_BY_FIELD_TRANSFORM,Xl=Bl.GROUP_BY_ENCODING,$l=Object.freeze({"default":Hl,__moduleExports:Bl,REPLACE_BLANK_FIELDS:Yl,REPLACE_XY_CHANNELS:Wl,REPLACE_FACET_CHANNELS:Ql,REPLACE_MARK_STYLE_CHANNELS:zl,isExtendedGroupBy:Vl,parseGroupBy:Kl,GROUP_BY_FIELD_TRANSFORM:ql,GROUP_BY_ENCODING:Xl}),Jl=$l&&Hl||$l,Zl=n(function(e,t){function n(e,t){o[e]=t}function r(e,t){if(t){for(var n={name:"",path:"",items:[]},r={},i=[],a=[],u=[],s=0;s0?i[s-1].duplicate():new Is.PropIndex),a.push(s>0?a[s-1].duplicate():new Is.PropIndex);var c=t[s].groupBy;if(Bi.isArray(c)){var l=Jl.parseGroupBy(c,i[s],a[s]);u.push(l.replacer)}}return e.forEach(function(e){for(var a="",s=n,c=0;c0},e.prototype.channelEncodingField=function(e){var t=this.getEncodingQueryByChannel(e);return fs.isFieldQuery(t)},e.prototype.getEncodings=function(){return this._spec.encodings.filter(function(e){return!fs.isDisabledAutoCountQuery(e)})},e.prototype.getEncodingQueryByChannel=function(e){for(var t=0,n=this._spec.encodings;te.score)return n}return e},{type:"Dimension",feature:"No Dimension",score:-5}),[]},t}(uf.Scorer);t.DimensionScorer=r}),pf=t(ff),yf=ff.DimensionScorer,gf=Object.freeze({"default":pf,__moduleExports:ff,DimensionScorer:yf}),hf=n(function(e,t){var n=Ge&&Ge.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),r=Ge&&Ge.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;ne.score)return o}return e},null);o.push(t)}),o},r}(uf.Scorer);t.TypeChannelScorer=r}),Af=t(Nf),Pf=Nf.TERRIBLE,Cf=Nf.TypeChannelScorer,If=Object.freeze({"default":Af,__moduleExports:Nf,TERRIBLE:Pf,TypeChannelScorer:Cf}),bf=n(function(e,t){function n(e,t,n,r){return e+"_"+t+"_"+n+"_"+r}function r(){var e=[af.Q,af.T],t=[af.BIN_Q,af.TIMEUNIT_O,af.O,af.N,af.K],r=t.concat([af.NONE]),i={};return e.forEach(function(t){e.forEach(function(e){var r={point:0,text:-.2,tick:-.5,rect:-1,bar:-2,line:-2,area:-2,rule:-2.5};va.forEach(r,function(r,o){var a=n(t,e,!0,o);i[a]=r});var o={point:0,text:-.2,tick:-.5,bar:-2,line:-2,area:-2,rule:-2.5};va.forEach(o,function(r,o){var a=n(t,e,!1,o);i[a]=r})})}),e.forEach(function(e){r.forEach(function(t){var r={tick:0,point:-.2,text:-.5,bar:-2,line:-2,area:-2,rule:-2.5};va.forEach(r,function(r,o){var a=n(e,t,!0,o);i[a]=r;var u=n(t,e,!0,o);i[u]=r})}),[af.TIMEUNIT_T].forEach(function(t){var r={point:0,text:-.5,tick:-1,bar:-2,line:-2,area:-2,rule:-2.5};va.forEach(r,function(r,o){var a=n(e,t,!0,o);i[a]=r;var u=n(t,e,!0,o);i[u]=r})}),[af.NONE,af.N,af.O,af.K].forEach(function(t){var r={bar:0,point:-.2,tick:-.25,text:-.3,line:-2,area:-2,rule:-2.5};va.forEach(r,function(r,o){var a=n(e,t,!1,o);i[a]=r;var u=n(t,e,!1,o);i[u]=r})}),[af.BIN_Q].forEach(function(t){var r={bar:0,point:-.2,tick:-.25,text:-.3,line:-.5,area:-.5,rule:-2.5};va.forEach(r,function(r,o){var a=n(e,t,!1,o);i[a]=r;var u=n(t,e,!1,o);i[u]=r})}),[af.TIMEUNIT_T,af.TIMEUNIT_O].forEach(function(t){var r={line:0,area:-.1,bar:-.2,point:-.3,tick:-.35,text:-.4,rule:-2.5};va.forEach(r,function(r,o){var a=n(e,t,!1,o);i[a]=r;var u=n(t,e,!1,o);i[u]=r})})}),[af.TIMEUNIT_T].forEach(function(e){[af.TIMEUNIT_T].forEach(function(t){var r={point:0,rect:-.1,text:-.5,tick:-1,bar:-2,line:-2,area:-2,rule:-2.5};va.forEach(r,function(r,o){var a=n(e,t,!0,o);i[a]=r}),va.forEach(r,function(r,o){var a=n(e,t,!1,o);i[a]=r})}),r.forEach(function(t){var r={tick:0,point:-.2,text:-.5,rect:-1,bar:-2,line:-2,area:-2,rule:-2.5};va.forEach(r,function(r,o){var a=n(e,t,!0,o);i[a]=r}),va.forEach(r,function(r,o){var a=n(t,e,!0,o);i[a]=r}),va.forEach(r,function(r,o){var a=n(e,t,!1,o);i[a]=r}),va.forEach(r,function(r,o){var a=n(t,e,!1,o);i[a]=r})})}),r.forEach(function(e){r.forEach(function(t){var r={point:0,rect:0,text:-.1,tick:-1,bar:-2,line:-2,area:-2,rule:-2.5};va.forEach(r,function(r,o){var a=n(e,t,!0,o);i[a]=r}),va.forEach(r,function(r,o){var a=n(e,t,!1,o);i[a]=r})})}),i}var i=Ge&&Ge.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){return e.call(this,"Mark")||this}return i(t,e),t.prototype.initScore=function(){return r()},t.prototype.getScore=function(e,t,n){var r=e.getMark();r!==_a.Mark.CIRCLE&&r!==_a.Mark.SQUARE||(r=_a.Mark.POINT);var i=e.getEncodingQueryByChannel(Rr.Channel.X),o=i?af.getExtendedType(i):af.NONE,a=e.getEncodingQueryByChannel(Rr.Channel.Y),u=a?af.getExtendedType(a):af.NONE,s=!e.isAggregate(),c=o+"_"+u+"_"+s+"_"+r,l=this.getFeatureScore(c);return[l]},t}(uf.Scorer);t.MarkScorer=o,t.featurize=n}),Rf=t(bf),Df=bf.MarkScorer,Lf=bf.featurize,Mf=Object.freeze({"default":Rf,__moduleExports:bf,MarkScorer:Df,featurize:Lf}),Uf=df&&cf||df,xf=gf&&pf||gf,Ff=Tf&&mf||Tf,wf=Sf&&_f||Sf,kf=If&&Af||If,jf=Mf&&Rf||Mf,Gf=n(function(e,t){function n(e,t,n){var i=r.reduce(function(r,i){var o=i.getScore(e,t,n);return r.concat(o)},[]);return{score:i.reduce(function(e,t){return e+t.score},0),features:i}}Object.defineProperty(t,"__esModule",{value:!0});var r=[new Uf.AxisScorer,new xf.DimensionScorer,new Ff.FacetScorer,new jf.MarkScorer,new wf.SizeChannelScorer,new kf.TypeChannelScorer];t.effectiveness=n}),Bf=t(Gf),Hf=Gf.effectiveness,Yf=Object.freeze({"default":Bf,__moduleExports:Gf,effectiveness:Hf}),Wf=n(function(e,t){function n(e,t,n){var i=r(e,t,n);return{score:i.score,features:[i]}}function r(e,n,r){var i=e.getEncodings();if(e.isAggregate()){var o=function(e){return fs.isFieldQuery(e)&&(e.type===Sa.Type.QUANTITATIVE&&!e.bin&&!e.aggregate||e.type===Sa.Type.TEMPORAL&&!e.timeUnit)};if(va.some(i,o))return{type:t.name,score:.1,feature:"Aggregate with raw continuous"};if(va.some(i,function(e){return fs.isFieldQuery(e)&&fs.isDimension(e)})){var a=va.some(i,function(e){return fs.isFieldQuery(e)&&"count"===e.aggregate||fs.isEnabledAutoCountQuery(e)}),u=va.some(i,function(e){return fs.isFieldQuery(e)&&!!e.bin});return a?{type:t.name,score:.8,feature:"Aggregate with count"}:u?{type:t.name,score:.7,feature:"Aggregate with bin but without count"}:{type:t.name,score:.9,feature:"Aggregate without count and without bin"}}return{type:t.name,score:.3,feature:"Aggregate without dimension"}}return va.some(i,function(e){return fs.isFieldQuery(e)&&!fs.isDimension(e)})?{type:t.name,score:1,feature:"Raw with measure"}:{type:t.name,score:.2,feature:"Raw without measure"}}Object.defineProperty(t,"__esModule",{value:!0}),t.name="aggregationQuality",t.score=n}),Qf=t(Wf),zf=Wf.name,Vf=Wf.score,Kf=Object.freeze({"default":Qf,__moduleExports:Wf,name:zf,score:Vf}),qf=n(function(e,t){function n(e,t,n){var r=e.wildcardIndex.encodingIndicesByProperty.get("field");if(!r)return{score:0,features:[]};for(var i=e.specQuery.encodings,o=t.fieldSchemas.length,a=[],u=0,s=1,c=r.length-1;c>=0;c--){var l=r[c],d=i[l],f=void 0;if(fs.isFieldQuery(d)){f=d.field;var p=e.wildcardIndex.encodings[l].get("field"),y=t.fieldSchema(f).index,g=-y*s;u+=g,a.push({score:g,type:"fieldOrder",feature:"field "+p.name+" is "+f+" (#"+y+" in the schema)"}),s*=o}}return{score:u,features:a}}Object.defineProperty(t,"__esModule",{value:!0}),t.name="fieldOrder",t.score=n}),Xf=t(qf),$f=qf.name,Jf=qf.score,Zf=Object.freeze({"default":Xf,__moduleExports:qf,name:$f,score:Jf}),ep=Gd&&Fd||Gd,tp=Yf&&Bf||Yf,np=Kf&&Qf||Kf,rp=Zf&&Xf||Zf,ip=n(function(e,t){function n(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}function r(e,t){l[e]=t}function i(e){return l[e]}function o(e,t,n,r){return t.nest&&r!==t.nest.length?(e.items.forEach(function(e){o(e,t,n,r+1)}),t.nest[r].orderGroupBy&&e.items.sort(u(t.nest[r].orderGroupBy,n,t.config))):(t.orderBy||t.chooseBy)&&(e.items.sort(a(t.orderBy||t.chooseBy,n,t.config)),t.chooseBy&&e.items.length>0&&e.items.splice(1)),e}function a(e,t,n){return function(r,i){return e instanceof Array?s(e,r,i,t,n):s([e],r,i,t,n)}}function u(e,t,n){return function(r,i){var o=ep.getTopResultTreeItem(r),a=ep.getTopResultTreeItem(i);return e instanceof Array?s(e,o,a,t,n):s([e],o,a,t,n)}}function s(e,t,n,r,i){for(var o=0,a=e;or.smallRangeStepForHighCardinalityOrFacet.maxCardinality)){void 0===i.scale&&(i.scale={});var o=fs.scaleType(i);i.scale&&(void 0===o||si.hasDiscreteDomain(o))&&(i.scale.rangeStep||(i.scale.rangeStep=12))}var a=n[Rr.Channel.X];if(fs.isFieldQuery(a)&&(n[Rr.Channel.COLUMN]||t.cardinality(a)>r.smallRangeStepForHighCardinalityOrFacet.maxCardinality)){void 0===a.scale&&(a.scale={});var u=fs.scaleType(a);a.scale&&(void 0===u||si.hasDiscreteDomain(u))&&(a.scale.rangeStep||(a.scale.rangeStep=12))}return e}function i(e,t,n,r){n[Rr.Channel.COLOR]=e.getEncodingQueryByChannel(Rr.Channel.COLOR);var i=n[Rr.Channel.COLOR];return fs.isFieldQuery(i)&&void 0!==i&&(i.type===Sa.Type.NOMINAL||i.type===zs.ExpandedType.KEY)&&t.cardinality(i)>r.nominalColorScaleForHighCardinality.maxCardinality&&(void 0===i.scale&&(i.scale={}),i.scale&&(i.scale.range||(i.scale.scheme=r.nominalColorScaleForHighCardinality.palette))),e}function o(e,t,n,r){if([Rr.Channel.COLUMN,Rr.Channel.X,Rr.Channel.Y].forEach(function(t){n[t]=e.getEncodingQueryByChannel(t)}),void 0===n[Rr.Channel.COLUMN]){var i=n[Rr.Channel.X],o=n[Rr.Channel.Y];fs.isFieldQuery(i)&&fs.isFieldQuery(o)&&void 0!==o&&o.field&&si.hasDiscreteDomain(fs.scaleType(o))&&void 0!==i&&t.cardinality(o)>r.xAxisOnTopForHighYCardinalityWithoutColumn.maxCardinality&&(void 0===i.axis&&(i.axis={}),i.axis&&!i.axis.orient&&(i.axis.orient="top"))}return e}Object.defineProperty(t,"__esModule",{value:!0}),t.stylize=n,t.smallRangeStepForHighCardinalityOrFacet=r,t.nominalColorScaleForHighCardinality=i,t.xAxisOnTopForHighYCardinalityWithoutColumn=o}),mp=t(hp),Ep=hp.stylize,Tp=hp.smallRangeStepForHighCardinalityOrFacet,vp=hp.nominalColorScaleForHighCardinality,_p=hp.xAxisOnTopForHighYCardinalityWithoutColumn,Op=Object.freeze({"default":mp,__moduleExports:hp,stylize:Ep,smallRangeStepForHighCardinalityOrFacet:Tp,nominalColorScaleForHighCardinality:vp,xAxisOnTopForHighYCardinalityWithoutColumn:_p}),Sp=Fl&&Ml||Fl,Np=hd&&yd||hd,Ap=Op&&mp||Op,Pp=n(function(e,t){function n(e,t,n){void 0===n&&(n=Gc.DEFAULT_QUERY_CONFIG);var r=Np.SpecQueryModel.build(e,t,n),i=r.wildcardIndex,o=[r];return n.propertyPrecedence.forEach(function(e){var r=Ta.fromKey(e);if(i.hasProperty(r)){var a=Sp.getEnumerator(r),u=a(i,t,n);o=o.reduce(u,[])}}),!n.stylize||null===n.nominalColorScaleForHighCardinality&&null===n.smallRangeStepForHighCardinalityOrFacet&&null===n.xAxisOnTopForHighYCardinalityWithoutColumn?o:Ap.stylize(o,t,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.generate=n}),Cp=t(Pp),Ip=Pp.generate,bp=Object.freeze({"default":Cp,__moduleExports:Pp,generate:Ip}),Rp=bp&&Cp||bp,Dp=gp&&op||gp,Lp=n(function(e,t){function n(e,t,n){e=r({},Ad.normalize(e),{config:r({},Gc.DEFAULT_QUERY_CONFIG,n,e.config)});var i=Rp.generate(e.spec,t,e.config),o=fd.nest(i,e.nest),a=Dp.rank(o,e,t,0);return{query:e,result:a}}var r=Ge&&Ge.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n build/compassql.min.js",clean:"rm -rf build",deploy:"npm run clean && npm run lint && npm run test && scripts/deploy.sh",lint:"tslint -c tslint.json src/**/*.ts test/**/*.ts",schema:"npm run prebuild && typescript-json-schema --required true src/query.ts Query > build/compassql-schema.json",test:"jest --maxWorkers=4 && npm run lint","test:inspect":"node --inspect-brk ./node_modules/.bin/jest --runInBand","check:examples":"./scripts/check-examples.sh","watch:build":"npm run build && concurrently --kill-others -n Typescript,Rollup 'tsc -w' 'rollup -c -w'","watch:test":"jest --watch"},Vp={type:"git",url:"git+https://github.com/uwdata/CompassQL.git"},Kp=["visualization","recommendation"],qp={name:"UW Interactive Data Lab",url:"http://idl.cs.washington.edu"},Xp=["Kanit Wongsuphasawat (http://kanitw.yellowpigz.com)","Dominik Moritz (http://domoritz.de)","Jeffrey Heer (http://jheer.org)"],$p="BSD-3-Clause",Jp={url:"https://github.com/uwdata/compassql/issues"},Zp="https://github.com/uwdata/compassql#readme",ey={"@types/chai":"^4.1.3","@types/d3":"^4.13.0","@types/jest":"^22.2.3",chai:"^4.1.2",codecov:"~1.0.1",concurrently:"^3.5.1",d3:"~4",exorcist:"~0.4.0",jest:"^22.4.3",rollup:"^0.58.2","rollup-plugin-commonjs":"^9.1.0","rollup-plugin-json":"^2.3.0","rollup-plugin-node-resolve":"^3.3.0","source-map-support":"~0.4.0","ts-jest":"^22.4.4",tslint:"~4.3.1",typescript:"^2.3.4","uglify-js":"~2.6.1","vega-datasets":"latest"},ty={datalib:"~1.7.0","typescript-json-schema":"^0.9.0","vega-lite":"2.4.0","vega-typings":"^0.2.15"},ny={transform:{"^.+\\.tsx?$":"ts-jest"},testRegex:"(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",moduleFileExtensions:["ts","tsx","js","jsx","json","node"],testPathIgnorePatterns:["node_modules","/build","scripts","src"],coverageDirectory:"./coverage/",collectCoverage:!0},ry={name:Fp,version:wp,description:kp,main:jp,unpkg:Gp,jsdelivr:Bp,module:Hp,types:Yp,typings:Wp,directories:Qp,scripts:zp,repository:Vp,keywords:Kp,author:qp,collaborators:Xp,license:$p,bugs:Jp,homepage:Zp,devDependencies:ey,dependencies:ty,jest:ny},iy=Object.freeze({name:Fp,version:wp,description:kp,main:jp,unpkg:Gp,jsdelivr:Bp,module:Hp,types:Yp,typings:Wp,directories:Qp,scripts:zp,repository:Vp,keywords:Kp,author:qp,collaborators:Xp,license:$p,bugs:Jp,homepage:Zp,devDependencies:ey,dependencies:ty,jest:ny,"default":ry}),oy=Dl&&Il||Dl,ay=Ud&&Cd||Ud,uy=xp&&Mp||xp,sy=iy&&ry||iy,cy=n(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.config=Gc,t.constraint=oy,t.enumerate=Sp,t.wildcard=Fa,t.model=Np,t.nest=fd,t.property=Ta,t.query=ay,t.ranking=Dp,t.result=ep,t.schema=Jc,t.util=va,t.generate=Rp.generate,t.recommend=uy.recommend,t.version=sy.version}),ly=t(cy),dy=cy.config,fy=cy.constraint,py=cy.enumerate,yy=cy.wildcard,gy=cy.model,hy=cy.nest,my=cy.property,Ey=cy.query,Ty=cy.ranking,vy=cy.result,_y=cy.schema,Oy=cy.util,Sy=cy.generate,Ny=cy.recommend,Ay=cy.version;e["default"]=ly,e.config=dy,e.constraint=fy,e.enumerate=py,e.wildcard=yy,e.model=gy,e.nest=hy,e.property=my,e.query=Ey,e.ranking=Ty,e.result=vy,e.schema=_y,e.util=Oy,e.generate=Sy,e.recommend=Ny,e.version=Ay,Object.defineProperty(e,"__esModule",{value:!0})}); +//# sourceMappingURL=build/compassql.min.js.map diff --git a/build/compassql.min.js.map b/build/compassql.min.js.map new file mode 100644 index 00000000..4945fb02 --- /dev/null +++ b/build/compassql.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["build/compassql.js"],"names":["global","factory","exports","module","define","amd","cql","this","unwrapExports","x","__esModule","Object","prototype","hasOwnProperty","call","createCommonjsModule","fn","__extends","d","b","__","constructor","extendStatics","create","__rest","s","e","t","p","indexOf","getOwnPropertySymbols","i","length","__decorate","decorators","target","key","desc","c","arguments","r","getOwnPropertyDescriptor","Reflect","decorate","defineProperty","__param","paramIndex","decorator","__metadata","metadataKey","metadataValue","metadata","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","rejected","result","done","then","apply","__generator","body","verb","n","v","op","f","TypeError","_","y","label","ops","pop","trys","push","g","sent","throw","return","Symbol","iterator","__exportStar","m","__values","o","__read","ar","error","__spread","concat","__await","__asyncGenerator","a","q","resume","settle","fulfill","shift","asyncIterator","__asyncDelegator","__asyncValues","__makeTemplateObject","cooked","raw","__importStar","mod","k","__importDefault","default","quote","string","escapable","lastIndex","test","replace","meta","charCodeAt","toString","slice","str","holder","partial","mind","gap","toJSON","rep","isFinite","String","indent","join","accessor","fields","name","fname","accessorName","accessorFields","error$1","message","Error","splitAccessPath","path","substring","j","isObject","isString","$","isArray$1","map","JSON","stringify","field","code","Function","log","method","level","input","args","console","logger","None","Error$1","warn","Warn","info","Info","debug","Debug","peek","array","toNumber","exp","sign","Math","log$1","pow","exponent","pan","domain","delta","lift","ground","d0","d1","dd","panLinear","identity","panLog","panPow","zoom","anchor","scale","da","zoomLinear","zoomLog","zoomPow","array$1","isFunction","compare","orders","u","lt","gt","idx","cmp","ord","bind","reduce","forEach","keys","constant","debounce","delay","handler","callback","evt","tid","clearTimeout","setTimeout","extend","len","extentIndex","fastmap","has","obj","NULL","size","empty","object","get","undefined","set","delete","clear","clean","inherits","child","parent","proto","isBoolean","isDate","isNumber","isRegExp","flat","merge","array0","array1","output","n0","n1","merged","i0","i1","repeat","reps","pad","padchar","align","ceil","toBoolean","defaultParser","Date","parse","toDate","parser","toSet","truncate","ellipsis","l","max","visitArray","filter","visitor","annotation","data","types","TYPES","fieldNames","datum","util$6","bracket","fieldName","type$6","values","isValid","typeAll","infer","TESTS","splice","inferAll","date","tempDate","setTime","entry","type","unit","min","minstep","base","offset","count","find","units","span","minb","maxb","bins","STEPS","toUnitMap","opt","precision","eps","maxbins","logb","div","steps","bisect","round","floor","start","stop","value$2","index","lo","hi","mid","EPSILON","date_value","date_index","at","ch","text","value$1","encoding$5","freeze","encoding$4","__moduleExports","encoding$3","isValueQuery","encoding_1$3","isFieldQuery","encoding_2$1","isAutoCountQuery","encoding_3$1","isDisabledAutoCountQuery","encoding_4$1","isEnabledAutoCountQuery","encoding_5$1","toEncoding","encoding_6$1","toValueDef","encoding_7$1","toFieldDef","encoding_8","isContinuous","encoding_9","isMeasure","encoding_10","isDimension","encoding_11","scaleType","encoding_12","commonjsGlobal","window","self","setPrototypeOf","__proto__","Array","__assign","assign","tslib_es6","escapee","\"","\\","/","charAt","number","hex","uffff","parseInt","fromCharCode","white","word","source","reviver","walk","","parse$1","\b","\t","\n","\f","\r","replacer","space","stringify$1","require$$0","require$$1","parse$2","stringify$2","jsonify","jsonify$1","require$$0$1","json","jsonStableStringify","opts","cycles","node","aobj","bobj","seen","colonSeparator","isArray","out","item","objectKeys","sort","keyValue","jsonStableStringify$1","id","zero","one","truthy","falsy","vegaUtil","stringValue","logical","isLogicalOr","or","isLogicalAnd","and","isLogicalNot","not","forEachLeave","_i","_a","subop","_b","_c","normalizeLogicalOperand","normalizer","logical$1","logical_1","logical_2","logical_3","logical_4","logical_5","logical$2","stableStringify_","vega_util_1","logical_1$1","util","pick","props","copy","props_1","prop","omit","duplicate","props_2","hash","stableStringify","h","char","contains","without","excludedItems","union","other","some","arr","every","flatten","arrays","mergeDeep","dest","src","src_1","deepMerge_","unique","results","values_1","val","differ","dict","hasIntersection","isNumeric","num","isNaN","differArray","vals","_vals","flagKeys","varName","alphanumericS","match","logicalExpr","cb","deleteNestedProperty","orderedProps","titlecase","toUpperCase","substr","accessPath","util$1","util_1","util_2","util_3","util_4","util_5","util_6","util_7","util_8","util_9","util_10","util_11","util_12","util_13","util_14","util_15","util_16","util_17","util_18","util_19","util_20","util_21","util_22","util_23","util_24","util_25","util_26","util$2","tslib_1","util$3","channel","isColorChannel","isChannel","CHANNEL_INDEX","isScaleChannel","SCALE_CHANNEL_INDEX","supportMark","mark","getSupportedMark","COLOR","FILL","STROKE","DETAIL","KEY","TOOLTIP","HREF","ORDER","OPACITY","ROW","COLUMN","point","tick","rule","circle","square","bar","rect","line","trail","area","geoshape","X","Y","LATITUDE","LONGITUDE","X2","Y2","LATITUDE2","LONGITUDE2","SIZE","SHAPE","TEXT","rangeType","Channel","GEOPOSITION_CHANNEL_INDEX","longitude","longitude2","latitude","latitude2","GEOPOSITION_CHANNELS","UNIT_CHANNEL_INDEX","x2","y2","color","fill","stroke","opacity","shape","order","detail","tooltip","href","FACET_CHANNEL_INDEX","row","column","CHANNELS","SINGLE_DEF_CHANNEL_INDEX","SINGLE_DEF_CHANNELS","UNIT_CHANNELS","NONPOSITION_CHANNEL_INDEX","NONPOSITION_CHANNELS","POSITION_SCALE_CHANNEL_INDEX","POSITION_SCALE_CHANNELS","NONPOSITION_SCALE_CHANNEL_INDEX","NONPOSITION_SCALE_CHANNELS","SCALE_CHANNELS","channel$1","channel_1","channel_2","channel_3","channel_4","channel_5","channel_6","channel_7","channel_8","channel_9","channel_10","channel_11","channel_12","channel_13","channel_14","channel_15","channel_16","channel_17","channel_18","channel_19","channel_20","channel_21","channel_22","channel_23","channel_24","channel_25","channel_26","channel_27","channel_28","channel_29","channel_30","channel_31","channel_32","channel_33","channel_34","channel_35","channel_36","channel_37","channel_38","channel$2","axis","isAxisProperty","AXIS_PROPERTIES_INDEX","AXIS_PARTS","AXIS_PROPERTY_TYPE","grid","gridScale","labels","labelFlush","labelOverlap","minExtent","maxExtent","ticks","title","zindex","COMMON_AXIS_PROPERTIES_INDEX","orient","format","labelBound","labelPadding","position","tickCount","tickSize","titlePadding","encoding","labelAngle","titleMaxLength","VG_AXIS_PROPERTIES_INDEX","encode","VG_AXIS_PROPERTIES","AXIS_PROPERTIES","axis$1","axis_1","axis_2","axis_3","axis_4","axis_5","axis$2","log$2","wrap","current","LocalLogger","reset","newLogger","main","warns","infos","debugs","cannotProjectOnChannelWithoutField","nearestNotSupportForContinuous","selectionNotFound","noSuchRepeatedValue","cannotSetTitleAnchor","unrecognizedParse","differentParse","local","ancestor","invalidTransformIgnored","transform","encodingOverridden","channels","projectionOverridden","parentProjection","projection","primitiveChannelDef","invalidFieldType","nonZeroScaleUsedWithLengthMark","scaleText","zeroFalse","invalidFieldTypeForCountAggregate","aggregate","invalidAggregate","emptyOrInvalidFieldType","newType","droppingColor","emptyFieldDef","fieldDef","latLongDeprecated","newChannel","incompatibleChannel","markOrFacet","when","invalidEncodingChannel","facetChannelShouldBeDiscrete","discreteChannelCannotEncode","lineWithRange","hasX2","hasY2","unclearOrientContinuous","unclearOrientDiscreteOrEmpty","orientOverridden","original","actual","cannotUseScalePropertyWithNonColor","unaggregateDomainHasNoEffectForRawField","unaggregateDomainWithNonSharedDomainOp","unaggregatedDomainWithLogScale","cannotUseSizeFieldWithBandSize","positionChannel","cannotApplySizeToNonOrientedMark","rangeStepDropped","scaleTypeNotWorkWithChannel","defaultScaleType","scaleTypeNotWorkWithFieldDef","scalePropertyNotWorkWithScaleType","propName","scaleTypeNotWorkWithMark","mergeConflictingProperty","property","propertyOf","v1","v2","independentScaleMeansIndependentGuide","conflictedDomain","domainSortDropped","cannotStackRangedMark","cannotStackNonLinearScale","stackNonSummativeAggregate","invalidTimeUnit","unitName","dayReplacedWithDate","fullTimeUnit","droppedDay","INVALID_SPEC","FIT_NON_SINGLE","CANNOT_FIX_RANGE_STEP_WITH_FIT","SCALE_BINDINGS_CONTINUOUS","CONCAT_CANNOT_SHARE_AXIS","REPEAT_CANNOT_SHARE_AXIS","NO_FIELDS_NEEDS_AS","LINE_WITH_VARYING_SIZE","BAR_WITH_POINT_SCALE_AND_RANGESTEP_NULL","CANNOT_UNION_CUSTOM_DOMAIN_WITH_FIELD_DOMAIN","UNABLE_TO_MERGE_DOMAINS","MORE_THAN_ONE_SORT","INVALID_CHANNEL_FOR_AXIS","log$3","log_1","log_2","log_3","log_4","log_5","log_6","log_7","log_8","log$4","channel_1$1","log$5","scaleCompatible","scaleType1","scaleType2","scaleCategory1","SCALE_CATEGORY_INDEX","scaleCategory2","scaleTypePrecedence","SCALE_PRECEDENCE_INDEX","hasDiscreteDomain","DISCRETE_DOMAIN_INDEX","isBinScale","BIN_SCALES_INDEX","hasContinuousDomain","CONTINUOUS_DOMAIN_INDEX","isContinuousToContinuous","CONTINUOUS_TO_CONTINUOUS_INDEX","isExtendedScheme","scheme","isSelectionDomain","scaleTypeSupportProperty","channelScalePropertyIncompatability","channelSupportScaleType","ScaleType","LINEAR","BIN_LINEAR","LOG","POW","SQRT","TIME","UTC","SEQUENTIAL","QUANTILE","QUANTIZE","THRESHOLD","ORDINAL","BIN_ORDINAL","POINT","BAND","linear","sqrt","bin-linear","time","utc","sequential","ordinal","bin-ordinal","band","SCALE_TYPES","CONTINUOUS_TO_CONTINUOUS_SCALES","CONTINUOUS_DOMAIN_SCALES","DISCRETE_DOMAIN_SCALES","TIME_SCALE_TYPES","defaultScaleConfig","textXRangeStep","rangeStep","pointPadding","bandPaddingInner","facetSpacing","minBandSize","minFontSize","maxFontSize","minOpacity","maxOpacity","minSize","minStrokeWidth","maxStrokeWidth","SCALE_PROPERTY_INDEX","range","reverse","clamp","nice","interpolate","padding","paddingInner","paddingOuter","SCALE_PROPERTIES","NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTY_INDEX","NON_TYPE_DOMAIN_RANGE_VEGA_SCALE_PROPERTIES","scale$1","scale_1","scale_2","scale_3","scale_4","scale_5","scale_6","scale_7","scale_8","scale_9","scale_10","scale_11","scale_12","scale_13","scale_14","scale_15","scale_16","scale_17","scale_18","scale_19","scale_20","scale$2","legend","defaultLegendConfig","COMMON_LEGEND_PROPERTY_INDEX","entryPadding","VG_LEGEND_PROPERTY_INDEX","LEGEND_PROPERTIES","VG_LEGEND_PROPERTIES","legend$1","legend_1","legend_2","legend_3","legend$2","axis_1$1","scale_1$1","legend_1$1","isEncodingNestedProp","isEncodingTopLevelProperty","ENCODING_TOPLEVEL_PROP_INDEX","isEncodingNestedParent","ENCODING_NESTED_PROP_PARENT_INDEX","toKey","PROP_KEY_DELIMITER","fromKey","split","getEncodingNestedProp","ENCODING_NESTED_PROP_INDEX","isEncodingProperty","autoCount","bin","timeUnit","hasFn","stack","ENCODING_TOPLEVEL_PROPS","BIN_CHILD_PROPS","SORT_CHILD_PROPS","BIN_PROPS","SORT_PROPS","SCALE_PROPS","AXIS_PROPS","LEGEND_PROPS","ENCODING_NESTED_PROPS","VIEW_PROPS","ALL_ENCODING_PROPS","DEFAULT_PROP_PRECEDENCE","Property","MARK","TRANSFORM","STACK","FORMAT","CHANNEL","AGGREGATE","AUTOCOUNT","BIN","HAS_FN","TIMEUNIT","FIELD","TYPE","SORT","SCALE","AXIS","LEGEND","WIDTH","HEIGHT","BACKGROUND","PADDING","TITLE","property$1","property_1","property_2","property_3","property_4","property_5","property_6","property_7","property_8","property_9","property_10","property_11","property_12","property_13","property_14","property_15","property_16","property_17","property$2","util$4","strrep","truncateOnWord","rev","cnt","tok","truncate_word_re","w","trim","FNAME","namedfunc","equal","toMap","list","keystr","isBuffer","Buffer","field_re","mutator","$func","$valid","$length","$in","comparator","numcmp","stablesort","sortBy","keyFn","indices","sa","sb","permute","swap","random","pos","l1","l2","util_1$1","util_2$1","util_3$1","util_4$1","util_5$1","util_6$1","util_7$1","util_8$1","util_9$1","util$5","util$7","nestedMap","util$8","util_3$2","util_4$2","util_5$2","util_6$2","util_7$2","util_8$2","util_9$2","util_10$1","util_11$1","util_12$1","util_13$1","util_14$1","util_15$1","util_16$1","util$9","isMark","MARK_INDEX","isPathMark","isMarkDef","isPrimitiveMark","markType","PRIMITIVE_MARK_INDEX","Mark","AREA","BAR","LINE","RECT","RULE","TICK","TRAIL","CIRCLE","SQUARE","GEOSHAPE","PRIMITIVE_MARKS","STROKE_CONFIG","FILL_CONFIG","FILL_STROKE_CONFIG","VL_ONLY_MARK_CONFIG_PROPERTIES","VL_ONLY_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX","defaultMarkConfig","defaultBarConfig","binSpacing","continuousBandSize","defaultTickConfig","thickness","mark$1","mark_1","mark_2","mark_3","mark_4","mark_5","mark_6","mark_7","mark_8","mark_9","mark_10","mark_11","mark_12","mark_13","mark_14","mark_15","mark_16","mark_17","mark_18","mark_19","mark_20","mark_21","mark_22","mark_23","mark_24","mark_25","mark_26","mark$2","datetime","isDateTime","year","quarter","month","day","hours","minutes","seconds","milliseconds","normalizeQuarter","normalizeMonth","lowerM","toLowerCase","monthIndex","MONTHS","shortM","shortMonthIndex","SHORT_MONTHS","normalizeDay","lowerD","dayIndex","DAYS","shortD","shortDayIndex","SHORT_DAYS","dateTimeExpr","normalize","SUNDAY_YEAR","datetime$1","datetime_1","datetime_2","datetime_3","datetime_4","datetime_5","datetime_6","datetime$2","datetime_1$1","timeunit","isLocalSingleTimeUnit","LOCAL_SINGLE_TIMEUNIT_INDEX","isUtcSingleTimeUnit","UTC_SINGLE_TIMEUNIT_INDEX","isUTCTimeUnit","UTC_TIMEUNIT_INDEX","getLocalTimeUnit","isTimeUnit","TIMEUNIT_INDEX","convert","isUTC","TIMEUNIT_PARTS_1","TIMEUNIT_PARTS","timeUnitPart","containsTimeUnit","TimeUnit","DAY","QUARTER","dateMethods","getDateMethod_1","getDateMethod","setDateMethod_1","setDateMethod","singleUnit","isUtc","rawSetDateMethod","SET_DATE_METHOD","getTimeUnitParts","parts","part","SECONDS","fieldExpr","func","fieldRef","dateExpr","tu","formatExpression","shortTimeLabels","isUTCScale","dateComponents","expression","hasYear","YEAR","MONTH","DATE","timeComponents","HOURS","MINUTES","MILLISECONDS","dateTimeComponents","normalizeTimeUnit","YEARMONTH","YEARMONTHDATE","YEARMONTHDATEHOURS","YEARMONTHDATEHOURSMINUTES","YEARMONTHDATEHOURSMINUTESSECONDS","MONTHDATE","HOURSMINUTES","HOURSMINUTESSECONDS","MINUTESSECONDS","SECONDSMILLISECONDS","YEARQUARTER","QUARTERMONTH","YEARQUARTERMONTH","UTCYEAR","UTCMONTH","UTCDAY","UTCDATE","UTCHOURS","UTCMINUTES","UTCSECONDS","UTCMILLISECONDS","UTCYEARMONTH","UTCYEARMONTHDATE","UTCYEARMONTHDATEHOURS","UTCYEARMONTHDATEHOURSMINUTES","UTCYEARMONTHDATEHOURSMINUTESSECONDS","UTCMONTHDATE","UTCHOURSMINUTES","UTCHOURSMINUTESSECONDS","UTCMINUTESSECONDS","UTCSECONDSMILLISECONDS","UTCQUARTER","UTCYEARQUARTER","UTCQUARTERMONTH","UTCYEARQUARTERMONTH","utcyear","utcquarter","utcmonth","utcday","utcdate","utchours","utcminutes","utcseconds","utcmilliseconds","LOCAL_MULTI_TIMEUNIT_INDEX","yearquarter","yearquartermonth","yearmonth","yearmonthdate","yearmonthdatehours","yearmonthdatehoursminutes","yearmonthdatehoursminutesseconds","quartermonth","monthdate","hoursminutes","hoursminutesseconds","minutesseconds","secondsmilliseconds","UTC_MULTI_TIMEUNIT_INDEX","utcyearquarter","utcyearquartermonth","utcyearmonth","utcyearmonthdate","utcyearmonthdatehours","utcyearmonthdatehoursminutes","utcyearmonthdatehoursminutesseconds","utcquartermonth","utcmonthdate","utchoursminutes","utchoursminutesseconds","utcminutesseconds","utcsecondsmilliseconds","TIMEUNITS","timeunit$1","timeunit_1","timeunit_2","timeunit_3","timeunit_4","timeunit_5","timeunit_6","timeunit_7","timeunit_8","timeunit_9","timeunit_10","timeunit_11","timeunit_12","timeunit_13","timeunit_14","timeunit$2","isType","TYPE_INDEX","getFullName","QUANTITATIVE","TEMPORAL","NOMINAL","Type","GEOJSON","quantitative","temporal","nominal","geojson","type$1","type_1","type_2","type_3","type_4","type_5","type_6","type_7","type_8","type$2","property_1$1","util_1$2","mark_1$1","timeunit_1$1","type_1$1","wildcard","isWildcard","isShortWildcard","isWildcardDef","SHORT_WILDCARD","initWildcard","defaultName","defaultEnumValues","enum","initNestedPropName","fullNames","_loop_1","fullName","initialIndices","shortName","shortNameWithNo","fullNames_1","getDefaultName","DEFAULT_NAME","getDefaultEnumValues","schema","binProps","divide","sortProps","scaleProps","axisProps","legendProps","DEFAULT_BOOLEAN_ENUM","DEFAULT_BIN_PROPS_ENUM","extent","DEFAULT_SORT_PROPS","DEFAULT_SCALE_PROPS_ENUM","DEFAULT_AXIS_PROPS_ENUM","DEFAULT_LEGEND_PROPS_ENUM","DEFAULT_ENUM_INDEX","wildcard$1","wildcard_1","wildcard_2","wildcard_3","wildcard_4","wildcard_5","wildcard_6","wildcard_7","wildcard_8","wildcard_9","wildcard$2","wildcard_1$1","config","extendConfig","DEFAULT_QUERY_CONFIG","extendEnumIndex","enumIndex","enumOpt","extendNestedEnumIndex","verbose","defaultSpecConfig","useUnaggregatedDomain","propertyPrecedence","numberNominalProportion","numberNominalLimit","constraintManuallySpecifiedValue","autoAddCount","hasAppropriateGraphicTypeForMark","omitAggregate","omitAggregatePlotWithDimensionOnlyOnFacet","omitAggregatePlotWithoutDimension","omitBarLineAreaWithOcclusion","omitBarTickWithSize","omitMultipleNonPositionalChannels","omitRaw","omitRawContinuousFieldForAggregatePlot","omitRepeatedField","omitNonPositionalOrFacetOverPositionalChannels","omitTableWithOcclusionIfAutoAddCount","omitVerticalDotPlot","omitInvalidStackSpec","omitNonSumStack","preferredBinAxis","preferredTemporalAxis","preferredOrdinalAxis","preferredNominalAxis","preferredFacet","minCardinalityForBin","maxCardinalityForCategoricalColor","maxCardinalityForFacet","maxCardinalityForShape","timeUnitShouldHaveVariation","typeMatchesSchemaType","stylize","smallRangeStepForHighCardinalityOrFacet","maxCardinality","nominalColorScaleForHighCardinality","palette","xAxisOnTopForHighYCardinalityWithoutColumn","maxGoodCardinalityForFacet","maxGoodCardinalityForColor","minPercentUniqueForKey","minCardinalityForKey","config$1","config_1","config_2","config$2","isAggregateOp","AGGREGATE_OP_INDEX","isCountingAggregateOp","COUNTING_OPS","argmax","argmin","average","distinct","mean","median","missing","q1","q3","ci0","ci1","stderr","stdev","stdevp","sum","valid","variance","variancep","AGGREGATE_OPS","SUM_OPS","SHARED_DOMAIN_OPS","SHARED_DOMAIN_OP_INDEX","aggregate$1","aggregate_1","aggregate_2","aggregate_3","aggregate_4","aggregate_5","aggregate_6","aggregate_7","aggregate$2","binToString","autoMaxBins","bin$1","bin_1","bin_2","bin$2","aggregate_1$1","bin_1$1","fielddef","isConditionalSelection","isRepeatRef","toFieldDefBase","isConditionalDef","channelDef","condition","hasConditionalFieldDef","isFieldDef","hasConditionalValueDef","isValueDef","isStringFieldDef","isScaleFieldDef","vgField","prefix","suffix","isCount","nofn","binSuffix","expr","isDiscrete","verbalTitleFormatter","countTitle","functionalTitleFormatter","setTitleFormatter","formatter","titleFormatter","resetTitleFormatter","defaultTitleFormatter","defaultType","getFieldDef","primitiveType","normalizeFieldDef","fieldDefWithoutAggregate","normalizeBin","fullType","channelCompatibility","compatible","warning","COMPATIBLE","isNumberFieldDef","isTimeFieldDef","fieldTitle","fielddef$1","fielddef_1","fielddef_2","fielddef_3","fielddef_4","fielddef_5","fielddef_6","fielddef_7","fielddef_8","fielddef_9","fielddef_10","fielddef_11","fielddef_12","fielddef_13","fielddef_14","fielddef_15","fielddef_16","fielddef_17","fielddef_18","fielddef_19","fielddef_20","fielddef_21","fielddef_22","fielddef_23","fielddef_24","fielddef_25","fielddef_26","fielddef_27","fielddef_28","fielddef$2","expandedtype","fieldType","ExpandedType","expandedtype$1","expandedtype_1","expandedtype_2","expandedtype$2","type$3","specifiedType","scaleConfig","fieldDefMatchScaleType","type$4","type_2$1","type_3$1","type$5","fielddef_1$1","channelHasField","isAggregate","normalizeEncoding","normalizedEncoding","defs","newEncoding","isRanged","fieldDefs","def","mapping","init","r1","encoding$1","encoding_1","encoding_2","encoding_3","encoding_4","encoding_5","encoding_6","encoding_7","encoding$2","encoding_1$1","stack_1","isStackOffset","STACK_OFFSET_INDEX","potentialStackedChannel","xDef","yDef","stackConfig","STACKABLE_MARKS","fieldChannel","stackedFieldDef","stackedField","dimensionChannel","dimensionDef","dimensionField","stackBy","sc","cDef","STACK_BY_DEFAULT_MARKS","groupbyChannel","impute","center","stack_2","stack_3","stack_4","stack_5","stack$1","stack_1$1","encoding_1$2","spec","fromSpec","width","height","background","encodings","encQ","specQ","getVlStack","hasRequiredStackProperties","wildcardMode","getStackOffset","getStackChannel","requiredEncodingProps","exclude","encodings_1","objectContainsWildcard","childProp","hasWildcard","spec$1","spec_1","spec_2","spec_3","spec_4","spec_5","spec_6","spec_7","spec$2","propindex","PropIndex","setByKey","propindex$1","propindex_1","propindex$2","spec$3","propindex_1$1","shorthand","getReplacerIndex","replaceIndex","getReplacer","vlSpec","vlspec","include","INCLUDE_ALL","REPLACE_NONE","encQs","VIEW_PROPS_1","viewProp","propString","value_1","fieldDefStr","fieldAndParams","fieldDefProps","typeShort","fnPrefix","fieldQ","localeCompare","parent_1","PROPERTY_SUPPORTED_CHANNELS","parentValue","nestedPropChildren","nestedProp","nestedPropObject","splitShorthand","splitPart","splitWithTail","splitPartKey","splitPartValue","shorthandParser","delim","indexOfDelim","pi","fieldDefShorthand","encQMixins","rawFieldDef","fieldDefPart","partParams","closingBraceIndex","propEqualSignIndex","parsedValue","openingBraceIndex","getClosingIndex","value_2","openingBracketIndex","closingBracketIndex","value_3","propIndex","nextCommaIndex","closingChar","fnEnumIndex","encodingProperty","func_1","insideFn","insideFnParts","shorthand$1","shorthand_1","shorthand_2","shorthand_3","shorthand_4","shorthand_5","shorthand_6","shorthand_7","shorthand_8","shorthand_9","shorthand_10","shorthand_11","shorthand_12","shorthand_13","shorthand_14","shorthand$2","expandedtype_1$1","type_2$2","shorthand_1$1","params","encQs_1","valueQ","DEFAULT_PROPS","isSupportedByChannel","ordinalDomain","fieldSchema","vegaLiteType","PARSERS","boolean","integer","all","parsers","type_1$2","type_2$3","type$7","generate","gen","zeros","Infinity","uniform","samples","pdf","cdf","icdf","NaN","normal","rds","PI","cd","z","Z","abs","SQRT2","bootstrap","smooth","err","generate$1","type$8","stats_1","ztest1","nullH","nullh","gaussian","mu","stats","SE","ztestP","n2","diffs","ztest2","meanDiff","quantile","quartile","H","geometric","harmonic","M2","modeskew","avg","med","std","dot","dist","L2","cohensd","x1","s1","s2","covariance","vx","vy","xm","ym","rank","tie","cor","mua","mub","sda","sdb","ra","rb","aa","bb","ab","A","mat","B","linearRegression","res","xy","sx","sy","slope","icept","fit","intercept","R","rss","ci","N","alpha","bs","means","paired","M","entropy","counts","LN2","mutual","px","py","I","profile","sd","summary","__summary__","stats_2","d3Time","newInterval","floori","offseti","interval","end","t0","t1","weekday","setHours","setDate","getDate","getDay","getTimezoneOffset","utcWeekday","setUTCHours","setUTCDate","getUTCDate","getUTCDay","millisecond","second","setMilliseconds","getSeconds","minute","setSeconds","getMinutes","hour","setMinutes","getHours","sunday","monday","tuesday","wednesday","thursday","friday","saturday","setMonth","getMonth","getFullYear","setFullYear","utcSecond","setUTCMilliseconds","getUTCSeconds","utcMinute","setUTCSeconds","getUTCMinutes","utcHour","setUTCMinutes","getUTCHours","utcDay","utcSunday","utcMonday","utcTuesday","utcWednesday","utcThursday","utcFriday","utcSaturday","utcMonth","setUTCMonth","getUTCMonth","getUTCFullYear","utcYear","setUTCFullYear","days","sundays","mondays","tuesdays","wednesdays","thursdays","fridays","saturdays","weeks","months","years","utcMillisecond","utcMilliseconds","utcSeconds","utcMinutes","utcHours","utcDays","utcSundays","utcMondays","utcTuesdays","utcWednesdays","utcThursdays","utcFridays","utcSaturdays","utcWeeks","utcMonths","utcYears","version","week","utcWeek","d3Time$1","d3_time","baseDate","utcBaseDate","locale","utc_1","time$1","time$2","dmin","dmax","minbins","bins_1","bins$1","stats_1$1","dlBin_","config_1$1","build","tableSchema","summaries","tableSchemaFieldIndex","fieldSchemas","fieldProfile","vlType","PrimitiveType","DATETIME","NUMBER","INTEGER","data_1","dataEntry","getTime","originalIndex","timeStats","binStats","orgFieldSchema","fieldSchemas_1","binSummary","_d","timeSummary","derivedTableSchema","Schema","dlBin","binUnique","dateString","oldUnique","newUnique","bucket","Number","invalidCount","prev","cur","_tableSchema","_fieldSchemaIndex","enumerable","configurable","cardinality","augmentTimeUnitDomain","excludeInvalid","timeUnitHasVariation","dateEncQ","singleUnitEncQ","fieldQueryParts","schema$1","schema_1","schema_2","schema_3","schema$2","AbstractConstraintModel","constraint","description","properties","strict","EncodingConstraintModel","_super","hasAllRequiredPropertiesSpecific","satisfy","encWildcardIndex","allowWildcardForProperties","base$1","base_1","base_2","base$2","schema_1$1","base_1$1","field$1","FIELD_CONSTRAINTS","___","fieldQwithoutBin","numFn","sType","scaleProp","sProp","isSupported","BOOLEAN","STRING","ec","FIELD_CONSTRAINT_INDEX","FIELD_CONSTRAINTS_BY_PROPERTY","field$2","field_1","field_2","field_3","field$3","value$3","VALUE_CONSTRAINTS","VALUE_CONSTRAINT_INDEX","VALUE_CONSTRAINTS_BY_PROPERTY","value$4","value$5","field_1$1","value_1$1","encoding$6","checkEncoding","specM","encodingConstraints","getEncodingQueryByIndex","encodingConstraints_1","wildcardIndex","violatedConstraint","toShorthand","valueContraints","valueContraints_1","encoding$7","encoding_2$2","encoding$8","spec$4","checkSpec","specConstraints","SPEC_CONSTRAINTS_BY_PROPERTY","specConstraints_1","NONPOSITION_CHANNELS_INDEX","SpecConstraintModel","specConstraint","getMark","child_1","getEncodings","SPEC_CONSTRAINTS","usedChannel","hasAutoCount","autoCountEncIndex","encodingIndicesByProperty","neverHaveAutoCount","channelUsed","hasProperty","hasNonFacetDim_1","hasDim_1","hasEnumeratedFacetDim_1","specQuery","hasEncodingProperty","channelEncodingField","encodings_2","nonPositionChannelCount","hasEnumeratedNonPositionChannel","hasNonPositionalChannelOrFacet","hasEnumeratedNonPositionOrFacetChannel","hasX","hasY","fieldUsed","fieldEnumerated","xEncQ_1","getEncodingQueryByChannel","yEncQ_1","xIsMeasure","yIsMeasure","xEncQ_2","yEncQ_2","xEncQ","yEncQ","xIsDimension","yIsDimension","colorEncQ","colorIsQuantitative","colorIsOrdinal","correctChannels","correctColor","stackProps","specStack","stackParentEncQ","SPEC_CONSTRAINT_INDEX","spec$5","spec_1$1","spec_2$1","spec_3$1","spec_4$1","spec$6","encoding$9","spec$7","index$1","constraint_1","constraint_2","constraint$1","enumerator","getEnumerator","ENUMERATOR_INDEX","EncodingPropertyGeneratorFactory","answerSet","enumerate","jobIndex","propWildcard","getEncodingProperty","propVal","setEncodingProperty","violatedEncodingConstraint","violatedSpecConstraint","resetEncodingProperty","markWildcard","setMark","resetMark","enumerator$1","enumerator_1","enumerator_2","enumerator$2","wildcardindex","WildcardIndex","_mark","_encodings","_encodingIndicesByProperty","encodingsIndex","encIndex","indicesByProp","isEmpty","wildcardindex$1","wildcardindex_1","wildcardindex$2","groupby","isExtendedGroupBy","parseGroupBy","groupBy","grpBy","replaceIndex_1","valFrom","valTo","valsFrom","REPLACE_BLANK_FIELDS","*","REPLACE_XY_CHANNELS","REPLACE_FACET_CHANNELS","REPLACE_MARK_STYLE_CHANNELS","GROUP_BY_FIELD_TRANSFORM","GROUP_BY_ENCODING","groupby$1","groupby_1","groupby_2","groupby_3","groupby_4","groupby_5","groupby_6","groupby_7","groupby_8","groupby$2","nest_1","registerKeyFn","groupRegistry","nest","specModels","queryNest","rootGroup_1","items","groupIndex_1","includes_1","replaces","replacers_1","groupBy$$1","parsedGroupBy","group","orderGroupBy","getGroupByKey","FIELD_TRANSFORM","ENCODING","SPEC","GROUP_BY_FIELD","PARSED_GROUP_BY_FIELD","PARSED_GROUP_BY_FIELD_TRANSFORM","PARSED_GROUP_BY_ENCODING","nest_2","nest_3","nest_4","nest_5","nest_6","nest_7","nest_8","nest_9","nest_10","nest$1","wildcardindex_1$1","nest_1$1","model","SpecQueryModel","wildcardAssignment","_rankingScore","_spec","_channelFieldCount","_wildcardIndex","_assignedWildcardIndex","_opt","_schema","name_1","defaultWildcardName","propObj","countEncQ","encodingQuery","specEncoding","toSpec","getRankingScore","rankingName","setRankingScore","score","model$1","model_1","model$2","transform$1","transform$2","normalize_1","orderBy","normalizedQ","chooseBy","normalize_2","normalize$1","transform$3","normalize_1$1","query","index$2","query_1","query_2","query_3","query_4","query_5","query_6","query$1","isResultTree","getTopResultTreeItem","topItem","mapLeaves","result$1","result_1","result_2","result_3","result$2","type$9","getExtendedType","ExtendedType","BIN_Q","TIMEUNIT_O","TIMEUNIT_T","Q","T","O","K","NONE","type$10","type_2$4","type_3$2","type_4$1","type_5$1","type_6$1","type_7$1","type_8$1","type_9","type_10","type_11","type_12","type$11","base$3","Scorer","scoreIndex","initScore","getFeatureScore","feature","base$4","base_1$2","base$5","type_1$3","base_1$3","axis$3","AxisScorer","preferredAxes","pAxis","featurize","getScore","_this","features","featureScore","axis$4","axis_1$2","axis$5","dimension","DimensionScorer","maxFScore","dimension$1","dimension_1","dimension$2","facet","FacetScorer","facet$1","facet_1","facet$2","sizechannel","SizeChannelScorer","bar_size","tick_size","featureScores","sizechannel$1","sizechannel_1","sizechannel$2","typechannel","TERRIBLE","TypeChannelScorer","SCORE","CONTINUOUS_TYPE_CHANNEL_SCORE","ORDERED_TYPE_CHANNEL_SCORE","NOMINAL_TYPE_CHANNEL_SCORE","encodingQueryByField","fieldKey","bestFieldFeature","best","typechannel$1","typechannel_1","typechannel_2","typechannel$2","mark$3","xType","yType","hasOcclusion","MEASURES","DISCRETE","DISCRETE_OR_NONE","occludedQQMark","noOccludedQQMark","occludedDimensionMeasureMark","feature2","noOccludedQxN","noOccludedQxBinQ","ttMark","tdMark","ddMark","MarkScorer","isOccluded","mark$4","mark_2$1","mark_3$1","mark$5","axis_1$3","dimension_1$1","facet_1$1","sizechannel_1$1","typechannel_1$1","mark_1$2","effectiveness_1","effectiveness","SCORERS","scorer","scores","index$3","effectiveness_2","aggregation","aggregationQualityFeature","isRawContinuous","hasCount","hasBin","aggregation$1","aggregation_1","aggregation_2","aggregation$2","fieldorder","fieldWildcardIndices","numFields","totalScore","fieldWildcard","fieldIndex","score_1","fieldorder$1","fieldorder_1","fieldorder_2","fieldorder$2","result_1$1","effectiveness_1$1","aggregation$3","fieldOrder","ranking","__export","register","rankingRegistry","subgroup","groupComparatorFactory","comparatorFactory","m1","m2","getScoreDifference","g1","g2","scoreDifference","EFFECTIVENESS","ranking$1","ranking_1","ranking_2","ranking_3","ranking_4","ranking_5","ranking_6","ranking_7","ranking_8","ranking_9","ranking$2","stylize_1","encQIndex","yScaleType","xScaleType","stylize_2","stylize_3","stylize_4","stylize_5","stylize$1","enumerator_1$1","model_1$1","stylize_1$1","generate_1","propKey","reducer","generate$2","generate_2","generate$3","generate_1$1","ranking_1$1","recommend_1","recommend","nestedAnswerSet","recommend_2","recommend$1","unpkg","jsdelivr","module$1","typings","directories","scripts","prebuild","build:examples","build:examples-only","postbuild","deploy","lint","test:inspect","check:examples","watch:build","watch:test","repository","url","keywords","author","collaborators","license","bugs","homepage","devDependencies","@types/chai","@types/d3","@types/jest","chai","codecov","concurrently","d3","exorcist","jest","rollup","rollup-plugin-commonjs","rollup-plugin-json","rollup-plugin-node-resolve","source-map-support","ts-jest","tslint","typescript","uglify-js","vega-datasets","dependencies","datalib","typescript-json-schema","vega-lite","vega-typings","^.+\\.tsx?$","testRegex","moduleFileExtensions","testPathIgnorePatterns","coverageDirectory","collectCoverage","_package","_package$1","constraint$2","query$2","recommend_1$1","package_json_1","index$4","src_2","src_3","src_4","src_5","src_6","src_7","src_8","src_9","src_10","src_11","src_12","src_13","src_14","src_15"],"mappings":"CAAC,SAAUA,EAAQC,GACC,gBAAZC,UAA0C,mBAAXC,QAAyBF,EAAQC,SACrD,kBAAXE,SAAyBA,OAAOC,IAAMD,QAAQ,WAAYH,GAChEA,EAASD,EAAOM,SAChBC,KAAM,SAAWL,GAAW,YAqB7B,SAASM,GAAeC,GACvB,MAAOA,IAAKA,EAAEC,YAAcC,OAAOC,UAAUC,eAAeC,KAAKL,EAAG,WAAaA,EAAE,WAAaA,EAGjG,QAASM,GAAqBC,EAAIb,GACjC,MAAOA,IAAWD,YAAec,EAAGb,EAAQA,EAAOD,SAAUC,EAAOD,QAuBrE,QAASe,GAAUC,EAAGC,GAElB,QAASC,KAAOb,KAAKc,YAAcH,EADnCI,GAAcJ,EAAGC,GAEjBD,EAAEN,UAAkB,OAANO,EAAaR,OAAOY,OAAOJ,IAAMC,EAAGR,UAAYO,EAAEP,UAAW,GAAIQ,IAWnF,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GAAQx/D,GAAIouD,MACZqR,GAAQz/D,GAAIk4D,QACZwH,GAAS1/D,GAAIpa,OACb+5E,GAAS3/D,GAAIw1B,OACboqC,GAAS5/D,GAAIzB,KACbshE,GAAS7/D,GAAIiuC,SACb6xB,GAAS9/D,GAAIg7D,UACb+E,GAAS//D,GAAIk6C,OAEjBr4D,GAAAA,WAAkBo9E,GAClBp9E,EAAQs1C,OAASl3B,GACjBpe,EAAQ28D,WAAa0gB,GACrBr9E,EAAQ2kE,UAAY2Y,GACpBt9E,EAAQuyC,SAAWgrC,GACnBv9E,EAAQqqE,MAAQmT,GAChBx9E,EAAQooE,KAAOqV,GACfz9E,EAAQ6vB,SAAW6tD,GACnB19E,EAAQusE,MAAQoR,GAChB39E,EAAQq2E,QAAUuH,GAClB59E,EAAQ+D,OAAS85E,GACjB79E,EAAQ2zC,OAASmqC,GACjB99E,EAAQ0c,KAAOqhE,GACf/9E,EAAQosD,SAAW4xB,GACnBh+E,EAAQm5E,UAAY8E,GACpBj+E,EAAQq4D,QAAU6lB,GAElBz9E,OAAOiC,eAAe1C,EAAS,cAAgB2D,OAAO"} \ No newline at end of file diff --git a/build/src/constraint/base.js b/build/src/constraint/base.js new file mode 100644 index 00000000..1b69b4b3 --- /dev/null +++ b/build/src/constraint/base.js @@ -0,0 +1,72 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var property_1 = require("../property"); +var wildcard_1 = require("../wildcard"); +var util_1 = require("../util"); +/** + * Abstract model for a constraint. + */ +var AbstractConstraintModel = /** @class */ (function () { + function AbstractConstraintModel(constraint) { + this.constraint = constraint; + } + AbstractConstraintModel.prototype.name = function () { + return this.constraint.name; + }; + AbstractConstraintModel.prototype.description = function () { + return this.constraint.description; + }; + AbstractConstraintModel.prototype.properties = function () { + return this.constraint.properties; + }; + AbstractConstraintModel.prototype.strict = function () { + return this.constraint.strict; + }; + return AbstractConstraintModel; +}()); +exports.AbstractConstraintModel = AbstractConstraintModel; +var EncodingConstraintModel = /** @class */ (function (_super) { + __extends(EncodingConstraintModel, _super); + function EncodingConstraintModel(constraint) { + return _super.call(this, constraint) || this; + } + EncodingConstraintModel.prototype.hasAllRequiredPropertiesSpecific = function (encQ) { + return util_1.every(this.constraint.properties, function (prop) { + if (property_1.isEncodingNestedProp(prop)) { + var parent_1 = prop.parent; + var child = prop.child; + if (!encQ[parent_1]) { + return true; + } + return !wildcard_1.isWildcard(encQ[parent_1][child]); + } + if (!encQ[prop]) { + return true; + } + return !wildcard_1.isWildcard(encQ[prop]); + }); + }; + EncodingConstraintModel.prototype.satisfy = function (encQ, schema, encWildcardIndex, opt) { + // TODO: Re-order logic to optimize the "allowWildcardForProperties" check + if (!this.constraint.allowWildcardForProperties) { + // TODO: extract as a method and do unit test + if (!this.hasAllRequiredPropertiesSpecific(encQ)) { + return true; + } + } + return this.constraint.satisfy(encQ, schema, encWildcardIndex, opt); + }; + return EncodingConstraintModel; +}(AbstractConstraintModel)); +exports.EncodingConstraintModel = EncodingConstraintModel; +//# sourceMappingURL=base.js.map \ No newline at end of file diff --git a/build/src/constraint/encoding.js b/build/src/constraint/encoding.js new file mode 100644 index 00000000..53a9593e --- /dev/null +++ b/build/src/constraint/encoding.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var encoding_1 = require("../query/encoding"); +var field_1 = require("./field"); +var value_1 = require("./value"); +/** + * Check all encoding constraints for a particular property and index tuple + */ +function checkEncoding(prop, wildcard, index, specM, schema, opt) { + // Check encoding constraint + var encodingConstraints = field_1.FIELD_CONSTRAINTS_BY_PROPERTY.get(prop) || []; + var encQ = specM.getEncodingQueryByIndex(index); + for (var _i = 0, encodingConstraints_1 = encodingConstraints; _i < encodingConstraints_1.length; _i++) { + var c = encodingConstraints_1[_i]; + // Check if the constraint is enabled + if (c.strict() || !!opt[c.name()]) { + // For strict constraint, or enabled non-strict, check the constraints + var satisfy = c.satisfy(encQ, schema, specM.wildcardIndex.encodings[index], opt); + if (!satisfy) { + var violatedConstraint = '(enc) ' + c.name(); + /* istanbul ignore if */ + if (opt.verbose) { + console.log(violatedConstraint + ' failed with ' + specM.toShorthand() + ' for ' + wildcard.name); + } + return violatedConstraint; + } + } + } + var valueContraints = value_1.VALUE_CONSTRAINTS_BY_PROPERTY.get(prop) || []; + for (var _a = 0, valueContraints_1 = valueContraints; _a < valueContraints_1.length; _a++) { + var c = valueContraints_1[_a]; + // Check if the constraint is enabled + if ((c.strict() || !!opt[c.name()]) && encoding_1.isValueQuery(encQ)) { + // For strict constraint, or enabled non-strict, check the constraints + var satisfy = c.satisfy(encQ, schema, specM.wildcardIndex.encodings[index], opt); + if (!satisfy) { + var violatedConstraint = '(enc) ' + c.name(); + /* istanbul ignore if */ + if (opt.verbose) { + console.log(violatedConstraint + ' failed with ' + specM.toShorthand() + ' for ' + wildcard.name); + } + return violatedConstraint; + } + } + } + return null; +} +exports.checkEncoding = checkEncoding; +//# sourceMappingURL=encoding.js.map \ No newline at end of file diff --git a/build/src/constraint/field.js b/build/src/constraint/field.js new file mode 100644 index 00000000..cbdcd62d --- /dev/null +++ b/build/src/constraint/field.js @@ -0,0 +1,369 @@ +"use strict"; +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var channel_1 = require("vega-lite/build/src/channel"); +var fielddef_1 = require("vega-lite/build/src/fielddef"); +var scale_1 = require("vega-lite/build/src/scale"); +var type_1 = require("vega-lite/build/src/type"); +var expandedtype_1 = require("../query/expandedtype"); +var property_1 = require("../property"); +var propindex_1 = require("../propindex"); +var wildcard_1 = require("../wildcard"); +var schema_1 = require("../schema"); +var util_1 = require("../util"); +var encoding_1 = require("../query/encoding"); +var base_1 = require("./base"); +exports.FIELD_CONSTRAINTS = [ + { + name: 'aggregateOpSupportedByType', + description: 'Aggregate function should be supported by data type.', + properties: [property_1.Property.TYPE, property_1.Property.AGGREGATE], + allowWildcardForProperties: false, + strict: true, + satisfy: function (fieldQ, _, __, ___) { + if (fieldQ.aggregate) { + return !expandedtype_1.isDiscrete(fieldQ.type); + } + // TODO: some aggregate function are actually supported by ordinal + return true; // no aggregate is okay with any type. + } + }, { + name: 'asteriskFieldWithCountOnly', + description: 'Field="*" should be disallowed except aggregate="count"', + properties: [property_1.Property.FIELD, property_1.Property.AGGREGATE], + allowWildcardForProperties: false, + strict: true, + satisfy: function (fieldQ, _, __, ___) { + return (fieldQ.field === '*') === (fieldQ.aggregate === 'count'); + } + }, { + name: 'minCardinalityForBin', + description: 'binned quantitative field should not have too low cardinality', + properties: [property_1.Property.BIN, property_1.Property.FIELD, property_1.Property.TYPE], + allowWildcardForProperties: false, + strict: true, + satisfy: function (fieldQ, schema, _, opt) { + if (fieldQ.bin && fieldQ.type === type_1.Type.QUANTITATIVE) { + // We remove bin so schema can infer the raw unbinned cardinality. + var fieldQwithoutBin = { channel: fieldQ.channel, field: fieldQ.field, type: fieldQ.type }; + return schema.cardinality(fieldQwithoutBin) >= opt.minCardinalityForBin; + } + return true; + } + }, { + name: 'binAppliedForQuantitative', + description: 'bin should be applied to quantitative field only.', + properties: [property_1.Property.TYPE, property_1.Property.BIN], + allowWildcardForProperties: false, + strict: true, + satisfy: function (fieldQ, _, __, ___) { + if (fieldQ.bin) { + // If binned, the type must be quantitative + return fieldQ.type === type_1.Type.QUANTITATIVE; + } + return true; + } + }, { + name: 'channelFieldCompatible', + description: "encoding channel's range type be compatible with channel type.", + properties: [property_1.Property.CHANNEL, property_1.Property.TYPE, property_1.Property.BIN, property_1.Property.TIMEUNIT], + allowWildcardForProperties: false, + strict: true, + satisfy: function (fieldQ, schema, encWildcardIndex, opt) { + var fieldDef = __assign({ field: 'f' }, encoding_1.toFieldDef(fieldQ, { schema: schema, props: ['bin', 'timeUnit', 'type'] })); + return fielddef_1.channelCompatibility(fieldDef, fieldQ.channel).compatible; + } + }, { + name: 'hasFn', + description: 'A field with as hasFn flag should have one of aggregate, timeUnit, or bin.', + properties: [property_1.Property.AGGREGATE, property_1.Property.BIN, property_1.Property.TIMEUNIT], + allowWildcardForProperties: true, + strict: true, + satisfy: function (fieldQ, _, __, ___) { + if (fieldQ.hasFn) { + return !!fieldQ.aggregate || !!fieldQ.bin || !!fieldQ.timeUnit; + } + return true; + } + }, { + name: 'omitScaleZeroWithBinnedField', + description: 'Do not use scale zero with binned field', + properties: [property_1.Property.SCALE, property_1.getEncodingNestedProp('scale', 'zero'), property_1.Property.BIN], + allowWildcardForProperties: false, + strict: true, + satisfy: function (fieldQ, _, __, ___) { + if (fieldQ.bin && fieldQ.scale) { + if (fieldQ.scale.zero === true) { + return false; + } + } + return true; + } + }, { + name: 'onlyOneTypeOfFunction', + description: 'Only of of aggregate, autoCount, timeUnit, or bin should be applied at the same time.', + properties: [property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT, property_1.Property.TIMEUNIT, property_1.Property.BIN], + allowWildcardForProperties: true, + strict: true, + satisfy: function (fieldQ, _, __, ___) { + if (encoding_1.isFieldQuery(fieldQ)) { + var numFn = (!wildcard_1.isWildcard(fieldQ.aggregate) && !!fieldQ.aggregate ? 1 : 0) + + (!wildcard_1.isWildcard(fieldQ.bin) && !!fieldQ.bin ? 1 : 0) + + (!wildcard_1.isWildcard(fieldQ.timeUnit) && !!fieldQ.timeUnit ? 1 : 0); + return numFn <= 1; + } + // For autoCount there is always only one type of function + return true; + } + }, { + name: 'timeUnitAppliedForTemporal', + description: 'Time unit should be applied to temporal field only.', + properties: [property_1.Property.TYPE, property_1.Property.TIMEUNIT], + allowWildcardForProperties: false, + strict: true, + satisfy: function (fieldQ, _, __, ___) { + if (fieldQ.timeUnit && fieldQ.type !== type_1.Type.TEMPORAL) { + return false; + } + return true; + } + }, { + name: 'timeUnitShouldHaveVariation', + description: 'A particular time unit should be applied only if they produce unique values.', + properties: [property_1.Property.TIMEUNIT, property_1.Property.TYPE], + allowWildcardForProperties: false, + strict: false, + satisfy: function (fieldQ, schema, encWildcardIndex, opt) { + if (fieldQ.timeUnit && fieldQ.type === type_1.Type.TEMPORAL) { + if (!encWildcardIndex.has('timeUnit') && !opt.constraintManuallySpecifiedValue) { + // Do not have to check this as this is manually specified by users. + return true; + } + return schema.timeUnitHasVariation(fieldQ); + } + return true; + } + }, { + name: 'scalePropertiesSupportedByScaleType', + description: 'Scale properties must be supported by correct scale type', + properties: [].concat(property_1.SCALE_PROPS, [property_1.Property.SCALE, property_1.Property.TYPE]), + allowWildcardForProperties: true, + strict: true, + satisfy: function (fieldQ, _, __, ___) { + if (fieldQ.scale) { + var scale = fieldQ.scale; + // If fieldQ.type is an Wildcard and scale.type is undefined, it is equivalent + // to scale type is Wildcard. If scale type is an Wildcard, we do not yet know + // what the scale type is, and thus can ignore the constraint. + var sType = encoding_1.scaleType(fieldQ); + if (sType === undefined || sType === null) { + // If still ambiguous, doesn't check the constraint + return true; + } + for (var scaleProp in scale) { + if (scaleProp === 'type' || scaleProp === 'name' || scaleProp === 'enum') { + // ignore type and properties of wildcards + continue; + } + var sProp = scaleProp; + if (sType === 'point') { + // HACK: our current implementation of scaleType() can return point + // when the scaleType is a band since we didn't pass all parameter to Vega-Lite's scale type method. + if (!scale_1.scaleTypeSupportProperty('point', sProp) && !scale_1.scaleTypeSupportProperty('band', sProp)) { + return false; + } + } + else if (!scale_1.scaleTypeSupportProperty(sType, sProp)) { + return false; + } + } + } + return true; + } + }, { + name: 'scalePropertiesSupportedByChannel', + description: 'Not all scale properties are supported by all encoding channels', + properties: [].concat(property_1.SCALE_PROPS, [property_1.Property.SCALE, property_1.Property.CHANNEL]), + allowWildcardForProperties: true, + strict: true, + satisfy: function (fieldQ, _, __, ___) { + if (fieldQ) { + var channel = fieldQ.channel; + var scale = fieldQ.scale; + if (channel && !wildcard_1.isWildcard(channel) && scale) { + if (channel === 'row' || channel === 'column') { + // row / column do not have scale + return false; + } + for (var scaleProp in scale) { + if (!scale.hasOwnProperty(scaleProp)) + continue; + if (scaleProp === 'type' || scaleProp === 'name' || scaleProp === 'enum') { + // ignore type and properties of wildcards + continue; + } + var isSupported = scale_1.channelScalePropertyIncompatability(channel, scaleProp) === undefined; + if (!isSupported) { + return false; + } + } + } + } + return true; + } + }, { + name: 'typeMatchesPrimitiveType', + description: 'Data type should be supported by field\'s primitive type.', + properties: [property_1.Property.FIELD, property_1.Property.TYPE], + allowWildcardForProperties: false, + strict: true, + satisfy: function (fieldQ, schema, encWildcardIndex, opt) { + if (fieldQ.field === '*') { + return true; + } + var primitiveType = schema.primitiveType(fieldQ.field); + var type = fieldQ.type; + if (!encWildcardIndex.has('field') && !encWildcardIndex.has('type') && !opt.constraintManuallySpecifiedValue) { + // Do not have to check this as this is manually specified by users. + return true; + } + switch (primitiveType) { + case schema_1.PrimitiveType.BOOLEAN: + case schema_1.PrimitiveType.STRING: + return type !== type_1.Type.QUANTITATIVE && type !== type_1.Type.TEMPORAL; + case schema_1.PrimitiveType.NUMBER: + case schema_1.PrimitiveType.INTEGER: + return type !== type_1.Type.TEMPORAL; + case schema_1.PrimitiveType.DATETIME: + // TODO: add NOMINAL, ORDINAL support after we support this in Vega-Lite + return type === type_1.Type.TEMPORAL; + case null: + // field does not exist in the schema + return false; + } + throw new Error('Not implemented'); + } + }, + { + name: 'typeMatchesSchemaType', + description: 'Enumerated data type of a field should match the field\'s type in the schema.', + properties: [property_1.Property.FIELD, property_1.Property.TYPE], + allowWildcardForProperties: false, + strict: false, + satisfy: function (fieldQ, schema, encWildcardIndex, opt) { + if (!encWildcardIndex.has('field') && !encWildcardIndex.has('type') && !opt.constraintManuallySpecifiedValue) { + // Do not have to check this as this is manually specified by users. + return true; + } + if (fieldQ.field === '*') { + return fieldQ.type === type_1.Type.QUANTITATIVE; + } + return schema.vlType(fieldQ.field) === fieldQ.type; + } + }, { + name: 'maxCardinalityForCategoricalColor', + description: 'Categorical channel should not have too high cardinality', + properties: [property_1.Property.CHANNEL, property_1.Property.FIELD], + allowWildcardForProperties: false, + strict: false, + satisfy: function (fieldQ, schema, _, opt) { + // TODO: missing case where ordinal / temporal use categorical color + // (once we do so, need to add Property.BIN, Property.TIMEUNIT) + if (fieldQ.channel === channel_1.Channel.COLOR && (fieldQ.type === type_1.Type.NOMINAL || fieldQ.type === expandedtype_1.ExpandedType.KEY)) { + return schema.cardinality(fieldQ) <= opt.maxCardinalityForCategoricalColor; + } + return true; // other channel is irrelevant to this constraint + } + }, { + name: 'maxCardinalityForFacet', + description: 'Row/column channel should not have too high cardinality', + properties: [property_1.Property.CHANNEL, property_1.Property.FIELD, property_1.Property.BIN, property_1.Property.TIMEUNIT], + allowWildcardForProperties: false, + strict: false, + satisfy: function (fieldQ, schema, _, opt) { + if (fieldQ.channel === channel_1.Channel.ROW || fieldQ.channel === channel_1.Channel.COLUMN) { + return schema.cardinality(fieldQ) <= opt.maxCardinalityForFacet; + } + return true; // other channel is irrelevant to this constraint + } + }, { + name: 'maxCardinalityForShape', + description: 'Shape channel should not have too high cardinality', + properties: [property_1.Property.CHANNEL, property_1.Property.FIELD, property_1.Property.BIN, property_1.Property.TIMEUNIT], + allowWildcardForProperties: false, + strict: false, + satisfy: function (fieldQ, schema, _, opt) { + if (fieldQ.channel === channel_1.Channel.SHAPE) { + return schema.cardinality(fieldQ) <= opt.maxCardinalityForShape; + } + return true; // other channel is irrelevant to this constraint + } + }, + { + name: 'dataTypeAndFunctionMatchScaleType', + description: 'Scale type must match data type', + properties: [property_1.Property.TYPE, property_1.Property.SCALE, property_1.getEncodingNestedProp('scale', 'type'), property_1.Property.TIMEUNIT, property_1.Property.BIN], + allowWildcardForProperties: false, + strict: true, + satisfy: function (fieldQ, _, __, ___) { + if (fieldQ.scale) { + var type = fieldQ.type; + var sType = encoding_1.scaleType(fieldQ); + if (expandedtype_1.isDiscrete(type)) { + return sType === undefined || scale_1.hasDiscreteDomain(sType); + } + else if (type === type_1.Type.TEMPORAL) { + if (!fieldQ.timeUnit) { + return util_1.contains([scale_1.ScaleType.TIME, scale_1.ScaleType.UTC, undefined], sType); + } + else { + return util_1.contains([scale_1.ScaleType.TIME, scale_1.ScaleType.UTC, undefined], sType) || scale_1.hasDiscreteDomain(sType); + } + } + else if (type === type_1.Type.QUANTITATIVE) { + if (fieldQ.bin) { + return util_1.contains([scale_1.ScaleType.LINEAR, undefined], sType); + } + else { + return util_1.contains([scale_1.ScaleType.LOG, scale_1.ScaleType.POW, scale_1.ScaleType.SQRT, scale_1.ScaleType.QUANTILE, scale_1.ScaleType.QUANTIZE, scale_1.ScaleType.LINEAR, undefined], sType); + } + } + } + return true; + } + }, + { + name: 'stackIsOnlyUsedWithXY', + description: 'stack should only be allowed for x and y channels', + properties: [property_1.Property.STACK, property_1.Property.CHANNEL], + allowWildcardForProperties: false, + strict: true, + satisfy: function (fieldQ, _, __, ___) { + if (!!fieldQ.stack) { + return fieldQ.channel === channel_1.Channel.X || fieldQ.channel === channel_1.Channel.Y; + } + return true; + } + } +].map(function (ec) { return new base_1.EncodingConstraintModel(ec); }); +exports.FIELD_CONSTRAINT_INDEX = exports.FIELD_CONSTRAINTS.reduce(function (m, ec) { + m[ec.name()] = ec; + return m; +}, {}); +exports.FIELD_CONSTRAINTS_BY_PROPERTY = exports.FIELD_CONSTRAINTS.reduce(function (index, c) { + for (var _i = 0, _a = c.properties(); _i < _a.length; _i++) { + var prop = _a[_i]; + // Initialize array and use it + index.set(prop, index.get(prop) || []); + index.get(prop).push(c); + } + return index; +}, new propindex_1.PropIndex()); +//# sourceMappingURL=field.js.map \ No newline at end of file diff --git a/build/src/constraint/index.js b/build/src/constraint/index.js new file mode 100644 index 00000000..ff91745c --- /dev/null +++ b/build/src/constraint/index.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var encoding = require("./encoding"); +exports.encoding = encoding; +var spec = require("./spec"); +exports.spec = spec; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/build/src/constraint/spec.js b/build/src/constraint/spec.js new file mode 100644 index 00000000..31f83568 --- /dev/null +++ b/build/src/constraint/spec.js @@ -0,0 +1,767 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var aggregate_1 = require("vega-lite/build/src/aggregate"); +var channel_1 = require("vega-lite/build/src/channel"); +var mark_1 = require("vega-lite/build/src/mark"); +var scale_1 = require("vega-lite/build/src/scale"); +var type_1 = require("vega-lite/build/src/type"); +var expandedtype_1 = require("../query/expandedtype"); +var base_1 = require("./base"); +var wildcard_1 = require("../wildcard"); +var property_1 = require("../property"); +var propindex_1 = require("../propindex"); +var util_1 = require("../util"); +var encoding_1 = require("../query/encoding"); +var NONPOSITION_CHANNELS_INDEX = channel_1.NONPOSITION_CHANNELS.reduce(function (m, channel) { + m[channel] = true; + return m; +}, {}); +var SpecConstraintModel = /** @class */ (function (_super) { + __extends(SpecConstraintModel, _super); + function SpecConstraintModel(specConstraint) { + return _super.call(this, specConstraint) || this; + } + SpecConstraintModel.prototype.hasAllRequiredPropertiesSpecific = function (specM) { + return util_1.every(this.constraint.properties, function (prop) { + if (prop === property_1.Property.MARK) { + return !wildcard_1.isWildcard(specM.getMark()); + } + // TODO: transform + if (property_1.isEncodingNestedProp(prop)) { + var parent_1 = prop.parent; + var child_1 = prop.child; + return util_1.every(specM.getEncodings(), function (encQ) { + if (!encQ[parent_1]) { + return true; + } + return !wildcard_1.isWildcard(encQ[parent_1][child_1]); + }); + } + if (!property_1.isEncodingProperty(prop)) { + throw new Error('UNIMPLEMENTED'); + } + return util_1.every(specM.getEncodings(), function (encQ) { + if (!encQ[prop]) { + return true; + } + return !wildcard_1.isWildcard(encQ[prop]); + }); + }); + }; + SpecConstraintModel.prototype.satisfy = function (specM, schema, opt) { + // TODO: Re-order logic to optimize the "allowWildcardForProperties" check + if (!this.constraint.allowWildcardForProperties) { + if (!this.hasAllRequiredPropertiesSpecific(specM)) { + return true; + } + } + return this.constraint.satisfy(specM, schema, opt); + }; + return SpecConstraintModel; +}(base_1.AbstractConstraintModel)); +exports.SpecConstraintModel = SpecConstraintModel; +exports.SPEC_CONSTRAINTS = [ + { + name: 'noRepeatedChannel', + description: 'Each encoding channel should only be used once.', + properties: [property_1.Property.CHANNEL], + allowWildcardForProperties: true, + strict: true, + satisfy: function (specM, _, __) { + var usedChannel = {}; + // channel for all encodings should be valid + return util_1.every(specM.getEncodings(), function (encQ) { + if (!wildcard_1.isWildcard(encQ.channel)) { + // If channel is specified, it should no be used already + if (usedChannel[encQ.channel]) { + return false; + } + usedChannel[encQ.channel] = true; + return true; + } + return true; // unspecified channel is valid + }); + } + }, + { + name: 'alwaysIncludeZeroInScaleWithBarMark', + description: 'Do not recommend bar mark if scale does not start at zero', + properties: [property_1.Property.MARK, property_1.Property.SCALE, property_1.getEncodingNestedProp('scale', 'zero'), property_1.Property.CHANNEL, property_1.Property.TYPE], + allowWildcardForProperties: false, + strict: true, + satisfy: function (specM, _, __) { + var mark = specM.getMark(); + var encodings = specM.getEncodings(); + if (mark === mark_1.Mark.BAR) { + for (var _i = 0, encodings_1 = encodings; _i < encodings_1.length; _i++) { + var encQ = encodings_1[_i]; + if (encoding_1.isFieldQuery(encQ) && + (encQ.channel === channel_1.Channel.X || encQ.channel === channel_1.Channel.Y) && + (encQ.type === type_1.Type.QUANTITATIVE) && + (encQ.scale && encQ.scale.zero === false)) { + // TODO: zero shouldn't be manually specified + return false; + } + } + } + return true; + } + }, + { + name: 'autoAddCount', + description: 'Automatically adding count only for plots with only ordinal, binned quantitative, or temporal with timeunit fields.', + properties: [property_1.Property.BIN, property_1.Property.TIMEUNIT, property_1.Property.TYPE, property_1.Property.AUTOCOUNT], + allowWildcardForProperties: true, + strict: false, + satisfy: function (specM, _, __) { + var hasAutoCount = util_1.some(specM.getEncodings(), function (encQ) { return encoding_1.isEnabledAutoCountQuery(encQ); }); + if (hasAutoCount) { + // Auto count should only be applied if all fields are nominal, ordinal, temporal with timeUnit, binned quantitative, or autoCount + return util_1.every(specM.getEncodings(), function (encQ) { + if (encoding_1.isValueQuery(encQ)) { + return true; + } + if (encoding_1.isAutoCountQuery(encQ)) { + return true; + } + switch (encQ.type) { + case type_1.Type.QUANTITATIVE: + return !!encQ.bin; + case type_1.Type.TEMPORAL: + return !!encQ.timeUnit; + case type_1.Type.ORDINAL: + case expandedtype_1.ExpandedType.KEY: + case type_1.Type.NOMINAL: + return true; + } + /* istanbul ignore next */ + throw new Error('Unsupported Type'); + }); + } + else { + var autoCountEncIndex = specM.wildcardIndex.encodingIndicesByProperty.get('autoCount') || []; + var neverHaveAutoCount = util_1.every(autoCountEncIndex, function (index) { + var encQ = specM.getEncodingQueryByIndex(index); + return encoding_1.isAutoCountQuery(encQ) && !wildcard_1.isWildcard(encQ.autoCount); + }); + if (neverHaveAutoCount) { + // If the query surely does not have autoCount + // then one of the field should be + // (1) unbinned quantitative + // (2) temporal without time unit + // (3) nominal or ordinal field + // or at least have potential to be (still ambiguous). + return util_1.some(specM.getEncodings(), function (encQ) { + if ((encoding_1.isFieldQuery(encQ) || encoding_1.isAutoCountQuery(encQ)) && encQ.type === type_1.Type.QUANTITATIVE) { + if (encoding_1.isDisabledAutoCountQuery(encQ)) { + return false; + } + else { + return encoding_1.isFieldQuery(encQ) && (!encQ.bin || wildcard_1.isWildcard(encQ.bin)); + } + } + else if (encoding_1.isFieldQuery(encQ) && encQ.type === type_1.Type.TEMPORAL) { + return !encQ.timeUnit || wildcard_1.isWildcard(encQ.timeUnit); + } + return false; // nominal or ordinal + }); + } + } + return true; // no auto count, no constraint + } + }, + { + name: 'channelPermittedByMarkType', + description: 'Each encoding channel should be supported by the mark type', + properties: [property_1.Property.CHANNEL, property_1.Property.MARK], + allowWildcardForProperties: true, + strict: true, + satisfy: function (specM, _, __) { + var mark = specM.getMark(); + // if mark is unspecified, no need to check + if (wildcard_1.isWildcard(mark)) + return true; + // TODO: can optimize this to detect only what's the changed property if needed. + return util_1.every(specM.getEncodings(), function (encQ) { + // channel unspecified, no need to check + if (wildcard_1.isWildcard(encQ.channel)) + return true; + return channel_1.supportMark(encQ.channel, mark); + }); + } + }, + { + name: 'hasAllRequiredChannelsForMark', + description: 'All required channels for the specified mark should be specified', + properties: [property_1.Property.CHANNEL, property_1.Property.MARK], + allowWildcardForProperties: false, + strict: true, + satisfy: function (specM, _, __) { + var mark = specM.getMark(); + switch (mark) { + case mark_1.Mark.AREA: + case mark_1.Mark.LINE: + return specM.channelUsed(channel_1.Channel.X) && specM.channelUsed(channel_1.Channel.Y); + case mark_1.Mark.TEXT: + return specM.channelUsed(channel_1.Channel.TEXT); + case mark_1.Mark.BAR: + case mark_1.Mark.CIRCLE: + case mark_1.Mark.SQUARE: + case mark_1.Mark.TICK: + case mark_1.Mark.RULE: + case mark_1.Mark.RECT: + return specM.channelUsed(channel_1.Channel.X) || specM.channelUsed(channel_1.Channel.Y); + case mark_1.Mark.POINT: + // This allows generating a point plot if channel was not a wildcard. + return !specM.wildcardIndex.hasProperty(property_1.Property.CHANNEL) || + specM.channelUsed(channel_1.Channel.X) || specM.channelUsed(channel_1.Channel.Y); + } + /* istanbul ignore next */ + throw new Error('hasAllRequiredChannelsForMark not implemented for mark' + JSON.stringify(mark)); + } + }, + { + name: 'omitAggregate', + description: 'Omit aggregate plots.', + properties: [property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT], + allowWildcardForProperties: true, + strict: false, + satisfy: function (specM, _, __) { + if (specM.isAggregate()) { + return false; + } + return true; + } + }, + { + name: 'omitAggregatePlotWithDimensionOnlyOnFacet', + description: 'Omit aggregate plots with dimensions only on facets as that leads to inefficient use of space.', + properties: [property_1.Property.CHANNEL, property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT], + allowWildcardForProperties: false, + strict: false, + satisfy: function (specM, _, opt) { + if (specM.isAggregate()) { + var hasNonFacetDim_1 = false, hasDim_1 = false, hasEnumeratedFacetDim_1 = false; + specM.specQuery.encodings.forEach(function (encQ, index) { + if (encoding_1.isValueQuery(encQ) || (encoding_1.isDisabledAutoCountQuery(encQ))) + return; // skip unused field + // FieldQuery & !encQ.aggregate + if (encoding_1.isFieldQuery(encQ) && !encQ.aggregate) { + hasDim_1 = true; + if (util_1.contains([channel_1.Channel.ROW, channel_1.Channel.COLUMN], encQ.channel)) { + if (specM.wildcardIndex.hasEncodingProperty(index, property_1.Property.CHANNEL)) { + hasEnumeratedFacetDim_1 = true; + } + } + else { + hasNonFacetDim_1 = true; + } + } + }); + if (hasDim_1 && !hasNonFacetDim_1) { + if (hasEnumeratedFacetDim_1 || opt.constraintManuallySpecifiedValue) { + return false; + } + } + } + return true; + } + }, + { + name: 'omitAggregatePlotWithoutDimension', + description: 'Aggregate plots without dimension should be omitted', + properties: [property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT, property_1.Property.BIN, property_1.Property.TIMEUNIT, property_1.Property.TYPE], + allowWildcardForProperties: false, + strict: false, + satisfy: function (specM, _, __) { + if (specM.isAggregate()) { + // TODO relax + return util_1.some(specM.getEncodings(), function (encQ) { + if (encoding_1.isDimension(encQ) || (encoding_1.isFieldQuery(encQ) && (encQ.type === 'temporal'))) { + return true; + } + return false; + }); + } + return true; + } + }, + { + // TODO: we can be smarter and check if bar has occlusion based on profiling statistics + name: 'omitBarLineAreaWithOcclusion', + description: 'Don\'t use bar, line or area to visualize raw plot as they often lead to occlusion.', + properties: [property_1.Property.MARK, property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT], + allowWildcardForProperties: false, + strict: false, + satisfy: function (specM, _, __) { + if (util_1.contains([mark_1.Mark.BAR, mark_1.Mark.LINE, mark_1.Mark.AREA], specM.getMark())) { + return specM.isAggregate(); + } + return true; + } + }, + { + name: 'omitBarTickWithSize', + description: 'Do not map field to size channel with bar and tick mark', + properties: [property_1.Property.CHANNEL, property_1.Property.MARK], + allowWildcardForProperties: true, + strict: false, + satisfy: function (specM, _, opt) { + var mark = specM.getMark(); + if (util_1.contains([mark_1.Mark.TICK, mark_1.Mark.BAR], mark)) { + if (specM.channelEncodingField(channel_1.Channel.SIZE)) { + if (opt.constraintManuallySpecifiedValue) { + // If size is used and we constraintManuallySpecifiedValue, + // then the spec violates this constraint. + return false; + } + else { + // Otherwise have to search for the size channel and check if it is enumerated + var encodings = specM.specQuery.encodings; + for (var i = 0; i < encodings.length; i++) { + var encQ = encodings[i]; + if (encQ.channel === channel_1.Channel.SIZE) { + if (specM.wildcardIndex.hasEncodingProperty(i, property_1.Property.CHANNEL)) { + // If enumerated, then this is bad + return false; + } + else { + // If it's manually specified, no need to continue searching, just return. + return true; + } + } + } + } + } + } + return true; // skip + } + }, + { + name: 'omitBarAreaForLogScale', + description: 'Do not use bar and area mark for x and y\'s log scale', + properties: [property_1.Property.MARK, property_1.Property.CHANNEL, property_1.Property.SCALE, property_1.getEncodingNestedProp('scale', 'type'), property_1.Property.TYPE], + allowWildcardForProperties: false, + strict: true, + satisfy: function (specM, _, __) { + var mark = specM.getMark(); + var encodings = specM.getEncodings(); + // TODO: mark or scale type should be enumerated + if (mark === mark_1.Mark.AREA || mark === mark_1.Mark.BAR) { + for (var _i = 0, encodings_2 = encodings; _i < encodings_2.length; _i++) { + var encQ = encodings_2[_i]; + if (encoding_1.isFieldQuery(encQ) && ((encQ.channel === channel_1.Channel.X || encQ.channel === channel_1.Channel.Y) && encQ.scale)) { + var sType = encoding_1.scaleType(encQ); + if (sType === scale_1.ScaleType.LOG) { + return false; + } + } + } + } + return true; + } + }, + { + name: 'omitMultipleNonPositionalChannels', + description: 'Unless manually specified, do not use multiple non-positional encoding channel to avoid over-encoding.', + properties: [property_1.Property.CHANNEL], + allowWildcardForProperties: true, + strict: false, + satisfy: function (specM, _, opt) { + // have to use specM.specQuery.encodings insetad of specM.getEncodings() + // since specM.getEncodings() remove encQ with autoCount===false from the array + // and thus might shift the index + var encodings = specM.specQuery.encodings; + var nonPositionChannelCount = 0; + var hasEnumeratedNonPositionChannel = false; + for (var i = 0; i < encodings.length; i++) { + var encQ = encodings[i]; + if (encoding_1.isValueQuery(encQ) || (encoding_1.isDisabledAutoCountQuery(encQ))) { + continue; // ignore skipped encoding + } + var channel = encQ.channel; + if (!wildcard_1.isWildcard(channel)) { + if (NONPOSITION_CHANNELS_INDEX[channel + '']) { + nonPositionChannelCount += 1; + if (specM.wildcardIndex.hasEncodingProperty(i, property_1.Property.CHANNEL)) { + hasEnumeratedNonPositionChannel = true; + } + if (nonPositionChannelCount > 1 && + (hasEnumeratedNonPositionChannel || opt.constraintManuallySpecifiedValue)) { + return false; + } + } + } + } + return true; + } + }, + { + name: 'omitNonPositionalOrFacetOverPositionalChannels', + description: 'Do not use non-positional channels unless all positional channels are used', + properties: [property_1.Property.CHANNEL], + allowWildcardForProperties: false, + strict: false, + satisfy: function (specM, _, opt) { + var encodings = specM.specQuery.encodings; + var hasNonPositionalChannelOrFacet = false; + var hasEnumeratedNonPositionOrFacetChannel = false; + var hasX = false, hasY = false; + for (var i = 0; i < encodings.length; i++) { + var encQ = encodings[i]; + if (encoding_1.isValueQuery(encQ) || (encoding_1.isDisabledAutoCountQuery(encQ))) { + continue; // ignore skipped encoding + } + var channel = encQ.channel; + if (channel === channel_1.Channel.X) { + hasX = true; + } + else if (channel === channel_1.Channel.Y) { + hasY = true; + } + else if (!wildcard_1.isWildcard(channel)) { + // All non positional channel / Facet + hasNonPositionalChannelOrFacet = true; + if (specM.wildcardIndex.hasEncodingProperty(i, property_1.Property.CHANNEL)) { + hasEnumeratedNonPositionOrFacetChannel = true; + } + } + } + if (hasEnumeratedNonPositionOrFacetChannel || + (opt.constraintManuallySpecifiedValue && hasNonPositionalChannelOrFacet)) { + return hasX && hasY; + } + return true; + } + }, + { + name: 'omitRaw', + description: 'Omit raw plots.', + properties: [property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT], + allowWildcardForProperties: false, + strict: false, + satisfy: function (specM, _, __) { + if (!specM.isAggregate()) { + return false; + } + return true; + } + }, + { + name: 'omitRawContinuousFieldForAggregatePlot', + description: 'Aggregate plot should not use raw continuous field as group by values. ' + + '(Quantitative should be binned. Temporal should have time unit.)', + properties: [property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT, property_1.Property.TIMEUNIT, property_1.Property.BIN, property_1.Property.TYPE], + allowWildcardForProperties: true, + strict: false, + satisfy: function (specM, _, opt) { + if (specM.isAggregate()) { + var encodings = specM.specQuery.encodings; + for (var i = 0; i < encodings.length; i++) { + var encQ = encodings[i]; + if (encoding_1.isValueQuery(encQ) || (encoding_1.isDisabledAutoCountQuery(encQ))) + continue; // skip unused encoding + // TODO: aggregate for ordinal and temporal + if (encoding_1.isFieldQuery(encQ) && encQ.type === type_1.Type.TEMPORAL) { + // Temporal fields should have timeUnit or is still a wildcard + if (!encQ.timeUnit && (specM.wildcardIndex.hasEncodingProperty(i, property_1.Property.TIMEUNIT) || + opt.constraintManuallySpecifiedValue)) { + return false; + } + } + if (encQ.type === type_1.Type.QUANTITATIVE) { + if (encoding_1.isFieldQuery(encQ) && !encQ.bin && !encQ.aggregate) { + // If Raw Q + if (specM.wildcardIndex.hasEncodingProperty(i, property_1.Property.BIN) || + specM.wildcardIndex.hasEncodingProperty(i, property_1.Property.AGGREGATE) || + specM.wildcardIndex.hasEncodingProperty(i, property_1.Property.AUTOCOUNT)) { + // and it's raw from enumeration + return false; + } + if (opt.constraintManuallySpecifiedValue) { + // or if we constraintManuallySpecifiedValue + return false; + } + } + } + } + } + return true; + } + }, + { + name: 'omitRawDetail', + description: 'Do not use detail channel with raw plot.', + properties: [property_1.Property.CHANNEL, property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT], + allowWildcardForProperties: false, + strict: true, + satisfy: function (specM, _, opt) { + if (specM.isAggregate()) { + return true; + } + return util_1.every(specM.specQuery.encodings, function (encQ, index) { + if (encoding_1.isValueQuery(encQ) || (encoding_1.isDisabledAutoCountQuery(encQ))) + return true; // ignore autoCount field + if (encQ.channel === channel_1.Channel.DETAIL) { + // Detail channel for raw plot is not good, except when its enumerated + // or when it's manually specified but we constraintManuallySpecifiedValue. + if (specM.wildcardIndex.hasEncodingProperty(index, property_1.Property.CHANNEL) || + opt.constraintManuallySpecifiedValue) { + return false; + } + } + return true; + }); + } + }, + { + name: 'omitRepeatedField', + description: 'Each field should be mapped to only one channel', + properties: [property_1.Property.FIELD], + allowWildcardForProperties: true, + strict: false, + satisfy: function (specM, _, opt) { + var fieldUsed = {}; + var fieldEnumerated = {}; + var encodings = specM.specQuery.encodings; + for (var i = 0; i < encodings.length; i++) { + var encQ = encodings[i]; + if (encoding_1.isValueQuery(encQ) || encoding_1.isAutoCountQuery(encQ)) + continue; + var field = void 0; + if (encQ.field && !wildcard_1.isWildcard(encQ.field)) { + field = encQ.field; + } + if (encoding_1.isAutoCountQuery(encQ) && !wildcard_1.isWildcard(encQ.autoCount)) { + field = 'count_*'; + } + if (field) { + if (specM.wildcardIndex.hasEncodingProperty(i, property_1.Property.FIELD)) { + fieldEnumerated[field] = true; + } + // When the field is specified previously, + // if it is enumerated (either previously or in this encQ) + // or if the opt.constraintManuallySpecifiedValue is true, + // then it violates the constraint. + if (fieldUsed[field]) { + if (fieldEnumerated[field] || opt.constraintManuallySpecifiedValue) { + return false; + } + } + fieldUsed[field] = true; + } + } + return true; + } + }, + // TODO: omitShapeWithBin + { + name: 'omitVerticalDotPlot', + description: 'Do not output vertical dot plot.', + properties: [property_1.Property.CHANNEL], + allowWildcardForProperties: true, + strict: false, + satisfy: function (specM, _, __) { + var encodings = specM.getEncodings(); + if (encodings.length === 1 && encodings[0].channel === channel_1.Channel.Y) { + return false; + } + return true; + } + }, + // EXPENSIVE CONSTRAINTS -- check them later! + { + name: 'hasAppropriateGraphicTypeForMark', + description: 'Has appropriate graphic type for mark', + properties: [property_1.Property.CHANNEL, property_1.Property.MARK, property_1.Property.TYPE, property_1.Property.TIMEUNIT, property_1.Property.BIN, property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT], + allowWildcardForProperties: false, + strict: false, + satisfy: function (specM, _, __) { + var mark = specM.getMark(); + switch (mark) { + case mark_1.Mark.AREA: + case mark_1.Mark.LINE: + if (specM.isAggregate()) { + var xEncQ_1 = specM.getEncodingQueryByChannel(channel_1.Channel.X); + var yEncQ_1 = specM.getEncodingQueryByChannel(channel_1.Channel.Y); + var xIsMeasure = encoding_1.isMeasure(xEncQ_1); + var yIsMeasure = encoding_1.isMeasure(yEncQ_1); + // for aggregate line / area, we need at least one group-by axis and one measure axis. + return xEncQ_1 && yEncQ_1 && (xIsMeasure !== yIsMeasure) && + // and the dimension axis should not be nominal + // TODO: make this clause optional + !(encoding_1.isFieldQuery(xEncQ_1) && !xIsMeasure && util_1.contains(['nominal', 'key'], xEncQ_1.type)) && + !(encoding_1.isFieldQuery(yEncQ_1) && !yIsMeasure && util_1.contains(['nominal', 'key'], yEncQ_1.type)); + // TODO: allow connected scatterplot + } + return true; + case mark_1.Mark.TEXT: + // FIXME correctly when we add text + return true; + case mark_1.Mark.BAR: + case mark_1.Mark.TICK: + // Bar and tick should not use size. + if (specM.channelEncodingField(channel_1.Channel.SIZE)) { + return false; + } + else { + // Tick and Bar should have one and only one measure + var xEncQ_2 = specM.getEncodingQueryByChannel(channel_1.Channel.X); + var yEncQ_2 = specM.getEncodingQueryByChannel(channel_1.Channel.Y); + var xIsMeasure = encoding_1.isMeasure(xEncQ_2); + var yIsMeasure = encoding_1.isMeasure(yEncQ_2); + if (xIsMeasure !== yIsMeasure) { + return true; + } + return false; + } + case mark_1.Mark.RECT: + // Until CompassQL supports layering, it only makes sense for + // rect to encode DxD or 1xD (otherwise just use bar). + // Furthermore, color should only be used in a 'heatmap' fashion + // (with a measure field). + var xEncQ = specM.getEncodingQueryByChannel(channel_1.Channel.X); + var yEncQ = specM.getEncodingQueryByChannel(channel_1.Channel.Y); + var xIsDimension = encoding_1.isDimension(xEncQ); + var yIsDimension = encoding_1.isDimension(yEncQ); + var colorEncQ = specM.getEncodingQueryByChannel(channel_1.Channel.COLOR); + var colorIsQuantitative = encoding_1.isMeasure(colorEncQ); + var colorIsOrdinal = encoding_1.isFieldQuery(colorEncQ) ? + colorEncQ.type === type_1.Type.ORDINAL : false; + var correctChannels = (xIsDimension && yIsDimension) || + (xIsDimension && !specM.channelUsed(channel_1.Channel.Y)) || + (yIsDimension && !specM.channelUsed(channel_1.Channel.X)); + var correctColor = !colorEncQ || + (colorEncQ && (colorIsQuantitative || colorIsOrdinal)); + return correctChannels && correctColor; + case mark_1.Mark.CIRCLE: + case mark_1.Mark.POINT: + case mark_1.Mark.SQUARE: + case mark_1.Mark.RULE: + return true; + } + /* istanbul ignore next */ + throw new Error('hasAllRequiredChannelsForMark not implemented for mark' + mark); + } + }, + { + name: 'omitInvalidStackSpec', + description: 'If stack is specified, must follow Vega-Lite stack rules', + properties: [property_1.Property.STACK, property_1.Property.FIELD, property_1.Property.CHANNEL, property_1.Property.MARK, property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT, property_1.Property.SCALE, property_1.getEncodingNestedProp('scale', 'type'), property_1.Property.TYPE], + allowWildcardForProperties: false, + strict: true, + satisfy: function (specM, _, __) { + if (!specM.wildcardIndex.hasProperty(property_1.Property.STACK)) { + return true; + } + var stackProps = specM.getVlStack(); + if (stackProps === null && specM.getStackOffset() !== null) { + return false; + } + if (stackProps.fieldChannel !== specM.getStackChannel()) { + return false; + } + return true; + } + }, + { + name: 'omitNonSumStack', + description: 'Stack specifications that use non-summative aggregates should be omitted (even implicit ones)', + properties: [property_1.Property.CHANNEL, property_1.Property.MARK, property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT, property_1.Property.SCALE, property_1.getEncodingNestedProp('scale', 'type'), property_1.Property.TYPE], + allowWildcardForProperties: false, + strict: true, + satisfy: function (specM, _, __) { + var specStack = specM.getVlStack(); + if (specStack != null) { + var stackParentEncQ = specM.getEncodingQueryByChannel(specStack.fieldChannel); + if (!util_1.contains(aggregate_1.SUM_OPS, stackParentEncQ.aggregate)) { + return false; + } + } + return true; + } + }, + { + name: 'omitTableWithOcclusionIfAutoAddCount', + description: 'Plots without aggregation or autocount where x and y are both discrete should be omitted if autoAddCount is enabled as they often lead to occlusion', + properties: [property_1.Property.CHANNEL, property_1.Property.TYPE, property_1.Property.TIMEUNIT, property_1.Property.BIN, property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT], + allowWildcardForProperties: false, + strict: false, + satisfy: function (specM, _, opt) { + if (opt.autoAddCount) { + var xEncQ = specM.getEncodingQueryByChannel('x'); + var yEncQ = specM.getEncodingQueryByChannel('y'); + if ((!encoding_1.isFieldQuery(xEncQ) || encoding_1.isDimension(xEncQ)) && + (!encoding_1.isFieldQuery(yEncQ) || encoding_1.isDimension(yEncQ))) { + if (!specM.isAggregate()) { + return false; + } + else { + return util_1.every(specM.getEncodings(), function (encQ) { + var channel = encQ.channel; + if (channel !== channel_1.Channel.X && channel !== channel_1.Channel.Y && + channel !== channel_1.Channel.ROW && channel !== channel_1.Channel.COLUMN) { + // Non-position fields should not be unaggreated fields + if (encoding_1.isFieldQuery(encQ) && !encQ.aggregate) { + return false; + } + } + return true; + }); + } + } + } + return true; + } + } +].map(function (sc) { return new SpecConstraintModel(sc); }); +// For testing +exports.SPEC_CONSTRAINT_INDEX = exports.SPEC_CONSTRAINTS.reduce(function (m, c) { + m[c.name()] = c; + return m; +}, {}); +var SPEC_CONSTRAINTS_BY_PROPERTY = exports.SPEC_CONSTRAINTS.reduce(function (index, c) { + for (var _i = 0, _a = c.properties(); _i < _a.length; _i++) { + var prop = _a[_i]; + // Initialize array and use it + index.set(prop, index.get(prop) || []); + index.get(prop).push(c); + } + return index; +}, new propindex_1.PropIndex()); +/** + * Check all encoding constraints for a particular property and index tuple + */ +function checkSpec(prop, wildcard, specM, schema, opt) { + // Check encoding constraint + var specConstraints = SPEC_CONSTRAINTS_BY_PROPERTY.get(prop) || []; + for (var _i = 0, specConstraints_1 = specConstraints; _i < specConstraints_1.length; _i++) { + var c = specConstraints_1[_i]; + // Check if the constraint is enabled + if (c.strict() || !!opt[c.name()]) { + // For strict constraint, or enabled non-strict, check the constraints + var satisfy = c.satisfy(specM, schema, opt); + if (!satisfy) { + var violatedConstraint = '(spec) ' + c.name(); + /* istanbul ignore if */ + if (opt.verbose) { + console.log(violatedConstraint + ' failed with ' + specM.toShorthand() + ' for ' + wildcard.name); + } + return violatedConstraint; + } + } + } + return null; +} +exports.checkSpec = checkSpec; +//# sourceMappingURL=spec.js.map \ No newline at end of file diff --git a/build/src/constraint/value.js b/build/src/constraint/value.js new file mode 100644 index 00000000..e442e782 --- /dev/null +++ b/build/src/constraint/value.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var property_1 = require("../property"); +var propindex_1 = require("../propindex"); +var util_1 = require("../util"); +var base_1 = require("./base"); +exports.VALUE_CONSTRAINTS = [ + { + name: 'doesNotSupportConstantValue', + description: 'row, column, x, y, order, and detail should not work with constant values.', + properties: [property_1.Property.TYPE, property_1.Property.AGGREGATE], + allowWildcardForProperties: false, + strict: true, + satisfy: function (valueQ, _, __, ___) { + return !(util_1.contains(['row', 'column', 'x', 'y', 'detail', 'order'], valueQ.channel)); + } + } +].map(function (ec) { return new base_1.EncodingConstraintModel(ec); }); +exports.VALUE_CONSTRAINT_INDEX = exports.VALUE_CONSTRAINTS.reduce(function (m, ec) { + m[ec.name()] = ec; + return m; +}, {}); +exports.VALUE_CONSTRAINTS_BY_PROPERTY = exports.VALUE_CONSTRAINTS.reduce(function (index, c) { + for (var _i = 0, _a = c.properties(); _i < _a.length; _i++) { + var prop = _a[_i]; + index.set(prop, index.get(prop) || []); + index.get(prop).push(c); + } + return index; +}, new propindex_1.PropIndex()); +//# sourceMappingURL=value.js.map \ No newline at end of file diff --git a/build/src/query/encoding.js b/build/src/query/encoding.js new file mode 100644 index 00000000..ad404156 --- /dev/null +++ b/build/src/query/encoding.js @@ -0,0 +1,206 @@ +"use strict"; +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var vlFieldDef = require("vega-lite/build/src/fielddef"); +var type_1 = require("vega-lite/build/src/type"); +var expandedtype_1 = require("./expandedtype"); +var type_2 = require("vega-lite/build/src/compile/scale/type"); +var wildcard_1 = require("../wildcard"); +var property_1 = require("../property"); +var shorthand_1 = require("./shorthand"); +var util_1 = require("datalib/src/util"); +function isValueQuery(encQ) { + return encQ !== null && encQ !== undefined && encQ['value'] !== undefined; +} +exports.isValueQuery = isValueQuery; +function isFieldQuery(encQ) { + return encQ !== null && encQ !== undefined && (encQ['field'] || encQ['aggregate'] === 'count'); +} +exports.isFieldQuery = isFieldQuery; +function isAutoCountQuery(encQ) { + return encQ !== null && encQ !== undefined && 'autoCount' in encQ; +} +exports.isAutoCountQuery = isAutoCountQuery; +function isDisabledAutoCountQuery(encQ) { + return isAutoCountQuery(encQ) && encQ.autoCount === false; +} +exports.isDisabledAutoCountQuery = isDisabledAutoCountQuery; +function isEnabledAutoCountQuery(encQ) { + return isAutoCountQuery(encQ) && encQ.autoCount === true; +} +exports.isEnabledAutoCountQuery = isEnabledAutoCountQuery; +var DEFAULT_PROPS = [property_1.Property.AGGREGATE, property_1.Property.BIN, property_1.Property.TIMEUNIT, property_1.Property.FIELD, property_1.Property.TYPE, property_1.Property.SCALE, property_1.Property.SORT, property_1.Property.AXIS, property_1.Property.LEGEND, property_1.Property.STACK, property_1.Property.FORMAT]; +function toEncoding(encQs, params) { + var _a = params.wildcardMode, wildcardMode = _a === void 0 ? 'skip' : _a; + var encoding = {}; + for (var _i = 0, encQs_1 = encQs; _i < encQs_1.length; _i++) { + var encQ = encQs_1[_i]; + if (isDisabledAutoCountQuery(encQ)) { + continue; // Do not include this in the output. + } + var channel = encQ.channel; + // if channel is a wildcard, return null + if (wildcard_1.isWildcard(channel)) { + throw new Error('Cannot convert wildcard channel to a fixed channel'); + } + var channelDef = isValueQuery(encQ) ? toValueDef(encQ) : toFieldDef(encQ, params); + if (channelDef === null) { + if (params.wildcardMode === 'null') { + // contains invalid property (e.g., wildcard, thus cannot return a proper spec.) + return null; + } + continue; + } + // Otherwise, we can set the channelDef + encoding[channel] = channelDef; + } + return encoding; +} +exports.toEncoding = toEncoding; +function toValueDef(valueQ) { + var value = valueQ.value; + if (wildcard_1.isWildcard(value)) { + return null; + } + return { value: value }; +} +exports.toValueDef = toValueDef; +function toFieldDef(encQ, params) { + if (params === void 0) { params = {}; } + var _a = params.props, props = _a === void 0 ? DEFAULT_PROPS : _a, schema = params.schema, _b = params.wildcardMode, wildcardMode = _b === void 0 ? 'skip' : _b; + if (isFieldQuery(encQ)) { + var fieldDef = {}; + for (var _i = 0, props_1 = props; _i < props_1.length; _i++) { + var prop = props_1[_i]; + var encodingProperty = encQ[prop]; + if (wildcard_1.isWildcard(encodingProperty)) { + if (wildcardMode === 'skip') + continue; + return null; + } + if (encodingProperty !== undefined) { + // if the channel supports this prop + var isSupportedByChannel = (!shorthand_1.PROPERTY_SUPPORTED_CHANNELS[prop] || shorthand_1.PROPERTY_SUPPORTED_CHANNELS[prop][encQ.channel]); + if (!isSupportedByChannel) { + continue; + } + if (property_1.isEncodingNestedParent(prop) && util_1.isObject(encodingProperty)) { + encodingProperty = __assign({}, encodingProperty); // Make a shallow copy first + for (var childProp in encodingProperty) { + // ensure nested properties are not wildcard before assigning to field def + if (wildcard_1.isWildcard(encodingProperty[childProp])) { + if (wildcardMode === 'null') { + return null; + } + delete encodingProperty[childProp]; // skip + } + } + } + if (prop === 'bin' && encodingProperty === false) { + continue; + } + else if (prop === 'type' && encodingProperty === 'key') { + fieldDef.type = 'nominal'; + } + else { + fieldDef[prop] = encodingProperty; + } + } + if (prop === property_1.Property.SCALE && schema && encQ.type === type_1.Type.ORDINAL) { + var scale = encQ.scale; + var ordinalDomain = schema.fieldSchema(encQ.field).ordinalDomain; + if (scale !== null && ordinalDomain) { + fieldDef[property_1.Property.SCALE] = __assign({ domain: ordinalDomain }, (util_1.isObject(scale) ? scale : {})); + } + } + } + return fieldDef; + } + else { + if (encQ.autoCount === false) { + throw new Error("Cannot convert {autoCount: false} into a field def"); + } + else { + return { + aggregate: 'count', + field: '*', + type: 'quantitative' + }; + } + } +} +exports.toFieldDef = toFieldDef; +/** + * Is a field query continuous field? + * This method is applicable only for fieldQuery without wildcard + */ +function isContinuous(encQ) { + if (isFieldQuery(encQ)) { + return vlFieldDef.isContinuous(toFieldDef(encQ, { props: ['bin', 'timeUnit', 'field', 'type'] })); + } + return isAutoCountQuery(encQ); +} +exports.isContinuous = isContinuous; +function isMeasure(encQ) { + if (isFieldQuery(encQ)) { + return !isDimension(encQ) && encQ.type !== 'temporal'; + } + return isAutoCountQuery(encQ); +} +exports.isMeasure = isMeasure; +/** + * Is a field query discrete field? + * This method is applicable only for fieldQuery without wildcard + */ +function isDimension(encQ) { + if (isFieldQuery(encQ)) { + var fieldDef = toFieldDef(encQ, { props: ['bin', 'timeUnit', 'type'] }); + return vlFieldDef.isDiscrete(fieldDef) || !!fieldDef.timeUnit; + } + return false; +} +exports.isDimension = isDimension; +/** + * Returns the true scale type of an encoding. + * @returns {ScaleType} If the scale type was not specified, it is inferred from the encoding's Type. + * @returns {undefined} If the scale type was not specified and Type (or TimeUnit if applicable) is a Wildcard, there is no clear scale type + */ +function scaleType(fieldQ) { + var scale = fieldQ.scale === true || fieldQ.scale === wildcard_1.SHORT_WILDCARD ? {} : fieldQ.scale || {}; + var type = fieldQ.type, channel = fieldQ.channel, timeUnit = fieldQ.timeUnit, bin = fieldQ.bin; + // HACK: All of markType, and scaleConfig only affect + // sub-type of ordinal to quantitative scales (point or band) + // Currently, most of scaleType usage in CompassQL doesn't care about this subtle difference. + // Thus, instead of making this method requiring the global mark, + // we will just call it with mark = undefined . + // Thus, currently, we will always get a point scale unless a CompassQuery specifies band. + var markType = undefined; + var scaleConfig = {}; + if (wildcard_1.isWildcard(scale.type) || wildcard_1.isWildcard(type) || wildcard_1.isWildcard(channel) || wildcard_1.isWildcard(bin)) { + return undefined; + } + // If scale type is specified, then use scale.type + if (scale.type) { + return scale.type; + } + // if type is fixed and it's not temporal, we can ignore time unit. + if (type === 'temporal' && wildcard_1.isWildcard(timeUnit)) { + return undefined; + } + // if type is fixed and it's not quantitative, we can ignore bin + if (type === 'quantitative' && wildcard_1.isWildcard(bin)) { + return undefined; + } + var vegaLiteType = type === expandedtype_1.ExpandedType.KEY ? 'nominal' : type; + var fieldDef = { type: vegaLiteType, timeUnit: timeUnit, bin: bin }; + return type_2.scaleType(scale.type, channel, fieldDef, markType, scaleConfig); +} +exports.scaleType = scaleType; +//# sourceMappingURL=encoding.js.map \ No newline at end of file diff --git a/build/src/query/expandedtype.js b/build/src/query/expandedtype.js new file mode 100644 index 00000000..e6ec878e --- /dev/null +++ b/build/src/query/expandedtype.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var type_1 = require("vega-lite/build/src/type"); +var ExpandedType; +(function (ExpandedType) { + ExpandedType.QUANTITATIVE = type_1.Type.QUANTITATIVE; + ExpandedType.ORDINAL = type_1.Type.ORDINAL; + ExpandedType.TEMPORAL = type_1.Type.TEMPORAL; + ExpandedType.NOMINAL = type_1.Type.NOMINAL; + ExpandedType.KEY = 'key'; +})(ExpandedType = exports.ExpandedType || (exports.ExpandedType = {})); +function isDiscrete(fieldType) { + return fieldType === type_1.Type.ORDINAL || fieldType === type_1.Type.NOMINAL || fieldType === ExpandedType.KEY; +} +exports.isDiscrete = isDiscrete; +//# sourceMappingURL=expandedtype.js.map \ No newline at end of file diff --git a/build/src/query/groupby.js b/build/src/query/groupby.js new file mode 100644 index 00000000..9e8f47a3 --- /dev/null +++ b/build/src/query/groupby.js @@ -0,0 +1,74 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var util_1 = require("datalib/src/util"); +var shorthand_1 = require("./shorthand"); +var property_1 = require("../property"); +var propindex_1 = require("../propindex"); +var util_2 = require("../util"); +exports.REPLACE_BLANK_FIELDS = { '*': '' }; +exports.REPLACE_XY_CHANNELS = { x: 'xy', y: 'xy' }; +exports.REPLACE_FACET_CHANNELS = { row: 'facet', column: 'facet' }; +exports.REPLACE_MARK_STYLE_CHANNELS = { color: 'style', opacity: 'style', shape: 'style', size: 'style' }; +function isExtendedGroupBy(g) { + return util_1.isObject(g) && !!g['property']; +} +exports.isExtendedGroupBy = isExtendedGroupBy; +function parseGroupBy(groupBy, include, replaceIndex) { + include = include || new propindex_1.PropIndex(); + replaceIndex = replaceIndex || new propindex_1.PropIndex(); + groupBy.forEach(function (grpBy) { + if (isExtendedGroupBy(grpBy)) { + include.setByKey(grpBy.property, true); + replaceIndex.setByKey(grpBy.property, grpBy.replace); + } + else { + include.setByKey(grpBy, true); + } + }); + return { + include: include, + replaceIndex: replaceIndex, + replacer: shorthand_1.getReplacerIndex(replaceIndex) + }; +} +exports.parseGroupBy = parseGroupBy; +function toString(groupBy) { + if (util_1.isArray(groupBy)) { + return groupBy.map(function (g) { + if (isExtendedGroupBy(g)) { + if (g.replace) { + var replaceIndex_1 = util_2.keys(g.replace).reduce(function (index, valFrom) { + var valTo = g.replace[valFrom]; + (index[valTo] = index[valTo] || []).push(valFrom); + return index; + }, {}); + return g.property + '[' + util_2.keys(replaceIndex_1).map(function (valTo) { + var valsFrom = replaceIndex_1[valTo].sort(); + return valsFrom.join(',') + '=>' + valTo; + }).join(';') + ']'; + } + return g.property; + } + return g; + }).join(','); + } + else { + return groupBy; + } +} +exports.toString = toString; +exports.GROUP_BY_FIELD_TRANSFORM = [ + property_1.Property.FIELD, property_1.Property.TYPE, + property_1.Property.AGGREGATE, property_1.Property.BIN, property_1.Property.TIMEUNIT, property_1.Property.STACK +]; +exports.GROUP_BY_ENCODING = exports.GROUP_BY_FIELD_TRANSFORM.concat([ + { + property: property_1.Property.CHANNEL, + replace: { + 'x': 'xy', 'y': 'xy', + 'color': 'style', 'size': 'style', 'shape': 'style', 'opacity': 'style', + 'row': 'facet', 'column': 'facet' + } + } +]); +//# sourceMappingURL=groupby.js.map \ No newline at end of file diff --git a/build/src/query/index.js b/build/src/query/index.js new file mode 100644 index 00000000..fbb4b717 --- /dev/null +++ b/build/src/query/index.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var encoding = require("./encoding"); +exports.encoding = encoding; +var groupBy = require("./groupby"); +exports.groupBy = groupBy; +var shorthand = require("./shorthand"); +exports.shorthand = shorthand; +var spec = require("./spec"); +exports.spec = spec; +var transform = require("./transform"); +exports.transform = transform; +var normalize_1 = require("./normalize"); +exports.normalize = normalize_1.normalize; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/build/src/query/normalize.js b/build/src/query/normalize.js new file mode 100644 index 00000000..d66f2ece --- /dev/null +++ b/build/src/query/normalize.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var util_1 = require("../util"); +/** + * Normalize the non-nested version of the query + * (basically when you have a `groupBy`) + * to a standardize nested. + */ +function normalize(q) { + if (q.groupBy) { + var nest = { + groupBy: q.groupBy + }; + if (q.orderBy) { + nest.orderGroupBy = q.orderBy; + } + var normalizedQ = { + spec: util_1.duplicate(q.spec), + nest: [nest], + }; + if (q.chooseBy) { + normalizedQ.chooseBy = q.chooseBy; + } + if (q.config) { + normalizedQ.config = q.config; + } + return normalizedQ; + } + return util_1.duplicate(q); // We will cause side effect to q.spec in SpecQueryModel.build +} +exports.normalize = normalize; +//# sourceMappingURL=normalize.js.map \ No newline at end of file diff --git a/build/src/query/query.js b/build/src/query/query.js new file mode 100644 index 00000000..c57121b1 --- /dev/null +++ b/build/src/query/query.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=query.js.map \ No newline at end of file diff --git a/build/src/query/shorthand.js b/build/src/query/shorthand.js new file mode 100644 index 00000000..007215b2 --- /dev/null +++ b/build/src/query/shorthand.js @@ -0,0 +1,476 @@ +"use strict"; +var __assign = (this && this.__assign) || Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var aggregate_1 = require("vega-lite/build/src/aggregate"); +var channel_1 = require("vega-lite/build/src/channel"); +var timeunit_1 = require("vega-lite/build/src/timeunit"); +var type_1 = require("vega-lite/build/src/type"); +var util_1 = require("datalib/src/util"); +var encoding_1 = require("./encoding"); +var spec_1 = require("./spec"); +var wildcard_1 = require("../wildcard"); +var property_1 = require("../property"); +var propindex_1 = require("../propindex"); +var util_2 = require("../util"); +function getReplacerIndex(replaceIndex) { + return replaceIndex.map(function (r) { return getReplacer(r); }); +} +exports.getReplacerIndex = getReplacerIndex; +function getReplacer(replace) { + return function (s) { + if (replace[s] !== undefined) { + return replace[s]; + } + return s; + }; +} +exports.getReplacer = getReplacer; +function value(v, replacer) { + if (wildcard_1.isWildcard(v)) { + // Return the enum array if it's a full wildcard, or just return SHORT_WILDCARD for short ones. + if (!wildcard_1.isShortWildcard(v) && v.enum) { + return wildcard_1.SHORT_WILDCARD + JSON.stringify(v.enum); + } + else { + return wildcard_1.SHORT_WILDCARD; + } + } + if (replacer) { + return replacer(v); + } + return v; +} +exports.value = value; +function replace(v, replacer) { + if (replacer) { + return replacer(v); + } + return v; +} +exports.replace = replace; +exports.REPLACE_NONE = new propindex_1.PropIndex(); +exports.INCLUDE_ALL = +// FIXME: remove manual TRANSFORM concat once we really support enumerating transform. +[].concat(property_1.DEFAULT_PROP_PRECEDENCE, property_1.SORT_PROPS, [property_1.Property.TRANSFORM, property_1.Property.STACK], property_1.VIEW_PROPS) + .reduce(function (pi, prop) { return pi.set(prop, true); }, new propindex_1.PropIndex()); +function vlSpec(vlspec, include, replace) { + if (include === void 0) { include = exports.INCLUDE_ALL; } + if (replace === void 0) { replace = exports.REPLACE_NONE; } + var specQ = spec_1.fromSpec(vlspec); + return spec(specQ, include, replace); +} +exports.vlSpec = vlSpec; +exports.PROPERTY_SUPPORTED_CHANNELS = { + axis: { x: true, y: true, row: true, column: true }, + legend: { color: true, opacity: true, size: true, shape: true }, + scale: { x: true, y: true, color: true, opacity: true, row: true, column: true, size: true, shape: true }, + sort: { x: true, y: true, path: true, order: true }, + stack: { x: true, y: true }, +}; +/** + * Returns a shorthand for a spec query + * @param specQ a spec query + * @param include Dict Set listing property types (key) to be included in the shorthand + * @param replace Dictionary of replace function for values of a particular property type (key) + */ +function spec(specQ, include, replace) { + if (include === void 0) { include = exports.INCLUDE_ALL; } + if (replace === void 0) { replace = exports.REPLACE_NONE; } + var parts = []; + if (include.get(property_1.Property.MARK)) { + parts.push(value(specQ.mark, replace.get(property_1.Property.MARK))); + } + if (specQ.transform && specQ.transform.length > 0) { + parts.push('transform:' + JSON.stringify(specQ.transform)); + } + var stack; + if (include.get(property_1.Property.STACK)) { + stack = spec_1.getVlStack(specQ); + } + if (specQ.encodings) { + var encodings = specQ.encodings.reduce(function (encQs, encQ) { + // Exclude encoding mapping with autoCount=false as they are basically disabled. + if (!encoding_1.isDisabledAutoCountQuery(encQ)) { + var str = void 0; + if (!!stack && encQ.channel === stack.fieldChannel) { + str = encoding(__assign({}, encQ, { stack: stack.offset }), include, replace); + } + else { + str = encoding(encQ, include, replace); + } + if (str) { + encQs.push(str); + } + } + return encQs; + }, []) + .sort() // sort at the end to ignore order + .join('|'); + if (encodings) { + parts.push(encodings); + } + } + for (var _i = 0, VIEW_PROPS_1 = property_1.VIEW_PROPS; _i < VIEW_PROPS_1.length; _i++) { + var viewProp = VIEW_PROPS_1[_i]; + var propString = viewProp.toString(); + if (include.get(viewProp) && !!specQ[propString]) { + var value_1 = specQ[propString]; + parts.push(propString + "=" + JSON.stringify(value_1)); + } + } + return parts.join('|'); +} +exports.spec = spec; +/** + * Returns a shorthand for an encoding query + * @param encQ an encoding query + * @param include Dict Set listing property types (key) to be included in the shorthand + * @param replace Dictionary of replace function for values of a particular property type (key) + */ +function encoding(encQ, include, replace) { + if (include === void 0) { include = exports.INCLUDE_ALL; } + if (replace === void 0) { replace = exports.REPLACE_NONE; } + var parts = []; + if (include.get(property_1.Property.CHANNEL)) { + parts.push(value(encQ.channel, replace.get(property_1.Property.CHANNEL))); + } + if (encoding_1.isFieldQuery(encQ)) { + var fieldDefStr = fieldDef(encQ, include, replace); + if (fieldDefStr) { + parts.push(fieldDefStr); + } + } + else if (encoding_1.isValueQuery(encQ)) { + parts.push(encQ.value); + } + else if (encoding_1.isAutoCountQuery(encQ)) { + parts.push('autocount()'); + } + return parts.join(':'); +} +exports.encoding = encoding; +/** + * Returns a field definition shorthand for an encoding query + * @param encQ an encoding query + * @param include Dict Set listing property types (key) to be included in the shorthand + * @param replace Dictionary of replace function for values of a particular property type (key) + */ +function fieldDef(encQ, include, replacer) { + if (include === void 0) { include = exports.INCLUDE_ALL; } + if (replacer === void 0) { replacer = exports.REPLACE_NONE; } + if (include.get(property_1.Property.AGGREGATE) && encoding_1.isDisabledAutoCountQuery(encQ)) { + return '-'; + } + var fn = func(encQ, include, replacer); + var props = fieldDefProps(encQ, include, replacer); + var fieldAndParams; + if (encoding_1.isFieldQuery(encQ)) { + // field + fieldAndParams = include.get('field') ? value(encQ.field, replacer.get('field')) : '...'; + // type + if (include.get(property_1.Property.TYPE)) { + if (wildcard_1.isWildcard(encQ.type)) { + fieldAndParams += ',' + value(encQ.type, replacer.get(property_1.Property.TYPE)); + } + else { + var typeShort = ((encQ.type || type_1.Type.QUANTITATIVE) + '').substr(0, 1); + fieldAndParams += ',' + value(typeShort, replacer.get(property_1.Property.TYPE)); + } + } + // encoding properties + fieldAndParams += props.map(function (p) { + var val = p.value instanceof Array ? '[' + p.value + ']' : p.value; + return ',' + p.key + '=' + val; + }).join(''); + } + else if (encoding_1.isAutoCountQuery(encQ)) { + fieldAndParams = '*,q'; + } + if (!fieldAndParams) { + return null; + } + if (fn) { + var fnPrefix = util_1.isString(fn) ? fn : wildcard_1.SHORT_WILDCARD + + (util_2.keys(fn).length > 0 ? JSON.stringify(fn) : ''); + return fnPrefix + '(' + fieldAndParams + ')'; + } + return fieldAndParams; +} +exports.fieldDef = fieldDef; +/** + * Return function part of + */ +function func(fieldQ, include, replacer) { + if (include.get(property_1.Property.AGGREGATE) && fieldQ.aggregate && !wildcard_1.isWildcard(fieldQ.aggregate)) { + return replace(fieldQ.aggregate, replacer.get(property_1.Property.AGGREGATE)); + } + else if (include.get(property_1.Property.AGGREGATE) && encoding_1.isEnabledAutoCountQuery(fieldQ)) { + // autoCount is considered a part of aggregate + return replace('count', replacer.get(property_1.Property.AGGREGATE)); + ; + } + else if (include.get(property_1.Property.TIMEUNIT) && fieldQ.timeUnit && !wildcard_1.isWildcard(fieldQ.timeUnit)) { + return replace(fieldQ.timeUnit, replacer.get(property_1.Property.TIMEUNIT)); + } + else if (include.get(property_1.Property.BIN) && fieldQ.bin && !wildcard_1.isWildcard(fieldQ.bin)) { + return 'bin'; + } + else { + var fn = null; + for (var _i = 0, _a = [property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT, property_1.Property.TIMEUNIT, property_1.Property.BIN]; _i < _a.length; _i++) { + var prop = _a[_i]; + var val = fieldQ[prop]; + if (include.get(prop) && fieldQ[prop] && wildcard_1.isWildcard(val)) { + // assign fnEnumIndex[prop] = array of enum values or just "?" if it is SHORT_WILDCARD + fn = fn || {}; + fn[prop] = wildcard_1.isShortWildcard(val) ? val : val.enum; + } + } + if (fn && fieldQ.hasFn) { + fn.hasFn = true; + } + return fn; + } +} +/** + * Return key-value of parameters of field defs + */ +function fieldDefProps(fieldQ, include, replacer) { + /** Encoding properties e.g., Scale, Axis, Legend */ + var props = []; + // Parameters of function such as bin will be just top-level properties + if (!util_2.isBoolean(fieldQ.bin) && !wildcard_1.isShortWildcard(fieldQ.bin)) { + var bin = fieldQ.bin; + for (var child in bin) { + var prop = property_1.getEncodingNestedProp('bin', child); + if (prop && include.get(prop) && bin[child] !== undefined) { + props.push({ + key: child, + value: value(bin[child], replacer.get(prop)) + }); + } + } + // Sort to make sure that parameter are ordered consistently + props.sort(function (a, b) { return a.key.localeCompare(b.key); }); + } + for (var _i = 0, _a = [property_1.Property.SCALE, property_1.Property.SORT, property_1.Property.STACK, property_1.Property.AXIS, property_1.Property.LEGEND]; _i < _a.length; _i++) { + var parent_1 = _a[_i]; + if (!wildcard_1.isWildcard(fieldQ.channel) && !exports.PROPERTY_SUPPORTED_CHANNELS[parent_1][fieldQ.channel]) { + continue; + } + if (include.get(parent_1) && fieldQ[parent_1] !== undefined) { + var parentValue = fieldQ[parent_1]; + if (util_2.isBoolean(parentValue) || parentValue === null) { + // `scale`, `axis`, `legend` can be false/null. + props.push({ + key: parent_1 + '', + value: parentValue || false // return true or false (false if null) + }); + } + else if (util_1.isString(parentValue)) { + // `sort` can be a string (ascending/descending). + props.push({ + key: parent_1 + '', + value: replace(JSON.stringify(parentValue), replacer.get(parent_1)) + }); + } + else { + var nestedPropChildren = []; + for (var child in parentValue) { + var nestedProp = property_1.getEncodingNestedProp(parent_1, child); + if (nestedProp && include.get(nestedProp) && parentValue[child] !== undefined) { + nestedPropChildren.push({ + key: child, + value: value(parentValue[child], replacer.get(nestedProp)) + }); + } + } + if (nestedPropChildren.length > 0) { + var nestedPropObject = nestedPropChildren.sort(function (a, b) { return a.key.localeCompare(b.key); }) + .reduce(function (o, item) { + o[item.key] = item.value; + return o; + }, {}); + // Sort to make sure that parameter are ordered consistently + props.push({ + key: parent_1 + '', + value: JSON.stringify(nestedPropObject) + }); + } + } + } + } + return props; +} +function parse(shorthand) { + // TODO(https://github.com/uwdata/compassql/issues/259): + // Do not split directly, but use an upgraded version of `getClosingBraceIndex()` + var splitShorthand = shorthand.split('|'); + var specQ = { + mark: splitShorthand[0], + encodings: [] + }; + for (var i = 1; i < splitShorthand.length; i++) { + var part = splitShorthand[i]; + var splitPart = splitWithTail(part, ':', 1); + var splitPartKey = splitPart[0]; + var splitPartValue = splitPart[1]; + if (channel_1.isChannel(splitPartKey) || splitPartKey === '?') { + var encQ = shorthandParser.encoding(splitPartKey, splitPartValue); + specQ.encodings.push(encQ); + continue; + } + if (splitPartKey === 'transform') { + specQ.transform = JSON.parse(splitPartValue); + continue; + } + } + return specQ; +} +exports.parse = parse; +/** + * Split a string n times into substrings with the specified delimiter and return them as an array. + * @param str The string to be split + * @param delim The delimiter string used to separate the string + * @param number The value used to determine how many times the string is split + */ +function splitWithTail(str, delim, count) { + var result = []; + var lastIndex = 0; + for (var i = 0; i < count; i++) { + var indexOfDelim = str.indexOf(delim, lastIndex); + if (indexOfDelim !== -1) { + result.push(str.substring(lastIndex, indexOfDelim)); + lastIndex = indexOfDelim + 1; + } + else { + break; + } + } + result.push(str.substr(lastIndex)); + // If the specified count is greater than the number of delimiters that exist in the string, + // an empty string will be pushed count minus number of delimiter occurence times. + if (result.length !== count + 1) { + while (result.length !== count + 1) { + result.push(''); + } + } + return result; +} +exports.splitWithTail = splitWithTail; +var shorthandParser; +(function (shorthandParser) { + function encoding(channel, fieldDefShorthand) { + var encQMixins = fieldDefShorthand.indexOf('(') !== -1 ? + fn(fieldDefShorthand) : + rawFieldDef(splitWithTail(fieldDefShorthand, ',', 2)); + return __assign({ channel: channel }, encQMixins); + } + shorthandParser.encoding = encoding; + function rawFieldDef(fieldDefPart) { + var fieldQ = {}; + fieldQ.field = fieldDefPart[0]; + fieldQ.type = type_1.getFullName(fieldDefPart[1].toUpperCase()) || '?'; + var partParams = fieldDefPart[2]; + var closingBraceIndex = 0; + var i = 0; + while (i < partParams.length) { + var propEqualSignIndex = partParams.indexOf('=', i); + var parsedValue = void 0; + if (propEqualSignIndex !== -1) { + var prop = partParams.substring(i, propEqualSignIndex); + if (partParams[i + prop.length + 1] === '{') { + var openingBraceIndex = i + prop.length + 1; + closingBraceIndex = getClosingIndex(openingBraceIndex, partParams, '}'); + var value_2 = partParams.substring(openingBraceIndex, closingBraceIndex + 1); + parsedValue = JSON.parse(value_2); + // index after next comma + i = closingBraceIndex + 2; + } + else if (partParams[i + prop.length + 1] === '[') { + // find closing square bracket + var openingBracketIndex = i + prop.length + 1; + var closingBracketIndex = getClosingIndex(openingBracketIndex, partParams, ']'); + var value_3 = partParams.substring(openingBracketIndex, closingBracketIndex + 1); + parsedValue = JSON.parse(value_3); + // index after next comma + i = closingBracketIndex + 2; + } + else { + var propIndex = i; + // Substring until the next comma (or end of the string) + var nextCommaIndex = partParams.indexOf(',', i + prop.length); + if (nextCommaIndex === -1) { + nextCommaIndex = partParams.length; + } + // index after next comma + i = nextCommaIndex + 1; + parsedValue = JSON.parse(partParams.substring(propIndex + prop.length + 1, nextCommaIndex)); + } + if (property_1.isEncodingNestedParent(prop)) { + fieldQ[prop] = parsedValue; + } + else { + // prop is a property of the aggregation function such as bin + fieldQ.bin = fieldQ.bin || {}; + fieldQ.bin[prop] = parsedValue; + } + } + else { + // something is wrong with the format of the partParams + // exits loop if don't have then infintie loop + break; + } + } + return fieldQ; + } + shorthandParser.rawFieldDef = rawFieldDef; + function getClosingIndex(openingBraceIndex, str, closingChar) { + for (var i = openingBraceIndex; i < str.length; i++) { + if (str[i] === closingChar) { + return i; + } + } + } + shorthandParser.getClosingIndex = getClosingIndex; + function fn(fieldDefShorthand) { + var fieldQ = {}; + // Aggregate, Bin, TimeUnit as wildcard case + if (fieldDefShorthand[0] === '?') { + var closingBraceIndex = getClosingIndex(1, fieldDefShorthand, '}'); + var fnEnumIndex = JSON.parse(fieldDefShorthand.substring(1, closingBraceIndex + 1)); + for (var encodingProperty in fnEnumIndex) { + if (util_2.isArray(fnEnumIndex[encodingProperty])) { + fieldQ[encodingProperty] = { enum: fnEnumIndex[encodingProperty] }; + } + else { + fieldQ[encodingProperty] = fnEnumIndex[encodingProperty]; + } + } + return __assign({}, fieldQ, rawFieldDef(splitWithTail(fieldDefShorthand.substring(closingBraceIndex + 2, fieldDefShorthand.length - 1), ',', 2))); + } + else { + var func_1 = fieldDefShorthand.substring(0, fieldDefShorthand.indexOf('(')); + var insideFn = fieldDefShorthand.substring(func_1.length + 1, fieldDefShorthand.length - 1); + var insideFnParts = splitWithTail(insideFn, ',', 2); + if (aggregate_1.isAggregateOp(func_1)) { + return __assign({ aggregate: func_1 }, rawFieldDef(insideFnParts)); + } + else if (timeunit_1.isTimeUnit(func_1)) { + return __assign({ timeUnit: func_1 }, rawFieldDef(insideFnParts)); + } + else if (func_1 === 'bin') { + return __assign({ bin: {} }, rawFieldDef(insideFnParts)); + } + } + } + shorthandParser.fn = fn; +})(shorthandParser = exports.shorthandParser || (exports.shorthandParser = {})); +//# sourceMappingURL=shorthand.js.map \ No newline at end of file diff --git a/build/src/query/spec.js b/build/src/query/spec.js new file mode 100644 index 00000000..1206969b --- /dev/null +++ b/build/src/query/spec.js @@ -0,0 +1,156 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var stack_1 = require("vega-lite/build/src/stack"); +var wildcard_1 = require("../wildcard"); +var property_1 = require("../property"); +var util_1 = require("../util"); +var encoding_1 = require("./encoding"); +var util_2 = require("datalib/src/util"); +/** + * Convert a Vega-Lite's ExtendedUnitSpec into a CompassQL's SpecQuery + * @param {ExtendedUnitSpec} spec + * @returns + */ +function fromSpec(spec) { + return util_1.extend(spec.data ? { data: spec.data } : {}, spec.transform ? { transform: spec.transform } : {}, spec.width ? { width: spec.width } : {}, spec.height ? { height: spec.height } : {}, spec.background ? { background: spec.background } : {}, spec.padding ? { padding: spec.padding } : {}, spec.title ? { title: spec.title } : {}, { + mark: spec.mark, + encodings: util_1.keys(spec.encoding).map(function (channel) { + var encQ = { channel: channel }; + var channelDef = spec.encoding[channel]; + for (var prop in channelDef) { + if (property_1.isEncodingTopLevelProperty(prop) && channelDef[prop] !== undefined) { + // Currently bin, scale, axis, legend only support boolean, but not null. + // Therefore convert null to false. + if (util_1.contains(['bin', 'scale', 'axis', 'legend'], prop) && channelDef[prop] === null) { + encQ[prop] = false; + } + else { + encQ[prop] = channelDef[prop]; + } + } + } + if (encoding_1.isFieldQuery(encQ) && encQ.aggregate === 'count' && !encQ.field) { + encQ.field = '*'; + } + return encQ; + }) + }, spec.config ? { config: spec.config } : {}); +} +exports.fromSpec = fromSpec; +function isAggregate(specQ) { + return util_1.some(specQ.encodings, function (encQ) { + return (encoding_1.isFieldQuery(encQ) && !wildcard_1.isWildcard(encQ.aggregate) && !!encQ.aggregate) || encoding_1.isEnabledAutoCountQuery(encQ); + }); +} +exports.isAggregate = isAggregate; +/** + * @return The Vega-Lite `StackProperties` object that describes the stack + * configuration of `specQ`. Returns `null` if this is not stackable. + */ +function getVlStack(specQ) { + if (!hasRequiredStackProperties(specQ)) { + return null; + } + var encoding = encoding_1.toEncoding(specQ.encodings, { schema: null, wildcardMode: 'null' }); + var mark = specQ.mark; + return stack_1.stack(mark, encoding, getStackOffset(specQ)); +} +exports.getVlStack = getVlStack; +/** + * @return The `StackOffset` specified in `specQ`, `undefined` if none + * is specified. + */ +function getStackOffset(specQ) { + for (var _i = 0, _a = specQ.encodings; _i < _a.length; _i++) { + var encQ = _a[_i]; + if (encQ[property_1.Property.STACK] !== undefined && !wildcard_1.isWildcard(encQ[property_1.Property.STACK])) { + return encQ[property_1.Property.STACK]; + } + } + return undefined; +} +exports.getStackOffset = getStackOffset; +/** + * @return The `Channel` in which `stack` is specified in `specQ`, or + * `null` if none is specified. + */ +function getStackChannel(specQ) { + for (var _i = 0, _a = specQ.encodings; _i < _a.length; _i++) { + var encQ = _a[_i]; + if (encQ[property_1.Property.STACK] !== undefined && !wildcard_1.isWildcard(encQ.channel)) { + return encQ.channel; + } + } + return null; +} +exports.getStackChannel = getStackChannel; +/** + * Returns true iff the given SpecQuery has the properties defined + * to be a potential Stack spec. + * @param specQ The SpecQuery in question. + */ +function hasRequiredStackProperties(specQ) { + // TODO(haldenl): make this leaner, a lot of encQ properties aren't required for stack. + // TODO(haldenl): check mark, then encodings + if (wildcard_1.isWildcard(specQ.mark)) { + return false; + } + var requiredEncodingProps = [property_1.Property.STACK, property_1.Property.CHANNEL, + property_1.Property.MARK, property_1.Property.FIELD, property_1.Property.AGGREGATE, property_1.Property.AUTOCOUNT, property_1.Property.SCALE, + property_1.getEncodingNestedProp('scale', 'type'), property_1.Property.TYPE]; + var exclude = util_2.toMap(util_1.without(property_1.ALL_ENCODING_PROPS, requiredEncodingProps)); + var encodings = specQ.encodings.filter(function (encQ) { return !encoding_1.isDisabledAutoCountQuery(encQ); }); + for (var _i = 0, encodings_1 = encodings; _i < encodings_1.length; _i++) { + var encQ = encodings_1[_i]; + if (objectContainsWildcard(encQ, { exclude: exclude })) { + return false; + } + } + return true; +} +exports.hasRequiredStackProperties = hasRequiredStackProperties; +/** + * Returns true iff the given object does not contain a nested wildcard. + * @param obj The object in question. + * @param opt With optional `exclude` property, which defines properties to + * ignore when testing for wildcards. + */ +// TODO(haldenl): rename to objectHasWildcard, rename prop to obj +function objectContainsWildcard(obj, opt) { + if (opt === void 0) { opt = {}; } + if (!util_1.isObject(obj)) { + return false; + } + for (var childProp in obj) { + if (obj.hasOwnProperty(childProp)) { + var wildcard = wildcard_1.isWildcard(obj[childProp]); + if ((wildcard && (!opt.exclude || !opt.exclude[childProp])) || + objectContainsWildcard(obj[childProp], opt)) { + return true; + } + } + } + return false; +} +/** + * Returns true iff the given `specQ` contains a wildcard. + * @param specQ The `SpecQuery` in question. + * @param opt With optional `exclude` property, which defines properties to + * ignore when testing for wildcards. + */ +function hasWildcard(specQ, opt) { + if (opt === void 0) { opt = {}; } + var exclude = opt.exclude ? util_2.toMap(opt.exclude.map(property_1.toKey)) : {}; + if (wildcard_1.isWildcard(specQ.mark) && !exclude['mark']) { + return true; + } + for (var _i = 0, _a = specQ.encodings; _i < _a.length; _i++) { + var encQ = _a[_i]; + if (objectContainsWildcard(encQ, exclude)) { + return true; + } + } + return false; +} +exports.hasWildcard = hasWildcard; +//# sourceMappingURL=spec.js.map \ No newline at end of file diff --git a/build/src/query/transform.js b/build/src/query/transform.js new file mode 100644 index 00000000..f07f1525 --- /dev/null +++ b/build/src/query/transform.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=transform.js.map \ No newline at end of file diff --git a/build/src/ranking/aggregation.js b/build/src/ranking/aggregation.js new file mode 100644 index 00000000..15b3ec51 --- /dev/null +++ b/build/src/ranking/aggregation.js @@ -0,0 +1,87 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var type_1 = require("vega-lite/build/src/type"); +var util_1 = require("../util"); +var encoding_1 = require("../query/encoding"); +exports.name = 'aggregationQuality'; +function score(specM, schema, opt) { + var feature = aggregationQualityFeature(specM, schema, opt); + return { + score: feature.score, + features: [feature] + }; +} +exports.score = score; +function aggregationQualityFeature(specM, _, __) { + var encodings = specM.getEncodings(); + if (specM.isAggregate()) { + var isRawContinuous = function (encQ) { + return encoding_1.isFieldQuery(encQ) && ((encQ.type === type_1.Type.QUANTITATIVE && !encQ.bin && !encQ.aggregate) || + (encQ.type === type_1.Type.TEMPORAL && !encQ.timeUnit)); + }; + if (util_1.some(encodings, isRawContinuous)) { + // These are plots that pollute continuous fields as dimension. + // They are often intermediate visualizations rather than what users actually want. + return { + type: exports.name, + score: 0.1, + feature: 'Aggregate with raw continuous' + }; + } + if (util_1.some(encodings, function (encQ) { return encoding_1.isFieldQuery(encQ) && encoding_1.isDimension(encQ); })) { + var hasCount = util_1.some(encodings, function (encQ) { + return (encoding_1.isFieldQuery(encQ) && encQ.aggregate === 'count') || encoding_1.isEnabledAutoCountQuery(encQ); + }); + var hasBin = util_1.some(encodings, function (encQ) { + return encoding_1.isFieldQuery(encQ) && !!encQ.bin; + }); + if (hasCount) { + // If there is count, we might add additional count field, making it a little less simple + // then when we just apply aggregate to Q field + return { + type: exports.name, + score: 0.8, + feature: 'Aggregate with count' + }; + } + else if (hasBin) { + // This is not as good as binning all the Q and show heatmap + return { + type: exports.name, + score: 0.7, + feature: 'Aggregate with bin but without count' + }; + } + else { + return { + type: exports.name, + score: 0.9, + feature: 'Aggregate without count and without bin' + }; + } + } + // no dimension -- often not very useful + return { + type: exports.name, + score: 0.3, + feature: 'Aggregate without dimension' + }; + } + else { + if (util_1.some(encodings, function (encQ) { return encoding_1.isFieldQuery(encQ) && !encoding_1.isDimension(encQ); })) { + // raw plots with measure -- simplest of all! + return { + type: exports.name, + score: 1, + feature: 'Raw with measure' + }; + } + // raw plots with no measure -- often a lot of occlusion + return { + type: exports.name, + score: 0.2, + feature: 'Raw without measure' + }; + } +} +//# sourceMappingURL=aggregation.js.map \ No newline at end of file diff --git a/build/src/ranking/fieldorder.js b/build/src/ranking/fieldorder.js new file mode 100644 index 00000000..f7063420 --- /dev/null +++ b/build/src/ranking/fieldorder.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var encoding_1 = require("../query/encoding"); +exports.name = 'fieldOrder'; +/** + * Return ranking score based on indices of encoded fields in the schema. + * If there are multiple fields, prioritize field on the lower indices of encodings. + * + * For example, to compare two specs with two encodings each, + * first we compare the field on the 0-th index + * and only compare the field on the 1-th index only if the fields on the 0-th index are the same. + */ +function score(specM, schema, _) { + var fieldWildcardIndices = specM.wildcardIndex.encodingIndicesByProperty.get('field'); + if (!fieldWildcardIndices) { + return { + score: 0, + features: [] + }; + } + var encodings = specM.specQuery.encodings; + var numFields = schema.fieldSchemas.length; + var features = []; + var totalScore = 0, base = 1; + for (var i = fieldWildcardIndices.length - 1; i >= 0; i--) { + var index = fieldWildcardIndices[i]; + var encoding = encodings[index]; + // Skip ValueQuery as we only care about order of fields. + var field = void 0; + if (encoding_1.isFieldQuery(encoding)) { + field = encoding.field; + } + else { + continue; + } + var fieldWildcard = specM.wildcardIndex.encodings[index].get('field'); + var fieldIndex = schema.fieldSchema(field).index; + // reverse order field with lower index should get higher score and come first + var score_1 = -fieldIndex * base; + totalScore += score_1; + features.push({ + score: score_1, + type: 'fieldOrder', + feature: "field " + fieldWildcard.name + " is " + field + " (#" + fieldIndex + " in the schema)" + }); + base *= numFields; + } + return { + score: totalScore, + features: features + }; +} +exports.score = score; +//# sourceMappingURL=fieldorder.js.map \ No newline at end of file diff --git a/build/src/ranking/ranking.js b/build/src/ranking/ranking.js new file mode 100644 index 00000000..26486674 --- /dev/null +++ b/build/src/ranking/ranking.js @@ -0,0 +1,100 @@ +"use strict"; +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +var result_1 = require("../result"); +var effectiveness_1 = require("./effectiveness"); +__export(require("./effectiveness")); +var aggregation = require("./aggregation"); +exports.aggregation = aggregation; +var fieldOrder = require("./fieldorder"); +exports.fieldOrder = fieldOrder; +/** + * Registry for all encoding ranking functions + */ +var rankingRegistry = {}; +/** + * Add an ordering function to the registry. + */ +function register(name, keyFn) { + rankingRegistry[name] = keyFn; +} +exports.register = register; +function get(name) { + return rankingRegistry[name]; +} +exports.get = get; +function rank(group, query, schema, level) { + if (!query.nest || level === query.nest.length) { + if (query.orderBy || query.chooseBy) { + group.items.sort(comparatorFactory(query.orderBy || query.chooseBy, schema, query.config)); + if (query.chooseBy) { + if (group.items.length > 0) { + // for chooseBy -- only keep the top-item + group.items.splice(1); + } + } + } + } + else { + // sort lower-level nodes first because our ranking takes top-item in the subgroup + group.items.forEach(function (subgroup) { + rank(subgroup, query, schema, level + 1); + }); + if (query.nest[level].orderGroupBy) { + group.items.sort(groupComparatorFactory(query.nest[level].orderGroupBy, schema, query.config)); + } + } + return group; +} +exports.rank = rank; +function comparatorFactory(name, schema, opt) { + return function (m1, m2) { + if (name instanceof Array) { + return getScoreDifference(name, m1, m2, schema, opt); + } + else { + return getScoreDifference([name], m1, m2, schema, opt); + } + }; +} +exports.comparatorFactory = comparatorFactory; +function groupComparatorFactory(name, schema, opt) { + return function (g1, g2) { + var m1 = result_1.getTopResultTreeItem(g1); + var m2 = result_1.getTopResultTreeItem(g2); + if (name instanceof Array) { + return getScoreDifference(name, m1, m2, schema, opt); + } + else { + return getScoreDifference([name], m1, m2, schema, opt); + } + }; +} +exports.groupComparatorFactory = groupComparatorFactory; +function getScoreDifference(name, m1, m2, schema, opt) { + for (var _i = 0, name_1 = name; _i < name_1.length; _i++) { + var rankingName = name_1[_i]; + var scoreDifference = getScore(m2, rankingName, schema, opt).score - getScore(m1, rankingName, schema, opt).score; + if (scoreDifference !== 0) { + return scoreDifference; + } + } + return 0; +} +function getScore(model, rankingName, schema, opt) { + if (model.getRankingScore(rankingName) !== undefined) { + return model.getRankingScore(rankingName); + } + var fn = get(rankingName); + var score = fn(model, schema, opt); + model.setRankingScore(rankingName, score); + return score; +} +exports.getScore = getScore; +exports.EFFECTIVENESS = 'effectiveness'; +register(exports.EFFECTIVENESS, effectiveness_1.effectiveness); +register(aggregation.name, aggregation.score); +register(fieldOrder.name, fieldOrder.score); +//# sourceMappingURL=ranking.js.map \ No newline at end of file