1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 | (function webpackUniversalModuleDefinition(root, factory) {
|
26 | if(typeof exports === 'object' && typeof module === 'object')
|
27 | module.exports = factory();
|
28 | else if(typeof define === 'function' && define.amd)
|
29 | define([], factory);
|
30 | else {
|
31 | var a = factory();
|
32 | for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
33 | }
|
34 | })(this, function() {
|
35 | return (function() {
|
36 | var __webpack_modules__ = ([
|
37 |
|
38 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
39 |
|
40 | __webpack_require__(1);
|
41 | __webpack_require__(369);
|
42 | var path = __webpack_require__(36);
|
43 |
|
44 | module.exports = path;
|
45 |
|
46 |
|
47 | }),
|
48 |
|
49 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
50 |
|
51 | __webpack_require__(2);
|
52 | __webpack_require__(66);
|
53 | __webpack_require__(67);
|
54 | __webpack_require__(68);
|
55 | __webpack_require__(69);
|
56 | __webpack_require__(70);
|
57 | __webpack_require__(71);
|
58 | __webpack_require__(72);
|
59 | __webpack_require__(73);
|
60 | __webpack_require__(74);
|
61 | __webpack_require__(75);
|
62 | __webpack_require__(76);
|
63 | __webpack_require__(77);
|
64 | __webpack_require__(78);
|
65 | __webpack_require__(79);
|
66 | __webpack_require__(80);
|
67 | __webpack_require__(92);
|
68 | __webpack_require__(97);
|
69 | __webpack_require__(98);
|
70 | __webpack_require__(99);
|
71 | __webpack_require__(101);
|
72 | __webpack_require__(104);
|
73 | __webpack_require__(106);
|
74 | __webpack_require__(108);
|
75 | __webpack_require__(109);
|
76 | __webpack_require__(110);
|
77 | __webpack_require__(111);
|
78 | __webpack_require__(113);
|
79 | __webpack_require__(114);
|
80 | __webpack_require__(116);
|
81 | __webpack_require__(117);
|
82 | __webpack_require__(118);
|
83 | __webpack_require__(119);
|
84 | __webpack_require__(121);
|
85 | __webpack_require__(122);
|
86 | __webpack_require__(124);
|
87 | __webpack_require__(125);
|
88 | __webpack_require__(126);
|
89 | __webpack_require__(127);
|
90 | __webpack_require__(128);
|
91 | __webpack_require__(129);
|
92 | __webpack_require__(130);
|
93 | __webpack_require__(132);
|
94 | __webpack_require__(133);
|
95 | __webpack_require__(134);
|
96 | __webpack_require__(138);
|
97 | __webpack_require__(140);
|
98 | __webpack_require__(141);
|
99 | __webpack_require__(142);
|
100 | __webpack_require__(143);
|
101 | __webpack_require__(145);
|
102 | __webpack_require__(146);
|
103 | __webpack_require__(147);
|
104 | __webpack_require__(148);
|
105 | __webpack_require__(150);
|
106 | __webpack_require__(153);
|
107 | __webpack_require__(154);
|
108 | __webpack_require__(155);
|
109 | __webpack_require__(156);
|
110 | __webpack_require__(157);
|
111 | __webpack_require__(158);
|
112 | __webpack_require__(160);
|
113 | __webpack_require__(161);
|
114 | __webpack_require__(162);
|
115 | __webpack_require__(163);
|
116 | __webpack_require__(164);
|
117 | __webpack_require__(165);
|
118 | __webpack_require__(166);
|
119 | __webpack_require__(167);
|
120 | __webpack_require__(168);
|
121 | __webpack_require__(170);
|
122 | __webpack_require__(172);
|
123 | __webpack_require__(173);
|
124 | __webpack_require__(174);
|
125 | __webpack_require__(175);
|
126 | __webpack_require__(176);
|
127 | __webpack_require__(177);
|
128 | __webpack_require__(179);
|
129 | __webpack_require__(183);
|
130 | __webpack_require__(184);
|
131 | __webpack_require__(192);
|
132 | __webpack_require__(194);
|
133 | __webpack_require__(198);
|
134 | __webpack_require__(199);
|
135 | __webpack_require__(200);
|
136 | __webpack_require__(202);
|
137 | __webpack_require__(203);
|
138 | __webpack_require__(204);
|
139 | __webpack_require__(205);
|
140 | __webpack_require__(209);
|
141 | __webpack_require__(210);
|
142 | __webpack_require__(211);
|
143 | __webpack_require__(212);
|
144 | __webpack_require__(215);
|
145 | __webpack_require__(216);
|
146 | __webpack_require__(217);
|
147 | __webpack_require__(218);
|
148 | __webpack_require__(219);
|
149 | __webpack_require__(220);
|
150 | __webpack_require__(221);
|
151 | __webpack_require__(222);
|
152 | __webpack_require__(223);
|
153 | __webpack_require__(224);
|
154 | __webpack_require__(225);
|
155 | __webpack_require__(226);
|
156 | __webpack_require__(227);
|
157 | __webpack_require__(228);
|
158 | __webpack_require__(186);
|
159 | __webpack_require__(230);
|
160 | __webpack_require__(231);
|
161 | __webpack_require__(232);
|
162 | __webpack_require__(233);
|
163 | __webpack_require__(234);
|
164 | __webpack_require__(236);
|
165 | __webpack_require__(238);
|
166 | __webpack_require__(239);
|
167 | __webpack_require__(240);
|
168 | __webpack_require__(242);
|
169 | __webpack_require__(244);
|
170 | __webpack_require__(245);
|
171 | __webpack_require__(246);
|
172 | __webpack_require__(247);
|
173 | __webpack_require__(248);
|
174 | __webpack_require__(249);
|
175 | __webpack_require__(250);
|
176 | __webpack_require__(252);
|
177 | __webpack_require__(253);
|
178 | __webpack_require__(255);
|
179 | __webpack_require__(256);
|
180 | __webpack_require__(257);
|
181 | __webpack_require__(259);
|
182 | __webpack_require__(260);
|
183 | __webpack_require__(262);
|
184 | __webpack_require__(263);
|
185 | __webpack_require__(265);
|
186 | __webpack_require__(266);
|
187 | __webpack_require__(267);
|
188 | __webpack_require__(268);
|
189 | __webpack_require__(269);
|
190 | __webpack_require__(270);
|
191 | __webpack_require__(271);
|
192 | __webpack_require__(272);
|
193 | __webpack_require__(273);
|
194 | __webpack_require__(274);
|
195 | __webpack_require__(275);
|
196 | __webpack_require__(276);
|
197 | __webpack_require__(277);
|
198 | __webpack_require__(279);
|
199 | __webpack_require__(280);
|
200 | __webpack_require__(282);
|
201 | __webpack_require__(283);
|
202 | __webpack_require__(284);
|
203 | __webpack_require__(296);
|
204 | __webpack_require__(297);
|
205 | __webpack_require__(298);
|
206 | __webpack_require__(299);
|
207 | __webpack_require__(302);
|
208 | __webpack_require__(303);
|
209 | __webpack_require__(305);
|
210 | __webpack_require__(306);
|
211 | __webpack_require__(311);
|
212 | __webpack_require__(313);
|
213 | __webpack_require__(314);
|
214 | __webpack_require__(315);
|
215 | __webpack_require__(321);
|
216 | __webpack_require__(322);
|
217 | __webpack_require__(323);
|
218 | __webpack_require__(324);
|
219 | __webpack_require__(325);
|
220 | __webpack_require__(326);
|
221 | __webpack_require__(327);
|
222 | __webpack_require__(328);
|
223 | __webpack_require__(329);
|
224 | __webpack_require__(330);
|
225 | __webpack_require__(331);
|
226 | __webpack_require__(332);
|
227 | __webpack_require__(333);
|
228 | __webpack_require__(334);
|
229 | __webpack_require__(336);
|
230 | __webpack_require__(337);
|
231 | __webpack_require__(338);
|
232 | __webpack_require__(339);
|
233 | __webpack_require__(340);
|
234 | __webpack_require__(341);
|
235 | __webpack_require__(342);
|
236 | __webpack_require__(343);
|
237 | __webpack_require__(344);
|
238 | __webpack_require__(345);
|
239 | __webpack_require__(346);
|
240 | __webpack_require__(347);
|
241 | __webpack_require__(348);
|
242 | __webpack_require__(349);
|
243 | __webpack_require__(350);
|
244 | __webpack_require__(351);
|
245 | __webpack_require__(352);
|
246 | __webpack_require__(353);
|
247 | __webpack_require__(354);
|
248 | __webpack_require__(355);
|
249 | __webpack_require__(356);
|
250 | __webpack_require__(357);
|
251 | __webpack_require__(358);
|
252 | __webpack_require__(359);
|
253 | __webpack_require__(360);
|
254 | __webpack_require__(361);
|
255 | __webpack_require__(362);
|
256 | __webpack_require__(363);
|
257 | __webpack_require__(364);
|
258 | __webpack_require__(365);
|
259 | __webpack_require__(366);
|
260 | __webpack_require__(367);
|
261 | __webpack_require__(368);
|
262 | var path = __webpack_require__(36);
|
263 |
|
264 | module.exports = path;
|
265 |
|
266 |
|
267 | }),
|
268 |
|
269 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
270 |
|
271 | "use strict";
|
272 |
|
273 | var $ = __webpack_require__(3);
|
274 | var global = __webpack_require__(4);
|
275 | var getBuiltIn = __webpack_require__(35);
|
276 | var IS_PURE = __webpack_require__(30);
|
277 | var DESCRIPTORS = __webpack_require__(6);
|
278 | var NATIVE_SYMBOL = __webpack_require__(46);
|
279 | var USE_SYMBOL_AS_UID = __webpack_require__(50);
|
280 | var fails = __webpack_require__(7);
|
281 | var has = __webpack_require__(16);
|
282 | var isArray = __webpack_require__(51);
|
283 | var isObject = __webpack_require__(15);
|
284 | var anObject = __webpack_require__(21);
|
285 | var toObject = __webpack_require__(52);
|
286 | var toIndexedObject = __webpack_require__(10);
|
287 | var toPrimitive = __webpack_require__(14);
|
288 | var createPropertyDescriptor = __webpack_require__(9);
|
289 | var nativeObjectCreate = __webpack_require__(53);
|
290 | var objectKeys = __webpack_require__(55);
|
291 | var getOwnPropertyNamesModule = __webpack_require__(37);
|
292 | var getOwnPropertyNamesExternal = __webpack_require__(57);
|
293 | var getOwnPropertySymbolsModule = __webpack_require__(44);
|
294 | var getOwnPropertyDescriptorModule = __webpack_require__(5);
|
295 | var definePropertyModule = __webpack_require__(20);
|
296 | var propertyIsEnumerableModule = __webpack_require__(8);
|
297 | var createNonEnumerableProperty = __webpack_require__(19);
|
298 | var redefine = __webpack_require__(22);
|
299 | var shared = __webpack_require__(29);
|
300 | var sharedKey = __webpack_require__(28);
|
301 | var hiddenKeys = __webpack_require__(32);
|
302 | var uid = __webpack_require__(31);
|
303 | var wellKnownSymbol = __webpack_require__(58);
|
304 | var wrappedWellKnownSymbolModule = __webpack_require__(59);
|
305 | var defineWellKnownSymbol = __webpack_require__(60);
|
306 | var setToStringTag = __webpack_require__(61);
|
307 | var InternalStateModule = __webpack_require__(26);
|
308 | var $forEach = __webpack_require__(62).forEach;
|
309 |
|
310 | var HIDDEN = sharedKey('hidden');
|
311 | var SYMBOL = 'Symbol';
|
312 | var PROTOTYPE = 'prototype';
|
313 | var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
314 | var setInternalState = InternalStateModule.set;
|
315 | var getInternalState = InternalStateModule.getterFor(SYMBOL);
|
316 | var ObjectPrototype = Object[PROTOTYPE];
|
317 | var $Symbol = global.Symbol;
|
318 | var $stringify = getBuiltIn('JSON', 'stringify');
|
319 | var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
320 | var nativeDefineProperty = definePropertyModule.f;
|
321 | var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
|
322 | var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
|
323 | var AllSymbols = shared('symbols');
|
324 | var ObjectPrototypeSymbols = shared('op-symbols');
|
325 | var StringToSymbolRegistry = shared('string-to-symbol-registry');
|
326 | var SymbolToStringRegistry = shared('symbol-to-string-registry');
|
327 | var WellKnownSymbolsStore = shared('wks');
|
328 | var QObject = global.QObject;
|
329 |
|
330 | var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
|
331 |
|
332 |
|
333 | var setSymbolDescriptor = DESCRIPTORS && fails(function () {
|
334 | return nativeObjectCreate(nativeDefineProperty({}, 'a', {
|
335 | get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }
|
336 | })).a != 7;
|
337 | }) ? function (O, P, Attributes) {
|
338 | var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);
|
339 | if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
|
340 | nativeDefineProperty(O, P, Attributes);
|
341 | if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
|
342 | nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
|
343 | }
|
344 | } : nativeDefineProperty;
|
345 |
|
346 | var wrap = function (tag, description) {
|
347 | var symbol = AllSymbols[tag] = nativeObjectCreate($Symbol[PROTOTYPE]);
|
348 | setInternalState(symbol, {
|
349 | type: SYMBOL,
|
350 | tag: tag,
|
351 | description: description
|
352 | });
|
353 | if (!DESCRIPTORS) symbol.description = description;
|
354 | return symbol;
|
355 | };
|
356 |
|
357 | var isSymbol = USE_SYMBOL_AS_UID ? function (it) {
|
358 | return typeof it == 'symbol';
|
359 | } : function (it) {
|
360 | return Object(it) instanceof $Symbol;
|
361 | };
|
362 |
|
363 | var $defineProperty = function defineProperty(O, P, Attributes) {
|
364 | if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
|
365 | anObject(O);
|
366 | var key = toPrimitive(P, true);
|
367 | anObject(Attributes);
|
368 | if (has(AllSymbols, key)) {
|
369 | if (!Attributes.enumerable) {
|
370 | if (!has(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
|
371 | O[HIDDEN][key] = true;
|
372 | } else {
|
373 | if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
|
374 | Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
|
375 | } return setSymbolDescriptor(O, key, Attributes);
|
376 | } return nativeDefineProperty(O, key, Attributes);
|
377 | };
|
378 |
|
379 | var $defineProperties = function defineProperties(O, Properties) {
|
380 | anObject(O);
|
381 | var properties = toIndexedObject(Properties);
|
382 | var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
|
383 | $forEach(keys, function (key) {
|
384 | if (!DESCRIPTORS || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]);
|
385 | });
|
386 | return O;
|
387 | };
|
388 |
|
389 | var $create = function create(O, Properties) {
|
390 | return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
|
391 | };
|
392 |
|
393 | var $propertyIsEnumerable = function propertyIsEnumerable(V) {
|
394 | var P = toPrimitive(V, true);
|
395 | var enumerable = nativePropertyIsEnumerable.call(this, P);
|
396 | if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false;
|
397 | return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true;
|
398 | };
|
399 |
|
400 | var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
|
401 | var it = toIndexedObject(O);
|
402 | var key = toPrimitive(P, true);
|
403 | if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return;
|
404 | var descriptor = nativeGetOwnPropertyDescriptor(it, key);
|
405 | if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) {
|
406 | descriptor.enumerable = true;
|
407 | }
|
408 | return descriptor;
|
409 | };
|
410 |
|
411 | var $getOwnPropertyNames = function getOwnPropertyNames(O) {
|
412 | var names = nativeGetOwnPropertyNames(toIndexedObject(O));
|
413 | var result = [];
|
414 | $forEach(names, function (key) {
|
415 | if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key);
|
416 | });
|
417 | return result;
|
418 | };
|
419 |
|
420 | var $getOwnPropertySymbols = function getOwnPropertySymbols(O) {
|
421 | var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
|
422 | var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
|
423 | var result = [];
|
424 | $forEach(names, function (key) {
|
425 | if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key))) {
|
426 | result.push(AllSymbols[key]);
|
427 | }
|
428 | });
|
429 | return result;
|
430 | };
|
431 |
|
432 |
|
433 |
|
434 | if (!NATIVE_SYMBOL) {
|
435 | $Symbol = function Symbol() {
|
436 | if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor');
|
437 | var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]);
|
438 | var tag = uid(description);
|
439 | var setter = function (value) {
|
440 | if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value);
|
441 | if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
|
442 | setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
|
443 | };
|
444 | if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
|
445 | return wrap(tag, description);
|
446 | };
|
447 |
|
448 | redefine($Symbol[PROTOTYPE], 'toString', function toString() {
|
449 | return getInternalState(this).tag;
|
450 | });
|
451 |
|
452 | redefine($Symbol, 'withoutSetter', function (description) {
|
453 | return wrap(uid(description), description);
|
454 | });
|
455 |
|
456 | propertyIsEnumerableModule.f = $propertyIsEnumerable;
|
457 | definePropertyModule.f = $defineProperty;
|
458 | getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
|
459 | getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
|
460 | getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
|
461 |
|
462 | wrappedWellKnownSymbolModule.f = function (name) {
|
463 | return wrap(wellKnownSymbol(name), name);
|
464 | };
|
465 |
|
466 | if (DESCRIPTORS) {
|
467 |
|
468 | nativeDefineProperty($Symbol[PROTOTYPE], 'description', {
|
469 | configurable: true,
|
470 | get: function description() {
|
471 | return getInternalState(this).description;
|
472 | }
|
473 | });
|
474 | if (!IS_PURE) {
|
475 | redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
|
476 | }
|
477 | }
|
478 | }
|
479 |
|
480 | $({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
|
481 | Symbol: $Symbol
|
482 | });
|
483 |
|
484 | $forEach(objectKeys(WellKnownSymbolsStore), function (name) {
|
485 | defineWellKnownSymbol(name);
|
486 | });
|
487 |
|
488 | $({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
|
489 |
|
490 |
|
491 | 'for': function (key) {
|
492 | var string = String(key);
|
493 | if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
|
494 | var symbol = $Symbol(string);
|
495 | StringToSymbolRegistry[string] = symbol;
|
496 | SymbolToStringRegistry[symbol] = string;
|
497 | return symbol;
|
498 | },
|
499 |
|
500 |
|
501 | keyFor: function keyFor(sym) {
|
502 | if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol');
|
503 | if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
|
504 | },
|
505 | useSetter: function () { USE_SETTER = true; },
|
506 | useSimple: function () { USE_SETTER = false; }
|
507 | });
|
508 |
|
509 | $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
|
510 |
|
511 |
|
512 | create: $create,
|
513 |
|
514 |
|
515 | defineProperty: $defineProperty,
|
516 |
|
517 |
|
518 | defineProperties: $defineProperties,
|
519 |
|
520 |
|
521 | getOwnPropertyDescriptor: $getOwnPropertyDescriptor
|
522 | });
|
523 |
|
524 | $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {
|
525 |
|
526 |
|
527 | getOwnPropertyNames: $getOwnPropertyNames,
|
528 |
|
529 |
|
530 | getOwnPropertySymbols: $getOwnPropertySymbols
|
531 | });
|
532 |
|
533 |
|
534 |
|
535 | $({ target: 'Object', stat: true, forced: fails(function () { getOwnPropertySymbolsModule.f(1); }) }, {
|
536 | getOwnPropertySymbols: function getOwnPropertySymbols(it) {
|
537 | return getOwnPropertySymbolsModule.f(toObject(it));
|
538 | }
|
539 | });
|
540 |
|
541 |
|
542 |
|
543 | if ($stringify) {
|
544 | var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails(function () {
|
545 | var symbol = $Symbol();
|
546 |
|
547 | return $stringify([symbol]) != '[null]'
|
548 |
|
549 | || $stringify({ a: symbol }) != '{}'
|
550 |
|
551 | || $stringify(Object(symbol)) != '{}';
|
552 | });
|
553 |
|
554 | $({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, {
|
555 |
|
556 | stringify: function stringify(it, replacer, space) {
|
557 | var args = [it];
|
558 | var index = 1;
|
559 | var $replacer;
|
560 | while (arguments.length > index) args.push(arguments[index++]);
|
561 | $replacer = replacer;
|
562 | if (!isObject(replacer) && it === undefined || isSymbol(it)) return;
|
563 | if (!isArray(replacer)) replacer = function (key, value) {
|
564 | if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
|
565 | if (!isSymbol(value)) return value;
|
566 | };
|
567 | args[1] = replacer;
|
568 | return $stringify.apply(null, args);
|
569 | }
|
570 | });
|
571 | }
|
572 |
|
573 |
|
574 |
|
575 | if (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) {
|
576 | createNonEnumerableProperty($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
|
577 | }
|
578 |
|
579 |
|
580 | setToStringTag($Symbol, SYMBOL);
|
581 |
|
582 | hiddenKeys[HIDDEN] = true;
|
583 |
|
584 |
|
585 | }),
|
586 |
|
587 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
588 |
|
589 | var global = __webpack_require__(4);
|
590 | var getOwnPropertyDescriptor = __webpack_require__(5).f;
|
591 | var createNonEnumerableProperty = __webpack_require__(19);
|
592 | var redefine = __webpack_require__(22);
|
593 | var setGlobal = __webpack_require__(23);
|
594 | var copyConstructorProperties = __webpack_require__(33);
|
595 | var isForced = __webpack_require__(45);
|
596 |
|
597 |
|
598 |
|
599 |
|
600 |
|
601 |
|
602 |
|
603 |
|
604 |
|
605 |
|
606 |
|
607 |
|
608 |
|
609 |
|
610 |
|
611 | module.exports = function (options, source) {
|
612 | var TARGET = options.target;
|
613 | var GLOBAL = options.global;
|
614 | var STATIC = options.stat;
|
615 | var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
616 | if (GLOBAL) {
|
617 | target = global;
|
618 | } else if (STATIC) {
|
619 | target = global[TARGET] || setGlobal(TARGET, {});
|
620 | } else {
|
621 | target = (global[TARGET] || {}).prototype;
|
622 | }
|
623 | if (target) for (key in source) {
|
624 | sourceProperty = source[key];
|
625 | if (options.noTargetGet) {
|
626 | descriptor = getOwnPropertyDescriptor(target, key);
|
627 | targetProperty = descriptor && descriptor.value;
|
628 | } else targetProperty = target[key];
|
629 | FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
630 |
|
631 | if (!FORCED && targetProperty !== undefined) {
|
632 | if (typeof sourceProperty === typeof targetProperty) continue;
|
633 | copyConstructorProperties(sourceProperty, targetProperty);
|
634 | }
|
635 |
|
636 | if (options.sham || (targetProperty && targetProperty.sham)) {
|
637 | createNonEnumerableProperty(sourceProperty, 'sham', true);
|
638 | }
|
639 |
|
640 | redefine(target, key, sourceProperty, options);
|
641 | }
|
642 | };
|
643 |
|
644 |
|
645 | }),
|
646 |
|
647 | (function(module) {
|
648 |
|
649 | var check = function (it) {
|
650 | return it && it.Math == Math && it;
|
651 | };
|
652 |
|
653 |
|
654 | module.exports =
|
655 |
|
656 | check(typeof globalThis == 'object' && globalThis) ||
|
657 | check(typeof window == 'object' && window) ||
|
658 | check(typeof self == 'object' && self) ||
|
659 | check(typeof global == 'object' && global) ||
|
660 |
|
661 | (function () { return this; })() || Function('return this')();
|
662 |
|
663 |
|
664 | }),
|
665 |
|
666 | (function(__unused_webpack_module, exports, __webpack_require__) {
|
667 |
|
668 | var DESCRIPTORS = __webpack_require__(6);
|
669 | var propertyIsEnumerableModule = __webpack_require__(8);
|
670 | var createPropertyDescriptor = __webpack_require__(9);
|
671 | var toIndexedObject = __webpack_require__(10);
|
672 | var toPrimitive = __webpack_require__(14);
|
673 | var has = __webpack_require__(16);
|
674 | var IE8_DOM_DEFINE = __webpack_require__(17);
|
675 |
|
676 | var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
677 |
|
678 |
|
679 |
|
680 | exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
|
681 | O = toIndexedObject(O);
|
682 | P = toPrimitive(P, true);
|
683 | if (IE8_DOM_DEFINE) try {
|
684 | return nativeGetOwnPropertyDescriptor(O, P);
|
685 | } catch (error) { }
|
686 | if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);
|
687 | };
|
688 |
|
689 |
|
690 | }),
|
691 |
|
692 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
693 |
|
694 | var fails = __webpack_require__(7);
|
695 |
|
696 |
|
697 | module.exports = !fails(function () {
|
698 | return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
699 | });
|
700 |
|
701 |
|
702 | }),
|
703 |
|
704 | (function(module) {
|
705 |
|
706 | module.exports = function (exec) {
|
707 | try {
|
708 | return !!exec();
|
709 | } catch (error) {
|
710 | return true;
|
711 | }
|
712 | };
|
713 |
|
714 |
|
715 | }),
|
716 |
|
717 | (function(__unused_webpack_module, exports) {
|
718 |
|
719 | "use strict";
|
720 |
|
721 | var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
|
722 | var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
723 |
|
724 |
|
725 | var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
|
726 |
|
727 |
|
728 |
|
729 | exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
730 | var descriptor = getOwnPropertyDescriptor(this, V);
|
731 | return !!descriptor && descriptor.enumerable;
|
732 | } : nativePropertyIsEnumerable;
|
733 |
|
734 |
|
735 | }),
|
736 |
|
737 | (function(module) {
|
738 |
|
739 | module.exports = function (bitmap, value) {
|
740 | return {
|
741 | enumerable: !(bitmap & 1),
|
742 | configurable: !(bitmap & 2),
|
743 | writable: !(bitmap & 4),
|
744 | value: value
|
745 | };
|
746 | };
|
747 |
|
748 |
|
749 | }),
|
750 |
|
751 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
752 |
|
753 |
|
754 | var IndexedObject = __webpack_require__(11);
|
755 | var requireObjectCoercible = __webpack_require__(13);
|
756 |
|
757 | module.exports = function (it) {
|
758 | return IndexedObject(requireObjectCoercible(it));
|
759 | };
|
760 |
|
761 |
|
762 | }),
|
763 |
|
764 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
765 |
|
766 | var fails = __webpack_require__(7);
|
767 | var classof = __webpack_require__(12);
|
768 |
|
769 | var split = ''.split;
|
770 |
|
771 |
|
772 | module.exports = fails(function () {
|
773 |
|
774 |
|
775 | return !Object('z').propertyIsEnumerable(0);
|
776 | }) ? function (it) {
|
777 | return classof(it) == 'String' ? split.call(it, '') : Object(it);
|
778 | } : Object;
|
779 |
|
780 |
|
781 | }),
|
782 |
|
783 | (function(module) {
|
784 |
|
785 | var toString = {}.toString;
|
786 |
|
787 | module.exports = function (it) {
|
788 | return toString.call(it).slice(8, -1);
|
789 | };
|
790 |
|
791 |
|
792 | }),
|
793 |
|
794 | (function(module) {
|
795 |
|
796 |
|
797 |
|
798 | module.exports = function (it) {
|
799 | if (it == undefined) throw TypeError("Can't call method on " + it);
|
800 | return it;
|
801 | };
|
802 |
|
803 |
|
804 | }),
|
805 |
|
806 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
807 |
|
808 | var isObject = __webpack_require__(15);
|
809 |
|
810 |
|
811 |
|
812 |
|
813 |
|
814 | module.exports = function (input, PREFERRED_STRING) {
|
815 | if (!isObject(input)) return input;
|
816 | var fn, val;
|
817 | if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
|
818 | if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
|
819 | if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
|
820 | throw TypeError("Can't convert object to primitive value");
|
821 | };
|
822 |
|
823 |
|
824 | }),
|
825 |
|
826 | (function(module) {
|
827 |
|
828 | module.exports = function (it) {
|
829 | return typeof it === 'object' ? it !== null : typeof it === 'function';
|
830 | };
|
831 |
|
832 |
|
833 | }),
|
834 |
|
835 | (function(module) {
|
836 |
|
837 | var hasOwnProperty = {}.hasOwnProperty;
|
838 |
|
839 | module.exports = function (it, key) {
|
840 | return hasOwnProperty.call(it, key);
|
841 | };
|
842 |
|
843 |
|
844 | }),
|
845 |
|
846 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
847 |
|
848 | var DESCRIPTORS = __webpack_require__(6);
|
849 | var fails = __webpack_require__(7);
|
850 | var createElement = __webpack_require__(18);
|
851 |
|
852 |
|
853 | module.exports = !DESCRIPTORS && !fails(function () {
|
854 | return Object.defineProperty(createElement('div'), 'a', {
|
855 | get: function () { return 7; }
|
856 | }).a != 7;
|
857 | });
|
858 |
|
859 |
|
860 | }),
|
861 |
|
862 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
863 |
|
864 | var global = __webpack_require__(4);
|
865 | var isObject = __webpack_require__(15);
|
866 |
|
867 | var document = global.document;
|
868 |
|
869 | var EXISTS = isObject(document) && isObject(document.createElement);
|
870 |
|
871 | module.exports = function (it) {
|
872 | return EXISTS ? document.createElement(it) : {};
|
873 | };
|
874 |
|
875 |
|
876 | }),
|
877 |
|
878 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
879 |
|
880 | var DESCRIPTORS = __webpack_require__(6);
|
881 | var definePropertyModule = __webpack_require__(20);
|
882 | var createPropertyDescriptor = __webpack_require__(9);
|
883 |
|
884 | module.exports = DESCRIPTORS ? function (object, key, value) {
|
885 | return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
|
886 | } : function (object, key, value) {
|
887 | object[key] = value;
|
888 | return object;
|
889 | };
|
890 |
|
891 |
|
892 | }),
|
893 |
|
894 | (function(__unused_webpack_module, exports, __webpack_require__) {
|
895 |
|
896 | var DESCRIPTORS = __webpack_require__(6);
|
897 | var IE8_DOM_DEFINE = __webpack_require__(17);
|
898 | var anObject = __webpack_require__(21);
|
899 | var toPrimitive = __webpack_require__(14);
|
900 |
|
901 | var nativeDefineProperty = Object.defineProperty;
|
902 |
|
903 |
|
904 |
|
905 | exports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
|
906 | anObject(O);
|
907 | P = toPrimitive(P, true);
|
908 | anObject(Attributes);
|
909 | if (IE8_DOM_DEFINE) try {
|
910 | return nativeDefineProperty(O, P, Attributes);
|
911 | } catch (error) { }
|
912 | if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
|
913 | if ('value' in Attributes) O[P] = Attributes.value;
|
914 | return O;
|
915 | };
|
916 |
|
917 |
|
918 | }),
|
919 |
|
920 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
921 |
|
922 | var isObject = __webpack_require__(15);
|
923 |
|
924 | module.exports = function (it) {
|
925 | if (!isObject(it)) {
|
926 | throw TypeError(String(it) + ' is not an object');
|
927 | } return it;
|
928 | };
|
929 |
|
930 |
|
931 | }),
|
932 |
|
933 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
934 |
|
935 | var global = __webpack_require__(4);
|
936 | var createNonEnumerableProperty = __webpack_require__(19);
|
937 | var has = __webpack_require__(16);
|
938 | var setGlobal = __webpack_require__(23);
|
939 | var inspectSource = __webpack_require__(24);
|
940 | var InternalStateModule = __webpack_require__(26);
|
941 |
|
942 | var getInternalState = InternalStateModule.get;
|
943 | var enforceInternalState = InternalStateModule.enforce;
|
944 | var TEMPLATE = String(String).split('String');
|
945 |
|
946 | (module.exports = function (O, key, value, options) {
|
947 | var unsafe = options ? !!options.unsafe : false;
|
948 | var simple = options ? !!options.enumerable : false;
|
949 | var noTargetGet = options ? !!options.noTargetGet : false;
|
950 | var state;
|
951 | if (typeof value == 'function') {
|
952 | if (typeof key == 'string' && !has(value, 'name')) {
|
953 | createNonEnumerableProperty(value, 'name', key);
|
954 | }
|
955 | state = enforceInternalState(value);
|
956 | if (!state.source) {
|
957 | state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
|
958 | }
|
959 | }
|
960 | if (O === global) {
|
961 | if (simple) O[key] = value;
|
962 | else setGlobal(key, value);
|
963 | return;
|
964 | } else if (!unsafe) {
|
965 | delete O[key];
|
966 | } else if (!noTargetGet && O[key]) {
|
967 | simple = true;
|
968 | }
|
969 | if (simple) O[key] = value;
|
970 | else createNonEnumerableProperty(O, key, value);
|
971 |
|
972 | })(Function.prototype, 'toString', function toString() {
|
973 | return typeof this == 'function' && getInternalState(this).source || inspectSource(this);
|
974 | });
|
975 |
|
976 |
|
977 | }),
|
978 |
|
979 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
980 |
|
981 | var global = __webpack_require__(4);
|
982 | var createNonEnumerableProperty = __webpack_require__(19);
|
983 |
|
984 | module.exports = function (key, value) {
|
985 | try {
|
986 | createNonEnumerableProperty(global, key, value);
|
987 | } catch (error) {
|
988 | global[key] = value;
|
989 | } return value;
|
990 | };
|
991 |
|
992 |
|
993 | }),
|
994 |
|
995 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
996 |
|
997 | var store = __webpack_require__(25);
|
998 |
|
999 | var functionToString = Function.toString;
|
1000 |
|
1001 |
|
1002 | if (typeof store.inspectSource != 'function') {
|
1003 | store.inspectSource = function (it) {
|
1004 | return functionToString.call(it);
|
1005 | };
|
1006 | }
|
1007 |
|
1008 | module.exports = store.inspectSource;
|
1009 |
|
1010 |
|
1011 | }),
|
1012 |
|
1013 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1014 |
|
1015 | var global = __webpack_require__(4);
|
1016 | var setGlobal = __webpack_require__(23);
|
1017 |
|
1018 | var SHARED = '__core-js_shared__';
|
1019 | var store = global[SHARED] || setGlobal(SHARED, {});
|
1020 |
|
1021 | module.exports = store;
|
1022 |
|
1023 |
|
1024 | }),
|
1025 |
|
1026 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1027 |
|
1028 | var NATIVE_WEAK_MAP = __webpack_require__(27);
|
1029 | var global = __webpack_require__(4);
|
1030 | var isObject = __webpack_require__(15);
|
1031 | var createNonEnumerableProperty = __webpack_require__(19);
|
1032 | var objectHas = __webpack_require__(16);
|
1033 | var shared = __webpack_require__(25);
|
1034 | var sharedKey = __webpack_require__(28);
|
1035 | var hiddenKeys = __webpack_require__(32);
|
1036 |
|
1037 | var WeakMap = global.WeakMap;
|
1038 | var set, get, has;
|
1039 |
|
1040 | var enforce = function (it) {
|
1041 | return has(it) ? get(it) : set(it, {});
|
1042 | };
|
1043 |
|
1044 | var getterFor = function (TYPE) {
|
1045 | return function (it) {
|
1046 | var state;
|
1047 | if (!isObject(it) || (state = get(it)).type !== TYPE) {
|
1048 | throw TypeError('Incompatible receiver, ' + TYPE + ' required');
|
1049 | } return state;
|
1050 | };
|
1051 | };
|
1052 |
|
1053 | if (NATIVE_WEAK_MAP) {
|
1054 | var store = shared.state || (shared.state = new WeakMap());
|
1055 | var wmget = store.get;
|
1056 | var wmhas = store.has;
|
1057 | var wmset = store.set;
|
1058 | set = function (it, metadata) {
|
1059 | metadata.facade = it;
|
1060 | wmset.call(store, it, metadata);
|
1061 | return metadata;
|
1062 | };
|
1063 | get = function (it) {
|
1064 | return wmget.call(store, it) || {};
|
1065 | };
|
1066 | has = function (it) {
|
1067 | return wmhas.call(store, it);
|
1068 | };
|
1069 | } else {
|
1070 | var STATE = sharedKey('state');
|
1071 | hiddenKeys[STATE] = true;
|
1072 | set = function (it, metadata) {
|
1073 | metadata.facade = it;
|
1074 | createNonEnumerableProperty(it, STATE, metadata);
|
1075 | return metadata;
|
1076 | };
|
1077 | get = function (it) {
|
1078 | return objectHas(it, STATE) ? it[STATE] : {};
|
1079 | };
|
1080 | has = function (it) {
|
1081 | return objectHas(it, STATE);
|
1082 | };
|
1083 | }
|
1084 |
|
1085 | module.exports = {
|
1086 | set: set,
|
1087 | get: get,
|
1088 | has: has,
|
1089 | enforce: enforce,
|
1090 | getterFor: getterFor
|
1091 | };
|
1092 |
|
1093 |
|
1094 | /***/ }),
|
1095 | /* 27 */
|
1096 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
1097 |
|
1098 | var global = __webpack_require__(4);
|
1099 | var inspectSource = __webpack_require__(24);
|
1100 |
|
1101 | var WeakMap = global.WeakMap;
|
1102 |
|
1103 | module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap));
|
1104 |
|
1105 |
|
1106 | }),
|
1107 |
|
1108 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1109 |
|
1110 | var shared = __webpack_require__(29);
|
1111 | var uid = __webpack_require__(31);
|
1112 |
|
1113 | var keys = shared('keys');
|
1114 |
|
1115 | module.exports = function (key) {
|
1116 | return keys[key] || (keys[key] = uid(key));
|
1117 | };
|
1118 |
|
1119 |
|
1120 | }),
|
1121 |
|
1122 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1123 |
|
1124 | var IS_PURE = __webpack_require__(30);
|
1125 | var store = __webpack_require__(25);
|
1126 |
|
1127 | (module.exports = function (key, value) {
|
1128 | return store[key] || (store[key] = value !== undefined ? value : {});
|
1129 | })('versions', []).push({
|
1130 | version: '3.9.1',
|
1131 | mode: IS_PURE ? 'pure' : 'global',
|
1132 | copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
|
1133 | });
|
1134 |
|
1135 |
|
1136 | }),
|
1137 |
|
1138 | (function(module) {
|
1139 |
|
1140 | module.exports = false;
|
1141 |
|
1142 |
|
1143 | }),
|
1144 |
|
1145 | (function(module) {
|
1146 |
|
1147 | var id = 0;
|
1148 | var postfix = Math.random();
|
1149 |
|
1150 | module.exports = function (key) {
|
1151 | return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
|
1152 | };
|
1153 |
|
1154 |
|
1155 | }),
|
1156 |
|
1157 | (function(module) {
|
1158 |
|
1159 | module.exports = {};
|
1160 |
|
1161 |
|
1162 | }),
|
1163 |
|
1164 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1165 |
|
1166 | var has = __webpack_require__(16);
|
1167 | var ownKeys = __webpack_require__(34);
|
1168 | var getOwnPropertyDescriptorModule = __webpack_require__(5);
|
1169 | var definePropertyModule = __webpack_require__(20);
|
1170 |
|
1171 | module.exports = function (target, source) {
|
1172 | var keys = ownKeys(source);
|
1173 | var defineProperty = definePropertyModule.f;
|
1174 | var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
1175 | for (var i = 0; i < keys.length; i++) {
|
1176 | var key = keys[i];
|
1177 | if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
1178 | }
|
1179 | };
|
1180 |
|
1181 |
|
1182 | }),
|
1183 |
|
1184 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1185 |
|
1186 | var getBuiltIn = __webpack_require__(35);
|
1187 | var getOwnPropertyNamesModule = __webpack_require__(37);
|
1188 | var getOwnPropertySymbolsModule = __webpack_require__(44);
|
1189 | var anObject = __webpack_require__(21);
|
1190 |
|
1191 |
|
1192 | module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
1193 | var keys = getOwnPropertyNamesModule.f(anObject(it));
|
1194 | var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
1195 | return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
|
1196 | };
|
1197 |
|
1198 |
|
1199 | }),
|
1200 |
|
1201 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1202 |
|
1203 | var path = __webpack_require__(36);
|
1204 | var global = __webpack_require__(4);
|
1205 |
|
1206 | var aFunction = function (variable) {
|
1207 | return typeof variable == 'function' ? variable : undefined;
|
1208 | };
|
1209 |
|
1210 | module.exports = function (namespace, method) {
|
1211 | return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
|
1212 | : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
|
1213 | };
|
1214 |
|
1215 |
|
1216 | }),
|
1217 |
|
1218 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1219 |
|
1220 | var global = __webpack_require__(4);
|
1221 |
|
1222 | module.exports = global;
|
1223 |
|
1224 |
|
1225 | }),
|
1226 |
|
1227 | (function(__unused_webpack_module, exports, __webpack_require__) {
|
1228 |
|
1229 | var internalObjectKeys = __webpack_require__(38);
|
1230 | var enumBugKeys = __webpack_require__(43);
|
1231 |
|
1232 | var hiddenKeys = enumBugKeys.concat('length', 'prototype');
|
1233 |
|
1234 |
|
1235 |
|
1236 | exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
1237 | return internalObjectKeys(O, hiddenKeys);
|
1238 | };
|
1239 |
|
1240 |
|
1241 | }),
|
1242 |
|
1243 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1244 |
|
1245 | var has = __webpack_require__(16);
|
1246 | var toIndexedObject = __webpack_require__(10);
|
1247 | var indexOf = __webpack_require__(39).indexOf;
|
1248 | var hiddenKeys = __webpack_require__(32);
|
1249 |
|
1250 | module.exports = function (object, names) {
|
1251 | var O = toIndexedObject(object);
|
1252 | var i = 0;
|
1253 | var result = [];
|
1254 | var key;
|
1255 | for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key);
|
1256 |
|
1257 | while (names.length > i) if (has(O, key = names[i++])) {
|
1258 | ~indexOf(result, key) || result.push(key);
|
1259 | }
|
1260 | return result;
|
1261 | };
|
1262 |
|
1263 |
|
1264 | }),
|
1265 |
|
1266 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1267 |
|
1268 | var toIndexedObject = __webpack_require__(10);
|
1269 | var toLength = __webpack_require__(40);
|
1270 | var toAbsoluteIndex = __webpack_require__(42);
|
1271 |
|
1272 |
|
1273 | var createMethod = function (IS_INCLUDES) {
|
1274 | return function ($this, el, fromIndex) {
|
1275 | var O = toIndexedObject($this);
|
1276 | var length = toLength(O.length);
|
1277 | var index = toAbsoluteIndex(fromIndex, length);
|
1278 | var value;
|
1279 |
|
1280 |
|
1281 | if (IS_INCLUDES && el != el) while (length > index) {
|
1282 | value = O[index++];
|
1283 |
|
1284 | if (value != value) return true;
|
1285 |
|
1286 | } else for (;length > index; index++) {
|
1287 | if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
1288 | } return !IS_INCLUDES && -1;
|
1289 | };
|
1290 | };
|
1291 |
|
1292 | module.exports = {
|
1293 |
|
1294 |
|
1295 | includes: createMethod(true),
|
1296 |
|
1297 |
|
1298 | indexOf: createMethod(false)
|
1299 | };
|
1300 |
|
1301 |
|
1302 | }),
|
1303 |
|
1304 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1305 |
|
1306 | var toInteger = __webpack_require__(41);
|
1307 |
|
1308 | var min = Math.min;
|
1309 |
|
1310 |
|
1311 |
|
1312 | module.exports = function (argument) {
|
1313 | return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0;
|
1314 | };
|
1315 |
|
1316 |
|
1317 | }),
|
1318 |
|
1319 | (function(module) {
|
1320 |
|
1321 | var ceil = Math.ceil;
|
1322 | var floor = Math.floor;
|
1323 |
|
1324 |
|
1325 |
|
1326 | module.exports = function (argument) {
|
1327 | return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
|
1328 | };
|
1329 |
|
1330 |
|
1331 | }),
|
1332 |
|
1333 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1334 |
|
1335 | var toInteger = __webpack_require__(41);
|
1336 |
|
1337 | var max = Math.max;
|
1338 | var min = Math.min;
|
1339 |
|
1340 |
|
1341 |
|
1342 |
|
1343 | module.exports = function (index, length) {
|
1344 | var integer = toInteger(index);
|
1345 | return integer < 0 ? max(integer + length, 0) : min(integer, length);
|
1346 | };
|
1347 |
|
1348 |
|
1349 | }),
|
1350 |
|
1351 | (function(module) {
|
1352 |
|
1353 |
|
1354 | module.exports = [
|
1355 | 'constructor',
|
1356 | 'hasOwnProperty',
|
1357 | 'isPrototypeOf',
|
1358 | 'propertyIsEnumerable',
|
1359 | 'toLocaleString',
|
1360 | 'toString',
|
1361 | 'valueOf'
|
1362 | ];
|
1363 |
|
1364 |
|
1365 | }),
|
1366 |
|
1367 | (function(__unused_webpack_module, exports) {
|
1368 |
|
1369 | exports.f = Object.getOwnPropertySymbols;
|
1370 |
|
1371 |
|
1372 | }),
|
1373 |
|
1374 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1375 |
|
1376 | var fails = __webpack_require__(7);
|
1377 |
|
1378 | var replacement = /#|\.prototype\./;
|
1379 |
|
1380 | var isForced = function (feature, detection) {
|
1381 | var value = data[normalize(feature)];
|
1382 | return value == POLYFILL ? true
|
1383 | : value == NATIVE ? false
|
1384 | : typeof detection == 'function' ? fails(detection)
|
1385 | : !!detection;
|
1386 | };
|
1387 |
|
1388 | var normalize = isForced.normalize = function (string) {
|
1389 | return String(string).replace(replacement, '.').toLowerCase();
|
1390 | };
|
1391 |
|
1392 | var data = isForced.data = {};
|
1393 | var NATIVE = isForced.NATIVE = 'N';
|
1394 | var POLYFILL = isForced.POLYFILL = 'P';
|
1395 |
|
1396 | module.exports = isForced;
|
1397 |
|
1398 |
|
1399 | }),
|
1400 |
|
1401 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1402 |
|
1403 | var IS_NODE = __webpack_require__(47);
|
1404 | var V8_VERSION = __webpack_require__(48);
|
1405 | var fails = __webpack_require__(7);
|
1406 |
|
1407 | module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
|
1408 |
|
1409 | return !Symbol.sham &&
|
1410 |
|
1411 |
|
1412 | (IS_NODE ? V8_VERSION === 38 : V8_VERSION > 37 && V8_VERSION < 41);
|
1413 | });
|
1414 |
|
1415 |
|
1416 | }),
|
1417 |
|
1418 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1419 |
|
1420 | var classof = __webpack_require__(12);
|
1421 | var global = __webpack_require__(4);
|
1422 |
|
1423 | module.exports = classof(global.process) == 'process';
|
1424 |
|
1425 |
|
1426 | }),
|
1427 |
|
1428 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1429 |
|
1430 | var global = __webpack_require__(4);
|
1431 | var userAgent = __webpack_require__(49);
|
1432 |
|
1433 | var process = global.process;
|
1434 | var versions = process && process.versions;
|
1435 | var v8 = versions && versions.v8;
|
1436 | var match, version;
|
1437 |
|
1438 | if (v8) {
|
1439 | match = v8.split('.');
|
1440 | version = match[0] + match[1];
|
1441 | } else if (userAgent) {
|
1442 | match = userAgent.match(/Edge\/(\d+)/);
|
1443 | if (!match || match[1] >= 74) {
|
1444 | match = userAgent.match(/Chrome\/(\d+)/);
|
1445 | if (match) version = match[1];
|
1446 | }
|
1447 | }
|
1448 |
|
1449 | module.exports = version && +version;
|
1450 |
|
1451 |
|
1452 | }),
|
1453 |
|
1454 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1455 |
|
1456 | var getBuiltIn = __webpack_require__(35);
|
1457 |
|
1458 | module.exports = getBuiltIn('navigator', 'userAgent') || '';
|
1459 |
|
1460 |
|
1461 | }),
|
1462 |
|
1463 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1464 |
|
1465 | var NATIVE_SYMBOL = __webpack_require__(46);
|
1466 |
|
1467 | module.exports = NATIVE_SYMBOL
|
1468 |
|
1469 | && !Symbol.sham
|
1470 | && typeof Symbol.iterator == 'symbol';
|
1471 |
|
1472 |
|
1473 | }),
|
1474 |
|
1475 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1476 |
|
1477 | var classof = __webpack_require__(12);
|
1478 |
|
1479 |
|
1480 |
|
1481 | module.exports = Array.isArray || function isArray(arg) {
|
1482 | return classof(arg) == 'Array';
|
1483 | };
|
1484 |
|
1485 |
|
1486 | }),
|
1487 |
|
1488 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1489 |
|
1490 | var requireObjectCoercible = __webpack_require__(13);
|
1491 |
|
1492 |
|
1493 |
|
1494 | module.exports = function (argument) {
|
1495 | return Object(requireObjectCoercible(argument));
|
1496 | };
|
1497 |
|
1498 |
|
1499 | }),
|
1500 |
|
1501 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1502 |
|
1503 | var anObject = __webpack_require__(21);
|
1504 | var defineProperties = __webpack_require__(54);
|
1505 | var enumBugKeys = __webpack_require__(43);
|
1506 | var hiddenKeys = __webpack_require__(32);
|
1507 | var html = __webpack_require__(56);
|
1508 | var documentCreateElement = __webpack_require__(18);
|
1509 | var sharedKey = __webpack_require__(28);
|
1510 |
|
1511 | var GT = '>';
|
1512 | var LT = '<';
|
1513 | var PROTOTYPE = 'prototype';
|
1514 | var SCRIPT = 'script';
|
1515 | var IE_PROTO = sharedKey('IE_PROTO');
|
1516 |
|
1517 | var EmptyConstructor = function () { };
|
1518 |
|
1519 | var scriptTag = function (content) {
|
1520 | return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
1521 | };
|
1522 |
|
1523 |
|
1524 | var NullProtoObjectViaActiveX = function (activeXDocument) {
|
1525 | activeXDocument.write(scriptTag(''));
|
1526 | activeXDocument.close();
|
1527 | var temp = activeXDocument.parentWindow.Object;
|
1528 | activeXDocument = null;
|
1529 | return temp;
|
1530 | };
|
1531 |
|
1532 |
|
1533 | var NullProtoObjectViaIFrame = function () {
|
1534 |
|
1535 | var iframe = documentCreateElement('iframe');
|
1536 | var JS = 'java' + SCRIPT + ':';
|
1537 | var iframeDocument;
|
1538 | iframe.style.display = 'none';
|
1539 | html.appendChild(iframe);
|
1540 |
|
1541 | iframe.src = String(JS);
|
1542 | iframeDocument = iframe.contentWindow.document;
|
1543 | iframeDocument.open();
|
1544 | iframeDocument.write(scriptTag('document.F=Object'));
|
1545 | iframeDocument.close();
|
1546 | return iframeDocument.F;
|
1547 | };
|
1548 |
|
1549 |
|
1550 |
|
1551 |
|
1552 |
|
1553 |
|
1554 | var activeXDocument;
|
1555 | var NullProtoObject = function () {
|
1556 | try {
|
1557 |
|
1558 | activeXDocument = document.domain && new ActiveXObject('htmlfile');
|
1559 | } catch (error) { }
|
1560 | NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
|
1561 | var length = enumBugKeys.length;
|
1562 | while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
1563 | return NullProtoObject();
|
1564 | };
|
1565 |
|
1566 | hiddenKeys[IE_PROTO] = true;
|
1567 |
|
1568 |
|
1569 |
|
1570 | module.exports = Object.create || function create(O, Properties) {
|
1571 | var result;
|
1572 | if (O !== null) {
|
1573 | EmptyConstructor[PROTOTYPE] = anObject(O);
|
1574 | result = new EmptyConstructor();
|
1575 | EmptyConstructor[PROTOTYPE] = null;
|
1576 |
|
1577 | result[IE_PROTO] = O;
|
1578 | } else result = NullProtoObject();
|
1579 | return Properties === undefined ? result : defineProperties(result, Properties);
|
1580 | };
|
1581 |
|
1582 |
|
1583 | }),
|
1584 |
|
1585 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1586 |
|
1587 | var DESCRIPTORS = __webpack_require__(6);
|
1588 | var definePropertyModule = __webpack_require__(20);
|
1589 | var anObject = __webpack_require__(21);
|
1590 | var objectKeys = __webpack_require__(55);
|
1591 |
|
1592 |
|
1593 |
|
1594 | module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
|
1595 | anObject(O);
|
1596 | var keys = objectKeys(Properties);
|
1597 | var length = keys.length;
|
1598 | var index = 0;
|
1599 | var key;
|
1600 | while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]);
|
1601 | return O;
|
1602 | };
|
1603 |
|
1604 |
|
1605 | }),
|
1606 |
|
1607 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1608 |
|
1609 | var internalObjectKeys = __webpack_require__(38);
|
1610 | var enumBugKeys = __webpack_require__(43);
|
1611 |
|
1612 |
|
1613 |
|
1614 | module.exports = Object.keys || function keys(O) {
|
1615 | return internalObjectKeys(O, enumBugKeys);
|
1616 | };
|
1617 |
|
1618 |
|
1619 | }),
|
1620 |
|
1621 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1622 |
|
1623 | var getBuiltIn = __webpack_require__(35);
|
1624 |
|
1625 | module.exports = getBuiltIn('document', 'documentElement');
|
1626 |
|
1627 |
|
1628 | }),
|
1629 |
|
1630 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1631 |
|
1632 | var toIndexedObject = __webpack_require__(10);
|
1633 | var nativeGetOwnPropertyNames = __webpack_require__(37).f;
|
1634 |
|
1635 | var toString = {}.toString;
|
1636 |
|
1637 | var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
|
1638 | ? Object.getOwnPropertyNames(window) : [];
|
1639 |
|
1640 | var getWindowNames = function (it) {
|
1641 | try {
|
1642 | return nativeGetOwnPropertyNames(it);
|
1643 | } catch (error) {
|
1644 | return windowNames.slice();
|
1645 | }
|
1646 | };
|
1647 |
|
1648 |
|
1649 | module.exports.f = function getOwnPropertyNames(it) {
|
1650 | return windowNames && toString.call(it) == '[object Window]'
|
1651 | ? getWindowNames(it)
|
1652 | : nativeGetOwnPropertyNames(toIndexedObject(it));
|
1653 | };
|
1654 |
|
1655 |
|
1656 | }),
|
1657 |
|
1658 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1659 |
|
1660 | var global = __webpack_require__(4);
|
1661 | var shared = __webpack_require__(29);
|
1662 | var has = __webpack_require__(16);
|
1663 | var uid = __webpack_require__(31);
|
1664 | var NATIVE_SYMBOL = __webpack_require__(46);
|
1665 | var USE_SYMBOL_AS_UID = __webpack_require__(50);
|
1666 |
|
1667 | var WellKnownSymbolsStore = shared('wks');
|
1668 | var Symbol = global.Symbol;
|
1669 | var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
|
1670 |
|
1671 | module.exports = function (name) {
|
1672 | if (!has(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
|
1673 | if (NATIVE_SYMBOL && has(Symbol, name)) {
|
1674 | WellKnownSymbolsStore[name] = Symbol[name];
|
1675 | } else {
|
1676 | WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
|
1677 | }
|
1678 | } return WellKnownSymbolsStore[name];
|
1679 | };
|
1680 |
|
1681 |
|
1682 | }),
|
1683 |
|
1684 | (function(__unused_webpack_module, exports, __webpack_require__) {
|
1685 |
|
1686 | var wellKnownSymbol = __webpack_require__(58);
|
1687 |
|
1688 | exports.f = wellKnownSymbol;
|
1689 |
|
1690 |
|
1691 | }),
|
1692 |
|
1693 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1694 |
|
1695 | var path = __webpack_require__(36);
|
1696 | var has = __webpack_require__(16);
|
1697 | var wrappedWellKnownSymbolModule = __webpack_require__(59);
|
1698 | var defineProperty = __webpack_require__(20).f;
|
1699 |
|
1700 | module.exports = function (NAME) {
|
1701 | var Symbol = path.Symbol || (path.Symbol = {});
|
1702 | if (!has(Symbol, NAME)) defineProperty(Symbol, NAME, {
|
1703 | value: wrappedWellKnownSymbolModule.f(NAME)
|
1704 | });
|
1705 | };
|
1706 |
|
1707 |
|
1708 | }),
|
1709 |
|
1710 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1711 |
|
1712 | var defineProperty = __webpack_require__(20).f;
|
1713 | var has = __webpack_require__(16);
|
1714 | var wellKnownSymbol = __webpack_require__(58);
|
1715 |
|
1716 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
1717 |
|
1718 | module.exports = function (it, TAG, STATIC) {
|
1719 | if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
|
1720 | defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG });
|
1721 | }
|
1722 | };
|
1723 |
|
1724 |
|
1725 | }),
|
1726 |
|
1727 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1728 |
|
1729 | var bind = __webpack_require__(63);
|
1730 | var IndexedObject = __webpack_require__(11);
|
1731 | var toObject = __webpack_require__(52);
|
1732 | var toLength = __webpack_require__(40);
|
1733 | var arraySpeciesCreate = __webpack_require__(65);
|
1734 |
|
1735 | var push = [].push;
|
1736 |
|
1737 |
|
1738 | var createMethod = function (TYPE) {
|
1739 | var IS_MAP = TYPE == 1;
|
1740 | var IS_FILTER = TYPE == 2;
|
1741 | var IS_SOME = TYPE == 3;
|
1742 | var IS_EVERY = TYPE == 4;
|
1743 | var IS_FIND_INDEX = TYPE == 6;
|
1744 | var IS_FILTER_OUT = TYPE == 7;
|
1745 | var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
|
1746 | return function ($this, callbackfn, that, specificCreate) {
|
1747 | var O = toObject($this);
|
1748 | var self = IndexedObject(O);
|
1749 | var boundFunction = bind(callbackfn, that, 3);
|
1750 | var length = toLength(self.length);
|
1751 | var index = 0;
|
1752 | var create = specificCreate || arraySpeciesCreate;
|
1753 | var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_OUT ? create($this, 0) : undefined;
|
1754 | var value, result;
|
1755 | for (;length > index; index++) if (NO_HOLES || index in self) {
|
1756 | value = self[index];
|
1757 | result = boundFunction(value, index, O);
|
1758 | if (TYPE) {
|
1759 | if (IS_MAP) target[index] = result;
|
1760 | else if (result) switch (TYPE) {
|
1761 | case 3: return true;
|
1762 | case 5: return value;
|
1763 | case 6: return index;
|
1764 | case 2: push.call(target, value);
|
1765 | } else switch (TYPE) {
|
1766 | case 4: return false;
|
1767 | case 7: push.call(target, value);
|
1768 | }
|
1769 | }
|
1770 | }
|
1771 | return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
|
1772 | };
|
1773 | };
|
1774 |
|
1775 | module.exports = {
|
1776 |
|
1777 |
|
1778 | forEach: createMethod(0),
|
1779 |
|
1780 |
|
1781 | map: createMethod(1),
|
1782 |
|
1783 |
|
1784 | filter: createMethod(2),
|
1785 |
|
1786 |
|
1787 | some: createMethod(3),
|
1788 |
|
1789 |
|
1790 | every: createMethod(4),
|
1791 |
|
1792 |
|
1793 | find: createMethod(5),
|
1794 |
|
1795 |
|
1796 | findIndex: createMethod(6),
|
1797 |
|
1798 |
|
1799 | filterOut: createMethod(7)
|
1800 | };
|
1801 |
|
1802 |
|
1803 | }),
|
1804 |
|
1805 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1806 |
|
1807 | var aFunction = __webpack_require__(64);
|
1808 |
|
1809 |
|
1810 | module.exports = function (fn, that, length) {
|
1811 | aFunction(fn);
|
1812 | if (that === undefined) return fn;
|
1813 | switch (length) {
|
1814 | case 0: return function () {
|
1815 | return fn.call(that);
|
1816 | };
|
1817 | case 1: return function (a) {
|
1818 | return fn.call(that, a);
|
1819 | };
|
1820 | case 2: return function (a, b) {
|
1821 | return fn.call(that, a, b);
|
1822 | };
|
1823 | case 3: return function (a, b, c) {
|
1824 | return fn.call(that, a, b, c);
|
1825 | };
|
1826 | }
|
1827 | return function (/* ...args */) {
|
1828 | return fn.apply(that, arguments);
|
1829 | };
|
1830 | };
|
1831 |
|
1832 |
|
1833 | }),
|
1834 |
|
1835 | (function(module) {
|
1836 |
|
1837 | module.exports = function (it) {
|
1838 | if (typeof it != 'function') {
|
1839 | throw TypeError(String(it) + ' is not a function');
|
1840 | } return it;
|
1841 | };
|
1842 |
|
1843 |
|
1844 | }),
|
1845 |
|
1846 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1847 |
|
1848 | var isObject = __webpack_require__(15);
|
1849 | var isArray = __webpack_require__(51);
|
1850 | var wellKnownSymbol = __webpack_require__(58);
|
1851 |
|
1852 | var SPECIES = wellKnownSymbol('species');
|
1853 |
|
1854 |
|
1855 |
|
1856 | module.exports = function (originalArray, length) {
|
1857 | var C;
|
1858 | if (isArray(originalArray)) {
|
1859 | C = originalArray.constructor;
|
1860 |
|
1861 | if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
|
1862 | else if (isObject(C)) {
|
1863 | C = C[SPECIES];
|
1864 | if (C === null) C = undefined;
|
1865 | }
|
1866 | } return new (C === undefined ? Array : C)(length === 0 ? 0 : length);
|
1867 | };
|
1868 |
|
1869 |
|
1870 | }),
|
1871 |
|
1872 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
1873 |
|
1874 | var defineWellKnownSymbol = __webpack_require__(60);
|
1875 |
|
1876 |
|
1877 |
|
1878 | defineWellKnownSymbol('asyncIterator');
|
1879 |
|
1880 |
|
1881 | }),
|
1882 |
|
1883 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
1884 |
|
1885 | "use strict";
|
1886 |
|
1887 |
|
1888 |
|
1889 | var $ = __webpack_require__(3);
|
1890 | var DESCRIPTORS = __webpack_require__(6);
|
1891 | var global = __webpack_require__(4);
|
1892 | var has = __webpack_require__(16);
|
1893 | var isObject = __webpack_require__(15);
|
1894 | var defineProperty = __webpack_require__(20).f;
|
1895 | var copyConstructorProperties = __webpack_require__(33);
|
1896 |
|
1897 | var NativeSymbol = global.Symbol;
|
1898 |
|
1899 | if (DESCRIPTORS && typeof NativeSymbol == 'function' && (!('description' in NativeSymbol.prototype) ||
|
1900 |
|
1901 | NativeSymbol().description !== undefined
|
1902 | )) {
|
1903 | var EmptyStringDescriptionStore = {};
|
1904 |
|
1905 | var SymbolWrapper = function Symbol() {
|
1906 | var description = arguments.length < 1 || arguments[0] === undefined ? undefined : String(arguments[0]);
|
1907 | var result = this instanceof SymbolWrapper
|
1908 | ? new NativeSymbol(description)
|
1909 |
|
1910 | : description === undefined ? NativeSymbol() : NativeSymbol(description);
|
1911 | if (description === '') EmptyStringDescriptionStore[result] = true;
|
1912 | return result;
|
1913 | };
|
1914 | copyConstructorProperties(SymbolWrapper, NativeSymbol);
|
1915 | var symbolPrototype = SymbolWrapper.prototype = NativeSymbol.prototype;
|
1916 | symbolPrototype.constructor = SymbolWrapper;
|
1917 |
|
1918 | var symbolToString = symbolPrototype.toString;
|
1919 | var native = String(NativeSymbol('test')) == 'Symbol(test)';
|
1920 | var regexp = /^Symbol\((.*)\)[^)]+$/;
|
1921 | defineProperty(symbolPrototype, 'description', {
|
1922 | configurable: true,
|
1923 | get: function description() {
|
1924 | var symbol = isObject(this) ? this.valueOf() : this;
|
1925 | var string = symbolToString.call(symbol);
|
1926 | if (has(EmptyStringDescriptionStore, symbol)) return '';
|
1927 | var desc = native ? string.slice(7, -1) : string.replace(regexp, '$1');
|
1928 | return desc === '' ? undefined : desc;
|
1929 | }
|
1930 | });
|
1931 |
|
1932 | $({ global: true, forced: true }, {
|
1933 | Symbol: SymbolWrapper
|
1934 | });
|
1935 | }
|
1936 |
|
1937 |
|
1938 | }),
|
1939 |
|
1940 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
1941 |
|
1942 | var defineWellKnownSymbol = __webpack_require__(60);
|
1943 |
|
1944 |
|
1945 |
|
1946 | defineWellKnownSymbol('hasInstance');
|
1947 |
|
1948 |
|
1949 | }),
|
1950 |
|
1951 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
1952 |
|
1953 | var defineWellKnownSymbol = __webpack_require__(60);
|
1954 |
|
1955 |
|
1956 |
|
1957 | defineWellKnownSymbol('isConcatSpreadable');
|
1958 |
|
1959 |
|
1960 | }),
|
1961 |
|
1962 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
1963 |
|
1964 | var defineWellKnownSymbol = __webpack_require__(60);
|
1965 |
|
1966 |
|
1967 |
|
1968 | defineWellKnownSymbol('iterator');
|
1969 |
|
1970 |
|
1971 | }),
|
1972 |
|
1973 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
1974 |
|
1975 | var defineWellKnownSymbol = __webpack_require__(60);
|
1976 |
|
1977 |
|
1978 |
|
1979 | defineWellKnownSymbol('match');
|
1980 |
|
1981 |
|
1982 | }),
|
1983 |
|
1984 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
1985 |
|
1986 | var defineWellKnownSymbol = __webpack_require__(60);
|
1987 |
|
1988 |
|
1989 |
|
1990 | defineWellKnownSymbol('matchAll');
|
1991 |
|
1992 |
|
1993 | }),
|
1994 |
|
1995 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
1996 |
|
1997 | var defineWellKnownSymbol = __webpack_require__(60);
|
1998 |
|
1999 |
|
2000 |
|
2001 | defineWellKnownSymbol('replace');
|
2002 |
|
2003 |
|
2004 | }),
|
2005 |
|
2006 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2007 |
|
2008 | var defineWellKnownSymbol = __webpack_require__(60);
|
2009 |
|
2010 |
|
2011 |
|
2012 | defineWellKnownSymbol('search');
|
2013 |
|
2014 |
|
2015 | }),
|
2016 |
|
2017 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2018 |
|
2019 | var defineWellKnownSymbol = __webpack_require__(60);
|
2020 |
|
2021 |
|
2022 |
|
2023 | defineWellKnownSymbol('species');
|
2024 |
|
2025 |
|
2026 | }),
|
2027 |
|
2028 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2029 |
|
2030 | var defineWellKnownSymbol = __webpack_require__(60);
|
2031 |
|
2032 |
|
2033 |
|
2034 | defineWellKnownSymbol('split');
|
2035 |
|
2036 |
|
2037 | }),
|
2038 |
|
2039 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2040 |
|
2041 | var defineWellKnownSymbol = __webpack_require__(60);
|
2042 |
|
2043 |
|
2044 |
|
2045 | defineWellKnownSymbol('toPrimitive');
|
2046 |
|
2047 |
|
2048 | }),
|
2049 |
|
2050 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2051 |
|
2052 | var defineWellKnownSymbol = __webpack_require__(60);
|
2053 |
|
2054 |
|
2055 |
|
2056 | defineWellKnownSymbol('toStringTag');
|
2057 |
|
2058 |
|
2059 | }),
|
2060 |
|
2061 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2062 |
|
2063 | var defineWellKnownSymbol = __webpack_require__(60);
|
2064 |
|
2065 |
|
2066 |
|
2067 | defineWellKnownSymbol('unscopables');
|
2068 |
|
2069 |
|
2070 | }),
|
2071 |
|
2072 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2073 |
|
2074 | "use strict";
|
2075 |
|
2076 | var $ = __webpack_require__(3);
|
2077 | var getPrototypeOf = __webpack_require__(81);
|
2078 | var setPrototypeOf = __webpack_require__(83);
|
2079 | var create = __webpack_require__(53);
|
2080 | var createNonEnumerableProperty = __webpack_require__(19);
|
2081 | var createPropertyDescriptor = __webpack_require__(9);
|
2082 | var iterate = __webpack_require__(85);
|
2083 |
|
2084 | var $AggregateError = function AggregateError(errors, message) {
|
2085 | var that = this;
|
2086 | if (!(that instanceof $AggregateError)) return new $AggregateError(errors, message);
|
2087 | if (setPrototypeOf) {
|
2088 |
|
2089 | that = setPrototypeOf(new Error(undefined), getPrototypeOf(that));
|
2090 | }
|
2091 | if (message !== undefined) createNonEnumerableProperty(that, 'message', String(message));
|
2092 | var errorsArray = [];
|
2093 | iterate(errors, errorsArray.push, { that: errorsArray });
|
2094 | createNonEnumerableProperty(that, 'errors', errorsArray);
|
2095 | return that;
|
2096 | };
|
2097 |
|
2098 | $AggregateError.prototype = create(Error.prototype, {
|
2099 | constructor: createPropertyDescriptor(5, $AggregateError),
|
2100 | message: createPropertyDescriptor(5, ''),
|
2101 | name: createPropertyDescriptor(5, 'AggregateError')
|
2102 | });
|
2103 |
|
2104 | // `AggregateError` constructor
|
2105 | // https://tc39.es/ecma262/#sec-aggregate-error-constructor
|
2106 | $({ global: true }, {
|
2107 | AggregateError: $AggregateError
|
2108 | });
|
2109 |
|
2110 |
|
2111 | }),
|
2112 |
|
2113 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2114 |
|
2115 | var has = __webpack_require__(16);
|
2116 | var toObject = __webpack_require__(52);
|
2117 | var sharedKey = __webpack_require__(28);
|
2118 | var CORRECT_PROTOTYPE_GETTER = __webpack_require__(82);
|
2119 |
|
2120 | var IE_PROTO = sharedKey('IE_PROTO');
|
2121 | var ObjectPrototype = Object.prototype;
|
2122 |
|
2123 |
|
2124 |
|
2125 | module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {
|
2126 | O = toObject(O);
|
2127 | if (has(O, IE_PROTO)) return O[IE_PROTO];
|
2128 | if (typeof O.constructor == 'function' && O instanceof O.constructor) {
|
2129 | return O.constructor.prototype;
|
2130 | } return O instanceof Object ? ObjectPrototype : null;
|
2131 | };
|
2132 |
|
2133 |
|
2134 | }),
|
2135 |
|
2136 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2137 |
|
2138 | var fails = __webpack_require__(7);
|
2139 |
|
2140 | module.exports = !fails(function () {
|
2141 | function F() { }
|
2142 | F.prototype.constructor = null;
|
2143 | return Object.getPrototypeOf(new F()) !== F.prototype;
|
2144 | });
|
2145 |
|
2146 |
|
2147 | }),
|
2148 |
|
2149 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2150 |
|
2151 |
|
2152 | var anObject = __webpack_require__(21);
|
2153 | var aPossiblePrototype = __webpack_require__(84);
|
2154 |
|
2155 |
|
2156 |
|
2157 |
|
2158 | module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
2159 | var CORRECT_SETTER = false;
|
2160 | var test = {};
|
2161 | var setter;
|
2162 | try {
|
2163 | setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set;
|
2164 | setter.call(test, []);
|
2165 | CORRECT_SETTER = test instanceof Array;
|
2166 | } catch (error) { }
|
2167 | return function setPrototypeOf(O, proto) {
|
2168 | anObject(O);
|
2169 | aPossiblePrototype(proto);
|
2170 | if (CORRECT_SETTER) setter.call(O, proto);
|
2171 | else O.__proto__ = proto;
|
2172 | return O;
|
2173 | };
|
2174 | }() : undefined);
|
2175 |
|
2176 |
|
2177 | }),
|
2178 |
|
2179 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2180 |
|
2181 | var isObject = __webpack_require__(15);
|
2182 |
|
2183 | module.exports = function (it) {
|
2184 | if (!isObject(it) && it !== null) {
|
2185 | throw TypeError("Can't set " + String(it) + ' as a prototype');
|
2186 | } return it;
|
2187 | };
|
2188 |
|
2189 |
|
2190 | }),
|
2191 |
|
2192 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2193 |
|
2194 | var anObject = __webpack_require__(21);
|
2195 | var isArrayIteratorMethod = __webpack_require__(86);
|
2196 | var toLength = __webpack_require__(40);
|
2197 | var bind = __webpack_require__(63);
|
2198 | var getIteratorMethod = __webpack_require__(88);
|
2199 | var iteratorClose = __webpack_require__(91);
|
2200 |
|
2201 | var Result = function (stopped, result) {
|
2202 | this.stopped = stopped;
|
2203 | this.result = result;
|
2204 | };
|
2205 |
|
2206 | module.exports = function (iterable, unboundFunction, options) {
|
2207 | var that = options && options.that;
|
2208 | var AS_ENTRIES = !!(options && options.AS_ENTRIES);
|
2209 | var IS_ITERATOR = !!(options && options.IS_ITERATOR);
|
2210 | var INTERRUPTED = !!(options && options.INTERRUPTED);
|
2211 | var fn = bind(unboundFunction, that, 1 + AS_ENTRIES + INTERRUPTED);
|
2212 | var iterator, iterFn, index, length, result, next, step;
|
2213 |
|
2214 | var stop = function (condition) {
|
2215 | if (iterator) iteratorClose(iterator);
|
2216 | return new Result(true, condition);
|
2217 | };
|
2218 |
|
2219 | var callFn = function (value) {
|
2220 | if (AS_ENTRIES) {
|
2221 | anObject(value);
|
2222 | return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
|
2223 | } return INTERRUPTED ? fn(value, stop) : fn(value);
|
2224 | };
|
2225 |
|
2226 | if (IS_ITERATOR) {
|
2227 | iterator = iterable;
|
2228 | } else {
|
2229 | iterFn = getIteratorMethod(iterable);
|
2230 | if (typeof iterFn != 'function') throw TypeError('Target is not iterable');
|
2231 |
|
2232 | if (isArrayIteratorMethod(iterFn)) {
|
2233 | for (index = 0, length = toLength(iterable.length); length > index; index++) {
|
2234 | result = callFn(iterable[index]);
|
2235 | if (result && result instanceof Result) return result;
|
2236 | } return new Result(false);
|
2237 | }
|
2238 | iterator = iterFn.call(iterable);
|
2239 | }
|
2240 |
|
2241 | next = iterator.next;
|
2242 | while (!(step = next.call(iterator)).done) {
|
2243 | try {
|
2244 | result = callFn(step.value);
|
2245 | } catch (error) {
|
2246 | iteratorClose(iterator);
|
2247 | throw error;
|
2248 | }
|
2249 | if (typeof result == 'object' && result && result instanceof Result) return result;
|
2250 | } return new Result(false);
|
2251 | };
|
2252 |
|
2253 |
|
2254 | }),
|
2255 |
|
2256 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2257 |
|
2258 | var wellKnownSymbol = __webpack_require__(58);
|
2259 | var Iterators = __webpack_require__(87);
|
2260 |
|
2261 | var ITERATOR = wellKnownSymbol('iterator');
|
2262 | var ArrayPrototype = Array.prototype;
|
2263 |
|
2264 |
|
2265 | module.exports = function (it) {
|
2266 | return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
|
2267 | };
|
2268 |
|
2269 |
|
2270 | }),
|
2271 |
|
2272 | (function(module) {
|
2273 |
|
2274 | module.exports = {};
|
2275 |
|
2276 |
|
2277 | }),
|
2278 |
|
2279 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2280 |
|
2281 | var classof = __webpack_require__(89);
|
2282 | var Iterators = __webpack_require__(87);
|
2283 | var wellKnownSymbol = __webpack_require__(58);
|
2284 |
|
2285 | var ITERATOR = wellKnownSymbol('iterator');
|
2286 |
|
2287 | module.exports = function (it) {
|
2288 | if (it != undefined) return it[ITERATOR]
|
2289 | || it['@@iterator']
|
2290 | || Iterators[classof(it)];
|
2291 | };
|
2292 |
|
2293 |
|
2294 | }),
|
2295 |
|
2296 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2297 |
|
2298 | var TO_STRING_TAG_SUPPORT = __webpack_require__(90);
|
2299 | var classofRaw = __webpack_require__(12);
|
2300 | var wellKnownSymbol = __webpack_require__(58);
|
2301 |
|
2302 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
2303 |
|
2304 | var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
2305 |
|
2306 |
|
2307 | var tryGet = function (it, key) {
|
2308 | try {
|
2309 | return it[key];
|
2310 | } catch (error) { }
|
2311 | };
|
2312 |
|
2313 |
|
2314 | module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
|
2315 | var O, tag, result;
|
2316 | return it === undefined ? 'Undefined' : it === null ? 'Null'
|
2317 |
|
2318 | : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
|
2319 |
|
2320 | : CORRECT_ARGUMENTS ? classofRaw(O)
|
2321 |
|
2322 | : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
|
2323 | };
|
2324 |
|
2325 |
|
2326 | }),
|
2327 |
|
2328 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2329 |
|
2330 | var wellKnownSymbol = __webpack_require__(58);
|
2331 |
|
2332 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
2333 | var test = {};
|
2334 |
|
2335 | test[TO_STRING_TAG] = 'z';
|
2336 |
|
2337 | module.exports = String(test) === '[object z]';
|
2338 |
|
2339 |
|
2340 | }),
|
2341 |
|
2342 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2343 |
|
2344 | var anObject = __webpack_require__(21);
|
2345 |
|
2346 | module.exports = function (iterator) {
|
2347 | var returnMethod = iterator['return'];
|
2348 | if (returnMethod !== undefined) {
|
2349 | return anObject(returnMethod.call(iterator)).value;
|
2350 | }
|
2351 | };
|
2352 |
|
2353 |
|
2354 | }),
|
2355 |
|
2356 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2357 |
|
2358 | var $ = __webpack_require__(3);
|
2359 | var from = __webpack_require__(93);
|
2360 | var checkCorrectnessOfIteration = __webpack_require__(96);
|
2361 |
|
2362 | var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
|
2363 | Array.from(iterable);
|
2364 | });
|
2365 |
|
2366 |
|
2367 |
|
2368 | $({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
|
2369 | from: from
|
2370 | });
|
2371 |
|
2372 |
|
2373 | }),
|
2374 |
|
2375 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2376 |
|
2377 | "use strict";
|
2378 |
|
2379 | var bind = __webpack_require__(63);
|
2380 | var toObject = __webpack_require__(52);
|
2381 | var callWithSafeIterationClosing = __webpack_require__(94);
|
2382 | var isArrayIteratorMethod = __webpack_require__(86);
|
2383 | var toLength = __webpack_require__(40);
|
2384 | var createProperty = __webpack_require__(95);
|
2385 | var getIteratorMethod = __webpack_require__(88);
|
2386 |
|
2387 |
|
2388 |
|
2389 | module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
|
2390 | var O = toObject(arrayLike);
|
2391 | var C = typeof this == 'function' ? this : Array;
|
2392 | var argumentsLength = arguments.length;
|
2393 | var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
|
2394 | var mapping = mapfn !== undefined;
|
2395 | var iteratorMethod = getIteratorMethod(O);
|
2396 | var index = 0;
|
2397 | var length, result, step, iterator, next, value;
|
2398 | if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2);
|
2399 |
|
2400 | if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) {
|
2401 | iterator = iteratorMethod.call(O);
|
2402 | next = iterator.next;
|
2403 | result = new C();
|
2404 | for (;!(step = next.call(iterator)).done; index++) {
|
2405 | value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
|
2406 | createProperty(result, index, value);
|
2407 | }
|
2408 | } else {
|
2409 | length = toLength(O.length);
|
2410 | result = new C(length);
|
2411 | for (;length > index; index++) {
|
2412 | value = mapping ? mapfn(O[index], index) : O[index];
|
2413 | createProperty(result, index, value);
|
2414 | }
|
2415 | }
|
2416 | result.length = index;
|
2417 | return result;
|
2418 | };
|
2419 |
|
2420 |
|
2421 | }),
|
2422 |
|
2423 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2424 |
|
2425 | var anObject = __webpack_require__(21);
|
2426 | var iteratorClose = __webpack_require__(91);
|
2427 |
|
2428 |
|
2429 | module.exports = function (iterator, fn, value, ENTRIES) {
|
2430 | try {
|
2431 | return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
|
2432 |
|
2433 | } catch (error) {
|
2434 | iteratorClose(iterator);
|
2435 | throw error;
|
2436 | }
|
2437 | };
|
2438 |
|
2439 |
|
2440 | }),
|
2441 |
|
2442 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2443 |
|
2444 | "use strict";
|
2445 |
|
2446 | var toPrimitive = __webpack_require__(14);
|
2447 | var definePropertyModule = __webpack_require__(20);
|
2448 | var createPropertyDescriptor = __webpack_require__(9);
|
2449 |
|
2450 | module.exports = function (object, key, value) {
|
2451 | var propertyKey = toPrimitive(key);
|
2452 | if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
|
2453 | else object[propertyKey] = value;
|
2454 | };
|
2455 |
|
2456 |
|
2457 | }),
|
2458 |
|
2459 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2460 |
|
2461 | var wellKnownSymbol = __webpack_require__(58);
|
2462 |
|
2463 | var ITERATOR = wellKnownSymbol('iterator');
|
2464 | var SAFE_CLOSING = false;
|
2465 |
|
2466 | try {
|
2467 | var called = 0;
|
2468 | var iteratorWithReturn = {
|
2469 | next: function () {
|
2470 | return { done: !!called++ };
|
2471 | },
|
2472 | 'return': function () {
|
2473 | SAFE_CLOSING = true;
|
2474 | }
|
2475 | };
|
2476 | iteratorWithReturn[ITERATOR] = function () {
|
2477 | return this;
|
2478 | };
|
2479 |
|
2480 | Array.from(iteratorWithReturn, function () { throw 2; });
|
2481 | } catch (error) { }
|
2482 |
|
2483 | module.exports = function (exec, SKIP_CLOSING) {
|
2484 | if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
|
2485 | var ITERATION_SUPPORT = false;
|
2486 | try {
|
2487 | var object = {};
|
2488 | object[ITERATOR] = function () {
|
2489 | return {
|
2490 | next: function () {
|
2491 | return { done: ITERATION_SUPPORT = true };
|
2492 | }
|
2493 | };
|
2494 | };
|
2495 | exec(object);
|
2496 | } catch (error) { }
|
2497 | return ITERATION_SUPPORT;
|
2498 | };
|
2499 |
|
2500 |
|
2501 | }),
|
2502 |
|
2503 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2504 |
|
2505 | var $ = __webpack_require__(3);
|
2506 | var isArray = __webpack_require__(51);
|
2507 |
|
2508 |
|
2509 |
|
2510 | $({ target: 'Array', stat: true }, {
|
2511 | isArray: isArray
|
2512 | });
|
2513 |
|
2514 |
|
2515 | }),
|
2516 |
|
2517 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2518 |
|
2519 | "use strict";
|
2520 |
|
2521 | var $ = __webpack_require__(3);
|
2522 | var fails = __webpack_require__(7);
|
2523 | var createProperty = __webpack_require__(95);
|
2524 |
|
2525 | var ISNT_GENERIC = fails(function () {
|
2526 | function F() { }
|
2527 | return !(Array.of.call(F) instanceof F);
|
2528 | });
|
2529 |
|
2530 |
|
2531 |
|
2532 |
|
2533 | $({ target: 'Array', stat: true, forced: ISNT_GENERIC }, {
|
2534 | of: function of(/* ...args */) {
|
2535 | var index = 0;
|
2536 | var argumentsLength = arguments.length;
|
2537 | var result = new (typeof this == 'function' ? this : Array)(argumentsLength);
|
2538 | while (argumentsLength > index) createProperty(result, index, arguments[index++]);
|
2539 | result.length = argumentsLength;
|
2540 | return result;
|
2541 | }
|
2542 | });
|
2543 |
|
2544 |
|
2545 | }),
|
2546 |
|
2547 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2548 |
|
2549 | "use strict";
|
2550 |
|
2551 | var $ = __webpack_require__(3);
|
2552 | var fails = __webpack_require__(7);
|
2553 | var isArray = __webpack_require__(51);
|
2554 | var isObject = __webpack_require__(15);
|
2555 | var toObject = __webpack_require__(52);
|
2556 | var toLength = __webpack_require__(40);
|
2557 | var createProperty = __webpack_require__(95);
|
2558 | var arraySpeciesCreate = __webpack_require__(65);
|
2559 | var arrayMethodHasSpeciesSupport = __webpack_require__(100);
|
2560 | var wellKnownSymbol = __webpack_require__(58);
|
2561 | var V8_VERSION = __webpack_require__(48);
|
2562 |
|
2563 | var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
|
2564 | var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
|
2565 | var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
|
2566 |
|
2567 |
|
2568 |
|
2569 |
|
2570 | var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {
|
2571 | var array = [];
|
2572 | array[IS_CONCAT_SPREADABLE] = false;
|
2573 | return array.concat()[0] !== array;
|
2574 | });
|
2575 |
|
2576 | var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
|
2577 |
|
2578 | var isConcatSpreadable = function (O) {
|
2579 | if (!isObject(O)) return false;
|
2580 | var spreadable = O[IS_CONCAT_SPREADABLE];
|
2581 | return spreadable !== undefined ? !!spreadable : isArray(O);
|
2582 | };
|
2583 |
|
2584 | var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
|
2585 |
|
2586 |
|
2587 |
|
2588 |
|
2589 | $({ target: 'Array', proto: true, forced: FORCED }, {
|
2590 |
|
2591 | concat: function concat(arg) {
|
2592 | var O = toObject(this);
|
2593 | var A = arraySpeciesCreate(O, 0);
|
2594 | var n = 0;
|
2595 | var i, k, length, len, E;
|
2596 | for (i = -1, length = arguments.length; i < length; i++) {
|
2597 | E = i === -1 ? O : arguments[i];
|
2598 | if (isConcatSpreadable(E)) {
|
2599 | len = toLength(E.length);
|
2600 | if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
2601 | for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
|
2602 | } else {
|
2603 | if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
2604 | createProperty(A, n++, E);
|
2605 | }
|
2606 | }
|
2607 | A.length = n;
|
2608 | return A;
|
2609 | }
|
2610 | });
|
2611 |
|
2612 |
|
2613 | }),
|
2614 |
|
2615 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2616 |
|
2617 | var fails = __webpack_require__(7);
|
2618 | var wellKnownSymbol = __webpack_require__(58);
|
2619 | var V8_VERSION = __webpack_require__(48);
|
2620 |
|
2621 | var SPECIES = wellKnownSymbol('species');
|
2622 |
|
2623 | module.exports = function (METHOD_NAME) {
|
2624 |
|
2625 |
|
2626 |
|
2627 | return V8_VERSION >= 51 || !fails(function () {
|
2628 | var array = [];
|
2629 | var constructor = array.constructor = {};
|
2630 | constructor[SPECIES] = function () {
|
2631 | return { foo: 1 };
|
2632 | };
|
2633 | return array[METHOD_NAME](Boolean).foo !== 1;
|
2634 | });
|
2635 | };
|
2636 |
|
2637 |
|
2638 | }),
|
2639 |
|
2640 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2641 |
|
2642 | var $ = __webpack_require__(3);
|
2643 | var copyWithin = __webpack_require__(102);
|
2644 | var addToUnscopables = __webpack_require__(103);
|
2645 |
|
2646 |
|
2647 |
|
2648 | $({ target: 'Array', proto: true }, {
|
2649 | copyWithin: copyWithin
|
2650 | });
|
2651 |
|
2652 |
|
2653 | addToUnscopables('copyWithin');
|
2654 |
|
2655 |
|
2656 | }),
|
2657 |
|
2658 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2659 |
|
2660 | "use strict";
|
2661 |
|
2662 | var toObject = __webpack_require__(52);
|
2663 | var toAbsoluteIndex = __webpack_require__(42);
|
2664 | var toLength = __webpack_require__(40);
|
2665 |
|
2666 | var min = Math.min;
|
2667 |
|
2668 |
|
2669 |
|
2670 | module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {
|
2671 | var O = toObject(this);
|
2672 | var len = toLength(O.length);
|
2673 | var to = toAbsoluteIndex(target, len);
|
2674 | var from = toAbsoluteIndex(start, len);
|
2675 | var end = arguments.length > 2 ? arguments[2] : undefined;
|
2676 | var count = min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);
|
2677 | var inc = 1;
|
2678 | if (from < to && to < from + count) {
|
2679 | inc = -1;
|
2680 | from += count - 1;
|
2681 | to += count - 1;
|
2682 | }
|
2683 | while (count-- > 0) {
|
2684 | if (from in O) O[to] = O[from];
|
2685 | else delete O[to];
|
2686 | to += inc;
|
2687 | from += inc;
|
2688 | } return O;
|
2689 | };
|
2690 |
|
2691 |
|
2692 | }),
|
2693 |
|
2694 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2695 |
|
2696 | var wellKnownSymbol = __webpack_require__(58);
|
2697 | var create = __webpack_require__(53);
|
2698 | var definePropertyModule = __webpack_require__(20);
|
2699 |
|
2700 | var UNSCOPABLES = wellKnownSymbol('unscopables');
|
2701 | var ArrayPrototype = Array.prototype;
|
2702 |
|
2703 |
|
2704 |
|
2705 | if (ArrayPrototype[UNSCOPABLES] == undefined) {
|
2706 | definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
|
2707 | configurable: true,
|
2708 | value: create(null)
|
2709 | });
|
2710 | }
|
2711 |
|
2712 |
|
2713 | module.exports = function (key) {
|
2714 | ArrayPrototype[UNSCOPABLES][key] = true;
|
2715 | };
|
2716 |
|
2717 |
|
2718 | }),
|
2719 |
|
2720 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2721 |
|
2722 | "use strict";
|
2723 |
|
2724 | var $ = __webpack_require__(3);
|
2725 | var $every = __webpack_require__(62).every;
|
2726 | var arrayMethodIsStrict = __webpack_require__(105);
|
2727 |
|
2728 | var STRICT_METHOD = arrayMethodIsStrict('every');
|
2729 |
|
2730 |
|
2731 |
|
2732 | $({ target: 'Array', proto: true, forced: !STRICT_METHOD }, {
|
2733 | every: function every(callbackfn /* , thisArg */) {
|
2734 | return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
2735 | }
|
2736 | });
|
2737 |
|
2738 |
|
2739 | }),
|
2740 |
|
2741 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2742 |
|
2743 | "use strict";
|
2744 |
|
2745 | var fails = __webpack_require__(7);
|
2746 |
|
2747 | module.exports = function (METHOD_NAME, argument) {
|
2748 | var method = [][METHOD_NAME];
|
2749 | return !!method && fails(function () {
|
2750 |
|
2751 | method.call(null, argument || function () { throw 1; }, 1);
|
2752 | });
|
2753 | };
|
2754 |
|
2755 |
|
2756 | }),
|
2757 |
|
2758 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2759 |
|
2760 | var $ = __webpack_require__(3);
|
2761 | var fill = __webpack_require__(107);
|
2762 | var addToUnscopables = __webpack_require__(103);
|
2763 |
|
2764 |
|
2765 |
|
2766 | $({ target: 'Array', proto: true }, {
|
2767 | fill: fill
|
2768 | });
|
2769 |
|
2770 |
|
2771 | addToUnscopables('fill');
|
2772 |
|
2773 |
|
2774 | }),
|
2775 |
|
2776 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2777 |
|
2778 | "use strict";
|
2779 |
|
2780 | var toObject = __webpack_require__(52);
|
2781 | var toAbsoluteIndex = __webpack_require__(42);
|
2782 | var toLength = __webpack_require__(40);
|
2783 |
|
2784 |
|
2785 |
|
2786 | module.exports = function fill(value /* , start = 0, end = @length */) {
|
2787 | var O = toObject(this);
|
2788 | var length = toLength(O.length);
|
2789 | var argumentsLength = arguments.length;
|
2790 | var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length);
|
2791 | var end = argumentsLength > 2 ? arguments[2] : undefined;
|
2792 | var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
|
2793 | while (endPos > index) O[index++] = value;
|
2794 | return O;
|
2795 | };
|
2796 |
|
2797 |
|
2798 | }),
|
2799 |
|
2800 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2801 |
|
2802 | "use strict";
|
2803 |
|
2804 | var $ = __webpack_require__(3);
|
2805 | var $filter = __webpack_require__(62).filter;
|
2806 | var arrayMethodHasSpeciesSupport = __webpack_require__(100);
|
2807 |
|
2808 | var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
|
2809 |
|
2810 |
|
2811 |
|
2812 |
|
2813 | $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
|
2814 | filter: function filter(callbackfn /* , thisArg */) {
|
2815 | return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
2816 | }
|
2817 | });
|
2818 |
|
2819 |
|
2820 | }),
|
2821 |
|
2822 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2823 |
|
2824 | "use strict";
|
2825 |
|
2826 | var $ = __webpack_require__(3);
|
2827 | var $find = __webpack_require__(62).find;
|
2828 | var addToUnscopables = __webpack_require__(103);
|
2829 |
|
2830 | var FIND = 'find';
|
2831 | var SKIPS_HOLES = true;
|
2832 |
|
2833 |
|
2834 | if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
|
2835 |
|
2836 |
|
2837 |
|
2838 | $({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
|
2839 | find: function find(callbackfn /* , that = undefined */) {
|
2840 | return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
2841 | }
|
2842 | });
|
2843 |
|
2844 |
|
2845 | addToUnscopables(FIND);
|
2846 |
|
2847 |
|
2848 | }),
|
2849 |
|
2850 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2851 |
|
2852 | "use strict";
|
2853 |
|
2854 | var $ = __webpack_require__(3);
|
2855 | var $findIndex = __webpack_require__(62).findIndex;
|
2856 | var addToUnscopables = __webpack_require__(103);
|
2857 |
|
2858 | var FIND_INDEX = 'findIndex';
|
2859 | var SKIPS_HOLES = true;
|
2860 |
|
2861 |
|
2862 | if (FIND_INDEX in []) Array(1)[FIND_INDEX](function () { SKIPS_HOLES = false; });
|
2863 |
|
2864 |
|
2865 |
|
2866 | $({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
|
2867 | findIndex: function findIndex(callbackfn /* , that = undefined */) {
|
2868 | return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
2869 | }
|
2870 | });
|
2871 |
|
2872 |
|
2873 | addToUnscopables(FIND_INDEX);
|
2874 |
|
2875 |
|
2876 | }),
|
2877 |
|
2878 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2879 |
|
2880 | "use strict";
|
2881 |
|
2882 | var $ = __webpack_require__(3);
|
2883 | var flattenIntoArray = __webpack_require__(112);
|
2884 | var toObject = __webpack_require__(52);
|
2885 | var toLength = __webpack_require__(40);
|
2886 | var toInteger = __webpack_require__(41);
|
2887 | var arraySpeciesCreate = __webpack_require__(65);
|
2888 |
|
2889 |
|
2890 |
|
2891 | $({ target: 'Array', proto: true }, {
|
2892 | flat: function flat(/* depthArg = 1 */) {
|
2893 | var depthArg = arguments.length ? arguments[0] : undefined;
|
2894 | var O = toObject(this);
|
2895 | var sourceLen = toLength(O.length);
|
2896 | var A = arraySpeciesCreate(O, 0);
|
2897 | A.length = flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg));
|
2898 | return A;
|
2899 | }
|
2900 | });
|
2901 |
|
2902 |
|
2903 | }),
|
2904 |
|
2905 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2906 |
|
2907 | "use strict";
|
2908 |
|
2909 | var isArray = __webpack_require__(51);
|
2910 | var toLength = __webpack_require__(40);
|
2911 | var bind = __webpack_require__(63);
|
2912 |
|
2913 |
|
2914 |
|
2915 | var flattenIntoArray = function (target, original, source, sourceLen, start, depth, mapper, thisArg) {
|
2916 | var targetIndex = start;
|
2917 | var sourceIndex = 0;
|
2918 | var mapFn = mapper ? bind(mapper, thisArg, 3) : false;
|
2919 | var element;
|
2920 |
|
2921 | while (sourceIndex < sourceLen) {
|
2922 | if (sourceIndex in source) {
|
2923 | element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
|
2924 |
|
2925 | if (depth > 0 && isArray(element)) {
|
2926 | targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;
|
2927 | } else {
|
2928 | if (targetIndex >= 0x1FFFFFFFFFFFFF) throw TypeError('Exceed the acceptable array length');
|
2929 | target[targetIndex] = element;
|
2930 | }
|
2931 |
|
2932 | targetIndex++;
|
2933 | }
|
2934 | sourceIndex++;
|
2935 | }
|
2936 | return targetIndex;
|
2937 | };
|
2938 |
|
2939 | module.exports = flattenIntoArray;
|
2940 |
|
2941 |
|
2942 | }),
|
2943 |
|
2944 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2945 |
|
2946 | "use strict";
|
2947 |
|
2948 | var $ = __webpack_require__(3);
|
2949 | var flattenIntoArray = __webpack_require__(112);
|
2950 | var toObject = __webpack_require__(52);
|
2951 | var toLength = __webpack_require__(40);
|
2952 | var aFunction = __webpack_require__(64);
|
2953 | var arraySpeciesCreate = __webpack_require__(65);
|
2954 |
|
2955 |
|
2956 |
|
2957 | $({ target: 'Array', proto: true }, {
|
2958 | flatMap: function flatMap(callbackfn /* , thisArg */) {
|
2959 | var O = toObject(this);
|
2960 | var sourceLen = toLength(O.length);
|
2961 | var A;
|
2962 | aFunction(callbackfn);
|
2963 | A = arraySpeciesCreate(O, 0);
|
2964 | A.length = flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
2965 | return A;
|
2966 | }
|
2967 | });
|
2968 |
|
2969 |
|
2970 | }),
|
2971 |
|
2972 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2973 |
|
2974 | "use strict";
|
2975 |
|
2976 | var $ = __webpack_require__(3);
|
2977 | var forEach = __webpack_require__(115);
|
2978 |
|
2979 |
|
2980 |
|
2981 | $({ target: 'Array', proto: true, forced: [].forEach != forEach }, {
|
2982 | forEach: forEach
|
2983 | });
|
2984 |
|
2985 |
|
2986 | }),
|
2987 |
|
2988 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2989 |
|
2990 | "use strict";
|
2991 |
|
2992 | var $forEach = __webpack_require__(62).forEach;
|
2993 | var arrayMethodIsStrict = __webpack_require__(105);
|
2994 |
|
2995 | var STRICT_METHOD = arrayMethodIsStrict('forEach');
|
2996 |
|
2997 |
|
2998 |
|
2999 | module.exports = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) {
|
3000 | return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
3001 | } : [].forEach;
|
3002 |
|
3003 |
|
3004 | }),
|
3005 |
|
3006 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3007 |
|
3008 | "use strict";
|
3009 |
|
3010 | var $ = __webpack_require__(3);
|
3011 | var $includes = __webpack_require__(39).includes;
|
3012 | var addToUnscopables = __webpack_require__(103);
|
3013 |
|
3014 |
|
3015 |
|
3016 | $({ target: 'Array', proto: true }, {
|
3017 | includes: function includes(el /* , fromIndex = 0 */) {
|
3018 | return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
|
3019 | }
|
3020 | });
|
3021 |
|
3022 |
|
3023 | addToUnscopables('includes');
|
3024 |
|
3025 |
|
3026 | }),
|
3027 |
|
3028 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3029 |
|
3030 | "use strict";
|
3031 |
|
3032 | var $ = __webpack_require__(3);
|
3033 | var $indexOf = __webpack_require__(39).indexOf;
|
3034 | var arrayMethodIsStrict = __webpack_require__(105);
|
3035 |
|
3036 | var nativeIndexOf = [].indexOf;
|
3037 |
|
3038 | var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
|
3039 | var STRICT_METHOD = arrayMethodIsStrict('indexOf');
|
3040 |
|
3041 |
|
3042 |
|
3043 | $({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
|
3044 | indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
|
3045 | return NEGATIVE_ZERO
|
3046 |
|
3047 | ? nativeIndexOf.apply(this, arguments) || 0
|
3048 | : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined);
|
3049 | }
|
3050 | });
|
3051 |
|
3052 |
|
3053 | }),
|
3054 |
|
3055 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3056 |
|
3057 | "use strict";
|
3058 |
|
3059 | var $ = __webpack_require__(3);
|
3060 | var IndexedObject = __webpack_require__(11);
|
3061 | var toIndexedObject = __webpack_require__(10);
|
3062 | var arrayMethodIsStrict = __webpack_require__(105);
|
3063 |
|
3064 | var nativeJoin = [].join;
|
3065 |
|
3066 | var ES3_STRINGS = IndexedObject != Object;
|
3067 | var STRICT_METHOD = arrayMethodIsStrict('join', ',');
|
3068 |
|
3069 |
|
3070 |
|
3071 | $({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
|
3072 | join: function join(separator) {
|
3073 | return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);
|
3074 | }
|
3075 | });
|
3076 |
|
3077 |
|
3078 | }),
|
3079 |
|
3080 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3081 |
|
3082 | var $ = __webpack_require__(3);
|
3083 | var lastIndexOf = __webpack_require__(120);
|
3084 |
|
3085 |
|
3086 |
|
3087 | $({ target: 'Array', proto: true, forced: lastIndexOf !== [].lastIndexOf }, {
|
3088 | lastIndexOf: lastIndexOf
|
3089 | });
|
3090 |
|
3091 |
|
3092 | }),
|
3093 |
|
3094 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
3095 |
|
3096 | "use strict";
|
3097 |
|
3098 | var toIndexedObject = __webpack_require__(10);
|
3099 | var toInteger = __webpack_require__(41);
|
3100 | var toLength = __webpack_require__(40);
|
3101 | var arrayMethodIsStrict = __webpack_require__(105);
|
3102 |
|
3103 | var min = Math.min;
|
3104 | var nativeLastIndexOf = [].lastIndexOf;
|
3105 | var NEGATIVE_ZERO = !!nativeLastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0;
|
3106 | var STRICT_METHOD = arrayMethodIsStrict('lastIndexOf');
|
3107 | var FORCED = NEGATIVE_ZERO || !STRICT_METHOD;
|
3108 |
|
3109 |
|
3110 |
|
3111 | module.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
|
3112 |
|
3113 | if (NEGATIVE_ZERO) return nativeLastIndexOf.apply(this, arguments) || 0;
|
3114 | var O = toIndexedObject(this);
|
3115 | var length = toLength(O.length);
|
3116 | var index = length - 1;
|
3117 | if (arguments.length > 1) index = min(index, toInteger(arguments[1]));
|
3118 | if (index < 0) index = length + index;
|
3119 | for (;index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0;
|
3120 | return -1;
|
3121 | } : nativeLastIndexOf;
|
3122 |
|
3123 |
|
3124 | }),
|
3125 |
|
3126 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3127 |
|
3128 | "use strict";
|
3129 |
|
3130 | var $ = __webpack_require__(3);
|
3131 | var $map = __webpack_require__(62).map;
|
3132 | var arrayMethodHasSpeciesSupport = __webpack_require__(100);
|
3133 |
|
3134 | var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
|
3135 |
|
3136 |
|
3137 |
|
3138 |
|
3139 | $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
|
3140 | map: function map(callbackfn /* , thisArg */) {
|
3141 | return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
3142 | }
|
3143 | });
|
3144 |
|
3145 |
|
3146 | }),
|
3147 |
|
3148 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3149 |
|
3150 | "use strict";
|
3151 |
|
3152 | var $ = __webpack_require__(3);
|
3153 | var $reduce = __webpack_require__(123).left;
|
3154 | var arrayMethodIsStrict = __webpack_require__(105);
|
3155 | var CHROME_VERSION = __webpack_require__(48);
|
3156 | var IS_NODE = __webpack_require__(47);
|
3157 |
|
3158 | var STRICT_METHOD = arrayMethodIsStrict('reduce');
|
3159 |
|
3160 |
|
3161 | var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
|
3162 |
|
3163 |
|
3164 |
|
3165 | $({ target: 'Array', proto: true, forced: !STRICT_METHOD || CHROME_BUG }, {
|
3166 | reduce: function reduce(callbackfn /* , initialValue */) {
|
3167 | return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
|
3168 | }
|
3169 | });
|
3170 |
|
3171 |
|
3172 | }),
|
3173 |
|
3174 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
3175 |
|
3176 | var aFunction = __webpack_require__(64);
|
3177 | var toObject = __webpack_require__(52);
|
3178 | var IndexedObject = __webpack_require__(11);
|
3179 | var toLength = __webpack_require__(40);
|
3180 |
|
3181 |
|
3182 | var createMethod = function (IS_RIGHT) {
|
3183 | return function (that, callbackfn, argumentsLength, memo) {
|
3184 | aFunction(callbackfn);
|
3185 | var O = toObject(that);
|
3186 | var self = IndexedObject(O);
|
3187 | var length = toLength(O.length);
|
3188 | var index = IS_RIGHT ? length - 1 : 0;
|
3189 | var i = IS_RIGHT ? -1 : 1;
|
3190 | if (argumentsLength < 2) while (true) {
|
3191 | if (index in self) {
|
3192 | memo = self[index];
|
3193 | index += i;
|
3194 | break;
|
3195 | }
|
3196 | index += i;
|
3197 | if (IS_RIGHT ? index < 0 : length <= index) {
|
3198 | throw TypeError('Reduce of empty array with no initial value');
|
3199 | }
|
3200 | }
|
3201 | for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
|
3202 | memo = callbackfn(memo, self[index], index, O);
|
3203 | }
|
3204 | return memo;
|
3205 | };
|
3206 | };
|
3207 |
|
3208 | module.exports = {
|
3209 |
|
3210 |
|
3211 | left: createMethod(false),
|
3212 |
|
3213 |
|
3214 | right: createMethod(true)
|
3215 | };
|
3216 |
|
3217 |
|
3218 | }),
|
3219 |
|
3220 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3221 |
|
3222 | "use strict";
|
3223 |
|
3224 | var $ = __webpack_require__(3);
|
3225 | var $reduceRight = __webpack_require__(123).right;
|
3226 | var arrayMethodIsStrict = __webpack_require__(105);
|
3227 | var CHROME_VERSION = __webpack_require__(48);
|
3228 | var IS_NODE = __webpack_require__(47);
|
3229 |
|
3230 | var STRICT_METHOD = arrayMethodIsStrict('reduceRight');
|
3231 |
|
3232 |
|
3233 | var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
|
3234 |
|
3235 |
|
3236 |
|
3237 | $({ target: 'Array', proto: true, forced: !STRICT_METHOD || CHROME_BUG }, {
|
3238 | reduceRight: function reduceRight(callbackfn /* , initialValue */) {
|
3239 | return $reduceRight(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
|
3240 | }
|
3241 | });
|
3242 |
|
3243 |
|
3244 | }),
|
3245 |
|
3246 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3247 |
|
3248 | "use strict";
|
3249 |
|
3250 | var $ = __webpack_require__(3);
|
3251 | var isArray = __webpack_require__(51);
|
3252 |
|
3253 | var nativeReverse = [].reverse;
|
3254 | var test = [1, 2];
|
3255 |
|
3256 |
|
3257 |
|
3258 |
|
3259 |
|
3260 | $({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {
|
3261 | reverse: function reverse() {
|
3262 |
|
3263 | if (isArray(this)) this.length = this.length;
|
3264 | return nativeReverse.call(this);
|
3265 | }
|
3266 | });
|
3267 |
|
3268 |
|
3269 | }),
|
3270 |
|
3271 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3272 |
|
3273 | "use strict";
|
3274 |
|
3275 | var $ = __webpack_require__(3);
|
3276 | var isObject = __webpack_require__(15);
|
3277 | var isArray = __webpack_require__(51);
|
3278 | var toAbsoluteIndex = __webpack_require__(42);
|
3279 | var toLength = __webpack_require__(40);
|
3280 | var toIndexedObject = __webpack_require__(10);
|
3281 | var createProperty = __webpack_require__(95);
|
3282 | var wellKnownSymbol = __webpack_require__(58);
|
3283 | var arrayMethodHasSpeciesSupport = __webpack_require__(100);
|
3284 |
|
3285 | var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
|
3286 |
|
3287 | var SPECIES = wellKnownSymbol('species');
|
3288 | var nativeSlice = [].slice;
|
3289 | var max = Math.max;
|
3290 |
|
3291 |
|
3292 |
|
3293 |
|
3294 | $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
|
3295 | slice: function slice(start, end) {
|
3296 | var O = toIndexedObject(this);
|
3297 | var length = toLength(O.length);
|
3298 | var k = toAbsoluteIndex(start, length);
|
3299 | var fin = toAbsoluteIndex(end === undefined ? length : end, length);
|
3300 |
|
3301 | var Constructor, result, n;
|
3302 | if (isArray(O)) {
|
3303 | Constructor = O.constructor;
|
3304 |
|
3305 | if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {
|
3306 | Constructor = undefined;
|
3307 | } else if (isObject(Constructor)) {
|
3308 | Constructor = Constructor[SPECIES];
|
3309 | if (Constructor === null) Constructor = undefined;
|
3310 | }
|
3311 | if (Constructor === Array || Constructor === undefined) {
|
3312 | return nativeSlice.call(O, k, fin);
|
3313 | }
|
3314 | }
|
3315 | result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));
|
3316 | for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
|
3317 | result.length = n;
|
3318 | return result;
|
3319 | }
|
3320 | });
|
3321 |
|
3322 |
|
3323 | }),
|
3324 |
|
3325 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3326 |
|
3327 | "use strict";
|
3328 |
|
3329 | var $ = __webpack_require__(3);
|
3330 | var $some = __webpack_require__(62).some;
|
3331 | var arrayMethodIsStrict = __webpack_require__(105);
|
3332 |
|
3333 | var STRICT_METHOD = arrayMethodIsStrict('some');
|
3334 |
|
3335 |
|
3336 |
|
3337 | $({ target: 'Array', proto: true, forced: !STRICT_METHOD }, {
|
3338 | some: function some(callbackfn /* , thisArg */) {
|
3339 | return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
3340 | }
|
3341 | });
|
3342 |
|
3343 |
|
3344 | }),
|
3345 |
|
3346 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3347 |
|
3348 | "use strict";
|
3349 |
|
3350 | var $ = __webpack_require__(3);
|
3351 | var aFunction = __webpack_require__(64);
|
3352 | var toObject = __webpack_require__(52);
|
3353 | var fails = __webpack_require__(7);
|
3354 | var arrayMethodIsStrict = __webpack_require__(105);
|
3355 |
|
3356 | var test = [];
|
3357 | var nativeSort = test.sort;
|
3358 |
|
3359 |
|
3360 | var FAILS_ON_UNDEFINED = fails(function () {
|
3361 | test.sort(undefined);
|
3362 | });
|
3363 |
|
3364 | var FAILS_ON_NULL = fails(function () {
|
3365 | test.sort(null);
|
3366 | });
|
3367 |
|
3368 | var STRICT_METHOD = arrayMethodIsStrict('sort');
|
3369 |
|
3370 | var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD;
|
3371 |
|
3372 |
|
3373 |
|
3374 | $({ target: 'Array', proto: true, forced: FORCED }, {
|
3375 | sort: function sort(comparefn) {
|
3376 | return comparefn === undefined
|
3377 | ? nativeSort.call(toObject(this))
|
3378 | : nativeSort.call(toObject(this), aFunction(comparefn));
|
3379 | }
|
3380 | });
|
3381 |
|
3382 |
|
3383 | }),
|
3384 |
|
3385 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3386 |
|
3387 | "use strict";
|
3388 |
|
3389 | var $ = __webpack_require__(3);
|
3390 | var toAbsoluteIndex = __webpack_require__(42);
|
3391 | var toInteger = __webpack_require__(41);
|
3392 | var toLength = __webpack_require__(40);
|
3393 | var toObject = __webpack_require__(52);
|
3394 | var arraySpeciesCreate = __webpack_require__(65);
|
3395 | var createProperty = __webpack_require__(95);
|
3396 | var arrayMethodHasSpeciesSupport = __webpack_require__(100);
|
3397 |
|
3398 | var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
|
3399 |
|
3400 | var max = Math.max;
|
3401 | var min = Math.min;
|
3402 | var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
|
3403 | var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded';
|
3404 |
|
3405 |
|
3406 |
|
3407 |
|
3408 | $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
|
3409 | splice: function splice(start, deleteCount /* , ...items */) {
|
3410 | var O = toObject(this);
|
3411 | var len = toLength(O.length);
|
3412 | var actualStart = toAbsoluteIndex(start, len);
|
3413 | var argumentsLength = arguments.length;
|
3414 | var insertCount, actualDeleteCount, A, k, from, to;
|
3415 | if (argumentsLength === 0) {
|
3416 | insertCount = actualDeleteCount = 0;
|
3417 | } else if (argumentsLength === 1) {
|
3418 | insertCount = 0;
|
3419 | actualDeleteCount = len - actualStart;
|
3420 | } else {
|
3421 | insertCount = argumentsLength - 2;
|
3422 | actualDeleteCount = min(max(toInteger(deleteCount), 0), len - actualStart);
|
3423 | }
|
3424 | if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) {
|
3425 | throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);
|
3426 | }
|
3427 | A = arraySpeciesCreate(O, actualDeleteCount);
|
3428 | for (k = 0; k < actualDeleteCount; k++) {
|
3429 | from = actualStart + k;
|
3430 | if (from in O) createProperty(A, k, O[from]);
|
3431 | }
|
3432 | A.length = actualDeleteCount;
|
3433 | if (insertCount < actualDeleteCount) {
|
3434 | for (k = actualStart; k < len - actualDeleteCount; k++) {
|
3435 | from = k + actualDeleteCount;
|
3436 | to = k + insertCount;
|
3437 | if (from in O) O[to] = O[from];
|
3438 | else delete O[to];
|
3439 | }
|
3440 | for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1];
|
3441 | } else if (insertCount > actualDeleteCount) {
|
3442 | for (k = len - actualDeleteCount; k > actualStart; k--) {
|
3443 | from = k + actualDeleteCount - 1;
|
3444 | to = k + insertCount - 1;
|
3445 | if (from in O) O[to] = O[from];
|
3446 | else delete O[to];
|
3447 | }
|
3448 | }
|
3449 | for (k = 0; k < insertCount; k++) {
|
3450 | O[k + actualStart] = arguments[k + 2];
|
3451 | }
|
3452 | O.length = len - actualDeleteCount + insertCount;
|
3453 | return A;
|
3454 | }
|
3455 | });
|
3456 |
|
3457 |
|
3458 | }),
|
3459 |
|
3460 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3461 |
|
3462 | var setSpecies = __webpack_require__(131);
|
3463 |
|
3464 |
|
3465 |
|
3466 | setSpecies('Array');
|
3467 |
|
3468 |
|
3469 | }),
|
3470 |
|
3471 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
3472 |
|
3473 | "use strict";
|
3474 |
|
3475 | var getBuiltIn = __webpack_require__(35);
|
3476 | var definePropertyModule = __webpack_require__(20);
|
3477 | var wellKnownSymbol = __webpack_require__(58);
|
3478 | var DESCRIPTORS = __webpack_require__(6);
|
3479 |
|
3480 | var SPECIES = wellKnownSymbol('species');
|
3481 |
|
3482 | module.exports = function (CONSTRUCTOR_NAME) {
|
3483 | var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
|
3484 | var defineProperty = definePropertyModule.f;
|
3485 |
|
3486 | if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
|
3487 | defineProperty(Constructor, SPECIES, {
|
3488 | configurable: true,
|
3489 | get: function () { return this; }
|
3490 | });
|
3491 | }
|
3492 | };
|
3493 |
|
3494 |
|
3495 | }),
|
3496 |
|
3497 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3498 |
|
3499 |
|
3500 |
|
3501 | var addToUnscopables = __webpack_require__(103);
|
3502 |
|
3503 |
|
3504 | addToUnscopables('flat');
|
3505 |
|
3506 |
|
3507 | }),
|
3508 |
|
3509 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3510 |
|
3511 |
|
3512 |
|
3513 | var addToUnscopables = __webpack_require__(103);
|
3514 |
|
3515 |
|
3516 | addToUnscopables('flatMap');
|
3517 |
|
3518 |
|
3519 | }),
|
3520 |
|
3521 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
3522 |
|
3523 | "use strict";
|
3524 |
|
3525 | var toIndexedObject = __webpack_require__(10);
|
3526 | var addToUnscopables = __webpack_require__(103);
|
3527 | var Iterators = __webpack_require__(87);
|
3528 | var InternalStateModule = __webpack_require__(26);
|
3529 | var defineIterator = __webpack_require__(135);
|
3530 |
|
3531 | var ARRAY_ITERATOR = 'Array Iterator';
|
3532 | var setInternalState = InternalStateModule.set;
|
3533 | var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
|
3534 |
|
3535 |
|
3536 |
|
3537 |
|
3538 |
|
3539 |
|
3540 |
|
3541 |
|
3542 |
|
3543 |
|
3544 |
|
3545 | module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
|
3546 | setInternalState(this, {
|
3547 | type: ARRAY_ITERATOR,
|
3548 | target: toIndexedObject(iterated),
|
3549 | index: 0,
|
3550 | kind: kind
|
3551 | });
|
3552 |
|
3553 |
|
3554 | }, function () {
|
3555 | var state = getInternalState(this);
|
3556 | var target = state.target;
|
3557 | var kind = state.kind;
|
3558 | var index = state.index++;
|
3559 | if (!target || index >= target.length) {
|
3560 | state.target = undefined;
|
3561 | return { value: undefined, done: true };
|
3562 | }
|
3563 | if (kind == 'keys') return { value: index, done: false };
|
3564 | if (kind == 'values') return { value: target[index], done: false };
|
3565 | return { value: [index, target[index]], done: false };
|
3566 | }, 'values');
|
3567 |
|
3568 |
|
3569 |
|
3570 |
|
3571 | Iterators.Arguments = Iterators.Array;
|
3572 |
|
3573 |
|
3574 | addToUnscopables('keys');
|
3575 | addToUnscopables('values');
|
3576 | addToUnscopables('entries');
|
3577 |
|
3578 |
|
3579 | }),
|
3580 |
|
3581 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
3582 |
|
3583 | "use strict";
|
3584 |
|
3585 | var $ = __webpack_require__(3);
|
3586 | var createIteratorConstructor = __webpack_require__(136);
|
3587 | var getPrototypeOf = __webpack_require__(81);
|
3588 | var setPrototypeOf = __webpack_require__(83);
|
3589 | var setToStringTag = __webpack_require__(61);
|
3590 | var createNonEnumerableProperty = __webpack_require__(19);
|
3591 | var redefine = __webpack_require__(22);
|
3592 | var wellKnownSymbol = __webpack_require__(58);
|
3593 | var IS_PURE = __webpack_require__(30);
|
3594 | var Iterators = __webpack_require__(87);
|
3595 | var IteratorsCore = __webpack_require__(137);
|
3596 |
|
3597 | var IteratorPrototype = IteratorsCore.IteratorPrototype;
|
3598 | var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
|
3599 | var ITERATOR = wellKnownSymbol('iterator');
|
3600 | var KEYS = 'keys';
|
3601 | var VALUES = 'values';
|
3602 | var ENTRIES = 'entries';
|
3603 |
|
3604 | var returnThis = function () { return this; };
|
3605 |
|
3606 | module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
|
3607 | createIteratorConstructor(IteratorConstructor, NAME, next);
|
3608 |
|
3609 | var getIterationMethod = function (KIND) {
|
3610 | if (KIND === DEFAULT && defaultIterator) return defaultIterator;
|
3611 | if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
|
3612 | switch (KIND) {
|
3613 | case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
|
3614 | case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
|
3615 | case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
|
3616 | } return function () { return new IteratorConstructor(this); };
|
3617 | };
|
3618 |
|
3619 | var TO_STRING_TAG = NAME + ' Iterator';
|
3620 | var INCORRECT_VALUES_NAME = false;
|
3621 | var IterablePrototype = Iterable.prototype;
|
3622 | var nativeIterator = IterablePrototype[ITERATOR]
|
3623 | || IterablePrototype['@@iterator']
|
3624 | || DEFAULT && IterablePrototype[DEFAULT];
|
3625 | var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
|
3626 | var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
|
3627 | var CurrentIteratorPrototype, methods, KEY;
|
3628 |
|
3629 |
|
3630 | if (anyNativeIterator) {
|
3631 | CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
|
3632 | if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
|
3633 | if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
|
3634 | if (setPrototypeOf) {
|
3635 | setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
|
3636 | } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') {
|
3637 | createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis);
|
3638 | }
|
3639 | }
|
3640 |
|
3641 | setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
|
3642 | if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
|
3643 | }
|
3644 | }
|
3645 |
|
3646 |
|
3647 | if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
3648 | INCORRECT_VALUES_NAME = true;
|
3649 | defaultIterator = function values() { return nativeIterator.call(this); };
|
3650 | }
|
3651 |
|
3652 |
|
3653 | if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
|
3654 | createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator);
|
3655 | }
|
3656 | Iterators[NAME] = defaultIterator;
|
3657 |
|
3658 |
|
3659 | if (DEFAULT) {
|
3660 | methods = {
|
3661 | values: getIterationMethod(VALUES),
|
3662 | keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
|
3663 | entries: getIterationMethod(ENTRIES)
|
3664 | };
|
3665 | if (FORCED) for (KEY in methods) {
|
3666 | if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
3667 | redefine(IterablePrototype, KEY, methods[KEY]);
|
3668 | }
|
3669 | } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
|
3670 | }
|
3671 |
|
3672 | return methods;
|
3673 | };
|
3674 |
|
3675 |
|
3676 | }),
|
3677 |
|
3678 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
3679 |
|
3680 | "use strict";
|
3681 |
|
3682 | var IteratorPrototype = __webpack_require__(137).IteratorPrototype;
|
3683 | var create = __webpack_require__(53);
|
3684 | var createPropertyDescriptor = __webpack_require__(9);
|
3685 | var setToStringTag = __webpack_require__(61);
|
3686 | var Iterators = __webpack_require__(87);
|
3687 |
|
3688 | var returnThis = function () { return this; };
|
3689 |
|
3690 | module.exports = function (IteratorConstructor, NAME, next) {
|
3691 | var TO_STRING_TAG = NAME + ' Iterator';
|
3692 | IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) });
|
3693 | setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
|
3694 | Iterators[TO_STRING_TAG] = returnThis;
|
3695 | return IteratorConstructor;
|
3696 | };
|
3697 |
|
3698 |
|
3699 | }),
|
3700 |
|
3701 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
3702 |
|
3703 | "use strict";
|
3704 |
|
3705 | var fails = __webpack_require__(7);
|
3706 | var getPrototypeOf = __webpack_require__(81);
|
3707 | var createNonEnumerableProperty = __webpack_require__(19);
|
3708 | var has = __webpack_require__(16);
|
3709 | var wellKnownSymbol = __webpack_require__(58);
|
3710 | var IS_PURE = __webpack_require__(30);
|
3711 |
|
3712 | var ITERATOR = wellKnownSymbol('iterator');
|
3713 | var BUGGY_SAFARI_ITERATORS = false;
|
3714 |
|
3715 | var returnThis = function () { return this; };
|
3716 |
|
3717 |
|
3718 |
|
3719 | var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
3720 |
|
3721 | if ([].keys) {
|
3722 | arrayIterator = [].keys();
|
3723 |
|
3724 | if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
|
3725 | else {
|
3726 | PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
|
3727 | if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
|
3728 | }
|
3729 | }
|
3730 |
|
3731 | var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () {
|
3732 | var test = {};
|
3733 |
|
3734 | return IteratorPrototype[ITERATOR].call(test) !== test;
|
3735 | });
|
3736 |
|
3737 | if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
|
3738 |
|
3739 |
|
3740 | if ((!IS_PURE || NEW_ITERATOR_PROTOTYPE) && !has(IteratorPrototype, ITERATOR)) {
|
3741 | createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);
|
3742 | }
|
3743 |
|
3744 | module.exports = {
|
3745 | IteratorPrototype: IteratorPrototype,
|
3746 | BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
|
3747 | };
|
3748 |
|
3749 |
|
3750 | }),
|
3751 |
|
3752 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3753 |
|
3754 | var $ = __webpack_require__(3);
|
3755 | var bind = __webpack_require__(139);
|
3756 |
|
3757 |
|
3758 |
|
3759 | $({ target: 'Function', proto: true }, {
|
3760 | bind: bind
|
3761 | });
|
3762 |
|
3763 |
|
3764 | }),
|
3765 |
|
3766 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
3767 |
|
3768 | "use strict";
|
3769 |
|
3770 | var aFunction = __webpack_require__(64);
|
3771 | var isObject = __webpack_require__(15);
|
3772 |
|
3773 | var slice = [].slice;
|
3774 | var factories = {};
|
3775 |
|
3776 | var construct = function (C, argsLength, args) {
|
3777 | if (!(argsLength in factories)) {
|
3778 | for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';
|
3779 |
|
3780 | factories[argsLength] = Function('C,a', 'return new C(' + list.join(',') + ')');
|
3781 | } return factories[argsLength](C, args);
|
3782 | };
|
3783 |
|
3784 |
|
3785 |
|
3786 | module.exports = Function.bind || function bind(that /* , ...args */) {
|
3787 | var fn = aFunction(this);
|
3788 | var partArgs = slice.call(arguments, 1);
|
3789 | var boundFunction = function bound(/* args... */) {
|
3790 | var args = partArgs.concat(slice.call(arguments));
|
3791 | return this instanceof boundFunction ? construct(fn, args.length, args) : fn.apply(that, args);
|
3792 | };
|
3793 | if (isObject(fn.prototype)) boundFunction.prototype = fn.prototype;
|
3794 | return boundFunction;
|
3795 | };
|
3796 |
|
3797 |
|
3798 | }),
|
3799 |
|
3800 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3801 |
|
3802 | var DESCRIPTORS = __webpack_require__(6);
|
3803 | var defineProperty = __webpack_require__(20).f;
|
3804 |
|
3805 | var FunctionPrototype = Function.prototype;
|
3806 | var FunctionPrototypeToString = FunctionPrototype.toString;
|
3807 | var nameRE = /^\s*function ([^ (]*)/;
|
3808 | var NAME = 'name';
|
3809 |
|
3810 |
|
3811 |
|
3812 | if (DESCRIPTORS && !(NAME in FunctionPrototype)) {
|
3813 | defineProperty(FunctionPrototype, NAME, {
|
3814 | configurable: true,
|
3815 | get: function () {
|
3816 | try {
|
3817 | return FunctionPrototypeToString.call(this).match(nameRE)[1];
|
3818 | } catch (error) {
|
3819 | return '';
|
3820 | }
|
3821 | }
|
3822 | });
|
3823 | }
|
3824 |
|
3825 |
|
3826 | }),
|
3827 |
|
3828 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3829 |
|
3830 | "use strict";
|
3831 |
|
3832 | var isObject = __webpack_require__(15);
|
3833 | var definePropertyModule = __webpack_require__(20);
|
3834 | var getPrototypeOf = __webpack_require__(81);
|
3835 | var wellKnownSymbol = __webpack_require__(58);
|
3836 |
|
3837 | var HAS_INSTANCE = wellKnownSymbol('hasInstance');
|
3838 | var FunctionPrototype = Function.prototype;
|
3839 |
|
3840 |
|
3841 |
|
3842 | if (!(HAS_INSTANCE in FunctionPrototype)) {
|
3843 | definePropertyModule.f(FunctionPrototype, HAS_INSTANCE, { value: function (O) {
|
3844 | if (typeof this != 'function' || !isObject(O)) return false;
|
3845 | if (!isObject(this.prototype)) return O instanceof this;
|
3846 |
|
3847 | while (O = getPrototypeOf(O)) if (this.prototype === O) return true;
|
3848 | return false;
|
3849 | } });
|
3850 | }
|
3851 |
|
3852 |
|
3853 | }),
|
3854 |
|
3855 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3856 |
|
3857 | var $ = __webpack_require__(3);
|
3858 | var global = __webpack_require__(4);
|
3859 |
|
3860 |
|
3861 |
|
3862 | $({ global: true }, {
|
3863 | globalThis: global
|
3864 | });
|
3865 |
|
3866 |
|
3867 | }),
|
3868 |
|
3869 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3870 |
|
3871 | var $ = __webpack_require__(3);
|
3872 | var assign = __webpack_require__(144);
|
3873 |
|
3874 |
|
3875 |
|
3876 | $({ target: 'Object', stat: true, forced: Object.assign !== assign }, {
|
3877 | assign: assign
|
3878 | });
|
3879 |
|
3880 |
|
3881 | }),
|
3882 |
|
3883 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
3884 |
|
3885 | "use strict";
|
3886 |
|
3887 | var DESCRIPTORS = __webpack_require__(6);
|
3888 | var fails = __webpack_require__(7);
|
3889 | var objectKeys = __webpack_require__(55);
|
3890 | var getOwnPropertySymbolsModule = __webpack_require__(44);
|
3891 | var propertyIsEnumerableModule = __webpack_require__(8);
|
3892 | var toObject = __webpack_require__(52);
|
3893 | var IndexedObject = __webpack_require__(11);
|
3894 |
|
3895 | var nativeAssign = Object.assign;
|
3896 | var defineProperty = Object.defineProperty;
|
3897 |
|
3898 |
|
3899 |
|
3900 | module.exports = !nativeAssign || fails(function () {
|
3901 |
|
3902 | if (DESCRIPTORS && nativeAssign({ b: 1 }, nativeAssign(defineProperty({}, 'a', {
|
3903 | enumerable: true,
|
3904 | get: function () {
|
3905 | defineProperty(this, 'b', {
|
3906 | value: 3,
|
3907 | enumerable: false
|
3908 | });
|
3909 | }
|
3910 | }), { b: 2 })).b !== 1) return true;
|
3911 |
|
3912 | var A = {};
|
3913 | var B = {};
|
3914 |
|
3915 | var symbol = Symbol();
|
3916 | var alphabet = 'abcdefghijklmnopqrst';
|
3917 | A[symbol] = 7;
|
3918 | alphabet.split('').forEach(function (chr) { B[chr] = chr; });
|
3919 | return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
|
3920 | }) ? function assign(target, source) {
|
3921 | var T = toObject(target);
|
3922 | var argumentsLength = arguments.length;
|
3923 | var index = 1;
|
3924 | var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
3925 | var propertyIsEnumerable = propertyIsEnumerableModule.f;
|
3926 | while (argumentsLength > index) {
|
3927 | var S = IndexedObject(arguments[index++]);
|
3928 | var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);
|
3929 | var length = keys.length;
|
3930 | var j = 0;
|
3931 | var key;
|
3932 | while (length > j) {
|
3933 | key = keys[j++];
|
3934 | if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key];
|
3935 | }
|
3936 | } return T;
|
3937 | } : nativeAssign;
|
3938 |
|
3939 |
|
3940 | }),
|
3941 |
|
3942 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3943 |
|
3944 | var $ = __webpack_require__(3);
|
3945 | var DESCRIPTORS = __webpack_require__(6);
|
3946 | var create = __webpack_require__(53);
|
3947 |
|
3948 |
|
3949 |
|
3950 | $({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {
|
3951 | create: create
|
3952 | });
|
3953 |
|
3954 |
|
3955 | }),
|
3956 |
|
3957 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3958 |
|
3959 | var $ = __webpack_require__(3);
|
3960 | var DESCRIPTORS = __webpack_require__(6);
|
3961 | var objectDefinePropertyModile = __webpack_require__(20);
|
3962 |
|
3963 |
|
3964 |
|
3965 | $({ target: 'Object', stat: true, forced: !DESCRIPTORS, sham: !DESCRIPTORS }, {
|
3966 | defineProperty: objectDefinePropertyModile.f
|
3967 | });
|
3968 |
|
3969 |
|
3970 | }),
|
3971 |
|
3972 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3973 |
|
3974 | var $ = __webpack_require__(3);
|
3975 | var DESCRIPTORS = __webpack_require__(6);
|
3976 | var defineProperties = __webpack_require__(54);
|
3977 |
|
3978 |
|
3979 |
|
3980 | $({ target: 'Object', stat: true, forced: !DESCRIPTORS, sham: !DESCRIPTORS }, {
|
3981 | defineProperties: defineProperties
|
3982 | });
|
3983 |
|
3984 |
|
3985 | }),
|
3986 |
|
3987 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3988 |
|
3989 | var $ = __webpack_require__(3);
|
3990 | var $entries = __webpack_require__(149).entries;
|
3991 |
|
3992 |
|
3993 |
|
3994 | $({ target: 'Object', stat: true }, {
|
3995 | entries: function entries(O) {
|
3996 | return $entries(O);
|
3997 | }
|
3998 | });
|
3999 |
|
4000 |
|
4001 | }),
|
4002 |
|
4003 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
4004 |
|
4005 | var DESCRIPTORS = __webpack_require__(6);
|
4006 | var objectKeys = __webpack_require__(55);
|
4007 | var toIndexedObject = __webpack_require__(10);
|
4008 | var propertyIsEnumerable = __webpack_require__(8).f;
|
4009 |
|
4010 |
|
4011 | var createMethod = function (TO_ENTRIES) {
|
4012 | return function (it) {
|
4013 | var O = toIndexedObject(it);
|
4014 | var keys = objectKeys(O);
|
4015 | var length = keys.length;
|
4016 | var i = 0;
|
4017 | var result = [];
|
4018 | var key;
|
4019 | while (length > i) {
|
4020 | key = keys[i++];
|
4021 | if (!DESCRIPTORS || propertyIsEnumerable.call(O, key)) {
|
4022 | result.push(TO_ENTRIES ? [key, O[key]] : O[key]);
|
4023 | }
|
4024 | }
|
4025 | return result;
|
4026 | };
|
4027 | };
|
4028 |
|
4029 | module.exports = {
|
4030 |
|
4031 |
|
4032 | entries: createMethod(true),
|
4033 |
|
4034 |
|
4035 | values: createMethod(false)
|
4036 | };
|
4037 |
|
4038 |
|
4039 | }),
|
4040 |
|
4041 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4042 |
|
4043 | var $ = __webpack_require__(3);
|
4044 | var FREEZING = __webpack_require__(151);
|
4045 | var fails = __webpack_require__(7);
|
4046 | var isObject = __webpack_require__(15);
|
4047 | var onFreeze = __webpack_require__(152).onFreeze;
|
4048 |
|
4049 | var nativeFreeze = Object.freeze;
|
4050 | var FAILS_ON_PRIMITIVES = fails(function () { nativeFreeze(1); });
|
4051 |
|
4052 |
|
4053 |
|
4054 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, {
|
4055 | freeze: function freeze(it) {
|
4056 | return nativeFreeze && isObject(it) ? nativeFreeze(onFreeze(it)) : it;
|
4057 | }
|
4058 | });
|
4059 |
|
4060 |
|
4061 | }),
|
4062 |
|
4063 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
4064 |
|
4065 | var fails = __webpack_require__(7);
|
4066 |
|
4067 | module.exports = !fails(function () {
|
4068 | return Object.isExtensible(Object.preventExtensions({}));
|
4069 | });
|
4070 |
|
4071 |
|
4072 | }),
|
4073 |
|
4074 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
4075 |
|
4076 | var hiddenKeys = __webpack_require__(32);
|
4077 | var isObject = __webpack_require__(15);
|
4078 | var has = __webpack_require__(16);
|
4079 | var defineProperty = __webpack_require__(20).f;
|
4080 | var uid = __webpack_require__(31);
|
4081 | var FREEZING = __webpack_require__(151);
|
4082 |
|
4083 | var METADATA = uid('meta');
|
4084 | var id = 0;
|
4085 |
|
4086 | var isExtensible = Object.isExtensible || function () {
|
4087 | return true;
|
4088 | };
|
4089 |
|
4090 | var setMetadata = function (it) {
|
4091 | defineProperty(it, METADATA, { value: {
|
4092 | objectID: 'O' + ++id,
|
4093 | weakData: {}
|
4094 | } });
|
4095 | };
|
4096 |
|
4097 | var fastKey = function (it, create) {
|
4098 |
|
4099 | if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
|
4100 | if (!has(it, METADATA)) {
|
4101 |
|
4102 | if (!isExtensible(it)) return 'F';
|
4103 |
|
4104 | if (!create) return 'E';
|
4105 |
|
4106 | setMetadata(it);
|
4107 |
|
4108 | } return it[METADATA].objectID;
|
4109 | };
|
4110 |
|
4111 | var getWeakData = function (it, create) {
|
4112 | if (!has(it, METADATA)) {
|
4113 |
|
4114 | if (!isExtensible(it)) return true;
|
4115 |
|
4116 | if (!create) return false;
|
4117 |
|
4118 | setMetadata(it);
|
4119 |
|
4120 | } return it[METADATA].weakData;
|
4121 | };
|
4122 |
|
4123 |
|
4124 | var onFreeze = function (it) {
|
4125 | if (FREEZING && meta.REQUIRED && isExtensible(it) && !has(it, METADATA)) setMetadata(it);
|
4126 | return it;
|
4127 | };
|
4128 |
|
4129 | var meta = module.exports = {
|
4130 | REQUIRED: false,
|
4131 | fastKey: fastKey,
|
4132 | getWeakData: getWeakData,
|
4133 | onFreeze: onFreeze
|
4134 | };
|
4135 |
|
4136 | hiddenKeys[METADATA] = true;
|
4137 |
|
4138 |
|
4139 | }),
|
4140 |
|
4141 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4142 |
|
4143 | var $ = __webpack_require__(3);
|
4144 | var iterate = __webpack_require__(85);
|
4145 | var createProperty = __webpack_require__(95);
|
4146 |
|
4147 |
|
4148 |
|
4149 | $({ target: 'Object', stat: true }, {
|
4150 | fromEntries: function fromEntries(iterable) {
|
4151 | var obj = {};
|
4152 | iterate(iterable, function (k, v) {
|
4153 | createProperty(obj, k, v);
|
4154 | }, { AS_ENTRIES: true });
|
4155 | return obj;
|
4156 | }
|
4157 | });
|
4158 |
|
4159 |
|
4160 | }),
|
4161 |
|
4162 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4163 |
|
4164 | var $ = __webpack_require__(3);
|
4165 | var fails = __webpack_require__(7);
|
4166 | var toIndexedObject = __webpack_require__(10);
|
4167 | var nativeGetOwnPropertyDescriptor = __webpack_require__(5).f;
|
4168 | var DESCRIPTORS = __webpack_require__(6);
|
4169 |
|
4170 | var FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); });
|
4171 | var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES;
|
4172 |
|
4173 |
|
4174 |
|
4175 | $({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, {
|
4176 | getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
|
4177 | return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);
|
4178 | }
|
4179 | });
|
4180 |
|
4181 |
|
4182 | }),
|
4183 |
|
4184 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4185 |
|
4186 | var $ = __webpack_require__(3);
|
4187 | var DESCRIPTORS = __webpack_require__(6);
|
4188 | var ownKeys = __webpack_require__(34);
|
4189 | var toIndexedObject = __webpack_require__(10);
|
4190 | var getOwnPropertyDescriptorModule = __webpack_require__(5);
|
4191 | var createProperty = __webpack_require__(95);
|
4192 |
|
4193 |
|
4194 |
|
4195 | $({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {
|
4196 | getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
|
4197 | var O = toIndexedObject(object);
|
4198 | var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
4199 | var keys = ownKeys(O);
|
4200 | var result = {};
|
4201 | var index = 0;
|
4202 | var key, descriptor;
|
4203 | while (keys.length > index) {
|
4204 | descriptor = getOwnPropertyDescriptor(O, key = keys[index++]);
|
4205 | if (descriptor !== undefined) createProperty(result, key, descriptor);
|
4206 | }
|
4207 | return result;
|
4208 | }
|
4209 | });
|
4210 |
|
4211 |
|
4212 | }),
|
4213 |
|
4214 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4215 |
|
4216 | var $ = __webpack_require__(3);
|
4217 | var fails = __webpack_require__(7);
|
4218 | var nativeGetOwnPropertyNames = __webpack_require__(57).f;
|
4219 |
|
4220 | var FAILS_ON_PRIMITIVES = fails(function () { return !Object.getOwnPropertyNames(1); });
|
4221 |
|
4222 |
|
4223 |
|
4224 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
|
4225 | getOwnPropertyNames: nativeGetOwnPropertyNames
|
4226 | });
|
4227 |
|
4228 |
|
4229 | }),
|
4230 |
|
4231 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4232 |
|
4233 | var $ = __webpack_require__(3);
|
4234 | var fails = __webpack_require__(7);
|
4235 | var toObject = __webpack_require__(52);
|
4236 | var nativeGetPrototypeOf = __webpack_require__(81);
|
4237 | var CORRECT_PROTOTYPE_GETTER = __webpack_require__(82);
|
4238 |
|
4239 | var FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); });
|
4240 |
|
4241 |
|
4242 |
|
4243 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {
|
4244 | getPrototypeOf: function getPrototypeOf(it) {
|
4245 | return nativeGetPrototypeOf(toObject(it));
|
4246 | }
|
4247 | });
|
4248 |
|
4249 |
|
4250 |
|
4251 | }),
|
4252 |
|
4253 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4254 |
|
4255 | var $ = __webpack_require__(3);
|
4256 | var is = __webpack_require__(159);
|
4257 |
|
4258 |
|
4259 |
|
4260 | $({ target: 'Object', stat: true }, {
|
4261 | is: is
|
4262 | });
|
4263 |
|
4264 |
|
4265 | }),
|
4266 |
|
4267 | (function(module) {
|
4268 |
|
4269 |
|
4270 |
|
4271 | module.exports = Object.is || function is(x, y) {
|
4272 |
|
4273 | return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
|
4274 | };
|
4275 |
|
4276 |
|
4277 | }),
|
4278 |
|
4279 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4280 |
|
4281 | var $ = __webpack_require__(3);
|
4282 | var fails = __webpack_require__(7);
|
4283 | var isObject = __webpack_require__(15);
|
4284 |
|
4285 | var nativeIsExtensible = Object.isExtensible;
|
4286 | var FAILS_ON_PRIMITIVES = fails(function () { nativeIsExtensible(1); });
|
4287 |
|
4288 |
|
4289 |
|
4290 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
|
4291 | isExtensible: function isExtensible(it) {
|
4292 | return isObject(it) ? nativeIsExtensible ? nativeIsExtensible(it) : true : false;
|
4293 | }
|
4294 | });
|
4295 |
|
4296 |
|
4297 | }),
|
4298 |
|
4299 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4300 |
|
4301 | var $ = __webpack_require__(3);
|
4302 | var fails = __webpack_require__(7);
|
4303 | var isObject = __webpack_require__(15);
|
4304 |
|
4305 | var nativeIsFrozen = Object.isFrozen;
|
4306 | var FAILS_ON_PRIMITIVES = fails(function () { nativeIsFrozen(1); });
|
4307 |
|
4308 |
|
4309 |
|
4310 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
|
4311 | isFrozen: function isFrozen(it) {
|
4312 | return isObject(it) ? nativeIsFrozen ? nativeIsFrozen(it) : false : true;
|
4313 | }
|
4314 | });
|
4315 |
|
4316 |
|
4317 | }),
|
4318 |
|
4319 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4320 |
|
4321 | var $ = __webpack_require__(3);
|
4322 | var fails = __webpack_require__(7);
|
4323 | var isObject = __webpack_require__(15);
|
4324 |
|
4325 | var nativeIsSealed = Object.isSealed;
|
4326 | var FAILS_ON_PRIMITIVES = fails(function () { nativeIsSealed(1); });
|
4327 |
|
4328 |
|
4329 |
|
4330 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
|
4331 | isSealed: function isSealed(it) {
|
4332 | return isObject(it) ? nativeIsSealed ? nativeIsSealed(it) : false : true;
|
4333 | }
|
4334 | });
|
4335 |
|
4336 |
|
4337 | }),
|
4338 |
|
4339 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4340 |
|
4341 | var $ = __webpack_require__(3);
|
4342 | var toObject = __webpack_require__(52);
|
4343 | var nativeKeys = __webpack_require__(55);
|
4344 | var fails = __webpack_require__(7);
|
4345 |
|
4346 | var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });
|
4347 |
|
4348 |
|
4349 |
|
4350 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
|
4351 | keys: function keys(it) {
|
4352 | return nativeKeys(toObject(it));
|
4353 | }
|
4354 | });
|
4355 |
|
4356 |
|
4357 | }),
|
4358 |
|
4359 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4360 |
|
4361 | var $ = __webpack_require__(3);
|
4362 | var isObject = __webpack_require__(15);
|
4363 | var onFreeze = __webpack_require__(152).onFreeze;
|
4364 | var FREEZING = __webpack_require__(151);
|
4365 | var fails = __webpack_require__(7);
|
4366 |
|
4367 | var nativePreventExtensions = Object.preventExtensions;
|
4368 | var FAILS_ON_PRIMITIVES = fails(function () { nativePreventExtensions(1); });
|
4369 |
|
4370 |
|
4371 |
|
4372 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, {
|
4373 | preventExtensions: function preventExtensions(it) {
|
4374 | return nativePreventExtensions && isObject(it) ? nativePreventExtensions(onFreeze(it)) : it;
|
4375 | }
|
4376 | });
|
4377 |
|
4378 |
|
4379 | }),
|
4380 |
|
4381 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4382 |
|
4383 | var $ = __webpack_require__(3);
|
4384 | var isObject = __webpack_require__(15);
|
4385 | var onFreeze = __webpack_require__(152).onFreeze;
|
4386 | var FREEZING = __webpack_require__(151);
|
4387 | var fails = __webpack_require__(7);
|
4388 |
|
4389 | var nativeSeal = Object.seal;
|
4390 | var FAILS_ON_PRIMITIVES = fails(function () { nativeSeal(1); });
|
4391 |
|
4392 |
|
4393 |
|
4394 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, {
|
4395 | seal: function seal(it) {
|
4396 | return nativeSeal && isObject(it) ? nativeSeal(onFreeze(it)) : it;
|
4397 | }
|
4398 | });
|
4399 |
|
4400 |
|
4401 | }),
|
4402 |
|
4403 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4404 |
|
4405 | var $ = __webpack_require__(3);
|
4406 | var setPrototypeOf = __webpack_require__(83);
|
4407 |
|
4408 |
|
4409 |
|
4410 | $({ target: 'Object', stat: true }, {
|
4411 | setPrototypeOf: setPrototypeOf
|
4412 | });
|
4413 |
|
4414 |
|
4415 | }),
|
4416 |
|
4417 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4418 |
|
4419 | var $ = __webpack_require__(3);
|
4420 | var $values = __webpack_require__(149).values;
|
4421 |
|
4422 |
|
4423 |
|
4424 | $({ target: 'Object', stat: true }, {
|
4425 | values: function values(O) {
|
4426 | return $values(O);
|
4427 | }
|
4428 | });
|
4429 |
|
4430 |
|
4431 | }),
|
4432 |
|
4433 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4434 |
|
4435 | var TO_STRING_TAG_SUPPORT = __webpack_require__(90);
|
4436 | var redefine = __webpack_require__(22);
|
4437 | var toString = __webpack_require__(169);
|
4438 |
|
4439 |
|
4440 |
|
4441 | if (!TO_STRING_TAG_SUPPORT) {
|
4442 | redefine(Object.prototype, 'toString', toString, { unsafe: true });
|
4443 | }
|
4444 |
|
4445 |
|
4446 | }),
|
4447 |
|
4448 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
4449 |
|
4450 | "use strict";
|
4451 |
|
4452 | var TO_STRING_TAG_SUPPORT = __webpack_require__(90);
|
4453 | var classof = __webpack_require__(89);
|
4454 |
|
4455 |
|
4456 |
|
4457 | module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
|
4458 | return '[object ' + classof(this) + ']';
|
4459 | };
|
4460 |
|
4461 |
|
4462 | }),
|
4463 |
|
4464 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4465 |
|
4466 | "use strict";
|
4467 |
|
4468 | var $ = __webpack_require__(3);
|
4469 | var DESCRIPTORS = __webpack_require__(6);
|
4470 | var FORCED = __webpack_require__(171);
|
4471 | var toObject = __webpack_require__(52);
|
4472 | var aFunction = __webpack_require__(64);
|
4473 | var definePropertyModule = __webpack_require__(20);
|
4474 |
|
4475 |
|
4476 |
|
4477 | if (DESCRIPTORS) {
|
4478 | $({ target: 'Object', proto: true, forced: FORCED }, {
|
4479 | __defineGetter__: function __defineGetter__(P, getter) {
|
4480 | definePropertyModule.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true });
|
4481 | }
|
4482 | });
|
4483 | }
|
4484 |
|
4485 |
|
4486 | }),
|
4487 |
|
4488 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
4489 |
|
4490 | "use strict";
|
4491 |
|
4492 | var IS_PURE = __webpack_require__(30);
|
4493 | var global = __webpack_require__(4);
|
4494 | var fails = __webpack_require__(7);
|
4495 |
|
4496 |
|
4497 | module.exports = IS_PURE || !fails(function () {
|
4498 | var key = Math.random();
|
4499 |
|
4500 |
|
4501 | __defineSetter__.call(null, key, function () { });
|
4502 | delete global[key];
|
4503 | });
|
4504 |
|
4505 |
|
4506 | }),
|
4507 |
|
4508 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4509 |
|
4510 | "use strict";
|
4511 |
|
4512 | var $ = __webpack_require__(3);
|
4513 | var DESCRIPTORS = __webpack_require__(6);
|
4514 | var FORCED = __webpack_require__(171);
|
4515 | var toObject = __webpack_require__(52);
|
4516 | var aFunction = __webpack_require__(64);
|
4517 | var definePropertyModule = __webpack_require__(20);
|
4518 |
|
4519 |
|
4520 |
|
4521 | if (DESCRIPTORS) {
|
4522 | $({ target: 'Object', proto: true, forced: FORCED }, {
|
4523 | __defineSetter__: function __defineSetter__(P, setter) {
|
4524 | definePropertyModule.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true });
|
4525 | }
|
4526 | });
|
4527 | }
|
4528 |
|
4529 |
|
4530 | }),
|
4531 |
|
4532 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4533 |
|
4534 | "use strict";
|
4535 |
|
4536 | var $ = __webpack_require__(3);
|
4537 | var DESCRIPTORS = __webpack_require__(6);
|
4538 | var FORCED = __webpack_require__(171);
|
4539 | var toObject = __webpack_require__(52);
|
4540 | var toPrimitive = __webpack_require__(14);
|
4541 | var getPrototypeOf = __webpack_require__(81);
|
4542 | var getOwnPropertyDescriptor = __webpack_require__(5).f;
|
4543 |
|
4544 |
|
4545 |
|
4546 | if (DESCRIPTORS) {
|
4547 | $({ target: 'Object', proto: true, forced: FORCED }, {
|
4548 | __lookupGetter__: function __lookupGetter__(P) {
|
4549 | var O = toObject(this);
|
4550 | var key = toPrimitive(P, true);
|
4551 | var desc;
|
4552 | do {
|
4553 | if (desc = getOwnPropertyDescriptor(O, key)) return desc.get;
|
4554 | } while (O = getPrototypeOf(O));
|
4555 | }
|
4556 | });
|
4557 | }
|
4558 |
|
4559 |
|
4560 | }),
|
4561 |
|
4562 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4563 |
|
4564 | "use strict";
|
4565 |
|
4566 | var $ = __webpack_require__(3);
|
4567 | var DESCRIPTORS = __webpack_require__(6);
|
4568 | var FORCED = __webpack_require__(171);
|
4569 | var toObject = __webpack_require__(52);
|
4570 | var toPrimitive = __webpack_require__(14);
|
4571 | var getPrototypeOf = __webpack_require__(81);
|
4572 | var getOwnPropertyDescriptor = __webpack_require__(5).f;
|
4573 |
|
4574 |
|
4575 |
|
4576 | if (DESCRIPTORS) {
|
4577 | $({ target: 'Object', proto: true, forced: FORCED }, {
|
4578 | __lookupSetter__: function __lookupSetter__(P) {
|
4579 | var O = toObject(this);
|
4580 | var key = toPrimitive(P, true);
|
4581 | var desc;
|
4582 | do {
|
4583 | if (desc = getOwnPropertyDescriptor(O, key)) return desc.set;
|
4584 | } while (O = getPrototypeOf(O));
|
4585 | }
|
4586 | });
|
4587 | }
|
4588 |
|
4589 |
|
4590 | }),
|
4591 |
|
4592 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4593 |
|
4594 | var $ = __webpack_require__(3);
|
4595 | var toAbsoluteIndex = __webpack_require__(42);
|
4596 |
|
4597 | var fromCharCode = String.fromCharCode;
|
4598 | var nativeFromCodePoint = String.fromCodePoint;
|
4599 |
|
4600 |
|
4601 | var INCORRECT_LENGTH = !!nativeFromCodePoint && nativeFromCodePoint.length != 1;
|
4602 |
|
4603 |
|
4604 |
|
4605 | $({ target: 'String', stat: true, forced: INCORRECT_LENGTH }, {
|
4606 |
|
4607 | fromCodePoint: function fromCodePoint(x) {
|
4608 | var elements = [];
|
4609 | var length = arguments.length;
|
4610 | var i = 0;
|
4611 | var code;
|
4612 | while (length > i) {
|
4613 | code = +arguments[i++];
|
4614 | if (toAbsoluteIndex(code, 0x10FFFF) !== code) throw RangeError(code + ' is not a valid code point');
|
4615 | elements.push(code < 0x10000
|
4616 | ? fromCharCode(code)
|
4617 | : fromCharCode(((code -= 0x10000) >> 10) + 0xD800, code % 0x400 + 0xDC00)
|
4618 | );
|
4619 | } return elements.join('');
|
4620 | }
|
4621 | });
|
4622 |
|
4623 |
|
4624 | }),
|
4625 |
|
4626 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4627 |
|
4628 | var $ = __webpack_require__(3);
|
4629 | var toIndexedObject = __webpack_require__(10);
|
4630 | var toLength = __webpack_require__(40);
|
4631 |
|
4632 |
|
4633 |
|
4634 | $({ target: 'String', stat: true }, {
|
4635 | raw: function raw(template) {
|
4636 | var rawTemplate = toIndexedObject(template.raw);
|
4637 | var literalSegments = toLength(rawTemplate.length);
|
4638 | var argumentsLength = arguments.length;
|
4639 | var elements = [];
|
4640 | var i = 0;
|
4641 | while (literalSegments > i) {
|
4642 | elements.push(String(rawTemplate[i++]));
|
4643 | if (i < argumentsLength) elements.push(String(arguments[i]));
|
4644 | } return elements.join('');
|
4645 | }
|
4646 | });
|
4647 |
|
4648 |
|
4649 | }),
|
4650 |
|
4651 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4652 |
|
4653 | "use strict";
|
4654 |
|
4655 | var $ = __webpack_require__(3);
|
4656 | var codeAt = __webpack_require__(178).codeAt;
|
4657 |
|
4658 |
|
4659 |
|
4660 | $({ target: 'String', proto: true }, {
|
4661 | codePointAt: function codePointAt(pos) {
|
4662 | return codeAt(this, pos);
|
4663 | }
|
4664 | });
|
4665 |
|
4666 |
|
4667 | }),
|
4668 |
|
4669 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
4670 |
|
4671 | var toInteger = __webpack_require__(41);
|
4672 | var requireObjectCoercible = __webpack_require__(13);
|
4673 |
|
4674 |
|
4675 | var createMethod = function (CONVERT_TO_STRING) {
|
4676 | return function ($this, pos) {
|
4677 | var S = String(requireObjectCoercible($this));
|
4678 | var position = toInteger(pos);
|
4679 | var size = S.length;
|
4680 | var first, second;
|
4681 | if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
4682 | first = S.charCodeAt(position);
|
4683 | return first < 0xD800 || first > 0xDBFF || position + 1 === size
|
4684 | || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF
|
4685 | ? CONVERT_TO_STRING ? S.charAt(position) : first
|
4686 | : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
4687 | };
|
4688 | };
|
4689 |
|
4690 | module.exports = {
|
4691 |
|
4692 |
|
4693 | codeAt: createMethod(false),
|
4694 |
|
4695 |
|
4696 | charAt: createMethod(true)
|
4697 | };
|
4698 |
|
4699 |
|
4700 | }),
|
4701 |
|
4702 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4703 |
|
4704 | "use strict";
|
4705 |
|
4706 | var $ = __webpack_require__(3);
|
4707 | var getOwnPropertyDescriptor = __webpack_require__(5).f;
|
4708 | var toLength = __webpack_require__(40);
|
4709 | var notARegExp = __webpack_require__(180);
|
4710 | var requireObjectCoercible = __webpack_require__(13);
|
4711 | var correctIsRegExpLogic = __webpack_require__(182);
|
4712 | var IS_PURE = __webpack_require__(30);
|
4713 |
|
4714 | var nativeEndsWith = ''.endsWith;
|
4715 | var min = Math.min;
|
4716 |
|
4717 | var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('endsWith');
|
4718 |
|
4719 | var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () {
|
4720 | var descriptor = getOwnPropertyDescriptor(String.prototype, 'endsWith');
|
4721 | return descriptor && !descriptor.writable;
|
4722 | }();
|
4723 |
|
4724 |
|
4725 |
|
4726 | $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
|
4727 | endsWith: function endsWith(searchString /* , endPosition = @length */) {
|
4728 | var that = String(requireObjectCoercible(this));
|
4729 | notARegExp(searchString);
|
4730 | var endPosition = arguments.length > 1 ? arguments[1] : undefined;
|
4731 | var len = toLength(that.length);
|
4732 | var end = endPosition === undefined ? len : min(toLength(endPosition), len);
|
4733 | var search = String(searchString);
|
4734 | return nativeEndsWith
|
4735 | ? nativeEndsWith.call(that, search, end)
|
4736 | : that.slice(end - search.length, end) === search;
|
4737 | }
|
4738 | });
|
4739 |
|
4740 |
|
4741 | }),
|
4742 |
|
4743 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
4744 |
|
4745 | var isRegExp = __webpack_require__(181);
|
4746 |
|
4747 | module.exports = function (it) {
|
4748 | if (isRegExp(it)) {
|
4749 | throw TypeError("The method doesn't accept regular expressions");
|
4750 | } return it;
|
4751 | };
|
4752 |
|
4753 |
|
4754 | }),
|
4755 |
|
4756 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
4757 |
|
4758 | var isObject = __webpack_require__(15);
|
4759 | var classof = __webpack_require__(12);
|
4760 | var wellKnownSymbol = __webpack_require__(58);
|
4761 |
|
4762 | var MATCH = wellKnownSymbol('match');
|
4763 |
|
4764 |
|
4765 |
|
4766 | module.exports = function (it) {
|
4767 | var isRegExp;
|
4768 | return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');
|
4769 | };
|
4770 |
|
4771 |
|
4772 | }),
|
4773 |
|
4774 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
4775 |
|
4776 | var wellKnownSymbol = __webpack_require__(58);
|
4777 |
|
4778 | var MATCH = wellKnownSymbol('match');
|
4779 |
|
4780 | module.exports = function (METHOD_NAME) {
|
4781 | var regexp = /./;
|
4782 | try {
|
4783 | '/./'[METHOD_NAME](regexp);
|
4784 | } catch (error1) {
|
4785 | try {
|
4786 | regexp[MATCH] = false;
|
4787 | return '/./'[METHOD_NAME](regexp);
|
4788 | } catch (error2) { }
|
4789 | } return false;
|
4790 | };
|
4791 |
|
4792 |
|
4793 | }),
|
4794 |
|
4795 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4796 |
|
4797 | "use strict";
|
4798 |
|
4799 | var $ = __webpack_require__(3);
|
4800 | var notARegExp = __webpack_require__(180);
|
4801 | var requireObjectCoercible = __webpack_require__(13);
|
4802 | var correctIsRegExpLogic = __webpack_require__(182);
|
4803 |
|
4804 |
|
4805 |
|
4806 | $({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
|
4807 | includes: function includes(searchString /* , position = 0 */) {
|
4808 | return !!~String(requireObjectCoercible(this))
|
4809 | .indexOf(notARegExp(searchString), arguments.length > 1 ? arguments[1] : undefined);
|
4810 | }
|
4811 | });
|
4812 |
|
4813 |
|
4814 | }),
|
4815 |
|
4816 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4817 |
|
4818 | "use strict";
|
4819 |
|
4820 | var fixRegExpWellKnownSymbolLogic = __webpack_require__(185);
|
4821 | var anObject = __webpack_require__(21);
|
4822 | var toLength = __webpack_require__(40);
|
4823 | var requireObjectCoercible = __webpack_require__(13);
|
4824 | var advanceStringIndex = __webpack_require__(190);
|
4825 | var regExpExec = __webpack_require__(191);
|
4826 |
|
4827 |
|
4828 | fixRegExpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) {
|
4829 | return [
|
4830 |
|
4831 |
|
4832 | function match(regexp) {
|
4833 | var O = requireObjectCoercible(this);
|
4834 | var matcher = regexp == undefined ? undefined : regexp[MATCH];
|
4835 | return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
|
4836 | },
|
4837 |
|
4838 |
|
4839 | function (regexp) {
|
4840 | var res = maybeCallNative(nativeMatch, regexp, this);
|
4841 | if (res.done) return res.value;
|
4842 |
|
4843 | var rx = anObject(regexp);
|
4844 | var S = String(this);
|
4845 |
|
4846 | if (!rx.global) return regExpExec(rx, S);
|
4847 |
|
4848 | var fullUnicode = rx.unicode;
|
4849 | rx.lastIndex = 0;
|
4850 | var A = [];
|
4851 | var n = 0;
|
4852 | var result;
|
4853 | while ((result = regExpExec(rx, S)) !== null) {
|
4854 | var matchStr = String(result[0]);
|
4855 | A[n] = matchStr;
|
4856 | if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
|
4857 | n++;
|
4858 | }
|
4859 | return n === 0 ? null : A;
|
4860 | }
|
4861 | ];
|
4862 | });
|
4863 |
|
4864 |
|
4865 | }),
|
4866 |
|
4867 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
4868 |
|
4869 | "use strict";
|
4870 |
|
4871 |
|
4872 | __webpack_require__(186);
|
4873 | var redefine = __webpack_require__(22);
|
4874 | var fails = __webpack_require__(7);
|
4875 | var wellKnownSymbol = __webpack_require__(58);
|
4876 | var regexpExec = __webpack_require__(187);
|
4877 | var createNonEnumerableProperty = __webpack_require__(19);
|
4878 |
|
4879 | var SPECIES = wellKnownSymbol('species');
|
4880 |
|
4881 | var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
|
4882 |
|
4883 |
|
4884 |
|
4885 | var re = /./;
|
4886 | re.exec = function () {
|
4887 | var result = [];
|
4888 | result.groups = { a: '7' };
|
4889 | return result;
|
4890 | };
|
4891 | return ''.replace(re, '$<a>') !== '7';
|
4892 | });
|
4893 |
|
4894 |
|
4895 |
|
4896 | var REPLACE_KEEPS_$0 = (function () {
|
4897 | return 'a'.replace(/./, '$0') === '$0';
|
4898 | })();
|
4899 |
|
4900 | var REPLACE = wellKnownSymbol('replace');
|
4901 |
|
4902 | var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
|
4903 | if (/./[REPLACE]) {
|
4904 | return /./[REPLACE]('a', '$0') === '';
|
4905 | }
|
4906 | return false;
|
4907 | })();
|
4908 |
|
4909 |
|
4910 |
|
4911 | var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
|
4912 |
|
4913 | var re = /(?:)/;
|
4914 | var originalExec = re.exec;
|
4915 | re.exec = function () { return originalExec.apply(this, arguments); };
|
4916 | var result = 'ab'.split(re);
|
4917 | return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
|
4918 | });
|
4919 |
|
4920 | module.exports = function (KEY, length, exec, sham) {
|
4921 | var SYMBOL = wellKnownSymbol(KEY);
|
4922 |
|
4923 | var DELEGATES_TO_SYMBOL = !fails(function () {
|
4924 |
|
4925 | var O = {};
|
4926 | O[SYMBOL] = function () { return 7; };
|
4927 | return ''[KEY](O) != 7;
|
4928 | });
|
4929 |
|
4930 | var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
|
4931 |
|
4932 | var execCalled = false;
|
4933 | var re = /a/;
|
4934 |
|
4935 | if (KEY === 'split') {
|
4936 |
|
4937 |
|
4938 |
|
4939 | re = {};
|
4940 |
|
4941 |
|
4942 | re.constructor = {};
|
4943 | re.constructor[SPECIES] = function () { return re; };
|
4944 | re.flags = '';
|
4945 | re[SYMBOL] = /./[SYMBOL];
|
4946 | }
|
4947 |
|
4948 | re.exec = function () { execCalled = true; return null; };
|
4949 |
|
4950 | re[SYMBOL]('');
|
4951 | return !execCalled;
|
4952 | });
|
4953 |
|
4954 | if (
|
4955 | !DELEGATES_TO_SYMBOL ||
|
4956 | !DELEGATES_TO_EXEC ||
|
4957 | (KEY === 'replace' && !(
|
4958 | REPLACE_SUPPORTS_NAMED_GROUPS &&
|
4959 | REPLACE_KEEPS_$0 &&
|
4960 | !REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
|
4961 | )) ||
|
4962 | (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
|
4963 | ) {
|
4964 | var nativeRegExpMethod = /./[SYMBOL];
|
4965 | var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
|
4966 | if (regexp.exec === regexpExec) {
|
4967 | if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
|
4968 |
|
4969 |
|
4970 |
|
4971 | return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
|
4972 | }
|
4973 | return { done: true, value: nativeMethod.call(str, regexp, arg2) };
|
4974 | }
|
4975 | return { done: false };
|
4976 | }, {
|
4977 | REPLACE_KEEPS_$0: REPLACE_KEEPS_$0,
|
4978 | REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
|
4979 | });
|
4980 | var stringMethod = methods[0];
|
4981 | var regexMethod = methods[1];
|
4982 |
|
4983 | redefine(String.prototype, KEY, stringMethod);
|
4984 | redefine(RegExp.prototype, SYMBOL, length == 2
|
4985 |
|
4986 |
|
4987 | ? function (string, arg) { return regexMethod.call(string, this, arg); }
|
4988 |
|
4989 |
|
4990 | : function (string) { return regexMethod.call(string, this); }
|
4991 | );
|
4992 | }
|
4993 |
|
4994 | if (sham) createNonEnumerableProperty(RegExp.prototype[SYMBOL], 'sham', true);
|
4995 | };
|
4996 |
|
4997 |
|
4998 | }),
|
4999 |
|
5000 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5001 |
|
5002 | "use strict";
|
5003 |
|
5004 | var $ = __webpack_require__(3);
|
5005 | var exec = __webpack_require__(187);
|
5006 |
|
5007 |
|
5008 |
|
5009 | $({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
|
5010 | exec: exec
|
5011 | });
|
5012 |
|
5013 |
|
5014 | }),
|
5015 |
|
5016 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
5017 |
|
5018 | "use strict";
|
5019 |
|
5020 | var regexpFlags = __webpack_require__(188);
|
5021 | var stickyHelpers = __webpack_require__(189);
|
5022 |
|
5023 | var nativeExec = RegExp.prototype.exec;
|
5024 |
|
5025 |
|
5026 |
|
5027 | var nativeReplace = String.prototype.replace;
|
5028 |
|
5029 | var patchedExec = nativeExec;
|
5030 |
|
5031 | var UPDATES_LAST_INDEX_WRONG = (function () {
|
5032 | var re1 = /a/;
|
5033 | var re2 = /b*/g;
|
5034 | nativeExec.call(re1, 'a');
|
5035 | nativeExec.call(re2, 'a');
|
5036 | return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
5037 | })();
|
5038 |
|
5039 | var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET;
|
5040 |
|
5041 |
|
5042 |
|
5043 | var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
5044 |
|
5045 | var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y;
|
5046 |
|
5047 | if (PATCH) {
|
5048 | patchedExec = function exec(str) {
|
5049 | var re = this;
|
5050 | var lastIndex, reCopy, match, i;
|
5051 | var sticky = UNSUPPORTED_Y && re.sticky;
|
5052 | var flags = regexpFlags.call(re);
|
5053 | var source = re.source;
|
5054 | var charsAdded = 0;
|
5055 | var strCopy = str;
|
5056 |
|
5057 | if (sticky) {
|
5058 | flags = flags.replace('y', '');
|
5059 | if (flags.indexOf('g') === -1) {
|
5060 | flags += 'g';
|
5061 | }
|
5062 |
|
5063 | strCopy = String(str).slice(re.lastIndex);
|
5064 |
|
5065 | if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== '\n')) {
|
5066 | source = '(?: ' + source + ')';
|
5067 | strCopy = ' ' + strCopy;
|
5068 | charsAdded++;
|
5069 | }
|
5070 |
|
5071 |
|
5072 | reCopy = new RegExp('^(?:' + source + ')', flags);
|
5073 | }
|
5074 |
|
5075 | if (NPCG_INCLUDED) {
|
5076 | reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
|
5077 | }
|
5078 | if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
5079 |
|
5080 | match = nativeExec.call(sticky ? reCopy : re, strCopy);
|
5081 |
|
5082 | if (sticky) {
|
5083 | if (match) {
|
5084 | match.input = match.input.slice(charsAdded);
|
5085 | match[0] = match[0].slice(charsAdded);
|
5086 | match.index = re.lastIndex;
|
5087 | re.lastIndex += match[0].length;
|
5088 | } else re.lastIndex = 0;
|
5089 | } else if (UPDATES_LAST_INDEX_WRONG && match) {
|
5090 | re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
|
5091 | }
|
5092 | if (NPCG_INCLUDED && match && match.length > 1) {
|
5093 |
|
5094 |
|
5095 | nativeReplace.call(match[0], reCopy, function () {
|
5096 | for (i = 1; i < arguments.length - 2; i++) {
|
5097 | if (arguments[i] === undefined) match[i] = undefined;
|
5098 | }
|
5099 | });
|
5100 | }
|
5101 |
|
5102 | return match;
|
5103 | };
|
5104 | }
|
5105 |
|
5106 | module.exports = patchedExec;
|
5107 |
|
5108 |
|
5109 | }),
|
5110 |
|
5111 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
5112 |
|
5113 | "use strict";
|
5114 |
|
5115 | var anObject = __webpack_require__(21);
|
5116 |
|
5117 |
|
5118 |
|
5119 | module.exports = function () {
|
5120 | var that = anObject(this);
|
5121 | var result = '';
|
5122 | if (that.global) result += 'g';
|
5123 | if (that.ignoreCase) result += 'i';
|
5124 | if (that.multiline) result += 'm';
|
5125 | if (that.dotAll) result += 's';
|
5126 | if (that.unicode) result += 'u';
|
5127 | if (that.sticky) result += 'y';
|
5128 | return result;
|
5129 | };
|
5130 |
|
5131 |
|
5132 | }),
|
5133 |
|
5134 | (function(__unused_webpack_module, exports, __webpack_require__) {
|
5135 |
|
5136 | "use strict";
|
5137 |
|
5138 |
|
5139 | var fails = __webpack_require__(7);
|
5140 |
|
5141 |
|
5142 |
|
5143 | function RE(s, f) {
|
5144 | return RegExp(s, f);
|
5145 | }
|
5146 |
|
5147 | exports.UNSUPPORTED_Y = fails(function () {
|
5148 |
|
5149 | var re = RE('a', 'y');
|
5150 | re.lastIndex = 2;
|
5151 | return re.exec('abcd') != null;
|
5152 | });
|
5153 |
|
5154 | exports.BROKEN_CARET = fails(function () {
|
5155 |
|
5156 | var re = RE('^r', 'gy');
|
5157 | re.lastIndex = 2;
|
5158 | return re.exec('str') != null;
|
5159 | });
|
5160 |
|
5161 |
|
5162 | }),
|
5163 |
|
5164 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
5165 |
|
5166 | "use strict";
|
5167 |
|
5168 | var charAt = __webpack_require__(178).charAt;
|
5169 |
|
5170 |
|
5171 |
|
5172 | module.exports = function (S, index, unicode) {
|
5173 | return index + (unicode ? charAt(S, index).length : 1);
|
5174 | };
|
5175 |
|
5176 |
|
5177 | }),
|
5178 |
|
5179 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
5180 |
|
5181 | var classof = __webpack_require__(12);
|
5182 | var regexpExec = __webpack_require__(187);
|
5183 |
|
5184 |
|
5185 |
|
5186 | module.exports = function (R, S) {
|
5187 | var exec = R.exec;
|
5188 | if (typeof exec === 'function') {
|
5189 | var result = exec.call(R, S);
|
5190 | if (typeof result !== 'object') {
|
5191 | throw TypeError('RegExp exec method returned something other than an Object or null');
|
5192 | }
|
5193 | return result;
|
5194 | }
|
5195 |
|
5196 | if (classof(R) !== 'RegExp') {
|
5197 | throw TypeError('RegExp#exec called on incompatible receiver');
|
5198 | }
|
5199 |
|
5200 | return regexpExec.call(R, S);
|
5201 | };
|
5202 |
|
5203 |
|
5204 |
|
5205 | }),
|
5206 |
|
5207 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5208 |
|
5209 | "use strict";
|
5210 |
|
5211 | var $ = __webpack_require__(3);
|
5212 | var createIteratorConstructor = __webpack_require__(136);
|
5213 | var requireObjectCoercible = __webpack_require__(13);
|
5214 | var toLength = __webpack_require__(40);
|
5215 | var aFunction = __webpack_require__(64);
|
5216 | var anObject = __webpack_require__(21);
|
5217 | var classof = __webpack_require__(12);
|
5218 | var isRegExp = __webpack_require__(181);
|
5219 | var getRegExpFlags = __webpack_require__(188);
|
5220 | var createNonEnumerableProperty = __webpack_require__(19);
|
5221 | var fails = __webpack_require__(7);
|
5222 | var wellKnownSymbol = __webpack_require__(58);
|
5223 | var speciesConstructor = __webpack_require__(193);
|
5224 | var advanceStringIndex = __webpack_require__(190);
|
5225 | var InternalStateModule = __webpack_require__(26);
|
5226 | var IS_PURE = __webpack_require__(30);
|
5227 |
|
5228 | var MATCH_ALL = wellKnownSymbol('matchAll');
|
5229 | var REGEXP_STRING = 'RegExp String';
|
5230 | var REGEXP_STRING_ITERATOR = REGEXP_STRING + ' Iterator';
|
5231 | var setInternalState = InternalStateModule.set;
|
5232 | var getInternalState = InternalStateModule.getterFor(REGEXP_STRING_ITERATOR);
|
5233 | var RegExpPrototype = RegExp.prototype;
|
5234 | var regExpBuiltinExec = RegExpPrototype.exec;
|
5235 | var nativeMatchAll = ''.matchAll;
|
5236 |
|
5237 | var WORKS_WITH_NON_GLOBAL_REGEX = !!nativeMatchAll && !fails(function () {
|
5238 | 'a'.matchAll(/./);
|
5239 | });
|
5240 |
|
5241 | var regExpExec = function (R, S) {
|
5242 | var exec = R.exec;
|
5243 | var result;
|
5244 | if (typeof exec == 'function') {
|
5245 | result = exec.call(R, S);
|
5246 | if (typeof result != 'object') throw TypeError('Incorrect exec result');
|
5247 | return result;
|
5248 | } return regExpBuiltinExec.call(R, S);
|
5249 | };
|
5250 |
|
5251 |
|
5252 | var $RegExpStringIterator = createIteratorConstructor(function RegExpStringIterator(regexp, string, global, fullUnicode) {
|
5253 | setInternalState(this, {
|
5254 | type: REGEXP_STRING_ITERATOR,
|
5255 | regexp: regexp,
|
5256 | string: string,
|
5257 | global: global,
|
5258 | unicode: fullUnicode,
|
5259 | done: false
|
5260 | });
|
5261 | }, REGEXP_STRING, function next() {
|
5262 | var state = getInternalState(this);
|
5263 | if (state.done) return { value: undefined, done: true };
|
5264 | var R = state.regexp;
|
5265 | var S = state.string;
|
5266 | var match = regExpExec(R, S);
|
5267 | if (match === null) return { value: undefined, done: state.done = true };
|
5268 | if (state.global) {
|
5269 | if (String(match[0]) == '') R.lastIndex = advanceStringIndex(S, toLength(R.lastIndex), state.unicode);
|
5270 | return { value: match, done: false };
|
5271 | }
|
5272 | state.done = true;
|
5273 | return { value: match, done: false };
|
5274 | });
|
5275 |
|
5276 | var $matchAll = function (string) {
|
5277 | var R = anObject(this);
|
5278 | var S = String(string);
|
5279 | var C, flagsValue, flags, matcher, global, fullUnicode;
|
5280 | C = speciesConstructor(R, RegExp);
|
5281 | flagsValue = R.flags;
|
5282 | if (flagsValue === undefined && R instanceof RegExp && !('flags' in RegExpPrototype)) {
|
5283 | flagsValue = getRegExpFlags.call(R);
|
5284 | }
|
5285 | flags = flagsValue === undefined ? '' : String(flagsValue);
|
5286 | matcher = new C(C === RegExp ? R.source : R, flags);
|
5287 | global = !!~flags.indexOf('g');
|
5288 | fullUnicode = !!~flags.indexOf('u');
|
5289 | matcher.lastIndex = toLength(R.lastIndex);
|
5290 | return new $RegExpStringIterator(matcher, S, global, fullUnicode);
|
5291 | };
|
5292 |
|
5293 |
|
5294 |
|
5295 | $({ target: 'String', proto: true, forced: WORKS_WITH_NON_GLOBAL_REGEX }, {
|
5296 | matchAll: function matchAll(regexp) {
|
5297 | var O = requireObjectCoercible(this);
|
5298 | var flags, S, matcher, rx;
|
5299 | if (regexp != null) {
|
5300 | if (isRegExp(regexp)) {
|
5301 | flags = String(requireObjectCoercible('flags' in RegExpPrototype
|
5302 | ? regexp.flags
|
5303 | : getRegExpFlags.call(regexp)
|
5304 | ));
|
5305 | if (!~flags.indexOf('g')) throw TypeError('`.matchAll` does not allow non-global regexes');
|
5306 | }
|
5307 | if (WORKS_WITH_NON_GLOBAL_REGEX) return nativeMatchAll.apply(O, arguments);
|
5308 | matcher = regexp[MATCH_ALL];
|
5309 | if (matcher === undefined && IS_PURE && classof(regexp) == 'RegExp') matcher = $matchAll;
|
5310 | if (matcher != null) return aFunction(matcher).call(regexp, O);
|
5311 | } else if (WORKS_WITH_NON_GLOBAL_REGEX) return nativeMatchAll.apply(O, arguments);
|
5312 | S = String(O);
|
5313 | rx = new RegExp(regexp, 'g');
|
5314 | return IS_PURE ? $matchAll.call(rx, S) : rx[MATCH_ALL](S);
|
5315 | }
|
5316 | });
|
5317 |
|
5318 | IS_PURE || MATCH_ALL in RegExpPrototype || createNonEnumerableProperty(RegExpPrototype, MATCH_ALL, $matchAll);
|
5319 |
|
5320 |
|
5321 | }),
|
5322 |
|
5323 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
5324 |
|
5325 | var anObject = __webpack_require__(21);
|
5326 | var aFunction = __webpack_require__(64);
|
5327 | var wellKnownSymbol = __webpack_require__(58);
|
5328 |
|
5329 | var SPECIES = wellKnownSymbol('species');
|
5330 |
|
5331 |
|
5332 |
|
5333 | module.exports = function (O, defaultConstructor) {
|
5334 | var C = anObject(O).constructor;
|
5335 | var S;
|
5336 | return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S);
|
5337 | };
|
5338 |
|
5339 |
|
5340 | }),
|
5341 |
|
5342 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5343 |
|
5344 | "use strict";
|
5345 |
|
5346 | var $ = __webpack_require__(3);
|
5347 | var $padEnd = __webpack_require__(195).end;
|
5348 | var WEBKIT_BUG = __webpack_require__(197);
|
5349 |
|
5350 |
|
5351 |
|
5352 | $({ target: 'String', proto: true, forced: WEBKIT_BUG }, {
|
5353 | padEnd: function padEnd(maxLength /* , fillString = ' ' */) {
|
5354 | return $padEnd(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);
|
5355 | }
|
5356 | });
|
5357 |
|
5358 |
|
5359 | }),
|
5360 |
|
5361 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
5362 |
|
5363 |
|
5364 | var toLength = __webpack_require__(40);
|
5365 | var repeat = __webpack_require__(196);
|
5366 | var requireObjectCoercible = __webpack_require__(13);
|
5367 |
|
5368 | var ceil = Math.ceil;
|
5369 |
|
5370 |
|
5371 | var createMethod = function (IS_END) {
|
5372 | return function ($this, maxLength, fillString) {
|
5373 | var S = String(requireObjectCoercible($this));
|
5374 | var stringLength = S.length;
|
5375 | var fillStr = fillString === undefined ? ' ' : String(fillString);
|
5376 | var intMaxLength = toLength(maxLength);
|
5377 | var fillLen, stringFiller;
|
5378 | if (intMaxLength <= stringLength || fillStr == '') return S;
|
5379 | fillLen = intMaxLength - stringLength;
|
5380 | stringFiller = repeat.call(fillStr, ceil(fillLen / fillStr.length));
|
5381 | if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);
|
5382 | return IS_END ? S + stringFiller : stringFiller + S;
|
5383 | };
|
5384 | };
|
5385 |
|
5386 | module.exports = {
|
5387 |
|
5388 |
|
5389 | start: createMethod(false),
|
5390 |
|
5391 |
|
5392 | end: createMethod(true)
|
5393 | };
|
5394 |
|
5395 |
|
5396 | }),
|
5397 |
|
5398 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
5399 |
|
5400 | "use strict";
|
5401 |
|
5402 | var toInteger = __webpack_require__(41);
|
5403 | var requireObjectCoercible = __webpack_require__(13);
|
5404 |
|
5405 |
|
5406 |
|
5407 | module.exports = ''.repeat || function repeat(count) {
|
5408 | var str = String(requireObjectCoercible(this));
|
5409 | var result = '';
|
5410 | var n = toInteger(count);
|
5411 | if (n < 0 || n == Infinity) throw RangeError('Wrong number of repetitions');
|
5412 | for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;
|
5413 | return result;
|
5414 | };
|
5415 |
|
5416 |
|
5417 | }),
|
5418 |
|
5419 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
5420 |
|
5421 |
|
5422 | var userAgent = __webpack_require__(49);
|
5423 |
|
5424 |
|
5425 | module.exports = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);
|
5426 |
|
5427 |
|
5428 | }),
|
5429 |
|
5430 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5431 |
|
5432 | "use strict";
|
5433 |
|
5434 | var $ = __webpack_require__(3);
|
5435 | var $padStart = __webpack_require__(195).start;
|
5436 | var WEBKIT_BUG = __webpack_require__(197);
|
5437 |
|
5438 |
|
5439 |
|
5440 | $({ target: 'String', proto: true, forced: WEBKIT_BUG }, {
|
5441 | padStart: function padStart(maxLength /* , fillString = ' ' */) {
|
5442 | return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);
|
5443 | }
|
5444 | });
|
5445 |
|
5446 |
|
5447 | }),
|
5448 |
|
5449 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5450 |
|
5451 | var $ = __webpack_require__(3);
|
5452 | var repeat = __webpack_require__(196);
|
5453 |
|
5454 |
|
5455 |
|
5456 | $({ target: 'String', proto: true }, {
|
5457 | repeat: repeat
|
5458 | });
|
5459 |
|
5460 |
|
5461 | }),
|
5462 |
|
5463 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5464 |
|
5465 | "use strict";
|
5466 |
|
5467 | var fixRegExpWellKnownSymbolLogic = __webpack_require__(185);
|
5468 | var anObject = __webpack_require__(21);
|
5469 | var toLength = __webpack_require__(40);
|
5470 | var toInteger = __webpack_require__(41);
|
5471 | var requireObjectCoercible = __webpack_require__(13);
|
5472 | var advanceStringIndex = __webpack_require__(190);
|
5473 | var getSubstitution = __webpack_require__(201);
|
5474 | var regExpExec = __webpack_require__(191);
|
5475 |
|
5476 | var max = Math.max;
|
5477 | var min = Math.min;
|
5478 |
|
5479 | var maybeToString = function (it) {
|
5480 | return it === undefined ? it : String(it);
|
5481 | };
|
5482 |
|
5483 |
|
5484 | fixRegExpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative, reason) {
|
5485 | var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE;
|
5486 | var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0;
|
5487 | var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
|
5488 |
|
5489 | return [
|
5490 |
|
5491 |
|
5492 | function replace(searchValue, replaceValue) {
|
5493 | var O = requireObjectCoercible(this);
|
5494 | var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];
|
5495 | return replacer !== undefined
|
5496 | ? replacer.call(searchValue, O, replaceValue)
|
5497 | : nativeReplace.call(String(O), searchValue, replaceValue);
|
5498 | },
|
5499 |
|
5500 |
|
5501 | function (regexp, replaceValue) {
|
5502 | if (
|
5503 | (!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0) ||
|
5504 | (typeof replaceValue === 'string' && replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1)
|
5505 | ) {
|
5506 | var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
|
5507 | if (res.done) return res.value;
|
5508 | }
|
5509 |
|
5510 | var rx = anObject(regexp);
|
5511 | var S = String(this);
|
5512 |
|
5513 | var functionalReplace = typeof replaceValue === 'function';
|
5514 | if (!functionalReplace) replaceValue = String(replaceValue);
|
5515 |
|
5516 | var global = rx.global;
|
5517 | if (global) {
|
5518 | var fullUnicode = rx.unicode;
|
5519 | rx.lastIndex = 0;
|
5520 | }
|
5521 | var results = [];
|
5522 | while (true) {
|
5523 | var result = regExpExec(rx, S);
|
5524 | if (result === null) break;
|
5525 |
|
5526 | results.push(result);
|
5527 | if (!global) break;
|
5528 |
|
5529 | var matchStr = String(result[0]);
|
5530 | if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
|
5531 | }
|
5532 |
|
5533 | var accumulatedResult = '';
|
5534 | var nextSourcePosition = 0;
|
5535 | for (var i = 0; i < results.length; i++) {
|
5536 | result = results[i];
|
5537 |
|
5538 | var matched = String(result[0]);
|
5539 | var position = max(min(toInteger(result.index), S.length), 0);
|
5540 | var captures = [];
|
5541 |
|
5542 |
|
5543 |
|
5544 |
|
5545 |
|
5546 | for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
|
5547 | var namedCaptures = result.groups;
|
5548 | if (functionalReplace) {
|
5549 | var replacerArgs = [matched].concat(captures, position, S);
|
5550 | if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
|
5551 | var replacement = String(replaceValue.apply(undefined, replacerArgs));
|
5552 | } else {
|
5553 | replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
|
5554 | }
|
5555 | if (position >= nextSourcePosition) {
|
5556 | accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
|
5557 | nextSourcePosition = position + matched.length;
|
5558 | }
|
5559 | }
|
5560 | return accumulatedResult + S.slice(nextSourcePosition);
|
5561 | }
|
5562 | ];
|
5563 | });
|
5564 |
|
5565 |
|
5566 | }),
|
5567 |
|
5568 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
5569 |
|
5570 | var toObject = __webpack_require__(52);
|
5571 |
|
5572 | var floor = Math.floor;
|
5573 | var replace = ''.replace;
|
5574 | var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
|
5575 | var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
|
5576 |
|
5577 |
|
5578 | module.exports = function (matched, str, position, captures, namedCaptures, replacement) {
|
5579 | var tailPos = position + matched.length;
|
5580 | var m = captures.length;
|
5581 | var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
|
5582 | if (namedCaptures !== undefined) {
|
5583 | namedCaptures = toObject(namedCaptures);
|
5584 | symbols = SUBSTITUTION_SYMBOLS;
|
5585 | }
|
5586 | return replace.call(replacement, symbols, function (match, ch) {
|
5587 | var capture;
|
5588 | switch (ch.charAt(0)) {
|
5589 | case '$': return '$';
|
5590 | case '&': return matched;
|
5591 | case '`': return str.slice(0, position);
|
5592 | case "'": return str.slice(tailPos);
|
5593 | case '<':
|
5594 | capture = namedCaptures[ch.slice(1, -1)];
|
5595 | break;
|
5596 | default:
|
5597 | var n = +ch;
|
5598 | if (n === 0) return match;
|
5599 | if (n > m) {
|
5600 | var f = floor(n / 10);
|
5601 | if (f === 0) return match;
|
5602 | if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
|
5603 | return match;
|
5604 | }
|
5605 | capture = captures[n - 1];
|
5606 | }
|
5607 | return capture === undefined ? '' : capture;
|
5608 | });
|
5609 | };
|
5610 |
|
5611 |
|
5612 | }),
|
5613 |
|
5614 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5615 |
|
5616 | "use strict";
|
5617 |
|
5618 | var fixRegExpWellKnownSymbolLogic = __webpack_require__(185);
|
5619 | var anObject = __webpack_require__(21);
|
5620 | var requireObjectCoercible = __webpack_require__(13);
|
5621 | var sameValue = __webpack_require__(159);
|
5622 | var regExpExec = __webpack_require__(191);
|
5623 |
|
5624 |
|
5625 | fixRegExpWellKnownSymbolLogic('search', 1, function (SEARCH, nativeSearch, maybeCallNative) {
|
5626 | return [
|
5627 |
|
5628 |
|
5629 | function search(regexp) {
|
5630 | var O = requireObjectCoercible(this);
|
5631 | var searcher = regexp == undefined ? undefined : regexp[SEARCH];
|
5632 | return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
|
5633 | },
|
5634 |
|
5635 |
|
5636 | function (regexp) {
|
5637 | var res = maybeCallNative(nativeSearch, regexp, this);
|
5638 | if (res.done) return res.value;
|
5639 |
|
5640 | var rx = anObject(regexp);
|
5641 | var S = String(this);
|
5642 |
|
5643 | var previousLastIndex = rx.lastIndex;
|
5644 | if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
|
5645 | var result = regExpExec(rx, S);
|
5646 | if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
|
5647 | return result === null ? -1 : result.index;
|
5648 | }
|
5649 | ];
|
5650 | });
|
5651 |
|
5652 |
|
5653 | }),
|
5654 |
|
5655 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5656 |
|
5657 | "use strict";
|
5658 |
|
5659 | var fixRegExpWellKnownSymbolLogic = __webpack_require__(185);
|
5660 | var isRegExp = __webpack_require__(181);
|
5661 | var anObject = __webpack_require__(21);
|
5662 | var requireObjectCoercible = __webpack_require__(13);
|
5663 | var speciesConstructor = __webpack_require__(193);
|
5664 | var advanceStringIndex = __webpack_require__(190);
|
5665 | var toLength = __webpack_require__(40);
|
5666 | var callRegExpExec = __webpack_require__(191);
|
5667 | var regexpExec = __webpack_require__(187);
|
5668 | var fails = __webpack_require__(7);
|
5669 |
|
5670 | var arrayPush = [].push;
|
5671 | var min = Math.min;
|
5672 | var MAX_UINT32 = 0xFFFFFFFF;
|
5673 |
|
5674 |
|
5675 | var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); });
|
5676 |
|
5677 |
|
5678 | fixRegExpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) {
|
5679 | var internalSplit;
|
5680 | if (
|
5681 | 'abbc'.split(/(b)*/)[1] == 'c' ||
|
5682 |
|
5683 | 'test'.split(/(?:)/, -1).length != 4 ||
|
5684 | 'ab'.split(/(?:ab)*/).length != 2 ||
|
5685 | '.'.split(/(.?)(.?)/).length != 4 ||
|
5686 |
|
5687 | '.'.split(/()()/).length > 1 ||
|
5688 | ''.split(/.?/).length
|
5689 | ) {
|
5690 |
|
5691 | internalSplit = function (separator, limit) {
|
5692 | var string = String(requireObjectCoercible(this));
|
5693 | var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
|
5694 | if (lim === 0) return [];
|
5695 | if (separator === undefined) return [string];
|
5696 |
|
5697 | if (!isRegExp(separator)) {
|
5698 | return nativeSplit.call(string, separator, lim);
|
5699 | }
|
5700 | var output = [];
|
5701 | var flags = (separator.ignoreCase ? 'i' : '') +
|
5702 | (separator.multiline ? 'm' : '') +
|
5703 | (separator.unicode ? 'u' : '') +
|
5704 | (separator.sticky ? 'y' : '');
|
5705 | var lastLastIndex = 0;
|
5706 |
|
5707 | var separatorCopy = new RegExp(separator.source, flags + 'g');
|
5708 | var match, lastIndex, lastLength;
|
5709 | while (match = regexpExec.call(separatorCopy, string)) {
|
5710 | lastIndex = separatorCopy.lastIndex;
|
5711 | if (lastIndex > lastLastIndex) {
|
5712 | output.push(string.slice(lastLastIndex, match.index));
|
5713 | if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));
|
5714 | lastLength = match[0].length;
|
5715 | lastLastIndex = lastIndex;
|
5716 | if (output.length >= lim) break;
|
5717 | }
|
5718 | if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++;
|
5719 | }
|
5720 | if (lastLastIndex === string.length) {
|
5721 | if (lastLength || !separatorCopy.test('')) output.push('');
|
5722 | } else output.push(string.slice(lastLastIndex));
|
5723 | return output.length > lim ? output.slice(0, lim) : output;
|
5724 | };
|
5725 |
|
5726 | } else if ('0'.split(undefined, 0).length) {
|
5727 | internalSplit = function (separator, limit) {
|
5728 | return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);
|
5729 | };
|
5730 | } else internalSplit = nativeSplit;
|
5731 |
|
5732 | return [
|
5733 |
|
5734 |
|
5735 | function split(separator, limit) {
|
5736 | var O = requireObjectCoercible(this);
|
5737 | var splitter = separator == undefined ? undefined : separator[SPLIT];
|
5738 | return splitter !== undefined
|
5739 | ? splitter.call(separator, O, limit)
|
5740 | : internalSplit.call(String(O), separator, limit);
|
5741 | },
|
5742 |
|
5743 |
|
5744 |
|
5745 |
|
5746 |
|
5747 | function (regexp, limit) {
|
5748 | var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit);
|
5749 | if (res.done) return res.value;
|
5750 |
|
5751 | var rx = anObject(regexp);
|
5752 | var S = String(this);
|
5753 | var C = speciesConstructor(rx, RegExp);
|
5754 |
|
5755 | var unicodeMatching = rx.unicode;
|
5756 | var flags = (rx.ignoreCase ? 'i' : '') +
|
5757 | (rx.multiline ? 'm' : '') +
|
5758 | (rx.unicode ? 'u' : '') +
|
5759 | (SUPPORTS_Y ? 'y' : 'g');
|
5760 |
|
5761 |
|
5762 |
|
5763 | var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
|
5764 | var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
|
5765 | if (lim === 0) return [];
|
5766 | if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
|
5767 | var p = 0;
|
5768 | var q = 0;
|
5769 | var A = [];
|
5770 | while (q < S.length) {
|
5771 | splitter.lastIndex = SUPPORTS_Y ? q : 0;
|
5772 | var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q));
|
5773 | var e;
|
5774 | if (
|
5775 | z === null ||
|
5776 | (e = min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
|
5777 | ) {
|
5778 | q = advanceStringIndex(S, q, unicodeMatching);
|
5779 | } else {
|
5780 | A.push(S.slice(p, q));
|
5781 | if (A.length === lim) return A;
|
5782 | for (var i = 1; i <= z.length - 1; i++) {
|
5783 | A.push(z[i]);
|
5784 | if (A.length === lim) return A;
|
5785 | }
|
5786 | q = p = e;
|
5787 | }
|
5788 | }
|
5789 | A.push(S.slice(p));
|
5790 | return A;
|
5791 | }
|
5792 | ];
|
5793 | }, !SUPPORTS_Y);
|
5794 |
|
5795 |
|
5796 | }),
|
5797 |
|
5798 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5799 |
|
5800 | "use strict";
|
5801 |
|
5802 | var $ = __webpack_require__(3);
|
5803 | var getOwnPropertyDescriptor = __webpack_require__(5).f;
|
5804 | var toLength = __webpack_require__(40);
|
5805 | var notARegExp = __webpack_require__(180);
|
5806 | var requireObjectCoercible = __webpack_require__(13);
|
5807 | var correctIsRegExpLogic = __webpack_require__(182);
|
5808 | var IS_PURE = __webpack_require__(30);
|
5809 |
|
5810 | var nativeStartsWith = ''.startsWith;
|
5811 | var min = Math.min;
|
5812 |
|
5813 | var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith');
|
5814 |
|
5815 | var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () {
|
5816 | var descriptor = getOwnPropertyDescriptor(String.prototype, 'startsWith');
|
5817 | return descriptor && !descriptor.writable;
|
5818 | }();
|
5819 |
|
5820 |
|
5821 |
|
5822 | $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
|
5823 | startsWith: function startsWith(searchString /* , position = 0 */) {
|
5824 | var that = String(requireObjectCoercible(this));
|
5825 | notARegExp(searchString);
|
5826 | var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length));
|
5827 | var search = String(searchString);
|
5828 | return nativeStartsWith
|
5829 | ? nativeStartsWith.call(that, search, index)
|
5830 | : that.slice(index, index + search.length) === search;
|
5831 | }
|
5832 | });
|
5833 |
|
5834 |
|
5835 | }),
|
5836 |
|
5837 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5838 |
|
5839 | "use strict";
|
5840 |
|
5841 | var $ = __webpack_require__(3);
|
5842 | var $trim = __webpack_require__(206).trim;
|
5843 | var forcedStringTrimMethod = __webpack_require__(208);
|
5844 |
|
5845 |
|
5846 |
|
5847 | $({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
|
5848 | trim: function trim() {
|
5849 | return $trim(this);
|
5850 | }
|
5851 | });
|
5852 |
|
5853 |
|
5854 | }),
|
5855 |
|
5856 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
5857 |
|
5858 | var requireObjectCoercible = __webpack_require__(13);
|
5859 | var whitespaces = __webpack_require__(207);
|
5860 |
|
5861 | var whitespace = '[' + whitespaces + ']';
|
5862 | var ltrim = RegExp('^' + whitespace + whitespace + '*');
|
5863 | var rtrim = RegExp(whitespace + whitespace + '*$');
|
5864 |
|
5865 |
|
5866 | var createMethod = function (TYPE) {
|
5867 | return function ($this) {
|
5868 | var string = String(requireObjectCoercible($this));
|
5869 | if (TYPE & 1) string = string.replace(ltrim, '');
|
5870 | if (TYPE & 2) string = string.replace(rtrim, '');
|
5871 | return string;
|
5872 | };
|
5873 | };
|
5874 |
|
5875 | module.exports = {
|
5876 |
|
5877 |
|
5878 | start: createMethod(1),
|
5879 |
|
5880 |
|
5881 | end: createMethod(2),
|
5882 |
|
5883 |
|
5884 | trim: createMethod(3)
|
5885 | };
|
5886 |
|
5887 |
|
5888 | }),
|
5889 |
|
5890 | (function(module) {
|
5891 |
|
5892 |
|
5893 | module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
|
5894 | '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
5895 |
|
5896 |
|
5897 | }),
|
5898 |
|
5899 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
5900 |
|
5901 | var fails = __webpack_require__(7);
|
5902 | var whitespaces = __webpack_require__(207);
|
5903 |
|
5904 | var non = '\u200B\u0085\u180E';
|
5905 |
|
5906 |
|
5907 |
|
5908 | module.exports = function (METHOD_NAME) {
|
5909 | return fails(function () {
|
5910 | return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() != non || whitespaces[METHOD_NAME].name !== METHOD_NAME;
|
5911 | });
|
5912 | };
|
5913 |
|
5914 |
|
5915 | }),
|
5916 |
|
5917 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5918 |
|
5919 | "use strict";
|
5920 |
|
5921 | var $ = __webpack_require__(3);
|
5922 | var $trimStart = __webpack_require__(206).start;
|
5923 | var forcedStringTrimMethod = __webpack_require__(208);
|
5924 |
|
5925 | var FORCED = forcedStringTrimMethod('trimStart');
|
5926 |
|
5927 | var trimStart = FORCED ? function trimStart() {
|
5928 | return $trimStart(this);
|
5929 | } : ''.trimStart;
|
5930 |
|
5931 |
|
5932 |
|
5933 |
|
5934 | $({ target: 'String', proto: true, forced: FORCED }, {
|
5935 | trimStart: trimStart,
|
5936 | trimLeft: trimStart
|
5937 | });
|
5938 |
|
5939 |
|
5940 | }),
|
5941 |
|
5942 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5943 |
|
5944 | "use strict";
|
5945 |
|
5946 | var $ = __webpack_require__(3);
|
5947 | var $trimEnd = __webpack_require__(206).end;
|
5948 | var forcedStringTrimMethod = __webpack_require__(208);
|
5949 |
|
5950 | var FORCED = forcedStringTrimMethod('trimEnd');
|
5951 |
|
5952 | var trimEnd = FORCED ? function trimEnd() {
|
5953 | return $trimEnd(this);
|
5954 | } : ''.trimEnd;
|
5955 |
|
5956 |
|
5957 |
|
5958 |
|
5959 | $({ target: 'String', proto: true, forced: FORCED }, {
|
5960 | trimEnd: trimEnd,
|
5961 | trimRight: trimEnd
|
5962 | });
|
5963 |
|
5964 |
|
5965 | }),
|
5966 |
|
5967 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5968 |
|
5969 | "use strict";
|
5970 |
|
5971 | var charAt = __webpack_require__(178).charAt;
|
5972 | var InternalStateModule = __webpack_require__(26);
|
5973 | var defineIterator = __webpack_require__(135);
|
5974 |
|
5975 | var STRING_ITERATOR = 'String Iterator';
|
5976 | var setInternalState = InternalStateModule.set;
|
5977 | var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
|
5978 |
|
5979 |
|
5980 |
|
5981 | defineIterator(String, 'String', function (iterated) {
|
5982 | setInternalState(this, {
|
5983 | type: STRING_ITERATOR,
|
5984 | string: String(iterated),
|
5985 | index: 0
|
5986 | });
|
5987 |
|
5988 |
|
5989 | }, function next() {
|
5990 | var state = getInternalState(this);
|
5991 | var string = state.string;
|
5992 | var index = state.index;
|
5993 | var point;
|
5994 | if (index >= string.length) return { value: undefined, done: true };
|
5995 | point = charAt(string, index);
|
5996 | state.index += point.length;
|
5997 | return { value: point, done: false };
|
5998 | });
|
5999 |
|
6000 |
|
6001 | }),
|
6002 |
|
6003 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6004 |
|
6005 | "use strict";
|
6006 |
|
6007 | var $ = __webpack_require__(3);
|
6008 | var createHTML = __webpack_require__(213);
|
6009 | var forcedStringHTMLMethod = __webpack_require__(214);
|
6010 |
|
6011 |
|
6012 |
|
6013 | $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('anchor') }, {
|
6014 | anchor: function anchor(name) {
|
6015 | return createHTML(this, 'a', 'name', name);
|
6016 | }
|
6017 | });
|
6018 |
|
6019 |
|
6020 | }),
|
6021 |
|
6022 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
6023 |
|
6024 | var requireObjectCoercible = __webpack_require__(13);
|
6025 |
|
6026 | var quot = /"/g;
|
6027 |
|
6028 |
|
6029 |
|
6030 | module.exports = function (string, tag, attribute, value) {
|
6031 | var S = String(requireObjectCoercible(string));
|
6032 | var p1 = '<' + tag;
|
6033 | if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"';
|
6034 | return p1 + '>' + S + '</' + tag + '>';
|
6035 | };
|
6036 |
|
6037 |
|
6038 | }),
|
6039 |
|
6040 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
6041 |
|
6042 | var fails = __webpack_require__(7);
|
6043 |
|
6044 |
|
6045 |
|
6046 | module.exports = function (METHOD_NAME) {
|
6047 | return fails(function () {
|
6048 | var test = ''[METHOD_NAME]('"');
|
6049 | return test !== test.toLowerCase() || test.split('"').length > 3;
|
6050 | });
|
6051 | };
|
6052 |
|
6053 |
|
6054 | }),
|
6055 |
|
6056 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6057 |
|
6058 | "use strict";
|
6059 |
|
6060 | var $ = __webpack_require__(3);
|
6061 | var createHTML = __webpack_require__(213);
|
6062 | var forcedStringHTMLMethod = __webpack_require__(214);
|
6063 |
|
6064 |
|
6065 |
|
6066 | $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('big') }, {
|
6067 | big: function big() {
|
6068 | return createHTML(this, 'big', '', '');
|
6069 | }
|
6070 | });
|
6071 |
|
6072 |
|
6073 | }),
|
6074 |
|
6075 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6076 |
|
6077 | "use strict";
|
6078 |
|
6079 | var $ = __webpack_require__(3);
|
6080 | var createHTML = __webpack_require__(213);
|
6081 | var forcedStringHTMLMethod = __webpack_require__(214);
|
6082 |
|
6083 |
|
6084 |
|
6085 | $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('blink') }, {
|
6086 | blink: function blink() {
|
6087 | return createHTML(this, 'blink', '', '');
|
6088 | }
|
6089 | });
|
6090 |
|
6091 |
|
6092 | }),
|
6093 |
|
6094 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6095 |
|
6096 | "use strict";
|
6097 |
|
6098 | var $ = __webpack_require__(3);
|
6099 | var createHTML = __webpack_require__(213);
|
6100 | var forcedStringHTMLMethod = __webpack_require__(214);
|
6101 |
|
6102 |
|
6103 |
|
6104 | $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('bold') }, {
|
6105 | bold: function bold() {
|
6106 | return createHTML(this, 'b', '', '');
|
6107 | }
|
6108 | });
|
6109 |
|
6110 |
|
6111 | }),
|
6112 |
|
6113 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6114 |
|
6115 | "use strict";
|
6116 |
|
6117 | var $ = __webpack_require__(3);
|
6118 | var createHTML = __webpack_require__(213);
|
6119 | var forcedStringHTMLMethod = __webpack_require__(214);
|
6120 |
|
6121 |
|
6122 |
|
6123 | $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('fixed') }, {
|
6124 | fixed: function fixed() {
|
6125 | return createHTML(this, 'tt', '', '');
|
6126 | }
|
6127 | });
|
6128 |
|
6129 |
|
6130 | }),
|
6131 |
|
6132 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6133 |
|
6134 | "use strict";
|
6135 |
|
6136 | var $ = __webpack_require__(3);
|
6137 | var createHTML = __webpack_require__(213);
|
6138 | var forcedStringHTMLMethod = __webpack_require__(214);
|
6139 |
|
6140 |
|
6141 |
|
6142 | $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('fontcolor') }, {
|
6143 | fontcolor: function fontcolor(color) {
|
6144 | return createHTML(this, 'font', 'color', color);
|
6145 | }
|
6146 | });
|
6147 |
|
6148 |
|
6149 | }),
|
6150 |
|
6151 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6152 |
|
6153 | "use strict";
|
6154 |
|
6155 | var $ = __webpack_require__(3);
|
6156 | var createHTML = __webpack_require__(213);
|
6157 | var forcedStringHTMLMethod = __webpack_require__(214);
|
6158 |
|
6159 |
|
6160 |
|
6161 | $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('fontsize') }, {
|
6162 | fontsize: function fontsize(size) {
|
6163 | return createHTML(this, 'font', 'size', size);
|
6164 | }
|
6165 | });
|
6166 |
|
6167 |
|
6168 | }),
|
6169 |
|
6170 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6171 |
|
6172 | "use strict";
|
6173 |
|
6174 | var $ = __webpack_require__(3);
|
6175 | var createHTML = __webpack_require__(213);
|
6176 | var forcedStringHTMLMethod = __webpack_require__(214);
|
6177 |
|
6178 |
|
6179 |
|
6180 | $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('italics') }, {
|
6181 | italics: function italics() {
|
6182 | return createHTML(this, 'i', '', '');
|
6183 | }
|
6184 | });
|
6185 |
|
6186 |
|
6187 | }),
|
6188 |
|
6189 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6190 |
|
6191 | "use strict";
|
6192 |
|
6193 | var $ = __webpack_require__(3);
|
6194 | var createHTML = __webpack_require__(213);
|
6195 | var forcedStringHTMLMethod = __webpack_require__(214);
|
6196 |
|
6197 |
|
6198 |
|
6199 | $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('link') }, {
|
6200 | link: function link(url) {
|
6201 | return createHTML(this, 'a', 'href', url);
|
6202 | }
|
6203 | });
|
6204 |
|
6205 |
|
6206 | }),
|
6207 |
|
6208 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6209 |
|
6210 | "use strict";
|
6211 |
|
6212 | var $ = __webpack_require__(3);
|
6213 | var createHTML = __webpack_require__(213);
|
6214 | var forcedStringHTMLMethod = __webpack_require__(214);
|
6215 |
|
6216 |
|
6217 |
|
6218 | $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('small') }, {
|
6219 | small: function small() {
|
6220 | return createHTML(this, 'small', '', '');
|
6221 | }
|
6222 | });
|
6223 |
|
6224 |
|
6225 | }),
|
6226 |
|
6227 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6228 |
|
6229 | "use strict";
|
6230 |
|
6231 | var $ = __webpack_require__(3);
|
6232 | var createHTML = __webpack_require__(213);
|
6233 | var forcedStringHTMLMethod = __webpack_require__(214);
|
6234 |
|
6235 |
|
6236 |
|
6237 | $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('strike') }, {
|
6238 | strike: function strike() {
|
6239 | return createHTML(this, 'strike', '', '');
|
6240 | }
|
6241 | });
|
6242 |
|
6243 |
|
6244 | }),
|
6245 |
|
6246 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6247 |
|
6248 | "use strict";
|
6249 |
|
6250 | var $ = __webpack_require__(3);
|
6251 | var createHTML = __webpack_require__(213);
|
6252 | var forcedStringHTMLMethod = __webpack_require__(214);
|
6253 |
|
6254 |
|
6255 |
|
6256 | $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('sub') }, {
|
6257 | sub: function sub() {
|
6258 | return createHTML(this, 'sub', '', '');
|
6259 | }
|
6260 | });
|
6261 |
|
6262 |
|
6263 | }),
|
6264 |
|
6265 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6266 |
|
6267 | "use strict";
|
6268 |
|
6269 | var $ = __webpack_require__(3);
|
6270 | var createHTML = __webpack_require__(213);
|
6271 | var forcedStringHTMLMethod = __webpack_require__(214);
|
6272 |
|
6273 |
|
6274 |
|
6275 | $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('sup') }, {
|
6276 | sup: function sup() {
|
6277 | return createHTML(this, 'sup', '', '');
|
6278 | }
|
6279 | });
|
6280 |
|
6281 |
|
6282 | }),
|
6283 |
|
6284 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6285 |
|
6286 | "use strict";
|
6287 |
|
6288 | var $ = __webpack_require__(3);
|
6289 | var requireObjectCoercible = __webpack_require__(13);
|
6290 | var isRegExp = __webpack_require__(181);
|
6291 | var getRegExpFlags = __webpack_require__(188);
|
6292 | var getSubstitution = __webpack_require__(201);
|
6293 | var wellKnownSymbol = __webpack_require__(58);
|
6294 | var IS_PURE = __webpack_require__(30);
|
6295 |
|
6296 | var REPLACE = wellKnownSymbol('replace');
|
6297 | var RegExpPrototype = RegExp.prototype;
|
6298 | var max = Math.max;
|
6299 |
|
6300 | var stringIndexOf = function (string, searchValue, fromIndex) {
|
6301 | if (fromIndex > string.length) return -1;
|
6302 | if (searchValue === '') return fromIndex;
|
6303 | return string.indexOf(searchValue, fromIndex);
|
6304 | };
|
6305 |
|
6306 |
|
6307 |
|
6308 | $({ target: 'String', proto: true }, {
|
6309 | replaceAll: function replaceAll(searchValue, replaceValue) {
|
6310 | var O = requireObjectCoercible(this);
|
6311 | var IS_REG_EXP, flags, replacer, string, searchString, functionalReplace, searchLength, advanceBy, replacement;
|
6312 | var position = 0;
|
6313 | var endOfLastMatch = 0;
|
6314 | var result = '';
|
6315 | if (searchValue != null) {
|
6316 | IS_REG_EXP = isRegExp(searchValue);
|
6317 | if (IS_REG_EXP) {
|
6318 | flags = String(requireObjectCoercible('flags' in RegExpPrototype
|
6319 | ? searchValue.flags
|
6320 | : getRegExpFlags.call(searchValue)
|
6321 | ));
|
6322 | if (!~flags.indexOf('g')) throw TypeError('`.replaceAll` does not allow non-global regexes');
|
6323 | }
|
6324 | replacer = searchValue[REPLACE];
|
6325 | if (replacer !== undefined) {
|
6326 | return replacer.call(searchValue, O, replaceValue);
|
6327 | } else if (IS_PURE && IS_REG_EXP) {
|
6328 | return String(O).replace(searchValue, replaceValue);
|
6329 | }
|
6330 | }
|
6331 | string = String(O);
|
6332 | searchString = String(searchValue);
|
6333 | functionalReplace = typeof replaceValue === 'function';
|
6334 | if (!functionalReplace) replaceValue = String(replaceValue);
|
6335 | searchLength = searchString.length;
|
6336 | advanceBy = max(1, searchLength);
|
6337 | position = stringIndexOf(string, searchString, 0);
|
6338 | while (position !== -1) {
|
6339 | if (functionalReplace) {
|
6340 | replacement = String(replaceValue(searchString, position, string));
|
6341 | } else {
|
6342 | replacement = getSubstitution(searchString, string, position, [], undefined, replaceValue);
|
6343 | }
|
6344 | result += string.slice(endOfLastMatch, position) + replacement;
|
6345 | endOfLastMatch = position + searchLength;
|
6346 | position = stringIndexOf(string, searchString, position + advanceBy);
|
6347 | }
|
6348 | if (endOfLastMatch < string.length) {
|
6349 | result += string.slice(endOfLastMatch);
|
6350 | }
|
6351 | return result;
|
6352 | }
|
6353 | });
|
6354 |
|
6355 |
|
6356 | }),
|
6357 |
|
6358 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6359 |
|
6360 | var DESCRIPTORS = __webpack_require__(6);
|
6361 | var global = __webpack_require__(4);
|
6362 | var isForced = __webpack_require__(45);
|
6363 | var inheritIfRequired = __webpack_require__(229);
|
6364 | var defineProperty = __webpack_require__(20).f;
|
6365 | var getOwnPropertyNames = __webpack_require__(37).f;
|
6366 | var isRegExp = __webpack_require__(181);
|
6367 | var getFlags = __webpack_require__(188);
|
6368 | var stickyHelpers = __webpack_require__(189);
|
6369 | var redefine = __webpack_require__(22);
|
6370 | var fails = __webpack_require__(7);
|
6371 | var setInternalState = __webpack_require__(26).set;
|
6372 | var setSpecies = __webpack_require__(131);
|
6373 | var wellKnownSymbol = __webpack_require__(58);
|
6374 |
|
6375 | var MATCH = wellKnownSymbol('match');
|
6376 | var NativeRegExp = global.RegExp;
|
6377 | var RegExpPrototype = NativeRegExp.prototype;
|
6378 | var re1 = /a/g;
|
6379 | var re2 = /a/g;
|
6380 |
|
6381 |
|
6382 | var CORRECT_NEW = new NativeRegExp(re1) !== re1;
|
6383 |
|
6384 | var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
|
6385 |
|
6386 | var FORCED = DESCRIPTORS && isForced('RegExp', (!CORRECT_NEW || UNSUPPORTED_Y || fails(function () {
|
6387 | re2[MATCH] = false;
|
6388 |
|
6389 | return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i';
|
6390 | })));
|
6391 |
|
6392 |
|
6393 |
|
6394 | if (FORCED) {
|
6395 | var RegExpWrapper = function RegExp(pattern, flags) {
|
6396 | var thisIsRegExp = this instanceof RegExpWrapper;
|
6397 | var patternIsRegExp = isRegExp(pattern);
|
6398 | var flagsAreUndefined = flags === undefined;
|
6399 | var sticky;
|
6400 |
|
6401 | if (!thisIsRegExp && patternIsRegExp && pattern.constructor === RegExpWrapper && flagsAreUndefined) {
|
6402 | return pattern;
|
6403 | }
|
6404 |
|
6405 | if (CORRECT_NEW) {
|
6406 | if (patternIsRegExp && !flagsAreUndefined) pattern = pattern.source;
|
6407 | } else if (pattern instanceof RegExpWrapper) {
|
6408 | if (flagsAreUndefined) flags = getFlags.call(pattern);
|
6409 | pattern = pattern.source;
|
6410 | }
|
6411 |
|
6412 | if (UNSUPPORTED_Y) {
|
6413 | sticky = !!flags && flags.indexOf('y') > -1;
|
6414 | if (sticky) flags = flags.replace(/y/g, '');
|
6415 | }
|
6416 |
|
6417 | var result = inheritIfRequired(
|
6418 | CORRECT_NEW ? new NativeRegExp(pattern, flags) : NativeRegExp(pattern, flags),
|
6419 | thisIsRegExp ? this : RegExpPrototype,
|
6420 | RegExpWrapper
|
6421 | );
|
6422 |
|
6423 | if (UNSUPPORTED_Y && sticky) setInternalState(result, { sticky: sticky });
|
6424 |
|
6425 | return result;
|
6426 | };
|
6427 | var proxy = function (key) {
|
6428 | key in RegExpWrapper || defineProperty(RegExpWrapper, key, {
|
6429 | configurable: true,
|
6430 | get: function () { return NativeRegExp[key]; },
|
6431 | set: function (it) { NativeRegExp[key] = it; }
|
6432 | });
|
6433 | };
|
6434 | var keys = getOwnPropertyNames(NativeRegExp);
|
6435 | var index = 0;
|
6436 | while (keys.length > index) proxy(keys[index++]);
|
6437 | RegExpPrototype.constructor = RegExpWrapper;
|
6438 | RegExpWrapper.prototype = RegExpPrototype;
|
6439 | redefine(global, 'RegExp', RegExpWrapper);
|
6440 | }
|
6441 |
|
6442 |
|
6443 | setSpecies('RegExp');
|
6444 |
|
6445 |
|
6446 | }),
|
6447 |
|
6448 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
6449 |
|
6450 | var isObject = __webpack_require__(15);
|
6451 | var setPrototypeOf = __webpack_require__(83);
|
6452 |
|
6453 |
|
6454 | module.exports = function ($this, dummy, Wrapper) {
|
6455 | var NewTarget, NewTargetPrototype;
|
6456 | if (
|
6457 |
|
6458 | setPrototypeOf &&
|
6459 |
|
6460 | typeof (NewTarget = dummy.constructor) == 'function' &&
|
6461 | NewTarget !== Wrapper &&
|
6462 | isObject(NewTargetPrototype = NewTarget.prototype) &&
|
6463 | NewTargetPrototype !== Wrapper.prototype
|
6464 | ) setPrototypeOf($this, NewTargetPrototype);
|
6465 | return $this;
|
6466 | };
|
6467 |
|
6468 |
|
6469 | }),
|
6470 |
|
6471 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6472 |
|
6473 | var DESCRIPTORS = __webpack_require__(6);
|
6474 | var objectDefinePropertyModule = __webpack_require__(20);
|
6475 | var regExpFlags = __webpack_require__(188);
|
6476 | var UNSUPPORTED_Y = __webpack_require__(189).UNSUPPORTED_Y;
|
6477 |
|
6478 |
|
6479 |
|
6480 | if (DESCRIPTORS && (/./g.flags != 'g' || UNSUPPORTED_Y)) {
|
6481 | objectDefinePropertyModule.f(RegExp.prototype, 'flags', {
|
6482 | configurable: true,
|
6483 | get: regExpFlags
|
6484 | });
|
6485 | }
|
6486 |
|
6487 |
|
6488 | /***/ }),
|
6489 | /* 231 */
|
6490 | /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6491 |
|
6492 | var DESCRIPTORS = __webpack_require__(6);
|
6493 | var UNSUPPORTED_Y = __webpack_require__(189).UNSUPPORTED_Y;
|
6494 | var defineProperty = __webpack_require__(20).f;
|
6495 | var getInternalState = __webpack_require__(26).get;
|
6496 | var RegExpPrototype = RegExp.prototype;
|
6497 |
|
6498 |
|
6499 |
|
6500 | if (DESCRIPTORS && UNSUPPORTED_Y) {
|
6501 | defineProperty(RegExp.prototype, 'sticky', {
|
6502 | configurable: true,
|
6503 | get: function () {
|
6504 | if (this === RegExpPrototype) return undefined;
|
6505 |
|
6506 |
|
6507 | if (this instanceof RegExp) {
|
6508 | return !!getInternalState(this).sticky;
|
6509 | }
|
6510 | throw TypeError('Incompatible receiver, RegExp required');
|
6511 | }
|
6512 | });
|
6513 | }
|
6514 |
|
6515 |
|
6516 | }),
|
6517 |
|
6518 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6519 |
|
6520 | "use strict";
|
6521 |
|
6522 |
|
6523 | __webpack_require__(186);
|
6524 | var $ = __webpack_require__(3);
|
6525 | var isObject = __webpack_require__(15);
|
6526 |
|
6527 | var DELEGATES_TO_EXEC = function () {
|
6528 | var execCalled = false;
|
6529 | var re = /[ac]/;
|
6530 | re.exec = function () {
|
6531 | execCalled = true;
|
6532 | return /./.exec.apply(this, arguments);
|
6533 | };
|
6534 | return re.test('abc') === true && execCalled;
|
6535 | }();
|
6536 |
|
6537 | var nativeTest = /./.test;
|
6538 |
|
6539 |
|
6540 |
|
6541 | $({ target: 'RegExp', proto: true, forced: !DELEGATES_TO_EXEC }, {
|
6542 | test: function (str) {
|
6543 | if (typeof this.exec !== 'function') {
|
6544 | return nativeTest.call(this, str);
|
6545 | }
|
6546 | var result = this.exec(str);
|
6547 | if (result !== null && !isObject(result)) {
|
6548 | throw new Error('RegExp exec method returned something other than an Object or null');
|
6549 | }
|
6550 | return !!result;
|
6551 | }
|
6552 | });
|
6553 |
|
6554 |
|
6555 | }),
|
6556 |
|
6557 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6558 |
|
6559 | "use strict";
|
6560 |
|
6561 | var redefine = __webpack_require__(22);
|
6562 | var anObject = __webpack_require__(21);
|
6563 | var fails = __webpack_require__(7);
|
6564 | var flags = __webpack_require__(188);
|
6565 |
|
6566 | var TO_STRING = 'toString';
|
6567 | var RegExpPrototype = RegExp.prototype;
|
6568 | var nativeToString = RegExpPrototype[TO_STRING];
|
6569 |
|
6570 | var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
|
6571 |
|
6572 | var INCORRECT_NAME = nativeToString.name != TO_STRING;
|
6573 |
|
6574 |
|
6575 |
|
6576 | if (NOT_GENERIC || INCORRECT_NAME) {
|
6577 | redefine(RegExp.prototype, TO_STRING, function toString() {
|
6578 | var R = anObject(this);
|
6579 | var p = String(R.source);
|
6580 | var rf = R.flags;
|
6581 | var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf);
|
6582 | return '/' + p + '/' + f;
|
6583 | }, { unsafe: true });
|
6584 | }
|
6585 |
|
6586 |
|
6587 | }),
|
6588 |
|
6589 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6590 |
|
6591 | var $ = __webpack_require__(3);
|
6592 | var parseIntImplementation = __webpack_require__(235);
|
6593 |
|
6594 |
|
6595 |
|
6596 | $({ global: true, forced: parseInt != parseIntImplementation }, {
|
6597 | parseInt: parseIntImplementation
|
6598 | });
|
6599 |
|
6600 |
|
6601 | }),
|
6602 |
|
6603 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
6604 |
|
6605 | var global = __webpack_require__(4);
|
6606 | var trim = __webpack_require__(206).trim;
|
6607 | var whitespaces = __webpack_require__(207);
|
6608 |
|
6609 | var $parseInt = global.parseInt;
|
6610 | var hex = /^[+-]?0[Xx]/;
|
6611 | var FORCED = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22;
|
6612 |
|
6613 |
|
6614 |
|
6615 | module.exports = FORCED ? function parseInt(string, radix) {
|
6616 | var S = trim(String(string));
|
6617 | return $parseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10));
|
6618 | } : $parseInt;
|
6619 |
|
6620 |
|
6621 | }),
|
6622 |
|
6623 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6624 |
|
6625 | var $ = __webpack_require__(3);
|
6626 | var parseFloatImplementation = __webpack_require__(237);
|
6627 |
|
6628 |
|
6629 |
|
6630 | $({ global: true, forced: parseFloat != parseFloatImplementation }, {
|
6631 | parseFloat: parseFloatImplementation
|
6632 | });
|
6633 |
|
6634 |
|
6635 | }),
|
6636 |
|
6637 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
6638 |
|
6639 | var global = __webpack_require__(4);
|
6640 | var trim = __webpack_require__(206).trim;
|
6641 | var whitespaces = __webpack_require__(207);
|
6642 |
|
6643 | var $parseFloat = global.parseFloat;
|
6644 | var FORCED = 1 / $parseFloat(whitespaces + '-0') !== -Infinity;
|
6645 |
|
6646 |
|
6647 |
|
6648 | module.exports = FORCED ? function parseFloat(string) {
|
6649 | var trimmedString = trim(String(string));
|
6650 | var result = $parseFloat(trimmedString);
|
6651 | return result === 0 && trimmedString.charAt(0) == '-' ? -0 : result;
|
6652 | } : $parseFloat;
|
6653 |
|
6654 |
|
6655 | }),
|
6656 |
|
6657 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6658 |
|
6659 | "use strict";
|
6660 |
|
6661 | var DESCRIPTORS = __webpack_require__(6);
|
6662 | var global = __webpack_require__(4);
|
6663 | var isForced = __webpack_require__(45);
|
6664 | var redefine = __webpack_require__(22);
|
6665 | var has = __webpack_require__(16);
|
6666 | var classof = __webpack_require__(12);
|
6667 | var inheritIfRequired = __webpack_require__(229);
|
6668 | var toPrimitive = __webpack_require__(14);
|
6669 | var fails = __webpack_require__(7);
|
6670 | var create = __webpack_require__(53);
|
6671 | var getOwnPropertyNames = __webpack_require__(37).f;
|
6672 | var getOwnPropertyDescriptor = __webpack_require__(5).f;
|
6673 | var defineProperty = __webpack_require__(20).f;
|
6674 | var trim = __webpack_require__(206).trim;
|
6675 |
|
6676 | var NUMBER = 'Number';
|
6677 | var NativeNumber = global[NUMBER];
|
6678 | var NumberPrototype = NativeNumber.prototype;
|
6679 |
|
6680 |
|
6681 | var BROKEN_CLASSOF = classof(create(NumberPrototype)) == NUMBER;
|
6682 |
|
6683 |
|
6684 |
|
6685 | var toNumber = function (argument) {
|
6686 | var it = toPrimitive(argument, false);
|
6687 | var first, third, radix, maxCode, digits, length, index, code;
|
6688 | if (typeof it == 'string' && it.length > 2) {
|
6689 | it = trim(it);
|
6690 | first = it.charCodeAt(0);
|
6691 | if (first === 43 || first === 45) {
|
6692 | third = it.charCodeAt(2);
|
6693 | if (third === 88 || third === 120) return NaN;
|
6694 | } else if (first === 48) {
|
6695 | switch (it.charCodeAt(1)) {
|
6696 | case 66: case 98: radix = 2; maxCode = 49; break;
|
6697 | case 79: case 111: radix = 8; maxCode = 55; break;
|
6698 | default: return +it;
|
6699 | }
|
6700 | digits = it.slice(2);
|
6701 | length = digits.length;
|
6702 | for (index = 0; index < length; index++) {
|
6703 | code = digits.charCodeAt(index);
|
6704 |
|
6705 |
|
6706 | if (code < 48 || code > maxCode) return NaN;
|
6707 | } return parseInt(digits, radix);
|
6708 | }
|
6709 | } return +it;
|
6710 | };
|
6711 |
|
6712 |
|
6713 |
|
6714 | if (isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) {
|
6715 | var NumberWrapper = function Number(value) {
|
6716 | var it = arguments.length < 1 ? 0 : value;
|
6717 | var dummy = this;
|
6718 | return dummy instanceof NumberWrapper
|
6719 |
|
6720 | && (BROKEN_CLASSOF ? fails(function () { NumberPrototype.valueOf.call(dummy); }) : classof(dummy) != NUMBER)
|
6721 | ? inheritIfRequired(new NativeNumber(toNumber(it)), dummy, NumberWrapper) : toNumber(it);
|
6722 | };
|
6723 | for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : (
|
6724 |
|
6725 | 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
|
6726 |
|
6727 | 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +
|
6728 | 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,' +
|
6729 |
|
6730 | 'fromString,range'
|
6731 | ).split(','), j = 0, key; keys.length > j; j++) {
|
6732 | if (has(NativeNumber, key = keys[j]) && !has(NumberWrapper, key)) {
|
6733 | defineProperty(NumberWrapper, key, getOwnPropertyDescriptor(NativeNumber, key));
|
6734 | }
|
6735 | }
|
6736 | NumberWrapper.prototype = NumberPrototype;
|
6737 | NumberPrototype.constructor = NumberWrapper;
|
6738 | redefine(global, NUMBER, NumberWrapper);
|
6739 | }
|
6740 |
|
6741 |
|
6742 | }),
|
6743 |
|
6744 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6745 |
|
6746 | var $ = __webpack_require__(3);
|
6747 |
|
6748 |
|
6749 |
|
6750 | $({ target: 'Number', stat: true }, {
|
6751 | EPSILON: Math.pow(2, -52)
|
6752 | });
|
6753 |
|
6754 |
|
6755 | }),
|
6756 |
|
6757 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6758 |
|
6759 | var $ = __webpack_require__(3);
|
6760 | var numberIsFinite = __webpack_require__(241);
|
6761 |
|
6762 |
|
6763 |
|
6764 | $({ target: 'Number', stat: true }, { isFinite: numberIsFinite });
|
6765 |
|
6766 |
|
6767 | }),
|
6768 |
|
6769 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
6770 |
|
6771 | var global = __webpack_require__(4);
|
6772 |
|
6773 | var globalIsFinite = global.isFinite;
|
6774 |
|
6775 |
|
6776 |
|
6777 | module.exports = Number.isFinite || function isFinite(it) {
|
6778 | return typeof it == 'number' && globalIsFinite(it);
|
6779 | };
|
6780 |
|
6781 |
|
6782 | }),
|
6783 |
|
6784 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6785 |
|
6786 | var $ = __webpack_require__(3);
|
6787 | var isInteger = __webpack_require__(243);
|
6788 |
|
6789 |
|
6790 |
|
6791 | $({ target: 'Number', stat: true }, {
|
6792 | isInteger: isInteger
|
6793 | });
|
6794 |
|
6795 |
|
6796 | }),
|
6797 |
|
6798 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
6799 |
|
6800 | var isObject = __webpack_require__(15);
|
6801 |
|
6802 | var floor = Math.floor;
|
6803 |
|
6804 |
|
6805 |
|
6806 | module.exports = function isInteger(it) {
|
6807 | return !isObject(it) && isFinite(it) && floor(it) === it;
|
6808 | };
|
6809 |
|
6810 |
|
6811 | }),
|
6812 |
|
6813 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6814 |
|
6815 | var $ = __webpack_require__(3);
|
6816 |
|
6817 |
|
6818 |
|
6819 | $({ target: 'Number', stat: true }, {
|
6820 | isNaN: function isNaN(number) {
|
6821 |
|
6822 | return number != number;
|
6823 | }
|
6824 | });
|
6825 |
|
6826 |
|
6827 | }),
|
6828 |
|
6829 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6830 |
|
6831 | var $ = __webpack_require__(3);
|
6832 | var isInteger = __webpack_require__(243);
|
6833 |
|
6834 | var abs = Math.abs;
|
6835 |
|
6836 |
|
6837 |
|
6838 | $({ target: 'Number', stat: true }, {
|
6839 | isSafeInteger: function isSafeInteger(number) {
|
6840 | return isInteger(number) && abs(number) <= 0x1FFFFFFFFFFFFF;
|
6841 | }
|
6842 | });
|
6843 |
|
6844 |
|
6845 | }),
|
6846 |
|
6847 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6848 |
|
6849 | var $ = __webpack_require__(3);
|
6850 |
|
6851 |
|
6852 |
|
6853 | $({ target: 'Number', stat: true }, {
|
6854 | MAX_SAFE_INTEGER: 0x1FFFFFFFFFFFFF
|
6855 | });
|
6856 |
|
6857 |
|
6858 | }),
|
6859 |
|
6860 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6861 |
|
6862 | var $ = __webpack_require__(3);
|
6863 |
|
6864 |
|
6865 |
|
6866 | $({ target: 'Number', stat: true }, {
|
6867 | MIN_SAFE_INTEGER: -0x1FFFFFFFFFFFFF
|
6868 | });
|
6869 |
|
6870 |
|
6871 | }),
|
6872 |
|
6873 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6874 |
|
6875 | var $ = __webpack_require__(3);
|
6876 | var parseFloat = __webpack_require__(237);
|
6877 |
|
6878 |
|
6879 |
|
6880 | $({ target: 'Number', stat: true, forced: Number.parseFloat != parseFloat }, {
|
6881 | parseFloat: parseFloat
|
6882 | });
|
6883 |
|
6884 |
|
6885 | }),
|
6886 |
|
6887 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6888 |
|
6889 | var $ = __webpack_require__(3);
|
6890 | var parseInt = __webpack_require__(235);
|
6891 |
|
6892 |
|
6893 |
|
6894 | $({ target: 'Number', stat: true, forced: Number.parseInt != parseInt }, {
|
6895 | parseInt: parseInt
|
6896 | });
|
6897 |
|
6898 |
|
6899 | }),
|
6900 |
|
6901 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6902 |
|
6903 | "use strict";
|
6904 |
|
6905 | var $ = __webpack_require__(3);
|
6906 | var toInteger = __webpack_require__(41);
|
6907 | var thisNumberValue = __webpack_require__(251);
|
6908 | var repeat = __webpack_require__(196);
|
6909 | var fails = __webpack_require__(7);
|
6910 |
|
6911 | var nativeToFixed = 1.0.toFixed;
|
6912 | var floor = Math.floor;
|
6913 |
|
6914 | var pow = function (x, n, acc) {
|
6915 | return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);
|
6916 | };
|
6917 |
|
6918 | var log = function (x) {
|
6919 | var n = 0;
|
6920 | var x2 = x;
|
6921 | while (x2 >= 4096) {
|
6922 | n += 12;
|
6923 | x2 /= 4096;
|
6924 | }
|
6925 | while (x2 >= 2) {
|
6926 | n += 1;
|
6927 | x2 /= 2;
|
6928 | } return n;
|
6929 | };
|
6930 |
|
6931 | var multiply = function (data, n, c) {
|
6932 | var index = -1;
|
6933 | var c2 = c;
|
6934 | while (++index < 6) {
|
6935 | c2 += n * data[index];
|
6936 | data[index] = c2 % 1e7;
|
6937 | c2 = floor(c2 / 1e7);
|
6938 | }
|
6939 | };
|
6940 |
|
6941 | var divide = function (data, n) {
|
6942 | var index = 6;
|
6943 | var c = 0;
|
6944 | while (--index >= 0) {
|
6945 | c += data[index];
|
6946 | data[index] = floor(c / n);
|
6947 | c = (c % n) * 1e7;
|
6948 | }
|
6949 | };
|
6950 |
|
6951 | var dataToString = function (data) {
|
6952 | var index = 6;
|
6953 | var s = '';
|
6954 | while (--index >= 0) {
|
6955 | if (s !== '' || index === 0 || data[index] !== 0) {
|
6956 | var t = String(data[index]);
|
6957 | s = s === '' ? t : s + repeat.call('0', 7 - t.length) + t;
|
6958 | }
|
6959 | } return s;
|
6960 | };
|
6961 |
|
6962 | var FORCED = nativeToFixed && (
|
6963 | 0.00008.toFixed(3) !== '0.000' ||
|
6964 | 0.9.toFixed(0) !== '1' ||
|
6965 | 1.255.toFixed(2) !== '1.25' ||
|
6966 | 1000000000000000128.0.toFixed(0) !== '1000000000000000128'
|
6967 | ) || !fails(function () {
|
6968 |
|
6969 | nativeToFixed.call({});
|
6970 | });
|
6971 |
|
6972 |
|
6973 |
|
6974 | $({ target: 'Number', proto: true, forced: FORCED }, {
|
6975 | toFixed: function toFixed(fractionDigits) {
|
6976 | var number = thisNumberValue(this);
|
6977 | var fractDigits = toInteger(fractionDigits);
|
6978 | var data = [0, 0, 0, 0, 0, 0];
|
6979 | var sign = '';
|
6980 | var result = '0';
|
6981 | var e, z, j, k;
|
6982 |
|
6983 | if (fractDigits < 0 || fractDigits > 20) throw RangeError('Incorrect fraction digits');
|
6984 |
|
6985 | if (number != number) return 'NaN';
|
6986 | if (number <= -1e21 || number >= 1e21) return String(number);
|
6987 | if (number < 0) {
|
6988 | sign = '-';
|
6989 | number = -number;
|
6990 | }
|
6991 | if (number > 1e-21) {
|
6992 | e = log(number * pow(2, 69, 1)) - 69;
|
6993 | z = e < 0 ? number * pow(2, -e, 1) : number / pow(2, e, 1);
|
6994 | z *= 0x10000000000000;
|
6995 | e = 52 - e;
|
6996 | if (e > 0) {
|
6997 | multiply(data, 0, z);
|
6998 | j = fractDigits;
|
6999 | while (j >= 7) {
|
7000 | multiply(data, 1e7, 0);
|
7001 | j -= 7;
|
7002 | }
|
7003 | multiply(data, pow(10, j, 1), 0);
|
7004 | j = e - 1;
|
7005 | while (j >= 23) {
|
7006 | divide(data, 1 << 23);
|
7007 | j -= 23;
|
7008 | }
|
7009 | divide(data, 1 << j);
|
7010 | multiply(data, 1, 1);
|
7011 | divide(data, 2);
|
7012 | result = dataToString(data);
|
7013 | } else {
|
7014 | multiply(data, 0, z);
|
7015 | multiply(data, 1 << -e, 0);
|
7016 | result = dataToString(data) + repeat.call('0', fractDigits);
|
7017 | }
|
7018 | }
|
7019 | if (fractDigits > 0) {
|
7020 | k = result.length;
|
7021 | result = sign + (k <= fractDigits
|
7022 | ? '0.' + repeat.call('0', fractDigits - k) + result
|
7023 | : result.slice(0, k - fractDigits) + '.' + result.slice(k - fractDigits));
|
7024 | } else {
|
7025 | result = sign + result;
|
7026 | } return result;
|
7027 | }
|
7028 | });
|
7029 |
|
7030 |
|
7031 | }),
|
7032 |
|
7033 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
7034 |
|
7035 | var classof = __webpack_require__(12);
|
7036 |
|
7037 |
|
7038 |
|
7039 | module.exports = function (value) {
|
7040 | if (typeof value != 'number' && classof(value) != 'Number') {
|
7041 | throw TypeError('Incorrect invocation');
|
7042 | }
|
7043 | return +value;
|
7044 | };
|
7045 |
|
7046 |
|
7047 | }),
|
7048 |
|
7049 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7050 |
|
7051 | "use strict";
|
7052 |
|
7053 | var $ = __webpack_require__(3);
|
7054 | var fails = __webpack_require__(7);
|
7055 | var thisNumberValue = __webpack_require__(251);
|
7056 |
|
7057 | var nativeToPrecision = 1.0.toPrecision;
|
7058 |
|
7059 | var FORCED = fails(function () {
|
7060 |
|
7061 | return nativeToPrecision.call(1, undefined) !== '1';
|
7062 | }) || !fails(function () {
|
7063 |
|
7064 | nativeToPrecision.call({});
|
7065 | });
|
7066 |
|
7067 |
|
7068 |
|
7069 | $({ target: 'Number', proto: true, forced: FORCED }, {
|
7070 | toPrecision: function toPrecision(precision) {
|
7071 | return precision === undefined
|
7072 | ? nativeToPrecision.call(thisNumberValue(this))
|
7073 | : nativeToPrecision.call(thisNumberValue(this), precision);
|
7074 | }
|
7075 | });
|
7076 |
|
7077 |
|
7078 | }),
|
7079 |
|
7080 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7081 |
|
7082 | var $ = __webpack_require__(3);
|
7083 | var log1p = __webpack_require__(254);
|
7084 |
|
7085 | var nativeAcosh = Math.acosh;
|
7086 | var log = Math.log;
|
7087 | var sqrt = Math.sqrt;
|
7088 | var LN2 = Math.LN2;
|
7089 |
|
7090 | var FORCED = !nativeAcosh
|
7091 |
|
7092 | || Math.floor(nativeAcosh(Number.MAX_VALUE)) != 710
|
7093 |
|
7094 | || nativeAcosh(Infinity) != Infinity;
|
7095 |
|
7096 |
|
7097 |
|
7098 | $({ target: 'Math', stat: true, forced: FORCED }, {
|
7099 | acosh: function acosh(x) {
|
7100 | return (x = +x) < 1 ? NaN : x > 94906265.62425156
|
7101 | ? log(x) + LN2
|
7102 | : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1));
|
7103 | }
|
7104 | });
|
7105 |
|
7106 |
|
7107 | }),
|
7108 |
|
7109 | (function(module) {
|
7110 |
|
7111 | var log = Math.log;
|
7112 |
|
7113 |
|
7114 |
|
7115 | module.exports = Math.log1p || function log1p(x) {
|
7116 | return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : log(1 + x);
|
7117 | };
|
7118 |
|
7119 |
|
7120 | }),
|
7121 |
|
7122 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7123 |
|
7124 | var $ = __webpack_require__(3);
|
7125 |
|
7126 | var nativeAsinh = Math.asinh;
|
7127 | var log = Math.log;
|
7128 | var sqrt = Math.sqrt;
|
7129 |
|
7130 | function asinh(x) {
|
7131 | return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : log(x + sqrt(x * x + 1));
|
7132 | }
|
7133 |
|
7134 |
|
7135 |
|
7136 |
|
7137 | $({ target: 'Math', stat: true, forced: !(nativeAsinh && 1 / nativeAsinh(0) > 0) }, {
|
7138 | asinh: asinh
|
7139 | });
|
7140 |
|
7141 |
|
7142 | }),
|
7143 |
|
7144 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7145 |
|
7146 | var $ = __webpack_require__(3);
|
7147 |
|
7148 | var nativeAtanh = Math.atanh;
|
7149 | var log = Math.log;
|
7150 |
|
7151 |
|
7152 |
|
7153 |
|
7154 | $({ target: 'Math', stat: true, forced: !(nativeAtanh && 1 / nativeAtanh(-0) < 0) }, {
|
7155 | atanh: function atanh(x) {
|
7156 | return (x = +x) == 0 ? x : log((1 + x) / (1 - x)) / 2;
|
7157 | }
|
7158 | });
|
7159 |
|
7160 |
|
7161 | }),
|
7162 |
|
7163 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7164 |
|
7165 | var $ = __webpack_require__(3);
|
7166 | var sign = __webpack_require__(258);
|
7167 |
|
7168 | var abs = Math.abs;
|
7169 | var pow = Math.pow;
|
7170 |
|
7171 |
|
7172 |
|
7173 | $({ target: 'Math', stat: true }, {
|
7174 | cbrt: function cbrt(x) {
|
7175 | return sign(x = +x) * pow(abs(x), 1 / 3);
|
7176 | }
|
7177 | });
|
7178 |
|
7179 |
|
7180 | }),
|
7181 |
|
7182 | (function(module) {
|
7183 |
|
7184 |
|
7185 |
|
7186 | module.exports = Math.sign || function sign(x) {
|
7187 |
|
7188 | return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
|
7189 | };
|
7190 |
|
7191 |
|
7192 | }),
|
7193 |
|
7194 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7195 |
|
7196 | var $ = __webpack_require__(3);
|
7197 |
|
7198 | var floor = Math.floor;
|
7199 | var log = Math.log;
|
7200 | var LOG2E = Math.LOG2E;
|
7201 |
|
7202 |
|
7203 |
|
7204 | $({ target: 'Math', stat: true }, {
|
7205 | clz32: function clz32(x) {
|
7206 | return (x >>>= 0) ? 31 - floor(log(x + 0.5) * LOG2E) : 32;
|
7207 | }
|
7208 | });
|
7209 |
|
7210 |
|
7211 | }),
|
7212 |
|
7213 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7214 |
|
7215 | var $ = __webpack_require__(3);
|
7216 | var expm1 = __webpack_require__(261);
|
7217 |
|
7218 | var nativeCosh = Math.cosh;
|
7219 | var abs = Math.abs;
|
7220 | var E = Math.E;
|
7221 |
|
7222 |
|
7223 |
|
7224 | $({ target: 'Math', stat: true, forced: !nativeCosh || nativeCosh(710) === Infinity }, {
|
7225 | cosh: function cosh(x) {
|
7226 | var t = expm1(abs(x) - 1) + 1;
|
7227 | return (t + 1 / (t * E * E)) * (E / 2);
|
7228 | }
|
7229 | });
|
7230 |
|
7231 |
|
7232 | }),
|
7233 |
|
7234 | (function(module) {
|
7235 |
|
7236 | var nativeExpm1 = Math.expm1;
|
7237 | var exp = Math.exp;
|
7238 |
|
7239 |
|
7240 |
|
7241 | module.exports = (!nativeExpm1
|
7242 |
|
7243 | || nativeExpm1(10) > 22025.465794806719 || nativeExpm1(10) < 22025.4657948067165168
|
7244 |
|
7245 | || nativeExpm1(-2e-17) != -2e-17
|
7246 | ) ? function expm1(x) {
|
7247 | return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : exp(x) - 1;
|
7248 | } : nativeExpm1;
|
7249 |
|
7250 |
|
7251 | }),
|
7252 |
|
7253 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7254 |
|
7255 | var $ = __webpack_require__(3);
|
7256 | var expm1 = __webpack_require__(261);
|
7257 |
|
7258 |
|
7259 |
|
7260 | $({ target: 'Math', stat: true, forced: expm1 != Math.expm1 }, { expm1: expm1 });
|
7261 |
|
7262 |
|
7263 | }),
|
7264 |
|
7265 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7266 |
|
7267 | var $ = __webpack_require__(3);
|
7268 | var fround = __webpack_require__(264);
|
7269 |
|
7270 |
|
7271 |
|
7272 | $({ target: 'Math', stat: true }, { fround: fround });
|
7273 |
|
7274 |
|
7275 | }),
|
7276 |
|
7277 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
7278 |
|
7279 | var sign = __webpack_require__(258);
|
7280 |
|
7281 | var abs = Math.abs;
|
7282 | var pow = Math.pow;
|
7283 | var EPSILON = pow(2, -52);
|
7284 | var EPSILON32 = pow(2, -23);
|
7285 | var MAX32 = pow(2, 127) * (2 - EPSILON32);
|
7286 | var MIN32 = pow(2, -126);
|
7287 |
|
7288 | var roundTiesToEven = function (n) {
|
7289 | return n + 1 / EPSILON - 1 / EPSILON;
|
7290 | };
|
7291 |
|
7292 |
|
7293 |
|
7294 | module.exports = Math.fround || function fround(x) {
|
7295 | var $abs = abs(x);
|
7296 | var $sign = sign(x);
|
7297 | var a, result;
|
7298 | if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;
|
7299 | a = (1 + EPSILON32 / EPSILON) * $abs;
|
7300 | result = a - (a - $abs);
|
7301 |
|
7302 | if (result > MAX32 || result != result) return $sign * Infinity;
|
7303 | return $sign * result;
|
7304 | };
|
7305 |
|
7306 |
|
7307 | }),
|
7308 |
|
7309 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7310 |
|
7311 | var $ = __webpack_require__(3);
|
7312 |
|
7313 | var $hypot = Math.hypot;
|
7314 | var abs = Math.abs;
|
7315 | var sqrt = Math.sqrt;
|
7316 |
|
7317 |
|
7318 |
|
7319 | var BUGGY = !!$hypot && $hypot(Infinity, NaN) !== Infinity;
|
7320 |
|
7321 |
|
7322 |
|
7323 | $({ target: 'Math', stat: true, forced: BUGGY }, {
|
7324 |
|
7325 | hypot: function hypot(value1, value2) {
|
7326 | var sum = 0;
|
7327 | var i = 0;
|
7328 | var aLen = arguments.length;
|
7329 | var larg = 0;
|
7330 | var arg, div;
|
7331 | while (i < aLen) {
|
7332 | arg = abs(arguments[i++]);
|
7333 | if (larg < arg) {
|
7334 | div = larg / arg;
|
7335 | sum = sum * div * div + 1;
|
7336 | larg = arg;
|
7337 | } else if (arg > 0) {
|
7338 | div = arg / larg;
|
7339 | sum += div * div;
|
7340 | } else sum += arg;
|
7341 | }
|
7342 | return larg === Infinity ? Infinity : larg * sqrt(sum);
|
7343 | }
|
7344 | });
|
7345 |
|
7346 |
|
7347 | }),
|
7348 |
|
7349 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7350 |
|
7351 | var $ = __webpack_require__(3);
|
7352 | var fails = __webpack_require__(7);
|
7353 |
|
7354 | var nativeImul = Math.imul;
|
7355 |
|
7356 | var FORCED = fails(function () {
|
7357 | return nativeImul(0xFFFFFFFF, 5) != -5 || nativeImul.length != 2;
|
7358 | });
|
7359 |
|
7360 |
|
7361 |
|
7362 |
|
7363 | $({ target: 'Math', stat: true, forced: FORCED }, {
|
7364 | imul: function imul(x, y) {
|
7365 | var UINT16 = 0xFFFF;
|
7366 | var xn = +x;
|
7367 | var yn = +y;
|
7368 | var xl = UINT16 & xn;
|
7369 | var yl = UINT16 & yn;
|
7370 | return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);
|
7371 | }
|
7372 | });
|
7373 |
|
7374 |
|
7375 | }),
|
7376 |
|
7377 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7378 |
|
7379 | var $ = __webpack_require__(3);
|
7380 |
|
7381 | var log = Math.log;
|
7382 | var LOG10E = Math.LOG10E;
|
7383 |
|
7384 |
|
7385 |
|
7386 | $({ target: 'Math', stat: true }, {
|
7387 | log10: function log10(x) {
|
7388 | return log(x) * LOG10E;
|
7389 | }
|
7390 | });
|
7391 |
|
7392 |
|
7393 | }),
|
7394 |
|
7395 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7396 |
|
7397 | var $ = __webpack_require__(3);
|
7398 | var log1p = __webpack_require__(254);
|
7399 |
|
7400 |
|
7401 |
|
7402 | $({ target: 'Math', stat: true }, { log1p: log1p });
|
7403 |
|
7404 |
|
7405 | }),
|
7406 |
|
7407 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7408 |
|
7409 | var $ = __webpack_require__(3);
|
7410 |
|
7411 | var log = Math.log;
|
7412 | var LN2 = Math.LN2;
|
7413 |
|
7414 |
|
7415 |
|
7416 | $({ target: 'Math', stat: true }, {
|
7417 | log2: function log2(x) {
|
7418 | return log(x) / LN2;
|
7419 | }
|
7420 | });
|
7421 |
|
7422 |
|
7423 | }),
|
7424 |
|
7425 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7426 |
|
7427 | var $ = __webpack_require__(3);
|
7428 | var sign = __webpack_require__(258);
|
7429 |
|
7430 |
|
7431 |
|
7432 | $({ target: 'Math', stat: true }, {
|
7433 | sign: sign
|
7434 | });
|
7435 |
|
7436 |
|
7437 | }),
|
7438 |
|
7439 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7440 |
|
7441 | var $ = __webpack_require__(3);
|
7442 | var fails = __webpack_require__(7);
|
7443 | var expm1 = __webpack_require__(261);
|
7444 |
|
7445 | var abs = Math.abs;
|
7446 | var exp = Math.exp;
|
7447 | var E = Math.E;
|
7448 |
|
7449 | var FORCED = fails(function () {
|
7450 | return Math.sinh(-2e-17) != -2e-17;
|
7451 | });
|
7452 |
|
7453 |
|
7454 |
|
7455 |
|
7456 | $({ target: 'Math', stat: true, forced: FORCED }, {
|
7457 | sinh: function sinh(x) {
|
7458 | return abs(x = +x) < 1 ? (expm1(x) - expm1(-x)) / 2 : (exp(x - 1) - exp(-x - 1)) * (E / 2);
|
7459 | }
|
7460 | });
|
7461 |
|
7462 |
|
7463 | }),
|
7464 |
|
7465 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7466 |
|
7467 | var $ = __webpack_require__(3);
|
7468 | var expm1 = __webpack_require__(261);
|
7469 |
|
7470 | var exp = Math.exp;
|
7471 |
|
7472 |
|
7473 |
|
7474 | $({ target: 'Math', stat: true }, {
|
7475 | tanh: function tanh(x) {
|
7476 | var a = expm1(x = +x);
|
7477 | var b = expm1(-x);
|
7478 | return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));
|
7479 | }
|
7480 | });
|
7481 |
|
7482 |
|
7483 | }),
|
7484 |
|
7485 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7486 |
|
7487 | var setToStringTag = __webpack_require__(61);
|
7488 |
|
7489 |
|
7490 |
|
7491 | setToStringTag(Math, 'Math', true);
|
7492 |
|
7493 |
|
7494 | }),
|
7495 |
|
7496 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7497 |
|
7498 | var $ = __webpack_require__(3);
|
7499 |
|
7500 | var ceil = Math.ceil;
|
7501 | var floor = Math.floor;
|
7502 |
|
7503 |
|
7504 |
|
7505 | $({ target: 'Math', stat: true }, {
|
7506 | trunc: function trunc(it) {
|
7507 | return (it > 0 ? floor : ceil)(it);
|
7508 | }
|
7509 | });
|
7510 |
|
7511 |
|
7512 | }),
|
7513 |
|
7514 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7515 |
|
7516 | var $ = __webpack_require__(3);
|
7517 |
|
7518 |
|
7519 |
|
7520 | $({ target: 'Date', stat: true }, {
|
7521 | now: function now() {
|
7522 | return new Date().getTime();
|
7523 | }
|
7524 | });
|
7525 |
|
7526 |
|
7527 | }),
|
7528 |
|
7529 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7530 |
|
7531 | "use strict";
|
7532 |
|
7533 | var $ = __webpack_require__(3);
|
7534 | var fails = __webpack_require__(7);
|
7535 | var toObject = __webpack_require__(52);
|
7536 | var toPrimitive = __webpack_require__(14);
|
7537 |
|
7538 | var FORCED = fails(function () {
|
7539 | return new Date(NaN).toJSON() !== null
|
7540 | || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1;
|
7541 | });
|
7542 |
|
7543 |
|
7544 |
|
7545 | $({ target: 'Date', proto: true, forced: FORCED }, {
|
7546 |
|
7547 | toJSON: function toJSON(key) {
|
7548 | var O = toObject(this);
|
7549 | var pv = toPrimitive(O);
|
7550 | return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();
|
7551 | }
|
7552 | });
|
7553 |
|
7554 |
|
7555 | }),
|
7556 |
|
7557 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7558 |
|
7559 | var $ = __webpack_require__(3);
|
7560 | var toISOString = __webpack_require__(278);
|
7561 |
|
7562 |
|
7563 |
|
7564 |
|
7565 | $({ target: 'Date', proto: true, forced: Date.prototype.toISOString !== toISOString }, {
|
7566 | toISOString: toISOString
|
7567 | });
|
7568 |
|
7569 |
|
7570 | }),
|
7571 |
|
7572 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
7573 |
|
7574 | "use strict";
|
7575 |
|
7576 | var fails = __webpack_require__(7);
|
7577 | var padStart = __webpack_require__(195).start;
|
7578 |
|
7579 | var abs = Math.abs;
|
7580 | var DatePrototype = Date.prototype;
|
7581 | var getTime = DatePrototype.getTime;
|
7582 | var nativeDateToISOString = DatePrototype.toISOString;
|
7583 |
|
7584 |
|
7585 |
|
7586 |
|
7587 | module.exports = (fails(function () {
|
7588 | return nativeDateToISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';
|
7589 | }) || !fails(function () {
|
7590 | nativeDateToISOString.call(new Date(NaN));
|
7591 | })) ? function toISOString() {
|
7592 | if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value');
|
7593 | var date = this;
|
7594 | var year = date.getUTCFullYear();
|
7595 | var milliseconds = date.getUTCMilliseconds();
|
7596 | var sign = year < 0 ? '-' : year > 9999 ? '+' : '';
|
7597 | return sign + padStart(abs(year), sign ? 6 : 4, 0) +
|
7598 | '-' + padStart(date.getUTCMonth() + 1, 2, 0) +
|
7599 | '-' + padStart(date.getUTCDate(), 2, 0) +
|
7600 | 'T' + padStart(date.getUTCHours(), 2, 0) +
|
7601 | ':' + padStart(date.getUTCMinutes(), 2, 0) +
|
7602 | ':' + padStart(date.getUTCSeconds(), 2, 0) +
|
7603 | '.' + padStart(milliseconds, 3, 0) +
|
7604 | 'Z';
|
7605 | } : nativeDateToISOString;
|
7606 |
|
7607 |
|
7608 | }),
|
7609 |
|
7610 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7611 |
|
7612 | var redefine = __webpack_require__(22);
|
7613 |
|
7614 | var DatePrototype = Date.prototype;
|
7615 | var INVALID_DATE = 'Invalid Date';
|
7616 | var TO_STRING = 'toString';
|
7617 | var nativeDateToString = DatePrototype[TO_STRING];
|
7618 | var getTime = DatePrototype.getTime;
|
7619 |
|
7620 |
|
7621 |
|
7622 | if (new Date(NaN) + '' != INVALID_DATE) {
|
7623 | redefine(DatePrototype, TO_STRING, function toString() {
|
7624 | var value = getTime.call(this);
|
7625 |
|
7626 | return value === value ? nativeDateToString.call(this) : INVALID_DATE;
|
7627 | });
|
7628 | }
|
7629 |
|
7630 |
|
7631 | }),
|
7632 |
|
7633 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7634 |
|
7635 | var createNonEnumerableProperty = __webpack_require__(19);
|
7636 | var dateToPrimitive = __webpack_require__(281);
|
7637 | var wellKnownSymbol = __webpack_require__(58);
|
7638 |
|
7639 | var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
7640 | var DatePrototype = Date.prototype;
|
7641 |
|
7642 |
|
7643 |
|
7644 | if (!(TO_PRIMITIVE in DatePrototype)) {
|
7645 | createNonEnumerableProperty(DatePrototype, TO_PRIMITIVE, dateToPrimitive);
|
7646 | }
|
7647 |
|
7648 |
|
7649 | }),
|
7650 |
|
7651 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
7652 |
|
7653 | "use strict";
|
7654 |
|
7655 | var anObject = __webpack_require__(21);
|
7656 | var toPrimitive = __webpack_require__(14);
|
7657 |
|
7658 | module.exports = function (hint) {
|
7659 | if (hint !== 'string' && hint !== 'number' && hint !== 'default') {
|
7660 | throw TypeError('Incorrect hint');
|
7661 | } return toPrimitive(anObject(this), hint !== 'number');
|
7662 | };
|
7663 |
|
7664 |
|
7665 | }),
|
7666 |
|
7667 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7668 |
|
7669 | var $ = __webpack_require__(3);
|
7670 | var getBuiltIn = __webpack_require__(35);
|
7671 | var fails = __webpack_require__(7);
|
7672 |
|
7673 | var $stringify = getBuiltIn('JSON', 'stringify');
|
7674 | var re = /[\uD800-\uDFFF]/g;
|
7675 | var low = /^[\uD800-\uDBFF]$/;
|
7676 | var hi = /^[\uDC00-\uDFFF]$/;
|
7677 |
|
7678 | var fix = function (match, offset, string) {
|
7679 | var prev = string.charAt(offset - 1);
|
7680 | var next = string.charAt(offset + 1);
|
7681 | if ((low.test(match) && !hi.test(next)) || (hi.test(match) && !low.test(prev))) {
|
7682 | return '\\u' + match.charCodeAt(0).toString(16);
|
7683 | } return match;
|
7684 | };
|
7685 |
|
7686 | var FORCED = fails(function () {
|
7687 | return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
|
7688 | || $stringify('\uDEAD') !== '"\\udead"';
|
7689 | });
|
7690 |
|
7691 | if ($stringify) {
|
7692 |
|
7693 |
|
7694 |
|
7695 | $({ target: 'JSON', stat: true, forced: FORCED }, {
|
7696 |
|
7697 | stringify: function stringify(it, replacer, space) {
|
7698 | var result = $stringify.apply(null, arguments);
|
7699 | return typeof result == 'string' ? result.replace(re, fix) : result;
|
7700 | }
|
7701 | });
|
7702 | }
|
7703 |
|
7704 |
|
7705 | }),
|
7706 |
|
7707 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7708 |
|
7709 | var global = __webpack_require__(4);
|
7710 | var setToStringTag = __webpack_require__(61);
|
7711 |
|
7712 |
|
7713 |
|
7714 | setToStringTag(global.JSON, 'JSON', true);
|
7715 |
|
7716 |
|
7717 | }),
|
7718 |
|
7719 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7720 |
|
7721 | "use strict";
|
7722 |
|
7723 | var $ = __webpack_require__(3);
|
7724 | var IS_PURE = __webpack_require__(30);
|
7725 | var global = __webpack_require__(4);
|
7726 | var getBuiltIn = __webpack_require__(35);
|
7727 | var NativePromise = __webpack_require__(285);
|
7728 | var redefine = __webpack_require__(22);
|
7729 | var redefineAll = __webpack_require__(286);
|
7730 | var setToStringTag = __webpack_require__(61);
|
7731 | var setSpecies = __webpack_require__(131);
|
7732 | var isObject = __webpack_require__(15);
|
7733 | var aFunction = __webpack_require__(64);
|
7734 | var anInstance = __webpack_require__(287);
|
7735 | var inspectSource = __webpack_require__(24);
|
7736 | var iterate = __webpack_require__(85);
|
7737 | var checkCorrectnessOfIteration = __webpack_require__(96);
|
7738 | var speciesConstructor = __webpack_require__(193);
|
7739 | var task = __webpack_require__(288).set;
|
7740 | var microtask = __webpack_require__(290);
|
7741 | var promiseResolve = __webpack_require__(292);
|
7742 | var hostReportErrors = __webpack_require__(294);
|
7743 | var newPromiseCapabilityModule = __webpack_require__(293);
|
7744 | var perform = __webpack_require__(295);
|
7745 | var InternalStateModule = __webpack_require__(26);
|
7746 | var isForced = __webpack_require__(45);
|
7747 | var wellKnownSymbol = __webpack_require__(58);
|
7748 | var IS_NODE = __webpack_require__(47);
|
7749 | var V8_VERSION = __webpack_require__(48);
|
7750 |
|
7751 | var SPECIES = wellKnownSymbol('species');
|
7752 | var PROMISE = 'Promise';
|
7753 | var getInternalState = InternalStateModule.get;
|
7754 | var setInternalState = InternalStateModule.set;
|
7755 | var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
|
7756 | var PromiseConstructor = NativePromise;
|
7757 | var TypeError = global.TypeError;
|
7758 | var document = global.document;
|
7759 | var process = global.process;
|
7760 | var $fetch = getBuiltIn('fetch');
|
7761 | var newPromiseCapability = newPromiseCapabilityModule.f;
|
7762 | var newGenericPromiseCapability = newPromiseCapability;
|
7763 | var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);
|
7764 | var NATIVE_REJECTION_EVENT = typeof PromiseRejectionEvent == 'function';
|
7765 | var UNHANDLED_REJECTION = 'unhandledrejection';
|
7766 | var REJECTION_HANDLED = 'rejectionhandled';
|
7767 | var PENDING = 0;
|
7768 | var FULFILLED = 1;
|
7769 | var REJECTED = 2;
|
7770 | var HANDLED = 1;
|
7771 | var UNHANDLED = 2;
|
7772 | var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
|
7773 |
|
7774 | var FORCED = isForced(PROMISE, function () {
|
7775 | var GLOBAL_CORE_JS_PROMISE = inspectSource(PromiseConstructor) !== String(PromiseConstructor);
|
7776 | if (!GLOBAL_CORE_JS_PROMISE) {
|
7777 |
|
7778 |
|
7779 |
|
7780 | if (V8_VERSION === 66) return true;
|
7781 |
|
7782 | if (!IS_NODE && !NATIVE_REJECTION_EVENT) return true;
|
7783 | }
|
7784 |
|
7785 | if (IS_PURE && !PromiseConstructor.prototype['finally']) return true;
|
7786 |
|
7787 |
|
7788 |
|
7789 | if (V8_VERSION >= 51 && /native code/.test(PromiseConstructor)) return false;
|
7790 |
|
7791 | var promise = PromiseConstructor.resolve(1);
|
7792 | var FakePromise = function (exec) {
|
7793 | exec(function () { }, function () { });
|
7794 | };
|
7795 | var constructor = promise.constructor = {};
|
7796 | constructor[SPECIES] = FakePromise;
|
7797 | return !(promise.then(function () { }) instanceof FakePromise);
|
7798 | });
|
7799 |
|
7800 | var INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {
|
7801 | PromiseConstructor.all(iterable)['catch'](function () { });
|
7802 | });
|
7803 |
|
7804 |
|
7805 | var isThenable = function (it) {
|
7806 | var then;
|
7807 | return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
|
7808 | };
|
7809 |
|
7810 | var notify = function (state, isReject) {
|
7811 | if (state.notified) return;
|
7812 | state.notified = true;
|
7813 | var chain = state.reactions;
|
7814 | microtask(function () {
|
7815 | var value = state.value;
|
7816 | var ok = state.state == FULFILLED;
|
7817 | var index = 0;
|
7818 |
|
7819 | while (chain.length > index) {
|
7820 | var reaction = chain[index++];
|
7821 | var handler = ok ? reaction.ok : reaction.fail;
|
7822 | var resolve = reaction.resolve;
|
7823 | var reject = reaction.reject;
|
7824 | var domain = reaction.domain;
|
7825 | var result, then, exited;
|
7826 | try {
|
7827 | if (handler) {
|
7828 | if (!ok) {
|
7829 | if (state.rejection === UNHANDLED) onHandleUnhandled(state);
|
7830 | state.rejection = HANDLED;
|
7831 | }
|
7832 | if (handler === true) result = value;
|
7833 | else {
|
7834 | if (domain) domain.enter();
|
7835 | result = handler(value);
|
7836 | if (domain) {
|
7837 | domain.exit();
|
7838 | exited = true;
|
7839 | }
|
7840 | }
|
7841 | if (result === reaction.promise) {
|
7842 | reject(TypeError('Promise-chain cycle'));
|
7843 | } else if (then = isThenable(result)) {
|
7844 | then.call(result, resolve, reject);
|
7845 | } else resolve(result);
|
7846 | } else reject(value);
|
7847 | } catch (error) {
|
7848 | if (domain && !exited) domain.exit();
|
7849 | reject(error);
|
7850 | }
|
7851 | }
|
7852 | state.reactions = [];
|
7853 | state.notified = false;
|
7854 | if (isReject && !state.rejection) onUnhandled(state);
|
7855 | });
|
7856 | };
|
7857 |
|
7858 | var dispatchEvent = function (name, promise, reason) {
|
7859 | var event, handler;
|
7860 | if (DISPATCH_EVENT) {
|
7861 | event = document.createEvent('Event');
|
7862 | event.promise = promise;
|
7863 | event.reason = reason;
|
7864 | event.initEvent(name, false, true);
|
7865 | global.dispatchEvent(event);
|
7866 | } else event = { promise: promise, reason: reason };
|
7867 | if (!NATIVE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);
|
7868 | else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
|
7869 | };
|
7870 |
|
7871 | var onUnhandled = function (state) {
|
7872 | task.call(global, function () {
|
7873 | var promise = state.facade;
|
7874 | var value = state.value;
|
7875 | var IS_UNHANDLED = isUnhandled(state);
|
7876 | var result;
|
7877 | if (IS_UNHANDLED) {
|
7878 | result = perform(function () {
|
7879 | if (IS_NODE) {
|
7880 | process.emit('unhandledRejection', value, promise);
|
7881 | } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
|
7882 | });
|
7883 |
|
7884 | state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
|
7885 | if (result.error) throw result.value;
|
7886 | }
|
7887 | });
|
7888 | };
|
7889 |
|
7890 | var isUnhandled = function (state) {
|
7891 | return state.rejection !== HANDLED && !state.parent;
|
7892 | };
|
7893 |
|
7894 | var onHandleUnhandled = function (state) {
|
7895 | task.call(global, function () {
|
7896 | var promise = state.facade;
|
7897 | if (IS_NODE) {
|
7898 | process.emit('rejectionHandled', promise);
|
7899 | } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
|
7900 | });
|
7901 | };
|
7902 |
|
7903 | var bind = function (fn, state, unwrap) {
|
7904 | return function (value) {
|
7905 | fn(state, value, unwrap);
|
7906 | };
|
7907 | };
|
7908 |
|
7909 | var internalReject = function (state, value, unwrap) {
|
7910 | if (state.done) return;
|
7911 | state.done = true;
|
7912 | if (unwrap) state = unwrap;
|
7913 | state.value = value;
|
7914 | state.state = REJECTED;
|
7915 | notify(state, true);
|
7916 | };
|
7917 |
|
7918 | var internalResolve = function (state, value, unwrap) {
|
7919 | if (state.done) return;
|
7920 | state.done = true;
|
7921 | if (unwrap) state = unwrap;
|
7922 | try {
|
7923 | if (state.facade === value) throw TypeError("Promise can't be resolved itself");
|
7924 | var then = isThenable(value);
|
7925 | if (then) {
|
7926 | microtask(function () {
|
7927 | var wrapper = { done: false };
|
7928 | try {
|
7929 | then.call(value,
|
7930 | bind(internalResolve, wrapper, state),
|
7931 | bind(internalReject, wrapper, state)
|
7932 | );
|
7933 | } catch (error) {
|
7934 | internalReject(wrapper, error, state);
|
7935 | }
|
7936 | });
|
7937 | } else {
|
7938 | state.value = value;
|
7939 | state.state = FULFILLED;
|
7940 | notify(state, false);
|
7941 | }
|
7942 | } catch (error) {
|
7943 | internalReject({ done: false }, error, state);
|
7944 | }
|
7945 | };
|
7946 |
|
7947 |
|
7948 | if (FORCED) {
|
7949 |
|
7950 | PromiseConstructor = function Promise(executor) {
|
7951 | anInstance(this, PromiseConstructor, PROMISE);
|
7952 | aFunction(executor);
|
7953 | Internal.call(this);
|
7954 | var state = getInternalState(this);
|
7955 | try {
|
7956 | executor(bind(internalResolve, state), bind(internalReject, state));
|
7957 | } catch (error) {
|
7958 | internalReject(state, error);
|
7959 | }
|
7960 | };
|
7961 |
|
7962 | Internal = function Promise(executor) {
|
7963 | setInternalState(this, {
|
7964 | type: PROMISE,
|
7965 | done: false,
|
7966 | notified: false,
|
7967 | parent: false,
|
7968 | reactions: [],
|
7969 | rejection: false,
|
7970 | state: PENDING,
|
7971 | value: undefined
|
7972 | });
|
7973 | };
|
7974 | Internal.prototype = redefineAll(PromiseConstructor.prototype, {
|
7975 |
|
7976 |
|
7977 | then: function then(onFulfilled, onRejected) {
|
7978 | var state = getInternalPromiseState(this);
|
7979 | var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
|
7980 | reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
|
7981 | reaction.fail = typeof onRejected == 'function' && onRejected;
|
7982 | reaction.domain = IS_NODE ? process.domain : undefined;
|
7983 | state.parent = true;
|
7984 | state.reactions.push(reaction);
|
7985 | if (state.state != PENDING) notify(state, false);
|
7986 | return reaction.promise;
|
7987 | },
|
7988 |
|
7989 |
|
7990 | 'catch': function (onRejected) {
|
7991 | return this.then(undefined, onRejected);
|
7992 | }
|
7993 | });
|
7994 | OwnPromiseCapability = function () {
|
7995 | var promise = new Internal();
|
7996 | var state = getInternalState(promise);
|
7997 | this.promise = promise;
|
7998 | this.resolve = bind(internalResolve, state);
|
7999 | this.reject = bind(internalReject, state);
|
8000 | };
|
8001 | newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
|
8002 | return C === PromiseConstructor || C === PromiseWrapper
|
8003 | ? new OwnPromiseCapability(C)
|
8004 | : newGenericPromiseCapability(C);
|
8005 | };
|
8006 |
|
8007 | if (!IS_PURE && typeof NativePromise == 'function') {
|
8008 | nativeThen = NativePromise.prototype.then;
|
8009 |
|
8010 |
|
8011 | redefine(NativePromise.prototype, 'then', function then(onFulfilled, onRejected) {
|
8012 | var that = this;
|
8013 | return new PromiseConstructor(function (resolve, reject) {
|
8014 | nativeThen.call(that, resolve, reject);
|
8015 | }).then(onFulfilled, onRejected);
|
8016 |
|
8017 | }, { unsafe: true });
|
8018 |
|
8019 |
|
8020 | if (typeof $fetch == 'function') $({ global: true, enumerable: true, forced: true }, {
|
8021 |
|
8022 | fetch: function fetch(input /* , init */) {
|
8023 | return promiseResolve(PromiseConstructor, $fetch.apply(global, arguments));
|
8024 | }
|
8025 | });
|
8026 | }
|
8027 | }
|
8028 |
|
8029 | $({ global: true, wrap: true, forced: FORCED }, {
|
8030 | Promise: PromiseConstructor
|
8031 | });
|
8032 |
|
8033 | setToStringTag(PromiseConstructor, PROMISE, false, true);
|
8034 | setSpecies(PROMISE);
|
8035 |
|
8036 | PromiseWrapper = getBuiltIn(PROMISE);
|
8037 |
|
8038 |
|
8039 | $({ target: PROMISE, stat: true, forced: FORCED }, {
|
8040 |
|
8041 |
|
8042 | reject: function reject(r) {
|
8043 | var capability = newPromiseCapability(this);
|
8044 | capability.reject.call(undefined, r);
|
8045 | return capability.promise;
|
8046 | }
|
8047 | });
|
8048 |
|
8049 | $({ target: PROMISE, stat: true, forced: IS_PURE || FORCED }, {
|
8050 |
|
8051 |
|
8052 | resolve: function resolve(x) {
|
8053 | return promiseResolve(IS_PURE && this === PromiseWrapper ? PromiseConstructor : this, x);
|
8054 | }
|
8055 | });
|
8056 |
|
8057 | $({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {
|
8058 |
|
8059 |
|
8060 | all: function all(iterable) {
|
8061 | var C = this;
|
8062 | var capability = newPromiseCapability(C);
|
8063 | var resolve = capability.resolve;
|
8064 | var reject = capability.reject;
|
8065 | var result = perform(function () {
|
8066 | var $promiseResolve = aFunction(C.resolve);
|
8067 | var values = [];
|
8068 | var counter = 0;
|
8069 | var remaining = 1;
|
8070 | iterate(iterable, function (promise) {
|
8071 | var index = counter++;
|
8072 | var alreadyCalled = false;
|
8073 | values.push(undefined);
|
8074 | remaining++;
|
8075 | $promiseResolve.call(C, promise).then(function (value) {
|
8076 | if (alreadyCalled) return;
|
8077 | alreadyCalled = true;
|
8078 | values[index] = value;
|
8079 | --remaining || resolve(values);
|
8080 | }, reject);
|
8081 | });
|
8082 | --remaining || resolve(values);
|
8083 | });
|
8084 | if (result.error) reject(result.value);
|
8085 | return capability.promise;
|
8086 | },
|
8087 |
|
8088 |
|
8089 | race: function race(iterable) {
|
8090 | var C = this;
|
8091 | var capability = newPromiseCapability(C);
|
8092 | var reject = capability.reject;
|
8093 | var result = perform(function () {
|
8094 | var $promiseResolve = aFunction(C.resolve);
|
8095 | iterate(iterable, function (promise) {
|
8096 | $promiseResolve.call(C, promise).then(capability.resolve, reject);
|
8097 | });
|
8098 | });
|
8099 | if (result.error) reject(result.value);
|
8100 | return capability.promise;
|
8101 | }
|
8102 | });
|
8103 |
|
8104 |
|
8105 | }),
|
8106 |
|
8107 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
8108 |
|
8109 | var global = __webpack_require__(4);
|
8110 |
|
8111 | module.exports = global.Promise;
|
8112 |
|
8113 |
|
8114 | }),
|
8115 |
|
8116 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
8117 |
|
8118 | var redefine = __webpack_require__(22);
|
8119 |
|
8120 | module.exports = function (target, src, options) {
|
8121 | for (var key in src) redefine(target, key, src[key], options);
|
8122 | return target;
|
8123 | };
|
8124 |
|
8125 |
|
8126 | }),
|
8127 |
|
8128 | (function(module) {
|
8129 |
|
8130 | module.exports = function (it, Constructor, name) {
|
8131 | if (!(it instanceof Constructor)) {
|
8132 | throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation');
|
8133 | } return it;
|
8134 | };
|
8135 |
|
8136 |
|
8137 | }),
|
8138 |
|
8139 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
8140 |
|
8141 | var global = __webpack_require__(4);
|
8142 | var fails = __webpack_require__(7);
|
8143 | var bind = __webpack_require__(63);
|
8144 | var html = __webpack_require__(56);
|
8145 | var createElement = __webpack_require__(18);
|
8146 | var IS_IOS = __webpack_require__(289);
|
8147 | var IS_NODE = __webpack_require__(47);
|
8148 |
|
8149 | var location = global.location;
|
8150 | var set = global.setImmediate;
|
8151 | var clear = global.clearImmediate;
|
8152 | var process = global.process;
|
8153 | var MessageChannel = global.MessageChannel;
|
8154 | var Dispatch = global.Dispatch;
|
8155 | var counter = 0;
|
8156 | var queue = {};
|
8157 | var ONREADYSTATECHANGE = 'onreadystatechange';
|
8158 | var defer, channel, port;
|
8159 |
|
8160 | var run = function (id) {
|
8161 |
|
8162 | if (queue.hasOwnProperty(id)) {
|
8163 | var fn = queue[id];
|
8164 | delete queue[id];
|
8165 | fn();
|
8166 | }
|
8167 | };
|
8168 |
|
8169 | var runner = function (id) {
|
8170 | return function () {
|
8171 | run(id);
|
8172 | };
|
8173 | };
|
8174 |
|
8175 | var listener = function (event) {
|
8176 | run(event.data);
|
8177 | };
|
8178 |
|
8179 | var post = function (id) {
|
8180 |
|
8181 | global.postMessage(id + '', location.protocol + '//' + location.host);
|
8182 | };
|
8183 |
|
8184 |
|
8185 | if (!set || !clear) {
|
8186 | set = function setImmediate(fn) {
|
8187 | var args = [];
|
8188 | var i = 1;
|
8189 | while (arguments.length > i) args.push(arguments[i++]);
|
8190 | queue[++counter] = function () {
|
8191 |
|
8192 | (typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args);
|
8193 | };
|
8194 | defer(counter);
|
8195 | return counter;
|
8196 | };
|
8197 | clear = function clearImmediate(id) {
|
8198 | delete queue[id];
|
8199 | };
|
8200 |
|
8201 | if (IS_NODE) {
|
8202 | defer = function (id) {
|
8203 | process.nextTick(runner(id));
|
8204 | };
|
8205 |
|
8206 | } else if (Dispatch && Dispatch.now) {
|
8207 | defer = function (id) {
|
8208 | Dispatch.now(runner(id));
|
8209 | };
|
8210 |
|
8211 |
|
8212 | } else if (MessageChannel && !IS_IOS) {
|
8213 | channel = new MessageChannel();
|
8214 | port = channel.port2;
|
8215 | channel.port1.onmessage = listener;
|
8216 | defer = bind(port.postMessage, port, 1);
|
8217 |
|
8218 |
|
8219 | } else if (
|
8220 | global.addEventListener &&
|
8221 | typeof postMessage == 'function' &&
|
8222 | !global.importScripts &&
|
8223 | location && location.protocol !== 'file:' &&
|
8224 | !fails(post)
|
8225 | ) {
|
8226 | defer = post;
|
8227 | global.addEventListener('message', listener, false);
|
8228 |
|
8229 | } else if (ONREADYSTATECHANGE in createElement('script')) {
|
8230 | defer = function (id) {
|
8231 | html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
|
8232 | html.removeChild(this);
|
8233 | run(id);
|
8234 | };
|
8235 | };
|
8236 |
|
8237 | } else {
|
8238 | defer = function (id) {
|
8239 | setTimeout(runner(id), 0);
|
8240 | };
|
8241 | }
|
8242 | }
|
8243 |
|
8244 | module.exports = {
|
8245 | set: set,
|
8246 | clear: clear
|
8247 | };
|
8248 |
|
8249 |
|
8250 | /***/ }),
|
8251 | /* 289 */
|
8252 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
8253 |
|
8254 | var userAgent = __webpack_require__(49);
|
8255 |
|
8256 | module.exports = /(iphone|ipod|ipad).*applewebkit/i.test(userAgent);
|
8257 |
|
8258 |
|
8259 | }),
|
8260 |
|
8261 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
8262 |
|
8263 | var global = __webpack_require__(4);
|
8264 | var getOwnPropertyDescriptor = __webpack_require__(5).f;
|
8265 | var macrotask = __webpack_require__(288).set;
|
8266 | var IS_IOS = __webpack_require__(289);
|
8267 | var IS_WEBOS_WEBKIT = __webpack_require__(291);
|
8268 | var IS_NODE = __webpack_require__(47);
|
8269 |
|
8270 | var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
|
8271 | var document = global.document;
|
8272 | var process = global.process;
|
8273 | var Promise = global.Promise;
|
8274 |
|
8275 | var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');
|
8276 | var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
|
8277 |
|
8278 | var flush, head, last, notify, toggle, node, promise, then;
|
8279 |
|
8280 |
|
8281 | if (!queueMicrotask) {
|
8282 | flush = function () {
|
8283 | var parent, fn;
|
8284 | if (IS_NODE && (parent = process.domain)) parent.exit();
|
8285 | while (head) {
|
8286 | fn = head.fn;
|
8287 | head = head.next;
|
8288 | try {
|
8289 | fn();
|
8290 | } catch (error) {
|
8291 | if (head) notify();
|
8292 | else last = undefined;
|
8293 | throw error;
|
8294 | }
|
8295 | } last = undefined;
|
8296 | if (parent) parent.enter();
|
8297 | };
|
8298 |
|
8299 |
|
8300 |
|
8301 | if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {
|
8302 | toggle = true;
|
8303 | node = document.createTextNode('');
|
8304 | new MutationObserver(flush).observe(node, { characterData: true });
|
8305 | notify = function () {
|
8306 | node.data = toggle = !toggle;
|
8307 | };
|
8308 |
|
8309 | } else if (Promise && Promise.resolve) {
|
8310 |
|
8311 | promise = Promise.resolve(undefined);
|
8312 | then = promise.then;
|
8313 | notify = function () {
|
8314 | then.call(promise, flush);
|
8315 | };
|
8316 |
|
8317 | } else if (IS_NODE) {
|
8318 | notify = function () {
|
8319 | process.nextTick(flush);
|
8320 | };
|
8321 |
|
8322 |
|
8323 |
|
8324 |
|
8325 |
|
8326 |
|
8327 | } else {
|
8328 | notify = function () {
|
8329 |
|
8330 | macrotask.call(global, flush);
|
8331 | };
|
8332 | }
|
8333 | }
|
8334 |
|
8335 | module.exports = queueMicrotask || function (fn) {
|
8336 | var task = { fn: fn, next: undefined };
|
8337 | if (last) last.next = task;
|
8338 | if (!head) {
|
8339 | head = task;
|
8340 | notify();
|
8341 | } last = task;
|
8342 | };
|
8343 |
|
8344 |
|
8345 | }),
|
8346 |
|
8347 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
8348 |
|
8349 | var userAgent = __webpack_require__(49);
|
8350 |
|
8351 | module.exports = /web0s(?!.*chrome)/i.test(userAgent);
|
8352 |
|
8353 |
|
8354 | }),
|
8355 |
|
8356 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
8357 |
|
8358 | var anObject = __webpack_require__(21);
|
8359 | var isObject = __webpack_require__(15);
|
8360 | var newPromiseCapability = __webpack_require__(293);
|
8361 |
|
8362 | module.exports = function (C, x) {
|
8363 | anObject(C);
|
8364 | if (isObject(x) && x.constructor === C) return x;
|
8365 | var promiseCapability = newPromiseCapability.f(C);
|
8366 | var resolve = promiseCapability.resolve;
|
8367 | resolve(x);
|
8368 | return promiseCapability.promise;
|
8369 | };
|
8370 |
|
8371 |
|
8372 | }),
|
8373 |
|
8374 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
8375 |
|
8376 | "use strict";
|
8377 |
|
8378 | var aFunction = __webpack_require__(64);
|
8379 |
|
8380 | var PromiseCapability = function (C) {
|
8381 | var resolve, reject;
|
8382 | this.promise = new C(function ($$resolve, $$reject) {
|
8383 | if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
|
8384 | resolve = $$resolve;
|
8385 | reject = $$reject;
|
8386 | });
|
8387 | this.resolve = aFunction(resolve);
|
8388 | this.reject = aFunction(reject);
|
8389 | };
|
8390 |
|
8391 |
|
8392 | module.exports.f = function (C) {
|
8393 | return new PromiseCapability(C);
|
8394 | };
|
8395 |
|
8396 |
|
8397 | }),
|
8398 |
|
8399 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
8400 |
|
8401 | var global = __webpack_require__(4);
|
8402 |
|
8403 | module.exports = function (a, b) {
|
8404 | var console = global.console;
|
8405 | if (console && console.error) {
|
8406 | arguments.length === 1 ? console.error(a) : console.error(a, b);
|
8407 | }
|
8408 | };
|
8409 |
|
8410 |
|
8411 | }),
|
8412 |
|
8413 | (function(module) {
|
8414 |
|
8415 | module.exports = function (exec) {
|
8416 | try {
|
8417 | return { error: false, value: exec() };
|
8418 | } catch (error) {
|
8419 | return { error: true, value: error };
|
8420 | }
|
8421 | };
|
8422 |
|
8423 |
|
8424 | }),
|
8425 |
|
8426 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
8427 |
|
8428 | "use strict";
|
8429 |
|
8430 | var $ = __webpack_require__(3);
|
8431 | var aFunction = __webpack_require__(64);
|
8432 | var newPromiseCapabilityModule = __webpack_require__(293);
|
8433 | var perform = __webpack_require__(295);
|
8434 | var iterate = __webpack_require__(85);
|
8435 |
|
8436 |
|
8437 |
|
8438 | $({ target: 'Promise', stat: true }, {
|
8439 | allSettled: function allSettled(iterable) {
|
8440 | var C = this;
|
8441 | var capability = newPromiseCapabilityModule.f(C);
|
8442 | var resolve = capability.resolve;
|
8443 | var reject = capability.reject;
|
8444 | var result = perform(function () {
|
8445 | var promiseResolve = aFunction(C.resolve);
|
8446 | var values = [];
|
8447 | var counter = 0;
|
8448 | var remaining = 1;
|
8449 | iterate(iterable, function (promise) {
|
8450 | var index = counter++;
|
8451 | var alreadyCalled = false;
|
8452 | values.push(undefined);
|
8453 | remaining++;
|
8454 | promiseResolve.call(C, promise).then(function (value) {
|
8455 | if (alreadyCalled) return;
|
8456 | alreadyCalled = true;
|
8457 | values[index] = { status: 'fulfilled', value: value };
|
8458 | --remaining || resolve(values);
|
8459 | }, function (error) {
|
8460 | if (alreadyCalled) return;
|
8461 | alreadyCalled = true;
|
8462 | values[index] = { status: 'rejected', reason: error };
|
8463 | --remaining || resolve(values);
|
8464 | });
|
8465 | });
|
8466 | --remaining || resolve(values);
|
8467 | });
|
8468 | if (result.error) reject(result.value);
|
8469 | return capability.promise;
|
8470 | }
|
8471 | });
|
8472 |
|
8473 |
|
8474 | }),
|
8475 |
|
8476 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
8477 |
|
8478 | "use strict";
|
8479 |
|
8480 | var $ = __webpack_require__(3);
|
8481 | var aFunction = __webpack_require__(64);
|
8482 | var getBuiltIn = __webpack_require__(35);
|
8483 | var newPromiseCapabilityModule = __webpack_require__(293);
|
8484 | var perform = __webpack_require__(295);
|
8485 | var iterate = __webpack_require__(85);
|
8486 |
|
8487 | var PROMISE_ANY_ERROR = 'No one promise resolved';
|
8488 |
|
8489 |
|
8490 |
|
8491 | $({ target: 'Promise', stat: true }, {
|
8492 | any: function any(iterable) {
|
8493 | var C = this;
|
8494 | var capability = newPromiseCapabilityModule.f(C);
|
8495 | var resolve = capability.resolve;
|
8496 | var reject = capability.reject;
|
8497 | var result = perform(function () {
|
8498 | var promiseResolve = aFunction(C.resolve);
|
8499 | var errors = [];
|
8500 | var counter = 0;
|
8501 | var remaining = 1;
|
8502 | var alreadyResolved = false;
|
8503 | iterate(iterable, function (promise) {
|
8504 | var index = counter++;
|
8505 | var alreadyRejected = false;
|
8506 | errors.push(undefined);
|
8507 | remaining++;
|
8508 | promiseResolve.call(C, promise).then(function (value) {
|
8509 | if (alreadyRejected || alreadyResolved) return;
|
8510 | alreadyResolved = true;
|
8511 | resolve(value);
|
8512 | }, function (error) {
|
8513 | if (alreadyRejected || alreadyResolved) return;
|
8514 | alreadyRejected = true;
|
8515 | errors[index] = error;
|
8516 | --remaining || reject(new (getBuiltIn('AggregateError'))(errors, PROMISE_ANY_ERROR));
|
8517 | });
|
8518 | });
|
8519 | --remaining || reject(new (getBuiltIn('AggregateError'))(errors, PROMISE_ANY_ERROR));
|
8520 | });
|
8521 | if (result.error) reject(result.value);
|
8522 | return capability.promise;
|
8523 | }
|
8524 | });
|
8525 |
|
8526 |
|
8527 | }),
|
8528 |
|
8529 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
8530 |
|
8531 | "use strict";
|
8532 |
|
8533 | var $ = __webpack_require__(3);
|
8534 | var IS_PURE = __webpack_require__(30);
|
8535 | var NativePromise = __webpack_require__(285);
|
8536 | var fails = __webpack_require__(7);
|
8537 | var getBuiltIn = __webpack_require__(35);
|
8538 | var speciesConstructor = __webpack_require__(193);
|
8539 | var promiseResolve = __webpack_require__(292);
|
8540 | var redefine = __webpack_require__(22);
|
8541 |
|
8542 |
|
8543 | var NON_GENERIC = !!NativePromise && fails(function () {
|
8544 | NativePromise.prototype['finally'].call({ then: function () { } }, function () { });
|
8545 | });
|
8546 |
|
8547 |
|
8548 |
|
8549 | $({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {
|
8550 | 'finally': function (onFinally) {
|
8551 | var C = speciesConstructor(this, getBuiltIn('Promise'));
|
8552 | var isFunction = typeof onFinally == 'function';
|
8553 | return this.then(
|
8554 | isFunction ? function (x) {
|
8555 | return promiseResolve(C, onFinally()).then(function () { return x; });
|
8556 | } : onFinally,
|
8557 | isFunction ? function (e) {
|
8558 | return promiseResolve(C, onFinally()).then(function () { throw e; });
|
8559 | } : onFinally
|
8560 | );
|
8561 | }
|
8562 | });
|
8563 |
|
8564 |
|
8565 | if (!IS_PURE && typeof NativePromise == 'function' && !NativePromise.prototype['finally']) {
|
8566 | redefine(NativePromise.prototype, 'finally', getBuiltIn('Promise').prototype['finally']);
|
8567 | }
|
8568 |
|
8569 |
|
8570 | }),
|
8571 |
|
8572 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
8573 |
|
8574 | "use strict";
|
8575 |
|
8576 | var collection = __webpack_require__(300);
|
8577 | var collectionStrong = __webpack_require__(301);
|
8578 |
|
8579 |
|
8580 |
|
8581 | module.exports = collection('Map', function (init) {
|
8582 | return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };
|
8583 | }, collectionStrong);
|
8584 |
|
8585 |
|
8586 | }),
|
8587 |
|
8588 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
8589 |
|
8590 | "use strict";
|
8591 |
|
8592 | var $ = __webpack_require__(3);
|
8593 | var global = __webpack_require__(4);
|
8594 | var isForced = __webpack_require__(45);
|
8595 | var redefine = __webpack_require__(22);
|
8596 | var InternalMetadataModule = __webpack_require__(152);
|
8597 | var iterate = __webpack_require__(85);
|
8598 | var anInstance = __webpack_require__(287);
|
8599 | var isObject = __webpack_require__(15);
|
8600 | var fails = __webpack_require__(7);
|
8601 | var checkCorrectnessOfIteration = __webpack_require__(96);
|
8602 | var setToStringTag = __webpack_require__(61);
|
8603 | var inheritIfRequired = __webpack_require__(229);
|
8604 |
|
8605 | module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
|
8606 | var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
|
8607 | var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
|
8608 | var ADDER = IS_MAP ? 'set' : 'add';
|
8609 | var NativeConstructor = global[CONSTRUCTOR_NAME];
|
8610 | var NativePrototype = NativeConstructor && NativeConstructor.prototype;
|
8611 | var Constructor = NativeConstructor;
|
8612 | var exported = {};
|
8613 |
|
8614 | var fixMethod = function (KEY) {
|
8615 | var nativeMethod = NativePrototype[KEY];
|
8616 | redefine(NativePrototype, KEY,
|
8617 | KEY == 'add' ? function add(value) {
|
8618 | nativeMethod.call(this, value === 0 ? 0 : value);
|
8619 | return this;
|
8620 | } : KEY == 'delete' ? function (key) {
|
8621 | return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
|
8622 | } : KEY == 'get' ? function get(key) {
|
8623 | return IS_WEAK && !isObject(key) ? undefined : nativeMethod.call(this, key === 0 ? 0 : key);
|
8624 | } : KEY == 'has' ? function has(key) {
|
8625 | return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key);
|
8626 | } : function set(key, value) {
|
8627 | nativeMethod.call(this, key === 0 ? 0 : key, value);
|
8628 | return this;
|
8629 | }
|
8630 | );
|
8631 | };
|
8632 |
|
8633 | var REPLACE = isForced(
|
8634 | CONSTRUCTOR_NAME,
|
8635 | typeof NativeConstructor != 'function' || !(IS_WEAK || NativePrototype.forEach && !fails(function () {
|
8636 | new NativeConstructor().entries().next();
|
8637 | }))
|
8638 | );
|
8639 |
|
8640 | if (REPLACE) {
|
8641 |
|
8642 | Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
|
8643 | InternalMetadataModule.REQUIRED = true;
|
8644 | } else if (isForced(CONSTRUCTOR_NAME, true)) {
|
8645 | var instance = new Constructor();
|
8646 |
|
8647 | var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
|
8648 |
|
8649 | var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
|
8650 |
|
8651 |
|
8652 | var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); });
|
8653 |
|
8654 | var BUGGY_ZERO = !IS_WEAK && fails(function () {
|
8655 |
|
8656 | var $instance = new NativeConstructor();
|
8657 | var index = 5;
|
8658 | while (index--) $instance[ADDER](index, index);
|
8659 | return !$instance.has(-0);
|
8660 | });
|
8661 |
|
8662 | if (!ACCEPT_ITERABLES) {
|
8663 | Constructor = wrapper(function (dummy, iterable) {
|
8664 | anInstance(dummy, Constructor, CONSTRUCTOR_NAME);
|
8665 | var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
|
8666 | if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
|
8667 | return that;
|
8668 | });
|
8669 | Constructor.prototype = NativePrototype;
|
8670 | NativePrototype.constructor = Constructor;
|
8671 | }
|
8672 |
|
8673 | if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
|
8674 | fixMethod('delete');
|
8675 | fixMethod('has');
|
8676 | IS_MAP && fixMethod('get');
|
8677 | }
|
8678 |
|
8679 | if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
|
8680 |
|
8681 |
|
8682 | if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear;
|
8683 | }
|
8684 |
|
8685 | exported[CONSTRUCTOR_NAME] = Constructor;
|
8686 | $({ global: true, forced: Constructor != NativeConstructor }, exported);
|
8687 |
|
8688 | setToStringTag(Constructor, CONSTRUCTOR_NAME);
|
8689 |
|
8690 | if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
|
8691 |
|
8692 | return Constructor;
|
8693 | };
|
8694 |
|
8695 |
|
8696 | }),
|
8697 |
|
8698 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
8699 |
|
8700 | "use strict";
|
8701 |
|
8702 | var defineProperty = __webpack_require__(20).f;
|
8703 | var create = __webpack_require__(53);
|
8704 | var redefineAll = __webpack_require__(286);
|
8705 | var bind = __webpack_require__(63);
|
8706 | var anInstance = __webpack_require__(287);
|
8707 | var iterate = __webpack_require__(85);
|
8708 | var defineIterator = __webpack_require__(135);
|
8709 | var setSpecies = __webpack_require__(131);
|
8710 | var DESCRIPTORS = __webpack_require__(6);
|
8711 | var fastKey = __webpack_require__(152).fastKey;
|
8712 | var InternalStateModule = __webpack_require__(26);
|
8713 |
|
8714 | var setInternalState = InternalStateModule.set;
|
8715 | var internalStateGetterFor = InternalStateModule.getterFor;
|
8716 |
|
8717 | module.exports = {
|
8718 | getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
|
8719 | var C = wrapper(function (that, iterable) {
|
8720 | anInstance(that, C, CONSTRUCTOR_NAME);
|
8721 | setInternalState(that, {
|
8722 | type: CONSTRUCTOR_NAME,
|
8723 | index: create(null),
|
8724 | first: undefined,
|
8725 | last: undefined,
|
8726 | size: 0
|
8727 | });
|
8728 | if (!DESCRIPTORS) that.size = 0;
|
8729 | if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
|
8730 | });
|
8731 |
|
8732 | var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
8733 |
|
8734 | var define = function (that, key, value) {
|
8735 | var state = getInternalState(that);
|
8736 | var entry = getEntry(that, key);
|
8737 | var previous, index;
|
8738 |
|
8739 | if (entry) {
|
8740 | entry.value = value;
|
8741 |
|
8742 | } else {
|
8743 | state.last = entry = {
|
8744 | index: index = fastKey(key, true),
|
8745 | key: key,
|
8746 | value: value,
|
8747 | previous: previous = state.last,
|
8748 | next: undefined,
|
8749 | removed: false
|
8750 | };
|
8751 | if (!state.first) state.first = entry;
|
8752 | if (previous) previous.next = entry;
|
8753 | if (DESCRIPTORS) state.size++;
|
8754 | else that.size++;
|
8755 |
|
8756 | if (index !== 'F') state.index[index] = entry;
|
8757 | } return that;
|
8758 | };
|
8759 |
|
8760 | var getEntry = function (that, key) {
|
8761 | var state = getInternalState(that);
|
8762 |
|
8763 | var index = fastKey(key);
|
8764 | var entry;
|
8765 | if (index !== 'F') return state.index[index];
|
8766 |
|
8767 | for (entry = state.first; entry; entry = entry.next) {
|
8768 | if (entry.key == key) return entry;
|
8769 | }
|
8770 | };
|
8771 |
|
8772 | redefineAll(C.prototype, {
|
8773 |
|
8774 |
|
8775 | clear: function clear() {
|
8776 | var that = this;
|
8777 | var state = getInternalState(that);
|
8778 | var data = state.index;
|
8779 | var entry = state.first;
|
8780 | while (entry) {
|
8781 | entry.removed = true;
|
8782 | if (entry.previous) entry.previous = entry.previous.next = undefined;
|
8783 | delete data[entry.index];
|
8784 | entry = entry.next;
|
8785 | }
|
8786 | state.first = state.last = undefined;
|
8787 | if (DESCRIPTORS) state.size = 0;
|
8788 | else that.size = 0;
|
8789 | },
|
8790 |
|
8791 |
|
8792 | 'delete': function (key) {
|
8793 | var that = this;
|
8794 | var state = getInternalState(that);
|
8795 | var entry = getEntry(that, key);
|
8796 | if (entry) {
|
8797 | var next = entry.next;
|
8798 | var prev = entry.previous;
|
8799 | delete state.index[entry.index];
|
8800 | entry.removed = true;
|
8801 | if (prev) prev.next = next;
|
8802 | if (next) next.previous = prev;
|
8803 | if (state.first == entry) state.first = next;
|
8804 | if (state.last == entry) state.last = prev;
|
8805 | if (DESCRIPTORS) state.size--;
|
8806 | else that.size--;
|
8807 | } return !!entry;
|
8808 | },
|
8809 |
|
8810 |
|
8811 | forEach: function forEach(callbackfn /* , that = undefined */) {
|
8812 | var state = getInternalState(this);
|
8813 | var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
|
8814 | var entry;
|
8815 | while (entry = entry ? entry.next : state.first) {
|
8816 | boundFunction(entry.value, entry.key, this);
|
8817 |
|
8818 | while (entry && entry.removed) entry = entry.previous;
|
8819 | }
|
8820 | },
|
8821 |
|
8822 |
|
8823 | has: function has(key) {
|
8824 | return !!getEntry(this, key);
|
8825 | }
|
8826 | });
|
8827 |
|
8828 | redefineAll(C.prototype, IS_MAP ? {
|
8829 |
|
8830 | get: function get(key) {
|
8831 | var entry = getEntry(this, key);
|
8832 | return entry && entry.value;
|
8833 | },
|
8834 |
|
8835 | set: function set(key, value) {
|
8836 | return define(this, key === 0 ? 0 : key, value);
|
8837 | }
|
8838 | } : {
|
8839 |
|
8840 | add: function add(value) {
|
8841 | return define(this, value = value === 0 ? 0 : value, value);
|
8842 | }
|
8843 | });
|
8844 | if (DESCRIPTORS) defineProperty(C.prototype, 'size', {
|
8845 | get: function () {
|
8846 | return getInternalState(this).size;
|
8847 | }
|
8848 | });
|
8849 | return C;
|
8850 | },
|
8851 | setStrong: function (C, CONSTRUCTOR_NAME, IS_MAP) {
|
8852 | var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
|
8853 | var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
8854 | var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
|
8855 |
|
8856 |
|
8857 | defineIterator(C, CONSTRUCTOR_NAME, function (iterated, kind) {
|
8858 | setInternalState(this, {
|
8859 | type: ITERATOR_NAME,
|
8860 | target: iterated,
|
8861 | state: getInternalCollectionState(iterated),
|
8862 | kind: kind,
|
8863 | last: undefined
|
8864 | });
|
8865 | }, function () {
|
8866 | var state = getInternalIteratorState(this);
|
8867 | var kind = state.kind;
|
8868 | var entry = state.last;
|
8869 |
|
8870 | while (entry && entry.removed) entry = entry.previous;
|
8871 |
|
8872 | if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
|
8873 |
|
8874 | state.target = undefined;
|
8875 | return { value: undefined, done: true };
|
8876 | }
|
8877 |
|
8878 | if (kind == 'keys') return { value: entry.key, done: false };
|
8879 | if (kind == 'values') return { value: entry.value, done: false };
|
8880 | return { value: [entry.key, entry.value], done: false };
|
8881 | }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
|
8882 |
|
8883 |
|
8884 | setSpecies(CONSTRUCTOR_NAME);
|
8885 | }
|
8886 | };
|
8887 |
|
8888 |
|
8889 | }),
|
8890 |
|
8891 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
8892 |
|
8893 | "use strict";
|
8894 |
|
8895 | var collection = __webpack_require__(300);
|
8896 | var collectionStrong = __webpack_require__(301);
|
8897 |
|
8898 |
|
8899 |
|
8900 | module.exports = collection('Set', function (init) {
|
8901 | return function Set() { return init(this, arguments.length ? arguments[0] : undefined); };
|
8902 | }, collectionStrong);
|
8903 |
|
8904 |
|
8905 | }),
|
8906 |
|
8907 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
8908 |
|
8909 | "use strict";
|
8910 |
|
8911 | var global = __webpack_require__(4);
|
8912 | var redefineAll = __webpack_require__(286);
|
8913 | var InternalMetadataModule = __webpack_require__(152);
|
8914 | var collection = __webpack_require__(300);
|
8915 | var collectionWeak = __webpack_require__(304);
|
8916 | var isObject = __webpack_require__(15);
|
8917 | var enforceIternalState = __webpack_require__(26).enforce;
|
8918 | var NATIVE_WEAK_MAP = __webpack_require__(27);
|
8919 |
|
8920 | var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;
|
8921 | var isExtensible = Object.isExtensible;
|
8922 | var InternalWeakMap;
|
8923 |
|
8924 | var wrapper = function (init) {
|
8925 | return function WeakMap() {
|
8926 | return init(this, arguments.length ? arguments[0] : undefined);
|
8927 | };
|
8928 | };
|
8929 |
|
8930 |
|
8931 |
|
8932 | var $WeakMap = module.exports = collection('WeakMap', wrapper, collectionWeak);
|
8933 |
|
8934 |
|
8935 |
|
8936 |
|
8937 | if (NATIVE_WEAK_MAP && IS_IE11) {
|
8938 | InternalWeakMap = collectionWeak.getConstructor(wrapper, 'WeakMap', true);
|
8939 | InternalMetadataModule.REQUIRED = true;
|
8940 | var WeakMapPrototype = $WeakMap.prototype;
|
8941 | var nativeDelete = WeakMapPrototype['delete'];
|
8942 | var nativeHas = WeakMapPrototype.has;
|
8943 | var nativeGet = WeakMapPrototype.get;
|
8944 | var nativeSet = WeakMapPrototype.set;
|
8945 | redefineAll(WeakMapPrototype, {
|
8946 | 'delete': function (key) {
|
8947 | if (isObject(key) && !isExtensible(key)) {
|
8948 | var state = enforceIternalState(this);
|
8949 | if (!state.frozen) state.frozen = new InternalWeakMap();
|
8950 | return nativeDelete.call(this, key) || state.frozen['delete'](key);
|
8951 | } return nativeDelete.call(this, key);
|
8952 | },
|
8953 | has: function has(key) {
|
8954 | if (isObject(key) && !isExtensible(key)) {
|
8955 | var state = enforceIternalState(this);
|
8956 | if (!state.frozen) state.frozen = new InternalWeakMap();
|
8957 | return nativeHas.call(this, key) || state.frozen.has(key);
|
8958 | } return nativeHas.call(this, key);
|
8959 | },
|
8960 | get: function get(key) {
|
8961 | if (isObject(key) && !isExtensible(key)) {
|
8962 | var state = enforceIternalState(this);
|
8963 | if (!state.frozen) state.frozen = new InternalWeakMap();
|
8964 | return nativeHas.call(this, key) ? nativeGet.call(this, key) : state.frozen.get(key);
|
8965 | } return nativeGet.call(this, key);
|
8966 | },
|
8967 | set: function set(key, value) {
|
8968 | if (isObject(key) && !isExtensible(key)) {
|
8969 | var state = enforceIternalState(this);
|
8970 | if (!state.frozen) state.frozen = new InternalWeakMap();
|
8971 | nativeHas.call(this, key) ? nativeSet.call(this, key, value) : state.frozen.set(key, value);
|
8972 | } else nativeSet.call(this, key, value);
|
8973 | return this;
|
8974 | }
|
8975 | });
|
8976 | }
|
8977 |
|
8978 |
|
8979 | }),
|
8980 |
|
8981 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
8982 |
|
8983 | "use strict";
|
8984 |
|
8985 | var redefineAll = __webpack_require__(286);
|
8986 | var getWeakData = __webpack_require__(152).getWeakData;
|
8987 | var anObject = __webpack_require__(21);
|
8988 | var isObject = __webpack_require__(15);
|
8989 | var anInstance = __webpack_require__(287);
|
8990 | var iterate = __webpack_require__(85);
|
8991 | var ArrayIterationModule = __webpack_require__(62);
|
8992 | var $has = __webpack_require__(16);
|
8993 | var InternalStateModule = __webpack_require__(26);
|
8994 |
|
8995 | var setInternalState = InternalStateModule.set;
|
8996 | var internalStateGetterFor = InternalStateModule.getterFor;
|
8997 | var find = ArrayIterationModule.find;
|
8998 | var findIndex = ArrayIterationModule.findIndex;
|
8999 | var id = 0;
|
9000 |
|
9001 |
|
9002 | var uncaughtFrozenStore = function (store) {
|
9003 | return store.frozen || (store.frozen = new UncaughtFrozenStore());
|
9004 | };
|
9005 |
|
9006 | var UncaughtFrozenStore = function () {
|
9007 | this.entries = [];
|
9008 | };
|
9009 |
|
9010 | var findUncaughtFrozen = function (store, key) {
|
9011 | return find(store.entries, function (it) {
|
9012 | return it[0] === key;
|
9013 | });
|
9014 | };
|
9015 |
|
9016 | UncaughtFrozenStore.prototype = {
|
9017 | get: function (key) {
|
9018 | var entry = findUncaughtFrozen(this, key);
|
9019 | if (entry) return entry[1];
|
9020 | },
|
9021 | has: function (key) {
|
9022 | return !!findUncaughtFrozen(this, key);
|
9023 | },
|
9024 | set: function (key, value) {
|
9025 | var entry = findUncaughtFrozen(this, key);
|
9026 | if (entry) entry[1] = value;
|
9027 | else this.entries.push([key, value]);
|
9028 | },
|
9029 | 'delete': function (key) {
|
9030 | var index = findIndex(this.entries, function (it) {
|
9031 | return it[0] === key;
|
9032 | });
|
9033 | if (~index) this.entries.splice(index, 1);
|
9034 | return !!~index;
|
9035 | }
|
9036 | };
|
9037 |
|
9038 | module.exports = {
|
9039 | getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
|
9040 | var C = wrapper(function (that, iterable) {
|
9041 | anInstance(that, C, CONSTRUCTOR_NAME);
|
9042 | setInternalState(that, {
|
9043 | type: CONSTRUCTOR_NAME,
|
9044 | id: id++,
|
9045 | frozen: undefined
|
9046 | });
|
9047 | if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
|
9048 | });
|
9049 |
|
9050 | var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
9051 |
|
9052 | var define = function (that, key, value) {
|
9053 | var state = getInternalState(that);
|
9054 | var data = getWeakData(anObject(key), true);
|
9055 | if (data === true) uncaughtFrozenStore(state).set(key, value);
|
9056 | else data[state.id] = value;
|
9057 | return that;
|
9058 | };
|
9059 |
|
9060 | redefineAll(C.prototype, {
|
9061 |
|
9062 |
|
9063 | 'delete': function (key) {
|
9064 | var state = getInternalState(this);
|
9065 | if (!isObject(key)) return false;
|
9066 | var data = getWeakData(key);
|
9067 | if (data === true) return uncaughtFrozenStore(state)['delete'](key);
|
9068 | return data && $has(data, state.id) && delete data[state.id];
|
9069 | },
|
9070 |
|
9071 |
|
9072 | has: function has(key) {
|
9073 | var state = getInternalState(this);
|
9074 | if (!isObject(key)) return false;
|
9075 | var data = getWeakData(key);
|
9076 | if (data === true) return uncaughtFrozenStore(state).has(key);
|
9077 | return data && $has(data, state.id);
|
9078 | }
|
9079 | });
|
9080 |
|
9081 | redefineAll(C.prototype, IS_MAP ? {
|
9082 |
|
9083 | get: function get(key) {
|
9084 | var state = getInternalState(this);
|
9085 | if (isObject(key)) {
|
9086 | var data = getWeakData(key);
|
9087 | if (data === true) return uncaughtFrozenStore(state).get(key);
|
9088 | return data ? data[state.id] : undefined;
|
9089 | }
|
9090 | },
|
9091 |
|
9092 | set: function set(key, value) {
|
9093 | return define(this, key, value);
|
9094 | }
|
9095 | } : {
|
9096 |
|
9097 | add: function add(value) {
|
9098 | return define(this, value, true);
|
9099 | }
|
9100 | });
|
9101 |
|
9102 | return C;
|
9103 | }
|
9104 | };
|
9105 |
|
9106 |
|
9107 | }),
|
9108 |
|
9109 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9110 |
|
9111 | "use strict";
|
9112 |
|
9113 | var collection = __webpack_require__(300);
|
9114 | var collectionWeak = __webpack_require__(304);
|
9115 |
|
9116 |
|
9117 |
|
9118 | collection('WeakSet', function (init) {
|
9119 | return function WeakSet() { return init(this, arguments.length ? arguments[0] : undefined); };
|
9120 | }, collectionWeak);
|
9121 |
|
9122 |
|
9123 | }),
|
9124 |
|
9125 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9126 |
|
9127 | "use strict";
|
9128 |
|
9129 | var $ = __webpack_require__(3);
|
9130 | var global = __webpack_require__(4);
|
9131 | var arrayBufferModule = __webpack_require__(307);
|
9132 | var setSpecies = __webpack_require__(131);
|
9133 |
|
9134 | var ARRAY_BUFFER = 'ArrayBuffer';
|
9135 | var ArrayBuffer = arrayBufferModule[ARRAY_BUFFER];
|
9136 | var NativeArrayBuffer = global[ARRAY_BUFFER];
|
9137 |
|
9138 |
|
9139 |
|
9140 | $({ global: true, forced: NativeArrayBuffer !== ArrayBuffer }, {
|
9141 | ArrayBuffer: ArrayBuffer
|
9142 | });
|
9143 |
|
9144 | setSpecies(ARRAY_BUFFER);
|
9145 |
|
9146 |
|
9147 | }),
|
9148 |
|
9149 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
9150 |
|
9151 | "use strict";
|
9152 |
|
9153 | var global = __webpack_require__(4);
|
9154 | var DESCRIPTORS = __webpack_require__(6);
|
9155 | var NATIVE_ARRAY_BUFFER = __webpack_require__(308);
|
9156 | var createNonEnumerableProperty = __webpack_require__(19);
|
9157 | var redefineAll = __webpack_require__(286);
|
9158 | var fails = __webpack_require__(7);
|
9159 | var anInstance = __webpack_require__(287);
|
9160 | var toInteger = __webpack_require__(41);
|
9161 | var toLength = __webpack_require__(40);
|
9162 | var toIndex = __webpack_require__(309);
|
9163 | var IEEE754 = __webpack_require__(310);
|
9164 | var getPrototypeOf = __webpack_require__(81);
|
9165 | var setPrototypeOf = __webpack_require__(83);
|
9166 | var getOwnPropertyNames = __webpack_require__(37).f;
|
9167 | var defineProperty = __webpack_require__(20).f;
|
9168 | var arrayFill = __webpack_require__(107);
|
9169 | var setToStringTag = __webpack_require__(61);
|
9170 | var InternalStateModule = __webpack_require__(26);
|
9171 |
|
9172 | var getInternalState = InternalStateModule.get;
|
9173 | var setInternalState = InternalStateModule.set;
|
9174 | var ARRAY_BUFFER = 'ArrayBuffer';
|
9175 | var DATA_VIEW = 'DataView';
|
9176 | var PROTOTYPE = 'prototype';
|
9177 | var WRONG_LENGTH = 'Wrong length';
|
9178 | var WRONG_INDEX = 'Wrong index';
|
9179 | var NativeArrayBuffer = global[ARRAY_BUFFER];
|
9180 | var $ArrayBuffer = NativeArrayBuffer;
|
9181 | var $DataView = global[DATA_VIEW];
|
9182 | var $DataViewPrototype = $DataView && $DataView[PROTOTYPE];
|
9183 | var ObjectPrototype = Object.prototype;
|
9184 | var RangeError = global.RangeError;
|
9185 |
|
9186 | var packIEEE754 = IEEE754.pack;
|
9187 | var unpackIEEE754 = IEEE754.unpack;
|
9188 |
|
9189 | var packInt8 = function (number) {
|
9190 | return [number & 0xFF];
|
9191 | };
|
9192 |
|
9193 | var packInt16 = function (number) {
|
9194 | return [number & 0xFF, number >> 8 & 0xFF];
|
9195 | };
|
9196 |
|
9197 | var packInt32 = function (number) {
|
9198 | return [number & 0xFF, number >> 8 & 0xFF, number >> 16 & 0xFF, number >> 24 & 0xFF];
|
9199 | };
|
9200 |
|
9201 | var unpackInt32 = function (buffer) {
|
9202 | return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0];
|
9203 | };
|
9204 |
|
9205 | var packFloat32 = function (number) {
|
9206 | return packIEEE754(number, 23, 4);
|
9207 | };
|
9208 |
|
9209 | var packFloat64 = function (number) {
|
9210 | return packIEEE754(number, 52, 8);
|
9211 | };
|
9212 |
|
9213 | var addGetter = function (Constructor, key) {
|
9214 | defineProperty(Constructor[PROTOTYPE], key, { get: function () { return getInternalState(this)[key]; } });
|
9215 | };
|
9216 |
|
9217 | var get = function (view, count, index, isLittleEndian) {
|
9218 | var intIndex = toIndex(index);
|
9219 | var store = getInternalState(view);
|
9220 | if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX);
|
9221 | var bytes = getInternalState(store.buffer).bytes;
|
9222 | var start = intIndex + store.byteOffset;
|
9223 | var pack = bytes.slice(start, start + count);
|
9224 | return isLittleEndian ? pack : pack.reverse();
|
9225 | };
|
9226 |
|
9227 | var set = function (view, count, index, conversion, value, isLittleEndian) {
|
9228 | var intIndex = toIndex(index);
|
9229 | var store = getInternalState(view);
|
9230 | if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX);
|
9231 | var bytes = getInternalState(store.buffer).bytes;
|
9232 | var start = intIndex + store.byteOffset;
|
9233 | var pack = conversion(+value);
|
9234 | for (var i = 0; i < count; i++) bytes[start + i] = pack[isLittleEndian ? i : count - i - 1];
|
9235 | };
|
9236 |
|
9237 | if (!NATIVE_ARRAY_BUFFER) {
|
9238 | $ArrayBuffer = function ArrayBuffer(length) {
|
9239 | anInstance(this, $ArrayBuffer, ARRAY_BUFFER);
|
9240 | var byteLength = toIndex(length);
|
9241 | setInternalState(this, {
|
9242 | bytes: arrayFill.call(new Array(byteLength), 0),
|
9243 | byteLength: byteLength
|
9244 | });
|
9245 | if (!DESCRIPTORS) this.byteLength = byteLength;
|
9246 | };
|
9247 |
|
9248 | $DataView = function DataView(buffer, byteOffset, byteLength) {
|
9249 | anInstance(this, $DataView, DATA_VIEW);
|
9250 | anInstance(buffer, $ArrayBuffer, DATA_VIEW);
|
9251 | var bufferLength = getInternalState(buffer).byteLength;
|
9252 | var offset = toInteger(byteOffset);
|
9253 | if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset');
|
9254 | byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);
|
9255 | if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);
|
9256 | setInternalState(this, {
|
9257 | buffer: buffer,
|
9258 | byteLength: byteLength,
|
9259 | byteOffset: offset
|
9260 | });
|
9261 | if (!DESCRIPTORS) {
|
9262 | this.buffer = buffer;
|
9263 | this.byteLength = byteLength;
|
9264 | this.byteOffset = offset;
|
9265 | }
|
9266 | };
|
9267 |
|
9268 | if (DESCRIPTORS) {
|
9269 | addGetter($ArrayBuffer, 'byteLength');
|
9270 | addGetter($DataView, 'buffer');
|
9271 | addGetter($DataView, 'byteLength');
|
9272 | addGetter($DataView, 'byteOffset');
|
9273 | }
|
9274 |
|
9275 | redefineAll($DataView[PROTOTYPE], {
|
9276 | getInt8: function getInt8(byteOffset) {
|
9277 | return get(this, 1, byteOffset)[0] << 24 >> 24;
|
9278 | },
|
9279 | getUint8: function getUint8(byteOffset) {
|
9280 | return get(this, 1, byteOffset)[0];
|
9281 | },
|
9282 | getInt16: function getInt16(byteOffset /* , littleEndian */) {
|
9283 | var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined);
|
9284 | return (bytes[1] << 8 | bytes[0]) << 16 >> 16;
|
9285 | },
|
9286 | getUint16: function getUint16(byteOffset /* , littleEndian */) {
|
9287 | var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined);
|
9288 | return bytes[1] << 8 | bytes[0];
|
9289 | },
|
9290 | getInt32: function getInt32(byteOffset /* , littleEndian */) {
|
9291 | return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined));
|
9292 | },
|
9293 | getUint32: function getUint32(byteOffset /* , littleEndian */) {
|
9294 | return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)) >>> 0;
|
9295 | },
|
9296 | getFloat32: function getFloat32(byteOffset /* , littleEndian */) {
|
9297 | return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 23);
|
9298 | },
|
9299 | getFloat64: function getFloat64(byteOffset /* , littleEndian */) {
|
9300 | return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 52);
|
9301 | },
|
9302 | setInt8: function setInt8(byteOffset, value) {
|
9303 | set(this, 1, byteOffset, packInt8, value);
|
9304 | },
|
9305 | setUint8: function setUint8(byteOffset, value) {
|
9306 | set(this, 1, byteOffset, packInt8, value);
|
9307 | },
|
9308 | setInt16: function setInt16(byteOffset, value /* , littleEndian */) {
|
9309 | set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined);
|
9310 | },
|
9311 | setUint16: function setUint16(byteOffset, value /* , littleEndian */) {
|
9312 | set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined);
|
9313 | },
|
9314 | setInt32: function setInt32(byteOffset, value /* , littleEndian */) {
|
9315 | set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined);
|
9316 | },
|
9317 | setUint32: function setUint32(byteOffset, value /* , littleEndian */) {
|
9318 | set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined);
|
9319 | },
|
9320 | setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {
|
9321 | set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : undefined);
|
9322 | },
|
9323 | setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {
|
9324 | set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : undefined);
|
9325 | }
|
9326 | });
|
9327 | } else {
|
9328 |
|
9329 | if (!fails(function () {
|
9330 | NativeArrayBuffer(1);
|
9331 | }) || !fails(function () {
|
9332 | new NativeArrayBuffer(-1);
|
9333 | }) || fails(function () {
|
9334 | new NativeArrayBuffer();
|
9335 | new NativeArrayBuffer(1.5);
|
9336 | new NativeArrayBuffer(NaN);
|
9337 | return NativeArrayBuffer.name != ARRAY_BUFFER;
|
9338 | })) {
|
9339 |
|
9340 | $ArrayBuffer = function ArrayBuffer(length) {
|
9341 | anInstance(this, $ArrayBuffer);
|
9342 | return new NativeArrayBuffer(toIndex(length));
|
9343 | };
|
9344 | var ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE] = NativeArrayBuffer[PROTOTYPE];
|
9345 | for (var keys = getOwnPropertyNames(NativeArrayBuffer), j = 0, key; keys.length > j;) {
|
9346 | if (!((key = keys[j++]) in $ArrayBuffer)) {
|
9347 | createNonEnumerableProperty($ArrayBuffer, key, NativeArrayBuffer[key]);
|
9348 | }
|
9349 | }
|
9350 | ArrayBufferPrototype.constructor = $ArrayBuffer;
|
9351 | }
|
9352 |
|
9353 |
|
9354 | if (setPrototypeOf && getPrototypeOf($DataViewPrototype) !== ObjectPrototype) {
|
9355 | setPrototypeOf($DataViewPrototype, ObjectPrototype);
|
9356 | }
|
9357 |
|
9358 |
|
9359 | var testView = new $DataView(new $ArrayBuffer(2));
|
9360 | var nativeSetInt8 = $DataViewPrototype.setInt8;
|
9361 | testView.setInt8(0, 2147483648);
|
9362 | testView.setInt8(1, 2147483649);
|
9363 | if (testView.getInt8(0) || !testView.getInt8(1)) redefineAll($DataViewPrototype, {
|
9364 | setInt8: function setInt8(byteOffset, value) {
|
9365 | nativeSetInt8.call(this, byteOffset, value << 24 >> 24);
|
9366 | },
|
9367 | setUint8: function setUint8(byteOffset, value) {
|
9368 | nativeSetInt8.call(this, byteOffset, value << 24 >> 24);
|
9369 | }
|
9370 | }, { unsafe: true });
|
9371 | }
|
9372 |
|
9373 | setToStringTag($ArrayBuffer, ARRAY_BUFFER);
|
9374 | setToStringTag($DataView, DATA_VIEW);
|
9375 |
|
9376 | module.exports = {
|
9377 | ArrayBuffer: $ArrayBuffer,
|
9378 | DataView: $DataView
|
9379 | };
|
9380 |
|
9381 |
|
9382 | }),
|
9383 |
|
9384 | (function(module) {
|
9385 |
|
9386 | module.exports = typeof ArrayBuffer !== 'undefined' && typeof DataView !== 'undefined';
|
9387 |
|
9388 |
|
9389 | }),
|
9390 |
|
9391 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
9392 |
|
9393 | var toInteger = __webpack_require__(41);
|
9394 | var toLength = __webpack_require__(40);
|
9395 |
|
9396 |
|
9397 |
|
9398 | module.exports = function (it) {
|
9399 | if (it === undefined) return 0;
|
9400 | var number = toInteger(it);
|
9401 | var length = toLength(number);
|
9402 | if (number !== length) throw RangeError('Wrong length or index');
|
9403 | return length;
|
9404 | };
|
9405 |
|
9406 |
|
9407 | }),
|
9408 |
|
9409 | (function(module) {
|
9410 |
|
9411 |
|
9412 | var abs = Math.abs;
|
9413 | var pow = Math.pow;
|
9414 | var floor = Math.floor;
|
9415 | var log = Math.log;
|
9416 | var LN2 = Math.LN2;
|
9417 |
|
9418 | var pack = function (number, mantissaLength, bytes) {
|
9419 | var buffer = new Array(bytes);
|
9420 | var exponentLength = bytes * 8 - mantissaLength - 1;
|
9421 | var eMax = (1 << exponentLength) - 1;
|
9422 | var eBias = eMax >> 1;
|
9423 | var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0;
|
9424 | var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0;
|
9425 | var index = 0;
|
9426 | var exponent, mantissa, c;
|
9427 | number = abs(number);
|
9428 |
|
9429 | if (number != number || number === Infinity) {
|
9430 |
|
9431 | mantissa = number != number ? 1 : 0;
|
9432 | exponent = eMax;
|
9433 | } else {
|
9434 | exponent = floor(log(number) / LN2);
|
9435 | if (number * (c = pow(2, -exponent)) < 1) {
|
9436 | exponent--;
|
9437 | c *= 2;
|
9438 | }
|
9439 | if (exponent + eBias >= 1) {
|
9440 | number += rt / c;
|
9441 | } else {
|
9442 | number += rt * pow(2, 1 - eBias);
|
9443 | }
|
9444 | if (number * c >= 2) {
|
9445 | exponent++;
|
9446 | c /= 2;
|
9447 | }
|
9448 | if (exponent + eBias >= eMax) {
|
9449 | mantissa = 0;
|
9450 | exponent = eMax;
|
9451 | } else if (exponent + eBias >= 1) {
|
9452 | mantissa = (number * c - 1) * pow(2, mantissaLength);
|
9453 | exponent = exponent + eBias;
|
9454 | } else {
|
9455 | mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength);
|
9456 | exponent = 0;
|
9457 | }
|
9458 | }
|
9459 | for (; mantissaLength >= 8; buffer[index++] = mantissa & 255, mantissa /= 256, mantissaLength -= 8);
|
9460 | exponent = exponent << mantissaLength | mantissa;
|
9461 | exponentLength += mantissaLength;
|
9462 | for (; exponentLength > 0; buffer[index++] = exponent & 255, exponent /= 256, exponentLength -= 8);
|
9463 | buffer[--index] |= sign * 128;
|
9464 | return buffer;
|
9465 | };
|
9466 |
|
9467 | var unpack = function (buffer, mantissaLength) {
|
9468 | var bytes = buffer.length;
|
9469 | var exponentLength = bytes * 8 - mantissaLength - 1;
|
9470 | var eMax = (1 << exponentLength) - 1;
|
9471 | var eBias = eMax >> 1;
|
9472 | var nBits = exponentLength - 7;
|
9473 | var index = bytes - 1;
|
9474 | var sign = buffer[index--];
|
9475 | var exponent = sign & 127;
|
9476 | var mantissa;
|
9477 | sign >>= 7;
|
9478 | for (; nBits > 0; exponent = exponent * 256 + buffer[index], index--, nBits -= 8);
|
9479 | mantissa = exponent & (1 << -nBits) - 1;
|
9480 | exponent >>= -nBits;
|
9481 | nBits += mantissaLength;
|
9482 | for (; nBits > 0; mantissa = mantissa * 256 + buffer[index], index--, nBits -= 8);
|
9483 | if (exponent === 0) {
|
9484 | exponent = 1 - eBias;
|
9485 | } else if (exponent === eMax) {
|
9486 | return mantissa ? NaN : sign ? -Infinity : Infinity;
|
9487 | } else {
|
9488 | mantissa = mantissa + pow(2, mantissaLength);
|
9489 | exponent = exponent - eBias;
|
9490 | } return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength);
|
9491 | };
|
9492 |
|
9493 | module.exports = {
|
9494 | pack: pack,
|
9495 | unpack: unpack
|
9496 | };
|
9497 |
|
9498 |
|
9499 | }),
|
9500 |
|
9501 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9502 |
|
9503 | var $ = __webpack_require__(3);
|
9504 | var ArrayBufferViewCore = __webpack_require__(312);
|
9505 |
|
9506 | var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;
|
9507 |
|
9508 |
|
9509 |
|
9510 | $({ target: 'ArrayBuffer', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, {
|
9511 | isView: ArrayBufferViewCore.isView
|
9512 | });
|
9513 |
|
9514 |
|
9515 | }),
|
9516 |
|
9517 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
9518 |
|
9519 | "use strict";
|
9520 |
|
9521 | var NATIVE_ARRAY_BUFFER = __webpack_require__(308);
|
9522 | var DESCRIPTORS = __webpack_require__(6);
|
9523 | var global = __webpack_require__(4);
|
9524 | var isObject = __webpack_require__(15);
|
9525 | var has = __webpack_require__(16);
|
9526 | var classof = __webpack_require__(89);
|
9527 | var createNonEnumerableProperty = __webpack_require__(19);
|
9528 | var redefine = __webpack_require__(22);
|
9529 | var defineProperty = __webpack_require__(20).f;
|
9530 | var getPrototypeOf = __webpack_require__(81);
|
9531 | var setPrototypeOf = __webpack_require__(83);
|
9532 | var wellKnownSymbol = __webpack_require__(58);
|
9533 | var uid = __webpack_require__(31);
|
9534 |
|
9535 | var Int8Array = global.Int8Array;
|
9536 | var Int8ArrayPrototype = Int8Array && Int8Array.prototype;
|
9537 | var Uint8ClampedArray = global.Uint8ClampedArray;
|
9538 | var Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype;
|
9539 | var TypedArray = Int8Array && getPrototypeOf(Int8Array);
|
9540 | var TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype);
|
9541 | var ObjectPrototype = Object.prototype;
|
9542 | var isPrototypeOf = ObjectPrototype.isPrototypeOf;
|
9543 |
|
9544 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
9545 | var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');
|
9546 |
|
9547 | var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global.opera) !== 'Opera';
|
9548 | var TYPED_ARRAY_TAG_REQIRED = false;
|
9549 | var NAME;
|
9550 |
|
9551 | var TypedArrayConstructorsList = {
|
9552 | Int8Array: 1,
|
9553 | Uint8Array: 1,
|
9554 | Uint8ClampedArray: 1,
|
9555 | Int16Array: 2,
|
9556 | Uint16Array: 2,
|
9557 | Int32Array: 4,
|
9558 | Uint32Array: 4,
|
9559 | Float32Array: 4,
|
9560 | Float64Array: 8
|
9561 | };
|
9562 |
|
9563 | var BigIntArrayConstructorsList = {
|
9564 | BigInt64Array: 8,
|
9565 | BigUint64Array: 8
|
9566 | };
|
9567 |
|
9568 | var isView = function isView(it) {
|
9569 | if (!isObject(it)) return false;
|
9570 | var klass = classof(it);
|
9571 | return klass === 'DataView'
|
9572 | || has(TypedArrayConstructorsList, klass)
|
9573 | || has(BigIntArrayConstructorsList, klass);
|
9574 | };
|
9575 |
|
9576 | var isTypedArray = function (it) {
|
9577 | if (!isObject(it)) return false;
|
9578 | var klass = classof(it);
|
9579 | return has(TypedArrayConstructorsList, klass)
|
9580 | || has(BigIntArrayConstructorsList, klass);
|
9581 | };
|
9582 |
|
9583 | var aTypedArray = function (it) {
|
9584 | if (isTypedArray(it)) return it;
|
9585 | throw TypeError('Target is not a typed array');
|
9586 | };
|
9587 |
|
9588 | var aTypedArrayConstructor = function (C) {
|
9589 | if (setPrototypeOf) {
|
9590 | if (isPrototypeOf.call(TypedArray, C)) return C;
|
9591 | } else for (var ARRAY in TypedArrayConstructorsList) if (has(TypedArrayConstructorsList, NAME)) {
|
9592 | var TypedArrayConstructor = global[ARRAY];
|
9593 | if (TypedArrayConstructor && (C === TypedArrayConstructor || isPrototypeOf.call(TypedArrayConstructor, C))) {
|
9594 | return C;
|
9595 | }
|
9596 | } throw TypeError('Target is not a typed array constructor');
|
9597 | };
|
9598 |
|
9599 | var exportTypedArrayMethod = function (KEY, property, forced) {
|
9600 | if (!DESCRIPTORS) return;
|
9601 | if (forced) for (var ARRAY in TypedArrayConstructorsList) {
|
9602 | var TypedArrayConstructor = global[ARRAY];
|
9603 | if (TypedArrayConstructor && has(TypedArrayConstructor.prototype, KEY)) {
|
9604 | delete TypedArrayConstructor.prototype[KEY];
|
9605 | }
|
9606 | }
|
9607 | if (!TypedArrayPrototype[KEY] || forced) {
|
9608 | redefine(TypedArrayPrototype, KEY, forced ? property
|
9609 | : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property);
|
9610 | }
|
9611 | };
|
9612 |
|
9613 | var exportTypedArrayStaticMethod = function (KEY, property, forced) {
|
9614 | var ARRAY, TypedArrayConstructor;
|
9615 | if (!DESCRIPTORS) return;
|
9616 | if (setPrototypeOf) {
|
9617 | if (forced) for (ARRAY in TypedArrayConstructorsList) {
|
9618 | TypedArrayConstructor = global[ARRAY];
|
9619 | if (TypedArrayConstructor && has(TypedArrayConstructor, KEY)) {
|
9620 | delete TypedArrayConstructor[KEY];
|
9621 | }
|
9622 | }
|
9623 | if (!TypedArray[KEY] || forced) {
|
9624 |
|
9625 | try {
|
9626 | return redefine(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && Int8Array[KEY] || property);
|
9627 | } catch (error) { }
|
9628 | } else return;
|
9629 | }
|
9630 | for (ARRAY in TypedArrayConstructorsList) {
|
9631 | TypedArrayConstructor = global[ARRAY];
|
9632 | if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) {
|
9633 | redefine(TypedArrayConstructor, KEY, property);
|
9634 | }
|
9635 | }
|
9636 | };
|
9637 |
|
9638 | for (NAME in TypedArrayConstructorsList) {
|
9639 | if (!global[NAME]) NATIVE_ARRAY_BUFFER_VIEWS = false;
|
9640 | }
|
9641 |
|
9642 |
|
9643 | if (!NATIVE_ARRAY_BUFFER_VIEWS || typeof TypedArray != 'function' || TypedArray === Function.prototype) {
|
9644 |
|
9645 | TypedArray = function TypedArray() {
|
9646 | throw TypeError('Incorrect invocation');
|
9647 | };
|
9648 | if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {
|
9649 | if (global[NAME]) setPrototypeOf(global[NAME], TypedArray);
|
9650 | }
|
9651 | }
|
9652 |
|
9653 | if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) {
|
9654 | TypedArrayPrototype = TypedArray.prototype;
|
9655 | if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {
|
9656 | if (global[NAME]) setPrototypeOf(global[NAME].prototype, TypedArrayPrototype);
|
9657 | }
|
9658 | }
|
9659 |
|
9660 |
|
9661 | if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) {
|
9662 | setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype);
|
9663 | }
|
9664 |
|
9665 | if (DESCRIPTORS && !has(TypedArrayPrototype, TO_STRING_TAG)) {
|
9666 | TYPED_ARRAY_TAG_REQIRED = true;
|
9667 | defineProperty(TypedArrayPrototype, TO_STRING_TAG, { get: function () {
|
9668 | return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined;
|
9669 | } });
|
9670 | for (NAME in TypedArrayConstructorsList) if (global[NAME]) {
|
9671 | createNonEnumerableProperty(global[NAME], TYPED_ARRAY_TAG, NAME);
|
9672 | }
|
9673 | }
|
9674 |
|
9675 | module.exports = {
|
9676 | NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS,
|
9677 | TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQIRED && TYPED_ARRAY_TAG,
|
9678 | aTypedArray: aTypedArray,
|
9679 | aTypedArrayConstructor: aTypedArrayConstructor,
|
9680 | exportTypedArrayMethod: exportTypedArrayMethod,
|
9681 | exportTypedArrayStaticMethod: exportTypedArrayStaticMethod,
|
9682 | isView: isView,
|
9683 | isTypedArray: isTypedArray,
|
9684 | TypedArray: TypedArray,
|
9685 | TypedArrayPrototype: TypedArrayPrototype
|
9686 | };
|
9687 |
|
9688 |
|
9689 | }),
|
9690 |
|
9691 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9692 |
|
9693 | "use strict";
|
9694 |
|
9695 | var $ = __webpack_require__(3);
|
9696 | var fails = __webpack_require__(7);
|
9697 | var ArrayBufferModule = __webpack_require__(307);
|
9698 | var anObject = __webpack_require__(21);
|
9699 | var toAbsoluteIndex = __webpack_require__(42);
|
9700 | var toLength = __webpack_require__(40);
|
9701 | var speciesConstructor = __webpack_require__(193);
|
9702 |
|
9703 | var ArrayBuffer = ArrayBufferModule.ArrayBuffer;
|
9704 | var DataView = ArrayBufferModule.DataView;
|
9705 | var nativeArrayBufferSlice = ArrayBuffer.prototype.slice;
|
9706 |
|
9707 | var INCORRECT_SLICE = fails(function () {
|
9708 | return !new ArrayBuffer(2).slice(1, undefined).byteLength;
|
9709 | });
|
9710 |
|
9711 |
|
9712 |
|
9713 | $({ target: 'ArrayBuffer', proto: true, unsafe: true, forced: INCORRECT_SLICE }, {
|
9714 | slice: function slice(start, end) {
|
9715 | if (nativeArrayBufferSlice !== undefined && end === undefined) {
|
9716 | return nativeArrayBufferSlice.call(anObject(this), start);
|
9717 | }
|
9718 | var length = anObject(this).byteLength;
|
9719 | var first = toAbsoluteIndex(start, length);
|
9720 | var fin = toAbsoluteIndex(end === undefined ? length : end, length);
|
9721 | var result = new (speciesConstructor(this, ArrayBuffer))(toLength(fin - first));
|
9722 | var viewSource = new DataView(this);
|
9723 | var viewTarget = new DataView(result);
|
9724 | var index = 0;
|
9725 | while (first < fin) {
|
9726 | viewTarget.setUint8(index++, viewSource.getUint8(first++));
|
9727 | } return result;
|
9728 | }
|
9729 | });
|
9730 |
|
9731 |
|
9732 | }),
|
9733 |
|
9734 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9735 |
|
9736 | var $ = __webpack_require__(3);
|
9737 | var ArrayBufferModule = __webpack_require__(307);
|
9738 | var NATIVE_ARRAY_BUFFER = __webpack_require__(308);
|
9739 |
|
9740 |
|
9741 |
|
9742 | $({ global: true, forced: !NATIVE_ARRAY_BUFFER }, {
|
9743 | DataView: ArrayBufferModule.DataView
|
9744 | });
|
9745 |
|
9746 |
|
9747 | }),
|
9748 |
|
9749 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9750 |
|
9751 | var createTypedArrayConstructor = __webpack_require__(316);
|
9752 |
|
9753 |
|
9754 |
|
9755 | createTypedArrayConstructor('Int8', function (init) {
|
9756 | return function Int8Array(data, byteOffset, length) {
|
9757 | return init(this, data, byteOffset, length);
|
9758 | };
|
9759 | });
|
9760 |
|
9761 |
|
9762 | }),
|
9763 |
|
9764 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
9765 |
|
9766 | "use strict";
|
9767 |
|
9768 | var $ = __webpack_require__(3);
|
9769 | var global = __webpack_require__(4);
|
9770 | var DESCRIPTORS = __webpack_require__(6);
|
9771 | var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = __webpack_require__(317);
|
9772 | var ArrayBufferViewCore = __webpack_require__(312);
|
9773 | var ArrayBufferModule = __webpack_require__(307);
|
9774 | var anInstance = __webpack_require__(287);
|
9775 | var createPropertyDescriptor = __webpack_require__(9);
|
9776 | var createNonEnumerableProperty = __webpack_require__(19);
|
9777 | var toLength = __webpack_require__(40);
|
9778 | var toIndex = __webpack_require__(309);
|
9779 | var toOffset = __webpack_require__(318);
|
9780 | var toPrimitive = __webpack_require__(14);
|
9781 | var has = __webpack_require__(16);
|
9782 | var classof = __webpack_require__(89);
|
9783 | var isObject = __webpack_require__(15);
|
9784 | var create = __webpack_require__(53);
|
9785 | var setPrototypeOf = __webpack_require__(83);
|
9786 | var getOwnPropertyNames = __webpack_require__(37).f;
|
9787 | var typedArrayFrom = __webpack_require__(320);
|
9788 | var forEach = __webpack_require__(62).forEach;
|
9789 | var setSpecies = __webpack_require__(131);
|
9790 | var definePropertyModule = __webpack_require__(20);
|
9791 | var getOwnPropertyDescriptorModule = __webpack_require__(5);
|
9792 | var InternalStateModule = __webpack_require__(26);
|
9793 | var inheritIfRequired = __webpack_require__(229);
|
9794 |
|
9795 | var getInternalState = InternalStateModule.get;
|
9796 | var setInternalState = InternalStateModule.set;
|
9797 | var nativeDefineProperty = definePropertyModule.f;
|
9798 | var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
9799 | var round = Math.round;
|
9800 | var RangeError = global.RangeError;
|
9801 | var ArrayBuffer = ArrayBufferModule.ArrayBuffer;
|
9802 | var DataView = ArrayBufferModule.DataView;
|
9803 | var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;
|
9804 | var TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG;
|
9805 | var TypedArray = ArrayBufferViewCore.TypedArray;
|
9806 | var TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype;
|
9807 | var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
|
9808 | var isTypedArray = ArrayBufferViewCore.isTypedArray;
|
9809 | var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';
|
9810 | var WRONG_LENGTH = 'Wrong length';
|
9811 |
|
9812 | var fromList = function (C, list) {
|
9813 | var index = 0;
|
9814 | var length = list.length;
|
9815 | var result = new (aTypedArrayConstructor(C))(length);
|
9816 | while (length > index) result[index] = list[index++];
|
9817 | return result;
|
9818 | };
|
9819 |
|
9820 | var addGetter = function (it, key) {
|
9821 | nativeDefineProperty(it, key, { get: function () {
|
9822 | return getInternalState(this)[key];
|
9823 | } });
|
9824 | };
|
9825 |
|
9826 | var isArrayBuffer = function (it) {
|
9827 | var klass;
|
9828 | return it instanceof ArrayBuffer || (klass = classof(it)) == 'ArrayBuffer' || klass == 'SharedArrayBuffer';
|
9829 | };
|
9830 |
|
9831 | var isTypedArrayIndex = function (target, key) {
|
9832 | return isTypedArray(target)
|
9833 | && typeof key != 'symbol'
|
9834 | && key in target
|
9835 | && String(+key) == String(key);
|
9836 | };
|
9837 |
|
9838 | var wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) {
|
9839 | return isTypedArrayIndex(target, key = toPrimitive(key, true))
|
9840 | ? createPropertyDescriptor(2, target[key])
|
9841 | : nativeGetOwnPropertyDescriptor(target, key);
|
9842 | };
|
9843 |
|
9844 | var wrappedDefineProperty = function defineProperty(target, key, descriptor) {
|
9845 | if (isTypedArrayIndex(target, key = toPrimitive(key, true))
|
9846 | && isObject(descriptor)
|
9847 | && has(descriptor, 'value')
|
9848 | && !has(descriptor, 'get')
|
9849 | && !has(descriptor, 'set')
|
9850 |
|
9851 | && !descriptor.configurable
|
9852 | && (!has(descriptor, 'writable') || descriptor.writable)
|
9853 | && (!has(descriptor, 'enumerable') || descriptor.enumerable)
|
9854 | ) {
|
9855 | target[key] = descriptor.value;
|
9856 | return target;
|
9857 | } return nativeDefineProperty(target, key, descriptor);
|
9858 | };
|
9859 |
|
9860 | if (DESCRIPTORS) {
|
9861 | if (!NATIVE_ARRAY_BUFFER_VIEWS) {
|
9862 | getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor;
|
9863 | definePropertyModule.f = wrappedDefineProperty;
|
9864 | addGetter(TypedArrayPrototype, 'buffer');
|
9865 | addGetter(TypedArrayPrototype, 'byteOffset');
|
9866 | addGetter(TypedArrayPrototype, 'byteLength');
|
9867 | addGetter(TypedArrayPrototype, 'length');
|
9868 | }
|
9869 |
|
9870 | $({ target: 'Object', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, {
|
9871 | getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor,
|
9872 | defineProperty: wrappedDefineProperty
|
9873 | });
|
9874 |
|
9875 | module.exports = function (TYPE, wrapper, CLAMPED) {
|
9876 | var BYTES = TYPE.match(/\d+$/)[0] / 8;
|
9877 | var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? 'Clamped' : '') + 'Array';
|
9878 | var GETTER = 'get' + TYPE;
|
9879 | var SETTER = 'set' + TYPE;
|
9880 | var NativeTypedArrayConstructor = global[CONSTRUCTOR_NAME];
|
9881 | var TypedArrayConstructor = NativeTypedArrayConstructor;
|
9882 | var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype;
|
9883 | var exported = {};
|
9884 |
|
9885 | var getter = function (that, index) {
|
9886 | var data = getInternalState(that);
|
9887 | return data.view[GETTER](index * BYTES + data.byteOffset, true);
|
9888 | };
|
9889 |
|
9890 | var setter = function (that, index, value) {
|
9891 | var data = getInternalState(that);
|
9892 | if (CLAMPED) value = (value = round(value)) < 0 ? 0 : value > 0xFF ? 0xFF : value & 0xFF;
|
9893 | data.view[SETTER](index * BYTES + data.byteOffset, value, true);
|
9894 | };
|
9895 |
|
9896 | var addElement = function (that, index) {
|
9897 | nativeDefineProperty(that, index, {
|
9898 | get: function () {
|
9899 | return getter(this, index);
|
9900 | },
|
9901 | set: function (value) {
|
9902 | return setter(this, index, value);
|
9903 | },
|
9904 | enumerable: true
|
9905 | });
|
9906 | };
|
9907 |
|
9908 | if (!NATIVE_ARRAY_BUFFER_VIEWS) {
|
9909 | TypedArrayConstructor = wrapper(function (that, data, offset, $length) {
|
9910 | anInstance(that, TypedArrayConstructor, CONSTRUCTOR_NAME);
|
9911 | var index = 0;
|
9912 | var byteOffset = 0;
|
9913 | var buffer, byteLength, length;
|
9914 | if (!isObject(data)) {
|
9915 | length = toIndex(data);
|
9916 | byteLength = length * BYTES;
|
9917 | buffer = new ArrayBuffer(byteLength);
|
9918 | } else if (isArrayBuffer(data)) {
|
9919 | buffer = data;
|
9920 | byteOffset = toOffset(offset, BYTES);
|
9921 | var $len = data.byteLength;
|
9922 | if ($length === undefined) {
|
9923 | if ($len % BYTES) throw RangeError(WRONG_LENGTH);
|
9924 | byteLength = $len - byteOffset;
|
9925 | if (byteLength < 0) throw RangeError(WRONG_LENGTH);
|
9926 | } else {
|
9927 | byteLength = toLength($length) * BYTES;
|
9928 | if (byteLength + byteOffset > $len) throw RangeError(WRONG_LENGTH);
|
9929 | }
|
9930 | length = byteLength / BYTES;
|
9931 | } else if (isTypedArray(data)) {
|
9932 | return fromList(TypedArrayConstructor, data);
|
9933 | } else {
|
9934 | return typedArrayFrom.call(TypedArrayConstructor, data);
|
9935 | }
|
9936 | setInternalState(that, {
|
9937 | buffer: buffer,
|
9938 | byteOffset: byteOffset,
|
9939 | byteLength: byteLength,
|
9940 | length: length,
|
9941 | view: new DataView(buffer)
|
9942 | });
|
9943 | while (index < length) addElement(that, index++);
|
9944 | });
|
9945 |
|
9946 | if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray);
|
9947 | TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create(TypedArrayPrototype);
|
9948 | } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) {
|
9949 | TypedArrayConstructor = wrapper(function (dummy, data, typedArrayOffset, $length) {
|
9950 | anInstance(dummy, TypedArrayConstructor, CONSTRUCTOR_NAME);
|
9951 | return inheritIfRequired(function () {
|
9952 | if (!isObject(data)) return new NativeTypedArrayConstructor(toIndex(data));
|
9953 | if (isArrayBuffer(data)) return $length !== undefined
|
9954 | ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES), $length)
|
9955 | : typedArrayOffset !== undefined
|
9956 | ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES))
|
9957 | : new NativeTypedArrayConstructor(data);
|
9958 | if (isTypedArray(data)) return fromList(TypedArrayConstructor, data);
|
9959 | return typedArrayFrom.call(TypedArrayConstructor, data);
|
9960 | }(), dummy, TypedArrayConstructor);
|
9961 | });
|
9962 |
|
9963 | if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray);
|
9964 | forEach(getOwnPropertyNames(NativeTypedArrayConstructor), function (key) {
|
9965 | if (!(key in TypedArrayConstructor)) {
|
9966 | createNonEnumerableProperty(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]);
|
9967 | }
|
9968 | });
|
9969 | TypedArrayConstructor.prototype = TypedArrayConstructorPrototype;
|
9970 | }
|
9971 |
|
9972 | if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) {
|
9973 | createNonEnumerableProperty(TypedArrayConstructorPrototype, 'constructor', TypedArrayConstructor);
|
9974 | }
|
9975 |
|
9976 | if (TYPED_ARRAY_TAG) {
|
9977 | createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME);
|
9978 | }
|
9979 |
|
9980 | exported[CONSTRUCTOR_NAME] = TypedArrayConstructor;
|
9981 |
|
9982 | $({
|
9983 | global: true, forced: TypedArrayConstructor != NativeTypedArrayConstructor, sham: !NATIVE_ARRAY_BUFFER_VIEWS
|
9984 | }, exported);
|
9985 |
|
9986 | if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) {
|
9987 | createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES);
|
9988 | }
|
9989 |
|
9990 | if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) {
|
9991 | createNonEnumerableProperty(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES);
|
9992 | }
|
9993 |
|
9994 | setSpecies(CONSTRUCTOR_NAME);
|
9995 | };
|
9996 | } else module.exports = function () { };
|
9997 |
|
9998 |
|
9999 | }),
|
10000 |
|
10001 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
10002 |
|
10003 |
|
10004 | var global = __webpack_require__(4);
|
10005 | var fails = __webpack_require__(7);
|
10006 | var checkCorrectnessOfIteration = __webpack_require__(96);
|
10007 | var NATIVE_ARRAY_BUFFER_VIEWS = __webpack_require__(312).NATIVE_ARRAY_BUFFER_VIEWS;
|
10008 |
|
10009 | var ArrayBuffer = global.ArrayBuffer;
|
10010 | var Int8Array = global.Int8Array;
|
10011 |
|
10012 | module.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () {
|
10013 | Int8Array(1);
|
10014 | }) || !fails(function () {
|
10015 | new Int8Array(-1);
|
10016 | }) || !checkCorrectnessOfIteration(function (iterable) {
|
10017 | new Int8Array();
|
10018 | new Int8Array(null);
|
10019 | new Int8Array(1.5);
|
10020 | new Int8Array(iterable);
|
10021 | }, true) || fails(function () {
|
10022 |
|
10023 | return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1;
|
10024 | });
|
10025 |
|
10026 |
|
10027 | }),
|
10028 |
|
10029 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
10030 |
|
10031 | var toPositiveInteger = __webpack_require__(319);
|
10032 |
|
10033 | module.exports = function (it, BYTES) {
|
10034 | var offset = toPositiveInteger(it);
|
10035 | if (offset % BYTES) throw RangeError('Wrong offset');
|
10036 | return offset;
|
10037 | };
|
10038 |
|
10039 |
|
10040 | }),
|
10041 |
|
10042 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
10043 |
|
10044 | var toInteger = __webpack_require__(41);
|
10045 |
|
10046 | module.exports = function (it) {
|
10047 | var result = toInteger(it);
|
10048 | if (result < 0) throw RangeError("The argument can't be less than 0");
|
10049 | return result;
|
10050 | };
|
10051 |
|
10052 |
|
10053 | }),
|
10054 |
|
10055 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
10056 |
|
10057 | var toObject = __webpack_require__(52);
|
10058 | var toLength = __webpack_require__(40);
|
10059 | var getIteratorMethod = __webpack_require__(88);
|
10060 | var isArrayIteratorMethod = __webpack_require__(86);
|
10061 | var bind = __webpack_require__(63);
|
10062 | var aTypedArrayConstructor = __webpack_require__(312).aTypedArrayConstructor;
|
10063 |
|
10064 | module.exports = function from(source /* , mapfn, thisArg */) {
|
10065 | var O = toObject(source);
|
10066 | var argumentsLength = arguments.length;
|
10067 | var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
|
10068 | var mapping = mapfn !== undefined;
|
10069 | var iteratorMethod = getIteratorMethod(O);
|
10070 | var i, length, result, step, iterator, next;
|
10071 | if (iteratorMethod != undefined && !isArrayIteratorMethod(iteratorMethod)) {
|
10072 | iterator = iteratorMethod.call(O);
|
10073 | next = iterator.next;
|
10074 | O = [];
|
10075 | while (!(step = next.call(iterator)).done) {
|
10076 | O.push(step.value);
|
10077 | }
|
10078 | }
|
10079 | if (mapping && argumentsLength > 2) {
|
10080 | mapfn = bind(mapfn, arguments[2], 2);
|
10081 | }
|
10082 | length = toLength(O.length);
|
10083 | result = new (aTypedArrayConstructor(this))(length);
|
10084 | for (i = 0; length > i; i++) {
|
10085 | result[i] = mapping ? mapfn(O[i], i) : O[i];
|
10086 | }
|
10087 | return result;
|
10088 | };
|
10089 |
|
10090 |
|
10091 | }),
|
10092 |
|
10093 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10094 |
|
10095 | var createTypedArrayConstructor = __webpack_require__(316);
|
10096 |
|
10097 |
|
10098 |
|
10099 | createTypedArrayConstructor('Uint8', function (init) {
|
10100 | return function Uint8Array(data, byteOffset, length) {
|
10101 | return init(this, data, byteOffset, length);
|
10102 | };
|
10103 | });
|
10104 |
|
10105 |
|
10106 | }),
|
10107 |
|
10108 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10109 |
|
10110 | var createTypedArrayConstructor = __webpack_require__(316);
|
10111 |
|
10112 |
|
10113 |
|
10114 | createTypedArrayConstructor('Uint8', function (init) {
|
10115 | return function Uint8ClampedArray(data, byteOffset, length) {
|
10116 | return init(this, data, byteOffset, length);
|
10117 | };
|
10118 | }, true);
|
10119 |
|
10120 |
|
10121 | }),
|
10122 |
|
10123 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10124 |
|
10125 | var createTypedArrayConstructor = __webpack_require__(316);
|
10126 |
|
10127 |
|
10128 |
|
10129 | createTypedArrayConstructor('Int16', function (init) {
|
10130 | return function Int16Array(data, byteOffset, length) {
|
10131 | return init(this, data, byteOffset, length);
|
10132 | };
|
10133 | });
|
10134 |
|
10135 |
|
10136 | }),
|
10137 |
|
10138 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10139 |
|
10140 | var createTypedArrayConstructor = __webpack_require__(316);
|
10141 |
|
10142 |
|
10143 |
|
10144 | createTypedArrayConstructor('Uint16', function (init) {
|
10145 | return function Uint16Array(data, byteOffset, length) {
|
10146 | return init(this, data, byteOffset, length);
|
10147 | };
|
10148 | });
|
10149 |
|
10150 |
|
10151 | }),
|
10152 |
|
10153 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10154 |
|
10155 | var createTypedArrayConstructor = __webpack_require__(316);
|
10156 |
|
10157 |
|
10158 |
|
10159 | createTypedArrayConstructor('Int32', function (init) {
|
10160 | return function Int32Array(data, byteOffset, length) {
|
10161 | return init(this, data, byteOffset, length);
|
10162 | };
|
10163 | });
|
10164 |
|
10165 |
|
10166 | }),
|
10167 |
|
10168 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10169 |
|
10170 | var createTypedArrayConstructor = __webpack_require__(316);
|
10171 |
|
10172 |
|
10173 |
|
10174 | createTypedArrayConstructor('Uint32', function (init) {
|
10175 | return function Uint32Array(data, byteOffset, length) {
|
10176 | return init(this, data, byteOffset, length);
|
10177 | };
|
10178 | });
|
10179 |
|
10180 |
|
10181 | }),
|
10182 |
|
10183 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10184 |
|
10185 | var createTypedArrayConstructor = __webpack_require__(316);
|
10186 |
|
10187 |
|
10188 |
|
10189 | createTypedArrayConstructor('Float32', function (init) {
|
10190 | return function Float32Array(data, byteOffset, length) {
|
10191 | return init(this, data, byteOffset, length);
|
10192 | };
|
10193 | });
|
10194 |
|
10195 |
|
10196 | }),
|
10197 |
|
10198 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10199 |
|
10200 | var createTypedArrayConstructor = __webpack_require__(316);
|
10201 |
|
10202 |
|
10203 |
|
10204 | createTypedArrayConstructor('Float64', function (init) {
|
10205 | return function Float64Array(data, byteOffset, length) {
|
10206 | return init(this, data, byteOffset, length);
|
10207 | };
|
10208 | });
|
10209 |
|
10210 |
|
10211 | }),
|
10212 |
|
10213 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10214 |
|
10215 | "use strict";
|
10216 |
|
10217 | var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = __webpack_require__(317);
|
10218 | var exportTypedArrayStaticMethod = __webpack_require__(312).exportTypedArrayStaticMethod;
|
10219 | var typedArrayFrom = __webpack_require__(320);
|
10220 |
|
10221 |
|
10222 |
|
10223 | exportTypedArrayStaticMethod('from', typedArrayFrom, TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS);
|
10224 |
|
10225 |
|
10226 | }),
|
10227 |
|
10228 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10229 |
|
10230 | "use strict";
|
10231 |
|
10232 | var ArrayBufferViewCore = __webpack_require__(312);
|
10233 | var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = __webpack_require__(317);
|
10234 |
|
10235 | var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
|
10236 | var exportTypedArrayStaticMethod = ArrayBufferViewCore.exportTypedArrayStaticMethod;
|
10237 |
|
10238 |
|
10239 |
|
10240 | exportTypedArrayStaticMethod('of', function of(/* ...items */) {
|
10241 | var index = 0;
|
10242 | var length = arguments.length;
|
10243 | var result = new (aTypedArrayConstructor(this))(length);
|
10244 | while (length > index) result[index] = arguments[index++];
|
10245 | return result;
|
10246 | }, TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS);
|
10247 |
|
10248 |
|
10249 | }),
|
10250 |
|
10251 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10252 |
|
10253 | "use strict";
|
10254 |
|
10255 | var ArrayBufferViewCore = __webpack_require__(312);
|
10256 | var $copyWithin = __webpack_require__(102);
|
10257 |
|
10258 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
10259 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
10260 |
|
10261 |
|
10262 |
|
10263 | exportTypedArrayMethod('copyWithin', function copyWithin(target, start /* , end */) {
|
10264 | return $copyWithin.call(aTypedArray(this), target, start, arguments.length > 2 ? arguments[2] : undefined);
|
10265 | });
|
10266 |
|
10267 |
|
10268 | }),
|
10269 |
|
10270 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10271 |
|
10272 | "use strict";
|
10273 |
|
10274 | var ArrayBufferViewCore = __webpack_require__(312);
|
10275 | var $every = __webpack_require__(62).every;
|
10276 |
|
10277 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
10278 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
10279 |
|
10280 |
|
10281 |
|
10282 | exportTypedArrayMethod('every', function every(callbackfn /* , thisArg */) {
|
10283 | return $every(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
10284 | });
|
10285 |
|
10286 |
|
10287 | }),
|
10288 |
|
10289 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10290 |
|
10291 | "use strict";
|
10292 |
|
10293 | var ArrayBufferViewCore = __webpack_require__(312);
|
10294 | var $fill = __webpack_require__(107);
|
10295 |
|
10296 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
10297 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
10298 |
|
10299 |
|
10300 |
|
10301 |
|
10302 | exportTypedArrayMethod('fill', function fill(value /* , start, end */) {
|
10303 | return $fill.apply(aTypedArray(this), arguments);
|
10304 | });
|
10305 |
|
10306 |
|
10307 | }),
|
10308 |
|
10309 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10310 |
|
10311 | "use strict";
|
10312 |
|
10313 | var ArrayBufferViewCore = __webpack_require__(312);
|
10314 | var $filter = __webpack_require__(62).filter;
|
10315 | var fromSpeciesAndList = __webpack_require__(335);
|
10316 |
|
10317 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
10318 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
10319 |
|
10320 |
|
10321 |
|
10322 | exportTypedArrayMethod('filter', function filter(callbackfn /* , thisArg */) {
|
10323 | var list = $filter(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
10324 | return fromSpeciesAndList(this, list);
|
10325 | });
|
10326 |
|
10327 |
|
10328 | }),
|
10329 |
|
10330 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
10331 |
|
10332 | var aTypedArrayConstructor = __webpack_require__(312).aTypedArrayConstructor;
|
10333 | var speciesConstructor = __webpack_require__(193);
|
10334 |
|
10335 | module.exports = function (instance, list) {
|
10336 | var C = speciesConstructor(instance, instance.constructor);
|
10337 | var index = 0;
|
10338 | var length = list.length;
|
10339 | var result = new (aTypedArrayConstructor(C))(length);
|
10340 | while (length > index) result[index] = list[index++];
|
10341 | return result;
|
10342 | };
|
10343 |
|
10344 |
|
10345 | }),
|
10346 |
|
10347 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10348 |
|
10349 | "use strict";
|
10350 |
|
10351 | var ArrayBufferViewCore = __webpack_require__(312);
|
10352 | var $find = __webpack_require__(62).find;
|
10353 |
|
10354 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
10355 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
10356 |
|
10357 |
|
10358 |
|
10359 | exportTypedArrayMethod('find', function find(predicate /* , thisArg */) {
|
10360 | return $find(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
|
10361 | });
|
10362 |
|
10363 |
|
10364 | }),
|
10365 |
|
10366 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10367 |
|
10368 | "use strict";
|
10369 |
|
10370 | var ArrayBufferViewCore = __webpack_require__(312);
|
10371 | var $findIndex = __webpack_require__(62).findIndex;
|
10372 |
|
10373 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
10374 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
10375 |
|
10376 |
|
10377 |
|
10378 | exportTypedArrayMethod('findIndex', function findIndex(predicate /* , thisArg */) {
|
10379 | return $findIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
|
10380 | });
|
10381 |
|
10382 |
|
10383 | }),
|
10384 |
|
10385 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10386 |
|
10387 | "use strict";
|
10388 |
|
10389 | var ArrayBufferViewCore = __webpack_require__(312);
|
10390 | var $forEach = __webpack_require__(62).forEach;
|
10391 |
|
10392 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
10393 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
10394 |
|
10395 |
|
10396 |
|
10397 | exportTypedArrayMethod('forEach', function forEach(callbackfn /* , thisArg */) {
|
10398 | $forEach(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
10399 | });
|
10400 |
|
10401 |
|
10402 | }),
|
10403 |
|
10404 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10405 |
|
10406 | "use strict";
|
10407 |
|
10408 | var ArrayBufferViewCore = __webpack_require__(312);
|
10409 | var $includes = __webpack_require__(39).includes;
|
10410 |
|
10411 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
10412 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
10413 |
|
10414 |
|
10415 |
|
10416 | exportTypedArrayMethod('includes', function includes(searchElement /* , fromIndex */) {
|
10417 | return $includes(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
|
10418 | });
|
10419 |
|
10420 |
|
10421 | }),
|
10422 |
|
10423 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10424 |
|
10425 | "use strict";
|
10426 |
|
10427 | var ArrayBufferViewCore = __webpack_require__(312);
|
10428 | var $indexOf = __webpack_require__(39).indexOf;
|
10429 |
|
10430 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
10431 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
10432 |
|
10433 |
|
10434 |
|
10435 | exportTypedArrayMethod('indexOf', function indexOf(searchElement /* , fromIndex */) {
|
10436 | return $indexOf(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
|
10437 | });
|
10438 |
|
10439 |
|
10440 | }),
|
10441 |
|
10442 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10443 |
|
10444 | "use strict";
|
10445 |
|
10446 | var global = __webpack_require__(4);
|
10447 | var ArrayBufferViewCore = __webpack_require__(312);
|
10448 | var ArrayIterators = __webpack_require__(134);
|
10449 | var wellKnownSymbol = __webpack_require__(58);
|
10450 |
|
10451 | var ITERATOR = wellKnownSymbol('iterator');
|
10452 | var Uint8Array = global.Uint8Array;
|
10453 | var arrayValues = ArrayIterators.values;
|
10454 | var arrayKeys = ArrayIterators.keys;
|
10455 | var arrayEntries = ArrayIterators.entries;
|
10456 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
10457 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
10458 | var nativeTypedArrayIterator = Uint8Array && Uint8Array.prototype[ITERATOR];
|
10459 |
|
10460 | var CORRECT_ITER_NAME = !!nativeTypedArrayIterator
|
10461 | && (nativeTypedArrayIterator.name == 'values' || nativeTypedArrayIterator.name == undefined);
|
10462 |
|
10463 | var typedArrayValues = function values() {
|
10464 | return arrayValues.call(aTypedArray(this));
|
10465 | };
|
10466 |
|
10467 |
|
10468 |
|
10469 | exportTypedArrayMethod('entries', function entries() {
|
10470 | return arrayEntries.call(aTypedArray(this));
|
10471 | });
|
10472 |
|
10473 |
|
10474 | exportTypedArrayMethod('keys', function keys() {
|
10475 | return arrayKeys.call(aTypedArray(this));
|
10476 | });
|
10477 |
|
10478 |
|
10479 | exportTypedArrayMethod('values', typedArrayValues, !CORRECT_ITER_NAME);
|
10480 |
|
10481 |
|
10482 | exportTypedArrayMethod(ITERATOR, typedArrayValues, !CORRECT_ITER_NAME);
|
10483 |
|
10484 |
|
10485 | }),
|
10486 |
|
10487 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10488 |
|
10489 | "use strict";
|
10490 |
|
10491 | var ArrayBufferViewCore = __webpack_require__(312);
|
10492 |
|
10493 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
10494 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
10495 | var $join = [].join;
|
10496 |
|
10497 |
|
10498 |
|
10499 |
|
10500 | exportTypedArrayMethod('join', function join(separator) {
|
10501 | return $join.apply(aTypedArray(this), arguments);
|
10502 | });
|
10503 |
|
10504 |
|
10505 | }),
|
10506 |
|
10507 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10508 |
|
10509 | "use strict";
|
10510 |
|
10511 | var ArrayBufferViewCore = __webpack_require__(312);
|
10512 | var $lastIndexOf = __webpack_require__(120);
|
10513 |
|
10514 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
10515 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
10516 |
|
10517 |
|
10518 |
|
10519 |
|
10520 | exportTypedArrayMethod('lastIndexOf', function lastIndexOf(searchElement /* , fromIndex */) {
|
10521 | return $lastIndexOf.apply(aTypedArray(this), arguments);
|
10522 | });
|
10523 |
|
10524 |
|
10525 | }),
|
10526 |
|
10527 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10528 |
|
10529 | "use strict";
|
10530 |
|
10531 | var ArrayBufferViewCore = __webpack_require__(312);
|
10532 | var $map = __webpack_require__(62).map;
|
10533 | var speciesConstructor = __webpack_require__(193);
|
10534 |
|
10535 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
10536 | var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
|
10537 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
10538 |
|
10539 |
|
10540 |
|
10541 | exportTypedArrayMethod('map', function map(mapfn /* , thisArg */) {
|
10542 | return $map(aTypedArray(this), mapfn, arguments.length > 1 ? arguments[1] : undefined, function (O, length) {
|
10543 | return new (aTypedArrayConstructor(speciesConstructor(O, O.constructor)))(length);
|
10544 | });
|
10545 | });
|
10546 |
|
10547 |
|
10548 | }),
|
10549 |
|
10550 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10551 |
|
10552 | "use strict";
|
10553 |
|
10554 | var ArrayBufferViewCore = __webpack_require__(312);
|
10555 | var $reduce = __webpack_require__(123).left;
|
10556 |
|
10557 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
10558 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
10559 |
|
10560 |
|
10561 |
|
10562 | exportTypedArrayMethod('reduce', function reduce(callbackfn /* , initialValue */) {
|
10563 | return $reduce(aTypedArray(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
|
10564 | });
|
10565 |
|
10566 |
|
10567 | }),
|
10568 |
|
10569 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10570 |
|
10571 | "use strict";
|
10572 |
|
10573 | var ArrayBufferViewCore = __webpack_require__(312);
|
10574 | var $reduceRight = __webpack_require__(123).right;
|
10575 |
|
10576 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
10577 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
10578 |
|
10579 |
|
10580 |
|
10581 | exportTypedArrayMethod('reduceRight', function reduceRight(callbackfn /* , initialValue */) {
|
10582 | return $reduceRight(aTypedArray(this), callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
|
10583 | });
|
10584 |
|
10585 |
|
10586 | }),
|
10587 |
|
10588 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10589 |
|
10590 | "use strict";
|
10591 |
|
10592 | var ArrayBufferViewCore = __webpack_require__(312);
|
10593 |
|
10594 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
10595 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
10596 | var floor = Math.floor;
|
10597 |
|
10598 |
|
10599 |
|
10600 | exportTypedArrayMethod('reverse', function reverse() {
|
10601 | var that = this;
|
10602 | var length = aTypedArray(that).length;
|
10603 | var middle = floor(length / 2);
|
10604 | var index = 0;
|
10605 | var value;
|
10606 | while (index < middle) {
|
10607 | value = that[index];
|
10608 | that[index++] = that[--length];
|
10609 | that[length] = value;
|
10610 | } return that;
|
10611 | });
|
10612 |
|
10613 |
|
10614 | }),
|
10615 |
|
10616 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10617 |
|
10618 | "use strict";
|
10619 |
|
10620 | var ArrayBufferViewCore = __webpack_require__(312);
|
10621 | var toLength = __webpack_require__(40);
|
10622 | var toOffset = __webpack_require__(318);
|
10623 | var toObject = __webpack_require__(52);
|
10624 | var fails = __webpack_require__(7);
|
10625 |
|
10626 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
10627 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
10628 |
|
10629 | var FORCED = fails(function () {
|
10630 |
|
10631 | new Int8Array(1).set({});
|
10632 | });
|
10633 |
|
10634 |
|
10635 |
|
10636 | exportTypedArrayMethod('set', function set(arrayLike /* , offset */) {
|
10637 | aTypedArray(this);
|
10638 | var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1);
|
10639 | var length = this.length;
|
10640 | var src = toObject(arrayLike);
|
10641 | var len = toLength(src.length);
|
10642 | var index = 0;
|
10643 | if (len + offset > length) throw RangeError('Wrong length');
|
10644 | while (index < len) this[offset + index] = src[index++];
|
10645 | }, FORCED);
|
10646 |
|
10647 |
|
10648 | }),
|
10649 |
|
10650 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10651 |
|
10652 | "use strict";
|
10653 |
|
10654 | var ArrayBufferViewCore = __webpack_require__(312);
|
10655 | var speciesConstructor = __webpack_require__(193);
|
10656 | var fails = __webpack_require__(7);
|
10657 |
|
10658 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
10659 | var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
|
10660 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
10661 | var $slice = [].slice;
|
10662 |
|
10663 | var FORCED = fails(function () {
|
10664 |
|
10665 | new Int8Array(1).slice();
|
10666 | });
|
10667 |
|
10668 |
|
10669 |
|
10670 | exportTypedArrayMethod('slice', function slice(start, end) {
|
10671 | var list = $slice.call(aTypedArray(this), start, end);
|
10672 | var C = speciesConstructor(this, this.constructor);
|
10673 | var index = 0;
|
10674 | var length = list.length;
|
10675 | var result = new (aTypedArrayConstructor(C))(length);
|
10676 | while (length > index) result[index] = list[index++];
|
10677 | return result;
|
10678 | }, FORCED);
|
10679 |
|
10680 |
|
10681 | }),
|
10682 |
|
10683 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10684 |
|
10685 | "use strict";
|
10686 |
|
10687 | var ArrayBufferViewCore = __webpack_require__(312);
|
10688 | var $some = __webpack_require__(62).some;
|
10689 |
|
10690 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
10691 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
10692 |
|
10693 |
|
10694 |
|
10695 | exportTypedArrayMethod('some', function some(callbackfn /* , thisArg */) {
|
10696 | return $some(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
10697 | });
|
10698 |
|
10699 |
|
10700 | }),
|
10701 |
|
10702 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10703 |
|
10704 | "use strict";
|
10705 |
|
10706 | var ArrayBufferViewCore = __webpack_require__(312);
|
10707 |
|
10708 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
10709 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
10710 | var $sort = [].sort;
|
10711 |
|
10712 |
|
10713 |
|
10714 | exportTypedArrayMethod('sort', function sort(comparefn) {
|
10715 | return $sort.call(aTypedArray(this), comparefn);
|
10716 | });
|
10717 |
|
10718 |
|
10719 | }),
|
10720 |
|
10721 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10722 |
|
10723 | "use strict";
|
10724 |
|
10725 | var ArrayBufferViewCore = __webpack_require__(312);
|
10726 | var toLength = __webpack_require__(40);
|
10727 | var toAbsoluteIndex = __webpack_require__(42);
|
10728 | var speciesConstructor = __webpack_require__(193);
|
10729 |
|
10730 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
10731 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
10732 |
|
10733 |
|
10734 |
|
10735 | exportTypedArrayMethod('subarray', function subarray(begin, end) {
|
10736 | var O = aTypedArray(this);
|
10737 | var length = O.length;
|
10738 | var beginIndex = toAbsoluteIndex(begin, length);
|
10739 | return new (speciesConstructor(O, O.constructor))(
|
10740 | O.buffer,
|
10741 | O.byteOffset + beginIndex * O.BYTES_PER_ELEMENT,
|
10742 | toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - beginIndex)
|
10743 | );
|
10744 | });
|
10745 |
|
10746 |
|
10747 | }),
|
10748 |
|
10749 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10750 |
|
10751 | "use strict";
|
10752 |
|
10753 | var global = __webpack_require__(4);
|
10754 | var ArrayBufferViewCore = __webpack_require__(312);
|
10755 | var fails = __webpack_require__(7);
|
10756 |
|
10757 | var Int8Array = global.Int8Array;
|
10758 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
10759 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
10760 | var $toLocaleString = [].toLocaleString;
|
10761 | var $slice = [].slice;
|
10762 |
|
10763 |
|
10764 | var TO_LOCALE_STRING_BUG = !!Int8Array && fails(function () {
|
10765 | $toLocaleString.call(new Int8Array(1));
|
10766 | });
|
10767 |
|
10768 | var FORCED = fails(function () {
|
10769 | return [1, 2].toLocaleString() != new Int8Array([1, 2]).toLocaleString();
|
10770 | }) || !fails(function () {
|
10771 | Int8Array.prototype.toLocaleString.call([1, 2]);
|
10772 | });
|
10773 |
|
10774 |
|
10775 |
|
10776 | exportTypedArrayMethod('toLocaleString', function toLocaleString() {
|
10777 | return $toLocaleString.apply(TO_LOCALE_STRING_BUG ? $slice.call(aTypedArray(this)) : aTypedArray(this), arguments);
|
10778 | }, FORCED);
|
10779 |
|
10780 |
|
10781 | }),
|
10782 |
|
10783 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10784 |
|
10785 | "use strict";
|
10786 |
|
10787 | var exportTypedArrayMethod = __webpack_require__(312).exportTypedArrayMethod;
|
10788 | var fails = __webpack_require__(7);
|
10789 | var global = __webpack_require__(4);
|
10790 |
|
10791 | var Uint8Array = global.Uint8Array;
|
10792 | var Uint8ArrayPrototype = Uint8Array && Uint8Array.prototype || {};
|
10793 | var arrayToString = [].toString;
|
10794 | var arrayJoin = [].join;
|
10795 |
|
10796 | if (fails(function () { arrayToString.call({}); })) {
|
10797 | arrayToString = function toString() {
|
10798 | return arrayJoin.call(this);
|
10799 | };
|
10800 | }
|
10801 |
|
10802 | var IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString != arrayToString;
|
10803 |
|
10804 |
|
10805 |
|
10806 | exportTypedArrayMethod('toString', arrayToString, IS_NOT_ARRAY_METHOD);
|
10807 |
|
10808 |
|
10809 | }),
|
10810 |
|
10811 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10812 |
|
10813 | var $ = __webpack_require__(3);
|
10814 | var getBuiltIn = __webpack_require__(35);
|
10815 | var aFunction = __webpack_require__(64);
|
10816 | var anObject = __webpack_require__(21);
|
10817 | var fails = __webpack_require__(7);
|
10818 |
|
10819 | var nativeApply = getBuiltIn('Reflect', 'apply');
|
10820 | var functionApply = Function.apply;
|
10821 |
|
10822 |
|
10823 | var OPTIONAL_ARGUMENTS_LIST = !fails(function () {
|
10824 | nativeApply(function () { });
|
10825 | });
|
10826 |
|
10827 |
|
10828 |
|
10829 | $({ target: 'Reflect', stat: true, forced: OPTIONAL_ARGUMENTS_LIST }, {
|
10830 | apply: function apply(target, thisArgument, argumentsList) {
|
10831 | aFunction(target);
|
10832 | anObject(argumentsList);
|
10833 | return nativeApply
|
10834 | ? nativeApply(target, thisArgument, argumentsList)
|
10835 | : functionApply.call(target, thisArgument, argumentsList);
|
10836 | }
|
10837 | });
|
10838 |
|
10839 |
|
10840 | }),
|
10841 |
|
10842 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10843 |
|
10844 | var $ = __webpack_require__(3);
|
10845 | var getBuiltIn = __webpack_require__(35);
|
10846 | var aFunction = __webpack_require__(64);
|
10847 | var anObject = __webpack_require__(21);
|
10848 | var isObject = __webpack_require__(15);
|
10849 | var create = __webpack_require__(53);
|
10850 | var bind = __webpack_require__(139);
|
10851 | var fails = __webpack_require__(7);
|
10852 |
|
10853 | var nativeConstruct = getBuiltIn('Reflect', 'construct');
|
10854 |
|
10855 |
|
10856 |
|
10857 |
|
10858 |
|
10859 | var NEW_TARGET_BUG = fails(function () {
|
10860 | function F() { }
|
10861 | return !(nativeConstruct(function () { }, [], F) instanceof F);
|
10862 | });
|
10863 | var ARGS_BUG = !fails(function () {
|
10864 | nativeConstruct(function () { });
|
10865 | });
|
10866 | var FORCED = NEW_TARGET_BUG || ARGS_BUG;
|
10867 |
|
10868 | $({ target: 'Reflect', stat: true, forced: FORCED, sham: FORCED }, {
|
10869 | construct: function construct(Target, args /* , newTarget */) {
|
10870 | aFunction(Target);
|
10871 | anObject(args);
|
10872 | var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);
|
10873 | if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget);
|
10874 | if (Target == newTarget) {
|
10875 |
|
10876 | switch (args.length) {
|
10877 | case 0: return new Target();
|
10878 | case 1: return new Target(args[0]);
|
10879 | case 2: return new Target(args[0], args[1]);
|
10880 | case 3: return new Target(args[0], args[1], args[2]);
|
10881 | case 4: return new Target(args[0], args[1], args[2], args[3]);
|
10882 | }
|
10883 |
|
10884 | var $args = [null];
|
10885 | $args.push.apply($args, args);
|
10886 | return new (bind.apply(Target, $args))();
|
10887 | }
|
10888 |
|
10889 | var proto = newTarget.prototype;
|
10890 | var instance = create(isObject(proto) ? proto : Object.prototype);
|
10891 | var result = Function.apply.call(Target, instance, args);
|
10892 | return isObject(result) ? result : instance;
|
10893 | }
|
10894 | });
|
10895 |
|
10896 |
|
10897 | }),
|
10898 |
|
10899 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10900 |
|
10901 | var $ = __webpack_require__(3);
|
10902 | var DESCRIPTORS = __webpack_require__(6);
|
10903 | var anObject = __webpack_require__(21);
|
10904 | var toPrimitive = __webpack_require__(14);
|
10905 | var definePropertyModule = __webpack_require__(20);
|
10906 | var fails = __webpack_require__(7);
|
10907 |
|
10908 |
|
10909 | var ERROR_INSTEAD_OF_FALSE = fails(function () {
|
10910 |
|
10911 | Reflect.defineProperty(definePropertyModule.f({}, 1, { value: 1 }), 1, { value: 2 });
|
10912 | });
|
10913 |
|
10914 |
|
10915 |
|
10916 | $({ target: 'Reflect', stat: true, forced: ERROR_INSTEAD_OF_FALSE, sham: !DESCRIPTORS }, {
|
10917 | defineProperty: function defineProperty(target, propertyKey, attributes) {
|
10918 | anObject(target);
|
10919 | var key = toPrimitive(propertyKey, true);
|
10920 | anObject(attributes);
|
10921 | try {
|
10922 | definePropertyModule.f(target, key, attributes);
|
10923 | return true;
|
10924 | } catch (error) {
|
10925 | return false;
|
10926 | }
|
10927 | }
|
10928 | });
|
10929 |
|
10930 |
|
10931 | }),
|
10932 |
|
10933 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10934 |
|
10935 | var $ = __webpack_require__(3);
|
10936 | var anObject = __webpack_require__(21);
|
10937 | var getOwnPropertyDescriptor = __webpack_require__(5).f;
|
10938 |
|
10939 |
|
10940 |
|
10941 | $({ target: 'Reflect', stat: true }, {
|
10942 | deleteProperty: function deleteProperty(target, propertyKey) {
|
10943 | var descriptor = getOwnPropertyDescriptor(anObject(target), propertyKey);
|
10944 | return descriptor && !descriptor.configurable ? false : delete target[propertyKey];
|
10945 | }
|
10946 | });
|
10947 |
|
10948 |
|
10949 | }),
|
10950 |
|
10951 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10952 |
|
10953 | var $ = __webpack_require__(3);
|
10954 | var isObject = __webpack_require__(15);
|
10955 | var anObject = __webpack_require__(21);
|
10956 | var has = __webpack_require__(16);
|
10957 | var getOwnPropertyDescriptorModule = __webpack_require__(5);
|
10958 | var getPrototypeOf = __webpack_require__(81);
|
10959 |
|
10960 |
|
10961 |
|
10962 | function get(target, propertyKey /* , receiver */) {
|
10963 | var receiver = arguments.length < 3 ? target : arguments[2];
|
10964 | var descriptor, prototype;
|
10965 | if (anObject(target) === receiver) return target[propertyKey];
|
10966 | if (descriptor = getOwnPropertyDescriptorModule.f(target, propertyKey)) return has(descriptor, 'value')
|
10967 | ? descriptor.value
|
10968 | : descriptor.get === undefined
|
10969 | ? undefined
|
10970 | : descriptor.get.call(receiver);
|
10971 | if (isObject(prototype = getPrototypeOf(target))) return get(prototype, propertyKey, receiver);
|
10972 | }
|
10973 |
|
10974 | $({ target: 'Reflect', stat: true }, {
|
10975 | get: get
|
10976 | });
|
10977 |
|
10978 |
|
10979 | /***/ }),
|
10980 | /* 360 */
|
10981 | /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10982 |
|
10983 | var $ = __webpack_require__(3);
|
10984 | var DESCRIPTORS = __webpack_require__(6);
|
10985 | var anObject = __webpack_require__(21);
|
10986 | var getOwnPropertyDescriptorModule = __webpack_require__(5);
|
10987 |
|
10988 |
|
10989 |
|
10990 | $({ target: 'Reflect', stat: true, sham: !DESCRIPTORS }, {
|
10991 | getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) {
|
10992 | return getOwnPropertyDescriptorModule.f(anObject(target), propertyKey);
|
10993 | }
|
10994 | });
|
10995 |
|
10996 |
|
10997 | }),
|
10998 |
|
10999 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11000 |
|
11001 | var $ = __webpack_require__(3);
|
11002 | var anObject = __webpack_require__(21);
|
11003 | var objectGetPrototypeOf = __webpack_require__(81);
|
11004 | var CORRECT_PROTOTYPE_GETTER = __webpack_require__(82);
|
11005 |
|
11006 |
|
11007 |
|
11008 | $({ target: 'Reflect', stat: true, sham: !CORRECT_PROTOTYPE_GETTER }, {
|
11009 | getPrototypeOf: function getPrototypeOf(target) {
|
11010 | return objectGetPrototypeOf(anObject(target));
|
11011 | }
|
11012 | });
|
11013 |
|
11014 |
|
11015 | }),
|
11016 |
|
11017 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11018 |
|
11019 | var $ = __webpack_require__(3);
|
11020 |
|
11021 |
|
11022 |
|
11023 | $({ target: 'Reflect', stat: true }, {
|
11024 | has: function has(target, propertyKey) {
|
11025 | return propertyKey in target;
|
11026 | }
|
11027 | });
|
11028 |
|
11029 |
|
11030 | }),
|
11031 |
|
11032 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11033 |
|
11034 | var $ = __webpack_require__(3);
|
11035 | var anObject = __webpack_require__(21);
|
11036 |
|
11037 | var objectIsExtensible = Object.isExtensible;
|
11038 |
|
11039 |
|
11040 |
|
11041 | $({ target: 'Reflect', stat: true }, {
|
11042 | isExtensible: function isExtensible(target) {
|
11043 | anObject(target);
|
11044 | return objectIsExtensible ? objectIsExtensible(target) : true;
|
11045 | }
|
11046 | });
|
11047 |
|
11048 |
|
11049 | }),
|
11050 |
|
11051 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11052 |
|
11053 | var $ = __webpack_require__(3);
|
11054 | var ownKeys = __webpack_require__(34);
|
11055 |
|
11056 |
|
11057 |
|
11058 | $({ target: 'Reflect', stat: true }, {
|
11059 | ownKeys: ownKeys
|
11060 | });
|
11061 |
|
11062 |
|
11063 | }),
|
11064 |
|
11065 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11066 |
|
11067 | var $ = __webpack_require__(3);
|
11068 | var getBuiltIn = __webpack_require__(35);
|
11069 | var anObject = __webpack_require__(21);
|
11070 | var FREEZING = __webpack_require__(151);
|
11071 |
|
11072 |
|
11073 |
|
11074 | $({ target: 'Reflect', stat: true, sham: !FREEZING }, {
|
11075 | preventExtensions: function preventExtensions(target) {
|
11076 | anObject(target);
|
11077 | try {
|
11078 | var objectPreventExtensions = getBuiltIn('Object', 'preventExtensions');
|
11079 | if (objectPreventExtensions) objectPreventExtensions(target);
|
11080 | return true;
|
11081 | } catch (error) {
|
11082 | return false;
|
11083 | }
|
11084 | }
|
11085 | });
|
11086 |
|
11087 |
|
11088 | }),
|
11089 |
|
11090 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11091 |
|
11092 | var $ = __webpack_require__(3);
|
11093 | var anObject = __webpack_require__(21);
|
11094 | var isObject = __webpack_require__(15);
|
11095 | var has = __webpack_require__(16);
|
11096 | var fails = __webpack_require__(7);
|
11097 | var definePropertyModule = __webpack_require__(20);
|
11098 | var getOwnPropertyDescriptorModule = __webpack_require__(5);
|
11099 | var getPrototypeOf = __webpack_require__(81);
|
11100 | var createPropertyDescriptor = __webpack_require__(9);
|
11101 |
|
11102 |
|
11103 |
|
11104 | function set(target, propertyKey, V /* , receiver */) {
|
11105 | var receiver = arguments.length < 4 ? target : arguments[3];
|
11106 | var ownDescriptor = getOwnPropertyDescriptorModule.f(anObject(target), propertyKey);
|
11107 | var existingDescriptor, prototype;
|
11108 | if (!ownDescriptor) {
|
11109 | if (isObject(prototype = getPrototypeOf(target))) {
|
11110 | return set(prototype, propertyKey, V, receiver);
|
11111 | }
|
11112 | ownDescriptor = createPropertyDescriptor(0);
|
11113 | }
|
11114 | if (has(ownDescriptor, 'value')) {
|
11115 | if (ownDescriptor.writable === false || !isObject(receiver)) return false;
|
11116 | if (existingDescriptor = getOwnPropertyDescriptorModule.f(receiver, propertyKey)) {
|
11117 | if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false;
|
11118 | existingDescriptor.value = V;
|
11119 | definePropertyModule.f(receiver, propertyKey, existingDescriptor);
|
11120 | } else definePropertyModule.f(receiver, propertyKey, createPropertyDescriptor(0, V));
|
11121 | return true;
|
11122 | }
|
11123 | return ownDescriptor.set === undefined ? false : (ownDescriptor.set.call(receiver, V), true);
|
11124 | }
|
11125 |
|
11126 |
|
11127 |
|
11128 | var MS_EDGE_BUG = fails(function () {
|
11129 | var Constructor = function () { };
|
11130 | var object = definePropertyModule.f(new Constructor(), 'a', { configurable: true });
|
11131 |
|
11132 | return Reflect.set(Constructor.prototype, 'a', 1, object) !== false;
|
11133 | });
|
11134 |
|
11135 | $({ target: 'Reflect', stat: true, forced: MS_EDGE_BUG }, {
|
11136 | set: set
|
11137 | });
|
11138 |
|
11139 |
|
11140 | /***/ }),
|
11141 | /* 367 */
|
11142 | /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11143 |
|
11144 | var $ = __webpack_require__(3);
|
11145 | var anObject = __webpack_require__(21);
|
11146 | var aPossiblePrototype = __webpack_require__(84);
|
11147 | var objectSetPrototypeOf = __webpack_require__(83);
|
11148 |
|
11149 |
|
11150 |
|
11151 | if (objectSetPrototypeOf) $({ target: 'Reflect', stat: true }, {
|
11152 | setPrototypeOf: function setPrototypeOf(target, proto) {
|
11153 | anObject(target);
|
11154 | aPossiblePrototype(proto);
|
11155 | try {
|
11156 | objectSetPrototypeOf(target, proto);
|
11157 | return true;
|
11158 | } catch (error) {
|
11159 | return false;
|
11160 | }
|
11161 | }
|
11162 | });
|
11163 |
|
11164 |
|
11165 | }),
|
11166 |
|
11167 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11168 |
|
11169 | var $ = __webpack_require__(3);
|
11170 | var global = __webpack_require__(4);
|
11171 | var setToStringTag = __webpack_require__(61);
|
11172 |
|
11173 | $({ global: true }, { Reflect: {} });
|
11174 |
|
11175 |
|
11176 |
|
11177 | setToStringTag(global.Reflect, 'Reflect', true);
|
11178 |
|
11179 |
|
11180 | }),
|
11181 |
|
11182 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
11183 |
|
11184 | __webpack_require__(370);
|
11185 | __webpack_require__(372);
|
11186 | __webpack_require__(373);
|
11187 | __webpack_require__(374);
|
11188 | __webpack_require__(375);
|
11189 | __webpack_require__(376);
|
11190 | __webpack_require__(381);
|
11191 | __webpack_require__(379);
|
11192 | var path = __webpack_require__(36);
|
11193 |
|
11194 | module.exports = path;
|
11195 |
|
11196 |
|
11197 | }),
|
11198 |
|
11199 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11200 |
|
11201 | var global = __webpack_require__(4);
|
11202 | var DOMIterables = __webpack_require__(371);
|
11203 | var forEach = __webpack_require__(115);
|
11204 | var createNonEnumerableProperty = __webpack_require__(19);
|
11205 |
|
11206 | for (var COLLECTION_NAME in DOMIterables) {
|
11207 | var Collection = global[COLLECTION_NAME];
|
11208 | var CollectionPrototype = Collection && Collection.prototype;
|
11209 |
|
11210 | if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {
|
11211 | createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach);
|
11212 | } catch (error) {
|
11213 | CollectionPrototype.forEach = forEach;
|
11214 | }
|
11215 | }
|
11216 |
|
11217 |
|
11218 | }),
|
11219 |
|
11220 | (function(module) {
|
11221 |
|
11222 |
|
11223 |
|
11224 | module.exports = {
|
11225 | CSSRuleList: 0,
|
11226 | CSSStyleDeclaration: 0,
|
11227 | CSSValueList: 0,
|
11228 | ClientRectList: 0,
|
11229 | DOMRectList: 0,
|
11230 | DOMStringList: 0,
|
11231 | DOMTokenList: 1,
|
11232 | DataTransferItemList: 0,
|
11233 | FileList: 0,
|
11234 | HTMLAllCollection: 0,
|
11235 | HTMLCollection: 0,
|
11236 | HTMLFormElement: 0,
|
11237 | HTMLSelectElement: 0,
|
11238 | MediaList: 0,
|
11239 | MimeTypeArray: 0,
|
11240 | NamedNodeMap: 0,
|
11241 | NodeList: 1,
|
11242 | PaintRequestList: 0,
|
11243 | Plugin: 0,
|
11244 | PluginArray: 0,
|
11245 | SVGLengthList: 0,
|
11246 | SVGNumberList: 0,
|
11247 | SVGPathSegList: 0,
|
11248 | SVGPointList: 0,
|
11249 | SVGStringList: 0,
|
11250 | SVGTransformList: 0,
|
11251 | SourceBufferList: 0,
|
11252 | StyleSheetList: 0,
|
11253 | TextTrackCueList: 0,
|
11254 | TextTrackList: 0,
|
11255 | TouchList: 0
|
11256 | };
|
11257 |
|
11258 |
|
11259 | }),
|
11260 |
|
11261 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11262 |
|
11263 | var global = __webpack_require__(4);
|
11264 | var DOMIterables = __webpack_require__(371);
|
11265 | var ArrayIteratorMethods = __webpack_require__(134);
|
11266 | var createNonEnumerableProperty = __webpack_require__(19);
|
11267 | var wellKnownSymbol = __webpack_require__(58);
|
11268 |
|
11269 | var ITERATOR = wellKnownSymbol('iterator');
|
11270 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
11271 | var ArrayValues = ArrayIteratorMethods.values;
|
11272 |
|
11273 | for (var COLLECTION_NAME in DOMIterables) {
|
11274 | var Collection = global[COLLECTION_NAME];
|
11275 | var CollectionPrototype = Collection && Collection.prototype;
|
11276 | if (CollectionPrototype) {
|
11277 |
|
11278 | if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
|
11279 | createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
|
11280 | } catch (error) {
|
11281 | CollectionPrototype[ITERATOR] = ArrayValues;
|
11282 | }
|
11283 | if (!CollectionPrototype[TO_STRING_TAG]) {
|
11284 | createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
|
11285 | }
|
11286 | if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
|
11287 |
|
11288 | if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
|
11289 | createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
|
11290 | } catch (error) {
|
11291 | CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
|
11292 | }
|
11293 | }
|
11294 | }
|
11295 | }
|
11296 |
|
11297 |
|
11298 | }),
|
11299 |
|
11300 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11301 |
|
11302 | var $ = __webpack_require__(3);
|
11303 | var global = __webpack_require__(4);
|
11304 | var task = __webpack_require__(288);
|
11305 |
|
11306 | var FORCED = !global.setImmediate || !global.clearImmediate;
|
11307 |
|
11308 |
|
11309 | $({ global: true, bind: true, enumerable: true, forced: FORCED }, {
|
11310 |
|
11311 |
|
11312 | setImmediate: task.set,
|
11313 |
|
11314 |
|
11315 | clearImmediate: task.clear
|
11316 | });
|
11317 |
|
11318 |
|
11319 | }),
|
11320 |
|
11321 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11322 |
|
11323 | var $ = __webpack_require__(3);
|
11324 | var global = __webpack_require__(4);
|
11325 | var microtask = __webpack_require__(290);
|
11326 | var IS_NODE = __webpack_require__(47);
|
11327 |
|
11328 | var process = global.process;
|
11329 |
|
11330 |
|
11331 |
|
11332 | $({ global: true, enumerable: true, noTargetGet: true }, {
|
11333 | queueMicrotask: function queueMicrotask(fn) {
|
11334 | var domain = IS_NODE && process.domain;
|
11335 | microtask(domain ? domain.bind(fn) : fn);
|
11336 | }
|
11337 | });
|
11338 |
|
11339 |
|
11340 | }),
|
11341 |
|
11342 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11343 |
|
11344 | var $ = __webpack_require__(3);
|
11345 | var global = __webpack_require__(4);
|
11346 | var userAgent = __webpack_require__(49);
|
11347 |
|
11348 | var slice = [].slice;
|
11349 | var MSIE = /MSIE .\./.test(userAgent);
|
11350 |
|
11351 | var wrap = function (scheduler) {
|
11352 | return function (handler, timeout /* , ...arguments */) {
|
11353 | var boundArgs = arguments.length > 2;
|
11354 | var args = boundArgs ? slice.call(arguments, 2) : undefined;
|
11355 | return scheduler(boundArgs ? function () {
|
11356 |
|
11357 | (typeof handler == 'function' ? handler : Function(handler)).apply(this, args);
|
11358 | } : handler, timeout);
|
11359 | };
|
11360 | };
|
11361 |
|
11362 |
|
11363 |
|
11364 | $({ global: true, bind: true, forced: MSIE }, {
|
11365 |
|
11366 |
|
11367 | setTimeout: wrap(global.setTimeout),
|
11368 |
|
11369 |
|
11370 | setInterval: wrap(global.setInterval)
|
11371 | });
|
11372 |
|
11373 |
|
11374 | }),
|
11375 |
|
11376 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11377 |
|
11378 | "use strict";
|
11379 |
|
11380 |
|
11381 | __webpack_require__(211);
|
11382 | var $ = __webpack_require__(3);
|
11383 | var DESCRIPTORS = __webpack_require__(6);
|
11384 | var USE_NATIVE_URL = __webpack_require__(377);
|
11385 | var global = __webpack_require__(4);
|
11386 | var defineProperties = __webpack_require__(54);
|
11387 | var redefine = __webpack_require__(22);
|
11388 | var anInstance = __webpack_require__(287);
|
11389 | var has = __webpack_require__(16);
|
11390 | var assign = __webpack_require__(144);
|
11391 | var arrayFrom = __webpack_require__(93);
|
11392 | var codeAt = __webpack_require__(178).codeAt;
|
11393 | var toASCII = __webpack_require__(378);
|
11394 | var setToStringTag = __webpack_require__(61);
|
11395 | var URLSearchParamsModule = __webpack_require__(379);
|
11396 | var InternalStateModule = __webpack_require__(26);
|
11397 |
|
11398 | var NativeURL = global.URL;
|
11399 | var URLSearchParams = URLSearchParamsModule.URLSearchParams;
|
11400 | var getInternalSearchParamsState = URLSearchParamsModule.getState;
|
11401 | var setInternalState = InternalStateModule.set;
|
11402 | var getInternalURLState = InternalStateModule.getterFor('URL');
|
11403 | var floor = Math.floor;
|
11404 | var pow = Math.pow;
|
11405 |
|
11406 | var INVALID_AUTHORITY = 'Invalid authority';
|
11407 | var INVALID_SCHEME = 'Invalid scheme';
|
11408 | var INVALID_HOST = 'Invalid host';
|
11409 | var INVALID_PORT = 'Invalid port';
|
11410 |
|
11411 | var ALPHA = /[A-Za-z]/;
|
11412 | var ALPHANUMERIC = /[\d+-.A-Za-z]/;
|
11413 | var DIGIT = /\d/;
|
11414 | var HEX_START = /^(0x|0X)/;
|
11415 | var OCT = /^[0-7]+$/;
|
11416 | var DEC = /^\d+$/;
|
11417 | var HEX = /^[\dA-Fa-f]+$/;
|
11418 |
|
11419 | var FORBIDDEN_HOST_CODE_POINT = /[\u0000\t\u000A\u000D #%/:?@[\\]]/;
|
11420 | var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\u0000\t\u000A\u000D #/:?@[\\]]/;
|
11421 | var LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g;
|
11422 | var TAB_AND_NEW_LINE = /[\t\u000A\u000D]/g;
|
11423 |
|
11424 | var EOF;
|
11425 |
|
11426 | var parseHost = function (url, input) {
|
11427 | var result, codePoints, index;
|
11428 | if (input.charAt(0) == '[') {
|
11429 | if (input.charAt(input.length - 1) != ']') return INVALID_HOST;
|
11430 | result = parseIPv6(input.slice(1, -1));
|
11431 | if (!result) return INVALID_HOST;
|
11432 | url.host = result;
|
11433 |
|
11434 | } else if (!isSpecial(url)) {
|
11435 | if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input)) return INVALID_HOST;
|
11436 | result = '';
|
11437 | codePoints = arrayFrom(input);
|
11438 | for (index = 0; index < codePoints.length; index++) {
|
11439 | result += percentEncode(codePoints[index], C0ControlPercentEncodeSet);
|
11440 | }
|
11441 | url.host = result;
|
11442 | } else {
|
11443 | input = toASCII(input);
|
11444 | if (FORBIDDEN_HOST_CODE_POINT.test(input)) return INVALID_HOST;
|
11445 | result = parseIPv4(input);
|
11446 | if (result === null) return INVALID_HOST;
|
11447 | url.host = result;
|
11448 | }
|
11449 | };
|
11450 |
|
11451 | var parseIPv4 = function (input) {
|
11452 | var parts = input.split('.');
|
11453 | var partsLength, numbers, index, part, radix, number, ipv4;
|
11454 | if (parts.length && parts[parts.length - 1] == '') {
|
11455 | parts.pop();
|
11456 | }
|
11457 | partsLength = parts.length;
|
11458 | if (partsLength > 4) return input;
|
11459 | numbers = [];
|
11460 | for (index = 0; index < partsLength; index++) {
|
11461 | part = parts[index];
|
11462 | if (part == '') return input;
|
11463 | radix = 10;
|
11464 | if (part.length > 1 && part.charAt(0) == '0') {
|
11465 | radix = HEX_START.test(part) ? 16 : 8;
|
11466 | part = part.slice(radix == 8 ? 1 : 2);
|
11467 | }
|
11468 | if (part === '') {
|
11469 | number = 0;
|
11470 | } else {
|
11471 | if (!(radix == 10 ? DEC : radix == 8 ? OCT : HEX).test(part)) return input;
|
11472 | number = parseInt(part, radix);
|
11473 | }
|
11474 | numbers.push(number);
|
11475 | }
|
11476 | for (index = 0; index < partsLength; index++) {
|
11477 | number = numbers[index];
|
11478 | if (index == partsLength - 1) {
|
11479 | if (number >= pow(256, 5 - partsLength)) return null;
|
11480 | } else if (number > 255) return null;
|
11481 | }
|
11482 | ipv4 = numbers.pop();
|
11483 | for (index = 0; index < numbers.length; index++) {
|
11484 | ipv4 += numbers[index] * pow(256, 3 - index);
|
11485 | }
|
11486 | return ipv4;
|
11487 | };
|
11488 |
|
11489 |
|
11490 | var parseIPv6 = function (input) {
|
11491 | var address = [0, 0, 0, 0, 0, 0, 0, 0];
|
11492 | var pieceIndex = 0;
|
11493 | var compress = null;
|
11494 | var pointer = 0;
|
11495 | var value, length, numbersSeen, ipv4Piece, number, swaps, swap;
|
11496 |
|
11497 | var char = function () {
|
11498 | return input.charAt(pointer);
|
11499 | };
|
11500 |
|
11501 | if (char() == ':') {
|
11502 | if (input.charAt(1) != ':') return;
|
11503 | pointer += 2;
|
11504 | pieceIndex++;
|
11505 | compress = pieceIndex;
|
11506 | }
|
11507 | while (char()) {
|
11508 | if (pieceIndex == 8) return;
|
11509 | if (char() == ':') {
|
11510 | if (compress !== null) return;
|
11511 | pointer++;
|
11512 | pieceIndex++;
|
11513 | compress = pieceIndex;
|
11514 | continue;
|
11515 | }
|
11516 | value = length = 0;
|
11517 | while (length < 4 && HEX.test(char())) {
|
11518 | value = value * 16 + parseInt(char(), 16);
|
11519 | pointer++;
|
11520 | length++;
|
11521 | }
|
11522 | if (char() == '.') {
|
11523 | if (length == 0) return;
|
11524 | pointer -= length;
|
11525 | if (pieceIndex > 6) return;
|
11526 | numbersSeen = 0;
|
11527 | while (char()) {
|
11528 | ipv4Piece = null;
|
11529 | if (numbersSeen > 0) {
|
11530 | if (char() == '.' && numbersSeen < 4) pointer++;
|
11531 | else return;
|
11532 | }
|
11533 | if (!DIGIT.test(char())) return;
|
11534 | while (DIGIT.test(char())) {
|
11535 | number = parseInt(char(), 10);
|
11536 | if (ipv4Piece === null) ipv4Piece = number;
|
11537 | else if (ipv4Piece == 0) return;
|
11538 | else ipv4Piece = ipv4Piece * 10 + number;
|
11539 | if (ipv4Piece > 255) return;
|
11540 | pointer++;
|
11541 | }
|
11542 | address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece;
|
11543 | numbersSeen++;
|
11544 | if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++;
|
11545 | }
|
11546 | if (numbersSeen != 4) return;
|
11547 | break;
|
11548 | } else if (char() == ':') {
|
11549 | pointer++;
|
11550 | if (!char()) return;
|
11551 | } else if (char()) return;
|
11552 | address[pieceIndex++] = value;
|
11553 | }
|
11554 | if (compress !== null) {
|
11555 | swaps = pieceIndex - compress;
|
11556 | pieceIndex = 7;
|
11557 | while (pieceIndex != 0 && swaps > 0) {
|
11558 | swap = address[pieceIndex];
|
11559 | address[pieceIndex--] = address[compress + swaps - 1];
|
11560 | address[compress + --swaps] = swap;
|
11561 | }
|
11562 | } else if (pieceIndex != 8) return;
|
11563 | return address;
|
11564 | };
|
11565 |
|
11566 | var findLongestZeroSequence = function (ipv6) {
|
11567 | var maxIndex = null;
|
11568 | var maxLength = 1;
|
11569 | var currStart = null;
|
11570 | var currLength = 0;
|
11571 | var index = 0;
|
11572 | for (; index < 8; index++) {
|
11573 | if (ipv6[index] !== 0) {
|
11574 | if (currLength > maxLength) {
|
11575 | maxIndex = currStart;
|
11576 | maxLength = currLength;
|
11577 | }
|
11578 | currStart = null;
|
11579 | currLength = 0;
|
11580 | } else {
|
11581 | if (currStart === null) currStart = index;
|
11582 | ++currLength;
|
11583 | }
|
11584 | }
|
11585 | if (currLength > maxLength) {
|
11586 | maxIndex = currStart;
|
11587 | maxLength = currLength;
|
11588 | }
|
11589 | return maxIndex;
|
11590 | };
|
11591 |
|
11592 | var serializeHost = function (host) {
|
11593 | var result, index, compress, ignore0;
|
11594 |
|
11595 | if (typeof host == 'number') {
|
11596 | result = [];
|
11597 | for (index = 0; index < 4; index++) {
|
11598 | result.unshift(host % 256);
|
11599 | host = floor(host / 256);
|
11600 | } return result.join('.');
|
11601 |
|
11602 | } else if (typeof host == 'object') {
|
11603 | result = '';
|
11604 | compress = findLongestZeroSequence(host);
|
11605 | for (index = 0; index < 8; index++) {
|
11606 | if (ignore0 && host[index] === 0) continue;
|
11607 | if (ignore0) ignore0 = false;
|
11608 | if (compress === index) {
|
11609 | result += index ? ':' : '::';
|
11610 | ignore0 = true;
|
11611 | } else {
|
11612 | result += host[index].toString(16);
|
11613 | if (index < 7) result += ':';
|
11614 | }
|
11615 | }
|
11616 | return '[' + result + ']';
|
11617 | } return host;
|
11618 | };
|
11619 |
|
11620 | var C0ControlPercentEncodeSet = {};
|
11621 | var fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, {
|
11622 | ' ': 1, '"': 1, '<': 1, '>': 1, '`': 1
|
11623 | });
|
11624 | var pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, {
|
11625 | '#': 1, '?': 1, '{': 1, '}': 1
|
11626 | });
|
11627 | var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, {
|
11628 | '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\': 1, ']': 1, '^': 1, '|': 1
|
11629 | });
|
11630 |
|
11631 | var percentEncode = function (char, set) {
|
11632 | var code = codeAt(char, 0);
|
11633 | return code > 0x20 && code < 0x7F && !has(set, char) ? char : encodeURIComponent(char);
|
11634 | };
|
11635 |
|
11636 | var specialSchemes = {
|
11637 | ftp: 21,
|
11638 | file: null,
|
11639 | http: 80,
|
11640 | https: 443,
|
11641 | ws: 80,
|
11642 | wss: 443
|
11643 | };
|
11644 |
|
11645 | var isSpecial = function (url) {
|
11646 | return has(specialSchemes, url.scheme);
|
11647 | };
|
11648 |
|
11649 | var includesCredentials = function (url) {
|
11650 | return url.username != '' || url.password != '';
|
11651 | };
|
11652 |
|
11653 | var cannotHaveUsernamePasswordPort = function (url) {
|
11654 | return !url.host || url.cannotBeABaseURL || url.scheme == 'file';
|
11655 | };
|
11656 |
|
11657 | var isWindowsDriveLetter = function (string, normalized) {
|
11658 | var second;
|
11659 | return string.length == 2 && ALPHA.test(string.charAt(0))
|
11660 | && ((second = string.charAt(1)) == ':' || (!normalized && second == '|'));
|
11661 | };
|
11662 |
|
11663 | var startsWithWindowsDriveLetter = function (string) {
|
11664 | var third;
|
11665 | return string.length > 1 && isWindowsDriveLetter(string.slice(0, 2)) && (
|
11666 | string.length == 2 ||
|
11667 | ((third = string.charAt(2)) === '/' || third === '\\' || third === '?' || third === '#')
|
11668 | );
|
11669 | };
|
11670 |
|
11671 | var shortenURLsPath = function (url) {
|
11672 | var path = url.path;
|
11673 | var pathSize = path.length;
|
11674 | if (pathSize && (url.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) {
|
11675 | path.pop();
|
11676 | }
|
11677 | };
|
11678 |
|
11679 | var isSingleDot = function (segment) {
|
11680 | return segment === '.' || segment.toLowerCase() === '%2e';
|
11681 | };
|
11682 |
|
11683 | var isDoubleDot = function (segment) {
|
11684 | segment = segment.toLowerCase();
|
11685 | return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e';
|
11686 | };
|
11687 |
|
11688 |
|
11689 | var SCHEME_START = {};
|
11690 | var SCHEME = {};
|
11691 | var NO_SCHEME = {};
|
11692 | var SPECIAL_RELATIVE_OR_AUTHORITY = {};
|
11693 | var PATH_OR_AUTHORITY = {};
|
11694 | var RELATIVE = {};
|
11695 | var RELATIVE_SLASH = {};
|
11696 | var SPECIAL_AUTHORITY_SLASHES = {};
|
11697 | var SPECIAL_AUTHORITY_IGNORE_SLASHES = {};
|
11698 | var AUTHORITY = {};
|
11699 | var HOST = {};
|
11700 | var HOSTNAME = {};
|
11701 | var PORT = {};
|
11702 | var FILE = {};
|
11703 | var FILE_SLASH = {};
|
11704 | var FILE_HOST = {};
|
11705 | var PATH_START = {};
|
11706 | var PATH = {};
|
11707 | var CANNOT_BE_A_BASE_URL_PATH = {};
|
11708 | var QUERY = {};
|
11709 | var FRAGMENT = {};
|
11710 |
|
11711 |
|
11712 | var parseURL = function (url, input, stateOverride, base) {
|
11713 | var state = stateOverride || SCHEME_START;
|
11714 | var pointer = 0;
|
11715 | var buffer = '';
|
11716 | var seenAt = false;
|
11717 | var seenBracket = false;
|
11718 | var seenPasswordToken = false;
|
11719 | var codePoints, char, bufferCodePoints, failure;
|
11720 |
|
11721 | if (!stateOverride) {
|
11722 | url.scheme = '';
|
11723 | url.username = '';
|
11724 | url.password = '';
|
11725 | url.host = null;
|
11726 | url.port = null;
|
11727 | url.path = [];
|
11728 | url.query = null;
|
11729 | url.fragment = null;
|
11730 | url.cannotBeABaseURL = false;
|
11731 | input = input.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, '');
|
11732 | }
|
11733 |
|
11734 | input = input.replace(TAB_AND_NEW_LINE, '');
|
11735 |
|
11736 | codePoints = arrayFrom(input);
|
11737 |
|
11738 | while (pointer <= codePoints.length) {
|
11739 | char = codePoints[pointer];
|
11740 | switch (state) {
|
11741 | case SCHEME_START:
|
11742 | if (char && ALPHA.test(char)) {
|
11743 | buffer += char.toLowerCase();
|
11744 | state = SCHEME;
|
11745 | } else if (!stateOverride) {
|
11746 | state = NO_SCHEME;
|
11747 | continue;
|
11748 | } else return INVALID_SCHEME;
|
11749 | break;
|
11750 |
|
11751 | case SCHEME:
|
11752 | if (char && (ALPHANUMERIC.test(char) || char == '+' || char == '-' || char == '.')) {
|
11753 | buffer += char.toLowerCase();
|
11754 | } else if (char == ':') {
|
11755 | if (stateOverride && (
|
11756 | (isSpecial(url) != has(specialSchemes, buffer)) ||
|
11757 | (buffer == 'file' && (includesCredentials(url) || url.port !== null)) ||
|
11758 | (url.scheme == 'file' && !url.host)
|
11759 | )) return;
|
11760 | url.scheme = buffer;
|
11761 | if (stateOverride) {
|
11762 | if (isSpecial(url) && specialSchemes[url.scheme] == url.port) url.port = null;
|
11763 | return;
|
11764 | }
|
11765 | buffer = '';
|
11766 | if (url.scheme == 'file') {
|
11767 | state = FILE;
|
11768 | } else if (isSpecial(url) && base && base.scheme == url.scheme) {
|
11769 | state = SPECIAL_RELATIVE_OR_AUTHORITY;
|
11770 | } else if (isSpecial(url)) {
|
11771 | state = SPECIAL_AUTHORITY_SLASHES;
|
11772 | } else if (codePoints[pointer + 1] == '/') {
|
11773 | state = PATH_OR_AUTHORITY;
|
11774 | pointer++;
|
11775 | } else {
|
11776 | url.cannotBeABaseURL = true;
|
11777 | url.path.push('');
|
11778 | state = CANNOT_BE_A_BASE_URL_PATH;
|
11779 | }
|
11780 | } else if (!stateOverride) {
|
11781 | buffer = '';
|
11782 | state = NO_SCHEME;
|
11783 | pointer = 0;
|
11784 | continue;
|
11785 | } else return INVALID_SCHEME;
|
11786 | break;
|
11787 |
|
11788 | case NO_SCHEME:
|
11789 | if (!base || (base.cannotBeABaseURL && char != '#')) return INVALID_SCHEME;
|
11790 | if (base.cannotBeABaseURL && char == '#') {
|
11791 | url.scheme = base.scheme;
|
11792 | url.path = base.path.slice();
|
11793 | url.query = base.query;
|
11794 | url.fragment = '';
|
11795 | url.cannotBeABaseURL = true;
|
11796 | state = FRAGMENT;
|
11797 | break;
|
11798 | }
|
11799 | state = base.scheme == 'file' ? FILE : RELATIVE;
|
11800 | continue;
|
11801 |
|
11802 | case SPECIAL_RELATIVE_OR_AUTHORITY:
|
11803 | if (char == '/' && codePoints[pointer + 1] == '/') {
|
11804 | state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
|
11805 | pointer++;
|
11806 | } else {
|
11807 | state = RELATIVE;
|
11808 | continue;
|
11809 | } break;
|
11810 |
|
11811 | case PATH_OR_AUTHORITY:
|
11812 | if (char == '/') {
|
11813 | state = AUTHORITY;
|
11814 | break;
|
11815 | } else {
|
11816 | state = PATH;
|
11817 | continue;
|
11818 | }
|
11819 |
|
11820 | case RELATIVE:
|
11821 | url.scheme = base.scheme;
|
11822 | if (char == EOF) {
|
11823 | url.username = base.username;
|
11824 | url.password = base.password;
|
11825 | url.host = base.host;
|
11826 | url.port = base.port;
|
11827 | url.path = base.path.slice();
|
11828 | url.query = base.query;
|
11829 | } else if (char == '/' || (char == '\\' && isSpecial(url))) {
|
11830 | state = RELATIVE_SLASH;
|
11831 | } else if (char == '?') {
|
11832 | url.username = base.username;
|
11833 | url.password = base.password;
|
11834 | url.host = base.host;
|
11835 | url.port = base.port;
|
11836 | url.path = base.path.slice();
|
11837 | url.query = '';
|
11838 | state = QUERY;
|
11839 | } else if (char == '#') {
|
11840 | url.username = base.username;
|
11841 | url.password = base.password;
|
11842 | url.host = base.host;
|
11843 | url.port = base.port;
|
11844 | url.path = base.path.slice();
|
11845 | url.query = base.query;
|
11846 | url.fragment = '';
|
11847 | state = FRAGMENT;
|
11848 | } else {
|
11849 | url.username = base.username;
|
11850 | url.password = base.password;
|
11851 | url.host = base.host;
|
11852 | url.port = base.port;
|
11853 | url.path = base.path.slice();
|
11854 | url.path.pop();
|
11855 | state = PATH;
|
11856 | continue;
|
11857 | } break;
|
11858 |
|
11859 | case RELATIVE_SLASH:
|
11860 | if (isSpecial(url) && (char == '/' || char == '\\')) {
|
11861 | state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
|
11862 | } else if (char == '/') {
|
11863 | state = AUTHORITY;
|
11864 | } else {
|
11865 | url.username = base.username;
|
11866 | url.password = base.password;
|
11867 | url.host = base.host;
|
11868 | url.port = base.port;
|
11869 | state = PATH;
|
11870 | continue;
|
11871 | } break;
|
11872 |
|
11873 | case SPECIAL_AUTHORITY_SLASHES:
|
11874 | state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
|
11875 | if (char != '/' || buffer.charAt(pointer + 1) != '/') continue;
|
11876 | pointer++;
|
11877 | break;
|
11878 |
|
11879 | case SPECIAL_AUTHORITY_IGNORE_SLASHES:
|
11880 | if (char != '/' && char != '\\') {
|
11881 | state = AUTHORITY;
|
11882 | continue;
|
11883 | } break;
|
11884 |
|
11885 | case AUTHORITY:
|
11886 | if (char == '@') {
|
11887 | if (seenAt) buffer = '%40' + buffer;
|
11888 | seenAt = true;
|
11889 | bufferCodePoints = arrayFrom(buffer);
|
11890 | for (var i = 0; i < bufferCodePoints.length; i++) {
|
11891 | var codePoint = bufferCodePoints[i];
|
11892 | if (codePoint == ':' && !seenPasswordToken) {
|
11893 | seenPasswordToken = true;
|
11894 | continue;
|
11895 | }
|
11896 | var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet);
|
11897 | if (seenPasswordToken) url.password += encodedCodePoints;
|
11898 | else url.username += encodedCodePoints;
|
11899 | }
|
11900 | buffer = '';
|
11901 | } else if (
|
11902 | char == EOF || char == '/' || char == '?' || char == '#' ||
|
11903 | (char == '\\' && isSpecial(url))
|
11904 | ) {
|
11905 | if (seenAt && buffer == '') return INVALID_AUTHORITY;
|
11906 | pointer -= arrayFrom(buffer).length + 1;
|
11907 | buffer = '';
|
11908 | state = HOST;
|
11909 | } else buffer += char;
|
11910 | break;
|
11911 |
|
11912 | case HOST:
|
11913 | case HOSTNAME:
|
11914 | if (stateOverride && url.scheme == 'file') {
|
11915 | state = FILE_HOST;
|
11916 | continue;
|
11917 | } else if (char == ':' && !seenBracket) {
|
11918 | if (buffer == '') return INVALID_HOST;
|
11919 | failure = parseHost(url, buffer);
|
11920 | if (failure) return failure;
|
11921 | buffer = '';
|
11922 | state = PORT;
|
11923 | if (stateOverride == HOSTNAME) return;
|
11924 | } else if (
|
11925 | char == EOF || char == '/' || char == '?' || char == '#' ||
|
11926 | (char == '\\' && isSpecial(url))
|
11927 | ) {
|
11928 | if (isSpecial(url) && buffer == '') return INVALID_HOST;
|
11929 | if (stateOverride && buffer == '' && (includesCredentials(url) || url.port !== null)) return;
|
11930 | failure = parseHost(url, buffer);
|
11931 | if (failure) return failure;
|
11932 | buffer = '';
|
11933 | state = PATH_START;
|
11934 | if (stateOverride) return;
|
11935 | continue;
|
11936 | } else {
|
11937 | if (char == '[') seenBracket = true;
|
11938 | else if (char == ']') seenBracket = false;
|
11939 | buffer += char;
|
11940 | } break;
|
11941 |
|
11942 | case PORT:
|
11943 | if (DIGIT.test(char)) {
|
11944 | buffer += char;
|
11945 | } else if (
|
11946 | char == EOF || char == '/' || char == '?' || char == '#' ||
|
11947 | (char == '\\' && isSpecial(url)) ||
|
11948 | stateOverride
|
11949 | ) {
|
11950 | if (buffer != '') {
|
11951 | var port = parseInt(buffer, 10);
|
11952 | if (port > 0xFFFF) return INVALID_PORT;
|
11953 | url.port = (isSpecial(url) && port === specialSchemes[url.scheme]) ? null : port;
|
11954 | buffer = '';
|
11955 | }
|
11956 | if (stateOverride) return;
|
11957 | state = PATH_START;
|
11958 | continue;
|
11959 | } else return INVALID_PORT;
|
11960 | break;
|
11961 |
|
11962 | case FILE:
|
11963 | url.scheme = 'file';
|
11964 | if (char == '/' || char == '\\') state = FILE_SLASH;
|
11965 | else if (base && base.scheme == 'file') {
|
11966 | if (char == EOF) {
|
11967 | url.host = base.host;
|
11968 | url.path = base.path.slice();
|
11969 | url.query = base.query;
|
11970 | } else if (char == '?') {
|
11971 | url.host = base.host;
|
11972 | url.path = base.path.slice();
|
11973 | url.query = '';
|
11974 | state = QUERY;
|
11975 | } else if (char == '#') {
|
11976 | url.host = base.host;
|
11977 | url.path = base.path.slice();
|
11978 | url.query = base.query;
|
11979 | url.fragment = '';
|
11980 | state = FRAGMENT;
|
11981 | } else {
|
11982 | if (!startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {
|
11983 | url.host = base.host;
|
11984 | url.path = base.path.slice();
|
11985 | shortenURLsPath(url);
|
11986 | }
|
11987 | state = PATH;
|
11988 | continue;
|
11989 | }
|
11990 | } else {
|
11991 | state = PATH;
|
11992 | continue;
|
11993 | } break;
|
11994 |
|
11995 | case FILE_SLASH:
|
11996 | if (char == '/' || char == '\\') {
|
11997 | state = FILE_HOST;
|
11998 | break;
|
11999 | }
|
12000 | if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) {
|
12001 | if (isWindowsDriveLetter(base.path[0], true)) url.path.push(base.path[0]);
|
12002 | else url.host = base.host;
|
12003 | }
|
12004 | state = PATH;
|
12005 | continue;
|
12006 |
|
12007 | case FILE_HOST:
|
12008 | if (char == EOF || char == '/' || char == '\\' || char == '?' || char == '#') {
|
12009 | if (!stateOverride && isWindowsDriveLetter(buffer)) {
|
12010 | state = PATH;
|
12011 | } else if (buffer == '') {
|
12012 | url.host = '';
|
12013 | if (stateOverride) return;
|
12014 | state = PATH_START;
|
12015 | } else {
|
12016 | failure = parseHost(url, buffer);
|
12017 | if (failure) return failure;
|
12018 | if (url.host == 'localhost') url.host = '';
|
12019 | if (stateOverride) return;
|
12020 | buffer = '';
|
12021 | state = PATH_START;
|
12022 | } continue;
|
12023 | } else buffer += char;
|
12024 | break;
|
12025 |
|
12026 | case PATH_START:
|
12027 | if (isSpecial(url)) {
|
12028 | state = PATH;
|
12029 | if (char != '/' && char != '\\') continue;
|
12030 | } else if (!stateOverride && char == '?') {
|
12031 | url.query = '';
|
12032 | state = QUERY;
|
12033 | } else if (!stateOverride && char == '#') {
|
12034 | url.fragment = '';
|
12035 | state = FRAGMENT;
|
12036 | } else if (char != EOF) {
|
12037 | state = PATH;
|
12038 | if (char != '/') continue;
|
12039 | } break;
|
12040 |
|
12041 | case PATH:
|
12042 | if (
|
12043 | char == EOF || char == '/' ||
|
12044 | (char == '\\' && isSpecial(url)) ||
|
12045 | (!stateOverride && (char == '?' || char == '#'))
|
12046 | ) {
|
12047 | if (isDoubleDot(buffer)) {
|
12048 | shortenURLsPath(url);
|
12049 | if (char != '/' && !(char == '\\' && isSpecial(url))) {
|
12050 | url.path.push('');
|
12051 | }
|
12052 | } else if (isSingleDot(buffer)) {
|
12053 | if (char != '/' && !(char == '\\' && isSpecial(url))) {
|
12054 | url.path.push('');
|
12055 | }
|
12056 | } else {
|
12057 | if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) {
|
12058 | if (url.host) url.host = '';
|
12059 | buffer = buffer.charAt(0) + ':';
|
12060 | }
|
12061 | url.path.push(buffer);
|
12062 | }
|
12063 | buffer = '';
|
12064 | if (url.scheme == 'file' && (char == EOF || char == '?' || char == '#')) {
|
12065 | while (url.path.length > 1 && url.path[0] === '') {
|
12066 | url.path.shift();
|
12067 | }
|
12068 | }
|
12069 | if (char == '?') {
|
12070 | url.query = '';
|
12071 | state = QUERY;
|
12072 | } else if (char == '#') {
|
12073 | url.fragment = '';
|
12074 | state = FRAGMENT;
|
12075 | }
|
12076 | } else {
|
12077 | buffer += percentEncode(char, pathPercentEncodeSet);
|
12078 | } break;
|
12079 |
|
12080 | case CANNOT_BE_A_BASE_URL_PATH:
|
12081 | if (char == '?') {
|
12082 | url.query = '';
|
12083 | state = QUERY;
|
12084 | } else if (char == '#') {
|
12085 | url.fragment = '';
|
12086 | state = FRAGMENT;
|
12087 | } else if (char != EOF) {
|
12088 | url.path[0] += percentEncode(char, C0ControlPercentEncodeSet);
|
12089 | } break;
|
12090 |
|
12091 | case QUERY:
|
12092 | if (!stateOverride && char == '#') {
|
12093 | url.fragment = '';
|
12094 | state = FRAGMENT;
|
12095 | } else if (char != EOF) {
|
12096 | if (char == "'" && isSpecial(url)) url.query += '%27';
|
12097 | else if (char == '#') url.query += '%23';
|
12098 | else url.query += percentEncode(char, C0ControlPercentEncodeSet);
|
12099 | } break;
|
12100 |
|
12101 | case FRAGMENT:
|
12102 | if (char != EOF) url.fragment += percentEncode(char, fragmentPercentEncodeSet);
|
12103 | break;
|
12104 | }
|
12105 |
|
12106 | pointer++;
|
12107 | }
|
12108 | };
|
12109 |
|
12110 |
|
12111 |
|
12112 | var URLConstructor = function URL(url /* , base */) {
|
12113 | var that = anInstance(this, URLConstructor, 'URL');
|
12114 | var base = arguments.length > 1 ? arguments[1] : undefined;
|
12115 | var urlString = String(url);
|
12116 | var state = setInternalState(that, { type: 'URL' });
|
12117 | var baseState, failure;
|
12118 | if (base !== undefined) {
|
12119 | if (base instanceof URLConstructor) baseState = getInternalURLState(base);
|
12120 | else {
|
12121 | failure = parseURL(baseState = {}, String(base));
|
12122 | if (failure) throw TypeError(failure);
|
12123 | }
|
12124 | }
|
12125 | failure = parseURL(state, urlString, null, baseState);
|
12126 | if (failure) throw TypeError(failure);
|
12127 | var searchParams = state.searchParams = new URLSearchParams();
|
12128 | var searchParamsState = getInternalSearchParamsState(searchParams);
|
12129 | searchParamsState.updateSearchParams(state.query);
|
12130 | searchParamsState.updateURL = function () {
|
12131 | state.query = String(searchParams) || null;
|
12132 | };
|
12133 | if (!DESCRIPTORS) {
|
12134 | that.href = serializeURL.call(that);
|
12135 | that.origin = getOrigin.call(that);
|
12136 | that.protocol = getProtocol.call(that);
|
12137 | that.username = getUsername.call(that);
|
12138 | that.password = getPassword.call(that);
|
12139 | that.host = getHost.call(that);
|
12140 | that.hostname = getHostname.call(that);
|
12141 | that.port = getPort.call(that);
|
12142 | that.pathname = getPathname.call(that);
|
12143 | that.search = getSearch.call(that);
|
12144 | that.searchParams = getSearchParams.call(that);
|
12145 | that.hash = getHash.call(that);
|
12146 | }
|
12147 | };
|
12148 |
|
12149 | var URLPrototype = URLConstructor.prototype;
|
12150 |
|
12151 | var serializeURL = function () {
|
12152 | var url = getInternalURLState(this);
|
12153 | var scheme = url.scheme;
|
12154 | var username = url.username;
|
12155 | var password = url.password;
|
12156 | var host = url.host;
|
12157 | var port = url.port;
|
12158 | var path = url.path;
|
12159 | var query = url.query;
|
12160 | var fragment = url.fragment;
|
12161 | var output = scheme + ':';
|
12162 | if (host !== null) {
|
12163 | output += '//';
|
12164 | if (includesCredentials(url)) {
|
12165 | output += username + (password ? ':' + password : '') + '@';
|
12166 | }
|
12167 | output += serializeHost(host);
|
12168 | if (port !== null) output += ':' + port;
|
12169 | } else if (scheme == 'file') output += '//';
|
12170 | output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';
|
12171 | if (query !== null) output += '?' + query;
|
12172 | if (fragment !== null) output += '#' + fragment;
|
12173 | return output;
|
12174 | };
|
12175 |
|
12176 | var getOrigin = function () {
|
12177 | var url = getInternalURLState(this);
|
12178 | var scheme = url.scheme;
|
12179 | var port = url.port;
|
12180 | if (scheme == 'blob') try {
|
12181 | return new URL(scheme.path[0]).origin;
|
12182 | } catch (error) {
|
12183 | return 'null';
|
12184 | }
|
12185 | if (scheme == 'file' || !isSpecial(url)) return 'null';
|
12186 | return scheme + '://' + serializeHost(url.host) + (port !== null ? ':' + port : '');
|
12187 | };
|
12188 |
|
12189 | var getProtocol = function () {
|
12190 | return getInternalURLState(this).scheme + ':';
|
12191 | };
|
12192 |
|
12193 | var getUsername = function () {
|
12194 | return getInternalURLState(this).username;
|
12195 | };
|
12196 |
|
12197 | var getPassword = function () {
|
12198 | return getInternalURLState(this).password;
|
12199 | };
|
12200 |
|
12201 | var getHost = function () {
|
12202 | var url = getInternalURLState(this);
|
12203 | var host = url.host;
|
12204 | var port = url.port;
|
12205 | return host === null ? ''
|
12206 | : port === null ? serializeHost(host)
|
12207 | : serializeHost(host) + ':' + port;
|
12208 | };
|
12209 |
|
12210 | var getHostname = function () {
|
12211 | var host = getInternalURLState(this).host;
|
12212 | return host === null ? '' : serializeHost(host);
|
12213 | };
|
12214 |
|
12215 | var getPort = function () {
|
12216 | var port = getInternalURLState(this).port;
|
12217 | return port === null ? '' : String(port);
|
12218 | };
|
12219 |
|
12220 | var getPathname = function () {
|
12221 | var url = getInternalURLState(this);
|
12222 | var path = url.path;
|
12223 | return url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : '';
|
12224 | };
|
12225 |
|
12226 | var getSearch = function () {
|
12227 | var query = getInternalURLState(this).query;
|
12228 | return query ? '?' + query : '';
|
12229 | };
|
12230 |
|
12231 | var getSearchParams = function () {
|
12232 | return getInternalURLState(this).searchParams;
|
12233 | };
|
12234 |
|
12235 | var getHash = function () {
|
12236 | var fragment = getInternalURLState(this).fragment;
|
12237 | return fragment ? '#' + fragment : '';
|
12238 | };
|
12239 |
|
12240 | var accessorDescriptor = function (getter, setter) {
|
12241 | return { get: getter, set: setter, configurable: true, enumerable: true };
|
12242 | };
|
12243 |
|
12244 | if (DESCRIPTORS) {
|
12245 | defineProperties(URLPrototype, {
|
12246 |
|
12247 |
|
12248 | href: accessorDescriptor(serializeURL, function (href) {
|
12249 | var url = getInternalURLState(this);
|
12250 | var urlString = String(href);
|
12251 | var failure = parseURL(url, urlString);
|
12252 | if (failure) throw TypeError(failure);
|
12253 | getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);
|
12254 | }),
|
12255 |
|
12256 |
|
12257 | origin: accessorDescriptor(getOrigin),
|
12258 |
|
12259 |
|
12260 | protocol: accessorDescriptor(getProtocol, function (protocol) {
|
12261 | var url = getInternalURLState(this);
|
12262 | parseURL(url, String(protocol) + ':', SCHEME_START);
|
12263 | }),
|
12264 |
|
12265 |
|
12266 | username: accessorDescriptor(getUsername, function (username) {
|
12267 | var url = getInternalURLState(this);
|
12268 | var codePoints = arrayFrom(String(username));
|
12269 | if (cannotHaveUsernamePasswordPort(url)) return;
|
12270 | url.username = '';
|
12271 | for (var i = 0; i < codePoints.length; i++) {
|
12272 | url.username += percentEncode(codePoints[i], userinfoPercentEncodeSet);
|
12273 | }
|
12274 | }),
|
12275 |
|
12276 |
|
12277 | password: accessorDescriptor(getPassword, function (password) {
|
12278 | var url = getInternalURLState(this);
|
12279 | var codePoints = arrayFrom(String(password));
|
12280 | if (cannotHaveUsernamePasswordPort(url)) return;
|
12281 | url.password = '';
|
12282 | for (var i = 0; i < codePoints.length; i++) {
|
12283 | url.password += percentEncode(codePoints[i], userinfoPercentEncodeSet);
|
12284 | }
|
12285 | }),
|
12286 |
|
12287 |
|
12288 | host: accessorDescriptor(getHost, function (host) {
|
12289 | var url = getInternalURLState(this);
|
12290 | if (url.cannotBeABaseURL) return;
|
12291 | parseURL(url, String(host), HOST);
|
12292 | }),
|
12293 |
|
12294 |
|
12295 | hostname: accessorDescriptor(getHostname, function (hostname) {
|
12296 | var url = getInternalURLState(this);
|
12297 | if (url.cannotBeABaseURL) return;
|
12298 | parseURL(url, String(hostname), HOSTNAME);
|
12299 | }),
|
12300 |
|
12301 |
|
12302 | port: accessorDescriptor(getPort, function (port) {
|
12303 | var url = getInternalURLState(this);
|
12304 | if (cannotHaveUsernamePasswordPort(url)) return;
|
12305 | port = String(port);
|
12306 | if (port == '') url.port = null;
|
12307 | else parseURL(url, port, PORT);
|
12308 | }),
|
12309 |
|
12310 |
|
12311 | pathname: accessorDescriptor(getPathname, function (pathname) {
|
12312 | var url = getInternalURLState(this);
|
12313 | if (url.cannotBeABaseURL) return;
|
12314 | url.path = [];
|
12315 | parseURL(url, pathname + '', PATH_START);
|
12316 | }),
|
12317 |
|
12318 |
|
12319 | search: accessorDescriptor(getSearch, function (search) {
|
12320 | var url = getInternalURLState(this);
|
12321 | search = String(search);
|
12322 | if (search == '') {
|
12323 | url.query = null;
|
12324 | } else {
|
12325 | if ('?' == search.charAt(0)) search = search.slice(1);
|
12326 | url.query = '';
|
12327 | parseURL(url, search, QUERY);
|
12328 | }
|
12329 | getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);
|
12330 | }),
|
12331 |
|
12332 |
|
12333 | searchParams: accessorDescriptor(getSearchParams),
|
12334 |
|
12335 |
|
12336 | hash: accessorDescriptor(getHash, function (hash) {
|
12337 | var url = getInternalURLState(this);
|
12338 | hash = String(hash);
|
12339 | if (hash == '') {
|
12340 | url.fragment = null;
|
12341 | return;
|
12342 | }
|
12343 | if ('#' == hash.charAt(0)) hash = hash.slice(1);
|
12344 | url.fragment = '';
|
12345 | parseURL(url, hash, FRAGMENT);
|
12346 | })
|
12347 | });
|
12348 | }
|
12349 |
|
12350 |
|
12351 |
|
12352 | redefine(URLPrototype, 'toJSON', function toJSON() {
|
12353 | return serializeURL.call(this);
|
12354 | }, { enumerable: true });
|
12355 |
|
12356 |
|
12357 |
|
12358 | redefine(URLPrototype, 'toString', function toString() {
|
12359 | return serializeURL.call(this);
|
12360 | }, { enumerable: true });
|
12361 |
|
12362 | if (NativeURL) {
|
12363 | var nativeCreateObjectURL = NativeURL.createObjectURL;
|
12364 | var nativeRevokeObjectURL = NativeURL.revokeObjectURL;
|
12365 |
|
12366 |
|
12367 |
|
12368 | if (nativeCreateObjectURL) redefine(URLConstructor, 'createObjectURL', function createObjectURL(blob) {
|
12369 | return nativeCreateObjectURL.apply(NativeURL, arguments);
|
12370 | });
|
12371 |
|
12372 |
|
12373 |
|
12374 | if (nativeRevokeObjectURL) redefine(URLConstructor, 'revokeObjectURL', function revokeObjectURL(url) {
|
12375 | return nativeRevokeObjectURL.apply(NativeURL, arguments);
|
12376 | });
|
12377 | }
|
12378 |
|
12379 | setToStringTag(URLConstructor, 'URL');
|
12380 |
|
12381 | $({ global: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, {
|
12382 | URL: URLConstructor
|
12383 | });
|
12384 |
|
12385 |
|
12386 | }),
|
12387 |
|
12388 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
12389 |
|
12390 | var fails = __webpack_require__(7);
|
12391 | var wellKnownSymbol = __webpack_require__(58);
|
12392 | var IS_PURE = __webpack_require__(30);
|
12393 |
|
12394 | var ITERATOR = wellKnownSymbol('iterator');
|
12395 |
|
12396 | module.exports = !fails(function () {
|
12397 | var url = new URL('b?a=1&b=2&c=3', 'http://a');
|
12398 | var searchParams = url.searchParams;
|
12399 | var result = '';
|
12400 | url.pathname = 'c%20d';
|
12401 | searchParams.forEach(function (value, key) {
|
12402 | searchParams['delete']('b');
|
12403 | result += key + value;
|
12404 | });
|
12405 | return (IS_PURE && !url.toJSON)
|
12406 | || !searchParams.sort
|
12407 | || url.href !== 'http://a/c%20d?a=1&c=3'
|
12408 | || searchParams.get('c') !== '3'
|
12409 | || String(new URLSearchParams('?a=1')) !== 'a=1'
|
12410 | || !searchParams[ITERATOR]
|
12411 |
|
12412 | || new URL('https://a@b').username !== 'a'
|
12413 | || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b'
|
12414 |
|
12415 | || new URL('http://тест').host !== 'xn--e1aybc'
|
12416 |
|
12417 | || new URL('http://a#б').hash !== '#%D0%B1'
|
12418 |
|
12419 | || result !== 'a1c3'
|
12420 |
|
12421 | || new URL('http://x', undefined).host !== 'x';
|
12422 | });
|
12423 |
|
12424 |
|
12425 | }),
|
12426 |
|
12427 | (function(module) {
|
12428 |
|
12429 | "use strict";
|
12430 |
|
12431 |
|
12432 | var maxInt = 2147483647;
|
12433 | var base = 36;
|
12434 | var tMin = 1;
|
12435 | var tMax = 26;
|
12436 | var skew = 38;
|
12437 | var damp = 700;
|
12438 | var initialBias = 72;
|
12439 | var initialN = 128;
|
12440 | var delimiter = '-';
|
12441 | var regexNonASCII = /[^\0-\u007E]/;
|
12442 | var regexSeparators = /[.\u3002\uFF0E\uFF61]/g;
|
12443 | var OVERFLOW_ERROR = 'Overflow: input needs wider integers to process';
|
12444 | var baseMinusTMin = base - tMin;
|
12445 | var floor = Math.floor;
|
12446 | var stringFromCharCode = String.fromCharCode;
|
12447 |
|
12448 |
|
12449 |
|
12450 |
|
12451 |
|
12452 |
|
12453 |
|
12454 |
|
12455 | var ucs2decode = function (string) {
|
12456 | var output = [];
|
12457 | var counter = 0;
|
12458 | var length = string.length;
|
12459 | while (counter < length) {
|
12460 | var value = string.charCodeAt(counter++);
|
12461 | if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
|
12462 |
|
12463 | var extra = string.charCodeAt(counter++);
|
12464 | if ((extra & 0xFC00) == 0xDC00) {
|
12465 | output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
|
12466 | } else {
|
12467 |
|
12468 |
|
12469 | output.push(value);
|
12470 | counter--;
|
12471 | }
|
12472 | } else {
|
12473 | output.push(value);
|
12474 | }
|
12475 | }
|
12476 | return output;
|
12477 | };
|
12478 |
|
12479 |
|
12480 |
|
12481 |
|
12482 | var digitToBasic = function (digit) {
|
12483 |
|
12484 |
|
12485 | return digit + 22 + 75 * (digit < 26);
|
12486 | };
|
12487 |
|
12488 |
|
12489 |
|
12490 |
|
12491 |
|
12492 | var adapt = function (delta, numPoints, firstTime) {
|
12493 | var k = 0;
|
12494 | delta = firstTime ? floor(delta / damp) : delta >> 1;
|
12495 | delta += floor(delta / numPoints);
|
12496 | for (; delta > baseMinusTMin * tMax >> 1; k += base) {
|
12497 | delta = floor(delta / baseMinusTMin);
|
12498 | }
|
12499 | return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
|
12500 | };
|
12501 |
|
12502 |
|
12503 |
|
12504 |
|
12505 |
|
12506 |
|
12507 | var encode = function (input) {
|
12508 | var output = [];
|
12509 |
|
12510 |
|
12511 | input = ucs2decode(input);
|
12512 |
|
12513 |
|
12514 | var inputLength = input.length;
|
12515 |
|
12516 |
|
12517 | var n = initialN;
|
12518 | var delta = 0;
|
12519 | var bias = initialBias;
|
12520 | var i, currentValue;
|
12521 |
|
12522 |
|
12523 | for (i = 0; i < input.length; i++) {
|
12524 | currentValue = input[i];
|
12525 | if (currentValue < 0x80) {
|
12526 | output.push(stringFromCharCode(currentValue));
|
12527 | }
|
12528 | }
|
12529 |
|
12530 | var basicLength = output.length;
|
12531 | var handledCPCount = basicLength;
|
12532 |
|
12533 |
|
12534 | if (basicLength) {
|
12535 | output.push(delimiter);
|
12536 | }
|
12537 |
|
12538 |
|
12539 | while (handledCPCount < inputLength) {
|
12540 |
|
12541 | var m = maxInt;
|
12542 | for (i = 0; i < input.length; i++) {
|
12543 | currentValue = input[i];
|
12544 | if (currentValue >= n && currentValue < m) {
|
12545 | m = currentValue;
|
12546 | }
|
12547 | }
|
12548 |
|
12549 |
|
12550 | var handledCPCountPlusOne = handledCPCount + 1;
|
12551 | if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
|
12552 | throw RangeError(OVERFLOW_ERROR);
|
12553 | }
|
12554 |
|
12555 | delta += (m - n) * handledCPCountPlusOne;
|
12556 | n = m;
|
12557 |
|
12558 | for (i = 0; i < input.length; i++) {
|
12559 | currentValue = input[i];
|
12560 | if (currentValue < n && ++delta > maxInt) {
|
12561 | throw RangeError(OVERFLOW_ERROR);
|
12562 | }
|
12563 | if (currentValue == n) {
|
12564 |
|
12565 | var q = delta;
|
12566 | for (var k = base; ; k += base) {
|
12567 | var t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
|
12568 | if (q < t) break;
|
12569 | var qMinusT = q - t;
|
12570 | var baseMinusT = base - t;
|
12571 | output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT)));
|
12572 | q = floor(qMinusT / baseMinusT);
|
12573 | }
|
12574 |
|
12575 | output.push(stringFromCharCode(digitToBasic(q)));
|
12576 | bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
|
12577 | delta = 0;
|
12578 | ++handledCPCount;
|
12579 | }
|
12580 | }
|
12581 |
|
12582 | ++delta;
|
12583 | ++n;
|
12584 | }
|
12585 | return output.join('');
|
12586 | };
|
12587 |
|
12588 | module.exports = function (input) {
|
12589 | var encoded = [];
|
12590 | var labels = input.toLowerCase().replace(regexSeparators, '\u002E').split('.');
|
12591 | var i, label;
|
12592 | for (i = 0; i < labels.length; i++) {
|
12593 | label = labels[i];
|
12594 | encoded.push(regexNonASCII.test(label) ? 'xn--' + encode(label) : label);
|
12595 | }
|
12596 | return encoded.join('.');
|
12597 | };
|
12598 |
|
12599 |
|
12600 | }),
|
12601 |
|
12602 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
12603 |
|
12604 | "use strict";
|
12605 |
|
12606 |
|
12607 | __webpack_require__(134);
|
12608 | var $ = __webpack_require__(3);
|
12609 | var getBuiltIn = __webpack_require__(35);
|
12610 | var USE_NATIVE_URL = __webpack_require__(377);
|
12611 | var redefine = __webpack_require__(22);
|
12612 | var redefineAll = __webpack_require__(286);
|
12613 | var setToStringTag = __webpack_require__(61);
|
12614 | var createIteratorConstructor = __webpack_require__(136);
|
12615 | var InternalStateModule = __webpack_require__(26);
|
12616 | var anInstance = __webpack_require__(287);
|
12617 | var hasOwn = __webpack_require__(16);
|
12618 | var bind = __webpack_require__(63);
|
12619 | var classof = __webpack_require__(89);
|
12620 | var anObject = __webpack_require__(21);
|
12621 | var isObject = __webpack_require__(15);
|
12622 | var create = __webpack_require__(53);
|
12623 | var createPropertyDescriptor = __webpack_require__(9);
|
12624 | var getIterator = __webpack_require__(380);
|
12625 | var getIteratorMethod = __webpack_require__(88);
|
12626 | var wellKnownSymbol = __webpack_require__(58);
|
12627 |
|
12628 | var $fetch = getBuiltIn('fetch');
|
12629 | var Headers = getBuiltIn('Headers');
|
12630 | var ITERATOR = wellKnownSymbol('iterator');
|
12631 | var URL_SEARCH_PARAMS = 'URLSearchParams';
|
12632 | var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator';
|
12633 | var setInternalState = InternalStateModule.set;
|
12634 | var getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS);
|
12635 | var getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR);
|
12636 |
|
12637 | var plus = /\+/g;
|
12638 | var sequences = Array(4);
|
12639 |
|
12640 | var percentSequence = function (bytes) {
|
12641 | return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp('((?:%[\\da-f]{2}){' + bytes + '})', 'gi'));
|
12642 | };
|
12643 |
|
12644 | var percentDecode = function (sequence) {
|
12645 | try {
|
12646 | return decodeURIComponent(sequence);
|
12647 | } catch (error) {
|
12648 | return sequence;
|
12649 | }
|
12650 | };
|
12651 |
|
12652 | var deserialize = function (it) {
|
12653 | var result = it.replace(plus, ' ');
|
12654 | var bytes = 4;
|
12655 | try {
|
12656 | return decodeURIComponent(result);
|
12657 | } catch (error) {
|
12658 | while (bytes) {
|
12659 | result = result.replace(percentSequence(bytes--), percentDecode);
|
12660 | }
|
12661 | return result;
|
12662 | }
|
12663 | };
|
12664 |
|
12665 | var find = /[!'()~]|%20/g;
|
12666 |
|
12667 | var replace = {
|
12668 | '!': '%21',
|
12669 | "'": '%27',
|
12670 | '(': '%28',
|
12671 | ')': '%29',
|
12672 | '~': '%7E',
|
12673 | '%20': '+'
|
12674 | };
|
12675 |
|
12676 | var replacer = function (match) {
|
12677 | return replace[match];
|
12678 | };
|
12679 |
|
12680 | var serialize = function (it) {
|
12681 | return encodeURIComponent(it).replace(find, replacer);
|
12682 | };
|
12683 |
|
12684 | var parseSearchParams = function (result, query) {
|
12685 | if (query) {
|
12686 | var attributes = query.split('&');
|
12687 | var index = 0;
|
12688 | var attribute, entry;
|
12689 | while (index < attributes.length) {
|
12690 | attribute = attributes[index++];
|
12691 | if (attribute.length) {
|
12692 | entry = attribute.split('=');
|
12693 | result.push({
|
12694 | key: deserialize(entry.shift()),
|
12695 | value: deserialize(entry.join('='))
|
12696 | });
|
12697 | }
|
12698 | }
|
12699 | }
|
12700 | };
|
12701 |
|
12702 | var updateSearchParams = function (query) {
|
12703 | this.entries.length = 0;
|
12704 | parseSearchParams(this.entries, query);
|
12705 | };
|
12706 |
|
12707 | var validateArgumentsLength = function (passed, required) {
|
12708 | if (passed < required) throw TypeError('Not enough arguments');
|
12709 | };
|
12710 |
|
12711 | var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) {
|
12712 | setInternalState(this, {
|
12713 | type: URL_SEARCH_PARAMS_ITERATOR,
|
12714 | iterator: getIterator(getInternalParamsState(params).entries),
|
12715 | kind: kind
|
12716 | });
|
12717 | }, 'Iterator', function next() {
|
12718 | var state = getInternalIteratorState(this);
|
12719 | var kind = state.kind;
|
12720 | var step = state.iterator.next();
|
12721 | var entry = step.value;
|
12722 | if (!step.done) {
|
12723 | step.value = kind === 'keys' ? entry.key : kind === 'values' ? entry.value : [entry.key, entry.value];
|
12724 | } return step;
|
12725 | });
|
12726 |
|
12727 |
|
12728 |
|
12729 | var URLSearchParamsConstructor = function URLSearchParams(/* init */) {
|
12730 | anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS);
|
12731 | var init = arguments.length > 0 ? arguments[0] : undefined;
|
12732 | var that = this;
|
12733 | var entries = [];
|
12734 | var iteratorMethod, iterator, next, step, entryIterator, entryNext, first, second, key;
|
12735 |
|
12736 | setInternalState(that, {
|
12737 | type: URL_SEARCH_PARAMS,
|
12738 | entries: entries,
|
12739 | updateURL: function () { },
|
12740 | updateSearchParams: updateSearchParams
|
12741 | });
|
12742 |
|
12743 | if (init !== undefined) {
|
12744 | if (isObject(init)) {
|
12745 | iteratorMethod = getIteratorMethod(init);
|
12746 | if (typeof iteratorMethod === 'function') {
|
12747 | iterator = iteratorMethod.call(init);
|
12748 | next = iterator.next;
|
12749 | while (!(step = next.call(iterator)).done) {
|
12750 | entryIterator = getIterator(anObject(step.value));
|
12751 | entryNext = entryIterator.next;
|
12752 | if (
|
12753 | (first = entryNext.call(entryIterator)).done ||
|
12754 | (second = entryNext.call(entryIterator)).done ||
|
12755 | !entryNext.call(entryIterator).done
|
12756 | ) throw TypeError('Expected sequence with length 2');
|
12757 | entries.push({ key: first.value + '', value: second.value + '' });
|
12758 | }
|
12759 | } else for (key in init) if (hasOwn(init, key)) entries.push({ key: key, value: init[key] + '' });
|
12760 | } else {
|
12761 | parseSearchParams(entries, typeof init === 'string' ? init.charAt(0) === '?' ? init.slice(1) : init : init + '');
|
12762 | }
|
12763 | }
|
12764 | };
|
12765 |
|
12766 | var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;
|
12767 |
|
12768 | redefineAll(URLSearchParamsPrototype, {
|
12769 |
|
12770 |
|
12771 | append: function append(name, value) {
|
12772 | validateArgumentsLength(arguments.length, 2);
|
12773 | var state = getInternalParamsState(this);
|
12774 | state.entries.push({ key: name + '', value: value + '' });
|
12775 | state.updateURL();
|
12776 | },
|
12777 |
|
12778 |
|
12779 | 'delete': function (name) {
|
12780 | validateArgumentsLength(arguments.length, 1);
|
12781 | var state = getInternalParamsState(this);
|
12782 | var entries = state.entries;
|
12783 | var key = name + '';
|
12784 | var index = 0;
|
12785 | while (index < entries.length) {
|
12786 | if (entries[index].key === key) entries.splice(index, 1);
|
12787 | else index++;
|
12788 | }
|
12789 | state.updateURL();
|
12790 | },
|
12791 |
|
12792 |
|
12793 | get: function get(name) {
|
12794 | validateArgumentsLength(arguments.length, 1);
|
12795 | var entries = getInternalParamsState(this).entries;
|
12796 | var key = name + '';
|
12797 | var index = 0;
|
12798 | for (; index < entries.length; index++) {
|
12799 | if (entries[index].key === key) return entries[index].value;
|
12800 | }
|
12801 | return null;
|
12802 | },
|
12803 |
|
12804 |
|
12805 | getAll: function getAll(name) {
|
12806 | validateArgumentsLength(arguments.length, 1);
|
12807 | var entries = getInternalParamsState(this).entries;
|
12808 | var key = name + '';
|
12809 | var result = [];
|
12810 | var index = 0;
|
12811 | for (; index < entries.length; index++) {
|
12812 | if (entries[index].key === key) result.push(entries[index].value);
|
12813 | }
|
12814 | return result;
|
12815 | },
|
12816 |
|
12817 |
|
12818 | has: function has(name) {
|
12819 | validateArgumentsLength(arguments.length, 1);
|
12820 | var entries = getInternalParamsState(this).entries;
|
12821 | var key = name + '';
|
12822 | var index = 0;
|
12823 | while (index < entries.length) {
|
12824 | if (entries[index++].key === key) return true;
|
12825 | }
|
12826 | return false;
|
12827 | },
|
12828 |
|
12829 |
|
12830 | set: function set(name, value) {
|
12831 | validateArgumentsLength(arguments.length, 1);
|
12832 | var state = getInternalParamsState(this);
|
12833 | var entries = state.entries;
|
12834 | var found = false;
|
12835 | var key = name + '';
|
12836 | var val = value + '';
|
12837 | var index = 0;
|
12838 | var entry;
|
12839 | for (; index < entries.length; index++) {
|
12840 | entry = entries[index];
|
12841 | if (entry.key === key) {
|
12842 | if (found) entries.splice(index--, 1);
|
12843 | else {
|
12844 | found = true;
|
12845 | entry.value = val;
|
12846 | }
|
12847 | }
|
12848 | }
|
12849 | if (!found) entries.push({ key: key, value: val });
|
12850 | state.updateURL();
|
12851 | },
|
12852 |
|
12853 |
|
12854 | sort: function sort() {
|
12855 | var state = getInternalParamsState(this);
|
12856 | var entries = state.entries;
|
12857 |
|
12858 | var slice = entries.slice();
|
12859 | var entry, entriesIndex, sliceIndex;
|
12860 | entries.length = 0;
|
12861 | for (sliceIndex = 0; sliceIndex < slice.length; sliceIndex++) {
|
12862 | entry = slice[sliceIndex];
|
12863 | for (entriesIndex = 0; entriesIndex < sliceIndex; entriesIndex++) {
|
12864 | if (entries[entriesIndex].key > entry.key) {
|
12865 | entries.splice(entriesIndex, 0, entry);
|
12866 | break;
|
12867 | }
|
12868 | }
|
12869 | if (entriesIndex === sliceIndex) entries.push(entry);
|
12870 | }
|
12871 | state.updateURL();
|
12872 | },
|
12873 |
|
12874 | forEach: function forEach(callback /* , thisArg */) {
|
12875 | var entries = getInternalParamsState(this).entries;
|
12876 | var boundFunction = bind(callback, arguments.length > 1 ? arguments[1] : undefined, 3);
|
12877 | var index = 0;
|
12878 | var entry;
|
12879 | while (index < entries.length) {
|
12880 | entry = entries[index++];
|
12881 | boundFunction(entry.value, entry.key, this);
|
12882 | }
|
12883 | },
|
12884 |
|
12885 | keys: function keys() {
|
12886 | return new URLSearchParamsIterator(this, 'keys');
|
12887 | },
|
12888 |
|
12889 | values: function values() {
|
12890 | return new URLSearchParamsIterator(this, 'values');
|
12891 | },
|
12892 |
|
12893 | entries: function entries() {
|
12894 | return new URLSearchParamsIterator(this, 'entries');
|
12895 | }
|
12896 | }, { enumerable: true });
|
12897 |
|
12898 |
|
12899 | redefine(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries);
|
12900 |
|
12901 |
|
12902 |
|
12903 | redefine(URLSearchParamsPrototype, 'toString', function toString() {
|
12904 | var entries = getInternalParamsState(this).entries;
|
12905 | var result = [];
|
12906 | var index = 0;
|
12907 | var entry;
|
12908 | while (index < entries.length) {
|
12909 | entry = entries[index++];
|
12910 | result.push(serialize(entry.key) + '=' + serialize(entry.value));
|
12911 | } return result.join('&');
|
12912 | }, { enumerable: true });
|
12913 |
|
12914 | setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS);
|
12915 |
|
12916 | $({ global: true, forced: !USE_NATIVE_URL }, {
|
12917 | URLSearchParams: URLSearchParamsConstructor
|
12918 | });
|
12919 |
|
12920 |
|
12921 |
|
12922 | if (!USE_NATIVE_URL && typeof $fetch == 'function' && typeof Headers == 'function') {
|
12923 | $({ global: true, enumerable: true, forced: true }, {
|
12924 | fetch: function fetch(input /* , init */) {
|
12925 | var args = [input];
|
12926 | var init, body, headers;
|
12927 | if (arguments.length > 1) {
|
12928 | init = arguments[1];
|
12929 | if (isObject(init)) {
|
12930 | body = init.body;
|
12931 | if (classof(body) === URL_SEARCH_PARAMS) {
|
12932 | headers = init.headers ? new Headers(init.headers) : new Headers();
|
12933 | if (!headers.has('content-type')) {
|
12934 | headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
|
12935 | }
|
12936 | init = create(init, {
|
12937 | body: createPropertyDescriptor(0, String(body)),
|
12938 | headers: createPropertyDescriptor(0, headers)
|
12939 | });
|
12940 | }
|
12941 | }
|
12942 | args.push(init);
|
12943 | } return $fetch.apply(this, args);
|
12944 | }
|
12945 | });
|
12946 | }
|
12947 |
|
12948 | module.exports = {
|
12949 | URLSearchParams: URLSearchParamsConstructor,
|
12950 | getState: getInternalParamsState
|
12951 | };
|
12952 |
|
12953 |
|
12954 | }),
|
12955 |
|
12956 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
12957 |
|
12958 | var anObject = __webpack_require__(21);
|
12959 | var getIteratorMethod = __webpack_require__(88);
|
12960 |
|
12961 | module.exports = function (it) {
|
12962 | var iteratorMethod = getIteratorMethod(it);
|
12963 | if (typeof iteratorMethod != 'function') {
|
12964 | throw TypeError(String(it) + ' is not iterable');
|
12965 | } return anObject(iteratorMethod.call(it));
|
12966 | };
|
12967 |
|
12968 |
|
12969 | }),
|
12970 |
|
12971 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12972 |
|
12973 | "use strict";
|
12974 |
|
12975 | var $ = __webpack_require__(3);
|
12976 |
|
12977 |
|
12978 |
|
12979 | $({ target: 'URL', proto: true, enumerable: true }, {
|
12980 | toJSON: function toJSON() {
|
12981 | return URL.prototype.toString.call(this);
|
12982 | }
|
12983 | });
|
12984 |
|
12985 |
|
12986 | }),
|
12987 |
|
12988 | (function(module) {
|
12989 |
|
12990 |
|
12991 |
|
12992 |
|
12993 |
|
12994 |
|
12995 |
|
12996 |
|
12997 | var runtime = (function (exports) {
|
12998 | "use strict";
|
12999 |
|
13000 | var Op = Object.prototype;
|
13001 | var hasOwn = Op.hasOwnProperty;
|
13002 | var undefined;
|
13003 | var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
13004 | var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
13005 | var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
13006 | var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
13007 |
|
13008 | function define(obj, key, value) {
|
13009 | Object.defineProperty(obj, key, {
|
13010 | value: value,
|
13011 | enumerable: true,
|
13012 | configurable: true,
|
13013 | writable: true
|
13014 | });
|
13015 | return obj[key];
|
13016 | }
|
13017 | try {
|
13018 |
|
13019 | define({}, "");
|
13020 | } catch (err) {
|
13021 | define = function(obj, key, value) {
|
13022 | return obj[key] = value;
|
13023 | };
|
13024 | }
|
13025 |
|
13026 | function wrap(innerFn, outerFn, self, tryLocsList) {
|
13027 |
|
13028 | var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
13029 | var generator = Object.create(protoGenerator.prototype);
|
13030 | var context = new Context(tryLocsList || []);
|
13031 |
|
13032 |
|
13033 |
|
13034 | generator._invoke = makeInvokeMethod(innerFn, self, context);
|
13035 |
|
13036 | return generator;
|
13037 | }
|
13038 | exports.wrap = wrap;
|
13039 |
|
13040 |
|
13041 |
|
13042 |
|
13043 |
|
13044 |
|
13045 |
|
13046 |
|
13047 |
|
13048 |
|
13049 |
|
13050 | function tryCatch(fn, obj, arg) {
|
13051 | try {
|
13052 | return { type: "normal", arg: fn.call(obj, arg) };
|
13053 | } catch (err) {
|
13054 | return { type: "throw", arg: err };
|
13055 | }
|
13056 | }
|
13057 |
|
13058 | var GenStateSuspendedStart = "suspendedStart";
|
13059 | var GenStateSuspendedYield = "suspendedYield";
|
13060 | var GenStateExecuting = "executing";
|
13061 | var GenStateCompleted = "completed";
|
13062 |
|
13063 |
|
13064 |
|
13065 | var ContinueSentinel = {};
|
13066 |
|
13067 |
|
13068 |
|
13069 |
|
13070 |
|
13071 | function Generator() {}
|
13072 | function GeneratorFunction() {}
|
13073 | function GeneratorFunctionPrototype() {}
|
13074 |
|
13075 |
|
13076 |
|
13077 | var IteratorPrototype = {};
|
13078 | IteratorPrototype[iteratorSymbol] = function () {
|
13079 | return this;
|
13080 | };
|
13081 |
|
13082 | var getProto = Object.getPrototypeOf;
|
13083 | var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
13084 | if (NativeIteratorPrototype &&
|
13085 | NativeIteratorPrototype !== Op &&
|
13086 | hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
13087 |
|
13088 |
|
13089 | IteratorPrototype = NativeIteratorPrototype;
|
13090 | }
|
13091 |
|
13092 | var Gp = GeneratorFunctionPrototype.prototype =
|
13093 | Generator.prototype = Object.create(IteratorPrototype);
|
13094 | GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
|
13095 | GeneratorFunctionPrototype.constructor = GeneratorFunction;
|
13096 | GeneratorFunction.displayName = define(
|
13097 | GeneratorFunctionPrototype,
|
13098 | toStringTagSymbol,
|
13099 | "GeneratorFunction"
|
13100 | );
|
13101 |
|
13102 |
|
13103 |
|
13104 | function defineIteratorMethods(prototype) {
|
13105 | ["next", "throw", "return"].forEach(function(method) {
|
13106 | define(prototype, method, function(arg) {
|
13107 | return this._invoke(method, arg);
|
13108 | });
|
13109 | });
|
13110 | }
|
13111 |
|
13112 | exports.isGeneratorFunction = function(genFun) {
|
13113 | var ctor = typeof genFun === "function" && genFun.constructor;
|
13114 | return ctor
|
13115 | ? ctor === GeneratorFunction ||
|
13116 |
|
13117 |
|
13118 | (ctor.displayName || ctor.name) === "GeneratorFunction"
|
13119 | : false;
|
13120 | };
|
13121 |
|
13122 | exports.mark = function(genFun) {
|
13123 | if (Object.setPrototypeOf) {
|
13124 | Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
13125 | } else {
|
13126 | genFun.__proto__ = GeneratorFunctionPrototype;
|
13127 | define(genFun, toStringTagSymbol, "GeneratorFunction");
|
13128 | }
|
13129 | genFun.prototype = Object.create(Gp);
|
13130 | return genFun;
|
13131 | };
|
13132 |
|
13133 |
|
13134 |
|
13135 |
|
13136 |
|
13137 | exports.awrap = function(arg) {
|
13138 | return { __await: arg };
|
13139 | };
|
13140 |
|
13141 | function AsyncIterator(generator, PromiseImpl) {
|
13142 | function invoke(method, arg, resolve, reject) {
|
13143 | var record = tryCatch(generator[method], generator, arg);
|
13144 | if (record.type === "throw") {
|
13145 | reject(record.arg);
|
13146 | } else {
|
13147 | var result = record.arg;
|
13148 | var value = result.value;
|
13149 | if (value &&
|
13150 | typeof value === "object" &&
|
13151 | hasOwn.call(value, "__await")) {
|
13152 | return PromiseImpl.resolve(value.__await).then(function(value) {
|
13153 | invoke("next", value, resolve, reject);
|
13154 | }, function(err) {
|
13155 | invoke("throw", err, resolve, reject);
|
13156 | });
|
13157 | }
|
13158 |
|
13159 | return PromiseImpl.resolve(value).then(function(unwrapped) {
|
13160 |
|
13161 |
|
13162 |
|
13163 | result.value = unwrapped;
|
13164 | resolve(result);
|
13165 | }, function(error) {
|
13166 |
|
13167 |
|
13168 | return invoke("throw", error, resolve, reject);
|
13169 | });
|
13170 | }
|
13171 | }
|
13172 |
|
13173 | var previousPromise;
|
13174 |
|
13175 | function enqueue(method, arg) {
|
13176 | function callInvokeWithMethodAndArg() {
|
13177 | return new PromiseImpl(function(resolve, reject) {
|
13178 | invoke(method, arg, resolve, reject);
|
13179 | });
|
13180 | }
|
13181 |
|
13182 | return previousPromise =
|
13183 |
|
13184 |
|
13185 |
|
13186 |
|
13187 |
|
13188 |
|
13189 |
|
13190 |
|
13191 |
|
13192 |
|
13193 |
|
13194 |
|
13195 | previousPromise ? previousPromise.then(
|
13196 | callInvokeWithMethodAndArg,
|
13197 |
|
13198 |
|
13199 | callInvokeWithMethodAndArg
|
13200 | ) : callInvokeWithMethodAndArg();
|
13201 | }
|
13202 |
|
13203 |
|
13204 |
|
13205 | this._invoke = enqueue;
|
13206 | }
|
13207 |
|
13208 | defineIteratorMethods(AsyncIterator.prototype);
|
13209 | AsyncIterator.prototype[asyncIteratorSymbol] = function () {
|
13210 | return this;
|
13211 | };
|
13212 | exports.AsyncIterator = AsyncIterator;
|
13213 |
|
13214 |
|
13215 |
|
13216 |
|
13217 | exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
13218 | if (PromiseImpl === void 0) PromiseImpl = Promise;
|
13219 |
|
13220 | var iter = new AsyncIterator(
|
13221 | wrap(innerFn, outerFn, self, tryLocsList),
|
13222 | PromiseImpl
|
13223 | );
|
13224 |
|
13225 | return exports.isGeneratorFunction(outerFn)
|
13226 | ? iter
|
13227 | : iter.next().then(function(result) {
|
13228 | return result.done ? result.value : iter.next();
|
13229 | });
|
13230 | };
|
13231 |
|
13232 | function makeInvokeMethod(innerFn, self, context) {
|
13233 | var state = GenStateSuspendedStart;
|
13234 |
|
13235 | return function invoke(method, arg) {
|
13236 | if (state === GenStateExecuting) {
|
13237 | throw new Error("Generator is already running");
|
13238 | }
|
13239 |
|
13240 | if (state === GenStateCompleted) {
|
13241 | if (method === "throw") {
|
13242 | throw arg;
|
13243 | }
|
13244 |
|
13245 |
|
13246 |
|
13247 | return doneResult();
|
13248 | }
|
13249 |
|
13250 | context.method = method;
|
13251 | context.arg = arg;
|
13252 |
|
13253 | while (true) {
|
13254 | var delegate = context.delegate;
|
13255 | if (delegate) {
|
13256 | var delegateResult = maybeInvokeDelegate(delegate, context);
|
13257 | if (delegateResult) {
|
13258 | if (delegateResult === ContinueSentinel) continue;
|
13259 | return delegateResult;
|
13260 | }
|
13261 | }
|
13262 |
|
13263 | if (context.method === "next") {
|
13264 |
|
13265 |
|
13266 | context.sent = context._sent = context.arg;
|
13267 |
|
13268 | } else if (context.method === "throw") {
|
13269 | if (state === GenStateSuspendedStart) {
|
13270 | state = GenStateCompleted;
|
13271 | throw context.arg;
|
13272 | }
|
13273 |
|
13274 | context.dispatchException(context.arg);
|
13275 |
|
13276 | } else if (context.method === "return") {
|
13277 | context.abrupt("return", context.arg);
|
13278 | }
|
13279 |
|
13280 | state = GenStateExecuting;
|
13281 |
|
13282 | var record = tryCatch(innerFn, self, context);
|
13283 | if (record.type === "normal") {
|
13284 |
|
13285 |
|
13286 | state = context.done
|
13287 | ? GenStateCompleted
|
13288 | : GenStateSuspendedYield;
|
13289 |
|
13290 | if (record.arg === ContinueSentinel) {
|
13291 | continue;
|
13292 | }
|
13293 |
|
13294 | return {
|
13295 | value: record.arg,
|
13296 | done: context.done
|
13297 | };
|
13298 |
|
13299 | } else if (record.type === "throw") {
|
13300 | state = GenStateCompleted;
|
13301 |
|
13302 |
|
13303 | context.method = "throw";
|
13304 | context.arg = record.arg;
|
13305 | }
|
13306 | }
|
13307 | };
|
13308 | }
|
13309 |
|
13310 |
|
13311 |
|
13312 |
|
13313 |
|
13314 | function maybeInvokeDelegate(delegate, context) {
|
13315 | var method = delegate.iterator[context.method];
|
13316 | if (method === undefined) {
|
13317 |
|
13318 |
|
13319 | context.delegate = null;
|
13320 |
|
13321 | if (context.method === "throw") {
|
13322 |
|
13323 | if (delegate.iterator["return"]) {
|
13324 |
|
13325 |
|
13326 | context.method = "return";
|
13327 | context.arg = undefined;
|
13328 | maybeInvokeDelegate(delegate, context);
|
13329 |
|
13330 | if (context.method === "throw") {
|
13331 |
|
13332 |
|
13333 | return ContinueSentinel;
|
13334 | }
|
13335 | }
|
13336 |
|
13337 | context.method = "throw";
|
13338 | context.arg = new TypeError(
|
13339 | "The iterator does not provide a 'throw' method");
|
13340 | }
|
13341 |
|
13342 | return ContinueSentinel;
|
13343 | }
|
13344 |
|
13345 | var record = tryCatch(method, delegate.iterator, context.arg);
|
13346 |
|
13347 | if (record.type === "throw") {
|
13348 | context.method = "throw";
|
13349 | context.arg = record.arg;
|
13350 | context.delegate = null;
|
13351 | return ContinueSentinel;
|
13352 | }
|
13353 |
|
13354 | var info = record.arg;
|
13355 |
|
13356 | if (! info) {
|
13357 | context.method = "throw";
|
13358 | context.arg = new TypeError("iterator result is not an object");
|
13359 | context.delegate = null;
|
13360 | return ContinueSentinel;
|
13361 | }
|
13362 |
|
13363 | if (info.done) {
|
13364 |
|
13365 |
|
13366 | context[delegate.resultName] = info.value;
|
13367 |
|
13368 |
|
13369 | context.next = delegate.nextLoc;
|
13370 |
|
13371 |
|
13372 |
|
13373 |
|
13374 |
|
13375 |
|
13376 |
|
13377 | if (context.method !== "return") {
|
13378 | context.method = "next";
|
13379 | context.arg = undefined;
|
13380 | }
|
13381 |
|
13382 | } else {
|
13383 |
|
13384 | return info;
|
13385 | }
|
13386 |
|
13387 |
|
13388 |
|
13389 | context.delegate = null;
|
13390 | return ContinueSentinel;
|
13391 | }
|
13392 |
|
13393 |
|
13394 |
|
13395 | defineIteratorMethods(Gp);
|
13396 |
|
13397 | define(Gp, toStringTagSymbol, "Generator");
|
13398 |
|
13399 |
|
13400 |
|
13401 |
|
13402 |
|
13403 |
|
13404 | Gp[iteratorSymbol] = function() {
|
13405 | return this;
|
13406 | };
|
13407 |
|
13408 | Gp.toString = function() {
|
13409 | return "[object Generator]";
|
13410 | };
|
13411 |
|
13412 | function pushTryEntry(locs) {
|
13413 | var entry = { tryLoc: locs[0] };
|
13414 |
|
13415 | if (1 in locs) {
|
13416 | entry.catchLoc = locs[1];
|
13417 | }
|
13418 |
|
13419 | if (2 in locs) {
|
13420 | entry.finallyLoc = locs[2];
|
13421 | entry.afterLoc = locs[3];
|
13422 | }
|
13423 |
|
13424 | this.tryEntries.push(entry);
|
13425 | }
|
13426 |
|
13427 | function resetTryEntry(entry) {
|
13428 | var record = entry.completion || {};
|
13429 | record.type = "normal";
|
13430 | delete record.arg;
|
13431 | entry.completion = record;
|
13432 | }
|
13433 |
|
13434 | function Context(tryLocsList) {
|
13435 |
|
13436 |
|
13437 |
|
13438 | this.tryEntries = [{ tryLoc: "root" }];
|
13439 | tryLocsList.forEach(pushTryEntry, this);
|
13440 | this.reset(true);
|
13441 | }
|
13442 |
|
13443 | exports.keys = function(object) {
|
13444 | var keys = [];
|
13445 | for (var key in object) {
|
13446 | keys.push(key);
|
13447 | }
|
13448 | keys.reverse();
|
13449 |
|
13450 |
|
13451 |
|
13452 | return function next() {
|
13453 | while (keys.length) {
|
13454 | var key = keys.pop();
|
13455 | if (key in object) {
|
13456 | next.value = key;
|
13457 | next.done = false;
|
13458 | return next;
|
13459 | }
|
13460 | }
|
13461 |
|
13462 |
|
13463 |
|
13464 |
|
13465 | next.done = true;
|
13466 | return next;
|
13467 | };
|
13468 | };
|
13469 |
|
13470 | function values(iterable) {
|
13471 | if (iterable) {
|
13472 | var iteratorMethod = iterable[iteratorSymbol];
|
13473 | if (iteratorMethod) {
|
13474 | return iteratorMethod.call(iterable);
|
13475 | }
|
13476 |
|
13477 | if (typeof iterable.next === "function") {
|
13478 | return iterable;
|
13479 | }
|
13480 |
|
13481 | if (!isNaN(iterable.length)) {
|
13482 | var i = -1, next = function next() {
|
13483 | while (++i < iterable.length) {
|
13484 | if (hasOwn.call(iterable, i)) {
|
13485 | next.value = iterable[i];
|
13486 | next.done = false;
|
13487 | return next;
|
13488 | }
|
13489 | }
|
13490 |
|
13491 | next.value = undefined;
|
13492 | next.done = true;
|
13493 |
|
13494 | return next;
|
13495 | };
|
13496 |
|
13497 | return next.next = next;
|
13498 | }
|
13499 | }
|
13500 |
|
13501 |
|
13502 | return { next: doneResult };
|
13503 | }
|
13504 | exports.values = values;
|
13505 |
|
13506 | function doneResult() {
|
13507 | return { value: undefined, done: true };
|
13508 | }
|
13509 |
|
13510 | Context.prototype = {
|
13511 | constructor: Context,
|
13512 |
|
13513 | reset: function(skipTempReset) {
|
13514 | this.prev = 0;
|
13515 | this.next = 0;
|
13516 |
|
13517 |
|
13518 | this.sent = this._sent = undefined;
|
13519 | this.done = false;
|
13520 | this.delegate = null;
|
13521 |
|
13522 | this.method = "next";
|
13523 | this.arg = undefined;
|
13524 |
|
13525 | this.tryEntries.forEach(resetTryEntry);
|
13526 |
|
13527 | if (!skipTempReset) {
|
13528 | for (var name in this) {
|
13529 |
|
13530 | if (name.charAt(0) === "t" &&
|
13531 | hasOwn.call(this, name) &&
|
13532 | !isNaN(+name.slice(1))) {
|
13533 | this[name] = undefined;
|
13534 | }
|
13535 | }
|
13536 | }
|
13537 | },
|
13538 |
|
13539 | stop: function() {
|
13540 | this.done = true;
|
13541 |
|
13542 | var rootEntry = this.tryEntries[0];
|
13543 | var rootRecord = rootEntry.completion;
|
13544 | if (rootRecord.type === "throw") {
|
13545 | throw rootRecord.arg;
|
13546 | }
|
13547 |
|
13548 | return this.rval;
|
13549 | },
|
13550 |
|
13551 | dispatchException: function(exception) {
|
13552 | if (this.done) {
|
13553 | throw exception;
|
13554 | }
|
13555 |
|
13556 | var context = this;
|
13557 | function handle(loc, caught) {
|
13558 | record.type = "throw";
|
13559 | record.arg = exception;
|
13560 | context.next = loc;
|
13561 |
|
13562 | if (caught) {
|
13563 |
|
13564 |
|
13565 | context.method = "next";
|
13566 | context.arg = undefined;
|
13567 | }
|
13568 |
|
13569 | return !! caught;
|
13570 | }
|
13571 |
|
13572 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
13573 | var entry = this.tryEntries[i];
|
13574 | var record = entry.completion;
|
13575 |
|
13576 | if (entry.tryLoc === "root") {
|
13577 |
|
13578 |
|
13579 |
|
13580 | return handle("end");
|
13581 | }
|
13582 |
|
13583 | if (entry.tryLoc <= this.prev) {
|
13584 | var hasCatch = hasOwn.call(entry, "catchLoc");
|
13585 | var hasFinally = hasOwn.call(entry, "finallyLoc");
|
13586 |
|
13587 | if (hasCatch && hasFinally) {
|
13588 | if (this.prev < entry.catchLoc) {
|
13589 | return handle(entry.catchLoc, true);
|
13590 | } else if (this.prev < entry.finallyLoc) {
|
13591 | return handle(entry.finallyLoc);
|
13592 | }
|
13593 |
|
13594 | } else if (hasCatch) {
|
13595 | if (this.prev < entry.catchLoc) {
|
13596 | return handle(entry.catchLoc, true);
|
13597 | }
|
13598 |
|
13599 | } else if (hasFinally) {
|
13600 | if (this.prev < entry.finallyLoc) {
|
13601 | return handle(entry.finallyLoc);
|
13602 | }
|
13603 |
|
13604 | } else {
|
13605 | throw new Error("try statement without catch or finally");
|
13606 | }
|
13607 | }
|
13608 | }
|
13609 | },
|
13610 |
|
13611 | abrupt: function(type, arg) {
|
13612 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
13613 | var entry = this.tryEntries[i];
|
13614 | if (entry.tryLoc <= this.prev &&
|
13615 | hasOwn.call(entry, "finallyLoc") &&
|
13616 | this.prev < entry.finallyLoc) {
|
13617 | var finallyEntry = entry;
|
13618 | break;
|
13619 | }
|
13620 | }
|
13621 |
|
13622 | if (finallyEntry &&
|
13623 | (type === "break" ||
|
13624 | type === "continue") &&
|
13625 | finallyEntry.tryLoc <= arg &&
|
13626 | arg <= finallyEntry.finallyLoc) {
|
13627 |
|
13628 |
|
13629 | finallyEntry = null;
|
13630 | }
|
13631 |
|
13632 | var record = finallyEntry ? finallyEntry.completion : {};
|
13633 | record.type = type;
|
13634 | record.arg = arg;
|
13635 |
|
13636 | if (finallyEntry) {
|
13637 | this.method = "next";
|
13638 | this.next = finallyEntry.finallyLoc;
|
13639 | return ContinueSentinel;
|
13640 | }
|
13641 |
|
13642 | return this.complete(record);
|
13643 | },
|
13644 |
|
13645 | complete: function(record, afterLoc) {
|
13646 | if (record.type === "throw") {
|
13647 | throw record.arg;
|
13648 | }
|
13649 |
|
13650 | if (record.type === "break" ||
|
13651 | record.type === "continue") {
|
13652 | this.next = record.arg;
|
13653 | } else if (record.type === "return") {
|
13654 | this.rval = this.arg = record.arg;
|
13655 | this.method = "return";
|
13656 | this.next = "end";
|
13657 | } else if (record.type === "normal" && afterLoc) {
|
13658 | this.next = afterLoc;
|
13659 | }
|
13660 |
|
13661 | return ContinueSentinel;
|
13662 | },
|
13663 |
|
13664 | finish: function(finallyLoc) {
|
13665 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
13666 | var entry = this.tryEntries[i];
|
13667 | if (entry.finallyLoc === finallyLoc) {
|
13668 | this.complete(entry.completion, entry.afterLoc);
|
13669 | resetTryEntry(entry);
|
13670 | return ContinueSentinel;
|
13671 | }
|
13672 | }
|
13673 | },
|
13674 |
|
13675 | "catch": function(tryLoc) {
|
13676 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
13677 | var entry = this.tryEntries[i];
|
13678 | if (entry.tryLoc === tryLoc) {
|
13679 | var record = entry.completion;
|
13680 | if (record.type === "throw") {
|
13681 | var thrown = record.arg;
|
13682 | resetTryEntry(entry);
|
13683 | }
|
13684 | return thrown;
|
13685 | }
|
13686 | }
|
13687 |
|
13688 |
|
13689 |
|
13690 | throw new Error("illegal catch attempt");
|
13691 | },
|
13692 |
|
13693 | delegateYield: function(iterable, resultName, nextLoc) {
|
13694 | this.delegate = {
|
13695 | iterator: values(iterable),
|
13696 | resultName: resultName,
|
13697 | nextLoc: nextLoc
|
13698 | };
|
13699 |
|
13700 | if (this.method === "next") {
|
13701 |
|
13702 |
|
13703 | this.arg = undefined;
|
13704 | }
|
13705 |
|
13706 | return ContinueSentinel;
|
13707 | }
|
13708 | };
|
13709 |
|
13710 |
|
13711 |
|
13712 |
|
13713 |
|
13714 | return exports;
|
13715 |
|
13716 | }(
|
13717 |
|
13718 |
|
13719 |
|
13720 |
|
13721 | true ? module.exports : 0
|
13722 | ));
|
13723 |
|
13724 | try {
|
13725 | regeneratorRuntime = runtime;
|
13726 | } catch (accidentalStrictMode) {
|
13727 |
|
13728 |
|
13729 |
|
13730 |
|
13731 |
|
13732 |
|
13733 |
|
13734 |
|
13735 |
|
13736 | Function("r", "regeneratorRuntime = r")(runtime);
|
13737 | }
|
13738 |
|
13739 |
|
13740 | }),
|
13741 |
|
13742 | (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
13743 |
|
13744 | "use strict";
|
13745 |
|
13746 | __webpack_require__.r(__webpack_exports__);
|
13747 |
|
13748 |
|
13749 | __webpack_require__.d(__webpack_exports__, {
|
13750 | "bb": function() { return bb; },
|
13751 | "default": function() { return bb; }
|
13752 | });
|
13753 |
|
13754 |
|
13755 | var resolver_shape_namespaceObject = {};
|
13756 | __webpack_require__.r(resolver_shape_namespaceObject);
|
13757 | __webpack_require__.d(resolver_shape_namespaceObject, {
|
13758 | "area": function() { return _area; },
|
13759 | "areaLineRange": function() { return areaLineRange; },
|
13760 | "areaSpline": function() { return areaSpline; },
|
13761 | "areaSplineRange": function() { return areaSplineRange; },
|
13762 | "areaStep": function() { return areaStep; },
|
13763 | "bar": function() { return resolver_shape_bar; },
|
13764 | "bubble": function() { return resolver_shape_bubble; },
|
13765 | "candlestick": function() { return resolver_shape_candlestick; },
|
13766 | "donut": function() { return shape_donut; },
|
13767 | "gauge": function() { return resolver_shape_gauge; },
|
13768 | "line": function() { return resolver_shape_line; },
|
13769 | "pie": function() { return resolver_shape_pie; },
|
13770 | "radar": function() { return resolver_shape_radar; },
|
13771 | "scatter": function() { return shape_scatter; },
|
13772 | "spline": function() { return shape_spline; },
|
13773 | "step": function() { return shape_step; }
|
13774 | });
|
13775 |
|
13776 |
|
13777 | var resolver_interaction_namespaceObject = {};
|
13778 | __webpack_require__.r(resolver_interaction_namespaceObject);
|
13779 | __webpack_require__.d(resolver_interaction_namespaceObject, {
|
13780 | "selection": function() { return _selectionModule; },
|
13781 | "subchart": function() { return subchartModule; },
|
13782 | "zoom": function() { return zoomModule; }
|
13783 | });
|
13784 |
|
13785 | ;
|
13786 | var t0 = new Date(),
|
13787 | t1 = new Date();
|
13788 | function newInterval(floori, offseti, count, field) {
|
13789 | function interval(date) {
|
13790 | return floori(date = arguments.length === 0 ? new Date() : new Date(+date)), date;
|
13791 | }
|
13792 |
|
13793 | return interval.floor = function (date) {
|
13794 | return floori(date = new Date(+date)), date;
|
13795 | }, interval.ceil = function (date) {
|
13796 | return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;
|
13797 | }, interval.round = function (date) {
|
13798 | var d0 = interval(date),
|
13799 | d1 = interval.ceil(date);
|
13800 | return date - d0 < d1 - date ? d0 : d1;
|
13801 | }, interval.offset = function (date, step) {
|
13802 | return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;
|
13803 | }, interval.range = function (start, stop, step) {
|
13804 | var previous,
|
13805 | range = [];
|
13806 | if (start = interval.ceil(start), step = step == null ? 1 : Math.floor(step), !(start < stop) || !(step > 0)) return range;
|
13807 |
|
13808 | do range.push(previous = new Date(+start)), offseti(start, step), floori(start); while (previous < start && start < stop);
|
13809 |
|
13810 | return range;
|
13811 | }, interval.filter = function (test) {
|
13812 | return newInterval(function (date) {
|
13813 | if (date >= date) for (; floori(date), !test(date);) date.setTime(date - 1);
|
13814 | }, function (date, step) {
|
13815 | if (date >= date) if (step < 0) for (; ++step <= 0;) for (; offseti(date, -1), !test(date););
|
13816 | else for (; --step >= 0;) for (; offseti(date, 1), !test(date););
|
13817 | });
|
13818 | }, count && (interval.count = function (start, end) {
|
13819 | return t0.setTime(+start), t1.setTime(+end), floori(t0), floori(t1), Math.floor(count(t0, t1));
|
13820 | }, interval.every = function (step) {
|
13821 | return step = Math.floor(step), isFinite(step) && step > 0 ? step > 1 ? interval.filter(field ? function (d) {
|
13822 | return field(d) % step === 0;
|
13823 | } : function (d) {
|
13824 | return interval.count(0, d) % step === 0;
|
13825 | }) : interval : null;
|
13826 | }), interval;
|
13827 | }
|
13828 | ;
|
13829 | var durationSecond = 1e3;
|
13830 | var durationMinute = 6e4;
|
13831 | var durationHour = 36e5;
|
13832 | var durationDay = 864e5;
|
13833 | var durationWeek = 6048e5;
|
13834 | ;
|
13835 |
|
13836 |
|
13837 |
|
13838 | function utcWeekday(i) {
|
13839 | return newInterval(function (date) {
|
13840 | date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7), date.setUTCHours(0, 0, 0, 0);
|
13841 | }, function (date, step) {
|
13842 | date.setUTCDate(date.getUTCDate() + step * 7);
|
13843 | }, function (start, end) {
|
13844 | return (end - start) / durationWeek;
|
13845 | });
|
13846 | }
|
13847 |
|
13848 | var utcSunday = utcWeekday(0);
|
13849 | var utcMonday = utcWeekday(1);
|
13850 | var utcTuesday = utcWeekday(2);
|
13851 | var utcWednesday = utcWeekday(3);
|
13852 | var utcThursday = utcWeekday(4);
|
13853 | var utcFriday = utcWeekday(5);
|
13854 | var utcSaturday = utcWeekday(6);
|
13855 | var utcSundays = utcSunday.range;
|
13856 | var utcMondays = utcMonday.range;
|
13857 | var utcTuesdays = utcTuesday.range;
|
13858 | var utcWednesdays = utcWednesday.range;
|
13859 | var utcThursdays = utcThursday.range;
|
13860 | var utcFridays = utcFriday.range;
|
13861 | var utcSaturdays = utcSaturday.range;
|
13862 | ;
|
13863 |
|
13864 |
|
13865 | var utcDay = newInterval(function (date) {
|
13866 | date.setUTCHours(0, 0, 0, 0);
|
13867 | }, function (date, step) {
|
13868 | date.setUTCDate(date.getUTCDate() + step);
|
13869 | }, function (start, end) {
|
13870 | return (end - start) / durationDay;
|
13871 | }, function (date) {
|
13872 | return date.getUTCDate() - 1;
|
13873 | });
|
13874 | var src_utcDay = (utcDay);
|
13875 | var utcDays = utcDay.range;
|
13876 | ;
|
13877 |
|
13878 |
|
13879 |
|
13880 | function weekday(i) {
|
13881 | return newInterval(function (date) {
|
13882 | date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7), date.setHours(0, 0, 0, 0);
|
13883 | }, function (date, step) {
|
13884 | date.setDate(date.getDate() + step * 7);
|
13885 | }, function (start, end) {
|
13886 | return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;
|
13887 | });
|
13888 | }
|
13889 |
|
13890 | var sunday = weekday(0);
|
13891 | var monday = weekday(1);
|
13892 | var tuesday = weekday(2);
|
13893 | var wednesday = weekday(3);
|
13894 | var thursday = weekday(4);
|
13895 | var friday = weekday(5);
|
13896 | var saturday = weekday(6);
|
13897 | var sundays = sunday.range;
|
13898 | var mondays = monday.range;
|
13899 | var tuesdays = tuesday.range;
|
13900 | var wednesdays = wednesday.range;
|
13901 | var thursdays = thursday.range;
|
13902 | var fridays = friday.range;
|
13903 | var saturdays = saturday.range;
|
13904 | ;
|
13905 |
|
13906 |
|
13907 | var day = newInterval(function (date) {
|
13908 | return date.setHours(0, 0, 0, 0);
|
13909 | }, function (date, step) {
|
13910 | return date.setDate(date.getDate() + step);
|
13911 | }, function (start, end) {
|
13912 | return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay;
|
13913 | }, function (date) {
|
13914 | return date.getDate() - 1;
|
13915 | });
|
13916 | var src_day = (day);
|
13917 | var days = day.range;
|
13918 | ;
|
13919 |
|
13920 | var year = newInterval(function (date) {
|
13921 | date.setMonth(0, 1), date.setHours(0, 0, 0, 0);
|
13922 | }, function (date, step) {
|
13923 | date.setFullYear(date.getFullYear() + step);
|
13924 | }, function (start, end) {
|
13925 | return end.getFullYear() - start.getFullYear();
|
13926 | }, function (date) {
|
13927 | return date.getFullYear();
|
13928 | });
|
13929 |
|
13930 | year.every = function (k) {
|
13931 | return isFinite(k = Math.floor(k)) && k > 0 ? newInterval(function (date) {
|
13932 | date.setFullYear(Math.floor(date.getFullYear() / k) * k), date.setMonth(0, 1), date.setHours(0, 0, 0, 0);
|
13933 | }, function (date, step) {
|
13934 | date.setFullYear(date.getFullYear() + step * k);
|
13935 | }) : null;
|
13936 | };
|
13937 |
|
13938 | var src_year = (year);
|
13939 | var years = year.range;
|
13940 | ;
|
13941 |
|
13942 | var utcYear = newInterval(function (date) {
|
13943 | date.setUTCMonth(0, 1), date.setUTCHours(0, 0, 0, 0);
|
13944 | }, function (date, step) {
|
13945 | date.setUTCFullYear(date.getUTCFullYear() + step);
|
13946 | }, function (start, end) {
|
13947 | return end.getUTCFullYear() - start.getUTCFullYear();
|
13948 | }, function (date) {
|
13949 | return date.getUTCFullYear();
|
13950 | });
|
13951 |
|
13952 | utcYear.every = function (k) {
|
13953 | return isFinite(k = Math.floor(k)) && k > 0 ? newInterval(function (date) {
|
13954 | date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k), date.setUTCMonth(0, 1), date.setUTCHours(0, 0, 0, 0);
|
13955 | }, function (date, step) {
|
13956 | date.setUTCFullYear(date.getUTCFullYear() + step * k);
|
13957 | }) : null;
|
13958 | };
|
13959 |
|
13960 | var src_utcYear = (utcYear);
|
13961 | var utcYears = utcYear.range;
|
13962 | ;
|
13963 |
|
13964 |
|
13965 | function localDate(d) {
|
13966 | if (0 <= d.y && d.y < 100) {
|
13967 | var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);
|
13968 | return date.setFullYear(d.y), date;
|
13969 | }
|
13970 |
|
13971 | return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);
|
13972 | }
|
13973 |
|
13974 | function utcDate(d) {
|
13975 | if (0 <= d.y && d.y < 100) {
|
13976 | var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));
|
13977 | return date.setUTCFullYear(d.y), date;
|
13978 | }
|
13979 |
|
13980 | return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));
|
13981 | }
|
13982 |
|
13983 | function newDate(y, m, d) {
|
13984 | return {
|
13985 | y: y,
|
13986 | m: m,
|
13987 | d: d,
|
13988 | H: 0,
|
13989 | M: 0,
|
13990 | S: 0,
|
13991 | L: 0
|
13992 | };
|
13993 | }
|
13994 |
|
13995 | function formatLocale(locale) {
|
13996 | function newFormat(specifier, formats) {
|
13997 | return function (date) {
|
13998 | var c,
|
13999 | pad,
|
14000 | format,
|
14001 | string = [],
|
14002 | i = -1,
|
14003 | j = 0,
|
14004 | n = specifier.length;
|
14005 |
|
14006 | for (date instanceof Date || (date = new Date(+date)); ++i < n;) specifier.charCodeAt(i) === 37 && (string.push(specifier.slice(j, i)), (pad = pads[c = specifier.charAt(++i)]) == null ? pad = c === "e" ? " " : "0" : c = specifier.charAt(++i), (format = formats[c]) && (c = format(date, pad)), string.push(c), j = i + 1);
|
14007 |
|
14008 | return string.push(specifier.slice(j, i)), string.join("");
|
14009 | };
|
14010 | }
|
14011 |
|
14012 | function newParse(specifier, Z) {
|
14013 | return function (string) {
|
14014 | var week,
|
14015 | day,
|
14016 | d = newDate(1900, undefined, 1),
|
14017 | i = parseSpecifier(d, specifier, string += "", 0);
|
14018 | if (i != string.length) return null;
|
14019 |
|
14020 | if ("Q" in d) return new Date(d.Q);
|
14021 | if ("s" in d) return new Date(d.s * 1e3 + ("L" in d ? d.L : 0));
|
14022 |
|
14023 |
|
14024 | if (Z && !("Z" in d) && (d.Z = 0), "p" in d && (d.H = d.H % 12 + d.p * 12), d.m === undefined && (d.m = "q" in d ? d.q : 0), "V" in d) {
|
14025 | if (d.V < 1 || d.V > 53) return null;
|
14026 | "w" in d || (d.w = 1), "Z" in d ? (week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay(), week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week), week = src_utcDay.offset(week, (d.V - 1) * 7), d.y = week.getUTCFullYear(), d.m = week.getUTCMonth(), d.d = week.getUTCDate() + (d.w + 6) % 7) : (week = localDate(newDate(d.y, 0, 1)), day = week.getDay(), week = day > 4 || day === 0 ? monday.ceil(week) : monday(week), week = src_day.offset(week, (d.V - 1) * 7), d.y = week.getFullYear(), d.m = week.getMonth(), d.d = week.getDate() + (d.w + 6) % 7);
|
14027 | } else ("W" in d || "U" in d) && ("w" in d || (d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0), day = "Z" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay(), d.m = 0, d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7);
|
14028 |
|
14029 |
|
14030 |
|
14031 | return "Z" in d ? (d.H += d.Z / 100 | 0, d.M += d.Z % 100, utcDate(d)) : localDate(d);
|
14032 | };
|
14033 | }
|
14034 |
|
14035 | function parseSpecifier(d, specifier, string, j) {
|
14036 | for (var c, parse, i = 0, n = specifier.length, m = string.length; i < n;) {
|
14037 | if (j >= m) return -1;
|
14038 | if (c = specifier.charCodeAt(i++), c === 37) {
|
14039 | if (c = specifier.charAt(i++), parse = parses[c in pads ? specifier.charAt(i++) : c], !parse || (j = parse(d, string, j)) < 0) return -1;
|
14040 | } else if (c != string.charCodeAt(j++)) return -1;
|
14041 | }
|
14042 |
|
14043 | return j;
|
14044 | }
|
14045 |
|
14046 | var locale_dateTime = locale.dateTime,
|
14047 | locale_date = locale.date,
|
14048 | locale_time = locale.time,
|
14049 | locale_periods = locale.periods,
|
14050 | locale_weekdays = locale.days,
|
14051 | locale_shortWeekdays = locale.shortDays,
|
14052 | locale_months = locale.months,
|
14053 | locale_shortMonths = locale.shortMonths,
|
14054 | periodRe = formatRe(locale_periods),
|
14055 | periodLookup = formatLookup(locale_periods),
|
14056 | weekdayRe = formatRe(locale_weekdays),
|
14057 | weekdayLookup = formatLookup(locale_weekdays),
|
14058 | shortWeekdayRe = formatRe(locale_shortWeekdays),
|
14059 | shortWeekdayLookup = formatLookup(locale_shortWeekdays),
|
14060 | monthRe = formatRe(locale_months),
|
14061 | monthLookup = formatLookup(locale_months),
|
14062 | shortMonthRe = formatRe(locale_shortMonths),
|
14063 | shortMonthLookup = formatLookup(locale_shortMonths),
|
14064 | formats = {
|
14065 | "a": function (d) {
|
14066 | return locale_shortWeekdays[d.getDay()];
|
14067 | },
|
14068 | "A": function (d) {
|
14069 | return locale_weekdays[d.getDay()];
|
14070 | },
|
14071 | "b": function (d) {
|
14072 | return locale_shortMonths[d.getMonth()];
|
14073 | },
|
14074 | "B": function (d) {
|
14075 | return locale_months[d.getMonth()];
|
14076 | },
|
14077 | "c": null,
|
14078 | "d": formatDayOfMonth,
|
14079 | "e": formatDayOfMonth,
|
14080 | "f": formatMicroseconds,
|
14081 | "g": formatYearISO,
|
14082 | "G": formatFullYearISO,
|
14083 | "H": formatHour24,
|
14084 | "I": formatHour12,
|
14085 | "j": formatDayOfYear,
|
14086 | "L": formatMilliseconds,
|
14087 | "m": formatMonthNumber,
|
14088 | "M": formatMinutes,
|
14089 | "p": function (d) {
|
14090 | return locale_periods[+(d.getHours() >= 12)];
|
14091 | },
|
14092 | "q": function (d) {
|
14093 | return 1 + ~~(d.getMonth() / 3);
|
14094 | },
|
14095 | "Q": formatUnixTimestamp,
|
14096 | "s": formatUnixTimestampSeconds,
|
14097 | "S": formatSeconds,
|
14098 | "u": formatWeekdayNumberMonday,
|
14099 | "U": formatWeekNumberSunday,
|
14100 | "V": formatWeekNumberISO,
|
14101 | "w": formatWeekdayNumberSunday,
|
14102 | "W": formatWeekNumberMonday,
|
14103 | "x": null,
|
14104 | "X": null,
|
14105 | "y": formatYear,
|
14106 | "Y": formatFullYear,
|
14107 | "Z": formatZone,
|
14108 | "%": formatLiteralPercent
|
14109 | },
|
14110 | utcFormats = {
|
14111 | "a": function (d) {
|
14112 | return locale_shortWeekdays[d.getUTCDay()];
|
14113 | },
|
14114 | "A": function (d) {
|
14115 | return locale_weekdays[d.getUTCDay()];
|
14116 | },
|
14117 | "b": function (d) {
|
14118 | return locale_shortMonths[d.getUTCMonth()];
|
14119 | },
|
14120 | "B": function (d) {
|
14121 | return locale_months[d.getUTCMonth()];
|
14122 | },
|
14123 | "c": null,
|
14124 | "d": formatUTCDayOfMonth,
|
14125 | "e": formatUTCDayOfMonth,
|
14126 | "f": formatUTCMicroseconds,
|
14127 | "g": formatUTCYearISO,
|
14128 | "G": formatUTCFullYearISO,
|
14129 | "H": formatUTCHour24,
|
14130 | "I": formatUTCHour12,
|
14131 | "j": formatUTCDayOfYear,
|
14132 | "L": formatUTCMilliseconds,
|
14133 | "m": formatUTCMonthNumber,
|
14134 | "M": formatUTCMinutes,
|
14135 | "p": function (d) {
|
14136 | return locale_periods[+(d.getUTCHours() >= 12)];
|
14137 | },
|
14138 | "q": function (d) {
|
14139 | return 1 + ~~(d.getUTCMonth() / 3);
|
14140 | },
|
14141 | "Q": formatUnixTimestamp,
|
14142 | "s": formatUnixTimestampSeconds,
|
14143 | "S": formatUTCSeconds,
|
14144 | "u": formatUTCWeekdayNumberMonday,
|
14145 | "U": formatUTCWeekNumberSunday,
|
14146 | "V": formatUTCWeekNumberISO,
|
14147 | "w": formatUTCWeekdayNumberSunday,
|
14148 | "W": formatUTCWeekNumberMonday,
|
14149 | "x": null,
|
14150 | "X": null,
|
14151 | "y": formatUTCYear,
|
14152 | "Y": formatUTCFullYear,
|
14153 | "Z": formatUTCZone,
|
14154 | "%": formatLiteralPercent
|
14155 | },
|
14156 | parses = {
|
14157 | "a": function (d, string, i) {
|
14158 | var n = shortWeekdayRe.exec(string.slice(i));
|
14159 | return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
14160 | },
|
14161 | "A": function (d, string, i) {
|
14162 | var n = weekdayRe.exec(string.slice(i));
|
14163 | return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
14164 | },
|
14165 | "b": function (d, string, i) {
|
14166 | var n = shortMonthRe.exec(string.slice(i));
|
14167 | return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
14168 | },
|
14169 | "B": function (d, string, i) {
|
14170 | var n = monthRe.exec(string.slice(i));
|
14171 | return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
14172 | },
|
14173 | "c": function (d, string, i) {
|
14174 | return parseSpecifier(d, locale_dateTime, string, i);
|
14175 | },
|
14176 | "d": parseDayOfMonth,
|
14177 | "e": parseDayOfMonth,
|
14178 | "f": parseMicroseconds,
|
14179 | "g": parseYear,
|
14180 | "G": parseFullYear,
|
14181 | "H": parseHour24,
|
14182 | "I": parseHour24,
|
14183 | "j": parseDayOfYear,
|
14184 | "L": parseMilliseconds,
|
14185 | "m": parseMonthNumber,
|
14186 | "M": parseMinutes,
|
14187 | "p": function (d, string, i) {
|
14188 | var n = periodRe.exec(string.slice(i));
|
14189 | return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
14190 | },
|
14191 | "q": parseQuarter,
|
14192 | "Q": parseUnixTimestamp,
|
14193 | "s": parseUnixTimestampSeconds,
|
14194 | "S": parseSeconds,
|
14195 | "u": parseWeekdayNumberMonday,
|
14196 | "U": parseWeekNumberSunday,
|
14197 | "V": parseWeekNumberISO,
|
14198 | "w": parseWeekdayNumberSunday,
|
14199 | "W": parseWeekNumberMonday,
|
14200 | "x": function (d, string, i) {
|
14201 | return parseSpecifier(d, locale_date, string, i);
|
14202 | },
|
14203 | "X": function (d, string, i) {
|
14204 | return parseSpecifier(d, locale_time, string, i);
|
14205 | },
|
14206 | "y": parseYear,
|
14207 | "Y": parseFullYear,
|
14208 | "Z": parseZone,
|
14209 | "%": parseLiteralPercent
|
14210 | };
|
14211 | return formats.x = newFormat(locale_date, formats), formats.X = newFormat(locale_time, formats), formats.c = newFormat(locale_dateTime, formats), utcFormats.x = newFormat(locale_date, utcFormats), utcFormats.X = newFormat(locale_time, utcFormats), utcFormats.c = newFormat(locale_dateTime, utcFormats), {
|
14212 | format: function format(specifier) {
|
14213 | var f = newFormat(specifier += "", formats);
|
14214 | return f.toString = function () {
|
14215 | return specifier;
|
14216 | }, f;
|
14217 | },
|
14218 | parse: function parse(specifier) {
|
14219 | var p = newParse(specifier += "", !1);
|
14220 | return p.toString = function () {
|
14221 | return specifier;
|
14222 | }, p;
|
14223 | },
|
14224 | utcFormat: function utcFormat(specifier) {
|
14225 | var f = newFormat(specifier += "", utcFormats);
|
14226 | return f.toString = function () {
|
14227 | return specifier;
|
14228 | }, f;
|
14229 | },
|
14230 | utcParse: function utcParse(specifier) {
|
14231 | var p = newParse(specifier += "", !0);
|
14232 | return p.toString = function () {
|
14233 | return specifier;
|
14234 | }, p;
|
14235 | }
|
14236 | };
|
14237 | }
|
14238 | var pads = {
|
14239 | "-": "",
|
14240 | "_": " ",
|
14241 | "0": "0"
|
14242 | },
|
14243 | numberRe = /^\s*\d+/,
|
14244 |
|
14245 | percentRe = /^%/,
|
14246 | requoteRe = /[\\^$*+?|[\]().{}]/g;
|
14247 |
|
14248 | function pad(value, fill, width) {
|
14249 | var sign = value < 0 ? "-" : "",
|
14250 | string = (sign ? -value : value) + "",
|
14251 | length = string.length;
|
14252 | return sign + (length < width ? Array(width - length + 1).join(fill) + string : string);
|
14253 | }
|
14254 |
|
14255 | function requote(s) {
|
14256 | return s.replace(requoteRe, "\\$&");
|
14257 | }
|
14258 |
|
14259 | function formatRe(names) {
|
14260 | return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i");
|
14261 | }
|
14262 |
|
14263 | function formatLookup(names) {
|
14264 | return new Map(names.map(function (name, i) {
|
14265 | return [name.toLowerCase(), i];
|
14266 | }));
|
14267 | }
|
14268 |
|
14269 | function parseWeekdayNumberSunday(d, string, i) {
|
14270 | var n = numberRe.exec(string.slice(i, i + 1));
|
14271 | return n ? (d.w = +n[0], i + n[0].length) : -1;
|
14272 | }
|
14273 |
|
14274 | function parseWeekdayNumberMonday(d, string, i) {
|
14275 | var n = numberRe.exec(string.slice(i, i + 1));
|
14276 | return n ? (d.u = +n[0], i + n[0].length) : -1;
|
14277 | }
|
14278 |
|
14279 | function parseWeekNumberSunday(d, string, i) {
|
14280 | var n = numberRe.exec(string.slice(i, i + 2));
|
14281 | return n ? (d.U = +n[0], i + n[0].length) : -1;
|
14282 | }
|
14283 |
|
14284 | function parseWeekNumberISO(d, string, i) {
|
14285 | var n = numberRe.exec(string.slice(i, i + 2));
|
14286 | return n ? (d.V = +n[0], i + n[0].length) : -1;
|
14287 | }
|
14288 |
|
14289 | function parseWeekNumberMonday(d, string, i) {
|
14290 | var n = numberRe.exec(string.slice(i, i + 2));
|
14291 | return n ? (d.W = +n[0], i + n[0].length) : -1;
|
14292 | }
|
14293 |
|
14294 | function parseFullYear(d, string, i) {
|
14295 | var n = numberRe.exec(string.slice(i, i + 4));
|
14296 | return n ? (d.y = +n[0], i + n[0].length) : -1;
|
14297 | }
|
14298 |
|
14299 | function parseYear(d, string, i) {
|
14300 | var n = numberRe.exec(string.slice(i, i + 2));
|
14301 | return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2e3), i + n[0].length) : -1;
|
14302 | }
|
14303 |
|
14304 | function parseZone(d, string, i) {
|
14305 | var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i, i + 6));
|
14306 | return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i + n[0].length) : -1;
|
14307 | }
|
14308 |
|
14309 | function parseQuarter(d, string, i) {
|
14310 | var n = numberRe.exec(string.slice(i, i + 1));
|
14311 | return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;
|
14312 | }
|
14313 |
|
14314 | function parseMonthNumber(d, string, i) {
|
14315 | var n = numberRe.exec(string.slice(i, i + 2));
|
14316 | return n ? (d.m = n[0] - 1, i + n[0].length) : -1;
|
14317 | }
|
14318 |
|
14319 | function parseDayOfMonth(d, string, i) {
|
14320 | var n = numberRe.exec(string.slice(i, i + 2));
|
14321 | return n ? (d.d = +n[0], i + n[0].length) : -1;
|
14322 | }
|
14323 |
|
14324 | function parseDayOfYear(d, string, i) {
|
14325 | var n = numberRe.exec(string.slice(i, i + 3));
|
14326 | return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;
|
14327 | }
|
14328 |
|
14329 | function parseHour24(d, string, i) {
|
14330 | var n = numberRe.exec(string.slice(i, i + 2));
|
14331 | return n ? (d.H = +n[0], i + n[0].length) : -1;
|
14332 | }
|
14333 |
|
14334 | function parseMinutes(d, string, i) {
|
14335 | var n = numberRe.exec(string.slice(i, i + 2));
|
14336 | return n ? (d.M = +n[0], i + n[0].length) : -1;
|
14337 | }
|
14338 |
|
14339 | function parseSeconds(d, string, i) {
|
14340 | var n = numberRe.exec(string.slice(i, i + 2));
|
14341 | return n ? (d.S = +n[0], i + n[0].length) : -1;
|
14342 | }
|
14343 |
|
14344 | function parseMilliseconds(d, string, i) {
|
14345 | var n = numberRe.exec(string.slice(i, i + 3));
|
14346 | return n ? (d.L = +n[0], i + n[0].length) : -1;
|
14347 | }
|
14348 |
|
14349 | function parseMicroseconds(d, string, i) {
|
14350 | var n = numberRe.exec(string.slice(i, i + 6));
|
14351 | return n ? (d.L = Math.floor(n[0] / 1e3), i + n[0].length) : -1;
|
14352 | }
|
14353 |
|
14354 | function parseLiteralPercent(d, string, i) {
|
14355 | var n = percentRe.exec(string.slice(i, i + 1));
|
14356 | return n ? i + n[0].length : -1;
|
14357 | }
|
14358 |
|
14359 | function parseUnixTimestamp(d, string, i) {
|
14360 | var n = numberRe.exec(string.slice(i));
|
14361 | return n ? (d.Q = +n[0], i + n[0].length) : -1;
|
14362 | }
|
14363 |
|
14364 | function parseUnixTimestampSeconds(d, string, i) {
|
14365 | var n = numberRe.exec(string.slice(i));
|
14366 | return n ? (d.s = +n[0], i + n[0].length) : -1;
|
14367 | }
|
14368 |
|
14369 | function formatDayOfMonth(d, p) {
|
14370 | return pad(d.getDate(), p, 2);
|
14371 | }
|
14372 |
|
14373 | function formatHour24(d, p) {
|
14374 | return pad(d.getHours(), p, 2);
|
14375 | }
|
14376 |
|
14377 | function formatHour12(d, p) {
|
14378 | return pad(d.getHours() % 12 || 12, p, 2);
|
14379 | }
|
14380 |
|
14381 | function formatDayOfYear(d, p) {
|
14382 | return pad(1 + src_day.count(src_year(d), d), p, 3);
|
14383 | }
|
14384 |
|
14385 | function formatMilliseconds(d, p) {
|
14386 | return pad(d.getMilliseconds(), p, 3);
|
14387 | }
|
14388 |
|
14389 | function formatMicroseconds(d, p) {
|
14390 | return formatMilliseconds(d, p) + "000";
|
14391 | }
|
14392 |
|
14393 | function formatMonthNumber(d, p) {
|
14394 | return pad(d.getMonth() + 1, p, 2);
|
14395 | }
|
14396 |
|
14397 | function formatMinutes(d, p) {
|
14398 | return pad(d.getMinutes(), p, 2);
|
14399 | }
|
14400 |
|
14401 | function formatSeconds(d, p) {
|
14402 | return pad(d.getSeconds(), p, 2);
|
14403 | }
|
14404 |
|
14405 | function formatWeekdayNumberMonday(d) {
|
14406 | var day = d.getDay();
|
14407 | return day === 0 ? 7 : day;
|
14408 | }
|
14409 |
|
14410 | function formatWeekNumberSunday(d, p) {
|
14411 | return pad(sunday.count(src_year(d) - 1, d), p, 2);
|
14412 | }
|
14413 |
|
14414 | function dISO(d) {
|
14415 | var day = d.getDay();
|
14416 | return day >= 4 || day === 0 ? thursday(d) : thursday.ceil(d);
|
14417 | }
|
14418 |
|
14419 | function formatWeekNumberISO(d, p) {
|
14420 | return d = dISO(d), pad(thursday.count(src_year(d), d) + (src_year(d).getDay() === 4), p, 2);
|
14421 | }
|
14422 |
|
14423 | function formatWeekdayNumberSunday(d) {
|
14424 | return d.getDay();
|
14425 | }
|
14426 |
|
14427 | function formatWeekNumberMonday(d, p) {
|
14428 | return pad(monday.count(src_year(d) - 1, d), p, 2);
|
14429 | }
|
14430 |
|
14431 | function formatYear(d, p) {
|
14432 | return pad(d.getFullYear() % 100, p, 2);
|
14433 | }
|
14434 |
|
14435 | function formatYearISO(d, p) {
|
14436 | return d = dISO(d), pad(d.getFullYear() % 100, p, 2);
|
14437 | }
|
14438 |
|
14439 | function formatFullYear(d, p) {
|
14440 | return pad(d.getFullYear() % 1e4, p, 4);
|
14441 | }
|
14442 |
|
14443 | function formatFullYearISO(d, p) {
|
14444 | var day = d.getDay();
|
14445 | return d = day >= 4 || day === 0 ? thursday(d) : thursday.ceil(d), pad(d.getFullYear() % 1e4, p, 4);
|
14446 | }
|
14447 |
|
14448 | function formatZone(d) {
|
14449 | var z = d.getTimezoneOffset();
|
14450 | return (z > 0 ? "-" : (z *= -1, "+")) + pad(z / 60 | 0, "0", 2) + pad(z % 60, "0", 2);
|
14451 | }
|
14452 |
|
14453 | function formatUTCDayOfMonth(d, p) {
|
14454 | return pad(d.getUTCDate(), p, 2);
|
14455 | }
|
14456 |
|
14457 | function formatUTCHour24(d, p) {
|
14458 | return pad(d.getUTCHours(), p, 2);
|
14459 | }
|
14460 |
|
14461 | function formatUTCHour12(d, p) {
|
14462 | return pad(d.getUTCHours() % 12 || 12, p, 2);
|
14463 | }
|
14464 |
|
14465 | function formatUTCDayOfYear(d, p) {
|
14466 | return pad(1 + src_utcDay.count(src_utcYear(d), d), p, 3);
|
14467 | }
|
14468 |
|
14469 | function formatUTCMilliseconds(d, p) {
|
14470 | return pad(d.getUTCMilliseconds(), p, 3);
|
14471 | }
|
14472 |
|
14473 | function formatUTCMicroseconds(d, p) {
|
14474 | return formatUTCMilliseconds(d, p) + "000";
|
14475 | }
|
14476 |
|
14477 | function formatUTCMonthNumber(d, p) {
|
14478 | return pad(d.getUTCMonth() + 1, p, 2);
|
14479 | }
|
14480 |
|
14481 | function formatUTCMinutes(d, p) {
|
14482 | return pad(d.getUTCMinutes(), p, 2);
|
14483 | }
|
14484 |
|
14485 | function formatUTCSeconds(d, p) {
|
14486 | return pad(d.getUTCSeconds(), p, 2);
|
14487 | }
|
14488 |
|
14489 | function formatUTCWeekdayNumberMonday(d) {
|
14490 | var dow = d.getUTCDay();
|
14491 | return dow === 0 ? 7 : dow;
|
14492 | }
|
14493 |
|
14494 | function formatUTCWeekNumberSunday(d, p) {
|
14495 | return pad(utcSunday.count(src_utcYear(d) - 1, d), p, 2);
|
14496 | }
|
14497 |
|
14498 | function UTCdISO(d) {
|
14499 | var day = d.getUTCDay();
|
14500 | return day >= 4 || day === 0 ? utcThursday(d) : utcThursday.ceil(d);
|
14501 | }
|
14502 |
|
14503 | function formatUTCWeekNumberISO(d, p) {
|
14504 | return d = UTCdISO(d), pad(utcThursday.count(src_utcYear(d), d) + (src_utcYear(d).getUTCDay() === 4), p, 2);
|
14505 | }
|
14506 |
|
14507 | function formatUTCWeekdayNumberSunday(d) {
|
14508 | return d.getUTCDay();
|
14509 | }
|
14510 |
|
14511 | function formatUTCWeekNumberMonday(d, p) {
|
14512 | return pad(utcMonday.count(src_utcYear(d) - 1, d), p, 2);
|
14513 | }
|
14514 |
|
14515 | function formatUTCYear(d, p) {
|
14516 | return pad(d.getUTCFullYear() % 100, p, 2);
|
14517 | }
|
14518 |
|
14519 | function formatUTCYearISO(d, p) {
|
14520 | return d = UTCdISO(d), pad(d.getUTCFullYear() % 100, p, 2);
|
14521 | }
|
14522 |
|
14523 | function formatUTCFullYear(d, p) {
|
14524 | return pad(d.getUTCFullYear() % 1e4, p, 4);
|
14525 | }
|
14526 |
|
14527 | function formatUTCFullYearISO(d, p) {
|
14528 | var day = d.getUTCDay();
|
14529 | return d = day >= 4 || day === 0 ? utcThursday(d) : utcThursday.ceil(d), pad(d.getUTCFullYear() % 1e4, p, 4);
|
14530 | }
|
14531 |
|
14532 | function formatUTCZone() {
|
14533 | return "+0000";
|
14534 | }
|
14535 |
|
14536 | function formatLiteralPercent() {
|
14537 | return "%";
|
14538 | }
|
14539 |
|
14540 | function formatUnixTimestamp(d) {
|
14541 | return +d;
|
14542 | }
|
14543 |
|
14544 | function formatUnixTimestampSeconds(d) {
|
14545 | return Math.floor(+d / 1e3);
|
14546 | }
|
14547 | ;
|
14548 |
|
14549 | var locale;
|
14550 | var timeFormat;
|
14551 | var timeParse;
|
14552 | var utcFormat;
|
14553 | var utcParse;
|
14554 | defaultLocale({
|
14555 | dateTime: "%x, %X",
|
14556 | date: "%-m/%-d/%Y",
|
14557 | time: "%-I:%M:%S %p",
|
14558 | periods: ["AM", "PM"],
|
14559 | days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
|
14560 | shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
14561 | months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
|
14562 | shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
|
14563 | });
|
14564 | function defaultLocale(definition) {
|
14565 | return locale = formatLocale(definition), timeFormat = locale.format, timeParse = locale.parse, utcFormat = locale.utcFormat, utcParse = locale.utcParse, locale;
|
14566 | }
|
14567 | ;
|
14568 | function none() {}
|
14569 |
|
14570 | function selector(selector) {
|
14571 | return selector == null ? none : function () {
|
14572 | return this.querySelector(selector);
|
14573 | };
|
14574 | }
|
14575 | ;
|
14576 |
|
14577 |
|
14578 | function selection_select(select) {
|
14579 | typeof select !== "function" && (select = selector(select));
|
14580 |
|
14581 | for (var groups = this._groups, m = groups.length, subgroups = Array(m), j = 0; j < m; ++j) for (var node, subnode, group = groups[j], n = group.length, subgroup = subgroups[j] = Array(n), i = 0; i < n; ++i) (node = group[i]) && (subnode = select.call(node, node.__data__, i, group)) && ("__data__" in node && (subnode.__data__ = node.__data__), subgroup[i] = subnode);
|
14582 |
|
14583 | return new Selection(subgroups, this._parents);
|
14584 | }
|
14585 | ;
|
14586 | function array(x) {
|
14587 | return typeof x === "object" && "length" in x ? x
|
14588 | : Array.from(x);
|
14589 | }
|
14590 | ;
|
14591 | function empty() {
|
14592 | return [];
|
14593 | }
|
14594 |
|
14595 | function selectorAll(selector) {
|
14596 | return selector == null ? empty : function () {
|
14597 | return this.querySelectorAll(selector);
|
14598 | };
|
14599 | }
|
14600 | ;
|
14601 |
|
14602 |
|
14603 |
|
14604 |
|
14605 | function arrayAll(select) {
|
14606 | return function () {
|
14607 | var group = select.apply(this, arguments);
|
14608 | return group == null ? [] : array(group);
|
14609 | };
|
14610 | }
|
14611 |
|
14612 | function selectAll(select) {
|
14613 | select = typeof select === "function" ? arrayAll(select) : selectorAll(select);
|
14614 |
|
14615 | for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) for (var node, group = groups[j], n = group.length, i = 0; i < n; ++i) (node = group[i]) && (subgroups.push(select.call(node, node.__data__, i, group)), parents.push(node));
|
14616 |
|
14617 | return new Selection(subgroups, parents);
|
14618 | }
|
14619 | ;
|
14620 | function matcher(selector) {
|
14621 | return function () {
|
14622 | return this.matches(selector);
|
14623 | };
|
14624 | }
|
14625 | function childMatcher(selector) {
|
14626 | return function (node) {
|
14627 | return node.matches(selector);
|
14628 | };
|
14629 | }
|
14630 | ;
|
14631 |
|
14632 | var find = Array.prototype.find;
|
14633 |
|
14634 | function childFind(match) {
|
14635 | return function () {
|
14636 | return find.call(this.children, match);
|
14637 | };
|
14638 | }
|
14639 |
|
14640 | function childFirst() {
|
14641 | return this.firstElementChild;
|
14642 | }
|
14643 |
|
14644 | function selectChild(match) {
|
14645 | return this.select(match == null ? childFirst : childFind(typeof match === "function" ? match : childMatcher(match)));
|
14646 | }
|
14647 | ;
|
14648 |
|
14649 | var filter = Array.prototype.filter;
|
14650 |
|
14651 | function children() {
|
14652 | return this.children;
|
14653 | }
|
14654 |
|
14655 | function childrenFilter(match) {
|
14656 | return function () {
|
14657 | return filter.call(this.children, match);
|
14658 | };
|
14659 | }
|
14660 |
|
14661 | function selectChildren(match) {
|
14662 | return this.selectAll(match == null ? children : childrenFilter(typeof match === "function" ? match : childMatcher(match)));
|
14663 | }
|
14664 | ;
|
14665 |
|
14666 |
|
14667 | function selection_filter(match) {
|
14668 | typeof match !== "function" && (match = matcher(match));
|
14669 |
|
14670 | for (var groups = this._groups, m = groups.length, subgroups = Array(m), j = 0; j < m; ++j) for (var node, group = groups[j], n = group.length, subgroup = subgroups[j] = [], i = 0; i < n; ++i) (node = group[i]) && match.call(node, node.__data__, i, group) && subgroup.push(node);
|
14671 |
|
14672 | return new Selection(subgroups, this._parents);
|
14673 | }
|
14674 | ;
|
14675 | function sparse(update) {
|
14676 | return Array(update.length);
|
14677 | }
|
14678 | ;
|
14679 |
|
14680 |
|
14681 | function enter() {
|
14682 | return new Selection(this._enter || this._groups.map(sparse), this._parents);
|
14683 | }
|
14684 | function EnterNode(parent, datum) {
|
14685 | this.ownerDocument = parent.ownerDocument, this.namespaceURI = parent.namespaceURI, this._next = null, this._parent = parent, this.__data__ = datum;
|
14686 | }
|
14687 | EnterNode.prototype = {
|
14688 | constructor: EnterNode,
|
14689 | appendChild: function appendChild(child) {
|
14690 | return this._parent.insertBefore(child, this._next);
|
14691 | },
|
14692 | insertBefore: function insertBefore(child, next) {
|
14693 | return this._parent.insertBefore(child, next);
|
14694 | },
|
14695 | querySelector: function querySelector(selector) {
|
14696 | return this._parent.querySelector(selector);
|
14697 | },
|
14698 | querySelectorAll: function querySelectorAll(selector) {
|
14699 | return this._parent.querySelectorAll(selector);
|
14700 | }
|
14701 | };
|
14702 | ;
|
14703 | function constant(x) {
|
14704 | return function () {
|
14705 | return x;
|
14706 | };
|
14707 | }
|
14708 | ;
|
14709 |
|
14710 |
|
14711 |
|
14712 |
|
14713 |
|
14714 | function bindIndex(parent, group, enter, update, exit, data) {
|
14715 |
|
14716 |
|
14717 |
|
14718 | for (var node, i = 0, groupLength = group.length, dataLength = data.length; i < dataLength; ++i) (node = group[i]) ? (node.__data__ = data[i], update[i] = node) : enter[i] = new EnterNode(parent, data[i]);
|
14719 |
|
14720 |
|
14721 | for (; i < groupLength; ++i) (node = group[i]) && (exit[i] = node);
|
14722 | }
|
14723 |
|
14724 | function bindKey(parent, group, enter, update, exit, data, key) {
|
14725 | var i,
|
14726 | node,
|
14727 | keyValue,
|
14728 | nodeByKeyValue = new Map(),
|
14729 | groupLength = group.length,
|
14730 | dataLength = data.length,
|
14731 | keyValues = Array(groupLength);
|
14732 |
|
14733 |
|
14734 | for (i = 0; i < groupLength; ++i) (node = group[i]) && (keyValues[i] = keyValue = key.call(node, node.__data__, i, group) + "", nodeByKeyValue.has(keyValue) ? exit[i] = node : nodeByKeyValue.set(keyValue, node));
|
14735 |
|
14736 |
|
14737 |
|
14738 |
|
14739 | for (i = 0; i < dataLength; ++i) keyValue = key.call(parent, data[i], i, data) + "", (node = nodeByKeyValue.get(keyValue)) ? (update[i] = node, node.__data__ = data[i], nodeByKeyValue.delete(keyValue)) : enter[i] = new EnterNode(parent, data[i]);
|
14740 |
|
14741 |
|
14742 | for (i = 0; i < groupLength; ++i) (node = group[i]) && nodeByKeyValue.get(keyValues[i]) === node && (exit[i] = node);
|
14743 | }
|
14744 |
|
14745 | function datum(node) {
|
14746 | return node.__data__;
|
14747 | }
|
14748 |
|
14749 | function data(value, key) {
|
14750 | if (!arguments.length) return Array.from(this, datum);
|
14751 | var bind = key ? bindKey : bindIndex,
|
14752 | parents = this._parents,
|
14753 | groups = this._groups;
|
14754 | typeof value !== "function" && (value = constant(value));
|
14755 |
|
14756 | for (var m = groups.length, update = Array(m), enter = Array(m), exit = Array(m), j = 0; j < m; ++j) {
|
14757 | var parent = parents[j],
|
14758 | group = groups[j],
|
14759 | groupLength = group.length,
|
14760 | data = array(value.call(parent, parent && parent.__data__, j, parents)),
|
14761 | dataLength = data.length,
|
14762 | enterGroup = enter[j] = Array(dataLength),
|
14763 | updateGroup = update[j] = Array(dataLength),
|
14764 | exitGroup = exit[j] = Array(groupLength);
|
14765 | bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);
|
14766 |
|
14767 |
|
14768 |
|
14769 |
|
14770 | for (var previous, next, i0 = 0, i1 = 0; i0 < dataLength; ++i0) if (previous = enterGroup[i0]) {
|
14771 | for (i0 >= i1 && (i1 = i0 + 1); !(next = updateGroup[i1]) && ++i1 < dataLength;);
|
14772 |
|
14773 | previous._next = next || null;
|
14774 | }
|
14775 | }
|
14776 |
|
14777 | return update = new Selection(update, parents), update._enter = enter, update._exit = exit, update;
|
14778 | }
|
14779 | ;
|
14780 |
|
14781 |
|
14782 | function exit() {
|
14783 | return new Selection(this._exit || this._groups.map(sparse), this._parents);
|
14784 | }
|
14785 | ;
|
14786 | function join(onenter, onupdate, onexit) {
|
14787 | var enter = this.enter(),
|
14788 | update = this,
|
14789 | exit = this.exit();
|
14790 | return enter = typeof onenter === "function" ? onenter(enter) : enter.append(onenter + ""), onupdate != null && (update = onupdate(update)), onexit == null ? exit.remove() : onexit(exit), enter && update ? enter.merge(update).order() : update;
|
14791 | }
|
14792 | ;
|
14793 |
|
14794 | function merge(selection) {
|
14795 | if (!(selection instanceof Selection)) throw new Error("invalid merge");
|
14796 |
|
14797 | for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = Array(m0), j = 0; j < m; ++j) for (var node, group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = Array(n), i = 0; i < n; ++i) (node = group0[i] || group1[i]) && (merge[i] = node);
|
14798 |
|
14799 | for (; j < m0; ++j) merges[j] = groups0[j];
|
14800 |
|
14801 | return new Selection(merges, this._parents);
|
14802 | }
|
14803 | ;
|
14804 | function order() {
|
14805 | for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) for (var node, group = groups[j], i = group.length - 1, next = group[i]; --i >= 0;) (node = group[i]) && (next && node.compareDocumentPosition(next) ^ 4 && next.parentNode.insertBefore(node, next), next = node);
|
14806 |
|
14807 | return this;
|
14808 | }
|
14809 | ;
|
14810 |
|
14811 | function sort(compare) {
|
14812 | function compareNode(a, b) {
|
14813 | return a && b ? compare(a.__data__, b.__data__) : !a - !b;
|
14814 | }
|
14815 |
|
14816 | compare || (compare = ascending);
|
14817 |
|
14818 | for (var groups = this._groups, m = groups.length, sortgroups = Array(m), j = 0; j < m; ++j) {
|
14819 | for (var node, group = groups[j], n = group.length, sortgroup = sortgroups[j] = Array(n), i = 0; i < n; ++i) (node = group[i]) && (sortgroup[i] = node);
|
14820 |
|
14821 | sortgroup.sort(compareNode);
|
14822 | }
|
14823 |
|
14824 | return new Selection(sortgroups, this._parents).order();
|
14825 | }
|
14826 |
|
14827 | function ascending(a, b) {
|
14828 | return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
|
14829 | }
|
14830 | ;
|
14831 | function call() {
|
14832 | var callback = arguments[0];
|
14833 | return arguments[0] = this, callback.apply(null, arguments), this;
|
14834 | }
|
14835 | ;
|
14836 | function nodes() {
|
14837 | return Array.from(this);
|
14838 | }
|
14839 | ;
|
14840 | function node() {
|
14841 | for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) for (var node, group = groups[j], i = 0, n = group.length; i < n; ++i) if (node = group[i], node) return node;
|
14842 |
|
14843 | return null;
|
14844 | }
|
14845 | ;
|
14846 | function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { it && (o = it); var i = 0; return function () { return i >= o.length ? { done: !0 } : { done: !1, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } return it = o[Symbol.iterator](), it.next.bind(it); }
|
14847 |
|
14848 | function _unsupportedIterableToArray(o, minLen) { if (o) { if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); return n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set" ? Array.from(o) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? _arrayLikeToArray(o, minLen) : void 0; } }
|
14849 |
|
14850 | function _arrayLikeToArray(arr, len) { (len == null || len > arr.length) && (len = arr.length); for (var i = 0, arr2 = Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
14851 |
|
14852 | function size() {
|
14853 | var size = 0;
|
14854 |
|
14855 | for (var _step, _iterator = _createForOfIteratorHelperLoose(this); !(_step = _iterator()).done;) {
|
14856 | _step.value;
|
14857 | ++size;
|
14858 | }
|
14859 |
|
14860 |
|
14861 | return size;
|
14862 | }
|
14863 | ;
|
14864 | function selection_empty() {
|
14865 | return !this.node();
|
14866 | }
|
14867 | ;
|
14868 | function each(callback) {
|
14869 | for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) for (var node, group = groups[j], i = 0, n = group.length; i < n; ++i) (node = group[i]) && callback.call(node, node.__data__, i, group);
|
14870 |
|
14871 | return this;
|
14872 | }
|
14873 | ;
|
14874 | var xhtml = "http://www.w3.org/1999/xhtml";
|
14875 | var namespaces = ({
|
14876 | svg: "http://www.w3.org/2000/svg",
|
14877 | xhtml: "http://www.w3.org/1999/xhtml",
|
14878 | xlink: "http://www.w3.org/1999/xlink",
|
14879 | xml: "http://www.w3.org/XML/1998/namespace",
|
14880 | xmlns: "http://www.w3.org/2000/xmlns/"
|
14881 | });
|
14882 | ;
|
14883 |
|
14884 | function namespace(name) {
|
14885 | var prefix = name += "",
|
14886 | i = prefix.indexOf(":");
|
14887 | return i >= 0 && (prefix = name.slice(0, i)) !== "xmlns" && (name = name.slice(i + 1)), namespaces.hasOwnProperty(prefix) ? {
|
14888 | space: namespaces[prefix],
|
14889 | local: name
|
14890 | } : name;
|
14891 | }
|
14892 | ;
|
14893 |
|
14894 |
|
14895 | function attrRemove(name) {
|
14896 | return function () {
|
14897 | this.removeAttribute(name);
|
14898 | };
|
14899 | }
|
14900 |
|
14901 | function attrRemoveNS(fullname) {
|
14902 | return function () {
|
14903 | this.removeAttributeNS(fullname.space, fullname.local);
|
14904 | };
|
14905 | }
|
14906 |
|
14907 | function attrConstant(name, value) {
|
14908 | return function () {
|
14909 | this.setAttribute(name, value);
|
14910 | };
|
14911 | }
|
14912 |
|
14913 | function attrConstantNS(fullname, value) {
|
14914 | return function () {
|
14915 | this.setAttributeNS(fullname.space, fullname.local, value);
|
14916 | };
|
14917 | }
|
14918 |
|
14919 | function attrFunction(name, value) {
|
14920 | return function () {
|
14921 | var v = value.apply(this, arguments);
|
14922 | v == null ? this.removeAttribute(name) : this.setAttribute(name, v);
|
14923 | };
|
14924 | }
|
14925 |
|
14926 | function attrFunctionNS(fullname, value) {
|
14927 | return function () {
|
14928 | var v = value.apply(this, arguments);
|
14929 | v == null ? this.removeAttributeNS(fullname.space, fullname.local) : this.setAttributeNS(fullname.space, fullname.local, v);
|
14930 | };
|
14931 | }
|
14932 |
|
14933 | function attr(name, value) {
|
14934 | var fullname = namespace(name);
|
14935 |
|
14936 | if (arguments.length < 2) {
|
14937 | var node = this.node();
|
14938 | return fullname.local ? node.getAttributeNS(fullname.space, fullname.local) : node.getAttribute(fullname);
|
14939 | }
|
14940 |
|
14941 | return this.each((value == null ? fullname.local ? attrRemoveNS : attrRemove : typeof value === "function" ? fullname.local ? attrFunctionNS : attrFunction : fullname.local ? attrConstantNS : attrConstant)(fullname, value));
|
14942 | }
|
14943 | ;
|
14944 | function src_window(node) {
|
14945 | return node.ownerDocument && node.ownerDocument.defaultView ||
|
14946 | node.document && node
|
14947 | || node.defaultView;
|
14948 | }
|
14949 | ;
|
14950 |
|
14951 |
|
14952 | function styleRemove(name) {
|
14953 | return function () {
|
14954 | this.style.removeProperty(name);
|
14955 | };
|
14956 | }
|
14957 |
|
14958 | function styleConstant(name, value, priority) {
|
14959 | return function () {
|
14960 | this.style.setProperty(name, value, priority);
|
14961 | };
|
14962 | }
|
14963 |
|
14964 | function styleFunction(name, value, priority) {
|
14965 | return function () {
|
14966 | var v = value.apply(this, arguments);
|
14967 | v == null ? this.style.removeProperty(name) : this.style.setProperty(name, v, priority);
|
14968 | };
|
14969 | }
|
14970 |
|
14971 | function style(name, value, priority) {
|
14972 | return arguments.length > 1 ? this.each((value == null ? styleRemove : typeof value === "function" ? styleFunction : styleConstant)(name, value, priority == null ? "" : priority)) : styleValue(this.node(), name);
|
14973 | }
|
14974 | function styleValue(node, name) {
|
14975 | return node.style.getPropertyValue(name) || src_window(node).getComputedStyle(node, null).getPropertyValue(name);
|
14976 | }
|
14977 | ;
|
14978 | function propertyRemove(name) {
|
14979 | return function () {
|
14980 | delete this[name];
|
14981 | };
|
14982 | }
|
14983 |
|
14984 | function propertyConstant(name, value) {
|
14985 | return function () {
|
14986 | this[name] = value;
|
14987 | };
|
14988 | }
|
14989 |
|
14990 | function propertyFunction(name, value) {
|
14991 | return function () {
|
14992 | var v = value.apply(this, arguments);
|
14993 | v == null ? delete this[name] : this[name] = v;
|
14994 | };
|
14995 | }
|
14996 |
|
14997 | function property(name, value) {
|
14998 | return arguments.length > 1 ? this.each((value == null ? propertyRemove : typeof value === "function" ? propertyFunction : propertyConstant)(name, value)) : this.node()[name];
|
14999 | }
|
15000 | ;
|
15001 | function classArray(string) {
|
15002 | return string.trim().split(/^|\s+/);
|
15003 | }
|
15004 |
|
15005 | function classList(node) {
|
15006 | return node.classList || new ClassList(node);
|
15007 | }
|
15008 |
|
15009 | function ClassList(node) {
|
15010 | this._node = node, this._names = classArray(node.getAttribute("class") || "");
|
15011 | }
|
15012 |
|
15013 | ClassList.prototype = {
|
15014 | add: function add(name) {
|
15015 | var i = this._names.indexOf(name);
|
15016 |
|
15017 | i < 0 && (this._names.push(name), this._node.setAttribute("class", this._names.join(" ")));
|
15018 | },
|
15019 | remove: function remove(name) {
|
15020 | var i = this._names.indexOf(name);
|
15021 |
|
15022 | i >= 0 && (this._names.splice(i, 1), this._node.setAttribute("class", this._names.join(" ")));
|
15023 | },
|
15024 | contains: function contains(name) {
|
15025 | return this._names.indexOf(name) >= 0;
|
15026 | }
|
15027 | };
|
15028 |
|
15029 | function classedAdd(node, names) {
|
15030 | for (var list = classList(node), i = -1, n = names.length; ++i < n;) list.add(names[i]);
|
15031 | }
|
15032 |
|
15033 | function classedRemove(node, names) {
|
15034 | for (var list = classList(node), i = -1, n = names.length; ++i < n;) list.remove(names[i]);
|
15035 | }
|
15036 |
|
15037 | function classedTrue(names) {
|
15038 | return function () {
|
15039 | classedAdd(this, names);
|
15040 | };
|
15041 | }
|
15042 |
|
15043 | function classedFalse(names) {
|
15044 | return function () {
|
15045 | classedRemove(this, names);
|
15046 | };
|
15047 | }
|
15048 |
|
15049 | function classedFunction(names, value) {
|
15050 | return function () {
|
15051 | (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);
|
15052 | };
|
15053 | }
|
15054 |
|
15055 | function classed(name, value) {
|
15056 | var names = classArray(name + "");
|
15057 |
|
15058 | if (arguments.length < 2) {
|
15059 | for (var list = classList(this.node()), i = -1, n = names.length; ++i < n;) if (!list.contains(names[i])) return !1;
|
15060 |
|
15061 | return !0;
|
15062 | }
|
15063 |
|
15064 | return this.each((typeof value === "function" ? classedFunction : value ? classedTrue : classedFalse)(names, value));
|
15065 | }
|
15066 | ;
|
15067 | function textRemove() {
|
15068 | this.textContent = "";
|
15069 | }
|
15070 |
|
15071 | function textConstant(value) {
|
15072 | return function () {
|
15073 | this.textContent = value;
|
15074 | };
|
15075 | }
|
15076 |
|
15077 | function textFunction(value) {
|
15078 | return function () {
|
15079 | var v = value.apply(this, arguments);
|
15080 | this.textContent = v == null ? "" : v;
|
15081 | };
|
15082 | }
|
15083 |
|
15084 | function selection_text(value) {
|
15085 | return arguments.length ? this.each(value == null ? textRemove : (typeof value === "function" ? textFunction : textConstant)(value)) : this.node().textContent;
|
15086 | }
|
15087 | ;
|
15088 | function htmlRemove() {
|
15089 | this.innerHTML = "";
|
15090 | }
|
15091 |
|
15092 | function htmlConstant(value) {
|
15093 | return function () {
|
15094 | this.innerHTML = value;
|
15095 | };
|
15096 | }
|
15097 |
|
15098 | function htmlFunction(value) {
|
15099 | return function () {
|
15100 | var v = value.apply(this, arguments);
|
15101 | this.innerHTML = v == null ? "" : v;
|
15102 | };
|
15103 | }
|
15104 |
|
15105 | function html(value) {
|
15106 | return arguments.length ? this.each(value == null ? htmlRemove : (typeof value === "function" ? htmlFunction : htmlConstant)(value)) : this.node().innerHTML;
|
15107 | }
|
15108 | ;
|
15109 | function raise() {
|
15110 | this.nextSibling && this.parentNode.appendChild(this);
|
15111 | }
|
15112 |
|
15113 | function selection_raise() {
|
15114 | return this.each(raise);
|
15115 | }
|
15116 | ;
|
15117 | function lower() {
|
15118 | this.previousSibling && this.parentNode.insertBefore(this, this.parentNode.firstChild);
|
15119 | }
|
15120 |
|
15121 | function selection_lower() {
|
15122 | return this.each(lower);
|
15123 | }
|
15124 | ;
|
15125 |
|
15126 |
|
15127 |
|
15128 | function creatorInherit(name) {
|
15129 | return function () {
|
15130 | var document = this.ownerDocument,
|
15131 | uri = this.namespaceURI;
|
15132 | return uri === xhtml && document.documentElement.namespaceURI === xhtml ? document.createElement(name) : document.createElementNS(uri, name);
|
15133 | };
|
15134 | }
|
15135 |
|
15136 | function creatorFixed(fullname) {
|
15137 | return function () {
|
15138 | return this.ownerDocument.createElementNS(fullname.space, fullname.local);
|
15139 | };
|
15140 | }
|
15141 |
|
15142 | function creator(name) {
|
15143 | var fullname = namespace(name);
|
15144 | return (fullname.local ? creatorFixed : creatorInherit)(fullname);
|
15145 | }
|
15146 | ;
|
15147 |
|
15148 | function append(name) {
|
15149 | var create = typeof name === "function" ? name : creator(name);
|
15150 | return this.select(function () {
|
15151 | return this.appendChild(create.apply(this, arguments));
|
15152 | });
|
15153 | }
|
15154 | ;
|
15155 |
|
15156 |
|
15157 |
|
15158 | function constantNull() {
|
15159 | return null;
|
15160 | }
|
15161 |
|
15162 | function insert(name, before) {
|
15163 | var create = typeof name === "function" ? name : creator(name),
|
15164 | select = before == null ? constantNull : typeof before === "function" ? before : selector(before);
|
15165 | return this.select(function () {
|
15166 | return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);
|
15167 | });
|
15168 | }
|
15169 | ;
|
15170 | function remove() {
|
15171 | var parent = this.parentNode;
|
15172 | parent && parent.removeChild(this);
|
15173 | }
|
15174 |
|
15175 | function selection_remove() {
|
15176 | return this.each(remove);
|
15177 | }
|
15178 | ;
|
15179 | function selection_cloneShallow() {
|
15180 | var clone = this.cloneNode(!1),
|
15181 | parent = this.parentNode;
|
15182 | return parent ? parent.insertBefore(clone, this.nextSibling) : clone;
|
15183 | }
|
15184 |
|
15185 | function selection_cloneDeep() {
|
15186 | var clone = this.cloneNode(!0),
|
15187 | parent = this.parentNode;
|
15188 | return parent ? parent.insertBefore(clone, this.nextSibling) : clone;
|
15189 | }
|
15190 |
|
15191 | function clone(deep) {
|
15192 | return this.select(deep ? selection_cloneDeep : selection_cloneShallow);
|
15193 | }
|
15194 | ;
|
15195 | function selection_datum(value) {
|
15196 | return arguments.length ? this.property("__data__", value) : this.node().__data__;
|
15197 | }
|
15198 | ;
|
15199 | function contextListener(listener) {
|
15200 | return function (event) {
|
15201 | listener.call(this, event, this.__data__);
|
15202 | };
|
15203 | }
|
15204 |
|
15205 | function parseTypenames(typenames) {
|
15206 | return typenames.trim().split(/^|\s+/).map(function (t) {
|
15207 | var name = "",
|
15208 | i = t.indexOf(".");
|
15209 | return i >= 0 && (name = t.slice(i + 1), t = t.slice(0, i)), {
|
15210 | type: t,
|
15211 | name: name
|
15212 | };
|
15213 | });
|
15214 | }
|
15215 |
|
15216 | function onRemove(typename) {
|
15217 | return function () {
|
15218 | var on = this.__on;
|
15219 |
|
15220 | if (on) {
|
15221 | for (var o, j = 0, i = -1, m = on.length; j < m; ++j) (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) ? this.removeEventListener(o.type, o.listener, o.options) : on[++i] = o;
|
15222 |
|
15223 | ++i ? on.length = i : delete this.__on;
|
15224 | }
|
15225 | };
|
15226 | }
|
15227 |
|
15228 | function onAdd(typename, value, options) {
|
15229 | return function () {
|
15230 | var o,
|
15231 | on = this.__on,
|
15232 | listener = contextListener(value);
|
15233 | if (on) for (var j = 0, m = on.length; j < m; ++j) if ((o = on[j]).type === typename.type && o.name === typename.name) return this.removeEventListener(o.type, o.listener, o.options), this.addEventListener(o.type, o.listener = listener, o.options = options), void (o.value = value);
|
15234 | this.addEventListener(typename.type, listener, options), o = {
|
15235 | type: typename.type,
|
15236 | name: typename.name,
|
15237 | value: value,
|
15238 | listener: listener,
|
15239 | options: options
|
15240 | }, on ? on.push(o) : this.__on = [o];
|
15241 | };
|
15242 | }
|
15243 |
|
15244 | function on(typename, value, options) {
|
15245 | var i,
|
15246 | t,
|
15247 | typenames = parseTypenames(typename + ""),
|
15248 | n = typenames.length;
|
15249 |
|
15250 | if (arguments.length < 2) {
|
15251 | var on = this.node().__on;
|
15252 |
|
15253 | if (on) for (var o, j = 0, m = on.length; j < m; ++j) for (i = 0, o = on[j]; i < n; ++i) if ((t = typenames[i]).type === o.type && t.name === o.name) return o.value;
|
15254 | return;
|
15255 | }
|
15256 |
|
15257 | for (on = value ? onAdd : onRemove, i = 0; i < n; ++i) this.each(on(typenames[i], value, options));
|
15258 |
|
15259 | return this;
|
15260 | }
|
15261 | ;
|
15262 |
|
15263 |
|
15264 | function dispatchEvent(node, type, params) {
|
15265 | var window = src_window(node),
|
15266 | event = window.CustomEvent;
|
15267 | typeof event === "function" ? event = new event(type, params) : (event = window.document.createEvent("Event"), params ? (event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail) : event.initEvent(type, !1, !1)), node.dispatchEvent(event);
|
15268 | }
|
15269 |
|
15270 | function dispatchConstant(type, params) {
|
15271 | return function () {
|
15272 | return dispatchEvent(this, type, params);
|
15273 | };
|
15274 | }
|
15275 |
|
15276 | function dispatchFunction(type, params) {
|
15277 | return function () {
|
15278 | return dispatchEvent(this, type, params.apply(this, arguments));
|
15279 | };
|
15280 | }
|
15281 |
|
15282 | function dispatch(type, params) {
|
15283 | return this.each((typeof params === "function" ? dispatchFunction : dispatchConstant)(type, params));
|
15284 | }
|
15285 |
|
15286 | var regenerator = __webpack_require__(384);
|
15287 | var regenerator_default = __webpack_require__.n(regenerator);
|
15288 | ;
|
15289 |
|
15290 |
|
15291 | var _marked = regenerator_default().mark(_callee);
|
15292 |
|
15293 | function _callee() {
|
15294 | var groups, j, m, node, group, i, n;
|
15295 | return regenerator_default().wrap(function (_context) {
|
15296 | for (;;) switch (_context.prev = _context.next) {
|
15297 | case 0:
|
15298 | groups = this._groups, j = 0, m = groups.length;
|
15299 |
|
15300 | case 1:
|
15301 | if (!(j < m)) {
|
15302 | _context.next = 14;
|
15303 | break;
|
15304 | }
|
15305 |
|
15306 | group = groups[j], i = 0, n = group.length;
|
15307 |
|
15308 | case 3:
|
15309 | if (!(i < n)) {
|
15310 | _context.next = 11;
|
15311 | break;
|
15312 | }
|
15313 |
|
15314 | if (_context.t0 = node = group[i], !_context.t0) {
|
15315 | _context.next = 8;
|
15316 | break;
|
15317 | }
|
15318 |
|
15319 | return _context.next = 8, node;
|
15320 |
|
15321 | case 8:
|
15322 | ++i, _context.next = 3;
|
15323 | break;
|
15324 |
|
15325 | case 11:
|
15326 | ++j, _context.next = 1;
|
15327 | break;
|
15328 |
|
15329 | case 14:
|
15330 | case "end":
|
15331 | return _context.stop();
|
15332 | }
|
15333 | }, _marked, this);
|
15334 | }
|
15335 | ;
|
15336 | var _selection$prototype;
|
15337 |
|
15338 |
|
15339 |
|
15340 |
|
15341 |
|
15342 |
|
15343 |
|
15344 |
|
15345 |
|
15346 |
|
15347 |
|
15348 |
|
15349 |
|
15350 |
|
15351 |
|
15352 |
|
15353 |
|
15354 |
|
15355 |
|
15356 |
|
15357 |
|
15358 |
|
15359 |
|
15360 |
|
15361 |
|
15362 |
|
15363 |
|
15364 |
|
15365 |
|
15366 |
|
15367 |
|
15368 |
|
15369 |
|
15370 |
|
15371 |
|
15372 | var root = [null];
|
15373 | function Selection(groups, parents) {
|
15374 | this._groups = groups, this._parents = parents;
|
15375 | }
|
15376 |
|
15377 | function selection() {
|
15378 | return new Selection([[document.documentElement]], root);
|
15379 | }
|
15380 |
|
15381 | function selection_selection() {
|
15382 | return this;
|
15383 | }
|
15384 |
|
15385 | Selection.prototype = selection.prototype = (_selection$prototype = {
|
15386 | constructor: Selection,
|
15387 | select: selection_select,
|
15388 | selectAll: selectAll,
|
15389 | selectChild: selectChild,
|
15390 | selectChildren: selectChildren,
|
15391 | filter: selection_filter,
|
15392 | data: data,
|
15393 | enter: enter,
|
15394 | exit: exit,
|
15395 | join: join,
|
15396 | merge: merge,
|
15397 | selection: selection_selection,
|
15398 | order: order,
|
15399 | sort: sort,
|
15400 | call: call,
|
15401 | nodes: nodes,
|
15402 | node: node,
|
15403 | size: size,
|
15404 | empty: selection_empty,
|
15405 | each: each,
|
15406 | attr: attr,
|
15407 | style: style,
|
15408 | property: property,
|
15409 | classed: classed,
|
15410 | text: selection_text,
|
15411 | html: html,
|
15412 | raise: selection_raise,
|
15413 | lower: selection_lower,
|
15414 | append: append,
|
15415 | insert: insert,
|
15416 | remove: selection_remove,
|
15417 | clone: clone,
|
15418 | datum: selection_datum,
|
15419 | on: on,
|
15420 | dispatch: dispatch
|
15421 | }, _selection$prototype[Symbol.iterator] = _callee, _selection$prototype);
|
15422 | /* harmony default export */ var src_selection = (selection);
|
15423 | ;// CONCATENATED MODULE: ./node_modules/d3-selection/src/select.js
|
15424 |
|
15425 | /* harmony default export */ function src_select(selector) {
|
15426 | return typeof selector === "string" ? new Selection([[document.querySelector(selector)]], [document.documentElement]) : new Selection([[selector]], root);
|
15427 | }
|
15428 | ;
|
15429 |
|
15430 |
|
15431 |
|
15432 |
|
15433 |
|
15434 |
|
15435 |
|
15436 |
|
15437 |
|
15438 | var config_classes = ({
|
15439 | arc: "bb-arc",
|
15440 | arcLabelLine: "bb-arc-label-line",
|
15441 | arcs: "bb-arcs",
|
15442 | area: "bb-area",
|
15443 | areas: "bb-areas",
|
15444 | axis: "bb-axis",
|
15445 | axisX: "bb-axis-x",
|
15446 | axisXLabel: "bb-axis-x-label",
|
15447 | axisY: "bb-axis-y",
|
15448 | axisY2: "bb-axis-y2",
|
15449 | axisY2Label: "bb-axis-y2-label",
|
15450 | axisYLabel: "bb-axis-y-label",
|
15451 | bar: "bb-bar",
|
15452 | bars: "bb-bars",
|
15453 | brush: "bb-brush",
|
15454 | button: "bb-button",
|
15455 | buttonZoomReset: "bb-zoom-reset",
|
15456 | candlestick: "bb-candlestick",
|
15457 | candlesticks: "bb-candlesticks",
|
15458 | chart: "bb-chart",
|
15459 | chartArc: "bb-chart-arc",
|
15460 | chartArcs: "bb-chart-arcs",
|
15461 | chartArcsBackground: "bb-chart-arcs-background",
|
15462 | chartArcsGaugeMax: "bb-chart-arcs-gauge-max",
|
15463 | chartArcsGaugeMin: "bb-chart-arcs-gauge-min",
|
15464 | chartArcsGaugeUnit: "bb-chart-arcs-gauge-unit",
|
15465 | chartArcsTitle: "bb-chart-arcs-title",
|
15466 | chartArcsGaugeTitle: "bb-chart-arcs-gauge-title",
|
15467 | chartBar: "bb-chart-bar",
|
15468 | chartBars: "bb-chart-bars",
|
15469 | chartCandlestick: "bb-chart-candlestick",
|
15470 | chartCandlesticks: "bb-chart-candlesticks",
|
15471 | chartCircles: "bb-chart-circles",
|
15472 | chartLine: "bb-chart-line",
|
15473 | chartLines: "bb-chart-lines",
|
15474 | chartRadar: "bb-chart-radar",
|
15475 | chartRadars: "bb-chart-radars",
|
15476 | chartText: "bb-chart-text",
|
15477 | chartTexts: "bb-chart-texts",
|
15478 | circle: "bb-circle",
|
15479 | circles: "bb-circles",
|
15480 | colorPattern: "bb-color-pattern",
|
15481 | colorScale: "bb-colorscale",
|
15482 | defocused: "bb-defocused",
|
15483 | dragarea: "bb-dragarea",
|
15484 | empty: "bb-empty",
|
15485 | eventRect: "bb-event-rect",
|
15486 | eventRects: "bb-event-rects",
|
15487 | eventRectsMultiple: "bb-event-rects-multiple",
|
15488 | eventRectsSingle: "bb-event-rects-single",
|
15489 | focused: "bb-focused",
|
15490 | gaugeValue: "bb-gauge-value",
|
15491 | grid: "bb-grid",
|
15492 | gridLines: "bb-grid-lines",
|
15493 | legend: "bb-legend",
|
15494 | legendBackground: "bb-legend-background",
|
15495 | legendItem: "bb-legend-item",
|
15496 | legendItemEvent: "bb-legend-item-event",
|
15497 | legendItemFocused: "bb-legend-item-focused",
|
15498 | legendItemHidden: "bb-legend-item-hidden",
|
15499 | legendItemPoint: "bb-legend-item-point",
|
15500 | legendItemTile: "bb-legend-item-tile",
|
15501 | level: "bb-level",
|
15502 | levels: "bb-levels",
|
15503 | line: "bb-line",
|
15504 | lines: "bb-lines",
|
15505 | main: "bb-main",
|
15506 | region: "bb-region",
|
15507 | regions: "bb-regions",
|
15508 | selectedCircle: "bb-selected-circle",
|
15509 | selectedCircles: "bb-selected-circles",
|
15510 | shape: "bb-shape",
|
15511 | shapes: "bb-shapes",
|
15512 | stanfordElements: "bb-stanford-elements",
|
15513 | stanfordLine: "bb-stanford-line",
|
15514 | stanfordLines: "bb-stanford-lines",
|
15515 | stanfordRegion: "bb-stanford-region",
|
15516 | stanfordRegions: "bb-stanford-regions",
|
15517 | subchart: "bb-subchart",
|
15518 | target: "bb-target",
|
15519 | text: "bb-text",
|
15520 | texts: "bb-texts",
|
15521 | title: "bb-title",
|
15522 | tooltip: "bb-tooltip",
|
15523 | tooltipContainer: "bb-tooltip-container",
|
15524 | tooltipName: "bb-tooltip-name",
|
15525 | valueDown: "bb-value-down",
|
15526 | valueUp: "bb-value-up",
|
15527 | xgrid: "bb-xgrid",
|
15528 | xgridFocus: "bb-xgrid-focus",
|
15529 | xgridLine: "bb-xgrid-line",
|
15530 | xgridLines: "bb-xgrid-lines",
|
15531 | xgrids: "bb-xgrids",
|
15532 | ygrid: "bb-ygrid",
|
15533 | ygridFocus: "bb-ygrid-focus",
|
15534 | ygridLine: "bb-ygrid-line",
|
15535 | ygridLines: "bb-ygrid-lines",
|
15536 | ygrids: "bb-ygrids",
|
15537 | zoomBrush: "bb-zoom-brush",
|
15538 | EXPANDED: "_expanded_",
|
15539 | SELECTED: "_selected_",
|
15540 | INCLUDED: "_included_",
|
15541 | TextOverlapping: "text-overlapping"
|
15542 | });
|
15543 | ;
|
15544 |
|
15545 |
|
15546 |
|
15547 |
|
15548 |
|
15549 |
|
15550 |
|
15551 |
|
15552 |
|
15553 |
|
15554 |
|
15555 | var Element = function () {
|
15556 | return {
|
15557 | chart: null,
|
15558 | main: null,
|
15559 | svg: null,
|
15560 | axis: {
|
15561 |
|
15562 | x: null,
|
15563 | y: null,
|
15564 | y2: null,
|
15565 | subX: null
|
15566 | },
|
15567 | defs: null,
|
15568 | tooltip: null,
|
15569 | legend: null,
|
15570 | title: null,
|
15571 | subchart: {
|
15572 | main: null,
|
15573 |
|
15574 | bar: null,
|
15575 |
|
15576 | line: null,
|
15577 |
|
15578 | area: null
|
15579 |
|
15580 | },
|
15581 | arcs: null,
|
15582 | bar: null,
|
15583 |
|
15584 | candlestick: null,
|
15585 | line: null,
|
15586 |
|
15587 | area: null,
|
15588 |
|
15589 | circle: null,
|
15590 |
|
15591 | radar: null,
|
15592 | text: null,
|
15593 |
|
15594 | grid: {
|
15595 | main: null,
|
15596 |
|
15597 | x: null,
|
15598 |
|
15599 | y: null
|
15600 |
|
15601 | },
|
15602 | gridLines: {
|
15603 | main: null,
|
15604 |
|
15605 | x: null,
|
15606 |
|
15607 | y: null
|
15608 |
|
15609 | },
|
15610 | region: {
|
15611 | main: null,
|
15612 |
|
15613 | list: null
|
15614 |
|
15615 | },
|
15616 | eventRect: null
|
15617 | };
|
15618 | };
|
15619 |
|
15620 |
|
15621 | ;
|
15622 |
|
15623 |
|
15624 |
|
15625 |
|
15626 |
|
15627 |
|
15628 |
|
15629 |
|
15630 |
|
15631 |
|
15632 |
|
15633 | var State = function () {
|
15634 | return {
|
15635 | width: 0,
|
15636 | width2: 0,
|
15637 | height: 0,
|
15638 | height2: 0,
|
15639 | margin: {
|
15640 | top: 0,
|
15641 | bottom: 0,
|
15642 | left: 0,
|
15643 | right: 0
|
15644 | },
|
15645 | margin2: {
|
15646 | top: 0,
|
15647 | bottom: 0,
|
15648 | left: 0,
|
15649 | right: 0
|
15650 | },
|
15651 | margin3: {
|
15652 | top: 0,
|
15653 | bottom: 0,
|
15654 | left: 0,
|
15655 | right: 0
|
15656 | },
|
15657 | arcWidth: 0,
|
15658 | arcHeight: 0,
|
15659 | xAxisHeight: 0,
|
15660 | hasAxis: !1,
|
15661 | hasRadar: !1,
|
15662 | current: {
|
15663 | width: 0,
|
15664 | height: 0,
|
15665 | dataMax: 0,
|
15666 | maxTickWidths: {
|
15667 | x: {
|
15668 | size: 0,
|
15669 | ticks: [],
|
15670 | clipPath: 0,
|
15671 | domain: ""
|
15672 | },
|
15673 | y: {
|
15674 | size: 0,
|
15675 | domain: ""
|
15676 | },
|
15677 | y2: {
|
15678 | size: 0,
|
15679 | domain: ""
|
15680 | }
|
15681 | },
|
15682 |
|
15683 | types: []
|
15684 | },
|
15685 |
|
15686 | isLegendRight: !1,
|
15687 | isLegendInset: !1,
|
15688 | isLegendTop: !1,
|
15689 | isLegendLeft: !1,
|
15690 | legendStep: 0,
|
15691 | legendItemWidth: 0,
|
15692 | legendItemHeight: 0,
|
15693 | legendHasRendered: !1,
|
15694 | eventReceiver: {
|
15695 | currentIdx: -1,
|
15696 |
|
15697 | rect: {},
|
15698 |
|
15699 | data: [],
|
15700 |
|
15701 | coords: []
|
15702 |
|
15703 | },
|
15704 | axis: {
|
15705 | x: {
|
15706 | padding: {
|
15707 | left: 0,
|
15708 | right: 0
|
15709 | },
|
15710 | tickCount: 0
|
15711 | }
|
15712 | },
|
15713 | rotatedPadding: {
|
15714 | left: 30,
|
15715 | right: 0,
|
15716 | top: 5
|
15717 | },
|
15718 | withoutFadeIn: {},
|
15719 | inputType: "",
|
15720 | datetimeId: "",
|
15721 |
|
15722 | clip: {
|
15723 | id: "",
|
15724 | idXAxis: "",
|
15725 | idYAxis: "",
|
15726 | idXAxisTickTexts: "",
|
15727 | idGrid: "",
|
15728 | idSubchart: "",
|
15729 |
|
15730 | path: "",
|
15731 | pathXAxis: "",
|
15732 | pathYAxis: "",
|
15733 | pathXAxisTickTexts: "",
|
15734 | pathGrid: ""
|
15735 | },
|
15736 |
|
15737 | event: null,
|
15738 |
|
15739 | dragStart: null,
|
15740 | dragging: !1,
|
15741 | flowing: !1,
|
15742 | cancelClick: !1,
|
15743 | mouseover: !1,
|
15744 | rendered: !1,
|
15745 | transiting: !1,
|
15746 | redrawing: !1,
|
15747 |
|
15748 | resizing: !1,
|
15749 |
|
15750 | toggling: !1,
|
15751 |
|
15752 | zooming: !1,
|
15753 | hasNegativeValue: !1,
|
15754 | hasPositiveValue: !0,
|
15755 | orgAreaOpacity: "0.2",
|
15756 |
|
15757 | hiddenTargetIds: [],
|
15758 | hiddenLegendIds: [],
|
15759 | focusedTargetIds: [],
|
15760 | defocusedTargetIds: [],
|
15761 |
|
15762 | radius: 0,
|
15763 | innerRadius: 0,
|
15764 | outerRadius: undefined,
|
15765 | innerRadiusRatio: 0,
|
15766 | gaugeArcWidth: 0,
|
15767 | radiusExpanded: 0,
|
15768 |
|
15769 | xgridAttr: {
|
15770 | x1: null,
|
15771 | x2: null,
|
15772 | y1: null,
|
15773 | y2: null
|
15774 | }
|
15775 | };
|
15776 | };
|
15777 |
|
15778 |
|
15779 | ;
|
15780 |
|
15781 |
|
15782 |
|
15783 |
|
15784 |
|
15785 |
|
15786 |
|
15787 | var classes = {
|
15788 | element: Element,
|
15789 | state: State
|
15790 | };
|
15791 |
|
15792 |
|
15793 |
|
15794 |
|
15795 |
|
15796 |
|
15797 |
|
15798 | var Store = function () {
|
15799 | function Store() {
|
15800 | var _this = this;
|
15801 |
|
15802 | Object.keys(classes).forEach(function (v) {
|
15803 | _this[v] = new classes[v]();
|
15804 | });
|
15805 | }
|
15806 |
|
15807 | var _proto = Store.prototype;
|
15808 | return _proto.getStore = function getStore(name) {
|
15809 | return this[name];
|
15810 | }, Store;
|
15811 | }();
|
15812 |
|
15813 |
|
15814 | ;
|
15815 | function _defineProperty(obj, key, value) {
|
15816 | if (key in obj) {
|
15817 | Object.defineProperty(obj, key, {
|
15818 | value: value,
|
15819 | enumerable: true,
|
15820 | configurable: true,
|
15821 | writable: true
|
15822 | });
|
15823 | } else {
|
15824 | obj[key] = value;
|
15825 | }
|
15826 |
|
15827 | return obj;
|
15828 | }
|
15829 | ;
|
15830 |
|
15831 |
|
15832 |
|
15833 |
|
15834 |
|
15835 |
|
15836 |
|
15837 |
|
15838 | var main = ({
|
15839 | |
15840 |
|
15841 |
|
15842 |
|
15843 |
|
15844 |
|
15845 |
|
15846 |
|
15847 |
|
15848 |
|
15849 |
|
15850 |
|
15851 |
|
15852 |
|
15853 |
|
15854 |
|
15855 |
|
15856 |
|
15857 |
|
15858 |
|
15859 |
|
15860 |
|
15861 |
|
15862 |
|
15863 |
|
15864 |
|
15865 | bindto: "#chart",
|
15866 |
|
15867 | |
15868 |
|
15869 |
|
15870 |
|
15871 |
|
15872 |
|
15873 |
|
15874 |
|
15875 |
|
15876 |
|
15877 |
|
15878 |
|
15879 |
|
15880 |
|
15881 |
|
15882 |
|
15883 |
|
15884 |
|
15885 |
|
15886 | background: {},
|
15887 |
|
15888 | |
15889 |
|
15890 |
|
15891 |
|
15892 |
|
15893 |
|
15894 |
|
15895 |
|
15896 |
|
15897 |
|
15898 |
|
15899 |
|
15900 |
|
15901 |
|
15902 | clipPath: !0,
|
15903 |
|
15904 | |
15905 |
|
15906 |
|
15907 |
|
15908 |
|
15909 |
|
15910 |
|
15911 |
|
15912 |
|
15913 |
|
15914 |
|
15915 |
|
15916 | svg_classname: undefined,
|
15917 |
|
15918 | |
15919 |
|
15920 |
|
15921 |
|
15922 |
|
15923 |
|
15924 |
|
15925 |
|
15926 |
|
15927 |
|
15928 |
|
15929 |
|
15930 |
|
15931 |
|
15932 |
|
15933 |
|
15934 | size_width: undefined,
|
15935 | size_height: undefined,
|
15936 |
|
15937 | |
15938 |
|
15939 |
|
15940 |
|
15941 |
|
15942 |
|
15943 |
|
15944 |
|
15945 |
|
15946 |
|
15947 |
|
15948 |
|
15949 |
|
15950 |
|
15951 |
|
15952 |
|
15953 |
|
15954 |
|
15955 | padding_left: undefined,
|
15956 | padding_right: undefined,
|
15957 | padding_top: undefined,
|
15958 | padding_bottom: undefined,
|
15959 |
|
15960 | |
15961 |
|
15962 |
|
15963 |
|
15964 |
|
15965 |
|
15966 |
|
15967 |
|
15968 |
|
15969 |
|
15970 |
|
15971 |
|
15972 | resize_auto: !0,
|
15973 |
|
15974 | |
15975 |
|
15976 |
|
15977 |
|
15978 |
|
15979 |
|
15980 |
|
15981 |
|
15982 |
|
15983 |
|
15984 |
|
15985 |
|
15986 | onover: undefined,
|
15987 |
|
15988 | |
15989 |
|
15990 |
|
15991 |
|
15992 |
|
15993 |
|
15994 |
|
15995 |
|
15996 |
|
15997 |
|
15998 |
|
15999 |
|
16000 | onout: undefined,
|
16001 |
|
16002 | |
16003 |
|
16004 |
|
16005 |
|
16006 |
|
16007 |
|
16008 |
|
16009 |
|
16010 |
|
16011 |
|
16012 |
|
16013 |
|
16014 | onresize: undefined,
|
16015 |
|
16016 | |
16017 |
|
16018 |
|
16019 |
|
16020 |
|
16021 |
|
16022 |
|
16023 |
|
16024 |
|
16025 |
|
16026 |
|
16027 |
|
16028 | onresized: undefined,
|
16029 |
|
16030 | |
16031 |
|
16032 |
|
16033 |
|
16034 |
|
16035 |
|
16036 |
|
16037 |
|
16038 |
|
16039 |
|
16040 |
|
16041 |
|
16042 | onbeforeinit: undefined,
|
16043 |
|
16044 | |
16045 |
|
16046 |
|
16047 |
|
16048 |
|
16049 |
|
16050 |
|
16051 |
|
16052 |
|
16053 |
|
16054 |
|
16055 |
|
16056 | oninit: undefined,
|
16057 |
|
16058 | |
16059 |
|
16060 |
|
16061 |
|
16062 |
|
16063 |
|
16064 |
|
16065 |
|
16066 |
|
16067 |
|
16068 |
|
16069 |
|
16070 | onafterinit: undefined,
|
16071 |
|
16072 | |
16073 |
|
16074 |
|
16075 |
|
16076 |
|
16077 |
|
16078 |
|
16079 |
|
16080 |
|
16081 |
|
16082 |
|
16083 |
|
16084 | onrendered: undefined,
|
16085 |
|
16086 | |
16087 |
|
16088 |
|
16089 |
|
16090 |
|
16091 |
|
16092 |
|
16093 |
|
16094 |
|
16095 |
|
16096 |
|
16097 |
|
16098 |
|
16099 | transition_duration: 350,
|
16100 |
|
16101 | |
16102 |
|
16103 |
|
16104 |
|
16105 |
|
16106 |
|
16107 |
|
16108 |
|
16109 |
|
16110 |
|
16111 |
|
16112 |
|
16113 | plugins: [],
|
16114 |
|
16115 | |
16116 |
|
16117 |
|
16118 |
|
16119 |
|
16120 |
|
16121 |
|
16122 |
|
16123 |
|
16124 |
|
16125 |
|
16126 |
|
16127 |
|
16128 |
|
16129 |
|
16130 |
|
16131 |
|
16132 |
|
16133 |
|
16134 |
|
16135 |
|
16136 |
|
16137 |
|
16138 |
|
16139 |
|
16140 |
|
16141 |
|
16142 |
|
16143 |
|
16144 |
|
16145 |
|
16146 |
|
16147 |
|
16148 |
|
16149 |
|
16150 |
|
16151 |
|
16152 |
|
16153 |
|
16154 |
|
16155 | render: {},
|
16156 |
|
16157 | |
16158 |
|
16159 |
|
16160 |
|
16161 |
|
16162 |
|
16163 |
|
16164 |
|
16165 |
|
16166 |
|
16167 |
|
16168 |
|
16169 |
|
16170 |
|
16171 |
|
16172 |
|
16173 |
|
16174 |
|
16175 |
|
16176 |
|
16177 |
|
16178 |
|
16179 | regions: []
|
16180 | });
|
16181 | ;
|
16182 |
|
16183 |
|
16184 |
|
16185 |
|
16186 |
|
16187 |
|
16188 |
|
16189 |
|
16190 | var data_data = ({
|
16191 | |
16192 |
|
16193 |
|
16194 |
|
16195 |
|
16196 |
|
16197 |
|
16198 |
|
16199 |
|
16200 |
|
16201 |
|
16202 |
|
16203 | data_x: undefined,
|
16204 |
|
16205 | |
16206 |
|
16207 |
|
16208 |
|
16209 |
|
16210 |
|
16211 |
|
16212 |
|
16213 |
|
16214 |
|
16215 |
|
16216 |
|
16217 |
|
16218 |
|
16219 |
|
16220 |
|
16221 |
|
16222 |
|
16223 |
|
16224 | data_idConverter: function data_idConverter(id) {
|
16225 | return id;
|
16226 | },
|
16227 |
|
16228 | |
16229 |
|
16230 |
|
16231 |
|
16232 |
|
16233 |
|
16234 |
|
16235 |
|
16236 |
|
16237 |
|
16238 |
|
16239 |
|
16240 |
|
16241 |
|
16242 |
|
16243 | data_names: {},
|
16244 |
|
16245 | |
16246 |
|
16247 |
|
16248 |
|
16249 |
|
16250 |
|
16251 |
|
16252 |
|
16253 |
|
16254 |
|
16255 |
|
16256 |
|
16257 |
|
16258 |
|
16259 |
|
16260 | data_classes: {},
|
16261 |
|
16262 | |
16263 |
|
16264 |
|
16265 |
|
16266 |
|
16267 |
|
16268 |
|
16269 |
|
16270 |
|
16271 |
|
16272 |
|
16273 |
|
16274 |
|
16275 |
|
16276 |
|
16277 |
|
16278 |
|
16279 |
|
16280 |
|
16281 |
|
16282 |
|
16283 |
|
16284 |
|
16285 |
|
16286 |
|
16287 |
|
16288 |
|
16289 |
|
16290 |
|
16291 |
|
16292 |
|
16293 |
|
16294 |
|
16295 |
|
16296 |
|
16297 |
|
16298 |
|
16299 |
|
16300 |
|
16301 |
|
16302 |
|
16303 |
|
16304 |
|
16305 |
|
16306 |
|
16307 |
|
16308 |
|
16309 |
|
16310 |
|
16311 |
|
16312 |
|
16313 |
|
16314 |
|
16315 |
|
16316 |
|
16317 |
|
16318 |
|
16319 | data_type: undefined,
|
16320 |
|
16321 | |
16322 |
|
16323 |
|
16324 |
|
16325 |
|
16326 |
|
16327 |
|
16328 |
|
16329 |
|
16330 |
|
16331 |
|
16332 |
|
16333 |
|
16334 |
|
16335 |
|
16336 |
|
16337 |
|
16338 |
|
16339 |
|
16340 |
|
16341 |
|
16342 |
|
16343 |
|
16344 |
|
16345 |
|
16346 |
|
16347 |
|
16348 |
|
16349 |
|
16350 |
|
16351 |
|
16352 |
|
16353 |
|
16354 |
|
16355 |
|
16356 |
|
16357 |
|
16358 |
|
16359 |
|
16360 |
|
16361 |
|
16362 |
|
16363 |
|
16364 |
|
16365 |
|
16366 |
|
16367 |
|
16368 | data_types: {},
|
16369 |
|
16370 | |
16371 |
|
16372 |
|
16373 |
|
16374 |
|
16375 |
|
16376 |
|
16377 |
|
16378 |
|
16379 |
|
16380 |
|
16381 |
|
16382 |
|
16383 |
|
16384 |
|
16385 |
|
16386 |
|
16387 |
|
16388 |
|
16389 |
|
16390 |
|
16391 |
|
16392 |
|
16393 |
|
16394 |
|
16395 |
|
16396 |
|
16397 |
|
16398 |
|
16399 |
|
16400 |
|
16401 |
|
16402 |
|
16403 |
|
16404 |
|
16405 |
|
16406 |
|
16407 |
|
16408 |
|
16409 |
|
16410 |
|
16411 |
|
16412 |
|
16413 |
|
16414 |
|
16415 |
|
16416 |
|
16417 |
|
16418 |
|
16419 |
|
16420 | data_order: "desc",
|
16421 |
|
16422 | |
16423 |
|
16424 |
|
16425 |
|
16426 |
|
16427 |
|
16428 |
|
16429 |
|
16430 |
|
16431 |
|
16432 |
|
16433 |
|
16434 |
|
16435 |
|
16436 | data_groups: [],
|
16437 |
|
16438 | |
16439 |
|
16440 |
|
16441 |
|
16442 |
|
16443 |
|
16444 |
|
16445 |
|
16446 |
|
16447 |
|
16448 |
|
16449 |
|
16450 |
|
16451 | data_color: undefined,
|
16452 |
|
16453 | |
16454 |
|
16455 |
|
16456 |
|
16457 |
|
16458 |
|
16459 |
|
16460 |
|
16461 |
|
16462 |
|
16463 |
|
16464 |
|
16465 |
|
16466 |
|
16467 |
|
16468 |
|
16469 |
|
16470 | data_colors: {},
|
16471 |
|
16472 | |
16473 |
|
16474 |
|
16475 |
|
16476 |
|
16477 |
|
16478 |
|
16479 |
|
16480 |
|
16481 |
|
16482 |
|
16483 |
|
16484 |
|
16485 |
|
16486 |
|
16487 |
|
16488 |
|
16489 |
|
16490 |
|
16491 |
|
16492 |
|
16493 |
|
16494 |
|
16495 |
|
16496 |
|
16497 |
|
16498 |
|
16499 |
|
16500 |
|
16501 |
|
16502 |
|
16503 |
|
16504 |
|
16505 |
|
16506 |
|
16507 |
|
16508 |
|
16509 |
|
16510 |
|
16511 |
|
16512 |
|
16513 |
|
16514 |
|
16515 |
|
16516 |
|
16517 |
|
16518 |
|
16519 |
|
16520 |
|
16521 |
|
16522 |
|
16523 |
|
16524 |
|
16525 |
|
16526 |
|
16527 |
|
16528 |
|
16529 |
|
16530 |
|
16531 |
|
16532 |
|
16533 |
|
16534 |
|
16535 |
|
16536 |
|
16537 |
|
16538 |
|
16539 |
|
16540 |
|
16541 |
|
16542 |
|
16543 |
|
16544 |
|
16545 |
|
16546 |
|
16547 |
|
16548 |
|
16549 |
|
16550 |
|
16551 |
|
16552 |
|
16553 |
|
16554 | data_labels: {},
|
16555 | data_labels_colors: undefined,
|
16556 | data_labels_position: {},
|
16557 |
|
16558 | |
16559 |
|
16560 |
|
16561 |
|
16562 |
|
16563 |
|
16564 |
|
16565 |
|
16566 |
|
16567 |
|
16568 |
|
16569 |
|
16570 |
|
16571 |
|
16572 |
|
16573 |
|
16574 | data_hide: !1,
|
16575 |
|
16576 | |
16577 |
|
16578 |
|
16579 |
|
16580 |
|
16581 |
|
16582 |
|
16583 |
|
16584 |
|
16585 |
|
16586 |
|
16587 |
|
16588 |
|
16589 |
|
16590 |
|
16591 |
|
16592 |
|
16593 |
|
16594 | data_filter: undefined,
|
16595 |
|
16596 | |
16597 |
|
16598 |
|
16599 |
|
16600 |
|
16601 |
|
16602 |
|
16603 |
|
16604 |
|
16605 |
|
16606 |
|
16607 |
|
16608 |
|
16609 |
|
16610 |
|
16611 |
|
16612 |
|
16613 |
|
16614 |
|
16615 | data_onclick: function data_onclick() {},
|
16616 |
|
16617 | |
16618 |
|
16619 |
|
16620 |
|
16621 |
|
16622 |
|
16623 |
|
16624 |
|
16625 |
|
16626 |
|
16627 |
|
16628 |
|
16629 |
|
16630 |
|
16631 |
|
16632 |
|
16633 |
|
16634 |
|
16635 |
|
16636 | data_onover: function data_onover() {},
|
16637 |
|
16638 | |
16639 |
|
16640 |
|
16641 |
|
16642 |
|
16643 |
|
16644 |
|
16645 |
|
16646 |
|
16647 |
|
16648 |
|
16649 |
|
16650 |
|
16651 |
|
16652 |
|
16653 |
|
16654 |
|
16655 |
|
16656 |
|
16657 | data_onout: function data_onout() {},
|
16658 |
|
16659 | |
16660 |
|
16661 |
|
16662 |
|
16663 |
|
16664 |
|
16665 |
|
16666 |
|
16667 |
|
16668 |
|
16669 |
|
16670 |
|
16671 |
|
16672 |
|
16673 | data_onmin: undefined,
|
16674 |
|
16675 | |
16676 |
|
16677 |
|
16678 |
|
16679 |
|
16680 |
|
16681 |
|
16682 |
|
16683 |
|
16684 |
|
16685 |
|
16686 |
|
16687 |
|
16688 |
|
16689 | data_onmax: undefined,
|
16690 |
|
16691 | |
16692 |
|
16693 |
|
16694 |
|
16695 |
|
16696 |
|
16697 |
|
16698 |
|
16699 |
|
16700 |
|
16701 |
|
16702 |
|
16703 | data_url: undefined,
|
16704 |
|
16705 | |
16706 |
|
16707 |
|
16708 |
|
16709 |
|
16710 |
|
16711 |
|
16712 |
|
16713 |
|
16714 |
|
16715 |
|
16716 |
|
16717 |
|
16718 |
|
16719 |
|
16720 |
|
16721 |
|
16722 | data_headers: undefined,
|
16723 |
|
16724 | |
16725 |
|
16726 |
|
16727 |
|
16728 |
|
16729 |
|
16730 |
|
16731 |
|
16732 |
|
16733 |
|
16734 |
|
16735 |
|
16736 |
|
16737 |
|
16738 |
|
16739 |
|
16740 |
|
16741 |
|
16742 |
|
16743 |
|
16744 |
|
16745 |
|
16746 | data_json: undefined,
|
16747 |
|
16748 | |
16749 |
|
16750 |
|
16751 |
|
16752 |
|
16753 |
|
16754 |
|
16755 |
|
16756 |
|
16757 |
|
16758 |
|
16759 |
|
16760 |
|
16761 |
|
16762 |
|
16763 |
|
16764 |
|
16765 |
|
16766 |
|
16767 |
|
16768 |
|
16769 |
|
16770 |
|
16771 |
|
16772 |
|
16773 |
|
16774 |
|
16775 |
|
16776 |
|
16777 |
|
16778 |
|
16779 |
|
16780 |
|
16781 |
|
16782 |
|
16783 |
|
16784 |
|
16785 |
|
16786 |
|
16787 |
|
16788 |
|
16789 |
|
16790 |
|
16791 |
|
16792 |
|
16793 |
|
16794 |
|
16795 |
|
16796 |
|
16797 |
|
16798 |
|
16799 |
|
16800 |
|
16801 |
|
16802 |
|
16803 |
|
16804 |
|
16805 |
|
16806 |
|
16807 |
|
16808 |
|
16809 |
|
16810 |
|
16811 |
|
16812 |
|
16813 |
|
16814 |
|
16815 |
|
16816 |
|
16817 |
|
16818 |
|
16819 |
|
16820 |
|
16821 |
|
16822 |
|
16823 |
|
16824 |
|
16825 |
|
16826 | data_rows: undefined,
|
16827 |
|
16828 | |
16829 |
|
16830 |
|
16831 |
|
16832 |
|
16833 |
|
16834 |
|
16835 |
|
16836 |
|
16837 |
|
16838 |
|
16839 |
|
16840 |
|
16841 |
|
16842 |
|
16843 |
|
16844 |
|
16845 |
|
16846 |
|
16847 |
|
16848 |
|
16849 |
|
16850 |
|
16851 |
|
16852 |
|
16853 |
|
16854 |
|
16855 |
|
16856 |
|
16857 |
|
16858 |
|
16859 |
|
16860 |
|
16861 |
|
16862 |
|
16863 |
|
16864 |
|
16865 |
|
16866 |
|
16867 |
|
16868 |
|
16869 |
|
16870 |
|
16871 |
|
16872 |
|
16873 |
|
16874 |
|
16875 |
|
16876 |
|
16877 |
|
16878 |
|
16879 |
|
16880 |
|
16881 |
|
16882 |
|
16883 |
|
16884 |
|
16885 |
|
16886 | data_columns: undefined,
|
16887 |
|
16888 | |
16889 |
|
16890 |
|
16891 |
|
16892 |
|
16893 |
|
16894 |
|
16895 |
|
16896 |
|
16897 |
|
16898 |
|
16899 |
|
16900 |
|
16901 |
|
16902 |
|
16903 | data_mimeType: "csv",
|
16904 |
|
16905 | |
16906 |
|
16907 |
|
16908 |
|
16909 |
|
16910 |
|
16911 |
|
16912 |
|
16913 |
|
16914 |
|
16915 |
|
16916 |
|
16917 |
|
16918 |
|
16919 |
|
16920 |
|
16921 |
|
16922 |
|
16923 |
|
16924 |
|
16925 |
|
16926 | data_keys: undefined,
|
16927 |
|
16928 | |
16929 |
|
16930 |
|
16931 |
|
16932 |
|
16933 |
|
16934 |
|
16935 |
|
16936 |
|
16937 |
|
16938 |
|
16939 |
|
16940 |
|
16941 |
|
16942 |
|
16943 |
|
16944 | data_empty_label_text: ""
|
16945 | });
|
16946 | ;
|
16947 |
|
16948 |
|
16949 |
|
16950 |
|
16951 |
|
16952 |
|
16953 |
|
16954 |
|
16955 | var color = ({
|
16956 | |
16957 |
|
16958 |
|
16959 |
|
16960 |
|
16961 |
|
16962 |
|
16963 |
|
16964 |
|
16965 |
|
16966 |
|
16967 |
|
16968 |
|
16969 |
|
16970 |
|
16971 |
|
16972 |
|
16973 |
|
16974 |
|
16975 |
|
16976 |
|
16977 |
|
16978 |
|
16979 |
|
16980 |
|
16981 |
|
16982 |
|
16983 |
|
16984 |
|
16985 |
|
16986 |
|
16987 |
|
16988 |
|
16989 |
|
16990 |
|
16991 |
|
16992 |
|
16993 |
|
16994 |
|
16995 |
|
16996 |
|
16997 |
|
16998 |
|
16999 |
|
17000 |
|
17001 |
|
17002 |
|
17003 |
|
17004 |
|
17005 |
|
17006 |
|
17007 |
|
17008 |
|
17009 |
|
17010 |
|
17011 |
|
17012 |
|
17013 |
|
17014 |
|
17015 |
|
17016 |
|
17017 |
|
17018 |
|
17019 |
|
17020 |
|
17021 |
|
17022 |
|
17023 |
|
17024 |
|
17025 |
|
17026 |
|
17027 |
|
17028 |
|
17029 |
|
17030 | color_pattern: [],
|
17031 | color_tiles: undefined,
|
17032 | color_threshold: {},
|
17033 | color_onover: undefined
|
17034 | });
|
17035 | ;
|
17036 |
|
17037 |
|
17038 |
|
17039 |
|
17040 |
|
17041 |
|
17042 |
|
17043 |
|
17044 | var interaction = ({
|
17045 | |
17046 |
|
17047 |
|
17048 |
|
17049 |
|
17050 |
|
17051 |
|
17052 |
|
17053 |
|
17054 |
|
17055 |
|
17056 |
|
17057 |
|
17058 |
|
17059 |
|
17060 |
|
17061 |
|
17062 |
|
17063 |
|
17064 |
|
17065 |
|
17066 |
|
17067 |
|
17068 |
|
17069 |
|
17070 |
|
17071 |
|
17072 |
|
17073 |
|
17074 |
|
17075 |
|
17076 |
|
17077 | interaction_enabled: !0,
|
17078 | interaction_brighten: !0,
|
17079 | interaction_inputType_mouse: !0,
|
17080 | interaction_inputType_touch: {}
|
17081 | });
|
17082 | ;
|
17083 |
|
17084 |
|
17085 |
|
17086 |
|
17087 |
|
17088 |
|
17089 |
|
17090 |
|
17091 | var legend = ({
|
17092 | |
17093 |
|
17094 |
|
17095 |
|
17096 |
|
17097 |
|
17098 |
|
17099 |
|
17100 |
|
17101 |
|
17102 |
|
17103 |
|
17104 |
|
17105 |
|
17106 |
|
17107 |
|
17108 |
|
17109 |
|
17110 |
|
17111 |
|
17112 |
|
17113 |
|
17114 |
|
17115 |
|
17116 |
|
17117 |
|
17118 |
|
17119 |
|
17120 |
|
17121 |
|
17122 |
|
17123 |
|
17124 |
|
17125 |
|
17126 |
|
17127 |
|
17128 |
|
17129 |
|
17130 |
|
17131 |
|
17132 |
|
17133 |
|
17134 |
|
17135 |
|
17136 |
|
17137 |
|
17138 |
|
17139 |
|
17140 |
|
17141 |
|
17142 |
|
17143 |
|
17144 |
|
17145 |
|
17146 |
|
17147 |
|
17148 |
|
17149 |
|
17150 |
|
17151 |
|
17152 |
|
17153 |
|
17154 |
|
17155 |
|
17156 |
|
17157 |
|
17158 |
|
17159 |
|
17160 |
|
17161 |
|
17162 |
|
17163 |
|
17164 |
|
17165 |
|
17166 |
|
17167 |
|
17168 |
|
17169 |
|
17170 |
|
17171 |
|
17172 |
|
17173 |
|
17174 |
|
17175 |
|
17176 |
|
17177 | legend_show: !0,
|
17178 | legend_hide: !1,
|
17179 | legend_contents_bindto: undefined,
|
17180 | legend_contents_template: undefined,
|
17181 | legend_position: "bottom",
|
17182 | legend_inset_anchor: "top-left",
|
17183 | legend_inset_x: 10,
|
17184 | legend_inset_y: 0,
|
17185 | legend_inset_step: undefined,
|
17186 | legend_item_onclick: undefined,
|
17187 | legend_item_onover: undefined,
|
17188 | legend_item_onout: undefined,
|
17189 | legend_equally: !1,
|
17190 | legend_padding: 0,
|
17191 | legend_item_tile_width: 10,
|
17192 | legend_item_tile_height: 10,
|
17193 | legend_usePoint: !1
|
17194 | });
|
17195 | ;
|
17196 |
|
17197 |
|
17198 |
|
17199 |
|
17200 |
|
17201 |
|
17202 |
|
17203 |
|
17204 | var title = ({
|
17205 | |
17206 |
|
17207 |
|
17208 |
|
17209 |
|
17210 |
|
17211 |
|
17212 |
|
17213 |
|
17214 |
|
17215 |
|
17216 |
|
17217 |
|
17218 |
|
17219 |
|
17220 |
|
17221 |
|
17222 |
|
17223 |
|
17224 |
|
17225 |
|
17226 |
|
17227 |
|
17228 |
|
17229 |
|
17230 |
|
17231 |
|
17232 |
|
17233 |
|
17234 | title_text: undefined,
|
17235 | title_padding: {
|
17236 | top: 0,
|
17237 | right: 0,
|
17238 | bottom: 0,
|
17239 | left: 0
|
17240 | },
|
17241 | title_position: "center"
|
17242 | });
|
17243 | ;
|
17244 |
|
17245 |
|
17246 |
|
17247 |
|
17248 |
|
17249 |
|
17250 |
|
17251 |
|
17252 | var tooltip = ({
|
17253 | |
17254 |
|
17255 |
|
17256 |
|
17257 |
|
17258 |
|
17259 |
|
17260 |
|
17261 |
|
17262 |
|
17263 |
|
17264 |
|
17265 |
|
17266 |
|
17267 |
|
17268 |
|
17269 |
|
17270 |
|
17271 |
|
17272 |
|
17273 |
|
17274 |
|
17275 |
|
17276 |
|
17277 |
|
17278 |
|
17279 |
|
17280 |
|
17281 |
|
17282 |
|
17283 |
|
17284 |
|
17285 |
|
17286 |
|
17287 |
|
17288 |
|
17289 |
|
17290 |
|
17291 |
|
17292 |
|
17293 |
|
17294 |
|
17295 |
|
17296 |
|
17297 |
|
17298 |
|
17299 |
|
17300 |
|
17301 |
|
17302 |
|
17303 |
|
17304 |
|
17305 |
|
17306 |
|
17307 |
|
17308 |
|
17309 |
|
17310 |
|
17311 |
|
17312 |
|
17313 |
|
17314 |
|
17315 |
|
17316 |
|
17317 |
|
17318 |
|
17319 |
|
17320 |
|
17321 |
|
17322 |
|
17323 |
|
17324 |
|
17325 |
|
17326 |
|
17327 |
|
17328 |
|
17329 |
|
17330 |
|
17331 |
|
17332 |
|
17333 |
|
17334 |
|
17335 |
|
17336 |
|
17337 |
|
17338 |
|
17339 |
|
17340 |
|
17341 |
|
17342 |
|
17343 |
|
17344 |
|
17345 |
|
17346 |
|
17347 |
|
17348 |
|
17349 |
|
17350 |
|
17351 |
|
17352 |
|
17353 |
|
17354 |
|
17355 |
|
17356 |
|
17357 |
|
17358 |
|
17359 |
|
17360 |
|
17361 |
|
17362 |
|
17363 |
|
17364 |
|
17365 |
|
17366 |
|
17367 |
|
17368 |
|
17369 |
|
17370 |
|
17371 |
|
17372 |
|
17373 |
|
17374 |
|
17375 |
|
17376 |
|
17377 |
|
17378 |
|
17379 |
|
17380 |
|
17381 |
|
17382 |
|
17383 |
|
17384 |
|
17385 |
|
17386 |
|
17387 |
|
17388 |
|
17389 |
|
17390 |
|
17391 |
|
17392 |
|
17393 |
|
17394 |
|
17395 |
|
17396 |
|
17397 |
|
17398 |
|
17399 |
|
17400 |
|
17401 |
|
17402 |
|
17403 |
|
17404 |
|
17405 |
|
17406 |
|
17407 |
|
17408 |
|
17409 |
|
17410 |
|
17411 |
|
17412 |
|
17413 |
|
17414 |
|
17415 |
|
17416 |
|
17417 |
|
17418 |
|
17419 |
|
17420 | tooltip_show: !0,
|
17421 | tooltip_doNotHide: !1,
|
17422 | tooltip_grouped: !0,
|
17423 | tooltip_format_title: undefined,
|
17424 | tooltip_format_name: undefined,
|
17425 | tooltip_format_value: undefined,
|
17426 | tooltip_position: undefined,
|
17427 | tooltip_contents: {},
|
17428 | tooltip_init_show: !1,
|
17429 | tooltip_init_x: 0,
|
17430 | tooltip_init_position: {
|
17431 | top: "0px",
|
17432 | left: "50px"
|
17433 | },
|
17434 | tooltip_linked: !1,
|
17435 | tooltip_linked_name: "",
|
17436 | tooltip_onshow: function tooltip_onshow() {},
|
17437 | tooltip_onhide: function tooltip_onhide() {},
|
17438 | tooltip_onshown: function tooltip_onshown() {},
|
17439 | tooltip_onhidden: function tooltip_onhidden() {},
|
17440 | tooltip_order: null
|
17441 | });
|
17442 | ;
|
17443 | function sourceEvent(event) {
|
17444 | for (var sourceEvent; sourceEvent = event.sourceEvent;) event = sourceEvent;
|
17445 |
|
17446 | return event;
|
17447 | }
|
17448 | ;
|
17449 |
|
17450 | function src_pointer(event, node) {
|
17451 | if (event = sourceEvent(event), node === undefined && (node = event.currentTarget), node) {
|
17452 | var svg = node.ownerSVGElement || node;
|
17453 |
|
17454 | if (svg.createSVGPoint) {
|
17455 | var point = svg.createSVGPoint();
|
17456 | return point.x = event.clientX, point.y = event.clientY, point = point.matrixTransform(node.getScreenCTM().inverse()), [point.x, point.y];
|
17457 | }
|
17458 |
|
17459 | if (node.getBoundingClientRect) {
|
17460 | var rect = node.getBoundingClientRect();
|
17461 | return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];
|
17462 | }
|
17463 | }
|
17464 |
|
17465 | return [event.pageX, event.pageY];
|
17466 | }
|
17467 | ;
|
17468 | var noop = {
|
17469 | value: function value() {}
|
17470 | };
|
17471 |
|
17472 | function dispatch_dispatch() {
|
17473 | for (var t, i = 0, n = arguments.length, _ = {}; i < n; ++i) {
|
17474 | if (!(t = arguments[i] + "") || t in _ || /[\s.]/.test(t)) throw new Error("illegal type: " + t);
|
17475 | _[t] = [];
|
17476 | }
|
17477 |
|
17478 | return new Dispatch(_);
|
17479 | }
|
17480 |
|
17481 | function Dispatch(_) {
|
17482 | this._ = _;
|
17483 | }
|
17484 |
|
17485 | function dispatch_parseTypenames(typenames, types) {
|
17486 | return typenames.trim().split(/^|\s+/).map(function (t) {
|
17487 | var name = "",
|
17488 | i = t.indexOf(".");
|
17489 | if (i >= 0 && (name = t.slice(i + 1), t = t.slice(0, i)), t && !types.hasOwnProperty(t)) throw new Error("unknown type: " + t);
|
17490 | return {
|
17491 | type: t,
|
17492 | name: name
|
17493 | };
|
17494 | });
|
17495 | }
|
17496 |
|
17497 | Dispatch.prototype = dispatch_dispatch.prototype = {
|
17498 | constructor: Dispatch,
|
17499 | on: function on(typename, callback) {
|
17500 | var t,
|
17501 | _ = this._,
|
17502 | T = dispatch_parseTypenames(typename + "", _),
|
17503 | i = -1,
|
17504 | n = T.length;
|
17505 |
|
17506 | if (arguments.length < 2) {
|
17507 | for (; ++i < n;) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;
|
17508 |
|
17509 | return;
|
17510 | } // If a type was specified, set the callback for the given type and name.
|
17511 | // Otherwise, if a null callback was specified, remove callbacks of the given name.
|
17512 |
|
17513 |
|
17514 | if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback);
|
17515 |
|
17516 | for (; ++i < n;) if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);
|
17517 |
|
17518 | return this;
|
17519 | },
|
17520 | copy: function () {
|
17521 | var copy = {},
|
17522 | _ = this._;
|
17523 |
|
17524 | for (var t in _) copy[t] = _[t].slice();
|
17525 |
|
17526 | return new Dispatch(copy);
|
17527 | },
|
17528 | call: function call(type, that) {
|
17529 | if ((n = arguments.length - 2) > 0) for (var n, t, args = Array(n), i = 0; i < n; ++i) args[i] = arguments[i + 2];
|
17530 | if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type);
|
17531 |
|
17532 | for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);
|
17533 | },
|
17534 | apply: function apply(type, that, args) {
|
17535 | if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type);
|
17536 |
|
17537 | for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);
|
17538 | }
|
17539 | };
|
17540 |
|
17541 | function get(type, name) {
|
17542 | for (var c, i = 0, n = type.length; i < n; ++i) if ((c = type[i]).name === name) return c.value;
|
17543 | }
|
17544 |
|
17545 | function set(type, name, callback) {
|
17546 | for (var i = 0, n = type.length; i < n; ++i) if (type[i].name === name) {
|
17547 | type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));
|
17548 | break;
|
17549 | }
|
17550 |
|
17551 | return callback != null && type.push({
|
17552 | name: name,
|
17553 | value: callback
|
17554 | }), type;
|
17555 | }
|
17556 |
|
17557 | var src_dispatch = (dispatch_dispatch);
|
17558 | ;
|
17559 | function nopropagation(event) {
|
17560 | event.stopImmediatePropagation();
|
17561 | }
|
17562 | function noevent(event) {
|
17563 | event.preventDefault(), event.stopImmediatePropagation();
|
17564 | }
|
17565 | ;
|
17566 |
|
17567 |
|
17568 | function nodrag(view) {
|
17569 | var root = view.document.documentElement,
|
17570 | selection = src_select(view).on("dragstart.drag", noevent, !0);
|
17571 | "onselectstart" in root ? selection.on("selectstart.drag", noevent, !0) : (root.__noselect = root.style.MozUserSelect, root.style.MozUserSelect = "none");
|
17572 | }
|
17573 | function yesdrag(view, noclick) {
|
17574 | var root = view.document.documentElement,
|
17575 | selection = src_select(view).on("dragstart.drag", null);
|
17576 | noclick && (selection.on("click.drag", noevent, !0), setTimeout(function () {
|
17577 | selection.on("click.drag", null);
|
17578 | }, 0)), "onselectstart" in root ? selection.on("selectstart.drag", null) : (root.style.MozUserSelect = root.__noselect, delete root.__noselect);
|
17579 | }
|
17580 | ;
|
17581 | function src_define(constructor, factory, prototype) {
|
17582 | constructor.prototype = factory.prototype = prototype, prototype.constructor = constructor;
|
17583 | }
|
17584 | function extend(parent, definition) {
|
17585 | var prototype = Object.create(parent.prototype);
|
17586 |
|
17587 | for (var key in definition) prototype[key] = definition[key];
|
17588 |
|
17589 | return prototype;
|
17590 | }
|
17591 | ;
|
17592 |
|
17593 | function Color() {}
|
17594 | var _darker = .7;
|
17595 |
|
17596 |
|
17597 | var _brighter = 1 / _darker;
|
17598 |
|
17599 |
|
17600 | var reI = "\\s*([+-]?\\d+)\\s*",
|
17601 | reN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",
|
17602 | reP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",
|
17603 | reHex = /^#([0-9a-f]{3,8})$/,
|
17604 | reRgbInteger = new RegExp("^rgb\\(\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*\\)$"),
|
17605 | reRgbPercent = new RegExp("^rgb\\(\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*,\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*,\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*\\)$"),
|
17606 | reRgbaInteger = new RegExp("^rgba\\(\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*\\)$"),
|
17607 | reRgbaPercent = new RegExp("^rgba\\(\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*,\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*,\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*,\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*\\)$"),
|
17608 | reHslPercent = new RegExp("^hsl\\(\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*,\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*,\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*\\)$"),
|
17609 | reHslaPercent = new RegExp("^hsla\\(\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*,\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*,\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*,\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*\\)$"),
|
17610 | named = {
|
17611 | aliceblue: 0xf0f8ff,
|
17612 | antiquewhite: 0xfaebd7,
|
17613 | aqua: 65535,
|
17614 | aquamarine: 8388564,
|
17615 | azure: 0xf0ffff,
|
17616 | beige: 0xf5f5dc,
|
17617 | bisque: 0xffe4c4,
|
17618 | black: 0,
|
17619 | blanchedalmond: 0xffebcd,
|
17620 | blue: 255,
|
17621 | blueviolet: 9055202,
|
17622 | brown: 0xa52a2a,
|
17623 | burlywood: 0xdeb887,
|
17624 | cadetblue: 6266528,
|
17625 | chartreuse: 8388352,
|
17626 | chocolate: 0xd2691e,
|
17627 | coral: 0xff7f50,
|
17628 | cornflowerblue: 6591981,
|
17629 | cornsilk: 0xfff8dc,
|
17630 | crimson: 0xdc143c,
|
17631 | cyan: 65535,
|
17632 | darkblue: 139,
|
17633 | darkcyan: 35723,
|
17634 | darkgoldenrod: 0xb8860b,
|
17635 | darkgray: 0xa9a9a9,
|
17636 | darkgreen: 25600,
|
17637 | darkgrey: 0xa9a9a9,
|
17638 | darkkhaki: 0xbdb76b,
|
17639 | darkmagenta: 9109643,
|
17640 | darkolivegreen: 5597999,
|
17641 | darkorange: 0xff8c00,
|
17642 | darkorchid: 0x9932cc,
|
17643 | darkred: 9109504,
|
17644 | darksalmon: 0xe9967a,
|
17645 | darkseagreen: 9419919,
|
17646 | darkslateblue: 4734347,
|
17647 | darkslategray: 3100495,
|
17648 | darkslategrey: 3100495,
|
17649 | darkturquoise: 52945,
|
17650 | darkviolet: 9699539,
|
17651 | deeppink: 0xff1493,
|
17652 | deepskyblue: 49151,
|
17653 | dimgray: 6908265,
|
17654 | dimgrey: 6908265,
|
17655 | dodgerblue: 2003199,
|
17656 | firebrick: 0xb22222,
|
17657 | floralwhite: 0xfffaf0,
|
17658 | forestgreen: 2263842,
|
17659 | fuchsia: 0xff00ff,
|
17660 | gainsboro: 0xdcdcdc,
|
17661 | ghostwhite: 0xf8f8ff,
|
17662 | gold: 0xffd700,
|
17663 | goldenrod: 0xdaa520,
|
17664 | gray: 8421504,
|
17665 | green: 32768,
|
17666 | greenyellow: 0xadff2f,
|
17667 | grey: 8421504,
|
17668 | honeydew: 0xf0fff0,
|
17669 | hotpink: 0xff69b4,
|
17670 | indianred: 0xcd5c5c,
|
17671 | indigo: 4915330,
|
17672 | ivory: 0xfffff0,
|
17673 | khaki: 0xf0e68c,
|
17674 | lavender: 0xe6e6fa,
|
17675 | lavenderblush: 0xfff0f5,
|
17676 | lawngreen: 8190976,
|
17677 | lemonchiffon: 0xfffacd,
|
17678 | lightblue: 0xadd8e6,
|
17679 | lightcoral: 0xf08080,
|
17680 | lightcyan: 0xe0ffff,
|
17681 | lightgoldenrodyellow: 0xfafad2,
|
17682 | lightgray: 0xd3d3d3,
|
17683 | lightgreen: 9498256,
|
17684 | lightgrey: 0xd3d3d3,
|
17685 | lightpink: 0xffb6c1,
|
17686 | lightsalmon: 0xffa07a,
|
17687 | lightseagreen: 2142890,
|
17688 | lightskyblue: 8900346,
|
17689 | lightslategray: 7833753,
|
17690 | lightslategrey: 7833753,
|
17691 | lightsteelblue: 0xb0c4de,
|
17692 | lightyellow: 0xffffe0,
|
17693 | lime: 65280,
|
17694 | limegreen: 3329330,
|
17695 | linen: 0xfaf0e6,
|
17696 | magenta: 0xff00ff,
|
17697 | maroon: 8388608,
|
17698 | mediumaquamarine: 6737322,
|
17699 | mediumblue: 205,
|
17700 | mediumorchid: 0xba55d3,
|
17701 | mediumpurple: 9662683,
|
17702 | mediumseagreen: 3978097,
|
17703 | mediumslateblue: 8087790,
|
17704 | mediumspringgreen: 64154,
|
17705 | mediumturquoise: 4772300,
|
17706 | mediumvioletred: 0xc71585,
|
17707 | midnightblue: 1644912,
|
17708 | mintcream: 0xf5fffa,
|
17709 | mistyrose: 0xffe4e1,
|
17710 | moccasin: 0xffe4b5,
|
17711 | navajowhite: 0xffdead,
|
17712 | navy: 128,
|
17713 | oldlace: 0xfdf5e6,
|
17714 | olive: 8421376,
|
17715 | olivedrab: 7048739,
|
17716 | orange: 0xffa500,
|
17717 | orangered: 0xff4500,
|
17718 | orchid: 0xda70d6,
|
17719 | palegoldenrod: 0xeee8aa,
|
17720 | palegreen: 0x98fb98,
|
17721 | paleturquoise: 0xafeeee,
|
17722 | palevioletred: 0xdb7093,
|
17723 | papayawhip: 0xffefd5,
|
17724 | peachpuff: 0xffdab9,
|
17725 | peru: 0xcd853f,
|
17726 | pink: 0xffc0cb,
|
17727 | plum: 0xdda0dd,
|
17728 | powderblue: 0xb0e0e6,
|
17729 | purple: 8388736,
|
17730 | rebeccapurple: 6697881,
|
17731 | red: 0xff0000,
|
17732 | rosybrown: 0xbc8f8f,
|
17733 | royalblue: 4286945,
|
17734 | saddlebrown: 9127187,
|
17735 | salmon: 0xfa8072,
|
17736 | sandybrown: 0xf4a460,
|
17737 | seagreen: 3050327,
|
17738 | seashell: 0xfff5ee,
|
17739 | sienna: 0xa0522d,
|
17740 | silver: 0xc0c0c0,
|
17741 | skyblue: 8900331,
|
17742 | slateblue: 6970061,
|
17743 | slategray: 7372944,
|
17744 | slategrey: 7372944,
|
17745 | snow: 0xfffafa,
|
17746 | springgreen: 65407,
|
17747 | steelblue: 4620980,
|
17748 | tan: 0xd2b48c,
|
17749 | teal: 32896,
|
17750 | thistle: 0xd8bfd8,
|
17751 | tomato: 0xff6347,
|
17752 | turquoise: 4251856,
|
17753 | violet: 0xee82ee,
|
17754 | wheat: 0xf5deb3,
|
17755 | white: 0xffffff,
|
17756 | whitesmoke: 0xf5f5f5,
|
17757 | yellow: 0xffff00,
|
17758 | yellowgreen: 0x9acd32
|
17759 | };
|
17760 | src_define(Color, color_color, {
|
17761 | copy: function copy(channels) {
|
17762 | return Object.assign(new this.constructor(), this, channels);
|
17763 | },
|
17764 | displayable: function displayable() {
|
17765 | return this.rgb().displayable();
|
17766 | },
|
17767 | hex: color_formatHex,
|
17768 |
|
17769 | formatHex: color_formatHex,
|
17770 | formatHsl: color_formatHsl,
|
17771 | formatRgb: color_formatRgb,
|
17772 | toString: color_formatRgb
|
17773 | });
|
17774 |
|
17775 | function color_formatHex() {
|
17776 | return this.rgb().formatHex();
|
17777 | }
|
17778 |
|
17779 | function color_formatHsl() {
|
17780 | return hslConvert(this).formatHsl();
|
17781 | }
|
17782 |
|
17783 | function color_formatRgb() {
|
17784 | return this.rgb().formatRgb();
|
17785 | }
|
17786 |
|
17787 | function color_color(format) {
|
17788 | var m, l;
|
17789 | return format = (format + "").trim().toLowerCase(), (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m)
|
17790 | : l === 3 ? new Rgb(m >> 8 & 15 | m >> 4 & 240, m >> 4 & 15 | m & 240, (m & 15) << 4 | m & 15, 1)
|
17791 | : l === 8 ? rgba(m >> 24 & 255, m >> 16 & 255, m >> 8 & 255, (m & 255) / 255)
|
17792 | : l === 4 ? rgba(m >> 12 & 15 | m >> 8 & 240, m >> 8 & 15 | m >> 4 & 240, m >> 4 & 15 | m & 240, ((m & 15) << 4 | m & 15) / 255)
|
17793 | : null
|
17794 | ) : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1)
|
17795 | : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1)
|
17796 | : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4])
|
17797 | : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4])
|
17798 | : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1)
|
17799 | : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4])
|
17800 | : named.hasOwnProperty(format) ? rgbn(named[format])
|
17801 | : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null;
|
17802 | }
|
17803 |
|
17804 | function rgbn(n) {
|
17805 | return new Rgb(n >> 16 & 255, n >> 8 & 255, n & 255, 1);
|
17806 | }
|
17807 |
|
17808 | function rgba(r, g, b, a) {
|
17809 | return a <= 0 && (r = g = b = NaN), new Rgb(r, g, b, a);
|
17810 | }
|
17811 |
|
17812 | function rgbConvert(o) {
|
17813 | return (o instanceof Color || (o = color_color(o)), !o) ? new Rgb() : (o = o.rgb(), new Rgb(o.r, o.g, o.b, o.opacity));
|
17814 | }
|
17815 | function color_rgb(r, g, b, opacity) {
|
17816 | return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
|
17817 | }
|
17818 | function Rgb(r, g, b, opacity) {
|
17819 | this.r = +r, this.g = +g, this.b = +b, this.opacity = +opacity;
|
17820 | }
|
17821 | src_define(Rgb, color_rgb, extend(Color, {
|
17822 | brighter: function brighter(k) {
|
17823 | return k = k == null ? _brighter : Math.pow(_brighter, k), new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
|
17824 | },
|
17825 | darker: function darker(k) {
|
17826 | return k = k == null ? _darker : Math.pow(_darker, k), new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
|
17827 | },
|
17828 | rgb: function () {
|
17829 | return this;
|
17830 | },
|
17831 | displayable: function displayable() {
|
17832 | return -.5 <= this.r && this.r < 255.5 && -.5 <= this.g && this.g < 255.5 && -.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
|
17833 | },
|
17834 | hex: rgb_formatHex,
|
17835 |
|
17836 | formatHex: rgb_formatHex,
|
17837 | formatRgb: rgb_formatRgb,
|
17838 | toString: rgb_formatRgb
|
17839 | }));
|
17840 |
|
17841 | function rgb_formatHex() {
|
17842 | return "#" + hex(this.r) + hex(this.g) + hex(this.b);
|
17843 | }
|
17844 |
|
17845 | function rgb_formatRgb() {
|
17846 | var a = this.opacity;
|
17847 | return a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)), (a === 1 ? "rgb(" : "rgba(") + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", " + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", " + Math.max(0, Math.min(255, Math.round(this.b) || 0)) + (a === 1 ? ")" : ", " + a + ")");
|
17848 | }
|
17849 |
|
17850 | function hex(value) {
|
17851 | return value = Math.max(0, Math.min(255, Math.round(value) || 0)), (value < 16 ? "0" : "") + value.toString(16);
|
17852 | }
|
17853 |
|
17854 | function hsla(h, s, l, a) {
|
17855 | return a <= 0 ? h = s = l = NaN : l <= 0 || l >= 1 ? h = s = NaN : s <= 0 && (h = NaN), new Hsl(h, s, l, a);
|
17856 | }
|
17857 |
|
17858 | function hslConvert(o) {
|
17859 | if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
|
17860 | if (o instanceof Color || (o = color_color(o)), !o) return new Hsl();
|
17861 | if (o instanceof Hsl) return o;
|
17862 | o = o.rgb();
|
17863 | var r = o.r / 255,
|
17864 | g = o.g / 255,
|
17865 | b = o.b / 255,
|
17866 | min = Math.min(r, g, b),
|
17867 | max = Math.max(r, g, b),
|
17868 | h = NaN,
|
17869 | s = max - min,
|
17870 | l = (max + min) / 2;
|
17871 | return s ? (h = r === max ? (g - b) / s + (g < b) * 6 : g === max ? (b - r) / s + 2 : (r - g) / s + 4, s /= l < .5 ? max + min : 2 - max - min, h *= 60) : s = l > 0 && l < 1 ? 0 : h, new Hsl(h, s, l, o.opacity);
|
17872 | }
|
17873 | function hsl(h, s, l, opacity) {
|
17874 | return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);
|
17875 | }
|
17876 |
|
17877 | function Hsl(h, s, l, opacity) {
|
17878 | this.h = +h, this.s = +s, this.l = +l, this.opacity = +opacity;
|
17879 | }
|
17880 |
|
17881 | src_define(Hsl, hsl, extend(Color, {
|
17882 | brighter: function brighter(k) {
|
17883 | return k = k == null ? _brighter : Math.pow(_brighter, k), new Hsl(this.h, this.s, this.l * k, this.opacity);
|
17884 | },
|
17885 | darker: function darker(k) {
|
17886 | return k = k == null ? _darker : Math.pow(_darker, k), new Hsl(this.h, this.s, this.l * k, this.opacity);
|
17887 | },
|
17888 | rgb: function () {
|
17889 | var h = this.h % 360 + (this.h < 0) * 360,
|
17890 | s = isNaN(h) || isNaN(this.s) ? 0 : this.s,
|
17891 | l = this.l,
|
17892 | m2 = l + (l < .5 ? l : 1 - l) * s,
|
17893 | m1 = 2 * l - m2;
|
17894 | return new Rgb(hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2), hsl2rgb(h, m1, m2), hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2), this.opacity);
|
17895 | },
|
17896 | displayable: function displayable() {
|
17897 | return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
|
17898 | },
|
17899 | formatHsl: function formatHsl() {
|
17900 | var a = this.opacity;
|
17901 | return a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)), (a === 1 ? "hsl(" : "hsla(") + (this.h || 0) + ", " + (this.s || 0) * 100 + "%, " + (this.l || 0) * 100 + "%" + (a === 1 ? ")" : ", " + a + ")");
|
17902 | }
|
17903 | }));
|
17904 |
|
17905 |
|
17906 | function hsl2rgb(h, m1, m2) {
|
17907 | return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255;
|
17908 | }
|
17909 | ;
|
17910 | function basis(t1, v0, v1, v2, v3) {
|
17911 | var t2 = t1 * t1,
|
17912 | t3 = t2 * t1;
|
17913 | return ((1 - 3 * t1 + 3 * t2 - t3) * v0 + (4 - 6 * t2 + 3 * t3) * v1 + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2 + t3 * v3) / 6;
|
17914 | }
|
17915 | function src_basis(values) {
|
17916 | var n = values.length - 1;
|
17917 | return function (t) {
|
17918 | var i = t <= 0 ? t = 0 : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),
|
17919 | v1 = values[i],
|
17920 | v2 = values[i + 1],
|
17921 | v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,
|
17922 | v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;
|
17923 | return basis((t - i / n) * n, v0, v1, v2, v3);
|
17924 | };
|
17925 | }
|
17926 | ;
|
17927 |
|
17928 | function basisClosed(values) {
|
17929 | var n = values.length;
|
17930 | return function (t) {
|
17931 | var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),
|
17932 | v0 = values[(i + n - 1) % n],
|
17933 | v1 = values[i % n],
|
17934 | v2 = values[(i + 1) % n],
|
17935 | v3 = values[(i + 2) % n];
|
17936 | return basis((t - i / n) * n, v0, v1, v2, v3);
|
17937 | };
|
17938 | }
|
17939 | ;
|
17940 | var src_constant = (function (x) {
|
17941 | return function () {
|
17942 | return x;
|
17943 | };
|
17944 | });
|
17945 | ;
|
17946 |
|
17947 |
|
17948 | function linear(a, d) {
|
17949 | return function (t) {
|
17950 | return a + t * d;
|
17951 | };
|
17952 | }
|
17953 |
|
17954 | function exponential(a, b, y) {
|
17955 | return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function (t) {
|
17956 | return Math.pow(a + t * b, y);
|
17957 | };
|
17958 | }
|
17959 |
|
17960 | function hue(a, b) {
|
17961 | var d = b - a;
|
17962 | return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : src_constant(isNaN(a) ? b : a);
|
17963 | }
|
17964 | function gamma(y) {
|
17965 | return (y = +y) === 1 ? nogamma : function (a, b) {
|
17966 | return b - a ? exponential(a, b, y) : src_constant(isNaN(a) ? b : a);
|
17967 | };
|
17968 | }
|
17969 | function nogamma(a, b) {
|
17970 | var d = b - a;
|
17971 | return d ? linear(a, d) : src_constant(isNaN(a) ? b : a);
|
17972 | }
|
17973 | ;
|
17974 |
|
17975 |
|
17976 |
|
17977 |
|
17978 | var rgb = ((function rgbGamma(y) {
|
17979 | function rgb(start, end) {
|
17980 | var r = color((start = color_rgb(start)).r, (end = color_rgb(end)).r),
|
17981 | g = color(start.g, end.g),
|
17982 | b = color(start.b, end.b),
|
17983 | opacity = nogamma(start.opacity, end.opacity);
|
17984 | return function (t) {
|
17985 | return start.r = r(t), start.g = g(t), start.b = b(t), start.opacity = opacity(t), start + "";
|
17986 | };
|
17987 | }
|
17988 |
|
17989 | var color = gamma(y);
|
17990 | return rgb.gamma = rgbGamma, rgb;
|
17991 | })(1));
|
17992 |
|
17993 | function rgbSpline(spline) {
|
17994 | return function (colors) {
|
17995 | var i,
|
17996 | color,
|
17997 | n = colors.length,
|
17998 | r = Array(n),
|
17999 | g = Array(n),
|
18000 | b = Array(n);
|
18001 |
|
18002 | for (i = 0; i < n; ++i) color = color_rgb(colors[i]), r[i] = color.r || 0, g[i] = color.g || 0, b[i] = color.b || 0;
|
18003 |
|
18004 | return r = spline(r), g = spline(g), b = spline(b), color.opacity = 1, function (t) {
|
18005 | return color.r = r(t), color.g = g(t), color.b = b(t), color + "";
|
18006 | };
|
18007 | };
|
18008 | }
|
18009 |
|
18010 | var rgbBasis = rgbSpline(src_basis);
|
18011 | var rgbBasisClosed = rgbSpline(basisClosed);
|
18012 | ;
|
18013 | function numberArray(a, b) {
|
18014 | b || (b = []);
|
18015 | var i,
|
18016 | n = a ? Math.min(b.length, a.length) : 0,
|
18017 | c = b.slice();
|
18018 | return function (t) {
|
18019 | for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;
|
18020 |
|
18021 | return c;
|
18022 | };
|
18023 | }
|
18024 | function isNumberArray(x) {
|
18025 | return ArrayBuffer.isView(x) && !(x instanceof DataView);
|
18026 | }
|
18027 | ;
|
18028 |
|
18029 |
|
18030 | function src_array(a, b) {
|
18031 | return (isNumberArray(b) ? numberArray : genericArray)(a, b);
|
18032 | }
|
18033 | function genericArray(a, b) {
|
18034 | var i,
|
18035 | nb = b ? b.length : 0,
|
18036 | na = a ? Math.min(nb, a.length) : 0,
|
18037 | x = Array(na),
|
18038 | c = Array(nb);
|
18039 |
|
18040 | for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);
|
18041 |
|
18042 | for (; i < nb; ++i) c[i] = b[i];
|
18043 |
|
18044 | return function (t) {
|
18045 | for (i = 0; i < na; ++i) c[i] = x[i](t);
|
18046 |
|
18047 | return c;
|
18048 | };
|
18049 | }
|
18050 | ;
|
18051 | function date(a, b) {
|
18052 | var d = new Date();
|
18053 | return a = +a, b = +b, function (t) {
|
18054 | return d.setTime(a * (1 - t) + b * t), d;
|
18055 | };
|
18056 | }
|
18057 | ;
|
18058 | function number(a, b) {
|
18059 | return a = +a, b = +b, function (t) {
|
18060 | return a * (1 - t) + b * t;
|
18061 | };
|
18062 | }
|
18063 | ;
|
18064 |
|
18065 | function object(a, b) {
|
18066 | var k,
|
18067 | i = {},
|
18068 | c = {};
|
18069 |
|
18070 | for (k in (a === null || typeof a !== "object") && (a = {}), (b === null || typeof b !== "object") && (b = {}), b) k in a ? i[k] = value(a[k], b[k]) : c[k] = b[k];
|
18071 |
|
18072 | return function (t) {
|
18073 | for (k in i) c[k] = i[k](t);
|
18074 |
|
18075 | return c;
|
18076 | };
|
18077 | }
|
18078 | ;
|
18079 |
|
18080 | var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,
|
18081 | reB = new RegExp(reA.source, "g");
|
18082 |
|
18083 | function zero(b) {
|
18084 | return function () {
|
18085 | return b;
|
18086 | };
|
18087 | }
|
18088 |
|
18089 | function one(b) {
|
18090 | return function (t) {
|
18091 | return b(t) + "";
|
18092 | };
|
18093 | }
|
18094 |
|
18095 | function string(a, b) {
|
18096 | var
|
18097 | am,
|
18098 |
|
18099 | bm,
|
18100 |
|
18101 | bs,
|
18102 | bi = reA.lastIndex = reB.lastIndex = 0,
|
18103 |
|
18104 | i = -1,
|
18105 |
|
18106 | s = [],
|
18107 |
|
18108 | q = [];
|
18109 |
|
18110 |
|
18111 |
|
18112 | for (a += "", b += ""; (am = reA.exec(a)) && (bm = reB.exec(b));) (bs = bm.index) > bi && (bs = b.slice(bi, bs), s[i] ? s[i] += bs :
|
18113 | s[++i] = bs), (am = am[0]) === (bm = bm[0]) ? s[i] ? s[i] += bm :
|
18114 | s[++i] = bm : (s[++i] = null, q.push({
|
18115 | i: i,
|
18116 | x: number(am, bm)
|
18117 | })), bi = reB.lastIndex;
|
18118 |
|
18119 |
|
18120 |
|
18121 |
|
18122 | return bi < b.length && (bs = b.slice(bi), s[i] ? s[i] += bs :
|
18123 | s[++i] = bs), s.length < 2 ? q[0] ? one(q[0].x) : zero(b) : (b = q.length, function (t) {
|
18124 | for (var o, i = 0; i < b; ++i) s[(o = q[i]).i] = o.x(t);
|
18125 |
|
18126 | return s.join("");
|
18127 | });
|
18128 | }
|
18129 | ;
|
18130 |
|
18131 |
|
18132 |
|
18133 |
|
18134 |
|
18135 |
|
18136 |
|
18137 |
|
18138 |
|
18139 | function value(a, b) {
|
18140 | var c,
|
18141 | t = typeof b;
|
18142 | return b == null || t === "boolean" ? src_constant(b) : (t === "number" ? number : t === "string" ? (c = color_color(b)) ? (b = c, rgb) : string : b instanceof color_color ? rgb : b instanceof Date ? date : isNumberArray(b) ? numberArray : Array.isArray(b) ? genericArray : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object : number)(a, b);
|
18143 | }
|
18144 | ;
|
18145 | var
|
18146 | taskHead,
|
18147 | taskTail,
|
18148 | timer_frame = 0,
|
18149 |
|
18150 | timeout = 0,
|
18151 |
|
18152 | interval = 0,
|
18153 |
|
18154 | pokeDelay = 1e3,
|
18155 | clockLast = 0,
|
18156 | clockNow = 0,
|
18157 | clockSkew = 0,
|
18158 | clock = typeof performance === "object" && performance.now ? performance : Date,
|
18159 | setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function (f) {
|
18160 | setTimeout(f, 17);
|
18161 | };
|
18162 | function now() {
|
18163 | return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);
|
18164 | }
|
18165 |
|
18166 | function clearNow() {
|
18167 | clockNow = 0;
|
18168 | }
|
18169 |
|
18170 | function Timer() {
|
18171 | this._call = this._time = this._next = null;
|
18172 | }
|
18173 | Timer.prototype = timer.prototype = {
|
18174 | constructor: Timer,
|
18175 | restart: function restart(callback, delay, time) {
|
18176 | if (typeof callback !== "function") throw new TypeError("callback is not a function");
|
18177 | time = (time == null ? now() : +time) + (delay == null ? 0 : +delay), this._next || taskTail === this || (taskTail ? taskTail._next = this : taskHead = this, taskTail = this), this._call = callback, this._time = time, sleep();
|
18178 | },
|
18179 | stop: function stop() {
|
18180 | this._call && (this._call = null, this._time = Infinity, sleep());
|
18181 | }
|
18182 | };
|
18183 | function timer(callback, delay, time) {
|
18184 | var t = new Timer();
|
18185 | return t.restart(callback, delay, time), t;
|
18186 | }
|
18187 | function timerFlush() {
|
18188 | now(), ++timer_frame;
|
18189 |
|
18190 | for (
|
18191 | var e, t = taskHead; t;) (e = clockNow - t._time) >= 0 && t._call.call(null, e), t = t._next;
|
18192 |
|
18193 | --timer_frame;
|
18194 | }
|
18195 |
|
18196 | function wake() {
|
18197 | clockNow = (clockLast = clock.now()) + clockSkew, timer_frame = timeout = 0;
|
18198 |
|
18199 | try {
|
18200 | timerFlush();
|
18201 | } finally {
|
18202 | timer_frame = 0, nap(), clockNow = 0;
|
18203 | }
|
18204 | }
|
18205 |
|
18206 | function poke() {
|
18207 | var now = clock.now(),
|
18208 | delay = now - clockLast;
|
18209 | delay > pokeDelay && (clockSkew -= delay, clockLast = now);
|
18210 | }
|
18211 |
|
18212 | function nap() {
|
18213 | for (var t0, t2, t1 = taskHead, time = Infinity; t1;) t1._call ? (time > t1._time && (time = t1._time), t0 = t1, t1 = t1._next) : (t2 = t1._next, t1._next = null, t1 = t0 ? t0._next = t2 : taskHead = t2);
|
18214 |
|
18215 | taskTail = t0, sleep(time);
|
18216 | }
|
18217 |
|
18218 | function sleep(time) {
|
18219 | if (!timer_frame) {
|
18220 | timeout && (timeout = clearTimeout(timeout));
|
18221 | var delay = time - clockNow;
|
18222 |
|
18223 | delay > 24 ? (time < Infinity && (timeout = setTimeout(wake, time - clock.now() - clockSkew)), interval && (interval = clearInterval(interval))) : (!interval && (clockLast = clock.now(), interval = setInterval(poke, pokeDelay)), timer_frame = 1, setFrame(wake));
|
18224 | }
|
18225 |
|
18226 | }
|
18227 | ;
|
18228 |
|
18229 | function src_timeout(callback, delay, time) {
|
18230 | var t = new Timer();
|
18231 | return delay = delay == null ? 0 : +delay, t.restart(function (elapsed) {
|
18232 | t.stop(), callback(elapsed + delay);
|
18233 | }, delay, time), t;
|
18234 | }
|
18235 | ;
|
18236 |
|
18237 |
|
18238 | var emptyOn = src_dispatch("start", "end", "cancel", "interrupt"),
|
18239 | emptyTween = [];
|
18240 | var CREATED = 0;
|
18241 | var SCHEDULED = 1;
|
18242 | var STARTING = 2;
|
18243 | var STARTED = 3;
|
18244 | var RUNNING = 4;
|
18245 | var ENDING = 5;
|
18246 | var ENDED = 6;
|
18247 | function schedule(node, name, id, index, group, timing) {
|
18248 | var schedules = node.__transition;
|
18249 | if (!schedules) node.__transition = {};else if (id in schedules) return;
|
18250 | create(node, id, {
|
18251 | name: name,
|
18252 | index: index,
|
18253 |
|
18254 | group: group,
|
18255 |
|
18256 | on: emptyOn,
|
18257 | tween: emptyTween,
|
18258 | time: timing.time,
|
18259 | delay: timing.delay,
|
18260 | duration: timing.duration,
|
18261 | ease: timing.ease,
|
18262 | timer: null,
|
18263 | state: CREATED
|
18264 | });
|
18265 | }
|
18266 | function init(node, id) {
|
18267 | var schedule = schedule_get(node, id);
|
18268 | if (schedule.state > CREATED) throw new Error("too late; already scheduled");
|
18269 | return schedule;
|
18270 | }
|
18271 | function schedule_set(node, id) {
|
18272 | var schedule = schedule_get(node, id);
|
18273 | if (schedule.state > STARTED) throw new Error("too late; already running");
|
18274 | return schedule;
|
18275 | }
|
18276 | function schedule_get(node, id) {
|
18277 | var schedule = node.__transition;
|
18278 | if (!schedule || !(schedule = schedule[id])) throw new Error("transition not found");
|
18279 | return schedule;
|
18280 | }
|
18281 |
|
18282 | function create(node, id, self) {
|
18283 | function start(elapsed) {
|
18284 | var i, j, n, o;
|
18285 |
|
18286 | if (self.state !== SCHEDULED) return stop();
|
18287 |
|
18288 | for (i in schedules) if (o = schedules[i], o.name === self.name) {
|
18289 |
|
18290 |
|
18291 |
|
18292 | if (o.state === STARTED) return src_timeout(start);
|
18293 |
|
18294 | o.state === RUNNING ? (o.state = ENDED, o.timer.stop(), o.on.call("interrupt", node, node.__data__, o.index, o.group), delete schedules[i]) : +i < id && (o.state = ENDED, o.timer.stop(), o.on.call("cancel", node, node.__data__, o.index, o.group), delete schedules[i]);
|
18295 | }
|
18296 |
|
18297 |
|
18298 |
|
18299 |
|
18300 |
|
18301 | if (src_timeout(function () {
|
18302 | self.state === STARTED && (self.state = RUNNING, self.timer.restart(tick, self.delay, self.time), tick(elapsed));
|
18303 | }), self.state = STARTING, self.on.call("start", node, node.__data__, self.index, self.group), self.state === STARTING) {
|
18304 | for (self.state = STARTED, tween = Array(n = self.tween.length), (i = 0, j = -1); i < n; ++i) (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) && (tween[++j] = o);
|
18305 |
|
18306 | tween.length = j + 1;
|
18307 | }
|
18308 |
|
18309 | }
|
18310 |
|
18311 | function tick(elapsed) {
|
18312 | for (var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1), i = -1, n = tween.length; ++i < n;) tween[i].call(node, t);
|
18313 |
|
18314 |
|
18315 | self.state === ENDING && (self.on.call("end", node, node.__data__, self.index, self.group), stop());
|
18316 | }
|
18317 |
|
18318 | function stop() {
|
18319 | for (var i in self.state = ENDED, self.timer.stop(), delete schedules[id], schedules) return;
|
18320 |
|
18321 |
|
18322 | delete node.__transition;
|
18323 | }
|
18324 |
|
18325 | var tween,
|
18326 | schedules = node.__transition;
|
18327 |
|
18328 |
|
18329 | schedules[id] = self, self.timer = timer(function (elapsed) {
|
18330 | self.state = SCHEDULED, self.timer.restart(start, self.delay, self.time), self.delay <= elapsed && start(elapsed - self.delay);
|
18331 | }, 0, self.time);
|
18332 | }
|
18333 | ;
|
18334 |
|
18335 | function interrupt(node, name) {
|
18336 | var schedule,
|
18337 | active,
|
18338 | i,
|
18339 | schedules = node.__transition,
|
18340 | empty = !0;
|
18341 |
|
18342 | if (schedules) {
|
18343 | for (i in name = name == null ? null : name + "", schedules) {
|
18344 | if ((schedule = schedules[i]).name !== name) {
|
18345 | empty = !1;
|
18346 | continue;
|
18347 | }
|
18348 |
|
18349 | active = schedule.state > STARTING && schedule.state < ENDING, schedule.state = ENDED, schedule.timer.stop(), schedule.on.call(active ? "interrupt" : "cancel", node, node.__data__, schedule.index, schedule.group), delete schedules[i];
|
18350 | }
|
18351 |
|
18352 | empty && delete node.__transition;
|
18353 | }
|
18354 | }
|
18355 | ;
|
18356 |
|
18357 | function selection_interrupt(name) {
|
18358 | return this.each(function () {
|
18359 | interrupt(this, name);
|
18360 | });
|
18361 | }
|
18362 | ;
|
18363 | var degrees = 180 / Math.PI;
|
18364 | var identity = {
|
18365 | translateX: 0,
|
18366 | translateY: 0,
|
18367 | rotate: 0,
|
18368 | skewX: 0,
|
18369 | scaleX: 1,
|
18370 | scaleY: 1
|
18371 | };
|
18372 | function decompose(a, b, c, d, e, f) {
|
18373 | var scaleX, scaleY, skewX;
|
18374 | return (scaleX = Math.sqrt(a * a + b * b)) && (a /= scaleX, b /= scaleX), (skewX = a * c + b * d) && (c -= a * skewX, d -= b * skewX), (scaleY = Math.sqrt(c * c + d * d)) && (c /= scaleY, d /= scaleY, skewX /= scaleY), a * d < b * c && (a = -a, b = -b, skewX = -skewX, scaleX = -scaleX), {
|
18375 | translateX: e,
|
18376 | translateY: f,
|
18377 | rotate: Math.atan2(b, a) * degrees,
|
18378 | skewX: Math.atan(skewX) * degrees,
|
18379 | scaleX: scaleX,
|
18380 | scaleY: scaleY
|
18381 | };
|
18382 | }
|
18383 | ;
|
18384 |
|
18385 | var svgNode;
|
18386 |
|
18387 |
|
18388 | function parseCss(value) {
|
18389 | var m = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value + "");
|
18390 | return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f);
|
18391 | }
|
18392 | function parseSvg(value) {
|
18393 | return value == null ? identity : (svgNode || (svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g")), svgNode.setAttribute("transform", value), !(value = svgNode.transform.baseVal.consolidate())) ? identity : (value = value.matrix, decompose(value.a, value.b, value.c, value.d, value.e, value.f));
|
18394 | }
|
18395 | ;
|
18396 |
|
18397 |
|
18398 |
|
18399 | function interpolateTransform(parse, pxComma, pxParen, degParen) {
|
18400 | function pop(s) {
|
18401 | return s.length ? s.pop() + " " : "";
|
18402 | }
|
18403 |
|
18404 | function translate(xa, ya, xb, yb, s, q) {
|
18405 | if (xa !== xb || ya !== yb) {
|
18406 | var i = s.push("translate(", null, pxComma, null, pxParen);
|
18407 | q.push({
|
18408 | i: i - 4,
|
18409 | x: number(xa, xb)
|
18410 | }, {
|
18411 | i: i - 2,
|
18412 | x: number(ya, yb)
|
18413 | });
|
18414 | } else (xb || yb) && s.push("translate(" + xb + pxComma + yb + pxParen);
|
18415 | }
|
18416 |
|
18417 | function rotate(a, b, s, q) {
|
18418 | a === b ? b && s.push(pop(s) + "rotate(" + b + degParen) : (a - b > 180 ? b += 360 : b - a > 180 && (a += 360), q.push({
|
18419 | i: s.push(pop(s) + "rotate(", null, degParen) - 2,
|
18420 | x: number(a, b)
|
18421 | }));
|
18422 | }
|
18423 |
|
18424 | function skewX(a, b, s, q) {
|
18425 | a === b ? b && s.push(pop(s) + "skewX(" + b + degParen) : q.push({
|
18426 | i: s.push(pop(s) + "skewX(", null, degParen) - 2,
|
18427 | x: number(a, b)
|
18428 | });
|
18429 | }
|
18430 |
|
18431 | function scale(xa, ya, xb, yb, s, q) {
|
18432 | if (xa !== xb || ya !== yb) {
|
18433 | var i = s.push(pop(s) + "scale(", null, ",", null, ")");
|
18434 | q.push({
|
18435 | i: i - 4,
|
18436 | x: number(xa, xb)
|
18437 | }, {
|
18438 | i: i - 2,
|
18439 | x: number(ya, yb)
|
18440 | });
|
18441 | } else (xb !== 1 || yb !== 1) && s.push(pop(s) + "scale(" + xb + "," + yb + ")");
|
18442 | }
|
18443 |
|
18444 | return function (a, b) {
|
18445 | var s = [],
|
18446 |
|
18447 | q = [];
|
18448 |
|
18449 |
|
18450 | return a = parse(a), b = parse(b), translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q), rotate(a.rotate, b.rotate, s, q), skewX(a.skewX, b.skewX, s, q), scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q), a = b = null, function (t) {
|
18451 | for (var o, i = -1, n = q.length; ++i < n;) s[(o = q[i]).i] = o.x(t);
|
18452 |
|
18453 | return s.join("");
|
18454 | };
|
18455 | };
|
18456 | }
|
18457 |
|
18458 | var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)");
|
18459 | var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")");
|
18460 | ;
|
18461 |
|
18462 |
|
18463 | function tweenRemove(id, name) {
|
18464 | var tween0, tween1;
|
18465 | return function () {
|
18466 | var schedule = schedule_set(this, id),
|
18467 | tween = schedule.tween;
|
18468 |
|
18469 |
|
18470 |
|
18471 | if (tween !== tween0) {
|
18472 | tween1 = tween0 = tween;
|
18473 |
|
18474 | for (var i = 0, n = tween1.length; i < n; ++i) if (tween1[i].name === name) {
|
18475 | tween1 = tween1.slice(), tween1.splice(i, 1);
|
18476 | break;
|
18477 | }
|
18478 | }
|
18479 |
|
18480 | schedule.tween = tween1;
|
18481 | };
|
18482 | }
|
18483 |
|
18484 | function tweenFunction(id, name, value) {
|
18485 | var tween0, tween1;
|
18486 | if (typeof value !== "function") throw new Error();
|
18487 | return function () {
|
18488 | var schedule = schedule_set(this, id),
|
18489 | tween = schedule.tween;
|
18490 |
|
18491 |
|
18492 |
|
18493 | if (tween !== tween0) {
|
18494 | tween1 = (tween0 = tween).slice();
|
18495 |
|
18496 | for (var t = {
|
18497 | name: name,
|
18498 | value: value
|
18499 | }, i = 0, n = tween1.length; i < n; ++i) if (tween1[i].name === name) {
|
18500 | tween1[i] = t;
|
18501 | break;
|
18502 | }
|
18503 |
|
18504 | i === n && tween1.push(t);
|
18505 | }
|
18506 |
|
18507 | schedule.tween = tween1;
|
18508 | };
|
18509 | }
|
18510 |
|
18511 | function tween(name, value) {
|
18512 | var id = this._id;
|
18513 |
|
18514 | if (name += "", arguments.length < 2) {
|
18515 | for (var t, tween = schedule_get(this.node(), id).tween, i = 0, n = tween.length; i < n; ++i) if ((t = tween[i]).name === name) return t.value;
|
18516 |
|
18517 | return null;
|
18518 | }
|
18519 |
|
18520 | return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value));
|
18521 | }
|
18522 | function tweenValue(transition, name, value) {
|
18523 | var id = transition._id;
|
18524 | return transition.each(function () {
|
18525 | var schedule = schedule_set(this, id);
|
18526 | (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);
|
18527 | }), function (node) {
|
18528 | return schedule_get(node, id).value[name];
|
18529 | };
|
18530 | }
|
18531 | ;
|
18532 |
|
18533 |
|
18534 | function interpolate(a, b) {
|
18535 | var c;
|
18536 | return (typeof b === "number" ? number : b instanceof color_color ? rgb : (c = color_color(b)) ? (b = c, rgb) : string)(a, b);
|
18537 | }
|
18538 | ;
|
18539 |
|
18540 |
|
18541 |
|
18542 |
|
18543 |
|
18544 | function attr_attrRemove(name) {
|
18545 | return function () {
|
18546 | this.removeAttribute(name);
|
18547 | };
|
18548 | }
|
18549 |
|
18550 | function attr_attrRemoveNS(fullname) {
|
18551 | return function () {
|
18552 | this.removeAttributeNS(fullname.space, fullname.local);
|
18553 | };
|
18554 | }
|
18555 |
|
18556 | function attr_attrConstant(name, interpolate, value1) {
|
18557 | var string00, interpolate0;
|
18558 | return function () {
|
18559 | var string0 = this.getAttribute(name);
|
18560 | return string0 === value1 + "" ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1);
|
18561 | };
|
18562 | }
|
18563 |
|
18564 | function attr_attrConstantNS(fullname, interpolate, value1) {
|
18565 | var string00, interpolate0;
|
18566 | return function () {
|
18567 | var string0 = this.getAttributeNS(fullname.space, fullname.local);
|
18568 | return string0 === value1 + "" ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1);
|
18569 | };
|
18570 | }
|
18571 |
|
18572 | function attr_attrFunction(name, interpolate, value) {
|
18573 | var string00, string10, interpolate0;
|
18574 | return function () {
|
18575 | var string0,
|
18576 | string1,
|
18577 | value1 = value(this);
|
18578 | return value1 == null ? void this.removeAttribute(name) : (string0 = this.getAttribute(name), string1 = value1 + "", string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)));
|
18579 | };
|
18580 | }
|
18581 |
|
18582 | function attr_attrFunctionNS(fullname, interpolate, value) {
|
18583 | var string00, string10, interpolate0;
|
18584 | return function () {
|
18585 | var string0,
|
18586 | string1,
|
18587 | value1 = value(this);
|
18588 | return value1 == null ? void this.removeAttributeNS(fullname.space, fullname.local) : (string0 = this.getAttributeNS(fullname.space, fullname.local), string1 = value1 + "", string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)));
|
18589 | };
|
18590 | }
|
18591 |
|
18592 | function transition_attr(name, value) {
|
18593 | var fullname = namespace(name),
|
18594 | i = fullname === "transform" ? interpolateTransformSvg : interpolate;
|
18595 | return this.attrTween(name, typeof value === "function" ? (fullname.local ? attr_attrFunctionNS : attr_attrFunction)(fullname, i, tweenValue(this, "attr." + name, value)) : value == null ? (fullname.local ? attr_attrRemoveNS : attr_attrRemove)(fullname) : (fullname.local ? attr_attrConstantNS : attr_attrConstant)(fullname, i, value));
|
18596 | }
|
18597 | ;
|
18598 |
|
18599 |
|
18600 | function attrInterpolate(name, i) {
|
18601 | return function (t) {
|
18602 | this.setAttribute(name, i.call(this, t));
|
18603 | };
|
18604 | }
|
18605 |
|
18606 | function attrInterpolateNS(fullname, i) {
|
18607 | return function (t) {
|
18608 | this.setAttributeNS(fullname.space, fullname.local, i.call(this, t));
|
18609 | };
|
18610 | }
|
18611 |
|
18612 | function attrTweenNS(fullname, value) {
|
18613 | function tween() {
|
18614 | var i = value.apply(this, arguments);
|
18615 | return i !== i0 && (t0 = (i0 = i) && attrInterpolateNS(fullname, i)), t0;
|
18616 | }
|
18617 |
|
18618 | var t0, i0;
|
18619 | return tween._value = value, tween;
|
18620 | }
|
18621 |
|
18622 | function attrTween(name, value) {
|
18623 | function tween() {
|
18624 | var i = value.apply(this, arguments);
|
18625 | return i !== i0 && (t0 = (i0 = i) && attrInterpolate(name, i)), t0;
|
18626 | }
|
18627 |
|
18628 | var t0, i0;
|
18629 | return tween._value = value, tween;
|
18630 | }
|
18631 |
|
18632 | function transition_attrTween(name, value) {
|
18633 | var key = "attr." + name;
|
18634 | if (arguments.length < 2) return (key = this.tween(key)) && key._value;
|
18635 | if (value == null) return this.tween(key, null);
|
18636 | if (typeof value !== "function") throw new Error();
|
18637 | var fullname = namespace(name);
|
18638 | return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));
|
18639 | }
|
18640 | ;
|
18641 |
|
18642 |
|
18643 | function delayFunction(id, value) {
|
18644 | return function () {
|
18645 | init(this, id).delay = +value.apply(this, arguments);
|
18646 | };
|
18647 | }
|
18648 |
|
18649 | function delayConstant(id, value) {
|
18650 | return value = +value, function () {
|
18651 | init(this, id).delay = value;
|
18652 | };
|
18653 | }
|
18654 |
|
18655 | function delay(value) {
|
18656 | var id = this._id;
|
18657 | return arguments.length ? this.each((typeof value === "function" ? delayFunction : delayConstant)(id, value)) : schedule_get(this.node(), id).delay;
|
18658 | }
|
18659 | ;
|
18660 |
|
18661 |
|
18662 | function durationFunction(id, value) {
|
18663 | return function () {
|
18664 | schedule_set(this, id).duration = +value.apply(this, arguments);
|
18665 | };
|
18666 | }
|
18667 |
|
18668 | function durationConstant(id, value) {
|
18669 | return value = +value, function () {
|
18670 | schedule_set(this, id).duration = value;
|
18671 | };
|
18672 | }
|
18673 |
|
18674 | function duration(value) {
|
18675 | var id = this._id;
|
18676 | return arguments.length ? this.each((typeof value === "function" ? durationFunction : durationConstant)(id, value)) : schedule_get(this.node(), id).duration;
|
18677 | }
|
18678 | ;
|
18679 |
|
18680 |
|
18681 | function easeConstant(id, value) {
|
18682 | if (typeof value !== "function") throw new Error();
|
18683 | return function () {
|
18684 | schedule_set(this, id).ease = value;
|
18685 | };
|
18686 | }
|
18687 |
|
18688 | function ease(value) {
|
18689 | var id = this._id;
|
18690 | return arguments.length ? this.each(easeConstant(id, value)) : schedule_get(this.node(), id).ease;
|
18691 | }
|
18692 | ;
|
18693 |
|
18694 |
|
18695 | function easeVarying(id, value) {
|
18696 | return function () {
|
18697 | var v = value.apply(this, arguments);
|
18698 | if (typeof v !== "function") throw new Error();
|
18699 | schedule_set(this, id).ease = v;
|
18700 | };
|
18701 | }
|
18702 |
|
18703 | function transition_easeVarying(value) {
|
18704 | if (typeof value !== "function") throw new Error();
|
18705 | return this.each(easeVarying(this._id, value));
|
18706 | }
|
18707 | ;
|
18708 |
|
18709 |
|
18710 | function transition_filter(match) {
|
18711 | typeof match !== "function" && (match = matcher(match));
|
18712 |
|
18713 | for (var groups = this._groups, m = groups.length, subgroups = Array(m), j = 0; j < m; ++j) for (var node, group = groups[j], n = group.length, subgroup = subgroups[j] = [], i = 0; i < n; ++i) (node = group[i]) && match.call(node, node.__data__, i, group) && subgroup.push(node);
|
18714 |
|
18715 | return new Transition(subgroups, this._parents, this._name, this._id);
|
18716 | }
|
18717 | ;
|
18718 |
|
18719 | function transition_merge(transition) {
|
18720 | if (transition._id !== this._id) throw new Error();
|
18721 |
|
18722 | for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = Array(m0), j = 0; j < m; ++j) for (var node, group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = Array(n), i = 0; i < n; ++i) (node = group0[i] || group1[i]) && (merge[i] = node);
|
18723 |
|
18724 | for (; j < m0; ++j) merges[j] = groups0[j];
|
18725 |
|
18726 | return new Transition(merges, this._parents, this._name, this._id);
|
18727 | }
|
18728 | ;
|
18729 |
|
18730 |
|
18731 | function start(name) {
|
18732 | return (name + "").trim().split(/^|\s+/).every(function (t) {
|
18733 | var i = t.indexOf(".");
|
18734 | return i >= 0 && (t = t.slice(0, i)), !t || t === "start";
|
18735 | });
|
18736 | }
|
18737 |
|
18738 | function onFunction(id, name, listener) {
|
18739 | var on0,
|
18740 | on1,
|
18741 | sit = start(name) ? init : schedule_set;
|
18742 | return function () {
|
18743 | var schedule = sit(this, id),
|
18744 | on = schedule.on;
|
18745 |
|
18746 |
|
18747 |
|
18748 | on !== on0 && (on1 = (on0 = on).copy()).on(name, listener), schedule.on = on1;
|
18749 | };
|
18750 | }
|
18751 |
|
18752 | function transition_on(name, listener) {
|
18753 | var id = this._id;
|
18754 | return arguments.length < 2 ? schedule_get(this.node(), id).on.on(name) : this.each(onFunction(id, name, listener));
|
18755 | }
|
18756 | ;
|
18757 | function removeFunction(id) {
|
18758 | return function () {
|
18759 | var parent = this.parentNode;
|
18760 |
|
18761 | for (var i in this.__transition) if (+i !== id) return;
|
18762 |
|
18763 | parent && parent.removeChild(this);
|
18764 | };
|
18765 | }
|
18766 |
|
18767 | function transition_remove() {
|
18768 | return this.on("end.remove", removeFunction(this._id));
|
18769 | }
|
18770 | ;
|
18771 |
|
18772 |
|
18773 |
|
18774 | function transition_select(select) {
|
18775 | var name = this._name,
|
18776 | id = this._id;
|
18777 | typeof select !== "function" && (select = selector(select));
|
18778 |
|
18779 | for (var groups = this._groups, m = groups.length, subgroups = Array(m), j = 0; j < m; ++j) for (var node, subnode, group = groups[j], n = group.length, subgroup = subgroups[j] = Array(n), i = 0; i < n; ++i) (node = group[i]) && (subnode = select.call(node, node.__data__, i, group)) && ("__data__" in node && (subnode.__data__ = node.__data__), subgroup[i] = subnode, schedule(subgroup[i], name, id, i, subgroup, schedule_get(node, id)));
|
18780 |
|
18781 | return new Transition(subgroups, this._parents, name, id);
|
18782 | }
|
18783 | ;
|
18784 |
|
18785 |
|
18786 |
|
18787 | function transition_selectAll(select) {
|
18788 | var name = this._name,
|
18789 | id = this._id;
|
18790 | typeof select !== "function" && (select = selectorAll(select));
|
18791 |
|
18792 | for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) for (var node, group = groups[j], n = group.length, i = 0; i < n; ++i) if (node = group[i]) {
|
18793 | for (var child, children = select.call(node, node.__data__, i, group), inherit = schedule_get(node, id), k = 0, l = children.length; k < l; ++k) (child = children[k]) && schedule(child, name, id, k, children, inherit);
|
18794 |
|
18795 | subgroups.push(children), parents.push(node);
|
18796 | }
|
18797 |
|
18798 | return new Transition(subgroups, parents, name, id);
|
18799 | }
|
18800 | ;
|
18801 |
|
18802 | var selection_Selection = src_selection.prototype.constructor;
|
18803 | function transition_selection() {
|
18804 | return new selection_Selection(this._groups, this._parents);
|
18805 | }
|
18806 | ;
|
18807 |
|
18808 |
|
18809 |
|
18810 |
|
18811 |
|
18812 |
|
18813 | function styleNull(name, interpolate) {
|
18814 | var string00, string10, interpolate0;
|
18815 | return function () {
|
18816 | var string0 = styleValue(this, name),
|
18817 | string1 = (this.style.removeProperty(name), styleValue(this, name));
|
18818 | return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : interpolate0 = interpolate(string00 = string0, string10 = string1);
|
18819 | };
|
18820 | }
|
18821 |
|
18822 | function style_styleRemove(name) {
|
18823 | return function () {
|
18824 | this.style.removeProperty(name);
|
18825 | };
|
18826 | }
|
18827 |
|
18828 | function style_styleConstant(name, interpolate, value1) {
|
18829 | var string00, interpolate0;
|
18830 | return function () {
|
18831 | var string0 = styleValue(this, name);
|
18832 | return string0 === value1 + "" ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1);
|
18833 | };
|
18834 | }
|
18835 |
|
18836 | function style_styleFunction(name, interpolate, value) {
|
18837 | var string00, string10, interpolate0;
|
18838 | return function () {
|
18839 | var string0 = styleValue(this, name),
|
18840 | value1 = value(this),
|
18841 | string1 = value1 + "";
|
18842 | return value1 == null && (string1 = value1 = (this.style.removeProperty(name), styleValue(this, name))), string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
|
18843 | };
|
18844 | }
|
18845 |
|
18846 | function styleMaybeRemove(id, name) {
|
18847 | var on0,
|
18848 | on1,
|
18849 | listener0,
|
18850 | remove,
|
18851 | key = "style." + name;
|
18852 | return function () {
|
18853 | var schedule = schedule_set(this, id),
|
18854 | on = schedule.on,
|
18855 | listener = schedule.value[key] == null ? remove || (remove = style_styleRemove(name)) : undefined;
|
18856 |
|
18857 |
|
18858 |
|
18859 | (on !== on0 || listener0 !== listener) && (on1 = (on0 = on).copy()).on("end." + key, listener0 = listener), schedule.on = on1;
|
18860 | };
|
18861 | }
|
18862 |
|
18863 | function transition_style(name, value, priority) {
|
18864 | var i = (name += "") === "transform" ? interpolateTransformCss : interpolate;
|
18865 | return value == null ? this.styleTween(name, styleNull(name, i)).on("end.style." + name, style_styleRemove(name)) : typeof value === "function" ? this.styleTween(name, style_styleFunction(name, i, tweenValue(this, "style." + name, value))).each(styleMaybeRemove(this._id, name)) : this.styleTween(name, style_styleConstant(name, i, value), priority).on("end.style." + name, null);
|
18866 | }
|
18867 | ;
|
18868 | function styleInterpolate(name, i, priority) {
|
18869 | return function (t) {
|
18870 | this.style.setProperty(name, i.call(this, t), priority);
|
18871 | };
|
18872 | }
|
18873 |
|
18874 | function styleTween(name, value, priority) {
|
18875 | function tween() {
|
18876 | var i = value.apply(this, arguments);
|
18877 | return i !== i0 && (t = (i0 = i) && styleInterpolate(name, i, priority)), t;
|
18878 | }
|
18879 |
|
18880 | var t, i0;
|
18881 | return tween._value = value, tween;
|
18882 | }
|
18883 |
|
18884 | function transition_styleTween(name, value, priority) {
|
18885 | var key = "style." + (name += "");
|
18886 | if (arguments.length < 2) return (key = this.tween(key)) && key._value;
|
18887 | if (value == null) return this.tween(key, null);
|
18888 | if (typeof value !== "function") throw new Error();
|
18889 | return this.tween(key, styleTween(name, value, priority == null ? "" : priority));
|
18890 | }
|
18891 | ;
|
18892 |
|
18893 |
|
18894 | function text_textConstant(value) {
|
18895 | return function () {
|
18896 | this.textContent = value;
|
18897 | };
|
18898 | }
|
18899 |
|
18900 | function text_textFunction(value) {
|
18901 | return function () {
|
18902 | var value1 = value(this);
|
18903 | this.textContent = value1 == null ? "" : value1;
|
18904 | };
|
18905 | }
|
18906 |
|
18907 | function transition_text(value) {
|
18908 | return this.tween("text", typeof value === "function" ? text_textFunction(tweenValue(this, "text", value)) : text_textConstant(value == null ? "" : value + ""));
|
18909 | }
|
18910 | ;
|
18911 | function textInterpolate(i) {
|
18912 | return function (t) {
|
18913 | this.textContent = i.call(this, t);
|
18914 | };
|
18915 | }
|
18916 |
|
18917 | function textTween(value) {
|
18918 | function tween() {
|
18919 | var i = value.apply(this, arguments);
|
18920 | return i !== i0 && (t0 = (i0 = i) && textInterpolate(i)), t0;
|
18921 | }
|
18922 |
|
18923 | var t0, i0;
|
18924 | return tween._value = value, tween;
|
18925 | }
|
18926 |
|
18927 | function transition_textTween(value) {
|
18928 | var key = "text";
|
18929 | if (arguments.length < 1) return (key = this.tween(key)) && key._value;
|
18930 | if (value == null) return this.tween(key, null);
|
18931 | if (typeof value !== "function") throw new Error();
|
18932 | return this.tween(key, textTween(value));
|
18933 | }
|
18934 | ;
|
18935 |
|
18936 |
|
18937 | function transition() {
|
18938 | for (var name = this._name, id0 = this._id, id1 = newId(), groups = this._groups, m = groups.length, j = 0; j < m; ++j) for (var node, group = groups[j], n = group.length, i = 0; i < n; ++i) if (node = group[i]) {
|
18939 | var inherit = schedule_get(node, id0);
|
18940 | schedule(node, name, id1, i, group, {
|
18941 | time: inherit.time + inherit.delay + inherit.duration,
|
18942 | delay: 0,
|
18943 | duration: inherit.duration,
|
18944 | ease: inherit.ease
|
18945 | });
|
18946 | }
|
18947 |
|
18948 | return new Transition(groups, this._parents, name, id1);
|
18949 | }
|
18950 | ;
|
18951 |
|
18952 | function end() {
|
18953 | var on0,
|
18954 | on1,
|
18955 | that = this,
|
18956 | id = that._id,
|
18957 | size = that.size();
|
18958 | return new Promise(function (resolve, reject) {
|
18959 | var cancel = {
|
18960 | value: reject
|
18961 | },
|
18962 | end = {
|
18963 | value: function value() {
|
18964 | --size === 0 && resolve();
|
18965 | }
|
18966 | };
|
18967 | that.each(function () {
|
18968 | var schedule = schedule_set(this, id),
|
18969 | on = schedule.on;
|
18970 |
|
18971 |
|
18972 |
|
18973 | on !== on0 && (on1 = (on0 = on).copy(), on1._.cancel.push(cancel), on1._.interrupt.push(cancel), on1._.end.push(end)), schedule.on = on1;
|
18974 | }), size === 0 && resolve();
|
18975 | });
|
18976 | }
|
18977 | ;
|
18978 | var _transition$prototype;
|
18979 |
|
18980 |
|
18981 |
|
18982 |
|
18983 |
|
18984 |
|
18985 |
|
18986 |
|
18987 |
|
18988 |
|
18989 |
|
18990 |
|
18991 |
|
18992 |
|
18993 |
|
18994 |
|
18995 |
|
18996 |
|
18997 |
|
18998 |
|
18999 |
|
19000 |
|
19001 | var id = 0;
|
19002 | function Transition(groups, parents, name, id) {
|
19003 | this._groups = groups, this._parents = parents, this._name = name, this._id = id;
|
19004 | }
|
19005 | function transition_transition(name) {
|
19006 | return src_selection().transition(name);
|
19007 | }
|
19008 | function newId() {
|
19009 | return ++id;
|
19010 | }
|
19011 | var selection_prototype = src_selection.prototype;
|
19012 | Transition.prototype = transition_transition.prototype = (_transition$prototype = {
|
19013 | constructor: Transition,
|
19014 | select: transition_select,
|
19015 | selectAll: transition_selectAll,
|
19016 | filter: transition_filter,
|
19017 | merge: transition_merge,
|
19018 | selection: transition_selection,
|
19019 | transition: transition,
|
19020 | call: selection_prototype.call,
|
19021 | nodes: selection_prototype.nodes,
|
19022 | node: selection_prototype.node,
|
19023 | size: selection_prototype.size,
|
19024 | empty: selection_prototype.empty,
|
19025 | each: selection_prototype.each,
|
19026 | on: transition_on,
|
19027 | attr: transition_attr,
|
19028 | attrTween: transition_attrTween,
|
19029 | style: transition_style,
|
19030 | styleTween: transition_styleTween,
|
19031 | text: transition_text,
|
19032 | textTween: transition_textTween,
|
19033 | remove: transition_remove,
|
19034 | tween: tween,
|
19035 | delay: delay,
|
19036 | duration: duration,
|
19037 | ease: ease,
|
19038 | easeVarying: transition_easeVarying,
|
19039 | end: end
|
19040 | }, _transition$prototype[Symbol.iterator] = selection_prototype[Symbol.iterator], _transition$prototype);
|
19041 | ;// CONCATENATED MODULE: ./node_modules/d3-ease/src/cubic.js
|
19042 | function cubicIn(t) {
|
19043 | return t * t * t;
|
19044 | }
|
19045 | function cubicOut(t) {
|
19046 | return --t * t * t + 1;
|
19047 | }
|
19048 | function cubicInOut(t) {
|
19049 | return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
|
19050 | }
|
19051 | ;
|
19052 |
|
19053 |
|
19054 |
|
19055 |
|
19056 | var defaultTiming = {
|
19057 | time: null,
|
19058 |
|
19059 | delay: 0,
|
19060 | duration: 250,
|
19061 | ease: cubicInOut
|
19062 | };
|
19063 |
|
19064 | function inherit(node, id) {
|
19065 | for (var timing; !(timing = node.__transition) || !(timing = timing[id]);) if (!(node = node.parentNode)) throw new Error("transition " + id + " not found");
|
19066 |
|
19067 | return timing;
|
19068 | }
|
19069 |
|
19070 | function selection_transition(name) {
|
19071 | var id, timing;
|
19072 | name instanceof Transition ? (id = name._id, name = name._name) : (id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + "");
|
19073 |
|
19074 | for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) for (var node, group = groups[j], n = group.length, i = 0; i < n; ++i) (node = group[i]) && schedule(node, name, id, i, group, timing || inherit(node, id));
|
19075 |
|
19076 | return new Transition(groups, this._parents, name, id);
|
19077 | }
|
19078 | ;
|
19079 |
|
19080 |
|
19081 |
|
19082 | src_selection.prototype.interrupt = selection_interrupt, src_selection.prototype.transition = selection_transition;
|
19083 | ;
|
19084 |
|
19085 |
|
19086 | var active_root = [null];
|
19087 | function active(node, name) {
|
19088 | var schedule,
|
19089 | i,
|
19090 | schedules = node.__transition;
|
19091 | if (schedules) for (i in name = name == null ? null : name + "", schedules) if ((schedule = schedules[i]).state > SCHEDULED && schedule.name === name) return new Transition([[node]], active_root, name, +i);
|
19092 | return null;
|
19093 | }
|
19094 | ;
|
19095 |
|
19096 |
|
19097 |
|
19098 |
|
19099 | ;
|
19100 | var d3_brush_src_constant = (function (x) {
|
19101 | return function () {
|
19102 | return x;
|
19103 | };
|
19104 | });
|
19105 | ;
|
19106 | function BrushEvent(type, _ref) {
|
19107 | var sourceEvent = _ref.sourceEvent,
|
19108 | target = _ref.target,
|
19109 | selection = _ref.selection,
|
19110 | mode = _ref.mode,
|
19111 | dispatch = _ref.dispatch;
|
19112 | Object.defineProperties(this, {
|
19113 | type: {
|
19114 | value: type,
|
19115 | enumerable: !0,
|
19116 | configurable: !0
|
19117 | },
|
19118 | sourceEvent: {
|
19119 | value: sourceEvent,
|
19120 | enumerable: !0,
|
19121 | configurable: !0
|
19122 | },
|
19123 | target: {
|
19124 | value: target,
|
19125 | enumerable: !0,
|
19126 | configurable: !0
|
19127 | },
|
19128 | selection: {
|
19129 | value: selection,
|
19130 | enumerable: !0,
|
19131 | configurable: !0
|
19132 | },
|
19133 | mode: {
|
19134 | value: mode,
|
19135 | enumerable: !0,
|
19136 | configurable: !0
|
19137 | },
|
19138 | _: {
|
19139 | value: dispatch
|
19140 | }
|
19141 | });
|
19142 | }
|
19143 | ;
|
19144 | function noevent_nopropagation(event) {
|
19145 | event.stopImmediatePropagation();
|
19146 | }
|
19147 | function src_noevent(event) {
|
19148 | event.preventDefault(), event.stopImmediatePropagation();
|
19149 | }
|
19150 | ;
|
19151 | function brush_createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = brush_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { it && (o = it); var i = 0; return function () { return i >= o.length ? { done: !0 } : { done: !1, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } return it = o[Symbol.iterator](), it.next.bind(it); }
|
19152 |
|
19153 | function brush_unsupportedIterableToArray(o, minLen) { if (o) { if (typeof o === "string") return brush_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); return n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set" ? Array.from(o) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? brush_arrayLikeToArray(o, minLen) : void 0; } }
|
19154 |
|
19155 | function brush_arrayLikeToArray(arr, len) { (len == null || len > arr.length) && (len = arr.length); for (var i = 0, arr2 = Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
19156 |
|
19157 |
|
19158 |
|
19159 |
|
19160 |
|
19161 |
|
19162 |
|
19163 |
|
19164 |
|
19165 | var MODE_DRAG = {
|
19166 | name: "drag"
|
19167 | },
|
19168 | MODE_SPACE = {
|
19169 | name: "space"
|
19170 | },
|
19171 | MODE_HANDLE = {
|
19172 | name: "handle"
|
19173 | },
|
19174 | MODE_CENTER = {
|
19175 | name: "center"
|
19176 | },
|
19177 | abs = Math.abs,
|
19178 | max = Math.max,
|
19179 | min = Math.min;
|
19180 |
|
19181 | function number1(e) {
|
19182 | return [+e[0], +e[1]];
|
19183 | }
|
19184 |
|
19185 | function number2(e) {
|
19186 | return [number1(e[0]), number1(e[1])];
|
19187 | }
|
19188 |
|
19189 | var X = {
|
19190 | name: "x",
|
19191 | handles: ["w", "e"].map(type),
|
19192 | input: function input(x, e) {
|
19193 | return x == null ? null : [[+x[0], e[0][1]], [+x[1], e[1][1]]];
|
19194 | },
|
19195 | output: function output(xy) {
|
19196 | return xy && [xy[0][0], xy[1][0]];
|
19197 | }
|
19198 | },
|
19199 | Y = {
|
19200 | name: "y",
|
19201 | handles: ["n", "s"].map(type),
|
19202 | input: function input(y, e) {
|
19203 | return y == null ? null : [[e[0][0], +y[0]], [e[1][0], +y[1]]];
|
19204 | },
|
19205 | output: function output(xy) {
|
19206 | return xy && [xy[0][1], xy[1][1]];
|
19207 | }
|
19208 | },
|
19209 | XY = {
|
19210 | name: "xy",
|
19211 | handles: ["n", "w", "e", "s", "nw", "ne", "sw", "se"].map(type),
|
19212 | input: function input(xy) {
|
19213 | return xy == null ? null : number2(xy);
|
19214 | },
|
19215 | output: function output(xy) {
|
19216 | return xy;
|
19217 | }
|
19218 | },
|
19219 | cursors = {
|
19220 | overlay: "crosshair",
|
19221 | selection: "move",
|
19222 | n: "ns-resize",
|
19223 | e: "ew-resize",
|
19224 | s: "ns-resize",
|
19225 | w: "ew-resize",
|
19226 | nw: "nwse-resize",
|
19227 | ne: "nesw-resize",
|
19228 | se: "nwse-resize",
|
19229 | sw: "nesw-resize"
|
19230 | },
|
19231 | flipX = {
|
19232 | e: "w",
|
19233 | w: "e",
|
19234 | nw: "ne",
|
19235 | ne: "nw",
|
19236 | se: "sw",
|
19237 | sw: "se"
|
19238 | },
|
19239 | flipY = {
|
19240 | n: "s",
|
19241 | s: "n",
|
19242 | nw: "sw",
|
19243 | ne: "se",
|
19244 | se: "ne",
|
19245 | sw: "nw"
|
19246 | },
|
19247 | signsX = {
|
19248 | overlay: 1,
|
19249 | selection: 1,
|
19250 | n: null,
|
19251 | e: 1,
|
19252 | s: null,
|
19253 | w: -1,
|
19254 | nw: -1,
|
19255 | ne: 1,
|
19256 | se: 1,
|
19257 | sw: -1
|
19258 | },
|
19259 | signsY = {
|
19260 | overlay: 1,
|
19261 | selection: 1,
|
19262 | n: -1,
|
19263 | e: null,
|
19264 | s: 1,
|
19265 | w: null,
|
19266 | nw: -1,
|
19267 | ne: -1,
|
19268 | se: 1,
|
19269 | sw: 1
|
19270 | };
|
19271 |
|
19272 | function type(t) {
|
19273 | return {
|
19274 | type: t
|
19275 | };
|
19276 | }
|
19277 |
|
19278 |
|
19279 | function defaultFilter(event) {
|
19280 | return !event.ctrlKey && !event.button;
|
19281 | }
|
19282 |
|
19283 | function defaultExtent() {
|
19284 | var svg = this.ownerSVGElement || this;
|
19285 | return svg.hasAttribute("viewBox") ? (svg = svg.viewBox.baseVal, [[svg.x, svg.y], [svg.x + svg.width, svg.y + svg.height]]) : [[0, 0], [svg.width.baseVal.value, svg.height.baseVal.value]];
|
19286 | }
|
19287 |
|
19288 | function defaultTouchable() {
|
19289 | return navigator.maxTouchPoints || "ontouchstart" in this;
|
19290 | }
|
19291 |
|
19292 |
|
19293 | function local(node) {
|
19294 | for (; !node.__brush;) if (!(node = node.parentNode)) return;
|
19295 |
|
19296 | return node.__brush;
|
19297 | }
|
19298 |
|
19299 | function brush_empty(extent) {
|
19300 | return extent[0][0] === extent[1][0] || extent[0][1] === extent[1][1];
|
19301 | }
|
19302 |
|
19303 | function brushSelection(node) {
|
19304 | var state = node.__brush;
|
19305 | return state ? state.dim.output(state.selection) : null;
|
19306 | }
|
19307 | function brushX() {
|
19308 | return brush_brush(X);
|
19309 | }
|
19310 | function brushY() {
|
19311 | return brush_brush(Y);
|
19312 | }
|
19313 | function brush() {
|
19314 | return brush_brush(XY);
|
19315 | }
|
19316 |
|
19317 | function brush_brush(dim) {
|
19318 | function brush(group) {
|
19319 | var overlay = group.property("__brush", initialize).selectAll(".overlay").data([type("overlay")]);
|
19320 | overlay.enter().append("rect").attr("class", "overlay").attr("pointer-events", "all").attr("cursor", cursors.overlay).merge(overlay).each(function () {
|
19321 | var extent = local(this).extent;
|
19322 | src_select(this).attr("x", extent[0][0]).attr("y", extent[0][1]).attr("width", extent[1][0] - extent[0][0]).attr("height", extent[1][1] - extent[0][1]);
|
19323 | }), group.selectAll(".selection").data([type("selection")]).enter().append("rect").attr("class", "selection").attr("cursor", cursors.selection).attr("fill", "#777").attr("fill-opacity", .3).attr("stroke", "#fff").attr("shape-rendering", "crispEdges");
|
19324 | var handle = group.selectAll(".handle").data(dim.handles, function (d) {
|
19325 | return d.type;
|
19326 | });
|
19327 | handle.exit().remove(), handle.enter().append("rect").attr("class", function (d) {
|
19328 | return "handle handle--" + d.type;
|
19329 | }).attr("cursor", function (d) {
|
19330 | return cursors[d.type];
|
19331 | }), group.each(redraw).attr("fill", "none").attr("pointer-events", "all").on("mousedown.brush", started).filter(touchable).on("touchstart.brush", started).on("touchmove.brush", touchmoved).on("touchend.brush touchcancel.brush", touchended).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
19332 | }
|
19333 |
|
19334 | function redraw() {
|
19335 | var group = src_select(this),
|
19336 | selection = local(this).selection;
|
19337 | selection ? (group.selectAll(".selection").style("display", null).attr("x", selection[0][0]).attr("y", selection[0][1]).attr("width", selection[1][0] - selection[0][0]).attr("height", selection[1][1] - selection[0][1]), group.selectAll(".handle").style("display", null).attr("x", function (d) {
|
19338 | return d.type[d.type.length - 1] === "e" ? selection[1][0] - handleSize / 2 : selection[0][0] - handleSize / 2;
|
19339 | }).attr("y", function (d) {
|
19340 | return d.type[0] === "s" ? selection[1][1] - handleSize / 2 : selection[0][1] - handleSize / 2;
|
19341 | }).attr("width", function (d) {
|
19342 | return d.type === "n" || d.type === "s" ? selection[1][0] - selection[0][0] + handleSize : handleSize;
|
19343 | }).attr("height", function (d) {
|
19344 | return d.type === "e" || d.type === "w" ? selection[1][1] - selection[0][1] + handleSize : handleSize;
|
19345 | })) : group.selectAll(".selection,.handle").style("display", "none").attr("x", null).attr("y", null).attr("width", null).attr("height", null);
|
19346 | }
|
19347 |
|
19348 | function emitter(that, args, clean) {
|
19349 | var emit = that.__brush.emitter;
|
19350 | return !emit || clean && emit.clean ? new Emitter(that, args, clean) : emit;
|
19351 | }
|
19352 |
|
19353 | function Emitter(that, args, clean) {
|
19354 | this.that = that, this.args = args, this.state = that.__brush, this.active = 0, this.clean = clean;
|
19355 | }
|
19356 |
|
19357 | function started(event) {
|
19358 | function moved(event) {
|
19359 | for (var _step, p, _iterator = brush_createForOfIteratorHelperLoose(event.changedTouches || [event]); !(_step = _iterator()).done;) {
|
19360 | p = _step.value;
|
19361 |
|
19362 | for (var _step3, d, _iterator3 = brush_createForOfIteratorHelperLoose(points); !(_step3 = _iterator3()).done;) d = _step3.value, d.identifier === p.identifier && (d.cur = src_pointer(p, that));
|
19363 | }
|
19364 |
|
19365 | if (shifting && !lockX && !lockY && points.length === 1) {
|
19366 | var point = points[0];
|
19367 | abs(point.cur[0] - point[0]) > abs(point.cur[1] - point[1]) ? lockY = !0 : lockX = !0;
|
19368 | }
|
19369 |
|
19370 | for (var _step2, _point, _iterator2 = brush_createForOfIteratorHelperLoose(points); !(_step2 = _iterator2()).done;) _point = _step2.value, _point.cur && (_point[0] = _point.cur[0], _point[1] = _point.cur[1]);
|
19371 |
|
19372 | moving = !0, src_noevent(event), move(event);
|
19373 | }
|
19374 |
|
19375 | function move(event) {
|
19376 | var t,
|
19377 | point = points[0],
|
19378 | point0 = point.point0;
|
19379 |
|
19380 | switch (dx = point[0] - point0[0], dy = point[1] - point0[1], mode) {
|
19381 | case MODE_SPACE:
|
19382 | case MODE_DRAG:
|
19383 | {
|
19384 | signX && (dx = max(W - w0, min(E - e0, dx)), w1 = w0 + dx, e1 = e0 + dx), signY && (dy = max(N - n0, min(S - s0, dy)), n1 = n0 + dy, s1 = s0 + dy);
|
19385 | break;
|
19386 | }
|
19387 |
|
19388 | case MODE_HANDLE:
|
19389 | {
|
19390 | points[1] ? (signX && (w1 = max(W, min(E, points[0][0])), e1 = max(W, min(E, points[1][0])), signX = 1), signY && (n1 = max(N, min(S, points[0][1])), s1 = max(N, min(S, points[1][1])), signY = 1)) : (signX < 0 ? (dx = max(W - w0, min(E - w0, dx)), w1 = w0 + dx, e1 = e0) : signX > 0 && (dx = max(W - e0, min(E - e0, dx)), w1 = w0, e1 = e0 + dx), signY < 0 ? (dy = max(N - n0, min(S - n0, dy)), n1 = n0 + dy, s1 = s0) : signY > 0 && (dy = max(N - s0, min(S - s0, dy)), n1 = n0, s1 = s0 + dy));
|
19391 | break;
|
19392 | }
|
19393 |
|
19394 | case MODE_CENTER:
|
19395 | {
|
19396 | signX && (w1 = max(W, min(E, w0 - dx * signX)), e1 = max(W, min(E, e0 + dx * signX))), signY && (n1 = max(N, min(S, n0 - dy * signY)), s1 = max(N, min(S, s0 + dy * signY)));
|
19397 | break;
|
19398 | }
|
19399 | }
|
19400 |
|
19401 | e1 < w1 && (signX *= -1, t = w0, w0 = e0, e0 = t, t = w1, w1 = e1, e1 = t, type in flipX && overlay.attr("cursor", cursors[type = flipX[type]])), s1 < n1 && (signY *= -1, t = n0, n0 = s0, s0 = t, t = n1, n1 = s1, s1 = t, type in flipY && overlay.attr("cursor", cursors[type = flipY[type]])), state.selection && (selection = state.selection), lockX && (w1 = selection[0][0], e1 = selection[1][0]), lockY && (n1 = selection[0][1], s1 = selection[1][1]), (selection[0][0] !== w1 || selection[0][1] !== n1 || selection[1][0] !== e1 || selection[1][1] !== s1) && (state.selection = [[w1, n1], [e1, s1]], redraw.call(that), emit.brush(event, mode.name));
|
19402 | }
|
19403 |
|
19404 | function ended(event) {
|
19405 | if (noevent_nopropagation(event), event.touches) {
|
19406 | if (event.touches.length) return;
|
19407 | touchending && clearTimeout(touchending), touchending = setTimeout(function () {
|
19408 | touchending = null;
|
19409 | }, 500);
|
19410 | } else yesdrag(event.view, moving), view.on("keydown.brush keyup.brush mousemove.brush mouseup.brush", null);
|
19411 |
|
19412 | group.attr("pointer-events", "all"), overlay.attr("cursor", cursors.overlay), state.selection && (selection = state.selection), brush_empty(selection) && (state.selection = null, redraw.call(that)), emit.end(event, mode.name);
|
19413 | }
|
19414 |
|
19415 | function keydowned(event) {
|
19416 | switch (event.keyCode) {
|
19417 | case 16:
|
19418 | {
|
19419 | shifting = signX && signY;
|
19420 | break;
|
19421 | }
|
19422 |
|
19423 | case 18:
|
19424 | {
|
19425 | mode === MODE_HANDLE && (signX && (e0 = e1 - dx * signX, w0 = w1 + dx * signX), signY && (s0 = s1 - dy * signY, n0 = n1 + dy * signY), mode = MODE_CENTER, move());
|
19426 | break;
|
19427 | }
|
19428 |
|
19429 | case 32:
|
19430 | {
|
19431 | (mode === MODE_HANDLE || mode === MODE_CENTER) && (signX < 0 ? e0 = e1 - dx : signX > 0 && (w0 = w1 - dx), signY < 0 ? s0 = s1 - dy : signY > 0 && (n0 = n1 - dy), mode = MODE_SPACE, overlay.attr("cursor", cursors.selection), move());
|
19432 | break;
|
19433 | }
|
19434 |
|
19435 | default:
|
19436 | return;
|
19437 | }
|
19438 |
|
19439 | src_noevent(event);
|
19440 | }
|
19441 |
|
19442 | function keyupped(event) {
|
19443 | switch (event.keyCode) {
|
19444 | case 16:
|
19445 | {
|
19446 | shifting && (lockX = lockY = shifting = !1, move());
|
19447 | break;
|
19448 | }
|
19449 |
|
19450 | case 18:
|
19451 | {
|
19452 | mode === MODE_CENTER && (signX < 0 ? e0 = e1 : signX > 0 && (w0 = w1), signY < 0 ? s0 = s1 : signY > 0 && (n0 = n1), mode = MODE_HANDLE, move());
|
19453 | break;
|
19454 | }
|
19455 |
|
19456 | case 32:
|
19457 | {
|
19458 | mode === MODE_SPACE && (event.altKey ? (signX && (e0 = e1 - dx * signX, w0 = w1 + dx * signX), signY && (s0 = s1 - dy * signY, n0 = n1 + dy * signY), mode = MODE_CENTER) : (signX < 0 ? e0 = e1 : signX > 0 && (w0 = w1), signY < 0 ? s0 = s1 : signY > 0 && (n0 = n1), mode = MODE_HANDLE), overlay.attr("cursor", cursors[type]), move());
|
19459 | break;
|
19460 | }
|
19461 |
|
19462 | default:
|
19463 | return;
|
19464 | }
|
19465 |
|
19466 | src_noevent(event);
|
19467 | }
|
19468 |
|
19469 | if ((!touchending || event.touches) && filter.apply(this, arguments)) {
|
19470 | var w0,
|
19471 | w1,
|
19472 | n0,
|
19473 | n1,
|
19474 | e0,
|
19475 | e1,
|
19476 | s0,
|
19477 | s1,
|
19478 | moving,
|
19479 | lockX,
|
19480 | lockY,
|
19481 | that = this,
|
19482 | type = event.target.__data__.type,
|
19483 | mode = (keys && event.metaKey ? type = "overlay" : type) === "selection" ? MODE_DRAG : keys && event.altKey ? MODE_CENTER : MODE_HANDLE,
|
19484 | signX = dim === Y ? null : signsX[type],
|
19485 | signY = dim === X ? null : signsY[type],
|
19486 | state = local(that),
|
19487 | extent = state.extent,
|
19488 | selection = state.selection,
|
19489 | W = extent[0][0],
|
19490 | N = extent[0][1],
|
19491 | E = extent[1][0],
|
19492 | S = extent[1][1],
|
19493 | dx = 0,
|
19494 | dy = 0,
|
19495 | shifting = signX && signY && keys && event.shiftKey,
|
19496 | points = Array.from(event.touches || [event], function (t) {
|
19497 | var i = t.identifier;
|
19498 | return t = src_pointer(t, that), t.point0 = t.slice(), t.identifier = i, t;
|
19499 | });
|
19500 |
|
19501 | if (type === "overlay") {
|
19502 | selection && (moving = !0);
|
19503 | var pts = [points[0], points[1] || points[0]];
|
19504 | state.selection = selection = [[w0 = dim === Y ? W : min(pts[0][0], pts[1][0]), n0 = dim === X ? N : min(pts[0][1], pts[1][1])], [e0 = dim === Y ? E : max(pts[0][0], pts[1][0]), s0 = dim === X ? S : max(pts[0][1], pts[1][1])]], points.length > 1 && move();
|
19505 | } else w0 = selection[0][0], n0 = selection[0][1], e0 = selection[1][0], s0 = selection[1][1];
|
19506 |
|
19507 | w1 = w0, n1 = n0, e1 = e0, s1 = s0;
|
19508 | var group = src_select(that).attr("pointer-events", "none"),
|
19509 | overlay = group.selectAll(".overlay").attr("cursor", cursors[type]);
|
19510 | interrupt(that);
|
19511 | var emit = emitter(that, arguments, !0).beforestart();
|
19512 | if (event.touches) emit.moved = moved, emit.ended = ended;else {
|
19513 | var view = src_select(event.view).on("mousemove.brush", moved, !0).on("mouseup.brush", ended, !0);
|
19514 | keys && view.on("keydown.brush", keydowned, !0).on("keyup.brush", keyupped, !0), nodrag(event.view);
|
19515 | }
|
19516 | redraw.call(that), emit.start(event, mode.name);
|
19517 | }
|
19518 | }
|
19519 |
|
19520 | function touchmoved(event) {
|
19521 | emitter(this, arguments).moved(event);
|
19522 | }
|
19523 |
|
19524 | function touchended(event) {
|
19525 | emitter(this, arguments).ended(event);
|
19526 | }
|
19527 |
|
19528 | function initialize() {
|
19529 | var state = this.__brush || {
|
19530 | selection: null
|
19531 | };
|
19532 | return state.extent = number2(extent.apply(this, arguments)), state.dim = dim, state;
|
19533 | }
|
19534 |
|
19535 | var touchending,
|
19536 | extent = defaultExtent,
|
19537 | filter = defaultFilter,
|
19538 | touchable = defaultTouchable,
|
19539 | keys = !0,
|
19540 | listeners = src_dispatch("start", "brush", "end"),
|
19541 | handleSize = 6;
|
19542 | return brush.move = function (group, selection) {
|
19543 | group.tween ? group.on("start.brush", function (event) {
|
19544 | emitter(this, arguments).beforestart().start(event);
|
19545 | }).on("interrupt.brush end.brush", function (event) {
|
19546 | emitter(this, arguments).end(event);
|
19547 | }).tween("brush", function () {
|
19548 | function tween(t) {
|
19549 | state.selection = t === 1 && selection1 === null ? null : i(t), redraw.call(that), emit.brush();
|
19550 | }
|
19551 |
|
19552 | var that = this,
|
19553 | state = that.__brush,
|
19554 | emit = emitter(that, arguments),
|
19555 | selection0 = state.selection,
|
19556 | selection1 = dim.input(typeof selection === "function" ? selection.apply(this, arguments) : selection, state.extent),
|
19557 | i = value(selection0, selection1);
|
19558 | return selection0 !== null && selection1 !== null ? tween : tween(1);
|
19559 | }) : group.each(function () {
|
19560 | var that = this,
|
19561 | args = arguments,
|
19562 | state = that.__brush,
|
19563 | selection1 = dim.input(typeof selection === "function" ? selection.apply(that, args) : selection, state.extent),
|
19564 | emit = emitter(that, args).beforestart();
|
19565 | interrupt(that), state.selection = selection1 === null ? null : selection1, redraw.call(that), emit.start().brush().end();
|
19566 | });
|
19567 | }, brush.clear = function (group) {
|
19568 | brush.move(group, null);
|
19569 | }, Emitter.prototype = {
|
19570 | beforestart: function beforestart() {
|
19571 | return ++this.active === 1 && (this.state.emitter = this, this.starting = !0), this;
|
19572 | },
|
19573 | start: function start(event, mode) {
|
19574 | return this.starting ? (this.starting = !1, this.emit("start", event, mode)) : this.emit("brush", event), this;
|
19575 | },
|
19576 | brush: function (event, mode) {
|
19577 | return this.emit("brush", event, mode), this;
|
19578 | },
|
19579 | end: function end(event, mode) {
|
19580 | return --this.active === 0 && (delete this.state.emitter, this.emit("end", event, mode)), this;
|
19581 | },
|
19582 | emit: function emit(type, event, mode) {
|
19583 | var d = src_select(this.that).datum();
|
19584 | listeners.call(type, this.that, new BrushEvent(type, {
|
19585 | sourceEvent: event,
|
19586 | target: brush,
|
19587 | selection: dim.output(this.state.selection),
|
19588 | mode: mode,
|
19589 | dispatch: listeners
|
19590 | }), d);
|
19591 | }
|
19592 | }, brush.extent = function (_) {
|
19593 | return arguments.length ? (extent = typeof _ === "function" ? _ : d3_brush_src_constant(number2(_)), brush) : extent;
|
19594 | }, brush.filter = function (_) {
|
19595 | return arguments.length ? (filter = typeof _ === "function" ? _ : d3_brush_src_constant(!!_), brush) : filter;
|
19596 | }, brush.touchable = function (_) {
|
19597 | return arguments.length ? (touchable = typeof _ === "function" ? _ : d3_brush_src_constant(!!_), brush) : touchable;
|
19598 | }, brush.handleSize = function (_) {
|
19599 | return arguments.length ? (handleSize = +_, brush) : handleSize;
|
19600 | }, brush.keyModifiers = function (_) {
|
19601 | return arguments.length ? (keys = !!_, brush) : keys;
|
19602 | }, brush.on = function () {
|
19603 | var value = listeners.on.apply(listeners, arguments);
|
19604 | return value === listeners ? brush : value;
|
19605 | }, brush;
|
19606 | }
|
19607 | ;
|
19608 |
|
19609 | ;
|
19610 |
|
19611 |
|
19612 |
|
19613 |
|
19614 |
|
19615 |
|
19616 |
|
19617 |
|
19618 |
|
19619 |
|
19620 |
|
19621 |
|
19622 |
|
19623 | var win = function () {
|
19624 | var root = typeof globalThis === "object" && globalThis !== null && globalThis.Object === Object && globalThis || typeof global === "object" && global !== null && global.Object === Object && global || typeof self === "object" && self !== null && self.Object === Object && self;
|
19625 | return root || Function("return this")();
|
19626 | }(),
|
19627 | browser_doc = win && win.document;
|
19628 |
|
19629 | ;
|
19630 |
|
19631 |
|
19632 | function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
19633 |
|
19634 | function _objectSpread(target) { for (var source, i = 1; i < arguments.length; i++) source = arguments[i] == null ? {} : arguments[i], i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); return target; }
|
19635 |
|
19636 |
|
19637 |
|
19638 |
|
19639 |
|
19640 |
|
19641 |
|
19642 |
|
19643 |
|
19644 |
|
19645 |
|
19646 |
|
19647 | var isValue = function (v) {
|
19648 | return v || v === 0;
|
19649 | },
|
19650 | isFunction = function (v) {
|
19651 | return typeof v === "function";
|
19652 | },
|
19653 | isString = function (v) {
|
19654 | return typeof v === "string";
|
19655 | },
|
19656 | isNumber = function (v) {
|
19657 | return typeof v === "number";
|
19658 | },
|
19659 | isUndefined = function (v) {
|
19660 | return typeof v === "undefined";
|
19661 | },
|
19662 | isDefined = function (v) {
|
19663 | return typeof v !== "undefined";
|
19664 | },
|
19665 | isboolean = function (v) {
|
19666 | return typeof v === "boolean";
|
19667 | },
|
19668 | ceil10 = function (v) {
|
19669 | return Math.ceil(v / 10) * 10;
|
19670 | },
|
19671 | asHalfPixel = function (n) {
|
19672 | return Math.ceil(n) + .5;
|
19673 | },
|
19674 | diffDomain = function (d) {
|
19675 | return d[1] - d[0];
|
19676 | },
|
19677 | isObjectType = function (v) {
|
19678 | return typeof v === "object";
|
19679 | },
|
19680 | isEmpty = function (o) {
|
19681 | return isUndefined(o) || o === null || isString(o) && o.length === 0 || isObjectType(o) && !(o instanceof Date) && Object.keys(o).length === 0 || isNumber(o) && isNaN(o);
|
19682 | },
|
19683 | notEmpty = function (o) {
|
19684 | return !isEmpty(o);
|
19685 | },
|
19686 | isArray = function (arr) {
|
19687 | return Array.isArray(arr);
|
19688 | },
|
19689 | isObject = function (obj) {
|
19690 | return obj && !obj.nodeType && isObjectType(obj) && !isArray(obj);
|
19691 | };
|
19692 |
|
19693 |
|
19694 |
|
19695 |
|
19696 |
|
19697 |
|
19698 |
|
19699 |
|
19700 |
|
19701 |
|
19702 | function getOption(options, key, defaultValue) {
|
19703 | return isDefined(options[key]) ? options[key] : defaultValue;
|
19704 | }
|
19705 |
|
19706 |
|
19707 |
|
19708 |
|
19709 |
|
19710 |
|
19711 |
|
19712 |
|
19713 |
|
19714 | function hasValue(dict, value) {
|
19715 | var found = !1;
|
19716 | return Object.keys(dict).forEach(function (key) {
|
19717 | return dict[key] === value && (found = !0);
|
19718 | }), found;
|
19719 | }
|
19720 |
|
19721 |
|
19722 |
|
19723 |
|
19724 |
|
19725 |
|
19726 |
|
19727 |
|
19728 |
|
19729 | function callFn(fn) {
|
19730 | for (var isFn = isFunction(fn), _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) args[_key - 1] = arguments[_key];
|
19731 |
|
19732 | return isFn && fn.call.apply(fn, args), isFn;
|
19733 | }
|
19734 |
|
19735 |
|
19736 |
|
19737 |
|
19738 |
|
19739 |
|
19740 |
|
19741 |
|
19742 | function endall(transition, cb) {
|
19743 | var n = 0;
|
19744 | transition.each(function () {
|
19745 | return ++n;
|
19746 | }).on("end", function () {
|
19747 | for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) args[_key2] = arguments[_key2];
|
19748 |
|
19749 | --n || cb.apply.apply(cb, [this].concat(args));
|
19750 | });
|
19751 | }
|
19752 |
|
19753 |
|
19754 |
|
19755 |
|
19756 |
|
19757 |
|
19758 |
|
19759 |
|
19760 | function sanitise(str) {
|
19761 | return isString(str) ? str.replace(/</g, "<").replace(/>/g, ">") : str;
|
19762 | }
|
19763 |
|
19764 |
|
19765 |
|
19766 |
|
19767 |
|
19768 |
|
19769 |
|
19770 |
|
19771 |
|
19772 |
|
19773 | function setTextValue(node, text, dy, toMiddle) {
|
19774 | if (dy === void 0 && (dy = [-1, 1]), toMiddle === void 0 && (toMiddle = !1), node && isString(text)) if (text.indexOf("\n") === -1) node.text(text);else {
|
19775 | var diff = [node.text(), text].map(function (v) {
|
19776 | return v.replace(/[\s\n]/g, "");
|
19777 | });
|
19778 |
|
19779 | if (diff[0] !== diff[1]) {
|
19780 | var multiline = text.split("\n"),
|
19781 | len = toMiddle ? multiline.length - 1 : 1;
|
19782 | node.html(""), multiline.forEach(function (v, i) {
|
19783 | node.append("tspan").attr("x", 0).attr("dy", (i === 0 ? dy[0] * len : dy[1]) + "em").text(v);
|
19784 | });
|
19785 | }
|
19786 | }
|
19787 | }
|
19788 |
|
19789 |
|
19790 |
|
19791 |
|
19792 |
|
19793 |
|
19794 |
|
19795 |
|
19796 | function getRectSegList(path) {
|
19797 | |
19798 |
|
19799 |
|
19800 |
|
19801 |
|
19802 |
|
19803 |
|
19804 | var _path$getBBox = path.getBBox(),
|
19805 | x = _path$getBBox.x,
|
19806 | y = _path$getBBox.y,
|
19807 | width = _path$getBBox.width,
|
19808 | height = _path$getBBox.height;
|
19809 |
|
19810 | return [{
|
19811 | x: x,
|
19812 | y: y + height
|
19813 | },
|
19814 | {
|
19815 | x: x,
|
19816 | y: y
|
19817 | },
|
19818 | {
|
19819 | x: x + width,
|
19820 | y: y
|
19821 | },
|
19822 | {
|
19823 | x: x + width,
|
19824 | y: y + height
|
19825 | }
|
19826 | ];
|
19827 | }
|
19828 |
|
19829 |
|
19830 |
|
19831 |
|
19832 |
|
19833 |
|
19834 |
|
19835 |
|
19836 | function getPathBox(path) {
|
19837 | var _path$getBoundingClie = path.getBoundingClientRect(),
|
19838 | width = _path$getBoundingClie.width,
|
19839 | height = _path$getBoundingClie.height,
|
19840 | items = getRectSegList(path),
|
19841 | x = items[0].x,
|
19842 | y = Math.min(items[0].y, items[1].y);
|
19843 |
|
19844 | return {
|
19845 | x: x,
|
19846 | y: y,
|
19847 | width: width,
|
19848 | height: height
|
19849 | };
|
19850 | }
|
19851 |
|
19852 |
|
19853 |
|
19854 |
|
19855 |
|
19856 |
|
19857 |
|
19858 |
|
19859 |
|
19860 | function getPointer(event, element) {
|
19861 | var touches = event && (event.touches || event.sourceEvent && event.sourceEvent.touches),
|
19862 | pointer = event ? src_pointer(touches ? touches[0] : event, element) : [0, 0];
|
19863 | return pointer;
|
19864 | }
|
19865 |
|
19866 |
|
19867 |
|
19868 |
|
19869 |
|
19870 |
|
19871 |
|
19872 |
|
19873 | function getBrushSelection(ctx) {
|
19874 | var selection,
|
19875 | event = ctx.event,
|
19876 | $el = ctx.$el,
|
19877 | main = $el.subchart.main || $el.main;
|
19878 | return event && event.type === "brush" ? selection = event.selection : main && (selection = main.select("." + config_classes.brush).node()) && (selection = brushSelection(selection)), selection;
|
19879 | }
|
19880 |
|
19881 |
|
19882 |
|
19883 |
|
19884 |
|
19885 |
|
19886 |
|
19887 |
|
19888 |
|
19889 | function getBoundingRect(node) {
|
19890 | var needEvaluate = !("rect" in node) || "rect" in node && node.hasAttribute("width") && node.rect.width !== +node.getAttribute("width");
|
19891 | return needEvaluate ? node.rect = node.getBoundingClientRect() : node.rect;
|
19892 | }
|
19893 |
|
19894 |
|
19895 |
|
19896 |
|
19897 |
|
19898 |
|
19899 |
|
19900 |
|
19901 | function getRandom(asStr) {
|
19902 | asStr === void 0 && (asStr = !0);
|
19903 | var rand = Math.random();
|
19904 | return asStr ? rand + "" : rand;
|
19905 | }
|
19906 |
|
19907 |
|
19908 |
|
19909 |
|
19910 |
|
19911 |
|
19912 |
|
19913 |
|
19914 |
|
19915 |
|
19916 |
|
19917 |
|
19918 | function findIndex(arr, v, start, end, isRotated) {
|
19919 | if (start > end) return -1;
|
19920 | var mid = Math.floor((start + end) / 2),
|
19921 | _arr$mid = arr[mid],
|
19922 | x = _arr$mid.x,
|
19923 | _arr$mid$w = _arr$mid.w,
|
19924 | w = _arr$mid$w === void 0 ? 0 : _arr$mid$w;
|
19925 | return isRotated && (x = arr[mid].y, w = arr[mid].h), v >= x && v <= x + w ? mid : v < x ? findIndex(arr, v, start, mid - 1, isRotated) : findIndex(arr, v, mid + 1, end, isRotated);
|
19926 | }
|
19927 |
|
19928 |
|
19929 |
|
19930 |
|
19931 |
|
19932 |
|
19933 |
|
19934 |
|
19935 | function brushEmpty(ctx) {
|
19936 | var selection = getBrushSelection(ctx);
|
19937 | return !selection || selection[0] === selection[1];
|
19938 | }
|
19939 |
|
19940 |
|
19941 |
|
19942 |
|
19943 |
|
19944 |
|
19945 |
|
19946 |
|
19947 | function deepClone() {
|
19948 | for (var clone = function (_clone) {
|
19949 | function clone() {
|
19950 | return _clone.apply(this, arguments);
|
19951 | }
|
19952 |
|
19953 | return clone.toString = function () {
|
19954 | return _clone.toString();
|
19955 | }, clone;
|
19956 | }(function (v) {
|
19957 | if (isObject(v) && v.constructor) {
|
19958 | var r = new v.constructor();
|
19959 |
|
19960 | for (var k in v) r[k] = clone(v[k]);
|
19961 |
|
19962 | return r;
|
19963 | }
|
19964 |
|
19965 | return v;
|
19966 | }), _len3 = arguments.length, objectN = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) objectN[_key3] = arguments[_key3];
|
19967 |
|
19968 | return objectN.map(function (v) {
|
19969 | return clone(v);
|
19970 | }).reduce(function (a, c) {
|
19971 | return _objectSpread(_objectSpread({}, a), c);
|
19972 | });
|
19973 | }
|
19974 |
|
19975 |
|
19976 |
|
19977 |
|
19978 |
|
19979 |
|
19980 |
|
19981 |
|
19982 |
|
19983 | function util_extend(target, source) {
|
19984 |
|
19985 | for (var p in target === void 0 && (target = {}), isArray(source) && source.forEach(function (v) {
|
19986 | return util_extend(target, v);
|
19987 | }), source) /^\d+$/.test(p) || p in target || (target[p] = source[p]);
|
19988 |
|
19989 | return target;
|
19990 | }
|
19991 |
|
19992 |
|
19993 |
|
19994 |
|
19995 |
|
19996 |
|
19997 |
|
19998 |
|
19999 | var capitalize = function (str) {
|
20000 | return str.charAt(0).toUpperCase() + str.slice(1);
|
20001 | },
|
20002 | toArray = function (v) {
|
20003 | return [].slice.call(v);
|
20004 | };
|
20005 |
|
20006 |
|
20007 |
|
20008 |
|
20009 |
|
20010 |
|
20011 |
|
20012 |
|
20013 |
|
20014 |
|
20015 |
|
20016 |
|
20017 |
|
20018 |
|
20019 | function getCssRules(styleSheets) {
|
20020 | var rules = [];
|
20021 | return styleSheets.forEach(function (sheet) {
|
20022 | try {
|
20023 | sheet.cssRules && sheet.cssRules.length && (rules = rules.concat(toArray(sheet.cssRules)));
|
20024 | } catch (e) {
|
20025 | console.error("Error while reading rules from " + sheet.href + ": " + e.toString());
|
20026 | }
|
20027 | }), rules;
|
20028 | }
|
20029 |
|
20030 |
|
20031 |
|
20032 |
|
20033 |
|
20034 |
|
20035 |
|
20036 |
|
20037 | var getTranslation = function (node) {
|
20038 | var transform = node ? node.transform : null,
|
20039 | baseVal = transform && transform.baseVal;
|
20040 | return baseVal && baseVal.numberOfItems ? baseVal.getItem(0).matrix : {
|
20041 | a: 0,
|
20042 | b: 0,
|
20043 | c: 0,
|
20044 | d: 0,
|
20045 | e: 0,
|
20046 | f: 0
|
20047 | };
|
20048 | };
|
20049 |
|
20050 |
|
20051 |
|
20052 |
|
20053 |
|
20054 |
|
20055 |
|
20056 |
|
20057 | function getUnique(data) {
|
20058 | var isDate = data[0] instanceof Date,
|
20059 | d = (isDate ? data.map(Number) : data).filter(function (v, i, self) {
|
20060 | return self.indexOf(v) === i;
|
20061 | });
|
20062 | return isDate ? d.map(function (v) {
|
20063 | return new Date(v);
|
20064 | }) : d;
|
20065 | }
|
20066 |
|
20067 |
|
20068 |
|
20069 |
|
20070 |
|
20071 |
|
20072 |
|
20073 |
|
20074 | function mergeArray(arr) {
|
20075 | return arr && arr.length ? arr.reduce(function (p, c) {
|
20076 | return p.concat(c);
|
20077 | }) : [];
|
20078 | }
|
20079 |
|
20080 |
|
20081 |
|
20082 |
|
20083 |
|
20084 |
|
20085 |
|
20086 |
|
20087 |
|
20088 | function mergeObj(target) {
|
20089 | for (var _len4 = arguments.length, objectN = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) objectN[_key4 - 1] = arguments[_key4];
|
20090 |
|
20091 | if (!objectN.length || objectN.length === 1 && !objectN[0]) return target;
|
20092 | var source = objectN.shift();
|
20093 | return isObject(target) && isObject(source) && Object.keys(source).forEach(function (key) {
|
20094 | var value = source[key];
|
20095 | isObject(value) ? (!target[key] && (target[key] = {}), target[key] = mergeObj(target[key], value)) : target[key] = isArray(value) ? value.concat() : value;
|
20096 | }), mergeObj.apply(void 0, [target].concat(objectN));
|
20097 | }
|
20098 |
|
20099 |
|
20100 |
|
20101 |
|
20102 |
|
20103 |
|
20104 |
|
20105 |
|
20106 |
|
20107 | function sortValue(data, isAsc) {
|
20108 | isAsc === void 0 && (isAsc = !0);
|
20109 | var fn;
|
20110 | return data[0] instanceof Date ? fn = isAsc ? function (a, b) {
|
20111 | return a - b;
|
20112 | } : function (a, b) {
|
20113 | return b - a;
|
20114 | } : isAsc && !data.every(isNaN) ? fn = function (a, b) {
|
20115 | return a - b;
|
20116 | } : !isAsc && (fn = function (a, b) {
|
20117 | return a > b && -1 || a < b && 1 || a === b && 0;
|
20118 | }), data.concat().sort(fn);
|
20119 | }
|
20120 |
|
20121 |
|
20122 |
|
20123 |
|
20124 |
|
20125 |
|
20126 |
|
20127 |
|
20128 |
|
20129 | function getMinMax(type, data) {
|
20130 | var res = data.filter(function (v) {
|
20131 | return notEmpty(v);
|
20132 | });
|
20133 | return res.length ? isNumber(res[0]) ? res = Math[type].apply(Math, res) : res[0] instanceof Date && (res = sortValue(res, type === "min")[0]) : res = undefined, res;
|
20134 | }
|
20135 |
|
20136 |
|
20137 |
|
20138 |
|
20139 |
|
20140 |
|
20141 |
|
20142 |
|
20143 |
|
20144 |
|
20145 | var getRange = function (start, end, step) {
|
20146 | step === void 0 && (step = 1);
|
20147 | var res = [],
|
20148 | n = Math.max(0, Math.ceil((end - start) / step)) | 0;
|
20149 |
|
20150 | for (var i = start; i < n; i++) res.push(start + i * step);
|
20151 |
|
20152 | return res;
|
20153 | },
|
20154 | emulateEvent = {
|
20155 | mouse: function () {
|
20156 | var getParams = function () {
|
20157 | return {
|
20158 | bubbles: !1,
|
20159 | cancelable: !1,
|
20160 | screenX: 0,
|
20161 | screenY: 0,
|
20162 | clientX: 0,
|
20163 | clientY: 0
|
20164 | };
|
20165 | };
|
20166 |
|
20167 | try {
|
20168 | return new MouseEvent("t"), function (el, eventType, params) {
|
20169 | params === void 0 && (params = getParams()), el.dispatchEvent(new MouseEvent(eventType, params));
|
20170 | };
|
20171 | } catch (e) {
|
20172 |
|
20173 | return function (el, eventType, params) {
|
20174 | params === void 0 && (params = getParams());
|
20175 | var mouseEvent = browser_doc.createEvent("MouseEvent");
|
20176 |
|
20177 | mouseEvent.initMouseEvent(eventType, params.bubbles, params.cancelable, win, 0,
|
20178 | params.screenX, params.screenY, params.clientX, params.clientY, !1, !1, !1, !1, 0, null), el.dispatchEvent(mouseEvent);
|
20179 | };
|
20180 | }
|
20181 | }(),
|
20182 | touch: function touch(el, eventType, params) {
|
20183 | var touchObj = new Touch(mergeObj({
|
20184 | identifier: Date.now(),
|
20185 | target: el,
|
20186 | radiusX: 2.5,
|
20187 | radiusY: 2.5,
|
20188 | rotationAngle: 10,
|
20189 | force: .5
|
20190 | }, params));
|
20191 | el.dispatchEvent(new TouchEvent(eventType, {
|
20192 | cancelable: !0,
|
20193 | bubbles: !0,
|
20194 | shiftKey: !0,
|
20195 | touches: [touchObj],
|
20196 | targetTouches: [],
|
20197 | changedTouches: [touchObj]
|
20198 | }));
|
20199 | }
|
20200 | };
|
20201 |
|
20202 |
|
20203 |
|
20204 |
|
20205 |
|
20206 |
|
20207 |
|
20208 |
|
20209 |
|
20210 | function tplProcess(tpl, data) {
|
20211 | var res = tpl;
|
20212 |
|
20213 | for (var x in data) res = res.replace(new RegExp("{=" + x + "}", "g"), data[x]);
|
20214 |
|
20215 | return res;
|
20216 | }
|
20217 |
|
20218 |
|
20219 |
|
20220 |
|
20221 |
|
20222 |
|
20223 |
|
20224 |
|
20225 |
|
20226 | function parseDate(date) {
|
20227 | var parsedDate;
|
20228 | if (date instanceof Date) parsedDate = date;else if (isString(date)) {
|
20229 | var config = this.config,
|
20230 | format = this.format;
|
20231 | parsedDate = format.dataTime(config.data_xFormat)(date);
|
20232 | } else isNumber(date) && !isNaN(date) && (parsedDate = new Date(+date));
|
20233 | return (!parsedDate || isNaN(+parsedDate)) && console && console.error && console.error("Failed to parse x '" + date + "' to Date object"), parsedDate;
|
20234 | }
|
20235 |
|
20236 |
|
20237 |
|
20238 |
|
20239 |
|
20240 |
|
20241 |
|
20242 | function isTabVisible() {
|
20243 | return !browser_doc.hidden;
|
20244 | }
|
20245 |
|
20246 |
|
20247 |
|
20248 |
|
20249 |
|
20250 |
|
20251 |
|
20252 |
|
20253 |
|
20254 | function convertInputType(mouse, touch) {
|
20255 | var isMobile = !1;
|
20256 |
|
20257 | if (/Mobi/.test(win.navigator.userAgent) && touch) {
|
20258 |
|
20259 | var hasTouchPoints = win.navigator && "maxTouchPoints" in win.navigator && win.navigator.maxTouchPoints > 0,
|
20260 | hasTouch = "ontouchmove" in win || win.DocumentTouch && browser_doc instanceof win.DocumentTouch;
|
20261 |
|
20262 |
|
20263 | isMobile = hasTouchPoints || hasTouch;
|
20264 | }
|
20265 |
|
20266 | var hasMouse = !(!mouse || isMobile) && "onmouseover" in win;
|
20267 | return hasMouse && "mouse" || isMobile && "touch" || null;
|
20268 | }
|
20269 | ;
|
20270 |
|
20271 |
|
20272 | function Options_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
20273 |
|
20274 | function Options_objectSpread(target) { for (var source, i = 1; i < arguments.length; i++) source = arguments[i] == null ? {} : arguments[i], i % 2 ? Options_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : Options_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); return target; }
|
20275 |
|
20276 |
|
20277 |
|
20278 |
|
20279 |
|
20280 |
|
20281 |
|
20282 |
|
20283 |
|
20284 |
|
20285 |
|
20286 |
|
20287 |
|
20288 |
|
20289 |
|
20290 |
|
20291 |
|
20292 |
|
20293 |
|
20294 |
|
20295 |
|
20296 | var Options = function () {
|
20297 | function Options() {
|
20298 | return deepClone(main, data_data, color, interaction, legend, title, tooltip, Options.data);
|
20299 | }
|
20300 |
|
20301 | return Options.setOptions = function setOptions(options) {
|
20302 | this.data = options.reduce(function (a, c) {
|
20303 | return Options_objectSpread(Options_objectSpread({}, a), c);
|
20304 | }, this.data);
|
20305 | }, Options;
|
20306 | }();
|
20307 |
|
20308 | Options.data = {};
|
20309 |
|
20310 | ;
|
20311 |
|
20312 |
|
20313 |
|
20314 |
|
20315 |
|
20316 |
|
20317 |
|
20318 |
|
20319 |
|
20320 |
|
20321 |
|
20322 | var KEY = {
|
20323 | bubbleBaseLength: "$baseLength",
|
20324 | colorPattern: "__colorPattern__",
|
20325 | dataMinMax: "$dataMinMax",
|
20326 | dataTotalSum: "$dataTotalSum",
|
20327 | dataTotalPerIndex: "$totalPerIndex",
|
20328 | legendItemTextBox: "legendItemTextBox",
|
20329 | radarPoints: "$radarPoints",
|
20330 | setOverOut: "setOverOut",
|
20331 | callOverOutForTouch: "callOverOutForTouch",
|
20332 | textRect: "textRect"
|
20333 | };
|
20334 |
|
20335 | var Cache = function () {
|
20336 | function Cache() {
|
20337 | this.cache = {};
|
20338 | }
|
20339 |
|
20340 | var _proto = Cache.prototype;
|
20341 | return _proto.add =
|
20342 | |
20343 |
|
20344 |
|
20345 |
|
20346 |
|
20347 |
|
20348 |
|
20349 |
|
20350 | function add(key, value, isDataType) {
|
20351 | return isDataType === void 0 && (isDataType = !1), this.cache[key] = isDataType ? this.cloneTarget(value) : value, this.cache[key];
|
20352 | }
|
20353 | |
20354 |
|
20355 |
|
20356 |
|
20357 |
|
20358 | , _proto.remove = function remove(key) {
|
20359 | var _this = this;
|
20360 |
|
20361 | toArray(key).forEach(function (v) {
|
20362 | return delete _this.cache[v];
|
20363 | });
|
20364 | }
|
20365 | |
20366 |
|
20367 |
|
20368 |
|
20369 |
|
20370 |
|
20371 |
|
20372 | , _proto.get = function get(key, isDataType) {
|
20373 | if (isDataType === void 0 && (isDataType = !1), isDataType) {
|
20374 | for (var id, targets = [], i = 0; id = key[i]; i++) id in this.cache && targets.push(this.cloneTarget(this.cache[id]));
|
20375 |
|
20376 | return targets;
|
20377 | }
|
20378 |
|
20379 | var value = this.cache[key];
|
20380 | return isValue(value) ? value : null;
|
20381 | }
|
20382 | |
20383 |
|
20384 |
|
20385 |
|
20386 |
|
20387 | , _proto.reset = function reset(all) {
|
20388 | var $$ = this;
|
20389 |
|
20390 | for (var x in $$.cache) (all || /^\$/.test(x)) && ($$.cache[x] = null);
|
20391 | }
|
20392 | |
20393 |
|
20394 |
|
20395 |
|
20396 |
|
20397 |
|
20398 |
|
20399 | , _proto.cloneTarget = function cloneTarget(target) {
|
20400 | return {
|
20401 | id: target.id,
|
20402 | id_org: target.id_org,
|
20403 | values: target.values.map(function (d) {
|
20404 | return {
|
20405 | x: d.x,
|
20406 | value: d.value,
|
20407 | id: d.id
|
20408 | };
|
20409 | })
|
20410 | };
|
20411 | }, Cache;
|
20412 | }();
|
20413 |
|
20414 |
|
20415 | ;
|
20416 |
|
20417 |
|
20418 |
|
20419 |
|
20420 |
|
20421 |
|
20422 | var generator_setTimeout = win.setTimeout,
|
20423 | generator_clearTimeout = win.clearTimeout;
|
20424 |
|
20425 |
|
20426 |
|
20427 |
|
20428 |
|
20429 |
|
20430 | function generateResize() {
|
20431 | var timeout,
|
20432 | fn = [],
|
20433 | callResizeFn = function () {
|
20434 | callResizeFn.clear(), timeout = generator_setTimeout(function () {
|
20435 | fn.forEach(function (f) {
|
20436 | return f();
|
20437 | });
|
20438 | }, 200);
|
20439 | };
|
20440 |
|
20441 | return callResizeFn.clear = function () {
|
20442 | timeout && (generator_clearTimeout(timeout), timeout = null);
|
20443 | }, callResizeFn.add = function (f) {
|
20444 | return fn.push(f);
|
20445 | }, callResizeFn.remove = function (f) {
|
20446 | return fn.splice(fn.indexOf(f), 1);
|
20447 | }, callResizeFn;
|
20448 | }
|
20449 |
|
20450 |
|
20451 |
|
20452 |
|
20453 |
|
20454 |
|
20455 | function generateWait() {
|
20456 | var transitionsToWait = [],
|
20457 | f = function (t, callback) {
|
20458 |
|
20459 | function loop() {
|
20460 | for (var _t, done = 0, i = 0; _t = transitionsToWait[i]; i++) {
|
20461 | if (_t === !0 || _t.empty && _t.empty()) {
|
20462 | done++;
|
20463 | continue;
|
20464 | }
|
20465 |
|
20466 | try {
|
20467 | _t.transition();
|
20468 | } catch (e) {
|
20469 | done++;
|
20470 | }
|
20471 | }
|
20472 |
|
20473 | timer && generator_clearTimeout(timer), done === transitionsToWait.length ? callback && callback() : timer = generator_setTimeout(loop, 50);
|
20474 | }
|
20475 |
|
20476 | var timer;
|
20477 | loop();
|
20478 | };
|
20479 |
|
20480 | return f.add = function (t) {
|
20481 | isArray(t) ? transitionsToWait = transitionsToWait.concat(t) : transitionsToWait.push(t);
|
20482 | }, f;
|
20483 | }
|
20484 | ;
|
20485 | var EOL = {},
|
20486 | EOF = {},
|
20487 | QUOTE = 34,
|
20488 | NEWLINE = 10,
|
20489 | RETURN = 13;
|
20490 |
|
20491 | function objectConverter(columns) {
|
20492 | return new Function("d", "return {" + columns.map(function (name, i) {
|
20493 | return JSON.stringify(name) + ": d[" + i + "] || \"\"";
|
20494 | }).join(",") + "}");
|
20495 | }
|
20496 |
|
20497 | function customConverter(columns, f) {
|
20498 | var object = objectConverter(columns);
|
20499 | return function (row, i) {
|
20500 | return f(object(row), i, columns);
|
20501 | };
|
20502 | }
|
20503 |
|
20504 |
|
20505 | function inferColumns(rows) {
|
20506 | var columnSet = Object.create(null),
|
20507 | columns = [];
|
20508 | return rows.forEach(function (row) {
|
20509 | for (var column in row) column in columnSet || columns.push(columnSet[column] = column);
|
20510 | }), columns;
|
20511 | }
|
20512 |
|
20513 | function dsv_pad(value, width) {
|
20514 | var s = value + "",
|
20515 | length = s.length;
|
20516 | return length < width ? Array(width - length + 1).join(0) + s : s;
|
20517 | }
|
20518 |
|
20519 | function dsv_formatYear(year) {
|
20520 | return year < 0 ? "-" + dsv_pad(-year, 6) : year > 9999 ? "+" + dsv_pad(year, 6) : dsv_pad(year, 4);
|
20521 | }
|
20522 |
|
20523 | function formatDate(date) {
|
20524 | var hours = date.getUTCHours(),
|
20525 | minutes = date.getUTCMinutes(),
|
20526 | seconds = date.getUTCSeconds(),
|
20527 | milliseconds = date.getUTCMilliseconds();
|
20528 | return isNaN(date) ? "Invalid Date" : dsv_formatYear(date.getUTCFullYear(), 4) + "-" + dsv_pad(date.getUTCMonth() + 1, 2) + "-" + dsv_pad(date.getUTCDate(), 2) + (milliseconds ? "T" + dsv_pad(hours, 2) + ":" + dsv_pad(minutes, 2) + ":" + dsv_pad(seconds, 2) + "." + dsv_pad(milliseconds, 3) + "Z" : seconds ? "T" + dsv_pad(hours, 2) + ":" + dsv_pad(minutes, 2) + ":" + dsv_pad(seconds, 2) + "Z" : minutes || hours ? "T" + dsv_pad(hours, 2) + ":" + dsv_pad(minutes, 2) + "Z" : "");
|
20529 | }
|
20530 |
|
20531 | function dsv(delimiter) {
|
20532 | function parseRows(text, f) {
|
20533 | function token() {
|
20534 | if (eof) return EOF;
|
20535 | if (eol) return eol = !1, EOL;
|
20536 |
|
20537 | var i,
|
20538 | c,
|
20539 | j = I;
|
20540 |
|
20541 | if (text.charCodeAt(j) === QUOTE) {
|
20542 | for (; I++ < N && text.charCodeAt(I) !== QUOTE || text.charCodeAt(++I) === QUOTE;);
|
20543 |
|
20544 | return (i = I) >= N ? eof = !0 : (c = text.charCodeAt(I++)) === NEWLINE ? eol = !0 : c === RETURN && (eol = !0, text.charCodeAt(I) === NEWLINE && ++I), text.slice(j + 1, i - 1).replace(/""/g, "\"");
|
20545 | } // Find next delimiter or newline.
|
20546 |
|
20547 |
|
20548 | for (; I < N;) {
|
20549 | if ((c = text.charCodeAt(i = I++)) === NEWLINE) eol = !0;else if (c === RETURN) eol = !0, text.charCodeAt(I) === NEWLINE && ++I;else if (c !== DELIMITER) continue;
|
20550 | return text.slice(j, i);
|
20551 | } // Return last token before EOF.
|
20552 |
|
20553 |
|
20554 | return eof = !0, text.slice(j, N);
|
20555 | }
|
20556 |
|
20557 | var // current line number
|
20558 | t,
|
20559 | rows = [],
|
20560 | // output rows
|
20561 | N = text.length,
|
20562 | I = 0,
|
20563 | // current character index
|
20564 | n = 0,
|
20565 | // current token
|
20566 | eof = N <= 0,
|
20567 | // current token followed by EOF?
|
20568 | eol = !1; // current token followed by EOL?
|
20569 | // Strip the trailing newline.
|
20570 |
|
20571 | for (text.charCodeAt(N - 1) === NEWLINE && --N, text.charCodeAt(N - 1) === RETURN && --N; (t = token()) !== EOF;) {
|
20572 | for (var row = []; t !== EOL && t !== EOF;) row.push(t), t = token();
|
20573 |
|
20574 | f && (row = f(row, n++)) == null || rows.push(row);
|
20575 | }
|
20576 |
|
20577 | return rows;
|
20578 | }
|
20579 |
|
20580 | function preformatBody(rows, columns) {
|
20581 | return rows.map(function (row) {
|
20582 | return columns.map(function (column) {
|
20583 | return formatValue(row[column]);
|
20584 | }).join(delimiter);
|
20585 | });
|
20586 | }
|
20587 |
|
20588 | function formatRow(row) {
|
20589 | return row.map(formatValue).join(delimiter);
|
20590 | }
|
20591 |
|
20592 | function formatValue(value) {
|
20593 | return value == null ? "" : value instanceof Date ? formatDate(value) : reFormat.test(value += "") ? "\"" + value.replace(/"/g, "\"\"") + "\"" : value;
|
20594 | }
|
20595 |
|
20596 | var reFormat = new RegExp("[\"" + delimiter + "\n\r]"),
|
20597 | DELIMITER = delimiter.charCodeAt(0);
|
20598 | return {
|
20599 | parse: function (text, f) {
|
20600 | var convert,
|
20601 | columns,
|
20602 | rows = parseRows(text, function (row, i) {
|
20603 | return convert ? convert(row, i - 1) : void (columns = row, convert = f ? customConverter(row, f) : objectConverter(row));
|
20604 | });
|
20605 | return rows.columns = columns || [], rows;
|
20606 | },
|
20607 | parseRows: parseRows,
|
20608 | format: function (rows, columns) {
|
20609 | return columns == null && (columns = inferColumns(rows)), [columns.map(formatValue).join(delimiter)].concat(preformatBody(rows, columns)).join("\n");
|
20610 | },
|
20611 | formatBody: function (rows, columns) {
|
20612 | return columns == null && (columns = inferColumns(rows)), preformatBody(rows, columns).join("\n");
|
20613 | },
|
20614 | formatRows: function (rows) {
|
20615 | return rows.map(formatRow).join("\n");
|
20616 | },
|
20617 | formatRow: formatRow,
|
20618 | formatValue: formatValue
|
20619 | };
|
20620 | }
|
20621 | ;// CONCATENATED MODULE: ./node_modules/d3-dsv/src/csv.js
|
20622 |
|
20623 | var csv = dsv(",");
|
20624 | var csvParse = csv.parse;
|
20625 | var csvParseRows = csv.parseRows;
|
20626 | var csvFormat = csv.format;
|
20627 | var csvFormatBody = csv.formatBody;
|
20628 | var csvFormatRows = csv.formatRows;
|
20629 | var csvFormatRow = csv.formatRow;
|
20630 | var csvFormatValue = csv.formatValue;
|
20631 | ;// CONCATENATED MODULE: ./node_modules/d3-dsv/src/tsv.js
|
20632 |
|
20633 | var tsv = dsv("\t");
|
20634 | var tsvParse = tsv.parse;
|
20635 | var tsvParseRows = tsv.parseRows;
|
20636 | var tsvFormat = tsv.format;
|
20637 | var tsvFormatBody = tsv.formatBody;
|
20638 | var tsvFormatRows = tsv.formatRows;
|
20639 | var tsvFormatRow = tsv.formatRow;
|
20640 | var tsvFormatValue = tsv.formatValue;
|
20641 | ;// CONCATENATED MODULE: ./src/ChartInternal/data/convert.ts
|
20642 | /**
|
20643 | * Copyright (c) 2017 ~ present NAVER Corp.
|
20644 | * billboard.js project is licensed under the MIT license
|
20645 | */
|
20646 |
|
20647 |
|
20648 | /**
|
20649 | * Data convert
|
20650 | * @memberof ChartInternal
|
20651 | * @private
|
20652 | */
|
20653 |
|
20654 | /* harmony default export */ var convert = ({
|
20655 | /**
|
20656 | * Convert data according its type
|
20657 | * @param {object} args data object
|
20658 | * @param {Function} [callback] callback for url(XHR) type loading
|
20659 | * @returns {object}
|
20660 | * @private
|
20661 | */
|
20662 | convertData: function convertData(args, callback) {
|
20663 | var data;
|
20664 | if (args.bindto ? (data = {}, ["url", "mimeType", "headers", "keys", "json", "keys", "rows", "columns"].forEach(function (v) {
|
20665 | var key = "data_" + v;
|
20666 | key in args && (data[v] = args[key]);
|
20667 | })) : data = args, data.url && callback) this.convertUrlToData(data.url, data.mimeType, data.headers, data.keys, callback);else if (data.json) data = this.convertJsonToData(data.json, data.keys);else if (data.rows) data = this.convertRowsToData(data.rows);else if (data.columns) data = this.convertColumnsToData(data.columns);else if (args.bindto) throw Error("url or json or rows or columns is required.");
|
20668 | return isArray(data) && data;
|
20669 | },
|
20670 |
|
20671 | /**
|
20672 | * Convert URL data
|
20673 | * @param {string} url Remote URL
|
20674 | * @param {string} mimeType MIME type string: json | csv | tsv
|
20675 | * @param {object} headers Header object
|
20676 | * @param {object} keys Key object
|
20677 | * @param {Function} done Callback function
|
20678 | * @private
|
20679 | */
|
20680 | convertUrlToData: function convertUrlToData(url, mimeType, headers, keys, done) {
|
20681 | var _this = this;
|
20682 |
|
20683 | mimeType === void 0 && (mimeType = "csv");
|
20684 | var req = new XMLHttpRequest();
|
20685 | req.open("GET", url), headers && Object.keys(headers).forEach(function (key) {
|
20686 | req.setRequestHeader(key, headers[key]);
|
20687 | }), req.onreadystatechange = function () {
|
20688 | if (req.readyState === 4) if (req.status === 200) {
|
20689 | var response = req.responseText;
|
20690 | response && done.call(_this, _this["convert" + capitalize(mimeType) + "ToData"](mimeType === "json" ? JSON.parse(response) : response, keys));
|
20691 | } else throw new Error(url + ": Something went wrong loading!");
|
20692 | }, req.send();
|
20693 | },
|
20694 |
|
20695 | /**
|
20696 | * Convert CSV/TSV data
|
20697 | * @param {object} parser Parser object
|
20698 | * @param {object} xsv Data
|
20699 | * @private
|
20700 | * @returns {object}
|
20701 | */
|
20702 | convertCsvTsvToData: function convertCsvTsvToData(parser, xsv) {
|
20703 | var d,
|
20704 | rows = parser.rows(xsv);
|
20705 | return rows.length === 1 ? (d = [{}], rows[0].forEach(function (id) {
|
20706 | d[0][id] = null;
|
20707 | })) : d = parser.parse(xsv), d;
|
20708 | },
|
20709 | convertCsvToData: function convertCsvToData(xsv) {
|
20710 | return this.convertCsvTsvToData({
|
20711 | rows: csvParseRows,
|
20712 | parse: csvParse
|
20713 | }, xsv);
|
20714 | },
|
20715 | convertTsvToData: function convertTsvToData(tsv) {
|
20716 | return this.convertCsvTsvToData({
|
20717 | rows: tsvParseRows,
|
20718 | parse: tsvParse
|
20719 | }, tsv);
|
20720 | },
|
20721 | convertJsonToData: function convertJsonToData(json, keysParam) {
|
20722 | var targetKeys,
|
20723 | data,
|
20724 | _this2 = this,
|
20725 | config = this.config,
|
20726 | newRows = [];
|
20727 |
|
20728 | if (isArray(json)) {
|
20729 | var keys = keysParam || config.data_keys;
|
20730 | keys.x ? (targetKeys = keys.value.concat(keys.x), config.data_x = keys.x) : targetKeys = keys.value, newRows.push(targetKeys), json.forEach(function (o) {
|
20731 | var newRow = targetKeys.map(function (key) {
|
20732 | // convert undefined to null because undefined data will be removed in convertDataToTargets()
|
20733 | var v = _this2.findValueInJson(o, key);
|
20734 |
|
20735 | return isUndefined(v) && (v = null), v;
|
20736 | });
|
20737 | newRows.push(newRow);
|
20738 | }), data = this.convertRowsToData(newRows);
|
20739 | } else Object.keys(json).forEach(function (key) {
|
20740 | var tmp = json[key].concat();
|
20741 | tmp.unshift(key), newRows.push(tmp);
|
20742 | }), data = this.convertColumnsToData(newRows);
|
20743 |
|
20744 | return data;
|
20745 | },
|
20746 | findValueInJson: function findValueInJson(object, path) {
|
20747 | if (object[path] !== undefined) return object[path];
|
20748 | var convertedPath = path.replace(/\[(\w+)\]/g, ".$1"),
|
20749 | pathArray = convertedPath.replace(/^\./, "").split("."),
|
20750 | target = object; // convert indexes to properties (replace [] with .)
|
20751 |
|
20752 | return pathArray.some(function (k) {
|
20753 | return !(target = target && k in target ? target[k] : undefined);
|
20754 | }), target;
|
20755 | },
|
20756 | convertRowsToData: function convertRowsToData(rows) {
|
20757 | var keys = rows[0],
|
20758 | newRows = [];
|
20759 | return rows.forEach(function (row, i) {
|
20760 | if (i > 0) {
|
20761 | var newRow = {};
|
20762 | row.forEach(function (v, j) {
|
20763 | if (isUndefined(v)) throw new Error("Source data is missing a component at (" + i + ", " + j + ")!");
|
20764 | newRow[keys[j]] = v;
|
20765 | }), newRows.push(newRow);
|
20766 | }
|
20767 | }), newRows;
|
20768 | },
|
20769 | convertColumnsToData: function convertColumnsToData(columns) {
|
20770 | var newRows = [];
|
20771 | return columns.forEach(function (col, i) {
|
20772 | var key = col[0];
|
20773 | col.forEach(function (v, j) {
|
20774 | if (j > 0) {
|
20775 | if (isUndefined(newRows[j - 1]) && (newRows[j - 1] = {}), isUndefined(v)) throw new Error("Source data is missing a component at (" + i + ", " + j + ")!");
|
20776 | newRows[j - 1][key] = v;
|
20777 | }
|
20778 | });
|
20779 | }), newRows;
|
20780 | },
|
20781 | convertDataToTargets: function convertDataToTargets(data, appendXs) {
|
20782 | var _this3 = this,
|
20783 | $$ = this,
|
20784 | axis = $$.axis,
|
20785 | config = $$.config,
|
20786 | state = $$.state,
|
20787 | isCategorized = !1,
|
20788 | isTimeSeries = !1,
|
20789 | isCustomX = !1;
|
20790 |
|
20791 | axis && (isCategorized = axis.isCategorized(), isTimeSeries = axis.isTimeSeries(), isCustomX = axis.isCustomX());
|
20792 | var xsData,
|
20793 | dataKeys = Object.keys(data[0] || {}),
|
20794 | ids = dataKeys.length ? dataKeys.filter($$.isNotX, $$) : [],
|
20795 | xs = dataKeys.length ? dataKeys.filter($$.isX, $$) : [];
|
20796 | ids.forEach(function (id) {
|
20797 | var xKey = _this3.getXKey(id);
|
20798 |
|
20799 | isCustomX || isTimeSeries ? xs.indexOf(xKey) >= 0 ? xsData = (appendXs && $$.data.xs[id] || []).concat(data.map(function (d) {
|
20800 | return d[xKey];
|
20801 | }).filter(isValue).map(function (rawX, i) {
|
20802 | return $$.generateTargetX(rawX, id, i);
|
20803 | })) : config.data_x ? xsData = _this3.getOtherTargetXs() : notEmpty(config.data_xs) && (xsData = $$.getXValuesOfXKey(xKey, $$.data.targets)) : xsData = data.map(function (d, i) {
|
20804 | return i;
|
20805 | }), xsData && (_this3.data.xs[id] = xsData);
|
20806 | }), ids.forEach(function (id) {
|
20807 | if (!_this3.data.xs[id]) throw new Error("x is not defined for id = \"" + id + "\".");
|
20808 | });
|
20809 | // convert to target
|
20810 | var targets = ids.map(function (id, index) {
|
20811 | var convertedId = config.data_idConverter.bind($$.api)(id),
|
20812 | xKey = $$.getXKey(id),
|
20813 | isCategory = isCustomX && isCategorized,
|
20814 | hasCategory = isCategory && data.map(function (v) {
|
20815 | return v.x;
|
20816 | }).every(function (v) {
|
20817 | return config.axis_x_categories.indexOf(v) > -1;
|
20818 | });
|
20819 | return {
|
20820 | id: convertedId,
|
20821 | id_org: id,
|
20822 | values: data.map(function (d, i) {
|
20823 | var x,
|
20824 | rawX = d[xKey],
|
20825 | value = d[id];
|
20826 | return value = value === null || isNaN(value) || isObject(value) ? isArray(value) || isObject(value) ? value : null : +value, (isCategory || state.hasRadar) && index === 0 && !isUndefined(rawX) ? (!hasCategory && index === 0 && i === 0 && (config.axis_x_categories = []), x = config.axis_x_categories.indexOf(rawX), x === -1 && (x = config.axis_x_categories.length, config.axis_x_categories.push(rawX))) : x = $$.generateTargetX(rawX, id, i), (isUndefined(value) || $$.data.xs[id].length <= i) && (x = undefined), {
|
20827 | x: x,
|
20828 | value: value,
|
20829 | id: convertedId
|
20830 | };
|
20831 | }).filter(function (v) {
|
20832 | return isDefined(v.x);
|
20833 | })
|
20834 | };
|
20835 | }); // finish targets
|
20836 |
|
20837 | return targets.forEach(function (t) {
|
20838 | config.data_xSort && (t.values = t.values.sort(function (v1, v2) {
|
20839 | var x1 = v1.x || v1.x === 0 ? v1.x : Infinity,
|
20840 | x2 = v2.x || v2.x === 0 ? v2.x : Infinity;
|
20841 | return x1 - x2;
|
20842 | })), t.values.forEach(function (v, i) {
|
20843 | return v.index = i;
|
20844 | }), $$.data.xs[t.id].sort(function (v1, v2) {
|
20845 | return v1 - v2;
|
20846 | });
|
20847 | }), state.hasNegativeValue = $$.hasNegativeValueInTargets(targets), state.hasPositiveValue = $$.hasPositiveValueInTargets(targets), config.data_type && $$.setTargetType($$.mapToIds(targets).filter(function (id) {
|
20848 | return !(id in config.data_types);
|
20849 | }), config.data_type), targets.forEach(function (d) {
|
20850 | return $$.cache.add(d.id_org, d, !0);
|
20851 | }), targets;
|
20852 | }
|
20853 | });
|
20854 | ;// CONCATENATED MODULE: ./src/ChartInternal/data/data.ts
|
20855 | /**
|
20856 | * Copyright (c) 2017 ~ present NAVER Corp.
|
20857 | * billboard.js project is licensed under the MIT license
|
20858 | */
|
20859 |
|
20860 |
|
20861 |
|
20862 | /* harmony default export */ var ChartInternal_data_data = ({
|
20863 | isX: function isX(key) {
|
20864 | var $$ = this,
|
20865 | config = $$.config,
|
20866 | dataKey = config.data_x && key === config.data_x,
|
20867 | existValue = notEmpty(config.data_xs) && hasValue(config.data_xs, key);
|
20868 | return dataKey || existValue;
|
20869 | },
|
20870 | isNotX: function isNotX(key) {
|
20871 | return !this.isX(key);
|
20872 | },
|
20873 | isStackNormalized: function isStackNormalized() {
|
20874 | var config = this.config;
|
20875 | return !!(config.data_stack_normalize && config.data_groups.length);
|
20876 | },
|
20877 | isGrouped: function isGrouped(id) {
|
20878 | var groups = this.config.data_groups;
|
20879 | return id ? groups.some(function (v) {
|
20880 | return v.indexOf(id) >= 0 && v.length > 1;
|
20881 | }) : groups.length > 0;
|
20882 | },
|
20883 | getXKey: function getXKey(id) {
|
20884 | var $$ = this,
|
20885 | config = $$.config;
|
20886 | return config.data_x ? config.data_x : notEmpty(config.data_xs) ? config.data_xs[id] : null;
|
20887 | },
|
20888 | getXValuesOfXKey: function getXValuesOfXKey(key, targets) {
|
20889 | var xValues,
|
20890 | $$ = this,
|
20891 | ids = targets && notEmpty(targets) ? $$.mapToIds(targets) : [];
|
20892 | return ids.forEach(function (id) {
|
20893 | $$.getXKey(id) === key && (xValues = $$.data.xs[id]);
|
20894 | }), xValues;
|
20895 | },
|
20896 |
|
20897 | /**
|
20898 | * Get index number based on given x Axis value
|
20899 | * @param {Date|number|string} x x Axis to be compared
|
20900 | * @param {Array} basedX x Axis list to be based on
|
20901 | * @returns {number} index number
|
20902 | * @private
|
20903 | */
|
20904 | getIndexByX: function getIndexByX(x, basedX) {
|
20905 | var $$ = this;
|
20906 | return basedX ? basedX.indexOf(isString(x) ? x : +x) : ($$.filterByX($$.data.targets, x)[0] || {
|
20907 | index: null
|
20908 | }).index;
|
20909 | },
|
20910 | getXValue: function getXValue(id, i) {
|
20911 | var $$ = this;
|
20912 | return id in $$.data.xs && $$.data.xs[id] && isValue($$.data.xs[id][i]) ? $$.data.xs[id][i] : i;
|
20913 | },
|
20914 | getOtherTargetXs: function getOtherTargetXs() {
|
20915 | var $$ = this,
|
20916 | idsForX = Object.keys($$.data.xs);
|
20917 | return idsForX.length ? $$.data.xs[idsForX[0]] : null;
|
20918 | },
|
20919 | getOtherTargetX: function getOtherTargetX(index) {
|
20920 | var xs = this.getOtherTargetXs();
|
20921 | return xs && index < xs.length ? xs[index] : null;
|
20922 | },
|
20923 | addXs: function addXs(xs) {
|
20924 | var $$ = this,
|
20925 | config = $$.config;
|
20926 | Object.keys(xs).forEach(function (id) {
|
20927 | config.data_xs[id] = xs[id];
|
20928 | });
|
20929 | },
|
20930 | isMultipleX: function isMultipleX() {
|
20931 | return notEmpty(this.config.data_xs) || !this.config.data_xSort || this.hasType("bubble") || this.hasType("scatter");
|
20932 | },
|
20933 | addName: function addName(data) {
|
20934 | var name,
|
20935 | $$ = this,
|
20936 | config = $$.config;
|
20937 | return data && (name = config.data_names[data.id], data.name = name === undefined ? data.id : name), data;
|
20938 | },
|
20939 |
|
20940 | /**
|
20941 | * Get all values on given index
|
20942 | * @param {number} index Index
|
20943 | * @param {boolean} filterNull Filter nullish value
|
20944 | * @returns {Array}
|
20945 | * @private
|
20946 | */
|
20947 | getAllValuesOnIndex: function getAllValuesOnIndex(index, filterNull) {
|
20948 | filterNull === void 0 && (filterNull = !1);
|
20949 | var $$ = this,
|
20950 | value = $$.filterTargetsToShow($$.data.targets).map(function (t) {
|
20951 | return $$.addName($$.getValueOnIndex(t.values, index));
|
20952 | });
|
20953 | return filterNull && (value = value.filter(function (v) {
|
20954 | return isValue(v.value);
|
20955 | })), value;
|
20956 | },
|
20957 | getValueOnIndex: function getValueOnIndex(values, index) {
|
20958 | var valueOnIndex = values.filter(function (v) {
|
20959 | return v.index === index;
|
20960 | });
|
20961 | return valueOnIndex.length ? valueOnIndex[0] : null;
|
20962 | },
|
20963 | updateTargetX: function updateTargetX(targets, x) {
|
20964 | var $$ = this;
|
20965 | targets.forEach(function (t) {
|
20966 | t.values.forEach(function (v, i) {
|
20967 | v.x = $$.generateTargetX(x[i], t.id, i);
|
20968 | }), $$.data.xs[t.id] = x;
|
20969 | });
|
20970 | },
|
20971 | updateTargetXs: function updateTargetXs(targets, xs) {
|
20972 | var $$ = this;
|
20973 | targets.forEach(function (t) {
|
20974 | xs[t.id] && $$.updateTargetX([t], xs[t.id]);
|
20975 | });
|
20976 | },
|
20977 | generateTargetX: function generateTargetX(rawX, id, index) {
|
20978 | var $$ = this,
|
20979 | axis = $$.axis,
|
20980 | x = axis && axis.isCategorized() ? index : rawX || index;
|
20981 |
|
20982 | if (axis && axis.isTimeSeries()) {
|
20983 | var fn = parseDate.bind($$);
|
20984 | x = rawX ? fn(rawX) : fn($$.getXValue(id, index));
|
20985 | } else axis && axis.isCustomX() && !axis.isCategorized() && (x = isValue(rawX) ? +rawX : $$.getXValue(id, index));
|
20986 |
|
20987 | return x;
|
20988 | },
|
20989 | updateXs: function updateXs(values) {
|
20990 | values.length && (this.axis.xs = values.map(function (v) {
|
20991 | return v.x;
|
20992 | }));
|
20993 | },
|
20994 | getPrevX: function getPrevX(i) {
|
20995 | var x = this.axis.xs[i - 1];
|
20996 | return isDefined(x) ? x : null;
|
20997 | },
|
20998 | getNextX: function getNextX(i) {
|
20999 | var x = this.axis.xs[i + 1];
|
21000 | return isDefined(x) ? x : null;
|
21001 | },
|
21002 |
|
21003 | /**
|
21004 | * Get base value isAreaRangeType
|
21005 | * @param {object} data Data object
|
21006 | * @returns {number}
|
21007 | * @private
|
21008 | */
|
21009 | getBaseValue: function getBaseValue(data) {
|
21010 | var $$ = this,
|
21011 | hasAxis = $$.state.hasAxis,
|
21012 | value = data.value;
|
21013 | return value && hasAxis && ($$.isAreaRangeType(data) ? value = $$.getRangedData(data, "mid") : $$.isBubbleZType(data) && (value = $$.getBubbleZData(value, "y"))), value;
|
21014 | },
|
21015 |
|
21016 | /**
|
21017 | * Get min/max value from the data
|
21018 | * @private
|
21019 | * @param {Array} data array data to be evaluated
|
21020 | * @returns {{min: {number}, max: {number}}}
|
21021 | */
|
21022 | getMinMaxValue: function getMinMaxValue(data) {
|
21023 | var min,
|
21024 | max,
|
21025 | getBaseValue = this.getBaseValue.bind(this);
|
21026 | return (data || this.data.targets.map(function (t) {
|
21027 | return t.values;
|
21028 | })).forEach(function (v, i) {
|
21029 | var value = v.map(getBaseValue).filter(isNumber);
|
21030 | min = Math.min.apply(Math, [i ? min : Infinity].concat(value)), max = Math.max.apply(Math, [i ? max : -Infinity].concat(value));
|
21031 | }), {
|
21032 | min: min,
|
21033 | max: max
|
21034 | };
|
21035 | },
|
21036 |
|
21037 | /**
|
21038 | * Get the min/max data
|
21039 | * @private
|
21040 | * @returns {{min: Array, max: Array}}
|
21041 | */
|
21042 | getMinMaxData: function getMinMaxData() {
|
21043 | var $$ = this,
|
21044 | cacheKey = KEY.dataMinMax,
|
21045 | minMaxData = $$.cache.get(cacheKey);
|
21046 |
|
21047 | if (!minMaxData) {
|
21048 | var data = $$.data.targets.map(function (t) {
|
21049 | return t.values;
|
21050 | }),
|
21051 | minMax = $$.getMinMaxValue(data),
|
21052 | min = [],
|
21053 | max = [];
|
21054 | // update the cached data
|
21055 | data.forEach(function (v) {
|
21056 | var minData = $$.getFilteredDataByValue(v, minMax.min),
|
21057 | maxData = $$.getFilteredDataByValue(v, minMax.max);
|
21058 | minData.length && (min = min.concat(minData)), maxData.length && (max = max.concat(maxData));
|
21059 | }), $$.cache.add(cacheKey, minMaxData = {
|
21060 | min: min,
|
21061 | max: max
|
21062 | });
|
21063 | }
|
21064 |
|
21065 | return minMaxData;
|
21066 | },
|
21067 |
|
21068 | /**
|
21069 | * Get sum of data per index
|
21070 | * @private
|
21071 | * @returns {Array}
|
21072 | */
|
21073 | getTotalPerIndex: function getTotalPerIndex() {
|
21074 | var $$ = this,
|
21075 | cacheKey = KEY.dataTotalPerIndex,
|
21076 | sum = $$.cache.get(cacheKey);
|
21077 | return $$.isStackNormalized() && !sum && (sum = [], $$.data.targets.forEach(function (row) {
|
21078 | row.values.forEach(function (v, i) {
|
21079 | sum[i] || (sum[i] = 0), sum[i] += isNumber(v.value) ? v.value : 0;
|
21080 | });
|
21081 | })), sum;
|
21082 | },
|
21083 |
|
21084 | /**
|
21085 | * Get total data sum
|
21086 | * @param {boolean} subtractHidden Subtract hidden data from total
|
21087 | * @returns {number}
|
21088 | * @private
|
21089 | */
|
21090 | getTotalDataSum: function getTotalDataSum(subtractHidden) {
|
21091 | var $$ = this,
|
21092 | cacheKey = KEY.dataTotalSum,
|
21093 | total = $$.cache.get(cacheKey);
|
21094 |
|
21095 | if (!isNumber(total)) {
|
21096 | var sum = mergeArray($$.data.targets.map(function (t) {
|
21097 | return t.values;
|
21098 | })).map(function (v) {
|
21099 | return v.value;
|
21100 | }).reduce(function (p, c) {
|
21101 | return p + c;
|
21102 | });
|
21103 | $$.cache.add(cacheKey, total = sum);
|
21104 | }
|
21105 |
|
21106 | return subtractHidden && (total -= $$.getHiddenTotalDataSum()), total;
|
21107 | },
|
21108 |
|
21109 | /**
|
21110 | * Get total hidden data sum
|
21111 | * @returns {number}
|
21112 | * @private
|
21113 | */
|
21114 | getHiddenTotalDataSum: function getHiddenTotalDataSum() {
|
21115 | var $$ = this,
|
21116 | api = $$.api,
|
21117 | hiddenTargetIds = $$.state.hiddenTargetIds,
|
21118 | total = 0;
|
21119 | return hiddenTargetIds.length && (total = api.data.values.bind(api)(hiddenTargetIds).reduce(function (p, c) {
|
21120 | return p + c;
|
21121 | })), total;
|
21122 | },
|
21123 |
|
21124 | /**
|
21125 | * Get filtered data by value
|
21126 | * @param {object} data Data
|
21127 | * @param {number} value Value to be filtered
|
21128 | * @returns {Array} filtered array data
|
21129 | * @private
|
21130 | */
|
21131 | getFilteredDataByValue: function getFilteredDataByValue(data, value) {
|
21132 | var _this = this;
|
21133 |
|
21134 | return data.filter(function (t) {
|
21135 | return _this.getBaseValue(t) === value;
|
21136 | });
|
21137 | },
|
21138 |
|
21139 | /**
|
21140 | * Return the max length of the data
|
21141 | * @returns {number} max data length
|
21142 | * @private
|
21143 | */
|
21144 | getMaxDataCount: function getMaxDataCount() {
|
21145 | return Math.max.apply(Math, this.data.targets.map(function (t) {
|
21146 | return t.values.length;
|
21147 | }));
|
21148 | },
|
21149 | getMaxDataCountTarget: function getMaxDataCountTarget() {
|
21150 | var target = this.filterTargetsToShow() || [],
|
21151 | length = target.length;
|
21152 | return length > 1 ? (target = target.map(function (t) {
|
21153 | return t.values;
|
21154 | }).reduce(function (a, b) {
|
21155 | return a.concat(b);
|
21156 | }).map(function (v) {
|
21157 | return v.x;
|
21158 | }), target = sortValue(getUnique(target)).map(function (x, index) {
|
21159 | return {
|
21160 | x: x,
|
21161 | index: index
|
21162 | };
|
21163 | })) : length && (target = target[0].values), target;
|
21164 | },
|
21165 | mapToIds: function mapToIds(targets) {
|
21166 | return targets.map(function (d) {
|
21167 | return d.id;
|
21168 | });
|
21169 | },
|
21170 | mapToTargetIds: function mapToTargetIds(ids) {
|
21171 | var $$ = this;
|
21172 | return ids ? isArray(ids) ? ids.concat() : [ids] : $$.mapToIds($$.data.targets);
|
21173 | },
|
21174 | hasTarget: function hasTarget(targets, id) {
|
21175 | var ids = this.mapToIds(targets);
|
21176 |
|
21177 | for (var val, i = 0; val = ids[i]; i++) if (val === id) return !0;
|
21178 |
|
21179 | return !1;
|
21180 | },
|
21181 | isTargetToShow: function isTargetToShow(targetId) {
|
21182 | return this.state.hiddenTargetIds.indexOf(targetId) < 0;
|
21183 | },
|
21184 | isLegendToShow: function isLegendToShow(targetId) {
|
21185 | return this.state.hiddenLegendIds.indexOf(targetId) < 0;
|
21186 | },
|
21187 | filterTargetsToShow: function filterTargetsToShow(targets) {
|
21188 | var $$ = this;
|
21189 | return (targets || $$.data.targets).filter(function (t) {
|
21190 | return $$.isTargetToShow(t.id);
|
21191 | });
|
21192 | },
|
21193 | mapTargetsToUniqueXs: function mapTargetsToUniqueXs(targets) {
|
21194 | var $$ = this,
|
21195 | axis = $$.axis,
|
21196 | xs = [];
|
21197 | return targets && targets.length && (xs = getUnique(mergeArray(targets.map(function (t) {
|
21198 | return t.values.map(function (v) {
|
21199 | return +v.x;
|
21200 | });
|
21201 | }))), xs = axis && axis.isTimeSeries() ? xs.map(function (x) {
|
21202 | return new Date(+x);
|
21203 | }) : xs.map(function (x) {
|
21204 | return +x;
|
21205 | })), sortValue(xs);
|
21206 | },
|
21207 | addHiddenTargetIds: function addHiddenTargetIds(targetIds) {
|
21208 | this.state.hiddenTargetIds = this.state.hiddenTargetIds.concat(targetIds);
|
21209 | },
|
21210 | removeHiddenTargetIds: function removeHiddenTargetIds(targetIds) {
|
21211 | this.state.hiddenTargetIds = this.state.hiddenTargetIds.filter(function (id) {
|
21212 | return targetIds.indexOf(id) < 0;
|
21213 | });
|
21214 | },
|
21215 | addHiddenLegendIds: function addHiddenLegendIds(targetIds) {
|
21216 | this.state.hiddenLegendIds = this.state.hiddenLegendIds.concat(targetIds);
|
21217 | },
|
21218 | removeHiddenLegendIds: function removeHiddenLegendIds(targetIds) {
|
21219 | this.state.hiddenLegendIds = this.state.hiddenLegendIds.filter(function (id) {
|
21220 | return targetIds.indexOf(id) < 0;
|
21221 | });
|
21222 | },
|
21223 | getValuesAsIdKeyed: function getValuesAsIdKeyed(targets) {
|
21224 | var $$ = this,
|
21225 | hasAxis = $$.state.hasAxis,
|
21226 | ys = {},
|
21227 | isMultipleX = $$.isMultipleX(),
|
21228 | xs = isMultipleX ? $$.mapTargetsToUniqueXs(targets).map(function (v) {
|
21229 | return isString(v) ? v : +v;
|
21230 | }) : null;
|
21231 | return targets.forEach(function (t) {
|
21232 | var data = [];
|
21233 | t.values.filter(function (v) {
|
21234 | return isValue(v.value);
|
21235 | }).forEach(function (v) {
|
21236 | var value = v.value; // exclude 'volume' value to correct mis domain calculation
|
21237 |
|
21238 | $$.isCandlestickType(v) && (value = isArray(value) ? value.slice(0, 4) : [value.open, value.high, value.low, value.close]), isArray(value) ? data.push.apply(data, value) : isObject(value) && "high" in value ? data.push.apply(data, Object.values(value)) : $$.isBubbleZType(v) ? data.push(hasAxis && $$.getBubbleZData(value, "y")) : isMultipleX ? data[$$.getIndexByX(v.x, xs)] = value : data.push(value);
|
21239 | }), ys[t.id] = data;
|
21240 | }), ys;
|
21241 | },
|
21242 | checkValueInTargets: function checkValueInTargets(targets, checker) {
|
21243 | var values,
|
21244 | ids = Object.keys(targets);
|
21245 |
|
21246 | for (var i = 0; i < ids.length; i++) {
|
21247 | values = targets[ids[i]].values;
|
21248 |
|
21249 | for (var j = 0; j < values.length; j++) if (checker(values[j].value)) return !0;
|
21250 | }
|
21251 |
|
21252 | return !1;
|
21253 | },
|
21254 | hasMultiTargets: function hasMultiTargets() {
|
21255 | return this.filterTargetsToShow().length > 1;
|
21256 | },
|
21257 | hasNegativeValueInTargets: function hasNegativeValueInTargets(targets) {
|
21258 | return this.checkValueInTargets(targets, function (v) {
|
21259 | return v < 0;
|
21260 | });
|
21261 | },
|
21262 | hasPositiveValueInTargets: function hasPositiveValueInTargets(targets) {
|
21263 | return this.checkValueInTargets(targets, function (v) {
|
21264 | return v > 0;
|
21265 | });
|
21266 | },
|
21267 | _checkOrder: function _checkOrder(type) {
|
21268 | var config = this.config,
|
21269 | order = config.data_order;
|
21270 | return isString(order) && order.toLowerCase() === type;
|
21271 | },
|
21272 | isOrderDesc: function isOrderDesc() {
|
21273 | return this._checkOrder("desc");
|
21274 | },
|
21275 | isOrderAsc: function isOrderAsc() {
|
21276 | return this._checkOrder("asc");
|
21277 | },
|
21278 |
|
21279 | /**
|
21280 | * Sort targets data
|
21281 | * @param {Array} targetsValue Target value
|
21282 | * @returns {Array}
|
21283 | * @private
|
21284 | */
|
21285 | orderTargets: function orderTargets(targetsValue) {
|
21286 | var $$ = this,
|
21287 | targets = [].concat(targetsValue),
|
21288 | fn = $$.getSortCompareFn();
|
21289 | return fn && targets.sort(fn), targets;
|
21290 | },
|
21291 |
|
21292 | /**
|
21293 | * Get data.order compare function
|
21294 | * @param {boolean} isArc Is for Arc type sort or not
|
21295 | * @returns {Function} compare function
|
21296 | * @private
|
21297 | */
|
21298 | getSortCompareFn: function getSortCompareFn(isArc) {
|
21299 | isArc === void 0 && (isArc = !1);
|
21300 | var fn,
|
21301 | $$ = this,
|
21302 | config = $$.config,
|
21303 | orderAsc = $$.isOrderAsc(),
|
21304 | orderDesc = $$.isOrderDesc();
|
21305 | return orderAsc || orderDesc ? fn = function (t1, t2) {
|
21306 | var reducer = function (p, c) {
|
21307 | return p + Math.abs(c.value);
|
21308 | },
|
21309 | t1Sum = t1.values.reduce(reducer, 0),
|
21310 | t2Sum = t2.values.reduce(reducer, 0);
|
21311 |
|
21312 | return isArc ? orderAsc ? t1Sum - t2Sum : t2Sum - t1Sum : orderAsc ? t2Sum - t1Sum : t1Sum - t2Sum;
|
21313 | } : isFunction(config.data_order) && (fn = config.data_order.bind($$.api)), fn || null;
|
21314 | },
|
21315 | filterByX: function filterByX(targets, x) {
|
21316 | return mergeArray(targets.map(function (t) {
|
21317 | return t.values;
|
21318 | })).filter(function (v) {
|
21319 | return v.x - x === 0;
|
21320 | });
|
21321 | },
|
21322 | filterRemoveNull: function filterRemoveNull(data) {
|
21323 | var _this2 = this;
|
21324 |
|
21325 | return data.filter(function (d) {
|
21326 | return isValue(_this2.getBaseValue(d));
|
21327 | });
|
21328 | },
|
21329 | filterByXDomain: function filterByXDomain(targets, xDomain) {
|
21330 | return targets.map(function (t) {
|
21331 | return {
|
21332 | id: t.id,
|
21333 | id_org: t.id_org,
|
21334 | values: t.values.filter(function (v) {
|
21335 | return xDomain[0] <= v.x && v.x <= xDomain[1];
|
21336 | })
|
21337 | };
|
21338 | });
|
21339 | },
|
21340 | hasDataLabel: function hasDataLabel() {
|
21341 | var dataLabels = this.config.data_labels;
|
21342 | return isboolean(dataLabels) && dataLabels || isObjectType(dataLabels) && notEmpty(dataLabels);
|
21343 | },
|
21344 |
|
21345 | /**
|
21346 | * Get data index from the event coodinates
|
21347 | * @param {Event} event Event object
|
21348 | * @returns {number}
|
21349 | */
|
21350 | getDataIndexFromEvent: function getDataIndexFromEvent(event) {
|
21351 | var $$ = this,
|
21352 | config = $$.config,
|
21353 | _$$$state = $$.state,
|
21354 | inputType = _$$$state.inputType,
|
21355 | _$$$state$eventReceiv = _$$$state.eventReceiver,
|
21356 | coords = _$$$state$eventReceiv.coords,
|
21357 | rect = _$$$state$eventReceiv.rect,
|
21358 | isRotated = config.axis_rotated,
|
21359 | e = inputType === "touch" && event.changedTouches ? event.changedTouches[0] : event,
|
21360 | index = findIndex(coords, isRotated ? e.clientY - rect.top : e.clientX - rect.left, 0, coords.length - 1, isRotated);
|
21361 | return index;
|
21362 | },
|
21363 | getDataLabelLength: function getDataLabelLength(min, max, key) {
|
21364 | var $$ = this,
|
21365 | lengths = [0, 0];
|
21366 | return $$.$el.chart.select("svg").selectAll(".dummy").data([min, max]).enter().append("text").text(function (d) {
|
21367 | return $$.dataLabelFormat(d.id)(d);
|
21368 | }).each(function (d, i) {
|
21369 | lengths[i] = this.getBoundingClientRect()[key] * 1.3;
|
21370 | }).remove(), lengths;
|
21371 | },
|
21372 | isNoneArc: function isNoneArc(d) {
|
21373 | return this.hasTarget(this.data.targets, d.id);
|
21374 | },
|
21375 | isArc: function isArc(d) {
|
21376 | return "data" in d && this.hasTarget(this.data.targets, d.data.id);
|
21377 | },
|
21378 | findSameXOfValues: function findSameXOfValues(values, index) {
|
21379 | var i,
|
21380 | targetX = values[index].x,
|
21381 | sames = [];
|
21382 |
|
21383 | for (i = index - 1; i >= 0 && !(targetX !== values[i].x); i--) sames.push(values[i]);
|
21384 |
|
21385 | for (i = index; i < values.length && !(targetX !== values[i].x); i++) sames.push(values[i]);
|
21386 |
|
21387 | return sames;
|
21388 | },
|
21389 | findClosestFromTargets: function findClosestFromTargets(targets, pos) {
|
21390 | var $$ = this,
|
21391 | candidates = targets.map(function (target) {
|
21392 | return $$.findClosest(target.values, pos);
|
21393 | });
|
21394 | // map to array of closest points of each target
|
21395 | // decide closest point and return
|
21396 | return $$.findClosest(candidates, pos);
|
21397 | },
|
21398 | findClosest: function findClosest(values, pos) {
|
21399 | var closest,
|
21400 | $$ = this,
|
21401 | config = $$.config,
|
21402 | main = $$.$el.main,
|
21403 | data = values.filter(function (v) {
|
21404 | return v && isValue(v.value);
|
21405 | }),
|
21406 | minDist = config.point_sensitivity;
|
21407 | return data.filter(function (v) {
|
21408 | return $$.isBarType(v.id);
|
21409 | }).forEach(function (v) {
|
21410 | var shape = main.select("." + config_classes.bars + $$.getTargetSelectorSuffix(v.id) + " ." + config_classes.bar + "-" + v.index).node();
|
21411 | !closest && $$.isWithinBar(shape) && (closest = v);
|
21412 | }), data.filter(function (v) {
|
21413 | return !$$.isBarType(v.id);
|
21414 | }).forEach(function (v) {
|
21415 | var d = $$.dist(v, pos);
|
21416 | d < minDist && (minDist = d, closest = v);
|
21417 | }), closest;
|
21418 | },
|
21419 | dist: function dist(data, pos) {
|
21420 | var $$ = this,
|
21421 | isRotated = $$.config.axis_rotated,
|
21422 | scale = $$.scale,
|
21423 | xIndex = isRotated ? 1 : 0,
|
21424 | yIndex = isRotated ? 0 : 1,
|
21425 | y = $$.circleY(data, data.index),
|
21426 | x = (scale.zoom || scale.x)(data.x);
|
21427 | return Math.sqrt(Math.pow(x - pos[xIndex], 2) + Math.pow(y - pos[yIndex], 2));
|
21428 | },
|
21429 |
|
21430 | /**
|
21431 | * Convert data for step type
|
21432 | * @param {Array} values Object data values
|
21433 | * @returns {Array}
|
21434 | * @private
|
21435 | */
|
21436 | convertValuesToStep: function convertValuesToStep(values) {
|
21437 | var $$ = this,
|
21438 | axis = $$.axis,
|
21439 | config = $$.config,
|
21440 | stepType = config.line_step_type,
|
21441 | isCategorized = !!axis && axis.isCategorized(),
|
21442 | converted = isArray(values) ? values.concat() : [values];
|
21443 | if (!(isCategorized || /step\-(after|before)/.test(stepType))) return values; // insert & append cloning first/last value to be fully rendered covering on each gap sides
|
21444 |
|
21445 | var head = converted[0],
|
21446 | tail = converted[converted.length - 1],
|
21447 | id = head.id,
|
21448 | x = head.x;
|
21449 | return converted.unshift({
|
21450 | x: --x,
|
21451 | value: head.value,
|
21452 | id: id
|
21453 | }), isCategorized && stepType === "step-after" && converted.unshift({
|
21454 | x: --x,
|
21455 | value: head.value,
|
21456 | id: id
|
21457 | }), x = tail.x, converted.push({
|
21458 | x: ++x,
|
21459 | value: tail.value,
|
21460 | id: id
|
21461 | }), isCategorized && stepType === "step-before" && converted.push({
|
21462 | x: ++x,
|
21463 | value: tail.value,
|
21464 | id: id
|
21465 | }), converted;
|
21466 | },
|
21467 | convertValuesToRange: function convertValuesToRange(values) {
|
21468 | var converted = isArray(values) ? values.concat() : [values],
|
21469 | ranges = [];
|
21470 | return converted.forEach(function (range) {
|
21471 | var x = range.x,
|
21472 | id = range.id;
|
21473 | ranges.push({
|
21474 | x: x,
|
21475 | id: id,
|
21476 | value: range.value[0]
|
21477 | }), ranges.push({
|
21478 | x: x,
|
21479 | id: id,
|
21480 | value: range.value[2]
|
21481 | });
|
21482 | }), ranges;
|
21483 | },
|
21484 | updateDataAttributes: function updateDataAttributes(name, attrs) {
|
21485 | var $$ = this,
|
21486 | config = $$.config,
|
21487 | current = config["data_" + name];
|
21488 | return isUndefined(attrs) ? current : (Object.keys(attrs).forEach(function (id) {
|
21489 | current[id] = attrs[id];
|
21490 | }), $$.redraw({
|
21491 | withLegend: !0
|
21492 | }), current);
|
21493 | },
|
21494 | getRangedData: function getRangedData(d, key, type) {
|
21495 | key === void 0 && (key = ""), type === void 0 && (type = "areaRange");
|
21496 | var value = d == null ? void 0 : d.value;
|
21497 |
|
21498 | if (isArray(value)) {
|
21499 | // @ts-ignore
|
21500 | var index = {
|
21501 | areaRange: ["high", "mid", "low"],
|
21502 | candlestick: ["open", "high", "low", "close", "volume"]
|
21503 | }[type].indexOf(key);
|
21504 | return index >= 0 && value ? value[index] : undefined;
|
21505 | }
|
21506 |
|
21507 | return value ? value[key] : value;
|
21508 | },
|
21509 |
|
21510 | /**
|
21511 | * Get ratio value
|
21512 | * @param {string} type Ratio for given type
|
21513 | * @param {object} d Data value object
|
21514 | * @param {boolean} asPercent Convert the return as percent or not
|
21515 | * @returns {number} Ratio value
|
21516 | * @private
|
21517 | */
|
21518 | getRatio: function getRatio(type, d, asPercent) {
|
21519 | var $$ = this,
|
21520 | config = $$.config,
|
21521 | state = $$.state,
|
21522 | api = $$.api,
|
21523 | ratio = 0;
|
21524 | if (d && api.data.shown().length) if (ratio = d.ratio || d.value, type === "arc") {
|
21525 | // if has padAngle set, calculate rate based on value
|
21526 | if ($$.pie.padAngle()()) ratio = d.value / $$.getTotalDataSum(!0);else {
|
21527 | var gaugeArcLength = config.gauge_fullCircle ? $$.getArcLength() : $$.getStartAngle() * -2,
|
21528 | arcLength = $$.hasType("gauge") ? gaugeArcLength : Math.PI * 2;
|
21529 | ratio = (d.endAngle - d.startAngle) / arcLength;
|
21530 | }
|
21531 | } else if (type === "index") {
|
21532 | var dataValues = api.data.values.bind(api),
|
21533 | total = this.getTotalPerIndex();
|
21534 |
|
21535 | if (state.hiddenTargetIds.length) {
|
21536 | var hiddenSum = dataValues(state.hiddenTargetIds, !1);
|
21537 | hiddenSum.length && (hiddenSum = hiddenSum.reduce(function (acc, curr) {
|
21538 | return acc.map(function (v, i) {
|
21539 | return (isNumber(v) ? v : 0) + curr[i];
|
21540 | });
|
21541 | }), total = total.map(function (v, i) {
|
21542 | return v - hiddenSum[i];
|
21543 | }));
|
21544 | }
|
21545 |
|
21546 | d.ratio = isNumber(d.value) && total && total[d.index] > 0 ? d.value / total[d.index] : 0, ratio = d.ratio;
|
21547 | } else if (type === "radar") ratio = parseFloat(Math.max(d.value, 0) + "") / state.current.dataMax * config.radar_size_ratio;else if (type === "bar") {
|
21548 | var yScale = $$.getYScaleById.bind($$)(d.id),
|
21549 | max = yScale.domain().reduce(function (a, c) {
|
21550 | return c - a;
|
21551 | });
|
21552 | ratio = Math.abs(d.value) / max;
|
21553 | }
|
21554 | return asPercent && ratio ? ratio * 100 : ratio;
|
21555 | },
|
21556 |
|
21557 | /**
|
21558 | * Sort data index to be aligned with x axis.
|
21559 | * @param {Array} tickValues Tick array values
|
21560 | * @private
|
21561 | */
|
21562 | updateDataIndexByX: function updateDataIndexByX(tickValues) {
|
21563 | var $$ = this,
|
21564 | tickValueMap = tickValues.reduce(function (out, tick, index) {
|
21565 | return out[+tick.x] = index, out;
|
21566 | }, {});
|
21567 | $$.data.targets.forEach(function (t) {
|
21568 | t.values.forEach(function (value, valueIndex) {
|
21569 | var index = tickValueMap[+value.x];
|
21570 | index === undefined && (index = valueIndex), value.index = index;
|
21571 | });
|
21572 | });
|
21573 | },
|
21574 |
|
21575 | /**
|
21576 | * Determine if bubble has dimension data
|
21577 | * @param {object|Array} d data value
|
21578 | * @returns {boolean}
|
21579 | * @private
|
21580 | */
|
21581 | isBubbleZType: function isBubbleZType(d) {
|
21582 | var $$ = this;
|
21583 | return $$.isBubbleType(d) && (isObject(d.value) && ("z" in d.value || "y" in d.value) || isArray(d.value) && d.value.length === 2);
|
21584 | },
|
21585 |
|
21586 | /**
|
21587 | * Get data object by id
|
21588 | * @param {string} id data id
|
21589 | * @returns {object}
|
21590 | * @private
|
21591 | */
|
21592 | getDataById: function getDataById(id) {
|
21593 | var d = this.cache.get(id) || this.api.data(id);
|
21594 | return isArray(d) ? d[0] : d;
|
21595 | }
|
21596 | });
|
21597 | ;// CONCATENATED MODULE: ./src/ChartInternal/data/load.ts
|
21598 | /**
|
21599 | * Copyright (c) 2017 ~ present NAVER Corp.
|
21600 | * billboard.js project is licensed under the MIT license
|
21601 | */
|
21602 |
|
21603 |
|
21604 | /* harmony default export */ var load = ({
|
21605 | load: function load(rawTargets, args) {
|
21606 | var $$ = this,
|
21607 | targets = rawTargets;
|
21608 | // Set targets
|
21609 | // Redraw with new targets
|
21610 | // Update current state chart type and elements list after redraw
|
21611 | targets && (args.filter && (targets = targets.filter(args.filter)), (args.type || args.types) && targets.forEach(function (t) {
|
21612 | var type = args.types && args.types[t.id] || args.type;
|
21613 | $$.setTargetType(t.id, type);
|
21614 | }), $$.data.targets.forEach(function (d) {
|
21615 | for (var i = 0; i < targets.length; i++) if (d.id === targets[i].id) {
|
21616 | d.values = targets[i].values, targets.splice(i, 1);
|
21617 | break;
|
21618 | }
|
21619 | }), $$.data.targets = $$.data.targets.concat(targets)), $$.updateTargets($$.data.targets), $$.redraw({
|
21620 | withUpdateOrgXDomain: !0,
|
21621 | withUpdateXDomain: !0,
|
21622 | withLegend: !0
|
21623 | }), $$.updateTypesElements(), args.done && args.done.call($$.api);
|
21624 | },
|
21625 | loadFromArgs: function loadFromArgs(args) {
|
21626 | var $$ = this; // prevent load when chart is already destroyed
|
21627 |
|
21628 | if ($$.config) {
|
21629 | $$.cache.reset();
|
21630 | var data = args.data || $$.convertData(args, function (d) {
|
21631 | return $$.load($$.convertDataToTargets(d), args);
|
21632 | });
|
21633 | data && $$.load($$.convertDataToTargets(data), args);
|
21634 | } // reset internally cached data
|
21635 |
|
21636 | },
|
21637 | unload: function unload(rawTargetIds, customDoneCb) {
|
21638 | var $$ = this,
|
21639 | state = $$.state,
|
21640 | $el = $$.$el,
|
21641 | done = customDoneCb,
|
21642 | targetIds = rawTargetIds;
|
21643 | // If no target, call done and return
|
21644 | return $$.cache.reset(), done || (done = function () {}), targetIds = targetIds.filter(function (id) {
|
21645 | return $$.hasTarget($$.data.targets, id);
|
21646 | }), targetIds && targetIds.length !== 0 ? void ( // Update current state chart type and elements list after redraw
|
21647 | $el.svg.selectAll(targetIds.map(function (id) {
|
21648 | return $$.selectorTarget(id);
|
21649 | })).transition().style("opacity", "0").remove().call(endall, done), targetIds.forEach(function (id) {
|
21650 | state.withoutFadeIn[id] = !1, $el.legend && $el.legend.selectAll("." + config_classes.legendItem + $$.getTargetSelectorSuffix(id)).remove(), $$.data.targets = $$.data.targets.filter(function (t) {
|
21651 | return t.id !== id;
|
21652 | });
|
21653 | }), $$.updateTypesElements()) : void done();
|
21654 | }
|
21655 | });
|
21656 | ;// CONCATENATED MODULE: ./node_modules/d3-drag/src/constant.js
|
21657 | /* harmony default export */ var d3_drag_src_constant = (function (x) {
|
21658 | return function () {
|
21659 | return x;
|
21660 | };
|
21661 | });
|
21662 | ;// CONCATENATED MODULE: ./node_modules/d3-drag/src/event.js
|
21663 | function DragEvent(type, _ref) {
|
21664 | var sourceEvent = _ref.sourceEvent,
|
21665 | subject = _ref.subject,
|
21666 | target = _ref.target,
|
21667 | identifier = _ref.identifier,
|
21668 | active = _ref.active,
|
21669 | x = _ref.x,
|
21670 | y = _ref.y,
|
21671 | dx = _ref.dx,
|
21672 | dy = _ref.dy,
|
21673 | dispatch = _ref.dispatch;
|
21674 | Object.defineProperties(this, {
|
21675 | type: {
|
21676 | value: type,
|
21677 | enumerable: !0,
|
21678 | configurable: !0
|
21679 | },
|
21680 | sourceEvent: {
|
21681 | value: sourceEvent,
|
21682 | enumerable: !0,
|
21683 | configurable: !0
|
21684 | },
|
21685 | subject: {
|
21686 | value: subject,
|
21687 | enumerable: !0,
|
21688 | configurable: !0
|
21689 | },
|
21690 | target: {
|
21691 | value: target,
|
21692 | enumerable: !0,
|
21693 | configurable: !0
|
21694 | },
|
21695 | identifier: {
|
21696 | value: identifier,
|
21697 | enumerable: !0,
|
21698 | configurable: !0
|
21699 | },
|
21700 | active: {
|
21701 | value: active,
|
21702 | enumerable: !0,
|
21703 | configurable: !0
|
21704 | },
|
21705 | x: {
|
21706 | value: x,
|
21707 | enumerable: !0,
|
21708 | configurable: !0
|
21709 | },
|
21710 | y: {
|
21711 | value: y,
|
21712 | enumerable: !0,
|
21713 | configurable: !0
|
21714 | },
|
21715 | dx: {
|
21716 | value: dx,
|
21717 | enumerable: !0,
|
21718 | configurable: !0
|
21719 | },
|
21720 | dy: {
|
21721 | value: dy,
|
21722 | enumerable: !0,
|
21723 | configurable: !0
|
21724 | },
|
21725 | _: {
|
21726 | value: dispatch
|
21727 | }
|
21728 | });
|
21729 | }
|
21730 |
|
21731 | DragEvent.prototype.on = function () {
|
21732 | var value = this._.on.apply(this._, arguments);
|
21733 |
|
21734 | return value === this._ ? this : value;
|
21735 | };
|
21736 | ;// CONCATENATED MODULE: ./node_modules/d3-drag/src/drag.js
|
21737 |
|
21738 |
|
21739 |
|
21740 |
|
21741 |
|
21742 | // Ignore right-click, since that should open the context menu.
|
21743 |
|
21744 | function drag_defaultFilter(event) {
|
21745 | return !event.ctrlKey && !event.button;
|
21746 | }
|
21747 |
|
21748 | function defaultContainer() {
|
21749 | return this.parentNode;
|
21750 | }
|
21751 |
|
21752 | function defaultSubject(event, d) {
|
21753 | return d == null ? {
|
21754 | x: event.x,
|
21755 | y: event.y
|
21756 | } : d;
|
21757 | }
|
21758 |
|
21759 | function drag_defaultTouchable() {
|
21760 | return navigator.maxTouchPoints || "ontouchstart" in this;
|
21761 | }
|
21762 |
|
21763 | /* harmony default export */ function drag() {
|
21764 | function drag(selection) {
|
21765 | selection.on("mousedown.drag", mousedowned).filter(touchable).on("touchstart.drag", touchstarted).on("touchmove.drag", touchmoved).on("touchend.drag touchcancel.drag", touchended).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
21766 | }
|
21767 |
|
21768 | function mousedowned(event, d) {
|
21769 | if (!touchending && filter.call(this, event, d)) {
|
21770 | var gesture = beforestart(this, container.call(this, event, d), event, d, "mouse");
|
21771 | gesture && (src_select(event.view).on("mousemove.drag", mousemoved, !0).on("mouseup.drag", mouseupped, !0), nodrag(event.view), nopropagation(event), mousemoving = !1, mousedownx = event.clientX, mousedowny = event.clientY, gesture("start", event));
|
21772 | }
|
21773 | }
|
21774 |
|
21775 | function mousemoved(event) {
|
21776 | if (noevent(event), !mousemoving) {
|
21777 | var dx = event.clientX - mousedownx,
|
21778 | dy = event.clientY - mousedowny;
|
21779 | mousemoving = dx * dx + dy * dy > clickDistance2;
|
21780 | }
|
21781 |
|
21782 | gestures.mouse("drag", event);
|
21783 | }
|
21784 |
|
21785 | function mouseupped(event) {
|
21786 | src_select(event.view).on("mousemove.drag mouseup.drag", null), yesdrag(event.view, mousemoving), noevent(event), gestures.mouse("end", event);
|
21787 | }
|
21788 |
|
21789 | function touchstarted(event, d) {
|
21790 | if (filter.call(this, event, d)) {
|
21791 | var i,
|
21792 | gesture,
|
21793 | touches = event.changedTouches,
|
21794 | c = container.call(this, event, d),
|
21795 | n = touches.length;
|
21796 |
|
21797 | for (i = 0; i < n; ++i) (gesture = beforestart(this, c, event, d, touches[i].identifier, touches[i])) && (nopropagation(event), gesture("start", event, touches[i]));
|
21798 | }
|
21799 | }
|
21800 |
|
21801 | function touchmoved(event) {
|
21802 | var i,
|
21803 | gesture,
|
21804 | touches = event.changedTouches,
|
21805 | n = touches.length;
|
21806 |
|
21807 | for (i = 0; i < n; ++i) (gesture = gestures[touches[i].identifier]) && (noevent(event), gesture("drag", event, touches[i]));
|
21808 | }
|
21809 |
|
21810 | function touchended(event) {
|
21811 | var i,
|
21812 | gesture,
|
21813 | touches = event.changedTouches,
|
21814 | n = touches.length;
|
21815 |
|
21816 | // Ghost clicks are delayed!
|
21817 | for (touchending && clearTimeout(touchending), touchending = setTimeout(function () {
|
21818 | touchending = null;
|
21819 | }, 500), i = 0; i < n; ++i) (gesture = gestures[touches[i].identifier]) && (nopropagation(event), gesture("end", event, touches[i]));
|
21820 | }
|
21821 |
|
21822 | function beforestart(that, container, event, d, identifier, touch) {
|
21823 | var dx,
|
21824 | dy,
|
21825 | s,
|
21826 | dispatch = listeners.copy(),
|
21827 | p = src_pointer(touch || event, container);
|
21828 | if ((s = subject.call(that, new DragEvent("beforestart", {
|
21829 | sourceEvent: event,
|
21830 | target: drag,
|
21831 | identifier: identifier,
|
21832 | active: active,
|
21833 | x: p[0],
|
21834 | y: p[1],
|
21835 | dx: 0,
|
21836 | dy: 0,
|
21837 | dispatch: dispatch
|
21838 | }), d)) != null) return dx = s.x - p[0] || 0, dy = s.y - p[1] || 0, function gesture(type, event, touch) {
|
21839 | var n,
|
21840 | p0 = p;
|
21841 |
|
21842 | switch (type) {
|
21843 | case "start":
|
21844 | gestures[identifier] = gesture, n = active++;
|
21845 | break;
|
21846 |
|
21847 | case "end":
|
21848 | delete gestures[identifier], --active;
|
21849 | // nobreak
|
21850 |
|
21851 | case "drag":
|
21852 | p = src_pointer(touch || event, container), n = active;
|
21853 | }
|
21854 |
|
21855 | dispatch.call(type, that, new DragEvent(type, {
|
21856 | sourceEvent: event,
|
21857 | subject: s,
|
21858 | target: drag,
|
21859 | identifier: identifier,
|
21860 | active: n,
|
21861 | x: p[0] + dx,
|
21862 | y: p[1] + dy,
|
21863 | dx: p[0] - p0[0],
|
21864 | dy: p[1] - p0[1],
|
21865 | dispatch: dispatch
|
21866 | }), d);
|
21867 | };
|
21868 | }
|
21869 |
|
21870 | var mousedownx,
|
21871 | mousedowny,
|
21872 | mousemoving,
|
21873 | touchending,
|
21874 | filter = drag_defaultFilter,
|
21875 | container = defaultContainer,
|
21876 | subject = defaultSubject,
|
21877 | touchable = drag_defaultTouchable,
|
21878 | gestures = {},
|
21879 | listeners = src_dispatch("start", "drag", "end"),
|
21880 | active = 0,
|
21881 | clickDistance2 = 0;
|
21882 | return drag.filter = function (_) {
|
21883 | return arguments.length ? (filter = typeof _ === "function" ? _ : d3_drag_src_constant(!!_), drag) : filter;
|
21884 | }, drag.container = function (_) {
|
21885 | return arguments.length ? (container = typeof _ === "function" ? _ : d3_drag_src_constant(_), drag) : container;
|
21886 | }, drag.subject = function (_) {
|
21887 | return arguments.length ? (subject = typeof _ === "function" ? _ : d3_drag_src_constant(_), drag) : subject;
|
21888 | }, drag.touchable = function (_) {
|
21889 | return arguments.length ? (touchable = typeof _ === "function" ? _ : d3_drag_src_constant(!!_), drag) : touchable;
|
21890 | }, drag.on = function () {
|
21891 | var value = listeners.on.apply(listeners, arguments);
|
21892 | return value === listeners ? drag : value;
|
21893 | }, drag.clickDistance = function (_) {
|
21894 | return arguments.length ? (clickDistance2 = (_ = +_) * _, drag) : Math.sqrt(clickDistance2);
|
21895 | }, drag;
|
21896 | }
|
21897 | ;// CONCATENATED MODULE: ./src/ChartInternal/interactions/interaction.ts
|
21898 | /**
|
21899 | * Copyright (c) 2017 ~ present NAVER Corp.
|
21900 | * billboard.js project is licensed under the MIT license
|
21901 | */
|
21902 |
|
21903 |
|
21904 |
|
21905 |
|
21906 |
|
21907 | /* harmony default export */ var interactions_interaction = ({
|
21908 | selectRectForSingle: function selectRectForSingle(context, eventRect, index) {
|
21909 | var $$ = this,
|
21910 | config = $$.config,
|
21911 | main = $$.$el.main,
|
21912 | isSelectionEnabled = config.data_selection_enabled,
|
21913 | isSelectionGrouped = config.data_selection_grouped,
|
21914 | isSelectable = config.data_selection_isselectable,
|
21915 | isTooltipGrouped = config.tooltip_grouped,
|
21916 | selectedData = $$.getAllValuesOnIndex(index);
|
21917 | isTooltipGrouped && ($$.showTooltip(selectedData, context), $$.showGridFocus && $$.showGridFocus(selectedData), !isSelectionEnabled || isSelectionGrouped) || main.selectAll("." + config_classes.shape + "-" + index).each(function () {
|
21918 | src_select(this).classed(config_classes.EXPANDED, !0), isSelectionEnabled && eventRect.style("cursor", isSelectionGrouped ? "pointer" : null), isTooltipGrouped || ($$.hideGridFocus && $$.hideGridFocus(), $$.hideTooltip(), !isSelectionGrouped && $$.expandCirclesBars(index));
|
21919 | }).filter(function (d) {
|
21920 | return $$.isWithinShape(this, d);
|
21921 | }).call(function (selected) {
|
21922 | var d = selected.data();
|
21923 | isSelectionEnabled && (isSelectionGrouped || isSelectable && isSelectable.bind($$.api)(d)) && eventRect.style("cursor", "pointer"), isTooltipGrouped || ($$.showTooltip(d, context), $$.showGridFocus && $$.showGridFocus(d), $$.unexpandCircles && $$.unexpandCircles(), selected.each(function (d) {
|
21924 | return $$.expandCirclesBars(index, d.id);
|
21925 | }));
|
21926 | });
|
21927 | },
|
21928 | expandCirclesBars: function expandCirclesBars(index, id, reset) {
|
21929 | var $$ = this,
|
21930 | config = $$.config,
|
21931 | _$$$$el = $$.$el,
|
21932 | bar = _$$$$el.bar,
|
21933 | circle = _$$$$el.circle;
|
21934 | circle && config.point_focus_expand_enabled && $$.expandCircles(index, id, reset), bar && $$.expandBars(index, id, reset);
|
21935 | },
|
21936 |
|
21937 | /**
|
21938 | * Handle data.onover/out callback options
|
21939 | * @param {boolean} isOver Over or not
|
21940 | * @param {number|object} d data object
|
21941 | * @private
|
21942 | */
|
21943 | setOverOut: function setOverOut(isOver, d) {
|
21944 | var $$ = this,
|
21945 | config = $$.config,
|
21946 | hasRadar = $$.state.hasRadar,
|
21947 | main = $$.$el.main,
|
21948 | isArc = isObject(d);
|
21949 |
|
21950 | // Call event handler
|
21951 | if (isArc || d !== -1) {
|
21952 | var callback = config[isOver ? "data_onover" : "data_onout"].bind($$.api);
|
21953 | if (config.color_onover && $$.setOverColor(isOver, d, isArc), isArc) callback(d, main.select("." + config_classes.arc + $$.getTargetSelectorSuffix(d.id)).node());else if (!config.tooltip_grouped) {
|
21954 | var last = $$.cache.get(KEY.setOverOut) || [],
|
21955 | shape = main.selectAll("." + config_classes.shape + "-" + d).filter(function (d) {
|
21956 | return $$.isWithinShape(this, d);
|
21957 | });
|
21958 | shape.each(function (d) {
|
21959 | var _this = this;
|
21960 |
|
21961 | (last.length === 0 || last.every(function (v) {
|
21962 | return v !== _this;
|
21963 | })) && (callback(d, this), last.push(this));
|
21964 | }), last.length > 0 && shape.empty() && (callback = config.data_onout.bind($$.api), last.forEach(function (v) {
|
21965 | return callback(src_select(v).datum(), v);
|
21966 | }), last = []), $$.cache.add(KEY.setOverOut, last);
|
21967 | } else isOver && (config.point_focus_only && hasRadar ? $$.showCircleFocus($$.getAllValuesOnIndex(d, !0)) : $$.expandCirclesBars(d, null, !0)), $$.isMultipleX() || main.selectAll("." + config_classes.shape + "-" + d).each(function (d) {
|
21968 | callback(d, this);
|
21969 | });
|
21970 | }
|
21971 | },
|
21972 |
|
21973 | /**
|
21974 | * Call data.onover/out callback for touch event
|
21975 | * @param {number|object} d target index or data object for Arc type
|
21976 | * @private
|
21977 | */
|
21978 | callOverOutForTouch: function callOverOutForTouch(d) {
|
21979 | var $$ = this,
|
21980 | last = $$.cache.get(KEY.callOverOutForTouch);
|
21981 | (isObject(d) && last ? d.id !== last.id : d !== last) && ((last || isNumber(last)) && $$.setOverOut(!1, last), (d || isNumber(d)) && $$.setOverOut(!0, d), $$.cache.add(KEY.callOverOutForTouch, d));
|
21982 | },
|
21983 |
|
21984 | /**
|
21985 | * Return draggable selection function
|
21986 | * @returns {Function}
|
21987 | * @private
|
21988 | */
|
21989 | getDraggableSelection: function getDraggableSelection() {
|
21990 | var $$ = this,
|
21991 | config = $$.config,
|
21992 | state = $$.state;
|
21993 | return config.interaction_enabled && config.data_selection_draggable && $$.drag ? drag().on("drag", function (event) {
|
21994 | state.event = event, $$.drag(getPointer(event, this));
|
21995 | }).on("start", function (event) {
|
21996 | state.event = event, $$.dragstart(getPointer(event, this));
|
21997 | }).on("end", function (event) {
|
21998 | state.event = event, $$.dragend();
|
21999 | }) : function () {};
|
22000 | },
|
22001 |
|
22002 | /**
|
22003 | * Dispatch a mouse event.
|
22004 | * @private
|
22005 | * @param {string} type event type
|
22006 | * @param {number} index Index of eventRect
|
22007 | * @param {Array} mouse x and y coordinate value
|
22008 | */
|
22009 | dispatchEvent: function dispatchEvent(type, index, mouse) {
|
22010 | var $$ = this,
|
22011 | config = $$.config,
|
22012 | _$$$state = $$.state,
|
22013 | eventReceiver = _$$$state.eventReceiver,
|
22014 | hasAxis = _$$$state.hasAxis,
|
22015 | hasRadar = _$$$state.hasRadar,
|
22016 | _$$$$el2 = $$.$el,
|
22017 | eventRect = _$$$$el2.eventRect,
|
22018 | arcs = _$$$$el2.arcs,
|
22019 | radar = _$$$$el2.radar,
|
22020 | isMultipleX = $$.isMultipleX(),
|
22021 | element = (hasRadar ? radar.axes.select("." + config_classes.axis + "-" + index + " text") : eventRect || arcs.selectAll("." + config_classes.target + " path").filter(function (d, i) {
|
22022 | return i === index;
|
22023 | })).node(),
|
22024 | _element$getBoundingC = element.getBoundingClientRect(),
|
22025 | width = _element$getBoundingC.width,
|
22026 | left = _element$getBoundingC.left,
|
22027 | top = _element$getBoundingC.top;
|
22028 |
|
22029 | if (hasAxis && !hasRadar && !isMultipleX) {
|
22030 | var coords = eventReceiver.coords[index];
|
22031 | width = coords.w, left += coords.x, top += coords.y;
|
22032 | }
|
22033 |
|
22034 | var x = left + (mouse ? mouse[0] : 0) + (isMultipleX || config.axis_rotated ? 0 : width / 2),
|
22035 | y = top + (mouse ? mouse[1] : 0);
|
22036 | emulateEvent[/^(mouse|click)/.test(type) ? "mouse" : "touch"](element, type, {
|
22037 | screenX: x,
|
22038 | screenY: y,
|
22039 | clientX: x,
|
22040 | clientY: y
|
22041 | });
|
22042 | },
|
22043 | setDragStatus: function setDragStatus(isDragging) {
|
22044 | this.state.dragging = isDragging;
|
22045 | }
|
22046 | });
|
22047 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/class.ts
|
22048 | /**
|
22049 | * Copyright (c) 2017 ~ present NAVER Corp.
|
22050 | * billboard.js project is licensed under the MIT license
|
22051 | */
|
22052 |
|
22053 | /* harmony default export */ var internals_class = ({
|
22054 | generateClass: function generateClass(prefix, targetId) {
|
22055 | return " " + prefix + " " + (prefix + this.getTargetSelectorSuffix(targetId));
|
22056 | },
|
22057 |
|
22058 | /**
|
22059 | * Get class string
|
22060 | * @param {string} type Shape type
|
22061 | * @param {boolean} withShape Get with shape prefix
|
22062 | * @returns {string} Class string
|
22063 | * @private
|
22064 | */
|
22065 | getClass: function getClass(type, withShape) {
|
22066 | var _this = this,
|
22067 | isPlural = /s$/.test(type),
|
22068 | useIdKey = /^(area|arc|line)s?$/.test(type),
|
22069 | key = isPlural ? "id" : "index";
|
22070 |
|
22071 | return function (d) {
|
22072 | var data = d.data || d,
|
22073 | result = (withShape ? _this.generateClass(config_classes[isPlural ? "shapes" : "shape"], data[key]) : "") + _this.generateClass(config_classes[type], data[useIdKey ? "id" : key]);
|
22074 |
|
22075 | return result.trim();
|
22076 | };
|
22077 | },
|
22078 |
|
22079 | /**
|
22080 | * Get chart class string
|
22081 | * @param {string} type Shape type
|
22082 | * @returns {string} Class string
|
22083 | * @private
|
22084 | */
|
22085 | getChartClass: function getChartClass(type) {
|
22086 | var _this2 = this;
|
22087 |
|
22088 | return function (d) {
|
22089 | return config_classes["chart" + type] + _this2.classTarget((d.data ? d.data : d).id);
|
22090 | };
|
22091 | },
|
22092 | generateExtraLineClass: function generateExtraLineClass() {
|
22093 | var $$ = this,
|
22094 | classes = $$.config.line_classes || [],
|
22095 | ids = [];
|
22096 | return function (d) {
|
22097 | var id = d.id || d.data && d.data.id || d;
|
22098 | return ids.indexOf(id) < 0 && ids.push(id), classes[ids.indexOf(id) % classes.length];
|
22099 | };
|
22100 | },
|
22101 | classRegion: function classRegion(d, i) {
|
22102 | return this.generateClass(config_classes.region, i) + " " + ("class" in d ? d.class : "");
|
22103 | },
|
22104 | classTarget: function classTarget(id) {
|
22105 | var additionalClassSuffix = this.config.data_classes[id],
|
22106 | additionalClass = "";
|
22107 | return additionalClassSuffix && (additionalClass = " " + config_classes.target + "-" + additionalClassSuffix), this.generateClass(config_classes.target, id) + additionalClass;
|
22108 | },
|
22109 | classFocus: function classFocus(d) {
|
22110 | return this.classFocused(d) + this.classDefocused(d);
|
22111 | },
|
22112 | classFocused: function classFocused(d) {
|
22113 | return " " + (this.state.focusedTargetIds.indexOf(d.id) >= 0 ? config_classes.focused : "");
|
22114 | },
|
22115 | classDefocused: function classDefocused(d) {
|
22116 | return " " + (this.state.defocusedTargetIds.indexOf(d.id) >= 0 ? config_classes.defocused : "");
|
22117 | },
|
22118 | getTargetSelectorSuffix: function getTargetSelectorSuffix(targetId) {
|
22119 | return targetId || targetId === 0 ? ("-" + targetId).replace(/[\s?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\]/g, "-") : "";
|
22120 | },
|
22121 | selectorTarget: function selectorTarget(id, prefix) {
|
22122 | var pfx = prefix || "",
|
22123 | target = this.getTargetSelectorSuffix(id);
|
22124 | // select target & circle
|
22125 | return pfx + "." + (config_classes.target + target) + ", " + pfx + "." + (config_classes.circles + target);
|
22126 | },
|
22127 | selectorTargets: function selectorTargets(idsValue, prefix) {
|
22128 | var _this3 = this,
|
22129 | ids = idsValue || [];
|
22130 |
|
22131 | return ids.length ? ids.map(function (id) {
|
22132 | return _this3.selectorTarget(id, prefix);
|
22133 | }) : null;
|
22134 | },
|
22135 | selectorLegend: function selectorLegend(id) {
|
22136 | return "." + (config_classes.legendItem + this.getTargetSelectorSuffix(id));
|
22137 | },
|
22138 | selectorLegends: function selectorLegends(ids) {
|
22139 | var _this4 = this;
|
22140 |
|
22141 | return ids && ids.length ? ids.map(function (id) {
|
22142 | return _this4.selectorLegend(id);
|
22143 | }) : null;
|
22144 | }
|
22145 | });
|
22146 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/category.ts
|
22147 | /**
|
22148 | * Copyright (c) 2017 ~ present NAVER Corp.
|
22149 | * billboard.js project is licensed under the MIT license
|
22150 | */
|
22151 | /* harmony default export */ var category = ({
|
22152 | /**
|
22153 | * Category Name
|
22154 | * @param {number} i Index number
|
22155 | * @returns {string} category Name
|
22156 | * @private
|
22157 | */
|
22158 | categoryName: function categoryName(i) {
|
22159 | var categories = this.config.axis_x_categories;
|
22160 | return categories && i < categories.length ? categories[i] : i;
|
22161 | }
|
22162 | });
|
22163 | ;// CONCATENATED MODULE: ./node_modules/d3-scale/src/init.js
|
22164 | function initRange(domain, range) {
|
22165 | switch (arguments.length) {
|
22166 | case 0:
|
22167 | break;
|
22168 |
|
22169 | case 1:
|
22170 | this.range(domain);
|
22171 | break;
|
22172 |
|
22173 | default:
|
22174 | this.range(range).domain(domain);
|
22175 | }
|
22176 |
|
22177 | return this;
|
22178 | }
|
22179 | function initInterpolator(domain, interpolator) {
|
22180 | switch (arguments.length) {
|
22181 | case 0:
|
22182 | break;
|
22183 |
|
22184 | case 1:
|
22185 | {
|
22186 | typeof domain === "function" ? this.interpolator(domain) : this.range(domain);
|
22187 | break;
|
22188 | }
|
22189 |
|
22190 | default:
|
22191 | {
|
22192 | this.domain(domain), typeof interpolator === "function" ? this.interpolator(interpolator) : this.range(interpolator);
|
22193 | break;
|
22194 | }
|
22195 | }
|
22196 |
|
22197 | return this;
|
22198 | }
|
22199 | ;// CONCATENATED MODULE: ./node_modules/d3-scale/src/ordinal.js
|
22200 | function ordinal_createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = ordinal_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { it && (o = it); var i = 0; return function () { return i >= o.length ? { done: !0 } : { done: !1, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } return it = o[Symbol.iterator](), it.next.bind(it); }
|
22201 |
|
22202 | function ordinal_unsupportedIterableToArray(o, minLen) { if (o) { if (typeof o === "string") return ordinal_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); return n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set" ? Array.from(o) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? ordinal_arrayLikeToArray(o, minLen) : void 0; } }
|
22203 |
|
22204 | function ordinal_arrayLikeToArray(arr, len) { (len == null || len > arr.length) && (len = arr.length); for (var i = 0, arr2 = Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
22205 |
|
22206 |
|
22207 | var implicit = Symbol("implicit");
|
22208 | function ordinal() {
|
22209 | function scale(d) {
|
22210 | var key = d + "",
|
22211 | i = index.get(key);
|
22212 |
|
22213 | if (!i) {
|
22214 | if (unknown !== implicit) return unknown;
|
22215 | index.set(key, i = domain.push(d));
|
22216 | }
|
22217 |
|
22218 | return range[(i - 1) % range.length];
|
22219 | }
|
22220 |
|
22221 | var index = new Map(),
|
22222 | domain = [],
|
22223 | range = [],
|
22224 | unknown = implicit;
|
22225 | return scale.domain = function (_) {
|
22226 | if (!arguments.length) return domain.slice();
|
22227 | domain = [], index = new Map();
|
22228 |
|
22229 | for (var _step, _iterator = ordinal_createForOfIteratorHelperLoose(_); !(_step = _iterator()).done;) {
|
22230 | var value = _step.value,
|
22231 | key = value + "";
|
22232 | index.has(key) || index.set(key, domain.push(value));
|
22233 | }
|
22234 |
|
22235 | return scale;
|
22236 | }, scale.range = function (_) {
|
22237 | return arguments.length ? (range = Array.from(_), scale) : range.slice();
|
22238 | }, scale.unknown = function (_) {
|
22239 | return arguments.length ? (unknown = _, scale) : unknown;
|
22240 | }, scale.copy = function () {
|
22241 | return ordinal(domain, range).unknown(unknown);
|
22242 | }, initRange.apply(scale, arguments), scale;
|
22243 | }
|
22244 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/color.ts
|
22245 | /**
|
22246 | * Copyright (c) 2017 ~ present NAVER Corp.
|
22247 | * billboard.js project is licensed under the MIT license
|
22248 | */
|
22249 |
|
22250 |
|
22251 |
|
22252 |
|
22253 |
|
22254 |
|
22255 | /**
|
22256 | * Set pattern's background color
|
22257 | * (it adds a <rect> element to simulate bg-color)
|
22258 | * @param {SVGPatternElement} pattern SVG pattern element
|
22259 | * @param {string} color Color string
|
22260 | * @param {string} id ID to be set
|
22261 | * @returns {{id: string, node: SVGPatternElement}}
|
22262 | * @private
|
22263 | */
|
22264 |
|
22265 | var colorizePattern = function (pattern, color, id) {
|
22266 | var node = src_select(pattern.cloneNode(!0));
|
22267 | return node.attr("id", id).insert("rect", ":first-child").attr("width", node.attr("width")).attr("height", node.attr("height")).style("fill", color), {
|
22268 | id: id,
|
22269 | node: node.node()
|
22270 | };
|
22271 | },
|
22272 | schemeCategory10 = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "#8c564b", "#e377c2", "#7f7f7f", "#bcbd22", "#17becf"]; // Replacement of d3.schemeCategory10.
|
22273 | // Contained differently depend on d3 version: v4(d3-scale), v5(d3-scale-chromatic)
|
22274 |
|
22275 |
|
22276 | /* harmony default export */ var internals_color = ({
|
22277 | /**
|
22278 | * Get color pattern from CSS file
|
22279 | * CSS should be defined as: background-image: url("#00c73c;#fa7171; ...");
|
22280 | * @returns {Array}
|
22281 | * @private
|
22282 | */
|
22283 | getColorFromCss: function getColorFromCss() {
|
22284 | var cacheKey = KEY.colorPattern,
|
22285 | body = browser_doc.body,
|
22286 | pattern = body[cacheKey];
|
22287 |
|
22288 | if (!pattern) {
|
22289 | var span = browser_doc.createElement("span");
|
22290 | span.className = config_classes.colorPattern, span.style.display = "none", body.appendChild(span);
|
22291 | var content = win.getComputedStyle(span).backgroundImage;
|
22292 | span.parentNode.removeChild(span), content.indexOf(";") > -1 && (pattern = content.replace(/url[^#]*|["'()]|(\s|%20)/g, "").split(";").map(function (v) {
|
22293 | return v.trim().replace(/[\"'\s]/g, "");
|
22294 | }).filter(Boolean), body[cacheKey] = pattern);
|
22295 | }
|
22296 |
|
22297 | return pattern;
|
22298 | },
|
22299 | generateColor: function generateColor() {
|
22300 | var $$ = this,
|
22301 | config = $$.config,
|
22302 | colors = config.data_colors,
|
22303 | callback = config.data_color,
|
22304 | ids = [],
|
22305 | pattern = notEmpty(config.color_pattern) ? config.color_pattern : ordinal($$.getColorFromCss() || schemeCategory10).range(),
|
22306 | originalColorPattern = pattern;
|
22307 |
|
22308 | if (isFunction(config.color_tiles)) {
|
22309 | var tiles = config.color_tiles.bind($$.api)(),
|
22310 | colorizedPatterns = pattern.map(function (p, index) {
|
22311 | var color = p.replace(/[#\(\)\s,]/g, ""),
|
22312 | id = $$.state.datetimeId + "-pattern-" + color + "-" + index;
|
22313 | return colorizePattern(tiles[index % tiles.length], p, id);
|
22314 | }); // Add background color to patterns
|
22315 |
|
22316 | pattern = colorizedPatterns.map(function (p) {
|
22317 | return "url(#" + p.id + ")";
|
22318 | }), $$.patterns = colorizedPatterns;
|
22319 | }
|
22320 |
|
22321 | return function (d) {
|
22322 | var color,
|
22323 | id = d.id || d.data && d.data.id || d,
|
22324 | isLine = $$.isTypeOf(id, ["line", "spline", "step"]) || !config.data_types[id];
|
22325 | return isFunction(colors[id]) ? color = colors[id].bind($$.api)(d) : colors[id] ? color = colors[id] : (ids.indexOf(id) < 0 && ids.push(id), color = isLine ? originalColorPattern[ids.indexOf(id) % originalColorPattern.length] : pattern[ids.indexOf(id) % pattern.length], colors[id] = color), isFunction(callback) ? callback.bind($$.api)(color, d) : color;
|
22326 | };
|
22327 | },
|
22328 | generateLevelColor: function generateLevelColor() {
|
22329 | var $$ = this,
|
22330 | config = $$.config,
|
22331 | colors = config.color_pattern,
|
22332 | threshold = config.color_threshold,
|
22333 | asValue = threshold.unit === "value",
|
22334 | max = threshold.max || 100,
|
22335 | values = threshold.values && threshold.values.length ? threshold.values : [];
|
22336 | return notEmpty(threshold) ? function (value) {
|
22337 | var v = asValue ? value : value * 100 / max,
|
22338 | color = colors[colors.length - 1];
|
22339 |
|
22340 | for (var i = 0, l = values.length; i < l; i++) if (v <= values[i]) {
|
22341 | color = colors[i];
|
22342 | break;
|
22343 | }
|
22344 |
|
22345 | return color;
|
22346 | } : null;
|
22347 | },
|
22348 |
|
22349 | /**
|
22350 | * Set the data over color.
|
22351 | * When is out, will restate in its previous color value
|
22352 | * @param {boolean} isOver true: set overed color, false: restore
|
22353 | * @param {number|object} d target index or data object for Arc type
|
22354 | * @private
|
22355 | */
|
22356 | setOverColor: function setOverColor(isOver, d) {
|
22357 | var $$ = this,
|
22358 | config = $$.config,
|
22359 | main = $$.$el.main,
|
22360 | onover = config.color_onover,
|
22361 | color = isOver ? onover : $$.color;
|
22362 | isObject(color) ? color = function (_ref) {
|
22363 | var id = _ref.id;
|
22364 | return id in onover ? onover[id] : $$.color(id);
|
22365 | } : isString(color) ? color = function () {
|
22366 | return onover;
|
22367 | } : isFunction(onover) && (color = color.bind($$.api)), main.selectAll(isObject(d) ? // when is Arc type
|
22368 | "." + config_classes.arc + $$.getTargetSelectorSuffix(d.id) : "." + config_classes.shape + "-" + d).style("fill", color);
|
22369 | }
|
22370 | });
|
22371 | ;// CONCATENATED MODULE: ./src/config/const.ts
|
22372 | /**
|
22373 | * Copyright (c) 2017 ~ present NAVER Corp.
|
22374 | * billboard.js project is licensed under the MIT license
|
22375 | */
|
22376 |
|
22377 | /**
|
22378 | * Chart type constant
|
22379 | * @private
|
22380 | */
|
22381 | var TYPE = {
|
22382 | AREA: "area",
|
22383 | AREA_LINE_RANGE: "area-line-range",
|
22384 | AREA_SPLINE: "area-spline",
|
22385 | AREA_SPLINE_RANGE: "area-spline-range",
|
22386 | AREA_STEP: "area-step",
|
22387 | BAR: "bar",
|
22388 | BUBBLE: "bubble",
|
22389 | CANDLESTICK: "candlestick",
|
22390 | DONUT: "donut",
|
22391 | GAUGE: "gauge",
|
22392 | LINE: "line",
|
22393 | PIE: "pie",
|
22394 | RADAR: "radar",
|
22395 | SCATTER: "scatter",
|
22396 | SPLINE: "spline",
|
22397 | STEP: "step"
|
22398 | };
|
22399 | /**
|
22400 | * chart types by category
|
22401 | * @private
|
22402 | */
|
22403 |
|
22404 | var TYPE_BY_CATEGORY = {
|
22405 | Area: [TYPE.AREA, TYPE.AREA_SPLINE, TYPE.AREA_SPLINE_RANGE, TYPE.AREA_LINE_RANGE, TYPE.AREA_STEP],
|
22406 | AreaRange: [TYPE.AREA_SPLINE_RANGE, TYPE.AREA_LINE_RANGE],
|
22407 | Arc: [TYPE.PIE, TYPE.DONUT, TYPE.GAUGE, TYPE.RADAR],
|
22408 | Line: [TYPE.LINE, TYPE.SPLINE, TYPE.AREA, TYPE.AREA_SPLINE, TYPE.AREA_SPLINE_RANGE, TYPE.AREA_LINE_RANGE, TYPE.STEP, TYPE.AREA_STEP],
|
22409 | Step: [TYPE.STEP, TYPE.AREA_STEP],
|
22410 | Spline: [TYPE.SPLINE, TYPE.AREA_SPLINE, TYPE.AREA_SPLINE_RANGE]
|
22411 | };
|
22412 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/domain.ts
|
22413 | /**
|
22414 | * Copyright (c) 2017 ~ present NAVER Corp.
|
22415 | * billboard.js project is licensed under the MIT license
|
22416 | */
|
22417 |
|
22418 |
|
22419 | /* harmony default export */ var domain = ({
|
22420 | getYDomainMinMax: function getYDomainMinMax(targets, type) {
|
22421 | var $$ = this,
|
22422 | axis = $$.axis,
|
22423 | config = $$.config,
|
22424 | isMin = type === "min",
|
22425 | dataGroups = config.data_groups,
|
22426 | ids = $$.mapToIds(targets),
|
22427 | ys = $$.getValuesAsIdKeyed(targets);
|
22428 | return dataGroups.length > 0 && function () {
|
22429 | for (var idsInGroup, _ret, hasValue = $$["has" + (isMin ? "Negative" : "Positive") + "ValueInTargets"](targets), _loop = function (j, _idsInGroup) {
|
22430 | if (_idsInGroup = _idsInGroup.filter(function (v) {
|
22431 | return ids.indexOf(v) >= 0;
|
22432 | }), _idsInGroup.length === 0) return idsInGroup = _idsInGroup, "continue";
|
22433 | var baseId = _idsInGroup[0],
|
22434 | baseAxisId = axis.getId(baseId);
|
22435 | hasValue && ys[baseId] && (ys[baseId] = ys[baseId].map(function (v) {
|
22436 | return (isMin ? v < 0 : v > 0) ? v : 0;
|
22437 | }));
|
22438 |
|
22439 | for (var id, _ret2, _loop2 = function (k, id) {
|
22440 | if (!ys[id]) return "continue";
|
22441 | var axisId = axis.getId(id);
|
22442 | ys[id].forEach(function (v, i) {
|
22443 | var val = +v,
|
22444 | meetCondition = isMin ? val > 0 : val < 0;
|
22445 | axisId !== baseAxisId || hasValue && meetCondition || (ys[baseId][i] += val);
|
22446 | });
|
22447 | }, k = 1; id = _idsInGroup[k]; k++) _ret2 = _loop2(k, id), _ret2 === "continue";
|
22448 |
|
22449 | idsInGroup = _idsInGroup;
|
22450 | }, j = 0; idsInGroup = dataGroups[j]; j++) _ret = _loop(j, idsInGroup), _ret === "continue";
|
22451 | }(), getMinMax(type, Object.keys(ys).map(function (key) {
|
22452 | return getMinMax(type, ys[key]);
|
22453 | }));
|
22454 | },
|
22455 | getYDomainMin: function getYDomainMin(targets) {
|
22456 | return this.getYDomainMinMax(targets, "min");
|
22457 | },
|
22458 | getYDomainMax: function getYDomainMax(targets) {
|
22459 | return this.getYDomainMinMax(targets, "max");
|
22460 | },
|
22461 |
|
22462 | /**
|
22463 | * Check if hidden targets bound to the given axis id
|
22464 | * @param {string} id ID to be checked
|
22465 | * @returns {boolean}
|
22466 | * @private
|
22467 | */
|
22468 | isHiddenTargetWithYDomain: function isHiddenTargetWithYDomain(id) {
|
22469 | var $$ = this;
|
22470 | return $$.state.hiddenTargetIds.some(function (v) {
|
22471 | return $$.axis.getId(v) === id;
|
22472 | });
|
22473 | },
|
22474 | getYDomain: function getYDomain(targets, axisId, xDomain) {
|
22475 | var $$ = this,
|
22476 | axis = $$.axis,
|
22477 | config = $$.config,
|
22478 | scale = $$.scale,
|
22479 | pfx = "axis_" + axisId;
|
22480 | if ($$.isStackNormalized()) return [0, 100];
|
22481 | var isLog = scale && scale[axisId] && scale[axisId].type === "log",
|
22482 | targetsByAxisId = targets.filter(function (t) {
|
22483 | return axis.getId(t.id) === axisId;
|
22484 | }),
|
22485 | yTargets = xDomain ? $$.filterByXDomain(targetsByAxisId, xDomain) : targetsByAxisId;
|
22486 | if (yTargets.length === 0) // use domain of the other axis if target of axisId is none
|
22487 | return $$.isHiddenTargetWithYDomain(axisId) ? scale[axisId].domain() : axisId === "y2" ? scale.y.domain() : // When all data bounds to y2, y Axis domain is called prior y2.
|
22488 | // So, it needs to call to get y2 domain here
|
22489 | $$.getYDomain(targets, "y2", xDomain);
|
22490 | var yMin = config[pfx + "_min"],
|
22491 | yMax = config[pfx + "_max"],
|
22492 | yDomainMin = $$.getYDomainMin(yTargets),
|
22493 | yDomainMax = $$.getYDomainMax(yTargets),
|
22494 | center = config[pfx + "_center"],
|
22495 | isZeroBased = [TYPE.BAR, TYPE.BUBBLE, TYPE.SCATTER].concat(TYPE_BY_CATEGORY.Line).some(function (v) {
|
22496 | var type = v.indexOf("area") > -1 ? "area" : v;
|
22497 | return $$.hasType(v, yTargets) && config[type + "_zerobased"];
|
22498 | }),
|
22499 | isInverted = config[pfx + "_inverted"],
|
22500 | showHorizontalDataLabel = $$.hasDataLabel() && config.axis_rotated,
|
22501 | showVerticalDataLabel = $$.hasDataLabel() && !config.axis_rotated;
|
22502 | yDomainMin = isValue(yMin) ? yMin : isValue(yMax) ? yDomainMin < yMax ? yDomainMin : yMax - 10 : yDomainMin, yDomainMax = isValue(yMax) ? yMax : isValue(yMin) ? yMin < yDomainMax ? yDomainMax : yMin + 10 : yDomainMax, isNaN(yDomainMin) && (yDomainMin = 0), isNaN(yDomainMax) && (yDomainMax = yDomainMin), yDomainMin === yDomainMax && (yDomainMin < 0 ? yDomainMax = 0 : yDomainMin = 0);
|
22503 | var isAllPositive = yDomainMin >= 0 && yDomainMax >= 0,
|
22504 | isAllNegative = yDomainMin <= 0 && yDomainMax <= 0;
|
22505 | (isValue(yMin) && isAllPositive || isValue(yMax) && isAllNegative) && (isZeroBased = !1), isZeroBased && (isAllPositive && (yDomainMin = 0), isAllNegative && (yDomainMax = 0));
|
22506 | var domainLength = Math.abs(yDomainMax - yDomainMin),
|
22507 | padding = {
|
22508 | top: domainLength * .1,
|
22509 | bottom: domainLength * .1
|
22510 | };
|
22511 |
|
22512 | if (isDefined(center)) {
|
22513 | var yDomainAbs = Math.max(Math.abs(yDomainMin), Math.abs(yDomainMax));
|
22514 | yDomainMax = center + yDomainAbs, yDomainMin = center - yDomainAbs;
|
22515 | } // add padding for data label
|
22516 |
|
22517 |
|
22518 | if (showHorizontalDataLabel) {
|
22519 | var diff = diffDomain(scale.y.range()),
|
22520 | ratio = $$.getDataLabelLength(yDomainMin, yDomainMax, "width").map(function (v) {
|
22521 | return v / diff;
|
22522 | });
|
22523 | ["bottom", "top"].forEach(function (v, i) {
|
22524 | padding[v] += domainLength * (ratio[i] / (1 - ratio[0] - ratio[1]));
|
22525 | });
|
22526 | } else if (showVerticalDataLabel) {
|
22527 | var lengths = $$.getDataLabelLength(yDomainMin, yDomainMax, "height");
|
22528 | ["bottom", "top"].forEach(function (v, i) {
|
22529 | padding[v] += axis.convertPixelsToAxisPadding(lengths[i], domainLength);
|
22530 | });
|
22531 | } // if padding is set, the domain will be updated relative the current domain value
|
22532 | // ex) $$.height=300, padding.top=150, domainLength=4 --> domain=6
|
22533 |
|
22534 |
|
22535 | var p = config[pfx + "_padding"];
|
22536 | notEmpty(p) && ["bottom", "top"].forEach(function (v) {
|
22537 | padding[v] = axis.getPadding(p, v, padding[v], domainLength);
|
22538 | }), isZeroBased && (isAllPositive && (padding.bottom = yDomainMin), isAllNegative && (padding.top = -yDomainMax));
|
22539 | var domain = isLog ? [yDomainMin, yDomainMax].map(function (v) {
|
22540 | return v < 0 ? 0 : v;
|
22541 | }) : [yDomainMin - padding.bottom, yDomainMax + padding.top];
|
22542 | return isInverted ? domain.reverse() : domain;
|
22543 | },
|
22544 | getXDomainMinMax: function getXDomainMinMax(targets, type) {
|
22545 | var $$ = this,
|
22546 | configValue = $$.config["axis_x_" + type],
|
22547 | dataValue = getMinMax(type, targets.map(function (t) {
|
22548 | return getMinMax(type, t.values.map(function (v) {
|
22549 | return v.x;
|
22550 | }));
|
22551 | })),
|
22552 | value = isObject(configValue) ? configValue.value : configValue;
|
22553 | return value = isDefined(value) && $$.axis.isTimeSeries() ? parseDate.bind(this)(value) : value, isObject(configValue) && configValue.fit && (type === "min" && value < dataValue || type === "max" && value > dataValue) && (value = undefined), isDefined(value) ? value : dataValue;
|
22554 | },
|
22555 | getXDomainMin: function getXDomainMin(targets) {
|
22556 | return this.getXDomainMinMax(targets, "min");
|
22557 | },
|
22558 | getXDomainMax: function getXDomainMax(targets) {
|
22559 | return this.getXDomainMinMax(targets, "max");
|
22560 | },
|
22561 | getXDomainPadding: function getXDomainPadding(domain) {
|
22562 | var maxDataCount,
|
22563 | padding,
|
22564 | $$ = this,
|
22565 | axis = $$.axis,
|
22566 | config = $$.config,
|
22567 | diff = domain[1] - domain[0],
|
22568 | xPadding = config.axis_x_padding;
|
22569 | axis.isCategorized() ? padding = 0 : $$.hasType("bar") ? (maxDataCount = $$.getMaxDataCount(), padding = maxDataCount > 1 ? diff / (maxDataCount - 1) / 2 : .5) : padding = diff * .01;
|
22570 | var left = padding,
|
22571 | right = padding;
|
22572 | return isObject(xPadding) && notEmpty(xPadding) ? (left = isValue(xPadding.left) ? xPadding.left : padding, right = isValue(xPadding.right) ? xPadding.right : padding) : isNumber(config.axis_x_padding) && (left = xPadding, right = xPadding), {
|
22573 | left: left,
|
22574 | right: right
|
22575 | };
|
22576 | },
|
22577 | getXDomain: function getXDomain(targets) {
|
22578 | var $$ = this,
|
22579 | isLog = $$.scale.x.type === "log",
|
22580 | xDomain = [$$.getXDomainMin(targets), $$.getXDomainMax(targets)],
|
22581 | min = 0,
|
22582 | max = 0;
|
22583 | if (isLog) min = xDomain[0], max = xDomain[1];else {
|
22584 | var isCategorized = $$.axis.isCategorized(),
|
22585 | isTimeSeries = $$.axis.isTimeSeries(),
|
22586 | padding = $$.getXDomainPadding(xDomain),
|
22587 | _xDomain = xDomain,
|
22588 | firstX = _xDomain[0],
|
22589 | lastX = _xDomain[1];
|
22590 | firstX - lastX !== 0 || isCategorized || (isTimeSeries ? (firstX = new Date(firstX.getTime() * .5), lastX = new Date(lastX.getTime() * 1.5)) : (firstX = firstX === 0 ? 1 : firstX * .5, lastX = lastX === 0 ? -1 : lastX * 1.5)), (firstX || firstX === 0) && (min = isTimeSeries ? new Date(firstX.getTime() - padding.left) : firstX - padding.left), (lastX || lastX === 0) && (max = isTimeSeries ? new Date(lastX.getTime() + padding.right) : lastX + padding.right);
|
22591 | }
|
22592 | return [min, max];
|
22593 | },
|
22594 | updateXDomain: function updateXDomain(targets, withUpdateXDomain, withUpdateOrgXDomain, withTrim, domain) {
|
22595 | var $$ = this,
|
22596 | config = $$.config,
|
22597 | org = $$.org,
|
22598 | _$$$scale = $$.scale,
|
22599 | x = _$$$scale.x,
|
22600 | subX = _$$$scale.subX,
|
22601 | zoomEnabled = config.zoom_enabled;
|
22602 |
|
22603 | if (withUpdateOrgXDomain && (x.domain(domain || sortValue($$.getXDomain(targets))), org.xDomain = x.domain(), zoomEnabled && $$.zoom.updateScaleExtent(), subX.domain(x.domain()), $$.brush && $$.brush.scale(subX)), withUpdateXDomain) {
|
22604 | var domainValue = domain || !$$.brush || brushEmpty($$) ? org.xDomain : getBrushSelection($$).map(subX.invert);
|
22605 | x.domain(domainValue), zoomEnabled && $$.zoom.updateScaleExtent();
|
22606 | } // Trim domain when too big by zoom mousemove event
|
22607 |
|
22608 |
|
22609 | return withTrim && x.domain($$.trimXDomain(x.orgDomain())), x.domain();
|
22610 | },
|
22611 | trimXDomain: function trimXDomain(domain) {
|
22612 | var zoomDomain = this.getZoomDomain(),
|
22613 | min = zoomDomain[0],
|
22614 | max = zoomDomain[1];
|
22615 | return domain[0] <= min && (domain[1] = +domain[1] + (min - domain[0]), domain[0] = min), max <= domain[1] && (domain[0] = +domain[0] - (domain[1] - max), domain[1] = max), domain;
|
22616 | },
|
22617 |
|
22618 | /**
|
22619 | * Get zoom domain
|
22620 | * @returns {Array} zoom domain
|
22621 | * @private
|
22622 | */
|
22623 | getZoomDomain: function getZoomDomain() {
|
22624 | var $$ = this,
|
22625 | config = $$.config,
|
22626 | org = $$.org,
|
22627 | _org$xDomain = org.xDomain,
|
22628 | min = _org$xDomain[0],
|
22629 | max = _org$xDomain[1];
|
22630 | return isDefined(config.zoom_x_min) && (min = getMinMax("min", [min, config.zoom_x_min])), isDefined(config.zoom_x_max) && (max = getMinMax("max", [max, config.zoom_x_max])), [min, max];
|
22631 | }
|
22632 | });
|
22633 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/format.ts
|
22634 | /**
|
22635 | * Copyright (c) 2017 ~ present NAVER Corp.
|
22636 | * billboard.js project is licensed under the MIT license
|
22637 | */
|
22638 |
|
22639 |
|
22640 | /**
|
22641 | * Get formatted
|
22642 | * @param {object} $$ Context
|
22643 | * @param {string} typeValue Axis type
|
22644 | * @param {number} v Value to be formatted
|
22645 | * @returns {number | string}
|
22646 | * @private
|
22647 | */
|
22648 | function getFormat($$, typeValue, v) {
|
22649 | var config = $$.config,
|
22650 | type = "axis_" + typeValue + "_tick_format",
|
22651 | format = config[type] ? config[type] : $$.defaultValueFormat;
|
22652 | return format(v);
|
22653 | }
|
22654 |
|
22655 | /* harmony default export */ var format = ({
|
22656 | getYFormat: function getYFormat(forArc) {
|
22657 | var $$ = this,
|
22658 | yFormat = $$.yFormat,
|
22659 | y2Format = $$.y2Format;
|
22660 | return forArc && !$$.hasType("gauge") && (yFormat = $$.defaultArcValueFormat, y2Format = $$.defaultArcValueFormat), function (v, ratio, id) {
|
22661 | var format = $$.axis && $$.axis.getId(id) === "y2" ? y2Format : yFormat;
|
22662 | return format.call($$, v, ratio);
|
22663 | };
|
22664 | },
|
22665 | yFormat: function yFormat(v) {
|
22666 | return getFormat(this, "y", v);
|
22667 | },
|
22668 | y2Format: function y2Format(v) {
|
22669 | return getFormat(this, "y2", v);
|
22670 | },
|
22671 | defaultValueFormat: function defaultValueFormat(v) {
|
22672 | return isValue(v) ? +v : "";
|
22673 | },
|
22674 | defaultArcValueFormat: function defaultArcValueFormat(v, ratio) {
|
22675 | return (ratio * 100).toFixed(1) + "%";
|
22676 | },
|
22677 | dataLabelFormat: function dataLabelFormat(targetId) {
|
22678 | var $$ = this,
|
22679 | dataLabels = $$.config.data_labels,
|
22680 | defaultFormat = function (v) {
|
22681 | return isValue(v) ? +v : "";
|
22682 | },
|
22683 | format = defaultFormat;
|
22684 |
|
22685 | return isFunction(dataLabels.format) ? format = dataLabels.format : isObjectType(dataLabels.format) && (dataLabels.format[targetId] ? format = dataLabels.format[targetId] === !0 ? defaultFormat : dataLabels.format[targetId] : format = function () {
|
22686 | return "";
|
22687 | }), format.bind($$.api);
|
22688 | }
|
22689 | });
|
22690 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/legend.ts
|
22691 | /**
|
22692 | * Copyright (c) 2017 ~ present NAVER Corp.
|
22693 | * billboard.js project is licensed under the MIT license
|
22694 | */
|
22695 |
|
22696 |
|
22697 |
|
22698 |
|
22699 |
|
22700 | /* harmony default export */ var internals_legend = ({
|
22701 | /**
|
22702 | * Initialize the legend.
|
22703 | * @private
|
22704 | */
|
22705 | initLegend: function initLegend() {
|
22706 | var $$ = this,
|
22707 | config = $$.config,
|
22708 | $el = $$.$el;
|
22709 | $$.legendItemTextBox = {}, $$.state.legendHasRendered = !1, config.legend_show ? (!config.legend_contents_bindto && ($el.legend = $$.$el.svg.append("g").classed(config_classes.legend, !0).attr("transform", $$.getTranslate("legend"))), $$.updateLegend()) : $$.state.hiddenLegendIds = $$.mapToIds($$.data.targets);
|
22710 | },
|
22711 |
|
22712 | /**
|
22713 | * Update legend element
|
22714 | * @param {Array} targetIds ID's of target
|
22715 | * @param {object} options withTransform : Whether to use the transform property / withTransitionForTransform: Whether transition is used when using the transform property / withTransition : whether or not to transition.
|
22716 | * @param {object} transitions Return value of the generateTransitions
|
22717 | * @private
|
22718 | */
|
22719 | updateLegend: function updateLegend(targetIds, options, transitions) {
|
22720 | var $$ = this,
|
22721 | config = $$.config,
|
22722 | state = $$.state,
|
22723 | scale = $$.scale,
|
22724 | $el = $$.$el,
|
22725 | optionz = options || {
|
22726 | withTransform: !1,
|
22727 | withTransitionForTransform: !1,
|
22728 | withTransition: !1
|
22729 | };
|
22730 | // toggle legend state
|
22731 | // Update size and scale
|
22732 | // Update g positions
|
22733 | optionz.withTransition = getOption(optionz, "withTransition", !0), optionz.withTransitionForTransform = getOption(optionz, "withTransitionForTransform", !0), config.legend_contents_bindto && config.legend_contents_template ? $$.updateLegendTemplate() : $$.updateLegendElement(targetIds || $$.mapToIds($$.data.targets), optionz, transitions), $el.legend.selectAll("." + config_classes.legendItem).classed(config_classes.legendItemHidden, function (id) {
|
22734 | var hide = !$$.isTargetToShow(id);
|
22735 | return hide && (this.style.opacity = null), hide;
|
22736 | }), $$.updateScales(!1, !scale.zoom), $$.updateSvgSize(), $$.transformAll(optionz.withTransitionForTransform, transitions), state.legendHasRendered = !0;
|
22737 | },
|
22738 |
|
22739 | /**
|
22740 | * Update legend using template option
|
22741 | * @private
|
22742 | */
|
22743 | updateLegendTemplate: function updateLegendTemplate() {
|
22744 | var $$ = this,
|
22745 | config = $$.config,
|
22746 | $el = $$.$el,
|
22747 | wrapper = src_select(config.legend_contents_bindto),
|
22748 | template = config.legend_contents_template;
|
22749 |
|
22750 | if (!wrapper.empty()) {
|
22751 | var targets = $$.mapToIds($$.data.targets),
|
22752 | ids = [],
|
22753 | html = "";
|
22754 | targets.forEach(function (v) {
|
22755 | var content = isFunction(template) ? template.bind($$.api)(v, $$.color(v), $$.api.data(v)[0].values) : tplProcess(template, {
|
22756 | COLOR: $$.color(v),
|
22757 | TITLE: v
|
22758 | });
|
22759 | content && (ids.push(v), html += content);
|
22760 | });
|
22761 | var legendItem = wrapper.html(html).selectAll(function () {
|
22762 | return this.childNodes;
|
22763 | }).data(ids);
|
22764 | $$.setLegendItem(legendItem), $el.legend = wrapper;
|
22765 | }
|
22766 | },
|
22767 |
|
22768 | /**
|
22769 | * Update the size of the legend.
|
22770 | * @param {Obejct} size Size object
|
22771 | * @private
|
22772 | */
|
22773 | updateSizeForLegend: function updateSizeForLegend(size) {
|
22774 | var $$ = this,
|
22775 | config = $$.config,
|
22776 | _$$$state = $$.state,
|
22777 | isLegendTop = _$$$state.isLegendTop,
|
22778 | isLegendLeft = _$$$state.isLegendLeft,
|
22779 | isLegendRight = _$$$state.isLegendRight,
|
22780 | isLegendInset = _$$$state.isLegendInset,
|
22781 | current = _$$$state.current,
|
22782 | width = size.width,
|
22783 | height = size.height,
|
22784 | insetLegendPosition = {
|
22785 | top: isLegendTop ? $$.getCurrentPaddingTop() + config.legend_inset_y + 5.5 : current.height - height - $$.getCurrentPaddingBottom() - config.legend_inset_y,
|
22786 | left: isLegendLeft ? $$.getCurrentPaddingLeft() + config.legend_inset_x + .5 : current.width - width - $$.getCurrentPaddingRight() - config.legend_inset_x + .5
|
22787 | };
|
22788 | $$.state.margin3 = {
|
22789 | top: isLegendRight ? 0 : isLegendInset ? insetLegendPosition.top : current.height - height,
|
22790 | right: NaN,
|
22791 | bottom: 0,
|
22792 | left: isLegendRight ? current.width - width : isLegendInset ? insetLegendPosition.left : 0
|
22793 | };
|
22794 | },
|
22795 |
|
22796 | /**
|
22797 | * Transform Legend
|
22798 | * @param {boolean} withTransition whether or not to transition.
|
22799 | * @private
|
22800 | */
|
22801 | transformLegend: function transformLegend(withTransition) {
|
22802 | var $$ = this,
|
22803 | legend = $$.$el.legend;
|
22804 | (withTransition ? legend.transition() : legend).attr("transform", $$.getTranslate("legend"));
|
22805 | },
|
22806 |
|
22807 | /**
|
22808 | * Update the legend step
|
22809 | * @param {number} step Step value
|
22810 | * @private
|
22811 | */
|
22812 | updateLegendStep: function updateLegendStep(step) {
|
22813 | this.state.legendStep = step;
|
22814 | },
|
22815 |
|
22816 | /**
|
22817 | * Update legend item width
|
22818 | * @param {number} width Width value
|
22819 | * @private
|
22820 | */
|
22821 | updateLegendItemWidth: function updateLegendItemWidth(width) {
|
22822 | this.state.legendItemWidth = width;
|
22823 | },
|
22824 |
|
22825 | /**
|
22826 | * Update legend item height
|
22827 | * @param {number} height Height value
|
22828 | * @private
|
22829 | */
|
22830 | updateLegendItemHeight: function updateLegendItemHeight(height) {
|
22831 | this.state.legendItemHeight = height;
|
22832 | },
|
22833 |
|
22834 | /**
|
22835 | * Update legend item color
|
22836 | * @param {string} id Corresponding data ID value
|
22837 | * @param {string} color Color value
|
22838 | * @private
|
22839 | */
|
22840 | updateLegendItemColor: function updateLegendItemColor(id, color) {
|
22841 | var legend = this.$el.legend;
|
22842 | legend && legend.select("." + config_classes.legendItem + "-" + id + " line").style("stroke", color);
|
22843 | },
|
22844 |
|
22845 | /**
|
22846 | * Get the width of the legend
|
22847 | * @returns {number} width
|
22848 | * @private
|
22849 | */
|
22850 | getLegendWidth: function getLegendWidth() {
|
22851 | var $$ = this,
|
22852 | _$$$state2 = $$.state,
|
22853 | width = _$$$state2.current.width,
|
22854 | isLegendRight = _$$$state2.isLegendRight,
|
22855 | isLegendInset = _$$$state2.isLegendInset,
|
22856 | legendItemWidth = _$$$state2.legendItemWidth,
|
22857 | legendStep = _$$$state2.legendStep;
|
22858 | return $$.config.legend_show ? isLegendRight || isLegendInset ? legendItemWidth * (legendStep + 1) : width : 0;
|
22859 | },
|
22860 |
|
22861 | /**
|
22862 | * Get the height of the legend
|
22863 | * @returns {number} height
|
22864 | * @private
|
22865 | */
|
22866 | getLegendHeight: function getLegendHeight() {
|
22867 | var $$ = this,
|
22868 | _$$$state3 = $$.state,
|
22869 | current = _$$$state3.current,
|
22870 | isLegendRight = _$$$state3.isLegendRight,
|
22871 | legendItemHeight = _$$$state3.legendItemHeight,
|
22872 | legendStep = _$$$state3.legendStep;
|
22873 | return $$.config.legend_show ? isLegendRight ? current.height : Math.max(20, legendItemHeight) * (legendStep + 1) : 0;
|
22874 | },
|
22875 |
|
22876 | /**
|
22877 | * Get the opacity of the legend
|
22878 | * @param {d3.selection} legendItem Legend item node
|
22879 | * @returns {string|null} opacity
|
22880 | * @private
|
22881 | */
|
22882 | opacityForLegend: function opacityForLegend(legendItem) {
|
22883 | return legendItem.classed(config_classes.legendItemHidden) ? null : "1";
|
22884 | },
|
22885 |
|
22886 | /**
|
22887 | * Get the opacity of the legend that is unfocused
|
22888 | * @param {d3.selection} legendItem Legend item node
|
22889 | * @returns {string|null} opacity
|
22890 | * @private
|
22891 | */
|
22892 | opacityForUnfocusedLegend: function opacityForUnfocusedLegend(legendItem) {
|
22893 | return legendItem.classed(config_classes.legendItemHidden) ? null : "0.3";
|
22894 | },
|
22895 |
|
22896 | /**
|
22897 | * Toggles the focus of the legend
|
22898 | * @param {Array} targetIds ID's of target
|
22899 | * @param {boolean} focus whether or not to focus.
|
22900 | * @private
|
22901 | */
|
22902 | toggleFocusLegend: function toggleFocusLegend(targetIds, focus) {
|
22903 | var $$ = this,
|
22904 | legend = $$.$el.legend,
|
22905 | targetIdz = $$.mapToTargetIds(targetIds);
|
22906 | legend && legend.selectAll("." + config_classes.legendItem).filter(function (id) {
|
22907 | return targetIdz.indexOf(id) >= 0;
|
22908 | }).classed(config_classes.legendItemFocused, focus).transition().duration(100).style("opacity", function () {
|
22909 | return (focus ? $$.opacityForLegend : $$.opacityForUnfocusedLegend).call($$, src_select(this));
|
22910 | });
|
22911 | },
|
22912 |
|
22913 | /**
|
22914 | * Revert the legend to its default state
|
22915 | * @private
|
22916 | */
|
22917 | revertLegend: function revertLegend() {
|
22918 | var $$ = this,
|
22919 | legend = $$.$el.legend;
|
22920 | legend && legend.selectAll("." + config_classes.legendItem).classed(config_classes.legendItemFocused, !1).transition().duration(100).style("opacity", function () {
|
22921 | return $$.opacityForLegend(src_select(this));
|
22922 | });
|
22923 | },
|
22924 |
|
22925 | /**
|
22926 | * Shows the legend
|
22927 | * @param {Array} targetIds ID's of target
|
22928 | * @private
|
22929 | */
|
22930 | showLegend: function showLegend(targetIds) {
|
22931 | var $$ = this,
|
22932 | config = $$.config,
|
22933 | $el = $$.$el;
|
22934 | config.legend_show || (config.legend_show = !0, $el.legend ? $el.legend.style("visibility", "visible") : $$.initLegend(), !$$.state.legendHasRendered && $$.updateLegend()), $$.removeHiddenLegendIds(targetIds), $el.legend.selectAll($$.selectorLegends(targetIds)).style("visibility", "visible").transition().style("opacity", function () {
|
22935 | return $$.opacityForLegend(src_select(this));
|
22936 | });
|
22937 | },
|
22938 |
|
22939 | /**
|
22940 | * Hide the legend
|
22941 | * @param {Array} targetIds ID's of target
|
22942 | * @private
|
22943 | */
|
22944 | hideLegend: function hideLegend(targetIds) {
|
22945 | var $$ = this,
|
22946 | config = $$.config,
|
22947 | legend = $$.$el.legend;
|
22948 | config.legend_show && isEmpty(targetIds) && (config.legend_show = !1, legend.style("visibility", "hidden")), $$.addHiddenLegendIds(targetIds), legend.selectAll($$.selectorLegends(targetIds)).style("opacity", "0").style("visibility", "hidden");
|
22949 | },
|
22950 |
|
22951 | /**
|
22952 | * Get legend item textbox dimension
|
22953 | * @param {string} id Data ID
|
22954 | * @param {HTMLElement|d3.selection} textElement Text node element
|
22955 | * @returns {object} Bounding rect
|
22956 | * @private
|
22957 | */
|
22958 | getLegendItemTextBox: function getLegendItemTextBox(id, textElement) {
|
22959 | var data,
|
22960 | $$ = this,
|
22961 | cache = $$.cache,
|
22962 | state = $$.state,
|
22963 | cacheKey = KEY.legendItemTextBox;
|
22964 | return id && (data = !state.redrawing && cache.get(cacheKey) || {}, !data[id] && (data[id] = $$.getTextRect(textElement, config_classes.legendItem), cache.add(cacheKey, data)), data = data[id]), data;
|
22965 | },
|
22966 |
|
22967 | /**
|
22968 | * Set legend item style & bind events
|
22969 | * @param {d3.selection} item Item node
|
22970 | * @private
|
22971 | */
|
22972 | setLegendItem: function setLegendItem(item) {
|
22973 | var $$ = this,
|
22974 | api = $$.api,
|
22975 | config = $$.config,
|
22976 | state = $$.state,
|
22977 | isTouch = state.inputType === "touch",
|
22978 | hasGauge = $$.hasType("gauge");
|
22979 | item.attr("class", function (id) {
|
22980 | var node = src_select(this),
|
22981 | itemClass = !node.empty() && node.attr("class") || "";
|
22982 | return itemClass + $$.generateClass(config_classes.legendItem, id);
|
22983 | }).style("visibility", function (id) {
|
22984 | return $$.isLegendToShow(id) ? "visible" : "hidden";
|
22985 | }), config.interaction_enabled && (item.style("cursor", "pointer").on("click", function (event, id) {
|
22986 | callFn(config.legend_item_onclick, api, id) || (event.altKey ? (api.hide(), api.show(id)) : (api.toggle(id), src_select(this).classed(config_classes.legendItemFocused, !1).style("opacity", null))), isTouch && $$.hideTooltip();
|
22987 | }), !isTouch && item.on("mouseout", function (event, id) {
|
22988 | callFn(config.legend_item_onout, api, id) || (src_select(this).classed(config_classes.legendItemFocused, !1), hasGauge && $$.undoMarkOverlapped($$, "." + config_classes.gaugeValue), $$.api.revert());
|
22989 | }).on("mouseover", function (event, id) {
|
22990 | callFn(config.legend_item_onover, api, id) || (src_select(this).classed(config_classes.legendItemFocused, !0), hasGauge && $$.markOverlapped(id, $$, "." + config_classes.gaugeValue), !state.transiting && $$.isTargetToShow(id) && api.focus(id));
|
22991 | }));
|
22992 | },
|
22993 |
|
22994 | /**
|
22995 | * Update the legend
|
22996 | * @param {Array} targetIds ID's of target
|
22997 | * @param {object} options withTransform : Whether to use the transform property / withTransitionForTransform: Whether transition is used when using the transform property / withTransition : whether or not to transition.
|
22998 | * @private
|
22999 | */
|
23000 | updateLegendElement: function updateLegendElement(targetIds, options) {
|
23001 | var xForLegend,
|
23002 | yForLegend,
|
23003 | background,
|
23004 | $$ = this,
|
23005 | config = $$.config,
|
23006 | state = $$.state,
|
23007 | legend = $$.$el.legend,
|
23008 | posMin = 10,
|
23009 | tileWidth = config.legend_item_tile_width + 5,
|
23010 | maxWidth = 0,
|
23011 | maxHeight = 0,
|
23012 | totalLength = 0,
|
23013 | offsets = {},
|
23014 | widths = {},
|
23015 | heights = {},
|
23016 | margins = [0],
|
23017 | steps = {},
|
23018 | step = 0,
|
23019 | isLegendRightOrInset = state.isLegendRight || state.isLegendInset,
|
23020 | targetIdz = targetIds.filter(function (id) {
|
23021 | return !isDefined(config.data_names[id]) || config.data_names[id] !== null;
|
23022 | }),
|
23023 | withTransition = options.withTransition,
|
23024 | updatePositions = function (textElement, id, index) {
|
23025 | var margin,
|
23026 | isLast = index === targetIdz.length - 1,
|
23027 | box = $$.getLegendItemTextBox(id, textElement),
|
23028 | itemWidth = box.width + tileWidth + (isLast && !isLegendRightOrInset ? 0 : 10) + config.legend_padding,
|
23029 | itemHeight = box.height + 4,
|
23030 | itemLength = isLegendRightOrInset ? itemHeight : itemWidth,
|
23031 | areaLength = isLegendRightOrInset ? $$.getLegendHeight() : $$.getLegendWidth(),
|
23032 | updateValues = function (id2, withoutStep) {
|
23033 | withoutStep || (margin = (areaLength - totalLength - itemLength) / 2, margin < posMin && (margin = (areaLength - itemLength) / 2, totalLength = 0, step++)), steps[id2] = step, margins[step] = state.isLegendInset ? 10 : margin, offsets[id2] = totalLength, totalLength += itemLength;
|
23034 | };
|
23035 |
|
23036 | if (index === 0 && (totalLength = 0, step = 0, maxWidth = 0, maxHeight = 0), config.legend_show && !$$.isLegendToShow(id)) return widths[id] = 0, heights[id] = 0, steps[id] = 0, void (offsets[id] = 0);
|
23037 | widths[id] = itemWidth, heights[id] = itemHeight, (!maxWidth || itemWidth >= maxWidth) && (maxWidth = itemWidth), (!maxHeight || itemHeight >= maxHeight) && (maxHeight = itemHeight);
|
23038 | var maxLength = isLegendRightOrInset ? maxHeight : maxWidth;
|
23039 | config.legend_equally ? (Object.keys(widths).forEach(function (id2) {
|
23040 | return widths[id2] = maxWidth;
|
23041 | }), Object.keys(heights).forEach(function (id2) {
|
23042 | return heights[id2] = maxHeight;
|
23043 | }), margin = (areaLength - maxLength * targetIdz.length) / 2, margin < posMin ? (totalLength = 0, step = 0, targetIdz.forEach(function (id2) {
|
23044 | return updateValues(id2);
|
23045 | })) : updateValues(id, !0)) : updateValues(id);
|
23046 | };
|
23047 |
|
23048 | state.isLegendInset && (step = config.legend_inset_step ? config.legend_inset_step : targetIdz.length, $$.updateLegendStep(step)), state.isLegendRight ? (xForLegend = function (id) {
|
23049 | return maxWidth * steps[id];
|
23050 | }, yForLegend = function (id) {
|
23051 | return margins[steps[id]] + offsets[id];
|
23052 | }) : state.isLegendInset ? (xForLegend = function (id) {
|
23053 | return maxWidth * steps[id] + 10;
|
23054 | }, yForLegend = function (id) {
|
23055 | return margins[steps[id]] + offsets[id];
|
23056 | }) : (xForLegend = function (id) {
|
23057 | return margins[steps[id]] + offsets[id];
|
23058 | }, yForLegend = function (id) {
|
23059 | return maxHeight * steps[id];
|
23060 | });
|
23061 |
|
23062 | var xForLegendText = function (id, i) {
|
23063 | return xForLegend(id, i) + 4 + config.legend_item_tile_width;
|
23064 | },
|
23065 | xForLegendRect = function (id, i) {
|
23066 | return xForLegend(id, i);
|
23067 | },
|
23068 | x1ForLegendTile = function (id, i) {
|
23069 | return xForLegend(id, i) - 2;
|
23070 | },
|
23071 | x2ForLegendTile = function (id, i) {
|
23072 | return xForLegend(id, i) - 2 + config.legend_item_tile_width;
|
23073 | },
|
23074 | yForLegendText = function (id, i) {
|
23075 | return yForLegend(id, i) + 9;
|
23076 | },
|
23077 | yForLegendRect = function (id, i) {
|
23078 | return yForLegend(id, i) - 5;
|
23079 | },
|
23080 | yForLegendTile = function (id, i) {
|
23081 | return yForLegend(id, i) + 4;
|
23082 | },
|
23083 | pos = -200,
|
23084 | l = legend.selectAll("." + config_classes.legendItem).data(targetIdz).enter().append("g");
|
23085 |
|
23086 | $$.setLegendItem(l), l.append("text").text(function (id) {
|
23087 | return isDefined(config.data_names[id]) ? config.data_names[id] : id;
|
23088 | }).each(function (id, i) {
|
23089 | updatePositions(this, id, i);
|
23090 | }).style("pointer-events", "none").attr("x", isLegendRightOrInset ? xForLegendText : pos).attr("y", isLegendRightOrInset ? pos : yForLegendText), l.append("rect").attr("class", config_classes.legendItemEvent).style("fill-opacity", "0").attr("x", isLegendRightOrInset ? xForLegendRect : pos).attr("y", isLegendRightOrInset ? pos : yForLegendRect);
|
23091 |
|
23092 | var getColor = function (id) {
|
23093 | var data = $$.getDataById(id);
|
23094 | return $$.levelColor ? $$.levelColor(data.values[0].value) : $$.color(data);
|
23095 | },
|
23096 | usePoint = config.legend_usePoint;
|
23097 |
|
23098 | if (usePoint) {
|
23099 | var ids = [];
|
23100 | l.append(function (d) {
|
23101 | var pattern = notEmpty(config.point_pattern) ? config.point_pattern : [config.point_type];
|
23102 | ids.indexOf(d) === -1 && ids.push(d);
|
23103 | var point = pattern[ids.indexOf(d) % pattern.length];
|
23104 | return point === "rectangle" && (point = "rect"), browser_doc.createElementNS(namespaces.svg, "hasValidPointType" in $$ && $$.hasValidPointType(point) ? point : "use");
|
23105 | }).attr("class", config_classes.legendItemPoint).style("fill", getColor).style("pointer-events", "none").attr("href", function (data, idx, selection) {
|
23106 | var node = selection[idx],
|
23107 | nodeName = node.nodeName.toLowerCase();
|
23108 | return nodeName === "use" ? "#" + state.datetimeId + "-point-" + data : undefined;
|
23109 | });
|
23110 | } else l.append("line").attr("class", config_classes.legendItemTile).style("stroke", getColor).style("pointer-events", "none").attr("x1", isLegendRightOrInset ? x1ForLegendTile : pos).attr("y1", isLegendRightOrInset ? pos : yForLegendTile).attr("x2", isLegendRightOrInset ? x2ForLegendTile : pos).attr("y2", isLegendRightOrInset ? pos : yForLegendTile).attr("stroke-width", config.legend_item_tile_height); // Set background for inset legend
|
23111 |
|
23112 |
|
23113 | background = legend.select("." + config_classes.legendBackground + " rect"), state.isLegendInset && maxWidth > 0 && background.size() === 0 && (background = legend.insert("g", "." + config_classes.legendItem).attr("class", config_classes.legendBackground).append("rect"));
|
23114 | var texts = legend.selectAll("text").data(targetIdz).text(function (id) {
|
23115 | return isDefined(config.data_names[id]) ? config.data_names[id] : id;
|
23116 | }) // MEMO: needed for update
|
23117 | .each(function (id, i) {
|
23118 | updatePositions(this, id, i);
|
23119 | });
|
23120 | (withTransition ? texts.transition() : texts).attr("x", xForLegendText).attr("y", yForLegendText);
|
23121 | var rects = legend.selectAll("rect." + config_classes.legendItemEvent).data(targetIdz);
|
23122 |
|
23123 | if ((withTransition ? rects.transition() : rects).attr("width", function (id) {
|
23124 | return widths[id];
|
23125 | }).attr("height", function (id) {
|
23126 | return heights[id];
|
23127 | }).attr("x", xForLegendRect).attr("y", yForLegendRect), usePoint) {
|
23128 | var tiles = legend.selectAll("." + config_classes.legendItemPoint).data(targetIdz);
|
23129 | (withTransition ? tiles.transition() : tiles).each(function () {
|
23130 | var radius,
|
23131 | width,
|
23132 | height,
|
23133 | nodeName = this.nodeName.toLowerCase(),
|
23134 | pointR = config.point_r,
|
23135 | x = "x",
|
23136 | y = "y",
|
23137 | xOffset = 2,
|
23138 | yOffset = 2.5;
|
23139 |
|
23140 | if (nodeName === "circle") {
|
23141 | var size = pointR * .2;
|
23142 | x = "cx", y = "cy", radius = pointR + size, xOffset = pointR * 2, yOffset = -size;
|
23143 | } else if (nodeName === "rect") {
|
23144 | var _size = pointR * 2.5;
|
23145 |
|
23146 | width = _size, height = _size, yOffset = 3;
|
23147 | }
|
23148 |
|
23149 | src_select(this).attr(x, function (d) {
|
23150 | return x1ForLegendTile(d) + xOffset;
|
23151 | }).attr(y, function (d) {
|
23152 | return yForLegendTile(d) - yOffset;
|
23153 | }).attr("r", radius).attr("width", width).attr("height", height);
|
23154 | });
|
23155 | } else {
|
23156 | var _tiles = legend.selectAll("line." + config_classes.legendItemTile).data(targetIdz);
|
23157 |
|
23158 | (withTransition ? _tiles.transition() : _tiles).style("stroke", getColor).attr("x1", x1ForLegendTile).attr("y1", yForLegendTile).attr("x2", x2ForLegendTile).attr("y2", yForLegendTile);
|
23159 | }
|
23160 |
|
23161 | background && (withTransition ? background.transition() : background).attr("height", $$.getLegendHeight() - 12).attr("width", maxWidth * (step + 1) + 10), $$.updateLegendItemWidth(maxWidth), $$.updateLegendItemHeight(maxHeight), $$.updateLegendStep(step);
|
23162 | }
|
23163 | });
|
23164 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/redraw.ts
|
23165 | /**
|
23166 | * Copyright (c) 2017 ~ present NAVER Corp.
|
23167 | * billboard.js project is licensed under the MIT license
|
23168 | */
|
23169 |
|
23170 |
|
23171 |
|
23172 |
|
23173 | /* harmony default export */ var redraw = ({
|
23174 | redraw: function redraw(options) {
|
23175 | options === void 0 && (options = {});
|
23176 | var $$ = this,
|
23177 | config = $$.config,
|
23178 | state = $$.state,
|
23179 | $el = $$.$el,
|
23180 | main = $el.main;
|
23181 | state.redrawing = !0;
|
23182 | var targetsToShow = $$.filterTargetsToShow($$.data.targets),
|
23183 | initializing = options.initializing,
|
23184 | flow = options.flow,
|
23185 | wth = $$.getWithOption(options),
|
23186 | duration = wth.Transition ? config.transition_duration : 0,
|
23187 | durationForExit = wth.TransitionForExit ? duration : 0,
|
23188 | durationForAxis = wth.TransitionForAxis ? duration : 0,
|
23189 | transitions = $$.axis && $$.axis.generateTransitions(durationForAxis);
|
23190 | // text
|
23191 | // title
|
23192 | $$.updateSizes(initializing), wth.Legend && config.legend_show ? (options.withTransition = !!duration, $$.updateLegend($$.mapToIds($$.data.targets), options, transitions)) : wth.Dimension && $$.updateDimension(!0), (!$$.hasArcType() || state.hasRadar) && $$.updateCircleY && ($$.circleY = $$.updateCircleY()), state.hasAxis ? ($$.axis.redrawAxis(targetsToShow, wth, transitions, flow, initializing), config.data_empty_label_text && main.select("text." + config_classes.text + "." + config_classes.empty).attr("x", state.width / 2).attr("y", state.height / 2).text(config.data_empty_label_text).style("display", targetsToShow.length ? "none" : null), $$.hasGrid() && $$.updateGrid(duration), config.regions.length && $$.updateRegion(duration), ["bar", "candlestick", "line", "area"].forEach(function (v) {
|
23193 | var name = capitalize(v);
|
23194 | (/^(line|area)$/.test(v) && $$.hasTypeOf(name) || $$.hasType(v)) && $$["update" + name](durationForExit);
|
23195 | }), $el.text && main.selectAll("." + config_classes.selectedCircles).filter($$.isBarType.bind($$)).selectAll("circle").remove(), config.interaction_enabled && !flow && wth.EventRect && ($$.redrawEventRect(), $$.bindZoomEvent && $$.bindZoomEvent())) : ($el.arcs && $$.redrawArc(duration, durationForExit, wth.Transform), $el.radar && $$.redrawRadar(durationForExit)), !state.resizing && ($$.hasPointType() || state.hasRadar) && $$.updateCircle(), $$.hasDataLabel() && !$$.hasArcType(null, ["radar"]) && $$.updateText(durationForExit), $$.redrawTitle && $$.redrawTitle(), initializing && $$.updateTypesElements(), $$.generateRedrawList(targetsToShow, flow, duration, wth.Subchart), $$.callPluginHook("$redraw", options, duration);
|
23196 | },
|
23197 |
|
23198 | /**
|
23199 | * Generate redraw list
|
23200 | * @param {object} targets targets data to be shown
|
23201 | * @param {object} flow flow object
|
23202 | * @param {number} duration duration value
|
23203 | * @param {boolean} withSubchart whether or not to show subchart
|
23204 | * @private
|
23205 | */
|
23206 | generateRedrawList: function generateRedrawList(targets, flow, duration, withSubchart) {
|
23207 | var $$ = this,
|
23208 | config = $$.config,
|
23209 | state = $$.state,
|
23210 | shape = $$.getDrawShape();
|
23211 | state.hasAxis && config.subchart_show && $$.redrawSubchart(withSubchart, duration, shape);
|
23212 | // generate flow
|
23213 | var flowFn = flow && $$.generateFlow({
|
23214 | targets: targets,
|
23215 | flow: flow,
|
23216 | duration: flow.duration,
|
23217 | shape: shape,
|
23218 | xv: $$.xv.bind($$)
|
23219 | }),
|
23220 | isTransition = (duration || flowFn) && isTabVisible(),
|
23221 | redrawList = $$.getRedrawList(shape, flow, flowFn, isTransition),
|
23222 | afterRedraw = flow || config.onrendered ? function () {
|
23223 | flowFn && flowFn(), state.redrawing = !1, callFn(config.onrendered, $$.api);
|
23224 | } : null;
|
23225 | if (afterRedraw) // Only use transition when current tab is visible.
|
23226 | if (isTransition && redrawList.length) {
|
23227 | // Wait for end of transitions for callback
|
23228 | var waitForDraw = generateWait(); // transition should be derived from one transition
|
23229 |
|
23230 | transition_transition().duration(duration).each(function () {
|
23231 | redrawList.reduce(function (acc, t1) {
|
23232 | return acc.concat(t1);
|
23233 | }, []).forEach(function (t) {
|
23234 | return waitForDraw.add(t);
|
23235 | });
|
23236 | }).call(waitForDraw, afterRedraw);
|
23237 | } else state.transiting || afterRedraw(); // update fadein condition
|
23238 |
|
23239 | $$.mapToIds($$.data.targets).forEach(function (id) {
|
23240 | state.withoutFadeIn[id] = !0;
|
23241 | });
|
23242 | },
|
23243 | getRedrawList: function getRedrawList(shape, flow, flowFn, isTransition) {
|
23244 | var $$ = this,
|
23245 | config = $$.config,
|
23246 | _$$$state = $$.state,
|
23247 | hasAxis = _$$$state.hasAxis,
|
23248 | hasRadar = _$$$state.hasRadar,
|
23249 | grid = $$.$el.grid,
|
23250 | _shape$pos = shape.pos,
|
23251 | cx = _shape$pos.cx,
|
23252 | cy = _shape$pos.cy,
|
23253 | xForText = _shape$pos.xForText,
|
23254 | yForText = _shape$pos.yForText,
|
23255 | list = [];
|
23256 | return hasAxis && ((config.grid_x_lines.length || config.grid_y_lines.length) && list.push($$.redrawGrid(isTransition)), config.regions.length && list.push($$.redrawRegion(isTransition)), Object.keys(shape.type).forEach(function (v) {
|
23257 | var name = capitalize(v),
|
23258 | drawFn = shape.type[v];
|
23259 | (/^(area|line)$/.test(v) && $$.hasTypeOf(name) || $$.hasType(v)) && list.push($$["redraw" + name](drawFn, isTransition));
|
23260 | }), !flow && grid.main && list.push($$.updateGridFocus())), (!$$.hasArcType() || hasRadar) && notEmpty(config.data_labels) && config.data_labels !== !1 && list.push($$.redrawText(xForText, yForText, flow, isTransition)), ($$.hasPointType() || hasRadar) && !config.point_focus_only && $$.redrawCircle && list.push($$.redrawCircle(cx, cy, isTransition, flowFn)), list;
|
23261 | },
|
23262 | updateAndRedraw: function updateAndRedraw(options) {
|
23263 | options === void 0 && (options = {});
|
23264 | var transitions,
|
23265 | $$ = this,
|
23266 | config = $$.config,
|
23267 | state = $$.state;
|
23268 | // same with redraw
|
23269 | // NOT same with redraw
|
23270 | // Draw with new sizes & scales
|
23271 | options.withTransition = getOption(options, "withTransition", !0), options.withTransform = getOption(options, "withTransform", !1), options.withLegend = getOption(options, "withLegend", !1), options.withUpdateXDomain = !0, options.withUpdateOrgXDomain = !0, options.withTransitionForExit = !1, options.withTransitionForTransform = getOption(options, "withTransitionForTransform", options.withTransition), options.withLegend && config.legend_show || (state.hasAxis && (transitions = $$.axis.generateTransitions(options.withTransitionForAxis ? config.transition_duration : 0)), $$.updateScales(), $$.updateSvgSize(), $$.transformAll(options.withTransitionForTransform, transitions)), $$.redraw(options, transitions);
|
23272 | },
|
23273 | redrawWithoutRescale: function redrawWithoutRescale() {
|
23274 | this.redraw({
|
23275 | withY: !1,
|
23276 | withSubchart: !1,
|
23277 | withEventRect: !1,
|
23278 | withTransitionForAxis: !1
|
23279 | });
|
23280 | }
|
23281 | });
|
23282 | ;// CONCATENATED MODULE: ./node_modules/d3-array/src/ticks.js
|
23283 | var e10 = Math.sqrt(50),
|
23284 | e5 = Math.sqrt(10),
|
23285 | e2 = Math.sqrt(2);
|
23286 | /* harmony default export */ function ticks(start, stop, count) {
|
23287 | var reverse,
|
23288 | n,
|
23289 | ticks,
|
23290 | step,
|
23291 | i = -1;
|
23292 | if (stop = +stop, start = +start, count = +count, start === stop && count > 0) return [start];
|
23293 | if ((reverse = stop < start) && (n = start, start = stop, stop = n), (step = tickIncrement(start, stop, count)) === 0 || !isFinite(step)) return [];
|
23294 |
|
23295 | if (step > 0) {
|
23296 | var r0 = Math.round(start / step),
|
23297 | r1 = Math.round(stop / step);
|
23298 |
|
23299 | for (r0 * step < start && ++r0, r1 * step > stop && --r1, ticks = Array(n = r1 - r0 + 1); ++i < n;) ticks[i] = (r0 + i) * step;
|
23300 | } else {
|
23301 | step = -step;
|
23302 |
|
23303 | var _r = Math.round(start * step),
|
23304 | _r2 = Math.round(stop * step);
|
23305 |
|
23306 | for (_r / step < start && ++_r, _r2 / step > stop && --_r2, ticks = Array(n = _r2 - _r + 1); ++i < n;) ticks[i] = (_r + i) / step;
|
23307 | }
|
23308 |
|
23309 | return reverse && ticks.reverse(), ticks;
|
23310 | }
|
23311 | function tickIncrement(start, stop, count) {
|
23312 | var step = (stop - start) / Math.max(0, count),
|
23313 | power = Math.floor(Math.log(step) / Math.LN10),
|
23314 | error = step / Math.pow(10, power);
|
23315 | return power >= 0 ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power) : -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1);
|
23316 | }
|
23317 | function tickStep(start, stop, count) {
|
23318 | var step0 = Math.abs(stop - start) / Math.max(0, count),
|
23319 | step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)),
|
23320 | error = step0 / step1;
|
23321 | return error >= e10 ? step1 *= 10 : error >= e5 ? step1 *= 5 : error >= e2 && (step1 *= 2), stop < start ? -step1 : step1;
|
23322 | }
|
23323 | ;// CONCATENATED MODULE: ./node_modules/d3-array/src/ascending.js
|
23324 | /* harmony default export */ function src_ascending(a, b) {
|
23325 | return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
|
23326 | }
|
23327 | ;// CONCATENATED MODULE: ./node_modules/d3-array/src/bisector.js
|
23328 |
|
23329 | /* harmony default export */ function bisector(f) {
|
23330 | function left(a, x, lo, hi) {
|
23331 | for (lo == null && (lo = 0), hi == null && (hi = a.length); lo < hi;) {
|
23332 | var mid = lo + hi >>> 1;
|
23333 | compare(a[mid], x) < 0 ? lo = mid + 1 : hi = mid;
|
23334 | }
|
23335 |
|
23336 | return lo;
|
23337 | }
|
23338 |
|
23339 | function right(a, x, lo, hi) {
|
23340 | for (lo == null && (lo = 0), hi == null && (hi = a.length); lo < hi;) {
|
23341 | var mid = lo + hi >>> 1;
|
23342 | compare(a[mid], x) > 0 ? hi = mid : lo = mid + 1;
|
23343 | }
|
23344 |
|
23345 | return lo;
|
23346 | }
|
23347 |
|
23348 | function center(a, x, lo, hi) {
|
23349 | lo == null && (lo = 0), hi == null && (hi = a.length);
|
23350 | var i = left(a, x, lo, hi - 1);
|
23351 | return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;
|
23352 | }
|
23353 |
|
23354 | var delta = f,
|
23355 | compare = f;
|
23356 | return f.length === 1 && (delta = function (d, x) {
|
23357 | return f(d) - x;
|
23358 | }, compare = ascendingComparator(f)), {
|
23359 | left: left,
|
23360 | center: center,
|
23361 | right: right
|
23362 | };
|
23363 | }
|
23364 |
|
23365 | function ascendingComparator(f) {
|
23366 | return function (d, x) {
|
23367 | return src_ascending(f(d), x);
|
23368 | };
|
23369 | }
|
23370 | ;// CONCATENATED MODULE: ./node_modules/d3-array/src/number.js
|
23371 |
|
23372 |
|
23373 | var number_marked = /*#__PURE__*/regenerator_default().mark(numbers);
|
23374 |
|
23375 | function number_createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = number_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { it && (o = it); var i = 0; return function () { return i >= o.length ? { done: !0 } : { done: !1, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } return it = o[Symbol.iterator](), it.next.bind(it); }
|
23376 |
|
23377 | function number_unsupportedIterableToArray(o, minLen) { if (o) { if (typeof o === "string") return number_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); return n === "Object" && o.constructor && (n = o.constructor.name), n === "Map" || n === "Set" ? Array.from(o) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? number_arrayLikeToArray(o, minLen) : void 0; } }
|
23378 |
|
23379 | function number_arrayLikeToArray(arr, len) { (len == null || len > arr.length) && (len = arr.length); for (var i = 0, arr2 = Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
23380 |
|
23381 | /* harmony default export */ function src_number(x) {
|
23382 | return x === null ? NaN : +x;
|
23383 | }
|
23384 | function numbers(values, valueof) {
|
23385 | var _step, value, _iterator, index, _step2, _iterator2, _value;
|
23386 |
|
23387 | return regenerator_default().wrap(function (_context) {
|
23388 | for (;;) switch (_context.prev = _context.next) {
|
23389 | case 0:
|
23390 | if (valueof !== undefined) {
|
23391 | _context.next = 12;
|
23392 | break;
|
23393 | }
|
23394 |
|
23395 | _iterator = number_createForOfIteratorHelperLoose(values);
|
23396 |
|
23397 | case 2:
|
23398 | if ((_step = _iterator()).done) {
|
23399 | _context.next = 10;
|
23400 | break;
|
23401 | }
|
23402 |
|
23403 | if (value = _step.value, _context.t0 = value != null && (value = +value) >= value, !_context.t0) {
|
23404 | _context.next = 8;
|
23405 | break;
|
23406 | }
|
23407 |
|
23408 | return _context.next = 8, value;
|
23409 |
|
23410 | case 8:
|
23411 | _context.next = 2;
|
23412 | break;
|
23413 |
|
23414 | case 10:
|
23415 | _context.next = 22;
|
23416 | break;
|
23417 |
|
23418 | case 12:
|
23419 | index = -1, _iterator2 = number_createForOfIteratorHelperLoose(values);
|
23420 |
|
23421 | case 14:
|
23422 | if ((_step2 = _iterator2()).done) {
|
23423 | _context.next = 22;
|
23424 | break;
|
23425 | }
|
23426 |
|
23427 | if (_value = _step2.value, _context.t1 = (_value = valueof(_value, ++index, values)) != null && (_value = +_value) >= _value, !_context.t1) {
|
23428 | _context.next = 20;
|
23429 | break;
|
23430 | }
|
23431 |
|
23432 | return _context.next = 20, _value;
|
23433 |
|
23434 | case 20:
|
23435 | _context.next = 14;
|
23436 | break;
|
23437 |
|
23438 | case 22:
|
23439 | case "end":
|
23440 | return _context.stop();
|
23441 | }
|
23442 | }, number_marked);
|
23443 | }
|
23444 | ;// CONCATENATED MODULE: ./node_modules/d3-array/src/bisect.js
|
23445 |
|
23446 |
|
23447 |
|
23448 | var ascendingBisect = bisector(src_ascending);
|
23449 | var bisectRight = ascendingBisect.right;
|
23450 | var bisectLeft = ascendingBisect.left;
|
23451 | var bisectCenter = bisector(src_number).center;
|
23452 | /* harmony default export */ var bisect = (bisectRight);
|
23453 | ;// CONCATENATED MODULE: ./node_modules/d3-interpolate/src/round.js
|
23454 | /* harmony default export */ function round(a, b) {
|
23455 | return a = +a, b = +b, function (t) {
|
23456 | return Math.round(a * (1 - t) + b * t);
|
23457 | };
|
23458 | }
|
23459 | ;// CONCATENATED MODULE: ./node_modules/d3-scale/src/constant.js
|
23460 | function constants(x) {
|
23461 | return function () {
|
23462 | return x;
|
23463 | };
|
23464 | }
|
23465 | ;// CONCATENATED MODULE: ./node_modules/d3-scale/src/number.js
|
23466 | function number_number(x) {
|
23467 | return +x;
|
23468 | }
|
23469 | ;// CONCATENATED MODULE: ./node_modules/d3-scale/src/continuous.js
|
23470 |
|
23471 |
|
23472 |
|
23473 |
|
23474 | var unit = [0, 1];
|
23475 | function continuous_identity(x) {
|
23476 | return x;
|
23477 | }
|
23478 |
|
23479 | function normalize(a, b) {
|
23480 | return (b -= a = +a) ? function (x) {
|
23481 | return (x - a) / b;
|
23482 | } : constants(isNaN(b) ? NaN : .5);
|
23483 | }
|
23484 |
|
23485 | function clamper(a, b) {
|
23486 | var t;
|
23487 | return a > b && (t = a, a = b, b = t), function (x) {
|
23488 | return Math.max(a, Math.min(b, x));
|
23489 | };
|
23490 | } // normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].
|
23491 | // interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].
|
23492 |
|
23493 |
|
23494 | function bimap(domain, range, interpolate) {
|
23495 | var d0 = domain[0],
|
23496 | d1 = domain[1],
|
23497 | r0 = range[0],
|
23498 | r1 = range[1];
|
23499 | return d1 < d0 ? (d0 = normalize(d1, d0), r0 = interpolate(r1, r0)) : (d0 = normalize(d0, d1), r0 = interpolate(r0, r1)), function (x) {
|
23500 | return r0(d0(x));
|
23501 | };
|
23502 | }
|
23503 |
|
23504 | function polymap(domain, range, interpolate) {
|
23505 | var j = Math.min(domain.length, range.length) - 1,
|
23506 | d = Array(j),
|
23507 | r = Array(j),
|
23508 | i = -1; // Reverse descending domains.
|
23509 |
|
23510 | for (domain[j] < domain[0] && (domain = domain.slice().reverse(), range = range.slice().reverse()); ++i < j;) d[i] = normalize(domain[i], domain[i + 1]), r[i] = interpolate(range[i], range[i + 1]);
|
23511 |
|
23512 | return function (x) {
|
23513 | var i = bisect(domain, x, 1, j) - 1;
|
23514 | return r[i](d[i](x));
|
23515 | };
|
23516 | }
|
23517 |
|
23518 | function copy(source, target) {
|
23519 | return target.domain(source.domain()).range(source.range()).interpolate(source.interpolate()).clamp(source.clamp()).unknown(source.unknown());
|
23520 | }
|
23521 | function transformer() {
|
23522 | function rescale() {
|
23523 | var n = Math.min(domain.length, range.length);
|
23524 | return clamp !== continuous_identity && (clamp = clamper(domain[0], domain[n - 1])), piecewise = n > 2 ? polymap : bimap, output = input = null, scale;
|
23525 | }
|
23526 |
|
23527 | function scale(x) {
|
23528 | return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate)))(transform(clamp(x)));
|
23529 | }
|
23530 |
|
23531 | var transform,
|
23532 | untransform,
|
23533 | unknown,
|
23534 | piecewise,
|
23535 | output,
|
23536 | input,
|
23537 | domain = unit,
|
23538 | range = unit,
|
23539 | interpolate = value,
|
23540 | clamp = continuous_identity;
|
23541 | return scale.invert = function (y) {
|
23542 | return clamp(untransform((input || (input = piecewise(range, domain.map(transform), number)))(y)));
|
23543 | }, scale.domain = function (_) {
|
23544 | return arguments.length ? (domain = Array.from(_, number_number), rescale()) : domain.slice();
|
23545 | }, scale.range = function (_) {
|
23546 | return arguments.length ? (range = Array.from(_), rescale()) : range.slice();
|
23547 | }, scale.rangeRound = function (_) {
|
23548 | return range = Array.from(_), interpolate = round, rescale();
|
23549 | }, scale.clamp = function (_) {
|
23550 | return arguments.length ? (clamp = !!_ || continuous_identity, rescale()) : clamp !== continuous_identity;
|
23551 | }, scale.interpolate = function (_) {
|
23552 | return arguments.length ? (interpolate = _, rescale()) : interpolate;
|
23553 | }, scale.unknown = function (_) {
|
23554 | return arguments.length ? (unknown = _, scale) : unknown;
|
23555 | }, function (t, u) {
|
23556 | return transform = t, untransform = u, rescale();
|
23557 | };
|
23558 | }
|
23559 | function continuous() {
|
23560 | return transformer()(continuous_identity, continuous_identity);
|
23561 | }
|
23562 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/formatSpecifier.js
|
23563 | // [[fill]align][sign][symbol][0][width][,][.precision][~][type]
|
23564 | var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
|
23565 | function formatSpecifier(specifier) {
|
23566 | if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier);
|
23567 | var match;
|
23568 | return new FormatSpecifier({
|
23569 | fill: match[1],
|
23570 | align: match[2],
|
23571 | sign: match[3],
|
23572 | symbol: match[4],
|
23573 | zero: match[5],
|
23574 | width: match[6],
|
23575 | comma: match[7],
|
23576 | precision: match[8] && match[8].slice(1),
|
23577 | trim: match[9],
|
23578 | type: match[10]
|
23579 | });
|
23580 | }
|
23581 | formatSpecifier.prototype = FormatSpecifier.prototype;
|
23582 | // instanceof
|
23583 | function FormatSpecifier(specifier) {
|
23584 | this.fill = specifier.fill === undefined ? " " : specifier.fill + "", this.align = specifier.align === undefined ? ">" : specifier.align + "", this.sign = specifier.sign === undefined ? "-" : specifier.sign + "", this.symbol = specifier.symbol === undefined ? "" : specifier.symbol + "", this.zero = !!specifier.zero, this.width = specifier.width === undefined ? undefined : +specifier.width, this.comma = !!specifier.comma, this.precision = specifier.precision === undefined ? undefined : +specifier.precision, this.trim = !!specifier.trim, this.type = specifier.type === undefined ? "" : specifier.type + "";
|
23585 | }
|
23586 |
|
23587 | FormatSpecifier.prototype.toString = function () {
|
23588 | return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === undefined ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === undefined ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
|
23589 | };
|
23590 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/formatDecimal.js
|
23591 | /* harmony default export */ function formatDecimal(x) {
|
23592 | return Math.abs(x = Math.round(x)) >= 1e21 ? x.toLocaleString("en").replace(/,/g, "") : x.toString(10);
|
23593 | } // Computes the decimal coefficient and exponent of the specified number x with
|
23594 | // significant digits p, where x is positive and p is in [1, 21] or undefined.
|
23595 | // For example, formatDecimalParts(1.23) returns ["123", 0].
|
23596 |
|
23597 | function formatDecimalParts(x, p) {
|
23598 | if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null; // NaN, ±Infinity
|
23599 |
|
23600 | var i,
|
23601 | coefficient = x.slice(0, i); // The string returned by toExponential either has the form \d\.\d+e[-+]\d+
|
23602 | // (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3).
|
23603 |
|
23604 | return [coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient, +x.slice(i + 1)];
|
23605 | }
|
23606 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/exponent.js
|
23607 |
|
23608 | /* harmony default export */ function exponent(x) {
|
23609 | return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;
|
23610 | }
|
23611 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/precisionPrefix.js
|
23612 |
|
23613 | /* harmony default export */ function precisionPrefix(step, value) {
|
23614 | return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));
|
23615 | }
|
23616 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/formatGroup.js
|
23617 | /* harmony default export */ function formatGroup(grouping, thousands) {
|
23618 | return function (value, width) {
|
23619 | for (var i = value.length, t = [], j = 0, g = grouping[0], length = 0; i > 0 && g > 0 && (length + g + 1 > width && (g = Math.max(1, width - length)), t.push(value.substring(i -= g, i + g)), !((length += g + 1) > width));) g = grouping[j = (j + 1) % grouping.length];
|
23620 |
|
23621 | return t.reverse().join(thousands);
|
23622 | };
|
23623 | }
|
23624 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/formatNumerals.js
|
23625 | /* harmony default export */ function formatNumerals(numerals) {
|
23626 | return function (value) {
|
23627 | return value.replace(/[0-9]/g, function (i) {
|
23628 | return numerals[+i];
|
23629 | });
|
23630 | };
|
23631 | }
|
23632 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/formatTrim.js
|
23633 | // Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.
|
23634 | /* harmony default export */ function formatTrim(s) {
|
23635 | out: for (var i1, n = s.length, i = 1, i0 = -1; i < n; ++i) switch (s[i]) {
|
23636 | case ".":
|
23637 | i0 = i1 = i;
|
23638 | break;
|
23639 |
|
23640 | case "0":
|
23641 | i0 === 0 && (i0 = i), i1 = i;
|
23642 | break;
|
23643 |
|
23644 | default:
|
23645 | if (!+s[i]) break out;
|
23646 | i0 > 0 && (i0 = 0);
|
23647 | }
|
23648 |
|
23649 | return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;
|
23650 | }
|
23651 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/formatPrefixAuto.js
|
23652 |
|
23653 | var prefixExponent;
|
23654 | /* harmony default export */ function formatPrefixAuto(x, p) {
|
23655 | var d = formatDecimalParts(x, p);
|
23656 | if (!d) return x + "";
|
23657 | var coefficient = d[0],
|
23658 | exponent = d[1],
|
23659 | i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,
|
23660 | n = coefficient.length;
|
23661 | return i === n ? coefficient : i > n ? coefficient + Array(i - n + 1).join("0") : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i) : "0." + Array(1 - i).join("0") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!
|
23662 | }
|
23663 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/formatRounded.js
|
23664 |
|
23665 | /* harmony default export */ function formatRounded(x, p) {
|
23666 | var d = formatDecimalParts(x, p);
|
23667 | if (!d) return x + "";
|
23668 | var coefficient = d[0],
|
23669 | exponent = d[1];
|
23670 | return exponent < 0 ? "0." + Array(-exponent).join("0") + coefficient : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1) : coefficient + Array(exponent - coefficient.length + 2).join("0");
|
23671 | }
|
23672 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/formatTypes.js
|
23673 |
|
23674 |
|
23675 |
|
23676 | /* harmony default export */ var formatTypes = ({
|
23677 | "%": function _(x, p) {
|
23678 | return (x * 100).toFixed(p);
|
23679 | },
|
23680 | "b": function b(x) {
|
23681 | return Math.round(x).toString(2);
|
23682 | },
|
23683 | "c": function c(x) {
|
23684 | return x + "";
|
23685 | },
|
23686 | "d": formatDecimal,
|
23687 | "e": function e(x, p) {
|
23688 | return x.toExponential(p);
|
23689 | },
|
23690 | "f": function f(x, p) {
|
23691 | return x.toFixed(p);
|
23692 | },
|
23693 | "g": function g(x, p) {
|
23694 | return x.toPrecision(p);
|
23695 | },
|
23696 | "o": function o(x) {
|
23697 | return Math.round(x).toString(8);
|
23698 | },
|
23699 | "p": function p(x, _p) {
|
23700 | return formatRounded(x * 100, _p);
|
23701 | },
|
23702 | "r": formatRounded,
|
23703 | "s": formatPrefixAuto,
|
23704 | "X": function X(x) {
|
23705 | return Math.round(x).toString(16).toUpperCase();
|
23706 | },
|
23707 | "x": function x(_x) {
|
23708 | return Math.round(_x).toString(16);
|
23709 | }
|
23710 | });
|
23711 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/identity.js
|
23712 | /* harmony default export */ function src_identity(x) {
|
23713 | return x;
|
23714 | }
|
23715 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/locale.js
|
23716 |
|
23717 |
|
23718 |
|
23719 |
|
23720 |
|
23721 |
|
23722 |
|
23723 |
|
23724 | var map = Array.prototype.map,
|
23725 | prefixes = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
|
23726 | /* harmony default export */ function src_locale(locale) {
|
23727 | function newFormat(specifier) {
|
23728 | function format(value) {
|
23729 | var i,
|
23730 | n,
|
23731 | c,
|
23732 | valuePrefix = prefix,
|
23733 | valueSuffix = suffix;
|
23734 | if (type === "c") valueSuffix = formatType(value) + valueSuffix, value = "";else {
|
23735 | value = +value;
|
23736 | // Determine the sign. -0 is not less than 0, but 1 / -0 is!
|
23737 | var valueNegative = value < 0 || 1 / value < 0; // Perform the initial formatting.
|
23738 |
|
23739 | // Break the formatted value into the integer “value” part that can be
|
23740 | // grouped, and fractional or exponential “suffix” part that is not.
|
23741 | if (value = isNaN(value) ? nan : formatType(Math.abs(value), precision), trim && (value = formatTrim(value)), valueNegative && +value === 0 && sign !== "+" && (valueNegative = !1), valuePrefix = (valueNegative ? sign === "(" ? sign : minus : sign === "-" || sign === "(" ? "" : sign) + valuePrefix, valueSuffix = (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : ""), maybeSuffix) for (i = -1, n = value.length; ++i < n;) if (c = value.charCodeAt(i), 48 > c || c > 57) {
|
23742 | valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix, value = value.slice(0, i);
|
23743 | break;
|
23744 | }
|
23745 | } // If the fill character is not "0", grouping is applied before padding.
|
23746 |
|
23747 | comma && !zero && (value = group(value, Infinity));
|
23748 | // Compute the padding.
|
23749 | var length = valuePrefix.length + value.length + valueSuffix.length,
|
23750 | padding = length < width ? Array(width - length + 1).join(fill) : ""; // If the fill character is "0", grouping is applied after padding.
|
23751 |
|
23752 | // Reconstruct the final output based on the desired alignment.
|
23753 | switch (comma && zero && (value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = ""), align) {
|
23754 | case "<":
|
23755 | value = valuePrefix + value + valueSuffix + padding;
|
23756 | break;
|
23757 |
|
23758 | case "=":
|
23759 | value = valuePrefix + padding + value + valueSuffix;
|
23760 | break;
|
23761 |
|
23762 | case "^":
|
23763 | value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length);
|
23764 | break;
|
23765 |
|
23766 | default:
|
23767 | value = padding + valuePrefix + value + valueSuffix;
|
23768 | }
|
23769 |
|
23770 | return numerals(value);
|
23771 | }
|
23772 |
|
23773 | specifier = formatSpecifier(specifier);
|
23774 | var fill = specifier.fill,
|
23775 | align = specifier.align,
|
23776 | sign = specifier.sign,
|
23777 | symbol = specifier.symbol,
|
23778 | zero = specifier.zero,
|
23779 | width = specifier.width,
|
23780 | comma = specifier.comma,
|
23781 | precision = specifier.precision,
|
23782 | trim = specifier.trim,
|
23783 | type = specifier.type; // The "n" type is an alias for ",g".
|
23784 |
|
23785 | type === "n" ? (comma = !0, type = "g") : !formatTypes[type] && (precision === undefined && (precision = 12), trim = !0, type = "g"), (zero || fill === "0" && align === "=") && (zero = !0, fill = "0", align = "=");
|
23786 | // Compute the prefix and suffix.
|
23787 | // For SI-prefix, the suffix is lazily computed.
|
23788 | var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "",
|
23789 | suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : "",
|
23790 | formatType = formatTypes[type],
|
23791 | maybeSuffix = /[defgprs%]/.test(type); // What format function should we use?
|
23792 | // Is this an integer type?
|
23793 | // Can this type generate exponential notation?
|
23794 |
|
23795 | return precision = precision === undefined ? 6 : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision)) : Math.max(0, Math.min(20, precision)), format.toString = function () {
|
23796 | return specifier + "";
|
23797 | }, format;
|
23798 | }
|
23799 |
|
23800 | var group = locale.grouping === undefined || locale.thousands === undefined ? src_identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + ""),
|
23801 | currencyPrefix = locale.currency === undefined ? "" : locale.currency[0] + "",
|
23802 | currencySuffix = locale.currency === undefined ? "" : locale.currency[1] + "",
|
23803 | decimal = locale.decimal === undefined ? "." : locale.decimal + "",
|
23804 | numerals = locale.numerals === undefined ? src_identity : formatNumerals(map.call(locale.numerals, String)),
|
23805 | percent = locale.percent === undefined ? "%" : locale.percent + "",
|
23806 | minus = locale.minus === undefined ? "−" : locale.minus + "",
|
23807 | nan = locale.nan === undefined ? "NaN" : locale.nan + "";
|
23808 | return {
|
23809 | format: newFormat,
|
23810 | formatPrefix: function (specifier, value) {
|
23811 | var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)),
|
23812 | e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,
|
23813 | k = Math.pow(10, -e),
|
23814 | prefix = prefixes[8 + e / 3];
|
23815 | return function (value) {
|
23816 | return f(k * value) + prefix;
|
23817 | };
|
23818 | }
|
23819 | };
|
23820 | }
|
23821 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/defaultLocale.js
|
23822 |
|
23823 | var defaultLocale_locale;
|
23824 | var defaultLocale_format;
|
23825 | var formatPrefix;
|
23826 | defaultLocale_defaultLocale({
|
23827 | thousands: ",",
|
23828 | grouping: [3],
|
23829 | currency: ["$", ""]
|
23830 | });
|
23831 | function defaultLocale_defaultLocale(definition) {
|
23832 | return defaultLocale_locale = src_locale(definition), defaultLocale_format = defaultLocale_locale.format, formatPrefix = defaultLocale_locale.formatPrefix, defaultLocale_locale;
|
23833 | }
|
23834 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/precisionRound.js
|
23835 |
|
23836 | /* harmony default export */ function precisionRound(step, max) {
|
23837 | return step = Math.abs(step), max = Math.abs(max) - step, Math.max(0, exponent(max) - exponent(step)) + 1;
|
23838 | }
|
23839 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/precisionFixed.js
|
23840 |
|
23841 | /* harmony default export */ function precisionFixed(step) {
|
23842 | return Math.max(0, -exponent(Math.abs(step)));
|
23843 | }
|
23844 | ;// CONCATENATED MODULE: ./node_modules/d3-scale/src/tickFormat.js
|
23845 |
|
23846 |
|
23847 | function tickFormat(start, stop, count, specifier) {
|
23848 | var precision,
|
23849 | step = tickStep(start, stop, count);
|
23850 |
|
23851 | switch (specifier = formatSpecifier(specifier == null ? ",f" : specifier), specifier.type) {
|
23852 | case "s":
|
23853 | {
|
23854 | var value = Math.max(Math.abs(start), Math.abs(stop));
|
23855 | return specifier.precision != null || isNaN(precision = precisionPrefix(step, value)) || (specifier.precision = precision), formatPrefix(specifier, value);
|
23856 | }
|
23857 |
|
23858 | case "":
|
23859 | case "e":
|
23860 | case "g":
|
23861 | case "p":
|
23862 | case "r":
|
23863 | {
|
23864 | specifier.precision != null || isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop)))) || (specifier.precision = precision - (specifier.type === "e"));
|
23865 | break;
|
23866 | }
|
23867 |
|
23868 | case "f":
|
23869 | case "%":
|
23870 | {
|
23871 | specifier.precision != null || isNaN(precision = precisionFixed(step)) || (specifier.precision = precision - (specifier.type === "%") * 2);
|
23872 | break;
|
23873 | }
|
23874 | }
|
23875 |
|
23876 | return defaultLocale_format(specifier);
|
23877 | }
|
23878 | ;// CONCATENATED MODULE: ./node_modules/d3-scale/src/linear.js
|
23879 |
|
23880 |
|
23881 |
|
23882 |
|
23883 | function linearish(scale) {
|
23884 | var domain = scale.domain;
|
23885 | return scale.ticks = function (count) {
|
23886 | var d = domain();
|
23887 | return ticks(d[0], d[d.length - 1], count == null ? 10 : count);
|
23888 | }, scale.tickFormat = function (count, specifier) {
|
23889 | var d = domain();
|
23890 | return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);
|
23891 | }, scale.nice = function (count) {
|
23892 | count == null && (count = 10);
|
23893 | var prestep,
|
23894 | step,
|
23895 | d = domain(),
|
23896 | i0 = 0,
|
23897 | i1 = d.length - 1,
|
23898 | start = d[i0],
|
23899 | stop = d[i1],
|
23900 | maxIter = 10;
|
23901 |
|
23902 | for (stop < start && (step = start, start = stop, stop = step, step = i0, i0 = i1, i1 = step); maxIter-- > 0;) {
|
23903 | if (step = tickIncrement(start, stop, count), step === prestep) return d[i0] = start, d[i1] = stop, domain(d);
|
23904 | if (step > 0) start = Math.floor(start / step) * step, stop = Math.ceil(stop / step) * step;else if (step < 0) start = Math.ceil(start * step) / step, stop = Math.floor(stop * step) / step;else break;
|
23905 | prestep = step;
|
23906 | }
|
23907 |
|
23908 | return scale;
|
23909 | }, scale;
|
23910 | }
|
23911 | function linear_linear() {
|
23912 | var scale = continuous();
|
23913 | return scale.copy = function () {
|
23914 | return copy(scale, linear_linear());
|
23915 | }, initRange.apply(scale, arguments), linearish(scale);
|
23916 | }
|
23917 | ;// CONCATENATED MODULE: ./node_modules/d3-scale/src/symlog.js
|
23918 |
|
23919 |
|
23920 |
|
23921 |
|
23922 | function transformSymlog(c) {
|
23923 | return function (x) {
|
23924 | return Math.sign(x) * Math.log1p(Math.abs(x / c));
|
23925 | };
|
23926 | }
|
23927 |
|
23928 | function transformSymexp(c) {
|
23929 | return function (x) {
|
23930 | return Math.sign(x) * Math.expm1(Math.abs(x)) * c;
|
23931 | };
|
23932 | }
|
23933 |
|
23934 | function symlogish(transform) {
|
23935 | var c = 1,
|
23936 | scale = transform(transformSymlog(c), transformSymexp(c));
|
23937 | return scale.constant = function (_) {
|
23938 | return arguments.length ? transform(transformSymlog(c = +_), transformSymexp(c)) : c;
|
23939 | }, linearish(scale);
|
23940 | }
|
23941 | function symlog() {
|
23942 | var scale = symlogish(transformer());
|
23943 | return scale.copy = function () {
|
23944 | return copy(scale, symlog()).constant(scale.constant());
|
23945 | }, initRange.apply(scale, arguments);
|
23946 | }
|
23947 | ;// CONCATENATED MODULE: ./node_modules/d3-scale/src/nice.js
|
23948 | function nice(domain, interval) {
|
23949 | domain = domain.slice();
|
23950 | var t,
|
23951 | i0 = 0,
|
23952 | i1 = domain.length - 1,
|
23953 | x0 = domain[i0],
|
23954 | x1 = domain[i1];
|
23955 | return x1 < x0 && (t = i0, i0 = i1, i1 = t, t = x0, x0 = x1, x1 = t), domain[i0] = interval.floor(x0), domain[i1] = interval.ceil(x1), domain;
|
23956 | }
|
23957 | ;// CONCATENATED MODULE: ./node_modules/d3-scale/src/log.js
|
23958 |
|
23959 |
|
23960 |
|
23961 |
|
23962 |
|
23963 |
|
23964 | function transformLog(x) {
|
23965 | return Math.log(x);
|
23966 | }
|
23967 |
|
23968 | function transformExp(x) {
|
23969 | return Math.exp(x);
|
23970 | }
|
23971 |
|
23972 | function transformLogn(x) {
|
23973 | return -Math.log(-x);
|
23974 | }
|
23975 |
|
23976 | function transformExpn(x) {
|
23977 | return -Math.exp(-x);
|
23978 | }
|
23979 |
|
23980 | function pow10(x) {
|
23981 | return isFinite(x) ? +("1e" + x) : x < 0 ? 0 : x;
|
23982 | }
|
23983 |
|
23984 | function powp(base) {
|
23985 | return base === 10 ? pow10 : base === Math.E ? Math.exp : function (x) {
|
23986 | return Math.pow(base, x);
|
23987 | };
|
23988 | }
|
23989 |
|
23990 | function logp(base) {
|
23991 | return base === Math.E ? Math.log : base === 10 && Math.log10 || base === 2 && Math.log2 || (base = Math.log(base), function (x) {
|
23992 | return Math.log(x) / base;
|
23993 | });
|
23994 | }
|
23995 |
|
23996 | function reflect(f) {
|
23997 | return function (x) {
|
23998 | return -f(-x);
|
23999 | };
|
24000 | }
|
24001 |
|
24002 | function loggish(transform) {
|
24003 | function rescale() {
|
24004 | return logs = logp(base), pows = powp(base), domain()[0] < 0 ? (logs = reflect(logs), pows = reflect(pows), transform(transformLogn, transformExpn)) : transform(transformLog, transformExp), scale;
|
24005 | }
|
24006 |
|
24007 | var logs,
|
24008 | pows,
|
24009 | scale = transform(transformLog, transformExp),
|
24010 | domain = scale.domain,
|
24011 | base = 10;
|
24012 | return scale.base = function (_) {
|
24013 | return arguments.length ? (base = +_, rescale()) : base;
|
24014 | }, scale.domain = function (_) {
|
24015 | return arguments.length ? (domain(_), rescale()) : domain();
|
24016 | }, scale.ticks = function (count) {
|
24017 | var r,
|
24018 | d = domain(),
|
24019 | u = d[0],
|
24020 | v = d[d.length - 1];
|
24021 | (r = v < u) && (i = u, u = v, v = i);
|
24022 | var p,
|
24023 | k,
|
24024 | t,
|
24025 | i = logs(u),
|
24026 | j = logs(v),
|
24027 | n = count == null ? 10 : +count,
|
24028 | z = [];
|
24029 |
|
24030 | if (!(base % 1) && j - i < n) {
|
24031 | if (i = Math.floor(i), j = Math.ceil(j), u > 0) {
|
24032 | for (; i <= j; ++i) for (k = 1, p = pows(i); k < base; ++k) if (t = p * k, !(t < u)) {
|
24033 | if (t > v) break;
|
24034 | z.push(t);
|
24035 | }
|
24036 | } else for (; i <= j; ++i) for (k = base - 1, p = pows(i); k >= 1; --k) if (t = p * k, !(t < u)) {
|
24037 | if (t > v) break;
|
24038 | z.push(t);
|
24039 | }
|
24040 | z.length * 2 < n && (z = ticks(u, v, n));
|
24041 | } else z = ticks(i, j, Math.min(j - i, n)).map(pows);
|
24042 |
|
24043 | return r ? z.reverse() : z;
|
24044 | }, scale.tickFormat = function (count, specifier) {
|
24045 | if (specifier == null && (specifier = base === 10 ? ".0e" : ","), typeof specifier !== "function" && (specifier = defaultLocale_format(specifier)), count === Infinity) return specifier;
|
24046 | count == null && (count = 10);
|
24047 | var k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?
|
24048 |
|
24049 | return function (d) {
|
24050 | var i = d / pows(Math.round(logs(d)));
|
24051 | return i * base < base - .5 && (i *= base), i <= k ? specifier(d) : "";
|
24052 | };
|
24053 | }, scale.nice = function () {
|
24054 | return domain(nice(domain(), {
|
24055 | floor: function floor(x) {
|
24056 | return pows(Math.floor(logs(x)));
|
24057 | },
|
24058 | ceil: function ceil(x) {
|
24059 | return pows(Math.ceil(logs(x)));
|
24060 | }
|
24061 | }));
|
24062 | }, scale;
|
24063 | }
|
24064 | function log() {
|
24065 | var scale = loggish(transformer()).domain([1, 10]);
|
24066 | return scale.copy = function () {
|
24067 | return copy(scale, log()).base(scale.base());
|
24068 | }, initRange.apply(scale, arguments), scale;
|
24069 | }
|
24070 | ;// CONCATENATED MODULE: ./node_modules/d3-time/src/month.js
|
24071 |
|
24072 | var month = newInterval(function (date) {
|
24073 | date.setDate(1), date.setHours(0, 0, 0, 0);
|
24074 | }, function (date, step) {
|
24075 | date.setMonth(date.getMonth() + step);
|
24076 | }, function (start, end) {
|
24077 | return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;
|
24078 | }, function (date) {
|
24079 | return date.getMonth();
|
24080 | });
|
24081 | /* harmony default export */ var src_month = (month);
|
24082 | var months = month.range;
|
24083 | ;// CONCATENATED MODULE: ./node_modules/d3-time/src/hour.js
|
24084 |
|
24085 |
|
24086 | var hour = newInterval(function (date) {
|
24087 | date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);
|
24088 | }, function (date, step) {
|
24089 | date.setTime(+date + step * durationHour);
|
24090 | }, function (start, end) {
|
24091 | return (end - start) / durationHour;
|
24092 | }, function (date) {
|
24093 | return date.getHours();
|
24094 | });
|
24095 | /* harmony default export */ var src_hour = (hour);
|
24096 | var hours = hour.range;
|
24097 | ;// CONCATENATED MODULE: ./node_modules/d3-time/src/minute.js
|
24098 |
|
24099 |
|
24100 | var minute = newInterval(function (date) {
|
24101 | date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);
|
24102 | }, function (date, step) {
|
24103 | date.setTime(+date + step * durationMinute);
|
24104 | }, function (start, end) {
|
24105 | return (end - start) / durationMinute;
|
24106 | }, function (date) {
|
24107 | return date.getMinutes();
|
24108 | });
|
24109 | /* harmony default export */ var src_minute = (minute);
|
24110 | var minutes = minute.range;
|
24111 | ;// CONCATENATED MODULE: ./node_modules/d3-time/src/second.js
|
24112 |
|
24113 |
|
24114 | var second = newInterval(function (date) {
|
24115 | date.setTime(date - date.getMilliseconds());
|
24116 | }, function (date, step) {
|
24117 | date.setTime(+date + step * durationSecond);
|
24118 | }, function (start, end) {
|
24119 | return (end - start) / durationSecond;
|
24120 | }, function (date) {
|
24121 | return date.getUTCSeconds();
|
24122 | });
|
24123 | /* harmony default export */ var src_second = (second);
|
24124 | var seconds = second.range;
|
24125 | ;// CONCATENATED MODULE: ./node_modules/d3-time/src/millisecond.js
|
24126 |
|
24127 | var millisecond = newInterval(function () {// noop
|
24128 | }, function (date, step) {
|
24129 | date.setTime(+date + step);
|
24130 | }, function (start, end) {
|
24131 | return end - start;
|
24132 | }); // An optimized implementation for this simple case.
|
24133 |
|
24134 | millisecond.every = function (k) {
|
24135 | return k = Math.floor(k), isFinite(k) && k > 0 ? k > 1 ? newInterval(function (date) {
|
24136 | date.setTime(Math.floor(date / k) * k);
|
24137 | }, function (date, step) {
|
24138 | date.setTime(+date + step * k);
|
24139 | }, function (start, end) {
|
24140 | return (end - start) / k;
|
24141 | }) : millisecond : null;
|
24142 | };
|
24143 |
|
24144 | /* harmony default export */ var src_millisecond = (millisecond);
|
24145 | var milliseconds = millisecond.range;
|
24146 | ;// CONCATENATED MODULE: ./node_modules/d3-scale/src/time.js
|
24147 |
|
24148 |
|
24149 |
|
24150 |
|
24151 |
|
24152 |
|
24153 | var time_durationSecond = 1e3,
|
24154 | time_durationMinute = 60000,
|
24155 | time_durationHour = 3600000,
|
24156 | time_durationDay = 86400000,
|
24157 | time_durationWeek = 604800000,
|
24158 | durationMonth = 2592000000,
|
24159 | durationYear = 31536000000;
|
24160 |
|
24161 | function time_date(t) {
|
24162 | return new Date(t);
|
24163 | }
|
24164 |
|
24165 | function time_number(t) {
|
24166 | return t instanceof Date ? +t : +new Date(+t);
|
24167 | }
|
24168 |
|
24169 | function calendar(year, month, week, day, hour, minute, second, millisecond, format) {
|
24170 | function tickFormat(date) {
|
24171 | return (second(date) < date ? formatMillisecond : minute(date) < date ? formatSecond : hour(date) < date ? formatMinute : day(date) < date ? formatHour : month(date) < date ? week(date) < date ? formatDay : formatWeek : year(date) < date ? formatMonth : formatYear)(date);
|
24172 | }
|
24173 |
|
24174 | function tickInterval(interval, start, stop) {
|
24175 | // If a desired tick count is specified, pick a reasonable tick interval
|
24176 | // based on the extent of the domain and a rough estimate of tick size.
|
24177 | // Otherwise, assume interval is already a time interval and use it.
|
24178 | if (interval == null && (interval = 10), typeof interval === "number") {
|
24179 | var step,
|
24180 | target = Math.abs(stop - start) / interval,
|
24181 | i = bisector(function (i) {
|
24182 | return i[2];
|
24183 | }).right(tickIntervals, target);
|
24184 | return i === tickIntervals.length ? (step = tickStep(start / durationYear, stop / durationYear, interval), interval = year) : i ? (i = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i], step = i[1], interval = i[0]) : (step = Math.max(tickStep(start, stop, interval), 1), interval = millisecond), interval.every(step);
|
24185 | }
|
24186 |
|
24187 | return interval;
|
24188 | }
|
24189 |
|
24190 | var scale = continuous(),
|
24191 | invert = scale.invert,
|
24192 | domain = scale.domain,
|
24193 | formatMillisecond = format(".%L"),
|
24194 | formatSecond = format(":%S"),
|
24195 | formatMinute = format("%I:%M"),
|
24196 | formatHour = format("%I %p"),
|
24197 | formatDay = format("%a %d"),
|
24198 | formatWeek = format("%b %d"),
|
24199 | formatMonth = format("%B"),
|
24200 | formatYear = format("%Y"),
|
24201 | tickIntervals = [[second, 1, time_durationSecond], [second, 5, 5000], [second, 15, 15000], [second, 30, 30000], [minute, 1, time_durationMinute], [minute, 5, 300000], [minute, 15, 900000], [minute, 30, 1800000], [hour, 1, time_durationHour], [hour, 3, 10800000], [hour, 6, 21600000], [hour, 12, 43200000], [day, 1, time_durationDay], [day, 2, 172800000], [week, 1, time_durationWeek], [month, 1, durationMonth], [month, 3, 7776000000], [year, 1, durationYear]];
|
24202 | return scale.invert = function (y) {
|
24203 | return new Date(invert(y));
|
24204 | }, scale.domain = function (_) {
|
24205 | return arguments.length ? domain(Array.from(_, time_number)) : domain().map(time_date);
|
24206 | }, scale.ticks = function (interval) {
|
24207 | var t,
|
24208 | d = domain(),
|
24209 | t0 = d[0],
|
24210 | t1 = d[d.length - 1],
|
24211 | r = t1 < t0;
|
24212 | // inclusive stop
|
24213 | return r && (t = t0, t0 = t1, t1 = t), t = tickInterval(interval, t0, t1), t = t ? t.range(t0, t1 + 1) : [], r ? t.reverse() : t;
|
24214 | }, scale.tickFormat = function (count, specifier) {
|
24215 | return specifier == null ? tickFormat : format(specifier);
|
24216 | }, scale.nice = function (interval) {
|
24217 | var d = domain();
|
24218 | return (interval = tickInterval(interval, d[0], d[d.length - 1])) ? domain(nice(d, interval)) : scale;
|
24219 | }, scale.copy = function () {
|
24220 | return copy(scale, calendar(year, month, week, day, hour, minute, second, millisecond, format));
|
24221 | }, scale;
|
24222 | }
|
24223 | function time() {
|
24224 | return initRange.apply(calendar(src_year, src_month, sunday, src_day, src_hour, src_minute, src_second, src_millisecond, timeFormat).domain([new Date(2e3, 0, 1), new Date(2e3, 0, 2)]), arguments);
|
24225 | }
|
24226 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/scale.ts
|
24227 | /**
|
24228 | * Copyright (c) 2017 ~ present NAVER Corp.
|
24229 | * billboard.js project is licensed under the MIT license
|
24230 | */
|
24231 |
|
24232 |
|
24233 | /**
|
24234 | * Get scale
|
24235 | * @param {string} [type='linear'] Scale type
|
24236 | * @param {number} [min] Min range
|
24237 | * @param {number} [max] Max range
|
24238 | * @returns {d3.scaleLinear|d3.scaleTime} scale
|
24239 | * @private
|
24240 | */
|
24241 |
|
24242 | function getScale(type, min, max) {
|
24243 | type === void 0 && (type = "linear"), min === void 0 && (min = 0), max === void 0 && (max = 1);
|
24244 | var scale = {
|
24245 | linear: linear_linear,
|
24246 | log: symlog,
|
24247 | _log: log,
|
24248 | time: time
|
24249 | }[type]();
|
24250 | return scale.type = type, /_?log/.test(type) && scale.clamp(!0), scale.range([min, max]);
|
24251 | }
|
24252 | /* harmony default export */ var scale = ({
|
24253 | /**
|
24254 | * Get x Axis scale function
|
24255 | * @param {number} min Min value
|
24256 | * @param {number} max Max value
|
24257 | * @param {Array} domain Domain value
|
24258 | * @param {Function} offset The offset getter to be sum
|
24259 | * @returns {Function} scale
|
24260 | * @private
|
24261 | */
|
24262 | getXScale: function getXScale(min, max, domain, offset) {
|
24263 | var $$ = this,
|
24264 | scale = $$.scale.zoom || getScale($$.axis.getAxisType("x"), min, max);
|
24265 | return $$.getCustomizedScale(domain ? scale.domain(domain) : scale, offset);
|
24266 | },
|
24267 |
|
24268 | /**
|
24269 | * Get y Axis scale function
|
24270 | * @param {string} id Axis id: 'y' or 'y2'
|
24271 | * @param {number} min Min value
|
24272 | * @param {number} max Max value
|
24273 | * @param {Array} domain Domain value
|
24274 | * @returns {Function} Scale function
|
24275 | * @private
|
24276 | */
|
24277 | getYScale: function getYScale(id, min, max, domain) {
|
24278 | var $$ = this,
|
24279 | scale = getScale($$.axis.getAxisType(id), min, max);
|
24280 | return domain && scale.domain(domain), scale;
|
24281 | },
|
24282 |
|
24283 | /**
|
24284 | * Get y Axis scale
|
24285 | * @param {string} id Axis id
|
24286 | * @param {boolean} isSub Weather is sub Axis
|
24287 | * @returns {Function} Scale function
|
24288 | * @private
|
24289 | */
|
24290 | getYScaleById: function getYScaleById(id, isSub) {
|
24291 | isSub === void 0 && (isSub = !1);
|
24292 | var isY2 = this.axis.getId(id) === "y2",
|
24293 | key = isSub ? isY2 ? "subY2" : "subY" : isY2 ? "y2" : "y";
|
24294 | return this.scale[key];
|
24295 | },
|
24296 |
|
24297 | /**
|
24298 | * Get customized scale
|
24299 | * @param {d3.scaleLinear|d3.scaleTime} scaleValue Scale function
|
24300 | * @param {Function} offsetValue Offset getter to be sum
|
24301 | * @returns {Function} Scale function
|
24302 | * @private
|
24303 | */
|
24304 | getCustomizedScale: function getCustomizedScale(scaleValue, offsetValue) {
|
24305 | var $$ = this,
|
24306 | offset = offsetValue || function () {
|
24307 | return $$.axis.x.tickOffset();
|
24308 | },
|
24309 | scale = function (d, raw) {
|
24310 | var v = scaleValue(d) + offset();
|
24311 | return raw ? v : Math.ceil(v);
|
24312 | };
|
24313 |
|
24314 | // copy original scale methods
|
24315 | for (var key in scaleValue) scale[key] = scaleValue[key];
|
24316 |
|
24317 | return scale.orgDomain = function () {
|
24318 | return scaleValue.domain();
|
24319 | }, scale.orgScale = function () {
|
24320 | return scaleValue;
|
24321 | }, $$.axis.isCategorized() && (scale.domain = function (domainValue) {
|
24322 | var domain = domainValue;
|
24323 | return arguments.length ? (scaleValue.domain(domain), scale) : (domain = this.orgDomain(), [domain[0], domain[1] + 1]);
|
24324 | }), scale;
|
24325 | },
|
24326 |
|
24327 | /**
|
24328 | * Update scale
|
24329 | * @param {boolean} isInit Param is given at the init rendering
|
24330 | * @param {boolean} updateXDomain If update x domain
|
24331 | * @private
|
24332 | */
|
24333 | updateScales: function updateScales(isInit, updateXDomain) {
|
24334 | updateXDomain === void 0 && (updateXDomain = !0);
|
24335 | var $$ = this,
|
24336 | axis = $$.axis,
|
24337 | config = $$.config,
|
24338 | format = $$.format,
|
24339 | org = $$.org,
|
24340 | scale = $$.scale,
|
24341 | _$$$state = $$.state,
|
24342 | width = _$$$state.width,
|
24343 | height = _$$$state.height,
|
24344 | width2 = _$$$state.width2,
|
24345 | height2 = _$$$state.height2,
|
24346 | hasAxis = _$$$state.hasAxis;
|
24347 |
|
24348 | if (hasAxis) {
|
24349 | var isRotated = config.axis_rotated,
|
24350 | min = {
|
24351 | x: isRotated ? 1 : 0,
|
24352 | y: isRotated ? 0 : height,
|
24353 | subX: isRotated ? 1 : 0,
|
24354 | subY: isRotated ? 0 : height2
|
24355 | },
|
24356 | max = {
|
24357 | x: isRotated ? height : width,
|
24358 | y: isRotated ? width : 1,
|
24359 | subX: isRotated ? height : width,
|
24360 | subY: isRotated ? width2 : 1
|
24361 | },
|
24362 | xDomain = updateXDomain && scale.x && scale.x.orgDomain(),
|
24363 | xSubDomain = updateXDomain && org.xDomain; // update edges
|
24364 |
|
24365 | // y Axis
|
24366 | scale.x = $$.getXScale(min.x, max.x, xDomain, function () {
|
24367 | return axis.x.tickOffset();
|
24368 | }), scale.subX = $$.getXScale(min.x, max.x, xSubDomain, function (d) {
|
24369 | return d % 1 ? 0 : axis.subX.tickOffset();
|
24370 | }), format.xAxisTick = axis.getXAxisTickFormat(), axis.setAxis("x", scale.x, config.axis_x_tick_outer, isInit), config.subchart_show && axis.setAxis("subX", scale.subX, config.axis_x_tick_outer, isInit), scale.y = $$.getYScale("y", min.y, max.y, scale.y ? scale.y.domain() : config.axis_y_default), scale.subY = $$.getYScale("y", min.subY, max.subY, scale.subY ? scale.subY.domain() : config.axis_y_default), axis.setAxis("y", scale.y, config.axis_y_tick_outer, isInit), config.axis_y2_show && (scale.y2 = $$.getYScale("y2", min.y, max.y, scale.y2 ? scale.y2.domain() : config.axis_y2_default), scale.subY2 = $$.getYScale("y2", min.subY, max.subY, scale.subY2 ? scale.subY2.domain() : config.axis_y2_default), axis.setAxis("y2", scale.y2, config.axis_y2_tick_outer, isInit));
|
24371 | } else // update for arc
|
24372 | $$.updateArc && $$.updateArc();
|
24373 | },
|
24374 |
|
24375 | /**
|
24376 | * Get the zoom or unzoomed scaled value
|
24377 | * @param {Date|number|object} d Data value
|
24378 | * @returns {number|null}
|
24379 | * @private
|
24380 | */
|
24381 | xx: function xx(d) {
|
24382 | var $$ = this,
|
24383 | config = $$.config,
|
24384 | _$$$scale = $$.scale,
|
24385 | x = _$$$scale.x,
|
24386 | zoom = _$$$scale.zoom,
|
24387 | fn = config.zoom_enabled && zoom ? zoom : x;
|
24388 | return d ? fn(isValue(d.x) ? d.x : d) : null;
|
24389 | },
|
24390 | xv: function xv(d) {
|
24391 | var $$ = this,
|
24392 | axis = $$.axis,
|
24393 | config = $$.config,
|
24394 | x = $$.scale.x,
|
24395 | value = $$.getBaseValue(d);
|
24396 | return axis.isTimeSeries() ? value = parseDate.call($$, value) : axis.isCategorized() && isString(value) && (value = config.axis_x_categories.indexOf(value)), Math.ceil(x(value));
|
24397 | },
|
24398 | yv: function yv(d) {
|
24399 | var $$ = this,
|
24400 | _$$$scale2 = $$.scale,
|
24401 | y = _$$$scale2.y,
|
24402 | y2 = _$$$scale2.y2,
|
24403 | yScale = d.axis && d.axis === "y2" ? y2 : y;
|
24404 | return Math.ceil(yScale($$.getBaseValue(d)));
|
24405 | },
|
24406 | subxx: function subxx(d) {
|
24407 | return d ? this.scale.subX(d.x) : null;
|
24408 | }
|
24409 | });
|
24410 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/basis.js
|
24411 | function _point(that, x, y) {
|
24412 | that._context.bezierCurveTo((2 * that._x0 + that._x1) / 3, (2 * that._y0 + that._y1) / 3, (that._x0 + 2 * that._x1) / 3, (that._y0 + 2 * that._y1) / 3, (that._x0 + 4 * that._x1 + x) / 6, (that._y0 + 4 * that._y1 + y) / 6);
|
24413 | }
|
24414 |
|
24415 |
|
24416 | function Basis(context) {
|
24417 | this._context = context;
|
24418 | }
|
24419 | Basis.prototype = {
|
24420 | areaStart: function areaStart() {
|
24421 | this._line = 0;
|
24422 | },
|
24423 | areaEnd: function areaEnd() {
|
24424 | this._line = NaN;
|
24425 | },
|
24426 | lineStart: function lineStart() {
|
24427 | this._x0 = this._x1 = this._y0 = this._y1 = NaN, this._point = 0;
|
24428 | },
|
24429 | lineEnd: function lineEnd() {
|
24430 | switch (this._point) {
|
24431 | case 3:
|
24432 | _point(this, this._x1, this._y1);
|
24433 |
|
24434 | // proceed
|
24435 |
|
24436 | case 2:
|
24437 | this._context.lineTo(this._x1, this._y1);
|
24438 |
|
24439 | }
|
24440 |
|
24441 | (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
|
24442 | },
|
24443 | point: function point(x, y) {
|
24444 | switch (x = +x, y = +y, this._point) {
|
24445 | case 0:
|
24446 | this._point = 1, this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y);
|
24447 | break;
|
24448 |
|
24449 | case 1:
|
24450 | this._point = 2;
|
24451 | break;
|
24452 |
|
24453 | case 2:
|
24454 | this._point = 3, this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6);
|
24455 | // proceed
|
24456 |
|
24457 | default:
|
24458 | _point(this, x, y);
|
24459 |
|
24460 | }
|
24461 |
|
24462 | this._x0 = this._x1, this._x1 = x, this._y0 = this._y1, this._y1 = y;
|
24463 | }
|
24464 | };
|
24465 | /* harmony default export */ function curve_basis(context) {
|
24466 | return new Basis(context);
|
24467 | }
|
24468 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/noop.js
|
24469 | /* harmony default export */ function src_noop() {}
|
24470 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/basisClosed.js
|
24471 |
|
24472 |
|
24473 |
|
24474 | function BasisClosed(context) {
|
24475 | this._context = context;
|
24476 | }
|
24477 |
|
24478 | BasisClosed.prototype = {
|
24479 | areaStart: src_noop,
|
24480 | areaEnd: src_noop,
|
24481 | lineStart: function lineStart() {
|
24482 | this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN, this._point = 0;
|
24483 | },
|
24484 | lineEnd: function lineEnd() {
|
24485 | switch (this._point) {
|
24486 | case 1:
|
24487 | {
|
24488 | this._context.moveTo(this._x2, this._y2), this._context.closePath();
|
24489 | break;
|
24490 | }
|
24491 |
|
24492 | case 2:
|
24493 | {
|
24494 | this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3), this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3), this._context.closePath();
|
24495 | break;
|
24496 | }
|
24497 |
|
24498 | case 3:
|
24499 | {
|
24500 | this.point(this._x2, this._y2), this.point(this._x3, this._y3), this.point(this._x4, this._y4);
|
24501 | break;
|
24502 | }
|
24503 | }
|
24504 | },
|
24505 | point: function point(x, y) {
|
24506 | switch (x = +x, y = +y, this._point) {
|
24507 | case 0:
|
24508 | this._point = 1, this._x2 = x, this._y2 = y;
|
24509 | break;
|
24510 |
|
24511 | case 1:
|
24512 | this._point = 2, this._x3 = x, this._y3 = y;
|
24513 | break;
|
24514 |
|
24515 | case 2:
|
24516 | this._point = 3, this._x4 = x, this._y4 = y, this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6);
|
24517 | break;
|
24518 |
|
24519 | default:
|
24520 | _point(this, x, y);
|
24521 |
|
24522 | }
|
24523 |
|
24524 | this._x0 = this._x1, this._x1 = x, this._y0 = this._y1, this._y1 = y;
|
24525 | }
|
24526 | };
|
24527 | /* harmony default export */ function curve_basisClosed(context) {
|
24528 | return new BasisClosed(context);
|
24529 | }
|
24530 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/basisOpen.js
|
24531 |
|
24532 |
|
24533 | function BasisOpen(context) {
|
24534 | this._context = context;
|
24535 | }
|
24536 |
|
24537 | BasisOpen.prototype = {
|
24538 | areaStart: function areaStart() {
|
24539 | this._line = 0;
|
24540 | },
|
24541 | areaEnd: function areaEnd() {
|
24542 | this._line = NaN;
|
24543 | },
|
24544 | lineStart: function lineStart() {
|
24545 | this._x0 = this._x1 = this._y0 = this._y1 = NaN, this._point = 0;
|
24546 | },
|
24547 | lineEnd: function lineEnd() {
|
24548 | (this._line || this._line !== 0 && this._point === 3) && this._context.closePath(), this._line = 1 - this._line;
|
24549 | },
|
24550 | point: function point(x, y) {
|
24551 | switch (x = +x, y = +y, this._point) {
|
24552 | case 0:
|
24553 | this._point = 1;
|
24554 | break;
|
24555 |
|
24556 | case 1:
|
24557 | this._point = 2;
|
24558 | break;
|
24559 |
|
24560 | case 2:
|
24561 | this._point = 3;
|
24562 | var x0 = (this._x0 + 4 * this._x1 + x) / 6,
|
24563 | y0 = (this._y0 + 4 * this._y1 + y) / 6;
|
24564 | this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0);
|
24565 | break;
|
24566 |
|
24567 | case 3:
|
24568 | this._point = 4;
|
24569 | // proceed
|
24570 |
|
24571 | default:
|
24572 | _point(this, x, y);
|
24573 |
|
24574 | }
|
24575 |
|
24576 | this._x0 = this._x1, this._x1 = x, this._y0 = this._y1, this._y1 = y;
|
24577 | }
|
24578 | };
|
24579 | /* harmony default export */ function basisOpen(context) {
|
24580 | return new BasisOpen(context);
|
24581 | }
|
24582 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/bundle.js
|
24583 |
|
24584 |
|
24585 | function Bundle(context, beta) {
|
24586 | this._basis = new Basis(context), this._beta = beta;
|
24587 | }
|
24588 |
|
24589 | Bundle.prototype = {
|
24590 | lineStart: function lineStart() {
|
24591 | this._x = [], this._y = [], this._basis.lineStart();
|
24592 | },
|
24593 | lineEnd: function lineEnd() {
|
24594 | var x = this._x,
|
24595 | y = this._y,
|
24596 | j = x.length - 1;
|
24597 | if (j > 0) for (var t, x0 = x[0], y0 = y[0], dx = x[j] - x0, dy = y[j] - y0, i = -1; ++i <= j;) t = i / j, this._basis.point(this._beta * x[i] + (1 - this._beta) * (x0 + t * dx), this._beta * y[i] + (1 - this._beta) * (y0 + t * dy));
|
24598 | this._x = this._y = null, this._basis.lineEnd();
|
24599 | },
|
24600 | point: function point(x, y) {
|
24601 | this._x.push(+x), this._y.push(+y);
|
24602 | }
|
24603 | };
|
24604 | /* harmony default export */ var bundle = ((function custom(beta) {
|
24605 | function bundle(context) {
|
24606 | return beta === 1 ? new Basis(context) : new Bundle(context, beta);
|
24607 | }
|
24608 |
|
24609 | return bundle.beta = function (beta) {
|
24610 | return custom(+beta);
|
24611 | }, bundle;
|
24612 | })(.85));
|
24613 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/cardinal.js
|
24614 | function cardinal_point(that, x, y) {
|
24615 | that._context.bezierCurveTo(that._x1 + that._k * (that._x2 - that._x0), that._y1 + that._k * (that._y2 - that._y0), that._x2 + that._k * (that._x1 - x), that._y2 + that._k * (that._y1 - y), that._x2, that._y2);
|
24616 | }
|
24617 |
|
24618 |
|
24619 | function Cardinal(context, tension) {
|
24620 | this._context = context, this._k = (1 - tension) / 6;
|
24621 | }
|
24622 | Cardinal.prototype = {
|
24623 | areaStart: function areaStart() {
|
24624 | this._line = 0;
|
24625 | },
|
24626 | areaEnd: function areaEnd() {
|
24627 | this._line = NaN;
|
24628 | },
|
24629 | lineStart: function lineStart() {
|
24630 | this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN, this._point = 0;
|
24631 | },
|
24632 | lineEnd: function lineEnd() {
|
24633 | switch (this._point) {
|
24634 | case 2:
|
24635 | this._context.lineTo(this._x2, this._y2);
|
24636 |
|
24637 | break;
|
24638 |
|
24639 | case 3:
|
24640 | cardinal_point(this, this._x1, this._y1);
|
24641 |
|
24642 | }
|
24643 |
|
24644 | (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
|
24645 | },
|
24646 | point: function point(x, y) {
|
24647 | switch (x = +x, y = +y, this._point) {
|
24648 | case 0:
|
24649 | this._point = 1, this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y);
|
24650 | break;
|
24651 |
|
24652 | case 1:
|
24653 | this._point = 2, this._x1 = x, this._y1 = y;
|
24654 | break;
|
24655 |
|
24656 | case 2:
|
24657 | this._point = 3;
|
24658 | // proceed
|
24659 |
|
24660 | default:
|
24661 | cardinal_point(this, x, y);
|
24662 |
|
24663 | }
|
24664 |
|
24665 | this._x0 = this._x1, this._x1 = this._x2, this._x2 = x, this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
|
24666 | }
|
24667 | };
|
24668 | /* harmony default export */ var cardinal = ((function custom(tension) {
|
24669 | function cardinal(context) {
|
24670 | return new Cardinal(context, tension);
|
24671 | }
|
24672 |
|
24673 | return cardinal.tension = function (tension) {
|
24674 | return custom(+tension);
|
24675 | }, cardinal;
|
24676 | })(0));
|
24677 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/cardinalClosed.js
|
24678 |
|
24679 |
|
24680 | function CardinalClosed(context, tension) {
|
24681 | this._context = context, this._k = (1 - tension) / 6;
|
24682 | }
|
24683 | CardinalClosed.prototype = {
|
24684 | areaStart: src_noop,
|
24685 | areaEnd: src_noop,
|
24686 | lineStart: function lineStart() {
|
24687 | this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN, this._point = 0;
|
24688 | },
|
24689 | lineEnd: function lineEnd() {
|
24690 | switch (this._point) {
|
24691 | case 1:
|
24692 | {
|
24693 | this._context.moveTo(this._x3, this._y3), this._context.closePath();
|
24694 | break;
|
24695 | }
|
24696 |
|
24697 | case 2:
|
24698 | {
|
24699 | this._context.lineTo(this._x3, this._y3), this._context.closePath();
|
24700 | break;
|
24701 | }
|
24702 |
|
24703 | case 3:
|
24704 | {
|
24705 | this.point(this._x3, this._y3), this.point(this._x4, this._y4), this.point(this._x5, this._y5);
|
24706 | break;
|
24707 | }
|
24708 | }
|
24709 | },
|
24710 | point: function point(x, y) {
|
24711 | switch (x = +x, y = +y, this._point) {
|
24712 | case 0:
|
24713 | this._point = 1, this._x3 = x, this._y3 = y;
|
24714 | break;
|
24715 |
|
24716 | case 1:
|
24717 | this._point = 2, this._context.moveTo(this._x4 = x, this._y4 = y);
|
24718 | break;
|
24719 |
|
24720 | case 2:
|
24721 | this._point = 3, this._x5 = x, this._y5 = y;
|
24722 | break;
|
24723 |
|
24724 | default:
|
24725 | cardinal_point(this, x, y);
|
24726 |
|
24727 | }
|
24728 |
|
24729 | this._x0 = this._x1, this._x1 = this._x2, this._x2 = x, this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
|
24730 | }
|
24731 | };
|
24732 | /* harmony default export */ var cardinalClosed = ((function custom(tension) {
|
24733 | function cardinal(context) {
|
24734 | return new CardinalClosed(context, tension);
|
24735 | }
|
24736 |
|
24737 | return cardinal.tension = function (tension) {
|
24738 | return custom(+tension);
|
24739 | }, cardinal;
|
24740 | })(0));
|
24741 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/cardinalOpen.js
|
24742 |
|
24743 | function CardinalOpen(context, tension) {
|
24744 | this._context = context, this._k = (1 - tension) / 6;
|
24745 | }
|
24746 | CardinalOpen.prototype = {
|
24747 | areaStart: function areaStart() {
|
24748 | this._line = 0;
|
24749 | },
|
24750 | areaEnd: function areaEnd() {
|
24751 | this._line = NaN;
|
24752 | },
|
24753 | lineStart: function lineStart() {
|
24754 | this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN, this._point = 0;
|
24755 | },
|
24756 | lineEnd: function lineEnd() {
|
24757 | (this._line || this._line !== 0 && this._point === 3) && this._context.closePath(), this._line = 1 - this._line;
|
24758 | },
|
24759 | point: function point(x, y) {
|
24760 | switch (x = +x, y = +y, this._point) {
|
24761 | case 0:
|
24762 | this._point = 1;
|
24763 | break;
|
24764 |
|
24765 | case 1:
|
24766 | this._point = 2;
|
24767 | break;
|
24768 |
|
24769 | case 2:
|
24770 | this._point = 3, this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2);
|
24771 | break;
|
24772 |
|
24773 | case 3:
|
24774 | this._point = 4;
|
24775 | // proceed
|
24776 |
|
24777 | default:
|
24778 | cardinal_point(this, x, y);
|
24779 |
|
24780 | }
|
24781 |
|
24782 | this._x0 = this._x1, this._x1 = this._x2, this._x2 = x, this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
|
24783 | }
|
24784 | };
|
24785 | /* harmony default export */ var cardinalOpen = ((function custom(tension) {
|
24786 | function cardinal(context) {
|
24787 | return new CardinalOpen(context, tension);
|
24788 | }
|
24789 |
|
24790 | return cardinal.tension = function (tension) {
|
24791 | return custom(+tension);
|
24792 | }, cardinal;
|
24793 | })(0));
|
24794 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/math.js
|
24795 | var math_abs = Math.abs;
|
24796 | var atan2 = Math.atan2;
|
24797 | var cos = Math.cos;
|
24798 | var math_max = Math.max;
|
24799 | var math_min = Math.min;
|
24800 | var sin = Math.sin;
|
24801 | var sqrt = Math.sqrt;
|
24802 | var epsilon = 1e-12;
|
24803 | var pi = Math.PI;
|
24804 | var halfPi = pi / 2;
|
24805 | var tau = 2 * pi;
|
24806 | function acos(x) {
|
24807 | return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);
|
24808 | }
|
24809 | function asin(x) {
|
24810 | return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);
|
24811 | }
|
24812 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/catmullRom.js
|
24813 |
|
24814 |
|
24815 |
|
24816 | function catmullRom_point(that, x, y) {
|
24817 | var x1 = that._x1,
|
24818 | y1 = that._y1,
|
24819 | x2 = that._x2,
|
24820 | y2 = that._y2;
|
24821 |
|
24822 | if (that._l01_a > epsilon) {
|
24823 | var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,
|
24824 | n = 3 * that._l01_a * (that._l01_a + that._l12_a);
|
24825 | x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n, y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;
|
24826 | }
|
24827 |
|
24828 | if (that._l23_a > epsilon) {
|
24829 | var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,
|
24830 | m = 3 * that._l23_a * (that._l23_a + that._l12_a);
|
24831 | x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m, y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;
|
24832 | }
|
24833 |
|
24834 | that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);
|
24835 | }
|
24836 |
|
24837 |
|
24838 |
|
24839 | function CatmullRom(context, alpha) {
|
24840 | this._context = context, this._alpha = alpha;
|
24841 | }
|
24842 |
|
24843 | CatmullRom.prototype = {
|
24844 | areaStart: function areaStart() {
|
24845 | this._line = 0;
|
24846 | },
|
24847 | areaEnd: function areaEnd() {
|
24848 | this._line = NaN;
|
24849 | },
|
24850 | lineStart: function lineStart() {
|
24851 | this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN, this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
|
24852 | },
|
24853 | lineEnd: function lineEnd() {
|
24854 | switch (this._point) {
|
24855 | case 2:
|
24856 | this._context.lineTo(this._x2, this._y2);
|
24857 |
|
24858 | break;
|
24859 |
|
24860 | case 3:
|
24861 | this.point(this._x2, this._y2);
|
24862 | }
|
24863 |
|
24864 | (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
|
24865 | },
|
24866 | point: function point(x, y) {
|
24867 | if (x = +x, y = +y, this._point) {
|
24868 | var x23 = this._x2 - x,
|
24869 | y23 = this._y2 - y;
|
24870 | this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
|
24871 | }
|
24872 |
|
24873 | switch (this._point) {
|
24874 | case 0:
|
24875 | this._point = 1, this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y);
|
24876 | break;
|
24877 |
|
24878 | case 1:
|
24879 | this._point = 2;
|
24880 | break;
|
24881 |
|
24882 | case 2:
|
24883 | this._point = 3;
|
24884 | // proceed
|
24885 |
|
24886 | default:
|
24887 | catmullRom_point(this, x, y);
|
24888 |
|
24889 | }
|
24890 |
|
24891 | this._l01_a = this._l12_a, this._l12_a = this._l23_a, this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a, this._x0 = this._x1, this._x1 = this._x2, this._x2 = x, this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
|
24892 | }
|
24893 | };
|
24894 | /* harmony default export */ var catmullRom = ((function custom(alpha) {
|
24895 | function catmullRom(context) {
|
24896 | return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);
|
24897 | }
|
24898 |
|
24899 | return catmullRom.alpha = function (alpha) {
|
24900 | return custom(+alpha);
|
24901 | }, catmullRom;
|
24902 | })(.5));
|
24903 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/catmullRomClosed.js
|
24904 |
|
24905 |
|
24906 |
|
24907 |
|
24908 | function CatmullRomClosed(context, alpha) {
|
24909 | this._context = context, this._alpha = alpha;
|
24910 | }
|
24911 |
|
24912 | CatmullRomClosed.prototype = {
|
24913 | areaStart: src_noop,
|
24914 | areaEnd: src_noop,
|
24915 | lineStart: function lineStart() {
|
24916 | this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN, this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
|
24917 | },
|
24918 | lineEnd: function lineEnd() {
|
24919 | switch (this._point) {
|
24920 | case 1:
|
24921 | {
|
24922 | this._context.moveTo(this._x3, this._y3), this._context.closePath();
|
24923 | break;
|
24924 | }
|
24925 |
|
24926 | case 2:
|
24927 | {
|
24928 | this._context.lineTo(this._x3, this._y3), this._context.closePath();
|
24929 | break;
|
24930 | }
|
24931 |
|
24932 | case 3:
|
24933 | {
|
24934 | this.point(this._x3, this._y3), this.point(this._x4, this._y4), this.point(this._x5, this._y5);
|
24935 | break;
|
24936 | }
|
24937 | }
|
24938 | },
|
24939 | point: function point(x, y) {
|
24940 | if (x = +x, y = +y, this._point) {
|
24941 | var x23 = this._x2 - x,
|
24942 | y23 = this._y2 - y;
|
24943 | this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
|
24944 | }
|
24945 |
|
24946 | switch (this._point) {
|
24947 | case 0:
|
24948 | this._point = 1, this._x3 = x, this._y3 = y;
|
24949 | break;
|
24950 |
|
24951 | case 1:
|
24952 | this._point = 2, this._context.moveTo(this._x4 = x, this._y4 = y);
|
24953 | break;
|
24954 |
|
24955 | case 2:
|
24956 | this._point = 3, this._x5 = x, this._y5 = y;
|
24957 | break;
|
24958 |
|
24959 | default:
|
24960 | catmullRom_point(this, x, y);
|
24961 |
|
24962 | }
|
24963 |
|
24964 | this._l01_a = this._l12_a, this._l12_a = this._l23_a, this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a, this._x0 = this._x1, this._x1 = this._x2, this._x2 = x, this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
|
24965 | }
|
24966 | };
|
24967 | /* harmony default export */ var catmullRomClosed = ((function custom(alpha) {
|
24968 | function catmullRom(context) {
|
24969 | return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);
|
24970 | }
|
24971 |
|
24972 | return catmullRom.alpha = function (alpha) {
|
24973 | return custom(+alpha);
|
24974 | }, catmullRom;
|
24975 | })(.5));
|
24976 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/catmullRomOpen.js
|
24977 |
|
24978 |
|
24979 |
|
24980 | function CatmullRomOpen(context, alpha) {
|
24981 | this._context = context, this._alpha = alpha;
|
24982 | }
|
24983 |
|
24984 | CatmullRomOpen.prototype = {
|
24985 | areaStart: function areaStart() {
|
24986 | this._line = 0;
|
24987 | },
|
24988 | areaEnd: function areaEnd() {
|
24989 | this._line = NaN;
|
24990 | },
|
24991 | lineStart: function lineStart() {
|
24992 | this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN, this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
|
24993 | },
|
24994 | lineEnd: function lineEnd() {
|
24995 | (this._line || this._line !== 0 && this._point === 3) && this._context.closePath(), this._line = 1 - this._line;
|
24996 | },
|
24997 | point: function point(x, y) {
|
24998 | if (x = +x, y = +y, this._point) {
|
24999 | var x23 = this._x2 - x,
|
25000 | y23 = this._y2 - y;
|
25001 | this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
|
25002 | }
|
25003 |
|
25004 | switch (this._point) {
|
25005 | case 0:
|
25006 | this._point = 1;
|
25007 | break;
|
25008 |
|
25009 | case 1:
|
25010 | this._point = 2;
|
25011 | break;
|
25012 |
|
25013 | case 2:
|
25014 | this._point = 3, this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2);
|
25015 | break;
|
25016 |
|
25017 | case 3:
|
25018 | this._point = 4;
|
25019 | // proceed
|
25020 |
|
25021 | default:
|
25022 | catmullRom_point(this, x, y);
|
25023 |
|
25024 | }
|
25025 |
|
25026 | this._l01_a = this._l12_a, this._l12_a = this._l23_a, this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a, this._x0 = this._x1, this._x1 = this._x2, this._x2 = x, this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
|
25027 | }
|
25028 | };
|
25029 | /* harmony default export */ var catmullRomOpen = ((function custom(alpha) {
|
25030 | function catmullRom(context) {
|
25031 | return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);
|
25032 | }
|
25033 |
|
25034 | return catmullRom.alpha = function (alpha) {
|
25035 | return custom(+alpha);
|
25036 | }, catmullRom;
|
25037 | })(.5));
|
25038 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/monotone.js
|
25039 | function sign(x) {
|
25040 | return x < 0 ? -1 : 1;
|
25041 | } // Calculate the slopes of the tangents (Hermite-type interpolation) based on
|
25042 | // the following paper: Steffen, M. 1990. A Simple Method for Monotonic
|
25043 | // Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.
|
25044 | // NOV(II), P. 443, 1990.
|
25045 |
|
25046 |
|
25047 | function slope3(that, x2, y2) {
|
25048 | var h0 = that._x1 - that._x0,
|
25049 | h1 = x2 - that._x1,
|
25050 | s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),
|
25051 | s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0);
|
25052 | return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), .5 * Math.abs((s0 * h1 + s1 * h0) / (h0 + h1))) || 0;
|
25053 | } // Calculate a one-sided slope.
|
25054 |
|
25055 |
|
25056 | function slope2(that, t) {
|
25057 | var h = that._x1 - that._x0;
|
25058 | return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;
|
25059 | } // According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations
|
25060 | // "you can express cubic Hermite interpolation in terms of cubic Bézier curves
|
25061 | // with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1".
|
25062 |
|
25063 |
|
25064 | function monotone_point(that, t0, t1) {
|
25065 | var x0 = that._x0,
|
25066 | y0 = that._y0,
|
25067 | x1 = that._x1,
|
25068 | y1 = that._y1,
|
25069 | dx = (x1 - x0) / 3;
|
25070 |
|
25071 | that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);
|
25072 | }
|
25073 |
|
25074 | function MonotoneX(context) {
|
25075 | this._context = context;
|
25076 | }
|
25077 |
|
25078 | MonotoneX.prototype = {
|
25079 | areaStart: function areaStart() {
|
25080 | this._line = 0;
|
25081 | },
|
25082 | areaEnd: function areaEnd() {
|
25083 | this._line = NaN;
|
25084 | },
|
25085 | lineStart: function lineStart() {
|
25086 | this._x0 = this._x1 = this._y0 = this._y1 = this._t0 = NaN, this._point = 0;
|
25087 | },
|
25088 | lineEnd: function lineEnd() {
|
25089 | switch (this._point) {
|
25090 | case 2:
|
25091 | this._context.lineTo(this._x1, this._y1);
|
25092 |
|
25093 | break;
|
25094 |
|
25095 | case 3:
|
25096 | monotone_point(this, this._t0, slope2(this, this._t0));
|
25097 |
|
25098 | }
|
25099 |
|
25100 | (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
|
25101 | },
|
25102 | point: function point(x, y) {
|
25103 | var t1 = NaN;
|
25104 |
|
25105 | if (x = +x, y = +y, x !== this._x1 || y !== this._y1) {
|
25106 | // Ignore coincident points.
|
25107 | switch (this._point) {
|
25108 | case 0:
|
25109 | this._point = 1, this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y);
|
25110 | break;
|
25111 |
|
25112 | case 1:
|
25113 | this._point = 2;
|
25114 | break;
|
25115 |
|
25116 | case 2:
|
25117 | this._point = 3, monotone_point(this, slope2(this, t1 = slope3(this, x, y)), t1);
|
25118 | break;
|
25119 |
|
25120 | default:
|
25121 | monotone_point(this, this._t0, t1 = slope3(this, x, y));
|
25122 |
|
25123 | }
|
25124 |
|
25125 | this._x0 = this._x1, this._x1 = x, this._y0 = this._y1, this._y1 = y, this._t0 = t1;
|
25126 | }
|
25127 | }
|
25128 | };
|
25129 |
|
25130 | function MonotoneY(context) {
|
25131 | this._context = new ReflectContext(context);
|
25132 | }
|
25133 |
|
25134 | (MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function (x, y) {
|
25135 | MonotoneX.prototype.point.call(this, y, x);
|
25136 | };
|
25137 |
|
25138 | function ReflectContext(context) {
|
25139 | this._context = context;
|
25140 | }
|
25141 |
|
25142 | ReflectContext.prototype = {
|
25143 | moveTo: function moveTo(x, y) {
|
25144 | this._context.moveTo(y, x);
|
25145 | },
|
25146 | closePath: function closePath() {
|
25147 | this._context.closePath();
|
25148 | },
|
25149 | lineTo: function lineTo(x, y) {
|
25150 | this._context.lineTo(y, x);
|
25151 | },
|
25152 | bezierCurveTo: function bezierCurveTo(x1, y1, x2, y2, x, y) {
|
25153 | this._context.bezierCurveTo(y1, x1, y2, x2, y, x);
|
25154 | }
|
25155 | };
|
25156 | function monotoneX(context) {
|
25157 | return new MonotoneX(context);
|
25158 | }
|
25159 | function monotoneY(context) {
|
25160 | return new MonotoneY(context);
|
25161 | }
|
25162 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/natural.js
|
25163 | function Natural(context) {
|
25164 | this._context = context;
|
25165 | }
|
25166 |
|
25167 | Natural.prototype = {
|
25168 | areaStart: function areaStart() {
|
25169 | this._line = 0;
|
25170 | },
|
25171 | areaEnd: function areaEnd() {
|
25172 | this._line = NaN;
|
25173 | },
|
25174 | lineStart: function lineStart() {
|
25175 | this._x = [], this._y = [];
|
25176 | },
|
25177 | lineEnd: function lineEnd() {
|
25178 | var x = this._x,
|
25179 | y = this._y,
|
25180 | n = x.length;
|
25181 | if (n) if (this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]), n === 2) this._context.lineTo(x[1], y[1]);else for (var px = controlPoints(x), py = controlPoints(y), i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);
|
25182 | (this._line || this._line !== 0 && n === 1) && this._context.closePath(), this._line = 1 - this._line, this._x = this._y = null;
|
25183 | },
|
25184 | point: function point(x, y) {
|
25185 | this._x.push(+x), this._y.push(+y);
|
25186 | }
|
25187 | };
|
25188 |
|
25189 | // See https://www.particleincell.com/2012/bezier-splines/ for derivation.
|
25190 | function controlPoints(x) {
|
25191 | var i,
|
25192 | m,
|
25193 | n = x.length - 1,
|
25194 | a = Array(n),
|
25195 | b = Array(n),
|
25196 | r = Array(n);
|
25197 |
|
25198 | for (a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1], i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];
|
25199 |
|
25200 | for (a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n], i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];
|
25201 |
|
25202 | for (a[n - 1] = r[n - 1] / b[n - 1], i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];
|
25203 |
|
25204 | for (b[n - 1] = (x[n] + a[n - 1]) / 2, i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];
|
25205 |
|
25206 | return [a, b];
|
25207 | }
|
25208 |
|
25209 | /* harmony default export */ function natural(context) {
|
25210 | return new Natural(context);
|
25211 | }
|
25212 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/linearClosed.js
|
25213 |
|
25214 |
|
25215 | function LinearClosed(context) {
|
25216 | this._context = context;
|
25217 | }
|
25218 |
|
25219 | LinearClosed.prototype = {
|
25220 | areaStart: src_noop,
|
25221 | areaEnd: src_noop,
|
25222 | lineStart: function lineStart() {
|
25223 | this._point = 0;
|
25224 | },
|
25225 | lineEnd: function lineEnd() {
|
25226 | this._point && this._context.closePath();
|
25227 | },
|
25228 | point: function point(x, y) {
|
25229 | x = +x, y = +y, this._point ? this._context.lineTo(x, y) : (this._point = 1, this._context.moveTo(x, y));
|
25230 | }
|
25231 | };
|
25232 | /* harmony default export */ function linearClosed(context) {
|
25233 | return new LinearClosed(context);
|
25234 | }
|
25235 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/linear.js
|
25236 | function Linear(context) {
|
25237 | this._context = context;
|
25238 | }
|
25239 |
|
25240 | Linear.prototype = {
|
25241 | areaStart: function areaStart() {
|
25242 | this._line = 0;
|
25243 | },
|
25244 | areaEnd: function areaEnd() {
|
25245 | this._line = NaN;
|
25246 | },
|
25247 | lineStart: function lineStart() {
|
25248 | this._point = 0;
|
25249 | },
|
25250 | lineEnd: function lineEnd() {
|
25251 | (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
|
25252 | },
|
25253 | point: function point(x, y) {
|
25254 | switch (x = +x, y = +y, this._point) {
|
25255 | case 0:
|
25256 | this._point = 1, this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y);
|
25257 | break;
|
25258 |
|
25259 | case 1:
|
25260 | this._point = 2;
|
25261 | // proceed
|
25262 |
|
25263 | default:
|
25264 | this._context.lineTo(x, y);
|
25265 |
|
25266 | }
|
25267 | }
|
25268 | };
|
25269 | /* harmony default export */ function curve_linear(context) {
|
25270 | return new Linear(context);
|
25271 | }
|
25272 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/step.js
|
25273 | function Step(context, t) {
|
25274 | this._context = context, this._t = t;
|
25275 | }
|
25276 |
|
25277 | Step.prototype = {
|
25278 | areaStart: function areaStart() {
|
25279 | this._line = 0;
|
25280 | },
|
25281 | areaEnd: function areaEnd() {
|
25282 | this._line = NaN;
|
25283 | },
|
25284 | lineStart: function lineStart() {
|
25285 | this._x = this._y = NaN, this._point = 0;
|
25286 | },
|
25287 | lineEnd: function lineEnd() {
|
25288 | 0 < this._t && this._t < 1 && this._point === 2 && this._context.lineTo(this._x, this._y), (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line >= 0 && (this._t = 1 - this._t, this._line = 1 - this._line);
|
25289 | },
|
25290 | point: function point(x, y) {
|
25291 | switch (x = +x, y = +y, this._point) {
|
25292 | case 0:
|
25293 | this._point = 1, this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y);
|
25294 | break;
|
25295 |
|
25296 | case 1:
|
25297 | this._point = 2;
|
25298 | // proceed
|
25299 |
|
25300 | default:
|
25301 | {
|
25302 | if (this._t <= 0) this._context.lineTo(this._x, y), this._context.lineTo(x, y);else {
|
25303 | var x1 = this._x * (1 - this._t) + x * this._t;
|
25304 | this._context.lineTo(x1, this._y), this._context.lineTo(x1, y);
|
25305 | }
|
25306 | break;
|
25307 | }
|
25308 | }
|
25309 |
|
25310 | this._x = x, this._y = y;
|
25311 | }
|
25312 | };
|
25313 | /* harmony default export */ function step(context) {
|
25314 | return new Step(context, .5);
|
25315 | }
|
25316 | function stepBefore(context) {
|
25317 | return new Step(context, 0);
|
25318 | }
|
25319 | function stepAfter(context) {
|
25320 | return new Step(context, 1);
|
25321 | }
|
25322 | ;// CONCATENATED MODULE: ./src/ChartInternal/shape/shape.ts
|
25323 | /**
|
25324 | * Copyright (c) 2017 ~ present NAVER Corp.
|
25325 | * billboard.js project is licensed under the MIT license
|
25326 | */
|
25327 |
|
25328 |
|
25329 |
|
25330 |
|
25331 | /* harmony default export */ var shape = ({
|
25332 | /**
|
25333 | * Get the shape draw function
|
25334 | * @returns {object}
|
25335 | * @private
|
25336 | */
|
25337 | getDrawShape: function getDrawShape() {
|
25338 | var $$ = this,
|
25339 | isRotated = $$.config.axis_rotated,
|
25340 | hasRadar = $$.state.hasRadar,
|
25341 | shape = {
|
25342 | type: {},
|
25343 | indices: {},
|
25344 | pos: {}
|
25345 | };
|
25346 |
|
25347 | if (["bar", "candlestick", "line", "area"].forEach(function (v) {
|
25348 | var name = capitalize(/^(bubble|scatter)$/.test(v) ? "line" : v);
|
25349 |
|
25350 | if ($$.hasType(v) || $$.hasTypeOf(name) || v === "line" && ($$.hasType("bubble") || $$.hasType("scatter"))) {
|
25351 | var indices = $$.getShapeIndices($$["is" + name + "Type"]),
|
25352 | drawFn = $$["generateDraw" + name];
|
25353 | shape.indices[v] = indices, shape.type[v] = drawFn ? drawFn.bind($$)(indices, !1) : undefined;
|
25354 | }
|
25355 | }), !$$.hasArcType() || hasRadar) {
|
25356 | // generate circle x/y functions depending on updated params
|
25357 | var cx = hasRadar ? $$.radarCircleX : isRotated ? $$.circleY : $$.circleX,
|
25358 | cy = hasRadar ? $$.radarCircleY : isRotated ? $$.circleX : $$.circleY;
|
25359 | shape.pos = {
|
25360 | xForText: $$.generateXYForText(shape.indices, !0),
|
25361 | yForText: $$.generateXYForText(shape.indices, !1),
|
25362 | cx: (cx || function () {}).bind($$),
|
25363 | cy: (cy || function () {}).bind($$)
|
25364 | };
|
25365 | }
|
25366 |
|
25367 | return shape;
|
25368 | },
|
25369 | getShapeIndices: function getShapeIndices(typeFilter) {
|
25370 | var $$ = this,
|
25371 | config = $$.config,
|
25372 | xs = config.data_xs,
|
25373 | hasXs = notEmpty(xs),
|
25374 | indices = {},
|
25375 | i = hasXs ? {} : 0;
|
25376 | return hasXs && getUnique(Object.keys(xs).map(function (v) {
|
25377 | return xs[v];
|
25378 | })).forEach(function (v) {
|
25379 | i[v] = 0, indices[v] = {};
|
25380 | }), $$.filterTargetsToShow($$.data.targets.filter(typeFilter, $$)).forEach(function (d) {
|
25381 | for (var groups, xKey = (d.id in xs) ? xs[d.id] : "", ind = xKey ? indices[xKey] : indices, j = 0; groups = config.data_groups[j]; j++) if (!(groups.indexOf(d.id) < 0)) for (var _row4, _k4 = 0; _row4 = groups[_k4]; _k4++) if (_row4 in ind) {
|
25382 | ind[d.id] = ind[_row4];
|
25383 | break;
|
25384 | }
|
25385 |
|
25386 | isUndefined(ind[d.id]) && (ind[d.id] = xKey ? i[xKey]++ : i++, ind.__max__ = (xKey ? i[xKey] : i) - 1);
|
25387 | }), indices;
|
25388 | },
|
25389 |
|
25390 | /**
|
25391 | * Get indices value based on data ID value
|
25392 | * @param {object} indices Indices object
|
25393 | * @param {string} id Data id value
|
25394 | * @returns {object} Indices object
|
25395 | * @private
|
25396 | */
|
25397 | getIndices: function getIndices(indices, id) {
|
25398 | var xs = this.config.data_xs;
|
25399 | return notEmpty(xs) ? indices[xs[id]] : indices;
|
25400 | },
|
25401 |
|
25402 | /**
|
25403 | * Get indices max number
|
25404 | * @param {object} indices Indices object
|
25405 | * @returns {number} Max number
|
25406 | * @private
|
25407 | */
|
25408 | getIndicesMax: function getIndicesMax(indices) {
|
25409 | return notEmpty(this.config.data_xs) ? // if is multiple xs, return total sum of xs' __max__ value
|
25410 | Object.keys(indices).map(function (v) {
|
25411 | return indices[v].__max__ || 0;
|
25412 | }).reduce(function (acc, curr) {
|
25413 | return acc + curr;
|
25414 | }) : indices.__max__;
|
25415 | },
|
25416 | getShapeX: function getShapeX(offset, indices, isSub) {
|
25417 | var $$ = this,
|
25418 | config = $$.config,
|
25419 | scale = $$.scale,
|
25420 | currScale = isSub ? scale.subX : scale.zoom || scale.x,
|
25421 | barPadding = config.bar_padding,
|
25422 | sum = function (p, c) {
|
25423 | return p + c;
|
25424 | },
|
25425 | halfWidth = isObjectType(offset) && (offset._$total.length ? offset._$total.reduce(sum) / 2 : 0);
|
25426 |
|
25427 | return function (d) {
|
25428 | var ind = $$.getIndices(indices, d.id),
|
25429 | index = d.id in ind ? ind[d.id] : 0,
|
25430 | targetsNum = (ind.__max__ || 0) + 1,
|
25431 | x = 0;
|
25432 |
|
25433 | if (notEmpty(d.x)) {
|
25434 | var xPos = currScale(d.x, !0);
|
25435 | x = halfWidth ? xPos - (offset[d.id] || offset._$width) + offset._$total.slice(0, index + 1).reduce(sum) - halfWidth : xPos - (isNumber(offset) ? offset : offset._$width) * (targetsNum / 2 - index);
|
25436 | } // adjust x position for bar.padding optionq
|
25437 |
|
25438 |
|
25439 | return offset && x && targetsNum > 1 && barPadding && (index && (x += barPadding * index), targetsNum > 2 ? x -= (targetsNum - 1) * barPadding / 2 : targetsNum === 2 && (x -= barPadding / 2)), x;
|
25440 | };
|
25441 | },
|
25442 | getShapeY: function getShapeY(isSub) {
|
25443 | var $$ = this,
|
25444 | isStackNormalized = $$.isStackNormalized();
|
25445 | return function (d) {
|
25446 | var value = d.value;
|
25447 | return isNumber(d) ? value = d : isStackNormalized ? value = $$.getRatio("index", d, !0) : $$.isBubbleZType(d) && (value = $$.getBubbleZData(d.value, "y")), $$.getYScaleById(d.id, isSub)(value);
|
25448 | };
|
25449 | },
|
25450 |
|
25451 | /**
|
25452 | * Get shape based y Axis min value
|
25453 | * @param {string} id Data id
|
25454 | * @returns {number}
|
25455 | * @private
|
25456 | */
|
25457 | getShapeYMin: function getShapeYMin(id) {
|
25458 | var $$ = this,
|
25459 | scale = $$.scale[$$.axis.getId(id)],
|
25460 | _scale$domain = scale.domain(),
|
25461 | yMin = _scale$domain[0];
|
25462 |
|
25463 | return !$$.isGrouped(id) && yMin > 0 ? yMin : 0;
|
25464 | },
|
25465 |
|
25466 | /**
|
25467 | * Get Shape's offset data
|
25468 | * @param {Function} typeFilter Type filter function
|
25469 | * @returns {object}
|
25470 | * @private
|
25471 | */
|
25472 | getShapeOffsetData: function getShapeOffsetData(typeFilter) {
|
25473 | var $$ = this,
|
25474 | targets = $$.orderTargets($$.filterTargetsToShow($$.data.targets.filter(typeFilter, $$))),
|
25475 | isStackNormalized = $$.isStackNormalized(),
|
25476 | shapeOffsetTargets = targets.map(function (target) {
|
25477 | var rowValues = target.values,
|
25478 | values = {};
|
25479 | $$.isStepType(target) && (rowValues = $$.convertValuesToStep(rowValues));
|
25480 | var rowValueMapByXValue = rowValues.reduce(function (out, d) {
|
25481 | var key = +d.x;
|
25482 | return out[key] = d, values[key] = isStackNormalized ? $$.getRatio("index", d, !0) : d.value, out;
|
25483 | }, {});
|
25484 | return {
|
25485 | id: target.id,
|
25486 | rowValues: rowValues,
|
25487 | rowValueMapByXValue: rowValueMapByXValue,
|
25488 | values: values
|
25489 | };
|
25490 | }),
|
25491 | indexMapByTargetId = targets.reduce(function (out, _ref, index) {
|
25492 | var id = _ref.id;
|
25493 | return out[id] = index, out;
|
25494 | }, {});
|
25495 | return {
|
25496 | indexMapByTargetId: indexMapByTargetId,
|
25497 | shapeOffsetTargets: shapeOffsetTargets
|
25498 | };
|
25499 | },
|
25500 | getShapeOffset: function getShapeOffset(typeFilter, indices, isSub) {
|
25501 | var $$ = this,
|
25502 | _$$$getShapeOffsetDat = $$.getShapeOffsetData(typeFilter),
|
25503 | shapeOffsetTargets = _$$$getShapeOffsetDat.shapeOffsetTargets,
|
25504 | indexMapByTargetId = _$$$getShapeOffsetDat.indexMapByTargetId;
|
25505 |
|
25506 | return function (d, idx) {
|
25507 | var ind = $$.getIndices(indices, d.id),
|
25508 | scale = $$.getYScaleById(d.id, isSub),
|
25509 | y0 = scale($$.getShapeYMin(d.id)),
|
25510 | dataXAsNumber = +d.x,
|
25511 | offset = y0;
|
25512 | return shapeOffsetTargets.filter(function (t) {
|
25513 | return t.id !== d.id;
|
25514 | }).forEach(function (t) {
|
25515 | if (ind[t.id] === ind[d.id] && indexMapByTargetId[t.id] < indexMapByTargetId[d.id]) {
|
25516 | var row = t.rowValues[idx]; // check if the x values line up
|
25517 |
|
25518 | row && +row.x === dataXAsNumber || (row = t.rowValueMapByXValue[dataXAsNumber]), row && row.value * d.value >= 0 && (offset += scale(t.values[dataXAsNumber]) - y0);
|
25519 | }
|
25520 | }), offset;
|
25521 | };
|
25522 | },
|
25523 | getBarW: function getBarW(type, axis, targetsNum) {
|
25524 | var $$ = this,
|
25525 | config = $$.config,
|
25526 | org = $$.org,
|
25527 | scale = $$.scale,
|
25528 | maxDataCount = $$.getMaxDataCount(),
|
25529 | isGrouped = type === "bar" && config.data_groups.length,
|
25530 | configName = type + "_width",
|
25531 | tickInterval = scale.zoom && !$$.axis.isCategorized() ? org.xDomain.map(function (v) {
|
25532 | return scale.zoom(v);
|
25533 | }).reduce(function (a, c) {
|
25534 | return Math.abs(a) + c;
|
25535 | }) / maxDataCount : axis.tickInterval(maxDataCount),
|
25536 | getWidth = function (id) {
|
25537 | var width = id ? config[configName][id] : config[configName],
|
25538 | ratio = id ? width.ratio : config[configName + "_ratio"],
|
25539 | max = id ? width.max : config[configName + "_max"],
|
25540 | w = isNumber(width) ? width : targetsNum ? tickInterval * ratio / targetsNum : 0;
|
25541 | return max && w > max ? max : w;
|
25542 | },
|
25543 | result = getWidth();
|
25544 |
|
25545 | return !isGrouped && isObjectType(config[configName]) && (result = {
|
25546 | _$width: result,
|
25547 | _$total: []
|
25548 | }, $$.filterTargetsToShow($$.data.targets).forEach(function (v) {
|
25549 | config[configName][v.id] && (result[v.id] = getWidth(v.id), result._$total.push(result[v.id] || result._$width));
|
25550 | })), result;
|
25551 | },
|
25552 | isWithinShape: function isWithinShape(that, d) {
|
25553 | var isWithin,
|
25554 | $$ = this,
|
25555 | shape = src_select(that);
|
25556 | return $$.isTargetToShow(d.id) ? "hasValidPointType" in $$ && $$.hasValidPointType(that.nodeName) ? isWithin = $$.isStepType(d) ? $$.isWithinStep(that, $$.getYScaleById(d.id)(d.value)) : $$.isWithinCircle(that, $$.isBubbleType(d) ? $$.pointSelectR(d) * 1.5 : 0) : that.nodeName === "path" && (isWithin = !shape.classed(config_classes.bar) || $$.isWithinBar(that)) : isWithin = !1, isWithin;
|
25557 | },
|
25558 | getInterpolate: function getInterpolate(d) {
|
25559 | var $$ = this,
|
25560 | interpolation = $$.getInterpolateType(d);
|
25561 | return {
|
25562 | "basis": curve_basis,
|
25563 | "basis-closed": curve_basisClosed,
|
25564 | "basis-open": basisOpen,
|
25565 | "bundle": bundle,
|
25566 | "cardinal": cardinal,
|
25567 | "cardinal-closed": cardinalClosed,
|
25568 | "cardinal-open": cardinalOpen,
|
25569 | "catmull-rom": catmullRom,
|
25570 | "catmull-rom-closed": catmullRomClosed,
|
25571 | "catmull-rom-open": catmullRomOpen,
|
25572 | "monotone-x": monotoneX,
|
25573 | "monotone-y": monotoneY,
|
25574 | "natural": natural,
|
25575 | "linear-closed": linearClosed,
|
25576 | "linear": curve_linear,
|
25577 | "step": step,
|
25578 | "step-after": stepAfter,
|
25579 | "step-before": stepBefore
|
25580 | }[interpolation];
|
25581 | },
|
25582 | getInterpolateType: function getInterpolateType(d) {
|
25583 | var $$ = this,
|
25584 | config = $$.config,
|
25585 | type = config.spline_interpolation_type,
|
25586 | interpolation = $$.isInterpolationType(type) ? type : "cardinal";
|
25587 | return $$.isSplineType(d) ? interpolation : $$.isStepType(d) ? config.line_step_type : "linear";
|
25588 | }
|
25589 | });
|
25590 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/size.ts
|
25591 | /**
|
25592 | * Copyright (c) 2017 ~ present NAVER Corp.
|
25593 | * billboard.js project is licensed under the MIT license
|
25594 | */
|
25595 |
|
25596 |
|
25597 |
|
25598 | /* harmony default export */ var internals_size = ({
|
25599 | /**
|
25600 | * Update container size
|
25601 | * @private
|
25602 | */
|
25603 | setContainerSize: function setContainerSize() {
|
25604 | var $$ = this,
|
25605 | state = $$.state;
|
25606 | state.current.width = $$.getCurrentWidth(), state.current.height = $$.getCurrentHeight();
|
25607 | },
|
25608 | getCurrentWidth: function getCurrentWidth() {
|
25609 | var $$ = this;
|
25610 | return $$.config.size_width || $$.getParentWidth();
|
25611 | },
|
25612 | getCurrentHeight: function getCurrentHeight() {
|
25613 | var $$ = this,
|
25614 | config = $$.config,
|
25615 | h = config.size_height || $$.getParentHeight();
|
25616 | return h > 0 ? h : 320 / ($$.hasType("gauge") && !config.gauge_fullCircle ? 2 : 1);
|
25617 | },
|
25618 | getCurrentPaddingTop: function getCurrentPaddingTop() {
|
25619 | var $$ = this,
|
25620 | config = $$.config,
|
25621 | hasAxis = $$.state.hasAxis,
|
25622 | $el = $$.$el,
|
25623 | axesLen = hasAxis ? config.axis_y2_axes.length : 0,
|
25624 | padding = isValue(config.padding_top) ? config.padding_top : 0;
|
25625 | return $el.title && $el.title.node() && (padding += $$.getTitlePadding()), axesLen && config.axis_rotated && (padding += $$.getHorizontalAxisHeight("y2") * axesLen), padding;
|
25626 | },
|
25627 | getCurrentPaddingBottom: function getCurrentPaddingBottom() {
|
25628 | var $$ = this,
|
25629 | config = $$.config,
|
25630 | hasAxis = $$.state.hasAxis,
|
25631 | axisId = config.axis_rotated ? "y" : "x",
|
25632 | axesLen = hasAxis ? config["axis_" + axisId + "_axes"].length : 0,
|
25633 | padding = isValue(config.padding_bottom) ? config.padding_bottom : 0;
|
25634 | return padding + (axesLen ? $$.getHorizontalAxisHeight(axisId) * axesLen : 0);
|
25635 | },
|
25636 | getCurrentPaddingLeft: function getCurrentPaddingLeft(withoutRecompute) {
|
25637 | var padding,
|
25638 | $$ = this,
|
25639 | config = $$.config,
|
25640 | hasAxis = $$.state.hasAxis,
|
25641 | isRotated = config.axis_rotated,
|
25642 | axisId = isRotated ? "x" : "y",
|
25643 | axesLen = hasAxis ? config["axis_" + axisId + "_axes"].length : 0,
|
25644 | axisWidth = hasAxis ? $$.getAxisWidthByAxisId(axisId, withoutRecompute) : 0;
|
25645 | return padding = isValue(config.padding_left) ? config.padding_left : hasAxis && isRotated ? config.axis_x_show ? Math.max(ceil10(axisWidth), 40) : 1 : hasAxis && (!config.axis_y_show || config.axis_y_inner) ? $$.axis.getAxisLabelPosition("y").isOuter ? 30 : 1 : ceil10(axisWidth), padding + axisWidth * axesLen;
|
25646 | },
|
25647 | getCurrentPaddingRight: function getCurrentPaddingRight(withXAxisTickTextOverflow) {
|
25648 | withXAxisTickTextOverflow === void 0 && (withXAxisTickTextOverflow = !1);
|
25649 | var padding,
|
25650 | $$ = this,
|
25651 | config = $$.config,
|
25652 | hasAxis = $$.state.hasAxis,
|
25653 | defaultPadding = 10,
|
25654 | legendWidthOnRight = $$.state.isLegendRight ? $$.getLegendWidth() + 20 : 0,
|
25655 | axesLen = hasAxis ? config.axis_y2_axes.length : 0,
|
25656 | axisWidth = hasAxis ? $$.getAxisWidthByAxisId("y2") : 0,
|
25657 | xAxisTickTextOverflow = withXAxisTickTextOverflow ? $$.axis.getXAxisTickTextY2Overflow(defaultPadding) : 0;
|
25658 | return padding = isValue(config.padding_right) ? config.padding_right + 1 : $$.axis && config.axis_rotated ? defaultPadding + legendWidthOnRight : $$.axis && (!config.axis_y2_show || config.axis_y2_inner) ? Math.max(2 + legendWidthOnRight + ($$.axis.getAxisLabelPosition("y2").isOuter ? 20 : 0), xAxisTickTextOverflow) : Math.max(ceil10(axisWidth) + legendWidthOnRight, xAxisTickTextOverflow), padding + axisWidth * axesLen;
|
25659 | },
|
25660 |
|
25661 | /**
|
25662 | * Get the parent rect element's size
|
25663 | * @param {string} key property/attribute name
|
25664 | * @returns {number}
|
25665 | * @private
|
25666 | */
|
25667 | getParentRectValue: function getParentRectValue(key) {
|
25668 | for (var v, offsetName = "offset" + capitalize(key), parent = this.$el.chart.node(); !v && parent && parent.tagName !== "BODY";) {
|
25669 | try {
|
25670 | v = parent.getBoundingClientRect()[key];
|
25671 | } catch (e) {
|
25672 | offsetName in parent && (v = parent[offsetName]);
|
25673 | }
|
25674 |
|
25675 | parent = parent.parentNode;
|
25676 | }
|
25677 |
|
25678 | if (key === "width") {
|
25679 | // Sometimes element's width value is incorrect(ex. flex container)
|
25680 | // In this case, use body's offsetWidth instead.
|
25681 | var bodyWidth = browser_doc.body.offsetWidth;
|
25682 | v > bodyWidth && (v = bodyWidth);
|
25683 | }
|
25684 |
|
25685 | return v;
|
25686 | },
|
25687 | getParentWidth: function getParentWidth() {
|
25688 | return this.getParentRectValue("width");
|
25689 | },
|
25690 | getParentHeight: function getParentHeight() {
|
25691 | var h = this.$el.chart.style("height");
|
25692 | return h.indexOf("px") > 0 ? parseInt(h, 10) : 0;
|
25693 | },
|
25694 | getSvgLeft: function getSvgLeft(withoutRecompute) {
|
25695 | var $$ = this,
|
25696 | config = $$.config,
|
25697 | $el = $$.$el,
|
25698 | hasLeftAxisRect = config.axis_rotated || !config.axis_rotated && !config.axis_y_inner,
|
25699 | leftAxisClass = config.axis_rotated ? config_classes.axisX : config_classes.axisY,
|
25700 | leftAxis = $el.main.select("." + leftAxisClass).node(),
|
25701 | svgRect = leftAxis && hasLeftAxisRect ? leftAxis.getBoundingClientRect() : {
|
25702 | right: 0
|
25703 | },
|
25704 | chartRect = $el.chart.node().getBoundingClientRect(),
|
25705 | hasArc = $$.hasArcType(),
|
25706 | svgLeft = svgRect.right - chartRect.left - (hasArc ? 0 : $$.getCurrentPaddingLeft(withoutRecompute));
|
25707 | return svgLeft > 0 ? svgLeft : 0;
|
25708 | },
|
25709 | updateDimension: function updateDimension(withoutAxis) {
|
25710 | var $$ = this,
|
25711 | config = $$.config,
|
25712 | hasAxis = $$.state.hasAxis,
|
25713 | $el = $$.$el;
|
25714 | // pass 'withoutAxis' param to not animate at the init rendering
|
25715 | hasAxis && !withoutAxis && $$.axis.x && config.axis_rotated && $$.axis.subX && $$.axis.subX.create($el.axis.subX), $$.updateScales(withoutAxis), $$.updateSvgSize(), $$.transformAll(!1);
|
25716 | },
|
25717 | updateSvgSize: function updateSvgSize() {
|
25718 | var $$ = this,
|
25719 | _$$$state = $$.state,
|
25720 | clip = _$$$state.clip,
|
25721 | current = _$$$state.current,
|
25722 | hasAxis = _$$$state.hasAxis,
|
25723 | width = _$$$state.width,
|
25724 | height = _$$$state.height,
|
25725 | svg = $$.$el.svg;
|
25726 |
|
25727 | if (svg.attr("width", current.width).attr("height", current.height), hasAxis) {
|
25728 | var brush = svg.select("." + config_classes.brush + " .overlay"),
|
25729 | brushSize = {
|
25730 | width: 0,
|
25731 | height: 0
|
25732 | };
|
25733 | brush.size() && (brushSize.width = +brush.attr("width"), brushSize.height = +brush.attr("height")), svg.selectAll(["#" + clip.id, "#" + clip.idGrid]).select("rect").attr("width", width).attr("height", height), svg.select("#" + clip.idXAxis).select("rect").call($$.setXAxisClipPath.bind($$)), svg.select("#" + clip.idYAxis).select("rect").call($$.setYAxisClipPath.bind($$)), clip.idSubchart && svg.select("#" + clip.idSubchart).select("rect").attr("width", width).attr("height", brushSize.height);
|
25734 | }
|
25735 | },
|
25736 |
|
25737 | /**
|
25738 | * Update size values
|
25739 | * @param {boolean} isInit If is called at initialization
|
25740 | * @private
|
25741 | */
|
25742 | updateSizes: function updateSizes(isInit) {
|
25743 | var $$ = this,
|
25744 | config = $$.config,
|
25745 | state = $$.state,
|
25746 | legend = $$.$el.legend,
|
25747 | isRotated = config.axis_rotated,
|
25748 | hasArc = $$.hasArcType();
|
25749 | isInit || $$.setContainerSize();
|
25750 | var currLegend = {
|
25751 | width: legend ? $$.getLegendWidth() : 0,
|
25752 | height: legend ? $$.getLegendHeight() : 0
|
25753 | };
|
25754 | !hasArc && config.axis_x_show && config.axis_x_tick_autorotate && $$.updateXAxisTickClip();
|
25755 | var legendHeightForBottom = state.isLegendRight || state.isLegendInset ? 0 : currLegend.height,
|
25756 | xAxisHeight = isRotated || hasArc ? 0 : $$.getHorizontalAxisHeight("x"),
|
25757 | subchartXAxisHeight = config.subchart_axis_x_show && config.subchart_axis_x_tick_text_show ? xAxisHeight : 30,
|
25758 | subchartHeight = config.subchart_show && !hasArc ? config.subchart_size_height + subchartXAxisHeight : 0;
|
25759 | state.margin = !hasArc && isRotated ? {
|
25760 | top: $$.getHorizontalAxisHeight("y2") + $$.getCurrentPaddingTop(),
|
25761 | right: hasArc ? 0 : $$.getCurrentPaddingRight(!0),
|
25762 | bottom: $$.getHorizontalAxisHeight("y") + legendHeightForBottom + $$.getCurrentPaddingBottom(),
|
25763 | left: subchartHeight + (hasArc ? 0 : $$.getCurrentPaddingLeft())
|
25764 | } : {
|
25765 | top: 4 + $$.getCurrentPaddingTop(),
|
25766 | // for top tick text
|
25767 | right: hasArc ? 0 : $$.getCurrentPaddingRight(!0),
|
25768 | bottom: xAxisHeight + subchartHeight + legendHeightForBottom + $$.getCurrentPaddingBottom(),
|
25769 | left: hasArc ? 0 : $$.getCurrentPaddingLeft()
|
25770 | }, state.margin2 = isRotated ? {
|
25771 | top: state.margin.top,
|
25772 | right: NaN,
|
25773 | bottom: 20 + legendHeightForBottom,
|
25774 | left: $$.state.rotatedPadding.left
|
25775 | } : {
|
25776 | top: state.current.height - subchartHeight - legendHeightForBottom,
|
25777 | right: NaN,
|
25778 | bottom: subchartXAxisHeight + legendHeightForBottom,
|
25779 | left: state.margin.left
|
25780 | }, state.margin3 = {
|
25781 | top: 0,
|
25782 | right: NaN,
|
25783 | bottom: 0,
|
25784 | left: 0
|
25785 | }, $$.updateSizeForLegend && $$.updateSizeForLegend(currLegend), state.width = state.current.width - state.margin.left - state.margin.right, state.height = state.current.height - state.margin.top - state.margin.bottom, state.width < 0 && (state.width = 0), state.height < 0 && (state.height = 0), state.width2 = isRotated ? state.margin.left - state.rotatedPadding.left - state.rotatedPadding.right : state.width, state.height2 = isRotated ? state.height : state.current.height - state.margin2.top - state.margin2.bottom, state.width2 < 0 && (state.width2 = 0), state.height2 < 0 && (state.height2 = 0);
|
25786 | // for arc
|
25787 | var hasGauge = $$.hasType("gauge"),
|
25788 | isLegendRight = config.legend_show && state.isLegendRight;
|
25789 | state.arcWidth = state.width - (isLegendRight ? currLegend.width + 10 : 0), state.arcHeight = state.height - (isLegendRight && !hasGauge ? 0 : 10), hasGauge && !config.gauge_fullCircle && (state.arcHeight += state.height - $$.getPaddingBottomForGauge()), $$.updateRadius && $$.updateRadius(), state.isLegendRight && hasArc && (state.margin3.left = state.arcWidth / 2 + state.radiusExpanded * 1.1);
|
25790 | }
|
25791 | });
|
25792 | ;// CONCATENATED MODULE: ./node_modules/d3-selection/src/selectAll.js
|
25793 |
|
25794 |
|
25795 | /* harmony default export */ function src_selectAll(selector) {
|
25796 | return typeof selector === "string" ? new Selection([document.querySelectorAll(selector)], [document.documentElement]) : new Selection([selector == null ? [] : array(selector)], root);
|
25797 | }
|
25798 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/text.ts
|
25799 | /**
|
25800 | * Copyright (c) 2017 ~ present NAVER Corp.
|
25801 | * billboard.js project is licensed under the MIT license
|
25802 | */
|
25803 |
|
25804 |
|
25805 |
|
25806 |
|
25807 | /* harmony default export */ var internals_text = ({
|
25808 | opacityForText: function opacityForText(d) {
|
25809 | var $$ = this;
|
25810 | return $$.isBarType(d) && !$$.meetsLabelThreshold(Math.abs($$.getRatio("bar", d)), "bar") ? "0" : $$.hasDataLabel ? "1" : "0";
|
25811 | },
|
25812 |
|
25813 | /**
|
25814 | * Initializes the text
|
25815 | * @private
|
25816 | */
|
25817 | initText: function initText() {
|
25818 | var $el = this.$el;
|
25819 | $el.main.select("." + config_classes.chart).append("g").attr("class", config_classes.chartTexts);
|
25820 | },
|
25821 |
|
25822 | /**
|
25823 | * Update chartText
|
25824 | * @param {object} targets $$.data.targets
|
25825 | * @private
|
25826 | */
|
25827 | updateTargetsForText: function updateTargetsForText(targets) {
|
25828 | var $$ = this,
|
25829 | classChartText = $$.getChartClass("Text"),
|
25830 | classTexts = $$.getClass("texts", "id"),
|
25831 | classFocus = $$.classFocus.bind($$),
|
25832 | mainTextUpdate = $$.$el.main.select("." + config_classes.chartTexts).selectAll("." + config_classes.chartText).data(targets).attr("class", function (d) {
|
25833 | return classChartText(d) + classFocus(d);
|
25834 | }),
|
25835 | mainTextEnter = mainTextUpdate.enter().append("g").style("opacity", "0").attr("class", classChartText).style("pointer-events", "none");
|
25836 | mainTextEnter.append("g").attr("class", classTexts);
|
25837 | },
|
25838 |
|
25839 | /**
|
25840 | * Update text
|
25841 | * @param {number} durationForExit Fade-out transition duration
|
25842 | * @private
|
25843 | */
|
25844 | updateText: function updateText(durationForExit) {
|
25845 | var $$ = this,
|
25846 | config = $$.config,
|
25847 | $el = $$.$el,
|
25848 | classText = $$.getClass("text", "index"),
|
25849 | text = $el.main.selectAll("." + config_classes.texts).selectAll("." + config_classes.text).data($$.labelishData.bind($$));
|
25850 | text.exit().transition().duration(durationForExit).style("fill-opacity", "0").remove(), $el.text = text.enter().append("text").merge(text).attr("class", classText).attr("text-anchor", function (d) {
|
25851 | // when value is negative or
|
25852 | var isEndAnchor = d.value < 0;
|
25853 |
|
25854 | if ($$.isCandlestickType(d)) {
|
25855 | var data = $$.getCandlestickData(d);
|
25856 | isEndAnchor = data && !data._isUp;
|
25857 | }
|
25858 |
|
25859 | return config.axis_rotated ? isEndAnchor ? "end" : "start" : "middle";
|
25860 | }).style("fill", $$.updateTextColor.bind($$)).style("fill-opacity", "0").each(function (d, i, j) {
|
25861 | var node = src_select(this),
|
25862 | value = d.value;
|
25863 | if ($$.isBubbleZType(d)) value = $$.getBubbleZData(value, "z");else if ($$.isCandlestickType(d)) {
|
25864 | var data = $$.getCandlestickData(d);
|
25865 | data && (value = data.close);
|
25866 | }
|
25867 | value = $$.dataLabelFormat(d.id)(value, d.id, i, j), isNumber(value) ? this.textContent = value : setTextValue(node, value);
|
25868 | });
|
25869 | },
|
25870 | updateTextColor: function updateTextColor(d) {
|
25871 | var color,
|
25872 | $$ = this,
|
25873 | config = $$.config,
|
25874 | labelColors = config.data_labels_colors,
|
25875 | defaultColor = $$.isArcType(d) && !$$.isRadarType(d) ? null : $$.color(d);
|
25876 | if (isString(labelColors)) color = labelColors;else if (isObject(labelColors)) {
|
25877 | var _ref = d.data || d,
|
25878 | id = _ref.id;
|
25879 |
|
25880 | color = labelColors[id];
|
25881 | } else isFunction(labelColors) && (color = labelColors.bind($$.api)(defaultColor, d));
|
25882 |
|
25883 | if ($$.isCandlestickType(d) && !isFunction(labelColors)) {
|
25884 | var value = $$.getCandlestickData(d);
|
25885 |
|
25886 | if (value && !value._isUp) {
|
25887 | var downColor = config.candlestick_color_down;
|
25888 | color = isObject(downColor) ? downColor[d.id] : downColor;
|
25889 | }
|
25890 | }
|
25891 |
|
25892 | return color || defaultColor;
|
25893 | },
|
25894 |
|
25895 | /**
|
25896 | * Redraw chartText
|
25897 | * @param {Function} x Positioning function for x
|
25898 | * @param {Function} y Positioning function for y
|
25899 | * @param {boolean} forFlow Weather is flow
|
25900 | * @param {boolean} withTransition transition is enabled
|
25901 | * @returns {Array}
|
25902 | * @private
|
25903 | */
|
25904 | redrawText: function redrawText(x, y, forFlow, withTransition) {
|
25905 | var $$ = this,
|
25906 | t = getRandom(!0);
|
25907 | // need to return 'true' as of being pushed to the redraw list
|
25908 | // ref: getRedrawList()
|
25909 | return $$.$el.text.style("fill", $$.updateTextColor.bind($$)).style("fill-opacity", forFlow ? 0 : $$.opacityForText.bind($$)).each(function (d, i) {
|
25910 | // do not apply transition for newly added text elements
|
25911 | var node = withTransition && this.getAttribute("x") ? src_select(this).transition(t) : src_select(this),
|
25912 | posX = x.bind(this)(d, i),
|
25913 | posY = y.bind(this)(d, i);
|
25914 | this.childElementCount ? node.attr("transform", "translate(" + posX + " " + posY + ")") : node.attr("x", posX).attr("y", posY);
|
25915 | }), !0;
|
25916 | },
|
25917 |
|
25918 | /**
|
25919 | * Gets the getBoundingClientRect value of the element
|
25920 | * @param {HTMLElement|d3.selection} element Target element
|
25921 | * @param {string} className Class name
|
25922 | * @returns {object} value of element.getBoundingClientRect()
|
25923 | * @private
|
25924 | */
|
25925 | getTextRect: function getTextRect(element, className) {
|
25926 | var $$ = this,
|
25927 | base = element.node ? element.node() : element;
|
25928 | /text/i.test(base.tagName) || (base = base.querySelector("text"));
|
25929 | var text = base.textContent,
|
25930 | cacheKey = KEY.textRect + "-" + text.replace(/\W/g, "_"),
|
25931 | rect = $$.cache.get(cacheKey);
|
25932 | return rect || ($$.$el.svg.append("text").style("visibility", "hidden").style("font", src_select(base).style("font")).classed(className, !0).text(text).call(function (v) {
|
25933 | rect = getBoundingRect(v.node());
|
25934 | }).remove(), $$.cache.add(cacheKey, rect)), rect;
|
25935 | },
|
25936 |
|
25937 | /**
|
25938 | * Gets the x or y coordinate of the text
|
25939 | * @param {object} indices Indices values
|
25940 | * @param {boolean} forX whether or not to x
|
25941 | * @returns {number} coordinates
|
25942 | * @private
|
25943 | */
|
25944 | generateXYForText: function generateXYForText(indices, forX) {
|
25945 | var $$ = this,
|
25946 | types = Object.keys(indices),
|
25947 | points = {},
|
25948 | getter = forX ? $$.getXForText : $$.getYForText;
|
25949 | return $$.hasType("radar") && types.push("radar"), types.forEach(function (v) {
|
25950 | points[v] = $$["generateGet" + capitalize(v) + "Points"](indices[v], !1);
|
25951 | }), function (d, i) {
|
25952 | var type = $$.isAreaType(d) && "area" || $$.isBarType(d) && "bar" || $$.isCandlestickType(d) && "candlestick" || $$.isRadarType(d) && "radar" || "line";
|
25953 | return getter.call($$, points[type](d, i), d, this);
|
25954 | };
|
25955 | },
|
25956 |
|
25957 | /**
|
25958 | * Get centerized text position for bar type data.label.text
|
25959 | * @param {object} d Data object
|
25960 | * @param {Array} points Data points position
|
25961 | * @param {HTMLElement} textElement Data label text element
|
25962 | * @returns {number} Position value
|
25963 | * @private
|
25964 | */
|
25965 | getCenteredTextPos: function getCenteredTextPos(d, points, textElement) {
|
25966 | var $$ = this,
|
25967 | config = $$.config,
|
25968 | isRotated = config.axis_rotated;
|
25969 |
|
25970 | if (config.data_labels.centered && $$.isBarType(d)) {
|
25971 | var rect = getBoundingRect(textElement),
|
25972 | isPositive = d.value >= 0;
|
25973 |
|
25974 | if (isRotated) {
|
25975 | var w = (isPositive ? points[1][1] - points[0][1] : points[0][1] - points[1][1]) / 2 + rect.width / 2;
|
25976 | return isPositive ? -w - 3 : w + 2;
|
25977 | }
|
25978 |
|
25979 | var h = (isPositive ? points[0][1] - points[1][1] : points[1][1] - points[0][1]) / 2 + rect.height / 2;
|
25980 | return isPositive ? h : -h - 2;
|
25981 | }
|
25982 |
|
25983 | return 0;
|
25984 | },
|
25985 |
|
25986 | /**
|
25987 | * Get data.labels.position value
|
25988 | * @param {string} id Data id value
|
25989 | * @param {string} type x | y
|
25990 | * @returns {number} Position value
|
25991 | * @private
|
25992 | */
|
25993 | getTextPos: function getTextPos(id, type) {
|
25994 | var pos = this.config.data_labels_position;
|
25995 | return (id in pos ? pos[id] : pos)[type] || 0;
|
25996 | },
|
25997 |
|
25998 | /**
|
25999 | * Gets the x coordinate of the text
|
26000 | * @param {object} points Data points position
|
26001 | * @param {object} d Data object
|
26002 | * @param {HTMLElement} textElement Data label text element
|
26003 | * @returns {number} x coordinate
|
26004 | * @private
|
26005 | */
|
26006 | getXForText: function getXForText(points, d, textElement) {
|
26007 | var $$ = this,
|
26008 | config = $$.config,
|
26009 | state = $$.state,
|
26010 | isRotated = config.axis_rotated,
|
26011 | xPos = points[0][0];
|
26012 | if ($$.hasType("candlestick")) isRotated ? xPos = $$.getCandlestickData(d)._isUp ? points[2][2] + 4 : points[2][1] - 4 : xPos += (points[1][0] - xPos) / 2;else if (isRotated) {
|
26013 | var padding = $$.isBarType(d) ? 4 : 6;
|
26014 | xPos = points[2][1] + padding * (d.value < 0 ? -1 : 1);
|
26015 | } else xPos = $$.hasType("bar") ? (points[2][0] + points[0][0]) / 2 : xPos; // show labels regardless of the domain if value is null
|
26016 |
|
26017 | if (d.value === null) if (xPos > state.width) {
|
26018 | var _getBoundingRect = getBoundingRect(textElement),
|
26019 | width = _getBoundingRect.width;
|
26020 |
|
26021 | xPos = state.width - width;
|
26022 | } else xPos < 0 && (xPos = 4);
|
26023 | return isRotated && (xPos += $$.getCenteredTextPos(d, points, textElement)), xPos + $$.getTextPos(d.id, "x");
|
26024 | },
|
26025 |
|
26026 | /**
|
26027 | * Gets the y coordinate of the text
|
26028 | * @param {object} points Data points position
|
26029 | * @param {object} d Data object
|
26030 | * @param {HTMLElement} textElement Data label text element
|
26031 | * @returns {number} y coordinate
|
26032 | * @private
|
26033 | */
|
26034 | getYForText: function getYForText(points, d, textElement) {
|
26035 | var yPos,
|
26036 | $$ = this,
|
26037 | config = $$.config,
|
26038 | state = $$.state,
|
26039 | isRotated = config.axis_rotated,
|
26040 | r = config.point_r,
|
26041 | rect = getBoundingRect(textElement),
|
26042 | value = d.value,
|
26043 | baseY = 3;
|
26044 | if ($$.isCandlestickType(d)) value = $$.getCandlestickData(d), isRotated ? (yPos = points[0][0], yPos += (points[1][0] - yPos) / 2 + baseY) : yPos = value && value._isUp ? points[2][2] - baseY : points[2][1] + baseY * 4;else if (isRotated) yPos = (points[0][0] + points[2][0] + rect.height * .6) / 2;else if (yPos = points[2][1], isNumber(r) && r > 5 && ($$.isLineType(d) || $$.isScatterType(d)) && (baseY += config.point_r / 2.3), value < 0 || value === 0 && !state.hasPositiveValue && state.hasNegativeValue) yPos += rect.height + ($$.isBarType(d) ? -baseY : baseY);else {
|
26045 | var diff = -baseY * 2;
|
26046 | $$.isBarType(d) ? diff = -baseY : $$.isBubbleType(d) && (diff = baseY), yPos += diff;
|
26047 | } // show labels regardless of the domain if value is null
|
26048 |
|
26049 | if (d.value === null && !isRotated) {
|
26050 | var boxHeight = rect.height;
|
26051 | yPos < boxHeight ? yPos = boxHeight : yPos > state.height && (yPos = state.height - 4);
|
26052 | }
|
26053 |
|
26054 | return isRotated || (yPos += $$.getCenteredTextPos(d, points, textElement)), yPos + $$.getTextPos(d.id, "y");
|
26055 | },
|
26056 |
|
26057 | /**
|
26058 | * Calculate if two or more text nodes are overlapping
|
26059 | * Mark overlapping text nodes with "text-overlapping" class
|
26060 | * @param {string} id Axis id
|
26061 | * @param {ChartInternal} $$ ChartInternal context
|
26062 | * @param {string} selector Selector string
|
26063 | * @private
|
26064 | */
|
26065 | markOverlapped: function markOverlapped(id, $$, selector) {
|
26066 | var textNodes = $$.$el.arcs.selectAll(selector),
|
26067 | filteredTextNodes = textNodes.filter(function (node) {
|
26068 | return node.data.id !== id;
|
26069 | }),
|
26070 | textNode = textNodes.filter(function (node) {
|
26071 | return node.data.id === id;
|
26072 | }),
|
26073 | translate = getTranslation(textNode.node()),
|
26074 | calcHypo = function (x, y) {
|
26075 | return Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
|
26076 | };
|
26077 |
|
26078 | textNode.node() && filteredTextNodes.each(function () {
|
26079 | var coordinate = getTranslation(this),
|
26080 | filteredTextNode = src_select(this),
|
26081 | nodeForWidth = calcHypo(translate.e, translate.f) > calcHypo(coordinate.e, coordinate.f) ? textNode : filteredTextNode,
|
26082 | overlapsX = Math.ceil(Math.abs(translate.e - coordinate.e)) < Math.ceil(nodeForWidth.node().getComputedTextLength()),
|
26083 | overlapsY = Math.ceil(Math.abs(translate.f - coordinate.f)) < parseInt(textNode.style("font-size"), 10);
|
26084 | filteredTextNode.classed(config_classes.TextOverlapping, overlapsX && overlapsY);
|
26085 | });
|
26086 | },
|
26087 |
|
26088 | /**
|
26089 | * Calculate if two or more text nodes are overlapping
|
26090 | * Remove "text-overlapping" class on selected text nodes
|
26091 | * @param {ChartInternal} $$ ChartInternal context
|
26092 | * @param {string} selector Selector string
|
26093 | * @private
|
26094 | */
|
26095 | undoMarkOverlapped: function undoMarkOverlapped($$, selector) {
|
26096 | $$.$el.arcs.selectAll(selector).each(function () {
|
26097 | src_selectAll([this, this.previousSibling]).classed(config_classes.TextOverlapping, !1);
|
26098 | });
|
26099 | },
|
26100 |
|
26101 | /**
|
26102 | * Check if meets the ratio to show data label text
|
26103 | * @param {number} ratio ratio to meet
|
26104 | * @param {string} type chart type
|
26105 | * @returns {boolean}
|
26106 | * @private
|
26107 | */
|
26108 | meetsLabelThreshold: function meetsLabelThreshold(ratio, type) {
|
26109 | ratio === void 0 && (ratio = 0);
|
26110 | var $$ = this,
|
26111 | config = $$.config,
|
26112 | threshold = config[type + "_label_threshold"] || 0;
|
26113 | return ratio >= threshold;
|
26114 | }
|
26115 | });
|
26116 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/title.ts
|
26117 | /**
|
26118 | * Copyright (c) 2017 ~ present NAVER Corp.
|
26119 | * billboard.js project is licensed under the MIT license
|
26120 | */
|
26121 |
|
26122 |
|
26123 | /**
|
26124 | * Get the text position
|
26125 | * @param {string} pos right, left or center
|
26126 | * @param {number} width chart width
|
26127 | * @returns {string|number} text-anchor value or position in pixel
|
26128 | * @private
|
26129 | */
|
26130 |
|
26131 | function getTextPos(pos, width) {
|
26132 | pos === void 0 && (pos = "left");
|
26133 | var position,
|
26134 | isNum = isNumber(width);
|
26135 | return position = pos.indexOf("center") > -1 ? isNum ? width / 2 : "middle" : pos.indexOf("right") > -1 ? isNum ? width : "end" : isNum ? 0 : "start", position;
|
26136 | }
|
26137 |
|
26138 | /* harmony default export */ var internals_title = ({
|
26139 | /**
|
26140 | * Initializes the title
|
26141 | * @private
|
26142 | */
|
26143 | initTitle: function initTitle() {
|
26144 | var $$ = this,
|
26145 | config = $$.config,
|
26146 | $el = $$.$el;
|
26147 |
|
26148 | if (config.title_text) {
|
26149 | $el.title = $el.svg.append("g");
|
26150 | var text = $el.title.append("text").style("text-anchor", getTextPos(config.title_position)).attr("class", config_classes.title);
|
26151 | setTextValue(text, config.title_text, [.3, 1.5]);
|
26152 | }
|
26153 | },
|
26154 |
|
26155 | /**
|
26156 | * Redraw title
|
26157 | * @private
|
26158 | */
|
26159 | redrawTitle: function redrawTitle() {
|
26160 | var $$ = this,
|
26161 | config = $$.config,
|
26162 | current = $$.state.current,
|
26163 | title = $$.$el.title;
|
26164 |
|
26165 | if (title) {
|
26166 | var y = $$.yForTitle.call($$);
|
26167 | /g/i.test(title.node().tagName) ? title.attr("transform", "translate(" + getTextPos(config.title_position, current.width) + ", " + y + ")") : title.attr("x", $$.xForTitle.call($$)).attr("y", y);
|
26168 | }
|
26169 | },
|
26170 |
|
26171 | /**
|
26172 | * Returns the x attribute value of the title
|
26173 | * @returns {number} x attribute value
|
26174 | * @private
|
26175 | */
|
26176 | xForTitle: function xForTitle() {
|
26177 | var x,
|
26178 | $$ = this,
|
26179 | config = $$.config,
|
26180 | current = $$.state.current,
|
26181 | position = config.title_position || "left",
|
26182 | textRectWidth = $$.getTextRect($$.$el.title, config_classes.title).width;
|
26183 | return /(right|center)/.test(position) ? (x = current.width - textRectWidth, position.indexOf("right") >= 0 ? x = current.width - textRectWidth - config.title_padding.right : position.indexOf("center") >= 0 && (x = (current.width - textRectWidth) / 2)) : x = config.title_padding.left || 0, x;
|
26184 | },
|
26185 |
|
26186 | /**
|
26187 | * Returns the y attribute value of the title
|
26188 | * @returns {number} y attribute value
|
26189 | * @private
|
26190 | */
|
26191 | yForTitle: function yForTitle() {
|
26192 | var $$ = this;
|
26193 | return ($$.config.title_padding.top || 0) + $$.getTextRect($$.$el.title, config_classes.title).height;
|
26194 | },
|
26195 |
|
26196 | /**
|
26197 | * Get title padding
|
26198 | * @returns {number} padding value
|
26199 | * @private
|
26200 | */
|
26201 | getTitlePadding: function getTitlePadding() {
|
26202 | var $$ = this;
|
26203 | return $$.yForTitle() + ($$.config.title_padding.bottom || 0);
|
26204 | }
|
26205 | });
|
26206 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/tooltip.ts
|
26207 | /**
|
26208 | * Copyright (c) 2017 ~ present NAVER Corp.
|
26209 | * billboard.js project is licensed under the MIT license
|
26210 | */
|
26211 |
|
26212 |
|
26213 |
|
26214 |
|
26215 | /* harmony default export */ var internals_tooltip = ({
|
26216 | /**
|
26217 | * Initializes the tooltip
|
26218 | * @private
|
26219 | */
|
26220 | initTooltip: function initTooltip() {
|
26221 | var $$ = this,
|
26222 | config = $$.config,
|
26223 | $el = $$.$el;
|
26224 | $el.tooltip = src_select(config.tooltip_contents.bindto), $el.tooltip.empty() && ($el.tooltip = $el.chart.style("position", "relative").append("div").attr("class", config_classes.tooltipContainer).style("position", "absolute").style("pointer-events", "none").style("display", "none")), $$.bindTooltipResizePos();
|
26225 | },
|
26226 | initShowTooltip: function initShowTooltip() {
|
26227 | var $$ = this,
|
26228 | config = $$.config,
|
26229 | $el = $$.$el,
|
26230 | _$$$state = $$.state,
|
26231 | hasAxis = _$$$state.hasAxis,
|
26232 | hasRadar = _$$$state.hasRadar;
|
26233 |
|
26234 | // Show tooltip if needed
|
26235 | if (config.tooltip_init_show) {
|
26236 | var isArc = !(hasAxis && hasRadar);
|
26237 |
|
26238 | if ($$.axis && $$.axis.isTimeSeries() && isString(config.tooltip_init_x)) {
|
26239 | var i,
|
26240 | val,
|
26241 | targets = $$.data.targets[0];
|
26242 |
|
26243 | for (config.tooltip_init_x = parseDate.call($$, config.tooltip_init_x), i = 0; (val = targets.values[i]) && !(val.x - config.tooltip_init_x === 0); i++);
|
26244 |
|
26245 | config.tooltip_init_x = i;
|
26246 | }
|
26247 |
|
26248 | var data = $$.data.targets.map(function (d) {
|
26249 | var x = isArc ? 0 : config.tooltip_init_x;
|
26250 | return $$.addName(d.values[x]);
|
26251 | });
|
26252 | isArc && (data = [data[config.tooltip_init_x]]), $el.tooltip.html($$.getTooltipHTML(data, $$.axis && $$.axis.getXAxisTickFormat(), $$.getYFormat($$.hasArcType(null, ["radar"])), $$.color)), config.tooltip_contents.bindto || $el.tooltip.style("top", config.tooltip_init_position.top).style("left", config.tooltip_init_position.left).style("display", "block");
|
26253 | }
|
26254 | },
|
26255 |
|
26256 | /**
|
26257 | * Get the tooltip HTML string
|
26258 | * @param {Array} args Arguments
|
26259 | * @returns {string} Formatted HTML string
|
26260 | * @private
|
26261 | */
|
26262 | getTooltipHTML: function getTooltipHTML() {
|
26263 | var $$ = this,
|
26264 | api = $$.api,
|
26265 | config = $$.config;
|
26266 | return isFunction(config.tooltip_contents) ? config.tooltip_contents.bind(api).apply(void 0, arguments) : $$.getTooltipContent.apply($$, arguments);
|
26267 | },
|
26268 |
|
26269 | /**
|
26270 | * Returns the tooltip content(HTML string)
|
26271 | * @param {object} d data
|
26272 | * @param {Function} defaultTitleFormat Default title format
|
26273 | * @param {Function} defaultValueFormat Default format for each data value in the tooltip.
|
26274 | * @param {Function} color Color function
|
26275 | * @returns {string} html
|
26276 | * @private
|
26277 | */
|
26278 | getTooltipContent: function getTooltipContent(d, defaultTitleFormat, defaultValueFormat, color) {
|
26279 | var $$ = this,
|
26280 | api = $$.api,
|
26281 | config = $$.config,
|
26282 | state = $$.state,
|
26283 | _map = ["title", "name", "value"].map(function (v) {
|
26284 | var fn = config["tooltip_format_" + v];
|
26285 | return isFunction(fn) ? fn.bind(api) : fn;
|
26286 | }),
|
26287 | titleFormat = _map[0],
|
26288 | nameFormat = _map[1],
|
26289 | valueFormat = _map[2];
|
26290 |
|
26291 | titleFormat = titleFormat || defaultTitleFormat, nameFormat = nameFormat || function (name) {
|
26292 | return name;
|
26293 | }, valueFormat = valueFormat || ($$.isStackNormalized() ? function (v, ratio) {
|
26294 | return (ratio * 100).toFixed(2) + "%";
|
26295 | } : defaultValueFormat);
|
26296 |
|
26297 | var order = config.tooltip_order,
|
26298 | getRowValue = function (row) {
|
26299 | return $$.axis && $$.isBubbleZType(row) ? $$.getBubbleZData(row.value, "z") : $$.getBaseValue(row);
|
26300 | },
|
26301 | getBgColor = $$.levelColor ? function (row) {
|
26302 | return $$.levelColor(row.value);
|
26303 | } : function (row) {
|
26304 | return color(row);
|
26305 | },
|
26306 | contents = config.tooltip_contents,
|
26307 | tplStr = contents.template,
|
26308 | targetIds = $$.mapToTargetIds();
|
26309 |
|
26310 | if (order === null && config.data_groups.length) {
|
26311 | // for stacked data, order should aligned with the visually displayed data
|
26312 | var ids = $$.orderTargets($$.data.targets).map(function (i2) {
|
26313 | return i2.id;
|
26314 | }).reverse();
|
26315 | d.sort(function (a, b) {
|
26316 | var v1 = a ? a.value : null,
|
26317 | v2 = b ? b.value : null;
|
26318 | return v1 > 0 && v2 > 0 && (v1 = a.id ? ids.indexOf(a.id) : null, v2 = b.id ? ids.indexOf(b.id) : null), v1 - v2;
|
26319 | });
|
26320 | } else if (/^(asc|desc)$/.test(order)) {
|
26321 | d.sort(function (a, b) {
|
26322 | var v1 = a ? getRowValue(a) : null,
|
26323 | v2 = b ? getRowValue(b) : null;
|
26324 | return order === "asc" ? v1 - v2 : v2 - v1;
|
26325 | });
|
26326 | } else isFunction(order) && d.sort(order.bind(api));
|
26327 |
|
26328 | var text,
|
26329 | row,
|
26330 | param,
|
26331 | value,
|
26332 | i,
|
26333 | tpl = $$.getTooltipContentTemplate(tplStr),
|
26334 | len = d.length;
|
26335 |
|
26336 | for (i = 0; i < len; i++) if (row = d[i], row && (getRowValue(row) || getRowValue(row) === 0)) {
|
26337 | if (isUndefined(text)) {
|
26338 | var title = (state.hasAxis || state.hasRadar) && sanitise(titleFormat ? titleFormat(row.x) : row.x);
|
26339 | text = tplProcess(tpl[0], {
|
26340 | CLASS_TOOLTIP: config_classes.tooltip,
|
26341 | TITLE: isValue(title) ? tplStr ? title : "<tr><th colspan=\"2\">" + title + "</th></tr>" : ""
|
26342 | });
|
26343 | }
|
26344 |
|
26345 | if (!row.ratio && $$.$el.arcs && (row.ratio = $$.getRatio("arc", $$.$el.arcs.select("path." + config_classes.arc + "-" + row.id).data()[0])), param = [row.ratio, row.id, row.index, d], value = sanitise(valueFormat.apply(void 0, [getRowValue(row)].concat(param))), $$.isAreaRangeType(row)) {
|
26346 | var _map2 = ["high", "low"].map(function (v) {
|
26347 | return sanitise(valueFormat.apply(void 0, [$$.getRangedData(row, v)].concat(param)));
|
26348 | }),
|
26349 | high = _map2[0],
|
26350 | low = _map2[1];
|
26351 |
|
26352 | value = "<b>Mid:</b> " + value + " <b>High:</b> " + high + " <b>Low:</b> " + low;
|
26353 | } else if ($$.isCandlestickType(row)) {
|
26354 | var _map3 = ["open", "high", "low", "close", "volume"].map(function (v) {
|
26355 | return sanitise(valueFormat.apply(void 0, [$$.getRangedData(row, v, "candlestick")].concat(param)));
|
26356 | }),
|
26357 | open = _map3[0],
|
26358 | _high = _map3[1],
|
26359 | _low = _map3[2],
|
26360 | close = _map3[3],
|
26361 | volume = _map3[4];
|
26362 |
|
26363 | value = "<b>Open:</b> " + open + " <b>High:</b> " + _high + " <b>Low:</b> " + _low + " <b>Close:</b> " + close + (volume ? " <b>Volume:</b> " + volume : "");
|
26364 | }
|
26365 |
|
26366 | if (value !== undefined) {
|
26367 | var _ret = function () {
|
26368 | // Skip elements when their name is set to null
|
26369 | if (row.name === null) return "continue";
|
26370 | var name = sanitise(nameFormat.apply(void 0, [row.name].concat(param))),
|
26371 | color = getBgColor(row),
|
26372 | contentValue = {
|
26373 | CLASS_TOOLTIP_NAME: config_classes.tooltipName + $$.getTargetSelectorSuffix(row.id),
|
26374 | COLOR: tplStr || !$$.patterns ? color : "<svg><rect style=\"fill:" + color + "\" width=\"10\" height=\"10\"></rect></svg>",
|
26375 | NAME: name,
|
26376 | VALUE: value
|
26377 | };
|
26378 |
|
26379 | if (tplStr && isObject(contents.text)) {
|
26380 | var index = targetIds.indexOf(row.id);
|
26381 | Object.keys(contents.text).forEach(function (key) {
|
26382 | contentValue[key] = contents.text[key][index];
|
26383 | });
|
26384 | }
|
26385 |
|
26386 | text += tplProcess(tpl[1], contentValue);
|
26387 | }();
|
26388 |
|
26389 | if (_ret === "continue") continue;
|
26390 | }
|
26391 | }
|
26392 |
|
26393 | return text + "</table>";
|
26394 | },
|
26395 |
|
26396 | /**
|
26397 | * Get the content template string
|
26398 | * @param {string} tplStr Tempalte string
|
26399 | * @returns {Array} Template string
|
26400 | * @private
|
26401 | */
|
26402 | getTooltipContentTemplate: function getTooltipContentTemplate(tplStr) {
|
26403 | return (tplStr || "<table class=\"{=CLASS_TOOLTIP}\"><tbody>\n\t\t\t\t{=TITLE}\n\t\t\t\t{{<tr class=\"{=CLASS_TOOLTIP_NAME}\">\n\t\t\t\t\t<td class=\"name\">" + (this.patterns ? "{=COLOR}" : "<span style=\"background-color:{=COLOR}\"></span>") + "{=NAME}</td>\n\t\t\t\t\t<td class=\"value\">{=VALUE}</td>\n\t\t\t\t</tr>}}\n\t\t\t</tbody></table>").replace(/(\r?\n|\t)/g, "").split(/{{(.*)}}/);
|
26404 | },
|
26405 |
|
26406 | /**
|
26407 | * Returns the position of the tooltip
|
26408 | * @param {object} dataToShow data
|
26409 | * @param {string} tWidth Width value of tooltip element
|
26410 | * @param {string} tHeight Height value of tooltip element
|
26411 | * @param {HTMLElement} element Tooltip element
|
26412 | * @returns {object} top, left value
|
26413 | * @private
|
26414 | */
|
26415 | tooltipPosition: function tooltipPosition(dataToShow, tWidth, tHeight, element) {
|
26416 | var $$ = this,
|
26417 | config = $$.config,
|
26418 | scale = $$.scale,
|
26419 | state = $$.state,
|
26420 | _state = state,
|
26421 | width = _state.width,
|
26422 | height = _state.height,
|
26423 | current = _state.current,
|
26424 | isLegendRight = _state.isLegendRight,
|
26425 | inputType = _state.inputType,
|
26426 | event = _state.event,
|
26427 | hasGauge = $$.hasType("gauge") && !config.gauge_fullCircle,
|
26428 | svgLeft = $$.getSvgLeft(!0),
|
26429 | chartRight = svgLeft + current.width - $$.getCurrentPaddingRight(),
|
26430 | chartLeft = $$.getCurrentPaddingLeft(!0),
|
26431 | size = 20,
|
26432 | _getPointer = getPointer(event, element),
|
26433 | x = _getPointer[0],
|
26434 | y = _getPointer[1];
|
26435 |
|
26436 | // Determine tooltip position
|
26437 | if ($$.hasArcType()) {
|
26438 | var raw = inputType === "touch" || $$.hasType("radar");
|
26439 | raw || (y += hasGauge ? height : height / 2, x += (width - (isLegendRight ? $$.getLegendWidth() : 0)) / 2);
|
26440 | } else {
|
26441 | var dataScale = scale.x(dataToShow[0].x);
|
26442 | config.axis_rotated ? (y = dataScale + size, x += svgLeft + 100, chartRight -= svgLeft) : (y -= 5, x = svgLeft + chartLeft + size + ($$.zoomScale ? x : dataScale));
|
26443 | } // when tooltip left + tWidth > chart's width
|
26444 |
|
26445 |
|
26446 | x + tWidth + 15 > chartRight && (x -= tWidth + chartLeft), y + tHeight > current.height && (y -= hasGauge ? tHeight * 3 : tHeight + 30);
|
26447 | var pos = {
|
26448 | top: y,
|
26449 | left: x
|
26450 | }; // make sure to not be positioned out of viewport
|
26451 |
|
26452 | return Object.keys(pos).forEach(function (v) {
|
26453 | pos[v] < 0 && (pos[v] = 0);
|
26454 | }), pos;
|
26455 | },
|
26456 |
|
26457 | /**
|
26458 | * Show the tooltip
|
26459 | * @param {object} selectedData Data object
|
26460 | * @param {HTMLElement} element Tooltip element
|
26461 | * @private
|
26462 | */
|
26463 | showTooltip: function showTooltip(selectedData, element) {
|
26464 | var $$ = this,
|
26465 | config = $$.config,
|
26466 | state = $$.state,
|
26467 | tooltip = $$.$el.tooltip,
|
26468 | bindto = config.tooltip_contents.bindto,
|
26469 | forArc = $$.hasArcType(null, ["radar"]),
|
26470 | dataToShow = selectedData.filter(function (d) {
|
26471 | return d && isValue($$.getBaseValue(d));
|
26472 | });
|
26473 |
|
26474 | if (tooltip && dataToShow.length !== 0 && config.tooltip_show) {
|
26475 | var datum = tooltip.datum(),
|
26476 | _ref = datum || {},
|
26477 | _ref$width = _ref.width,
|
26478 | width = _ref$width === void 0 ? 0 : _ref$width,
|
26479 | _ref$height = _ref.height,
|
26480 | height = _ref$height === void 0 ? 0 : _ref$height,
|
26481 | dataStr = JSON.stringify(selectedData);
|
26482 |
|
26483 | if (!datum || datum.current !== dataStr) {
|
26484 | var index = selectedData.concat().sort()[0].index;
|
26485 | callFn(config.tooltip_onshow, $$.api, selectedData), tooltip.html($$.getTooltipHTML(selectedData, // data
|
26486 | $$.axis ? $$.axis.getXAxisTickFormat() : $$.categoryName.bind($$), // defaultTitleFormat
|
26487 | $$.getYFormat(forArc), // defaultValueFormat
|
26488 | $$.color // color
|
26489 | )).style("display", null).style("visibility", null) // for IE9
|
26490 | .datum(datum = {
|
26491 | index: index,
|
26492 | current: dataStr,
|
26493 | width: width = tooltip.property("offsetWidth"),
|
26494 | height: height = tooltip.property("offsetHeight")
|
26495 | }), callFn(config.tooltip_onshown, $$.api, selectedData), $$._handleLinkedCharts(!0, index);
|
26496 | }
|
26497 |
|
26498 | if (!bindto) {
|
26499 | var fnPos = config.tooltip_position || $$.tooltipPosition,
|
26500 | pos = fnPos.call(this, dataToShow, width, height, element); // Get tooltip dimensions
|
26501 |
|
26502 | ["top", "left"].forEach(function (v) {
|
26503 | var value = pos[v];
|
26504 | tooltip.style(v, value + "px"), v !== "left" || datum.xPosInPercent || (datum.xPosInPercent = value / state.current.width * 100);
|
26505 | });
|
26506 | }
|
26507 | }
|
26508 | },
|
26509 |
|
26510 | /**
|
26511 | * Adjust tooltip position on resize event
|
26512 | * @private
|
26513 | */
|
26514 | bindTooltipResizePos: function bindTooltipResizePos() {
|
26515 | var $$ = this,
|
26516 | resizeFunction = $$.resizeFunction,
|
26517 | state = $$.state,
|
26518 | tooltip = $$.$el.tooltip;
|
26519 | resizeFunction.add(function () {
|
26520 | if (tooltip.style("display") === "block") {
|
26521 | var current = state.current,
|
26522 | _tooltip$datum = tooltip.datum(),
|
26523 | width = _tooltip$datum.width,
|
26524 | xPosInPercent = _tooltip$datum.xPosInPercent,
|
26525 | _value = current.width / 100 * xPosInPercent,
|
26526 | diff = current.width - (_value + width);
|
26527 |
|
26528 | diff < 0 && (_value += diff), tooltip.style("left", _value + "px");
|
26529 | }
|
26530 | });
|
26531 | },
|
26532 |
|
26533 | /**
|
26534 | * Hide the tooltip
|
26535 | * @param {boolean} force Force to hide
|
26536 | * @private
|
26537 | */
|
26538 | hideTooltip: function hideTooltip(force) {
|
26539 | var $$ = this,
|
26540 | api = $$.api,
|
26541 | config = $$.config,
|
26542 | tooltip = $$.$el.tooltip;
|
26543 |
|
26544 | if (tooltip && tooltip.style("display") !== "none" && (!config.tooltip_doNotHide || force)) {
|
26545 | var selectedData = JSON.parse(tooltip.datum().current);
|
26546 | // hide tooltip
|
26547 | callFn(config.tooltip_onhide, api, selectedData), tooltip.style("display", "none").style("visibility", "hidden") // for IE9
|
26548 | .datum(null), callFn(config.tooltip_onhidden, api, selectedData);
|
26549 | }
|
26550 | },
|
26551 |
|
26552 | /**
|
26553 | * Toggle display for linked chart instances
|
26554 | * @param {boolean} show true: show, false: hide
|
26555 | * @param {number} index x Axis index
|
26556 | * @private
|
26557 | */
|
26558 | _handleLinkedCharts: function _handleLinkedCharts(show, index) {
|
26559 | var $$ = this,
|
26560 | charts = $$.charts,
|
26561 | config = $$.config,
|
26562 | event = $$.state.event;
|
26563 |
|
26564 | // Prevent propagation among instances if isn't instantiated from the user's event
|
26565 | // https://github.com/naver/billboard.js/issues/1979
|
26566 | if (event && event.isTrusted && config.tooltip_linked && charts.length > 1) {
|
26567 | var linkedName = config.tooltip_linked_name;
|
26568 | charts.filter(function (c) {
|
26569 | return c !== $$.api;
|
26570 | }).forEach(function (c) {
|
26571 | var _c$internal = c.internal,
|
26572 | config = _c$internal.config,
|
26573 | $el = _c$internal.$el,
|
26574 | isLinked = config.tooltip_linked,
|
26575 | name = config.tooltip_linked_name,
|
26576 | isInDom = browser_doc.body.contains($el.chart.node());
|
26577 |
|
26578 | if (isLinked && linkedName === name && isInDom) {
|
26579 | var data = $el.tooltip.data()[0],
|
26580 | isNotSameIndex = index !== (data && data.index);
|
26581 |
|
26582 | try {
|
26583 | c.tooltip[show && isNotSameIndex ? "show" : "hide"]({
|
26584 | index: index
|
26585 | });
|
26586 | } catch (e) {}
|
26587 | }
|
26588 | });
|
26589 | }
|
26590 | }
|
26591 | });
|
26592 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/transform.ts
|
26593 | /**
|
26594 | * Copyright (c) 2017 ~ present NAVER Corp.
|
26595 | * billboard.js project is licensed under the MIT license
|
26596 | */
|
26597 |
|
26598 |
|
26599 | /* harmony default export */ var transform = ({
|
26600 | getTranslate: function getTranslate(target, index) {
|
26601 | index === void 0 && (index = 0);
|
26602 | var x,
|
26603 | y,
|
26604 | $$ = this,
|
26605 | config = $$.config,
|
26606 | state = $$.state,
|
26607 | isRotated = config.axis_rotated,
|
26608 | padding = 0;
|
26609 | if (index && /^(x|y2?)$/.test(target) && (padding = $$.getAxisSize(target) * index), target === "main") x = asHalfPixel(state.margin.left), y = asHalfPixel(state.margin.top);else if (target === "context") x = asHalfPixel(state.margin2.left), y = asHalfPixel(state.margin2.top);else if (target === "legend") x = state.margin3.left, y = state.margin3.top;else if (target === "x") x = isRotated ? -padding : 0, y = isRotated ? 0 : state.height + padding;else if (target === "y") x = isRotated ? 0 : -padding, y = isRotated ? state.height + padding : 0;else if (target === "y2") x = isRotated ? 0 : state.width + padding, y = isRotated ? 1 - padding : 0;else if (target === "subX") x = 0, y = isRotated ? 0 : state.height2;else if (target === "arc") x = state.arcWidth / 2, y = state.arcHeight / 2;else if (target === "radar") {
|
26610 | var _$$$getRadarSize = $$.getRadarSize(),
|
26611 | width = _$$$getRadarSize[0];
|
26612 |
|
26613 | x = state.width / 2 - width, y = asHalfPixel(state.margin.top);
|
26614 | }
|
26615 | return "translate(" + x + ", " + y + ")";
|
26616 | },
|
26617 | transformMain: function transformMain(withTransition, transitions) {
|
26618 | var xAxis,
|
26619 | yAxis,
|
26620 | y2Axis,
|
26621 | $$ = this,
|
26622 | main = $$.$el.main;
|
26623 | transitions && transitions.axisX ? xAxis = transitions.axisX : (xAxis = main.select("." + config_classes.axisX), withTransition && (xAxis = xAxis.transition())), transitions && transitions.axisY ? yAxis = transitions.axisY : (yAxis = main.select("." + config_classes.axisY), withTransition && (yAxis = yAxis.transition())), transitions && transitions.axisY2 ? y2Axis = transitions.axisY2 : (y2Axis = main.select("." + config_classes.axisY2), withTransition && (y2Axis = y2Axis.transition())), (withTransition ? main.transition() : main).attr("transform", $$.getTranslate("main")), xAxis.attr("transform", $$.getTranslate("x")), yAxis.attr("transform", $$.getTranslate("y")), y2Axis.attr("transform", $$.getTranslate("y2")), main.select("." + config_classes.chartArcs).attr("transform", $$.getTranslate("arc"));
|
26624 | },
|
26625 | transformAll: function transformAll(withTransition, transitions) {
|
26626 | var $$ = this,
|
26627 | config = $$.config,
|
26628 | hasAxis = $$.state.hasAxis,
|
26629 | $el = $$.$el;
|
26630 | $$.transformMain(withTransition, transitions), hasAxis && config.subchart_show && $$.transformContext(withTransition, transitions), $el.legend && $$.transformLegend(withTransition);
|
26631 | }
|
26632 | });
|
26633 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/type.ts
|
26634 | /**
|
26635 | * Copyright (c) 2017 ~ present NAVER Corp.
|
26636 | * billboard.js project is licensed under the MIT license
|
26637 | */
|
26638 |
|
26639 |
|
26640 | /* harmony default export */ var internals_type = ({
|
26641 | setTargetType: function setTargetType(targetIds, type) {
|
26642 | var $$ = this,
|
26643 | config = $$.config,
|
26644 | withoutFadeIn = $$.state.withoutFadeIn;
|
26645 | $$.mapToTargetIds(targetIds).forEach(function (id) {
|
26646 | withoutFadeIn[id] = type === config.data_types[id], config.data_types[id] = type;
|
26647 | }), targetIds || (config.data_type = type);
|
26648 | },
|
26649 |
|
26650 | /**
|
26651 | * Updte current used chart types
|
26652 | * @private
|
26653 | */
|
26654 | updateTypesElements: function updateTypesElements() {
|
26655 | var $$ = this,
|
26656 | current = $$.state.current;
|
26657 | // Update current chart elements reference
|
26658 | Object.keys(TYPE).forEach(function (v) {
|
26659 | var t = TYPE[v],
|
26660 | has = $$.hasType(t, null, !0),
|
26661 | idx = current.types.indexOf(t);
|
26662 | idx === -1 && has ? current.types.push(t) : idx > -1 && !has && current.types.splice(idx, 1);
|
26663 | }), $$.setChartElements();
|
26664 | },
|
26665 |
|
26666 | /**
|
26667 | * Check if given chart types exists
|
26668 | * @param {string} type Chart type
|
26669 | * @param {Array} targetsValue Data array
|
26670 | * @param {boolean} checkFromData Force to check type cotains from data targets
|
26671 | * @returns {boolean}
|
26672 | * @private
|
26673 | */
|
26674 | hasType: function hasType(type, targetsValue, checkFromData) {
|
26675 | checkFromData === void 0 && (checkFromData = !1);
|
26676 | var $$ = this,
|
26677 | config = $$.config,
|
26678 | current = $$.state.current,
|
26679 | types = config.data_types,
|
26680 | targets = targetsValue || $$.data.targets,
|
26681 | has = !1;
|
26682 | return !checkFromData && current.types.length && current.types.indexOf(type) > -1 ? has = !0 : targets && targets.length ? targets.forEach(function (target) {
|
26683 | var t = types[target.id];
|
26684 | t !== type && (t || type !== "line") || (has = !0);
|
26685 | }) : Object.keys(types).length ? Object.keys(types).forEach(function (id) {
|
26686 | types[id] === type && (has = !0);
|
26687 | }) : has = config.data_type === type, has;
|
26688 | },
|
26689 |
|
26690 | /**
|
26691 | * Check if contains given chart types
|
26692 | * @param {string} type Type key
|
26693 | * @param {object} targets Target data
|
26694 | * @param {Array} exclude Excluded types
|
26695 | * @returns {boolean}
|
26696 | * @private
|
26697 | */
|
26698 | hasTypeOf: function hasTypeOf(type, targets, exclude) {
|
26699 | var _this = this;
|
26700 |
|
26701 | return exclude === void 0 && (exclude = []), !!(type in TYPE_BY_CATEGORY) && !TYPE_BY_CATEGORY[type].filter(function (v) {
|
26702 | return exclude.indexOf(v) === -1;
|
26703 | }).every(function (v) {
|
26704 | return !_this.hasType(v, targets);
|
26705 | });
|
26706 | },
|
26707 |
|
26708 | /**
|
26709 | * Check if given data is certain chart type
|
26710 | * @param {object} d Data object
|
26711 | * @param {string|Array} type chart type
|
26712 | * @returns {boolean}
|
26713 | * @private
|
26714 | */
|
26715 | isTypeOf: function isTypeOf(d, type) {
|
26716 | var id = isString(d) ? d : d.id,
|
26717 | dataType = this.config.data_types[id] || this.config.data_type;
|
26718 | return isArray(type) ? type.indexOf(dataType) >= 0 : dataType === type;
|
26719 | },
|
26720 | hasPointType: function hasPointType() {
|
26721 | var $$ = this;
|
26722 | return $$.hasTypeOf("Line") || $$.hasType("bubble") || $$.hasType("scatter");
|
26723 | },
|
26724 |
|
26725 | /**
|
26726 | * Check if contains arc types chart
|
26727 | * @param {object} targets Target data
|
26728 | * @param {Array} exclude Excluded types
|
26729 | * @returns {boolean}
|
26730 | * @private
|
26731 | */
|
26732 | hasArcType: function hasArcType(targets, exclude) {
|
26733 | return this.hasTypeOf("Arc", targets, exclude);
|
26734 | },
|
26735 | hasMultiArcGauge: function hasMultiArcGauge() {
|
26736 | return this.hasType("gauge") && this.config.gauge_type === "multi";
|
26737 | },
|
26738 | isLineType: function isLineType(d) {
|
26739 | var id = isString(d) ? d : d.id;
|
26740 | return !this.config.data_types[id] || this.isTypeOf(id, TYPE_BY_CATEGORY.Line);
|
26741 | },
|
26742 | isStepType: function isStepType(d) {
|
26743 | return this.isTypeOf(d, TYPE_BY_CATEGORY.Step);
|
26744 | },
|
26745 | isSplineType: function isSplineType(d) {
|
26746 | return this.isTypeOf(d, TYPE_BY_CATEGORY.Spline);
|
26747 | },
|
26748 | isAreaType: function isAreaType(d) {
|
26749 | return this.isTypeOf(d, TYPE_BY_CATEGORY.Area);
|
26750 | },
|
26751 | isAreaRangeType: function isAreaRangeType(d) {
|
26752 | return this.isTypeOf(d, TYPE_BY_CATEGORY.AreaRange);
|
26753 | },
|
26754 | isBarType: function isBarType(d) {
|
26755 | return this.isTypeOf(d, "bar");
|
26756 | },
|
26757 | isBubbleType: function isBubbleType(d) {
|
26758 | return this.isTypeOf(d, "bubble");
|
26759 | },
|
26760 | isCandlestickType: function isCandlestickType(d) {
|
26761 | return this.isTypeOf(d, "candlestick");
|
26762 | },
|
26763 | isScatterType: function isScatterType(d) {
|
26764 | return this.isTypeOf(d, "scatter");
|
26765 | },
|
26766 | isPieType: function isPieType(d) {
|
26767 | return this.isTypeOf(d, "pie");
|
26768 | },
|
26769 | isGaugeType: function isGaugeType(d) {
|
26770 | return this.isTypeOf(d, "gauge");
|
26771 | },
|
26772 | isDonutType: function isDonutType(d) {
|
26773 | return this.isTypeOf(d, "donut");
|
26774 | },
|
26775 | isRadarType: function isRadarType(d) {
|
26776 | return this.isTypeOf(d, "radar");
|
26777 | },
|
26778 | isArcType: function isArcType(d) {
|
26779 | return this.isPieType(d) || this.isDonutType(d) || this.isGaugeType(d) || this.isRadarType(d);
|
26780 | },
|
26781 | // determine if is 'circle' data point
|
26782 | isCirclePoint: function isCirclePoint(node) {
|
26783 | var config = this.config,
|
26784 | pattern = config.point_pattern,
|
26785 | isCircle = !1;
|
26786 | return isCircle = !!(node && node.tagName === "circle") || config.point_type === "circle" && (!pattern || isArray(pattern) && pattern.length === 0), isCircle;
|
26787 | },
|
26788 | lineData: function lineData(d) {
|
26789 | return this.isLineType(d) ? [d] : [];
|
26790 | },
|
26791 | arcData: function arcData(d) {
|
26792 | return this.isArcType(d.data) ? [d] : [];
|
26793 | },
|
26794 |
|
26795 | /**
|
26796 | * Get data adapt for data label showing
|
26797 | * @param {object} d Data object
|
26798 | * @returns {Array}
|
26799 | * @private
|
26800 | */
|
26801 | labelishData: function labelishData(d) {
|
26802 | return this.isBarType(d) || this.isLineType(d) || this.isScatterType(d) || this.isBubbleType(d) || this.isCandlestickType(d) || this.isRadarType(d) ? d.values.filter(function (v) {
|
26803 | return isNumber(v.value) || !!v.value;
|
26804 | }) : [];
|
26805 | },
|
26806 | barLineBubbleData: function barLineBubbleData(d) {
|
26807 | return this.isBarType(d) || this.isLineType(d) || this.isBubbleType(d) ? d.values : [];
|
26808 | },
|
26809 | // https://github.com/d3/d3-shape#curves
|
26810 | isInterpolationType: function isInterpolationType(type) {
|
26811 | return ["basis", "basis-closed", "basis-open", "bundle", "cardinal", "cardinal-closed", "cardinal-open", "catmull-rom", "catmull-rom-closed", "catmull-rom-open", "linear", "linear-closed", "monotone-x", "monotone-y", "natural"].indexOf(type) >= 0;
|
26812 | }
|
26813 | });
|
26814 | ;// CONCATENATED MODULE: ./src/ChartInternal/ChartInternal.ts
|
26815 | /**
|
26816 | * Copyright (c) 2017 ~ present NAVER Corp.
|
26817 | * billboard.js project is licensed under the MIT license
|
26818 | * @ignore
|
26819 | */
|
26820 |
|
26821 |
|
26822 |
|
26823 |
|
26824 |
|
26825 |
|
26826 |
|
26827 |
|
26828 | // data
|
26829 |
|
26830 |
|
26831 |
|
26832 | // interactions
|
26833 |
|
26834 | // internals
|
26835 |
|
26836 |
|
26837 | // used to retrieve radar Axis name
|
26838 |
|
26839 |
|
26840 |
|
26841 |
|
26842 |
|
26843 |
|
26844 |
|
26845 |
|
26846 |
|
26847 |
|
26848 |
|
26849 |
|
26850 |
|
26851 |
|
26852 | /**
|
26853 | * Internal chart class.
|
26854 | * - Note: Instantiated internally, not exposed for public.
|
26855 | * @class ChartInternal
|
26856 | * @ignore
|
26857 | * @private
|
26858 | */
|
26859 |
|
26860 | var ChartInternal = /*#__PURE__*/function () {
|
26861 | // API interface
|
26862 | // config object
|
26863 | // cache instance
|
26864 | // elements
|
26865 | // state variables
|
26866 | // all Chart instances array within page (equivalent of 'bb.instances')
|
26867 | // data object
|
26868 | // Axis
|
26869 | // Axis
|
26870 | // scales
|
26871 | // original values
|
26872 | // formatter function
|
26873 | // format function
|
26874 | function ChartInternal(api) {
|
26875 | this.api = void 0, this.config = void 0, this.cache = void 0, this.$el = void 0, this.state = void 0, this.charts = void 0, this.data = {
|
26876 | xs: {},
|
26877 | targets: []
|
26878 | }, this.axis = void 0, this.scale = {
|
26879 | x: null,
|
26880 | y: null,
|
26881 | y2: null,
|
26882 | subX: null,
|
26883 | subY: null,
|
26884 | subY2: null,
|
26885 | zoom: null
|
26886 | }, this.org = {
|
26887 | xScale: null,
|
26888 | xDomain: null
|
26889 | }, this.color = void 0, this.patterns = void 0, this.levelColor = void 0, this.point = void 0, this.brush = void 0, this.format = {
|
26890 | extraLineClasses: null,
|
26891 | xAxisTick: null,
|
26892 | dataTime: null,
|
26893 | // dataTimeFormat
|
26894 | defaultAxisTime: null,
|
26895 | // defaultAxisTimeFormat
|
26896 | axisTime: null // axisTimeFormat
|
26897 |
|
26898 | };
|
26899 | var $$ = this;
|
26900 | $$.api = api, $$.config = new Options(), $$.cache = new Cache();
|
26901 | var store = new Store();
|
26902 | $$.$el = store.getStore("element"), $$.state = store.getStore("state");
|
26903 | }
|
26904 |
|
26905 | var _proto = ChartInternal.prototype;
|
26906 | return _proto.beforeInit = function beforeInit() {
|
26907 | var $$ = this;
|
26908 | $$.callPluginHook("$beforeInit"), callFn($$.config.onbeforeinit, $$.api);
|
26909 | }, _proto.afterInit = function afterInit() {
|
26910 | var $$ = this;
|
26911 | $$.callPluginHook("$afterInit"), callFn($$.config.onafterinit, $$.api);
|
26912 | }, _proto.init = function init() {
|
26913 | var $$ = this,
|
26914 | config = $$.config,
|
26915 | state = $$.state,
|
26916 | $el = $$.$el;
|
26917 | state.hasAxis = !$$.hasArcType(), state.hasRadar = !state.hasAxis && $$.hasType("radar"), $$.initParams();
|
26918 | var bindto = {
|
26919 | element: config.bindto,
|
26920 | classname: "bb"
|
26921 | };
|
26922 | isObject(config.bindto) && (bindto.element = config.bindto.element || "#chart", bindto.classname = config.bindto.classname || bindto.classname), $el.chart = isFunction(bindto.element.node) ? config.bindto.element : src_select(bindto.element || []), $el.chart.empty() && ($el.chart = src_select(browser_doc.body.appendChild(browser_doc.createElement("div")))), $el.chart.html("").classed(bindto.classname, !0), $$.initToRender();
|
26923 | }
|
26924 | /**
|
26925 | * Initialize the rendering process
|
26926 | * @param {boolean} forced Force to render process
|
26927 | * @private
|
26928 | */
|
26929 | , _proto.initToRender = function initToRender(forced) {
|
26930 | var $$ = this,
|
26931 | config = $$.config,
|
26932 | state = $$.state,
|
26933 | chart = $$.$el.chart,
|
26934 | isHidden = function () {
|
26935 | return chart.style("display") === "none" || chart.style("visibility") === "hidden";
|
26936 | },
|
26937 | isLazy = config.render.lazy || isHidden(),
|
26938 | MutationObserver = win.MutationObserver;
|
26939 |
|
26940 | if (isLazy && MutationObserver && config.render.observe !== !1 && !forced && new MutationObserver(function (mutation, observer) {
|
26941 | isHidden() || (observer.disconnect(), !state.rendered && $$.initToRender(!0));
|
26942 | }).observe(chart.node(), {
|
26943 | attributes: !0,
|
26944 | attributeFilter: ["class", "style"]
|
26945 | }), !isLazy || forced) {
|
26946 | var convertedData = $$.convertData(config, $$.initWithData);
|
26947 | convertedData && $$.initWithData(convertedData), $$.afterInit();
|
26948 | }
|
26949 | }, _proto.initParams = function initParams() {
|
26950 | var $$ = this,
|
26951 | _ref = $$,
|
26952 | config = _ref.config,
|
26953 | format = _ref.format,
|
26954 | state = _ref.state,
|
26955 | isRotated = config.axis_rotated;
|
26956 |
|
26957 | if (state.datetimeId = "bb-" + +new Date(), $$.color = $$.generateColor(), $$.levelColor = $$.generateLevelColor(), $$.hasPointType() && ($$.point = $$.generatePoint()), state.hasAxis) {
|
26958 | $$.initClip(), format.extraLineClasses = $$.generateExtraLineClass(), format.dataTime = config.data_xLocaltime ? timeParse : utcParse, format.axisTime = config.axis_x_localtime ? timeFormat : utcFormat;
|
26959 | var isDragZoom = $$.config.zoom_enabled && $$.config.zoom_type === "drag";
|
26960 |
|
26961 | format.defaultAxisTime = function (d) {
|
26962 | var _$$$scale = $$.scale,
|
26963 | x = _$$$scale.x,
|
26964 | zoom = _$$$scale.zoom,
|
26965 | isZoomed = isDragZoom ? zoom : zoom && x.orgDomain().toString() !== zoom.domain().toString(),
|
26966 | specifier = d.getMilliseconds() && ".%L" || d.getSeconds() && ".:%S" || d.getMinutes() && "%I:%M" || d.getHours() && "%I %p" || d.getDate() !== 1 && "%b %d" || isZoomed && d.getDate() === 1 && "%b\'%y" || d.getMonth() && "%-m/%-d" || "%Y";
|
26967 | return format.axisTime(specifier)(d);
|
26968 | };
|
26969 | }
|
26970 |
|
26971 | state.isLegendRight = config.legend_position === "right", state.isLegendInset = config.legend_position === "inset", state.isLegendTop = config.legend_inset_anchor === "top-left" || config.legend_inset_anchor === "top-right", state.isLegendLeft = config.legend_inset_anchor === "top-left" || config.legend_inset_anchor === "bottom-left", state.rotatedPaddingRight = isRotated && !config.axis_x_show ? 0 : 30, state.inputType = convertInputType(config.interaction_inputType_mouse, config.interaction_inputType_touch);
|
26972 | }, _proto.initWithData = function initWithData(data) {
|
26973 | var $$ = this,
|
26974 | config = $$.config,
|
26975 | scale = $$.scale,
|
26976 | state = $$.state,
|
26977 | $el = $$.$el,
|
26978 | org = $$.org,
|
26979 | hasAxis = state.hasAxis,
|
26980 | hasInteraction = config.interaction_enabled;
|
26981 | hasAxis && ($$.axis = $$.getAxisInstance(), config.zoom_enabled && $$.initZoom()), $$.data.xs = {}, $$.data.targets = $$.convertDataToTargets(data), config.data_filter && ($$.data.targets = $$.data.targets.filter(config.data_filter.bind($$.api))), config.data_hide && $$.addHiddenTargetIds(config.data_hide === !0 ? $$.mapToIds($$.data.targets) : config.data_hide), config.legend_hide && $$.addHiddenLegendIds(config.legend_hide === !0 ? $$.mapToIds($$.data.targets) : config.legend_hide), $$.updateSizes(), $$.updateScales(!0);
|
26982 | // retrieve scale after the 'updateScales()' is called
|
26983 | var x = scale.x,
|
26984 | y = scale.y,
|
26985 | y2 = scale.y2,
|
26986 | subX = scale.subX,
|
26987 | subY = scale.subY,
|
26988 | subY2 = scale.subY2; // Set domains for each scale
|
26989 |
|
26990 | if (x && (x.domain(sortValue($$.getXDomain($$.data.targets))), subX.domain(x.domain()), org.xDomain = x.domain()), y && (y.domain($$.getYDomain($$.data.targets, "y")), subY.domain(y.domain())), y2 && (y2.domain($$.getYDomain($$.data.targets, "y2")), subY2 && subY2.domain(y2.domain())), $el.svg = $el.chart.append("svg").style("overflow", "hidden").style("display", "block"), hasInteraction && state.inputType) {
|
26991 | var isTouch = state.inputType === "touch";
|
26992 | $el.svg.on(isTouch ? "touchstart" : "mouseenter", function () {
|
26993 | return callFn(config.onover, $$.api);
|
26994 | }).on(isTouch ? "touchend" : "mouseleave", function () {
|
26995 | return callFn(config.onout, $$.api);
|
26996 | });
|
26997 | }
|
26998 |
|
26999 | config.svg_classname && $el.svg.attr("class", config.svg_classname);
|
27000 | // Define defs
|
27001 | var hasColorPatterns = isFunction(config.color_tiles) && $$.patterns;
|
27002 | (hasAxis || hasColorPatterns) && ($el.defs = $el.svg.append("defs"), hasAxis && ["id", "idXAxis", "idYAxis", "idGrid"].forEach(function (v) {
|
27003 | $$.appendClip($el.defs, state.clip[v]);
|
27004 | }), hasColorPatterns && $$.patterns.forEach(function (p) {
|
27005 | return $el.defs.append(function () {
|
27006 | return p.node;
|
27007 | });
|
27008 | })), $$.updateSvgSize(), $$.bindResize();
|
27009 | // Define regions
|
27010 | var main = $el.svg.append("g").classed(config_classes.main, !0).attr("transform", $$.getTranslate("main"));
|
27011 |
|
27012 | // data.onmin/max callback
|
27013 | if ($el.main = main, config.subchart_show && $$.initSubchart(), config.tooltip_show && $$.initTooltip(), config.title_text && $$.initTitle(), config.legend_show && $$.initLegend(), config.data_empty_label_text && main.append("text").attr("class", config_classes.text + " " + config_classes.empty).attr("text-anchor", "middle") // horizontal centering of text at x position in all browsers.
|
27014 | .attr("dominant-baseline", "middle"), hasAxis && (config.regions.length && $$.initRegion(), !config.clipPath && $$.axis.init()), main.append("g").attr("class", config_classes.chart).attr("clip-path", state.clip.path), $$.callPluginHook("$init"), hasAxis && (hasInteraction && $$.initEventRect && $$.initEventRect(), $$.initGrid(), config.clipPath && $$.axis && $$.axis.init()), $$.initChartElements(), $$.updateTargets($$.data.targets), $$.updateDimension(), callFn(config.oninit, $$.api), $$.setBackground(), $$.redraw({
|
27015 | withTransition: !1,
|
27016 | withTransform: !0,
|
27017 | withUpdateXDomain: !0,
|
27018 | withUpdateOrgXDomain: !0,
|
27019 | withTransitionForAxis: !1,
|
27020 | initializing: !0
|
27021 | }), config.data_onmin || config.data_onmax) {
|
27022 | var minMax = $$.getMinMaxData();
|
27023 | callFn(config.data_onmin, $$.api, minMax.min), callFn(config.data_onmax, $$.api, minMax.max);
|
27024 | }
|
27025 |
|
27026 | config.tooltip_show && $$.initShowTooltip(), state.rendered = !0;
|
27027 | }, _proto.initChartElements = function initChartElements() {
|
27028 | var $$ = this,
|
27029 | _$$$state = $$.state,
|
27030 | hasAxis = _$$$state.hasAxis,
|
27031 | hasRadar = _$$$state.hasRadar,
|
27032 | types = [];
|
27033 | hasAxis ? ["bar", "bubble", "candlestick", "line"].forEach(function (v) {
|
27034 | var name = capitalize(v);
|
27035 | (v === "line" && $$.hasTypeOf(name) || $$.hasType(v)) && types.push(name);
|
27036 | }) : (!hasRadar && types.push("Arc", "Pie"), $$.hasType("gauge") ? types.push("Gauge") : hasRadar && types.push("Radar")), types.forEach(function (v) {
|
27037 | $$["init" + v]();
|
27038 | }), notEmpty($$.config.data_labels) && !$$.hasArcType(null, ["radar"]) && $$.initText();
|
27039 | }, _proto.setChartElements = function setChartElements() {
|
27040 | var $$ = this,
|
27041 | _$$$$el = $$.$el,
|
27042 | chart = _$$$$el.chart,
|
27043 | svg = _$$$$el.svg,
|
27044 | defs = _$$$$el.defs,
|
27045 | main = _$$$$el.main,
|
27046 | tooltip = _$$$$el.tooltip,
|
27047 | legend = _$$$$el.legend,
|
27048 | title = _$$$$el.title,
|
27049 | grid = _$$$$el.grid,
|
27050 | arc = _$$$$el.arcs,
|
27051 | circles = _$$$$el.circle,
|
27052 | bars = _$$$$el.bar,
|
27053 | candlestick = _$$$$el.candlestick,
|
27054 | lines = _$$$$el.line,
|
27055 | areas = _$$$$el.area,
|
27056 | texts = _$$$$el.text;
|
27057 | $$.api.$ = {
|
27058 | chart: chart,
|
27059 | svg: svg,
|
27060 | defs: defs,
|
27061 | main: main,
|
27062 | tooltip: tooltip,
|
27063 | legend: legend,
|
27064 | title: title,
|
27065 | grid: grid,
|
27066 | arc: arc,
|
27067 | circles: circles,
|
27068 | bar: {
|
27069 | bars: bars
|
27070 | },
|
27071 | candlestick: candlestick,
|
27072 | line: {
|
27073 | lines: lines,
|
27074 | areas: areas
|
27075 | },
|
27076 | text: {
|
27077 | texts: texts
|
27078 | }
|
27079 | };
|
27080 | }
|
27081 | /**
|
27082 | * Set background element/image
|
27083 | * @private
|
27084 | */
|
27085 | , _proto.setBackground = function setBackground() {
|
27086 | var $$ = this,
|
27087 | bg = $$.config.background,
|
27088 | state = $$.state,
|
27089 | svg = $$.$el.svg;
|
27090 |
|
27091 | if (notEmpty(bg)) {
|
27092 | var element = svg.select("g").insert(bg.imgUrl ? "image" : "rect", ":first-child");
|
27093 | bg.imgUrl ? element.attr("href", bg.imgUrl) : bg.color && element.style("fill", bg.color).attr("clip-path", state.clip.path), element.attr("class", bg.class || null).attr("width", "100%").attr("height", "100%");
|
27094 | }
|
27095 | }
|
27096 | /**
|
27097 | * Update targeted element with given data
|
27098 | * @param {object} targets Data object formatted as 'target'
|
27099 | * @private
|
27100 | */
|
27101 | , _proto.updateTargets = function updateTargets(targets) {
|
27102 | var $$ = this,
|
27103 | _$$$state2 = $$.state,
|
27104 | hasAxis = _$$$state2.hasAxis,
|
27105 | hasRadar = _$$$state2.hasRadar;
|
27106 | $$.updateTargetsForText(targets), hasAxis ? (["bar", "candlestick", "line"].forEach(function (v) {
|
27107 | var name = capitalize(v);
|
27108 | (v === "line" && $$.hasTypeOf(name) || $$.hasType(v)) && $$["updateTargetsFor" + name](targets.filter($$["is" + name + "Type"].bind($$)));
|
27109 | }), $$.updateTargetsForSubchart && $$.updateTargetsForSubchart(targets)) : $$.hasArcType(targets) && (hasRadar ? $$.updateTargetsForRadar(targets.filter($$.isRadarType.bind($$))) : $$.updateTargetsForArc(targets.filter($$.isArcType.bind($$)))), ($$.hasType("bubble") || $$.hasType("scatter")) && $$.updateTargetForCircle && $$.updateTargetForCircle(), $$.showTargets();
|
27110 | }
|
27111 | /**
|
27112 | * Display targeted elements
|
27113 | * @private
|
27114 | */
|
27115 | , _proto.showTargets = function showTargets() {
|
27116 | var $$ = this,
|
27117 | config = $$.config,
|
27118 | svg = $$.$el.svg;
|
27119 | svg.selectAll("." + config_classes.target).filter(function (d) {
|
27120 | return $$.isTargetToShow(d.id);
|
27121 | }).transition().duration(config.transition_duration).style("opacity", "1");
|
27122 | }, _proto.getWithOption = function getWithOption(options) {
|
27123 | var withOptions = {
|
27124 | Y: !0,
|
27125 | Subchart: !0,
|
27126 | Transition: !0,
|
27127 | EventRect: !0,
|
27128 | Dimension: !0,
|
27129 | TrimXDomain: !0,
|
27130 | Transform: !1,
|
27131 | UpdateXDomain: !1,
|
27132 | UpdateOrgXDomain: !1,
|
27133 | Legend: !1,
|
27134 | UpdateXAxis: "UpdateXDomain",
|
27135 | TransitionForExit: "Transition",
|
27136 | TransitionForAxis: "Transition"
|
27137 | };
|
27138 | return Object.keys(withOptions).forEach(function (key) {
|
27139 | var defVal = withOptions[key];
|
27140 | isString(defVal) && (defVal = withOptions[defVal]), withOptions[key] = getOption(options, "with" + key, defVal);
|
27141 | }), withOptions;
|
27142 | }, _proto.initialOpacity = function initialOpacity(d) {
|
27143 | var $$ = this,
|
27144 | withoutFadeIn = $$.state.withoutFadeIn;
|
27145 | return $$.getBaseValue(d) !== null && withoutFadeIn[d.id] ? "1" : "0";
|
27146 | }, _proto.bindResize = function bindResize() {
|
27147 | var $$ = this,
|
27148 | config = $$.config,
|
27149 | state = $$.state,
|
27150 | resizeFunction = generateResize(),
|
27151 | list = [];
|
27152 | list.push(function () {
|
27153 | return callFn(config.onresize, $$, $$.api);
|
27154 | }), config.resize_auto && list.push(function () {
|
27155 | state.resizing = !0, $$.api.flush(!1);
|
27156 | }), list.push(function () {
|
27157 | callFn(config.onresized, $$, $$.api), state.resizing = !1;
|
27158 | }), list.forEach(function (v) {
|
27159 | return resizeFunction.add(v);
|
27160 | }), $$.resizeFunction = resizeFunction, win.addEventListener("resize", $$.resizeFunction = resizeFunction);
|
27161 | }
|
27162 | /**
|
27163 | * Call plugin hook
|
27164 | * @param {string} phase The lifecycle phase
|
27165 | * @param {Array} args Arguments
|
27166 | * @private
|
27167 | */
|
27168 | , _proto.callPluginHook = function callPluginHook(phase) {
|
27169 | for (var _this = this, _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) args[_key - 1] = arguments[_key];
|
27170 |
|
27171 | this.config.plugins.forEach(function (v) {
|
27172 | phase === "$beforeInit" && (v.$$ = _this, _this.api.plugins.push(v)), v[phase].apply(v, args);
|
27173 | });
|
27174 | }, ChartInternal;
|
27175 | }();
|
27176 |
|
27177 |
|
27178 | util_extend(ChartInternal.prototype, [// common
|
27179 | convert, ChartInternal_data_data, load, category, internals_class, internals_color, domain, interactions_interaction, format, internals_legend, redraw, scale, shape, internals_size, internals_text, internals_title, internals_tooltip, transform, internals_type]);
|
27180 | ;// CONCATENATED MODULE: ./src/config/config.ts
|
27181 | /**
|
27182 | * Copyright (c) 2017 ~ present NAVER Corp.
|
27183 | * billboard.js project is licensed under the MIT license
|
27184 | */
|
27185 |
|
27186 |
|
27187 | /**
|
27188 | * Load configuration option
|
27189 | * @param {object} config User's generation config value
|
27190 | * @private
|
27191 | */
|
27192 | function loadConfig(config) {
|
27193 | var target,
|
27194 | keys,
|
27195 | read,
|
27196 | thisConfig = this.config,
|
27197 | find = function () {
|
27198 | var key = keys.shift();
|
27199 | return key && target && isObjectType(target) && key in target ? (target = target[key], find()) : key ? undefined : target;
|
27200 | };
|
27201 |
|
27202 | Object.keys(thisConfig).forEach(function (key) {
|
27203 | target = config, keys = key.split("_"), read = find(), isDefined(read) && (thisConfig[key] = read);
|
27204 | });
|
27205 | }
|
27206 | ;// CONCATENATED MODULE: ./src/Chart/api/chart.ts
|
27207 | /**
|
27208 | * Copyright (c) 2017 ~ present NAVER Corp.
|
27209 | * billboard.js project is licensed under the MIT license
|
27210 | */
|
27211 |
|
27212 |
|
27213 | /* harmony default export */ var chart = ({
|
27214 | /**
|
27215 | * Resize the chart.
|
27216 | * @function resize
|
27217 | * @instance
|
27218 | * @memberof Chart
|
27219 | * @param {object} size This argument should include width and height in pixels.
|
27220 | * @param {number} [size.width] width value
|
27221 | * @param {number} [size.height] height value
|
27222 | * @example
|
27223 | * // Resize to 640x480
|
27224 | * chart.resize({
|
27225 | * width: 640,
|
27226 | * height: 480
|
27227 | * });
|
27228 | */
|
27229 | resize: function resize(size) {
|
27230 | var $$ = this.internal,
|
27231 | config = $$.config,
|
27232 | state = $$.state;
|
27233 | state.rendered && (config.size_width = size ? size.width : null, config.size_height = size ? size.height : null, state.resizing = !0, this.flush(!1, !0), $$.resizeFunction());
|
27234 | },
|
27235 |
|
27236 | /**
|
27237 | * Force to redraw.
|
27238 | * - **NOTE:** When zoom/subchart is used, the zoomed state will be resetted.
|
27239 | * @function flush
|
27240 | * @instance
|
27241 | * @memberof Chart
|
27242 | * @param {boolean} [soft] For soft redraw.
|
27243 | * @example
|
27244 | * chart.flush();
|
27245 | *
|
27246 | * // for soft redraw
|
27247 | * chart.flush(true);
|
27248 | */
|
27249 | flush: function flush(soft) {
|
27250 | var $$ = this.internal,
|
27251 | state = $$.state;
|
27252 | state.rendered ? (state.resizing ? $$.brush && $$.brush.updateResize() : $$.axis && $$.axis.setOrient(), $$.scale.zoom = null, soft ? $$.redraw({
|
27253 | withTransform: !0,
|
27254 | withUpdateXDomain: !0,
|
27255 | withUpdateOrgXDomain: !0,
|
27256 | withLegend: !0
|
27257 | }) : $$.updateAndRedraw({
|
27258 | withLegend: !0,
|
27259 | withTransition: !1,
|
27260 | withTransitionForTransform: !1
|
27261 | }), !state.resizing && $$.brush && ($$.brush.getSelection().call($$.brush.move), $$.unselectRect())) : $$.initToRender(!0);
|
27262 | },
|
27263 |
|
27264 | /**
|
27265 | * Reset the chart object and remove element and events completely.
|
27266 | * @function destroy
|
27267 | * @instance
|
27268 | * @memberof Chart
|
27269 | * @returns {null}
|
27270 | * @example
|
27271 | * chart.destroy();
|
27272 | */
|
27273 | destroy: function destroy() {
|
27274 | var _this = this,
|
27275 | $$ = this.internal,
|
27276 | _$$$$el = $$.$el,
|
27277 | chart = _$$$$el.chart,
|
27278 | svg = _$$$$el.svg;
|
27279 |
|
27280 | if (notEmpty($$)) // release prototype chains
|
27281 | for (var _key in $$.callPluginHook("$willDestroy"), $$.charts.splice($$.charts.indexOf(this), 1), svg.select("*").interrupt(), $$.resizeFunction.clear(), win.removeEventListener("resize", $$.resizeFunction), chart.classed("bb", !1).html(""), Object.keys(this).forEach(function (key) {
|
27282 | key === "internal" && Object.keys($$).forEach(function (k) {
|
27283 | $$[k] = null;
|
27284 | }), _this[key] = null, delete _this[key];
|
27285 | }), this) this[_key] = function () {};
|
27286 | return null;
|
27287 | },
|
27288 |
|
27289 | /**
|
27290 | * Get or set single config option value.
|
27291 | * @function config
|
27292 | * @instance
|
27293 | * @memberof Chart
|
27294 | * @param {string} name The option key name.
|
27295 | * @param {*} [value] The value accepted for indicated option.
|
27296 | * @param {boolean} [redraw] Set to redraw with the new option changes.
|
27297 | * - **NOTE:** Doesn't guarantee work in all circumstances. It can be applied for limited options only.
|
27298 | * @returns {*}
|
27299 | * @example
|
27300 | * // Getter
|
27301 | * chart.config("gauge.max");
|
27302 | *
|
27303 | * // Setter
|
27304 | * chart.config("gauge.max", 100);
|
27305 | *
|
27306 | * // Setter & redraw with the new option
|
27307 | * chart.config("gauge.max", 100, true);
|
27308 | */
|
27309 | config: function (name, value, redraw) {
|
27310 | var res,
|
27311 | $$ = this.internal,
|
27312 | config = $$.config,
|
27313 | key = name && name.replace(/\./g, "_");
|
27314 | return key in config && (isDefined(value) ? (config[key] = value, res = value, redraw && this.flush()) : res = config[key]), res;
|
27315 | }
|
27316 | });
|
27317 | ;// CONCATENATED MODULE: ./src/Chart/api/color.ts
|
27318 | /**
|
27319 | * Copyright (c) 2017 ~ present NAVER Corp.
|
27320 | * billboard.js project is licensed under the MIT license
|
27321 | */
|
27322 | /* harmony default export */ var api_color = ({
|
27323 | /**
|
27324 | * Get the color
|
27325 | * @function color
|
27326 | * @instance
|
27327 | * @memberof Chart
|
27328 | * @param {string} id id to get the color
|
27329 | * @returns {string}
|
27330 | * @example
|
27331 | * chart.color("data1");
|
27332 | */
|
27333 | color: function color(id) {
|
27334 | return this.internal.color(id); // more patterns
|
27335 | }
|
27336 | });
|
27337 | ;// CONCATENATED MODULE: ./src/Chart/api/data.ts
|
27338 | /**
|
27339 | * Copyright (c) 2017 ~ present NAVER Corp.
|
27340 | * billboard.js project is licensed under the MIT license
|
27341 | */
|
27342 |
|
27343 |
|
27344 | /**
|
27345 | * Get data loaded in the chart.
|
27346 | * @function data
|
27347 | * @instance
|
27348 | * @memberof Chart
|
27349 | * @param {string|Array} targetIds If this argument is given, this API returns the specified target data. If this argument is not given, all of data will be returned.
|
27350 | * @returns {Array} Data objects
|
27351 | * @example
|
27352 | * // Get only data1 data
|
27353 | * chart.data("data1");
|
27354 | * // --> [{id: "data1", id_org: "data1", values: Array(6)}, ...]
|
27355 | *
|
27356 | * // Get data1 and data2 data
|
27357 | * chart.data(["data1", "data2"]);
|
27358 | *
|
27359 | * // Get all data
|
27360 | * chart.data();
|
27361 | */
|
27362 | function api_data_data(targetIds) {
|
27363 | var targets = this.internal.data.targets;
|
27364 |
|
27365 | if (!isUndefined(targetIds)) {
|
27366 | var ids = isArray(targetIds) ? targetIds : [targetIds];
|
27367 | return targets.filter(function (t) {
|
27368 | return ids.some(function (v) {
|
27369 | return v === t.id;
|
27370 | });
|
27371 | });
|
27372 | }
|
27373 |
|
27374 | return targets;
|
27375 | }
|
27376 |
|
27377 | util_extend(api_data_data, {
|
27378 | /**
|
27379 | * Get data shown in the chart.
|
27380 | * @function data․shown
|
27381 | * @instance
|
27382 | * @memberof Chart
|
27383 | * @param {string|Array} targetIds If this argument is given, this API filters the data with specified target ids. If this argument is not given, all shown data will be returned.
|
27384 | * @returns {Array} Data objects
|
27385 | * @example
|
27386 | * // Get shown data by filtering to include only data1 data
|
27387 | * chart.data.shown("data1");
|
27388 | * // --> [{id: "data1", id_org: "data1", values: Array(6)}, ...]
|
27389 | *
|
27390 | * // Get shown data by filtering to include data1 and data2 data
|
27391 | * chart.data.shown(["data1", "data2"]);
|
27392 | *
|
27393 | * // Get all shown data
|
27394 | * chart.data.shown();
|
27395 | */
|
27396 | shown: function shown(targetIds) {
|
27397 | return this.internal.filterTargetsToShow(this.data(targetIds));
|
27398 | },
|
27399 |
|
27400 | /**
|
27401 | * Get values of the data loaded in the chart.
|
27402 | * @function data․values
|
27403 | * @instance
|
27404 | * @memberof Chart
|
27405 | * @param {string|Array|null} targetIds This API returns the values of specified target. If this argument is not given, null will be retruned
|
27406 | * @param {boolean} [flat=true] Get flatten values
|
27407 | * @returns {Array} Data values
|
27408 | * @example
|
27409 | * // Get data1 values
|
27410 | * chart.data.values("data1");
|
27411 | * // --> [10, 20, 30, 40]
|
27412 | */
|
27413 | values: function (targetIds, flat) {
|
27414 | flat === void 0 && (flat = !0);
|
27415 | var values = null;
|
27416 |
|
27417 | if (targetIds) {
|
27418 | var targets = this.data(targetIds);
|
27419 | targets && isArray(targets) && (values = [], targets.forEach(function (v) {
|
27420 | var dataValue = v.values.map(function (d) {
|
27421 | return d.value;
|
27422 | });
|
27423 | flat ? values = values.concat(dataValue) : values.push(dataValue);
|
27424 | }));
|
27425 | }
|
27426 |
|
27427 | return values;
|
27428 | },
|
27429 |
|
27430 | /**
|
27431 | * Get and set names of the data loaded in the chart.
|
27432 | * @function data․names
|
27433 | * @instance
|
27434 | * @memberof Chart
|
27435 | * @param {object} names If this argument is given, the names of data will be updated. If not given, the current names will be returned. The format of this argument is the same as
|
27436 | * @returns {object} Corresponding names according its key value, if specified names values.
|
27437 | * @example
|
27438 | * // Get current names
|
27439 | * chart.data.names();
|
27440 | * // --> {data1: "test1", data2: "test2"}
|
27441 | *
|
27442 | * // Update names
|
27443 | * chart.data.names({
|
27444 | * data1: "New Name 1",
|
27445 | * data2: "New Name 2"
|
27446 | *});
|
27447 | */
|
27448 | names: function names(_names) {
|
27449 | var $$ = this.internal;
|
27450 | return $$.updateDataAttributes("names", _names);
|
27451 | },
|
27452 |
|
27453 | /**
|
27454 | * Get and set colors of the data loaded in the chart.
|
27455 | * @function data․colors
|
27456 | * @instance
|
27457 | * @memberof Chart
|
27458 | * @param {object} colors If this argument is given, the colors of data will be updated. If not given, the current colors will be returned. The format of this argument is the same as [data.colors](./Options.html#.data%25E2%2580%25A4colors).
|
27459 | * @returns {object} Corresponding data color value according its key value.
|
27460 | * @example
|
27461 | * // Get current colors
|
27462 | * chart.data.colors();
|
27463 | * // --> {data1: "#00c73c", data2: "#fa7171"}
|
27464 | *
|
27465 | * // Update colors
|
27466 | * chart.data.colors({
|
27467 | * data1: "#FFFFFF",
|
27468 | * data2: "#000000"
|
27469 | * });
|
27470 | */
|
27471 | colors: function colors(_colors) {
|
27472 | return this.internal.updateDataAttributes("colors", _colors);
|
27473 | },
|
27474 |
|
27475 | /**
|
27476 | * Get and set axes of the data loaded in the chart.
|
27477 | * - **NOTE:** If all data is related to one of the axes, the domain of axis without related data will be replaced by the domain from the axis with related data
|
27478 | * @function data․axes
|
27479 | * @instance
|
27480 | * @memberof Chart
|
27481 | * @param {object} axes If this argument is given, the axes of data will be updated. If not given, the current axes will be returned. The format of this argument is the same as
|
27482 | * @returns {object} Corresponding axes value for data, if specified axes value.
|
27483 | * @example
|
27484 | * // Get current axes
|
27485 | * chart.data.axes();
|
27486 | * // --> {data1: "y"}
|
27487 | *
|
27488 | * // Update axes
|
27489 | * chart.data.axes({
|
27490 | * data1: "y",
|
27491 | * data2: "y2"
|
27492 | * });
|
27493 | */
|
27494 | axes: function axes(_axes) {
|
27495 | return this.internal.updateDataAttributes("axes", _axes);
|
27496 | },
|
27497 |
|
27498 | /**
|
27499 | * Get the minimum data value bound to the chart
|
27500 | * @function data․min
|
27501 | * @instance
|
27502 | * @memberof Chart
|
27503 | * @returns {Array} Data objects
|
27504 | * @example
|
27505 | * // Get current axes
|
27506 | * chart.data.min();
|
27507 | * // --> [{x: 0, value: 30, id: "data1", index: 0}, ...]
|
27508 | */
|
27509 | min: function min() {
|
27510 | return this.internal.getMinMaxData().min;
|
27511 | },
|
27512 |
|
27513 | /**
|
27514 | * Get the maximum data value bound to the chart
|
27515 | * @function data․max
|
27516 | * @instance
|
27517 | * @memberof Chart
|
27518 | * @returns {Array} Data objects
|
27519 | * @example
|
27520 | * // Get current axes
|
27521 | * chart.data.max();
|
27522 | * // --> [{x: 3, value: 400, id: "data1", index: 3}, ...]
|
27523 | */
|
27524 | max: function max() {
|
27525 | return this.internal.getMinMaxData().max;
|
27526 | }
|
27527 | });
|
27528 | /* harmony default export */ var api_data = ({
|
27529 | data: api_data_data
|
27530 | });
|
27531 | ;// CONCATENATED MODULE: ./src/Chart/api/export.ts
|
27532 | /**
|
27533 | * Copyright (c) 2017 ~ present NAVER Corp.
|
27534 | * billboard.js project is licensed under the MIT license
|
27535 | */
|
27536 |
|
27537 |
|
27538 |
|
27539 |
|
27540 | /**
|
27541 | * Encode to base64
|
27542 | * @param {string} str string to be encoded
|
27543 | * @returns {string}
|
27544 | * @private
|
27545 | * @see https://developer.mozilla.org/ko/docs/Web/API/WindowBase64/Base64_encoding_and_decoding
|
27546 | */
|
27547 | var b64EncodeUnicode = function (str) {
|
27548 | return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function (match, p) {
|
27549 | return String.fromCharCode(+("0x" + p));
|
27550 | }));
|
27551 | };
|
27552 | /**
|
27553 | * Convert svg node to data url
|
27554 | * @param {HTMLElement} node target node
|
27555 | * @param {object} option object containing {width, height, preserveAspectRatio}
|
27556 | * @param {object} orgSize object containing {width, height}
|
27557 | * @returns {string}
|
27558 | * @private
|
27559 | */
|
27560 |
|
27561 |
|
27562 | function nodeToSvgDataUrl(node, option, orgSize) {
|
27563 | var _ref = option || orgSize,
|
27564 | width = _ref.width,
|
27565 | height = _ref.height,
|
27566 | serializer = new XMLSerializer(),
|
27567 | clone = node.cloneNode(!0),
|
27568 | cssText = getCssRules(toArray(browser_doc.styleSheets)).filter(function (r) {
|
27569 | return r.cssText;
|
27570 | }).map(function (r) {
|
27571 | return r.cssText;
|
27572 | });
|
27573 |
|
27574 | clone.setAttribute("xmlns", namespaces.xhtml);
|
27575 | var nodeXml = serializer.serializeToString(clone),
|
27576 | style = browser_doc.createElement("style"); // escape css for XML
|
27577 |
|
27578 | style.appendChild(browser_doc.createTextNode(cssText.join("\n")));
|
27579 | var styleXml = serializer.serializeToString(style),
|
27580 | dataStr = ("<svg xmlns=\"" + namespaces.svg + "\" width=\"" + width + "\" height=\"" + height + "\" \n\t\tviewBox=\"0 0 " + orgSize.width + " " + orgSize.height + "\" \n\t\tpreserveAspectRatio=\"" + (option && option.preserveAspectRatio === !1 ? "none" : "xMinYMid meet") + "\">\n\t\t\t<foreignObject width=\"100%\" height=\"100%\">\n\t\t\t\t" + styleXml + "\n\t\t\t\t" + nodeXml.replace(/(url\()[^#]+/g, "$1") + "\n\t\t\t</foreignObject></svg>").replace("/\n/g", "%0A"); // foreignObject not supported in IE11 and below
|
27581 | // https://msdn.microsoft.com/en-us/library/hh834675(v=vs.85).aspx
|
27582 |
|
27583 | return "data:image/svg+xml;base64," + b64EncodeUnicode(dataStr);
|
27584 | }
|
27585 |
|
27586 | /* harmony default export */ var api_export = ({
|
27587 | /**
|
27588 | * Export chart as an image.
|
27589 | * - **NOTE:**
|
27590 | * - IE11 and below not work properly due to the lack of the feature(<a href="https://msdn.microsoft.com/en-us/library/hh834675(v=vs.85).aspx">foreignObject</a>) support
|
27591 | * - The basic CSS file(ex. billboard.css) should be at same domain as API call context to get correct styled export image.
|
27592 | * @function export
|
27593 | * @instance
|
27594 | * @memberof Chart
|
27595 | * @param {object} option Export option
|
27596 | * @param {string} [option.mimeType="image/png"] The desired output image format. (ex. 'image/png' for png, 'image/jpeg' for jpeg format)
|
27597 | * @param {number} [option.width={currentWidth}] width
|
27598 | * @param {number} [option.height={currentHeigth}] height
|
27599 | * @param {boolean} [option.preserveAspectRatio=true] Preserve aspect ratio on given size
|
27600 | * @param {Function} [callback] The callback to be invoked when export is ready.
|
27601 | * @returns {string} dataURI
|
27602 | * @example
|
27603 | * chart.export();
|
27604 | * // --> "data:image/svg+xml;base64,PHN..."
|
27605 | *
|
27606 | * // Initialize the download automatically
|
27607 | * chart.export({mimeType: "image/png"}, dataUrl => {
|
27608 | * const link = document.createElement("a");
|
27609 | *
|
27610 | * link.download = `${Date.now()}.png`;
|
27611 | * link.href = dataUrl;
|
27612 | * link.innerHTML = "Download chart as image";
|
27613 | *
|
27614 | * document.body.appendChild(link);
|
27615 | * });
|
27616 | *
|
27617 | * // Resize the exported image
|
27618 | * chart.export(
|
27619 | * {
|
27620 | * width: 800,
|
27621 | * height: 600,
|
27622 | * preserveAspectRatio: false,
|
27623 | * mimeType: "image/png"
|
27624 | * },
|
27625 | * dataUrl => { ... }
|
27626 | * );
|
27627 | */
|
27628 | export: function _export(option, callback) {
|
27629 | var _this = this,
|
27630 | $$ = this.internal,
|
27631 | state = $$.state,
|
27632 | chart = $$.$el.chart,
|
27633 | _state$current = state.current,
|
27634 | width = _state$current.width,
|
27635 | height = _state$current.height,
|
27636 | opt = mergeObj({
|
27637 | width: width,
|
27638 | height: height,
|
27639 | preserveAspectRatio: !0,
|
27640 | mimeType: "image/png"
|
27641 | }, option),
|
27642 | svgDataUrl = nodeToSvgDataUrl(chart.node(), opt, {
|
27643 | width: width,
|
27644 | height: height
|
27645 | });
|
27646 |
|
27647 | if (callback && isFunction(callback)) {
|
27648 | var img = new Image();
|
27649 | img.crossOrigin = "Anonymous", img.onload = function () {
|
27650 | var canvas = browser_doc.createElement("canvas"),
|
27651 | ctx = canvas.getContext("2d");
|
27652 | canvas.width = opt.width || width, canvas.height = opt.height || height, ctx.drawImage(img, 0, 0), callback.bind(_this)(canvas.toDataURL(opt.mimeType));
|
27653 | }, img.src = svgDataUrl;
|
27654 | }
|
27655 |
|
27656 | return svgDataUrl;
|
27657 | }
|
27658 | });
|
27659 | ;// CONCATENATED MODULE: ./src/Chart/api/focus.ts
|
27660 | /**
|
27661 | * Copyright (c) 2017 ~ present NAVER Corp.
|
27662 | * billboard.js project is licensed under the MIT license
|
27663 | */
|
27664 |
|
27665 |
|
27666 | /* harmony default export */ var api_focus = ({
|
27667 | /**
|
27668 | * This API highlights specified targets and fade out the others.<br><br>
|
27669 | * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be highlighted.
|
27670 | * @function focus
|
27671 | * @instance
|
27672 | * @memberof Chart
|
27673 | * @param {string|Array} targetIdsValue Target ids to be highlighted.
|
27674 | * @example
|
27675 | * // data1 will be highlighted and the others will be faded out
|
27676 | * chart.focus("data1");
|
27677 | *
|
27678 | * // data1 and data2 will be highlighted and the others will be faded out
|
27679 | * chart.focus(["data1", "data2"]);
|
27680 | *
|
27681 | * // all targets will be highlighted
|
27682 | * chart.focus();
|
27683 | */
|
27684 | focus: function focus(targetIdsValue) {
|
27685 | var $$ = this.internal,
|
27686 | state = $$.state,
|
27687 | targetIds = $$.mapToTargetIds(targetIdsValue),
|
27688 | candidates = $$.$el.svg.selectAll($$.selectorTargets(targetIds.filter($$.isTargetToShow, $$)));
|
27689 | this.revert(), this.defocus(), candidates.classed(config_classes.focused, !0).classed(config_classes.defocused, !1), $$.hasArcType() && !state.hasRadar && ($$.expandArc(targetIds), $$.hasType("gauge") && $$.markOverlapped(targetIdsValue, $$, "." + config_classes.gaugeValue)), $$.toggleFocusLegend(targetIds, !0), state.focusedTargetIds = targetIds, state.defocusedTargetIds = state.defocusedTargetIds.filter(function (id) {
|
27690 | return targetIds.indexOf(id) < 0;
|
27691 | });
|
27692 | },
|
27693 |
|
27694 | /**
|
27695 | * This API fades out specified targets and reverts the others.<br><br>
|
27696 | * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be faded out.
|
27697 | * @function defocus
|
27698 | * @instance
|
27699 | * @memberof Chart
|
27700 | * @param {string|Array} targetIdsValue Target ids to be faded out.
|
27701 | * @example
|
27702 | * // data1 will be faded out and the others will be reverted.
|
27703 | * chart.defocus("data1");
|
27704 | *
|
27705 | * // data1 and data2 will be faded out and the others will be reverted.
|
27706 | * chart.defocus(["data1", "data2"]);
|
27707 | *
|
27708 | * // all targets will be faded out.
|
27709 | * chart.defocus();
|
27710 | */
|
27711 | defocus: function defocus(targetIdsValue) {
|
27712 | var $$ = this.internal,
|
27713 | state = $$.state,
|
27714 | targetIds = $$.mapToTargetIds(targetIdsValue),
|
27715 | candidates = $$.$el.svg.selectAll($$.selectorTargets(targetIds.filter($$.isTargetToShow, $$)));
|
27716 | candidates.classed(config_classes.focused, !1).classed(config_classes.defocused, !0), $$.hasArcType() && ($$.unexpandArc(targetIds), $$.hasType("gauge") && $$.undoMarkOverlapped($$, "." + config_classes.gaugeValue)), $$.toggleFocusLegend(targetIds, !1), state.focusedTargetIds = state.focusedTargetIds.filter(function (id) {
|
27717 | return targetIds.indexOf(id) < 0;
|
27718 | }), state.defocusedTargetIds = targetIds;
|
27719 | },
|
27720 |
|
27721 | /**
|
27722 | * This API reverts specified targets.<br><br>
|
27723 | * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be reverted.
|
27724 | * @function revert
|
27725 | * @instance
|
27726 | * @memberof Chart
|
27727 | * @param {string|Array} targetIdsValue Target ids to be reverted
|
27728 | * @example
|
27729 | * // data1 will be reverted.
|
27730 | * chart.revert("data1");
|
27731 | *
|
27732 | * // data1 and data2 will be reverted.
|
27733 | * chart.revert(["data1", "data2"]);
|
27734 | *
|
27735 | * // all targets will be reverted.
|
27736 | * chart.revert();
|
27737 | */
|
27738 | revert: function revert(targetIdsValue) {
|
27739 | var $$ = this.internal,
|
27740 | config = $$.config,
|
27741 | state = $$.state,
|
27742 | $el = $$.$el,
|
27743 | targetIds = $$.mapToTargetIds(targetIdsValue),
|
27744 | candidates = $el.svg.selectAll($$.selectorTargets(targetIds));
|
27745 | // should be for all targets
|
27746 | candidates.classed(config_classes.focused, !1).classed(config_classes.defocused, !1), $$.hasArcType() && $$.unexpandArc(targetIds), config.legend_show && ($$.showLegend(targetIds.filter($$.isLegendToShow.bind($$))), $el.legend.selectAll($$.selectorLegends(targetIds)).filter(function () {
|
27747 | return src_select(this).classed(config_classes.legendItemFocused);
|
27748 | }).classed(config_classes.legendItemFocused, !1)), state.focusedTargetIds = [], state.defocusedTargetIds = [];
|
27749 | }
|
27750 | });
|
27751 | ;// CONCATENATED MODULE: ./src/Chart/api/legend.ts
|
27752 | /**
|
27753 | * Copyright (c) 2017 ~ present NAVER Corp.
|
27754 | * billboard.js project is licensed under the MIT license
|
27755 | */
|
27756 |
|
27757 | /**
|
27758 | * Define legend
|
27759 | * @ignore
|
27760 | */
|
27761 | var legend_legend = {
|
27762 | /**
|
27763 | * Show legend for each target.
|
27764 | * @function legend․show
|
27765 | * @instance
|
27766 | * @memberof Chart
|
27767 | * @param {string|Array} targetIds
|
27768 | * - If targetIds is given, specified target's legend will be shown.
|
27769 | * - If only one target is the candidate, String can be passed.
|
27770 | * - If no argument is given, all of target's legend will be shown.
|
27771 | * @example
|
27772 | * // Show legend for data1.
|
27773 | * chart.legend.show("data1");
|
27774 | *
|
27775 | * // Show legend for data1 and data2.
|
27776 | * chart.legend.show(["data1", "data2"]);
|
27777 | *
|
27778 | * // Show all legend.
|
27779 | * chart.legend.show();
|
27780 | */
|
27781 | show: function show(targetIds) {
|
27782 | var $$ = this.internal;
|
27783 | $$.showLegend($$.mapToTargetIds(targetIds)), $$.updateAndRedraw({
|
27784 | withLegend: !0
|
27785 | });
|
27786 | },
|
27787 |
|
27788 | /**
|
27789 | * Hide legend for each target.
|
27790 | * @function legend․hide
|
27791 | * @instance
|
27792 | * @memberof Chart
|
27793 | * @param {string|Array} targetIds
|
27794 | * - If targetIds is given, specified target's legend will be hidden.
|
27795 | * - If only one target is the candidate, String can be passed.
|
27796 | * - If no argument is given, all of target's legend will be hidden.
|
27797 | * @example
|
27798 | * // Hide legend for data1.
|
27799 | * chart.legend.hide("data1");
|
27800 | *
|
27801 | * // Hide legend for data1 and data2.
|
27802 | * chart.legend.hide(["data1", "data2"]);
|
27803 | *
|
27804 | * // Hide all legend.
|
27805 | * chart.legend.hide();
|
27806 | */
|
27807 | hide: function hide(targetIds) {
|
27808 | var $$ = this.internal;
|
27809 | $$.hideLegend($$.mapToTargetIds(targetIds)), $$.updateAndRedraw({
|
27810 | withLegend: !0
|
27811 | });
|
27812 | }
|
27813 | };
|
27814 | /* harmony default export */ var api_legend = ({
|
27815 | legend: legend_legend
|
27816 | });
|
27817 | ;// CONCATENATED MODULE: ./src/Chart/api/load.ts
|
27818 | /**
|
27819 | * Copyright (c) 2017 ~ present NAVER Corp.
|
27820 | * billboard.js project is licensed under the MIT license
|
27821 | */
|
27822 |
|
27823 | /* harmony default export */ var api_load = ({
|
27824 | /**
|
27825 | * Load data to the chart.<br><br>
|
27826 | * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be toggles.
|
27827 | * - <b>Note:</b>
|
27828 | * - unload should be used if some data needs to be unloaded simultaneously.
|
27829 | * If you call unload API soon after/before load instead of unload param, chart will not be rendered properly because of cancel of animation.<br>
|
27830 | * - done will be called after data loaded, but it's not after rendering.
|
27831 | * It's because rendering will finish after some transition and there is some time lag between loading and rendering
|
27832 | * @function load
|
27833 | * @instance
|
27834 | * @memberof Chart
|
27835 | * @param {object} args The object can consist with following members:<br>
|
27836 | *
|
27837 | * | Key | Description |
|
27838 | * | --- | --- |
|
27839 | * | - url<br>- json<br>- rows<br>- columns | The data will be loaded. If data that has the same target id is given, the chart will be updated. Otherwise, new target will be added |
|
27840 | * | data | Data objects to be loaded. Checkout the example. |
|
27841 | * | names | Same as data.names() |
|
27842 | * | xs | Same as data.xs option |
|
27843 | * | classes | The classes specified by data.classes will be updated. classes must be Object that has target id as keys. |
|
27844 | * | categories | The categories specified by axis.x.categories or data.x will be updated. categories must be Array. |
|
27845 | * | axes | The axes specified by data.axes will be updated. axes must be Object that has target id as keys. |
|
27846 | * | colors | The colors specified by data.colors will be updated. colors must be Object that has target id as keys. |
|
27847 | * | headers | Set request header if loading via `data.url`.<br>@see [data․headers](Options.html#.data%25E2%2580%25A4headers) |
|
27848 | * | keys | Choose which JSON objects keys correspond to desired data.<br>**NOTE:** Only for JSON object given as array.<br>@see [data․keys](Options.html#.data%25E2%2580%25A4keys) |
|
27849 | * | mimeType | Set 'json' if loading JSON via url.<br>@see [data․mimeType](Options.html#.data%25E2%2580%25A4mimeType) |
|
27850 | * | - type<br>- types | The type of targets will be updated. type must be String and types must be Object. |
|
27851 | * | unload | Specify the data will be unloaded before loading new data. If true given, all of data will be unloaded. If target ids given as String or Array, specified targets will be unloaded. If absent or false given, unload will not occur. |
|
27852 | * | done | The specified function will be called after data loaded.|
|
27853 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Data.DataFromURL)
|
27854 | * @example
|
27855 | * // Load data1 and unload data2 and data3
|
27856 | * chart.load({
|
27857 | * columns: [
|
27858 | * ["data1", 100, 200, 150, ...],
|
27859 | * ...
|
27860 | * ],
|
27861 | * unload: ["data2", "data3"],
|
27862 | * url: "...",
|
27863 | * done: function() { ... }
|
27864 | * });
|
27865 | * @example
|
27866 | * // myAPI.json
|
27867 | * // {
|
27868 | * // "data1": [220, 240, 270, 250, 280],
|
27869 | * // "data2": [180, 150, 300, 70, 120]
|
27870 | * // }
|
27871 | *
|
27872 | * chart.load({
|
27873 | * url: './data/myAPI.json',
|
27874 | * mimeType: "json",
|
27875 | *
|
27876 | * // set request header if is needed
|
27877 | * headers: {
|
27878 | * "Content-Type": "text/json"
|
27879 | * }
|
27880 | * });
|
27881 | * @example
|
27882 | * chart.load({
|
27883 | * data: [
|
27884 | * // equivalent as: columns: [["data1", 30, 200, 100]]
|
27885 | * {"data1": 30}, {"data1": 200}, {"data1": 100}
|
27886 | *
|
27887 | * // or
|
27888 | * // equivalent as: columns: [["data1", 10, 20], ["data2", 13, 30]]
|
27889 | * // {"data1": 10, "data2": 13}, {"data1": 20, "data2": 30}}
|
27890 | * ]
|
27891 | * });
|
27892 | * @example
|
27893 | * chart.load({
|
27894 | * json: [
|
27895 | * {name: "www.site1.com", upload: 800, download: 500, total: 400},
|
27896 | * ],
|
27897 | * keys: {
|
27898 | * x: "name",
|
27899 | * value: ["upload", "download"]
|
27900 | * }
|
27901 | * });
|
27902 | */
|
27903 | load: function load(args) {
|
27904 | var $$ = this.internal,
|
27905 | config = $$.config;
|
27906 | // update xs if specified
|
27907 | // update names if exists
|
27908 | // update classes if exists
|
27909 | // update axes if exists
|
27910 | // update colors if exists
|
27911 | args.xs && $$.addXs(args.xs), "names" in args && this.data.names(args.names), "classes" in args && Object.keys(args.classes).forEach(function (id) {
|
27912 | config.data_classes[id] = args.classes[id];
|
27913 | }), "categories" in args && $$.axis.isCategorized() && (config.axis_x_categories = args.categories), "axes" in args && Object.keys(args.axes).forEach(function (id) {
|
27914 | config.data_axes[id] = args.axes[id];
|
27915 | }), "colors" in args && Object.keys(args.colors).forEach(function (id) {
|
27916 | config.data_colors[id] = args.colors[id];
|
27917 | }), "unload" in args && args.unload !== !1 ? $$.unload($$.mapToTargetIds(args.unload === !0 ? null : args.unload), function () {
|
27918 | return $$.loadFromArgs(args);
|
27919 | }) : $$.loadFromArgs(args);
|
27920 | },
|
27921 |
|
27922 | /**
|
27923 | * Unload data to the chart.<br><br>
|
27924 | * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be toggles.
|
27925 | * - <b>Note:</b>
|
27926 | * If you call load API soon after/before unload, unload param of load should be used. Otherwise chart will not be rendered properly because of cancel of animation.<br>
|
27927 | * `done` will be called after data loaded, but it's not after rendering. It's because rendering will finish after some transition and there is some time lag between loading and rendering.
|
27928 | * @function unload
|
27929 | * @instance
|
27930 | * @memberof Chart
|
27931 | * @param {object} argsValue
|
27932 | * | key | Type | Description |
|
27933 | * | --- | --- | --- |
|
27934 | * | ids | String | Array | Target id data to be unloaded. If not given, all data will be unloaded. |
|
27935 | * | done | Fuction | Callback after data is unloaded. |
|
27936 | * @example
|
27937 | * // Unload data2 and data3
|
27938 | * chart.unload({
|
27939 | * ids: ["data2", "data3"],
|
27940 | * done: function() {
|
27941 | * // called after the unloaded
|
27942 | * }
|
27943 | * });
|
27944 | */
|
27945 | unload: function unload(argsValue) {
|
27946 | var _this = this,
|
27947 | $$ = this.internal,
|
27948 | args = argsValue || {};
|
27949 |
|
27950 | isArray(args) ? args = {
|
27951 | ids: args
|
27952 | } : isString(args) && (args = {
|
27953 | ids: [args]
|
27954 | });
|
27955 | var ids = $$.mapToTargetIds(args.ids);
|
27956 | $$.unload(ids, function () {
|
27957 | $$.redraw({
|
27958 | withUpdateOrgXDomain: !0,
|
27959 | withUpdateXDomain: !0,
|
27960 | withLegend: !0
|
27961 | }), $$.cache.remove(ids), args.done && args.done.call(_this);
|
27962 | });
|
27963 | }
|
27964 | });
|
27965 | ;// CONCATENATED MODULE: ./src/Chart/api/show.ts
|
27966 | /**
|
27967 | * Copyright (c) 2017 ~ present NAVER Corp.
|
27968 | * billboard.js project is licensed under the MIT license
|
27969 | */
|
27970 |
|
27971 | /**
|
27972 | * Show/Hide data series
|
27973 | * @param {boolean} show Show or hide
|
27974 | * @param {Array} targetIdsValue Target id values
|
27975 | * @param {object} options Options
|
27976 | * @private
|
27977 | */
|
27978 |
|
27979 | function showHide(show, targetIdsValue, options) {
|
27980 | var $$ = this.internal,
|
27981 | targetIds = $$.mapToTargetIds(targetIdsValue);
|
27982 | $$.state.toggling = !0, $$[(show ? "remove" : "add") + "HiddenTargetIds"](targetIds);
|
27983 | var targets = $$.$el.svg.selectAll($$.selectorTargets(targetIds)),
|
27984 | opacity = show ? "1" : "0";
|
27985 | show && targets.style("display", null), targets.transition().style("opacity", opacity, "important").call(endall, function () {
|
27986 | // https://github.com/naver/billboard.js/issues/1758
|
27987 | show || targets.style("display", "none"), targets.style("opacity", opacity);
|
27988 | }), options.withLegend && $$[(show ? "show" : "hide") + "Legend"](targetIds), $$.redraw({
|
27989 | withUpdateOrgXDomain: !0,
|
27990 | withUpdateXDomain: !0,
|
27991 | withLegend: !0
|
27992 | }), $$.state.toggling = !1;
|
27993 | }
|
27994 |
|
27995 | /* harmony default export */ var show = ({
|
27996 | /**
|
27997 | * Show data series on chart
|
27998 | * @function show
|
27999 | * @instance
|
28000 | * @memberof Chart
|
28001 | * @param {string|Array} [targetIdsValue] The target id value.
|
28002 | * @param {object} [options] The object can consist with following members:<br>
|
28003 | *
|
28004 | * | Key | Type | default | Description |
|
28005 | * | --- | --- | --- | --- |
|
28006 | * | withLegend | boolean | false | whether or not display legend |
|
28007 | *
|
28008 | * @example
|
28009 | * // show 'data1'
|
28010 | * chart.show("data1");
|
28011 | *
|
28012 | * // show 'data1' and 'data3'
|
28013 | * chart.show(["data1", "data3"]);
|
28014 | */
|
28015 | show: function show(targetIdsValue, options) {
|
28016 | options === void 0 && (options = {}), showHide.call(this, !0, targetIdsValue, options);
|
28017 | },
|
28018 |
|
28019 | /**
|
28020 | * Hide data series from chart
|
28021 | * @function hide
|
28022 | * @instance
|
28023 | * @memberof Chart
|
28024 | * @param {string|Array} [targetIdsValue] The target id value.
|
28025 | * @param {object} [options] The object can consist with following members:<br>
|
28026 | *
|
28027 | * | Key | Type | default | Description |
|
28028 | * | --- | --- | --- | --- |
|
28029 | * | withLegend | boolean | false | whether or not display legend |
|
28030 | *
|
28031 | * @example
|
28032 | * // hide 'data1'
|
28033 | * chart.hide("data1");
|
28034 | *
|
28035 | * // hide 'data1' and 'data3'
|
28036 | * chart.hide(["data1", "data3"]);
|
28037 | */
|
28038 | hide: function hide(targetIdsValue, options) {
|
28039 | options === void 0 && (options = {}), showHide.call(this, !1, targetIdsValue, options);
|
28040 | },
|
28041 |
|
28042 | /**
|
28043 | * Toggle data series on chart. When target data is hidden, it will show. If is shown, it will hide in vice versa.
|
28044 | * @function toggle
|
28045 | * @instance
|
28046 | * @memberof Chart
|
28047 | * @param {string|Array} [targetIds] The target id value.
|
28048 | * @param {object} [options] The object can consist with following members:<br>
|
28049 | *
|
28050 | * | Key | Type | default | Description |
|
28051 | * | --- | --- | --- | --- |
|
28052 | * | withLegend | boolean | false | whether or not display legend |
|
28053 | *
|
28054 | * @example
|
28055 | * // toggle 'data1'
|
28056 | * chart.toggle("data1");
|
28057 | *
|
28058 | * // toggle 'data1' and 'data3'
|
28059 | * chart.toggle(["data1", "data3"]);
|
28060 | */
|
28061 | toggle: function toggle(targetIds, options) {
|
28062 | var _this = this;
|
28063 |
|
28064 | options === void 0 && (options = {});
|
28065 | var $$ = this.internal,
|
28066 | targets = {
|
28067 | show: [],
|
28068 | hide: []
|
28069 | };
|
28070 | // sort show & hide target ids
|
28071 | // perform show & hide task separately
|
28072 | // https://github.com/naver/billboard.js/issues/454
|
28073 | $$.mapToTargetIds(targetIds).forEach(function (id) {
|
28074 | return targets[$$.isTargetToShow(id) ? "hide" : "show"].push(id);
|
28075 | }), targets.show.length && this.show(targets.show, options), targets.hide.length && setTimeout(function () {
|
28076 | return _this.hide(targets.hide, options);
|
28077 | }, 0);
|
28078 | }
|
28079 | });
|
28080 | ;// CONCATENATED MODULE: ./src/Chart/api/tooltip.ts
|
28081 | /**
|
28082 | * Copyright (c) 2017 ~ present NAVER Corp.
|
28083 | * billboard.js project is licensed under the MIT license
|
28084 | */
|
28085 |
|
28086 | /**
|
28087 | * Define tooltip
|
28088 | * @ignore
|
28089 | */
|
28090 |
|
28091 | var tooltip_tooltip = {
|
28092 | /**
|
28093 | * Show tooltip
|
28094 | * @function tooltip․show
|
28095 | * @instance
|
28096 | * @memberof Chart
|
28097 | * @param {object} args The object can consist with following members:<br>
|
28098 | *
|
28099 | * | Key | Type | Description |
|
28100 | * | --- | --- | --- |
|
28101 | * | index | Number | Determine focus by index |
|
28102 | * | x | Number | Date | Determine focus by x Axis index |
|
28103 | * | mouse | Array | Determine x and y coordinate value relative the targeted '.bb-event-rect' x Axis.<br>It should be used along with `data`, `index` or `x` value. The default value is set as `[0,0]` |
|
28104 | * | data | Object | When [data.xs](Options.html#.data%25E2%2580%25A4xs) option is used or [tooltip.grouped](Options.html#.tooltip) set to 'false', `should be used giving this param`.<br><br>**Key:**<br>- x {number | Date}: x Axis value<br>- index {number}: x Axis index (useless for data.xs)<br>- id {string}: data id<br>- value {number}: The corresponding value for tooltip. |
|
28105 | *
|
28106 | * @example
|
28107 | * // show the 2nd x Axis coordinate tooltip
|
28108 | * // for Arc(gauge, donut & pie) and radar type, approch showing tooltip by using "index" number.
|
28109 | * chart.tooltip.show({
|
28110 | * index: 1
|
28111 | * });
|
28112 | *
|
28113 | * // show tooltip for the 3rd x Axis in x:50 and y:100 coordinate of '.bb-event-rect' of the x Axis.
|
28114 | * chart.tooltip.show({
|
28115 | * x: 2,
|
28116 | * mouse: [50, 100]
|
28117 | * });
|
28118 | *
|
28119 | * // show tooltip for timeseries x axis
|
28120 | * chart.tooltip.show({
|
28121 | * x: new Date("2018-01-02 00:00")
|
28122 | * });
|
28123 | *
|
28124 | * // when data.xs is used
|
28125 | * chart.tooltip.show({
|
28126 | * data: {
|
28127 | * x: 3, // x Axis value
|
28128 | * id: "data1", // data id
|
28129 | * value: 500 // data value
|
28130 | * }
|
28131 | * });
|
28132 | *
|
28133 | * // when data.xs isn't used, but tooltip.grouped=false is set
|
28134 | * chart.tooltip.show({
|
28135 | * data: {
|
28136 | * index: 3, // or 'x' key value
|
28137 | * id: "data1", // data id
|
28138 | * value: 500 // data value
|
28139 | * }
|
28140 | * });
|
28141 | */
|
28142 | show: function show(args) {
|
28143 | var index,
|
28144 | mouse,
|
28145 | $$ = this.internal,
|
28146 | config = $$.config,
|
28147 | inputType = $$.state.inputType;
|
28148 |
|
28149 | // determine focus data
|
28150 | if (args.mouse && (mouse = args.mouse), args.data) {
|
28151 | var data = args.data,
|
28152 | y = $$.getYScaleById(data.id)(data.value);
|
28153 | $$.isMultipleX() ? mouse = [$$.scale.x(data.x), y] : (!config.tooltip_grouped && (mouse = [0, y]), index = isValue(data.index) ? data.index : $$.getIndexByX(data.x));
|
28154 | } else isDefined(args.x) ? index = $$.getIndexByX(args.x) : isDefined(args.index) && (index = args.index);
|
28155 |
|
28156 | (inputType === "mouse" ? ["mouseover", "mousemove"] : ["touchstart"]).forEach(function (eventName) {
|
28157 | $$.dispatchEvent(eventName, index, mouse);
|
28158 | });
|
28159 | },
|
28160 |
|
28161 | /**
|
28162 | * Hide tooltip
|
28163 | * @function tooltip․hide
|
28164 | * @instance
|
28165 | * @memberof Chart
|
28166 | */
|
28167 | hide: function hide() {
|
28168 | var $$ = this.internal,
|
28169 | inputType = $$.state.inputType,
|
28170 | tooltip = $$.$el.tooltip,
|
28171 | data = tooltip && tooltip.datum();
|
28172 |
|
28173 | if (data) {
|
28174 | var index = JSON.parse(data.current)[0].index; // make to finalize, possible pending event flow set from '.tooltip.show()' call
|
28175 |
|
28176 | (inputType === "mouse" ? ["mouseout"] : ["touchend"]).forEach(function (eventName) {
|
28177 | $$.dispatchEvent(eventName, index);
|
28178 | });
|
28179 | } // reset last touch point index
|
28180 |
|
28181 |
|
28182 | inputType === "touch" && $$.callOverOutForTouch(), $$.hideTooltip(!0), $$.hideGridFocus(), $$.unexpandCircles && $$.unexpandCircles(), $$.unexpandBars && $$.unexpandBars();
|
28183 | }
|
28184 | };
|
28185 | /* harmony default export */ var api_tooltip = ({
|
28186 | tooltip: tooltip_tooltip
|
28187 | });
|
28188 | ;// CONCATENATED MODULE: ./src/Chart/Chart.ts
|
28189 | /**
|
28190 | * Copyright (c) 2017 ~ present NAVER Corp.
|
28191 | * billboard.js project is licensed under the MIT license
|
28192 | */
|
28193 |
|
28194 |
|
28195 |
|
28196 |
|
28197 |
|
28198 |
|
28199 |
|
28200 |
|
28201 |
|
28202 |
|
28203 |
|
28204 |
|
28205 | /**
|
28206 | * Main chart class.
|
28207 | * - Note: Instantiated via `bb.generate()`.
|
28208 | * @class Chart
|
28209 | * @example
|
28210 | * var chart = bb.generate({
|
28211 | * data: {
|
28212 | * columns: [
|
28213 | * ["x", "2015-11-02", "2015-12-01", "2016-01-01", "2016-02-01", "2016-03-01"],
|
28214 | * ["count1", 11, 8, 7, 6, 5 ],
|
28215 | * ["count2", 9, 3, 6, 2, 8 ]
|
28216 | * ]}
|
28217 | * }
|
28218 | * @see {@link bb.generate} for the initialization.
|
28219 | */
|
28220 |
|
28221 | /**
|
28222 | * Access instance's primary node elements
|
28223 | * @member {object} $
|
28224 | * @property {object} $ Access instance's primary node elements
|
28225 | * @property {d3.selection} $.chart Wrapper element
|
28226 | * @property {d3.selection} $.svg Main svg element
|
28227 | * @property {d3.selection} $.defs Definition element
|
28228 | * @property {d3.selection} $.main Main grouping element
|
28229 | * @property {d3.selection} $.tooltip Tooltip element
|
28230 | * @property {d3.selection} $.legend Legend element
|
28231 | * @property {d3.selection} $.title Title element
|
28232 | * @property {d3.selection} $.grid Grid element
|
28233 | * @property {d3.selection} $.arc Arc element
|
28234 | * @property {d3.selection} $.circles Data point circle elements
|
28235 | * @property {object} $.bar Bar element object
|
28236 | * @property {d3.selection} $.bar.bars Bar elements
|
28237 | * @property {d3.selection} $.candlestick Candlestick elements
|
28238 | * @property {object} $.line Line element object
|
28239 | * @property {d3.selection} $.line.lines Line elements
|
28240 | * @property {d3.selection} $.line.areas Areas elements
|
28241 | * @property {object} $.text Text element object
|
28242 | * @property {d3.selection} $.text.texts Data label text elements
|
28243 | * @memberof Chart
|
28244 | * @example
|
28245 | * var chart = bb.generate({ ... });
|
28246 | *
|
28247 | * chart.$.chart; // wrapper element
|
28248 | * chart.$.line.circles; // all data point circle elements
|
28249 | */
|
28250 |
|
28251 | /**
|
28252 | * Plugin instance array
|
28253 | * @member {Array} plugins
|
28254 | * @memberof Chart
|
28255 | * @example
|
28256 | * var chart = bb.generate({
|
28257 | * ...
|
28258 | * plugins: [
|
28259 | * new bb.plugin.stanford({ ... }),
|
28260 | * new PluginA()
|
28261 | * ]
|
28262 | * });
|
28263 | *
|
28264 | * chart.plugins; // [Stanford, PluginA] - instance array
|
28265 | */
|
28266 |
|
28267 | var Chart = function Chart(options) {
|
28268 | this.plugins = [], this.internal = void 0;
|
28269 | var $$ = new ChartInternal(this);
|
28270 | // bind to namespaced APIs
|
28271 | this.internal = $$, function bindThis(fn, target, argThis) {
|
28272 | Object.keys(fn).forEach(function (key) {
|
28273 | var isFunc = isFunction(fn[key]),
|
28274 | isChild = target !== argThis,
|
28275 | hasChild = Object.keys(fn[key]).length > 0;
|
28276 | isFunc && (!isChild && hasChild || isChild) ? target[key] = fn[key].bind(argThis) : !isFunc && (target[key] = {}), hasChild && bindThis(fn[key], target[key], argThis);
|
28277 | });
|
28278 | }(Chart.prototype, this, this), loadConfig.call($$, options), $$.beforeInit(), $$.init();
|
28279 | }; // extend common APIs as part of Chart class
|
28280 |
|
28281 |
|
28282 |
|
28283 | util_extend(Chart.prototype, [chart, api_color, api_data, api_export, api_focus, api_legend, api_load, show, api_tooltip]);
|
28284 | ;// CONCATENATED MODULE: ./src/Chart/api/axis.ts
|
28285 | /**
|
28286 | * Copyright (c) 2017 ~ present NAVER Corp.
|
28287 | * billboard.js project is licensed under the MIT license
|
28288 | */
|
28289 |
|
28290 | /**
|
28291 | * Set the min/max value
|
28292 | * @param {Chart} $$ Chart instance
|
28293 | * @param {string} type Set type 'min' or 'max'
|
28294 | * @param {object} value Value to be set
|
28295 | * @private
|
28296 | */
|
28297 |
|
28298 | function setMinMax($$, type, value) {
|
28299 | var config = $$.config,
|
28300 | axisY = "axis_y_" + type,
|
28301 | axisY2 = "axis_y2_" + type;
|
28302 | isDefined(value) && (isObjectType(value) ? (isValue(value.x) && (config["axis_x_" + type] = value.x), isValue(value.y) && (config[axisY] = value.y), isValue(value.y2) && (config[axisY2] = value.y2)) : (config[axisY] = value, config[axisY2] = value), $$.redraw({
|
28303 | withUpdateOrgXDomain: !0,
|
28304 | withUpdateXDomain: !0
|
28305 | }));
|
28306 | }
|
28307 | /**
|
28308 | * Get the min/max value
|
28309 | * @param {Chart} $$ Chart instance
|
28310 | * @param {string} type Set type 'min' or 'max'
|
28311 | * @returns {{x, y, y2}}
|
28312 | * @private
|
28313 | */
|
28314 |
|
28315 |
|
28316 | function axis_getMinMax($$, type) {
|
28317 | var config = $$.config;
|
28318 | return {
|
28319 | x: config["axis_x_" + type],
|
28320 | y: config["axis_y_" + type],
|
28321 | y2: config["axis_y2_" + type]
|
28322 | };
|
28323 | }
|
28324 | /**
|
28325 | * Define axis
|
28326 | * @ignore
|
28327 | */
|
28328 |
|
28329 |
|
28330 | var axis = {
|
28331 | /**
|
28332 | * Get and set axis labels.
|
28333 | * @function axis․labels
|
28334 | * @instance
|
28335 | * @memberof Chart
|
28336 | * @param {object} labels specified axis' label to be updated.
|
28337 | * @param {string} [labels.x] x Axis string
|
28338 | * @param {string} [labels.y] y Axis string
|
28339 | * @param {string} [labels.y2] y2 Axis string
|
28340 | * @returns {object|undefined} axis labels text object
|
28341 | * @example
|
28342 | * // Update axis' label
|
28343 | * chart.axis.labels({
|
28344 | * x: "New X Axis Label",
|
28345 | * y: "New Y Axis Label",
|
28346 | * y2: "New Y2 Axis Label"
|
28347 | * });
|
28348 | *
|
28349 | * chart.axis.labels();
|
28350 | * // --> {
|
28351 | * // x: "New X Axis Label",
|
28352 | * // y: "New Y Axis Label",
|
28353 | * // y2: "New Y2 Axis Label"
|
28354 | * // }
|
28355 | */
|
28356 | labels: function labels(_labels) {
|
28357 | var labelText,
|
28358 | $$ = this.internal;
|
28359 | return _labels && (Object.keys(_labels).forEach(function (axisId) {
|
28360 | $$.axis.setLabelText(axisId, _labels[axisId]);
|
28361 | }), $$.axis.updateLabels()), ["x", "y", "y2"].forEach(function (v) {
|
28362 | var text = $$.axis.getLabelText(v);
|
28363 | text && (!labelText && (labelText = {}), labelText[v] = text);
|
28364 | }), labelText;
|
28365 | },
|
28366 |
|
28367 | /**
|
28368 | * Get and set axis min value.
|
28369 | * @function axis․min
|
28370 | * @instance
|
28371 | * @memberof Chart
|
28372 | * @param {object} min If min is given, specified axis' min value will be updated.<br>
|
28373 | * If no argument is given, the min values set on generating option for each axis will be returned.
|
28374 | * If not set any min values on generation, it will return `undefined`.
|
28375 | * @returns {object|undefined}
|
28376 | * @example
|
28377 | * // Update axis' min
|
28378 | * chart.axis.min({
|
28379 | * x: -10,
|
28380 | * y: 1000,
|
28381 | * y2: 100
|
28382 | * });
|
28383 | */
|
28384 | min: function min(_min) {
|
28385 | var $$ = this.internal;
|
28386 | return isValue(_min) ? setMinMax($$, "min", _min) : axis_getMinMax($$, "min");
|
28387 | },
|
28388 |
|
28389 | /**
|
28390 | * Get and set axis max value.
|
28391 | * @function axis․max
|
28392 | * @instance
|
28393 | * @memberof Chart
|
28394 | * @param {object} max If max is given, specified axis' max value will be updated.<br>
|
28395 | * If no argument is given, the max values set on generating option for each axis will be returned.
|
28396 | * If not set any max values on generation, it will return `undefined`.
|
28397 | * @returns {object|undefined}
|
28398 | * @example
|
28399 | * // Update axis' label
|
28400 | * chart.axis.max({
|
28401 | * x: 100,
|
28402 | * y: 1000,
|
28403 | * y2: 10000
|
28404 | * });
|
28405 | */
|
28406 | max: function max(_max) {
|
28407 | var $$ = this.internal;
|
28408 | return arguments.length ? setMinMax($$, "max", _max) : axis_getMinMax($$, "max");
|
28409 | },
|
28410 |
|
28411 | /**
|
28412 | * Get and set axis min and max value.
|
28413 | * @function axis․range
|
28414 | * @instance
|
28415 | * @memberof Chart
|
28416 | * @param {object} range If range is given, specified axis' min and max value will be updated. If no argument is given, the current min and max values for each axis will be returned.
|
28417 | * @returns {object|undefined}
|
28418 | * @example
|
28419 | * // Update axis' label
|
28420 | * chart.axis.range({
|
28421 | * min: {
|
28422 | * x: -10,
|
28423 | * y: -1000,
|
28424 | * y2: -10000
|
28425 | * },
|
28426 | * max: {
|
28427 | * x: 100,
|
28428 | * y: 1000,
|
28429 | * y2: 10000
|
28430 | * },
|
28431 | * });
|
28432 | */
|
28433 | range: function range(_range) {
|
28434 | var axis = this.axis;
|
28435 | if (arguments.length) isDefined(_range.max) && axis.max(_range.max), isDefined(_range.min) && axis.min(_range.min);else return {
|
28436 | max: axis.max(),
|
28437 | min: axis.min()
|
28438 | };
|
28439 | return undefined;
|
28440 | }
|
28441 | };
|
28442 | /* harmony default export */ var api_axis = ({
|
28443 | axis: axis
|
28444 | });
|
28445 | ;// CONCATENATED MODULE: ./src/Chart/api/category.ts
|
28446 | /**
|
28447 | * Copyright (c) 2017 ~ present NAVER Corp.
|
28448 | * billboard.js project is licensed under the MIT license
|
28449 | */
|
28450 | /* harmony default export */ var api_category = ({
|
28451 | /**
|
28452 | * Set specified category name on category axis.
|
28453 | * @function category
|
28454 | * @instance
|
28455 | * @memberof Chart
|
28456 | * @param {number} i index of category to be changed
|
28457 | * @param {string} category category value to be changed
|
28458 | * @returns {string}
|
28459 | * @example
|
28460 | * chart.category(2, "Category 3");
|
28461 | */
|
28462 | category: function category(i, _category) {
|
28463 | var $$ = this.internal,
|
28464 | config = $$.config;
|
28465 | return arguments.length > 1 && (config.axis_x_categories[i] = _category, $$.redraw()), config.axis_x_categories[i];
|
28466 | },
|
28467 |
|
28468 | /**
|
28469 | * Set category names on category axis.
|
28470 | * @function categories
|
28471 | * @instance
|
28472 | * @memberof Chart
|
28473 | * @param {Array} categories This must be an array that includes category names in string. If category names are included in the date by data.x option, this is not required.
|
28474 | * @returns {Array}
|
28475 | * @example
|
28476 | * chart.categories([
|
28477 | * "Category 1", "Category 2", ...
|
28478 | * ]);
|
28479 | */
|
28480 | categories: function categories(_categories) {
|
28481 | var $$ = this.internal,
|
28482 | config = $$.config;
|
28483 | return arguments.length ? (config.axis_x_categories = _categories, $$.redraw(), config.axis_x_categories) : config.axis_x_categories;
|
28484 | }
|
28485 | });
|
28486 | ;// CONCATENATED MODULE: ./src/Chart/api/grid.x.ts
|
28487 | /**
|
28488 | * Copyright (c) 2017 ~ present NAVER Corp.
|
28489 | * billboard.js project is licensed under the MIT license
|
28490 | */
|
28491 |
|
28492 |
|
28493 | /**
|
28494 | * Update x grid lines.
|
28495 | * @function xgrids
|
28496 | * @instance
|
28497 | * @memberof Chart
|
28498 | * @param {Array} grids X grid lines will be replaced with this argument. The format of this argument is the same as grid.x.lines.
|
28499 | * @returns {object}
|
28500 | * @example
|
28501 | * // Show 2 x grid lines
|
28502 | * chart.xgrids([
|
28503 | * {value: 1, text: "Label 1"},
|
28504 | * {value: 4, text: "Label 4"}
|
28505 | * ]);
|
28506 | * // --> Returns: [{value: 1, text: "Label 1"}, {value: 4, text: "Label 4"}]
|
28507 | */
|
28508 | function xgrids(grids) {
|
28509 | var $$ = this.internal,
|
28510 | config = $$.config;
|
28511 | return grids ? (config.grid_x_lines = grids, $$.redrawWithoutRescale(), config.grid_x_lines) : config.grid_x_lines;
|
28512 | }
|
28513 |
|
28514 | util_extend(xgrids, {
|
28515 | /**
|
28516 | * Add x grid lines.<br>
|
28517 | * This API adds new x grid lines instead of replacing like xgrids.
|
28518 | * @function xgrids․add
|
28519 | * @instance
|
28520 | * @memberof Chart
|
28521 | * @param {Array|object} grids New x grid lines will be added. The format of this argument is the same as grid.x.lines and it's possible to give an Object if only one line will be added.
|
28522 | * @returns {object}
|
28523 | * @example
|
28524 | * // Add a new x grid line
|
28525 | * chart.xgrids.add(
|
28526 | * {value: 4, text: "Label 4"}
|
28527 | * );
|
28528 | *
|
28529 | * // Add new x grid lines
|
28530 | * chart.xgrids.add([
|
28531 | * {value: 2, text: "Label 2"},
|
28532 | * {value: 4, text: "Label 4"}
|
28533 | * ]);
|
28534 | */
|
28535 | add: function add(grids) {
|
28536 | return this.xgrids(this.internal.config.grid_x_lines.concat(grids || []));
|
28537 | },
|
28538 |
|
28539 | /**
|
28540 | * Remove x grid lines.<br>
|
28541 | * This API removes x grid lines.
|
28542 | * @function xgrids․remove
|
28543 | * @instance
|
28544 | * @memberof Chart
|
28545 | * @param {object} params This argument should include value or class. If value is given, the x grid lines that have specified x value will be removed. If class is given, the x grid lines that have specified class will be removed. If args is not given, all of x grid lines will be removed.
|
28546 | * @example
|
28547 | * // x grid line on x = 2 will be removed
|
28548 | * chart.xgrids.remove({value: 2});
|
28549 | *
|
28550 | * // x grid lines that have 'grid-A' will be removed
|
28551 | * chart.xgrids.remove({
|
28552 | * class: "grid-A"
|
28553 | * });
|
28554 | *
|
28555 | * // all of x grid lines will be removed
|
28556 | * chart.xgrids.remove();
|
28557 | */
|
28558 | remove: function remove(params) {
|
28559 | // TODO: multiple
|
28560 | this.internal.removeGridLines(params, !0);
|
28561 | }
|
28562 | });
|
28563 | /* harmony default export */ var grid_x = ({
|
28564 | xgrids: xgrids
|
28565 | });
|
28566 | ;// CONCATENATED MODULE: ./src/Chart/api/grid.y.ts
|
28567 | /**
|
28568 | * Copyright (c) 2017 ~ present NAVER Corp.
|
28569 | * billboard.js project is licensed under the MIT license
|
28570 | */
|
28571 |
|
28572 | /**
|
28573 | * Update y grid lines.
|
28574 | * @function ygrids
|
28575 | * @instance
|
28576 | * @memberof Chart
|
28577 | * @param {Array} grids Y grid lines will be replaced with this argument. The format of this argument is the same as grid.y.lines.
|
28578 | * @returns {object}
|
28579 | * @example
|
28580 | * // Show 2 y grid lines
|
28581 | * chart.ygrids([
|
28582 | * {value: 100, text: "Label 1"},
|
28583 | * {value: 400, text: "Label 4"}
|
28584 | * ]);
|
28585 | * // --> Returns: [{value: 100, text: "Label 1"}, {value: 400, text: "Label 4"}]
|
28586 | */
|
28587 |
|
28588 | function ygrids(grids) {
|
28589 | var $$ = this.internal,
|
28590 | config = $$.config;
|
28591 | return grids ? (config.grid_y_lines = grids, $$.redrawWithoutRescale(), config.grid_y_lines) : config.grid_y_lines;
|
28592 | }
|
28593 |
|
28594 | util_extend(ygrids, {
|
28595 | /**
|
28596 | * Add y grid lines.<br>
|
28597 | * This API adds new y grid lines instead of replacing like ygrids.
|
28598 | * @function ygrids․add
|
28599 | * @instance
|
28600 | * @memberof Chart
|
28601 | * @param {Array|object} grids New y grid lines will be added. The format of this argument is the same as grid.y.lines and it's possible to give an Object if only one line will be added.
|
28602 | * @returns {object}
|
28603 | * @example
|
28604 | * // Add a new x grid line
|
28605 | * chart.ygrids.add(
|
28606 | * {value: 400, text: "Label 4"}
|
28607 | * );
|
28608 | *
|
28609 | * // Add new x grid lines
|
28610 | * chart.ygrids.add([
|
28611 | * {value: 200, text: "Label 2"},
|
28612 | * {value: 400, text: "Label 4"}
|
28613 | * ]);
|
28614 | */
|
28615 | add: function add(grids) {
|
28616 | return this.ygrids(this.internal.config.grid_y_lines.concat(grids || []));
|
28617 | },
|
28618 |
|
28619 | /**
|
28620 | * Remove y grid lines.<br>
|
28621 | * This API removes x grid lines.
|
28622 | * @function ygrids․remove
|
28623 | * @instance
|
28624 | * @memberof Chart
|
28625 | * @param {object} params This argument should include value or class. If value is given, the y grid lines that have specified y value will be removed. If class is given, the y grid lines that have specified class will be removed. If args is not given, all of y grid lines will be removed.
|
28626 | * @param {number} [params.value] target value
|
28627 | * @param {string} [params.class] target class
|
28628 | * @example
|
28629 | * // y grid line on y = 200 will be removed
|
28630 | * chart.ygrids.remove({value: 200});
|
28631 | *
|
28632 | * // y grid lines that have 'grid-A' will be removed
|
28633 | * chart.ygrids.remove({
|
28634 | * class: "grid-A"
|
28635 | * });
|
28636 | *
|
28637 | * // all of y grid lines will be removed
|
28638 | * chart.ygrids.remove();
|
28639 | */
|
28640 | remove: function remove(params) {
|
28641 | // TODO: multiple
|
28642 | this.internal.removeGridLines(params, !1);
|
28643 | }
|
28644 | });
|
28645 | /* harmony default export */ var grid_y = ({
|
28646 | ygrids: ygrids
|
28647 | });
|
28648 | ;// CONCATENATED MODULE: ./src/Chart/api/group.ts
|
28649 | /**
|
28650 | * Copyright (c) 2017 ~ present NAVER Corp.
|
28651 | * billboard.js project is licensed under the MIT license
|
28652 | */
|
28653 |
|
28654 | /* harmony default export */ var group = ({
|
28655 | /**
|
28656 | * Update groups for the targets.
|
28657 | * @function groups
|
28658 | * @instance
|
28659 | * @memberof Chart
|
28660 | * @param {Array} groups This argument needs to be an Array that includes one or more Array that includes target ids to be grouped.
|
28661 | * @returns {Array} Grouped data names array
|
28662 | * @example
|
28663 | * // data1 and data2 will be a new group.
|
28664 | * chart.groups([
|
28665 | * ["data1", "data2"]
|
28666 | * ]);
|
28667 | */
|
28668 | groups: function groups(_groups) {
|
28669 | var $$ = this.internal,
|
28670 | config = $$.config;
|
28671 | return isUndefined(_groups) ? config.data_groups : (config.data_groups = _groups, $$.redraw(), config.data_groups);
|
28672 | }
|
28673 | });
|
28674 | ;// CONCATENATED MODULE: ./src/Chart/api/regions.ts
|
28675 | /**
|
28676 | * Copyright (c) 2017 ~ present NAVER Corp.
|
28677 | * billboard.js project is licensed under the MIT license
|
28678 | */
|
28679 |
|
28680 |
|
28681 |
|
28682 | /**
|
28683 | * Update regions.
|
28684 | * @function regions
|
28685 | * @instance
|
28686 | * @memberof Chart
|
28687 | * @param {Array} regions Regions will be replaced with this argument. The format of this argument is the same as regions.
|
28688 | * @returns {Array} regions
|
28689 | * @example
|
28690 | * // Show 2 regions
|
28691 | * chart.regions([
|
28692 | * {axis: "x", start: 5, class: "regionX"},
|
28693 | * {axis: "y", end: 50, class: "regionY"}
|
28694 | * ]);
|
28695 | */
|
28696 | function regions(regions) {
|
28697 | var $$ = this.internal,
|
28698 | config = $$.config;
|
28699 | return regions ? (config.regions = regions, $$.redrawWithoutRescale(), regions) : config.regions;
|
28700 | }
|
28701 |
|
28702 | util_extend(regions, {
|
28703 | /**
|
28704 | * Add new region.<br><br>
|
28705 | * This API adds new region instead of replacing like regions.
|
28706 | * @function regions․add
|
28707 | * @instance
|
28708 | * @memberof Chart
|
28709 | * @param {Array|object} regions New region will be added. The format of this argument is the same as regions and it's possible to give an Object if only one region will be added.
|
28710 | * @returns {Array} regions
|
28711 | * @example
|
28712 | * // Add a new region
|
28713 | * chart.regions.add(
|
28714 | * {axis: "x", start: 5, class: "regionX"}
|
28715 | * );
|
28716 | *
|
28717 | * // Add new regions
|
28718 | * chart.regions.add([
|
28719 | * {axis: "x", start: 5, class: "regionX"},
|
28720 | * {axis: "y", end: 50, class: "regionY"}
|
28721 | *]);
|
28722 | */
|
28723 | add: function add(regions) {
|
28724 | var $$ = this.internal,
|
28725 | config = $$.config;
|
28726 | return regions ? (config.regions = config.regions.concat(regions), $$.redrawWithoutRescale(), config.regions) : config.regions;
|
28727 | },
|
28728 |
|
28729 | /**
|
28730 | * Remove regions.<br><br>
|
28731 | * This API removes regions.
|
28732 | * @function regions․remove
|
28733 | * @instance
|
28734 | * @memberof Chart
|
28735 | * @param {object} optionsValue This argument should include classes. If classes is given, the regions that have one of the specified classes will be removed. If args is not given, all of regions will be removed.
|
28736 | * @returns {Array} regions Removed regions
|
28737 | * @example
|
28738 | * // regions that have 'region-A' or 'region-B' will be removed.
|
28739 | * chart.regions.remove({
|
28740 | * classes: [
|
28741 | * "region-A", "region-B"
|
28742 | * ]
|
28743 | * });
|
28744 | *
|
28745 | * // all of regions will be removed.
|
28746 | * chart.regions.remove();
|
28747 | */
|
28748 | remove: function remove(optionsValue) {
|
28749 | var $$ = this.internal,
|
28750 | config = $$.config,
|
28751 | options = optionsValue || {},
|
28752 | duration = getOption(options, "duration", config.transition_duration),
|
28753 | classes = getOption(options, "classes", [config_classes.region]),
|
28754 | regions = $$.$el.main.select("." + config_classes.regions).selectAll(classes.map(function (c) {
|
28755 | return "." + c;
|
28756 | }));
|
28757 | return (duration ? regions.transition().duration(duration) : regions).style("opacity", "0").remove(), regions = config.regions, Object.keys(options).length ? (regions = regions.filter(function (region) {
|
28758 | var found = !1;
|
28759 | return !region.class || (region.class.split(" ").forEach(function (c) {
|
28760 | classes.indexOf(c) >= 0 && (found = !0);
|
28761 | }), !found);
|
28762 | }), config.regions = regions) : config.regions = [], regions;
|
28763 | }
|
28764 | });
|
28765 | /* harmony default export */ var api_regions = ({
|
28766 | regions: regions
|
28767 | });
|
28768 | ;// CONCATENATED MODULE: ./src/Chart/api/x.ts
|
28769 | /**
|
28770 | * Copyright (c) 2017 ~ present NAVER Corp.
|
28771 | * billboard.js project is licensed under the MIT license
|
28772 | */
|
28773 |
|
28774 | /* harmony default export */ var x = ({
|
28775 | /**
|
28776 | * Get and set x values for the chart.
|
28777 | * @function x
|
28778 | * @instance
|
28779 | * @memberof Chart
|
28780 | * @param {Array} x If x is given, x values of every target will be updated. If no argument is given, current x values will be returned as an Object whose keys are the target ids.
|
28781 | * @returns {object} xs
|
28782 | * @example
|
28783 | * // Get current x values
|
28784 | * chart.x();
|
28785 | *
|
28786 | * // Update x values for all targets
|
28787 | * chart.x([100, 200, 300, 400, ...]);
|
28788 | */
|
28789 | x: function x(_x) {
|
28790 | var $$ = this.internal,
|
28791 | axis = $$.axis,
|
28792 | data = $$.data,
|
28793 | isCategorized = axis.isCustomX() && axis.isCategorized();
|
28794 | return isArray(_x) && (isCategorized ? this.categories(_x) : ($$.updateTargetX(data.targets, _x), $$.redraw({
|
28795 | withUpdateOrgXDomain: !0,
|
28796 | withUpdateXDomain: !0
|
28797 | }))), isCategorized ? this.categories() : data.xs;
|
28798 | },
|
28799 |
|
28800 | /**
|
28801 | * Get and set x values for the chart.
|
28802 | * @function xs
|
28803 | * @instance
|
28804 | * @memberof Chart
|
28805 | * @param {Array} xs If xs is given, specified target's x values will be updated. If no argument is given, current x values will be returned as an Object whose keys are the target ids.
|
28806 | * @returns {object} xs
|
28807 | * @example
|
28808 | * // Get current x values
|
28809 | * chart.xs();
|
28810 | *
|
28811 | * // Update x values for all targets
|
28812 | * chart.xs({
|
28813 | * data1: [10, 20, 30, 40, ...],
|
28814 | * data2: [100, 200, 300, 400, ...]
|
28815 | * });
|
28816 | */
|
28817 | xs: function xs(_xs) {
|
28818 | var $$ = this.internal;
|
28819 | return isObject(_xs) && ($$.updateTargetXs($$.data.targets, _xs), $$.redraw({
|
28820 | withUpdateOrgXDomain: !0,
|
28821 | withUpdateXDomain: !0
|
28822 | })), $$.data.xs;
|
28823 | }
|
28824 | });
|
28825 | ;// CONCATENATED MODULE: ./src/Chart/api/flow.ts
|
28826 | /**
|
28827 | * Copyright (c) 2017 ~ present NAVER Corp.
|
28828 | * billboard.js project is licensed under the MIT license
|
28829 | */
|
28830 |
|
28831 | /* harmony default export */ var flow = ({
|
28832 | /**
|
28833 | * Flow data to the chart.<br><br>
|
28834 | * By this API, you can append new data points to the chart.
|
28835 | * @function flow
|
28836 | * @instance
|
28837 | * @memberof Chart
|
28838 | * @param {object} args The object can consist with following members:<br>
|
28839 | *
|
28840 | * | Key | Type | Description |
|
28841 | * | --- | --- | --- |
|
28842 | * | json | Object | Data as JSON format (@see [data․json](Options.html#.data%25E2%2580%25A4json)) |
|
28843 | * | rows | Array | Data in array as row format (@see [data․rows](Options.html#.data%25E2%2580%25A4json)) |
|
28844 | * | columns | Array | Data in array as column format (@see [data․columns](Options.html#.data%25E2%2580%25A4columns)) |
|
28845 | * | to | String | The lower x edge will move to that point. If not given, the lower x edge will move by the number of given data points |
|
28846 | * | length | Number | The lower x edge will move by the number of this argument |
|
28847 | * | duration | Number | The duration of the transition will be specified value. If not given, transition.duration will be used as default |
|
28848 | * | done | Function | The specified function will be called when flow ends |
|
28849 | *
|
28850 | * - **NOTE:**
|
28851 | * - If json, rows and columns given, the data will be loaded.
|
28852 | * - If data that has the same target id is given, the chart will be appended.
|
28853 | * - Otherwise, new target will be added. One of these is required when calling.
|
28854 | * - If json specified, keys is required as well as data.json.
|
28855 | * - If tab isn't visible(by evaluating `document.hidden`), will not be executed to prevent unnecessary work.
|
28856 | * @example
|
28857 | * // 2 data points will be apprended to the tail and popped from the head.
|
28858 | * // After that, 4 data points will be appended and no data points will be poppoed.
|
28859 | * chart.flow({
|
28860 | * columns: [
|
28861 | * ["x", "2018-01-11", "2018-01-21"],
|
28862 | * ["data1", 500, 200],
|
28863 | * ["data2", 100, 300],
|
28864 | * ["data3", 200, 120]
|
28865 | * ],
|
28866 | * to: "2013-01-11",
|
28867 | * done: function () {
|
28868 | * chart.flow({
|
28869 | * columns: [
|
28870 | * ["x", "2018-02-11", "2018-02-12", "2018-02-13", "2018-02-14"],
|
28871 | * ["data1", 200, 300, 100, 250],
|
28872 | * ["data2", 100, 90, 40, 120],
|
28873 | * ["data3", 100, 100, 300, 500]
|
28874 | * ],
|
28875 | * length: 2,
|
28876 | * duration: 1500
|
28877 | * });
|
28878 | * }
|
28879 | * });
|
28880 | */
|
28881 | flow: function flow(args) {
|
28882 | var data,
|
28883 | domain,
|
28884 | diff,
|
28885 | to,
|
28886 | $$ = this.internal,
|
28887 | length = 0,
|
28888 | tail = 0;
|
28889 |
|
28890 | if ((args.json || args.rows || args.columns) && (data = $$.convertData(args)), data && isTabVisible()) {
|
28891 | var notfoundIds = [],
|
28892 | orgDataCount = $$.getMaxDataCount(),
|
28893 | targets = $$.convertDataToTargets(data, !0),
|
28894 | isTimeSeries = $$.axis.isTimeSeries();
|
28895 | $$.data.targets.forEach(function (t) {
|
28896 | for (var found = !1, i = 0; i < targets.length; i++) if (t.id === targets[i].id) {
|
28897 | found = !0, t.values[t.values.length - 1] && (tail = t.values[t.values.length - 1].index + 1), length = targets[i].values.length;
|
28898 |
|
28899 | for (var _j3 = 0; _j3 < length; _j3++) targets[i].values[_j3].index = tail + _j3, isTimeSeries || (targets[i].values[_j3].x = tail + _j3);
|
28900 |
|
28901 | t.values = t.values.concat(targets[i].values), targets.splice(i, 1);
|
28902 | break;
|
28903 | }
|
28904 |
|
28905 | found || notfoundIds.push(t.id);
|
28906 | }), $$.data.targets.forEach(function (t) {
|
28907 | for (var _i = 0; _i < notfoundIds.length; _i++) if (t.id === notfoundIds[_i]) {
|
28908 | tail = t.values[t.values.length - 1].index + 1;
|
28909 |
|
28910 | for (var _j4 = 0; _j4 < length; _j4++) t.values.push({
|
28911 | id: t.id,
|
28912 | index: tail + _j4,
|
28913 | x: isTimeSeries ? $$.getOtherTargetX(tail + _j4) : tail + _j4,
|
28914 | value: null
|
28915 | });
|
28916 | }
|
28917 | }), $$.data.targets.length && targets.forEach(function (t) {
|
28918 | for (var missing = [], i = $$.data.targets[0].values[0].index; i < tail; i++) missing.push({
|
28919 | id: t.id,
|
28920 | index: i,
|
28921 | x: isTimeSeries ? $$.getOtherTargetX(i) : i,
|
28922 | value: null
|
28923 | });
|
28924 |
|
28925 | t.values.forEach(function (v) {
|
28926 | v.index += tail, isTimeSeries || (v.x += tail);
|
28927 | }), t.values = missing.concat(t.values);
|
28928 | }), $$.data.targets = $$.data.targets.concat(targets);
|
28929 | // add remained
|
28930 | // check data count because behavior needs to change when it"s only one
|
28931 | // const dataCount = $$.getMaxDataCount();
|
28932 | var baseTarget = $$.data.targets[0],
|
28933 | baseValue = baseTarget.values[0];
|
28934 | isDefined(args.to) ? (length = 0, to = isTimeSeries ? parseDate.call($$, args.to) : args.to, baseTarget.values.forEach(function (v) {
|
28935 | v.x < to && length++;
|
28936 | })) : isDefined(args.length) && (length = args.length), orgDataCount ? orgDataCount === 1 && isTimeSeries && (diff = (baseTarget.values[baseTarget.values.length - 1].x - baseValue.x) / 2, domain = [new Date(+baseValue.x - diff), new Date(+baseValue.x + diff)]) : (diff = isTimeSeries ? baseTarget.values.length > 1 ? baseTarget.values[baseTarget.values.length - 1].x - baseValue.x : baseValue.x - $$.getXDomain($$.data.targets)[0] : 1, domain = [baseValue.x - diff, baseValue.x]), domain && $$.updateXDomain(null, !0, !0, !1, domain), $$.updateTargets($$.data.targets), $$.redraw({
|
28937 | flow: {
|
28938 | index: baseValue.index,
|
28939 | length: length,
|
28940 | duration: isValue(args.duration) ? args.duration : $$.config.transition_duration,
|
28941 | done: args.done,
|
28942 | orgDataCount: orgDataCount
|
28943 | },
|
28944 | withLegend: !0,
|
28945 | withTransition: orgDataCount > 1,
|
28946 | withTrimXDomain: !1,
|
28947 | withUpdateXAxis: !0
|
28948 | });
|
28949 | }
|
28950 | }
|
28951 | });
|
28952 | ;// CONCATENATED MODULE: ./node_modules/d3-axis/src/array.js
|
28953 | var slice = Array.prototype.slice;
|
28954 | ;// CONCATENATED MODULE: ./node_modules/d3-axis/src/identity.js
|
28955 | /* harmony default export */ function d3_axis_src_identity(x) {
|
28956 | return x;
|
28957 | }
|
28958 | ;// CONCATENATED MODULE: ./node_modules/d3-axis/src/axis.js
|
28959 |
|
28960 |
|
28961 | var axis_top = 1,
|
28962 | right = 2,
|
28963 | bottom = 3,
|
28964 | left = 4,
|
28965 | axis_epsilon = 1e-6;
|
28966 |
|
28967 | function translateX(x) {
|
28968 | return "translate(" + x + ",0)";
|
28969 | }
|
28970 |
|
28971 | function translateY(y) {
|
28972 | return "translate(0," + y + ")";
|
28973 | }
|
28974 |
|
28975 | function axis_number(scale) {
|
28976 | return function (d) {
|
28977 | return +scale(d);
|
28978 | };
|
28979 | }
|
28980 |
|
28981 | function center(scale, offset) {
|
28982 | return offset = Math.max(0, scale.bandwidth() - offset * 2) / 2, scale.round() && (offset = Math.round(offset)), function (d) {
|
28983 | return +scale(d) + offset;
|
28984 | };
|
28985 | }
|
28986 |
|
28987 | function entering() {
|
28988 | return !this.__axis;
|
28989 | }
|
28990 |
|
28991 | function axis_axis(orient, scale) {
|
28992 | function axis(context) {
|
28993 | var values = tickValues == null ? scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain() : tickValues,
|
28994 | format = tickFormat == null ? scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : d3_axis_src_identity : tickFormat,
|
28995 | spacing = Math.max(tickSizeInner, 0) + tickPadding,
|
28996 | range = scale.range(),
|
28997 | range0 = +range[0] + offset,
|
28998 | range1 = +range[range.length - 1] + offset,
|
28999 | position = (scale.bandwidth ? center : axis_number)(scale.copy(), offset),
|
29000 | selection = context.selection ? context.selection() : context,
|
29001 | path = selection.selectAll(".domain").data([null]),
|
29002 | tick = selection.selectAll(".tick").data(values, scale).order(),
|
29003 | tickExit = tick.exit(),
|
29004 | tickEnter = tick.enter().append("g").attr("class", "tick"),
|
29005 | line = tick.select("line"),
|
29006 | text = tick.select("text");
|
29007 | path = path.merge(path.enter().insert("path", ".tick").attr("class", "domain").attr("stroke", "currentColor")), tick = tick.merge(tickEnter), line = line.merge(tickEnter.append("line").attr("stroke", "currentColor").attr(x + "2", k * tickSizeInner)), text = text.merge(tickEnter.append("text").attr("fill", "currentColor").attr(x, k * spacing).attr("dy", orient === axis_top ? "0em" : orient === bottom ? "0.71em" : "0.32em")), context !== selection && (path = path.transition(context), tick = tick.transition(context), line = line.transition(context), text = text.transition(context), tickExit = tickExit.transition(context).attr("opacity", axis_epsilon).attr("transform", function (d) {
|
29008 | return isFinite(d = position(d)) ? transform(d + offset) : this.getAttribute("transform");
|
29009 | }), tickEnter.attr("opacity", axis_epsilon).attr("transform", function (d) {
|
29010 | var p = this.parentNode.__axis;
|
29011 | return transform((p && isFinite(p = p(d)) ? p : position(d)) + offset);
|
29012 | })), tickExit.remove(), path.attr("d", orient === left || orient === right ? tickSizeOuter ? "M" + k * tickSizeOuter + "," + range0 + "H" + offset + "V" + range1 + "H" + k * tickSizeOuter : "M" + offset + "," + range0 + "V" + range1 : tickSizeOuter ? "M" + range0 + "," + k * tickSizeOuter + "V" + offset + "H" + range1 + "V" + k * tickSizeOuter : "M" + range0 + "," + offset + "H" + range1), tick.attr("opacity", 1).attr("transform", function (d) {
|
29013 | return transform(position(d) + offset);
|
29014 | }), line.attr(x + "2", k * tickSizeInner), text.attr(x, k * spacing).text(format), selection.filter(entering).attr("fill", "none").attr("font-size", 10).attr("font-family", "sans-serif").attr("text-anchor", orient === right ? "start" : orient === left ? "end" : "middle"), selection.each(function () {
|
29015 | this.__axis = position;
|
29016 | });
|
29017 | }
|
29018 |
|
29019 | var tickArguments = [],
|
29020 | tickValues = null,
|
29021 | tickFormat = null,
|
29022 | tickSizeInner = 6,
|
29023 | tickSizeOuter = 6,
|
29024 | tickPadding = 3,
|
29025 | offset = typeof window !== "undefined" && window.devicePixelRatio > 1 ? 0 : .5,
|
29026 | k = orient === axis_top || orient === left ? -1 : 1,
|
29027 | x = orient === left || orient === right ? "x" : "y",
|
29028 | transform = orient === axis_top || orient === bottom ? translateX : translateY;
|
29029 | return axis.scale = function (_) {
|
29030 | return arguments.length ? (scale = _, axis) : scale;
|
29031 | }, axis.ticks = function () {
|
29032 | return tickArguments = slice.call(arguments), axis;
|
29033 | }, axis.tickArguments = function (_) {
|
29034 | return arguments.length ? (tickArguments = _ == null ? [] : slice.call(_), axis) : tickArguments.slice();
|
29035 | }, axis.tickValues = function (_) {
|
29036 | return arguments.length ? (tickValues = _ == null ? null : slice.call(_), axis) : tickValues && tickValues.slice();
|
29037 | }, axis.tickFormat = function (_) {
|
29038 | return arguments.length ? (tickFormat = _, axis) : tickFormat;
|
29039 | }, axis.tickSize = function (_) {
|
29040 | return arguments.length ? (tickSizeInner = tickSizeOuter = +_, axis) : tickSizeInner;
|
29041 | }, axis.tickSizeInner = function (_) {
|
29042 | return arguments.length ? (tickSizeInner = +_, axis) : tickSizeInner;
|
29043 | }, axis.tickSizeOuter = function (_) {
|
29044 | return arguments.length ? (tickSizeOuter = +_, axis) : tickSizeOuter;
|
29045 | }, axis.tickPadding = function (_) {
|
29046 | return arguments.length ? (tickPadding = +_, axis) : tickPadding;
|
29047 | }, axis.offset = function (_) {
|
29048 | return arguments.length ? (offset = +_, axis) : offset;
|
29049 | }, axis;
|
29050 | }
|
29051 |
|
29052 | function axisTop(scale) {
|
29053 | return axis_axis(axis_top, scale);
|
29054 | }
|
29055 | function axisRight(scale) {
|
29056 | return axis_axis(right, scale);
|
29057 | }
|
29058 | function axisBottom(scale) {
|
29059 | return axis_axis(bottom, scale);
|
29060 | }
|
29061 | function axisLeft(scale) {
|
29062 | return axis_axis(left, scale);
|
29063 | }
|
29064 | ;// CONCATENATED MODULE: ./src/ChartInternal/Axis/AxisRendererHelper.ts
|
29065 | /**
|
29066 | * Copyright (c) 2017 ~ present NAVER Corp.
|
29067 | * billboard.js project is licensed under the MIT license
|
29068 | * @ignore
|
29069 | */
|
29070 |
|
29071 |
|
29072 |
|
29073 | var AxisRendererHelper = /*#__PURE__*/function () {
|
29074 | function AxisRendererHelper(owner) {
|
29075 | this.owner = void 0, this.config = void 0, this.scale = void 0;
|
29076 | var scale = getScale(),
|
29077 | config = owner.config,
|
29078 | params = owner.params;
|
29079 | this.owner = owner, this.config = config, this.scale = scale, (config.noTransition || !params.config.transition_duration) && (config.withoutTransition = !0), config.range = this.scaleExtent((params.orgXScale || scale).range());
|
29080 | }
|
29081 | /**
|
29082 | * Compute a character dimension
|
29083 | * @param {d3.selection} node <g class=tick> node
|
29084 | * @returns {{w: number, h: number}}
|
29085 | * @private
|
29086 | */
|
29087 |
|
29088 |
|
29089 | AxisRendererHelper.getSizeFor1Char = function getSizeFor1Char(node) {
|
29090 | // default size for one character
|
29091 | var size = {
|
29092 | w: 5.5,
|
29093 | h: 11.5
|
29094 | };
|
29095 | return node.empty() || node.select("text").text("0").call(function (el) {
|
29096 | try {
|
29097 | var _el$node$getBBox = el.node().getBBox(),
|
29098 | width = _el$node$getBBox.width,
|
29099 | height = _el$node$getBBox.height;
|
29100 |
|
29101 | width && height && (size.w = width, size.h = height);
|
29102 | } catch (e) {} finally {
|
29103 | el.text("");
|
29104 | }
|
29105 | }), this.getSizeFor1Char = function () {
|
29106 | return size;
|
29107 | }, size;
|
29108 | }
|
29109 | /**
|
29110 | * Get tick transform setter function
|
29111 | * @param {string} id Axis id
|
29112 | * @returns {Function} transfrom setter function
|
29113 | * @private
|
29114 | */
|
29115 | ;
|
29116 |
|
29117 | var _proto = AxisRendererHelper.prototype;
|
29118 | return _proto.getTickTransformSetter = function getTickTransformSetter(id) {
|
29119 | var config = this.config,
|
29120 | fn = id === "x" ? function (value) {
|
29121 | return "translate(" + (value + config.tickOffset) + ",0)";
|
29122 | } : function (value) {
|
29123 | return "translate(0," + value + ")";
|
29124 | };
|
29125 | return function (selection, scale) {
|
29126 | selection.attr("transform", function (d) {
|
29127 | return fn(Math.ceil(scale(d)));
|
29128 | });
|
29129 | };
|
29130 | }, _proto.scaleExtent = function scaleExtent(domain) {
|
29131 | var start = domain[0],
|
29132 | stop = domain[domain.length - 1];
|
29133 | return start < stop ? [start, stop] : [stop, start];
|
29134 | }, _proto.generateTicks = function generateTicks(scale, isYAxes) {
|
29135 | var tickStepSize = this.owner.params.tickStepSize,
|
29136 | _scale$domain = scale.domain(),
|
29137 | start = _scale$domain[0],
|
29138 | end = _scale$domain[1],
|
29139 | ticks = [];
|
29140 |
|
29141 | // When 'axis[y|y2].tick.stepSize' option is set
|
29142 | if (isYAxes && tickStepSize) for (var interval = start; interval <= end;) ticks.push(interval), interval += tickStepSize;else if (scale.ticks) {
|
29143 | var tickArguments = this.config.tickArguments; // adjust excessive tick count show
|
29144 |
|
29145 | if (scale.type === "log" && !tickArguments) {
|
29146 | // nicer symlog ticks didn't implemented yet: https://github.com/d3/d3-scale/issues/162
|
29147 | // get ticks values from logScale
|
29148 | var s = getScale("_log").domain([start > 0 ? start : 1, end]).range(scale.range());
|
29149 | ticks = s.ticks();
|
29150 |
|
29151 | for (var cnt = end.toFixed().length; ticks.length > 15; cnt--) ticks = s.ticks(cnt);
|
29152 |
|
29153 | ticks.splice(0, 1, start), ticks.splice(ticks.length - 1, 1, end);
|
29154 | } else ticks = scale.ticks.apply(scale, this.config.tickArguments || []);
|
29155 |
|
29156 | ticks = ticks.map(function (v) {
|
29157 | // round the tick value if is number
|
29158 | var r = isString(v) && isNumber(v) && !isNaN(v) && Math.round(v * 10) / 10 || v;
|
29159 | return r;
|
29160 | });
|
29161 | } else {
|
29162 | for (var i = Math.ceil(start); i < end; i++) ticks.push(i);
|
29163 |
|
29164 | ticks.length > 0 && ticks[0] > 0 && ticks.unshift(ticks[0] - (ticks[1] - ticks[0]));
|
29165 | }
|
29166 | return ticks;
|
29167 | }, _proto.copyScale = function copyScale() {
|
29168 | var newScale = this.scale.copy();
|
29169 | return newScale.domain().length || newScale.domain(this.scale.domain()), newScale.type = this.scale.type, newScale;
|
29170 | }, _proto.textFormatted = function textFormatted(v) {
|
29171 | var tickFormat = this.config.tickFormat,
|
29172 | value = /\d+\.\d+0{5,}\d$/.test(v) ? +(v + "").replace(/0+\d$/, "") : v,
|
29173 | formatted = tickFormat ? tickFormat(value) : value; // to round float numbers from 'binary floating point'
|
29174 | // https://en.wikipedia.org/wiki/Double-precision_floating-point_format
|
29175 | // https://stackoverflow.com/questions/17849101/laymans-explanation-for-why-javascript-has-weird-floating-math-ieee-754-stand
|
29176 |
|
29177 | return isDefined(formatted) ? formatted : "";
|
29178 | }, _proto.transitionise = function transitionise(selection) {
|
29179 | var config = this.config;
|
29180 | return config.withoutTransition ? selection.interrupt() : selection.transition(config.transition);
|
29181 | }, AxisRendererHelper;
|
29182 | }();
|
29183 |
|
29184 |
|
29185 | ;// CONCATENATED MODULE: ./src/ChartInternal/Axis/AxisRenderer.ts
|
29186 | /**
|
29187 | * Copyright (c) 2017 ~ present NAVER Corp.
|
29188 | * billboard.js project is licensed under the MIT license
|
29189 | * @ignore
|
29190 | */
|
29191 |
|
29192 |
|
29193 |
|
29194 |
|
29195 | var AxisRenderer = /*#__PURE__*/function () {
|
29196 | function AxisRenderer(params) {
|
29197 | params === void 0 && (params = {}), this.helper = void 0, this.config = void 0, this.params = void 0, this.g = void 0;
|
29198 | var config = {
|
29199 | innerTickSize: 6,
|
29200 | outerTickSize: params.outerTick ? 6 : 0,
|
29201 | orient: "bottom",
|
29202 | range: [],
|
29203 | tickArguments: null,
|
29204 | tickCentered: null,
|
29205 | tickCulling: !0,
|
29206 | tickFormat: null,
|
29207 | tickLength: 9,
|
29208 | tickOffset: 0,
|
29209 | tickPadding: 3,
|
29210 | tickValues: null,
|
29211 | transition: null,
|
29212 | noTransition: params.noTransition
|
29213 | };
|
29214 | config.tickLength = Math.max(config.innerTickSize, 0) + config.tickPadding, this.config = config, this.params = params, this.helper = new AxisRendererHelper(this);
|
29215 | }
|
29216 | /**
|
29217 | * Create axis element
|
29218 | * @param {d3.selection} g Axis selection
|
29219 | * @private
|
29220 | */
|
29221 |
|
29222 |
|
29223 | var _proto = AxisRenderer.prototype;
|
29224 | return _proto.create = function create(g) {
|
29225 | var ctx = this,
|
29226 | config = this.config,
|
29227 | helper = this.helper,
|
29228 | params = this.params,
|
29229 | scale = helper.scale,
|
29230 | orient = config.orient,
|
29231 | splitTickText = this.splitTickText.bind(this),
|
29232 | isLeftRight = /^(left|right)$/.test(orient),
|
29233 | isTopBottom = /^(top|bottom)$/.test(orient),
|
29234 | tickTransform = helper.getTickTransformSetter(isTopBottom ? "x" : "y"),
|
29235 | axisPx = tickTransform === helper.axisX ? "y" : "x",
|
29236 | sign = /^(top|left)$/.test(orient) ? -1 : 1,
|
29237 | rotate = params.tickTextRotate;
|
29238 | this.config.range = scale.rangeExtent ? scale.rangeExtent() : helper.scaleExtent((params.orgXScale || scale).range());
|
29239 | var $g,
|
29240 | _config2 = config,
|
29241 | innerTickSize = _config2.innerTickSize,
|
29242 | tickLength = _config2.tickLength,
|
29243 | range = _config2.range,
|
29244 | id = params.id,
|
29245 | tickTextPos = id && /^(x|y|y2)$/.test(id) ? params.config["axis_" + id + "_tick_text_position"] : {
|
29246 | x: 0,
|
29247 | y: 0
|
29248 | },
|
29249 | prefix = id === "subX" ? "subchart_axis_x" : "axis_" + id,
|
29250 | axisShow = params.config[prefix + "_show"],
|
29251 | tickShow = {
|
29252 | tick: !!axisShow && params.config[prefix + "_tick_show"],
|
29253 | text: !!axisShow && params.config[prefix + "_tick_text_show"]
|
29254 | }; // // get the axis' tick position configuration
|
29255 |
|
29256 | g.each(function () {
|
29257 | var g = src_select(this),
|
29258 | scale0 = this.__chart__ || scale,
|
29259 | scale1 = helper.copyScale();
|
29260 | $g = g, this.__chart__ = scale1, config.tickOffset = params.isCategory ? Math.ceil((scale1(1) - scale1(0)) / 2) : 0;
|
29261 | // update selection - data join
|
29262 | var path = g.selectAll(".domain").data([0]); // enter + update selection
|
29263 |
|
29264 | if (path.enter().append("path").attr("class", "domain") // https://observablehq.com/@d3/d3-selection-2-0
|
29265 | .merge(helper.transitionise(path).selection()).attr("d", function () {
|
29266 | var outerTickSized = config.outerTickSize * sign;
|
29267 | return isTopBottom ? "M" + range[0] + "," + outerTickSized + "V0H" + range[1] + "V" + outerTickSized : "M" + outerTickSized + "," + range[0] + "H0V" + range[1] + "H" + outerTickSized;
|
29268 | }), tickShow.tick || tickShow.text) {
|
29269 | // count of tick data in array
|
29270 | var ticks = config.tickValues || helper.generateTicks(scale1, isLeftRight),
|
29271 | tick = g.selectAll(".tick").data(ticks, scale1),
|
29272 | tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick").style("opacity", "1"),
|
29273 | tickExit = tick.exit().remove(); // update selection
|
29274 |
|
29275 | tick = tickEnter.merge(tick), tickShow.tick && tickEnter.append("line"), tickShow.text && tickEnter.append("text");
|
29276 | var sizeFor1Char = AxisRendererHelper.getSizeFor1Char(tick),
|
29277 | counts = [],
|
29278 | tspan = tick.select("text").selectAll("tspan").data(function (d, index) {
|
29279 | var split = params.tickMultiline ? splitTickText(d, scale1, ticks, isLeftRight, sizeFor1Char.w) : isArray(helper.textFormatted(d)) ? helper.textFormatted(d).concat() : [helper.textFormatted(d)];
|
29280 | return counts[index] = split.length, split.map(function (splitted) {
|
29281 | return {
|
29282 | index: index,
|
29283 | splitted: splitted
|
29284 | };
|
29285 | });
|
29286 | });
|
29287 | tspan.exit().remove(), tspan = tspan.enter().append("tspan").merge(tspan).text(function (d) {
|
29288 | return d.splitted;
|
29289 | }), tspan.attr("x", isTopBottom ? 0 : tickLength * sign).attr("dx", function () {
|
29290 | var dx = 0;
|
29291 | return /(top|bottom)/.test(orient) && rotate && (dx = 8 * Math.sin(Math.PI * (rotate / 180)) * (orient === "top" ? -1 : 1)), dx + (tickTextPos.x || 0);
|
29292 | }()).attr("dy", function (d, i) {
|
29293 | var dy = 0;
|
29294 | return orient !== "top" && (dy = sizeFor1Char.h, i === 0 && (dy = isLeftRight ? -((counts[d.index] - 1) * (sizeFor1Char.h / 2) - 3) : tickTextPos.y === 0 ? ".71em" : 0)), isNumber(dy) && tickTextPos.y ? dy + tickTextPos.y : dy || ".71em";
|
29295 | });
|
29296 | var lineUpdate = tick.select("line"),
|
29297 | textUpdate = tick.select("text");
|
29298 |
|
29299 | // Append <title> for tooltip display
|
29300 | if (tickEnter.select("line").attr(axisPx + "2", innerTickSize * sign), tickEnter.select("text").attr(axisPx, tickLength * sign), ctx.setTickLineTextPosition(lineUpdate, textUpdate), params.tickTitle) {
|
29301 | var title = textUpdate.select("title");
|
29302 | (title.empty() ? textUpdate.append("title") : title).text(function (index) {
|
29303 | return params.tickTitle[index];
|
29304 | });
|
29305 | }
|
29306 |
|
29307 | if (scale1.bandwidth) {
|
29308 | var x = scale1,
|
29309 | dx = x.bandwidth() / 2;
|
29310 | scale0 = function (d) {
|
29311 | return x(d) + dx;
|
29312 | }, scale1 = scale0;
|
29313 | } else scale0.bandwidth ? scale0 = scale1 : tickTransform(tickExit, scale1);
|
29314 |
|
29315 | tickTransform(tickEnter, scale0), tickTransform(helper.transitionise(tick).style("opacity", "1"), scale1);
|
29316 | }
|
29317 | }), this.g = $g;
|
29318 | }
|
29319 | /**
|
29320 | * Get tick x/y coordinate
|
29321 | * @returns {{x: number, y: number}}
|
29322 | * @private
|
29323 | */
|
29324 | , _proto.getTickXY = function getTickXY() {
|
29325 | var config = this.config,
|
29326 | pos = {
|
29327 | x: 0,
|
29328 | y: 0
|
29329 | };
|
29330 | return this.params.isCategory && (pos.x = config.tickCentered ? 0 : config.tickOffset, pos.y = config.tickCentered ? config.tickOffset : 0), pos;
|
29331 | }
|
29332 | /**
|
29333 | * Get tick size
|
29334 | * @param {object} d data object
|
29335 | * @returns {number}
|
29336 | * @private
|
29337 | */
|
29338 | , _proto.getTickSize = function getTickSize(d) {
|
29339 | var scale = this.helper.scale,
|
29340 | config = this.config,
|
29341 | _config3 = config,
|
29342 | innerTickSize = _config3.innerTickSize,
|
29343 | range = _config3.range,
|
29344 | tickPosition = scale(d) + (config.tickCentered ? 0 : config.tickOffset);
|
29345 | return range[0] < tickPosition && tickPosition < range[1] ? innerTickSize : 0;
|
29346 | }
|
29347 | /**
|
29348 | * Set tick's line & text position
|
29349 | * @param {d3.selection} lineUpdate Line selection
|
29350 | * @param {d3.selection} textUpdate Text selection
|
29351 | * @private
|
29352 | */
|
29353 | , _proto.setTickLineTextPosition = function setTickLineTextPosition(lineUpdate, textUpdate) {
|
29354 | var tickPos = this.getTickXY(),
|
29355 | _this$config = this.config,
|
29356 | innerTickSize = _this$config.innerTickSize,
|
29357 | orient = _this$config.orient,
|
29358 | tickLength = _this$config.tickLength,
|
29359 | tickOffset = _this$config.tickOffset,
|
29360 | rotate = this.params.tickTextRotate,
|
29361 | textAnchorForText = function (r) {
|
29362 | var value = ["start", "end"];
|
29363 | return orient === "top" && value.reverse(), r ? r > 0 ? value[0] : value[1] : "middle";
|
29364 | },
|
29365 | textTransform = function (r) {
|
29366 | return r ? "rotate(" + r + ")" : null;
|
29367 | },
|
29368 | yForText = function (r) {
|
29369 | var r2 = r / (orient === "bottom" ? 15 : 23);
|
29370 | return r ? 11.5 - 2.5 * r2 * (r > 0 ? 1 : -1) : tickLength;
|
29371 | };
|
29372 |
|
29373 | orient === "bottom" ? (lineUpdate.attr("x1", tickPos.x).attr("x2", tickPos.x).attr("y2", this.getTickSize.bind(this)), textUpdate.attr("x", 0).attr("y", yForText(rotate)).style("text-anchor", textAnchorForText(rotate)).attr("transform", textTransform(rotate))) : orient === "top" ? (lineUpdate.attr("x2", 0).attr("y2", -innerTickSize), textUpdate.attr("x", 0).attr("y", -yForText(rotate) * 2).style("text-anchor", textAnchorForText(rotate)).attr("transform", textTransform(rotate))) : orient === "left" ? (lineUpdate.attr("x2", -innerTickSize).attr("y1", tickPos.y).attr("y2", tickPos.y), textUpdate.attr("x", -tickLength).attr("y", tickOffset).style("text-anchor", "end")) : orient === "right" ? (lineUpdate.attr("x2", innerTickSize).attr("y2", 0), textUpdate.attr("x", tickLength).attr("y", 0).style("text-anchor", "start")) : void 0;
|
29374 | } // this should be called only when category axis
|
29375 | , _proto.splitTickText = function splitTickText(d, scale, ticks, isLeftRight, charWidth) {
|
29376 | // split given text by tick width size
|
29377 | // eslint-disable-next-line
|
29378 | function split(splitted, text) {
|
29379 | for (var subtext, spaceIndex, textWidth, i = 1; i < text.length; i++) // if text width gets over tick width, split by space index or current index
|
29380 | if (text.charAt(i) === " " && (spaceIndex = i), subtext = text.substr(0, i + 1), textWidth = charWidth * subtext.length, tickWidth < textWidth) return split(splitted.concat(text.substr(0, spaceIndex || i)), text.slice(spaceIndex ? spaceIndex + 1 : i));
|
29381 |
|
29382 | return splitted.concat(text);
|
29383 | }
|
29384 |
|
29385 | var params = this.params,
|
29386 | tickText = this.helper.textFormatted(d),
|
29387 | splitted = isString(tickText) && tickText.indexOf("\n") > -1 ? tickText.split("\n") : [];
|
29388 | if (splitted.length) return splitted;
|
29389 | if (isArray(tickText)) return tickText;
|
29390 | var tickWidth = params.tickWidth;
|
29391 | return (!tickWidth || tickWidth <= 0) && (tickWidth = isLeftRight ? 95 : params.isCategory ? Math.ceil(scale(ticks[1]) - scale(ticks[0])) - 12 : 110), split(splitted, tickText + "");
|
29392 | }, _proto.scale = function scale(x) {
|
29393 | return arguments.length ? (this.helper.scale = x, this) : this.helper.scale;
|
29394 | }, _proto.orient = function orient(x) {
|
29395 | return arguments.length ? (this.config.orient = x in {
|
29396 | top: 1,
|
29397 | right: 1,
|
29398 | bottom: 1,
|
29399 | left: 1
|
29400 | } ? x + "" : "bottom", this) : this.config.orient;
|
29401 | }, _proto.tickFormat = function tickFormat(format) {
|
29402 | var config = this.config;
|
29403 | return arguments.length ? (config.tickFormat = format, this) : config.tickFormat;
|
29404 | }, _proto.tickCentered = function tickCentered(isCentered) {
|
29405 | var config = this.config;
|
29406 | return arguments.length ? (config.tickCentered = isCentered, this) : config.tickCentered;
|
29407 | }
|
29408 | /**
|
29409 | * Return tick's offset value.
|
29410 | * The value will be set for 'category' axis type.
|
29411 | * @returns {number}
|
29412 | * @private
|
29413 | */
|
29414 | , _proto.tickOffset = function tickOffset() {
|
29415 | return this.config.tickOffset;
|
29416 | }
|
29417 | /**
|
29418 | * Get tick interval count
|
29419 | * @private
|
29420 | * @param {number} size Total data size
|
29421 | * @returns {number}
|
29422 | */
|
29423 | , _proto.tickInterval = function tickInterval(size) {
|
29424 | var interval,
|
29425 | _this = this;
|
29426 |
|
29427 | if (this.params.isCategory) interval = this.config.tickOffset * 2;else {
|
29428 | var length = this.g.select("path.domain").node().getTotalLength() - this.config.outerTickSize * 2;
|
29429 | interval = length / (size || this.g.selectAll("line").size());
|
29430 | // get the interval by its values
|
29431 | var intervalByValue = this.config.tickValues.map(function (v, i, arr) {
|
29432 | var next = i + 1;
|
29433 | return next < arr.length ? _this.helper.scale(arr[next]) - _this.helper.scale(v) : null;
|
29434 | }).filter(Boolean);
|
29435 | interval = Math.min.apply(Math, intervalByValue.concat([interval]));
|
29436 | }
|
29437 | return interval === Infinity ? 0 : interval;
|
29438 | }, _proto.ticks = function ticks() {
|
29439 | for (var config = this.config, _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
|
29440 |
|
29441 | return args.length ? (config.tickArguments = toArray(args), this) : config.tickArguments;
|
29442 | }, _proto.tickCulling = function tickCulling(culling) {
|
29443 | var config = this.config;
|
29444 | return arguments.length ? (config.tickCulling = culling, this) : config.tickCulling;
|
29445 | }, _proto.tickValues = function tickValues(x) {
|
29446 | var _this2 = this,
|
29447 | config = this.config;
|
29448 |
|
29449 | if (isFunction(x)) config.tickValues = function () {
|
29450 | return x(_this2.helper.scale.domain());
|
29451 | };else {
|
29452 | if (!arguments.length) return config.tickValues;
|
29453 | config.tickValues = x;
|
29454 | }
|
29455 | return this;
|
29456 | }, _proto.setTransition = function setTransition(t) {
|
29457 | return this.config.transition = t, this;
|
29458 | }, AxisRenderer;
|
29459 | }();
|
29460 |
|
29461 |
|
29462 | ;// CONCATENATED MODULE: ./src/ChartInternal/Axis/Axis.ts
|
29463 | /**
|
29464 | * Copyright (c) 2017 ~ present NAVER Corp.
|
29465 | * billboard.js project is licensed under the MIT license
|
29466 | */
|
29467 |
|
29468 |
|
29469 |
|
29470 |
|
29471 |
|
29472 | /* harmony default export */ var Axis = ({
|
29473 | getAxisInstance: function getAxisInstance() {
|
29474 | return this.axis || new Axis_Axis(this);
|
29475 | }
|
29476 | });
|
29477 |
|
29478 | var Axis_Axis = /*#__PURE__*/function () {
|
29479 | function Axis(owner) {
|
29480 | this.owner = void 0, this.x = void 0, this.subX = void 0, this.y = void 0, this.y2 = void 0, this.axesList = {}, this.tick = {
|
29481 | x: null,
|
29482 | y: null,
|
29483 | y2: null
|
29484 | }, this.xs = [], this.orient = {
|
29485 | x: "bottom",
|
29486 | y: "left",
|
29487 | y2: "right",
|
29488 | subX: "bottom"
|
29489 | }, this.owner = owner, this.setOrient();
|
29490 | }
|
29491 |
|
29492 | var _proto = Axis.prototype;
|
29493 | return _proto.getAxisClassName = function getAxisClassName(id) {
|
29494 | return config_classes.axis + " " + config_classes["axis" + capitalize(id)];
|
29495 | }, _proto.isHorizontal = function isHorizontal($$, forHorizontal) {
|
29496 | var isRotated = $$.config.axis_rotated;
|
29497 | return forHorizontal ? isRotated : !isRotated;
|
29498 | }, _proto.isCategorized = function isCategorized() {
|
29499 | var _this$owner = this.owner,
|
29500 | config = _this$owner.config,
|
29501 | state = _this$owner.state;
|
29502 | return config.axis_x_type.indexOf("category") >= 0 || state.hasRadar;
|
29503 | }, _proto.isCustomX = function isCustomX() {
|
29504 | var config = this.owner.config;
|
29505 | return !this.isTimeSeries() && (config.data_x || notEmpty(config.data_xs));
|
29506 | }, _proto.isTimeSeries = function isTimeSeries(id) {
|
29507 | return id === void 0 && (id = "x"), this.owner.config["axis_" + id + "_type"] === "timeseries";
|
29508 | }, _proto.isLog = function isLog(id) {
|
29509 | return id === void 0 && (id = "x"), this.owner.config["axis_" + id + "_type"] === "log";
|
29510 | }, _proto.isTimeSeriesY = function isTimeSeriesY() {
|
29511 | return this.isTimeSeries("y");
|
29512 | }, _proto.getAxisType = function getAxisType(id) {
|
29513 | id === void 0 && (id = "x");
|
29514 | var type = "linear";
|
29515 | return this.isTimeSeries(id) ? type = "time" : this.isLog(id) && (type = "log"), type;
|
29516 | }, _proto.init = function init() {
|
29517 | var _this = this,
|
29518 | $$ = this.owner,
|
29519 | config = $$.config,
|
29520 | _$$$$el = $$.$el,
|
29521 | main = _$$$$el.main,
|
29522 | axis = _$$$$el.axis,
|
29523 | clip = $$.state.clip,
|
29524 | isRotated = config.axis_rotated,
|
29525 | target = ["x", "y"];
|
29526 |
|
29527 | config.axis_y2_show && target.push("y2"), target.forEach(function (v) {
|
29528 | var classAxis = _this.getAxisClassName(v),
|
29529 | classLabel = config_classes["axis" + v.toUpperCase() + "Label"];
|
29530 |
|
29531 | axis[v] = main.append("g").attr("class", classAxis).attr("clip-path", function () {
|
29532 | var res = null;
|
29533 | return v === "x" ? res = clip.pathXAxis : v === "y" && (res = clip.pathYAxis), res;
|
29534 | }).attr("transform", $$.getTranslate(v)).style("visibility", config["axis_" + v + "_show"] ? "visible" : "hidden"), axis[v].append("text").attr("class", classLabel).attr("transform", ["rotate(-90)", null][v === "x" ? +!isRotated : +isRotated]).style("text-anchor", function () {
|
29535 | return _this.textAnchorForAxisLabel(v);
|
29536 | }), _this.generateAxes(v);
|
29537 | });
|
29538 | }
|
29539 | /**
|
29540 | * Set axis orient according option value
|
29541 | * @private
|
29542 | */
|
29543 | , _proto.setOrient = function setOrient() {
|
29544 | var $$ = this.owner,
|
29545 | _$$$config = $$.config,
|
29546 | isRotated = _$$$config.axis_rotated,
|
29547 | yInner = _$$$config.axis_y_inner,
|
29548 | y2Inner = _$$$config.axis_y2_inner;
|
29549 | this.orient = {
|
29550 | x: isRotated ? "left" : "bottom",
|
29551 | y: isRotated ? yInner ? "top" : "bottom" : yInner ? "right" : "left",
|
29552 | y2: isRotated ? y2Inner ? "bottom" : "top" : y2Inner ? "left" : "right",
|
29553 | subX: isRotated ? "left" : "bottom"
|
29554 | };
|
29555 | }
|
29556 | /**
|
29557 | * Generate axes
|
29558 | * It's used when axis' axes option is set
|
29559 | * @param {string} id Axis id
|
29560 | * @private
|
29561 | */
|
29562 | , _proto.generateAxes = function generateAxes(id) {
|
29563 | var d3Axis,
|
29564 | $$ = this.owner,
|
29565 | config = $$.config,
|
29566 | axes = [],
|
29567 | axesConfig = config["axis_" + id + "_axes"],
|
29568 | isRotated = config.axis_rotated;
|
29569 | id === "x" ? d3Axis = isRotated ? axisLeft : axisBottom : id === "y" ? d3Axis = isRotated ? axisBottom : axisLeft : id === "y2" && (d3Axis = isRotated ? axisTop : axisRight), axesConfig.length && axesConfig.forEach(function (v) {
|
29570 | var tick = v.tick || {},
|
29571 | scale = $$.scale[id].copy();
|
29572 | v.domain && scale.domain(v.domain), axes.push(d3Axis(scale).ticks(tick.count).tickFormat(isFunction(tick.format) ? tick.format.bind($$.api) : function (x) {
|
29573 | return x;
|
29574 | }).tickValues(tick.values).tickSizeOuter(tick.outer === !1 ? 0 : 6));
|
29575 | }), this.axesList[id] = axes;
|
29576 | }
|
29577 | /**
|
29578 | * Update axes nodes
|
29579 | * @private
|
29580 | */
|
29581 | , _proto.updateAxes = function updateAxes() {
|
29582 | var _this2 = this,
|
29583 | $$ = this.owner,
|
29584 | config = $$.config,
|
29585 | main = $$.$el.main;
|
29586 |
|
29587 | Object.keys(this.axesList).forEach(function (id) {
|
29588 | var axesConfig = config["axis_" + id + "_axes"],
|
29589 | scale = $$.scale[id].copy(),
|
29590 | range = scale.range();
|
29591 |
|
29592 | _this2.axesList[id].forEach(function (v, i) {
|
29593 | var axisRange = v.scale().range(); // adjust range value with the current
|
29594 | // https://github.com/naver/billboard.js/issues/859
|
29595 |
|
29596 | range.every(function (v, i) {
|
29597 | return v === axisRange[i];
|
29598 | }) || v.scale().range(range);
|
29599 | var className = _this2.getAxisClassName(id) + "-" + (i + 1),
|
29600 | g = main.select("." + className.replace(/\s/, "."));
|
29601 | g.empty() ? g = main.append("g").attr("class", className).style("visibility", config["axis_" + id + "_show"] ? "visible" : "hidden").call(v) : (axesConfig[i].domain && scale.domain(axesConfig[i].domain), _this2.x.helper.transitionise(g).call(v.scale(scale))), g.attr("transform", $$.getTranslate(id, i + 1));
|
29602 | });
|
29603 | });
|
29604 | }
|
29605 | /**
|
29606 | * Set Axis & tick values
|
29607 | * called from: updateScales()
|
29608 | * @param {string} id Axis id string
|
29609 | * @param {d3Scale} scale Scale
|
29610 | * @param {boolean} outerTick If show outer tick
|
29611 | * @param {boolean} noTransition If with no transition
|
29612 | * @private
|
29613 | */
|
29614 | , _proto.setAxis = function setAxis(id, scale, outerTick, noTransition) {
|
29615 | var $$ = this.owner;
|
29616 | id !== "subX" && (this.tick[id] = this.getTickValues(id)), this[id] = this.getAxis(id, scale, outerTick, // do not transit x Axis on zoom and resizing
|
29617 | // https://github.com/naver/billboard.js/issues/1949
|
29618 | !!(id === "x" && ($$.scale.zoom || $$.config.subchart_show || $$.state.resizing)) || noTransition);
|
29619 | } // called from : getMaxTickWidth()
|
29620 | , _proto.getAxis = function getAxis(id, scale, outerTick, noTransition, noTickTextRotate) {
|
29621 | var tickFormat,
|
29622 | $$ = this.owner,
|
29623 | config = $$.config,
|
29624 | isX = /^(x|subX)$/.test(id),
|
29625 | type = isX ? "x" : id,
|
29626 | isCategory = isX && this.isCategorized(),
|
29627 | orient = this.orient[id],
|
29628 | tickTextRotate = noTickTextRotate ? 0 : $$.getAxisTickRotate(type);
|
29629 | if (isX) tickFormat = $$.format.xAxisTick;else {
|
29630 | var fn = config["axis_" + id + "_tick_format"];
|
29631 | isFunction(fn) && (tickFormat = fn.bind($$.api));
|
29632 | }
|
29633 | var tickValues = this.tick[type],
|
29634 | axisParams = mergeObj({
|
29635 | outerTick: outerTick,
|
29636 | noTransition: noTransition,
|
29637 | config: config,
|
29638 | id: id,
|
29639 | tickTextRotate: tickTextRotate
|
29640 | }, isX && {
|
29641 | isCategory: isCategory,
|
29642 | tickMultiline: config.axis_x_tick_multiline,
|
29643 | tickWidth: config.axis_x_tick_width,
|
29644 | tickTitle: isCategory && config.axis_x_tick_tooltip && $$.api.categories(),
|
29645 | orgXScale: $$.scale.x
|
29646 | });
|
29647 | isX || (axisParams.tickStepSize = config["axis_" + type + "_tick_stepSize"]);
|
29648 | var axis = new AxisRenderer(axisParams).scale(isX && $$.scale.zoom || scale).orient(orient);
|
29649 |
|
29650 | if (isX && this.isTimeSeries() && tickValues && !isFunction(tickValues)) {
|
29651 | var _fn = parseDate.bind($$);
|
29652 |
|
29653 | tickValues = tickValues.map(function (v) {
|
29654 | return _fn(v);
|
29655 | });
|
29656 | } else !isX && this.isTimeSeriesY() && ( // https://github.com/d3/d3/blob/master/CHANGES.md#time-intervals-d3-time
|
29657 | axis.ticks(config.axis_y_tick_time_value), tickValues = null);
|
29658 |
|
29659 | tickValues && axis.tickValues(tickValues), axis.tickFormat(tickFormat || !isX && $$.isStackNormalized() && function (x) {
|
29660 | return x + "%";
|
29661 | }), isCategory && (axis.tickCentered(config.axis_x_tick_centered), isEmpty(config.axis_x_tick_culling) && (config.axis_x_tick_culling = !1));
|
29662 | var tickCount = config["axis_" + type + "_tick_count"];
|
29663 | return tickCount && axis.ticks(tickCount), axis;
|
29664 | }, _proto.updateXAxisTickValues = function updateXAxisTickValues(targets, axis) {
|
29665 | var values,
|
29666 | $$ = this.owner,
|
29667 | config = $$.config,
|
29668 | fit = config.axis_x_tick_fit,
|
29669 | count = config.axis_x_tick_count;
|
29670 | return (fit || count && fit) && (values = $$.mapTargetsToUniqueXs(targets), this.isCategorized() && count > values.length && (count = values.length), values = this.generateTickValues(values, count, this.isTimeSeries())), axis ? axis.tickValues(values) : this.x && (this.x.tickValues(values), this.subX && this.subX.tickValues(values)), values;
|
29671 | }, _proto.getId = function getId(id) {
|
29672 | var _this$owner2 = this.owner,
|
29673 | config = _this$owner2.config,
|
29674 | scale = _this$owner2.scale,
|
29675 | axis = config.data_axes[id];
|
29676 | return axis && scale[axis] || (axis = "y"), axis;
|
29677 | }, _proto.getXAxisTickFormat = function getXAxisTickFormat() {
|
29678 | var currFormat,
|
29679 | $$ = this.owner,
|
29680 | config = $$.config,
|
29681 | format = $$.format,
|
29682 | tickFormat = config.axis_x_tick_format,
|
29683 | isTimeSeries = this.isTimeSeries(),
|
29684 | isCategorized = this.isCategorized();
|
29685 | return tickFormat ? isFunction(tickFormat) ? currFormat = tickFormat.bind($$.api) : isTimeSeries && (currFormat = function (date) {
|
29686 | return date ? format.axisTime(tickFormat)(date) : "";
|
29687 | }) : currFormat = isTimeSeries ? format.defaultAxisTime : isCategorized ? $$.categoryName : function (v) {
|
29688 | return v < 0 ? v.toFixed(0) : v;
|
29689 | }, isFunction(currFormat) ? function (v) {
|
29690 | return currFormat.apply($$, isCategorized ? [v, $$.categoryName(v)] : [v]);
|
29691 | } : currFormat;
|
29692 | }, _proto.getTickValues = function getTickValues(id) {
|
29693 | var $$ = this.owner,
|
29694 | tickValues = $$.config["axis_" + id + "_tick_values"],
|
29695 | axis = $$[id + "Axis"];
|
29696 | return (isFunction(tickValues) ? tickValues.call($$.api) : tickValues) || (axis ? axis.tickValues() : undefined);
|
29697 | }, _proto.getLabelOptionByAxisId = function getLabelOptionByAxisId(id) {
|
29698 | return this.owner.config["axis_" + id + "_label"];
|
29699 | }, _proto.getLabelText = function getLabelText(id) {
|
29700 | var option = this.getLabelOptionByAxisId(id);
|
29701 | return isString(option) ? option : option ? option.text : null;
|
29702 | }, _proto.setLabelText = function setLabelText(id, text) {
|
29703 | var $$ = this.owner,
|
29704 | config = $$.config,
|
29705 | option = this.getLabelOptionByAxisId(id);
|
29706 | isString(option) ? config["axis_" + id + "_label"] = text : option && (option.text = text);
|
29707 | }, _proto.getLabelPosition = function getLabelPosition(id, defaultPosition) {
|
29708 | var isRotated = this.owner.config.axis_rotated,
|
29709 | option = this.getLabelOptionByAxisId(id),
|
29710 | position = isObjectType(option) && option.position ? option.position : defaultPosition[+!isRotated],
|
29711 | has = function (v) {
|
29712 | return !!~position.indexOf(v);
|
29713 | };
|
29714 |
|
29715 | return {
|
29716 | isInner: has("inner"),
|
29717 | isOuter: has("outer"),
|
29718 | isLeft: has("left"),
|
29719 | isCenter: has("center"),
|
29720 | isRight: has("right"),
|
29721 | isTop: has("top"),
|
29722 | isMiddle: has("middle"),
|
29723 | isBottom: has("bottom")
|
29724 | };
|
29725 | }, _proto.getAxisLabelPosition = function getAxisLabelPosition(id) {
|
29726 | return this.getLabelPosition(id, id === "x" ? ["inner-top", "inner-right"] : ["inner-right", "inner-top"]);
|
29727 | }, _proto.getLabelPositionById = function getLabelPositionById(id) {
|
29728 | return this.getAxisLabelPosition(id);
|
29729 | }, _proto.xForAxisLabel = function xForAxisLabel(id) {
|
29730 | var $$ = this.owner,
|
29731 | _$$$state = $$.state,
|
29732 | width = _$$$state.width,
|
29733 | height = _$$$state.height,
|
29734 | position = this.getAxisLabelPosition(id),
|
29735 | x = position.isMiddle ? -height / 2 : 0;
|
29736 | return this.isHorizontal($$, id !== "x") ? x = position.isLeft ? 0 : position.isCenter ? width / 2 : width : position.isBottom && (x = -height), x;
|
29737 | }, _proto.dxForAxisLabel = function dxForAxisLabel(id) {
|
29738 | var $$ = this.owner,
|
29739 | position = this.getAxisLabelPosition(id),
|
29740 | dx = position.isBottom ? "0.5em" : "0";
|
29741 | return this.isHorizontal($$, id !== "x") ? dx = position.isLeft ? "0.5em" : position.isRight ? "-0.5em" : "0" : position.isTop && (dx = "-0.5em"), dx;
|
29742 | }, _proto.textAnchorForAxisLabel = function textAnchorForAxisLabel(id) {
|
29743 | var $$ = this.owner,
|
29744 | position = this.getAxisLabelPosition(id),
|
29745 | anchor = position.isMiddle ? "middle" : "end";
|
29746 | return this.isHorizontal($$, id !== "x") ? anchor = position.isLeft ? "start" : position.isCenter ? "middle" : "end" : position.isBottom && (anchor = "start"), anchor;
|
29747 | }, _proto.dyForAxisLabel = function dyForAxisLabel(id) {
|
29748 | var dy,
|
29749 | $$ = this.owner,
|
29750 | config = $$.config,
|
29751 | isRotated = config.axis_rotated,
|
29752 | isInner = this.getAxisLabelPosition(id).isInner,
|
29753 | tickRotate = config["axis_" + id + "_tick_rotate"] ? $$.getHorizontalAxisHeight(id) : 0,
|
29754 | maxTickWidth = this.getMaxTickWidth(id);
|
29755 |
|
29756 | if (id === "x") {
|
29757 | var xHeight = config.axis_x_height;
|
29758 | dy = isRotated ? isInner ? "1.2em" : -25 - maxTickWidth : isInner ? "-0.5em" : xHeight ? xHeight - 10 : tickRotate ? tickRotate - 10 : "3em";
|
29759 | } else dy = {
|
29760 | y: ["-0.5em", 10, "3em", "1.2em", 10],
|
29761 | y2: ["1.2em", -20, "-2.2em", "-0.5em", 15]
|
29762 | }[id], dy = isRotated ? isInner ? dy[0] : tickRotate ? tickRotate * (id === "y2" ? -1 : 1) - dy[1] : dy[2] : isInner ? dy[3] : (dy[4] + (config["axis_" + id + "_inner"] ? 0 : maxTickWidth + dy[4])) * (id === "y" ? -1 : 1);
|
29763 |
|
29764 | return dy;
|
29765 | }, _proto.getMaxTickWidth = function getMaxTickWidth(id, withoutRecompute) {
|
29766 | var $$ = this.owner,
|
29767 | config = $$.config,
|
29768 | current = $$.state.current,
|
29769 | _$$$$el2 = $$.$el,
|
29770 | svg = _$$$$el2.svg,
|
29771 | chart = _$$$$el2.chart,
|
29772 | currentTickMax = current.maxTickWidths[id],
|
29773 | maxWidth = 0;
|
29774 | if (withoutRecompute || !config["axis_" + id + "_show"] || $$.filterTargetsToShow().length === 0) return currentTickMax.size;
|
29775 |
|
29776 | if (svg) {
|
29777 | var isYAxis = /^y2?$/.test(id),
|
29778 | targetsToShow = $$.filterTargetsToShow($$.data.targets),
|
29779 | scale = $$.scale[id].copy().domain($$["get" + (isYAxis ? "Y" : "X") + "Domain"](targetsToShow, id)),
|
29780 | domain = scale.domain(),
|
29781 | isDomainSame = domain[0] === domain[1] && domain.every(function (v) {
|
29782 | return v > 0;
|
29783 | }),
|
29784 | isCurrentMaxTickDomainSame = isArray(currentTickMax.domain) && currentTickMax.domain[0] === currentTickMax.domain[1] && currentTickMax.domain.every(function (v) {
|
29785 | return v > 0;
|
29786 | });
|
29787 | // do not compute if domain or currentMaxTickDomain is same
|
29788 | if (isDomainSame || isCurrentMaxTickDomainSame) return currentTickMax.size; // reset old max state value to prevent from new data loading
|
29789 |
|
29790 | currentTickMax.domain = domain, isYAxis || currentTickMax.ticks.splice(0);
|
29791 | var axis = this.getAxis(id, scale, !1, !1, !0),
|
29792 | tickCount = config["axis_" + id + "_tick_count"],
|
29793 | tickValues = config["axis_" + id + "_tick_values"];
|
29794 | !tickValues && tickCount && axis.tickValues(this.generateTickValues(domain, tickCount, isYAxis ? this.isTimeSeriesY() : this.isTimeSeries())), isYAxis || this.updateXAxisTickValues(targetsToShow, axis);
|
29795 | var dummy = chart.append("svg").style("visibility", "hidden").style("position", "fixed").style("top", "0px").style("left", "0px");
|
29796 | axis.create(dummy), dummy.selectAll("text").each(function (d, i) {
|
29797 | var currentTextWidth = this.getBoundingClientRect().width;
|
29798 | maxWidth = Math.max(maxWidth, currentTextWidth), isYAxis || (currentTickMax.ticks[i] = currentTextWidth);
|
29799 | }), dummy.remove();
|
29800 | }
|
29801 |
|
29802 | return maxWidth > 0 && (currentTickMax.size = maxWidth), currentTickMax.size;
|
29803 | }, _proto.getXAxisTickTextY2Overflow = function getXAxisTickTextY2Overflow(defaultPadding) {
|
29804 | var $$ = this.owner,
|
29805 | axis = $$.axis,
|
29806 | config = $$.config,
|
29807 | state = $$.state,
|
29808 | xAxisTickRotate = $$.getAxisTickRotate("x");
|
29809 |
|
29810 | if ((axis.isCategorized() || axis.isTimeSeries()) && config.axis_x_tick_fit && !config.axis_x_tick_culling && !config.axis_x_tick_multiline && xAxisTickRotate > 0 && xAxisTickRotate < 90) {
|
29811 | var widthWithoutCurrentPaddingLeft = state.current.width - $$.getCurrentPaddingLeft(),
|
29812 | maxOverflow = this.getXAxisTickMaxOverflow(xAxisTickRotate, widthWithoutCurrentPaddingLeft - defaultPadding),
|
29813 | xAxisTickTextY2Overflow = Math.max(0, maxOverflow) + defaultPadding;
|
29814 | // for display inconsistencies between browsers
|
29815 | return Math.min(xAxisTickTextY2Overflow, widthWithoutCurrentPaddingLeft / 2);
|
29816 | }
|
29817 |
|
29818 | return 0;
|
29819 | }, _proto.getXAxisTickMaxOverflow = function getXAxisTickMaxOverflow(xAxisTickRotate, widthWithoutCurrentPaddingLeft) {
|
29820 | for (var $$ = this.owner, axis = $$.axis, config = $$.config, state = $$.state, isTimeSeries = axis.isTimeSeries(), tickTextWidths = state.current.maxTickWidths.x.ticks, tickCount = tickTextWidths.length, _state$axis$x$padding = state.axis.x.padding, left = _state$axis$x$padding.left, right = _state$axis$x$padding.right, maxOverflow = 0, remaining = tickCount - (isTimeSeries && config.axis_x_tick_fit ? .5 : 0), i = 0; i < tickCount; i++) {
|
29821 | var tickIndex = i + 1,
|
29822 | rotatedTickTextWidth = Math.cos(Math.PI * xAxisTickRotate / 180) * tickTextWidths[i],
|
29823 | ticksBeforeTickText = tickIndex - (isTimeSeries ? 1 : .5) + left;
|
29824 |
|
29825 | // Skip ticks if there are no ticks before them
|
29826 | if (!(ticksBeforeTickText <= 0)) {
|
29827 | var tickLength = (widthWithoutCurrentPaddingLeft - rotatedTickTextWidth) / ticksBeforeTickText;
|
29828 | maxOverflow = Math.max(maxOverflow, rotatedTickTextWidth - tickLength / 2 - ((remaining - tickIndex) * tickLength + right * tickLength));
|
29829 | }
|
29830 | }
|
29831 |
|
29832 | var filteredTargets = $$.filterTargetsToShow($$.data.targets),
|
29833 | tickOffset = 0;
|
29834 |
|
29835 | if (!isTimeSeries && config.axis_x_tick_count <= filteredTargets.length && filteredTargets[0].values.length) {
|
29836 | var scale = getScale($$.axis.getAxisType("x"), 0, widthWithoutCurrentPaddingLeft - maxOverflow).domain([left * -1, $$.getXDomainMax($$.data.targets) + 1 + right]);
|
29837 | tickOffset = Math.ceil((scale(1) - scale(0)) / 2);
|
29838 | }
|
29839 |
|
29840 | return maxOverflow + tickOffset;
|
29841 | }
|
29842 | /**
|
29843 | * Get x Axis padding
|
29844 | * @param {number} tickCount Tick count
|
29845 | * @returns {object} Padding object values with 'left' & 'right' key
|
29846 | * @private
|
29847 | */
|
29848 | , _proto.getXAxisPadding = function getXAxisPadding(tickCount) {
|
29849 | var $$ = this.owner,
|
29850 | padding = $$.config.axis_x_padding;
|
29851 |
|
29852 | if (isEmpty(padding) ? padding = {
|
29853 | left: 0,
|
29854 | right: 0
|
29855 | } : (padding.left = padding.left || 0, padding.right = padding.right || 0), $$.axis.isTimeSeries()) {
|
29856 | var firstX = +$$.getXDomainMin($$.data.targets),
|
29857 | lastX = +$$.getXDomainMax($$.data.targets),
|
29858 | timeDiff = lastX - firstX,
|
29859 | range = timeDiff + padding.left + padding.right,
|
29860 | left = 0,
|
29861 | _right = 0;
|
29862 |
|
29863 | if (tickCount && range) {
|
29864 | var relativeTickWidth = timeDiff / tickCount / range;
|
29865 | left = padding.left / range / relativeTickWidth, _right = padding.right / range / relativeTickWidth;
|
29866 | }
|
29867 |
|
29868 | padding = {
|
29869 | left: left,
|
29870 | right: _right
|
29871 | };
|
29872 | }
|
29873 |
|
29874 | return padding;
|
29875 | }, _proto.updateLabels = function updateLabels(withTransition) {
|
29876 | var _this3 = this,
|
29877 | $$ = this.owner,
|
29878 | main = $$.$el.main,
|
29879 | labels = {
|
29880 | x: main.select("." + config_classes.axisX + " ." + config_classes.axisXLabel),
|
29881 | y: main.select("." + config_classes.axisY + " ." + config_classes.axisYLabel),
|
29882 | y2: main.select("." + config_classes.axisY2 + " ." + config_classes.axisY2Label)
|
29883 | };
|
29884 |
|
29885 | Object.keys(labels).filter(function (id) {
|
29886 | return !labels[id].empty();
|
29887 | }).forEach(function (v) {
|
29888 | var node = labels[v];
|
29889 | (withTransition ? node.transition() : node).attr("x", function () {
|
29890 | return _this3.xForAxisLabel(v);
|
29891 | }).attr("dx", function () {
|
29892 | return _this3.dxForAxisLabel(v);
|
29893 | }).attr("dy", function () {
|
29894 | return _this3.dyForAxisLabel(v);
|
29895 | }).text(function () {
|
29896 | return _this3.getLabelText(v);
|
29897 | });
|
29898 | });
|
29899 | }, _proto.getPadding = function getPadding(padding, key, defaultValue, domainLength) {
|
29900 | var p = isNumber(padding) ? padding : padding[key];
|
29901 | return isValue(p) ? this.convertPixelsToAxisPadding(p, domainLength) : defaultValue;
|
29902 | }, _proto.convertPixelsToAxisPadding = function convertPixelsToAxisPadding(pixels, domainLength) {
|
29903 | var $$ = this.owner,
|
29904 | config = $$.config,
|
29905 | _$$$state2 = $$.state,
|
29906 | width = _$$$state2.width,
|
29907 | height = _$$$state2.height,
|
29908 | length = config.axis_rotated ? width : height;
|
29909 | return domainLength * (pixels / length);
|
29910 | }, _proto.generateTickValues = function generateTickValues(values, tickCount, forTimeSeries) {
|
29911 | var tickValues = values;
|
29912 |
|
29913 | if (tickCount) {
|
29914 | var targetCount = isFunction(tickCount) ? tickCount() : tickCount; // compute ticks according to tickCount
|
29915 |
|
29916 | if (targetCount === 1) tickValues = [values[0]];else if (targetCount === 2) tickValues = [values[0], values[values.length - 1]];else if (targetCount > 2) {
|
29917 | var tickValue,
|
29918 | isCategorized = this.isCategorized(),
|
29919 | count = targetCount - 2,
|
29920 | start = values[0],
|
29921 | end = values[values.length - 1];
|
29922 | tickValues = [start];
|
29923 |
|
29924 | for (var i = 0; i < count; i++) tickValue = +start + (end - start) / (count + 1) * (i + 1), tickValues.push(forTimeSeries ? new Date(tickValue) : isCategorized ? Math.round(tickValue) : tickValue);
|
29925 |
|
29926 | tickValues.push(end);
|
29927 | }
|
29928 | }
|
29929 |
|
29930 | return forTimeSeries || (tickValues = tickValues.sort(function (a, b) {
|
29931 | return a - b;
|
29932 | })), tickValues;
|
29933 | }, _proto.generateTransitions = function generateTransitions(duration) {
|
29934 | var $$ = this.owner,
|
29935 | axis = $$.$el.axis,
|
29936 | _map = ["x", "y", "y2", "subX"].map(function (v) {
|
29937 | var ax = axis[v];
|
29938 | return ax && duration && (ax = ax.transition().duration(duration)), ax;
|
29939 | }),
|
29940 | axisX = _map[0],
|
29941 | axisY = _map[1],
|
29942 | axisY2 = _map[2],
|
29943 | axisSubX = _map[3];
|
29944 |
|
29945 | return {
|
29946 | axisX: axisX,
|
29947 | axisY: axisY,
|
29948 | axisY2: axisY2,
|
29949 | axisSubX: axisSubX
|
29950 | };
|
29951 | }, _proto.redraw = function redraw(transitions, isHidden, isInit) {
|
29952 | var _this4 = this,
|
29953 | $$ = this.owner,
|
29954 | config = $$.config,
|
29955 | $el = $$.$el,
|
29956 | opacity = isHidden ? "0" : "1";
|
29957 |
|
29958 | ["x", "y", "y2", "subX"].forEach(function (id) {
|
29959 | var axis = _this4[id],
|
29960 | $axis = $el.axis[id];
|
29961 | axis && $axis && (!isInit && !config.transition_duration && (axis.config.withoutTransition = !0), $axis.style("opacity", opacity), axis.create(transitions["axis" + capitalize(id)]));
|
29962 | }), this.updateAxes();
|
29963 | }
|
29964 | /**
|
29965 | * Redraw axis
|
29966 | * @param {Array} targetsToShow targets data to be shown
|
29967 | * @param {object} wth option object
|
29968 | * @param {d3.Transition} transitions Transition object
|
29969 | * @param {object} flow flow object
|
29970 | * @param {boolean} isInit called from initialization
|
29971 | * @private
|
29972 | */
|
29973 | , _proto.redrawAxis = function redrawAxis(targetsToShow, wth, transitions, flow, isInit) {
|
29974 | var xDomainForZoom,
|
29975 | _this5 = this,
|
29976 | $$ = this.owner,
|
29977 | config = $$.config,
|
29978 | scale = $$.scale,
|
29979 | $el = $$.$el,
|
29980 | hasZoom = !!scale.zoom;
|
29981 |
|
29982 | !hasZoom && this.isCategorized() && targetsToShow.length === 0 && scale.x.domain([0, $el.axis.x.selectAll(".tick").size()]), scale.x && targetsToShow.length ? (!hasZoom && $$.updateXDomain(targetsToShow, wth.UpdateXDomain, wth.UpdateOrgXDomain, wth.TrimXDomain), !config.axis_x_tick_values && this.updateXAxisTickValues(targetsToShow)) : this.x && (this.x.tickValues([]), this.subX && this.subX.tickValues([])), config.zoom_rescale && !flow && (xDomainForZoom = scale.x.orgDomain()), ["y", "y2"].forEach(function (key) {
|
29983 | var axisScale = scale[key];
|
29984 |
|
29985 | if (axisScale) {
|
29986 | var tickValues = config["axis_" + key + "_tick_values"],
|
29987 | tickCount = config["axis_" + key + "_tick_count"];
|
29988 |
|
29989 | if (axisScale.domain($$.getYDomain(targetsToShow, key, xDomainForZoom)), !tickValues && tickCount) {
|
29990 | var _axis = $$.axis[key],
|
29991 | domain = axisScale.domain();
|
29992 |
|
29993 | _axis.tickValues(_this5.generateTickValues(domain, domain.every(function (v) {
|
29994 | return v === 0;
|
29995 | }) ? 1 : tickCount, _this5.isTimeSeriesY()));
|
29996 | }
|
29997 | }
|
29998 | }), this.redraw(transitions, $$.hasArcType(), isInit), this.updateLabels(wth.Transition), (wth.UpdateXDomain || wth.UpdateXAxis || wth.Y) && targetsToShow.length && this.setCulling(), wth.Y && (scale.subY && scale.subY.domain($$.getYDomain(targetsToShow, "y")), scale.subY2 && scale.subY2.domain($$.getYDomain(targetsToShow, "y2")));
|
29999 | }
|
30000 | /**
|
30001 | * Set manual culling
|
30002 | * @private
|
30003 | */
|
30004 | , _proto.setCulling = function setCulling() {
|
30005 | var $$ = this.owner,
|
30006 | config = $$.config,
|
30007 | _$$$state3 = $$.state,
|
30008 | clip = _$$$state3.clip,
|
30009 | current = _$$$state3.current,
|
30010 | $el = $$.$el;
|
30011 | ["subX", "x", "y", "y2"].forEach(function (type) {
|
30012 | var axis = $el.axis[type],
|
30013 | id = type === "subX" ? "x" : type,
|
30014 | toCull = config["axis_" + id + "_tick_culling"]; // subchart x axis should be aligned with x axis culling
|
30015 |
|
30016 | if (axis && toCull) {
|
30017 | var intervalForCulling,
|
30018 | tickText = axis.selectAll(".tick text"),
|
30019 | tickValues = sortValue(tickText.data()),
|
30020 | tickSize = tickValues.length,
|
30021 | cullingMax = config["axis_" + id + "_tick_culling_max"];
|
30022 |
|
30023 | if (tickSize) {
|
30024 | for (var i = 1; i < tickSize; i++) if (tickSize / i < cullingMax) {
|
30025 | intervalForCulling = i;
|
30026 | break;
|
30027 | }
|
30028 |
|
30029 | tickText.each(function (d) {
|
30030 | this.style.display = tickValues.indexOf(d) % intervalForCulling ? "none" : "block";
|
30031 | });
|
30032 | } else tickText.style("display", "block"); // set/unset x_axis_tick_clippath
|
30033 |
|
30034 |
|
30035 | if (type === "x") {
|
30036 | var clipPath = current.maxTickWidths.x.clipPath ? clip.pathXAxisTickTexts : null;
|
30037 | $el.svg.selectAll("." + config_classes.axisX + " .tick text").attr("clip-path", clipPath);
|
30038 | }
|
30039 | }
|
30040 | });
|
30041 | }, Axis;
|
30042 | }();
|
30043 | ;// CONCATENATED MODULE: ./src/ChartInternal/interactions/eventrect.ts
|
30044 | /**
|
30045 | * Copyright (c) 2017 ~ present NAVER Corp.
|
30046 | * billboard.js project is licensed under the MIT license
|
30047 | */
|
30048 |
|
30049 |
|
30050 | /* harmony default export */ var eventrect = ({
|
30051 | /**
|
30052 | * Initialize the area that detects the event.
|
30053 | * Add a container for the zone that detects the event.
|
30054 | * @private
|
30055 | */
|
30056 | initEventRect: function initEventRect() {
|
30057 | var $$ = this;
|
30058 | $$.$el.main.select("." + config_classes.chart).append("g").attr("class", config_classes.eventRects).style("fill-opacity", "0");
|
30059 | },
|
30060 |
|
30061 | /**
|
30062 | * Redraws the area that detects the event.
|
30063 | * @private
|
30064 | */
|
30065 | redrawEventRect: function redrawEventRect() {
|
30066 | var $$ = this,
|
30067 | config = $$.config,
|
30068 | state = $$.state,
|
30069 | $el = $$.$el,
|
30070 | isMultipleX = $$.isMultipleX();
|
30071 | if ($el.eventRect) $$.updateEventRect($el.eventRect, !0);else {
|
30072 | var eventRects = $$.$el.main.select("." + config_classes.eventRects).style("cursor", config.zoom_enabled && config.zoom_type !== "drag" ? config.axis_rotated ? "ns-resize" : "ew-resize" : null).classed(config_classes.eventRectsMultiple, isMultipleX).classed(config_classes.eventRectsSingle, !isMultipleX),
|
30073 | eventRectUpdate = eventRects.selectAll("." + config_classes.eventRect).data([0]).enter().append("rect"); // append event <rect>
|
30074 |
|
30075 | // bind event to <rect> element
|
30076 | // bind draggable selection
|
30077 | $$.updateEventRect(eventRectUpdate), isMultipleX ? $$.generateEventRectsForMultipleXs(eventRectUpdate) : $$.generateEventRectsForSingleX(eventRectUpdate), eventRectUpdate.call($$.getDraggableSelection()), $el.eventRect = eventRectUpdate, $$.state.inputType !== "touch" || $el.svg.on("touchstart.eventRect") || $$.hasArcType() || $$.bindTouchOnEventRect(isMultipleX);
|
30078 | }
|
30079 |
|
30080 | if (!isMultipleX) {
|
30081 | // Set data and update eventReceiver.data
|
30082 | var xAxisTickValues = $$.getMaxDataCountTarget(); // update data's index value to be alinged with the x Axis
|
30083 |
|
30084 | $$.updateDataIndexByX(xAxisTickValues), $$.updateXs(xAxisTickValues), $$.updatePointClass && $$.updatePointClass(!0), state.eventReceiver.data = xAxisTickValues;
|
30085 | }
|
30086 |
|
30087 | $$.updateEventRectData();
|
30088 | },
|
30089 | bindTouchOnEventRect: function bindTouchOnEventRect(isMultipleX) {
|
30090 | var startPx,
|
30091 | $$ = this,
|
30092 | config = $$.config,
|
30093 | state = $$.state,
|
30094 | _$$$$el = $$.$el,
|
30095 | eventRect = _$$$$el.eventRect,
|
30096 | svg = _$$$$el.svg,
|
30097 | selectRect = function (context) {
|
30098 | if (isMultipleX) $$.selectRectForMultipleXs(context);else {
|
30099 | var index = $$.getDataIndexFromEvent(state.event);
|
30100 | $$.callOverOutForTouch(index), index === -1 ? $$.unselectRect() : $$.selectRectForSingle(context, eventRect, index);
|
30101 | }
|
30102 | },
|
30103 | unselectRect = function () {
|
30104 | $$.unselectRect(), $$.callOverOutForTouch();
|
30105 | },
|
30106 | preventDefault = config.interaction_inputType_touch.preventDefault,
|
30107 | isPrevented = isboolean(preventDefault) && preventDefault || !1,
|
30108 | preventThreshold = !isNaN(preventDefault) && preventDefault || null,
|
30109 | preventEvent = function (event) {
|
30110 | var eventType = event.type,
|
30111 | touch = event.changedTouches[0],
|
30112 | currentXY = touch["client" + (config.axis_rotated ? "Y" : "X")];
|
30113 | eventType === "touchstart" ? isPrevented ? event.preventDefault() : preventThreshold !== null && (startPx = currentXY) : eventType === "touchmove" && (isPrevented || startPx === !0 || preventThreshold !== null && Math.abs(startPx - currentXY) >= preventThreshold) && (startPx = !0, event.preventDefault());
|
30114 | };
|
30115 |
|
30116 | // bind touch events
|
30117 | eventRect.on("touchstart", function (event) {
|
30118 | state.event = event, $$.updateEventRect();
|
30119 | }).on("touchstart.eventRect touchmove.eventRect", function (event) {
|
30120 | if (state.event = event, !eventRect.empty() && eventRect.classed(config_classes.eventRect)) {
|
30121 | // if touch points are > 1, means doing zooming interaction. In this case do not execute tooltip codes.
|
30122 | if (state.dragging || state.flowing || $$.hasArcType() || event.touches.length > 1) return;
|
30123 | preventEvent(event), selectRect(eventRect.node());
|
30124 | } else unselectRect();
|
30125 | }, !0).on("touchend.eventRect", function (event) {
|
30126 | state.event = event, !eventRect.empty() && eventRect.classed(config_classes.eventRect) && ($$.hasArcType() || !$$.toggleShape || state.cancelClick) && state.cancelClick && (state.cancelClick = !1);
|
30127 | }, !0), svg.on("touchstart", function (event) {
|
30128 | state.event = event;
|
30129 | var target = event.target;
|
30130 | target && target !== eventRect.node() && unselectRect();
|
30131 | });
|
30132 | },
|
30133 |
|
30134 | /**
|
30135 | * Update event rect size
|
30136 | * @param {d3Selection} eventRect Event <rect> element
|
30137 | * @param {boolean} force Force to update
|
30138 | * @private
|
30139 | */
|
30140 | updateEventRect: function updateEventRect(eventRect, force) {
|
30141 | force === void 0 && (force = !1);
|
30142 | var $$ = this,
|
30143 | state = $$.state,
|
30144 | $el = $$.$el,
|
30145 | _state = state,
|
30146 | eventReceiver = _state.eventReceiver,
|
30147 | width = _state.width,
|
30148 | height = _state.height,
|
30149 | rendered = _state.rendered,
|
30150 | resizing = _state.resizing,
|
30151 | rectElement = eventRect || $el.eventRect;
|
30152 | (!rendered || resizing || force) && (rectElement.attr("x", 0).attr("y", 0).attr("width", width).attr("height", height), !rendered && rectElement.attr("class", config_classes.eventRect)), function updateClientRect() {
|
30153 | eventReceiver && (eventReceiver.rect = rectElement.node().getBoundingClientRect());
|
30154 | }();
|
30155 | },
|
30156 |
|
30157 | /**
|
30158 | * Updates the location and size of the eventRect.
|
30159 | * @private
|
30160 | */
|
30161 | updateEventRectData: function updateEventRectData() {
|
30162 | var x,
|
30163 | y,
|
30164 | w,
|
30165 | h,
|
30166 | $$ = this,
|
30167 | config = $$.config,
|
30168 | scale = $$.scale,
|
30169 | state = $$.state,
|
30170 | xScale = scale.zoom || scale.x,
|
30171 | isRotated = config.axis_rotated;
|
30172 | if ($$.isMultipleX()) // TODO: rotated not supported yet
|
30173 | x = 0, y = 0, w = state.width, h = state.height;else {
|
30174 | var rectW, rectX;
|
30175 | if ($$.axis.isCategorized()) rectW = $$.getEventRectWidth(), rectX = function (d) {
|
30176 | return xScale(d.x) - rectW / 2;
|
30177 | };else {
|
30178 | var getPrevNextX = function (_ref) {
|
30179 | var index = _ref.index;
|
30180 | return {
|
30181 | prev: $$.getPrevX(index),
|
30182 | next: $$.getNextX(index)
|
30183 | };
|
30184 | };
|
30185 |
|
30186 | rectW = function (d) {
|
30187 | var x = getPrevNextX(d); // if there this is a single data point make the eventRect full width (or height)
|
30188 |
|
30189 | return x.prev === null && x.next === null ? isRotated ? state.height : state.width : (x.prev === null && (x.prev = xScale.domain()[0]), x.next === null && (x.next = xScale.domain()[1]), Math.max(0, (xScale(x.next) - xScale(x.prev)) / 2));
|
30190 | }, rectX = function (d) {
|
30191 | var x = getPrevNextX(d),
|
30192 | thisX = d.x;
|
30193 | // if there this is a single data point position the eventRect at 0
|
30194 | return x.prev === null && x.next === null ? 0 : (x.prev === null && (x.prev = xScale.domain()[0]), (xScale(thisX) + xScale(x.prev)) / 2);
|
30195 | };
|
30196 | }
|
30197 | x = isRotated ? 0 : rectX, y = isRotated ? rectX : 0, w = isRotated ? state.width : rectW, h = isRotated ? rectW : state.height;
|
30198 | }
|
30199 |
|
30200 | var eventReceiver = state.eventReceiver,
|
30201 | call = function (fn, v) {
|
30202 | return isFunction(fn) ? fn(v) : fn;
|
30203 | };
|
30204 |
|
30205 | // reset for possible remains coords data before the data loading
|
30206 | eventReceiver.coords.splice(eventReceiver.data.length), eventReceiver.data.forEach(function (d, i) {
|
30207 | eventReceiver.coords[i] = {
|
30208 | x: call(x, d),
|
30209 | y: call(y, d),
|
30210 | w: call(w, d),
|
30211 | h: call(h, d)
|
30212 | };
|
30213 | });
|
30214 | },
|
30215 | selectRectForMultipleXs: function selectRectForMultipleXs(context) {
|
30216 | var $$ = this,
|
30217 | config = $$.config,
|
30218 | state = $$.state,
|
30219 | targetsToShow = $$.filterTargetsToShow($$.data.targets);
|
30220 |
|
30221 | // do nothing when dragging
|
30222 | if (!(state.dragging || $$.hasArcType(targetsToShow))) {
|
30223 | var mouse = getPointer(state.event, context),
|
30224 | closest = $$.findClosestFromTargets(targetsToShow, mouse);
|
30225 | if (state.mouseover && (!closest || closest.id !== state.mouseover.id) && (config.data_onout.call($$.api, state.mouseover), state.mouseover = undefined), !closest) return void $$.unselectRect();
|
30226 | var sameXData = $$.isBubbleType(closest) || $$.isScatterType(closest) || !config.tooltip_grouped ? [closest] : $$.filterByX(targetsToShow, closest.x),
|
30227 | selectedData = sameXData.map(function (d) {
|
30228 | return $$.addName(d);
|
30229 | }); // show tooltip when cursor is close to some point
|
30230 |
|
30231 | $$.showTooltip(selectedData, context), $$.expandCirclesBars(closest.index, closest.id, !0), $$.showGridFocus(selectedData), ($$.isBarType(closest.id) || $$.dist(closest, mouse) < config.point_sensitivity) && ($$.$el.svg.select("." + config_classes.eventRect).style("cursor", "pointer"), !state.mouseover && (config.data_onover.call($$.api, closest), state.mouseover = closest));
|
30232 | }
|
30233 | },
|
30234 |
|
30235 | /**
|
30236 | * Unselect EventRect.
|
30237 | * @private
|
30238 | */
|
30239 | unselectRect: function unselectRect() {
|
30240 | var $$ = this,
|
30241 | config = $$.config,
|
30242 | _$$$$el2 = $$.$el,
|
30243 | bar = _$$$$el2.bar,
|
30244 | circle = _$$$$el2.circle,
|
30245 | tooltip = _$$$$el2.tooltip;
|
30246 | $$.$el.svg.select("." + config_classes.eventRect).style("cursor", null), $$.hideGridFocus(), tooltip && ($$.hideTooltip(), $$._handleLinkedCharts(!1)), circle && !config.point_focus_only && $$.unexpandCircles(), bar && $$.unexpandBars();
|
30247 | },
|
30248 |
|
30249 | /**
|
30250 | * Create eventRect for each data on the x-axis.
|
30251 | * Register touch and drag events.
|
30252 | * @param {object} eventRectEnter d3.select(CLASS.eventRects) object.
|
30253 | * @returns {object} d3.select(CLASS.eventRects) object.
|
30254 | * @private
|
30255 | */
|
30256 | generateEventRectsForSingleX: function generateEventRectsForSingleX(eventRectEnter) {
|
30257 | var $$ = this,
|
30258 | config = $$.config,
|
30259 | state = $$.state,
|
30260 | eventReceiver = state.eventReceiver,
|
30261 | rect = eventRectEnter.style("cursor", config.data_selection_enabled && config.data_selection_grouped ? "pointer" : null).on("click", function (event) {
|
30262 | state.event = event;
|
30263 | var _eventReceiver = eventReceiver,
|
30264 | currentIdx = _eventReceiver.currentIdx,
|
30265 | data = _eventReceiver.data,
|
30266 | d = data[currentIdx === -1 ? $$.getDataIndexFromEvent(event) : currentIdx];
|
30267 | $$.clickHandlerForSingleX.bind(this)(d, $$);
|
30268 | });
|
30269 |
|
30270 | if (state.inputType === "mouse") {
|
30271 | var getData = function (event) {
|
30272 | var index = event ? $$.getDataIndexFromEvent(event) : eventReceiver.currentIdx;
|
30273 | return index > -1 ? eventReceiver.data[index] : null;
|
30274 | };
|
30275 |
|
30276 | rect.on("mouseover", function (event) {
|
30277 | state.event = event, $$.updateEventRect();
|
30278 | }).on("mousemove", function (event) {
|
30279 | var d = getData(event);
|
30280 |
|
30281 | // do nothing while dragging/flowing
|
30282 | if (state.event = event, !(state.dragging || state.flowing || $$.hasArcType() || !d || config.tooltip_grouped && d && d.index === eventReceiver.currentIdx)) {
|
30283 | var index = d.index;
|
30284 | $$.isStepType(d) && config.line_step_type === "step-after" && getPointer(event, this)[0] < $$.scale.x($$.getXValue(d.id, index)) && (index -= 1), index !== eventReceiver.currentIdx && ($$.setOverOut(!1, eventReceiver.currentIdx), eventReceiver.currentIdx = index), index === -1 ? $$.unselectRect() : $$.selectRectForSingle(this, rect, index), $$.setOverOut(index !== -1, index);
|
30285 | }
|
30286 | }).on("mouseout", function (event) {
|
30287 | state.event = event;
|
30288 | // chart is destroyed
|
30289 | !config || $$.hasArcType() || eventReceiver.currentIdx === -1 || ( // reset the event current index
|
30290 | $$.unselectRect(), $$.setOverOut(!1, eventReceiver.currentIdx), eventReceiver.currentIdx = -1);
|
30291 | });
|
30292 | }
|
30293 |
|
30294 | return rect;
|
30295 | },
|
30296 | clickHandlerForSingleX: function clickHandlerForSingleX(d, ctx) {
|
30297 | var $$ = ctx,
|
30298 | config = $$.config,
|
30299 | state = $$.state,
|
30300 | main = $$.$el.main;
|
30301 | if (!d || $$.hasArcType() || state.cancelClick) return void (state.cancelClick && (state.cancelClick = !1));
|
30302 | var index = d.index;
|
30303 | main.selectAll("." + config_classes.shape + "-" + index).each(function (d2) {
|
30304 | (config.data_selection_grouped || $$.isWithinShape(this, d2)) && ($$.toggleShape && $$.toggleShape(this, d2, index), config.data_onclick.bind($$.api)(d2, this));
|
30305 | });
|
30306 | },
|
30307 |
|
30308 | /**
|
30309 | * Create an eventRect,
|
30310 | * Register touch and drag events.
|
30311 | * @param {object} eventRectEnter d3.select(CLASS.eventRects) object.
|
30312 | * @private
|
30313 | */
|
30314 | generateEventRectsForMultipleXs: function generateEventRectsForMultipleXs(eventRectEnter) {
|
30315 | var $$ = this,
|
30316 | state = $$.state;
|
30317 | eventRectEnter.on("click", function (event) {
|
30318 | state.event = event, $$.clickHandlerForMultipleXS.bind(this)($$);
|
30319 | }), state.inputType === "mouse" && eventRectEnter.on("mouseover mousemove", function (event) {
|
30320 | state.event = event, $$.selectRectForMultipleXs(this);
|
30321 | }).on("mouseout", function (event) {
|
30322 | state.event = event;
|
30323 | // chart is destroyed
|
30324 | !$$.config || $$.hasArcType() || $$.unselectRect();
|
30325 | });
|
30326 | },
|
30327 | clickHandlerForMultipleXS: function clickHandlerForMultipleXS(ctx) {
|
30328 | var $$ = ctx,
|
30329 | config = $$.config,
|
30330 | state = $$.state,
|
30331 | targetsToShow = $$.filterTargetsToShow($$.data.targets);
|
30332 |
|
30333 | if (!$$.hasArcType(targetsToShow)) {
|
30334 | var mouse = getPointer(state.event, this),
|
30335 | closest = $$.findClosestFromTargets(targetsToShow, mouse);
|
30336 | !closest || ($$.isBarType(closest.id) || $$.dist(closest, mouse) < config.point_sensitivity) && $$.$el.main.selectAll("." + config_classes.shapes + $$.getTargetSelectorSuffix(closest.id)).selectAll("." + config_classes.shape + "-" + closest.index).each(function () {
|
30337 | (config.data_selection_grouped || $$.isWithinShape(this, closest)) && ($$.toggleShape && $$.toggleShape(this, closest, closest.index), config.data_onclick.bind($$.api)(closest, this));
|
30338 | });
|
30339 | } // select if selection enabled
|
30340 |
|
30341 | }
|
30342 | });
|
30343 | ;// CONCATENATED MODULE: ./node_modules/d3-ease/src/linear.js
|
30344 | var src_linear_linear = function (t) {
|
30345 | return +t;
|
30346 | };
|
30347 | ;// CONCATENATED MODULE: ./src/ChartInternal/interactions/flow.ts
|
30348 | /**
|
30349 | * Copyright (c) 2017 ~ present NAVER Corp.
|
30350 | * billboard.js project is licensed under the MIT license
|
30351 | */
|
30352 |
|
30353 |
|
30354 |
|
30355 |
|
30356 | /* harmony default export */ var interactions_flow = ({
|
30357 | /**
|
30358 | * Generate flow
|
30359 | * @param {object} args option object
|
30360 | * @returns {Function}
|
30361 | * @private
|
30362 | */
|
30363 | generateFlow: function generateFlow(args) {
|
30364 | var $$ = this,
|
30365 | data = $$.data,
|
30366 | state = $$.state,
|
30367 | $el = $$.$el;
|
30368 | return function () {
|
30369 | var flowLength = args.flow.length; // set flag
|
30370 |
|
30371 | state.flowing = !0, data.targets.forEach(function (d) {
|
30372 | d.values.splice(0, flowLength);
|
30373 | }), $$.updateXGrid && $$.updateXGrid(!0);
|
30374 | // target elements
|
30375 | var elements = {};
|
30376 | ["axis.x", "grid.x", "gridLines.x", "region.list", "text", "bar", "line", "area", "circle"].forEach(function (v) {
|
30377 | var name = v.split("."),
|
30378 | node = $el[name[0]];
|
30379 | node && name.length > 1 && (node = node[name[1]]), node && node.size() && (elements[v] = node);
|
30380 | }), $$.hideGridFocus(), $$.setFlowList(elements, args);
|
30381 | };
|
30382 | },
|
30383 |
|
30384 | /**
|
30385 | * Set flow list
|
30386 | * @param {object} elements Target elements
|
30387 | * @param {object} args option object
|
30388 | * @private
|
30389 | */
|
30390 | setFlowList: function setFlowList(elements, args) {
|
30391 | var n,
|
30392 | $$ = this,
|
30393 | flow = args.flow,
|
30394 | targets = args.targets,
|
30395 | _flow = flow,
|
30396 | _flow$duration = _flow.duration,
|
30397 | duration = _flow$duration === void 0 ? args.duration : _flow$duration,
|
30398 | flowIndex = _flow.index,
|
30399 | flowLength = _flow.length,
|
30400 | orgDataCount = _flow.orgDataCount,
|
30401 | transform = $$.getFlowTransform(targets, orgDataCount, flowIndex, flowLength),
|
30402 | wait = generateWait();
|
30403 | wait.add(Object.keys(elements).map(function (v) {
|
30404 | return n = elements[v].transition().ease(src_linear_linear).duration(duration), n = v === "axis.x" ? n.call(function (g) {
|
30405 | $$.axis.x.setTransition(g).create(g);
|
30406 | }) : v === "region.list" ? n.filter($$.isRegionOnX).attr("transform", transform) : n.attr("transform", transform), n;
|
30407 | })), n.call(wait, function () {
|
30408 | $$.cleanUpFlow(elements, args);
|
30409 | });
|
30410 | },
|
30411 |
|
30412 | /**
|
30413 | * Clean up flow
|
30414 | * @param {object} elements Target elements
|
30415 | * @param {object} args option object
|
30416 | * @private
|
30417 | */
|
30418 | cleanUpFlow: function cleanUpFlow(elements, args) {
|
30419 | var $$ = this,
|
30420 | config = $$.config,
|
30421 | state = $$.state,
|
30422 | svg = $$.$el.svg,
|
30423 | isRotated = config.axis_rotated,
|
30424 | flow = args.flow,
|
30425 | shape = args.shape,
|
30426 | xv = args.xv,
|
30427 | _shape$pos = shape.pos,
|
30428 | cx = _shape$pos.cx,
|
30429 | cy = _shape$pos.cy,
|
30430 | xForText = _shape$pos.xForText,
|
30431 | yForText = _shape$pos.yForText,
|
30432 | _flow2 = flow,
|
30433 | _flow2$done = _flow2.done,
|
30434 | done = _flow2$done === void 0 ? function () {} : _flow2$done,
|
30435 | flowLength = _flow2.length;
|
30436 | // draw again for removing flowed elements and reverting attr
|
30437 | // callback for end of flow
|
30438 | flowLength && (["circle", "text", "shape", "eventRect"].forEach(function (v) {
|
30439 | var target = [];
|
30440 |
|
30441 | for (var i = 0; i < flowLength; i++) target.push("." + config_classes[v] + "-" + i);
|
30442 |
|
30443 | svg.selectAll("." + config_classes[v + "s"]) // circles, shapes, texts, eventRects
|
30444 | .selectAll(target).remove();
|
30445 | }), svg.select("." + config_classes.xgrid).remove()), Object.keys(elements).forEach(function (v) {
|
30446 | var n = elements[v];
|
30447 | if (v !== "axis.x" && n.attr("transform", null), v === "grid.x") n.attr(state.xgridAttr);else if (v === "gridLines.x") n.attr("x1", isRotated ? 0 : xv).attr("x2", isRotated ? state.width : xv);else if (v === "gridLines.x") n.select("line").attr("x1", isRotated ? 0 : xv).attr("x2", isRotated ? state.width : xv), n.select("text").attr("x", isRotated ? state.width : 0).attr("y", xv);else if (/^(area|bar|line)$/.test(v)) n.attr("d", shape.type[v]);else if (v === "text") n.attr("x", xForText).attr("y", yForText).style("fill-opacity", $$.opacityForText.bind($$));else if (v !== "circle") v === "region.list" && n.select("rect").filter($$.isRegionOnX).attr("x", $$.regionX.bind($$)).attr("width", $$.regionWidth.bind($$));else if ($$.isCirclePoint()) n.attr("cx", cx).attr("cy", cy);else {
|
30448 | var xFunc = function (d) {
|
30449 | return cx(d) - config.point_r;
|
30450 | },
|
30451 | yFunc = function (d) {
|
30452 | return cy(d) - config.point_r;
|
30453 | };
|
30454 |
|
30455 | n.attr("x", xFunc).attr("y", yFunc).attr("cx", cx) // when pattern is used, it possibly contain 'circle' also.
|
30456 | .attr("cy", cy);
|
30457 | }
|
30458 | }), config.interaction_enabled && $$.redrawEventRect(), done.call($$.api), state.flowing = !1;
|
30459 | },
|
30460 |
|
30461 | /**
|
30462 | * Get flow transform value
|
30463 | * @param {object} targets target
|
30464 | * @param {number} orgDataCount original data count
|
30465 | * @param {number} flowIndex flow index
|
30466 | * @param {number} flowLength flow length
|
30467 | * @returns {string}
|
30468 | * @private
|
30469 | */
|
30470 | getFlowTransform: function getFlowTransform(targets, orgDataCount, flowIndex, flowLength) {
|
30471 | var translateX,
|
30472 | $$ = this,
|
30473 | data = $$.data,
|
30474 | x = $$.scale.x,
|
30475 | dataValues = data.targets[0].values,
|
30476 | flowStart = $$.getValueOnIndex(dataValues, flowIndex),
|
30477 | flowEnd = $$.getValueOnIndex(dataValues, flowIndex + flowLength),
|
30478 | orgDomain = x.domain(),
|
30479 | domain = $$.updateXDomain(targets, !0, !0);
|
30480 | orgDataCount ? orgDataCount === 1 || (flowStart && flowStart.x) === (flowEnd && flowEnd.x) ? translateX = x(orgDomain[0]) - x(domain[0]) : translateX = $$.axis.isTimeSeries() ? x(orgDomain[0]) - x(domain[0]) : x(flowStart.x) - x(flowEnd.x) : dataValues.length === 1 ? $$.axis.isTimeSeries() ? (flowStart = $$.getValueOnIndex(dataValues, 0), flowEnd = $$.getValueOnIndex(dataValues, dataValues.length - 1), translateX = x(flowStart.x) - x(flowEnd.x)) : translateX = diffDomain(domain) / 2 : translateX = x(orgDomain[0]) - x(domain[0]);
|
30481 | var scaleX = diffDomain(orgDomain) / diffDomain(domain);
|
30482 | return "translate(" + translateX + ",0) scale(" + scaleX + ",1)";
|
30483 | }
|
30484 | });
|
30485 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/clip.ts
|
30486 | /**
|
30487 | * Copyright (c) 2017 ~ present NAVER Corp.
|
30488 | * billboard.js project is licensed under the MIT license
|
30489 | */
|
30490 |
|
30491 | /* harmony default export */ var clip = ({
|
30492 | initClip: function initClip() {
|
30493 | var $$ = this,
|
30494 | clip = $$.state.clip;
|
30495 | // MEMO: clipId needs to be unique because it conflicts when multiple charts exist
|
30496 | // Define 'clip-path' attribute values
|
30497 | clip.id = $$.state.datetimeId + "-clip", clip.idXAxis = clip.id + "-xaxis", clip.idYAxis = clip.id + "-yaxis", clip.idGrid = clip.id + "-grid", clip.path = $$.getClipPath(clip.id), clip.pathXAxis = $$.getClipPath(clip.idXAxis), clip.pathYAxis = $$.getClipPath(clip.idYAxis), clip.pathGrid = $$.getClipPath(clip.idGrid);
|
30498 | },
|
30499 | getClipPath: function getClipPath(id) {
|
30500 | var $$ = this,
|
30501 | config = $$.config;
|
30502 | if (!config.clipPath && /-clip$/.test(id) || !config.axis_x_clipPath && /-clip-xaxis$/.test(id) || !config.axis_y_clipPath && /-clip-yaxis$/.test(id)) return null;
|
30503 | var isIE9 = !!win.navigator && win.navigator.appVersion.toLowerCase().indexOf("msie 9.") >= 0;
|
30504 | return "url(" + (isIE9 ? "" : browser_doc.URL.split("#")[0]) + "#" + id + ")";
|
30505 | },
|
30506 | appendClip: function appendClip(parent, id) {
|
30507 | id && parent.append("clipPath").attr("id", id).append("rect");
|
30508 | },
|
30509 |
|
30510 | /**
|
30511 | * Set x Axis clipPath dimension
|
30512 | * @param {d3Selecton} node clipPath <rect> selection
|
30513 | * @private
|
30514 | */
|
30515 | setXAxisClipPath: function setXAxisClipPath(node) {
|
30516 | var $$ = this,
|
30517 | config = $$.config,
|
30518 | _$$$state = $$.state,
|
30519 | margin = _$$$state.margin,
|
30520 | width = _$$$state.width,
|
30521 | height = _$$$state.height,
|
30522 | isRotated = config.axis_rotated,
|
30523 | left = Math.max(30, margin.left) - (isRotated ? 0 : 20),
|
30524 | x = isRotated ? -(1 + left) : -(left - 1),
|
30525 | y = -Math.max(15, margin.top),
|
30526 | w = isRotated ? margin.left + 20 : width + 10 + left,
|
30527 | h = (isRotated ? margin.top + height + 10 : margin.bottom) + 20;
|
30528 | node.attr("x", x).attr("y", y).attr("width", w).attr("height", h);
|
30529 | },
|
30530 |
|
30531 | /**
|
30532 | * Set y Axis clipPath dimension
|
30533 | * @param {d3Selecton} node clipPath <rect> selection
|
30534 | * @private
|
30535 | */
|
30536 | setYAxisClipPath: function setYAxisClipPath(node) {
|
30537 | var $$ = this,
|
30538 | config = $$.config,
|
30539 | _$$$state2 = $$.state,
|
30540 | margin = _$$$state2.margin,
|
30541 | width = _$$$state2.width,
|
30542 | height = _$$$state2.height,
|
30543 | isRotated = config.axis_rotated,
|
30544 | left = Math.max(30, margin.left) - (isRotated ? 20 : 0),
|
30545 | isInner = config.axis_y_inner,
|
30546 | x = isInner ? -1 : isRotated ? -(1 + left) : -(left - 1),
|
30547 | y = -(isRotated ? 20 : margin.top),
|
30548 | w = (isRotated ? width + 15 + left : margin.left + 20) + (isInner ? 20 : 0),
|
30549 | h = (isRotated ? margin.bottom : margin.top + height) + 10;
|
30550 | node.attr("x", x).attr("y", y).attr("width", w).attr("height", h);
|
30551 | },
|
30552 | updateXAxisTickClip: function updateXAxisTickClip() {
|
30553 | var $$ = this,
|
30554 | config = $$.config,
|
30555 | _$$$state3 = $$.state,
|
30556 | clip = _$$$state3.clip,
|
30557 | xAxisHeight = _$$$state3.xAxisHeight,
|
30558 | defs = $$.$el.defs,
|
30559 | newXAxisHeight = $$.getHorizontalAxisHeight("x");
|
30560 |
|
30561 | if (defs && !clip.idXAxisTickTexts) {
|
30562 | var clipId = clip.id + "-xaxisticktexts";
|
30563 | $$.appendClip(defs, clipId), clip.pathXAxisTickTexts = $$.getClipPath(clip.idXAxisTickTexts), clip.idXAxisTickTexts = clipId;
|
30564 | }
|
30565 |
|
30566 | !config.axis_x_tick_multiline && $$.getAxisTickRotate("x") && newXAxisHeight !== xAxisHeight && ($$.setXAxisTickClipWidth(), $$.setXAxisTickTextClipPathWidth()), $$.state.xAxisHeight = newXAxisHeight;
|
30567 | },
|
30568 | setXAxisTickClipWidth: function setXAxisTickClipWidth() {
|
30569 | var $$ = this,
|
30570 | config = $$.config,
|
30571 | maxTickWidths = $$.state.current.maxTickWidths,
|
30572 | xAxisTickRotate = $$.getAxisTickRotate("x");
|
30573 |
|
30574 | if (!config.axis_x_tick_multiline && xAxisTickRotate) {
|
30575 | var sinRotation = Math.sin(Math.PI / 180 * Math.abs(xAxisTickRotate));
|
30576 | maxTickWidths.x.clipPath = ($$.getHorizontalAxisHeight("x") - 20) / sinRotation;
|
30577 | } else maxTickWidths.x.clipPath = null;
|
30578 | },
|
30579 | setXAxisTickTextClipPathWidth: function setXAxisTickTextClipPathWidth() {
|
30580 | var $$ = this,
|
30581 | _$$$state4 = $$.state,
|
30582 | clip = _$$$state4.clip,
|
30583 | current = _$$$state4.current,
|
30584 | svg = $$.$el.svg;
|
30585 | svg && svg.select("#" + clip.idXAxisTickTexts + " rect").attr("width", current.maxTickWidths.x.clipPath).attr("height", 30);
|
30586 | }
|
30587 | });
|
30588 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/grid.ts
|
30589 | /**
|
30590 | * Copyright (c) 2017 ~ present NAVER Corp.
|
30591 | * billboard.js project is licensed under the MIT license
|
30592 | */
|
30593 |
|
30594 |
|
30595 | // Grid position and text anchor helpers
|
30596 |
|
30597 | var getGridTextAnchor = function (d) {
|
30598 | return isValue(d.position) || "end";
|
30599 | },
|
30600 | getGridTextDx = function (d) {
|
30601 | return d.position === "start" ? 4 : d.position === "middle" ? 0 : -4;
|
30602 | };
|
30603 |
|
30604 | /**
|
30605 | * Get grid text x value getter function
|
30606 | * @param {boolean} isX Is x Axis
|
30607 | * @param {number} width Width value
|
30608 | * @param {number} height Height value
|
30609 | * @returns {Function}
|
30610 | * @private
|
30611 | */
|
30612 | function getGridTextX(isX, width, height) {
|
30613 | return function (d) {
|
30614 | var x = isX ? 0 : width;
|
30615 | return d.position === "start" ? x = isX ? -height : 0 : d.position === "middle" && (x = (isX ? -height : width) / 2), x;
|
30616 | };
|
30617 | }
|
30618 | /**
|
30619 | * Update coordinate attributes value
|
30620 | * @param {d3.selection} el Target node
|
30621 | * @param {string} type Type
|
30622 | * @private
|
30623 | */
|
30624 |
|
30625 |
|
30626 | function smoothLines(el, type) {
|
30627 | type === "grid" && el.each(function () {
|
30628 | var g = src_select(this);
|
30629 | ["x1", "x2", "y1", "y2"].forEach(function (v) {
|
30630 | return g.attr(v, Math.ceil(+g.attr(v)));
|
30631 | });
|
30632 | });
|
30633 | }
|
30634 |
|
30635 | /* harmony default export */ var grid = ({
|
30636 | hasGrid: function hasGrid() {
|
30637 | var config = this.config;
|
30638 | return ["x", "y"].some(function (v) {
|
30639 | return config["grid_" + v + "_show"] || config["grid_" + v + "_lines"].length;
|
30640 | });
|
30641 | },
|
30642 | initGrid: function initGrid() {
|
30643 | var $$ = this;
|
30644 | $$.hasGrid() && $$.initGridLines(), $$.initFocusGrid();
|
30645 | },
|
30646 | initGridLines: function initGridLines() {
|
30647 | var $$ = this,
|
30648 | config = $$.config,
|
30649 | clip = $$.state.clip,
|
30650 | $el = $$.$el;
|
30651 | (config.grid_x_lines.length || config.grid_y_lines.length) && ($el.gridLines.main = $el.main.insert("g", "." + config_classes.chart + (config.grid_lines_front ? " + *" : "")).attr("clip-path", clip.pathGrid).attr("class", config_classes.grid + " " + config_classes.gridLines), $el.gridLines.main.append("g").attr("class", config_classes.xgridLines), $el.gridLines.main.append("g").attr("class", config_classes.ygridLines), $el.gridLines.x = src_selectAll([]));
|
30652 | },
|
30653 | updateXGrid: function updateXGrid(withoutUpdate) {
|
30654 | var $$ = this,
|
30655 | config = $$.config,
|
30656 | scale = $$.scale,
|
30657 | state = $$.state,
|
30658 | _$$$$el = $$.$el,
|
30659 | main = _$$$$el.main,
|
30660 | grid = _$$$$el.grid,
|
30661 | isRotated = config.axis_rotated,
|
30662 | xgridData = $$.generateGridData(config.grid_x_type, scale.x),
|
30663 | tickOffset = $$.axis.isCategorized() ? $$.axis.x.tickOffset() : 0,
|
30664 | pos = function (d) {
|
30665 | return (scale.zoom || scale.x)(d) + tickOffset * (isRotated ? -1 : 1);
|
30666 | };
|
30667 |
|
30668 | state.xgridAttr = isRotated ? {
|
30669 | "x1": 0,
|
30670 | "x2": state.width,
|
30671 | "y1": pos,
|
30672 | "y2": pos
|
30673 | } : {
|
30674 | "x1": pos,
|
30675 | "x2": pos,
|
30676 | "y1": 0,
|
30677 | "y2": state.height
|
30678 | }, grid.x = main.select("." + config_classes.xgrids).selectAll("." + config_classes.xgrid).data(xgridData), grid.x.exit().remove(), grid.x = grid.x.enter().append("line").attr("class", config_classes.xgrid).merge(grid.x), withoutUpdate || grid.x.each(function () {
|
30679 | var grid = src_select(this);
|
30680 | Object.keys(state.xgridAttr).forEach(function (id) {
|
30681 | grid.attr(id, state.xgridAttr[id]).style("opacity", function () {
|
30682 | return grid.attr(isRotated ? "y1" : "x1") === (isRotated ? state.height : 0) ? "0" : "1";
|
30683 | });
|
30684 | });
|
30685 | });
|
30686 | },
|
30687 | updateYGrid: function updateYGrid() {
|
30688 | var $$ = this,
|
30689 | config = $$.config,
|
30690 | state = $$.state,
|
30691 | _$$$$el2 = $$.$el,
|
30692 | grid = _$$$$el2.grid,
|
30693 | main = _$$$$el2.main,
|
30694 | isRotated = config.axis_rotated,
|
30695 | gridValues = $$.axis.y.tickValues() || $$.scale.y.ticks(config.grid_y_ticks),
|
30696 | pos = function (d) {
|
30697 | return Math.ceil($$.scale.y(d));
|
30698 | };
|
30699 |
|
30700 | grid.y = main.select("." + config_classes.ygrids).selectAll("." + config_classes.ygrid).data(gridValues), grid.y.exit().remove(), grid.y = grid.y.enter().append("line").attr("class", config_classes.ygrid).merge(grid.y), grid.y.attr("x1", isRotated ? pos : 0).attr("x2", isRotated ? pos : state.width).attr("y1", isRotated ? 0 : pos).attr("y2", isRotated ? state.height : pos), smoothLines(grid.y, "grid");
|
30701 | },
|
30702 | updateGrid: function updateGrid(duration) {
|
30703 | var $$ = this,
|
30704 | _$$$$el3 = $$.$el,
|
30705 | grid = _$$$$el3.grid,
|
30706 | gridLines = _$$$$el3.gridLines;
|
30707 | // hide if arc type
|
30708 | gridLines.main || $$.initGridLines(), grid.main.style("visibility", $$.hasArcType() ? "hidden" : "visible"), $$.hideGridFocus(), $$.updateXGridLines(duration), $$.updateYGridLines(duration);
|
30709 | },
|
30710 |
|
30711 | /**
|
30712 | * Update X Grid lines
|
30713 | * @param {number} duration Dration value
|
30714 | * @private
|
30715 | */
|
30716 | updateXGridLines: function updateXGridLines(duration) {
|
30717 | var $$ = this,
|
30718 | config = $$.config,
|
30719 | _$$$$el4 = $$.$el,
|
30720 | gridLines = _$$$$el4.gridLines,
|
30721 | main = _$$$$el4.main,
|
30722 | isRotated = config.axis_rotated;
|
30723 | config.grid_x_show && $$.updateXGrid();
|
30724 | var xLines = main.select("." + config_classes.xgridLines).selectAll("." + config_classes.xgridLine).data(config.grid_x_lines); // exit
|
30725 |
|
30726 | xLines.exit().transition().duration(duration).style("opacity", "0").remove();
|
30727 | // enter
|
30728 | var xgridLine = xLines.enter().append("g");
|
30729 | xgridLine.append("line").style("opacity", "0"), xgridLine.append("text").attr("transform", isRotated ? "" : "rotate(-90)").attr("dy", -5).style("opacity", "0"), xLines = xgridLine.merge(xLines), xLines.attr("class", function (d) {
|
30730 | return (config_classes.xgridLine + " " + (d.class || "")).trim();
|
30731 | }).select("text").attr("text-anchor", getGridTextAnchor).attr("dx", getGridTextDx).transition().duration(duration).text(function (d) {
|
30732 | return d.text;
|
30733 | }).transition().style("opacity", "1"), gridLines.x = xLines;
|
30734 | },
|
30735 |
|
30736 | /**
|
30737 | * Update Y Grid lines
|
30738 | * @param {number} duration Duration value
|
30739 | * @private
|
30740 | */
|
30741 | updateYGridLines: function updateYGridLines(duration) {
|
30742 | var $$ = this,
|
30743 | config = $$.config,
|
30744 | _$$$state = $$.state,
|
30745 | width = _$$$state.width,
|
30746 | height = _$$$state.height,
|
30747 | $el = $$.$el,
|
30748 | isRotated = config.axis_rotated;
|
30749 | config.grid_y_show && $$.updateYGrid();
|
30750 | var ygridLines = $el.main.select("." + config_classes.ygridLines).selectAll("." + config_classes.ygridLine).data(config.grid_y_lines); // exit
|
30751 |
|
30752 | ygridLines.exit().transition().duration(duration).style("opacity", "0").remove();
|
30753 | // enter
|
30754 | var ygridLine = ygridLines.enter().append("g");
|
30755 | ygridLine.append("line").style("opacity", "0"), ygridLine.append("text").attr("transform", isRotated ? "rotate(-90)" : "").style("opacity", "0"), ygridLines = ygridLine.merge(ygridLines);
|
30756 | // update
|
30757 | var yv = $$.yv.bind($$);
|
30758 | ygridLines.attr("class", function (d) {
|
30759 | return (config_classes.ygridLine + " " + (d.class || "")).trim();
|
30760 | }).select("line").transition().duration(duration).attr("x1", isRotated ? yv : 0).attr("x2", isRotated ? yv : width).attr("y1", isRotated ? 0 : yv).attr("y2", isRotated ? height : yv).transition().style("opacity", "1"), ygridLines.select("text").attr("text-anchor", getGridTextAnchor).attr("dx", getGridTextDx).transition().duration(duration).attr("dy", -5).attr("x", getGridTextX(isRotated, width, height)).attr("y", yv).text(function (d) {
|
30761 | return d.text;
|
30762 | }).transition().style("opacity", "1"), $el.gridLines.y = ygridLines;
|
30763 | },
|
30764 | redrawGrid: function redrawGrid(withTransition) {
|
30765 | var $$ = this,
|
30766 | isRotated = $$.config.axis_rotated,
|
30767 | _$$$state2 = $$.state,
|
30768 | width = _$$$state2.width,
|
30769 | height = _$$$state2.height,
|
30770 | gridLines = $$.$el.gridLines,
|
30771 | xv = $$.xv.bind($$),
|
30772 | lines = gridLines.x.select("line"),
|
30773 | texts = gridLines.x.select("text");
|
30774 | return lines = (withTransition ? lines.transition() : lines).attr("x1", isRotated ? 0 : xv).attr("x2", isRotated ? width : xv).attr("y1", isRotated ? xv : 0).attr("y2", isRotated ? xv : height), texts = (withTransition ? texts.transition() : texts).attr("x", getGridTextX(!isRotated, width, height)).attr("y", xv).text(function (d) {
|
30775 | return d.text;
|
30776 | }), [lines.style("opacity", "1"), texts.style("opacity", "1")];
|
30777 | },
|
30778 | initFocusGrid: function initFocusGrid() {
|
30779 | var $$ = this,
|
30780 | config = $$.config,
|
30781 | clip = $$.state.clip,
|
30782 | $el = $$.$el,
|
30783 | isFront = config.grid_front,
|
30784 | className = "." + config_classes[isFront && $el.gridLines.main ? "gridLines" : "chart"] + (isFront ? " + *" : ""),
|
30785 | grid = $el.main.insert("g", className).attr("clip-path", clip.pathGrid).attr("class", config_classes.grid);
|
30786 | $el.grid.main = grid, config.grid_x_show && grid.append("g").attr("class", config_classes.xgrids), config.grid_y_show && grid.append("g").attr("class", config_classes.ygrids), config.interaction_enabled && config.grid_focus_show && (grid.append("g").attr("class", config_classes.xgridFocus).append("line").attr("class", config_classes.xgridFocus), config.grid_focus_y && !config.tooltip_grouped && grid.append("g").attr("class", config_classes.ygridFocus).append("line").attr("class", config_classes.ygridFocus));
|
30787 | },
|
30788 |
|
30789 | /**
|
30790 | * Show grid focus line
|
30791 | * @param {Array} data Selected data
|
30792 | * @private
|
30793 | */
|
30794 | showGridFocus: function showGridFocus(data) {
|
30795 | var $$ = this,
|
30796 | config = $$.config,
|
30797 | _$$$state3 = $$.state,
|
30798 | width = _$$$state3.width,
|
30799 | height = _$$$state3.height,
|
30800 | isRotated = config.axis_rotated,
|
30801 | focusEl = $$.$el.main.selectAll("line." + config_classes.xgridFocus + ", line." + config_classes.ygridFocus),
|
30802 | dataToShow = (data || [focusEl.datum()]).filter(function (d) {
|
30803 | return d && isValue($$.getBaseValue(d));
|
30804 | });
|
30805 |
|
30806 | // Hide when bubble/scatter/stanford plot exists
|
30807 | if (!(!config.tooltip_show || dataToShow.length === 0 || $$.hasType("bubble") || $$.hasArcType())) {
|
30808 | var isEdge = config.grid_focus_edge && !config.tooltip_grouped,
|
30809 | xx = $$.xx.bind($$);
|
30810 | focusEl.style("visibility", "visible").data(dataToShow.concat(dataToShow)).each(function (d) {
|
30811 | var xy,
|
30812 | el = src_select(this),
|
30813 | pos = {
|
30814 | x: xx(d),
|
30815 | y: $$.getYScaleById(d.id)(d.value)
|
30816 | };
|
30817 | if (el.classed(config_classes.xgridFocus)) xy = isRotated ? [null, // x1
|
30818 | pos.x, // y1
|
30819 | isEdge ? pos.y : width, // x2
|
30820 | pos.x // y2
|
30821 | ] : [pos.x, isEdge ? pos.y : null, pos.x, height];else {
|
30822 | var isY2 = $$.axis.getId(d.id) === "y2";
|
30823 | xy = isRotated ? [pos.y, // x1
|
30824 | isEdge && !isY2 ? pos.x : null, // y1
|
30825 | pos.y, // x2
|
30826 | isEdge && isY2 ? pos.x : height // y2
|
30827 | ] : [isEdge && isY2 ? pos.x : null, pos.y, isEdge && !isY2 ? pos.x : width, pos.y];
|
30828 | }
|
30829 | ["x1", "y1", "x2", "y2"].forEach(function (v, i) {
|
30830 | return el.attr(v, xy[i]);
|
30831 | });
|
30832 | }), smoothLines(focusEl, "grid"), $$.showCircleFocus && $$.showCircleFocus(data);
|
30833 | }
|
30834 | },
|
30835 | hideGridFocus: function hideGridFocus() {
|
30836 | var $$ = this,
|
30837 | _$$$state4 = $$.state,
|
30838 | inputType = _$$$state4.inputType,
|
30839 | resizing = _$$$state4.resizing,
|
30840 | main = $$.$el.main;
|
30841 | inputType !== "mouse" && resizing || (main.selectAll("line." + config_classes.xgridFocus + ", line." + config_classes.ygridFocus).style("visibility", "hidden"), $$.hideCircleFocus && $$.hideCircleFocus());
|
30842 | },
|
30843 | updateGridFocus: function updateGridFocus() {
|
30844 | var $$ = this,
|
30845 | _$$$state5 = $$.state,
|
30846 | inputType = _$$$state5.inputType,
|
30847 | width = _$$$state5.width,
|
30848 | height = _$$$state5.height,
|
30849 | resizing = _$$$state5.resizing,
|
30850 | grid = $$.$el.grid,
|
30851 | xgridFocus = grid.main.select("line." + config_classes.xgridFocus);
|
30852 | if (inputType === "touch") xgridFocus.empty() ? resizing && $$.showCircleFocus() : $$.showGridFocus();else {
|
30853 | var _isRotated = $$.config.axis_rotated;
|
30854 | xgridFocus.attr("x1", _isRotated ? 0 : -10).attr("x2", _isRotated ? width : -10).attr("y1", _isRotated ? -10 : 0).attr("y2", _isRotated ? -10 : height);
|
30855 | } // need to return 'true' as of being pushed to the redraw list
|
30856 | // ref: getRedrawList()
|
30857 |
|
30858 | return !0;
|
30859 | },
|
30860 | generateGridData: function generateGridData(type, scale) {
|
30861 | var $$ = this,
|
30862 | tickNum = $$.$el.main.select("." + config_classes.axisX).selectAll(".tick").size(),
|
30863 | gridData = [];
|
30864 |
|
30865 | if (type === "year") {
|
30866 | var xDomain = $$.getXDomain(),
|
30867 | firstYear = xDomain[0].getFullYear(),
|
30868 | lastYear = xDomain[1].getFullYear();
|
30869 |
|
30870 | for (var i = firstYear; i <= lastYear; i++) gridData.push(new Date(i + "-01-01 00:00:00"));
|
30871 | } else gridData = scale.ticks(10), gridData.length > tickNum && (gridData = gridData.filter(function (d) {
|
30872 | return (d + "").indexOf(".") < 0;
|
30873 | }));
|
30874 |
|
30875 | return gridData;
|
30876 | },
|
30877 | getGridFilterToRemove: function getGridFilterToRemove(params) {
|
30878 | return params ? function (line) {
|
30879 | var found = !1;
|
30880 | return (isArray(params) ? params.concat() : [params]).forEach(function (param) {
|
30881 | ("value" in param && line.value === param.value || "class" in param && line.class === param.class) && (found = !0);
|
30882 | }), found;
|
30883 | } : function () {
|
30884 | return !0;
|
30885 | };
|
30886 | },
|
30887 | removeGridLines: function removeGridLines(params, forX) {
|
30888 | var $$ = this,
|
30889 | config = $$.config,
|
30890 | toRemove = $$.getGridFilterToRemove(params),
|
30891 | classLines = forX ? config_classes.xgridLines : config_classes.ygridLines,
|
30892 | classLine = forX ? config_classes.xgridLine : config_classes.ygridLine;
|
30893 | $$.$el.main.select("." + classLines).selectAll("." + classLine).filter(toRemove).transition().duration(config.transition_duration).style("opacity", "0").remove();
|
30894 | var gridLines = "grid_" + (forX ? "x" : "y") + "_lines";
|
30895 | config[gridLines] = config[gridLines].filter(function toShow(line) {
|
30896 | return !toRemove(line);
|
30897 | });
|
30898 | }
|
30899 | });
|
30900 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/region.ts
|
30901 | /**
|
30902 | * Copyright (c) 2017 ~ present NAVER Corp.
|
30903 | * billboard.js project is licensed under the MIT license
|
30904 | */
|
30905 | // selection
|
30906 |
|
30907 |
|
30908 |
|
30909 | /* harmony default export */ var region = ({
|
30910 | initRegion: function initRegion() {
|
30911 | var $$ = this,
|
30912 | $el = $$.$el;
|
30913 | $el.region.main = $el.main.append("g").attr("clip-path", $$.state.clip.path).attr("class", config_classes.regions);
|
30914 | },
|
30915 | updateRegion: function updateRegion(duration) {
|
30916 | var $$ = this,
|
30917 | config = $$.config,
|
30918 | $el = $$.$el;
|
30919 | $el.region.main || $$.initRegion(), $el.region.main.style("visibility", $$.hasArcType() ? "hidden" : "visible");
|
30920 | // select <g> element
|
30921 | var list = $el.main.select("." + config_classes.regions).selectAll("." + config_classes.region).data(config.regions);
|
30922 | list.exit().transition().duration(duration).style("opacity", "0").remove(), list = list.enter().append("g").merge(list).attr("class", $$.classRegion.bind($$)), list.append("rect").style("fill-opacity", "0"), $el.region.list = list;
|
30923 | },
|
30924 | redrawRegion: function redrawRegion(withTransition) {
|
30925 | var $$ = this,
|
30926 | regions = $$.$el.region.list.select("rect");
|
30927 | return regions = (withTransition ? regions.transition() : regions).attr("x", $$.regionX.bind($$)).attr("y", $$.regionY.bind($$)).attr("width", $$.regionWidth.bind($$)).attr("height", $$.regionHeight.bind($$)), [(withTransition ? regions.transition() : regions).style("fill-opacity", function (d) {
|
30928 | return isValue(d.opacity) ? d.opacity : "0.1";
|
30929 | }).on("end", function () {
|
30930 | src_select(this.parentNode).selectAll("rect:not([x])").remove();
|
30931 | })];
|
30932 | },
|
30933 | getRegionXY: function getRegionXY(type, d) {
|
30934 | var currScale,
|
30935 | $$ = this,
|
30936 | config = $$.config,
|
30937 | scale = $$.scale,
|
30938 | isRotated = config.axis_rotated,
|
30939 | isX = type === "x",
|
30940 | key = "start",
|
30941 | pos = 0;
|
30942 | return d.axis === "y" || d.axis === "y2" ? (!isX && (key = "end"), (isX ? isRotated : !isRotated) && key in d && (currScale = scale[d.axis], pos = currScale(d[key]))) : (isX ? !isRotated : isRotated) && key in d && (currScale = scale.zoom || scale.x, pos = currScale($$.axis.isTimeSeries() ? parseDate.call($$, d[key]) : d[key])), pos;
|
30943 | },
|
30944 | regionX: function regionX(d) {
|
30945 | return this.getRegionXY("x", d);
|
30946 | },
|
30947 | regionY: function regionY(d) {
|
30948 | return this.getRegionXY("y", d);
|
30949 | },
|
30950 | getRegionSize: function getRegionSize(type, d) {
|
30951 | var currScale,
|
30952 | $$ = this,
|
30953 | config = $$.config,
|
30954 | scale = $$.scale,
|
30955 | state = $$.state,
|
30956 | isRotated = config.axis_rotated,
|
30957 | isWidth = type === "width",
|
30958 | start = $$[isWidth ? "regionX" : "regionY"](d),
|
30959 | key = "end",
|
30960 | end = state[type];
|
30961 | return d.axis === "y" || d.axis === "y2" ? (!isWidth && (key = "start"), (isWidth ? isRotated : !isRotated) && key in d && (currScale = scale[d.axis], end = currScale(d[key]))) : (isWidth ? !isRotated : isRotated) && key in d && (currScale = scale.zoom || scale.x, end = currScale($$.axis.isTimeSeries() ? parseDate.call($$, d[key]) : d[key])), end < start ? 0 : end - start;
|
30962 | },
|
30963 | regionWidth: function regionWidth(d) {
|
30964 | return this.getRegionSize("width", d);
|
30965 | },
|
30966 | regionHeight: function regionHeight(d) {
|
30967 | return this.getRegionSize("height", d);
|
30968 | },
|
30969 | isRegionOnX: function isRegionOnX(d) {
|
30970 | return !d.axis || d.axis === "x";
|
30971 | }
|
30972 | });
|
30973 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/size.axis.ts
|
30974 | /**
|
30975 | * Copyright (c) 2017 ~ present NAVER Corp.
|
30976 | * billboard.js project is licensed under the MIT license
|
30977 | */
|
30978 | /* harmony default export */ var size_axis = ({
|
30979 | /**
|
30980 | * Get Axis size according its position
|
30981 | * @param {string} id Axis id value - x, y or y2
|
30982 | * @returns {number} size Axis size value
|
30983 | * @private
|
30984 | */
|
30985 | getAxisSize: function getAxisSize(id) {
|
30986 | var $$ = this,
|
30987 | isRotated = $$.config.axis_rotated;
|
30988 | return isRotated && id === "x" || !isRotated && /y2?/.test(id) ? $$.getAxisWidthByAxisId(id, !0) : $$.getHorizontalAxisHeight(id);
|
30989 | },
|
30990 | getAxisWidthByAxisId: function getAxisWidthByAxisId(id, withoutRecompute) {
|
30991 | var $$ = this;
|
30992 |
|
30993 | if ($$.axis) {
|
30994 | var position = $$.axis && $$.axis.getLabelPositionById(id);
|
30995 | return $$.axis.getMaxTickWidth(id, withoutRecompute) + (position.isInner ? 20 : 40);
|
30996 | }
|
30997 |
|
30998 | return 40;
|
30999 | },
|
31000 | getHorizontalAxisHeight: function getHorizontalAxisHeight(id) {
|
31001 | var $$ = this,
|
31002 | config = $$.config,
|
31003 | state = $$.state,
|
31004 | _state = state,
|
31005 | current = _state.current,
|
31006 | rotatedPadding = _state.rotatedPadding,
|
31007 | isLegendRight = _state.isLegendRight,
|
31008 | isLegendInset = _state.isLegendInset,
|
31009 | isRotated = config.axis_rotated,
|
31010 | h = 30;
|
31011 | if (id === "x" && !config.axis_x_show) return 8;
|
31012 | if (id === "x" && config.axis_x_height) return config.axis_x_height;
|
31013 | if (id === "y" && !config.axis_y_show) return !config.legend_show || isLegendRight || isLegendInset ? 1 : 10;
|
31014 | if (id === "y2" && !config.axis_y2_show) return rotatedPadding.top;
|
31015 | var rotate = $$.getAxisTickRotate(id); // Calculate x/y axis height when tick rotated
|
31016 |
|
31017 | return (id === "x" && !isRotated || /y2?/.test(id) && isRotated) && rotate && (h = 30 + $$.axis.getMaxTickWidth(id) * Math.cos(Math.PI * (90 - Math.abs(rotate)) / 180), !config.axis_x_tick_multiline && current.height && h > current.height / 2 && (h = current.height / 2)), h + ($$.axis.getLabelPositionById(id).isInner ? 0 : 10) + (id !== "y2" || isRotated ? 0 : -10);
|
31018 | },
|
31019 | getEventRectWidth: function getEventRectWidth() {
|
31020 | return Math.max(0, this.axis.x.tickInterval());
|
31021 | },
|
31022 |
|
31023 | /**
|
31024 | * Get axis tick test rotate value
|
31025 | * @param {string} id Axis id
|
31026 | * @returns {number} rotate value
|
31027 | * @private
|
31028 | */
|
31029 | getAxisTickRotate: function getAxisTickRotate(id) {
|
31030 | var $$ = this,
|
31031 | axis = $$.axis,
|
31032 | config = $$.config,
|
31033 | state = $$.state,
|
31034 | $el = $$.$el,
|
31035 | rotate = config["axis_" + id + "_tick_rotate"];
|
31036 |
|
31037 | if (id === "x") {
|
31038 | var allowedXAxisTypes = axis.isCategorized() || axis.isTimeSeries();
|
31039 |
|
31040 | if (config.axis_x_tick_fit && allowedXAxisTypes) {
|
31041 | var xTickCount = config.axis_x_tick_count,
|
31042 | currentXTicksLength = state.current.maxTickWidths.x.ticks.length,
|
31043 | tickCount = 0;
|
31044 | xTickCount ? tickCount = xTickCount > currentXTicksLength ? currentXTicksLength : xTickCount : currentXTicksLength && (tickCount = currentXTicksLength), tickCount !== state.axis.x.tickCount && (state.axis.x.padding = $$.axis.getXAxisPadding(tickCount)), state.axis.x.tickCount = tickCount;
|
31045 | }
|
31046 |
|
31047 | $el.svg && config.axis_x_tick_fit && !config.axis_x_tick_multiline && !config.axis_x_tick_culling && config.axis_x_tick_autorotate && allowedXAxisTypes && (rotate = $$.needToRotateXAxisTickTexts() ? config.axis_x_tick_rotate : 0);
|
31048 | }
|
31049 |
|
31050 | return rotate;
|
31051 | },
|
31052 |
|
31053 | /**
|
31054 | * Check weather axis tick text needs to be rotated
|
31055 | * @returns {boolean}
|
31056 | * @private
|
31057 | */
|
31058 | needToRotateXAxisTickTexts: function needToRotateXAxisTickTexts() {
|
31059 | var $$ = this,
|
31060 | _$$$state = $$.state,
|
31061 | axis = _$$$state.axis,
|
31062 | current = _$$$state.current,
|
31063 | xAxisLength = current.width - $$.getCurrentPaddingLeft(!1) - $$.getCurrentPaddingRight(),
|
31064 | tickCountWithPadding = axis.x.tickCount + axis.x.padding.left + axis.x.padding.right,
|
31065 | maxTickWidth = $$.axis.getMaxTickWidth("x"),
|
31066 | tickLength = tickCountWithPadding ? xAxisLength / tickCountWithPadding : 0;
|
31067 | return maxTickWidth > tickLength;
|
31068 | }
|
31069 | });
|
31070 | ;// CONCATENATED MODULE: ./src/config/Options/data/axis.ts
|
31071 | /**
|
31072 | * Copyright (c) 2017 ~ present NAVER Corp.
|
31073 | * billboard.js project is licensed under the MIT license
|
31074 | */
|
31075 |
|
31076 | /**
|
31077 | * Axis based chart data config options
|
31078 | */
|
31079 | /* harmony default export */ var data_axis = ({
|
31080 | /**
|
31081 | * Specify the keys of the x values for each data.<br><br>
|
31082 | * This option can be used if we want to show the data that has different x values.
|
31083 | * @name data․xs
|
31084 | * @memberof Options
|
31085 | * @type {object}
|
31086 | * @default {}
|
31087 | * @example
|
31088 | * data: {
|
31089 | * xs: {
|
31090 | * data1: "x1",
|
31091 | * data2: "x2"
|
31092 | * }
|
31093 | * }
|
31094 | */
|
31095 | data_xs: {},
|
31096 |
|
31097 | /**
|
31098 | * Set a format specifier to parse string specifed as x.
|
31099 | * @name data․xFormat
|
31100 | * @memberof Options
|
31101 | * @type {string}
|
31102 | * @default %Y-%m-%d
|
31103 | * @example
|
31104 | * data: {
|
31105 | * x: "x",
|
31106 | * columns: [
|
31107 | * ["x", "01012019", "02012019", "03012019"],
|
31108 | * ["data1", 30, 200, 100]
|
31109 | * ],
|
31110 | * // Format specifier to parse as datetime for given 'x' string value
|
31111 | * xFormat: "%m%d%Y"
|
31112 | * },
|
31113 | * axis: {
|
31114 | * x: {
|
31115 | * type: "timeseries"
|
31116 | * }
|
31117 | * }
|
31118 | * @see [D3's time specifier](https://github.com/d3/d3-time-format#locale_format)
|
31119 | */
|
31120 | data_xFormat: "%Y-%m-%d",
|
31121 |
|
31122 | /**
|
31123 | * Set localtime format to parse x axis.
|
31124 | * @name data․xLocaltime
|
31125 | * @memberof Options
|
31126 | * @type {boolean}
|
31127 | * @default true
|
31128 | * @example
|
31129 | * data: {
|
31130 | * xLocaltime: false
|
31131 | * }
|
31132 | */
|
31133 | data_xLocaltime: !0,
|
31134 |
|
31135 | /**
|
31136 | * Sort on x axis.
|
31137 | * @name data․xSort
|
31138 | * @memberof Options
|
31139 | * @type {boolean}
|
31140 | * @default true
|
31141 | * @example
|
31142 | * data: {
|
31143 | * xSort: false
|
31144 | * }
|
31145 | */
|
31146 | data_xSort: !0,
|
31147 |
|
31148 | /**
|
31149 | * Set y axis the data related to. y and y2 can be used.
|
31150 | * - **NOTE:** If all data is related to one of the axes, the domain of axis without related data will be replaced by the domain from the axis with related data
|
31151 | * @name data․axes
|
31152 | * @memberof Options
|
31153 | * @type {object}
|
31154 | * @default {}
|
31155 | * @example
|
31156 | * data: {
|
31157 | * axes: {
|
31158 | * data1: "y",
|
31159 | * data2: "y2"
|
31160 | * }
|
31161 | * }
|
31162 | */
|
31163 | data_axes: {},
|
31164 |
|
31165 | /**
|
31166 | * Define regions for each data.<br>
|
31167 | * The values must be an array for each data and it should include an object that has `start`, `end` and `style`.
|
31168 | * - The object type should be as:
|
31169 | * - start {number}: Start data point number. If not set, the start will be the first data point.
|
31170 | * - [end] {number}: End data point number. If not set, the end will be the last data point.
|
31171 | * - [style.dasharray="2 2"] {object}: The first number specifies a distance for the filled area, and the second a distance for the unfilled area.
|
31172 | * - **NOTE:** Currently this option supports only line chart and dashed style. If this option specified, the line will be dashed only in the regions.
|
31173 | * @name data․regions
|
31174 | * @memberof Options
|
31175 | * @type {object}
|
31176 | * @default {}
|
31177 | * @example
|
31178 | * data: {
|
31179 | * regions: {
|
31180 | * data1: [{
|
31181 | * start: 1,
|
31182 | * end: 2,
|
31183 | * style: {
|
31184 | * dasharray: "5 2"
|
31185 | * }
|
31186 | * }, {
|
31187 | * start: 3
|
31188 | * }],
|
31189 | * ...
|
31190 | * }
|
31191 | * }
|
31192 | */
|
31193 | data_regions: {},
|
31194 |
|
31195 | /**
|
31196 | * Set the stacking to be normalized
|
31197 | * - **NOTE:**
|
31198 | * - For stacking, '[data.groups](#.data%25E2%2580%25A4groups)' option should be set
|
31199 | * - y Axis will be set in percentage value (0 ~ 100%)
|
31200 | * - Must have postive values
|
31201 | * @name data․stack․normalize
|
31202 | * @memberof Options
|
31203 | * @type {boolean}
|
31204 | * @default false
|
31205 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Data.DataStackNormalized)
|
31206 | * @example
|
31207 | * data: {
|
31208 | * stack: {
|
31209 | * normalize: true
|
31210 | * }
|
31211 | * }
|
31212 | */
|
31213 | data_stack_normalize: !1
|
31214 | });
|
31215 | ;// CONCATENATED MODULE: ./src/config/Options/axis/x.ts
|
31216 | /**
|
31217 | * Copyright (c) 2017 ~ present NAVER Corp.
|
31218 | * billboard.js project is licensed under the MIT license
|
31219 | */
|
31220 |
|
31221 | /**
|
31222 | * x Axis config options
|
31223 | */
|
31224 | /* harmony default export */ var axis_x = ({
|
31225 | /**
|
31226 | * Set clip-path attribute for x axis element
|
31227 | * @name axis․x․clipPath
|
31228 | * @memberof Options
|
31229 | * @type {boolean}
|
31230 | * @default true
|
31231 | * @see [Demo]()
|
31232 | * @example
|
31233 | * // don't set 'clip-path' attribute
|
31234 | * clipPath: false
|
31235 | */
|
31236 | axis_x_clipPath: !0,
|
31237 |
|
31238 | /**
|
31239 | * Show or hide x axis.
|
31240 | * @name axis․x․show
|
31241 | * @memberof Options
|
31242 | * @type {boolean}
|
31243 | * @default true
|
31244 | * @example
|
31245 | * axis: {
|
31246 | * x: {
|
31247 | * show: false
|
31248 | * }
|
31249 | * }
|
31250 | */
|
31251 | axis_x_show: !0,
|
31252 |
|
31253 | /**
|
31254 | * Set type of x axis.<br><br>
|
31255 | * **Available Values:**
|
31256 | * - category
|
31257 | * - indexed
|
31258 | * - log
|
31259 | * - timeseries
|
31260 | *
|
31261 | * **NOTE:**<br>
|
31262 | * - **log** type:
|
31263 | * - the x values specified by [`data.x`](#.data%25E2%2580%25A4x)(or by any equivalent option), must be exclusively-positive.
|
31264 | * - x axis min value should be >= 0.
|
31265 | *
|
31266 | * @name axis․x․type
|
31267 | * @memberof Options
|
31268 | * @type {string}
|
31269 | * @default indexed
|
31270 | * @see [Demo: indexed](https://naver.github.io/billboard.js/demo/#Chart.AreaChart)
|
31271 | * @see [Demo: timeseries](https://naver.github.io/billboard.js/demo/#Chart.TimeseriesChart)
|
31272 | * @see [Demo: category](https://naver.github.io/billboard.js/demo/#Data.CategoryData)
|
31273 | * @see [Demo: log](https://naver.github.io/billboard.js/demo/#Axis.LogScales)
|
31274 | * @example
|
31275 | * axis: {
|
31276 | * x: {
|
31277 | * type: "timeseries"
|
31278 | * }
|
31279 | * }
|
31280 | */
|
31281 | axis_x_type: "indexed",
|
31282 |
|
31283 | /**
|
31284 | * Set how to treat the timezone of x values.<br>
|
31285 | * If true, treat x value as localtime. If false, convert to UTC internally.
|
31286 | * @name axis․x․localtime
|
31287 | * @memberof Options
|
31288 | * @type {boolean}
|
31289 | * @default true
|
31290 | * @example
|
31291 | * axis: {
|
31292 | * x: {
|
31293 | * localtime: false
|
31294 | * }
|
31295 | * }
|
31296 | */
|
31297 | axis_x_localtime: !0,
|
31298 |
|
31299 | /**
|
31300 | * Set category names on category axis.
|
31301 | * This must be an array that includes category names in string. If category names are included in the date by data.x option, this is not required.
|
31302 | * @name axis․x․categories
|
31303 | * @memberof Options
|
31304 | * @type {Array}
|
31305 | * @default []
|
31306 | * @example
|
31307 | * axis: {
|
31308 | * x: {
|
31309 | * categories: ["Category 1", "Category 2", ...]
|
31310 | * }
|
31311 | * }
|
31312 | */
|
31313 | axis_x_categories: [],
|
31314 |
|
31315 | /**
|
31316 | * centerize ticks on category axis.
|
31317 | * @name axis․x․tick․centered
|
31318 | * @memberof Options
|
31319 | * @type {boolean}
|
31320 | * @default false
|
31321 | * @example
|
31322 | * axis: {
|
31323 | * x: {
|
31324 | * tick: {
|
31325 | * centered: true
|
31326 | * }
|
31327 | * }
|
31328 | * }
|
31329 | */
|
31330 | axis_x_tick_centered: !1,
|
31331 |
|
31332 | /**
|
31333 | * A function to format tick value. Format string is also available for timeseries data.
|
31334 | * @name axis․x․tick․format
|
31335 | * @memberof Options
|
31336 | * @type {Function|string}
|
31337 | * @default undefined
|
31338 | * @see [D3's time specifier](https://github.com/d3/d3-time-format#locale_format)
|
31339 | * @example
|
31340 | * axis: {
|
31341 | * x: {
|
31342 | * tick: {
|
31343 | * // for timeseries, a 'datetime' object is given as parameter
|
31344 | * format: function(x) {
|
31345 | * return x.getFullYear();
|
31346 | * }
|
31347 | *
|
31348 | * // for category, index(Number) and categoryName(String) are given as parameter
|
31349 | * format: function(index, categoryName) {
|
31350 | * return categoryName.substr(0, 10);
|
31351 | * },
|
31352 | *
|
31353 | * // for timeseries format specifier
|
31354 | * format: "%Y-%m-%d %H:%M:%S"
|
31355 | * }
|
31356 | * }
|
31357 | * }
|
31358 | */
|
31359 | axis_x_tick_format: undefined,
|
31360 |
|
31361 | /**
|
31362 | * Setting for culling ticks.<br><br>
|
31363 | * If true is set, the ticks will be culled, then only limitted tick text will be shown. This option does not hide the tick lines. If false is set, all of ticks will be shown.<br><br>
|
31364 | * We can change the number of ticks to be shown by axis.x.tick.culling.max.
|
31365 | * @name axis․x․tick․culling
|
31366 | * @memberof Options
|
31367 | * @type {boolean}
|
31368 | * @default
|
31369 | * - true for indexed axis and timeseries axis
|
31370 | * - false for category axis
|
31371 | * @example
|
31372 | * axis: {
|
31373 | * x: {
|
31374 | * tick: {
|
31375 | * culling: false
|
31376 | * }
|
31377 | * }
|
31378 | * }
|
31379 | */
|
31380 | axis_x_tick_culling: {},
|
31381 |
|
31382 | /**
|
31383 | * The number of tick texts will be adjusted to less than this value.
|
31384 | * @name axis․x․tick․culling․max
|
31385 | * @memberof Options
|
31386 | * @type {number}
|
31387 | * @default 10
|
31388 | * @example
|
31389 | * axis: {
|
31390 | * x: {
|
31391 | * tick: {
|
31392 | * culling: {
|
31393 | * max: 5
|
31394 | * }
|
31395 | * }
|
31396 | * }
|
31397 | * }
|
31398 | */
|
31399 | axis_x_tick_culling_max: 10,
|
31400 |
|
31401 | /**
|
31402 | * The number of x axis ticks to show.<br><br>
|
31403 | * This option hides tick lines together with tick text. If this option is used on timeseries axis, the ticks position will be determined precisely and not nicely positioned (e.g. it will have rough second value).
|
31404 | * @name axis․x․tick․count
|
31405 | * @memberof Options
|
31406 | * @type {number}
|
31407 | * @default undefined
|
31408 | * @example
|
31409 | * axis: {
|
31410 | * x: {
|
31411 | * tick: {
|
31412 | * count: 5
|
31413 | * }
|
31414 | * }
|
31415 | * }
|
31416 | */
|
31417 | axis_x_tick_count: undefined,
|
31418 |
|
31419 | /**
|
31420 | * Show or hide x axis tick line.
|
31421 | * @name axis․x․tick․show
|
31422 | * @memberof Options
|
31423 | * @type {boolean}
|
31424 | * @default true
|
31425 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.HideTickLineText)
|
31426 | * @example
|
31427 | * axis: {
|
31428 | * x: {
|
31429 | * tick: {
|
31430 | * show: false
|
31431 | * }
|
31432 | * }
|
31433 | * }
|
31434 | */
|
31435 | axis_x_tick_show: !0,
|
31436 |
|
31437 | /**
|
31438 | * Show or hide x axis tick text.
|
31439 | * @name axis․x․tick․text․show
|
31440 | * @memberof Options
|
31441 | * @type {boolean}
|
31442 | * @default true
|
31443 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.HideTickLineText)
|
31444 | * @example
|
31445 | * axis: {
|
31446 | * x: {
|
31447 | * tick: {
|
31448 | * text: {
|
31449 | * show: false
|
31450 | * }
|
31451 | * }
|
31452 | * }
|
31453 | * }
|
31454 | */
|
31455 | axis_x_tick_text_show: !0,
|
31456 |
|
31457 | /**
|
31458 | * Set the x Axis tick text's position relatively its original position
|
31459 | * @name axis․x․tick․text․position
|
31460 | * @memberof Options
|
31461 | * @type {object}
|
31462 | * @default {x: 0, y:0}
|
31463 | * @example
|
31464 | * axis: {
|
31465 | * x: {
|
31466 | * tick: {
|
31467 | * text: {
|
31468 | * position: {
|
31469 | * x: 10,
|
31470 | * y: 10
|
31471 | * }
|
31472 | * }
|
31473 | * }
|
31474 | * }
|
31475 | * }
|
31476 | */
|
31477 | axis_x_tick_text_position: {
|
31478 | x: 0,
|
31479 | y: 0
|
31480 | },
|
31481 |
|
31482 | /**
|
31483 | * Fit x axis ticks.
|
31484 | * - **true**: ticks will be positioned nicely to have same intervals.
|
31485 | * - **false**: ticks will be positioned according to x value of the data points.
|
31486 | * @name axis․x․tick․fit
|
31487 | * @memberof Options
|
31488 | * @type {boolean}
|
31489 | * @default true
|
31490 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.XAxisTickFitting)
|
31491 | * @see [Demo: for timeseries zoom](https://naver.github.io/billboard.js/demo/#Axis.XAxisTickTimeseries)
|
31492 | * @example
|
31493 | * axis: {
|
31494 | * x: {
|
31495 | * tick: {
|
31496 | * fit: false
|
31497 | * }
|
31498 | * }
|
31499 | * }
|
31500 | */
|
31501 | axis_x_tick_fit: !0,
|
31502 |
|
31503 | /**
|
31504 | * Set the x values of ticks manually.<br><br>
|
31505 | * If this option is provided, the position of the ticks will be determined based on those values.<br>
|
31506 | * This option works with `timeseries` data and the x values will be parsed accoding to the type of the value and data.xFormat option.
|
31507 | * @name axis․x․tick․values
|
31508 | * @memberof Options
|
31509 | * @type {Array|Function}
|
31510 | * @default null
|
31511 | * @example
|
31512 | * axis: {
|
31513 | * x: {
|
31514 | * tick: {
|
31515 | * values: [1, 2, 4, 8, 16, 32, ...],
|
31516 | *
|
31517 | * // an Array value should be returned
|
31518 | * values: function() {
|
31519 | * return [ ... ];
|
31520 | * }
|
31521 | * }
|
31522 | * }
|
31523 | * }
|
31524 | */
|
31525 | axis_x_tick_values: null,
|
31526 |
|
31527 | /**
|
31528 | * Rotate x axis tick text if there is not enough space for 'category' and 'timeseries' type axis.
|
31529 | * - **NOTE:** The conditions where `autorotate` is enabled are:
|
31530 | * - axis.x.type='category' or 'timeseries
|
31531 | * - axis.x.tick.multiline=false
|
31532 | * - axis.x.tick.culling=false
|
31533 | * - axis.x.tick.fit=true
|
31534 | * - **NOTE:** axis.x.tick.clippath=false is necessary for calculating the overflow padding between the end of x axis and the width of the SVG
|
31535 | * @name axis․x․tick․autorotate
|
31536 | * @memberof Options
|
31537 | * @type {boolean}
|
31538 | * @default false
|
31539 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.XAxisTickAutorotate)
|
31540 | * @example
|
31541 | * axis: {
|
31542 | * x: {
|
31543 | * tick: {
|
31544 | * rotate: 15,
|
31545 | * autorotate: true,
|
31546 | * multiline: false,
|
31547 | * culling: false,
|
31548 | * fit: true
|
31549 | * },
|
31550 | * clipPath: false
|
31551 | * }
|
31552 | * }
|
31553 | */
|
31554 | axis_x_tick_autorotate: !1,
|
31555 |
|
31556 | /**
|
31557 | * Rotate x axis tick text.
|
31558 | * - If you set negative value, it will rotate to opposite direction.
|
31559 | * - Applied when [`axis.rotated`](#.axis%25E2%2580%25A4rotated) option is `false`.
|
31560 | * - As long as `axis_x_tick_fit` is set to `true` it will calculate an overflow for the y2 axis and add this value to the right padding.
|
31561 | * @name axis․x․tick․rotate
|
31562 | * @memberof Options
|
31563 | * @type {number}
|
31564 | * @default 0
|
31565 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.RotateXAxisTickText)
|
31566 | * @example
|
31567 | * axis: {
|
31568 | * x: {
|
31569 | * tick: {
|
31570 | * rotate: 60
|
31571 | * }
|
31572 | * }
|
31573 | * }
|
31574 | */
|
31575 | axis_x_tick_rotate: 0,
|
31576 |
|
31577 | /**
|
31578 | * Show x axis outer tick.
|
31579 | * @name axis․x․tick․outer
|
31580 | * @memberof Options
|
31581 | * @type {boolean}
|
31582 | * @default true
|
31583 | * @example
|
31584 | * axis: {
|
31585 | * x: {
|
31586 | * tick: {
|
31587 | * outer: false
|
31588 | * }
|
31589 | * }
|
31590 | * }
|
31591 | */
|
31592 | axis_x_tick_outer: !0,
|
31593 |
|
31594 | /**
|
31595 | * Set tick text to be multiline
|
31596 | * - **NOTE:**
|
31597 | * > When x tick text contains `\n`, it's used as line break and 'axis.x.tick.width' option is ignored.
|
31598 | * @name axis․x․tick․multiline
|
31599 | * @memberof Options
|
31600 | * @type {boolean}
|
31601 | * @default true
|
31602 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.XAxisTickMultiline)
|
31603 | * @example
|
31604 | * axis: {
|
31605 | * x: {
|
31606 | * tick: {
|
31607 | * multiline: false
|
31608 | * }
|
31609 | * }
|
31610 | * }
|
31611 | * @example
|
31612 | * // example of line break with '\n'
|
31613 | * // In this case, 'axis.x.tick.width' is ignored
|
31614 | * data: {
|
31615 | * x: "x",
|
31616 | * columns: [
|
31617 | * ["x", "long\ntext", "Another\nLong\nText"],
|
31618 | * ...
|
31619 | * ],
|
31620 | * }
|
31621 | */
|
31622 | axis_x_tick_multiline: !0,
|
31623 |
|
31624 | /**
|
31625 | * Set tick width
|
31626 | * - **NOTE:**
|
31627 | * > When x tick text contains `\n`, this option is ignored.
|
31628 | * @name axis․x․tick․width
|
31629 | * @memberof Options
|
31630 | * @type {number}
|
31631 | * @default null
|
31632 | * @example
|
31633 | * axis: {
|
31634 | * x: {
|
31635 | * tick: {
|
31636 | * width: 50
|
31637 | * }
|
31638 | * }
|
31639 | * }
|
31640 | */
|
31641 | axis_x_tick_width: null,
|
31642 |
|
31643 | /**
|
31644 | * Set to display system tooltip(via 'title' attribute) for tick text
|
31645 | * - **NOTE:** Only available for category axis type (`axis.x.type='category'`)
|
31646 | * @name axis․x․tick․tooltip
|
31647 | * @memberof Options
|
31648 | * @type {boolean}
|
31649 | * @default false
|
31650 | * @example
|
31651 | * axis: {
|
31652 | * x: {
|
31653 | * tick: {
|
31654 | * tooltip: true
|
31655 | * }
|
31656 | * }
|
31657 | * }
|
31658 | */
|
31659 | axis_x_tick_tooltip: !1,
|
31660 |
|
31661 | /**
|
31662 | * Set max value of x axis range.
|
31663 | * @name axis․x․max
|
31664 | * @memberof Options
|
31665 | * @property {number} max Set the max value
|
31666 | * @property {boolean} [max.fit=false] When specified `max.value` is greater than the bound data value, setting `true` will make x axis max to be fitted to the bound data max value.
|
31667 | * - **NOTE:** If the bound data max value is greater than the `max.value`, the x axis max will be limited as the given `max.value`.
|
31668 | * @property {number} [max.value] Set the max value
|
31669 | * @example
|
31670 | * axis: {
|
31671 | * x: {
|
31672 | * max: 100,
|
31673 | *
|
31674 | * max: {
|
31675 | * // 'fit=true' will make x axis max to be limited as the bound data value max when 'max.value' is greater.
|
31676 | * // - when bound data max is '10' and max.value: '100' ==> x axis max will be '10'
|
31677 | * // - when bound data max is '1000' and max.value: '100' ==> x axis max will be '100'
|
31678 | * fit: true,
|
31679 | * value: 100
|
31680 | * }
|
31681 | * }
|
31682 | * }
|
31683 | */
|
31684 | axis_x_max: undefined,
|
31685 |
|
31686 | /**
|
31687 | * Set min value of x axis range.
|
31688 | * @name axis․x․min
|
31689 | * @memberof Options
|
31690 | * @property {number} min Set the min value
|
31691 | * @property {boolean} [min.fit=false] When specified `min.value` is lower than the bound data value, setting `true` will make x axis min to be fitted to the bound data min value.
|
31692 | * - **NOTE:** If the bound data min value is lower than the `min.value`, the x axis min will be limited as the given `min.value`.
|
31693 | * @property {number} [min.value] Set the min value
|
31694 | * @example
|
31695 | * axis: {
|
31696 | * x: {
|
31697 | * min: -100,
|
31698 | *
|
31699 | * min: {
|
31700 | * // 'fit=true' will make x axis min to be limited as the bound data value min when 'min.value' is lower.
|
31701 | * // - when bound data min is '-10' and min.value: '-100' ==> x axis min will be '-10'
|
31702 | * // - when bound data min is '-1000' and min.value: '-100' ==> x axis min will be '-100'
|
31703 | * fit: true,
|
31704 | * value: -100
|
31705 | * }
|
31706 | * }
|
31707 | * }
|
31708 | */
|
31709 | axis_x_min: undefined,
|
31710 |
|
31711 | /**
|
31712 | * Set padding for x axis.<br><br>
|
31713 | * If this option is set, the range of x axis will increase/decrease according to the values.
|
31714 | * If no padding is needed in the rage of x axis, 0 should be set.
|
31715 | * - **NOTE:**
|
31716 | * The padding values aren't based on pixels. It differs according axis types<br>
|
31717 | * - **category:** The unit of tick value
|
31718 | * ex. the given value `1`, is same as the width of 1 tick width
|
31719 | * - **timeseries:** Numeric time value
|
31720 | * ex. the given value `1000*60*60*24`, which is numeric time equivalent of a day, is same as the width of 1 tick width
|
31721 | * @name axis․x․padding
|
31722 | * @memberof Options
|
31723 | * @type {object|number}
|
31724 | * @default {}
|
31725 | * @example
|
31726 | * axis: {
|
31727 | * x: {
|
31728 | * padding: {
|
31729 | * // when axis type is 'category'
|
31730 | * left: 1, // set left padding width of equivalent value of a tick's width
|
31731 | * right: 0.5 // set right padding width as half of equivalent value of tick's width
|
31732 | *
|
31733 | * // when axis type is 'timeseries'
|
31734 | * left: 1000*60*60*24, // set left padding width of equivalent value of a day tick's width
|
31735 | * right: 1000*60*60*12 // set right padding width as half of equivalent value of a day tick's width
|
31736 | * },
|
31737 | *
|
31738 | * // or set both values at once.
|
31739 | * padding: 10
|
31740 | * }
|
31741 | * }
|
31742 | */
|
31743 | axis_x_padding: {},
|
31744 |
|
31745 | /**
|
31746 | * Set height of x axis.<br><br>
|
31747 | * The height of x axis can be set manually by this option. If you need more space for x axis, please use this option for that. The unit is pixel.
|
31748 | * @name axis․x․height
|
31749 | * @memberof Options
|
31750 | * @type {number}
|
31751 | * @default undefined
|
31752 | * @example
|
31753 | * axis: {
|
31754 | * x: {
|
31755 | * height: 20
|
31756 | * }
|
31757 | * }
|
31758 | */
|
31759 | axis_x_height: undefined,
|
31760 |
|
31761 | /**
|
31762 | * Set default extent for subchart and zoom. This can be an array or function that returns an array.
|
31763 | * @name axis․x․extent
|
31764 | * @memberof Options
|
31765 | * @type {Array|Function}
|
31766 | * @default undefined
|
31767 | * @example
|
31768 | * axis: {
|
31769 | * x: {
|
31770 | * // extent range as a pixel value
|
31771 | * extent: [0, 200],
|
31772 | *
|
31773 | * // when axis is 'timeseries', parsable datetime string
|
31774 | * extent: ["2019-03-01", "2019-03-05"],
|
31775 | *
|
31776 | * // return extent value
|
31777 | * extent: function(domain, scale) {
|
31778 | * var extent = domain.map(function(v) {
|
31779 | * return scale(v);
|
31780 | * });
|
31781 | *
|
31782 | * // it should return a format of array
|
31783 | * // ex) [0, 584]
|
31784 | * return extent;
|
31785 | * }
|
31786 | * }
|
31787 | * }
|
31788 | */
|
31789 | axis_x_extent: undefined,
|
31790 |
|
31791 | /**
|
31792 | * Set label on x axis.<br><br>
|
31793 | * You can set x axis label and change its position by this option.
|
31794 | * `string` and `object` can be passed and we can change the poisiton by passing object that has position key.<br>
|
31795 | * Available position differs according to the axis direction (vertical or horizontal).
|
31796 | * If string set, the position will be the default.
|
31797 | *
|
31798 | * - **If it's horizontal axis:**
|
31799 | * - inner-right [default]
|
31800 | * - inner-center
|
31801 | * - inner-left
|
31802 | * - outer-right
|
31803 | * - outer-center
|
31804 | * - outer-left
|
31805 | * - **If it's vertical axis:**
|
31806 | * - inner-top [default]
|
31807 | * - inner-middle
|
31808 | * - inner-bottom
|
31809 | * - outer-top
|
31810 | * - outer-middle
|
31811 | * - outer-bottom
|
31812 | * @name axis․x․label
|
31813 | * @memberof Options
|
31814 | * @type {string|object}
|
31815 | * @default undefined
|
31816 | * @example
|
31817 | * axis: {
|
31818 | * x: {
|
31819 | * label: "Your X Axis"
|
31820 | * }
|
31821 | * }
|
31822 | *
|
31823 | * axis: {
|
31824 | * x: {
|
31825 | * label: {
|
31826 | * text: "Your X Axis",
|
31827 | * position: "outer-center"
|
31828 | * }
|
31829 | * }
|
31830 | * }
|
31831 | */
|
31832 | axis_x_label: {},
|
31833 |
|
31834 | /**
|
31835 | * Set additional axes for x Axis.
|
31836 | * - **NOTE:** Axis' scale is based on x Axis value if domain option isn't set.
|
31837 | *
|
31838 | * Each axis object should consist with following options:
|
31839 | *
|
31840 | * | Name | Type | Default | Description |
|
31841 | * | --- | --- | --- | --- |
|
31842 | * | domain | Array | - | Set the domain value |
|
31843 | * | tick.outer | boolean | true | Show outer tick |
|
31844 | * | tick.format | Function | - | Set formatter for tick text |
|
31845 | * | tick.count | Number | - | Set the number of y axis ticks |
|
31846 | * | tick.values | Array | - | Set tick values manually |
|
31847 | * @name axis․x․axes
|
31848 | * @memberof Options
|
31849 | * @type {Array}
|
31850 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.MultiAxes)
|
31851 | * @see [Demo: Domain](https://naver.github.io/billboard.js/demo/#Axis.MultiAxesDomain)
|
31852 | * @example
|
31853 | * x: {
|
31854 | * axes: [
|
31855 | * {
|
31856 | * // if set, will not be correlated with the main x Axis domain value
|
31857 | * domain: [0, 1000],
|
31858 | * tick: {
|
31859 | * outer: false,
|
31860 | * format: function(x) {
|
31861 | * return x + "%";
|
31862 | * },
|
31863 | * count: 2,
|
31864 | * values: [10, 20, 30]
|
31865 | * }
|
31866 | * },
|
31867 | * ...
|
31868 | * ]
|
31869 | * }
|
31870 | */
|
31871 | axis_x_axes: []
|
31872 | });
|
31873 | ;// CONCATENATED MODULE: ./src/config/Options/axis/y.ts
|
31874 | /**
|
31875 | * Copyright (c) 2017 ~ present NAVER Corp.
|
31876 | * billboard.js project is licensed under the MIT license
|
31877 | */
|
31878 |
|
31879 | /**
|
31880 | * y Axis config options
|
31881 | */
|
31882 | /* harmony default export */ var y = ({
|
31883 | /**
|
31884 | * Set clip-path attribute for y axis element
|
31885 | * - **NOTE**: `clip-path` attribute for y Axis is set only when `axis.y.inner` option is true.
|
31886 | * @name axis․y․clipPath
|
31887 | * @memberof Options
|
31888 | * @type {boolean}
|
31889 | * @default true
|
31890 | * @example
|
31891 | * // don't set 'clip-path' attribute
|
31892 | * clipPath: false
|
31893 | */
|
31894 | axis_y_clipPath: !0,
|
31895 |
|
31896 | /**
|
31897 | * Show or hide y axis.
|
31898 | * @name axis․y․show
|
31899 | * @memberof Options
|
31900 | * @type {boolean}
|
31901 | * @default true
|
31902 | * @example
|
31903 | * axis: {
|
31904 | * y: {
|
31905 | * show: false
|
31906 | * }
|
31907 | * }
|
31908 | */
|
31909 | axis_y_show: !0,
|
31910 |
|
31911 | /**
|
31912 | * Set type of y axis.<br><br>
|
31913 | * **Available Values:**
|
31914 | * - indexed
|
31915 | * - log
|
31916 | * - timeseries
|
31917 | *
|
31918 | * **NOTE:**<br>
|
31919 | * - **log** type:
|
31920 | * - the bound data values must be exclusively-positive.
|
31921 | * - y axis min value should be >= 0.
|
31922 | * - [`data.groups`](#.data%25E2%2580%25A4groups)(stacked data) option aren't supported.
|
31923 | *
|
31924 | * @name axis․y․type
|
31925 | * @memberof Options
|
31926 | * @type {string}
|
31927 | * @default "indexed"
|
31928 | * @see [Demo: log](https://naver.github.io/billboard.js/demo/#Axis.LogScales)
|
31929 | * @example
|
31930 | * axis: {
|
31931 | * y: {
|
31932 | * type: "log"
|
31933 | * }
|
31934 | * }
|
31935 | */
|
31936 | axis_y_type: "indexed",
|
31937 |
|
31938 | /**
|
31939 | * Set max value of y axis.
|
31940 | * - **NOTE:** Padding will be added based on this value, so if you don't need the padding, please set axis.y.padding to disable it (e.g. axis.y.padding = 0).
|
31941 | * @name axis․y․max
|
31942 | * @memberof Options
|
31943 | * @type {number}
|
31944 | * @default undefined
|
31945 | * @example
|
31946 | * axis: {
|
31947 | * y: {
|
31948 | * max: 1000
|
31949 | * }
|
31950 | * }
|
31951 | */
|
31952 | axis_y_max: undefined,
|
31953 |
|
31954 | /**
|
31955 | * Set min value of y axis.
|
31956 | * - **NOTE:**
|
31957 | * Padding will be added based on this value, so if you don't need the padding, please set axis.y.padding to disable it (e.g. axis.y.padding = 0).
|
31958 | * @name axis․y․min
|
31959 | * @memberof Options
|
31960 | * @type {number}
|
31961 | * @default undefined
|
31962 | * @example
|
31963 | * axis: {
|
31964 | * y: {
|
31965 | * min: 1000
|
31966 | * }
|
31967 | * }
|
31968 | */
|
31969 | axis_y_min: undefined,
|
31970 |
|
31971 | /**
|
31972 | * Change the direction of y axis.<br><br>
|
31973 | * If true set, the direction will be from the top to the bottom.
|
31974 | * @name axis․y․inverted
|
31975 | * @memberof Options
|
31976 | * @type {boolean}
|
31977 | * @default false
|
31978 | * @example
|
31979 | * axis: {
|
31980 | * y: {
|
31981 | * inverted: true
|
31982 | * }
|
31983 | * }
|
31984 | */
|
31985 | axis_y_inverted: !1,
|
31986 |
|
31987 | /**
|
31988 | * Set center value of y axis.
|
31989 | * @name axis․y․center
|
31990 | * @memberof Options
|
31991 | * @type {number}
|
31992 | * @default undefined
|
31993 | * @example
|
31994 | * axis: {
|
31995 | * y: {
|
31996 | * center: 0
|
31997 | * }
|
31998 | * }
|
31999 | */
|
32000 | axis_y_center: undefined,
|
32001 |
|
32002 | /**
|
32003 | * Show y axis inside of the chart.
|
32004 | * @name axis․y․inner
|
32005 | * @memberof Options
|
32006 | * @type {boolean}
|
32007 | * @default false
|
32008 | * @example
|
32009 | * axis: {
|
32010 | * y: {
|
32011 | * inner: true
|
32012 | * }
|
32013 | * }
|
32014 | */
|
32015 | axis_y_inner: !1,
|
32016 |
|
32017 | /**
|
32018 | * Set label on y axis.<br><br>
|
32019 | * You can set y axis label and change its position by this option. This option works in the same way as [axis.x.label](#.axis%25E2%2580%25A4x%25E2%2580%25A4label).
|
32020 | * @name axis․y․label
|
32021 | * @memberof Options
|
32022 | * @type {string|object}
|
32023 | * @default {}
|
32024 | * @see [axis.x.label](#.axis%25E2%2580%25A4x%25E2%2580%25A4label) for position string value.
|
32025 | * @example
|
32026 | * axis: {
|
32027 | * y: {
|
32028 | * label: "Your Y Axis"
|
32029 | * }
|
32030 | * }
|
32031 | *
|
32032 | * axis: {
|
32033 | * y: {
|
32034 | * label: {
|
32035 | * text: "Your Y Axis",
|
32036 | * position: "outer-middle"
|
32037 | * }
|
32038 | * }
|
32039 | * }
|
32040 | */
|
32041 | axis_y_label: {},
|
32042 |
|
32043 | /**
|
32044 | * Set formatter for y axis tick text.<br><br>
|
32045 | * This option accepts d3.format object as well as a function you define.
|
32046 | * @name axis․y․tick․format
|
32047 | * @memberof Options
|
32048 | * @type {Function}
|
32049 | * @default undefined
|
32050 | * @example
|
32051 | * axis: {
|
32052 | * y: {
|
32053 | * tick: {
|
32054 | * format: function(x) {
|
32055 | * return x.getFullYear();
|
32056 | * }
|
32057 | * }
|
32058 | * }
|
32059 | * }
|
32060 | */
|
32061 | axis_y_tick_format: undefined,
|
32062 |
|
32063 | /**
|
32064 | * Setting for culling ticks.<br><br>
|
32065 | * If true is set, the ticks will be culled, then only limitted tick text will be shown. This option does not hide the tick lines. If false is set, all of ticks will be shown.<br><br>
|
32066 | * We can change the number of ticks to be shown by axis.y.tick.culling.max.
|
32067 | * @name axis․y․tick․culling
|
32068 | * @memberof Options
|
32069 | * @type {boolean}
|
32070 | * @default false
|
32071 | * @example
|
32072 | * axis: {
|
32073 | * y: {
|
32074 | * tick: {
|
32075 | * culling: false
|
32076 | * }
|
32077 | * }
|
32078 | * }
|
32079 | */
|
32080 | axis_y_tick_culling: !1,
|
32081 |
|
32082 | /**
|
32083 | * The number of tick texts will be adjusted to less than this value.
|
32084 | * @name axis․y․tick․culling․max
|
32085 | * @memberof Options
|
32086 | * @type {number}
|
32087 | * @default 5
|
32088 | * @example
|
32089 | * axis: {
|
32090 | * y: {
|
32091 | * tick: {
|
32092 | * culling: {
|
32093 | * max: 5
|
32094 | * }
|
32095 | * }
|
32096 | * }
|
32097 | * }
|
32098 | */
|
32099 | axis_y_tick_culling_max: 5,
|
32100 |
|
32101 | /**
|
32102 | * Show y axis outer tick.
|
32103 | * @name axis․y․tick․outer
|
32104 | * @memberof Options
|
32105 | * @type {boolean}
|
32106 | * @default true
|
32107 | * @example
|
32108 | * axis: {
|
32109 | * y: {
|
32110 | * tick: {
|
32111 | * outer: false
|
32112 | * }
|
32113 | * }
|
32114 | * }
|
32115 | */
|
32116 | axis_y_tick_outer: !0,
|
32117 |
|
32118 | /**
|
32119 | * Set y axis tick values manually.
|
32120 | * @name axis․y․tick․values
|
32121 | * @memberof Options
|
32122 | * @type {Array|Function}
|
32123 | * @default null
|
32124 | * @example
|
32125 | * axis: {
|
32126 | * y: {
|
32127 | * tick: {
|
32128 | * values: [100, 1000, 10000],
|
32129 | *
|
32130 | * // an Array value should be returned
|
32131 | * values: function() {
|
32132 | * return [ ... ];
|
32133 | * }
|
32134 | * }
|
32135 | * }
|
32136 | * }
|
32137 | */
|
32138 | axis_y_tick_values: null,
|
32139 |
|
32140 | /**
|
32141 | * Rotate y axis tick text.
|
32142 | * - If you set negative value, it will rotate to opposite direction.
|
32143 | * - Applied when [`axis.rotated`](#.axis%25E2%2580%25A4rotated) option is `true`.
|
32144 | * @name axis․y․tick․rotate
|
32145 | * @memberof Options
|
32146 | * @type {number}
|
32147 | * @default 0
|
32148 | * @example
|
32149 | * axis: {
|
32150 | * y: {
|
32151 | * tick: {
|
32152 | * rotate: 60
|
32153 | * }
|
32154 | * }
|
32155 | * }
|
32156 | */
|
32157 | axis_y_tick_rotate: 0,
|
32158 |
|
32159 | /**
|
32160 | * Set the number of y axis ticks.<br><br>
|
32161 | * - **NOTE:** The position of the ticks will be calculated precisely, so the values on the ticks will not be rounded nicely. In the case, axis.y.tick.format or axis.y.tick.values will be helpful.
|
32162 | * @name axis․y․tick․count
|
32163 | * @memberof Options
|
32164 | * @type {number}
|
32165 | * @default undefined
|
32166 | * @example
|
32167 | * axis: {
|
32168 | * y: {
|
32169 | * tick: {
|
32170 | * count: 5
|
32171 | * }
|
32172 | * }
|
32173 | * }
|
32174 | */
|
32175 | axis_y_tick_count: undefined,
|
32176 |
|
32177 | /**
|
32178 | * Show or hide y axis tick line.
|
32179 | * @name axis․y․tick․show
|
32180 | * @memberof Options
|
32181 | * @type {boolean}
|
32182 | * @default true
|
32183 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.HideTickLineText)
|
32184 | * @example
|
32185 | * axis: {
|
32186 | * y: {
|
32187 | * tick: {
|
32188 | * show: false
|
32189 | * }
|
32190 | * }
|
32191 | * }
|
32192 | */
|
32193 | axis_y_tick_show: !0,
|
32194 |
|
32195 | /**
|
32196 | * Set axis tick step(interval) size.
|
32197 | * - **NOTE:** Will be ignored if `axis.y.tick.count` or `axis.y.tick.values` options are set.
|
32198 | * @name axis․y․tick․stepSize
|
32199 | * @memberof Options
|
32200 | * @type {number}
|
32201 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.StepSizeForYAxis)
|
32202 | * @example
|
32203 | * axis: {
|
32204 | * y: {
|
32205 | * tick: {
|
32206 | * // tick value will step as indicated interval value.
|
32207 | * // ex) 'stepSize=15' ==> [0, 15, 30, 45, 60]
|
32208 | * stepSize: 15
|
32209 | * }
|
32210 | * }
|
32211 | * }
|
32212 | */
|
32213 | axis_y_tick_stepSize: null,
|
32214 |
|
32215 | /**
|
32216 | * Show or hide y axis tick text.
|
32217 | * @name axis․y․tick․text․show
|
32218 | * @memberof Options
|
32219 | * @type {boolean}
|
32220 | * @default true
|
32221 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.HideTickLineText)
|
32222 | * @example
|
32223 | * axis: {
|
32224 | * y: {
|
32225 | * tick: {
|
32226 | * text: {
|
32227 | * show: false
|
32228 | * }
|
32229 | * }
|
32230 | * }
|
32231 | * }
|
32232 | */
|
32233 | axis_y_tick_text_show: !0,
|
32234 |
|
32235 | /**
|
32236 | * Set the y Axis tick text's position relatively its original position
|
32237 | * @name axis․y․tick․text․position
|
32238 | * @memberof Options
|
32239 | * @type {object}
|
32240 | * @default {x: 0, y:0}
|
32241 | * @example
|
32242 | * axis: {
|
32243 | * y: {
|
32244 | * tick: {
|
32245 | * text: {
|
32246 | * position: {
|
32247 | * x: 10,
|
32248 | * y: 10
|
32249 | * }
|
32250 | * }
|
32251 | * }
|
32252 | * }
|
32253 | * }
|
32254 | */
|
32255 | axis_y_tick_text_position: {
|
32256 | x: 0,
|
32257 | y: 0
|
32258 | },
|
32259 |
|
32260 | /**
|
32261 | * Set the number of y axis ticks.<br><br>
|
32262 | * - **NOTE:** The position of the ticks will be calculated precisely, so the values on the ticks will not be rounded nicely. In the case, axis.y.tick.format or axis.y.tick.values will be helpful.
|
32263 | * @name axis․y․tick․time
|
32264 | * @memberof Options
|
32265 | * @private
|
32266 | * @type {object}
|
32267 | * @property {object} time time object
|
32268 | * @property {Function} [time.value] D3's time interval function (https://github.com/d3/d3-time#intervals)
|
32269 | * @example
|
32270 | * axis: {
|
32271 | * y: {
|
32272 | * tick: {
|
32273 | * time: {
|
32274 | * // ticks at 15-minute intervals
|
32275 | * // https://github.com/d3/d3-scale/blob/master/README.md#time_ticks
|
32276 | * value: d3.timeMinute.every(15)
|
32277 | * }
|
32278 | * }
|
32279 | * }
|
32280 | * }
|
32281 | */
|
32282 | // @TODO: not fully implemented yet
|
32283 | axis_y_tick_time_value: undefined,
|
32284 |
|
32285 | /**
|
32286 | * Set padding for y axis.<br><br>
|
32287 | * You can set padding for y axis to create more space on the edge of the axis.
|
32288 | * This option accepts object and it can include top and bottom. top, bottom will be treated as pixels.
|
32289 | *
|
32290 | * - **NOTE:**
|
32291 | * - Given values are translated relative to the y Axis domain value for padding
|
32292 | * - For area and bar type charts, [area.zerobased](#.area) or [bar.zerobased](#.bar) options should be set to 'false` to get padded bottom.
|
32293 | * @name axis․y․padding
|
32294 | * @memberof Options
|
32295 | * @type {object|number}
|
32296 | * @default {}
|
32297 | * @example
|
32298 | * axis: {
|
32299 | * y: {
|
32300 | * padding: {
|
32301 | * top: 0,
|
32302 | * bottom: 0
|
32303 | * },
|
32304 | *
|
32305 | * // or set both values at once.
|
32306 | * padding: 10
|
32307 | * }
|
32308 | * }
|
32309 | */
|
32310 | axis_y_padding: {},
|
32311 |
|
32312 | /**
|
32313 | * Set default range of y axis.<br><br>
|
32314 | * This option set the default value for y axis when there is no data on init.
|
32315 | * @name axis․y․default
|
32316 | * @memberof Options
|
32317 | * @type {Array}
|
32318 | * @default undefined
|
32319 | * @example
|
32320 | * axis: {
|
32321 | * y: {
|
32322 | * default: [0, 1000]
|
32323 | * }
|
32324 | * }
|
32325 | */
|
32326 | axis_y_default: undefined,
|
32327 |
|
32328 | /**
|
32329 | * Set additional axes for y Axis.
|
32330 | * - **NOTE:** Axis' scale is based on y Axis value if domain option isn't set.
|
32331 | *
|
32332 | * Each axis object should consist with following options:
|
32333 | *
|
32334 | * | Name | Type | Default | Description |
|
32335 | * | --- | --- | --- | --- |
|
32336 | * | domain | Array | - | Set the domain value |
|
32337 | * | tick.outer | boolean | true | Show outer tick |
|
32338 | * | tick.format | Function | - | Set formatter for tick text |
|
32339 | * | tick.count | Number | - | Set the number of y axis ticks |
|
32340 | * | tick.values | Array | - | Set tick values manually |
|
32341 | * @name axis․y․axes
|
32342 | * @memberof Options
|
32343 | * @type {Array}
|
32344 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.MultiAxes)
|
32345 | * @see [Demo: Domain](https://naver.github.io/billboard.js/demo/#Axis.MultiAxesDomain)
|
32346 | * @example
|
32347 | * y: {
|
32348 | * axes: [
|
32349 | * {
|
32350 | * // if set, will not be correlated with the main y Axis domain value
|
32351 | * domain: [0, 1000],
|
32352 | * tick: {
|
32353 | * outer: false,
|
32354 | * format: function(x) {
|
32355 | * return x + "%";
|
32356 | * },
|
32357 | * count: 2,
|
32358 | * values: [10, 20, 30]
|
32359 | * }
|
32360 | * },
|
32361 | * ...
|
32362 | * ]
|
32363 | * }
|
32364 | */
|
32365 | axis_y_axes: []
|
32366 | });
|
32367 | ;// CONCATENATED MODULE: ./src/config/Options/axis/y2.ts
|
32368 | /**
|
32369 | * Copyright (c) 2017 ~ present NAVER Corp.
|
32370 | * billboard.js project is licensed under the MIT license
|
32371 | */
|
32372 |
|
32373 | /**
|
32374 | * y2 Axis config options
|
32375 | */
|
32376 | /* harmony default export */ var y2 = ({
|
32377 | /**
|
32378 | * Show or hide y2 axis.
|
32379 | * - **NOTE**:
|
32380 | * - When set to `false` will not generate y2 axis node. In this case, all 'y2' axis related functionality won't work properly.
|
32381 | * - If need to use 'y2' related options while y2 isn't visible, set the value `true` and control visibility by css display property.
|
32382 | * @name axis․y2․show
|
32383 | * @memberof Options
|
32384 | * @type {boolean}
|
32385 | * @default false
|
32386 | * @example
|
32387 | * axis: {
|
32388 | * y2: {
|
32389 | * show: true
|
32390 | * }
|
32391 | * }
|
32392 | */
|
32393 | axis_y2_show: !1,
|
32394 |
|
32395 | /**
|
32396 | * Set type of y2 axis.<br><br>
|
32397 | * **Available Values:**
|
32398 | * - indexed
|
32399 | * - log
|
32400 | * - timeseries
|
32401 | *
|
32402 | * **NOTE:**<br>
|
32403 | * - **log** type:
|
32404 | * - the bound data values must be exclusively-positive.
|
32405 | * - y2 axis min value should be >= 0.
|
32406 | * - [`data.groups`](#.data%25E2%2580%25A4groups)(stacked data) option aren't supported.
|
32407 | *
|
32408 | * @name axis․y2․type
|
32409 | * @memberof Options
|
32410 | * @type {string}
|
32411 | * @default "indexed"
|
32412 | * @see [Demo: log](https://naver.github.io/billboard.js/demo/#Axis.LogScales)
|
32413 | * @example
|
32414 | * axis: {
|
32415 | * y2: {
|
32416 | * type: "indexed"
|
32417 | * }
|
32418 | * }
|
32419 | */
|
32420 | axis_y2_type: "indexed",
|
32421 |
|
32422 | /**
|
32423 | * Set max value of y2 axis.
|
32424 | * @name axis․y2․max
|
32425 | * @memberof Options
|
32426 | * @type {number}
|
32427 | * @default undefined
|
32428 | * @example
|
32429 | * axis: {
|
32430 | * y2: {
|
32431 | * max: 1000
|
32432 | * }
|
32433 | * }
|
32434 | */
|
32435 | axis_y2_max: undefined,
|
32436 |
|
32437 | /**
|
32438 | * Set min value of y2 axis.
|
32439 | * @name axis․y2․min
|
32440 | * @memberof Options
|
32441 | * @type {number}
|
32442 | * @default undefined
|
32443 | * @example
|
32444 | * axis: {
|
32445 | * y2: {
|
32446 | * min: -1000
|
32447 | * }
|
32448 | * }
|
32449 | */
|
32450 | axis_y2_min: undefined,
|
32451 |
|
32452 | /**
|
32453 | * Change the direction of y2 axis.<br><br>
|
32454 | * If true set, the direction will be from the top to the bottom.
|
32455 | * @name axis․y2․inverted
|
32456 | * @memberof Options
|
32457 | * @type {boolean}
|
32458 | * @default false
|
32459 | * @example
|
32460 | * axis: {
|
32461 | * y2: {
|
32462 | * inverted: true
|
32463 | * }
|
32464 | * }
|
32465 | */
|
32466 | axis_y2_inverted: !1,
|
32467 |
|
32468 | /**
|
32469 | * Set center value of y2 axis.
|
32470 | * @name axis․y2․center
|
32471 | * @memberof Options
|
32472 | * @type {number}
|
32473 | * @default undefined
|
32474 | * @example
|
32475 | * axis: {
|
32476 | * y2: {
|
32477 | * center: 0
|
32478 | * }
|
32479 | * }
|
32480 | */
|
32481 | axis_y2_center: undefined,
|
32482 |
|
32483 | /**
|
32484 | * Show y2 axis inside of the chart.
|
32485 | * @name axis․y2․inner
|
32486 | * @memberof Options
|
32487 | * @type {boolean}
|
32488 | * @default false
|
32489 | * @example
|
32490 | * axis: {
|
32491 | * y2: {
|
32492 | * inner: true
|
32493 | * }
|
32494 | * }
|
32495 | */
|
32496 | axis_y2_inner: !1,
|
32497 |
|
32498 | /**
|
32499 | * Set label on y2 axis.<br><br>
|
32500 | * You can set y2 axis label and change its position by this option. This option works in the same way as [axis.x.label](#.axis%25E2%2580%25A4x%25E2%2580%25A4label).
|
32501 | * @name axis․y2․label
|
32502 | * @memberof Options
|
32503 | * @type {string|object}
|
32504 | * @default {}
|
32505 | * @see [axis.x.label](#.axis%25E2%2580%25A4x%25E2%2580%25A4label) for position string value.
|
32506 | * @example
|
32507 | * axis: {
|
32508 | * y2: {
|
32509 | * label: "Your Y2 Axis"
|
32510 | * }
|
32511 | * }
|
32512 | *
|
32513 | * axis: {
|
32514 | * y2: {
|
32515 | * label: {
|
32516 | * text: "Your Y2 Axis",
|
32517 | * position: "outer-middle"
|
32518 | * }
|
32519 | * }
|
32520 | * }
|
32521 | */
|
32522 | axis_y2_label: {},
|
32523 |
|
32524 | /**
|
32525 | * Set formatter for y2 axis tick text.<br><br>
|
32526 | * This option works in the same way as axis.y.format.
|
32527 | * @name axis․y2․tick․format
|
32528 | * @memberof Options
|
32529 | * @type {Function}
|
32530 | * @default undefined
|
32531 | * @example
|
32532 | * axis: {
|
32533 | * y2: {
|
32534 | * tick: {
|
32535 | * format: d3.format("$,")
|
32536 | * //or format: function(d) { return "$" + d; }
|
32537 | * }
|
32538 | * }
|
32539 | * }
|
32540 | */
|
32541 | axis_y2_tick_format: undefined,
|
32542 |
|
32543 | /**
|
32544 | * Setting for culling ticks.<br><br>
|
32545 | * If true is set, the ticks will be culled, then only limitted tick text will be shown. This option does not hide the tick lines. If false is set, all of ticks will be shown.<br><br>
|
32546 | * We can change the number of ticks to be shown by axis.y.tick.culling.max.
|
32547 | * @name axis․y2․tick․culling
|
32548 | * @memberof Options
|
32549 | * @type {boolean}
|
32550 | * @default false
|
32551 | * @example
|
32552 | * axis: {
|
32553 | * y2: {
|
32554 | * tick: {
|
32555 | * culling: false
|
32556 | * }
|
32557 | * }
|
32558 | * }
|
32559 | */
|
32560 | axis_y2_tick_culling: !1,
|
32561 |
|
32562 | /**
|
32563 | * The number of tick texts will be adjusted to less than this value.
|
32564 | * @name axis․y2․tick․culling․max
|
32565 | * @memberof Options
|
32566 | * @type {number}
|
32567 | * @default 5
|
32568 | * @example
|
32569 | * axis: {
|
32570 | * y2: {
|
32571 | * tick: {
|
32572 | * culling: {
|
32573 | * max: 5
|
32574 | * }
|
32575 | * }
|
32576 | * }
|
32577 | * }
|
32578 | */
|
32579 | axis_y2_tick_culling_max: 5,
|
32580 |
|
32581 | /**
|
32582 | * Show or hide y2 axis outer tick.
|
32583 | * @name axis․y2․tick․outer
|
32584 | * @memberof Options
|
32585 | * @type {boolean}
|
32586 | * @default true
|
32587 | * @example
|
32588 | * axis: {
|
32589 | * y2: {
|
32590 | * tick: {
|
32591 | * outer: false
|
32592 | * }
|
32593 | * }
|
32594 | * }
|
32595 | */
|
32596 | axis_y2_tick_outer: !0,
|
32597 |
|
32598 | /**
|
32599 | * Set y2 axis tick values manually.
|
32600 | * @name axis․y2․tick․values
|
32601 | * @memberof Options
|
32602 | * @type {Array|Function}
|
32603 | * @default null
|
32604 | * @example
|
32605 | * axis: {
|
32606 | * y2: {
|
32607 | * tick: {
|
32608 | * values: [100, 1000, 10000],
|
32609 | *
|
32610 | * // an Array value should be returned
|
32611 | * values: function() {
|
32612 | * return [ ... ];
|
32613 | * }
|
32614 | * }
|
32615 | * }
|
32616 | * }
|
32617 | */
|
32618 | axis_y2_tick_values: null,
|
32619 |
|
32620 | /**
|
32621 | * Rotate y2 axis tick text.
|
32622 | * - If you set negative value, it will rotate to opposite direction.
|
32623 | * - Applied when [`axis.rotated`](#.axis%25E2%2580%25A4rotated) option is `true`.
|
32624 | * @name axis․y2․tick․rotate
|
32625 | * @memberof Options
|
32626 | * @type {number}
|
32627 | * @default 0
|
32628 | * @example
|
32629 | * axis: {
|
32630 | * y2: {
|
32631 | * tick: {
|
32632 | * rotate: 60
|
32633 | * }
|
32634 | * }
|
32635 | * }
|
32636 | */
|
32637 | axis_y2_tick_rotate: 0,
|
32638 |
|
32639 | /**
|
32640 | * Set the number of y2 axis ticks.
|
32641 | * - **NOTE:** This works in the same way as axis.y.tick.count.
|
32642 | * @name axis․y2․tick․count
|
32643 | * @memberof Options
|
32644 | * @type {number}
|
32645 | * @default undefined
|
32646 | * @example
|
32647 | * axis: {
|
32648 | * y2: {
|
32649 | * tick: {
|
32650 | * count: 5
|
32651 | * }
|
32652 | * }
|
32653 | * }
|
32654 | */
|
32655 | axis_y2_tick_count: undefined,
|
32656 |
|
32657 | /**
|
32658 | * Show or hide y2 axis tick line.
|
32659 | * @name axis․y2․tick․show
|
32660 | * @memberof Options
|
32661 | * @type {boolean}
|
32662 | * @default true
|
32663 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.HideTickLineText)
|
32664 | * @example
|
32665 | * axis: {
|
32666 | * y2: {
|
32667 | * tick: {
|
32668 | * show: false
|
32669 | * }
|
32670 | * }
|
32671 | * }
|
32672 | */
|
32673 | axis_y2_tick_show: !0,
|
32674 |
|
32675 | /**
|
32676 | * Set axis tick step(interval) size.
|
32677 | * - **NOTE:** Will be ignored if `axis.y2.tick.count` or `axis.y2.tick.values` options are set.
|
32678 | * @name axis․y2․tick․stepSize
|
32679 | * @memberof Options
|
32680 | * @type {number}
|
32681 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.StepSizeForYAxis)
|
32682 | * @example
|
32683 | * axis: {
|
32684 | * y2: {
|
32685 | * tick: {
|
32686 | * // tick value will step as indicated interval value.
|
32687 | * // ex) 'stepSize=15' ==> [0, 15, 30, 45, 60]
|
32688 | * stepSize: 15
|
32689 | * }
|
32690 | * }
|
32691 | * }
|
32692 | */
|
32693 | axis_y2_tick_stepSize: null,
|
32694 |
|
32695 | /**
|
32696 | * Show or hide y2 axis tick text.
|
32697 | * @name axis․y2․tick․text․show
|
32698 | * @memberof Options
|
32699 | * @type {boolean}
|
32700 | * @default true
|
32701 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.HideTickLineText)
|
32702 | * @example
|
32703 | * axis: {
|
32704 | * y2: {
|
32705 | * tick: {
|
32706 | * text: {
|
32707 | * show: false
|
32708 | * }
|
32709 | * }
|
32710 | * }
|
32711 | * }
|
32712 | */
|
32713 | axis_y2_tick_text_show: !0,
|
32714 |
|
32715 | /**
|
32716 | * Set the y2 Axis tick text's position relatively its original position
|
32717 | * @name axis․y2․tick․text․position
|
32718 | * @memberof Options
|
32719 | * @type {object}
|
32720 | * @default {x: 0, y:0}
|
32721 | * @example
|
32722 | * axis: {
|
32723 | * y2: {
|
32724 | * tick: {
|
32725 | * text: {
|
32726 | * position: {
|
32727 | * x: 10,
|
32728 | * y: 10
|
32729 | * }
|
32730 | * }
|
32731 | * }
|
32732 | * }
|
32733 | * }
|
32734 | */
|
32735 | axis_y2_tick_text_position: {
|
32736 | x: 0,
|
32737 | y: 0
|
32738 | },
|
32739 |
|
32740 | /**
|
32741 | * Set padding for y2 axis.<br><br>
|
32742 | * You can set padding for y2 axis to create more space on the edge of the axis.
|
32743 | * This option accepts object and it can include top and bottom. top, bottom will be treated as pixels.
|
32744 | *
|
32745 | * - **NOTE:**
|
32746 | * - Given values are translated relative to the y2 Axis domain value for padding
|
32747 | * - For area and bar type charts, [area.zerobased](#.area) or [bar.zerobased](#.bar) options should be set to 'false` to get padded bottom.
|
32748 | * @name axis․y2․padding
|
32749 | * @memberof Options
|
32750 | * @type {object|number}
|
32751 | * @default {}
|
32752 | * @example
|
32753 | * axis: {
|
32754 | * y2: {
|
32755 | * padding: {
|
32756 | * top: 100,
|
32757 | * bottom: 100
|
32758 | * }
|
32759 | *
|
32760 | * // or set both values at once.
|
32761 | * padding: 10
|
32762 | * }
|
32763 | */
|
32764 | axis_y2_padding: {},
|
32765 |
|
32766 | /**
|
32767 | * Set default range of y2 axis.<br><br>
|
32768 | * This option set the default value for y2 axis when there is no data on init.
|
32769 | * @name axis․y2․default
|
32770 | * @memberof Options
|
32771 | * @type {Array}
|
32772 | * @default undefined
|
32773 | * @example
|
32774 | * axis: {
|
32775 | * y2: {
|
32776 | * default: [0, 1000]
|
32777 | * }
|
32778 | * }
|
32779 | */
|
32780 | axis_y2_default: undefined,
|
32781 |
|
32782 | /**
|
32783 | * Set additional axes for y2 Axis.
|
32784 | * - **NOTE:** Axis' scale is based on y2 Axis value if domain option isn't set.
|
32785 | *
|
32786 | * Each axis object should consist with following options:
|
32787 | *
|
32788 | * | Name | Type | Default | Description |
|
32789 | * | --- | --- | --- | --- |
|
32790 | * | domain | Array | - | Set the domain value |
|
32791 | * | tick.outer | boolean | true | Show outer tick |
|
32792 | * | tick.format | Function | - | Set formatter for tick text |
|
32793 | * | tick.count | Number | - | Set the number of y axis ticks |
|
32794 | * | tick.values | Array | - | Set tick values manually |
|
32795 | * @name axis․y2․axes
|
32796 | * @memberof Options
|
32797 | * @type {Array}
|
32798 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.MultiAxes)
|
32799 | * @see [Demo: Domain](https://naver.github.io/billboard.js/demo/#Axis.MultiAxesDomain)
|
32800 | * @example
|
32801 | * y2: {
|
32802 | * axes: [
|
32803 | * {
|
32804 | * // if set, will not be correlated with the main y2 Axis domain value
|
32805 | * domain: [0, 1000],
|
32806 | * tick: {
|
32807 | * outer: false,
|
32808 | * format: function(x) {
|
32809 | * return x + "%";
|
32810 | * },
|
32811 | * count: 2,
|
32812 | * values: [10, 20, 30]
|
32813 | * }
|
32814 | * },
|
32815 | * ...
|
32816 | * ]
|
32817 | * }
|
32818 | */
|
32819 | axis_y2_axes: []
|
32820 | });
|
32821 | ;// CONCATENATED MODULE: ./src/config/Options/axis/axis.ts
|
32822 |
|
32823 |
|
32824 | function axis_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
32825 |
|
32826 | function axis_objectSpread(target) { for (var source, i = 1; i < arguments.length; i++) source = arguments[i] == null ? {} : arguments[i], i % 2 ? axis_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : axis_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); return target; }
|
32827 |
|
32828 | /**
|
32829 | * Copyright (c) 2017 ~ present NAVER Corp.
|
32830 | * billboard.js project is licensed under the MIT license
|
32831 | */
|
32832 |
|
32833 |
|
32834 |
|
32835 | /**
|
32836 | * y Axis config options
|
32837 | */
|
32838 |
|
32839 | /* harmony default export */ var Options_axis_axis = (axis_objectSpread(axis_objectSpread(axis_objectSpread({
|
32840 | /**
|
32841 | * Switch x and y axis position.
|
32842 | * @name axis․rotated
|
32843 | * @memberof Options
|
32844 | * @type {boolean}
|
32845 | * @default false
|
32846 | * @example
|
32847 | * axis: {
|
32848 | * rotated: true
|
32849 | * }
|
32850 | */
|
32851 | axis_rotated: !1
|
32852 | }, axis_x), y), y2));
|
32853 | ;// CONCATENATED MODULE: ./src/config/Options/common/grid.ts
|
32854 | /**
|
32855 | * Copyright (c) 2017 ~ present NAVER Corp.
|
32856 | * billboard.js project is licensed under the MIT license
|
32857 | */
|
32858 |
|
32859 | /**
|
32860 | * grid config options
|
32861 | */
|
32862 | /* harmony default export */ var common_grid = ({
|
32863 | /**
|
32864 | * Set related options
|
32865 | * @name grid
|
32866 | * @memberof Options
|
32867 | * @type {object}
|
32868 | * @property {boolean} [front=false] Set 'grid & focus lines' to be positioned over grid lines and chart elements.
|
32869 | * @property {object} x Grid x object
|
32870 | * @property {boolean} [x.show=false] Show grids along x axis.
|
32871 | * @property {Array} [x.lines=[]] Show additional grid lines along x axis.<br>
|
32872 | * This option accepts array including object that has value, text, position and class. text, position and class are optional. For position, start, middle and end (default) are available.
|
32873 | * If x axis is category axis, value can be category name. If x axis is timeseries axis, value can be date string, Date object and unixtime integer.
|
32874 | * @property {object} y Grid y object
|
32875 | * @property {boolean} [y.show=false] Show grids along x axis.
|
32876 | * @property {Array} [y.lines=[]] Show additional grid lines along y axis.<br>
|
32877 | * This option accepts array including object that has value, text, position and class.
|
32878 | * @property {number} [y.ticks=10] Number of y grids to be shown.
|
32879 | * @property {object} focus Grid focus object
|
32880 | * @property {boolean} [focus.edge=false] Show edged focus grid line.<br>**NOTE:** Available when [`tooltip.grouped=false`](#.tooltip) option is set.
|
32881 | * @property {boolean} [focus.show=true] Show grid line when focus.
|
32882 | * @property {boolean} [focus.y=false] Show y coordinate focus grid line.<br>**NOTE:** Available when [`tooltip.grouped=false`](#.tooltip) option is set.
|
32883 | * @property {object} lines Grid lines object
|
32884 | * @property {boolean} [lines.front=true] Set grid lines to be positioned over chart elements.
|
32885 | * @default undefined
|
32886 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Grid.GridLines)
|
32887 | * @see [Demo: X Grid Lines](https://naver.github.io/billboard.js/demo/#Grid.OptionalXGridLines)
|
32888 | * @see [Demo: Y Grid Lines](https://naver.github.io/billboard.js/demo/#Grid.OptionalYGridLines)
|
32889 | * @example
|
32890 | * grid: {
|
32891 | * x: {
|
32892 | * show: true,
|
32893 | * lines: [
|
32894 | * {value: 2, text: "Label on 2"},
|
32895 | * {value: 5, text: "Label on 5", class: "label-5"},
|
32896 | * {value: 6, text: "Label on 6", position: "start"}
|
32897 | * ]
|
32898 | * },
|
32899 | * y: {
|
32900 | * show: true,
|
32901 | * lines: [
|
32902 | * {value: 100, text: "Label on 100"},
|
32903 | * {value: 200, text: "Label on 200", class: "label-200"},
|
32904 | * {value: 300, text: "Label on 300", position: 'middle'}
|
32905 | * ],
|
32906 | * ticks: 5
|
32907 | * },
|
32908 | * front: true,
|
32909 | * focus: {
|
32910 | * show: false,
|
32911 | *
|
32912 | * // Below options are available when 'tooltip.grouped=false' option is set
|
32913 | * edge: true,
|
32914 | * y: true
|
32915 | * },
|
32916 | * lines: {
|
32917 | * front: false
|
32918 | * }
|
32919 | * }
|
32920 | */
|
32921 | grid_x_show: !1,
|
32922 | grid_x_type: "tick",
|
32923 | grid_x_lines: [],
|
32924 | grid_y_show: !1,
|
32925 | grid_y_lines: [],
|
32926 | grid_y_ticks: 10,
|
32927 | grid_focus_edge: !1,
|
32928 | grid_focus_show: !0,
|
32929 | grid_focus_y: !1,
|
32930 | grid_front: !1,
|
32931 | grid_lines_front: !0
|
32932 | });
|
32933 | ;// CONCATENATED MODULE: ./src/config/resolver/axis.ts
|
32934 | /**
|
32935 | * Copyright (c) 2017 ~ present NAVER Corp.
|
32936 | * billboard.js project is licensed under the MIT license
|
32937 | */
|
32938 |
|
32939 | /**
|
32940 | * Modules exports for Axis based chart
|
32941 | */
|
32942 | // Chart
|
32943 |
|
32944 |
|
32945 |
|
32946 |
|
32947 |
|
32948 |
|
32949 |
|
32950 | // ChartInternal
|
32951 |
|
32952 |
|
32953 |
|
32954 |
|
32955 |
|
32956 |
|
32957 |
|
32958 | // Axis based options
|
32959 |
|
32960 |
|
32961 |
|
32962 |
|
32963 | var api = [api_axis, api_category, grid_x, grid_y, flow, group, api_regions, x];
|
32964 | var internal = [Axis, clip, eventrect, interactions_flow, grid, region, size_axis];
|
32965 | var options = [data_axis, Options_axis_axis, common_grid];
|
32966 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/array.js
|
32967 | var array_slice = Array.prototype.slice;
|
32968 | /* harmony default export */ function d3_shape_src_array(x) {
|
32969 | return typeof x === "object" && "length" in x ? x // Array, TypedArray, NodeList, array-like
|
32970 | : Array.from(x); // Map, Set, iterable, string, or anything else
|
32971 | }
|
32972 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/constant.js
|
32973 | /* harmony default export */ function d3_shape_src_constant(x) {
|
32974 | return function () {
|
32975 | return x;
|
32976 | };
|
32977 | }
|
32978 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/descending.js
|
32979 | /* harmony default export */ function descending(a, b) {
|
32980 | return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
|
32981 | }
|
32982 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/identity.js
|
32983 | /* harmony default export */ function d3_shape_src_identity(d) {
|
32984 | return d;
|
32985 | }
|
32986 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/pie.js
|
32987 |
|
32988 |
|
32989 |
|
32990 |
|
32991 |
|
32992 | /* harmony default export */ function pie() {
|
32993 | function pie(data) {
|
32994 | var i,
|
32995 | j,
|
32996 | k,
|
32997 | a1,
|
32998 | v,
|
32999 | n = (data = d3_shape_src_array(data)).length,
|
33000 | sum = 0,
|
33001 | index = Array(n),
|
33002 | arcs = Array(n),
|
33003 | a0 = +startAngle.apply(this, arguments),
|
33004 | da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),
|
33005 | p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),
|
33006 | pa = p * (da < 0 ? -1 : 1);
|
33007 |
|
33008 | for (i = 0; i < n; ++i) (v = arcs[index[i] = i] = +value(data[i], i, data)) > 0 && (sum += v); // Optionally sort the arcs by previously-computed values or by data.
|
33009 |
|
33010 |
|
33011 | // Compute the arcs! They are stored in the original data's order.
|
33012 | for (sortValues == null ? sort != null && index.sort(function (i, j) {
|
33013 | return sort(data[i], data[j]);
|
33014 | }) : index.sort(function (i, j) {
|
33015 | return sortValues(arcs[i], arcs[j]);
|
33016 | }), i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {
|
33017 | data: data[j],
|
33018 | index: i,
|
33019 | value: v,
|
33020 | startAngle: a0,
|
33021 | endAngle: a1,
|
33022 | padAngle: p
|
33023 | };
|
33024 |
|
33025 | return arcs;
|
33026 | }
|
33027 |
|
33028 | var value = d3_shape_src_identity,
|
33029 | sortValues = descending,
|
33030 | sort = null,
|
33031 | startAngle = d3_shape_src_constant(0),
|
33032 | endAngle = d3_shape_src_constant(tau),
|
33033 | padAngle = d3_shape_src_constant(0);
|
33034 | return pie.value = function (_) {
|
33035 | return arguments.length ? (value = typeof _ === "function" ? _ : d3_shape_src_constant(+_), pie) : value;
|
33036 | }, pie.sortValues = function (_) {
|
33037 | return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;
|
33038 | }, pie.sort = function (_) {
|
33039 | return arguments.length ? (sort = _, sortValues = null, pie) : sort;
|
33040 | }, pie.startAngle = function (_) {
|
33041 | return arguments.length ? (startAngle = typeof _ === "function" ? _ : d3_shape_src_constant(+_), pie) : startAngle;
|
33042 | }, pie.endAngle = function (_) {
|
33043 | return arguments.length ? (endAngle = typeof _ === "function" ? _ : d3_shape_src_constant(+_), pie) : endAngle;
|
33044 | }, pie.padAngle = function (_) {
|
33045 | return arguments.length ? (padAngle = typeof _ === "function" ? _ : d3_shape_src_constant(+_), pie) : padAngle;
|
33046 | }, pie;
|
33047 | }
|
33048 | ;// CONCATENATED MODULE: ./node_modules/d3-path/src/path.js
|
33049 | var path_pi = Math.PI,
|
33050 | path_tau = 2 * path_pi,
|
33051 | path_epsilon = 1e-6,
|
33052 | tauEpsilon = path_tau - path_epsilon;
|
33053 |
|
33054 | function Path() {
|
33055 | // end of current subpath
|
33056 | this._x0 = this._y0 = // start of current subpath
|
33057 | this._x1 = this._y1 = null, this._ = "";
|
33058 | }
|
33059 |
|
33060 | function path() {
|
33061 | return new Path();
|
33062 | }
|
33063 |
|
33064 | Path.prototype = path.prototype = {
|
33065 | constructor: Path,
|
33066 | moveTo: function moveTo(x, y) {
|
33067 | this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y);
|
33068 | },
|
33069 | closePath: function closePath() {
|
33070 | this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._ += "Z");
|
33071 | },
|
33072 | lineTo: function lineTo(x, y) {
|
33073 | this._ += "L" + (this._x1 = +x) + "," + (this._y1 = +y);
|
33074 | },
|
33075 | quadraticCurveTo: function quadraticCurveTo(x1, y1, x, y) {
|
33076 | this._ += "Q" + +x1 + "," + +y1 + "," + (this._x1 = +x) + "," + (this._y1 = +y);
|
33077 | },
|
33078 | bezierCurveTo: function bezierCurveTo(x1, y1, x2, y2, x, y) {
|
33079 | this._ += "C" + +x1 + "," + +y1 + "," + +x2 + "," + +y2 + "," + (this._x1 = +x) + "," + (this._y1 = +y);
|
33080 | },
|
33081 | arcTo: function arcTo(x1, y1, x2, y2, r) {
|
33082 | x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;
|
33083 | var x0 = this._x1,
|
33084 | y0 = this._y1,
|
33085 | x21 = x2 - x1,
|
33086 | y21 = y2 - y1,
|
33087 | x01 = x0 - x1,
|
33088 | y01 = y0 - y1,
|
33089 | l01_2 = x01 * x01 + y01 * y01; // Is the radius negative? Error.
|
33090 |
|
33091 | if (r < 0) throw new Error("negative radius: " + r); // Is this path empty? Move to (x1,y1).
|
33092 |
|
33093 | if (this._x1 === null) this._ += "M" + (this._x1 = x1) + "," + (this._y1 = y1); // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.
|
33094 | else if (!(l01_2 > path_epsilon)) ; // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?
|
33095 | // Equivalently, is (x1,y1) coincident with (x2,y2)?
|
33096 | // Or, is the radius zero? Line to (x1,y1).
|
33097 | else if (!(Math.abs(y01 * x21 - y21 * x01) > path_epsilon) || !r) this._ += "L" + (this._x1 = x1) + "," + (this._y1 = y1); // Otherwise, draw an arc!
|
33098 | else {
|
33099 | var x20 = x2 - x0,
|
33100 | y20 = y2 - y0,
|
33101 | l21_2 = x21 * x21 + y21 * y21,
|
33102 | l21 = Math.sqrt(l21_2),
|
33103 | l01 = Math.sqrt(l01_2),
|
33104 | l = r * Math.tan((path_pi - Math.acos((l21_2 + l01_2 - (x20 * x20 + y20 * y20)) / (2 * l21 * l01))) / 2),
|
33105 | t01 = l / l01,
|
33106 | t21 = l / l21; // If the start tangent is not coincident with (x0,y0), line to.
|
33107 |
|
33108 | Math.abs(t01 - 1) > path_epsilon && (this._ += "L" + (x1 + t01 * x01) + "," + (y1 + t01 * y01)), this._ += "A" + r + "," + r + ",0,0," + +(y01 * x20 > x01 * y20) + "," + (this._x1 = x1 + t21 * x21) + "," + (this._y1 = y1 + t21 * y21);
|
33109 | }
|
33110 | },
|
33111 | arc: function arc(x, y, r, a0, a1, ccw) {
|
33112 | x = +x, y = +y, r = +r, ccw = !!ccw;
|
33113 | var dx = r * Math.cos(a0),
|
33114 | dy = r * Math.sin(a0),
|
33115 | x0 = x + dx,
|
33116 | y0 = y + dy,
|
33117 | cw = 1 ^ ccw,
|
33118 | da = ccw ? a0 - a1 : a1 - a0; // Is the radius negative? Error.
|
33119 |
|
33120 | if (r < 0) throw new Error("negative radius: " + r); // Is this path empty? Move to (x0,y0).
|
33121 |
|
33122 | this._x1 === null ? this._ += "M" + x0 + "," + y0 : (Math.abs(this._x1 - x0) > path_epsilon || Math.abs(this._y1 - y0) > path_epsilon) && (this._ += "L" + x0 + "," + y0);
|
33123 | // Is this arc empty? We’re done.
|
33124 | r && (da < 0 && (da = da % path_tau + path_tau), da > tauEpsilon ? this._ += "A" + r + "," + r + ",0,1," + cw + "," + (x - dx) + "," + (y - dy) + "A" + r + "," + r + ",0,1," + cw + "," + (this._x1 = x0) + "," + (this._y1 = y0) : da > path_epsilon && (this._ += "A" + r + "," + r + ",0," + +(da >= path_pi) + "," + cw + "," + (this._x1 = x + r * Math.cos(a1)) + "," + (this._y1 = y + r * Math.sin(a1)))); // Does the angle go the wrong way? Flip the direction.
|
33125 | },
|
33126 | rect: function rect(x, y, w, h) {
|
33127 | this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y) + "h" + +w + "v" + +h + "h" + -w + "Z";
|
33128 | },
|
33129 | toString: function toString() {
|
33130 | return this._;
|
33131 | }
|
33132 | };
|
33133 | /* harmony default export */ var src_path = (path);
|
33134 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/arc.js
|
33135 |
|
33136 |
|
33137 |
|
33138 |
|
33139 | function arcInnerRadius(d) {
|
33140 | return d.innerRadius;
|
33141 | }
|
33142 |
|
33143 | function arcOuterRadius(d) {
|
33144 | return d.outerRadius;
|
33145 | }
|
33146 |
|
33147 | function arcStartAngle(d) {
|
33148 | return d.startAngle;
|
33149 | }
|
33150 |
|
33151 | function arcEndAngle(d) {
|
33152 | return d.endAngle;
|
33153 | }
|
33154 |
|
33155 | function arcPadAngle(d) {
|
33156 | return d && d.padAngle; // Note: optional!
|
33157 | }
|
33158 |
|
33159 | function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {
|
33160 | var x10 = x1 - x0,
|
33161 | y10 = y1 - y0,
|
33162 | x32 = x3 - x2,
|
33163 | y32 = y3 - y2,
|
33164 | t = y32 * x10 - x32 * y10;
|
33165 | if (!(t * t < epsilon)) return t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t, [x0 + t * x10, y0 + t * y10];
|
33166 | } // Compute perpendicular offset line of length rc.
|
33167 | // http://mathworld.wolfram.com/Circle-LineIntersection.html
|
33168 |
|
33169 |
|
33170 | function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
|
33171 | var x01 = x0 - x1,
|
33172 | y01 = y0 - y1,
|
33173 | lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),
|
33174 | ox = lo * y01,
|
33175 | oy = -lo * x01,
|
33176 | x11 = x0 + ox,
|
33177 | y11 = y0 + oy,
|
33178 | x10 = x1 + ox,
|
33179 | y10 = y1 + oy,
|
33180 | x00 = (x11 + x10) / 2,
|
33181 | y00 = (y11 + y10) / 2,
|
33182 | dx = x10 - x11,
|
33183 | dy = y10 - y11,
|
33184 | d2 = dx * dx + dy * dy,
|
33185 | r = r1 - rc,
|
33186 | D = x11 * y10 - x10 * y11,
|
33187 | d = (dy < 0 ? -1 : 1) * sqrt(math_max(0, r * r * d2 - D * D)),
|
33188 | cx0 = (D * dy - dx * d) / d2,
|
33189 | cy0 = (-D * dx - dy * d) / d2,
|
33190 | cx1 = (D * dy + dx * d) / d2,
|
33191 | cy1 = (-D * dx + dy * d) / d2,
|
33192 | dx0 = cx0 - x00,
|
33193 | dy0 = cy0 - y00,
|
33194 | dx1 = cx1 - x00,
|
33195 | dy1 = cy1 - y00; // Pick the closer of the two intersection points.
|
33196 | // TODO Is there a faster way to determine which intersection to use?
|
33197 |
|
33198 | return dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1 && (cx0 = cx1, cy0 = cy1), {
|
33199 | cx: cx0,
|
33200 | cy: cy0,
|
33201 | x01: -ox,
|
33202 | y01: -oy,
|
33203 | x11: cx0 * (r1 / r - 1),
|
33204 | y11: cy0 * (r1 / r - 1)
|
33205 | };
|
33206 | }
|
33207 |
|
33208 | /* harmony default export */ function src_arc() {
|
33209 | function arc() {
|
33210 | var buffer,
|
33211 | r,
|
33212 | r0 = +innerRadius.apply(this, arguments),
|
33213 | r1 = +outerRadius.apply(this, arguments),
|
33214 | a0 = startAngle.apply(this, arguments) - halfPi,
|
33215 | a1 = endAngle.apply(this, arguments) - halfPi,
|
33216 | da = math_abs(a1 - a0),
|
33217 | cw = a1 > a0;
|
33218 | // Is it a point?
|
33219 | if (context || (context = buffer = src_path()), r1 < r0 && (r = r1, r1 = r0, r0 = r), !(r1 > epsilon)) context.moveTo(0, 0); // Or is it a circle or annulus?
|
33220 | else if (da > tau - epsilon) context.moveTo(r1 * cos(a0), r1 * sin(a0)), context.arc(0, 0, r1, a0, a1, !cw), r0 > epsilon && (context.moveTo(r0 * cos(a1), r0 * sin(a1)), context.arc(0, 0, r0, a1, a0, cw)); // Or is it a circular or annular sector?
|
33221 | else {
|
33222 | var t0,
|
33223 | t1,
|
33224 | a01 = a0,
|
33225 | a11 = a1,
|
33226 | a00 = a0,
|
33227 | a10 = a1,
|
33228 | da0 = da,
|
33229 | da1 = da,
|
33230 | ap = padAngle.apply(this, arguments) / 2,
|
33231 | rp = ap > epsilon && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),
|
33232 | rc = math_min(math_abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),
|
33233 | rc0 = rc,
|
33234 | rc1 = rc; // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.
|
33235 |
|
33236 | if (rp > epsilon) {
|
33237 | var p0 = asin(rp / r0 * sin(ap)),
|
33238 | p1 = asin(rp / r1 * sin(ap));
|
33239 | (da0 -= p0 * 2) > epsilon ? (p0 *= cw ? 1 : -1, a00 += p0, a10 -= p0) : (da0 = 0, a00 = a10 = (a0 + a1) / 2), (da1 -= p1 * 2) > epsilon ? (p1 *= cw ? 1 : -1, a01 += p1, a11 -= p1) : (da1 = 0, a01 = a11 = (a0 + a1) / 2);
|
33240 | }
|
33241 |
|
33242 | var x01 = r1 * cos(a01),
|
33243 | y01 = r1 * sin(a01),
|
33244 | x10 = r0 * cos(a10),
|
33245 | y10 = r0 * sin(a10); // Apply rounded corners?
|
33246 |
|
33247 | if (rc > epsilon) {
|
33248 | var oc,
|
33249 | x11 = r1 * cos(a11),
|
33250 | y11 = r1 * sin(a11),
|
33251 | x00 = r0 * cos(a00),
|
33252 | y00 = r0 * sin(a00); // Restrict the corner radius according to the sector angle.
|
33253 |
|
33254 | if (da < pi && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) {
|
33255 | var ax = x01 - oc[0],
|
33256 | ay = y01 - oc[1],
|
33257 | bx = x11 - oc[0],
|
33258 | by = y11 - oc[1],
|
33259 | kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),
|
33260 | lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);
|
33261 | rc0 = math_min(rc, (r0 - lc) / (kc - 1)), rc1 = math_min(rc, (r1 - lc) / (kc + 1));
|
33262 | }
|
33263 | } // Is the sector collapsed to a line?
|
33264 |
|
33265 |
|
33266 | da1 > epsilon ? rc1 > epsilon ? (t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw), t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw), context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01), rc1 < rc ? context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw) : (context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw), context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw), context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw))) : ( // Or is the outer ring just a circular arc?
|
33267 | context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw)) : context.moveTo(x01, y01), r0 > epsilon && da0 > epsilon ? rc0 > epsilon ? (t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw), t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw), context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01), rc0 < rc ? context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw) : (context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw), context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw), context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw))) : // Or is the inner ring just a circular arc?
|
33268 | context.arc(0, 0, r0, a10, a00, cw) : context.lineTo(x10, y10);
|
33269 | }
|
33270 | return (context.closePath(), buffer) ? (context = null, buffer + "" || null) : void 0;
|
33271 | }
|
33272 |
|
33273 | var innerRadius = arcInnerRadius,
|
33274 | outerRadius = arcOuterRadius,
|
33275 | cornerRadius = d3_shape_src_constant(0),
|
33276 | padRadius = null,
|
33277 | startAngle = arcStartAngle,
|
33278 | endAngle = arcEndAngle,
|
33279 | padAngle = arcPadAngle,
|
33280 | context = null;
|
33281 | return arc.centroid = function () {
|
33282 | var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,
|
33283 | a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;
|
33284 | return [cos(a) * r, sin(a) * r];
|
33285 | }, arc.innerRadius = function (_) {
|
33286 | return arguments.length ? (innerRadius = typeof _ === "function" ? _ : d3_shape_src_constant(+_), arc) : innerRadius;
|
33287 | }, arc.outerRadius = function (_) {
|
33288 | return arguments.length ? (outerRadius = typeof _ === "function" ? _ : d3_shape_src_constant(+_), arc) : outerRadius;
|
33289 | }, arc.cornerRadius = function (_) {
|
33290 | return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : d3_shape_src_constant(+_), arc) : cornerRadius;
|
33291 | }, arc.padRadius = function (_) {
|
33292 | return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : d3_shape_src_constant(+_), arc) : padRadius;
|
33293 | }, arc.startAngle = function (_) {
|
33294 | return arguments.length ? (startAngle = typeof _ === "function" ? _ : d3_shape_src_constant(+_), arc) : startAngle;
|
33295 | }, arc.endAngle = function (_) {
|
33296 | return arguments.length ? (endAngle = typeof _ === "function" ? _ : d3_shape_src_constant(+_), arc) : endAngle;
|
33297 | }, arc.padAngle = function (_) {
|
33298 | return arguments.length ? (padAngle = typeof _ === "function" ? _ : d3_shape_src_constant(+_), arc) : padAngle;
|
33299 | }, arc.context = function (_) {
|
33300 | return arguments.length ? (context = _ == null ? null : _, arc) : context;
|
33301 | }, arc;
|
33302 | }
|
33303 | ;// CONCATENATED MODULE: ./src/ChartInternal/shape/arc.ts
|
33304 | /**
|
33305 | * Copyright (c) 2017 ~ present NAVER Corp.
|
33306 | * billboard.js project is licensed under the MIT license
|
33307 | */
|
33308 |
|
33309 |
|
33310 |
|
33311 |
|
33312 |
|
33313 |
|
33314 | /* harmony default export */ var arc = ({
|
33315 | initPie: function initPie() {
|
33316 | var $$ = this,
|
33317 | config = $$.config,
|
33318 | dataType = config.data_type,
|
33319 | padding = config.pie_padding,
|
33320 | startingAngle = config[dataType + "_startingAngle"] || 0,
|
33321 | padAngle = ($$.hasType("pie") && padding ? padding * .01 : config[dataType + "_padAngle"]) || 0;
|
33322 | $$.pie = pie().startAngle(startingAngle).endAngle(startingAngle + 2 * Math.PI).padAngle(padAngle).value(function (d) {
|
33323 | return d.values.reduce(function (a, b) {
|
33324 | return a + b.value;
|
33325 | }, 0);
|
33326 | }).sort($$.getSortCompareFn.bind($$)(!0));
|
33327 | },
|
33328 | updateRadius: function updateRadius() {
|
33329 | var $$ = this,
|
33330 | config = $$.config,
|
33331 | state = $$.state,
|
33332 | padding = config.pie_padding,
|
33333 | w = config.gauge_width || config.donut_width,
|
33334 | gaugeArcWidth = $$.filterTargetsToShow($$.data.targets).length * config.gauge_arcs_minWidth;
|
33335 | state.radiusExpanded = Math.min(state.arcWidth, state.arcHeight) / 2 * ($$.hasMultiArcGauge() ? .85 : 1), state.radius = state.radiusExpanded * .95, state.innerRadiusRatio = w ? (state.radius - w) / state.radius : .6, state.gaugeArcWidth = w || (gaugeArcWidth <= state.radius - state.innerRadius ? state.radius - state.innerRadius : gaugeArcWidth <= state.radius ? gaugeArcWidth : state.radius);
|
33336 | var innerRadius = config.pie_innerRadius || (padding ? padding * (state.innerRadiusRatio + .1) : 0); // NOTE: inner/outerRadius can be an object by user setting, only for 'pie' type
|
33337 |
|
33338 | state.outerRadius = config.pie_outerRadius, state.innerRadius = $$.hasType("donut") || $$.hasType("gauge") ? state.radius * state.innerRadiusRatio : innerRadius;
|
33339 | },
|
33340 |
|
33341 | /**
|
33342 | * Get pie's inner & outer radius value
|
33343 | * @param {object|undefined} d Data object
|
33344 | * @returns {object}
|
33345 | * @private
|
33346 | */
|
33347 | getRadius: function getRadius(d) {
|
33348 | var $$ = this,
|
33349 | data = d && d.data,
|
33350 | _$$$state = $$.state,
|
33351 | innerRadius = _$$$state.innerRadius,
|
33352 | outerRadius = _$$$state.outerRadius;
|
33353 | return !isNumber(innerRadius) && data && (innerRadius = innerRadius[data.id] || 0), isObject(outerRadius) && data && data.id in outerRadius ? outerRadius = outerRadius[data.id] : !isNumber(outerRadius) && (outerRadius = $$.state.radius), {
|
33354 | innerRadius: innerRadius,
|
33355 | outerRadius: outerRadius
|
33356 | };
|
33357 | },
|
33358 | updateArc: function updateArc() {
|
33359 | var $$ = this;
|
33360 | $$.updateRadius(), $$.svgArc = $$.getSvgArc(), $$.svgArcExpanded = $$.getSvgArcExpanded();
|
33361 | },
|
33362 | getArcLength: function getArcLength() {
|
33363 | var $$ = this,
|
33364 | config = $$.config,
|
33365 | arcLengthInPercent = config.gauge_arcLength * 3.6,
|
33366 | len = 2 * (arcLengthInPercent / 360);
|
33367 | return arcLengthInPercent < -360 ? len = -2 : arcLengthInPercent > 360 && (len = 2), len * Math.PI;
|
33368 | },
|
33369 | getStartAngle: function getStartAngle() {
|
33370 | var $$ = this,
|
33371 | config = $$.config,
|
33372 | isFullCircle = config.gauge_fullCircle,
|
33373 | defaultStartAngle = -1 * Math.PI / 2,
|
33374 | defaultEndAngle = Math.PI / 2,
|
33375 | startAngle = config.gauge_startingAngle;
|
33376 | return !isFullCircle && startAngle <= defaultStartAngle ? startAngle = defaultStartAngle : !isFullCircle && startAngle >= defaultEndAngle ? startAngle = defaultEndAngle : (startAngle > Math.PI || startAngle < -1 * Math.PI) && (startAngle = Math.PI), startAngle;
|
33377 | },
|
33378 | updateAngle: function updateAngle(dValue) {
|
33379 | var $$ = this,
|
33380 | config = $$.config,
|
33381 | state = $$.state,
|
33382 | pie = $$.pie,
|
33383 | d = dValue,
|
33384 | found = !1;
|
33385 | if (!config) return null;
|
33386 | var gStart = $$.getStartAngle(),
|
33387 | radius = config.gauge_fullCircle ? $$.getArcLength() : gStart * -2;
|
33388 |
|
33389 | if (d.data && $$.isGaugeType(d.data) && !$$.hasMultiArcGauge()) {
|
33390 | // to prevent excluding total data sum during the init(when data.hide option is used), use $$.rendered state value
|
33391 | var totalSum = $$.getTotalDataSum(state.rendered),
|
33392 | gEnd = radius * (totalSum / (config.gauge_max - config.gauge_min));
|
33393 | pie = pie.startAngle(gStart).endAngle(gEnd + gStart);
|
33394 | }
|
33395 |
|
33396 | if (pie($$.filterTargetsToShow()).forEach(function (t, i) {
|
33397 | found || t.data.id !== d.data.id || (found = !0, d = t, d.index = i);
|
33398 | }), isNaN(d.startAngle) && (d.startAngle = 0), isNaN(d.endAngle) && (d.endAngle = d.startAngle), d.data && $$.hasMultiArcGauge()) {
|
33399 | var gMin = config.gauge_min,
|
33400 | gMax = config.gauge_max,
|
33401 | gValue = d.value < gMin ? 0 : d.value < gMax ? d.value - gMin : gMax - gMin;
|
33402 | d.startAngle = gStart, d.endAngle = gStart + radius / (gMax - gMin) * gValue;
|
33403 | }
|
33404 |
|
33405 | return found ? d : null;
|
33406 | },
|
33407 | getSvgArc: function getSvgArc() {
|
33408 | var $$ = this,
|
33409 | state = $$.state,
|
33410 | singleArcWidth = state.gaugeArcWidth / $$.filterTargetsToShow($$.data.targets).length,
|
33411 | hasMultiArcGauge = $$.hasMultiArcGauge(),
|
33412 | arc = src_arc().innerRadius(function (d) {
|
33413 | var _$$$getRadius = $$.getRadius(d),
|
33414 | innerRadius = _$$$getRadius.innerRadius;
|
33415 |
|
33416 | return hasMultiArcGauge ? state.radius - singleArcWidth * (d.index + 1) : isNumber(innerRadius) ? innerRadius : 0;
|
33417 | }).outerRadius(function (d) {
|
33418 | var _$$$getRadius2 = $$.getRadius(d),
|
33419 | outerRadius = _$$$getRadius2.outerRadius;
|
33420 |
|
33421 | return hasMultiArcGauge ? state.radius - singleArcWidth * d.index : outerRadius;
|
33422 | }),
|
33423 | newArc = function (d, withoutUpdate) {
|
33424 | var path = "M 0 0";
|
33425 |
|
33426 | if (d.value || d.data) {
|
33427 | var updated = !withoutUpdate && $$.updateAngle(d);
|
33428 | withoutUpdate ? path = arc(d) : updated && (path = arc(updated));
|
33429 | }
|
33430 |
|
33431 | return path;
|
33432 | };
|
33433 |
|
33434 | return newArc.centroid = arc.centroid, newArc;
|
33435 | },
|
33436 | getSvgArcExpanded: function getSvgArcExpanded(rate) {
|
33437 | var $$ = this,
|
33438 | state = $$.state,
|
33439 | newRate = rate || 1,
|
33440 | singleArcWidth = state.gaugeArcWidth / $$.filterTargetsToShow($$.data.targets).length,
|
33441 | hasMultiArcGauge = $$.hasMultiArcGauge(),
|
33442 | expandWidth = Math.min(state.radiusExpanded * newRate - state.radius, singleArcWidth * .8 - (1 - newRate) * 100),
|
33443 | arc = src_arc().innerRadius(function (d) {
|
33444 | return hasMultiArcGauge ? state.radius - singleArcWidth * (d.index + 1) : $$.getRadius(d).innerRadius;
|
33445 | }).outerRadius(function (d) {
|
33446 | var radius;
|
33447 | if (hasMultiArcGauge) radius = state.radius - singleArcWidth * d.index + expandWidth;else {
|
33448 | var _$$$getRadius3 = $$.getRadius(d),
|
33449 | outerRadius = _$$$getRadius3.outerRadius,
|
33450 | radiusExpanded = state.radiusExpanded;
|
33451 |
|
33452 | state.radius !== outerRadius && (radiusExpanded -= Math.abs(state.radius - outerRadius)), radius = radiusExpanded * newRate;
|
33453 | }
|
33454 | return radius;
|
33455 | });
|
33456 | return function (d) {
|
33457 | var updated = $$.updateAngle(d);
|
33458 | return updated ? arc(updated) : "M 0 0";
|
33459 | };
|
33460 | },
|
33461 | getArc: function getArc(d, withoutUpdate, force) {
|
33462 | return force || this.isArcType(d.data) ? this.svgArc(d, withoutUpdate) : "M 0 0";
|
33463 | },
|
33464 | transformForArcLabel: function transformForArcLabel(d) {
|
33465 | var $$ = this,
|
33466 | config = $$.config,
|
33467 | radiusExpanded = $$.state.radiusExpanded,
|
33468 | updated = $$.updateAngle(d),
|
33469 | translate = "";
|
33470 | if (updated) if ($$.hasMultiArcGauge()) {
|
33471 | var y1 = Math.sin(updated.endAngle - Math.PI / 2),
|
33472 | x = Math.cos(updated.endAngle - Math.PI / 2) * (radiusExpanded + 25),
|
33473 | y = y1 * (radiusExpanded + 15 - Math.abs(y1 * 10)) + 3;
|
33474 | translate = "translate(" + x + "," + y + ")";
|
33475 | } else if (!$$.hasType("gauge") || $$.data.targets.length > 1) {
|
33476 | var _$$$getRadius4 = $$.getRadius(d),
|
33477 | outerRadius = _$$$getRadius4.outerRadius,
|
33478 | c = this.svgArc.centroid(updated),
|
33479 | x = isNaN(c[0]) ? 0 : c[0],
|
33480 | y = isNaN(c[1]) ? 0 : c[1],
|
33481 | h = Math.sqrt(x * x + y * y),
|
33482 | ratio = $$.hasType("donut") && config.donut_label_ratio || $$.hasType("pie") && config.pie_label_ratio;
|
33483 |
|
33484 | ratio = ratio ? isFunction(ratio) ? ratio.bind($$.api)(d, outerRadius, h) : ratio : outerRadius && (h ? (36 / outerRadius > .375 ? 1.175 - 36 / outerRadius : .8) * outerRadius / h : 0), translate = "translate(" + x * ratio + "," + y * ratio + ")";
|
33485 | }
|
33486 | return translate;
|
33487 | },
|
33488 | convertToArcData: function convertToArcData(d) {
|
33489 | return this.addName({
|
33490 | id: d.data ? d.data.id : d.id,
|
33491 | value: d.value,
|
33492 | ratio: this.getRatio("arc", d),
|
33493 | index: d.index
|
33494 | });
|
33495 | },
|
33496 | textForArcLabel: function textForArcLabel(selection) {
|
33497 | var $$ = this,
|
33498 | hasGauge = $$.hasType("gauge");
|
33499 | $$.shouldShowArcLabel() && selection.style("fill", $$.updateTextColor.bind($$)).each(function (d) {
|
33500 | var node = src_select(this),
|
33501 | updated = $$.updateAngle(d),
|
33502 | ratio = $$.getRatio("arc", updated),
|
33503 | isUnderThreshold = $$.meetsLabelThreshold(ratio, $$.hasType("donut") && "donut" || $$.hasType("gauge") && "gauge" || $$.hasType("pie") && "pie");
|
33504 |
|
33505 | if (isUnderThreshold) {
|
33506 | var value = (updated || d).value,
|
33507 | text = ($$.getArcLabelFormat() || $$.defaultArcValueFormat)(value, ratio, d.data.id).toString();
|
33508 | setTextValue(node, text, [-1, 1], hasGauge);
|
33509 | } else node.text("");
|
33510 | });
|
33511 | },
|
33512 | expandArc: function expandArc(targetIds) {
|
33513 | var $$ = this,
|
33514 | transiting = $$.state.transiting,
|
33515 | $el = $$.$el;
|
33516 |
|
33517 | // MEMO: avoid to cancel transition
|
33518 | if (transiting) {
|
33519 | var interval = setInterval(function () {
|
33520 | transiting || (clearInterval(interval), $el.legend.selectAll("." + config_classes.legendItemFocused).size() > 0 && $$.expandArc(targetIds));
|
33521 | }, 10);
|
33522 | return;
|
33523 | }
|
33524 |
|
33525 | var newTargetIds = $$.mapToTargetIds(targetIds);
|
33526 | $el.svg.selectAll($$.selectorTargets(newTargetIds, "." + config_classes.chartArc)).each(function (d) {
|
33527 | if ($$.shouldExpand(d.data.id)) {
|
33528 | var expandDuration = $$.getExpandConfig(d.data.id, "duration"),
|
33529 | svgArcExpandedSub = $$.getSvgArcExpanded($$.getExpandConfig(d.data.id, "rate"));
|
33530 | src_select(this).selectAll("path").transition().duration(expandDuration).attr("d", $$.svgArcExpanded).transition().duration(expandDuration * 2).attr("d", svgArcExpandedSub);
|
33531 | }
|
33532 | });
|
33533 | },
|
33534 | unexpandArc: function unexpandArc(targetIds) {
|
33535 | var $$ = this,
|
33536 | transiting = $$.state.transiting,
|
33537 | svg = $$.$el.svg;
|
33538 |
|
33539 | if (!transiting) {
|
33540 | var newTargetIds = $$.mapToTargetIds(targetIds);
|
33541 | svg.selectAll($$.selectorTargets(newTargetIds, "." + config_classes.chartArc)).selectAll("path").transition().duration(function (d) {
|
33542 | return $$.getExpandConfig(d.data.id, "duration");
|
33543 | }).attr("d", $$.svgArc), svg.selectAll("" + config_classes.arc).style("opacity", "1");
|
33544 | }
|
33545 | },
|
33546 |
|
33547 | /**
|
33548 | * Get expand config value
|
33549 | * @param {string} id data ID
|
33550 | * @param {string} key config key: 'duration | rate'
|
33551 | * @returns {number}
|
33552 | * @private
|
33553 | */
|
33554 | getExpandConfig: function getExpandConfig(id, key) {
|
33555 | var type,
|
33556 | $$ = this,
|
33557 | config = $$.config;
|
33558 | return $$.isDonutType(id) ? type = "donut" : $$.isGaugeType(id) ? type = "gauge" : $$.isPieType(id) && (type = "pie"), type ? config[type + "_expand_" + key] : {
|
33559 | duration: 50,
|
33560 | rate: .98
|
33561 | }[key];
|
33562 | },
|
33563 | shouldExpand: function shouldExpand(id) {
|
33564 | var $$ = this,
|
33565 | config = $$.config;
|
33566 | return $$.isDonutType(id) && config.donut_expand || $$.isGaugeType(id) && config.gauge_expand || $$.isPieType(id) && config.pie_expand;
|
33567 | },
|
33568 | shouldShowArcLabel: function shouldShowArcLabel() {
|
33569 | var $$ = this,
|
33570 | config = $$.config;
|
33571 | return ["pie", "donut", "gauge"].some(function (v) {
|
33572 | return $$.hasType(v) && config[v + "_label_show"];
|
33573 | });
|
33574 | },
|
33575 | getArcLabelFormat: function getArcLabelFormat() {
|
33576 | var $$ = this,
|
33577 | config = $$.config,
|
33578 | format = config.pie_label_format;
|
33579 | return $$.hasType("gauge") ? format = config.gauge_label_format : $$.hasType("donut") && (format = config.donut_label_format), isFunction(format) ? format.bind($$.api) : format;
|
33580 | },
|
33581 | getArcTitle: function getArcTitle() {
|
33582 | var $$ = this,
|
33583 | type = $$.hasType("donut") && "donut" || $$.hasType("gauge") && "gauge";
|
33584 | return type ? $$.config[type + "_title"] : "";
|
33585 | },
|
33586 | updateTargetsForArc: function updateTargetsForArc(targets) {
|
33587 | var $$ = this,
|
33588 | $el = $$.$el,
|
33589 | hasGauge = $$.hasType("gauge"),
|
33590 | classChartArc = $$.getChartClass("Arc"),
|
33591 | classArcs = $$.getClass("arcs", !0),
|
33592 | classFocus = $$.classFocus.bind($$),
|
33593 | chartArcs = $el.main.select("." + config_classes.chartArcs),
|
33594 | mainPieUpdate = chartArcs.selectAll("." + config_classes.chartArc).data($$.pie(targets)).attr("class", function (d) {
|
33595 | return classChartArc(d) + classFocus(d.data);
|
33596 | }),
|
33597 | mainPieEnter = mainPieUpdate.enter().append("g").attr("class", classChartArc);
|
33598 | mainPieEnter.append("g").attr("class", classArcs).merge(mainPieUpdate), mainPieEnter.append("text").attr("dy", hasGauge && !$$.hasMultiTargets() ? "-.1em" : ".35em").style("opacity", "0").style("text-anchor", "middle").style("pointer-events", "none"), $el.text = chartArcs.selectAll("." + config_classes.target + " text");
|
33599 | },
|
33600 | initArc: function initArc() {
|
33601 | var $$ = this,
|
33602 | $el = $$.$el;
|
33603 | $el.arcs = $el.main.select("." + config_classes.chart).append("g").attr("class", config_classes.chartArcs).attr("transform", $$.getTranslate("arc")), $$.setArcTitle();
|
33604 | },
|
33605 |
|
33606 | /**
|
33607 | * Set arc title text
|
33608 | * @private
|
33609 | */
|
33610 | setArcTitle: function setArcTitle() {
|
33611 | var $$ = this,
|
33612 | title = $$.getArcTitle(),
|
33613 | hasGauge = $$.hasType("gauge");
|
33614 |
|
33615 | if (title) {
|
33616 | var text = $$.$el.arcs.append("text").attr("class", config_classes[hasGauge ? "chartArcsGaugeTitle" : "chartArcsTitle"]).style("text-anchor", "middle");
|
33617 | hasGauge && text.attr("dy", "-0.3em").style("font-size", "27px"), setTextValue(text, title, hasGauge ? undefined : [-.6, 1.35], !0);
|
33618 | }
|
33619 | },
|
33620 | redrawArc: function redrawArc(duration, durationForExit, withTransform) {
|
33621 | var $$ = this,
|
33622 | config = $$.config,
|
33623 | state = $$.state,
|
33624 | main = $$.$el.main,
|
33625 | hasInteraction = config.interaction_enabled,
|
33626 | isSelectable = hasInteraction && config.data_selection_isselectable,
|
33627 | mainArc = main.selectAll("." + config_classes.arcs).selectAll("." + config_classes.arc).data($$.arcData.bind($$));
|
33628 | // bind arc events
|
33629 | mainArc.exit().transition().duration(durationForExit).style("opacity", "0").remove(), mainArc = mainArc.enter().append("path").attr("class", $$.getClass("arc", !0)).style("fill", function (d) {
|
33630 | return $$.color(d.data);
|
33631 | }).style("cursor", function (d) {
|
33632 | return isSelectable && isSelectable.bind($$.api)(d) ? "pointer" : null;
|
33633 | }).style("opacity", "0").each(function (d) {
|
33634 | $$.isGaugeType(d.data) && (d.startAngle = config.gauge_startingAngle, d.endAngle = config.gauge_startingAngle), this._current = d;
|
33635 | }).merge(mainArc), $$.hasType("gauge") && ($$.updateGaugeMax(), $$.hasMultiArcGauge() && $$.redrawMultiArcGauge()), mainArc.attr("transform", function (d) {
|
33636 | return !$$.isGaugeType(d.data) && withTransform ? "scale(0)" : "";
|
33637 | }).style("opacity", function (d) {
|
33638 | return d === this._current ? "0" : "1";
|
33639 | }).each(function () {
|
33640 | state.transiting = !0;
|
33641 | }).transition().duration(duration).attrTween("d", function (d) {
|
33642 | var updated = $$.updateAngle(d);
|
33643 | if (!updated) return function () {
|
33644 | return "M 0 0";
|
33645 | };
|
33646 | isNaN(this._current.startAngle) && (this._current.startAngle = 0), isNaN(this._current.endAngle) && (this._current.endAngle = this._current.startAngle);
|
33647 | var interpolate = value(this._current, updated);
|
33648 | return this._current = interpolate(0), function (t) {
|
33649 | var interpolated = interpolate(t);
|
33650 | // data.id will be updated by interporator
|
33651 | return interpolated.data = d.data, $$.getArc(interpolated, !0);
|
33652 | };
|
33653 | }).attr("transform", withTransform ? "scale(1)" : "").style("fill", function (d) {
|
33654 | var color;
|
33655 | return $$.levelColor ? (color = $$.levelColor(d.data.values[0].value), config.data_colors[d.data.id] = color) : color = $$.color(d.data), color;
|
33656 | }) // Where gauge reading color would receive customization.
|
33657 | .style("opacity", "1").call(endall, function () {
|
33658 | if ($$.levelColor) {
|
33659 | var path = src_select(this),
|
33660 | d = path.datum();
|
33661 | $$.updateLegendItemColor(d.data.id, path.style("fill"));
|
33662 | }
|
33663 |
|
33664 | state.transiting = !1, callFn(config.onrendered, $$.api);
|
33665 | }), hasInteraction && $$.bindArcEvent(mainArc), $$.hasType("gauge") && $$.redrawBackgroundArcs(), $$.redrawArcText(duration);
|
33666 | },
|
33667 | redrawBackgroundArcs: function redrawBackgroundArcs() {
|
33668 | var $$ = this,
|
33669 | config = $$.config,
|
33670 | state = $$.state,
|
33671 | hasMultiArcGauge = $$.hasMultiArcGauge(),
|
33672 | isFullCircle = config.gauge_fullCircle,
|
33673 | startAngle = $$.getStartAngle(),
|
33674 | endAngle = isFullCircle ? startAngle + $$.getArcLength() : startAngle * -1,
|
33675 | backgroundArc = $$.$el.arcs.select((hasMultiArcGauge ? "g" : "") + "." + config_classes.chartArcsBackground);
|
33676 |
|
33677 | if (hasMultiArcGauge) {
|
33678 | var index = 0;
|
33679 | backgroundArc = backgroundArc.selectAll("path." + config_classes.chartArcsBackground).data($$.data.targets), backgroundArc.enter().append("path").attr("class", function (d, i) {
|
33680 | return config_classes.chartArcsBackground + " " + config_classes.chartArcsBackground + "-" + i;
|
33681 | }).merge(backgroundArc).style("fill", config.gauge_background || null).attr("d", function (_ref2) {
|
33682 | var id = _ref2.id;
|
33683 | if (state.hiddenTargetIds.indexOf(id) >= 0) return "M 0 0";
|
33684 | var d = {
|
33685 | data: [{
|
33686 | value: config.gauge_max
|
33687 | }],
|
33688 | startAngle: startAngle,
|
33689 | endAngle: endAngle,
|
33690 | index: index++
|
33691 | };
|
33692 | return $$.getArc(d, !0, !0);
|
33693 | }), backgroundArc.exit().remove();
|
33694 | } else backgroundArc.attr("d", function () {
|
33695 | var d = {
|
33696 | data: [{
|
33697 | value: config.gauge_max
|
33698 | }],
|
33699 | startAngle: startAngle,
|
33700 | endAngle: endAngle
|
33701 | };
|
33702 | return $$.getArc(d, !0, !0);
|
33703 | });
|
33704 | },
|
33705 | bindArcEvent: function bindArcEvent(arc) {
|
33706 | // eslint-disable-next-line
|
33707 | function selectArc(_this, arcData, id) {
|
33708 | $$.expandArc(id), $$.api.focus(id), $$.toggleFocusLegend(id, !0), $$.showTooltip([arcData], _this);
|
33709 | } // eslint-disable-next-line
|
33710 |
|
33711 |
|
33712 | function unselectArc(arcData) {
|
33713 | var id = arcData && arcData.id || undefined;
|
33714 | $$.unexpandArc(id), $$.api.revert(), $$.revertLegend(), $$.hideTooltip();
|
33715 | }
|
33716 |
|
33717 | var $$ = this,
|
33718 | config = $$.config,
|
33719 | state = $$.state,
|
33720 | isTouch = state.inputType === "touch",
|
33721 | isMouse = state.inputType === "mouse";
|
33722 |
|
33723 | // touch events
|
33724 | if (arc.on("click", function (event, d, i) {
|
33725 | var arcData,
|
33726 | updated = $$.updateAngle(d);
|
33727 | updated && (arcData = $$.convertToArcData(updated), $$.toggleShape && $$.toggleShape(this, arcData, i), config.data_onclick.bind($$.api)(arcData, this));
|
33728 | }), isMouse && arc.on("mouseover", function (event, d) {
|
33729 | if (!state.transiting) // skip while transiting
|
33730 | {
|
33731 | state.event = event;
|
33732 | var updated = $$.updateAngle(d),
|
33733 | arcData = updated ? $$.convertToArcData(updated) : null,
|
33734 | id = arcData && arcData.id || undefined;
|
33735 | selectArc(this, arcData, id), $$.setOverOut(!0, arcData);
|
33736 | }
|
33737 | }).on("mouseout", function (event, d) {
|
33738 | if (!state.transiting) // skip while transiting
|
33739 | {
|
33740 | state.event = event;
|
33741 | var updated = $$.updateAngle(d),
|
33742 | arcData = updated ? $$.convertToArcData(updated) : null;
|
33743 | unselectArc(), $$.setOverOut(!1, arcData);
|
33744 | }
|
33745 | }).on("mousemove", function (event, d) {
|
33746 | var updated = $$.updateAngle(d),
|
33747 | arcData = updated ? $$.convertToArcData(updated) : null;
|
33748 | state.event = event, $$.showTooltip([arcData], this);
|
33749 | }), isTouch && $$.hasArcType() && !$$.radars) {
|
33750 | var getEventArc = function (event) {
|
33751 | var touch = event.changedTouches[0],
|
33752 | eventArc = src_select(browser_doc.elementFromPoint(touch.clientX, touch.clientY));
|
33753 | return eventArc;
|
33754 | };
|
33755 |
|
33756 | $$.$el.svg.on("touchstart touchmove", function (event) {
|
33757 | if (!state.transiting) // skip while transiting
|
33758 | {
|
33759 | var eventArc = getEventArc(event),
|
33760 | datum = eventArc.datum(),
|
33761 | updated = datum && datum.data && datum.data.id ? $$.updateAngle(datum) : null,
|
33762 | arcData = updated ? $$.convertToArcData(updated) : null,
|
33763 | id = arcData && arcData.id || undefined;
|
33764 | $$.callOverOutForTouch(arcData), isUndefined(id) ? unselectArc() : selectArc(this, arcData, id);
|
33765 | }
|
33766 | });
|
33767 | }
|
33768 | },
|
33769 | redrawArcText: function redrawArcText(duration) {
|
33770 | var text,
|
33771 | $$ = this,
|
33772 | config = $$.config,
|
33773 | state = $$.state,
|
33774 | _$$$$el = $$.$el,
|
33775 | main = _$$$$el.main,
|
33776 | arcs = _$$$$el.arcs,
|
33777 | hasGauge = $$.hasType("gauge"),
|
33778 | hasMultiArcGauge = $$.hasMultiArcGauge();
|
33779 |
|
33780 | if (hasGauge && $$.data.targets.length === 1 && config.gauge_title || (text = main.selectAll("." + config_classes.chartArc).select("text").style("opacity", "0").attr("class", function (d) {
|
33781 | return $$.isGaugeType(d.data) ? config_classes.gaugeValue : null;
|
33782 | }).call($$.textForArcLabel.bind($$)).attr("transform", $$.transformForArcLabel.bind($$)).style("font-size", function (d) {
|
33783 | return $$.isGaugeType(d.data) && $$.data.targets.length === 1 && !hasMultiArcGauge ? Math.round(state.radius / 5) + "px" : null;
|
33784 | }).transition().duration(duration).style("opacity", function (d) {
|
33785 | return $$.isTargetToShow(d.data.id) && $$.isArcType(d.data) ? "1" : "0";
|
33786 | }), hasMultiArcGauge && text.attr("dy", "-.1em")), main.select("." + config_classes.chartArcsTitle).style("opacity", $$.hasType("donut") || hasGauge ? "1" : "0"), hasGauge) {
|
33787 | var isFullCircle = config.gauge_fullCircle;
|
33788 | isFullCircle && text && text.attr("dy", "" + (hasMultiArcGauge ? 0 : Math.round(state.radius / 14))), config.gauge_label_show && (arcs.select("." + config_classes.chartArcsGaugeUnit).attr("dy", (isFullCircle ? 1.5 : .75) + "em").text(config.gauge_units), arcs.select("." + config_classes.chartArcsGaugeMin).attr("dx", -1 * (state.innerRadius + (state.radius - state.innerRadius) / (isFullCircle ? 1 : 2)) + "px").attr("dy", "1.2em").text($$.textForGaugeMinMax(config.gauge_min, !1)), !isFullCircle && arcs.select("." + config_classes.chartArcsGaugeMax).attr("dx", state.innerRadius + (state.radius - state.innerRadius) / 2 + "px").attr("dy", "1.2em").text($$.textForGaugeMinMax(config.gauge_max, !0)));
|
33789 | }
|
33790 | }
|
33791 | });
|
33792 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/point.js
|
33793 | function point_x(p) {
|
33794 | return p[0];
|
33795 | }
|
33796 | function point_y(p) {
|
33797 | return p[1];
|
33798 | }
|
33799 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/line.js
|
33800 |
|
33801 |
|
33802 |
|
33803 |
|
33804 |
|
33805 | /* harmony default export */ function src_line(x, y) {
|
33806 | function line(data) {
|
33807 | var i,
|
33808 | d,
|
33809 | buffer,
|
33810 | n = (data = d3_shape_src_array(data)).length,
|
33811 | defined0 = !1;
|
33812 |
|
33813 | for (context == null && (output = curve(buffer = src_path())), i = 0; i <= n; ++i) !(i < n && defined(d = data[i], i, data)) === defined0 && ((defined0 = !defined0) ? output.lineStart() : output.lineEnd()), defined0 && output.point(+x(d, i, data), +y(d, i, data));
|
33814 |
|
33815 | if (buffer) return output = null, buffer + "" || null;
|
33816 | }
|
33817 |
|
33818 | var defined = d3_shape_src_constant(!0),
|
33819 | context = null,
|
33820 | curve = curve_linear,
|
33821 | output = null;
|
33822 | return x = typeof x === "function" ? x : x === undefined ? point_x : d3_shape_src_constant(x), y = typeof y === "function" ? y : y === undefined ? point_y : d3_shape_src_constant(y), line.x = function (_) {
|
33823 | return arguments.length ? (x = typeof _ === "function" ? _ : d3_shape_src_constant(+_), line) : x;
|
33824 | }, line.y = function (_) {
|
33825 | return arguments.length ? (y = typeof _ === "function" ? _ : d3_shape_src_constant(+_), line) : y;
|
33826 | }, line.defined = function (_) {
|
33827 | return arguments.length ? (defined = typeof _ === "function" ? _ : d3_shape_src_constant(!!_), line) : defined;
|
33828 | }, line.curve = function (_) {
|
33829 | return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;
|
33830 | }, line.context = function (_) {
|
33831 | return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;
|
33832 | }, line;
|
33833 | }
|
33834 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/area.js
|
33835 |
|
33836 |
|
33837 |
|
33838 |
|
33839 |
|
33840 |
|
33841 | /* harmony default export */ function src_area(x0, y0, y1) {
|
33842 | function area(data) {
|
33843 | var i,
|
33844 | j,
|
33845 | k,
|
33846 | d,
|
33847 | buffer,
|
33848 | n = (data = d3_shape_src_array(data)).length,
|
33849 | defined0 = !1,
|
33850 | x0z = Array(n),
|
33851 | y0z = Array(n);
|
33852 |
|
33853 | for (context == null && (output = curve(buffer = src_path())), i = 0; i <= n; ++i) {
|
33854 | if (!(i < n && defined(d = data[i], i, data)) === defined0) if (defined0 = !defined0) j = i, output.areaStart(), output.lineStart();else {
|
33855 | for (output.lineEnd(), output.lineStart(), k = i - 1; k >= j; --k) output.point(x0z[k], y0z[k]);
|
33856 |
|
33857 | output.lineEnd(), output.areaEnd();
|
33858 | }
|
33859 | defined0 && (x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data), output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]));
|
33860 | }
|
33861 |
|
33862 | if (buffer) return output = null, buffer + "" || null;
|
33863 | }
|
33864 |
|
33865 | function arealine() {
|
33866 | return src_line().defined(defined).curve(curve).context(context);
|
33867 | }
|
33868 |
|
33869 | var x1 = null,
|
33870 | defined = d3_shape_src_constant(!0),
|
33871 | context = null,
|
33872 | curve = curve_linear,
|
33873 | output = null;
|
33874 | return x0 = typeof x0 === "function" ? x0 : x0 === undefined ? point_x : d3_shape_src_constant(+x0), y0 = typeof y0 === "function" ? y0 : y0 === undefined ? d3_shape_src_constant(0) : d3_shape_src_constant(+y0), y1 = typeof y1 === "function" ? y1 : y1 === undefined ? point_y : d3_shape_src_constant(+y1), area.x = function (_) {
|
33875 | return arguments.length ? (x0 = typeof _ === "function" ? _ : d3_shape_src_constant(+_), x1 = null, area) : x0;
|
33876 | }, area.x0 = function (_) {
|
33877 | return arguments.length ? (x0 = typeof _ === "function" ? _ : d3_shape_src_constant(+_), area) : x0;
|
33878 | }, area.x1 = function (_) {
|
33879 | return arguments.length ? (x1 = _ == null ? null : typeof _ === "function" ? _ : d3_shape_src_constant(+_), area) : x1;
|
33880 | }, area.y = function (_) {
|
33881 | return arguments.length ? (y0 = typeof _ === "function" ? _ : d3_shape_src_constant(+_), y1 = null, area) : y0;
|
33882 | }, area.y0 = function (_) {
|
33883 | return arguments.length ? (y0 = typeof _ === "function" ? _ : d3_shape_src_constant(+_), area) : y0;
|
33884 | }, area.y1 = function (_) {
|
33885 | return arguments.length ? (y1 = _ == null ? null : typeof _ === "function" ? _ : d3_shape_src_constant(+_), area) : y1;
|
33886 | }, area.lineX0 = area.lineY0 = function () {
|
33887 | return arealine().x(x0).y(y0);
|
33888 | }, area.lineY1 = function () {
|
33889 | return arealine().x(x0).y(y1);
|
33890 | }, area.lineX1 = function () {
|
33891 | return arealine().x(x1).y(y0);
|
33892 | }, area.defined = function (_) {
|
33893 | return arguments.length ? (defined = typeof _ === "function" ? _ : d3_shape_src_constant(!!_), area) : defined;
|
33894 | }, area.curve = function (_) {
|
33895 | return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;
|
33896 | }, area.context = function (_) {
|
33897 | return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;
|
33898 | }, area;
|
33899 | }
|
33900 | ;// CONCATENATED MODULE: ./src/ChartInternal/shape/area.ts
|
33901 | /**
|
33902 | * Copyright (c) 2017 ~ present NAVER Corp.
|
33903 | * billboard.js project is licensed under the MIT license
|
33904 | */
|
33905 |
|
33906 |
|
33907 |
|
33908 |
|
33909 | /* harmony default export */ var shape_area = ({
|
33910 | initArea: function initArea(mainLine) {
|
33911 | var $$ = this,
|
33912 | config = $$.config;
|
33913 | mainLine.insert("g", "." + config_classes[config.area_front ? "circles" : "lines"]).attr("class", $$.getClass("areas", !0));
|
33914 | },
|
33915 | updateAreaGradient: function updateAreaGradient() {
|
33916 | var $$ = this,
|
33917 | config = $$.config,
|
33918 | datetimeId = $$.state.datetimeId,
|
33919 | defs = $$.$el.defs;
|
33920 | $$.data.targets.forEach(function (d) {
|
33921 | var id = datetimeId + "-areaGradient" + $$.getTargetSelectorSuffix(d.id);
|
33922 |
|
33923 | if ($$.isAreaType(d) && defs.select("#" + id).empty()) {
|
33924 | var color = $$.color(d),
|
33925 | _config$area_linearGr = config.area_linearGradient,
|
33926 | _config$area_linearGr2 = _config$area_linearGr.x,
|
33927 | x = _config$area_linearGr2 === void 0 ? [0, 0] : _config$area_linearGr2,
|
33928 | _config$area_linearGr3 = _config$area_linearGr.y,
|
33929 | y = _config$area_linearGr3 === void 0 ? [0, 1] : _config$area_linearGr3,
|
33930 | _config$area_linearGr4 = _config$area_linearGr.stops,
|
33931 | stops = _config$area_linearGr4 === void 0 ? [[0, color, 1], [1, color, 0]] : _config$area_linearGr4,
|
33932 | linearGradient = defs.append("linearGradient").attr("id", "" + id).attr("x1", x[0]).attr("x2", x[1]).attr("y1", y[0]).attr("y2", y[1]);
|
33933 | stops.forEach(function (v) {
|
33934 | var stopColor = isFunction(v[1]) ? v[1].bind($$.api)(d.id) : v[1];
|
33935 | linearGradient.append("stop").attr("offset", v[0]).attr("stop-color", stopColor || color).attr("stop-opacity", v[2]);
|
33936 | });
|
33937 | }
|
33938 | });
|
33939 | },
|
33940 | updateAreaColor: function updateAreaColor(d) {
|
33941 | var $$ = this;
|
33942 | return $$.config.area_linearGradient ? "url(#" + $$.state.datetimeId + "-areaGradient" + $$.getTargetSelectorSuffix(d.id) + ")" : $$.color(d);
|
33943 | },
|
33944 |
|
33945 | /**
|
33946 | * Generate/Update elements
|
33947 | * @param {number} durationForExit Transition duration for exit elements
|
33948 | * @param {boolean} isSub Subchart draw
|
33949 | * @private
|
33950 | */
|
33951 | updateArea: function updateArea(durationForExit, isSub) {
|
33952 | isSub === void 0 && (isSub = !1);
|
33953 | var $$ = this,
|
33954 | config = $$.config,
|
33955 | state = $$.state,
|
33956 | $el = $$.$el,
|
33957 | $root = isSub ? $el.subchart : $el;
|
33958 | config.area_linearGradient && $$.updateAreaGradient();
|
33959 | var area = $root.main.selectAll("." + config_classes.areas).selectAll("." + config_classes.area).data($$.lineData.bind($$));
|
33960 | area.exit().transition().duration(durationForExit).style("opacity", "0").remove(), $root.area = area.enter().append("path").attr("class", $$.getClass("area", !0)).style("fill", $$.updateAreaColor.bind($$)).style("opacity", function () {
|
33961 | return state.orgAreaOpacity = src_select(this).style("opacity"), "0";
|
33962 | }).merge(area), area.style("opacity", state.orgAreaOpacity);
|
33963 | },
|
33964 |
|
33965 | /**
|
33966 | * Redraw function
|
33967 | * @param {Function} drawFn Retuned functino from .generateDrawCandlestick()
|
33968 | * @param {boolean} withTransition With or without transition
|
33969 | * @param {boolean} isSub Subchart draw
|
33970 | * @returns {Array}
|
33971 | */
|
33972 | redrawArea: function redrawArea(drawFn, withTransition, isSub) {
|
33973 | isSub === void 0 && (isSub = !1);
|
33974 |
|
33975 | var $$ = this,
|
33976 | _ref = isSub ? this.$el.subchart : this.$el,
|
33977 | area = _ref.area,
|
33978 | orgAreaOpacity = $$.state.orgAreaOpacity;
|
33979 |
|
33980 | return [(withTransition ? area.transition(getRandom()) : area).attr("d", drawFn).style("fill", $$.updateAreaColor.bind($$)).style("opacity", function (d) {
|
33981 | return ($$.isAreaRangeType(d) ? orgAreaOpacity / 1.75 : orgAreaOpacity) + "";
|
33982 | })];
|
33983 | },
|
33984 |
|
33985 | /**
|
33986 | * Generate area path data
|
33987 | * @param {object} areaIndices Indices
|
33988 | * @param {boolean} isSub Weather is sub axis
|
33989 | * @returns {Function}
|
33990 | * @private
|
33991 | */
|
33992 | generateDrawArea: function generateDrawArea(areaIndices, isSub) {
|
33993 | var $$ = this,
|
33994 | config = $$.config,
|
33995 | lineConnectNull = config.line_connectNull,
|
33996 | isRotated = config.axis_rotated,
|
33997 | getPoints = $$.generateGetAreaPoints(areaIndices, isSub),
|
33998 | yScale = $$.getYScaleById.bind($$),
|
33999 | xValue = function (d) {
|
34000 | return (isSub ? $$.subxx : $$.xx).call($$, d);
|
34001 | },
|
34002 | value0 = function (d, i) {
|
34003 | return $$.isGrouped(d.id) ? getPoints(d, i)[0][1] : yScale(d.id, isSub)($$.isAreaRangeType(d) ? $$.getRangedData(d, "high") : $$.getShapeYMin(d.id));
|
34004 | },
|
34005 | value1 = function (d, i) {
|
34006 | return $$.isGrouped(d.id) ? getPoints(d, i)[1][1] : yScale(d.id, isSub)($$.isAreaRangeType(d) ? $$.getRangedData(d, "low") : d.value);
|
34007 | };
|
34008 |
|
34009 | return function (d) {
|
34010 | var path,
|
34011 | values = lineConnectNull ? $$.filterRemoveNull(d.values) : d.values,
|
34012 | x0 = 0,
|
34013 | y0 = 0;
|
34014 |
|
34015 | if ($$.isAreaType(d)) {
|
34016 | var area = src_area();
|
34017 | area = isRotated ? area.y(xValue).x0(value0).x1(value1) : area.x(xValue) // @ts-ignore
|
34018 | .y0(config.area_above ? 0 : value0).y1(value1), lineConnectNull || (area = area.defined(function (d) {
|
34019 | return $$.getBaseValue(d) !== null;
|
34020 | })), $$.isStepType(d) && (values = $$.convertValuesToStep(values)), path = area.curve($$.getCurve(d))(values);
|
34021 | } else values[0] && (x0 = $$.scale.x(values[0].x), y0 = $$.getYScaleById(d.id)(values[0].value)), path = isRotated ? "M " + y0 + " " + x0 : "M " + x0 + " " + y0;
|
34022 |
|
34023 | return path || "M 0 0";
|
34024 | };
|
34025 | },
|
34026 | generateGetAreaPoints: function generateGetAreaPoints(areaIndices, isSub) {
|
34027 | // partial duplication of generateGetBarPoints
|
34028 | var $$ = this,
|
34029 | config = $$.config,
|
34030 | x = $$.getShapeX(0, areaIndices, isSub),
|
34031 | y = $$.getShapeY(!!isSub),
|
34032 | areaOffset = $$.getShapeOffset($$.isAreaType, areaIndices, isSub),
|
34033 | yScale = $$.getYScaleById.bind($$);
|
34034 | return function (d, i) {
|
34035 | var y0 = yScale.call($$, d.id, isSub)($$.getShapeYMin(d.id)),
|
34036 | offset = areaOffset(d, i) || y0,
|
34037 | posX = x(d),
|
34038 | posY = y(d);
|
34039 | // 1 point that marks the area position
|
34040 | return config.axis_rotated && (d.value > 0 && posY < y0 || d.value < 0 && y0 < posY) && (posY = y0), [[posX, offset], [posX, posY - (y0 - offset)], [posX, posY - (y0 - offset)], // needed for compatibility
|
34041 | [posX, offset] // needed for compatibility
|
34042 | ];
|
34043 | };
|
34044 | }
|
34045 | });
|
34046 | ;// CONCATENATED MODULE: ./src/ChartInternal/shape/bar.ts
|
34047 | /**
|
34048 | * Copyright (c) 2017 ~ present NAVER Corp.
|
34049 | * billboard.js project is licensed under the MIT license
|
34050 | */
|
34051 |
|
34052 |
|
34053 | /* harmony default export */ var bar = ({
|
34054 | initBar: function initBar() {
|
34055 | var $el = this.$el;
|
34056 | $el.bar = $el.main.select("." + config_classes.chart) // should positioned at the beginning of the shape node to not overlap others
|
34057 | .insert("g", ":first-child").attr("class", config_classes.chartBars);
|
34058 | },
|
34059 | updateTargetsForBar: function updateTargetsForBar(targets) {
|
34060 | var $$ = this,
|
34061 | config = $$.config,
|
34062 | $el = $$.$el,
|
34063 | classChartBar = $$.getChartClass("Bar"),
|
34064 | classBars = $$.getClass("bars", !0),
|
34065 | classFocus = $$.classFocus.bind($$),
|
34066 | isSelectable = config.interaction_enabled && config.data_selection_isselectable;
|
34067 | $el.bar || $$.initBar();
|
34068 | var mainBarUpdate = $$.$el.main.select("." + config_classes.chartBars).selectAll("." + config_classes.chartBar).data(targets).attr("class", function (d) {
|
34069 | return classChartBar(d) + classFocus(d);
|
34070 | }),
|
34071 | mainBarEnter = mainBarUpdate.enter().append("g").attr("class", classChartBar).style("opacity", "0").style("pointer-events", "none");
|
34072 | // Bars for each data
|
34073 | mainBarEnter.append("g").attr("class", classBars).style("cursor", function (d) {
|
34074 | return isSelectable && isSelectable.bind($$.api)(d) ? "pointer" : null;
|
34075 | });
|
34076 | },
|
34077 |
|
34078 | /**
|
34079 | * Generate/Update elements
|
34080 | * @param {number} durationForExit Transition duration for exit elements
|
34081 | * @param {boolean} isSub Subchart draw
|
34082 | * @private
|
34083 | */
|
34084 | updateBar: function updateBar(durationForExit, isSub) {
|
34085 | isSub === void 0 && (isSub = !1);
|
34086 | var $$ = this,
|
34087 | $root = isSub ? $$.$el.subchart : $$.$el,
|
34088 | classBar = $$.getClass("bar", !0),
|
34089 | initialOpacity = $$.initialOpacity.bind($$),
|
34090 | bar = $root.main.selectAll("." + config_classes.bars).selectAll("." + config_classes.bar).data($$.labelishData.bind($$));
|
34091 | bar.exit().transition().duration(durationForExit).style("opacity", "0").remove(), $root.bar = bar.enter().append("path").attr("class", classBar).style("fill", $$.color).merge(bar).style("opacity", initialOpacity);
|
34092 | },
|
34093 |
|
34094 | /**
|
34095 | * Redraw function
|
34096 | * @param {Function} drawFn Retuned functino from .generateDrawCandlestick()
|
34097 | * @param {boolean} withTransition With or without transition
|
34098 | * @param {boolean} isSub Subchart draw
|
34099 | * @returns {Array}
|
34100 | */
|
34101 | redrawBar: function redrawBar(drawFn, withTransition, isSub) {
|
34102 | isSub === void 0 && (isSub = !1);
|
34103 |
|
34104 | var _ref = isSub ? this.$el.subchart : this.$el,
|
34105 | bar = _ref.bar;
|
34106 |
|
34107 | return [(withTransition ? bar.transition(getRandom()) : bar).attr("d", drawFn).style("fill", this.color).style("opacity", "1")];
|
34108 | },
|
34109 | getBars: function getBars(i, id) {
|
34110 | var $$ = this,
|
34111 | main = $$.$el.main,
|
34112 | suffix = isValue(i) ? "-" + i : "";
|
34113 | return (id ? main.selectAll("." + config_classes.bars + $$.getTargetSelectorSuffix(id)) : main).selectAll("." + config_classes.bar + suffix);
|
34114 | },
|
34115 | expandBars: function expandBars(i, id, reset) {
|
34116 | var $$ = this;
|
34117 | reset && $$.unexpandBars(), $$.getBars(i, id).classed(config_classes.EXPANDED, !0);
|
34118 | },
|
34119 | unexpandBars: function unexpandBars(i) {
|
34120 | this.getBars(i).classed(config_classes.EXPANDED, !1);
|
34121 | },
|
34122 | generateDrawBar: function generateDrawBar(barIndices, isSub) {
|
34123 | var $$ = this,
|
34124 | config = $$.config,
|
34125 | getPoints = $$.generateGetBarPoints(barIndices, isSub),
|
34126 | isRotated = config.axis_rotated,
|
34127 | isGrouped = config.data_groups.length,
|
34128 | barRadius = config.bar_radius,
|
34129 | barRadiusRatio = config.bar_radius_ratio,
|
34130 | getRadius = isNumber(barRadius) && barRadius > 0 ? function () {
|
34131 | return barRadius;
|
34132 | } : isNumber(barRadiusRatio) ? function (w) {
|
34133 | return w * barRadiusRatio;
|
34134 | } : null;
|
34135 | return function (d, i) {
|
34136 | // 4 points that make a bar
|
34137 | var points = getPoints(d, i),
|
34138 | indexX = +isRotated,
|
34139 | indexY = +!indexX,
|
34140 | isNegative = d.value < 0,
|
34141 | pathRadius = ["", ""],
|
34142 | radius = 0; // switch points if axis is rotated, not applicable for sub chart
|
34143 |
|
34144 | if (getRadius && !isGrouped) {
|
34145 | var index = isRotated ? indexY : indexX,
|
34146 | barW = points[2][index] - points[0][index];
|
34147 | radius = getRadius(barW);
|
34148 | var arc = "a" + radius + "," + radius + " " + (isNegative ? "1 0 0" : "0 0 1") + " ";
|
34149 | pathRadius[+!isRotated] = "" + arc + radius + "," + radius, pathRadius[+isRotated] = "" + arc + [-radius, radius][isRotated ? "sort" : "reverse"](), isNegative && pathRadius.reverse();
|
34150 | } // path string data shouldn't be containing new line chars
|
34151 | // https://github.com/naver/billboard.js/issues/530
|
34152 |
|
34153 |
|
34154 | var path = isRotated ? "H" + (points[1][indexX] - radius) + " " + pathRadius[0] + "V" + (points[2][indexY] - radius) + " " + pathRadius[1] + "H" + points[3][indexX] : "V" + (points[1][indexY] + (isNegative ? -radius : radius)) + " " + pathRadius[0] + "H" + (points[2][indexX] - radius) + " " + pathRadius[1] + "V" + points[3][indexY];
|
34155 | return "M" + points[0][indexX] + "," + points[0][indexY] + path + "z";
|
34156 | };
|
34157 | },
|
34158 | generateGetBarPoints: function generateGetBarPoints(barIndices, isSub) {
|
34159 | var $$ = this,
|
34160 | config = $$.config,
|
34161 | axis = isSub ? $$.axis.subX : $$.axis.x,
|
34162 | barTargetsNum = $$.getIndicesMax(barIndices) + 1,
|
34163 | barW = $$.getBarW("bar", axis, barTargetsNum),
|
34164 | barX = $$.getShapeX(barW, barIndices, !!isSub),
|
34165 | barY = $$.getShapeY(!!isSub),
|
34166 | barOffset = $$.getShapeOffset($$.isBarType, barIndices, !!isSub),
|
34167 | yScale = $$.getYScaleById.bind($$);
|
34168 | return function (d, i) {
|
34169 | var y0 = yScale.call($$, d.id, isSub)($$.getShapeYMin(d.id)),
|
34170 | offset = barOffset(d, i) || y0,
|
34171 | width = isNumber(barW) ? barW : barW[d.id] || barW._$width,
|
34172 | posX = barX(d),
|
34173 | posY = barY(d);
|
34174 | config.axis_rotated && (d.value > 0 && posY < y0 || d.value < 0 && y0 < posY) && (posY = y0), posY -= y0 - offset;
|
34175 | var startPosX = posX + width; // 4 points that make a bar
|
34176 |
|
34177 | return [[posX, offset], [posX, posY], [startPosX, posY], [startPosX, offset]];
|
34178 | };
|
34179 | },
|
34180 | isWithinBar: function isWithinBar(that) {
|
34181 | var mouse = getPointer(this.state.event, that),
|
34182 | list = getRectSegList(that),
|
34183 | _list = list,
|
34184 | seg0 = _list[0],
|
34185 | seg1 = _list[1],
|
34186 | x = Math.min(seg0.x, seg1.x),
|
34187 | y = Math.min(seg0.y, seg1.y),
|
34188 | offset = this.config.bar_sensitivity,
|
34189 | _that$getBBox = that.getBBox(),
|
34190 | width = _that$getBBox.width,
|
34191 | height = _that$getBBox.height,
|
34192 | isWithin = x - offset < mouse[0] && mouse[0] < x + width + offset && y - offset < mouse[1] && mouse[1] < y + height + offset;
|
34193 |
|
34194 | return isWithin;
|
34195 | }
|
34196 | });
|
34197 | ;// CONCATENATED MODULE: ./src/ChartInternal/shape/candlestick.ts
|
34198 |
|
34199 |
|
34200 | function candlestick_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
34201 |
|
34202 | function candlestick_objectSpread(target) { for (var source, i = 1; i < arguments.length; i++) source = arguments[i] == null ? {} : arguments[i], i % 2 ? candlestick_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : candlestick_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); return target; }
|
34203 |
|
34204 | /**
|
34205 | * Copyright (c) 2017 ~ present NAVER Corp.
|
34206 | * billboard.js project is licensed under the MIT license
|
34207 | */
|
34208 |
|
34209 |
|
34210 |
|
34211 | /* harmony default export */ var candlestick = ({
|
34212 | initCandlestick: function initCandlestick() {
|
34213 | var $el = this.$el;
|
34214 | $el.candlestick = $el.main.select("." + config_classes.chart) // should positioned at the beginning of the shape node to not overlap others
|
34215 | .append("g").attr("class", config_classes.chartCandlesticks);
|
34216 | },
|
34217 |
|
34218 | /**
|
34219 | * Update targets by its data
|
34220 | * called from: ChartInternal.updateTargets()
|
34221 | * @param {Array} targets Filtered target by type
|
34222 | * @private
|
34223 | */
|
34224 | updateTargetsForCandlestick: function updateTargetsForCandlestick(targets) {
|
34225 | var $$ = this,
|
34226 | $el = $$.$el,
|
34227 | classChart = $$.getChartClass("Candlestick"),
|
34228 | classFocus = $$.classFocus.bind($$);
|
34229 | $el.candlestick || $$.initCandlestick();
|
34230 | var mainUpdate = $$.$el.main.select("." + config_classes.chartCandlesticks).selectAll("." + config_classes.chartCandlestick).data(targets).attr("class", function (d) {
|
34231 | return classChart(d) + classFocus(d);
|
34232 | });
|
34233 | mainUpdate.enter().append("g").attr("class", classChart).style("pointer-events", "none");
|
34234 | },
|
34235 |
|
34236 | /**
|
34237 | * Generate/Update elements
|
34238 | * @param {number} durationForExit Transition duration for exit elements
|
34239 | * @param {boolean} isSub Subchart draw
|
34240 | * @private
|
34241 | */
|
34242 | updateCandlestick: function updateCandlestick(durationForExit, isSub) {
|
34243 | isSub === void 0 && (isSub = !1);
|
34244 | var $$ = this,
|
34245 | $el = $$.$el,
|
34246 | $root = isSub ? $el.subchart : $el,
|
34247 | classSetter = $$.getClass("candlestick", !0),
|
34248 | initialOpacity = $$.initialOpacity.bind($$),
|
34249 | candlestick = $root.main.selectAll("." + config_classes.chartCandlestick).selectAll("." + config_classes.candlestick).data($$.labelishData.bind($$));
|
34250 | candlestick.exit().transition().duration(durationForExit).style("opacity", "0").remove();
|
34251 | var candlestickEnter = candlestick.enter().filter(function (d) {
|
34252 | return d.value;
|
34253 | }).append("g").attr("class", classSetter);
|
34254 | candlestickEnter.append("line"), candlestickEnter.append("path"), $root.candlestick || ($root.candlestick = {}), $root.candlestick = candlestick.merge(candlestickEnter).style("opacity", initialOpacity);
|
34255 | },
|
34256 |
|
34257 | /**
|
34258 | * Get draw function
|
34259 | * @param {object} indices Indice data
|
34260 | * @param {boolean} isSub Subchart draw
|
34261 | * @returns {Function}
|
34262 | * @private
|
34263 | */
|
34264 | generateDrawCandlestick: function generateDrawCandlestick(indices, isSub) {
|
34265 | var $$ = this,
|
34266 | config = $$.config,
|
34267 | getPoints = $$.generateGetCandlestickPoints(indices, isSub),
|
34268 | isRotated = config.axis_rotated,
|
34269 | downColor = config.candlestick_color_down;
|
34270 | return function (d, i, g) {
|
34271 | var _value,
|
34272 | points = getPoints(d, i),
|
34273 | value = $$.getCandlestickData(d),
|
34274 | isUp = (_value = value) == null ? void 0 : _value._isUp,
|
34275 | indexX = +isRotated;
|
34276 |
|
34277 | g.classed && g.classed(config_classes[isUp ? "valueUp" : "valueDown"], !0);
|
34278 | var path = isRotated ? "H" + points[1][1] + " V" + points[1][0] + " H" + points[0][1] : "V" + points[1][1] + " H" + points[1][0] + " V" + points[0][1];
|
34279 | g.select("path").attr("d", "M" + points[0][indexX] + "," + points[0][+!indexX] + path + "z").style("fill", function (d) {
|
34280 | var color = isUp ? $$.color(d) : isObject(downColor) ? downColor[d.id] : downColor;
|
34281 | return color || $$.color(d);
|
34282 | });
|
34283 | // set line position
|
34284 | var line = g.select("line"),
|
34285 | pos = isRotated ? {
|
34286 | x1: points[2][1],
|
34287 | x2: points[2][2],
|
34288 | y1: points[2][0],
|
34289 | y2: points[2][0]
|
34290 | } : {
|
34291 | x1: points[2][0],
|
34292 | x2: points[2][0],
|
34293 | y1: points[2][1],
|
34294 | y2: points[2][2]
|
34295 | };
|
34296 |
|
34297 | for (var x in pos) line.attr(x, pos[x]);
|
34298 | };
|
34299 | },
|
34300 |
|
34301 | /**
|
34302 | * Generate shape drawing points
|
34303 | * @param {object} indices Indice data
|
34304 | * @param {boolean} isSub Subchart draw
|
34305 | * @returns {Function}
|
34306 | */
|
34307 | generateGetCandlestickPoints: function generateGetCandlestickPoints(indices, isSub) {
|
34308 | isSub === void 0 && (isSub = !1);
|
34309 | var $$ = this,
|
34310 | config = $$.config,
|
34311 | axis = isSub ? $$.axis.subX : $$.axis.x,
|
34312 | targetsNum = $$.getIndicesMax(indices) + 1,
|
34313 | barW = $$.getBarW("candlestick", axis, targetsNum),
|
34314 | x = $$.getShapeX(barW, indices, !!isSub),
|
34315 | y = $$.getShapeY(!!isSub),
|
34316 | shapeOffset = $$.getShapeOffset($$.isBarType, indices, !!isSub),
|
34317 | yScale = $$.getYScaleById.bind($$);
|
34318 | return function (d, i) {
|
34319 | var points,
|
34320 | y0 = yScale.call($$, d.id, isSub)($$.getShapeYMin(d.id)),
|
34321 | offset = shapeOffset(d, i) || y0,
|
34322 | width = isNumber(barW) ? barW : barW[d.id] || barW._$width,
|
34323 | value = $$.getCandlestickData(d);
|
34324 |
|
34325 | if (value) {
|
34326 | var posX = {
|
34327 | start: x(d),
|
34328 | end: 0
|
34329 | };
|
34330 | posX.end = posX.start + width;
|
34331 | var posY = {
|
34332 | start: y(value.open),
|
34333 | end: y(value.close)
|
34334 | },
|
34335 | posLine = {
|
34336 | x: posX.start + width / 2,
|
34337 | high: y(value.high),
|
34338 | low: y(value.low)
|
34339 | };
|
34340 | config.axis_rotated && (d.value > 0 && posY.start < y0 || d.value < 0 && y0 < posY.start) && (posY.start = y0), posY.start -= y0 - offset, points = [[posX.start, posY.start], [posX.end, posY.end], [posLine.x, posLine.low, posLine.high]];
|
34341 | } else points = [[0, 0], [0, 0], [0, 0, 0]];
|
34342 |
|
34343 | return points;
|
34344 | };
|
34345 | },
|
34346 |
|
34347 | /**
|
34348 | * Redraw function
|
34349 | * @param {Function} drawFn Retuned functino from .generateDrawCandlestick()
|
34350 | * @param {boolean} withTransition With or without transition
|
34351 | * @param {boolean} isSub Subchart draw
|
34352 | * @returns {Array}
|
34353 | */
|
34354 | redrawCandlestick: function redrawCandlestick(drawFn, withTransition, isSub) {
|
34355 | isSub === void 0 && (isSub = !1);
|
34356 |
|
34357 | var _ref = isSub ? this.$el.subchart : this.$el,
|
34358 | candlestick = _ref.candlestick,
|
34359 | rand = getRandom(!0);
|
34360 |
|
34361 | return [candlestick.each(function (d, i) {
|
34362 | var g = withTransition ? src_select(this).transition(rand) : src_select(this);
|
34363 | drawFn(d, i, g);
|
34364 | }).style("opacity", "1")];
|
34365 | },
|
34366 |
|
34367 | /**
|
34368 | * Get candlestick data as object
|
34369 | * @param {object} param Data object
|
34370 | * @param {Array|object} param.value Data value
|
34371 | * @returns {object|null} Converted data object
|
34372 | * @private
|
34373 | */
|
34374 | getCandlestickData: function getCandlestickData(_ref2) {
|
34375 | var d,
|
34376 | value = _ref2.value;
|
34377 |
|
34378 | if (isArray(value)) {
|
34379 | var open = value[0],
|
34380 | high = value[1],
|
34381 | low = value[2],
|
34382 | close = value[3],
|
34383 | _value$ = value[4],
|
34384 | volume = _value$ !== void 0 && _value$;
|
34385 | d = {
|
34386 | open: open,
|
34387 | high: high,
|
34388 | low: low,
|
34389 | close: close
|
34390 | }, volume !== !1 && (d.volume = volume);
|
34391 | } else isObject(value) && (d = candlestick_objectSpread({}, value));
|
34392 |
|
34393 | return d && (d._isUp = d.close >= d.open), d || null;
|
34394 | }
|
34395 | });
|
34396 | ;// CONCATENATED MODULE: ./src/ChartInternal/shape/gauge.ts
|
34397 | /**
|
34398 | * Copyright (c) 2017 ~ present NAVER Corp.
|
34399 | * billboard.js project is licensed under the MIT license
|
34400 | */
|
34401 |
|
34402 |
|
34403 |
|
34404 | /* harmony default export */ var gauge = ({
|
34405 | initGauge: function initGauge() {
|
34406 | var $$ = this,
|
34407 | config = $$.config,
|
34408 | arcs = $$.$el.arcs,
|
34409 | appendText = function (className) {
|
34410 | arcs.append("text").attr("class", className).style("text-anchor", "middle").style("pointer-events", "none");
|
34411 | };
|
34412 |
|
34413 | if ($$.hasType("gauge")) {
|
34414 | var hasMulti = $$.hasMultiArcGauge();
|
34415 | arcs.append(hasMulti ? "g" : "path").attr("class", config_classes.chartArcsBackground).style("fill", !hasMulti && config.gauge_background || null), config.gauge_units && appendText(config_classes.chartArcsGaugeUnit), config.gauge_label_show && (appendText(config_classes.chartArcsGaugeMin), !config.gauge_fullCircle && appendText(config_classes.chartArcsGaugeMax));
|
34416 | }
|
34417 | },
|
34418 | updateGaugeMax: function updateGaugeMax() {
|
34419 | var $$ = this,
|
34420 | config = $$.config,
|
34421 | state = $$.state,
|
34422 | hasMultiGauge = $$.hasMultiArcGauge(),
|
34423 | max = hasMultiGauge ? $$.getMinMaxData().max[0].value : $$.getTotalDataSum(state.rendered);
|
34424 | max > config.gauge_max && (config.gauge_max = max);
|
34425 | },
|
34426 | redrawMultiArcGauge: function redrawMultiArcGauge() {
|
34427 | var $$ = this,
|
34428 | config = $$.config,
|
34429 | state = $$.state,
|
34430 | $el = $$.$el,
|
34431 | hiddenTargetIds = $$.state.hiddenTargetIds,
|
34432 | arcLabelLines = $el.main.selectAll("." + config_classes.arcs).selectAll("." + config_classes.arcLabelLine).data($$.arcData.bind($$)),
|
34433 | mainArcLabelLine = arcLabelLines.enter().append("rect").attr("class", function (d) {
|
34434 | return config_classes.arcLabelLine + " " + config_classes.target + " " + config_classes.target + "-" + d.data.id;
|
34435 | }).merge(arcLabelLines);
|
34436 | mainArcLabelLine.style("fill", function (d) {
|
34437 | return $$.levelColor ? $$.levelColor(d.data.values[0].value) : $$.color(d.data);
|
34438 | }).style("display", config.gauge_label_show ? "" : "none").each(function (d) {
|
34439 | var lineLength = 0,
|
34440 | lineThickness = 2,
|
34441 | x = 0,
|
34442 | y = 0,
|
34443 | transform = "";
|
34444 |
|
34445 | if (hiddenTargetIds.indexOf(d.data.id) < 0) {
|
34446 | var updated = $$.updateAngle(d),
|
34447 | innerLineLength = state.gaugeArcWidth / $$.filterTargetsToShow($$.data.targets).length * (updated.index + 1),
|
34448 | lineAngle = updated.endAngle - Math.PI / 2,
|
34449 | arcInnerRadius = state.radius - innerLineLength,
|
34450 | linePositioningAngle = lineAngle - (arcInnerRadius === 0 ? 0 : 1 / arcInnerRadius);
|
34451 | lineLength = state.radiusExpanded - state.radius + innerLineLength, x = Math.cos(linePositioningAngle) * arcInnerRadius, y = Math.sin(linePositioningAngle) * arcInnerRadius, transform = "rotate(" + lineAngle * 180 / Math.PI + ", " + x + ", " + y + ")";
|
34452 | }
|
34453 |
|
34454 | src_select(this).attr("x", x).attr("y", y).attr("width", lineLength).attr("height", lineThickness).attr("transform", transform).style("stroke-dasharray", "0, " + (lineLength + lineThickness) + ", 0");
|
34455 | });
|
34456 | },
|
34457 | textForGaugeMinMax: function textForGaugeMinMax(value, isMax) {
|
34458 | var $$ = this,
|
34459 | config = $$.config,
|
34460 | format = config.gauge_label_extents;
|
34461 | return isFunction(format) ? format.bind($$.api)(value, isMax) : value;
|
34462 | },
|
34463 | getGaugeLabelHeight: function getGaugeLabelHeight() {
|
34464 | var config = this.config;
|
34465 | return this.config.gauge_label_show && !config.gauge_fullCircle ? 20 : 0;
|
34466 | },
|
34467 | getPaddingBottomForGauge: function getPaddingBottomForGauge() {
|
34468 | var $$ = this;
|
34469 | return $$.getGaugeLabelHeight() * ($$.config.gauge_label_show ? 2 : 2.5);
|
34470 | }
|
34471 | });
|
34472 | ;// CONCATENATED MODULE: ./src/ChartInternal/shape/bubble.ts
|
34473 | /**
|
34474 | * Copyright (c) 2017 ~ present NAVER Corp.
|
34475 | * billboard.js project is licensed under the MIT license
|
34476 | */
|
34477 |
|
34478 |
|
34479 | /* harmony default export */ var bubble = ({
|
34480 | /**
|
34481 | * Initializer
|
34482 | * @private
|
34483 | */
|
34484 | initBubble: function initBubble() {
|
34485 | var $$ = this,
|
34486 | config = $$.config;
|
34487 | $$.hasType("bubble") && (config.point_show = !0, config.point_type = "circle", config.point_sensitivity = 25);
|
34488 | },
|
34489 |
|
34490 | /**
|
34491 | * Get user agent's computed value
|
34492 | * @returns {number}
|
34493 | * @private
|
34494 | */
|
34495 | getBaseLength: function getBaseLength() {
|
34496 | var $$ = this,
|
34497 | _$$$state = $$.state,
|
34498 | width = _$$$state.width,
|
34499 | height = _$$$state.height,
|
34500 | cacheKey = KEY.bubbleBaseLength,
|
34501 | baseLength = $$.cache.get(cacheKey);
|
34502 | return baseLength || $$.cache.add(cacheKey, baseLength = getMinMax("min", [width, height])), baseLength;
|
34503 | },
|
34504 |
|
34505 | /**
|
34506 | * Get the radius value for bubble circle
|
34507 | * @param {object} d Data object
|
34508 | * @returns {number}
|
34509 | * @private
|
34510 | */
|
34511 | getBubbleR: function getBubbleR(d) {
|
34512 | var $$ = this,
|
34513 | maxR = $$.config.bubble_maxR;
|
34514 | isFunction(maxR) ? maxR = maxR.bind($$.api)(d) : !isNumber(maxR) && (maxR = $$.getBaseLength() / ($$.getMaxDataCount() * 2) + 12);
|
34515 | var max = getMinMax("max", $$.getMinMaxData().max.map(function (d) {
|
34516 | return $$.isBubbleZType(d) ? $$.getBubbleZData(d.value, "y") : isObject(d.value) ? d.value.mid : d.value;
|
34517 | })),
|
34518 | maxArea = maxR * maxR * Math.PI,
|
34519 | area = ($$.isBubbleZType(d) ? $$.getBubbleZData(d.value, "z") : d.value) * (maxArea / max);
|
34520 | return Math.sqrt(area / Math.PI);
|
34521 | },
|
34522 |
|
34523 | /**
|
34524 | * Get bubble dimension data
|
34525 | * @param {object|Array} d data value
|
34526 | * @param {string} type - y or z
|
34527 | * @returns {number}
|
34528 | * @private
|
34529 | */
|
34530 | getBubbleZData: function getBubbleZData(d, type) {
|
34531 | return isObject(d) ? d[type] : d[type === "y" ? 0 : 1];
|
34532 | }
|
34533 | });
|
34534 | ;// CONCATENATED MODULE: ./src/ChartInternal/shape/line.ts
|
34535 | /**
|
34536 | * Copyright (c) 2017 ~ present NAVER Corp.
|
34537 | * billboard.js project is licensed under the MIT license
|
34538 | */
|
34539 |
|
34540 |
|
34541 |
|
34542 |
|
34543 | /* harmony default export */ var line = ({
|
34544 | initLine: function initLine() {
|
34545 | var $el = this.$el;
|
34546 | $el.line = $el.main.select("." + config_classes.chart).append("g").attr("class", config_classes.chartLines);
|
34547 | },
|
34548 | updateTargetsForLine: function updateTargetsForLine(t) {
|
34549 | var $$ = this,
|
34550 | _$$$$el = $$.$el,
|
34551 | area = _$$$$el.area,
|
34552 | line = _$$$$el.line,
|
34553 | main = _$$$$el.main,
|
34554 | classChartLine = $$.getChartClass("Line"),
|
34555 | classLines = $$.getClass("lines", !0),
|
34556 | classFocus = $$.classFocus.bind($$);
|
34557 | line || $$.initLine();
|
34558 | var targets = t.filter(function (d) {
|
34559 | return !($$.isScatterType(d) || $$.isBubbleType(d));
|
34560 | }),
|
34561 | mainLineUpdate = main.select("." + config_classes.chartLines).selectAll("." + config_classes.chartLine).data(targets).attr("class", function (d) {
|
34562 | return classChartLine(d) + classFocus(d);
|
34563 | }),
|
34564 | mainLineEnter = mainLineUpdate.enter().append("g").attr("class", classChartLine).style("opacity", "0").style("pointer-events", "none");
|
34565 | // Lines for each data
|
34566 | mainLineEnter.append("g").attr("class", classLines), $$.hasTypeOf("Area") && $$.initArea(!area && mainLineEnter.empty() ? mainLineUpdate : mainLineEnter), $$.updateTargetForCircle(targets, mainLineEnter);
|
34567 | },
|
34568 |
|
34569 | /**
|
34570 | * Generate/Update elements
|
34571 | * @param {number} durationForExit Transition duration for exit elements
|
34572 | * @param {boolean} isSub Subchart draw
|
34573 | * @private
|
34574 | */
|
34575 | updateLine: function updateLine(durationForExit, isSub) {
|
34576 | isSub === void 0 && (isSub = !1);
|
34577 | var $$ = this,
|
34578 | extraLineClasses = $$.format.extraLineClasses,
|
34579 | $el = $$.$el,
|
34580 | $root = isSub ? $el.subchart : $el,
|
34581 | line = $root.main.selectAll("." + config_classes.lines).selectAll("." + config_classes.line).data($$.lineData.bind($$));
|
34582 | line.exit().transition().duration(durationForExit).style("opacity", "0").remove(), $root.line = line.enter().append("path").attr("class", function (d) {
|
34583 | return $$.getClass("line", !0)(d) + " " + (extraLineClasses(d) || "");
|
34584 | }).style("stroke", $$.color).merge(line).style("opacity", $$.initialOpacity.bind($$)).style("shape-rendering", function (d) {
|
34585 | return $$.isStepType(d) ? "crispEdges" : "";
|
34586 | }).attr("transform", null);
|
34587 | },
|
34588 |
|
34589 | /**
|
34590 | * Redraw function
|
34591 | * @param {Function} drawFn Retuned functino from .generateDrawCandlestick()
|
34592 | * @param {boolean} withTransition With or without transition
|
34593 | * @param {boolean} isSub Subchart draw
|
34594 | * @returns {Array}
|
34595 | */
|
34596 | redrawLine: function redrawLine(drawFn, withTransition, isSub) {
|
34597 | isSub === void 0 && (isSub = !1);
|
34598 |
|
34599 | var _ref = isSub ? this.$el.subchart : this.$el,
|
34600 | line = _ref.line;
|
34601 |
|
34602 | return [(withTransition ? line.transition(getRandom()) : line).attr("d", drawFn).style("stroke", this.color).style("opacity", "1")];
|
34603 | },
|
34604 |
|
34605 | /**
|
34606 | * Get the curve interpolate
|
34607 | * @param {Array} d Data object
|
34608 | * @returns {Function}
|
34609 | * @private
|
34610 | */
|
34611 | getCurve: function getCurve(d) {
|
34612 | var $$ = this,
|
34613 | isRotatedStepType = $$.config.axis_rotated && $$.isStepType(d);
|
34614 | // when is step & rotated, should be computed in different way
|
34615 | // https://github.com/naver/billboard.js/issues/471
|
34616 | return isRotatedStepType ? function (context) {
|
34617 | var step = $$.getInterpolate(d)(context); // keep the original method
|
34618 |
|
34619 | return step.orgPoint = step.point, step.pointRotated = function (x, y) {
|
34620 | this._point === 1 && (this._point = 2);
|
34621 | var y1 = this._y * (1 - this._t) + y * this._t;
|
34622 | this._context.lineTo(this._x, y1), this._context.lineTo(x, y1), this._x = x, this._y = y;
|
34623 | }, step.point = function (x, y) {
|
34624 | this._point === 0 ? this.orgPoint(x, y) : this.pointRotated(x, y);
|
34625 | }, step;
|
34626 | } : $$.getInterpolate(d);
|
34627 | },
|
34628 | generateDrawLine: function generateDrawLine(lineIndices, isSub) {
|
34629 | var $$ = this,
|
34630 | config = $$.config,
|
34631 | scale = $$.scale,
|
34632 | lineConnectNull = config.line_connectNull,
|
34633 | isRotated = config.axis_rotated,
|
34634 | getPoints = $$.generateGetLinePoints(lineIndices, isSub),
|
34635 | yScale = $$.getYScaleById.bind($$),
|
34636 | xValue = function (d) {
|
34637 | return (isSub ? $$.subxx : $$.xx).call($$, d);
|
34638 | },
|
34639 | yValue = function (d, i) {
|
34640 | return $$.isGrouped(d.id) ? getPoints(d, i)[0][1] : yScale(d.id, isSub)($$.getBaseValue(d));
|
34641 | },
|
34642 | line = src_line();
|
34643 |
|
34644 | line = isRotated ? line.x(yValue).y(xValue) : line.x(xValue).y(yValue), lineConnectNull || (line = line.defined(function (d) {
|
34645 | return $$.getBaseValue(d) !== null;
|
34646 | }));
|
34647 | var x = isSub ? scale.subX : scale.x;
|
34648 | return function (d) {
|
34649 | var path,
|
34650 | y = yScale(d.id, isSub),
|
34651 | values = lineConnectNull ? $$.filterRemoveNull(d.values) : d.values,
|
34652 | x0 = 0,
|
34653 | y0 = 0;
|
34654 |
|
34655 | if ($$.isLineType(d)) {
|
34656 | var regions = config.data_regions[d.id];
|
34657 | regions ? path = $$.lineWithRegions(values, x, y, regions) : ($$.isStepType(d) && (values = $$.convertValuesToStep(values)), path = line.curve($$.getCurve(d))(values));
|
34658 | } else values[0] && (x0 = x(values[0].x), y0 = y(values[0].value)), path = isRotated ? "M " + y0 + " " + x0 : "M " + x0 + " " + y0;
|
34659 |
|
34660 | return path || "M 0 0";
|
34661 | };
|
34662 | },
|
34663 | lineWithRegions: function lineWithRegions(d, x, y, _regions) {
|
34664 | var xp,
|
34665 | yp,
|
34666 | diff,
|
34667 | diffx2,
|
34668 | $$ = this,
|
34669 | config = $$.config,
|
34670 | isRotated = config.axis_rotated,
|
34671 | isTimeSeries = $$.axis.isTimeSeries(),
|
34672 | xOffset = $$.axis.isCategorized() ? .5 : 0,
|
34673 | regions = [],
|
34674 | dasharray = "2 2",
|
34675 | isWithinRegions = function (withinX, withinRegions) {
|
34676 | for (var reg, i = 0; reg = withinRegions[i]; i++) if (reg.start < withinX && withinX <= reg.end) return reg.style;
|
34677 |
|
34678 | return !1;
|
34679 | };
|
34680 |
|
34681 | // Check start/end of regions
|
34682 | if (isDefined(_regions)) {
|
34683 | var getValue = function (v, def) {
|
34684 | return isUndefined(v) ? def : isTimeSeries ? parseDate.call($$, v) : v;
|
34685 | };
|
34686 |
|
34687 | for (var reg, i = 0; reg = _regions[i]; i++) {
|
34688 | var start = getValue(reg.start, d[0].x),
|
34689 | end = getValue(reg.end, d[d.length - 1].x),
|
34690 | style = reg.style || {
|
34691 | dasharray: dasharray
|
34692 | };
|
34693 | regions[i] = {
|
34694 | start: start,
|
34695 | end: end,
|
34696 | style: style
|
34697 | };
|
34698 | }
|
34699 | } // Set scales
|
34700 |
|
34701 |
|
34702 | var xValue = isRotated ? function (dt) {
|
34703 | return y(dt.value);
|
34704 | } : function (dt) {
|
34705 | return x(dt.x);
|
34706 | },
|
34707 | yValue = isRotated ? function (dt) {
|
34708 | return x(dt.x);
|
34709 | } : function (dt) {
|
34710 | return y(dt.value);
|
34711 | },
|
34712 | generateM = function (points) {
|
34713 | return "M" + points[0][0] + "," + points[0][1] + "L" + points[1][0] + "," + points[1][1];
|
34714 | },
|
34715 | sWithRegion = isTimeSeries ? function (d0, d1, k, timeseriesDiff) {
|
34716 | var x0 = d0.x.getTime(),
|
34717 | xDiff = d1.x - d0.x,
|
34718 | xv0 = new Date(x0 + xDiff * k),
|
34719 | xv1 = new Date(x0 + xDiff * (k + timeseriesDiff)),
|
34720 | points = isRotated ? [[y(yp(k)), x(xv0)], [y(yp(k + diff)), x(xv1)]] : [[x(xv0), y(yp(k))], [x(xv1), y(yp(k + diff))]];
|
34721 | return generateM(points);
|
34722 | } : function (d0, d1, k, otherDiff) {
|
34723 | var points = isRotated ? [[y(yp(k), !0), x(xp(k))], [y(yp(k + otherDiff), !0), x(xp(k + otherDiff))]] : [[x(xp(k), !0), y(yp(k))], [x(xp(k + otherDiff), !0), y(yp(k + otherDiff))]];
|
34724 | return generateM(points);
|
34725 | },
|
34726 | axisType = {
|
34727 | x: $$.axis.getAxisType("x"),
|
34728 | y: $$.axis.getAxisType("y")
|
34729 | },
|
34730 | path = "";
|
34731 |
|
34732 | for (var data, _i = 0; data = d[_i]; _i++) {
|
34733 | var prevData = d[_i - 1],
|
34734 | hasPrevData = prevData && isValue(prevData.value),
|
34735 | style = isWithinRegions(data.x, regions);
|
34736 | // https://github.com/naver/billboard.js/issues/1172
|
34737 | if (isValue(data.value)) // Draw as normal
|
34738 | if (isUndefined(regions) || !style || !hasPrevData) path += "" + (_i && hasPrevData ? "L" : "M") + xValue(data) + "," + yValue(data);else if (hasPrevData) {
|
34739 | try {
|
34740 | style = style.dasharray.split(" ");
|
34741 | } catch (e) {
|
34742 | style = dasharray.split(" ");
|
34743 | } // Draw with region // TODO: Fix for horizotal charts
|
34744 |
|
34745 |
|
34746 | xp = getScale(axisType.x, prevData.x + xOffset, data.x + xOffset), yp = getScale(axisType.y, prevData.value, data.value);
|
34747 | var dx = x(data.x) - x(prevData.x),
|
34748 | dy = y(data.value) - y(prevData.value),
|
34749 | dd = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));
|
34750 | diff = style[0] / dd, diffx2 = diff * style[1];
|
34751 |
|
34752 | for (var _j = diff; _j <= 1; _j += diffx2) path += sWithRegion(prevData, data, _j, diff), _j + diffx2 >= 1 && (path += sWithRegion(prevData, data, 1, 0));
|
34753 | }
|
34754 | }
|
34755 |
|
34756 | return path;
|
34757 | },
|
34758 | isWithinStep: function isWithinStep(that, y) {
|
34759 | return Math.abs(y - getPointer(this.state.event, that)[1]) < 30;
|
34760 | },
|
34761 | shouldDrawPointsForLine: function shouldDrawPointsForLine(d) {
|
34762 | var linePoint = this.config.line_point;
|
34763 | return linePoint === !0 || isArray(linePoint) && linePoint.indexOf(d.id) !== -1;
|
34764 | }
|
34765 | });
|
34766 | ;// CONCATENATED MODULE: ./src/ChartInternal/shape/point.ts
|
34767 | /**
|
34768 | * Copyright (c) 2017 ~ present NAVER Corp.
|
34769 | * billboard.js project is licensed under the MIT license
|
34770 | */
|
34771 |
|
34772 |
|
34773 |
|
34774 |
|
34775 |
|
34776 | var getTransitionName = function () {
|
34777 | return getRandom();
|
34778 | };
|
34779 |
|
34780 | /* harmony default export */ var point = ({
|
34781 | hasValidPointType: function hasValidPointType(type) {
|
34782 | return /^(circle|rect(angle)?|polygon|ellipse|use)$/i.test(type || this.config.point_type);
|
34783 | },
|
34784 | hasValidPointDrawMethods: function hasValidPointDrawMethods(type) {
|
34785 | var pointType = type || this.config.point_type;
|
34786 | return isObjectType(pointType) && isFunction(pointType.create) && isFunction(pointType.update);
|
34787 | },
|
34788 | initialOpacityForCircle: function initialOpacityForCircle(d) {
|
34789 | var config = this.config,
|
34790 | withoutFadeIn = this.state.withoutFadeIn,
|
34791 | opacity = config.point_opacity;
|
34792 | return isUndefined(opacity) && (opacity = this.getBaseValue(d) !== null && withoutFadeIn[d.id] ? this.opacityForCircle(d) : "0"), opacity;
|
34793 | },
|
34794 | opacityForCircle: function opacityForCircle(d) {
|
34795 | var config = this.config,
|
34796 | opacity = config.point_opacity;
|
34797 | return isUndefined(opacity) && (opacity = config.point_show && !config.point_focus_only ? "1" : "0", opacity = isValue(this.getBaseValue(d)) ? this.isBubbleType(d) || this.isScatterType(d) ? "0.5" : opacity : "0"), opacity;
|
34798 | },
|
34799 | initCircle: function initCircle() {
|
34800 | var $$ = this,
|
34801 | main = $$.$el.main;
|
34802 | $$.point = $$.generatePoint(), ($$.hasType("bubble") || $$.hasType("scatter")) && main.select("." + config_classes.chartCircles).empty() && main.select("." + config_classes.chart).append("g").attr("class", config_classes.chartCircles);
|
34803 | },
|
34804 | updateTargetForCircle: function updateTargetForCircle(targetsValue, enterNodeValue) {
|
34805 | var _this = this,
|
34806 | $$ = this,
|
34807 | config = $$.config,
|
34808 | data = $$.data,
|
34809 | $el = $$.$el,
|
34810 | selectionEnabled = config.interaction_enabled && config.data_selection_enabled,
|
34811 | isSelectable = selectionEnabled && config.data_selection_isselectable,
|
34812 | classCircles = $$.getClass("circles", !0);
|
34813 |
|
34814 | if (config.point_show) {
|
34815 | $el.circle || $$.initCircle();
|
34816 | var targets = targetsValue,
|
34817 | enterNode = enterNodeValue;
|
34818 |
|
34819 | // only for scatter & bubble type should generate seprate <g> node
|
34820 | if (!targets) {
|
34821 | targets = data.targets.filter(function (d) {
|
34822 | return _this.isScatterType(d) || _this.isBubbleType(d);
|
34823 | });
|
34824 | var mainCircle = $el.main.select("." + config_classes.chartCircles).style("pointer-events", "none").selectAll("." + config_classes.circles).data(targets).attr("class", classCircles);
|
34825 | mainCircle.exit().remove(), enterNode = mainCircle.enter();
|
34826 | } // Circles for each data point on lines
|
34827 |
|
34828 |
|
34829 | selectionEnabled && enterNode.append("g").attr("class", function (d) {
|
34830 | return $$.generateClass(config_classes.selectedCircles, d.id);
|
34831 | }), enterNode.append("g").attr("class", classCircles).style("cursor", function (d) {
|
34832 | return isSelectable && isSelectable(d) ? "pointer" : null;
|
34833 | }), selectionEnabled && targets.forEach(function (t) {
|
34834 | $el.main.selectAll("." + config_classes.selectedCircles + $$.getTargetSelectorSuffix(t.id)).selectAll("" + config_classes.selectedCircle).each(function (d) {
|
34835 | d.value = t.values[d.index].value;
|
34836 | });
|
34837 | });
|
34838 | }
|
34839 | },
|
34840 | updateCircle: function updateCircle(isSub) {
|
34841 | isSub === void 0 && (isSub = !1);
|
34842 | var $$ = this,
|
34843 | config = $$.config,
|
34844 | state = $$.state,
|
34845 | $el = $$.$el,
|
34846 | focusOnly = config.point_focus_only,
|
34847 | $root = isSub ? $el.subchart : $el;
|
34848 |
|
34849 | if (config.point_show && !state.toggling) {
|
34850 | var circles = $root.main.selectAll("." + config_classes.circles).selectAll("." + config_classes.circle).data(function (d) {
|
34851 | return $$.isLineType(d) && $$.shouldDrawPointsForLine(d) || $$.isBubbleType(d) || $$.isRadarType(d) || $$.isScatterType(d) ? focusOnly ? [d.values[0]] : d.values : [];
|
34852 | });
|
34853 | circles.exit().remove(), circles.enter().filter(Boolean).append($$.point("create", this, $$.pointR.bind($$), $$.color)), $root.circle = $root.main.selectAll("." + config_classes.circles + " ." + config_classes.circle).style("stroke", $$.color).style("opacity", $$.initialOpacityForCircle.bind($$));
|
34854 | }
|
34855 | },
|
34856 | redrawCircle: function redrawCircle(cx, cy, withTransition, flow, isSub) {
|
34857 | isSub === void 0 && (isSub = !1);
|
34858 | var $$ = this,
|
34859 | rendered = $$.state.rendered,
|
34860 | $el = $$.$el,
|
34861 | $root = isSub ? $el.subchart : $el,
|
34862 | selectedCircles = $root.main.selectAll("." + config_classes.selectedCircle);
|
34863 | if (!$$.config.point_show) return [];
|
34864 | var fn = $$.point("update", $$, cx, cy, $$.color, withTransition, flow, selectedCircles),
|
34865 | posAttr = $$.isCirclePoint() ? "c" : "",
|
34866 | t = getRandom(),
|
34867 | opacityStyleFn = $$.opacityForCircle.bind($$),
|
34868 | mainCircles = [];
|
34869 | return $root.circle.each(function (d) {
|
34870 | var result = fn.bind(this)(d);
|
34871 | result = (withTransition || !rendered ? result.transition(t) : result).style("opacity", opacityStyleFn), mainCircles.push(result);
|
34872 | }), [mainCircles, (withTransition ? selectedCircles.transition() : selectedCircles).attr(posAttr + "x", cx).attr(posAttr + "y", cy)];
|
34873 | },
|
34874 |
|
34875 | /**
|
34876 | * Show focused data point circle
|
34877 | * @param {object} d Selected data
|
34878 | * @private
|
34879 | */
|
34880 | showCircleFocus: function showCircleFocus(d) {
|
34881 | var $$ = this,
|
34882 | config = $$.config,
|
34883 | _$$$state = $$.state,
|
34884 | hasRadar = _$$$state.hasRadar,
|
34885 | resizing = _$$$state.resizing,
|
34886 | toggling = _$$$state.toggling,
|
34887 | transiting = _$$$state.transiting,
|
34888 | $el = $$.$el,
|
34889 | circle = $el.circle;
|
34890 |
|
34891 | if (transiting === !1 && config.point_focus_only && circle) {
|
34892 | var cx = (hasRadar ? $$.radarCircleX : $$.circleX).bind($$),
|
34893 | cy = (hasRadar ? $$.radarCircleY : $$.circleY).bind($$),
|
34894 | withTransition = toggling || isUndefined(d),
|
34895 | fn = $$.point("update", $$, cx, cy, $$.color, !resizing && withTransition);
|
34896 | d && (circle = circle.filter(function (t) {
|
34897 | var data = d.filter(function (v) {
|
34898 | return v.id === t.id;
|
34899 | });
|
34900 | return !!data.length && src_select(this).datum(data[0]);
|
34901 | })), circle.attr("class", this.updatePointClass.bind(this)).style("opacity", "1").each(function (d) {
|
34902 | var id = d.id,
|
34903 | index = d.index,
|
34904 | value = d.value,
|
34905 | visibility = "hidden";
|
34906 | isValue(value) && (fn.bind(this)(d), $$.expandCircles(index, id), visibility = ""), this.style.visibility = visibility;
|
34907 | });
|
34908 | }
|
34909 | },
|
34910 |
|
34911 | /**
|
34912 | * Hide focused data point circle
|
34913 | * @private
|
34914 | */
|
34915 | hideCircleFocus: function hideCircleFocus() {
|
34916 | var $$ = this,
|
34917 | config = $$.config,
|
34918 | circle = $$.$el.circle;
|
34919 | config.point_focus_only && circle && ($$.unexpandCircles(), circle.style("visibility", "hidden"));
|
34920 | },
|
34921 | circleX: function circleX(d) {
|
34922 | return this.xx(d);
|
34923 | },
|
34924 | updateCircleY: function updateCircleY(isSub) {
|
34925 | isSub === void 0 && (isSub = !1);
|
34926 | var $$ = this,
|
34927 | getPoints = $$.generateGetLinePoints($$.getShapeIndices($$.isLineType), isSub);
|
34928 | return function (d, i) {
|
34929 | var id = d.id;
|
34930 | return $$.isGrouped(id) ? getPoints(d, i)[0][1] : $$.getYScaleById(id, isSub)($$.getBaseValue(d));
|
34931 | };
|
34932 | },
|
34933 | getCircles: function getCircles(i, id) {
|
34934 | var $$ = this,
|
34935 | suffix = isValue(i) ? "-" + i : "";
|
34936 | return (id ? $$.$el.main.selectAll("." + config_classes.circles + $$.getTargetSelectorSuffix(id)) : $$.$el.main).selectAll("." + config_classes.circle + suffix);
|
34937 | },
|
34938 | expandCircles: function expandCircles(i, id, reset) {
|
34939 | var $$ = this,
|
34940 | r = $$.pointExpandedR.bind($$);
|
34941 | reset && $$.unexpandCircles();
|
34942 | var circles = $$.getCircles(i, id).classed(config_classes.EXPANDED, !0),
|
34943 | scale = r(circles) / $$.config.point_r,
|
34944 | ratio = 1 - scale;
|
34945 | $$.isCirclePoint() ? circles.attr("r", r) : circles.each(function () {
|
34946 | var point = src_select(this);
|
34947 | if (this.tagName === "circle") point.attr("r", r);else {
|
34948 | var _this$getBBox = this.getBBox(),
|
34949 | width = _this$getBBox.width,
|
34950 | height = _this$getBBox.height,
|
34951 | x = ratio * (+point.attr("x") + width / 2),
|
34952 | y = ratio * (+point.attr("y") + height / 2);
|
34953 |
|
34954 | point.attr("transform", "translate(" + x + " " + y + ") scale(" + scale + ")");
|
34955 | }
|
34956 | });
|
34957 | },
|
34958 | unexpandCircles: function unexpandCircles(i) {
|
34959 | var $$ = this,
|
34960 | r = $$.pointR.bind($$),
|
34961 | circles = $$.getCircles(i).filter(function () {
|
34962 | return src_select(this).classed(config_classes.EXPANDED);
|
34963 | }).classed(config_classes.EXPANDED, !1);
|
34964 | circles.attr("r", r), $$.isCirclePoint() || circles.attr("transform", "scale(" + r(circles) / $$.config.point_r + ")");
|
34965 | },
|
34966 | pointR: function (d) {
|
34967 | var $$ = this,
|
34968 | config = $$.config,
|
34969 | pointR = config.point_r,
|
34970 | r = pointR;
|
34971 | return $$.isBubbleType(d) ? r = $$.getBubbleR(d) : isFunction(pointR) && (r = pointR.bind($$.api)(d)), r;
|
34972 | },
|
34973 | pointExpandedR: function pointExpandedR(d) {
|
34974 | var $$ = this,
|
34975 | config = $$.config,
|
34976 | scale = $$.isBubbleType(d) ? 1.15 : 1.75;
|
34977 | return config.point_focus_expand_enabled ? config.point_focus_expand_r || $$.pointR(d) * scale : $$.pointR(d);
|
34978 | },
|
34979 | pointSelectR: function pointSelectR(d) {
|
34980 | var $$ = this,
|
34981 | selectR = $$.config.point_select_r;
|
34982 | return isFunction(selectR) ? selectR(d) : selectR || $$.pointR(d) * 4;
|
34983 | },
|
34984 | isWithinCircle: function isWithinCircle(node, r) {
|
34985 | var mouse = getPointer(this.state.event, node),
|
34986 | element = src_select(node),
|
34987 | prefix = this.isCirclePoint(node) ? "c" : "",
|
34988 | cx = +element.attr(prefix + "x"),
|
34989 | cy = +element.attr(prefix + "y");
|
34990 |
|
34991 | // if node don't have cx/y or x/y attribute value
|
34992 | if (!(cx || cy) && node.nodeType === 1) {
|
34993 | var _getBoundingRect = getBoundingRect(node),
|
34994 | x = _getBoundingRect.x,
|
34995 | y = _getBoundingRect.y;
|
34996 |
|
34997 | cx = x, cy = y;
|
34998 | }
|
34999 |
|
35000 | return Math.sqrt(Math.pow(cx - mouse[0], 2) + Math.pow(cy - mouse[1], 2)) < (r || this.config.point_sensitivity);
|
35001 | },
|
35002 | insertPointInfoDefs: function insertPointInfoDefs(point, id) {
|
35003 | var $$ = this,
|
35004 | copyAttr = function (from, target) {
|
35005 | for (var name, attribs = from.attributes, i = 0; name = attribs[i]; i++) name = name.name, target.setAttribute(name, from.getAttribute(name));
|
35006 | },
|
35007 | doc = new DOMParser().parseFromString(point, "image/svg+xml"),
|
35008 | node = doc.documentElement,
|
35009 | clone = browser_doc.createElementNS(namespaces.svg, node.nodeName.toLowerCase());
|
35010 |
|
35011 | if (clone.id = id, clone.style.fill = "inherit", clone.style.stroke = "inherit", copyAttr(node, clone), node.childNodes && node.childNodes.length) {
|
35012 | var parent = src_select(clone);
|
35013 | "innerHTML" in clone ? parent.html(node.innerHTML) : toArray(node.childNodes).forEach(function (v) {
|
35014 | copyAttr(v, parent.append(v.tagName).node());
|
35015 | });
|
35016 | }
|
35017 |
|
35018 | $$.$el.defs.node().appendChild(clone);
|
35019 | },
|
35020 | pointFromDefs: function pointFromDefs(id) {
|
35021 | return this.$el.defs.select("#" + id);
|
35022 | },
|
35023 | updatePointClass: function updatePointClass(d) {
|
35024 | var $$ = this,
|
35025 | circle = $$.$el.circle,
|
35026 | pointClass = !1;
|
35027 | return (isObject(d) || circle) && (pointClass = d === !0 ? circle.each(function (d) {
|
35028 | var className = $$.getClass("circle", !0)(d);
|
35029 | this.getAttribute("class").indexOf(config_classes.EXPANDED) > -1 && (className += " " + config_classes.EXPANDED), this.setAttribute("class", className);
|
35030 | }) : $$.getClass("circle", !0)(d)), pointClass;
|
35031 | },
|
35032 | generateGetLinePoints: function generateGetLinePoints(lineIndices, isSub) {
|
35033 | // partial duplication of generateGetBarPoints
|
35034 | var $$ = this,
|
35035 | config = $$.config,
|
35036 | x = $$.getShapeX(0, lineIndices, isSub),
|
35037 | y = $$.getShapeY(isSub),
|
35038 | lineOffset = $$.getShapeOffset($$.isLineType, lineIndices, isSub),
|
35039 | yScale = $$.getYScaleById.bind($$);
|
35040 | return function (d, i) {
|
35041 | var y0 = yScale.call($$, d.id, isSub)($$.getShapeYMin(d.id)),
|
35042 | offset = lineOffset(d, i) || y0,
|
35043 | posX = x(d),
|
35044 | posY = y(d);
|
35045 | config.axis_rotated && (d.value > 0 && posY < y0 || d.value < 0 && y0 < posY) && (posY = y0);
|
35046 | // 1 point that marks the line position
|
35047 | var point = [posX, posY - (y0 - offset)];
|
35048 | return [point, point, // from here and below, needed for compatibility
|
35049 | point, point];
|
35050 | };
|
35051 | },
|
35052 | generatePoint: function generatePoint() {
|
35053 | var $$ = this,
|
35054 | config = $$.config,
|
35055 | datetimeId = $$.state.datetimeId,
|
35056 | ids = [],
|
35057 | pattern = notEmpty(config.point_pattern) ? config.point_pattern : [config.point_type];
|
35058 | return function (method, context) {
|
35059 | for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) args[_key - 2] = arguments[_key];
|
35060 |
|
35061 | return function (d) {
|
35062 | var id = $$.getTargetSelectorSuffix(d.id || d.data && d.data.id || d),
|
35063 | element = src_select(this);
|
35064 | ids.indexOf(id) < 0 && ids.push(id);
|
35065 | var point = pattern[ids.indexOf(id) % pattern.length];
|
35066 | if ($$.hasValidPointType(point)) point = $$[point];else if (!$$.hasValidPointDrawMethods(point)) {
|
35067 | var pointId = datetimeId + "-point" + id,
|
35068 | pointFromDefs = $$.pointFromDefs(pointId);
|
35069 | if (pointFromDefs.size() < 1 && $$.insertPointInfoDefs(point, pointId), method === "create") return $$.custom.create.bind(context).apply(void 0, [element, pointId].concat(args));
|
35070 | if (method === "update") return $$.custom.update.bind(context).apply(void 0, [element].concat(args));
|
35071 | }
|
35072 | return point[method].bind(context).apply(void 0, [element].concat(args));
|
35073 | };
|
35074 | };
|
35075 | },
|
35076 | custom: {
|
35077 | create: function create(element, id, sizeFn, fillStyleFn) {
|
35078 | return element.append("use").attr("xlink:href", "#" + id).attr("class", this.updatePointClass.bind(this)).style("fill", fillStyleFn).node();
|
35079 | },
|
35080 | update: function update(element, xPosFn, yPosFn, fillStyleFn, withTransition, flow, selectedCircles) {
|
35081 | var _element$node$getBBox = element.node().getBBox(),
|
35082 | width = _element$node$getBBox.width,
|
35083 | height = _element$node$getBBox.height,
|
35084 | xPosFn2 = function (d) {
|
35085 | return xPosFn(d) - width / 2;
|
35086 | },
|
35087 | mainCircles = element;
|
35088 |
|
35089 | if (withTransition) {
|
35090 | var transitionName = getTransitionName();
|
35091 | flow && mainCircles.attr("x", xPosFn2), mainCircles = mainCircles.transition(transitionName), selectedCircles && selectedCircles.transition(getTransitionName());
|
35092 | }
|
35093 |
|
35094 | return mainCircles.attr("x", xPosFn2).attr("y", function yPosFn2(d) {
|
35095 | return yPosFn(d) - height / 2;
|
35096 | }).style("fill", fillStyleFn);
|
35097 | }
|
35098 | },
|
35099 | // 'circle' data point
|
35100 | circle: {
|
35101 | create: function create(element, sizeFn, fillStyleFn) {
|
35102 | return element.append("circle").attr("class", this.updatePointClass.bind(this)).attr("r", sizeFn).style("fill", fillStyleFn).node();
|
35103 | },
|
35104 | update: function update(element, xPosFn, yPosFn, fillStyleFn, withTransition, flow, selectedCircles) {
|
35105 | var $$ = this,
|
35106 | mainCircles = element;
|
35107 |
|
35108 | if ($$.hasType("bubble") && mainCircles.attr("r", $$.pointR.bind($$)), withTransition) {
|
35109 | var transitionName = getTransitionName();
|
35110 | flow && mainCircles.attr("cx", xPosFn), mainCircles.attr("cx") && (mainCircles = mainCircles.transition(transitionName)), selectedCircles && selectedCircles.transition(getTransitionName());
|
35111 | }
|
35112 |
|
35113 | return mainCircles.attr("cx", xPosFn).attr("cy", yPosFn).style("fill", fillStyleFn);
|
35114 | }
|
35115 | },
|
35116 | // 'rectangle' data point
|
35117 | rectangle: {
|
35118 | create: function create(element, sizeFn, fillStyleFn) {
|
35119 | var rectSizeFn = function (d) {
|
35120 | return sizeFn(d) * 2;
|
35121 | };
|
35122 |
|
35123 | return element.append("rect").attr("class", this.updatePointClass.bind(this)).attr("width", rectSizeFn).attr("height", rectSizeFn).style("fill", fillStyleFn).node();
|
35124 | },
|
35125 | update: function update(element, xPosFn, yPosFn, fillStyleFn, withTransition, flow, selectedCircles) {
|
35126 | var $$ = this,
|
35127 | r = $$.config.point_r,
|
35128 | rectXPosFn = function (d) {
|
35129 | return xPosFn(d) - r;
|
35130 | },
|
35131 | mainCircles = element;
|
35132 |
|
35133 | if (withTransition) {
|
35134 | var transitionName = getTransitionName();
|
35135 | flow && mainCircles.attr("x", rectXPosFn), mainCircles = mainCircles.transition(transitionName), selectedCircles && selectedCircles.transition(getTransitionName());
|
35136 | }
|
35137 |
|
35138 | return mainCircles.attr("x", rectXPosFn).attr("y", function rectYPosFn(d) {
|
35139 | return yPosFn(d) - r;
|
35140 | }).style("fill", fillStyleFn);
|
35141 | }
|
35142 | }
|
35143 | });
|
35144 | ;// CONCATENATED MODULE: ./src/ChartInternal/shape/radar.ts
|
35145 | /**
|
35146 | * Copyright (c) 2017 ~ present NAVER Corp.
|
35147 | * billboard.js project is licensed under the MIT license
|
35148 | */
|
35149 |
|
35150 |
|
35151 |
|
35152 |
|
35153 | /**
|
35154 | * Get the position value
|
35155 | * @param {boolean} isClockwise If the direction is clockwise
|
35156 | * @param {string} type Coordinate type 'x' or 'y'
|
35157 | * @param {number} edge Number of edge
|
35158 | * @param {number} pos The indexed position
|
35159 | * @param {number} range Range value
|
35160 | * @param {number} ratio Ratio value
|
35161 | * @returns {number}
|
35162 | * @private
|
35163 | */
|
35164 |
|
35165 | function getPosition(isClockwise, type, edge, pos, range, ratio) {
|
35166 | var index = isClockwise && pos > 0 ? edge - pos : pos,
|
35167 | r = 2 * Math.PI,
|
35168 | func = type === "x" ? Math.sin : Math.cos;
|
35169 | return range * (1 - ratio * func(index * r / edge));
|
35170 | } // cache key
|
35171 |
|
35172 |
|
35173 | var cacheKey = KEY.radarPoints;
|
35174 | /* harmony default export */ var radar = ({
|
35175 | initRadar: function initRadar() {
|
35176 | var $$ = this,
|
35177 | config = $$.config,
|
35178 | current = $$.state.current,
|
35179 | $el = $$.$el;
|
35180 | $$.hasType("radar") && ($el.radar = $el.main.select("." + config_classes.chart).append("g").attr("class", config_classes.chartRadars), $el.radar.levels = $el.radar.append("g").attr("class", config_classes.levels), $el.radar.axes = $el.radar.append("g").attr("class", config_classes.axis), $el.radar.shapes = $el.radar.append("g").attr("class", config_classes.shapes), current.dataMax = config.radar_axis_max || $$.getMinMaxData().max[0].value);
|
35181 | },
|
35182 | getRadarSize: function getRadarSize() {
|
35183 | var $$ = this,
|
35184 | config = $$.config,
|
35185 | _$$$state = $$.state,
|
35186 | arcWidth = _$$$state.arcWidth,
|
35187 | arcHeight = _$$$state.arcHeight,
|
35188 | padding = config.axis_x_categories.length < 4 ? -20 : 10,
|
35189 | size = (Math.min(arcWidth, arcHeight) - padding) / 2;
|
35190 | return [size, size];
|
35191 | },
|
35192 | updateTargetsForRadar: function updateTargetsForRadar(targets) {
|
35193 | var $$ = this,
|
35194 | config = $$.config;
|
35195 | isEmpty(config.axis_x_categories) && (config.axis_x_categories = getRange(0, getMinMax("max", targets.map(function (v) {
|
35196 | return v.values.length;
|
35197 | })))), $$.generateRadarPoints();
|
35198 | },
|
35199 | getRadarPosition: function getRadarPosition(type, index, range, ratio) {
|
35200 | var $$ = this,
|
35201 | config = $$.config,
|
35202 | _$$$getRadarSize = $$.getRadarSize(),
|
35203 | width = _$$$getRadarSize[0],
|
35204 | height = _$$$getRadarSize[1],
|
35205 | edge = config.axis_x_categories.length,
|
35206 | isClockwise = config.radar_direction_clockwise,
|
35207 | pos = toArray(type).map(function (v) {
|
35208 | return getPosition(isClockwise, v, edge, index, isDefined(range) ? range : type === "x" ? width : height, isNumber(ratio) ? ratio : config.radar_size_ratio);
|
35209 | });
|
35210 |
|
35211 | return pos.length === 1 ? pos[0] : pos;
|
35212 | },
|
35213 |
|
35214 | /**
|
35215 | * Generate data points
|
35216 | * @private
|
35217 | */
|
35218 | generateRadarPoints: function generateRadarPoints() {
|
35219 | var $$ = this,
|
35220 | targets = $$.data.targets,
|
35221 | _$$$getRadarSize2 = $$.getRadarSize(),
|
35222 | width = _$$$getRadarSize2[0],
|
35223 | height = _$$$getRadarSize2[1],
|
35224 | points = $$.cache.get(cacheKey) || {},
|
35225 | size = points._size;
|
35226 |
|
35227 | size && (size.width === width || size.height === height) || (targets.forEach(function (d) {
|
35228 | points[d.id] = d.values.map(function (v, i) {
|
35229 | return $$.getRadarPosition(["x", "y"], i, undefined, $$.getRatio("radar", v));
|
35230 | });
|
35231 | }), points._size = {
|
35232 | width: width,
|
35233 | height: height
|
35234 | }, $$.cache.add(cacheKey, points));
|
35235 | },
|
35236 | redrawRadar: function redrawRadar(durationForExit) {
|
35237 | var $$ = this,
|
35238 | _$$$$el = $$.$el,
|
35239 | radar = _$$$$el.radar,
|
35240 | main = _$$$$el.main,
|
35241 | translate = $$.getTranslate("radar");
|
35242 | translate && (radar.attr("transform", translate), main.select("." + config_classes.chartTexts).attr("transform", translate), $$.generateRadarPoints(), $$.updateRadarLevel(), $$.updateRadarAxes(), $$.updateRadarShape(durationForExit));
|
35243 | },
|
35244 | generateGetRadarPoints: function generateGetRadarPoints() {
|
35245 | var points = this.cache.get(cacheKey);
|
35246 | return function (d, i) {
|
35247 | var point = points[d.id][i];
|
35248 | return [point, point, point, point];
|
35249 | };
|
35250 | },
|
35251 | updateRadarLevel: function updateRadarLevel() {
|
35252 | var $$ = this,
|
35253 | config = $$.config,
|
35254 | state = $$.state,
|
35255 | radar = $$.$el.radar,
|
35256 | _$$$getRadarSize3 = $$.getRadarSize(),
|
35257 | width = _$$$getRadarSize3[0],
|
35258 | height = _$$$getRadarSize3[1],
|
35259 | depth = config.radar_level_depth,
|
35260 | edge = config.axis_x_categories.length,
|
35261 | showText = config.radar_level_text_show,
|
35262 | radarLevels = radar.levels,
|
35263 | levelData = getRange(0, depth),
|
35264 | radius = config.radar_size_ratio * Math.min(width, height),
|
35265 | levelRatio = levelData.map(function (l) {
|
35266 | return radius * ((l + 1) / depth);
|
35267 | }),
|
35268 | levelTextFormat = (config.radar_level_text_format || function () {}).bind($$.api),
|
35269 | points = levelData.map(function (v) {
|
35270 | var range = levelRatio[v],
|
35271 | pos = getRange(0, edge).map(function (i) {
|
35272 | return $$.getRadarPosition(["x", "y"], i, range, 1).join(",");
|
35273 | });
|
35274 | return pos.join(" ");
|
35275 | }),
|
35276 | level = radarLevels.selectAll("." + config_classes.level).data(levelData);
|
35277 |
|
35278 | level.exit().remove();
|
35279 | var levelEnter = level.enter().append("g").attr("class", function (d, i) {
|
35280 | return config_classes.level + " " + config_classes.level + "-" + i;
|
35281 | });
|
35282 | levelEnter.append("polygon").style("visibility", config.radar_level_show ? null : "hidden"), showText && (radarLevels.select("text").empty() && radarLevels.append("text").attr("dx", "-.5em").attr("dy", "-.7em").style("text-anchor", "end").text(function () {
|
35283 | return levelTextFormat(0);
|
35284 | }), levelEnter.append("text").attr("dx", "-.5em").style("text-anchor", "end").text(function (d) {
|
35285 | return levelTextFormat(state.current.dataMax / levelData.length * (d + 1));
|
35286 | })), levelEnter.merge(level).attr("transform", function (d) {
|
35287 | return "translate(" + (width - levelRatio[d]) + ", " + (height - levelRatio[d]) + ")";
|
35288 | }).selectAll("polygon").attr("points", function (d) {
|
35289 | return points[d];
|
35290 | }), showText && radarLevels.selectAll("text").attr("x", function (d) {
|
35291 | return isUndefined(d) ? width : points[d].split(",")[0];
|
35292 | }).attr("y", function (d) {
|
35293 | return isUndefined(d) ? height : 0;
|
35294 | });
|
35295 | },
|
35296 | updateRadarAxes: function updateRadarAxes() {
|
35297 | var $$ = this,
|
35298 | config = $$.config,
|
35299 | radar = $$.$el.radar,
|
35300 | _$$$getRadarSize4 = $$.getRadarSize(),
|
35301 | width = _$$$getRadarSize4[0],
|
35302 | height = _$$$getRadarSize4[1],
|
35303 | categories = config.axis_x_categories,
|
35304 | axis = radar.axes.selectAll("g").data(categories);
|
35305 |
|
35306 | axis.exit().remove();
|
35307 | var axisEnter = axis.enter().append("g").attr("class", function (d, i) {
|
35308 | return config_classes.axis + "-" + i;
|
35309 | });
|
35310 |
|
35311 | // axis text
|
35312 | if (config.radar_axis_line_show && axisEnter.append("line"), config.radar_axis_text_show && axisEnter.append("text"), axis = axisEnter.merge(axis), config.radar_axis_line_show && axis.select("line").attr("x1", width).attr("y1", height).attr("x2", function (d, i) {
|
35313 | return $$.getRadarPosition("x", i);
|
35314 | }).attr("y2", function (d, i) {
|
35315 | return $$.getRadarPosition("y", i);
|
35316 | }), config.radar_axis_text_show) {
|
35317 | var _config$radar_axis_te = config.radar_axis_text_position,
|
35318 | _config$radar_axis_te2 = _config$radar_axis_te.x,
|
35319 | x = _config$radar_axis_te2 === void 0 ? 0 : _config$radar_axis_te2,
|
35320 | _config$radar_axis_te3 = _config$radar_axis_te.y,
|
35321 | y = _config$radar_axis_te3 === void 0 ? 0 : _config$radar_axis_te3;
|
35322 | axis.select("text").style("text-anchor", "middle").attr("dy", ".5em").call(function (selection) {
|
35323 | selection.each(function (d) {
|
35324 | setTextValue(src_select(this), d + "", [-.6, 1.2]);
|
35325 | });
|
35326 | }).datum(function (d, i) {
|
35327 | return {
|
35328 | index: i
|
35329 | };
|
35330 | }).attr("transform", function (d) {
|
35331 | isUndefined(this.width) && (this.width = this.getBoundingClientRect().width / 2);
|
35332 | var posX = $$.getRadarPosition("x", d.index, undefined, 1),
|
35333 | posY = Math.round($$.getRadarPosition("y", d.index, undefined, 1));
|
35334 | return posX > width ? posX += this.width + x : Math.round(posX) < width && (posX -= this.width + x), posY > height ? (posY / 2 === height && this.firstChild.tagName === "tspan" && this.firstChild.setAttribute("dy", "0em"), posY += y) : posY < height && (posY -= y), "translate(" + posX + " " + posY + ")";
|
35335 | });
|
35336 | }
|
35337 |
|
35338 | $$.bindEvent();
|
35339 | },
|
35340 | bindEvent: function bindEvent() {
|
35341 | var $$ = this,
|
35342 | config = $$.config,
|
35343 | state = $$.state,
|
35344 | _$$$$el2 = $$.$el,
|
35345 | radar = _$$$$el2.radar,
|
35346 | svg = _$$$$el2.svg,
|
35347 | focusOnly = config.point_focus_only,
|
35348 | _state = state,
|
35349 | inputType = _state.inputType,
|
35350 | transiting = _state.transiting;
|
35351 |
|
35352 | if (config.interaction_enabled) {
|
35353 | var isMouse = inputType === "mouse",
|
35354 | getIndex = function (event) {
|
35355 | var target = event.target; // in case of multilined axis text
|
35356 |
|
35357 | /tspan/i.test(target.tagName) && (target = target.parentNode);
|
35358 | var d = src_select(target).datum();
|
35359 | return d && Object.keys(d).length === 1 ? d.index : undefined;
|
35360 | },
|
35361 | hide = function (event) {
|
35362 | var index = getIndex(event),
|
35363 | noIndex = isUndefined(index);
|
35364 | (isMouse || noIndex) && ($$.hideTooltip(), focusOnly ? $$.hideCircleFocus() : $$.unexpandCircles(), isMouse ? $$.setOverOut(!1, index) : noIndex && $$.callOverOutForTouch());
|
35365 | };
|
35366 |
|
35367 | radar.axes.selectAll("text").on(isMouse ? "mouseover " : "touchstart", function (event) {
|
35368 | if (!transiting) // skip while transiting
|
35369 | {
|
35370 | state.event = event;
|
35371 | var index = getIndex(event);
|
35372 | $$.selectRectForSingle(svg.node(), null, index), isMouse ? $$.setOverOut(!0, index) : $$.callOverOutForTouch(index);
|
35373 | }
|
35374 | }).on("mouseout", isMouse ? hide : null), isMouse || svg.on("touchstart", hide);
|
35375 | }
|
35376 | },
|
35377 | updateRadarShape: function updateRadarShape(durationForExit) {
|
35378 | var $$ = this,
|
35379 | targets = $$.data.targets.filter(function (d) {
|
35380 | return $$.isRadarType(d);
|
35381 | }),
|
35382 | points = $$.cache.get(cacheKey),
|
35383 | areas = $$.$el.radar.shapes.selectAll("polygon").data(targets),
|
35384 | areasEnter = areas.enter().append("g").attr("class", $$.getChartClass("Radar"));
|
35385 | areas.exit().transition().duration(durationForExit).remove(), areasEnter.append("polygon").merge(areas).style("fill", $$.color).style("stroke", $$.color).attr("points", function (d) {
|
35386 | return points[d.id].join(" ");
|
35387 | }), $$.updateTargetForCircle(targets, areasEnter);
|
35388 | },
|
35389 |
|
35390 | /**
|
35391 | * Get data point x coordinate
|
35392 | * @param {object} d Data object
|
35393 | * @returns {number}
|
35394 | * @private
|
35395 | */
|
35396 | radarCircleX: function radarCircleX(d) {
|
35397 | return this.cache.get(cacheKey)[d.id][d.index][0];
|
35398 | },
|
35399 |
|
35400 | /**
|
35401 | * Get data point y coordinate
|
35402 | * @param {object} d Data object
|
35403 | * @returns {number}
|
35404 | * @private
|
35405 | */
|
35406 | radarCircleY: function radarCircleY(d) {
|
35407 | return this.cache.get(cacheKey)[d.id][d.index][1];
|
35408 | }
|
35409 | });
|
35410 | ;// CONCATENATED MODULE: ./src/config/Options/common/point.ts
|
35411 | /**
|
35412 | * Copyright (c) 2017 ~ present NAVER Corp.
|
35413 | * billboard.js project is licensed under the MIT license
|
35414 | */
|
35415 |
|
35416 | /**
|
35417 | * point config options
|
35418 | */
|
35419 | /* harmony default export */ var common_point = ({
|
35420 | /**
|
35421 | * Set point options
|
35422 | * @name point
|
35423 | * @memberof Options
|
35424 | * @type {object}
|
35425 | * @property {object} point Point object
|
35426 | * @property {boolean} [point.show=true] Whether to show each point in line.
|
35427 | * @property {number|Function} [point.r=2.5] The radius size of each point.
|
35428 | * - **NOTE:** Disabled for 'bubble' type
|
35429 | * @property {boolean} [point.focus.expand.enabled=true] Whether to expand each point on focus.
|
35430 | * @property {number} [point.focus.expand.r=point.r*1.75] The radius size of each point on focus.
|
35431 | * - **NOTE:** For 'bubble' type, the default is `bubbleSize*1.15`
|
35432 | * @property {boolean} [point.focus.only=false] Show point only when is focused.
|
35433 | * @property {number|null} [point.opacity=undefined] Set point opacity value.
|
35434 | * - **NOTE:**
|
35435 | * - `null` will make to not set inline 'opacity' css prop.
|
35436 | * - when no value(or undefined) is set, it defaults to set opacity value according its chart types.
|
35437 | * @property {number} [point.sensitivity=10] The senstivity value for interaction boundary.
|
35438 | * @property {number} [point.select.r=point.r*4] The radius size of each point on selected.
|
35439 | * @property {string} [point.type="circle"] The type of point to be drawn
|
35440 | * - **NOTE:**
|
35441 | * - If chart has 'bubble' type, only circle can be used.
|
35442 | * - For IE, non circle point expansions are not supported due to lack of transform support.
|
35443 | * - **Available Values:**
|
35444 | * - circle
|
35445 | * - rectangle
|
35446 | * @property {Array} [point.pattern=[]] The type of point or svg shape as string, to be drawn for each line
|
35447 | * - **NOTE:**
|
35448 | * - This is an `experimental` feature and can have some unexpected behaviors.
|
35449 | * - If chart has 'bubble' type, only circle can be used.
|
35450 | * - For IE, non circle point expansions are not supported due to lack of transform support.
|
35451 | * - **Available Values:**
|
35452 | * - circle
|
35453 | * - rectangle
|
35454 | * - svg shape tag interpreted as string<br>
|
35455 | * (ex. `<polygon points='2.5 0 0 5 5 5'></polygon>`)
|
35456 | * @see [Demo: point type](https://naver.github.io/billboard.js/demo/#Point.RectanglePoints)
|
35457 | * @see [Demo: point focus only](https://naver.github.io/billboard.js/demo/#Point.FocusOnly)
|
35458 | * @example
|
35459 | * point: {
|
35460 | * show: false,
|
35461 | * r: 5,
|
35462 | *
|
35463 | * // or customize the radius
|
35464 | * r: function(d) {
|
35465 | * ...
|
35466 | * return r;
|
35467 | * },
|
35468 | *
|
35469 | * focus: {
|
35470 | * expand: {
|
35471 | * enabled: true,
|
35472 | * r: 1
|
35473 | * },
|
35474 | * only: true
|
35475 | * },
|
35476 | *
|
35477 | * // do not set inline 'opacity' css prop setting
|
35478 | * opacity: null,
|
35479 | *
|
35480 | * // set every data point's opacity value
|
35481 | * opacity: 0.7,
|
35482 | *
|
35483 | * select: {
|
35484 | * r: 3
|
35485 | * },
|
35486 | *
|
35487 | * // having lower value, means how closer to be for interaction
|
35488 | * sensitivity: 3,
|
35489 | *
|
35490 | * // valid values are "circle" or "rectangle"
|
35491 | * type: "rectangle",
|
35492 | *
|
35493 | * // or indicate as pattern
|
35494 | * pattern: [
|
35495 | * "circle",
|
35496 | * "rectangle",
|
35497 | * "<polygon points='0 6 4 0 -4 0'></polygon>"
|
35498 | * ],
|
35499 | * }
|
35500 | */
|
35501 | point_show: !0,
|
35502 | point_r: 2.5,
|
35503 | point_sensitivity: 10,
|
35504 | point_focus_expand_enabled: !0,
|
35505 | point_focus_expand_r: undefined,
|
35506 | point_focus_only: !1,
|
35507 | point_opacity: undefined,
|
35508 | point_pattern: [],
|
35509 | point_select_r: undefined,
|
35510 | point_type: "circle"
|
35511 | });
|
35512 | ;// CONCATENATED MODULE: ./src/config/Options/shape/area.ts
|
35513 | /**
|
35514 | * Copyright (c) 2017 ~ present NAVER Corp.
|
35515 | * billboard.js project is licensed under the MIT license
|
35516 | */
|
35517 |
|
35518 | /**
|
35519 | * area config options
|
35520 | */
|
35521 | /* harmony default export */ var Options_shape_area = ({
|
35522 | /**
|
35523 | * Set area options
|
35524 | * @name area
|
35525 | * @memberof Options
|
35526 | * @type {object}
|
35527 | * @property {object} area Area object
|
35528 | * @property {boolean} [area.above=false] Set background area above the data chart line.
|
35529 | * @property {boolean} [area.front=true] Set area node to be positioned over line node.
|
35530 | * @property {boolean|object} [area.linearGradient=false] Set the linear gradient on area.<br><br>
|
35531 | * Or customize by giving below object value:
|
35532 | * - x {Array}: `x1`, `x2` value
|
35533 | * - y {Array}: `y1`, `y2` value
|
35534 | * - stops {Array}: Each item should be having `[offset, stop-color, stop-opacity]` values.
|
35535 | * @property {boolean} [area.zerobased=true] Set if min or max value will be 0 on area chart.
|
35536 | * @see [MDN's <linearGradient>](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/linearGradient), [<stop>](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/stop)
|
35537 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Chart.AreaChart)
|
35538 | * @see [Demo: above](https://naver.github.io/billboard.js/demo/#AreaChartOptions.Above)
|
35539 | * @see [Demo: linearGradient](https://naver.github.io/billboard.js/demo/#AreaChartOptions.LinearGradient)
|
35540 | * @example
|
35541 | * area: {
|
35542 | * above: true,
|
35543 | * zerobased: false,
|
35544 | *
|
35545 | * // <g class='bb-areas'> will be positioned behind the line <g class='bb-lines'> in stacking order
|
35546 | * front: false,
|
35547 | *
|
35548 | * // will generate follwing linearGradient:
|
35549 | * // <linearGradient x1="0" x2="0" y1="0" y2="1">
|
35550 | * // <stop offset="0" stop-color="$DATA_COLOR" stop-opacity="1"></stop>
|
35551 | * // <stop offset="1" stop-color="$DATA_COLOR" stop-opacity="0"></stop>
|
35552 | * // </linearGradient>
|
35553 | * linearGradient: true,
|
35554 | *
|
35555 | * // Or customized gradient
|
35556 | * linearGradient: {
|
35557 | * x: [0, 0], // x1, x2 attributes
|
35558 | * y: [0, 0], // y1, y2 attributes
|
35559 | * stops: [
|
35560 | * // offset, stop-color, stop-opacity
|
35561 | * [0, "#7cb5ec", 1],
|
35562 | *
|
35563 | * // setting 'null' for stop-color, will set its original data color
|
35564 | * [0.5, null, 0],
|
35565 | *
|
35566 | * // setting 'function' for stop-color, will pass data id as argument.
|
35567 | * // It should return color string or null value
|
35568 | * [1, function(id) { return id === "data1" ? "red" : "blue"; }, 0],
|
35569 | * ]
|
35570 | * }
|
35571 | * }
|
35572 | */
|
35573 | area_above: !1,
|
35574 | area_front: !0,
|
35575 | area_linearGradient: !1,
|
35576 | area_zerobased: !0
|
35577 | });
|
35578 | ;// CONCATENATED MODULE: ./src/config/Options/shape/bar.ts
|
35579 | /**
|
35580 | * Copyright (c) 2017 ~ present NAVER Corp.
|
35581 | * billboard.js project is licensed under the MIT license
|
35582 | */
|
35583 |
|
35584 | /**
|
35585 | * bar config options
|
35586 | */
|
35587 | /* harmony default export */ var shape_bar = ({
|
35588 | /**
|
35589 | * Set bar options
|
35590 | * @name bar
|
35591 | * @memberof Options
|
35592 | * @type {object}
|
35593 | * @property {object} bar Bar object
|
35594 | * @property {number} [bar.label.threshold=0] Set threshold ratio to show/hide labels.
|
35595 | * @property {number} [bar.padding=0] The padding pixel value between each bar.
|
35596 | * @property {number} [bar.radius] Set the radius of bar edge in pixel.
|
35597 | * - **NOTE:** Works only for non-stacked bar
|
35598 | * @property {number} [bar.radius.ratio] Set the radius ratio of bar edge in relative the bar's width.
|
35599 | * @property {number} [bar.sensitivity=2] The senstivity offset value for interaction boundary.
|
35600 | * @property {number} [bar.width] Change the width of bar chart.
|
35601 | * @property {number} [bar.width.ratio=0.6] Change the width of bar chart by ratio.
|
35602 | * @property {number} [bar.width.max] The maximum width value for ratio.
|
35603 | * @property {number} [bar.width.dataname] Change the width of bar for indicated dataset only.
|
35604 | * - **NOTE:**
|
35605 | * - Works only for non-stacked bar
|
35606 | * - Bars are centered accoding its total width value
|
35607 | * @property {number} [bar.width.dataname.ratio=0.6] Change the width of bar chart by ratio.
|
35608 | * @property {number} [bar.width.dataname.max] The maximum width value for ratio.
|
35609 | * @property {boolean} [bar.zerobased=true] Set if min or max value will be 0 on bar chart.
|
35610 | * @see [Demo: bar padding](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarPadding)
|
35611 | * @see [Demo: bar radius](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarRadius)
|
35612 | * @see [Demo: bar width](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarWidth)
|
35613 | * @see [Demo: bar width variant](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarWidthVariant)
|
35614 | * @example
|
35615 | * bar: {
|
35616 | * padding: 1,
|
35617 | *
|
35618 | * // the 'radius' option can be used only for non-stacking bars
|
35619 | * radius: 10,
|
35620 | * // or
|
35621 | * radius: {
|
35622 | * ratio: 0.5
|
35623 | * }
|
35624 | *
|
35625 | * label: {
|
35626 | * // 0.1(10%) ratio value means, the minimum ratio to show text label relative to the y Axis domain range value.
|
35627 | * // if data value is below than 0.1, text label will be hidden.
|
35628 | * threshold: 0.1,
|
35629 | * },
|
35630 | *
|
35631 | * // will not have offset between each bar elements for interaction
|
35632 | * sensitivity: 0,
|
35633 | *
|
35634 | * width: 10,
|
35635 | *
|
35636 | * // or
|
35637 | * width: {
|
35638 | * ratio: 0.2,
|
35639 | * max: 20
|
35640 | * },
|
35641 | *
|
35642 | * // or specify width per dataset
|
35643 | * width: {
|
35644 | * data1: 20,
|
35645 | * data2: {
|
35646 | * ratio: 0.2,
|
35647 | * max: 20
|
35648 | * }
|
35649 | * },
|
35650 | *
|
35651 | * zerobased: false
|
35652 | * }
|
35653 | */
|
35654 | bar_label_threshold: 0,
|
35655 | bar_padding: 0,
|
35656 | bar_radius: undefined,
|
35657 | bar_radius_ratio: undefined,
|
35658 | bar_sensitivity: 2,
|
35659 | bar_width: undefined,
|
35660 | bar_width_ratio: .6,
|
35661 | bar_width_max: undefined,
|
35662 | bar_zerobased: !0
|
35663 | });
|
35664 | ;// CONCATENATED MODULE: ./src/config/Options/shape/bubble.ts
|
35665 | /**
|
35666 | * Copyright (c) 2017 ~ present NAVER Corp.
|
35667 | * billboard.js project is licensed under the MIT license
|
35668 | */
|
35669 |
|
35670 | /**
|
35671 | * bubble config options
|
35672 | */
|
35673 | /* harmony default export */ var shape_bubble = ({
|
35674 | /**
|
35675 | * Set bubble options
|
35676 | * @name bubble
|
35677 | * @memberof Options
|
35678 | * @type {object}
|
35679 | * @property {object} bubble bubble object
|
35680 | * @property {number|Function} [bubble.maxR=35] Set the max bubble radius value
|
35681 | * @property {boolean} [bubble.zerobased=false] Set if min or max value will be 0 on bubble chart.
|
35682 | * @example
|
35683 | * bubble: {
|
35684 | * // ex) If 100 is the highest value among data bound, the representation bubble of 100 will have radius of 50.
|
35685 | * // And the lesser will have radius relatively from tha max value.
|
35686 | * maxR: 50,
|
35687 | *
|
35688 | * // or set radius callback
|
35689 | * maxR: function(d) {
|
35690 | * // ex. of d param - {x: Fri Oct 06 2017 00:00:00 GMT+0900, value: 80, id: "data2", index: 5}
|
35691 | * ...
|
35692 | * return Math.sqrt(d.value * 2);
|
35693 | * },
|
35694 | * zerobased: false
|
35695 | * }
|
35696 | */
|
35697 | bubble_maxR: 35,
|
35698 | bubble_zerobased: !1
|
35699 | });
|
35700 | ;// CONCATENATED MODULE: ./src/config/Options/shape/candlestick.ts
|
35701 | /**
|
35702 | * Copyright (c) 2017 ~ present NAVER Corp.
|
35703 | * billboard.js project is licensed under the MIT license
|
35704 | */
|
35705 |
|
35706 | /**
|
35707 | * candlestick config options
|
35708 | */
|
35709 | /* harmony default export */ var shape_candlestick = ({
|
35710 | /**
|
35711 | * Set candlestick options
|
35712 | * @name candlestick
|
35713 | * @memberof Options
|
35714 | * @type {object}
|
35715 | * @property {object} candlestick Candlestick object
|
35716 | * @property {number} [candlestick.width] Change the width.
|
35717 | * @property {number} [candlestick.width.ratio=0.6] Change the width by ratio.
|
35718 | * @property {number} [candlestick.width.max] The maximum width value for ratio.
|
35719 | * @property {number} [candlestick.width.dataname] Change the width for indicated dataset only.
|
35720 | * @property {number} [candlestick.width.dataname.ratio=0.6] Change the width of bar chart by ratio.
|
35721 | * @property {number} [candlestick.width.dataname.max] The maximum width value for ratio.
|
35722 | * @property {object} [candlestick.color] Color setting.
|
35723 | * @property {string|object} [candlestick.color.down] Change down(bearish) value color.
|
35724 | * @property {string} [candlestick.color.down.dataname] Change down value color for indicated dataset only.
|
35725 | *
|
35726 | * @see [Demo](https://naver.github.io/billboard.js/demo/##Chart.CandlestickChart)
|
35727 | * @example
|
35728 | * candlestick: {
|
35729 | * width: 10,
|
35730 | *
|
35731 | * // or
|
35732 | * width: {
|
35733 | * ratio: 0.2,
|
35734 | * max: 20
|
35735 | * },
|
35736 | *
|
35737 | * // or specify width per dataset
|
35738 | * width: {
|
35739 | * data1: 20,
|
35740 | * data2: {
|
35741 | * ratio: 0.2,
|
35742 | * max: 20
|
35743 | * }
|
35744 | * },
|
35745 | * color: {
|
35746 | * // spcify bearish color
|
35747 | * down: "red",
|
35748 | *
|
35749 | * // or specify color per dataset
|
35750 | * down: {
|
35751 | * data1: "red",
|
35752 | * data2: "blue",
|
35753 | * }
|
35754 | * }
|
35755 | * }
|
35756 | */
|
35757 | candlestick_width: undefined,
|
35758 | candlestick_width_ratio: .6,
|
35759 | candlestick_width_max: undefined,
|
35760 | candlestick_color_down: "red"
|
35761 | });
|
35762 | ;// CONCATENATED MODULE: ./src/config/Options/shape/line.ts
|
35763 | /**
|
35764 | * Copyright (c) 2017 ~ present NAVER Corp.
|
35765 | * billboard.js project is licensed under the MIT license
|
35766 | */
|
35767 |
|
35768 | /**
|
35769 | * line config options
|
35770 | */
|
35771 | /* harmony default export */ var shape_line = ({
|
35772 | /**
|
35773 | * Set line options
|
35774 | * @name line
|
35775 | * @memberof Options
|
35776 | * @type {object}
|
35777 | * @property {object} line Line object
|
35778 | * @property {boolean} [line.connectNull=false] Set if null data point will be connected or not.<br>
|
35779 | * If true set, the region of null data will be connected without any data point. If false set, the region of null data will not be connected and get empty.
|
35780 | * @property {Array} [line.classes=undefined] If set, used to set a css class on each line.
|
35781 | * @property {boolean} [line.step.type=step] Change step type for step chart.<br>
|
35782 | * **Available values:**
|
35783 | * - step
|
35784 | * - step-before
|
35785 | * - step-after
|
35786 | * @property {boolean|Array} [line.point=true] Set to false to not draw points on linecharts. Or pass an array of line ids to draw points for.
|
35787 | * @property {boolean} [line.zerobased=false] Set if min or max value will be 0 on line chart.
|
35788 | * @example
|
35789 | * line: {
|
35790 | * connectNull: true,
|
35791 | * classes: [
|
35792 | * "line-class1",
|
35793 | * "line-class2"
|
35794 | * ],
|
35795 | * step: {
|
35796 | * type: "step-after"
|
35797 | * },
|
35798 | *
|
35799 | * // hide all data points ('point.show=false' also has similar effect)
|
35800 | * point: false,
|
35801 | *
|
35802 | * // show data points for only indicated datas
|
35803 | * point: [
|
35804 | * "data1", "data3"
|
35805 | * ],
|
35806 | *
|
35807 | * zerobased: false
|
35808 | * }
|
35809 | */
|
35810 | line_connectNull: !1,
|
35811 | line_step_type: "step",
|
35812 | line_zerobased: !1,
|
35813 | line_classes: undefined,
|
35814 | line_point: !0
|
35815 | });
|
35816 | ;// CONCATENATED MODULE: ./src/config/Options/shape/scatter.ts
|
35817 | /**
|
35818 | * Copyright (c) 2017 ~ present NAVER Corp.
|
35819 | * billboard.js project is licensed under the MIT license
|
35820 | */
|
35821 |
|
35822 | /**
|
35823 | * scatter config options
|
35824 | */
|
35825 | /* harmony default export */ var scatter = ({
|
35826 | /**
|
35827 | * Set scatter options
|
35828 | * @name scatter
|
35829 | * @memberof Options
|
35830 | * @type {object}
|
35831 | * @property {object} [scatter] scatter object
|
35832 | * @property {boolean} [scatter.zerobased=false] Set if min or max value will be 0 on scatter chart.
|
35833 | * @example
|
35834 | * scatter: {
|
35835 | * connectNull: true,
|
35836 | * step: {
|
35837 | * type: "step-after"
|
35838 | * },
|
35839 | *
|
35840 | * // hide all data points ('point.show=false' also has similar effect)
|
35841 | * point: false,
|
35842 | *
|
35843 | * // show data points for only indicated datas
|
35844 | * point: [
|
35845 | * "data1", "data3"
|
35846 | * ],
|
35847 | *
|
35848 | * zerobased: false
|
35849 | * }
|
35850 | */
|
35851 | scatter_zerobased: !1
|
35852 | });
|
35853 | ;// CONCATENATED MODULE: ./src/config/Options/shape/spline.ts
|
35854 | /**
|
35855 | * Copyright (c) 2017 ~ present NAVER Corp.
|
35856 | * billboard.js project is licensed under the MIT license
|
35857 | */
|
35858 |
|
35859 | /**
|
35860 | * x Axis config options
|
35861 | */
|
35862 | /* harmony default export */ var spline = ({
|
35863 | /**
|
35864 | * Set spline options
|
35865 | * - **Available interpolation type values:**
|
35866 | * - basis (d3.curveBasis)
|
35867 | * - basis-closed (d3.curveBasisClosed)
|
35868 | * - basis-open (d3.curveBasisOpen)
|
35869 | * - bundle (d3.curveBundle)
|
35870 | * - cardinal (d3.curveCardinal)
|
35871 | * - cardinal-closed (d3.curveCardinalClosed)
|
35872 | * - cardinal-open (d3.curveCardinalOpen)
|
35873 | * - catmull-rom (d3.curveCatmullRom)
|
35874 | * - catmull-rom-closed (d3.curveCatmullRomClosed)
|
35875 | * - catmull-rom-open (d3.curveCatmullRomOpen)
|
35876 | * - monotone-x (d3.curveMonotoneX)
|
35877 | * - monotone-y (d3.curveMonotoneY)
|
35878 | * - natural (d3.curveNatural)
|
35879 | * - linear-closed (d3.curveLinearClosed)
|
35880 | * - linear (d3.curveLinear)
|
35881 | * - step (d3.curveStep)
|
35882 | * - step-after (d3.curveStepAfter)
|
35883 | * - step-before (d3.curveStepBefore)
|
35884 | * @name spline
|
35885 | * @memberof Options
|
35886 | * @type {object}
|
35887 | * @property {object} spline Spline object
|
35888 | * @property {object} spline.interpolation Spline interpolation object
|
35889 | * @property {string} [spline.interpolation.type="cardinal"] Interpolation type
|
35890 | * @see [Interpolation (d3 v4)](http://bl.ocks.org/emmasaunders/c25a147970def2b02d8c7c2719dc7502)
|
35891 | * @example
|
35892 | * spline: {
|
35893 | * interpolation: {
|
35894 | * type: "cardinal"
|
35895 | * }
|
35896 | * }
|
35897 | */
|
35898 | spline_interpolation_type: "cardinal"
|
35899 | });
|
35900 | ;// CONCATENATED MODULE: ./src/config/Options/shape/donut.ts
|
35901 | /**
|
35902 | * Copyright (c) 2017 ~ present NAVER Corp.
|
35903 | * billboard.js project is licensed under the MIT license
|
35904 | */
|
35905 |
|
35906 | /**
|
35907 | * donut config options
|
35908 | */
|
35909 | /* harmony default export */ var donut = ({
|
35910 | /**
|
35911 | * Set donut options
|
35912 | * @name donut
|
35913 | * @memberof Options
|
35914 | * @type {object}
|
35915 | * @property {object} donut Donut object
|
35916 | * @property {boolean} [donut.label.show=true] Show or hide label on each donut piece.
|
35917 | * @property {Function} [donut.label.format] Set formatter for the label on each donut piece.
|
35918 | * @property {number} [donut.label.threshold=0.05] Set threshold ratio to show/hide labels.
|
35919 | * @property {number|Function} [donut.label.ratio=undefined] Set ratio of labels position.
|
35920 | * @property {boolean} [donut.expand=true] Enable or disable expanding donut pieces.
|
35921 | * @property {number} [donut.expand.rate=0.98] Set expand rate.
|
35922 | * @property {number} [donut.expand.duration=50] Set expand transition time in ms.
|
35923 | * @property {number} [donut.width] Set width of donut chart.
|
35924 | * @property {string} [donut.title=""] Set title of donut chart. Use `\n` character for line break.
|
35925 | * @property {number} [donut.padAngle=0] Set padding between data.
|
35926 | * @property {number} [donut.startingAngle=0] Set starting angle where data draws.
|
35927 | * @example
|
35928 | * donut: {
|
35929 | * label: {
|
35930 | * show: false,
|
35931 | * format: function(value, ratio, id) {
|
35932 | * return d3.format("$")(value);
|
35933 | *
|
35934 | * // to multiline, return with '\n' character
|
35935 | * // return value +"%\nLine1\n2Line2";
|
35936 | * },
|
35937 | *
|
35938 | * // 0.1(10%) ratio value means, the minimum ratio to show text label relative to the total value.
|
35939 | * // if data value is below than 0.1, text label will be hidden.
|
35940 | * threshold: 0.1,
|
35941 | *
|
35942 | * // set ratio callback. Should return ratio value
|
35943 | * ratio: function(d, radius, h) {
|
35944 | * ...
|
35945 | * return ratio;
|
35946 | * },
|
35947 | * // or set ratio number
|
35948 | * ratio: 0.5
|
35949 | * },
|
35950 | *
|
35951 | * // disable expand transition for interaction
|
35952 | * expand: false,
|
35953 | *
|
35954 | * expand: {
|
35955 | * // set duration of expand transition to 500ms.
|
35956 | * duration: 500,
|
35957 | *
|
35958 | * // set expand area rate
|
35959 | * rate: 1
|
35960 | * },
|
35961 | *
|
35962 | * width: 10,
|
35963 | * padAngle: 0.2,
|
35964 | * startingAngle: 1,
|
35965 | * title: "Donut Title"
|
35966 | *
|
35967 | * // title with line break
|
35968 | * title: "Title1\nTitle2"
|
35969 | * }
|
35970 | */
|
35971 | donut_label_show: !0,
|
35972 | donut_label_format: undefined,
|
35973 | donut_label_threshold: .05,
|
35974 | donut_label_ratio: undefined,
|
35975 | donut_width: undefined,
|
35976 | donut_title: "",
|
35977 | donut_expand: {},
|
35978 | donut_expand_rate: .98,
|
35979 | donut_expand_duration: 50,
|
35980 | donut_padAngle: 0,
|
35981 | donut_startingAngle: 0
|
35982 | });
|
35983 | ;// CONCATENATED MODULE: ./src/config/Options/shape/gauge.ts
|
35984 | /**
|
35985 | * Copyright (c) 2017 ~ present NAVER Corp.
|
35986 | * billboard.js project is licensed under the MIT license
|
35987 | */
|
35988 |
|
35989 | /**
|
35990 | * gauge config options
|
35991 | */
|
35992 | /* harmony default export */ var shape_gauge = ({
|
35993 | /**
|
35994 | * Set gauge options
|
35995 | * @name gauge
|
35996 | * @memberof Options
|
35997 | * @type {object}
|
35998 | * @property {object} gauge Gauge object
|
35999 | * @property {boolean} [gauge.background=""] Set background color. (The `.bb-chart-arcs-background` element)
|
36000 | * @property {boolean} [gauge.fullCircle=false] Show full circle as donut. When set to 'true', the max label will not be showed due to start and end points are same location.
|
36001 | * @property {boolean} [gauge.label.show=true] Show or hide label on gauge.
|
36002 | * @property {Function} [gauge.label.format] Set formatter for the label on gauge. Label text can be multilined with `\n` character.
|
36003 | * @property {Function} [gauge.label.extents] Set customized min/max label text.
|
36004 | * @property {number} [gauge.label.threshold=0] Set threshold ratio to show/hide labels.
|
36005 | * @property {boolean} [gauge.expand=true] Enable or disable expanding gauge.
|
36006 | * @property {number} [gauge.expand.rate=0.98] Set expand rate.
|
36007 | * @property {number} [gauge.expand.duration=50] Set the expand transition time in milliseconds.
|
36008 | * @property {number} [gauge.min=0] Set min value of the gauge.
|
36009 | * @property {number} [gauge.max=100] Set max value of the gauge.
|
36010 | * @property {number} [gauge.startingAngle=-1 * Math.PI / 2] Set starting angle where data draws.
|
36011 | *
|
36012 | * **Limitations:**
|
36013 | * - when `gauge.fullCircle=false`:
|
36014 | * - -1 * Math.PI / 2 <= startingAngle <= Math.PI / 2
|
36015 | * - `startingAngle <= -1 * Math.PI / 2` defaults to `-1 * Math.PI / 2`
|
36016 | * - `startingAngle >= Math.PI / 2` defaults to `Math.PI / 2`
|
36017 | * - when `gauge.fullCircle=true`:
|
36018 | * - -1 * Math.PI < startingAngle < Math.PI
|
36019 | * - `startingAngle < -1 * Math.PI` defaults to `Math.PI`
|
36020 | * - `startingAngle > Math.PI` defaults to `Math.PI`
|
36021 | * @property {number} [gauge.arcLength=100] Set the length of the arc to be drawn in percent from -100 to 100.<br>
|
36022 | * Negative value will draw the arc **counterclockwise**.
|
36023 | *
|
36024 | * **Limitations:**
|
36025 | * - -100 <= arcLength (in percent) <= 100
|
36026 | * - 'arcLength < -100' defaults to -100
|
36027 | * - 'arcLength > 100' defaults to 100
|
36028 | * @property {string} [gauge.title=""] Set title of gauge chart. Use `\n` character for line break.
|
36029 | * @property {string} [gauge.units] Set units of the gauge.
|
36030 | * @property {number} [gauge.width] Set width of gauge chart.
|
36031 | * @property {string} [gauge.type="single"] Set type of gauge to be displayed.<br><br>
|
36032 | * **Available Values:**
|
36033 | * - single
|
36034 | * - multi
|
36035 | * @property {string} [gauge.arcs.minWidth=5] Set minimal width of gauge arcs until the innerRadius disappears.
|
36036 | * @see [Demo: archLength](https://naver.github.io/billboard.js/demo/#GaugeChartOptions.GaugeArcLength)
|
36037 | * @see [Demo: startingAngle](https://naver.github.io/billboard.js/demo/#GaugeChartOptions.GaugeStartingAngle)
|
36038 | * @example
|
36039 | * gauge: {
|
36040 | * background: "#eee", // will set 'fill' css prop for '.bb-chart-arcs-background' classed element.
|
36041 | * fullCircle: false,
|
36042 | * label: {
|
36043 | * show: false,
|
36044 | * format: function(value, ratio) {
|
36045 | * return value;
|
36046 | *
|
36047 | * // to multiline, return with '\n' character
|
36048 | * // return value +"%\nLine1\n2Line2";
|
36049 | * },
|
36050 | *
|
36051 | * extents: function(value, isMax) {
|
36052 | * return (isMax ? "Max:" : "Min:") + value;
|
36053 | * },
|
36054 | *
|
36055 | * // 0.1(10%) ratio value means, the minimum ratio to show text label relative to the total value.
|
36056 | * // if data value is below than 0.1, text label will be hidden.
|
36057 | * threshold: 0.1,
|
36058 | * },
|
36059 | *
|
36060 | * // disable expand transition for interaction
|
36061 | * expand: false,
|
36062 | *
|
36063 | * expand: {
|
36064 | * // set duration of expand transition to 500ms.
|
36065 | * duration: 500,
|
36066 | *
|
36067 | * // set expand area rate
|
36068 | * rate: 1
|
36069 | * },
|
36070 | *
|
36071 | * min: -100,
|
36072 | * max: 200,
|
36073 | * type: "single" // or 'multi'
|
36074 | * title: "Title Text",
|
36075 | * units: "%",
|
36076 | * width: 10,
|
36077 | * startingAngle: -1 * Math.PI / 2,
|
36078 | * arcLength: 100,
|
36079 | * arcs: {
|
36080 | * minWidth: 5
|
36081 | * }
|
36082 | * }
|
36083 | */
|
36084 | gauge_background: "",
|
36085 | gauge_fullCircle: !1,
|
36086 | gauge_label_show: !0,
|
36087 | gauge_label_format: undefined,
|
36088 | gauge_label_extents: undefined,
|
36089 | gauge_label_threshold: 0,
|
36090 | gauge_min: 0,
|
36091 | gauge_max: 100,
|
36092 | gauge_type: "single",
|
36093 | gauge_startingAngle: -1 * Math.PI / 2,
|
36094 | gauge_arcLength: 100,
|
36095 | gauge_title: "",
|
36096 | gauge_units: undefined,
|
36097 | gauge_width: undefined,
|
36098 | gauge_arcs_minWidth: 5,
|
36099 | gauge_expand: {},
|
36100 | gauge_expand_rate: .98,
|
36101 | gauge_expand_duration: 50
|
36102 | });
|
36103 | ;// CONCATENATED MODULE: ./src/config/Options/shape/pie.ts
|
36104 | /**
|
36105 | * Copyright (c) 2017 ~ present NAVER Corp.
|
36106 | * billboard.js project is licensed under the MIT license
|
36107 | */
|
36108 |
|
36109 | /**
|
36110 | * x Axis config options
|
36111 | */
|
36112 | /* harmony default export */ var shape_pie = ({
|
36113 | /**
|
36114 | * Set pie options
|
36115 | * @name pie
|
36116 | * @memberof Options
|
36117 | * @type {object}
|
36118 | * @property {object} pie Pie object
|
36119 | * @property {boolean} [pie.label.show=true] Show or hide label on each pie piece.
|
36120 | * @property {Function} [pie.label.format] Set formatter for the label on each pie piece.
|
36121 | * @property {number} [pie.label.threshold=0.05] Set threshold ratio to show/hide labels.
|
36122 | * @property {number|Function} [pie.label.ratio=undefined] Set ratio of labels position.
|
36123 | * @property {boolean|object} [pie.expand=true] Enable or disable expanding pie pieces.
|
36124 | * @property {number} [pie.expand.rate=0.98] Set expand rate.
|
36125 | * @property {number} [pie.expand.duration=50] Set expand transition time in ms.
|
36126 | * @property {number|object} [pie.innerRadius=0] Sets the inner radius of pie arc.
|
36127 | * @property {number|object|undefined} [pie.outerRadius=undefined] Sets the outer radius of pie arc.
|
36128 | * @property {number} [pie.padAngle=0] Set padding between data.
|
36129 | * @property {number} [pie.padding=0] Sets the gap between pie arcs.
|
36130 | * @property {number} [pie.startingAngle=0] Set starting angle where data draws.
|
36131 | * @see [Demo: expand.rate](https://naver.github.io/billboard.js/demo/#PieChartOptions.ExpandRate)
|
36132 | * @see [Demo: innerRadius](https://naver.github.io/billboard.js/demo/#PieChartOptions.InnerRadius)
|
36133 | * @see [Demo: outerRadius](https://naver.github.io/billboard.js/demo/#PieChartOptions.OuterRadius)
|
36134 | * @see [Demo: startingAngle](https://naver.github.io/billboard.js/demo/#PieChartOptions.StartingAngle)
|
36135 | * @example
|
36136 | * pie: {
|
36137 | * label: {
|
36138 | * show: false,
|
36139 | * format: function(value, ratio, id) {
|
36140 | * return d3.format("$")(value);
|
36141 | *
|
36142 | * // to multiline, return with '\n' character
|
36143 | * // return value +"%\nLine1\n2Line2";
|
36144 | * },
|
36145 | *
|
36146 | * // 0.1(10%) ratio value means, the minimum ratio to show text label relative to the total value.
|
36147 | * // if data value is below than 0.1, text label will be hidden.
|
36148 | * threshold: 0.1,
|
36149 | *
|
36150 | * // set ratio callback. Should return ratio value
|
36151 | * ratio: function(d, radius, h) {
|
36152 | * ...
|
36153 | * return ratio;
|
36154 | * },
|
36155 | * // or set ratio number
|
36156 | * ratio: 0.5
|
36157 | * },
|
36158 | *
|
36159 | * // disable expand transition for interaction
|
36160 | * expand: false,
|
36161 | *
|
36162 | * expand: {
|
36163 | * // set duration of expand transition to 500ms.
|
36164 | * duration: 500,
|
36165 | *
|
36166 | * // set expand area rate
|
36167 | * rate: 1
|
36168 | * },
|
36169 | *
|
36170 | * innerRadius: 0,
|
36171 | *
|
36172 | * // set different innerRadius for each data
|
36173 | * innerRadius: {
|
36174 | * data1: 10,
|
36175 | * data2: 0
|
36176 | * },
|
36177 | *
|
36178 | * outerRadius: 100,
|
36179 | *
|
36180 | * // set different outerRadius for each data
|
36181 | * outerRadius: {
|
36182 | * data1: 50,
|
36183 | * data2: 100
|
36184 | * }
|
36185 | *
|
36186 | * padAngle: 0.1,
|
36187 | * padding: 0,
|
36188 | * startingAngle: 1
|
36189 | * }
|
36190 | */
|
36191 | pie_label_show: !0,
|
36192 | pie_label_format: undefined,
|
36193 | pie_label_threshold: .05,
|
36194 | pie_label_ratio: undefined,
|
36195 | pie_expand: {},
|
36196 | pie_expand_rate: .98,
|
36197 | pie_expand_duration: 50,
|
36198 | pie_innerRadius: 0,
|
36199 | pie_outerRadius: undefined,
|
36200 | pie_padAngle: 0,
|
36201 | pie_padding: 0,
|
36202 | pie_startingAngle: 0
|
36203 | });
|
36204 | ;// CONCATENATED MODULE: ./src/config/Options/shape/radar.ts
|
36205 | /**
|
36206 | * Copyright (c) 2017 ~ present NAVER Corp.
|
36207 | * billboard.js project is licensed under the MIT license
|
36208 | */
|
36209 |
|
36210 | /**
|
36211 | * x Axis config options
|
36212 | */
|
36213 | /* harmony default export */ var shape_radar = ({
|
36214 | /**
|
36215 | * Set radar options
|
36216 | * - **NOTE:**
|
36217 | * > When x tick text contains `\n`, it's used as line break.
|
36218 | * @name radar
|
36219 | * @memberof Options
|
36220 | * @type {object}
|
36221 | * @property {object} radar Radar object
|
36222 | * @property {number} [radar.axis.max=undefined] The max value of axis. If not given, it'll take the max value from the given data.
|
36223 | * @property {boolean} [radar.axis.line.show=true] Show or hide axis line.
|
36224 | * @property {number} [radar.axis.text.position.x=0] x coordinate position, relative the original.
|
36225 | * @property {number} [radar.axis.text.position.y=0] y coordinate position, relative the original.
|
36226 | * @property {boolean} [radar.axis.text.show=true] Show or hide axis text.
|
36227 | * @property {boolean} [radar.direction.clockwise=false] Set the direction to be drawn.
|
36228 | * @property {number} [radar.level.depth=3] Set the level depth.
|
36229 | * @property {boolean} [radar.level.show=true] Show or hide level.
|
36230 | * @property {Function} [radar.level.text.format] Set format function for the level value.<br>- Default value: `(x) => x % 1 === 0 ? x : x.toFixed(2)`
|
36231 | * @property {boolean} [radar.level.text.show=true] Show or hide level text.
|
36232 | * @property {number} [radar.size.ratio=0.87] Set size ratio.
|
36233 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Chart.RadarChart)
|
36234 | * @see [Demo: radar axis](https://naver.github.io/billboard.js/demo/#RadarChartOptions.RadarAxis)
|
36235 | * @see [Demo: radar level](https://naver.github.io/billboard.js/demo/#RadarChartOptions.RadarLevel)
|
36236 | * @see [Demo: radar size](https://naver.github.io/billboard.js/demo/#RadarChartOptions.RadarSize)
|
36237 | * @see [Demo: radar axis multiline](https://naver.github.io/billboard.js/demo/#RadarChartOptions.RadarAxisMultiline)
|
36238 | * @example
|
36239 | * radar: {
|
36240 | * axis: {
|
36241 | * max: 50,
|
36242 | * line: {
|
36243 | * show: false
|
36244 | * },
|
36245 | * text: {
|
36246 | * position: {
|
36247 | * x: 0,
|
36248 | * y: 0
|
36249 | * },
|
36250 | * show: false
|
36251 | * }
|
36252 | * },
|
36253 | * direction: {
|
36254 | * clockwise: true
|
36255 | * },
|
36256 | * level: {
|
36257 | * show: false,
|
36258 | * text: {
|
36259 | * format: function(x) {
|
36260 | * return x + "%";
|
36261 | * },
|
36262 | * show: true
|
36263 | * }
|
36264 | * },
|
36265 | * size: {
|
36266 | * ratio: 0.7
|
36267 | * }
|
36268 | * }
|
36269 | */
|
36270 | radar_axis_max: undefined,
|
36271 | radar_axis_line_show: !0,
|
36272 | radar_axis_text_show: !0,
|
36273 | radar_axis_text_position: {},
|
36274 | radar_level_depth: 3,
|
36275 | radar_level_show: !0,
|
36276 | radar_level_text_format: function radar_level_text_format(x) {
|
36277 | return x % 1 === 0 ? x : x.toFixed(2);
|
36278 | },
|
36279 | radar_level_text_show: !0,
|
36280 | radar_size_ratio: .87,
|
36281 | radar_direction_clockwise: !1
|
36282 | });
|
36283 | ;// CONCATENATED MODULE: ./src/config/resolver/shape.ts
|
36284 | /**
|
36285 | * Copyright (c) 2017 ~ present NAVER Corp.
|
36286 | * billboard.js project is licensed under the MIT license
|
36287 | */
|
36288 |
|
36289 |
|
36290 |
|
36291 |
|
36292 | // Axis
|
36293 |
|
36294 | // Shape
|
36295 |
|
36296 |
|
36297 |
|
36298 |
|
36299 |
|
36300 |
|
36301 |
|
36302 |
|
36303 |
|
36304 | // Options
|
36305 |
|
36306 |
|
36307 |
|
36308 |
|
36309 |
|
36310 |
|
36311 |
|
36312 |
|
36313 | // Non-Axis based
|
36314 |
|
36315 |
|
36316 |
|
36317 |
|
36318 |
|
36319 |
|
36320 | /**
|
36321 | * Extend Axis
|
36322 | * @param {Array} module Module to be extended
|
36323 | * @param {Array} option Option object to be extended
|
36324 | * @private
|
36325 | */
|
36326 |
|
36327 | function extendAxis(module, option) {
|
36328 | util_extend(ChartInternal.prototype, internal.concat(module)), util_extend(Chart.prototype, api), Options.setOptions(options.concat(option || []));
|
36329 | }
|
36330 | /**
|
36331 | * Extend Line type modules
|
36332 | * @param {object} module Module to be extended
|
36333 | * @param {Array} option Option object to be extended
|
36334 | * @private
|
36335 | */
|
36336 |
|
36337 |
|
36338 | function extendLine(module, option) {
|
36339 | extendAxis([point, line].concat(module || [])), Options.setOptions([common_point, shape_line].concat(option || []));
|
36340 | }
|
36341 | /**
|
36342 | * Extend Arc type modules
|
36343 | * @param {Array} module Module to be extended
|
36344 | * @param {Array} option Option object to be extended
|
36345 | * @private
|
36346 | */
|
36347 |
|
36348 |
|
36349 | function extendArc(module, option) {
|
36350 | util_extend(ChartInternal.prototype, [arc].concat(module || [])), Options.setOptions(option);
|
36351 | } // Area types
|
36352 |
|
36353 |
|
36354 | var _area = function area() {
|
36355 | return extendLine(shape_area, [Options_shape_area]), (_area = function area() {
|
36356 | return TYPE.AREA;
|
36357 | })();
|
36358 | },
|
36359 | areaLineRange = function () {
|
36360 | return extendLine(shape_area, [Options_shape_area]), (areaLineRange = function () {
|
36361 | return TYPE.AREA_LINE_RANGE;
|
36362 | })();
|
36363 | },
|
36364 | areaSpline = function () {
|
36365 | return extendLine(shape_area, [Options_shape_area, spline]), (areaSpline = function () {
|
36366 | return TYPE.AREA_SPLINE;
|
36367 | })();
|
36368 | },
|
36369 | areaSplineRange = function () {
|
36370 | return extendLine(shape_area, [Options_shape_area, spline]), (areaSplineRange = function () {
|
36371 | return TYPE.AREA_SPLINE_RANGE;
|
36372 | })();
|
36373 | },
|
36374 | areaStep = function () {
|
36375 | return extendLine(shape_area, [Options_shape_area]), (areaStep = function () {
|
36376 | return TYPE.AREA_STEP;
|
36377 | })();
|
36378 | },
|
36379 | resolver_shape_line = function () {
|
36380 | return extendLine(), (resolver_shape_line = function () {
|
36381 | return TYPE.LINE;
|
36382 | })();
|
36383 | },
|
36384 | shape_spline = function () {
|
36385 | return extendLine(undefined, [spline]), (shape_spline = function () {
|
36386 | return TYPE.SPLINE;
|
36387 | })();
|
36388 | },
|
36389 | shape_step = function () {
|
36390 | return extendLine(), (shape_step = function () {
|
36391 | return TYPE.STEP;
|
36392 | })();
|
36393 | },
|
36394 | shape_donut = function () {
|
36395 | return extendArc(undefined, [donut]), (shape_donut = function () {
|
36396 | return TYPE.DONUT;
|
36397 | })();
|
36398 | },
|
36399 | resolver_shape_gauge = function () {
|
36400 | return extendArc([gauge], [shape_gauge]), (resolver_shape_gauge = function () {
|
36401 | return TYPE.GAUGE;
|
36402 | })();
|
36403 | },
|
36404 | resolver_shape_pie = function () {
|
36405 | return extendArc(undefined, [shape_pie]), (resolver_shape_pie = function () {
|
36406 | return TYPE.PIE;
|
36407 | })();
|
36408 | },
|
36409 | resolver_shape_radar = function () {
|
36410 | return extendArc([point, radar], [common_point, shape_radar]), (resolver_shape_radar = function () {
|
36411 | return TYPE.RADAR;
|
36412 | })();
|
36413 | },
|
36414 | resolver_shape_bar = function () {
|
36415 | return extendAxis([bar], shape_bar), (resolver_shape_bar = function () {
|
36416 | return TYPE.BAR;
|
36417 | })();
|
36418 | },
|
36419 | resolver_shape_bubble = function () {
|
36420 | return extendAxis([point, bubble], [shape_bubble, common_point]), (resolver_shape_bubble = function () {
|
36421 | return TYPE.BUBBLE;
|
36422 | })();
|
36423 | },
|
36424 | resolver_shape_candlestick = function () {
|
36425 | return extendAxis([candlestick], [shape_candlestick]), (resolver_shape_candlestick = function () {
|
36426 | return TYPE.CANDLESTICK;
|
36427 | })();
|
36428 | },
|
36429 | shape_scatter = function () {
|
36430 | return extendAxis([point], [common_point, scatter]), (shape_scatter = function () {
|
36431 | return TYPE.SCATTER;
|
36432 | })();
|
36433 | };
|
36434 | ;// CONCATENATED MODULE: ./src/Chart/api/selection.ts
|
36435 | /**
|
36436 | * Copyright (c) 2017 ~ present NAVER Corp.
|
36437 | * billboard.js project is licensed under the MIT license
|
36438 | */
|
36439 |
|
36440 |
|
36441 |
|
36442 | /* harmony default export */ var api_selection = ({
|
36443 | /**
|
36444 | * Get selected data points.<br><br>
|
36445 | * By this API, you can get selected data points information. To use this API, data.selection.enabled needs to be set true.
|
36446 | * @function selected
|
36447 | * @instance
|
36448 | * @memberof Chart
|
36449 | * @param {string} [targetId] You can filter the result by giving target id that you want to get. If not given, all of data points will be returned.
|
36450 | * @returns {Array} dataPoint Array of the data points.<br>ex.) `[{x: 1, value: 200, id: "data1", index: 1, name: "data1"}, ...]`
|
36451 | * @example
|
36452 | * // all selected data points will be returned.
|
36453 | * chart.selected();
|
36454 | * // --> ex.) [{x: 1, value: 200, id: "data1", index: 1, name: "data1"}, ... ]
|
36455 | *
|
36456 | * // all selected data points of data1 will be returned.
|
36457 | * chart.selected("data1");
|
36458 | */
|
36459 | selected: function selected(targetId) {
|
36460 | var $$ = this.internal,
|
36461 | dataPoint = [];
|
36462 | return $$.$el.main.selectAll("." + (config_classes.shapes + $$.getTargetSelectorSuffix(targetId))).selectAll("." + config_classes.shape).filter(function () {
|
36463 | return src_select(this).classed(config_classes.SELECTED);
|
36464 | }).each(function (d) {
|
36465 | return dataPoint.push(d);
|
36466 | }), dataPoint;
|
36467 | },
|
36468 |
|
36469 | /**
|
36470 | * Set data points to be selected. ([`data.selection.enabled`](Options.html#.data%25E2%2580%25A4selection%25E2%2580%25A4enabled) option should be set true to use this method)
|
36471 | * @function select
|
36472 | * @instance
|
36473 | * @memberof Chart
|
36474 | * @param {string|Array} [ids] id value to get selected.
|
36475 | * @param {Array} [indices] The index array of data points. If falsy value given, will select all data points.
|
36476 | * @param {boolean} [resetOther] Unselect already selected.
|
36477 | * @example
|
36478 | * // select all data points
|
36479 | * chart.select();
|
36480 | *
|
36481 | * // select all from 'data2'
|
36482 | * chart.select("data2");
|
36483 | *
|
36484 | * // select all from 'data1' and 'data2'
|
36485 | * chart.select(["data1", "data2"]);
|
36486 | *
|
36487 | * // select from 'data1', indices 2 and unselect others selected
|
36488 | * chart.select("data1", [2], true);
|
36489 | *
|
36490 | * // select from 'data1', indices 0, 3 and 5
|
36491 | * chart.select("data1", [0, 3, 5]);
|
36492 | */
|
36493 | select: function select(ids, indices, resetOther) {
|
36494 | var $$ = this.internal,
|
36495 | config = $$.config,
|
36496 | $el = $$.$el;
|
36497 | config.data_selection_enabled && $el.main.selectAll("." + config_classes.shapes).selectAll("." + config_classes.shape).each(function (d, i) {
|
36498 | var shape = src_select(this),
|
36499 | id = d.data ? d.data.id : d.id,
|
36500 | toggle = $$.getToggle(this, d).bind($$),
|
36501 | isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0,
|
36502 | isTargetIndex = !indices || indices.indexOf(i) >= 0,
|
36503 | isSelected = shape.classed(config_classes.SELECTED);
|
36504 | // line/area selection not supported yet
|
36505 | shape.classed(config_classes.line) || shape.classed(config_classes.area) || (isTargetId && isTargetIndex ? config.data_selection_isselectable.bind($$.api)(d) && !isSelected && toggle(!0, shape.classed(config_classes.SELECTED, !0), d, i) : isDefined(resetOther) && resetOther && isSelected && toggle(!1, shape.classed(config_classes.SELECTED, !1), d, i));
|
36506 | });
|
36507 | },
|
36508 |
|
36509 | /**
|
36510 | * Set data points to be un-selected.
|
36511 | * @function unselect
|
36512 | * @instance
|
36513 | * @memberof Chart
|
36514 | * @param {string|Array} [ids] id value to be unselected.
|
36515 | * @param {Array} [indices] The index array of data points. If falsy value given, will select all data points.
|
36516 | * @example
|
36517 | * // unselect all data points
|
36518 | * chart.unselect();
|
36519 | *
|
36520 | * // unselect all from 'data1'
|
36521 | * chart.unselect("data1");
|
36522 | *
|
36523 | * // unselect from 'data1', indices 2
|
36524 | * chart.unselect("data1", [2]);
|
36525 | */
|
36526 | unselect: function unselect(ids, indices) {
|
36527 | var $$ = this.internal,
|
36528 | config = $$.config,
|
36529 | $el = $$.$el;
|
36530 | config.data_selection_enabled && $el.main.selectAll("." + config_classes.shapes).selectAll("." + config_classes.shape).each(function (d, i) {
|
36531 | var shape = src_select(this),
|
36532 | id = d.data ? d.data.id : d.id,
|
36533 | toggle = $$.getToggle(this, d).bind($$),
|
36534 | isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0,
|
36535 | isTargetIndex = !indices || indices.indexOf(i) >= 0,
|
36536 | isSelected = shape.classed(config_classes.SELECTED);
|
36537 | // line/area selection not supported yet
|
36538 | shape.classed(config_classes.line) || shape.classed(config_classes.area) || isTargetId && isTargetIndex && config.data_selection_isselectable.bind($$.api)(d) && isSelected && toggle(!1, shape.classed(config_classes.SELECTED, !1), d, i);
|
36539 | });
|
36540 | }
|
36541 | });
|
36542 | ;// CONCATENATED MODULE: ./src/Chart/api/subchart.ts
|
36543 | /**
|
36544 | * Copyright (c) 2017 ~ present NAVER Corp.
|
36545 | * billboard.js project is licensed under the MIT license
|
36546 | */
|
36547 |
|
36548 | /* harmony default export */ var subchart = ({
|
36549 | subchart: {
|
36550 | /**
|
36551 | * Show subchart
|
36552 | * - **NOTE:** for ESM imports, needs to import 'subchart' exports and instantiate it by calling `subchart()`.
|
36553 | * @function subchart․show
|
36554 | * @instance
|
36555 | * @memberof Chart
|
36556 | * @example
|
36557 | * // for ESM imports, needs to import 'subchart' and must be instantiated first to enable subchart's API.
|
36558 | * import {subchart} from "billboard.js";
|
36559 | *
|
36560 | * const chart = bb.generate({
|
36561 | * ...
|
36562 | * subchart: {
|
36563 | * // need to be instantiated by calling 'subchart()'
|
36564 | * enabled: subchart()
|
36565 | *
|
36566 | * // in case don't want subchart to be shown at initialization, instantiate with '!subchart()'
|
36567 | * enabled: !subchart()
|
36568 | * }
|
36569 | * });
|
36570 | *
|
36571 | * chart.subchart.show();
|
36572 | */
|
36573 | show: function () {
|
36574 | var $$ = this.internal,
|
36575 | subchart = $$.$el.subchart,
|
36576 | config = $$.config,
|
36577 | show = config.subchart_show;
|
36578 |
|
36579 | if (!show) {
|
36580 | config.subchart_show = !show, subchart.main || $$.initSubchart();
|
36581 | var $target = subchart.main.selectAll("." + config_classes.target); // need to cover when new data has been loaded
|
36582 |
|
36583 | $$.data.targets.length !== $target.size() && ($$.updateSizes(), $$.updateTargetsForSubchart($$.data.targets), $target = subchart.main.selectAll("." + config_classes.target)), $target.style("opacity", "1"), subchart.main.style("display", null), this.flush();
|
36584 | }
|
36585 | },
|
36586 |
|
36587 | /**
|
36588 | * Hide generated subchart
|
36589 | * - **NOTE:** for ESM imports, needs to import 'subchart' exports and instantiate it by calling `subchart()`.
|
36590 | * @function subchart․hide
|
36591 | * @instance
|
36592 | * @memberof Chart
|
36593 | * @example
|
36594 | * chart.subchart.hide();
|
36595 | */
|
36596 | hide: function hide() {
|
36597 | var $$ = this.internal,
|
36598 | subchart = $$.$el.subchart,
|
36599 | config = $$.config;
|
36600 | config.subchart_show && subchart.main.style("display") !== "none" && (config.subchart_show = !1, subchart.main.style("display", "none"), this.flush());
|
36601 | },
|
36602 |
|
36603 | /**
|
36604 | * Toggle the visiblity of subchart
|
36605 | * - **NOTE:** for ESM imports, needs to import 'subchart' exports and instantiate it by calling `subchart()`.
|
36606 | * @function subchart․toggle
|
36607 | * @instance
|
36608 | * @memberof Chart
|
36609 | * @example
|
36610 | * // When subchart is hidden, will be shown
|
36611 | * // When subchart is shown, will be hidden
|
36612 | * chart.subchart.toggle();
|
36613 | */
|
36614 | toggle: function toggle() {
|
36615 | var $$ = this.internal,
|
36616 | config = $$.config;
|
36617 | this.subchart[config.subchart_show ? "hide" : "show"]();
|
36618 | }
|
36619 | }
|
36620 | });
|
36621 | ;// CONCATENATED MODULE: ./node_modules/d3-interpolate/src/zoom.js
|
36622 | var epsilon2 = 1e-12;
|
36623 |
|
36624 | function cosh(x) {
|
36625 | return ((x = Math.exp(x)) + 1 / x) / 2;
|
36626 | }
|
36627 |
|
36628 | function sinh(x) {
|
36629 | return ((x = Math.exp(x)) - 1 / x) / 2;
|
36630 | }
|
36631 |
|
36632 | function tanh(x) {
|
36633 | return ((x = Math.exp(2 * x)) - 1) / (x + 1);
|
36634 | }
|
36635 |
|
36636 | /* harmony default export */ var src_zoom = ((function zoomRho(rho, rho2, rho4) {
|
36637 | // p0 = [ux0, uy0, w0]
|
36638 | // p1 = [ux1, uy1, w1]
|
36639 | function zoom(p0, p1) {
|
36640 | var i,
|
36641 | S,
|
36642 | ux0 = p0[0],
|
36643 | uy0 = p0[1],
|
36644 | w0 = p0[2],
|
36645 | ux1 = p1[0],
|
36646 | uy1 = p1[1],
|
36647 | w1 = p1[2],
|
36648 | dx = ux1 - ux0,
|
36649 | dy = uy1 - uy0,
|
36650 | d2 = dx * dx + dy * dy; // Special case for u0 ≅ u1.
|
36651 |
|
36652 | if (d2 < epsilon2) S = Math.log(w1 / w0) / rho, i = function (t) {
|
36653 | return [ux0 + t * dx, uy0 + t * dy, w0 * Math.exp(rho * t * S)];
|
36654 | }; // General case.
|
36655 | else {
|
36656 | var d1 = Math.sqrt(d2),
|
36657 | b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),
|
36658 | b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),
|
36659 | r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),
|
36660 | r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
|
36661 | S = (r1 - r0) / rho, i = function (t) {
|
36662 | var s = t * S,
|
36663 | coshr0 = cosh(r0),
|
36664 | u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));
|
36665 | return [ux0 + u * dx, uy0 + u * dy, w0 * coshr0 / cosh(rho * s + r0)];
|
36666 | };
|
36667 | }
|
36668 | return i.duration = S * 1e3 * rho / Math.SQRT2, i;
|
36669 | }
|
36670 |
|
36671 | return zoom.rho = function (_) {
|
36672 | var _1 = Math.max(1e-3, +_),
|
36673 | _2 = _1 * _1;
|
36674 |
|
36675 | return zoomRho(_1, _2, _2 * _2);
|
36676 | }, zoom;
|
36677 | })(Math.SQRT2, 2, 4));
|
36678 | ;// CONCATENATED MODULE: ./node_modules/d3-zoom/src/constant.js
|
36679 | /* harmony default export */ var d3_zoom_src_constant = (function (x) {
|
36680 | return function () {
|
36681 | return x;
|
36682 | };
|
36683 | });
|
36684 | ;// CONCATENATED MODULE: ./node_modules/d3-zoom/src/event.js
|
36685 | function ZoomEvent(type, _ref) {
|
36686 | var sourceEvent = _ref.sourceEvent,
|
36687 | target = _ref.target,
|
36688 | transform = _ref.transform,
|
36689 | dispatch = _ref.dispatch;
|
36690 | Object.defineProperties(this, {
|
36691 | type: {
|
36692 | value: type,
|
36693 | enumerable: !0,
|
36694 | configurable: !0
|
36695 | },
|
36696 | sourceEvent: {
|
36697 | value: sourceEvent,
|
36698 | enumerable: !0,
|
36699 | configurable: !0
|
36700 | },
|
36701 | target: {
|
36702 | value: target,
|
36703 | enumerable: !0,
|
36704 | configurable: !0
|
36705 | },
|
36706 | transform: {
|
36707 | value: transform,
|
36708 | enumerable: !0,
|
36709 | configurable: !0
|
36710 | },
|
36711 | _: {
|
36712 | value: dispatch
|
36713 | }
|
36714 | });
|
36715 | }
|
36716 | ;// CONCATENATED MODULE: ./node_modules/d3-zoom/src/transform.js
|
36717 | function Transform(k, x, y) {
|
36718 | this.k = k, this.x = x, this.y = y;
|
36719 | }
|
36720 | Transform.prototype = {
|
36721 | constructor: Transform,
|
36722 | scale: function scale(k) {
|
36723 | return k === 1 ? this : new Transform(this.k * k, this.x, this.y);
|
36724 | },
|
36725 | translate: function translate(x, y) {
|
36726 | return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y);
|
36727 | },
|
36728 | apply: function apply(point) {
|
36729 | return [point[0] * this.k + this.x, point[1] * this.k + this.y];
|
36730 | },
|
36731 | applyX: function applyX(x) {
|
36732 | return x * this.k + this.x;
|
36733 | },
|
36734 | applyY: function applyY(y) {
|
36735 | return y * this.k + this.y;
|
36736 | },
|
36737 | invert: function invert(location) {
|
36738 | return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];
|
36739 | },
|
36740 | invertX: function invertX(x) {
|
36741 | return (x - this.x) / this.k;
|
36742 | },
|
36743 | invertY: function invertY(y) {
|
36744 | return (y - this.y) / this.k;
|
36745 | },
|
36746 | rescaleX: function rescaleX(x) {
|
36747 | return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x));
|
36748 | },
|
36749 | rescaleY: function rescaleY(y) {
|
36750 | return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y));
|
36751 | },
|
36752 | toString: function toString() {
|
36753 | return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
|
36754 | }
|
36755 | };
|
36756 | var transform_identity = new Transform(1, 0, 0);
|
36757 | transform_transform.prototype = Transform.prototype;
|
36758 | function transform_transform(node) {
|
36759 | for (; !node.__zoom;) if (!(node = node.parentNode)) return transform_identity;
|
36760 |
|
36761 | return node.__zoom;
|
36762 | }
|
36763 | ;// CONCATENATED MODULE: ./node_modules/d3-zoom/src/noevent.js
|
36764 | function src_noevent_nopropagation(event) {
|
36765 | event.stopImmediatePropagation();
|
36766 | }
|
36767 | /* harmony default export */ function d3_zoom_src_noevent(event) {
|
36768 | event.preventDefault(), event.stopImmediatePropagation();
|
36769 | }
|
36770 | ;// CONCATENATED MODULE: ./node_modules/d3-zoom/src/zoom.js
|
36771 |
|
36772 |
|
36773 |
|
36774 |
|
36775 |
|
36776 |
|
36777 |
|
36778 |
|
36779 | // Ignore right-click, since that should open the context menu.
|
36780 | // except for pinch-to-zoom, which is sent as a wheel+ctrlKey event
|
36781 |
|
36782 | function zoom_defaultFilter(event) {
|
36783 | return (!event.ctrlKey || event.type === 'wheel') && !event.button;
|
36784 | }
|
36785 |
|
36786 | function zoom_defaultExtent() {
|
36787 | var e = this;
|
36788 | return e instanceof SVGElement ? (e = e.ownerSVGElement || e, e.hasAttribute("viewBox") ? (e = e.viewBox.baseVal, [[e.x, e.y], [e.x + e.width, e.y + e.height]]) : [[0, 0], [e.width.baseVal.value, e.height.baseVal.value]]) : [[0, 0], [e.clientWidth, e.clientHeight]];
|
36789 | }
|
36790 |
|
36791 | function defaultTransform() {
|
36792 | return this.__zoom || transform_identity;
|
36793 | }
|
36794 |
|
36795 | function defaultWheelDelta(event) {
|
36796 | return -event.deltaY * (event.deltaMode === 1 ? .05 : event.deltaMode ? 1 : .002) * (event.ctrlKey ? 10 : 1);
|
36797 | }
|
36798 |
|
36799 | function zoom_defaultTouchable() {
|
36800 | return navigator.maxTouchPoints || "ontouchstart" in this;
|
36801 | }
|
36802 |
|
36803 | function defaultConstrain(transform, extent, translateExtent) {
|
36804 | var dx0 = transform.invertX(extent[0][0]) - translateExtent[0][0],
|
36805 | dx1 = transform.invertX(extent[1][0]) - translateExtent[1][0],
|
36806 | dy0 = transform.invertY(extent[0][1]) - translateExtent[0][1],
|
36807 | dy1 = transform.invertY(extent[1][1]) - translateExtent[1][1];
|
36808 | return transform.translate(dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1), dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1));
|
36809 | }
|
36810 |
|
36811 | /* harmony default export */ function d3_zoom_src_zoom() {
|
36812 | function zoom(selection) {
|
36813 | selection.property("__zoom", defaultTransform).on("wheel.zoom", wheeled).on("mousedown.zoom", mousedowned).on("dblclick.zoom", dblclicked).filter(touchable).on("touchstart.zoom", touchstarted).on("touchmove.zoom", touchmoved).on("touchend.zoom touchcancel.zoom", touchended).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
36814 | }
|
36815 |
|
36816 | function scale(transform, k) {
|
36817 | return k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k)), k === transform.k ? transform : new Transform(k, transform.x, transform.y);
|
36818 | }
|
36819 |
|
36820 | function translate(transform, p0, p1) {
|
36821 | var x = p0[0] - p1[0] * transform.k,
|
36822 | y = p0[1] - p1[1] * transform.k;
|
36823 | return x === transform.x && y === transform.y ? transform : new Transform(transform.k, x, y);
|
36824 | }
|
36825 |
|
36826 | function centroid(extent) {
|
36827 | return [(+extent[0][0] + +extent[1][0]) / 2, (+extent[0][1] + +extent[1][1]) / 2];
|
36828 | }
|
36829 |
|
36830 | function schedule(transition, transform, point, event) {
|
36831 | transition.on("start.zoom", function () {
|
36832 | gesture(this, arguments).event(event).start();
|
36833 | }).on("interrupt.zoom end.zoom", function () {
|
36834 | gesture(this, arguments).event(event).end();
|
36835 | }).tween("zoom", function () {
|
36836 | var that = this,
|
36837 | args = arguments,
|
36838 | g = gesture(that, args).event(event),
|
36839 | e = extent.apply(that, args),
|
36840 | p = point == null ? centroid(e) : typeof point === "function" ? point.apply(that, args) : point,
|
36841 | w = Math.max(e[1][0] - e[0][0], e[1][1] - e[0][1]),
|
36842 | a = that.__zoom,
|
36843 | b = typeof transform === "function" ? transform.apply(that, args) : transform,
|
36844 | i = interpolate(a.invert(p).concat(w / a.k), b.invert(p).concat(w / b.k));
|
36845 | return function (t) {
|
36846 | if (t === 1) t = b; // Avoid rounding error on end.
|
36847 | else {
|
36848 | var l = i(t),
|
36849 | k = w / l[2];
|
36850 | t = new Transform(k, p[0] - l[0] * k, p[1] - l[1] * k);
|
36851 | }
|
36852 | g.zoom(null, t);
|
36853 | };
|
36854 | });
|
36855 | }
|
36856 |
|
36857 | function gesture(that, args, clean) {
|
36858 | return !clean && that.__zooming || new Gesture(that, args);
|
36859 | }
|
36860 |
|
36861 | function Gesture(that, args) {
|
36862 | this.that = that, this.args = args, this.active = 0, this.sourceEvent = null, this.extent = extent.apply(that, args), this.taps = 0;
|
36863 | }
|
36864 |
|
36865 | function wheeled(event) {
|
36866 | function wheelidled() {
|
36867 | g.wheel = null, g.end();
|
36868 | }
|
36869 |
|
36870 | for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) args[_key - 1] = arguments[_key];
|
36871 |
|
36872 | if (filter.apply(this, arguments)) {
|
36873 | var g = gesture(this, args).event(event),
|
36874 | t = this.__zoom,
|
36875 | k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t.k * Math.pow(2, wheelDelta.apply(this, arguments)))),
|
36876 | p = src_pointer(event); // If the mouse is in the same location as before, reuse it.
|
36877 | // If there were recent wheel events, reset the wheel idle timeout.
|
36878 |
|
36879 | if (g.wheel) (g.mouse[0][0] !== p[0] || g.mouse[0][1] !== p[1]) && (g.mouse[1] = t.invert(g.mouse[0] = p)), clearTimeout(g.wheel); // If this wheel event won’t trigger a transform change, ignore it.
|
36880 | else {
|
36881 | if (t.k === k) return; // Otherwise, capture the mouse point and location at the start.
|
36882 |
|
36883 | g.mouse = [p, t.invert(p)], interrupt(this), g.start();
|
36884 | }
|
36885 | d3_zoom_src_noevent(event), g.wheel = setTimeout(wheelidled, 150), g.zoom("mouse", constrain(translate(scale(t, k), g.mouse[0], g.mouse[1]), g.extent, translateExtent));
|
36886 | }
|
36887 | }
|
36888 |
|
36889 | function mousedowned(event) {
|
36890 | function mousemoved(event) {
|
36891 | if (d3_zoom_src_noevent(event), !g.moved) {
|
36892 | var dx = event.clientX - x0,
|
36893 | dy = event.clientY - y0;
|
36894 | g.moved = dx * dx + dy * dy > clickDistance2;
|
36895 | }
|
36896 |
|
36897 | g.event(event).zoom("mouse", constrain(translate(g.that.__zoom, g.mouse[0] = src_pointer(event, currentTarget), g.mouse[1]), g.extent, translateExtent));
|
36898 | }
|
36899 |
|
36900 | function mouseupped(event) {
|
36901 | v.on("mousemove.zoom mouseup.zoom", null), yesdrag(event.view, g.moved), d3_zoom_src_noevent(event), g.event(event).end();
|
36902 | }
|
36903 |
|
36904 | for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) args[_key2 - 1] = arguments[_key2];
|
36905 |
|
36906 | if (!touchending && filter.apply(this, arguments)) {
|
36907 | var g = gesture(this, args, !0).event(event),
|
36908 | v = src_select(event.view).on("mousemove.zoom", mousemoved, !0).on("mouseup.zoom", mouseupped, !0),
|
36909 | p = src_pointer(event, currentTarget),
|
36910 | currentTarget = event.currentTarget,
|
36911 | x0 = event.clientX,
|
36912 | y0 = event.clientY;
|
36913 | nodrag(event.view), src_noevent_nopropagation(event), g.mouse = [p, this.__zoom.invert(p)], interrupt(this), g.start();
|
36914 | }
|
36915 | }
|
36916 |
|
36917 | function dblclicked(event) {
|
36918 | for (var _len3 = arguments.length, args = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) args[_key3 - 1] = arguments[_key3];
|
36919 |
|
36920 | if (filter.apply(this, arguments)) {
|
36921 | var t0 = this.__zoom,
|
36922 | p0 = src_pointer(event.changedTouches ? event.changedTouches[0] : event, this),
|
36923 | p1 = t0.invert(p0),
|
36924 | k1 = t0.k * (event.shiftKey ? .5 : 2),
|
36925 | t1 = constrain(translate(scale(t0, k1), p0, p1), extent.apply(this, args), translateExtent);
|
36926 | d3_zoom_src_noevent(event), duration > 0 ? src_select(this).transition().duration(duration).call(schedule, t1, p0, event) : src_select(this).call(zoom.transform, t1, p0, event);
|
36927 | }
|
36928 | }
|
36929 |
|
36930 | function touchstarted(event) {
|
36931 | for (var _len4 = arguments.length, args = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) args[_key4 - 1] = arguments[_key4];
|
36932 |
|
36933 | if (filter.apply(this, arguments)) {
|
36934 | var started,
|
36935 | i,
|
36936 | t,
|
36937 | p,
|
36938 | touches = event.touches,
|
36939 | n = touches.length,
|
36940 | g = gesture(this, args, event.changedTouches.length === n).event(event);
|
36941 |
|
36942 | for (src_noevent_nopropagation(event), i = 0; i < n; ++i) t = touches[i], p = src_pointer(t, this), p = [p, this.__zoom.invert(p), t.identifier], g.touch0 ? !g.touch1 && g.touch0[2] !== p[2] && (g.touch1 = p, g.taps = 0) : (g.touch0 = p, started = !0, g.taps = 1 + !!touchstarting);
|
36943 |
|
36944 | touchstarting && (touchstarting = clearTimeout(touchstarting)), started && (g.taps < 2 && (touchfirst = p[0], touchstarting = setTimeout(function () {
|
36945 | touchstarting = null;
|
36946 | }, 500)), interrupt(this), g.start());
|
36947 | }
|
36948 | }
|
36949 |
|
36950 | function touchmoved(event) {
|
36951 | if (this.__zooming) {
|
36952 | for (var _len5 = arguments.length, args = Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) args[_key5 - 1] = arguments[_key5];
|
36953 |
|
36954 | var i,
|
36955 | t,
|
36956 | p,
|
36957 | l,
|
36958 | g = gesture(this, args).event(event),
|
36959 | touches = event.changedTouches,
|
36960 | n = touches.length;
|
36961 |
|
36962 | for (d3_zoom_src_noevent(event), i = 0; i < n; ++i) t = touches[i], p = src_pointer(t, this), g.touch0 && g.touch0[2] === t.identifier ? g.touch0[0] = p : g.touch1 && g.touch1[2] === t.identifier && (g.touch1[0] = p);
|
36963 |
|
36964 | if (t = g.that.__zoom, g.touch1) {
|
36965 | var p0 = g.touch0[0],
|
36966 | l0 = g.touch0[1],
|
36967 | p1 = g.touch1[0],
|
36968 | l1 = g.touch1[1],
|
36969 | dp = (dp = p1[0] - p0[0]) * dp + (dp = p1[1] - p0[1]) * dp,
|
36970 | dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl;
|
36971 | t = scale(t, Math.sqrt(dp / dl)), p = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2], l = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2];
|
36972 | } else if (g.touch0) p = g.touch0[0], l = g.touch0[1];else return;
|
36973 |
|
36974 | g.zoom("touch", constrain(translate(t, p, l), g.extent, translateExtent));
|
36975 | }
|
36976 | }
|
36977 |
|
36978 | function touchended(event) {
|
36979 | for (var _len6 = arguments.length, args = Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) args[_key6 - 1] = arguments[_key6];
|
36980 |
|
36981 | if (this.__zooming) {
|
36982 | var i,
|
36983 | t,
|
36984 | g = gesture(this, args).event(event),
|
36985 | touches = event.changedTouches,
|
36986 | n = touches.length;
|
36987 |
|
36988 | for (src_noevent_nopropagation(event), touchending && clearTimeout(touchending), touchending = setTimeout(function () {
|
36989 | touchending = null;
|
36990 | }, 500), i = 0; i < n; ++i) t = touches[i], g.touch0 && g.touch0[2] === t.identifier ? delete g.touch0 : g.touch1 && g.touch1[2] === t.identifier && delete g.touch1;
|
36991 |
|
36992 | if (g.touch1 && !g.touch0 && (g.touch0 = g.touch1, delete g.touch1), g.touch0) g.touch0[1] = this.__zoom.invert(g.touch0[0]);else // If this was a dbltap, reroute to the (optional) dblclick.zoom handler.
|
36993 | if (g.end(), g.taps === 2 && (t = src_pointer(t, this), Math.hypot(touchfirst[0] - t[0], touchfirst[1] - t[1]) < tapDistance)) {
|
36994 | var p = src_select(this).on("dblclick.zoom");
|
36995 | p && p.apply(this, arguments);
|
36996 | }
|
36997 | }
|
36998 | }
|
36999 |
|
37000 | var touchstarting,
|
37001 | touchfirst,
|
37002 | touchending,
|
37003 | filter = zoom_defaultFilter,
|
37004 | extent = zoom_defaultExtent,
|
37005 | constrain = defaultConstrain,
|
37006 | wheelDelta = defaultWheelDelta,
|
37007 | touchable = zoom_defaultTouchable,
|
37008 | scaleExtent = [0, Infinity],
|
37009 | translateExtent = [[-Infinity, -Infinity], [Infinity, Infinity]],
|
37010 | duration = 250,
|
37011 | interpolate = src_zoom,
|
37012 | listeners = src_dispatch("start", "zoom", "end"),
|
37013 | clickDistance2 = 0,
|
37014 | tapDistance = 10;
|
37015 | return zoom.transform = function (collection, transform, point, event) {
|
37016 | var selection = collection.selection ? collection.selection() : collection;
|
37017 | selection.property("__zoom", defaultTransform), collection === selection ? selection.interrupt().each(function () {
|
37018 | gesture(this, arguments).event(event).start().zoom(null, typeof transform === "function" ? transform.apply(this, arguments) : transform).end();
|
37019 | }) : schedule(collection, transform, point, event);
|
37020 | }, zoom.scaleBy = function (selection, k, p, event) {
|
37021 | zoom.scaleTo(selection, function () {
|
37022 | var k0 = this.__zoom.k,
|
37023 | k1 = typeof k === "function" ? k.apply(this, arguments) : k;
|
37024 | return k0 * k1;
|
37025 | }, p, event);
|
37026 | }, zoom.scaleTo = function (selection, k, p, event) {
|
37027 | zoom.transform(selection, function () {
|
37028 | var e = extent.apply(this, arguments),
|
37029 | t0 = this.__zoom,
|
37030 | p0 = p == null ? centroid(e) : typeof p === "function" ? p.apply(this, arguments) : p,
|
37031 | p1 = t0.invert(p0),
|
37032 | k1 = typeof k === "function" ? k.apply(this, arguments) : k;
|
37033 | return constrain(translate(scale(t0, k1), p0, p1), e, translateExtent);
|
37034 | }, p, event);
|
37035 | }, zoom.translateBy = function (selection, x, y, event) {
|
37036 | zoom.transform(selection, function () {
|
37037 | return constrain(this.__zoom.translate(typeof x === "function" ? x.apply(this, arguments) : x, typeof y === "function" ? y.apply(this, arguments) : y), extent.apply(this, arguments), translateExtent);
|
37038 | }, null, event);
|
37039 | }, zoom.translateTo = function (selection, x, y, p, event) {
|
37040 | zoom.transform(selection, function () {
|
37041 | var e = extent.apply(this, arguments),
|
37042 | t = this.__zoom,
|
37043 | p0 = p == null ? centroid(e) : typeof p === "function" ? p.apply(this, arguments) : p;
|
37044 | return constrain(transform_identity.translate(p0[0], p0[1]).scale(t.k).translate(typeof x === "function" ? -x.apply(this, arguments) : -x, typeof y === "function" ? -y.apply(this, arguments) : -y), e, translateExtent);
|
37045 | }, p, event);
|
37046 | }, Gesture.prototype = {
|
37047 | event: function event(_event) {
|
37048 | return _event && (this.sourceEvent = _event), this;
|
37049 | },
|
37050 | start: function start() {
|
37051 | return ++this.active === 1 && (this.that.__zooming = this, this.emit("start")), this;
|
37052 | },
|
37053 | zoom: function (key, transform) {
|
37054 | return this.mouse && key !== "mouse" && (this.mouse[1] = transform.invert(this.mouse[0])), this.touch0 && key !== "touch" && (this.touch0[1] = transform.invert(this.touch0[0])), this.touch1 && key !== "touch" && (this.touch1[1] = transform.invert(this.touch1[0])), this.that.__zoom = transform, this.emit("zoom"), this;
|
37055 | },
|
37056 | end: function end() {
|
37057 | return --this.active === 0 && (delete this.that.__zooming, this.emit("end")), this;
|
37058 | },
|
37059 | emit: function emit(type) {
|
37060 | var d = src_select(this.that).datum();
|
37061 | listeners.call(type, this.that, new ZoomEvent(type, {
|
37062 | sourceEvent: this.sourceEvent,
|
37063 | target: zoom,
|
37064 | type: type,
|
37065 | transform: this.that.__zoom,
|
37066 | dispatch: listeners
|
37067 | }), d);
|
37068 | }
|
37069 | }, zoom.wheelDelta = function (_) {
|
37070 | return arguments.length ? (wheelDelta = typeof _ === "function" ? _ : d3_zoom_src_constant(+_), zoom) : wheelDelta;
|
37071 | }, zoom.filter = function (_) {
|
37072 | return arguments.length ? (filter = typeof _ === "function" ? _ : d3_zoom_src_constant(!!_), zoom) : filter;
|
37073 | }, zoom.touchable = function (_) {
|
37074 | return arguments.length ? (touchable = typeof _ === "function" ? _ : d3_zoom_src_constant(!!_), zoom) : touchable;
|
37075 | }, zoom.extent = function (_) {
|
37076 | return arguments.length ? (extent = typeof _ === "function" ? _ : d3_zoom_src_constant([[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]]), zoom) : extent;
|
37077 | }, zoom.scaleExtent = function (_) {
|
37078 | return arguments.length ? (scaleExtent[0] = +_[0], scaleExtent[1] = +_[1], zoom) : [scaleExtent[0], scaleExtent[1]];
|
37079 | }, zoom.translateExtent = function (_) {
|
37080 | return arguments.length ? (translateExtent[0][0] = +_[0][0], translateExtent[1][0] = +_[1][0], translateExtent[0][1] = +_[0][1], translateExtent[1][1] = +_[1][1], zoom) : [[translateExtent[0][0], translateExtent[0][1]], [translateExtent[1][0], translateExtent[1][1]]];
|
37081 | }, zoom.constrain = function (_) {
|
37082 | return arguments.length ? (constrain = _, zoom) : constrain;
|
37083 | }, zoom.duration = function (_) {
|
37084 | return arguments.length ? (duration = +_, zoom) : duration;
|
37085 | }, zoom.interpolate = function (_) {
|
37086 | return arguments.length ? (interpolate = _, zoom) : interpolate;
|
37087 | }, zoom.on = function () {
|
37088 | var value = listeners.on.apply(listeners, arguments);
|
37089 | return value === listeners ? zoom : value;
|
37090 | }, zoom.clickDistance = function (_) {
|
37091 | return arguments.length ? (clickDistance2 = (_ = +_) * _, zoom) : Math.sqrt(clickDistance2);
|
37092 | }, zoom.tapDistance = function (_) {
|
37093 | return arguments.length ? (tapDistance = +_, zoom) : tapDistance;
|
37094 | }, zoom;
|
37095 | }
|
37096 | ;// CONCATENATED MODULE: ./node_modules/d3-zoom/src/index.js
|
37097 |
|
37098 |
|
37099 | ;// CONCATENATED MODULE: ./src/Chart/api/zoom.ts
|
37100 | /**
|
37101 | * Copyright (c) 2017 ~ present NAVER Corp.
|
37102 | * billboard.js project is licensed under the MIT license
|
37103 | */
|
37104 |
|
37105 |
|
37106 |
|
37107 | /**
|
37108 | * Check if the given domain is within zoom range
|
37109 | * @param {Array} domain domain value
|
37110 | * @param {Array} range zoom range value
|
37111 | * @returns {boolean}
|
37112 | * @private
|
37113 | */
|
37114 |
|
37115 | function withinRange(domain, range) {
|
37116 | var min = range[0],
|
37117 | max = range[1];
|
37118 | return domain.every(function (v, i) {
|
37119 | return i === 0 ? v >= min : v <= max;
|
37120 | });
|
37121 | }
|
37122 | /**
|
37123 | * Zoom by giving x domain.
|
37124 | * - **NOTE:**
|
37125 | * - For `wheel` type zoom, the minimum zoom range will be set as the given domain. To get the initial state, [.unzoom()](#unzoom) should be called.
|
37126 | * - To be used [zoom.enabled](Options.html#.zoom) option should be set as `truthy`.
|
37127 | * @function zoom
|
37128 | * @instance
|
37129 | * @memberof Chart
|
37130 | * @param {Array} domainValue If domain is given, the chart will be zoomed to the given domain. If no argument is given, the current zoomed domain will be returned.
|
37131 | * @returns {Array} domain value in array
|
37132 | * @example
|
37133 | * // Zoom to specified domain
|
37134 | * chart.zoom([10, 20]);
|
37135 | *
|
37136 | * // Get the current zoomed domain
|
37137 | * chart.zoom();
|
37138 | */
|
37139 |
|
37140 |
|
37141 | var zoom = function (domainValue) {
|
37142 | var resultDomain,
|
37143 | $$ = this.internal,
|
37144 | config = $$.config,
|
37145 | scale = $$.scale,
|
37146 | domain = domainValue;
|
37147 | if (!(config.zoom_enabled && domain)) resultDomain = scale.zoom ? scale.zoom.domain() : scale.x.orgDomain();else if ($$.axis.isTimeSeries() && (domain = domain.map(function (x) {
|
37148 | return parseDate.bind($$)(x);
|
37149 | })), withinRange(domain, $$.getZoomDomain())) {
|
37150 | if ($$.api.tooltip.hide(), config.subchart_show) {
|
37151 | var xScale = scale.zoom || scale.x;
|
37152 | $$.brush.getSelection().call($$.brush.move, [xScale(domain[0]), xScale(domain[1])]), resultDomain = domain;
|
37153 | } else scale.x.domain(domain), scale.zoom = scale.x, $$.axis.x.scale(scale.zoom), resultDomain = scale.zoom.orgDomain();
|
37154 |
|
37155 | $$.redraw({
|
37156 | withTransition: !0,
|
37157 | withY: config.zoom_rescale,
|
37158 | withDimension: !1
|
37159 | }), $$.setZoomResetButton(), callFn(config.zoom_onzoom, $$.api, resultDomain);
|
37160 | }
|
37161 | return resultDomain;
|
37162 | };
|
37163 |
|
37164 | util_extend(zoom, {
|
37165 | /**
|
37166 | * Enable and disable zooming.
|
37167 | * @function zoom․enable
|
37168 | * @instance
|
37169 | * @memberof Chart
|
37170 | * @param {string|boolean} enabled Possible string values are "wheel" or "drag". If enabled is true, "wheel" will be used. If false is given, zooming will be disabled.<br>When set to false, the current zooming status will be reset.
|
37171 | * @example
|
37172 | * // Enable zooming using the mouse wheel
|
37173 | * chart.zoom.enable(true);
|
37174 | * // Or
|
37175 | * chart.zoom.enable("wheel");
|
37176 | *
|
37177 | * // Enable zooming by dragging
|
37178 | * chart.zoom.enable("drag");
|
37179 | *
|
37180 | * // Disable zooming
|
37181 | * chart.zoom.enable(false);
|
37182 | */
|
37183 | enable: function enable(enabled) {
|
37184 | var $$ = this.internal,
|
37185 | config = $$.config;
|
37186 | /^(drag|wheel)$/.test(enabled) && (config.zoom_type = enabled), config.zoom_enabled = !!enabled, $$.zoom ? enabled === !1 && $$.bindZoomEvent(!1) : ($$.initZoom(), $$.bindZoomEvent()), $$.updateAndRedraw();
|
37187 | },
|
37188 |
|
37189 | /**
|
37190 | * Set or get x Axis maximum zoom range value
|
37191 | * @function zoom․max
|
37192 | * @instance
|
37193 | * @memberof Chart
|
37194 | * @param {number} [max] maximum value to set for zoom
|
37195 | * @returns {number} zoom max value
|
37196 | * @example
|
37197 | * // Set maximum range value
|
37198 | * chart.zoom.max(20);
|
37199 | */
|
37200 | max: function max(_max) {
|
37201 | var $$ = this.internal,
|
37202 | config = $$.config,
|
37203 | xDomain = $$.org.xDomain;
|
37204 | return (_max === 0 || _max) && (config.zoom_x_max = getMinMax("max", [xDomain[1], _max])), config.zoom_x_max;
|
37205 | },
|
37206 |
|
37207 | /**
|
37208 | * Set or get x Axis minimum zoom range value
|
37209 | * @function zoom․min
|
37210 | * @instance
|
37211 | * @memberof Chart
|
37212 | * @param {number} [min] minimum value to set for zoom
|
37213 | * @returns {number} zoom min value
|
37214 | * @example
|
37215 | * // Set minimum range value
|
37216 | * chart.zoom.min(-1);
|
37217 | */
|
37218 | min: function min(_min) {
|
37219 | var $$ = this.internal,
|
37220 | config = $$.config,
|
37221 | xDomain = $$.org.xDomain;
|
37222 | return (_min === 0 || _min) && (config.zoom_x_min = getMinMax("min", [xDomain[0], _min])), config.zoom_x_min;
|
37223 | },
|
37224 |
|
37225 | /**
|
37226 | * Set zoom range
|
37227 | * @function zoom․range
|
37228 | * @instance
|
37229 | * @memberof Chart
|
37230 | * @param {object} [range] zoom range
|
37231 | * @returns {object} zoom range value
|
37232 | * {
|
37233 | * min: 0,
|
37234 | * max: 100
|
37235 | * }
|
37236 | * @example
|
37237 | * chart.zoom.range({
|
37238 | * min: 10,
|
37239 | * max: 100
|
37240 | * });
|
37241 | */
|
37242 | range: function range(_range) {
|
37243 | var zoom = this.zoom;
|
37244 |
|
37245 | if (isObject(_range)) {
|
37246 | var min = _range.min,
|
37247 | max = _range.max;
|
37248 | isDefined(min) && zoom.min(min), isDefined(max) && zoom.max(max);
|
37249 | }
|
37250 |
|
37251 | return {
|
37252 | min: zoom.min(),
|
37253 | max: zoom.max()
|
37254 | };
|
37255 | }
|
37256 | });
|
37257 | /* harmony default export */ var api_zoom = ({
|
37258 | zoom: zoom,
|
37259 |
|
37260 | /**
|
37261 | * Unzoom zoomed area
|
37262 | * @function unzoom
|
37263 | * @instance
|
37264 | * @memberof Chart
|
37265 | * @example
|
37266 | * chart.unzoom();
|
37267 | */
|
37268 | unzoom: function unzoom() {
|
37269 | var $$ = this.internal,
|
37270 | config = $$.config;
|
37271 |
|
37272 | if ($$.scale.zoom) {
|
37273 | config.subchart_show ? $$.brush.getSelection().call($$.brush.move, null) : $$.zoom.updateTransformScale(transform_identity), $$.updateZoom(!0), $$.zoom.resetBtn && $$.zoom.resetBtn.style("display", "none");
|
37274 | // reset transform
|
37275 | var eventRects = $$.$el.main.select("." + config_classes.eventRects);
|
37276 | transform_transform(eventRects.node()) !== transform_identity && $$.zoom.transform(eventRects, transform_identity), $$.redraw({
|
37277 | withTransition: !0,
|
37278 | withUpdateXDomain: !0,
|
37279 | withUpdateOrgXDomain: !0,
|
37280 | withY: config.zoom_rescale
|
37281 | });
|
37282 | }
|
37283 | }
|
37284 | });
|
37285 | ;// CONCATENATED MODULE: ./src/ChartInternal/interactions/drag.ts
|
37286 | /**
|
37287 | * Copyright (c) 2017 ~ present NAVER Corp.
|
37288 | * billboard.js project is licensed under the MIT license
|
37289 | */
|
37290 |
|
37291 |
|
37292 |
|
37293 | /**
|
37294 | * Module used for data.selection.draggable option
|
37295 | */
|
37296 |
|
37297 | /* harmony default export */ var interactions_drag = ({
|
37298 | /**
|
37299 | * Called when dragging.
|
37300 | * Data points can be selected.
|
37301 | * @private
|
37302 | * @param {object} mouse Object
|
37303 | */
|
37304 | drag: function drag(mouse) {
|
37305 | var $$ = this,
|
37306 | config = $$.config,
|
37307 | state = $$.state,
|
37308 | main = $$.$el.main,
|
37309 | isSelectionGrouped = config.data_selection_grouped,
|
37310 | isSelectable = config.interaction_enabled && config.data_selection_isselectable;
|
37311 |
|
37312 | if (!$$.hasArcType() && config.data_selection_enabled && ( // do nothing if not selectable
|
37313 | !config.zoom_enabled || $$.zoom.altDomain) && config.data_selection_multiple // skip when single selection because drag is used for multiple selection
|
37314 | ) {
|
37315 | var _ref = state.dragStart || [0, 0],
|
37316 | sx = _ref[0],
|
37317 | sy = _ref[1],
|
37318 | mx = mouse[0],
|
37319 | my = mouse[1],
|
37320 | minX = Math.min(sx, mx),
|
37321 | maxX = Math.max(sx, mx),
|
37322 | minY = isSelectionGrouped ? state.margin.top : Math.min(sy, my),
|
37323 | maxY = isSelectionGrouped ? state.height : Math.max(sy, my);
|
37324 |
|
37325 | main.select("." + config_classes.dragarea).attr("x", minX).attr("y", minY).attr("width", maxX - minX).attr("height", maxY - minY), main.selectAll("." + config_classes.shapes).selectAll("." + config_classes.shape).filter(function (d) {
|
37326 | return isSelectable && isSelectable.bind($$.api)(d);
|
37327 | }).each(function (d, i) {
|
37328 | var toggle,
|
37329 | shape = src_select(this),
|
37330 | isSelected = shape.classed(config_classes.SELECTED),
|
37331 | isIncluded = shape.classed(config_classes.INCLUDED),
|
37332 | isWithin = !1;
|
37333 |
|
37334 | if (shape.classed(config_classes.circle)) {
|
37335 | var x = +shape.attr("cx") * 1,
|
37336 | y = +shape.attr("cy") * 1;
|
37337 | toggle = $$.togglePoint, isWithin = minX < x && x < maxX && minY < y && y < maxY;
|
37338 | } else if (shape.classed(config_classes.bar)) {
|
37339 | var _getPathBox = getPathBox(this),
|
37340 | _x = _getPathBox.x,
|
37341 | y = _getPathBox.y,
|
37342 | width = _getPathBox.width,
|
37343 | height = _getPathBox.height;
|
37344 |
|
37345 | toggle = $$.togglePath, isWithin = !(maxX < _x || _x + width < minX) && !(maxY < y || y + height < minY);
|
37346 | } else // line/area selection not supported yet
|
37347 | return; // @ts-ignore
|
37348 |
|
37349 |
|
37350 | isWithin ^ isIncluded && (shape.classed(config_classes.INCLUDED, !isIncluded), shape.classed(config_classes.SELECTED, !isSelected), toggle.call($$, !isSelected, shape, d, i));
|
37351 | });
|
37352 | }
|
37353 | },
|
37354 |
|
37355 | /**
|
37356 | * Called when the drag starts.
|
37357 | * Adds and Shows the drag area.
|
37358 | * @private
|
37359 | * @param {object} mouse Object
|
37360 | */
|
37361 | dragstart: function dragstart(mouse) {
|
37362 | var $$ = this,
|
37363 | config = $$.config,
|
37364 | state = $$.state,
|
37365 | main = $$.$el.main;
|
37366 | $$.hasArcType() || !config.data_selection_enabled || (state.dragStart = mouse, main.select("." + config_classes.chart).append("rect").attr("class", config_classes.dragarea).style("opacity", "0.1"), $$.setDragStatus(!0));
|
37367 | },
|
37368 |
|
37369 | /**
|
37370 | * Called when the drag finishes.
|
37371 | * Removes the drag area.
|
37372 | * @private
|
37373 | */
|
37374 | dragend: function dragend() {
|
37375 | var $$ = this,
|
37376 | config = $$.config,
|
37377 | main = $$.$el.main;
|
37378 | $$.hasArcType() || !config.data_selection_enabled || (main.select("." + config_classes.dragarea).transition().duration(100).style("opacity", "0").remove(), main.selectAll("." + config_classes.shape).classed(config_classes.INCLUDED, !1), $$.setDragStatus(!1));
|
37379 | }
|
37380 | });
|
37381 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/selection.ts
|
37382 |
|
37383 |
|
37384 | function selection_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
37385 |
|
37386 | function selection_objectSpread(target) { for (var source, i = 1; i < arguments.length; i++) source = arguments[i] == null ? {} : arguments[i], i % 2 ? selection_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : selection_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); return target; }
|
37387 |
|
37388 | /**
|
37389 | * Copyright (c) 2017 ~ present NAVER Corp.
|
37390 | * billboard.js project is licensed under the MIT license
|
37391 | */
|
37392 |
|
37393 |
|
37394 |
|
37395 |
|
37396 |
|
37397 | /* harmony default export */ var internals_selection = (selection_objectSpread(selection_objectSpread({}, interactions_drag), {}, {
|
37398 | /**
|
37399 | * Select a point
|
37400 | * @param {object} target Target point
|
37401 | * @param {object} d Data object
|
37402 | * @param {number} i Index number
|
37403 | * @private
|
37404 | */
|
37405 | selectPoint: function selectPoint(target, d, i) {
|
37406 | var $$ = this,
|
37407 | config = $$.config,
|
37408 | main = $$.$el.main,
|
37409 | isRotated = config.axis_rotated,
|
37410 | cx = (isRotated ? $$.circleY : $$.circleX).bind($$),
|
37411 | cy = (isRotated ? $$.circleX : $$.circleY).bind($$),
|
37412 | r = $$.pointSelectR.bind($$);
|
37413 | // add selected-circle on low layer g
|
37414 | callFn(config.data_onselected, $$.api, d, target.node()), main.select("." + config_classes.selectedCircles + $$.getTargetSelectorSuffix(d.id)).selectAll("." + config_classes.selectedCircle + "-" + i).data([d]).enter().append("circle").attr("class", function () {
|
37415 | return $$.generateClass(config_classes.selectedCircle, i);
|
37416 | }).attr("cx", cx).attr("cy", cy).attr("stroke", $$.color).attr("r", function (d2) {
|
37417 | return $$.pointSelectR(d2) * 1.4;
|
37418 | }).transition().duration(100).attr("r", r);
|
37419 | },
|
37420 |
|
37421 | /**
|
37422 | * Unelect a point
|
37423 | * @param {object} target Target point
|
37424 | * @param {object} d Data object
|
37425 | * @param {number} i Index number
|
37426 | * @private
|
37427 | */
|
37428 | unselectPoint: function unselectPoint(target, d, i) {
|
37429 | var $$ = this,
|
37430 | config = $$.config,
|
37431 | $el = $$.$el;
|
37432 | // remove selected-circle from low layer g
|
37433 | callFn(config.data_onunselected, $$.api, d, target.node()), $el.main.select("." + config_classes.selectedCircles + $$.getTargetSelectorSuffix(d.id)).selectAll("." + config_classes.selectedCircle + "-" + i).transition().duration(100).attr("r", 0).remove();
|
37434 | },
|
37435 |
|
37436 | /**
|
37437 | * Toggles the selection of points
|
37438 | * @param {boolean} selected whether or not to select.
|
37439 | * @param {object} target Target object
|
37440 | * @param {object} d Data object
|
37441 | * @param {number} i Index number
|
37442 | * @private
|
37443 | */
|
37444 | togglePoint: function togglePoint(selected, target, d, i) {
|
37445 | var method = (selected ? "" : "un") + "selectPoint";
|
37446 | this[method](target, d, i);
|
37447 | },
|
37448 |
|
37449 | /**
|
37450 | * Select a path
|
37451 | * @param {object} target Target path
|
37452 | * @param {object} d Data object
|
37453 | * @private
|
37454 | */
|
37455 | selectPath: function selectPath(target, d) {
|
37456 | var $$ = this,
|
37457 | config = $$.config;
|
37458 | callFn(config.data_onselected, $$.api, d, target.node()), config.interaction_brighten && target.transition().duration(100).style("fill", function () {
|
37459 | return color_rgb($$.color(d)).brighter(.75);
|
37460 | });
|
37461 | },
|
37462 |
|
37463 | /**
|
37464 | * Unelect a path
|
37465 | * @private
|
37466 | * @param {object} target Target path
|
37467 | * @param {object} d Data object
|
37468 | */
|
37469 | unselectPath: function unselectPath(target, d) {
|
37470 | var $$ = this,
|
37471 | config = $$.config;
|
37472 | callFn(config.data_onunselected, $$.api, d, target.node()), config.interaction_brighten && target.transition().duration(100).style("fill", function () {
|
37473 | return $$.color(d);
|
37474 | });
|
37475 | },
|
37476 |
|
37477 | /**
|
37478 | * Toggles the selection of lines
|
37479 | * @param {boolean} selected whether or not to select.
|
37480 | * @param {object} target Target object
|
37481 | * @param {object} d Data object
|
37482 | * @param {number} i Index number
|
37483 | * @private
|
37484 | */
|
37485 | togglePath: function togglePath(selected, target, d, i) {
|
37486 | this[(selected ? "" : "un") + "selectPath"](target, d, i);
|
37487 | },
|
37488 |
|
37489 | /**
|
37490 | * Returns the toggle method of the target
|
37491 | * @param {object} that shape
|
37492 | * @param {object} d Data object
|
37493 | * @returns {Function} toggle method
|
37494 | * @private
|
37495 | */
|
37496 | getToggle: function getToggle(that, d) {
|
37497 | var $$ = this;
|
37498 | return that.nodeName === "path" ? $$.togglePath : $$.isStepType(d) ? function () {} : // circle is hidden in step chart, so treat as within the click area
|
37499 | $$.togglePoint;
|
37500 | },
|
37501 |
|
37502 | /**
|
37503 | * Toggles the selection of shapes
|
37504 | * @param {object} that shape
|
37505 | * @param {object} d Data object
|
37506 | * @param {number} i Index number
|
37507 | * @private
|
37508 | */
|
37509 | toggleShape: function toggleShape(that, d, i) {
|
37510 | var toggledShape,
|
37511 | $$ = this,
|
37512 | config = $$.config,
|
37513 | main = $$.$el.main,
|
37514 | shape = src_select(that),
|
37515 | isSelected = shape.classed(config_classes.SELECTED),
|
37516 | toggle = $$.getToggle(that, d).bind($$);
|
37517 |
|
37518 | if (config.data_selection_enabled && config.data_selection_isselectable.bind($$.api)(d)) {
|
37519 | if (!config.data_selection_multiple) {
|
37520 | var selector = "." + config_classes.shapes;
|
37521 | config.data_selection_grouped && (selector += $$.getTargetSelectorSuffix(d.id)), main.selectAll(selector).selectAll("." + config_classes.shape).each(function (d, i) {
|
37522 | var shape = src_select(this);
|
37523 | shape.classed(config_classes.SELECTED) && (toggledShape = shape, toggle(!1, shape.classed(config_classes.SELECTED, !1), d, i));
|
37524 | });
|
37525 | }
|
37526 |
|
37527 | toggledShape && toggledShape.node() === shape.node() || (shape.classed(config_classes.SELECTED, !isSelected), toggle(!isSelected, shape, d, i));
|
37528 | }
|
37529 | }
|
37530 | }));
|
37531 | ;// CONCATENATED MODULE: ./src/ChartInternal/interactions/subchart.ts
|
37532 | /**
|
37533 | * Copyright (c) 2017 ~ present NAVER Corp.
|
37534 | * billboard.js project is licensed under the MIT license
|
37535 | */
|
37536 |
|
37537 |
|
37538 |
|
37539 |
|
37540 | /* harmony default export */ var interactions_subchart = ({
|
37541 | /**
|
37542 | * Initialize the brush.
|
37543 | * @private
|
37544 | */
|
37545 | initBrush: function initBrush() {
|
37546 | var $$ = this,
|
37547 | config = $$.config,
|
37548 | scale = $$.scale,
|
37549 | subchart = $$.$el.subchart,
|
37550 | isRotated = config.axis_rotated;
|
37551 | $$.brush = isRotated ? brushY() : brushX();
|
37552 |
|
37553 | // set "brush" event
|
37554 | var lastDomain,
|
37555 | timeout,
|
37556 | brushHandler = function () {
|
37557 | $$.redrawForBrush();
|
37558 | },
|
37559 | getBrushSize = function () {
|
37560 | var brush = $$.$el.svg.select("." + config_classes.brush + " .overlay"),
|
37561 | brushSize = {
|
37562 | width: 0,
|
37563 | height: 0
|
37564 | };
|
37565 | return brush.size() && (brushSize.width = +brush.attr("width"), brushSize.height = +brush.attr("height")), brushSize[isRotated ? "width" : "height"];
|
37566 | };
|
37567 |
|
37568 | // set the brush extent
|
37569 | $$.brush.on("start", function () {
|
37570 | $$.state.inputType === "touch" && $$.hideTooltip(), brushHandler();
|
37571 | }).on("brush", brushHandler).on("end", function () {
|
37572 | lastDomain = scale.x.orgDomain();
|
37573 | }), $$.brush.updateResize = function () {
|
37574 | var _this = this;
|
37575 |
|
37576 | timeout && clearTimeout(timeout), timeout = setTimeout(function () {
|
37577 | var selection = _this.getSelection();
|
37578 |
|
37579 | lastDomain && brushSelection(selection.node()) && _this.move(selection, lastDomain.map(scale.subX.orgScale()));
|
37580 | }, 0);
|
37581 | }, $$.brush.update = function () {
|
37582 | var extent = this.extent()();
|
37583 | return extent[1].filter(function (v) {
|
37584 | return isNaN(v);
|
37585 | }).length === 0 && subchart.main && subchart.main.select("." + config_classes.brush).call(this), this;
|
37586 | }, $$.brush.scale = function (scale) {
|
37587 | var h = config.subchart_size_height || getBrushSize(),
|
37588 | extent = $$.getExtent();
|
37589 | // [[x0, y0], [x1, y1]], where [x0, y0] is the top-left corner and [x1, y1] is the bottom-right corner
|
37590 | // when extent updates, brush selection also be re-applied
|
37591 | // https://github.com/d3/d3/issues/2918
|
37592 | !extent && scale.range ? extent = [[0, 0], [scale.range()[1], h]] : isArray(extent) && (extent = extent.map(function (v, i) {
|
37593 | return [v, i > 0 ? h : i];
|
37594 | })), isRotated && extent[1].reverse(), this.extent(extent), this.update();
|
37595 | }, $$.brush.getSelection = function () {
|
37596 | return (// @ts-ignore
|
37597 | subchart.main ? subchart.main.select("." + config_classes.brush) : src_select([])
|
37598 | );
|
37599 | };
|
37600 | },
|
37601 |
|
37602 | /**
|
37603 | * Initialize the subchart.
|
37604 | * @private
|
37605 | */
|
37606 | initSubchart: function initSubchart() {
|
37607 | var $$ = this,
|
37608 | config = $$.config,
|
37609 | _$$$state = $$.state,
|
37610 | clip = _$$$state.clip,
|
37611 | hasAxis = _$$$state.hasAxis,
|
37612 | _$$$$el = $$.$el,
|
37613 | defs = _$$$$el.defs,
|
37614 | svg = _$$$$el.svg,
|
37615 | subchart = _$$$$el.subchart,
|
37616 | axis = _$$$$el.axis;
|
37617 |
|
37618 | if (hasAxis) {
|
37619 | var visibility = config.subchart_show ? "visible" : "hidden",
|
37620 | clipId = clip.id + "-subchart",
|
37621 | clipPath = $$.getClipPath(clipId);
|
37622 | clip.idSubchart = clipId, $$.appendClip(defs, clipId), $$.initBrush(), subchart.main = svg.append("g").classed(config_classes.subchart, !0).attr("transform", $$.getTranslate("context"));
|
37623 | var main = subchart.main;
|
37624 | main.style("visibility", visibility), main.append("g").attr("clip-path", clipPath).attr("class", config_classes.chart), ["bar", "line", "bubble", "candlestick", "scatter"].forEach(function (v) {
|
37625 | var type = capitalize(/^(bubble|scatter)$/.test(v) ? "circle" : v);
|
37626 |
|
37627 | if ($$.hasType(v) || $$.hasTypeOf(type)) {
|
37628 | var chart = main.select("." + config_classes.chart),
|
37629 | chartClassName = config_classes["chart" + type + "s"];
|
37630 | chart.select("." + chartClassName).empty() && chart.append("g").attr("class", chartClassName);
|
37631 | }
|
37632 | }), main.append("g").attr("clip-path", clipPath).attr("class", config_classes.brush).call($$.brush), axis.subX = main.append("g").attr("class", config_classes.axisX).attr("transform", $$.getTranslate("subX")).attr("clip-path", config.axis_rotated ? "" : clip.pathXAxis).style("visibility", config.subchart_axis_x_show ? visibility : "hidden");
|
37633 | }
|
37634 | },
|
37635 |
|
37636 | /**
|
37637 | * Update sub chart
|
37638 | * @param {object} targets $$.data.targets
|
37639 | * @private
|
37640 | */
|
37641 | updateTargetsForSubchart: function updateTargetsForSubchart(targets) {
|
37642 | var $$ = this,
|
37643 | config = $$.config,
|
37644 | state = $$.state,
|
37645 | main = $$.$el.subchart.main;
|
37646 | config.subchart_show && (["bar", "line", "bubble", "candlestick", "scatter"].filter(function (v) {
|
37647 | return $$.hasType(v) || $$.hasTypeOf(capitalize(v));
|
37648 | }).forEach(function (v) {
|
37649 | var isPointType = /^(bubble|scatter)$/.test(v),
|
37650 | name = capitalize(isPointType ? "circle" : v),
|
37651 | chartClass = $$.getChartClass(name, !0),
|
37652 | shapeClass = $$.getClass(isPointType ? "circles" : v + "s", !0),
|
37653 | shapeChart = main.select("." + config_classes["chart" + (name + "s")]);
|
37654 |
|
37655 | if (isPointType) {
|
37656 | var circle = shapeChart.selectAll("." + config_classes.circles).data(targets.filter($$["is" + capitalize(v) + "Type"].bind($$))).attr("class", shapeClass);
|
37657 | circle.exit().remove(), circle.enter().append("g").attr("class", shapeClass);
|
37658 | } else {
|
37659 | var shapeUpdate = shapeChart.selectAll("." + config_classes["chart" + name]).attr("class", chartClass).data(targets.filter($$["is" + name + "Type"].bind($$))),
|
37660 | shapeEnter = shapeUpdate.enter().append("g").style("opacity", "0").attr("class", chartClass).append("g").attr("class", shapeClass);
|
37661 | // Area
|
37662 | shapeUpdate.exit().remove(), v === "line" && $$.hasTypeOf("Area") && shapeEnter.append("g").attr("class", $$.getClass("areas", !0));
|
37663 | }
|
37664 | }), main.selectAll("." + config_classes.brush + " rect").attr(config.axis_rotated ? "width" : "height", config.axis_rotated ? state.width2 : state.height2));
|
37665 | },
|
37666 |
|
37667 | /**
|
37668 | * Redraw subchart.
|
37669 | * @private
|
37670 | * @param {boolean} withSubchart whether or not to show subchart
|
37671 | * @param {number} duration duration
|
37672 | * @param {object} shape Shape's info
|
37673 | */
|
37674 | redrawSubchart: function redrawSubchart(withSubchart, duration, shape) {
|
37675 | var $$ = this,
|
37676 | config = $$.config,
|
37677 | main = $$.$el.subchart.main,
|
37678 | state = $$.state,
|
37679 | withTransition = !!duration;
|
37680 |
|
37681 | // subchart
|
37682 | if (main.style("visibility", config.subchart_show ? "visible" : "hidden"), config.subchart_show && (state.event && state.event.type === "zoom" && $$.brush.update(), withSubchart && (brushEmpty($$) || $$.brush.update(), Object.keys(shape.type).forEach(function (v) {
|
37683 | var name = capitalize(v),
|
37684 | drawFn = $$["generateDraw" + name](shape.indices[v], !0);
|
37685 | $$["update" + name](duration, !0), $$["redraw" + name](drawFn, withTransition, !0);
|
37686 | }), $$.hasType("bubble") || $$.hasType("scatter")))) // update subchart elements if needed
|
37687 | {
|
37688 | var cx = shape.pos.cx,
|
37689 | cy = $$.updateCircleY(!0);
|
37690 | $$.updateCircle(!0), $$.redrawCircle(cx, cy, withTransition, undefined, !0);
|
37691 | }
|
37692 | },
|
37693 |
|
37694 | /**
|
37695 | * Redraw the brush.
|
37696 | * @private
|
37697 | */
|
37698 | redrawForBrush: function redrawForBrush() {
|
37699 | var $$ = this,
|
37700 | _$$$config = $$.config,
|
37701 | onBrush = _$$$config.subchart_onbrush,
|
37702 | withY = _$$$config.zoom_rescale,
|
37703 | scale = $$.scale;
|
37704 | $$.redraw({
|
37705 | withTransition: !1,
|
37706 | withY: withY,
|
37707 | withSubchart: !1,
|
37708 | withUpdateXDomain: !0,
|
37709 | withDimension: !1
|
37710 | }), onBrush.bind($$.api)(scale.x.orgDomain());
|
37711 | },
|
37712 |
|
37713 | /**
|
37714 | * Transform context
|
37715 | * @param {boolean} withTransition indicates transition is enabled
|
37716 | * @param {object} transitions The return value of the generateTransitions method of Axis.
|
37717 | * @private
|
37718 | */
|
37719 | transformContext: function transformContext(withTransition, transitions) {
|
37720 | var subXAxis,
|
37721 | $$ = this,
|
37722 | main = $$.$el.subchart.main;
|
37723 | transitions && transitions.axisSubX ? subXAxis = transitions.axisSubX : (subXAxis = main.select("." + config_classes.axisX), withTransition && (subXAxis = subXAxis.transition())), main.attr("transform", $$.getTranslate("context")), subXAxis.attr("transform", $$.getTranslate("subX"));
|
37724 | },
|
37725 |
|
37726 | /**
|
37727 | * Get extent value
|
37728 | * @returns {Array} default extent
|
37729 | * @private
|
37730 | */
|
37731 | getExtent: function getExtent() {
|
37732 | var $$ = this,
|
37733 | config = $$.config,
|
37734 | scale = $$.scale,
|
37735 | extent = config.axis_x_extent;
|
37736 | if (extent) if (isFunction(extent)) extent = extent.bind($$.api)($$.getXDomain($$.data.targets), scale.subX);else if ($$.axis.isTimeSeries() && extent.every(isNaN)) {
|
37737 | var fn = parseDate.bind($$);
|
37738 | extent = extent.map(function (v) {
|
37739 | return scale.subX(fn(v));
|
37740 | });
|
37741 | }
|
37742 | return extent;
|
37743 | }
|
37744 | });
|
37745 | ;// CONCATENATED MODULE: ./src/ChartInternal/interactions/zoom.ts
|
37746 | /**
|
37747 | * Copyright (c) 2017 ~ present NAVER Corp.
|
37748 | * billboard.js project is licensed under the MIT license
|
37749 | */
|
37750 |
|
37751 |
|
37752 |
|
37753 |
|
37754 |
|
37755 |
|
37756 | /* harmony default export */ var interactions_zoom = ({
|
37757 | /**
|
37758 | * Initialize zoom.
|
37759 | * @private
|
37760 | */
|
37761 | initZoom: function initZoom() {
|
37762 | var $$ = this;
|
37763 | $$.scale.zoom = null, $$.generateZoom(), $$.initZoomBehaviour();
|
37764 | },
|
37765 |
|
37766 | /**
|
37767 | * Bind zoom event
|
37768 | * @param {boolean} bind Weather bind or unbound
|
37769 | * @private
|
37770 | */
|
37771 | bindZoomEvent: function bindZoomEvent(bind) {
|
37772 | bind === void 0 && (bind = !0);
|
37773 | var $$ = this,
|
37774 | config = $$.config,
|
37775 | main = $$.$el.main,
|
37776 | zoomEnabled = config.zoom_enabled,
|
37777 | eventRects = main.select("." + config_classes.eventRects);
|
37778 | zoomEnabled && bind ? !config.subchart_show && $$.bindZoomOnEventRect(eventRects, config.zoom_type) : bind === !1 && ($$.api.unzoom(), eventRects.on(".zoom", null).on(".drag", null));
|
37779 | },
|
37780 |
|
37781 | /**
|
37782 | * Generate zoom
|
37783 | * @private
|
37784 | */
|
37785 | generateZoom: function generateZoom() {
|
37786 | var $$ = this,
|
37787 | config = $$.config,
|
37788 | org = $$.org,
|
37789 | scale = $$.scale,
|
37790 | zoom = d3_zoom_src_zoom().duration(0).on("start", $$.onZoomStart.bind($$)).on("zoom", $$.onZoom.bind($$)).on("end", $$.onZoomEnd.bind($$));
|
37791 | // get zoom extent
|
37792 | // @ts-ignore
|
37793 | // @ts-ignore
|
37794 |
|
37795 | /**
|
37796 | * Update scale according zoom transform value
|
37797 | * @param {object} transform transform object
|
37798 | * @private
|
37799 | */
|
37800 | // @ts-ignore
|
37801 | zoom.orgScaleExtent = function () {
|
37802 | var extent = config.zoom_extent || [1, 10];
|
37803 | return [extent[0], Math.max($$.getMaxDataCount() / extent[1], extent[1])];
|
37804 | }, zoom.updateScaleExtent = function () {
|
37805 | var ratio = diffDomain($$.scale.x.orgDomain()) / diffDomain($$.getZoomDomain()),
|
37806 | extent = this.orgScaleExtent();
|
37807 | return this.scaleExtent([extent[0] * ratio, extent[1] * ratio]), this;
|
37808 | }, zoom.updateTransformScale = function (transform) {
|
37809 | org.xScale && org.xScale.range(scale.x.range());
|
37810 | // rescale from the original scale
|
37811 | var newScale = transform[config.axis_rotated ? "rescaleY" : "rescaleX"](org.xScale || scale.x),
|
37812 | domain = $$.trimXDomain(newScale.domain()),
|
37813 | rescale = config.zoom_rescale;
|
37814 | newScale.domain(domain, org.xDomain), scale.zoom = $$.getCustomizedScale(newScale), $$.axis.x.scale(scale.zoom), rescale && (!org.xScale && (org.xScale = scale.x.copy()), scale.x.domain(domain));
|
37815 | }, $$.zoom = zoom;
|
37816 | },
|
37817 |
|
37818 | /**
|
37819 | * 'start' event listener
|
37820 | * @param {object} event Event object
|
37821 | * @private
|
37822 | */
|
37823 | onZoomStart: function onZoomStart(event) {
|
37824 | var $$ = this,
|
37825 | sourceEvent = event.sourceEvent;
|
37826 | sourceEvent && ($$.zoom.startEvent = sourceEvent, $$.state.zooming = !0, callFn($$.config.zoom_onzoomstart, $$.api, event));
|
37827 | },
|
37828 |
|
37829 | /**
|
37830 | * 'zoom' event listener
|
37831 | * @param {object} event Event object
|
37832 | * @private
|
37833 | */
|
37834 | onZoom: function onZoom(event) {
|
37835 | var $$ = this,
|
37836 | config = $$.config,
|
37837 | scale = $$.scale,
|
37838 | org = $$.org,
|
37839 | sourceEvent = event.sourceEvent;
|
37840 |
|
37841 | if (config.zoom_enabled && event.sourceEvent && $$.filterTargetsToShow($$.data.targets).length !== 0 && (scale.zoom || !(sourceEvent.type.indexOf("touch") > -1) || sourceEvent.touches.length !== 1)) {
|
37842 | var isMousemove = sourceEvent.type === "mousemove",
|
37843 | isZoomOut = sourceEvent.wheelDelta < 0,
|
37844 | transform = event.transform;
|
37845 | !isMousemove && isZoomOut && scale.x.domain().every(function (v, i) {
|
37846 | return v !== org.xDomain[i];
|
37847 | }) && scale.x.domain(org.xDomain), $$.zoom.updateTransformScale(transform), $$.axis.isCategorized() && scale.x.orgDomain()[0] === org.xDomain[0] && scale.x.domain([org.xDomain[0] - 1e-10, scale.x.orgDomain()[1]]), $$.redraw({
|
37848 | withTransition: !1,
|
37849 | withY: config.zoom_rescale,
|
37850 | withSubchart: !1,
|
37851 | withEventRect: !1,
|
37852 | withDimension: !1
|
37853 | }), $$.state.cancelClick = isMousemove, callFn(config.zoom_onzoom, $$.api, scale.zoom.domain());
|
37854 | }
|
37855 | },
|
37856 |
|
37857 | /**
|
37858 | * 'end' event listener
|
37859 | * @param {object} event Event object
|
37860 | * @private
|
37861 | */
|
37862 | onZoomEnd: function onZoomEnd(event) {
|
37863 | var $$ = this,
|
37864 | config = $$.config,
|
37865 | scale = $$.scale,
|
37866 | startEvent = $$.zoom.startEvent,
|
37867 | e = event && event.sourceEvent;
|
37868 | startEvent && startEvent.type.indexOf("touch") > -1 && (startEvent = startEvent.changedTouches[0], e = e.changedTouches[0]);
|
37869 | // if click, do nothing. otherwise, click interaction will be canceled.
|
37870 | !startEvent || e && startEvent.clientX === e.clientX && startEvent.clientY === e.clientY || ($$.redrawEventRect(), $$.updateZoom(), $$.state.zooming = !1, callFn(config.zoom_onzoomend, $$.api, scale[scale.zoom ? "zoom" : "subX"].domain()));
|
37871 | },
|
37872 |
|
37873 | /**
|
37874 | * Get zoom domain
|
37875 | * @returns {Array} zoom domain
|
37876 | * @private
|
37877 | */
|
37878 | getZoomDomain: function getZoomDomain() {
|
37879 | var $$ = this,
|
37880 | config = $$.config,
|
37881 | org = $$.org,
|
37882 | _org$xDomain = org.xDomain,
|
37883 | min = _org$xDomain[0],
|
37884 | max = _org$xDomain[1];
|
37885 | return isDefined(config.zoom_x_min) && (min = getMinMax("min", [min, config.zoom_x_min])), isDefined(config.zoom_x_max) && (max = getMinMax("max", [max, config.zoom_x_max])), [min, max];
|
37886 | },
|
37887 |
|
37888 | /**
|
37889 | * Update zoom
|
37890 | * @param {boolean} force Force unzoom
|
37891 | * @private
|
37892 | */
|
37893 | updateZoom: function updateZoom(force) {
|
37894 | var $$ = this,
|
37895 | _$$$scale = $$.scale,
|
37896 | subX = _$$$scale.subX,
|
37897 | x = _$$$scale.x,
|
37898 | zoom = _$$$scale.zoom;
|
37899 |
|
37900 | if (zoom) {
|
37901 | var zoomDomain = zoom.domain(),
|
37902 | xDomain = subX.domain(),
|
37903 | delta = .015,
|
37904 | isfullyShown = (zoomDomain[0] <= xDomain[0] || zoomDomain[0] - delta <= xDomain[0]) && (xDomain[1] <= zoomDomain[1] || xDomain[1] <= zoomDomain[1] - delta);
|
37905 | (force || isfullyShown) && ($$.axis.x.scale(subX), x.domain(subX.orgDomain()), $$.scale.zoom = null);
|
37906 | }
|
37907 | },
|
37908 |
|
37909 | /**
|
37910 | * Attach zoom event on <rect>
|
37911 | * @param {d3.selection} eventRects evemt <rect> element
|
37912 | * @param {string} type zoom type
|
37913 | * @private
|
37914 | */
|
37915 | bindZoomOnEventRect: function bindZoomOnEventRect(eventRects, type) {
|
37916 | var $$ = this,
|
37917 | behaviour = type === "drag" ? $$.zoomBehaviour : $$.zoom;
|
37918 | // Since Chrome 89, wheel zoom not works properly
|
37919 | // Applying the workaround: https://github.com/d3/d3-zoom/issues/231#issuecomment-802305692
|
37920 | $$.$el.svg.on("wheel", function () {}), eventRects.call(behaviour).on("dblclick.zoom", null);
|
37921 | },
|
37922 |
|
37923 | /**
|
37924 | * Initialize the drag behaviour used for zooming.
|
37925 | * @private
|
37926 | */
|
37927 | initZoomBehaviour: function initZoomBehaviour() {
|
37928 | var zoomRect,
|
37929 | $$ = this,
|
37930 | config = $$.config,
|
37931 | state = $$.state,
|
37932 | isRotated = config.axis_rotated,
|
37933 | start = 0,
|
37934 | end = 0,
|
37935 | prop = {
|
37936 | axis: isRotated ? "y" : "x",
|
37937 | attr: isRotated ? "height" : "width",
|
37938 | index: isRotated ? 1 : 0
|
37939 | };
|
37940 | $$.zoomBehaviour = drag().clickDistance(4).on("start", function (event) {
|
37941 | state.event = event, $$.setDragStatus(!0), $$.unselectRect(), zoomRect || (zoomRect = $$.$el.main.append("rect").attr("clip-path", state.clip.path).attr("class", config_classes.zoomBrush).attr("width", isRotated ? state.width : 0).attr("height", isRotated ? 0 : state.height)), start = getPointer(event, this)[prop.index], end = start, zoomRect.attr(prop.axis, start).attr(prop.attr, 0), $$.onZoomStart(event);
|
37942 | }).on("drag", function (event) {
|
37943 | end = getPointer(event, this)[prop.index], zoomRect.attr(prop.axis, Math.min(start, end)).attr(prop.attr, Math.abs(end - start));
|
37944 | }).on("end", function (event) {
|
37945 | var _ref,
|
37946 | scale = $$.scale.zoom || $$.scale.x;
|
37947 |
|
37948 | if (state.event = event, $$.setDragStatus(!1), zoomRect.attr(prop.axis, 0).attr(prop.attr, 0), start > end && (_ref = [end, start], start = _ref[0], end = _ref[1], _ref), start < 0 && (end += Math.abs(start), start = 0), start !== end) $$.api.zoom([start, end].map(function (v) {
|
37949 | return scale.invert(v);
|
37950 | })), $$.onZoomEnd(event);else if ($$.isMultipleX()) $$.clickHandlerForMultipleXS.bind(this)($$);else {
|
37951 | var _getPointer = getPointer(event),
|
37952 | x = _getPointer[0],
|
37953 | y = _getPointer[1],
|
37954 | target = browser_doc.elementFromPoint(x, y);
|
37955 |
|
37956 | $$.clickHandlerForSingleX.bind(target)(src_select(target).datum(), $$);
|
37957 | }
|
37958 | });
|
37959 | },
|
37960 | setZoomResetButton: function setZoomResetButton() {
|
37961 | var $$ = this,
|
37962 | config = $$.config,
|
37963 | resetButton = config.zoom_resetButton;
|
37964 | resetButton && config.zoom_type === "drag" && ($$.zoom.resetBtn ? $$.zoom.resetBtn.style("display", null) : $$.zoom.resetBtn = $$.$el.chart.append("div").classed(config_classes.button, !0).append("span").on("click", function () {
|
37965 | isFunction(resetButton.onclick) && resetButton.onclick.bind($$.api)(this), $$.api.unzoom();
|
37966 | }).classed(config_classes.buttonZoomReset, !0).text(resetButton.text || "Reset Zoom"));
|
37967 | }
|
37968 | });
|
37969 | ;// CONCATENATED MODULE: ./src/config/Options/data/selection.ts
|
37970 | /**
|
37971 | * Copyright (c) 2017 ~ present NAVER Corp.
|
37972 | * billboard.js project is licensed under the MIT license
|
37973 | */
|
37974 |
|
37975 | /**
|
37976 | * data.selection config options
|
37977 | */
|
37978 | /* harmony default export */ var data_selection = ({
|
37979 | /**
|
37980 | * Set data selection enabled<br><br>
|
37981 | * If this option is set true, we can select the data points and get/set its state of selection by API (e.g. select, unselect, selected).
|
37982 | * - **NOTE:** for ESM imports, needs to import 'selection' exports and instantiate it by calling `selection()`.
|
37983 | * - `enabled: selection()`
|
37984 | * @name data․selection․enabled
|
37985 | * @memberof Options
|
37986 | * @type {boolean}
|
37987 | * @default false
|
37988 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Data.DataSelection)
|
37989 | * @example
|
37990 | * data: {
|
37991 | * selection: {
|
37992 | * enabled: true
|
37993 | * }
|
37994 | * }
|
37995 | * @example
|
37996 | * // importing ESM
|
37997 | * import bb, {selection} from "billboard.js";
|
37998 | *
|
37999 | * data: {
|
38000 | * selection: {
|
38001 | * enabled: selection(),
|
38002 | * ...
|
38003 | * }
|
38004 | * }
|
38005 | */
|
38006 | data_selection_enabled: !1,
|
38007 |
|
38008 | /**
|
38009 | * Set grouped selection enabled.<br><br>
|
38010 | * If this option set true, multiple data points that have same x value will be selected by one selection.
|
38011 | * @name data․selection․grouped
|
38012 | * @memberof Options
|
38013 | * @type {boolean}
|
38014 | * @default false
|
38015 | * @example
|
38016 | * data: {
|
38017 | * selection: {
|
38018 | * grouped: true
|
38019 | * }
|
38020 | * }
|
38021 | */
|
38022 | data_selection_grouped: !1,
|
38023 |
|
38024 | /**
|
38025 | * Set a callback for each data point to determine if it's selectable or not.<br><br>
|
38026 | * The callback will receive d as an argument and it has some parameters like id, value, index. This callback should return boolean.
|
38027 | * @name data․selection․isselectable
|
38028 | * @memberof Options
|
38029 | * @type {Function}
|
38030 | * @default function() { return true; }
|
38031 | * @example
|
38032 | * data: {
|
38033 | * selection: {
|
38034 | * isselectable: function(d) { ... }
|
38035 | * }
|
38036 | * }
|
38037 | */
|
38038 | data_selection_isselectable: function data_selection_isselectable() {
|
38039 | return !0;
|
38040 | },
|
38041 |
|
38042 | /**
|
38043 | * Set multiple data points selection enabled.<br><br>
|
38044 | * If this option set true, multile data points can have the selected state at the same time. If false set, only one data point can have the selected state and the others will be unselected when the new data point is selected.
|
38045 | * @name data․selection․multiple
|
38046 | * @memberof Options
|
38047 | * @type {boolean}
|
38048 | * @default true
|
38049 | * @example
|
38050 | * data: {
|
38051 | * selection: {
|
38052 | * multiple: false
|
38053 | * }
|
38054 | * }
|
38055 | */
|
38056 | data_selection_multiple: !0,
|
38057 |
|
38058 | /**
|
38059 | * Enable to select data points by dragging.
|
38060 | * If this option set true, data points can be selected by dragging.
|
38061 | * - **NOTE:** If this option set true, scrolling on the chart will be disabled because dragging event will handle the event.
|
38062 | * @name data․selection․draggable
|
38063 | * @memberof Options
|
38064 | * @type {boolean}
|
38065 | * @default false
|
38066 | * @example
|
38067 | * data: {
|
38068 | * selection: {
|
38069 | * draggable: true
|
38070 | * }
|
38071 | * }
|
38072 | */
|
38073 | data_selection_draggable: !1,
|
38074 |
|
38075 | /**
|
38076 | * Set a callback for on data selection.
|
38077 | * @name data․onselected
|
38078 | * @memberof Options
|
38079 | * @type {Function}
|
38080 | * @default function() {}
|
38081 | * @example
|
38082 | * data: {
|
38083 | * onselected: function(d, element) {
|
38084 | * // d - ex) {x: 4, value: 150, id: "data1", index: 4, name: "data1"}
|
38085 | * // element - <circle>
|
38086 | * ...
|
38087 | * }
|
38088 | * }
|
38089 | */
|
38090 | data_onselected: function data_onselected() {},
|
38091 |
|
38092 | /**
|
38093 | * Set a callback for on data un-selection.
|
38094 | * @name data․onunselected
|
38095 | * @memberof Options
|
38096 | * @type {Function}
|
38097 | * @default function() {}
|
38098 | * @example
|
38099 | * data: {
|
38100 | * onunselected: function(d, element) {
|
38101 | * // d - ex) {x: 4, value: 150, id: "data1", index: 4, name: "data1"}
|
38102 | * // element - <circle>
|
38103 | * ...
|
38104 | * }
|
38105 | * }
|
38106 | */
|
38107 | data_onunselected: function data_onunselected() {}
|
38108 | });
|
38109 | ;// CONCATENATED MODULE: ./src/config/Options/interaction/subchart.ts
|
38110 | /**
|
38111 | * Copyright (c) 2017 ~ present NAVER Corp.
|
38112 | * billboard.js project is licensed under the MIT license
|
38113 | */
|
38114 |
|
38115 | /**
|
38116 | * x Axis config options
|
38117 | */
|
38118 | /* harmony default export */ var interaction_subchart = ({
|
38119 | /**
|
38120 | * Set subchart options.
|
38121 | * - **NOTE:** Not supported for `bubble`, `scatter` and non-Axis based(pie, donut, gauge, radar) types.
|
38122 | * @name subchart
|
38123 | * @memberof Options
|
38124 | * @type {object}
|
38125 | * @property {object} subchart Subchart object
|
38126 | * @property {boolean} [subchart.show=false] Show sub chart on the bottom of the chart.
|
38127 | * - **NOTE:** for ESM imports, needs to import 'subchart' exports and instantiate it by calling `subchart()`.
|
38128 | * - `show: subchart()`
|
38129 | * @property {boolean} [subchart.axis.x.show=true] Show or hide x axis.
|
38130 | * @property {boolean} [subchart.axis.x.tick.show=true] Show or hide x axis tick line.
|
38131 | * @property {boolean} [subchart.axis.x.tick.text.show=true] Show or hide x axis tick text.
|
38132 | * @property {number} [subchart.size.height] Change the height of the subchart.
|
38133 | * @property {Function} [subchart.onbrush] Set callback for brush event.<br>
|
38134 | * Specified function receives the current zoomed x domain.
|
38135 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Interaction.SubChart)
|
38136 | * @example
|
38137 | * subchart: {
|
38138 | * show: true,
|
38139 | * size: {
|
38140 | * height: 20
|
38141 | * },
|
38142 | * axis: {
|
38143 | * x: {
|
38144 | * show: true,
|
38145 | * tick: {
|
38146 | * show: true,
|
38147 | * text: {
|
38148 | * show: false
|
38149 | * }
|
38150 | * }
|
38151 | * }
|
38152 | * },
|
38153 | * onbrush: function(domain) { ... }
|
38154 | * }
|
38155 | * @example
|
38156 | * // importing ESM
|
38157 | * import bb, {subchart} from "billboard.js";
|
38158 | *
|
38159 | * subchart: {
|
38160 | * show: subchart(),
|
38161 | * ...
|
38162 | * }
|
38163 | */
|
38164 | subchart_show: !1,
|
38165 | subchart_size_height: 60,
|
38166 | subchart_axis_x_show: !0,
|
38167 | subchart_axis_x_tick_show: !0,
|
38168 | subchart_axis_x_tick_text_show: !0,
|
38169 | subchart_onbrush: function subchart_onbrush() {}
|
38170 | });
|
38171 | ;// CONCATENATED MODULE: ./src/config/Options/interaction/zoom.ts
|
38172 | /**
|
38173 | * Copyright (c) 2017 ~ present NAVER Corp.
|
38174 | * billboard.js project is licensed under the MIT license
|
38175 | */
|
38176 |
|
38177 | /**
|
38178 | * zoom config options
|
38179 | */
|
38180 | /* harmony default export */ var interaction_zoom = ({
|
38181 | /**
|
38182 | * Set zoom options
|
38183 | * @name zoom
|
38184 | * @memberof Options
|
38185 | * @type {object}
|
38186 | * @property {object} zoom Zoom object
|
38187 | * @property {boolean} [zoom.enabled=false] Enable zooming.
|
38188 | * - **NOTE:** for ESM imports, needs to import 'zoom' exports and instantiate it by calling `zoom()`.
|
38189 | * - `enabled: zoom()`
|
38190 | * @property {string} [zoom.type='wheel'] Set zoom interaction type.
|
38191 | * - **Available types:**
|
38192 | * - wheel
|
38193 | * - drag
|
38194 | * @property {boolean} [zoom.rescale=false] Enable to rescale after zooming.<br>
|
38195 | * If true set, y domain will be updated according to the zoomed region.
|
38196 | * @property {Array} [zoom.extent=[1, 10]] Change zoom extent.
|
38197 | * @property {number|Date} [zoom.x.min] Set x Axis minimum zoom range
|
38198 | * @property {number|Date} [zoom.x.max] Set x Axis maximum zoom range
|
38199 | * @property {Function} [zoom.onzoomstart=undefined] Set callback that is called when zooming starts.<br>
|
38200 | * Specified function receives the zoom event.
|
38201 | * @property {Function} [zoom.onzoom=undefined] Set callback that is called when the chart is zooming.<br>
|
38202 | * Specified function receives the zoomed domain.
|
38203 | * @property {Function} [zoom.onzoomend=undefined] Set callback that is called when zooming ends.<br>
|
38204 | * Specified function receives the zoomed domain.
|
38205 | * @property {boolean|object} [zoom.resetButton=true] Set to display zoom reset button for 'drag' type zoom
|
38206 | * @property {Function} [zoom.resetButton.onclick] Set callback when clicks the reset button. The callback will receive reset button element reference as argument.
|
38207 | * @property {string} [zoom.resetButton.text='Reset Zoom'] Text value for zoom reset button.
|
38208 | * @see [Demo:zoom](https://naver.github.io/billboard.js/demo/#Interaction.Zoom)
|
38209 | * @see [Demo:drag zoom](https://naver.github.io/billboard.js/demo/#Interaction.DragZoom)
|
38210 | * @example
|
38211 | * zoom: {
|
38212 | * enabled: true,
|
38213 | * type: "drag",
|
38214 | * rescale: true,
|
38215 | * extent: [1, 100] // enable more zooming
|
38216 | * x: {
|
38217 | * min: -1, // set min range
|
38218 | * max: 10 // set max range
|
38219 | * },
|
38220 | * onzoomstart: function(event) { ... },
|
38221 | * onzoom: function(domain) { ... },
|
38222 | * onzoomend: function(domain) { ... },
|
38223 | *
|
38224 | * // show reset button when is zoomed-in
|
38225 | * resetButton: true,
|
38226 | *
|
38227 | * resetButton: {
|
38228 | * // onclick callback when reset button is clicked
|
38229 | * onclick: function(button) {
|
38230 | * button; // Reset button element reference
|
38231 | * ...
|
38232 | * },
|
38233 | *
|
38234 | * // customized text value for reset zoom button
|
38235 | * text: "Unzoom"
|
38236 | * }
|
38237 | * }
|
38238 | * @example
|
38239 | * // importing ESM
|
38240 | * import bb, {zoom} from "billboard.js";
|
38241 | *
|
38242 | * zoom: {
|
38243 | * enabled: zoom(),
|
38244 | * ...
|
38245 | * }
|
38246 | */
|
38247 | zoom_enabled: !1,
|
38248 | zoom_type: "wheel",
|
38249 | zoom_extent: undefined,
|
38250 | zoom_privileged: !1,
|
38251 | zoom_rescale: !1,
|
38252 | zoom_onzoom: undefined,
|
38253 | zoom_onzoomstart: undefined,
|
38254 | zoom_onzoomend: undefined,
|
38255 | zoom_resetButton: !0,
|
38256 | zoom_x_min: undefined,
|
38257 | zoom_x_max: undefined
|
38258 | });
|
38259 | ;// CONCATENATED MODULE: ./src/config/resolver/interaction.ts
|
38260 | /**
|
38261 | * Copyright (c) 2017 ~ present NAVER Corp.
|
38262 | * billboard.js project is licensed under the MIT license
|
38263 | */
|
38264 |
|
38265 |
|
38266 |
|
38267 | // Chart
|
38268 |
|
38269 |
|
38270 |
|
38271 | // ChartInternal
|
38272 |
|
38273 |
|
38274 |
|
38275 | // Axis based options
|
38276 |
|
38277 |
|
38278 |
|
38279 |
|
38280 |
|
38281 |
|
38282 | var _selectionModule = function selectionModule() {
|
38283 | return util_extend(ChartInternal.prototype, internals_selection), util_extend(Chart.prototype, api_selection), Options.setOptions([data_selection]), (_selectionModule = function selectionModule() {
|
38284 | return !0;
|
38285 | })();
|
38286 | },
|
38287 | subchartModule = function () {
|
38288 | return util_extend(ChartInternal.prototype, interactions_subchart), util_extend(Chart.prototype, subchart), Options.setOptions([interaction_subchart]), (subchartModule = function () {
|
38289 | return !0;
|
38290 | })();
|
38291 | },
|
38292 | zoomModule = function () {
|
38293 | return util_extend(ChartInternal.prototype, interactions_zoom), util_extend(Chart.prototype, api_zoom), Options.setOptions([interaction_zoom]), (zoomModule = function () {
|
38294 | return !0;
|
38295 | })();
|
38296 | };
|
38297 | ;// CONCATENATED MODULE: ./src/core.ts
|
38298 | /**
|
38299 | * Copyright (c) 2017 ~ present NAVER Corp.
|
38300 | * billboard project is licensed under the MIT license
|
38301 | */
|
38302 |
|
38303 | // eslint-disable-next-line no-use-before-define
|
38304 |
|
38305 |
|
38306 | var _defaults = {},
|
38307 | bb = {
|
38308 | /**
|
38309 | * Version information
|
38310 | * @property {string} version version
|
38311 | * @example
|
38312 | * bb.version; // "1.0.0"
|
38313 | * @memberof bb
|
38314 | */
|
38315 | version: "3.0.1",
|
38316 |
|
38317 | /**
|
38318 | * Generate chart
|
38319 | * - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when:
|
38320 | * - Unused option value is given.
|
38321 | * - ex) For `data.type="pie"` option, setting 'axis' option can cause unexpected generation error.
|
38322 | * - Insufficient value is given for certain option used.
|
38323 | * - ex) `data: { x: "x", columns: [["x"], ["data1", 30, 200, 100]] }`
|
38324 | * @param {Options} config chart options
|
38325 | * @memberof bb
|
38326 | * @returns {Chart}
|
38327 | * @see {@link Options} for different generation options
|
38328 | * @see {@link Chart} for different methods API
|
38329 | * @example
|
38330 | * <!-- chart holder -->
|
38331 | * <div id="LineChart"></div>
|
38332 | * @example
|
38333 | * // Generate chart with options
|
38334 | * var chart = bb.generate({
|
38335 | * "bindto": "#LineChart"
|
38336 | * "data": {
|
38337 | * "columns": [
|
38338 | * ["data1", 30, 200, 100, 400, 150, 250],
|
38339 | * ["data2", 50, 20, 10, 40, 15, 25]
|
38340 | * ],
|
38341 | * "type": "line"
|
38342 | * }
|
38343 | * });
|
38344 | *
|
38345 | * // call some API
|
38346 | * // ex) get the data of 'data1'
|
38347 | * chart.data("data1");
|
38348 | * @example
|
38349 | * // Generate chart by importing ESM
|
38350 | * // Import types to be used only, where this will make smaller bundle size.
|
38351 | * import bb, {
|
38352 | * area,
|
38353 | * areaLineRange,
|
38354 | * areaSpline,
|
38355 | * areaSplineRange,
|
38356 | * areaStep,
|
38357 | * bar,
|
38358 | * bubble,
|
38359 | * donut,
|
38360 | * gauge,
|
38361 | * line,
|
38362 | * pie,
|
38363 | * radar,
|
38364 | * scatter,
|
38365 | * spline,
|
38366 | * step
|
38367 | * }
|
38368 | *
|
38369 | * bb.generate({
|
38370 | * "bindto": "#LineChart"
|
38371 | * "data": {
|
38372 | * "columns": [
|
38373 | * ["data1", 30, 200, 100, 400, 150, 250],
|
38374 | * ["data2", 50, 20, 10, 40, 15, 25]
|
38375 | * ]
|
38376 | * },
|
38377 | * type: line(),
|
38378 | *
|
38379 | * // or
|
38380 | * types: {
|
38381 | * data1: bar(),
|
38382 | * data2: step()
|
38383 | * }
|
38384 | * });
|
38385 | */
|
38386 | generate: function generate(config) {
|
38387 | var options = mergeObj({}, _defaults, config),
|
38388 | inst = new Chart(options);
|
38389 | return inst.internal.charts = this.instance, this.instance.push(inst), inst;
|
38390 | },
|
38391 |
|
38392 | /**
|
38393 | * Set or get global default options.
|
38394 | * - **NOTE:**
|
38395 | * - The options values settings are valid within page context only.
|
38396 | * - If is called multiple times, will override the last value.
|
38397 | * @param {Options} options chart options
|
38398 | * @memberof bb
|
38399 | * @returns {Options}
|
38400 | * @see {@link Options}
|
38401 | * @example
|
38402 | * // Set same option value as for `.generate()`
|
38403 | * bb.defaults({
|
38404 | * data: {
|
38405 | * type: "bar"
|
38406 | * }
|
38407 | * });
|
38408 | *
|
38409 | * bb.defaults(); // {data:{type: "bar"}}
|
38410 | *
|
38411 | * // data.type defaults to 'bar'
|
38412 | * var chart = bb.generate({ ... });
|
38413 | */
|
38414 | defaults: function defaults(options) {
|
38415 | return isObject(options) && (_defaults = options), _defaults;
|
38416 | },
|
38417 |
|
38418 | /**
|
38419 | * An array containing instance created
|
38420 | * @property {Array} instance instance array
|
38421 | * @example
|
38422 | * // generate charts
|
38423 | * var chart1 = bb.generate(...);
|
38424 | * var chart2 = bb.generate(...);
|
38425 | *
|
38426 | * bb.instance; // [ chart1, chart2, ... ]
|
38427 | * @memberof bb
|
38428 | */
|
38429 | instance: [],
|
38430 |
|
38431 | /**
|
38432 | * Namespace for plugins
|
38433 | * @property {object} plugin plugin namespace
|
38434 | * @example
|
38435 | * // Stanford diagram plugin
|
38436 | * bb.plugin.stanford;
|
38437 | * @memberof bb
|
38438 | */
|
38439 | plugin: {}
|
38440 | };
|
38441 | /**
|
38442 | * @namespace bb
|
38443 | * @version 3.0.1
|
38444 | */
|
38445 | ;// CONCATENATED MODULE: ./src/index.ts
|
38446 | /**
|
38447 | * Copyright (c) 2017 ~ present NAVER Corp.
|
38448 | * billboard project is licensed under the MIT license
|
38449 | */
|
38450 |
|
38451 | // extends shape modules
|
38452 |
|
38453 | Object.keys(resolver_shape_namespaceObject).forEach(function (v) {
|
38454 | return resolver_shape_namespaceObject[v]();
|
38455 | }), Object.keys(resolver_interaction_namespaceObject).forEach(function (v) {
|
38456 | return resolver_interaction_namespaceObject[v]();
|
38457 | });
|
38458 |
|
38459 |
|
38460 | /***/ }),
|
38461 | /* 384 */
|
38462 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
38463 |
|
38464 | module.exports = __webpack_require__(382);
|
38465 |
|
38466 |
|
38467 | /***/ })
|
38468 | /******/ ]);
|
38469 | /************************************************************************/
|
38470 | /******/ // The module cache
|
38471 | /******/ var __webpack_module_cache__ = {};
|
38472 | /******/
|
38473 | /******/ // The require function
|
38474 | /******/ function __webpack_require__(moduleId) {
|
38475 | /******/ // Check if module is in cache
|
38476 | /******/ var cachedModule = __webpack_module_cache__[moduleId];
|
38477 | /******/ if (cachedModule !== undefined) {
|
38478 | /******/ return cachedModule.exports;
|
38479 | /******/ }
|
38480 | /******/ // Create a new module (and put it into the cache)
|
38481 | /******/ var module = __webpack_module_cache__[moduleId] = {
|
38482 | /******/ // no module.id needed
|
38483 | /******/ // no module.loaded needed
|
38484 | /******/ exports: {}
|
38485 | /******/ };
|
38486 | /******/
|
38487 | /******/ // Execute the module function
|
38488 | /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
38489 | /******/
|
38490 | /******/ // Return the exports of the module
|
38491 | /******/ return module.exports;
|
38492 | /******/ }
|
38493 | /******/
|
38494 | /************************************************************************/
|
38495 | /******/ /* webpack/runtime/compat get default export */
|
38496 | /******/ !function() {
|
38497 | /******/ // getDefaultExport function for compatibility with non-harmony modules
|
38498 | /******/ __webpack_require__.n = function(module) {
|
38499 | /******/ var getter = module && module.__esModule ?
|
38500 | /******/ function() { return module['default']; } :
|
38501 | /******/ function() { return module; };
|
38502 | /******/ __webpack_require__.d(getter, { a: getter });
|
38503 | /******/ return getter;
|
38504 | /******/ };
|
38505 | /******/ }();
|
38506 | /******/
|
38507 | /******/ /* webpack/runtime/define property getters */
|
38508 | /******/ !function() {
|
38509 | /******/ // define getter functions for harmony exports
|
38510 | /******/ __webpack_require__.d = function(exports, definition) {
|
38511 | /******/ for(var key in definition) {
|
38512 | /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
38513 | /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
38514 | /******/ }
|
38515 | /******/ }
|
38516 | /******/ };
|
38517 | /******/ }();
|
38518 | /******/
|
38519 | /******/ /* webpack/runtime/hasOwnProperty shorthand */
|
38520 | /******/ !function() {
|
38521 | /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
38522 | /******/ }();
|
38523 | /******/
|
38524 | /******/ /* webpack/runtime/make namespace object */
|
38525 | /******/ !function() {
|
38526 | /******/ // define __esModule on exports
|
38527 | /******/ __webpack_require__.r = function(exports) {
|
38528 | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
38529 | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
38530 | /******/ }
|
38531 | /******/ Object.defineProperty(exports, '__esModule', { value: true });
|
38532 | /******/ };
|
38533 | /******/ }();
|
38534 | /******/
|
38535 | /************************************************************************/
|
38536 | /******/
|
38537 | /******/ // startup
|
38538 | /******/ // Load entry module and return exports
|
38539 | /******/ // This entry module is referenced by other modules so it can't be inlined
|
38540 | /******/ __webpack_require__(0);
|
38541 | /******/ __webpack_require__(382);
|
38542 | /******/ var __webpack_exports__ = __webpack_require__(383);
|
38543 | /******/
|
38544 | /******/ return __webpack_exports__;
|
38545 | /******/ })()
|
38546 | ;
|
38547 | }); |
\ | No newline at end of file |