1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 | (function webpackUniversalModuleDefinition(root, factory) {
|
25 | if(typeof exports === 'object' && typeof module === 'object')
|
26 | module.exports = factory();
|
27 | else if(typeof define === 'function' && define.amd)
|
28 | define([], factory);
|
29 | else {
|
30 | var a = factory();
|
31 | for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
32 | }
|
33 | })(this, function() {
|
34 | return (function() {
|
35 | var __webpack_modules__ = ([
|
36 |
|
37 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
38 |
|
39 | __webpack_require__(1);
|
40 | __webpack_require__(82);
|
41 | __webpack_require__(83);
|
42 | __webpack_require__(84);
|
43 | __webpack_require__(85);
|
44 | __webpack_require__(86);
|
45 | __webpack_require__(87);
|
46 | __webpack_require__(88);
|
47 | __webpack_require__(89);
|
48 | __webpack_require__(90);
|
49 | __webpack_require__(91);
|
50 | __webpack_require__(92);
|
51 | __webpack_require__(93);
|
52 | __webpack_require__(94);
|
53 | __webpack_require__(95);
|
54 | __webpack_require__(96);
|
55 | __webpack_require__(111);
|
56 | __webpack_require__(113);
|
57 | __webpack_require__(116);
|
58 | __webpack_require__(118);
|
59 | __webpack_require__(120);
|
60 | __webpack_require__(122);
|
61 | __webpack_require__(123);
|
62 | __webpack_require__(124);
|
63 | __webpack_require__(125);
|
64 | __webpack_require__(127);
|
65 | __webpack_require__(128);
|
66 | __webpack_require__(130);
|
67 | __webpack_require__(134);
|
68 | __webpack_require__(135);
|
69 | __webpack_require__(136);
|
70 | __webpack_require__(137);
|
71 | __webpack_require__(141);
|
72 | __webpack_require__(142);
|
73 | __webpack_require__(144);
|
74 | __webpack_require__(145);
|
75 | __webpack_require__(146);
|
76 | __webpack_require__(149);
|
77 | __webpack_require__(150);
|
78 | __webpack_require__(151);
|
79 | __webpack_require__(152);
|
80 | __webpack_require__(153);
|
81 | __webpack_require__(158);
|
82 | __webpack_require__(160);
|
83 | __webpack_require__(161);
|
84 | __webpack_require__(162);
|
85 | __webpack_require__(163);
|
86 | __webpack_require__(170);
|
87 | __webpack_require__(172);
|
88 | __webpack_require__(175);
|
89 | __webpack_require__(176);
|
90 | __webpack_require__(177);
|
91 | __webpack_require__(178);
|
92 | __webpack_require__(179);
|
93 | __webpack_require__(180);
|
94 | __webpack_require__(184);
|
95 | __webpack_require__(185);
|
96 | __webpack_require__(187);
|
97 | __webpack_require__(188);
|
98 | __webpack_require__(189);
|
99 | __webpack_require__(191);
|
100 | __webpack_require__(192);
|
101 | __webpack_require__(193);
|
102 | __webpack_require__(194);
|
103 | __webpack_require__(195);
|
104 | __webpack_require__(196);
|
105 | __webpack_require__(204);
|
106 | __webpack_require__(206);
|
107 | __webpack_require__(207);
|
108 | __webpack_require__(208);
|
109 | __webpack_require__(210);
|
110 | __webpack_require__(211);
|
111 | __webpack_require__(213);
|
112 | __webpack_require__(214);
|
113 | __webpack_require__(216);
|
114 | __webpack_require__(217);
|
115 | __webpack_require__(218);
|
116 | __webpack_require__(219);
|
117 | __webpack_require__(220);
|
118 | __webpack_require__(221);
|
119 | __webpack_require__(222);
|
120 | __webpack_require__(223);
|
121 | __webpack_require__(224);
|
122 | __webpack_require__(225);
|
123 | __webpack_require__(226);
|
124 | __webpack_require__(230);
|
125 | __webpack_require__(231);
|
126 | __webpack_require__(233);
|
127 | __webpack_require__(235);
|
128 | __webpack_require__(236);
|
129 | __webpack_require__(237);
|
130 | __webpack_require__(238);
|
131 | __webpack_require__(239);
|
132 | __webpack_require__(241);
|
133 | __webpack_require__(243);
|
134 | __webpack_require__(244);
|
135 | __webpack_require__(245);
|
136 | __webpack_require__(247);
|
137 | __webpack_require__(248);
|
138 | __webpack_require__(250);
|
139 | __webpack_require__(251);
|
140 | __webpack_require__(252);
|
141 | __webpack_require__(253);
|
142 | __webpack_require__(255);
|
143 | __webpack_require__(256);
|
144 | __webpack_require__(257);
|
145 | __webpack_require__(258);
|
146 | __webpack_require__(259);
|
147 | __webpack_require__(260);
|
148 | __webpack_require__(261);
|
149 | __webpack_require__(262);
|
150 | __webpack_require__(264);
|
151 | __webpack_require__(265);
|
152 | __webpack_require__(266);
|
153 | __webpack_require__(267);
|
154 | __webpack_require__(268);
|
155 | __webpack_require__(269);
|
156 | __webpack_require__(270);
|
157 | __webpack_require__(271);
|
158 | __webpack_require__(272);
|
159 | __webpack_require__(273);
|
160 | __webpack_require__(275);
|
161 | __webpack_require__(276);
|
162 | __webpack_require__(277);
|
163 | __webpack_require__(278);
|
164 | __webpack_require__(290);
|
165 | __webpack_require__(291);
|
166 | __webpack_require__(292);
|
167 | __webpack_require__(293);
|
168 | __webpack_require__(294);
|
169 | __webpack_require__(295);
|
170 | __webpack_require__(296);
|
171 | __webpack_require__(297);
|
172 | __webpack_require__(299);
|
173 | __webpack_require__(300);
|
174 | __webpack_require__(301);
|
175 | __webpack_require__(302);
|
176 | __webpack_require__(303);
|
177 | __webpack_require__(304);
|
178 | __webpack_require__(305);
|
179 | __webpack_require__(306);
|
180 | __webpack_require__(307);
|
181 | __webpack_require__(308);
|
182 | __webpack_require__(314);
|
183 | __webpack_require__(315);
|
184 | __webpack_require__(317);
|
185 | __webpack_require__(318);
|
186 | __webpack_require__(319);
|
187 | __webpack_require__(320);
|
188 | __webpack_require__(321);
|
189 | __webpack_require__(322);
|
190 | __webpack_require__(323);
|
191 | __webpack_require__(325);
|
192 | __webpack_require__(328);
|
193 | __webpack_require__(329);
|
194 | __webpack_require__(330);
|
195 | __webpack_require__(331);
|
196 | __webpack_require__(335);
|
197 | __webpack_require__(336);
|
198 | __webpack_require__(338);
|
199 | __webpack_require__(339);
|
200 | __webpack_require__(340);
|
201 | __webpack_require__(341);
|
202 | __webpack_require__(343);
|
203 | __webpack_require__(344);
|
204 | __webpack_require__(345);
|
205 | __webpack_require__(346);
|
206 | __webpack_require__(347);
|
207 | __webpack_require__(348);
|
208 | __webpack_require__(350);
|
209 | __webpack_require__(351);
|
210 | __webpack_require__(352);
|
211 | __webpack_require__(355);
|
212 | __webpack_require__(356);
|
213 | __webpack_require__(357);
|
214 | __webpack_require__(358);
|
215 | __webpack_require__(359);
|
216 | __webpack_require__(360);
|
217 | __webpack_require__(361);
|
218 | __webpack_require__(362);
|
219 | __webpack_require__(363);
|
220 | __webpack_require__(364);
|
221 | __webpack_require__(365);
|
222 | __webpack_require__(366);
|
223 | __webpack_require__(367);
|
224 | __webpack_require__(373);
|
225 | __webpack_require__(374);
|
226 | __webpack_require__(375);
|
227 | __webpack_require__(376);
|
228 | __webpack_require__(377);
|
229 | __webpack_require__(378);
|
230 | __webpack_require__(379);
|
231 | __webpack_require__(380);
|
232 | __webpack_require__(381);
|
233 | __webpack_require__(382);
|
234 | __webpack_require__(383);
|
235 | __webpack_require__(384);
|
236 | __webpack_require__(385);
|
237 | __webpack_require__(389);
|
238 | __webpack_require__(390);
|
239 | __webpack_require__(391);
|
240 | __webpack_require__(392);
|
241 | __webpack_require__(393);
|
242 | __webpack_require__(394);
|
243 | __webpack_require__(395);
|
244 | __webpack_require__(396);
|
245 | __webpack_require__(397);
|
246 | __webpack_require__(398);
|
247 | __webpack_require__(399);
|
248 | __webpack_require__(400);
|
249 | __webpack_require__(401);
|
250 | __webpack_require__(402);
|
251 | __webpack_require__(403);
|
252 | __webpack_require__(404);
|
253 | __webpack_require__(405);
|
254 | __webpack_require__(406);
|
255 | __webpack_require__(407);
|
256 | __webpack_require__(408);
|
257 | __webpack_require__(409);
|
258 | __webpack_require__(410);
|
259 | __webpack_require__(411);
|
260 | __webpack_require__(413);
|
261 | __webpack_require__(414);
|
262 | __webpack_require__(417);
|
263 | __webpack_require__(418);
|
264 | __webpack_require__(419);
|
265 | __webpack_require__(420);
|
266 | __webpack_require__(421);
|
267 | __webpack_require__(425);
|
268 | __webpack_require__(424);
|
269 |
|
270 | __webpack_require__(75);
|
271 |
|
272 |
|
273 | }),
|
274 |
|
275 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
276 |
|
277 | "use strict";
|
278 |
|
279 | var $ = __webpack_require__(2);
|
280 | var global = __webpack_require__(3);
|
281 | var getBuiltIn = __webpack_require__(20);
|
282 | var apply = __webpack_require__(62);
|
283 | var call = __webpack_require__(7);
|
284 | var uncurryThis = __webpack_require__(12);
|
285 | var IS_PURE = __webpack_require__(32);
|
286 | var DESCRIPTORS = __webpack_require__(5);
|
287 | var NATIVE_SYMBOL = __webpack_require__(23);
|
288 | var fails = __webpack_require__(6);
|
289 | var hasOwn = __webpack_require__(35);
|
290 | var isArray = __webpack_require__(63);
|
291 | var isCallable = __webpack_require__(18);
|
292 | var isObject = __webpack_require__(17);
|
293 | var isPrototypeOf = __webpack_require__(21);
|
294 | var isSymbol = __webpack_require__(19);
|
295 | var anObject = __webpack_require__(42);
|
296 | var toObject = __webpack_require__(36);
|
297 | var toIndexedObject = __webpack_require__(10);
|
298 | var toPropertyKey = __webpack_require__(15);
|
299 | var $toString = __webpack_require__(64);
|
300 | var createPropertyDescriptor = __webpack_require__(9);
|
301 | var nativeObjectCreate = __webpack_require__(67);
|
302 | var objectKeys = __webpack_require__(69);
|
303 | var getOwnPropertyNamesModule = __webpack_require__(52);
|
304 | var getOwnPropertyNamesExternal = __webpack_require__(71);
|
305 | var getOwnPropertySymbolsModule = __webpack_require__(60);
|
306 | var getOwnPropertyDescriptorModule = __webpack_require__(4);
|
307 | var definePropertyModule = __webpack_require__(41);
|
308 | var propertyIsEnumerableModule = __webpack_require__(8);
|
309 | var arraySlice = __webpack_require__(72);
|
310 | var redefine = __webpack_require__(43);
|
311 | var shared = __webpack_require__(31);
|
312 | var sharedKey = __webpack_require__(47);
|
313 | var hiddenKeys = __webpack_require__(48);
|
314 | var uid = __webpack_require__(37);
|
315 | var wellKnownSymbol = __webpack_require__(30);
|
316 | var wrappedWellKnownSymbolModule = __webpack_require__(73);
|
317 | var defineWellKnownSymbol = __webpack_require__(74);
|
318 | var setToStringTag = __webpack_require__(76);
|
319 | var InternalStateModule = __webpack_require__(45);
|
320 | var $forEach = (__webpack_require__(77).forEach);
|
321 |
|
322 | var HIDDEN = sharedKey('hidden');
|
323 | var SYMBOL = 'Symbol';
|
324 | var PROTOTYPE = 'prototype';
|
325 | var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
326 |
|
327 | var setInternalState = InternalStateModule.set;
|
328 | var getInternalState = InternalStateModule.getterFor(SYMBOL);
|
329 |
|
330 | var ObjectPrototype = Object[PROTOTYPE];
|
331 | var $Symbol = global.Symbol;
|
332 | var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE];
|
333 | var TypeError = global.TypeError;
|
334 | var QObject = global.QObject;
|
335 | var $stringify = getBuiltIn('JSON', 'stringify');
|
336 | var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
337 | var nativeDefineProperty = definePropertyModule.f;
|
338 | var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
|
339 | var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
|
340 | var push = uncurryThis([].push);
|
341 |
|
342 | var AllSymbols = shared('symbols');
|
343 | var ObjectPrototypeSymbols = shared('op-symbols');
|
344 | var StringToSymbolRegistry = shared('string-to-symbol-registry');
|
345 | var SymbolToStringRegistry = shared('symbol-to-string-registry');
|
346 | var WellKnownSymbolsStore = shared('wks');
|
347 |
|
348 |
|
349 | var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
|
350 |
|
351 |
|
352 | var setSymbolDescriptor = DESCRIPTORS && fails(function () {
|
353 | return nativeObjectCreate(nativeDefineProperty({}, 'a', {
|
354 | get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }
|
355 | })).a != 7;
|
356 | }) ? function (O, P, Attributes) {
|
357 | var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);
|
358 | if (ObjectPrototypeDescriptor) delete ObjectPrototype[P];
|
359 | nativeDefineProperty(O, P, Attributes);
|
360 | if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
|
361 | nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
|
362 | }
|
363 | } : nativeDefineProperty;
|
364 |
|
365 | var wrap = function (tag, description) {
|
366 | var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype);
|
367 | setInternalState(symbol, {
|
368 | type: SYMBOL,
|
369 | tag: tag,
|
370 | description: description
|
371 | });
|
372 | if (!DESCRIPTORS) symbol.description = description;
|
373 | return symbol;
|
374 | };
|
375 |
|
376 | var $defineProperty = function defineProperty(O, P, Attributes) {
|
377 | if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
|
378 | anObject(O);
|
379 | var key = toPropertyKey(P);
|
380 | anObject(Attributes);
|
381 | if (hasOwn(AllSymbols, key)) {
|
382 | if (!Attributes.enumerable) {
|
383 | if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
|
384 | O[HIDDEN][key] = true;
|
385 | } else {
|
386 | if (hasOwn(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
|
387 | Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
|
388 | } return setSymbolDescriptor(O, key, Attributes);
|
389 | } return nativeDefineProperty(O, key, Attributes);
|
390 | };
|
391 |
|
392 | var $defineProperties = function defineProperties(O, Properties) {
|
393 | anObject(O);
|
394 | var properties = toIndexedObject(Properties);
|
395 | var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties));
|
396 | $forEach(keys, function (key) {
|
397 | if (!DESCRIPTORS || call($propertyIsEnumerable, properties, key)) $defineProperty(O, key, properties[key]);
|
398 | });
|
399 | return O;
|
400 | };
|
401 |
|
402 | var $create = function create(O, Properties) {
|
403 | return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
|
404 | };
|
405 |
|
406 | var $propertyIsEnumerable = function propertyIsEnumerable(V) {
|
407 | var P = toPropertyKey(V);
|
408 | var enumerable = call(nativePropertyIsEnumerable, this, P);
|
409 | if (this === ObjectPrototype && hasOwn(AllSymbols, P) && !hasOwn(ObjectPrototypeSymbols, P)) return false;
|
410 | return enumerable || !hasOwn(this, P) || !hasOwn(AllSymbols, P) || hasOwn(this, HIDDEN) && this[HIDDEN][P]
|
411 | ? enumerable : true;
|
412 | };
|
413 |
|
414 | var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
|
415 | var it = toIndexedObject(O);
|
416 | var key = toPropertyKey(P);
|
417 | if (it === ObjectPrototype && hasOwn(AllSymbols, key) && !hasOwn(ObjectPrototypeSymbols, key)) return;
|
418 | var descriptor = nativeGetOwnPropertyDescriptor(it, key);
|
419 | if (descriptor && hasOwn(AllSymbols, key) && !(hasOwn(it, HIDDEN) && it[HIDDEN][key])) {
|
420 | descriptor.enumerable = true;
|
421 | }
|
422 | return descriptor;
|
423 | };
|
424 |
|
425 | var $getOwnPropertyNames = function getOwnPropertyNames(O) {
|
426 | var names = nativeGetOwnPropertyNames(toIndexedObject(O));
|
427 | var result = [];
|
428 | $forEach(names, function (key) {
|
429 | if (!hasOwn(AllSymbols, key) && !hasOwn(hiddenKeys, key)) push(result, key);
|
430 | });
|
431 | return result;
|
432 | };
|
433 |
|
434 | var $getOwnPropertySymbols = function getOwnPropertySymbols(O) {
|
435 | var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
|
436 | var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
|
437 | var result = [];
|
438 | $forEach(names, function (key) {
|
439 | if (hasOwn(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn(ObjectPrototype, key))) {
|
440 | push(result, AllSymbols[key]);
|
441 | }
|
442 | });
|
443 | return result;
|
444 | };
|
445 |
|
446 |
|
447 |
|
448 | if (!NATIVE_SYMBOL) {
|
449 | $Symbol = function Symbol() {
|
450 | if (isPrototypeOf(SymbolPrototype, this)) throw TypeError('Symbol is not a constructor');
|
451 | var description = !arguments.length || arguments[0] === undefined ? undefined : $toString(arguments[0]);
|
452 | var tag = uid(description);
|
453 | var setter = function (value) {
|
454 | if (this === ObjectPrototype) call(setter, ObjectPrototypeSymbols, value);
|
455 | if (hasOwn(this, HIDDEN) && hasOwn(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
|
456 | setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
|
457 | };
|
458 | if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
|
459 | return wrap(tag, description);
|
460 | };
|
461 |
|
462 | SymbolPrototype = $Symbol[PROTOTYPE];
|
463 |
|
464 | redefine(SymbolPrototype, 'toString', function toString() {
|
465 | return getInternalState(this).tag;
|
466 | });
|
467 |
|
468 | redefine($Symbol, 'withoutSetter', function (description) {
|
469 | return wrap(uid(description), description);
|
470 | });
|
471 |
|
472 | propertyIsEnumerableModule.f = $propertyIsEnumerable;
|
473 | definePropertyModule.f = $defineProperty;
|
474 | getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
|
475 | getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
|
476 | getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
|
477 |
|
478 | wrappedWellKnownSymbolModule.f = function (name) {
|
479 | return wrap(wellKnownSymbol(name), name);
|
480 | };
|
481 |
|
482 | if (DESCRIPTORS) {
|
483 |
|
484 | nativeDefineProperty(SymbolPrototype, 'description', {
|
485 | configurable: true,
|
486 | get: function description() {
|
487 | return getInternalState(this).description;
|
488 | }
|
489 | });
|
490 | if (!IS_PURE) {
|
491 | redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true });
|
492 | }
|
493 | }
|
494 | }
|
495 |
|
496 | $({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
|
497 | Symbol: $Symbol
|
498 | });
|
499 |
|
500 | $forEach(objectKeys(WellKnownSymbolsStore), function (name) {
|
501 | defineWellKnownSymbol(name);
|
502 | });
|
503 |
|
504 | $({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
|
505 |
|
506 |
|
507 | 'for': function (key) {
|
508 | var string = $toString(key);
|
509 | if (hasOwn(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
|
510 | var symbol = $Symbol(string);
|
511 | StringToSymbolRegistry[string] = symbol;
|
512 | SymbolToStringRegistry[symbol] = string;
|
513 | return symbol;
|
514 | },
|
515 |
|
516 |
|
517 | keyFor: function keyFor(sym) {
|
518 | if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol');
|
519 | if (hasOwn(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
|
520 | },
|
521 | useSetter: function () { USE_SETTER = true; },
|
522 | useSimple: function () { USE_SETTER = false; }
|
523 | });
|
524 |
|
525 | $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
|
526 |
|
527 |
|
528 | create: $create,
|
529 |
|
530 |
|
531 | defineProperty: $defineProperty,
|
532 |
|
533 |
|
534 | defineProperties: $defineProperties,
|
535 |
|
536 |
|
537 | getOwnPropertyDescriptor: $getOwnPropertyDescriptor
|
538 | });
|
539 |
|
540 | $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, {
|
541 |
|
542 |
|
543 | getOwnPropertyNames: $getOwnPropertyNames,
|
544 |
|
545 |
|
546 | getOwnPropertySymbols: $getOwnPropertySymbols
|
547 | });
|
548 |
|
549 |
|
550 |
|
551 | $({ target: 'Object', stat: true, forced: fails(function () { getOwnPropertySymbolsModule.f(1); }) }, {
|
552 | getOwnPropertySymbols: function getOwnPropertySymbols(it) {
|
553 | return getOwnPropertySymbolsModule.f(toObject(it));
|
554 | }
|
555 | });
|
556 |
|
557 |
|
558 |
|
559 | if ($stringify) {
|
560 | var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails(function () {
|
561 | var symbol = $Symbol();
|
562 |
|
563 | return $stringify([symbol]) != '[null]'
|
564 |
|
565 | || $stringify({ a: symbol }) != '{}'
|
566 |
|
567 | || $stringify(Object(symbol)) != '{}';
|
568 | });
|
569 |
|
570 | $({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, {
|
571 |
|
572 | stringify: function stringify(it, replacer, space) {
|
573 | var args = arraySlice(arguments);
|
574 | var $replacer = replacer;
|
575 | if (!isObject(replacer) && it === undefined || isSymbol(it)) return;
|
576 | if (!isArray(replacer)) replacer = function (key, value) {
|
577 | if (isCallable($replacer)) value = call($replacer, this, key, value);
|
578 | if (!isSymbol(value)) return value;
|
579 | };
|
580 | args[1] = replacer;
|
581 | return apply($stringify, null, args);
|
582 | }
|
583 | });
|
584 | }
|
585 |
|
586 |
|
587 |
|
588 | if (!SymbolPrototype[TO_PRIMITIVE]) {
|
589 | var valueOf = SymbolPrototype.valueOf;
|
590 |
|
591 | redefine(SymbolPrototype, TO_PRIMITIVE, function (hint) {
|
592 |
|
593 | return call(valueOf, this);
|
594 | });
|
595 | }
|
596 |
|
597 |
|
598 | setToStringTag($Symbol, SYMBOL);
|
599 |
|
600 | hiddenKeys[HIDDEN] = true;
|
601 |
|
602 |
|
603 | }),
|
604 |
|
605 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
606 |
|
607 | var global = __webpack_require__(3);
|
608 | var getOwnPropertyDescriptor = (__webpack_require__(4).f);
|
609 | var createNonEnumerableProperty = __webpack_require__(40);
|
610 | var redefine = __webpack_require__(43);
|
611 | var setGlobal = __webpack_require__(34);
|
612 | var copyConstructorProperties = __webpack_require__(50);
|
613 | var isForced = __webpack_require__(61);
|
614 |
|
615 |
|
616 |
|
617 |
|
618 |
|
619 |
|
620 |
|
621 |
|
622 |
|
623 |
|
624 |
|
625 |
|
626 |
|
627 |
|
628 |
|
629 |
|
630 | module.exports = function (options, source) {
|
631 | var TARGET = options.target;
|
632 | var GLOBAL = options.global;
|
633 | var STATIC = options.stat;
|
634 | var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
635 | if (GLOBAL) {
|
636 | target = global;
|
637 | } else if (STATIC) {
|
638 | target = global[TARGET] || setGlobal(TARGET, {});
|
639 | } else {
|
640 | target = (global[TARGET] || {}).prototype;
|
641 | }
|
642 | if (target) for (key in source) {
|
643 | sourceProperty = source[key];
|
644 | if (options.noTargetGet) {
|
645 | descriptor = getOwnPropertyDescriptor(target, key);
|
646 | targetProperty = descriptor && descriptor.value;
|
647 | } else targetProperty = target[key];
|
648 | FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
649 |
|
650 | if (!FORCED && targetProperty !== undefined) {
|
651 | if (typeof sourceProperty == typeof targetProperty) continue;
|
652 | copyConstructorProperties(sourceProperty, targetProperty);
|
653 | }
|
654 |
|
655 | if (options.sham || (targetProperty && targetProperty.sham)) {
|
656 | createNonEnumerableProperty(sourceProperty, 'sham', true);
|
657 | }
|
658 |
|
659 | redefine(target, key, sourceProperty, options);
|
660 | }
|
661 | };
|
662 |
|
663 |
|
664 | }),
|
665 |
|
666 | (function(module) {
|
667 |
|
668 | var check = function (it) {
|
669 | return it && it.Math == Math && it;
|
670 | };
|
671 |
|
672 |
|
673 | module.exports =
|
674 |
|
675 | check(typeof globalThis == 'object' && globalThis) ||
|
676 | check(typeof window == 'object' && window) ||
|
677 |
|
678 | check(typeof self == 'object' && self) ||
|
679 | check(typeof global == 'object' && global) ||
|
680 |
|
681 | (function () { return this; })() || Function('return this')();
|
682 |
|
683 |
|
684 | }),
|
685 |
|
686 | (function(__unused_webpack_module, exports, __webpack_require__) {
|
687 |
|
688 | var DESCRIPTORS = __webpack_require__(5);
|
689 | var call = __webpack_require__(7);
|
690 | var propertyIsEnumerableModule = __webpack_require__(8);
|
691 | var createPropertyDescriptor = __webpack_require__(9);
|
692 | var toIndexedObject = __webpack_require__(10);
|
693 | var toPropertyKey = __webpack_require__(15);
|
694 | var hasOwn = __webpack_require__(35);
|
695 | var IE8_DOM_DEFINE = __webpack_require__(38);
|
696 |
|
697 |
|
698 | var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
699 |
|
700 |
|
701 |
|
702 | exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
|
703 | O = toIndexedObject(O);
|
704 | P = toPropertyKey(P);
|
705 | if (IE8_DOM_DEFINE) try {
|
706 | return $getOwnPropertyDescriptor(O, P);
|
707 | } catch (error) { }
|
708 | if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
|
709 | };
|
710 |
|
711 |
|
712 | }),
|
713 |
|
714 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
715 |
|
716 | var fails = __webpack_require__(6);
|
717 |
|
718 |
|
719 | module.exports = !fails(function () {
|
720 |
|
721 | return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
|
722 | });
|
723 |
|
724 |
|
725 | }),
|
726 |
|
727 | (function(module) {
|
728 |
|
729 | module.exports = function (exec) {
|
730 | try {
|
731 | return !!exec();
|
732 | } catch (error) {
|
733 | return true;
|
734 | }
|
735 | };
|
736 |
|
737 |
|
738 | }),
|
739 |
|
740 | (function(module) {
|
741 |
|
742 | var call = Function.prototype.call;
|
743 |
|
744 | module.exports = call.bind ? call.bind(call) : function () {
|
745 | return call.apply(call, arguments);
|
746 | };
|
747 |
|
748 |
|
749 | }),
|
750 |
|
751 | (function(__unused_webpack_module, exports) {
|
752 |
|
753 | "use strict";
|
754 |
|
755 | var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
756 |
|
757 | var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
758 |
|
759 |
|
760 | var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
761 |
|
762 |
|
763 |
|
764 | exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
765 | var descriptor = getOwnPropertyDescriptor(this, V);
|
766 | return !!descriptor && descriptor.enumerable;
|
767 | } : $propertyIsEnumerable;
|
768 |
|
769 |
|
770 | }),
|
771 |
|
772 | (function(module) {
|
773 |
|
774 | module.exports = function (bitmap, value) {
|
775 | return {
|
776 | enumerable: !(bitmap & 1),
|
777 | configurable: !(bitmap & 2),
|
778 | writable: !(bitmap & 4),
|
779 | value: value
|
780 | };
|
781 | };
|
782 |
|
783 |
|
784 | }),
|
785 |
|
786 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
787 |
|
788 |
|
789 | var IndexedObject = __webpack_require__(11);
|
790 | var requireObjectCoercible = __webpack_require__(14);
|
791 |
|
792 | module.exports = function (it) {
|
793 | return IndexedObject(requireObjectCoercible(it));
|
794 | };
|
795 |
|
796 |
|
797 | }),
|
798 |
|
799 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
800 |
|
801 | var global = __webpack_require__(3);
|
802 | var uncurryThis = __webpack_require__(12);
|
803 | var fails = __webpack_require__(6);
|
804 | var classof = __webpack_require__(13);
|
805 |
|
806 | var Object = global.Object;
|
807 | var split = uncurryThis(''.split);
|
808 |
|
809 |
|
810 | module.exports = fails(function () {
|
811 |
|
812 |
|
813 | return !Object('z').propertyIsEnumerable(0);
|
814 | }) ? function (it) {
|
815 | return classof(it) == 'String' ? split(it, '') : Object(it);
|
816 | } : Object;
|
817 |
|
818 |
|
819 | }),
|
820 |
|
821 | (function(module) {
|
822 |
|
823 | var FunctionPrototype = Function.prototype;
|
824 | var bind = FunctionPrototype.bind;
|
825 | var call = FunctionPrototype.call;
|
826 | var callBind = bind && bind.bind(call);
|
827 |
|
828 | module.exports = bind ? function (fn) {
|
829 | return fn && callBind(call, fn);
|
830 | } : function (fn) {
|
831 | return fn && function () {
|
832 | return call.apply(fn, arguments);
|
833 | };
|
834 | };
|
835 |
|
836 |
|
837 | }),
|
838 |
|
839 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
840 |
|
841 | var uncurryThis = __webpack_require__(12);
|
842 |
|
843 | var toString = uncurryThis({}.toString);
|
844 | var stringSlice = uncurryThis(''.slice);
|
845 |
|
846 | module.exports = function (it) {
|
847 | return stringSlice(toString(it), 8, -1);
|
848 | };
|
849 |
|
850 |
|
851 | }),
|
852 |
|
853 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
854 |
|
855 | var global = __webpack_require__(3);
|
856 |
|
857 | var TypeError = global.TypeError;
|
858 |
|
859 |
|
860 |
|
861 | module.exports = function (it) {
|
862 | if (it == undefined) throw TypeError("Can't call method on " + it);
|
863 | return it;
|
864 | };
|
865 |
|
866 |
|
867 | }),
|
868 |
|
869 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
870 |
|
871 | var toPrimitive = __webpack_require__(16);
|
872 | var isSymbol = __webpack_require__(19);
|
873 |
|
874 |
|
875 |
|
876 | module.exports = function (argument) {
|
877 | var key = toPrimitive(argument, 'string');
|
878 | return isSymbol(key) ? key : key + '';
|
879 | };
|
880 |
|
881 |
|
882 | }),
|
883 |
|
884 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
885 |
|
886 | var global = __webpack_require__(3);
|
887 | var call = __webpack_require__(7);
|
888 | var isObject = __webpack_require__(17);
|
889 | var isSymbol = __webpack_require__(19);
|
890 | var getMethod = __webpack_require__(26);
|
891 | var ordinaryToPrimitive = __webpack_require__(29);
|
892 | var wellKnownSymbol = __webpack_require__(30);
|
893 |
|
894 | var TypeError = global.TypeError;
|
895 | var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
896 |
|
897 |
|
898 |
|
899 | module.exports = function (input, pref) {
|
900 | if (!isObject(input) || isSymbol(input)) return input;
|
901 | var exoticToPrim = getMethod(input, TO_PRIMITIVE);
|
902 | var result;
|
903 | if (exoticToPrim) {
|
904 | if (pref === undefined) pref = 'default';
|
905 | result = call(exoticToPrim, input, pref);
|
906 | if (!isObject(result) || isSymbol(result)) return result;
|
907 | throw TypeError("Can't convert object to primitive value");
|
908 | }
|
909 | if (pref === undefined) pref = 'number';
|
910 | return ordinaryToPrimitive(input, pref);
|
911 | };
|
912 |
|
913 |
|
914 | }),
|
915 |
|
916 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
917 |
|
918 | var isCallable = __webpack_require__(18);
|
919 |
|
920 | module.exports = function (it) {
|
921 | return typeof it == 'object' ? it !== null : isCallable(it);
|
922 | };
|
923 |
|
924 |
|
925 | }),
|
926 |
|
927 | (function(module) {
|
928 |
|
929 |
|
930 |
|
931 | module.exports = function (argument) {
|
932 | return typeof argument == 'function';
|
933 | };
|
934 |
|
935 |
|
936 | }),
|
937 |
|
938 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
939 |
|
940 | var global = __webpack_require__(3);
|
941 | var getBuiltIn = __webpack_require__(20);
|
942 | var isCallable = __webpack_require__(18);
|
943 | var isPrototypeOf = __webpack_require__(21);
|
944 | var USE_SYMBOL_AS_UID = __webpack_require__(22);
|
945 |
|
946 | var Object = global.Object;
|
947 |
|
948 | module.exports = USE_SYMBOL_AS_UID ? function (it) {
|
949 | return typeof it == 'symbol';
|
950 | } : function (it) {
|
951 | var $Symbol = getBuiltIn('Symbol');
|
952 | return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, Object(it));
|
953 | };
|
954 |
|
955 |
|
956 | }),
|
957 |
|
958 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
959 |
|
960 | var global = __webpack_require__(3);
|
961 | var isCallable = __webpack_require__(18);
|
962 |
|
963 | var aFunction = function (argument) {
|
964 | return isCallable(argument) ? argument : undefined;
|
965 | };
|
966 |
|
967 | module.exports = function (namespace, method) {
|
968 | return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method];
|
969 | };
|
970 |
|
971 |
|
972 | }),
|
973 |
|
974 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
975 |
|
976 | var uncurryThis = __webpack_require__(12);
|
977 |
|
978 | module.exports = uncurryThis({}.isPrototypeOf);
|
979 |
|
980 |
|
981 | }),
|
982 |
|
983 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
984 |
|
985 |
|
986 | var NATIVE_SYMBOL = __webpack_require__(23);
|
987 |
|
988 | module.exports = NATIVE_SYMBOL
|
989 | && !Symbol.sham
|
990 | && typeof Symbol.iterator == 'symbol';
|
991 |
|
992 |
|
993 | }),
|
994 |
|
995 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
996 |
|
997 |
|
998 | var V8_VERSION = __webpack_require__(24);
|
999 | var fails = __webpack_require__(6);
|
1000 |
|
1001 |
|
1002 | module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
|
1003 | var symbol = Symbol();
|
1004 |
|
1005 |
|
1006 | return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
1007 |
|
1008 | !Symbol.sham && V8_VERSION && V8_VERSION < 41;
|
1009 | });
|
1010 |
|
1011 |
|
1012 | }),
|
1013 |
|
1014 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1015 |
|
1016 | var global = __webpack_require__(3);
|
1017 | var userAgent = __webpack_require__(25);
|
1018 |
|
1019 | var process = global.process;
|
1020 | var Deno = global.Deno;
|
1021 | var versions = process && process.versions || Deno && Deno.version;
|
1022 | var v8 = versions && versions.v8;
|
1023 | var match, version;
|
1024 |
|
1025 | if (v8) {
|
1026 | match = v8.split('.');
|
1027 |
|
1028 |
|
1029 | version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
1030 | }
|
1031 |
|
1032 |
|
1033 |
|
1034 | if (!version && userAgent) {
|
1035 | match = userAgent.match(/Edge\/(\d+)/);
|
1036 | if (!match || match[1] >= 74) {
|
1037 | match = userAgent.match(/Chrome\/(\d+)/);
|
1038 | if (match) version = +match[1];
|
1039 | }
|
1040 | }
|
1041 |
|
1042 | module.exports = version;
|
1043 |
|
1044 |
|
1045 | }),
|
1046 |
|
1047 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1048 |
|
1049 | var getBuiltIn = __webpack_require__(20);
|
1050 |
|
1051 | module.exports = getBuiltIn('navigator', 'userAgent') || '';
|
1052 |
|
1053 |
|
1054 | }),
|
1055 |
|
1056 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1057 |
|
1058 | var aCallable = __webpack_require__(27);
|
1059 |
|
1060 |
|
1061 |
|
1062 | module.exports = function (V, P) {
|
1063 | var func = V[P];
|
1064 | return func == null ? undefined : aCallable(func);
|
1065 | };
|
1066 |
|
1067 |
|
1068 | }),
|
1069 |
|
1070 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1071 |
|
1072 | var global = __webpack_require__(3);
|
1073 | var isCallable = __webpack_require__(18);
|
1074 | var tryToString = __webpack_require__(28);
|
1075 |
|
1076 | var TypeError = global.TypeError;
|
1077 |
|
1078 |
|
1079 | module.exports = function (argument) {
|
1080 | if (isCallable(argument)) return argument;
|
1081 | throw TypeError(tryToString(argument) + ' is not a function');
|
1082 | };
|
1083 |
|
1084 |
|
1085 | }),
|
1086 |
|
1087 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1088 |
|
1089 | var global = __webpack_require__(3);
|
1090 |
|
1091 | var String = global.String;
|
1092 |
|
1093 | module.exports = function (argument) {
|
1094 | try {
|
1095 | return String(argument);
|
1096 | } catch (error) {
|
1097 | return 'Object';
|
1098 | }
|
1099 | };
|
1100 |
|
1101 |
|
1102 | }),
|
1103 |
|
1104 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1105 |
|
1106 | var global = __webpack_require__(3);
|
1107 | var call = __webpack_require__(7);
|
1108 | var isCallable = __webpack_require__(18);
|
1109 | var isObject = __webpack_require__(17);
|
1110 |
|
1111 | var TypeError = global.TypeError;
|
1112 |
|
1113 |
|
1114 |
|
1115 | module.exports = function (input, pref) {
|
1116 | var fn, val;
|
1117 | if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
|
1118 | if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;
|
1119 | if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
|
1120 | throw TypeError("Can't convert object to primitive value");
|
1121 | };
|
1122 |
|
1123 |
|
1124 | }),
|
1125 |
|
1126 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1127 |
|
1128 | var global = __webpack_require__(3);
|
1129 | var shared = __webpack_require__(31);
|
1130 | var hasOwn = __webpack_require__(35);
|
1131 | var uid = __webpack_require__(37);
|
1132 | var NATIVE_SYMBOL = __webpack_require__(23);
|
1133 | var USE_SYMBOL_AS_UID = __webpack_require__(22);
|
1134 |
|
1135 | var WellKnownSymbolsStore = shared('wks');
|
1136 | var Symbol = global.Symbol;
|
1137 | var symbolFor = Symbol && Symbol['for'];
|
1138 | var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
|
1139 |
|
1140 | module.exports = function (name) {
|
1141 | if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
|
1142 | var description = 'Symbol.' + name;
|
1143 | if (NATIVE_SYMBOL && hasOwn(Symbol, name)) {
|
1144 | WellKnownSymbolsStore[name] = Symbol[name];
|
1145 | } else if (USE_SYMBOL_AS_UID && symbolFor) {
|
1146 | WellKnownSymbolsStore[name] = symbolFor(description);
|
1147 | } else {
|
1148 | WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
|
1149 | }
|
1150 | } return WellKnownSymbolsStore[name];
|
1151 | };
|
1152 |
|
1153 |
|
1154 | }),
|
1155 |
|
1156 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1157 |
|
1158 | var IS_PURE = __webpack_require__(32);
|
1159 | var store = __webpack_require__(33);
|
1160 |
|
1161 | (module.exports = function (key, value) {
|
1162 | return store[key] || (store[key] = value !== undefined ? value : {});
|
1163 | })('versions', []).push({
|
1164 | version: '3.19.1',
|
1165 | mode: IS_PURE ? 'pure' : 'global',
|
1166 | copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
|
1167 | });
|
1168 |
|
1169 |
|
1170 | }),
|
1171 |
|
1172 | (function(module) {
|
1173 |
|
1174 | module.exports = false;
|
1175 |
|
1176 |
|
1177 | }),
|
1178 |
|
1179 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1180 |
|
1181 | var global = __webpack_require__(3);
|
1182 | var setGlobal = __webpack_require__(34);
|
1183 |
|
1184 | var SHARED = '__core-js_shared__';
|
1185 | var store = global[SHARED] || setGlobal(SHARED, {});
|
1186 |
|
1187 | module.exports = store;
|
1188 |
|
1189 |
|
1190 | }),
|
1191 |
|
1192 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1193 |
|
1194 | var global = __webpack_require__(3);
|
1195 |
|
1196 |
|
1197 | var defineProperty = Object.defineProperty;
|
1198 |
|
1199 | module.exports = function (key, value) {
|
1200 | try {
|
1201 | defineProperty(global, key, { value: value, configurable: true, writable: true });
|
1202 | } catch (error) {
|
1203 | global[key] = value;
|
1204 | } return value;
|
1205 | };
|
1206 |
|
1207 |
|
1208 | }),
|
1209 |
|
1210 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1211 |
|
1212 | var uncurryThis = __webpack_require__(12);
|
1213 | var toObject = __webpack_require__(36);
|
1214 |
|
1215 | var hasOwnProperty = uncurryThis({}.hasOwnProperty);
|
1216 |
|
1217 |
|
1218 |
|
1219 | module.exports = Object.hasOwn || function hasOwn(it, key) {
|
1220 | return hasOwnProperty(toObject(it), key);
|
1221 | };
|
1222 |
|
1223 |
|
1224 | }),
|
1225 |
|
1226 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1227 |
|
1228 | var global = __webpack_require__(3);
|
1229 | var requireObjectCoercible = __webpack_require__(14);
|
1230 |
|
1231 | var Object = global.Object;
|
1232 |
|
1233 |
|
1234 |
|
1235 | module.exports = function (argument) {
|
1236 | return Object(requireObjectCoercible(argument));
|
1237 | };
|
1238 |
|
1239 |
|
1240 | }),
|
1241 |
|
1242 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1243 |
|
1244 | var uncurryThis = __webpack_require__(12);
|
1245 |
|
1246 | var id = 0;
|
1247 | var postfix = Math.random();
|
1248 | var toString = uncurryThis(1.0.toString);
|
1249 |
|
1250 | module.exports = function (key) {
|
1251 | return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
|
1252 | };
|
1253 |
|
1254 |
|
1255 | }),
|
1256 |
|
1257 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1258 |
|
1259 | var DESCRIPTORS = __webpack_require__(5);
|
1260 | var fails = __webpack_require__(6);
|
1261 | var createElement = __webpack_require__(39);
|
1262 |
|
1263 |
|
1264 | module.exports = !DESCRIPTORS && !fails(function () {
|
1265 |
|
1266 | return Object.defineProperty(createElement('div'), 'a', {
|
1267 | get: function () { return 7; }
|
1268 | }).a != 7;
|
1269 | });
|
1270 |
|
1271 |
|
1272 | }),
|
1273 |
|
1274 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1275 |
|
1276 | var global = __webpack_require__(3);
|
1277 | var isObject = __webpack_require__(17);
|
1278 |
|
1279 | var document = global.document;
|
1280 |
|
1281 | var EXISTS = isObject(document) && isObject(document.createElement);
|
1282 |
|
1283 | module.exports = function (it) {
|
1284 | return EXISTS ? document.createElement(it) : {};
|
1285 | };
|
1286 |
|
1287 |
|
1288 | }),
|
1289 |
|
1290 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1291 |
|
1292 | var DESCRIPTORS = __webpack_require__(5);
|
1293 | var definePropertyModule = __webpack_require__(41);
|
1294 | var createPropertyDescriptor = __webpack_require__(9);
|
1295 |
|
1296 | module.exports = DESCRIPTORS ? function (object, key, value) {
|
1297 | return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
|
1298 | } : function (object, key, value) {
|
1299 | object[key] = value;
|
1300 | return object;
|
1301 | };
|
1302 |
|
1303 |
|
1304 | }),
|
1305 |
|
1306 | (function(__unused_webpack_module, exports, __webpack_require__) {
|
1307 |
|
1308 | var global = __webpack_require__(3);
|
1309 | var DESCRIPTORS = __webpack_require__(5);
|
1310 | var IE8_DOM_DEFINE = __webpack_require__(38);
|
1311 | var anObject = __webpack_require__(42);
|
1312 | var toPropertyKey = __webpack_require__(15);
|
1313 |
|
1314 | var TypeError = global.TypeError;
|
1315 |
|
1316 | var $defineProperty = Object.defineProperty;
|
1317 |
|
1318 |
|
1319 |
|
1320 | exports.f = DESCRIPTORS ? $defineProperty : function defineProperty(O, P, Attributes) {
|
1321 | anObject(O);
|
1322 | P = toPropertyKey(P);
|
1323 | anObject(Attributes);
|
1324 | if (IE8_DOM_DEFINE) try {
|
1325 | return $defineProperty(O, P, Attributes);
|
1326 | } catch (error) { }
|
1327 | if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');
|
1328 | if ('value' in Attributes) O[P] = Attributes.value;
|
1329 | return O;
|
1330 | };
|
1331 |
|
1332 |
|
1333 | }),
|
1334 |
|
1335 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1336 |
|
1337 | var global = __webpack_require__(3);
|
1338 | var isObject = __webpack_require__(17);
|
1339 |
|
1340 | var String = global.String;
|
1341 | var TypeError = global.TypeError;
|
1342 |
|
1343 |
|
1344 | module.exports = function (argument) {
|
1345 | if (isObject(argument)) return argument;
|
1346 | throw TypeError(String(argument) + ' is not an object');
|
1347 | };
|
1348 |
|
1349 |
|
1350 | }),
|
1351 |
|
1352 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1353 |
|
1354 | var global = __webpack_require__(3);
|
1355 | var isCallable = __webpack_require__(18);
|
1356 | var hasOwn = __webpack_require__(35);
|
1357 | var createNonEnumerableProperty = __webpack_require__(40);
|
1358 | var setGlobal = __webpack_require__(34);
|
1359 | var inspectSource = __webpack_require__(44);
|
1360 | var InternalStateModule = __webpack_require__(45);
|
1361 | var CONFIGURABLE_FUNCTION_NAME = (__webpack_require__(49).CONFIGURABLE);
|
1362 |
|
1363 | var getInternalState = InternalStateModule.get;
|
1364 | var enforceInternalState = InternalStateModule.enforce;
|
1365 | var TEMPLATE = String(String).split('String');
|
1366 |
|
1367 | (module.exports = function (O, key, value, options) {
|
1368 | var unsafe = options ? !!options.unsafe : false;
|
1369 | var simple = options ? !!options.enumerable : false;
|
1370 | var noTargetGet = options ? !!options.noTargetGet : false;
|
1371 | var name = options && options.name !== undefined ? options.name : key;
|
1372 | var state;
|
1373 | if (isCallable(value)) {
|
1374 | if (String(name).slice(0, 7) === 'Symbol(') {
|
1375 | name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
|
1376 | }
|
1377 | if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
|
1378 | createNonEnumerableProperty(value, 'name', name);
|
1379 | }
|
1380 | state = enforceInternalState(value);
|
1381 | if (!state.source) {
|
1382 | state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
|
1383 | }
|
1384 | }
|
1385 | if (O === global) {
|
1386 | if (simple) O[key] = value;
|
1387 | else setGlobal(key, value);
|
1388 | return;
|
1389 | } else if (!unsafe) {
|
1390 | delete O[key];
|
1391 | } else if (!noTargetGet && O[key]) {
|
1392 | simple = true;
|
1393 | }
|
1394 | if (simple) O[key] = value;
|
1395 | else createNonEnumerableProperty(O, key, value);
|
1396 |
|
1397 | })(Function.prototype, 'toString', function toString() {
|
1398 | return isCallable(this) && getInternalState(this).source || inspectSource(this);
|
1399 | });
|
1400 |
|
1401 |
|
1402 | }),
|
1403 |
|
1404 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1405 |
|
1406 | var uncurryThis = __webpack_require__(12);
|
1407 | var isCallable = __webpack_require__(18);
|
1408 | var store = __webpack_require__(33);
|
1409 |
|
1410 | var functionToString = uncurryThis(Function.toString);
|
1411 |
|
1412 |
|
1413 | if (!isCallable(store.inspectSource)) {
|
1414 | store.inspectSource = function (it) {
|
1415 | return functionToString(it);
|
1416 | };
|
1417 | }
|
1418 |
|
1419 | module.exports = store.inspectSource;
|
1420 |
|
1421 |
|
1422 | }),
|
1423 |
|
1424 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1425 |
|
1426 | var NATIVE_WEAK_MAP = __webpack_require__(46);
|
1427 | var global = __webpack_require__(3);
|
1428 | var uncurryThis = __webpack_require__(12);
|
1429 | var isObject = __webpack_require__(17);
|
1430 | var createNonEnumerableProperty = __webpack_require__(40);
|
1431 | var hasOwn = __webpack_require__(35);
|
1432 | var shared = __webpack_require__(33);
|
1433 | var sharedKey = __webpack_require__(47);
|
1434 | var hiddenKeys = __webpack_require__(48);
|
1435 |
|
1436 | var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
1437 | var TypeError = global.TypeError;
|
1438 | var WeakMap = global.WeakMap;
|
1439 | var set, get, has;
|
1440 |
|
1441 | var enforce = function (it) {
|
1442 | return has(it) ? get(it) : set(it, {});
|
1443 | };
|
1444 |
|
1445 | var getterFor = function (TYPE) {
|
1446 | return function (it) {
|
1447 | var state;
|
1448 | if (!isObject(it) || (state = get(it)).type !== TYPE) {
|
1449 | throw TypeError('Incompatible receiver, ' + TYPE + ' required');
|
1450 | } return state;
|
1451 | };
|
1452 | };
|
1453 |
|
1454 | if (NATIVE_WEAK_MAP || shared.state) {
|
1455 | var store = shared.state || (shared.state = new WeakMap());
|
1456 | var wmget = uncurryThis(store.get);
|
1457 | var wmhas = uncurryThis(store.has);
|
1458 | var wmset = uncurryThis(store.set);
|
1459 | set = function (it, metadata) {
|
1460 | if (wmhas(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
|
1461 | metadata.facade = it;
|
1462 | wmset(store, it, metadata);
|
1463 | return metadata;
|
1464 | };
|
1465 | get = function (it) {
|
1466 | return wmget(store, it) || {};
|
1467 | };
|
1468 | has = function (it) {
|
1469 | return wmhas(store, it);
|
1470 | };
|
1471 | } else {
|
1472 | var STATE = sharedKey('state');
|
1473 | hiddenKeys[STATE] = true;
|
1474 | set = function (it, metadata) {
|
1475 | if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
|
1476 | metadata.facade = it;
|
1477 | createNonEnumerableProperty(it, STATE, metadata);
|
1478 | return metadata;
|
1479 | };
|
1480 | get = function (it) {
|
1481 | return hasOwn(it, STATE) ? it[STATE] : {};
|
1482 | };
|
1483 | has = function (it) {
|
1484 | return hasOwn(it, STATE);
|
1485 | };
|
1486 | }
|
1487 |
|
1488 | module.exports = {
|
1489 | set: set,
|
1490 | get: get,
|
1491 | has: has,
|
1492 | enforce: enforce,
|
1493 | getterFor: getterFor
|
1494 | };
|
1495 |
|
1496 |
|
1497 | /***/ }),
|
1498 | /* 46 */
|
1499 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
1500 |
|
1501 | var global = __webpack_require__(3);
|
1502 | var isCallable = __webpack_require__(18);
|
1503 | var inspectSource = __webpack_require__(44);
|
1504 |
|
1505 | var WeakMap = global.WeakMap;
|
1506 |
|
1507 | module.exports = isCallable(WeakMap) && /native code/.test(inspectSource(WeakMap));
|
1508 |
|
1509 |
|
1510 | }),
|
1511 |
|
1512 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1513 |
|
1514 | var shared = __webpack_require__(31);
|
1515 | var uid = __webpack_require__(37);
|
1516 |
|
1517 | var keys = shared('keys');
|
1518 |
|
1519 | module.exports = function (key) {
|
1520 | return keys[key] || (keys[key] = uid(key));
|
1521 | };
|
1522 |
|
1523 |
|
1524 | }),
|
1525 |
|
1526 | (function(module) {
|
1527 |
|
1528 | module.exports = {};
|
1529 |
|
1530 |
|
1531 | }),
|
1532 |
|
1533 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1534 |
|
1535 | var DESCRIPTORS = __webpack_require__(5);
|
1536 | var hasOwn = __webpack_require__(35);
|
1537 |
|
1538 | var FunctionPrototype = Function.prototype;
|
1539 |
|
1540 | var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
|
1541 |
|
1542 | var EXISTS = hasOwn(FunctionPrototype, 'name');
|
1543 |
|
1544 | var PROPER = EXISTS && (function something() { }).name === 'something';
|
1545 | var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
|
1546 |
|
1547 | module.exports = {
|
1548 | EXISTS: EXISTS,
|
1549 | PROPER: PROPER,
|
1550 | CONFIGURABLE: CONFIGURABLE
|
1551 | };
|
1552 |
|
1553 |
|
1554 | }),
|
1555 |
|
1556 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1557 |
|
1558 | var hasOwn = __webpack_require__(35);
|
1559 | var ownKeys = __webpack_require__(51);
|
1560 | var getOwnPropertyDescriptorModule = __webpack_require__(4);
|
1561 | var definePropertyModule = __webpack_require__(41);
|
1562 |
|
1563 | module.exports = function (target, source) {
|
1564 | var keys = ownKeys(source);
|
1565 | var defineProperty = definePropertyModule.f;
|
1566 | var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
1567 | for (var i = 0; i < keys.length; i++) {
|
1568 | var key = keys[i];
|
1569 | if (!hasOwn(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
1570 | }
|
1571 | };
|
1572 |
|
1573 |
|
1574 | }),
|
1575 |
|
1576 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1577 |
|
1578 | var getBuiltIn = __webpack_require__(20);
|
1579 | var uncurryThis = __webpack_require__(12);
|
1580 | var getOwnPropertyNamesModule = __webpack_require__(52);
|
1581 | var getOwnPropertySymbolsModule = __webpack_require__(60);
|
1582 | var anObject = __webpack_require__(42);
|
1583 |
|
1584 | var concat = uncurryThis([].concat);
|
1585 |
|
1586 |
|
1587 | module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
1588 | var keys = getOwnPropertyNamesModule.f(anObject(it));
|
1589 | var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
1590 | return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
|
1591 | };
|
1592 |
|
1593 |
|
1594 | }),
|
1595 |
|
1596 | (function(__unused_webpack_module, exports, __webpack_require__) {
|
1597 |
|
1598 | var internalObjectKeys = __webpack_require__(53);
|
1599 | var enumBugKeys = __webpack_require__(59);
|
1600 |
|
1601 | var hiddenKeys = enumBugKeys.concat('length', 'prototype');
|
1602 |
|
1603 |
|
1604 |
|
1605 |
|
1606 | exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
1607 | return internalObjectKeys(O, hiddenKeys);
|
1608 | };
|
1609 |
|
1610 |
|
1611 | }),
|
1612 |
|
1613 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1614 |
|
1615 | var uncurryThis = __webpack_require__(12);
|
1616 | var hasOwn = __webpack_require__(35);
|
1617 | var toIndexedObject = __webpack_require__(10);
|
1618 | var indexOf = (__webpack_require__(54).indexOf);
|
1619 | var hiddenKeys = __webpack_require__(48);
|
1620 |
|
1621 | var push = uncurryThis([].push);
|
1622 |
|
1623 | module.exports = function (object, names) {
|
1624 | var O = toIndexedObject(object);
|
1625 | var i = 0;
|
1626 | var result = [];
|
1627 | var key;
|
1628 | for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
|
1629 |
|
1630 | while (names.length > i) if (hasOwn(O, key = names[i++])) {
|
1631 | ~indexOf(result, key) || push(result, key);
|
1632 | }
|
1633 | return result;
|
1634 | };
|
1635 |
|
1636 |
|
1637 | }),
|
1638 |
|
1639 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1640 |
|
1641 | var toIndexedObject = __webpack_require__(10);
|
1642 | var toAbsoluteIndex = __webpack_require__(55);
|
1643 | var lengthOfArrayLike = __webpack_require__(57);
|
1644 |
|
1645 |
|
1646 | var createMethod = function (IS_INCLUDES) {
|
1647 | return function ($this, el, fromIndex) {
|
1648 | var O = toIndexedObject($this);
|
1649 | var length = lengthOfArrayLike(O);
|
1650 | var index = toAbsoluteIndex(fromIndex, length);
|
1651 | var value;
|
1652 |
|
1653 |
|
1654 | if (IS_INCLUDES && el != el) while (length > index) {
|
1655 | value = O[index++];
|
1656 |
|
1657 | if (value != value) return true;
|
1658 |
|
1659 | } else for (;length > index; index++) {
|
1660 | if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
1661 | } return !IS_INCLUDES && -1;
|
1662 | };
|
1663 | };
|
1664 |
|
1665 | module.exports = {
|
1666 |
|
1667 |
|
1668 | includes: createMethod(true),
|
1669 |
|
1670 |
|
1671 | indexOf: createMethod(false)
|
1672 | };
|
1673 |
|
1674 |
|
1675 | }),
|
1676 |
|
1677 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1678 |
|
1679 | var toIntegerOrInfinity = __webpack_require__(56);
|
1680 |
|
1681 | var max = Math.max;
|
1682 | var min = Math.min;
|
1683 |
|
1684 |
|
1685 |
|
1686 |
|
1687 | module.exports = function (index, length) {
|
1688 | var integer = toIntegerOrInfinity(index);
|
1689 | return integer < 0 ? max(integer + length, 0) : min(integer, length);
|
1690 | };
|
1691 |
|
1692 |
|
1693 | }),
|
1694 |
|
1695 | (function(module) {
|
1696 |
|
1697 | var ceil = Math.ceil;
|
1698 | var floor = Math.floor;
|
1699 |
|
1700 |
|
1701 |
|
1702 | module.exports = function (argument) {
|
1703 | var number = +argument;
|
1704 |
|
1705 | return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
|
1706 | };
|
1707 |
|
1708 |
|
1709 | }),
|
1710 |
|
1711 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1712 |
|
1713 | var toLength = __webpack_require__(58);
|
1714 |
|
1715 |
|
1716 |
|
1717 | module.exports = function (obj) {
|
1718 | return toLength(obj.length);
|
1719 | };
|
1720 |
|
1721 |
|
1722 | }),
|
1723 |
|
1724 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1725 |
|
1726 | var toIntegerOrInfinity = __webpack_require__(56);
|
1727 |
|
1728 | var min = Math.min;
|
1729 |
|
1730 |
|
1731 |
|
1732 | module.exports = function (argument) {
|
1733 | return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0;
|
1734 | };
|
1735 |
|
1736 |
|
1737 | }),
|
1738 |
|
1739 | (function(module) {
|
1740 |
|
1741 |
|
1742 | module.exports = [
|
1743 | 'constructor',
|
1744 | 'hasOwnProperty',
|
1745 | 'isPrototypeOf',
|
1746 | 'propertyIsEnumerable',
|
1747 | 'toLocaleString',
|
1748 | 'toString',
|
1749 | 'valueOf'
|
1750 | ];
|
1751 |
|
1752 |
|
1753 | }),
|
1754 |
|
1755 | (function(__unused_webpack_module, exports) {
|
1756 |
|
1757 |
|
1758 | exports.f = Object.getOwnPropertySymbols;
|
1759 |
|
1760 |
|
1761 | }),
|
1762 |
|
1763 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1764 |
|
1765 | var fails = __webpack_require__(6);
|
1766 | var isCallable = __webpack_require__(18);
|
1767 |
|
1768 | var replacement = /#|\.prototype\./;
|
1769 |
|
1770 | var isForced = function (feature, detection) {
|
1771 | var value = data[normalize(feature)];
|
1772 | return value == POLYFILL ? true
|
1773 | : value == NATIVE ? false
|
1774 | : isCallable(detection) ? fails(detection)
|
1775 | : !!detection;
|
1776 | };
|
1777 |
|
1778 | var normalize = isForced.normalize = function (string) {
|
1779 | return String(string).replace(replacement, '.').toLowerCase();
|
1780 | };
|
1781 |
|
1782 | var data = isForced.data = {};
|
1783 | var NATIVE = isForced.NATIVE = 'N';
|
1784 | var POLYFILL = isForced.POLYFILL = 'P';
|
1785 |
|
1786 | module.exports = isForced;
|
1787 |
|
1788 |
|
1789 | }),
|
1790 |
|
1791 | (function(module) {
|
1792 |
|
1793 | var FunctionPrototype = Function.prototype;
|
1794 | var apply = FunctionPrototype.apply;
|
1795 | var bind = FunctionPrototype.bind;
|
1796 | var call = FunctionPrototype.call;
|
1797 |
|
1798 |
|
1799 | module.exports = typeof Reflect == 'object' && Reflect.apply || (bind ? call.bind(apply) : function () {
|
1800 | return call.apply(apply, arguments);
|
1801 | });
|
1802 |
|
1803 |
|
1804 | }),
|
1805 |
|
1806 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1807 |
|
1808 | var classof = __webpack_require__(13);
|
1809 |
|
1810 |
|
1811 |
|
1812 |
|
1813 | module.exports = Array.isArray || function isArray(argument) {
|
1814 | return classof(argument) == 'Array';
|
1815 | };
|
1816 |
|
1817 |
|
1818 | }),
|
1819 |
|
1820 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1821 |
|
1822 | var global = __webpack_require__(3);
|
1823 | var classof = __webpack_require__(65);
|
1824 |
|
1825 | var String = global.String;
|
1826 |
|
1827 | module.exports = function (argument) {
|
1828 | if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
|
1829 | return String(argument);
|
1830 | };
|
1831 |
|
1832 |
|
1833 | }),
|
1834 |
|
1835 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1836 |
|
1837 | var global = __webpack_require__(3);
|
1838 | var TO_STRING_TAG_SUPPORT = __webpack_require__(66);
|
1839 | var isCallable = __webpack_require__(18);
|
1840 | var classofRaw = __webpack_require__(13);
|
1841 | var wellKnownSymbol = __webpack_require__(30);
|
1842 |
|
1843 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
1844 | var Object = global.Object;
|
1845 |
|
1846 |
|
1847 | var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
|
1848 |
|
1849 |
|
1850 | var tryGet = function (it, key) {
|
1851 | try {
|
1852 | return it[key];
|
1853 | } catch (error) { }
|
1854 | };
|
1855 |
|
1856 |
|
1857 | module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
|
1858 | var O, tag, result;
|
1859 | return it === undefined ? 'Undefined' : it === null ? 'Null'
|
1860 |
|
1861 | : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
|
1862 |
|
1863 | : CORRECT_ARGUMENTS ? classofRaw(O)
|
1864 |
|
1865 | : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
|
1866 | };
|
1867 |
|
1868 |
|
1869 | }),
|
1870 |
|
1871 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1872 |
|
1873 | var wellKnownSymbol = __webpack_require__(30);
|
1874 |
|
1875 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
1876 | var test = {};
|
1877 |
|
1878 | test[TO_STRING_TAG] = 'z';
|
1879 |
|
1880 | module.exports = String(test) === '[object z]';
|
1881 |
|
1882 |
|
1883 | }),
|
1884 |
|
1885 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1886 |
|
1887 |
|
1888 | var anObject = __webpack_require__(42);
|
1889 | var defineProperties = __webpack_require__(68);
|
1890 | var enumBugKeys = __webpack_require__(59);
|
1891 | var hiddenKeys = __webpack_require__(48);
|
1892 | var html = __webpack_require__(70);
|
1893 | var documentCreateElement = __webpack_require__(39);
|
1894 | var sharedKey = __webpack_require__(47);
|
1895 |
|
1896 | var GT = '>';
|
1897 | var LT = '<';
|
1898 | var PROTOTYPE = 'prototype';
|
1899 | var SCRIPT = 'script';
|
1900 | var IE_PROTO = sharedKey('IE_PROTO');
|
1901 |
|
1902 | var EmptyConstructor = function () { };
|
1903 |
|
1904 | var scriptTag = function (content) {
|
1905 | return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
1906 | };
|
1907 |
|
1908 |
|
1909 | var NullProtoObjectViaActiveX = function (activeXDocument) {
|
1910 | activeXDocument.write(scriptTag(''));
|
1911 | activeXDocument.close();
|
1912 | var temp = activeXDocument.parentWindow.Object;
|
1913 | activeXDocument = null;
|
1914 | return temp;
|
1915 | };
|
1916 |
|
1917 |
|
1918 | var NullProtoObjectViaIFrame = function () {
|
1919 |
|
1920 | var iframe = documentCreateElement('iframe');
|
1921 | var JS = 'java' + SCRIPT + ':';
|
1922 | var iframeDocument;
|
1923 | iframe.style.display = 'none';
|
1924 | html.appendChild(iframe);
|
1925 |
|
1926 | iframe.src = String(JS);
|
1927 | iframeDocument = iframe.contentWindow.document;
|
1928 | iframeDocument.open();
|
1929 | iframeDocument.write(scriptTag('document.F=Object'));
|
1930 | iframeDocument.close();
|
1931 | return iframeDocument.F;
|
1932 | };
|
1933 |
|
1934 |
|
1935 |
|
1936 |
|
1937 |
|
1938 |
|
1939 | var activeXDocument;
|
1940 | var NullProtoObject = function () {
|
1941 | try {
|
1942 | activeXDocument = new ActiveXObject('htmlfile');
|
1943 | } catch (error) { }
|
1944 | NullProtoObject = typeof document != 'undefined'
|
1945 | ? document.domain && activeXDocument
|
1946 | ? NullProtoObjectViaActiveX(activeXDocument)
|
1947 | : NullProtoObjectViaIFrame()
|
1948 | : NullProtoObjectViaActiveX(activeXDocument);
|
1949 | var length = enumBugKeys.length;
|
1950 | while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
1951 | return NullProtoObject();
|
1952 | };
|
1953 |
|
1954 | hiddenKeys[IE_PROTO] = true;
|
1955 |
|
1956 |
|
1957 |
|
1958 | module.exports = Object.create || function create(O, Properties) {
|
1959 | var result;
|
1960 | if (O !== null) {
|
1961 | EmptyConstructor[PROTOTYPE] = anObject(O);
|
1962 | result = new EmptyConstructor();
|
1963 | EmptyConstructor[PROTOTYPE] = null;
|
1964 |
|
1965 | result[IE_PROTO] = O;
|
1966 | } else result = NullProtoObject();
|
1967 | return Properties === undefined ? result : defineProperties(result, Properties);
|
1968 | };
|
1969 |
|
1970 |
|
1971 | }),
|
1972 |
|
1973 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1974 |
|
1975 | var DESCRIPTORS = __webpack_require__(5);
|
1976 | var definePropertyModule = __webpack_require__(41);
|
1977 | var anObject = __webpack_require__(42);
|
1978 | var toIndexedObject = __webpack_require__(10);
|
1979 | var objectKeys = __webpack_require__(69);
|
1980 |
|
1981 |
|
1982 |
|
1983 |
|
1984 | module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
|
1985 | anObject(O);
|
1986 | var props = toIndexedObject(Properties);
|
1987 | var keys = objectKeys(Properties);
|
1988 | var length = keys.length;
|
1989 | var index = 0;
|
1990 | var key;
|
1991 | while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
|
1992 | return O;
|
1993 | };
|
1994 |
|
1995 |
|
1996 | }),
|
1997 |
|
1998 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
1999 |
|
2000 | var internalObjectKeys = __webpack_require__(53);
|
2001 | var enumBugKeys = __webpack_require__(59);
|
2002 |
|
2003 |
|
2004 |
|
2005 |
|
2006 | module.exports = Object.keys || function keys(O) {
|
2007 | return internalObjectKeys(O, enumBugKeys);
|
2008 | };
|
2009 |
|
2010 |
|
2011 | }),
|
2012 |
|
2013 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2014 |
|
2015 | var getBuiltIn = __webpack_require__(20);
|
2016 |
|
2017 | module.exports = getBuiltIn('document', 'documentElement');
|
2018 |
|
2019 |
|
2020 | }),
|
2021 |
|
2022 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2023 |
|
2024 |
|
2025 | var classof = __webpack_require__(13);
|
2026 | var toIndexedObject = __webpack_require__(10);
|
2027 | var $getOwnPropertyNames = (__webpack_require__(52).f);
|
2028 | var arraySlice = __webpack_require__(72);
|
2029 |
|
2030 | var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
|
2031 | ? Object.getOwnPropertyNames(window) : [];
|
2032 |
|
2033 | var getWindowNames = function (it) {
|
2034 | try {
|
2035 | return $getOwnPropertyNames(it);
|
2036 | } catch (error) {
|
2037 | return arraySlice(windowNames);
|
2038 | }
|
2039 | };
|
2040 |
|
2041 |
|
2042 | module.exports.f = function getOwnPropertyNames(it) {
|
2043 | return windowNames && classof(it) == 'Window'
|
2044 | ? getWindowNames(it)
|
2045 | : $getOwnPropertyNames(toIndexedObject(it));
|
2046 | };
|
2047 |
|
2048 |
|
2049 | }),
|
2050 |
|
2051 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2052 |
|
2053 | var uncurryThis = __webpack_require__(12);
|
2054 |
|
2055 | module.exports = uncurryThis([].slice);
|
2056 |
|
2057 |
|
2058 | }),
|
2059 |
|
2060 | (function(__unused_webpack_module, exports, __webpack_require__) {
|
2061 |
|
2062 | var wellKnownSymbol = __webpack_require__(30);
|
2063 |
|
2064 | exports.f = wellKnownSymbol;
|
2065 |
|
2066 |
|
2067 | }),
|
2068 |
|
2069 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2070 |
|
2071 | var path = __webpack_require__(75);
|
2072 | var hasOwn = __webpack_require__(35);
|
2073 | var wrappedWellKnownSymbolModule = __webpack_require__(73);
|
2074 | var defineProperty = (__webpack_require__(41).f);
|
2075 |
|
2076 | module.exports = function (NAME) {
|
2077 | var Symbol = path.Symbol || (path.Symbol = {});
|
2078 | if (!hasOwn(Symbol, NAME)) defineProperty(Symbol, NAME, {
|
2079 | value: wrappedWellKnownSymbolModule.f(NAME)
|
2080 | });
|
2081 | };
|
2082 |
|
2083 |
|
2084 | }),
|
2085 |
|
2086 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2087 |
|
2088 | var global = __webpack_require__(3);
|
2089 |
|
2090 | module.exports = global;
|
2091 |
|
2092 |
|
2093 | }),
|
2094 |
|
2095 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2096 |
|
2097 | var defineProperty = (__webpack_require__(41).f);
|
2098 | var hasOwn = __webpack_require__(35);
|
2099 | var wellKnownSymbol = __webpack_require__(30);
|
2100 |
|
2101 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
2102 |
|
2103 | module.exports = function (it, TAG, STATIC) {
|
2104 | if (it && !hasOwn(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
|
2105 | defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG });
|
2106 | }
|
2107 | };
|
2108 |
|
2109 |
|
2110 | }),
|
2111 |
|
2112 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2113 |
|
2114 | var bind = __webpack_require__(78);
|
2115 | var uncurryThis = __webpack_require__(12);
|
2116 | var IndexedObject = __webpack_require__(11);
|
2117 | var toObject = __webpack_require__(36);
|
2118 | var lengthOfArrayLike = __webpack_require__(57);
|
2119 | var arraySpeciesCreate = __webpack_require__(79);
|
2120 |
|
2121 | var push = uncurryThis([].push);
|
2122 |
|
2123 |
|
2124 | var createMethod = function (TYPE) {
|
2125 | var IS_MAP = TYPE == 1;
|
2126 | var IS_FILTER = TYPE == 2;
|
2127 | var IS_SOME = TYPE == 3;
|
2128 | var IS_EVERY = TYPE == 4;
|
2129 | var IS_FIND_INDEX = TYPE == 6;
|
2130 | var IS_FILTER_REJECT = TYPE == 7;
|
2131 | var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
|
2132 | return function ($this, callbackfn, that, specificCreate) {
|
2133 | var O = toObject($this);
|
2134 | var self = IndexedObject(O);
|
2135 | var boundFunction = bind(callbackfn, that);
|
2136 | var length = lengthOfArrayLike(self);
|
2137 | var index = 0;
|
2138 | var create = specificCreate || arraySpeciesCreate;
|
2139 | var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
|
2140 | var value, result;
|
2141 | for (;length > index; index++) if (NO_HOLES || index in self) {
|
2142 | value = self[index];
|
2143 | result = boundFunction(value, index, O);
|
2144 | if (TYPE) {
|
2145 | if (IS_MAP) target[index] = result;
|
2146 | else if (result) switch (TYPE) {
|
2147 | case 3: return true;
|
2148 | case 5: return value;
|
2149 | case 6: return index;
|
2150 | case 2: push(target, value);
|
2151 | } else switch (TYPE) {
|
2152 | case 4: return false;
|
2153 | case 7: push(target, value);
|
2154 | }
|
2155 | }
|
2156 | }
|
2157 | return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
|
2158 | };
|
2159 | };
|
2160 |
|
2161 | module.exports = {
|
2162 |
|
2163 |
|
2164 | forEach: createMethod(0),
|
2165 |
|
2166 |
|
2167 | map: createMethod(1),
|
2168 |
|
2169 |
|
2170 | filter: createMethod(2),
|
2171 |
|
2172 |
|
2173 | some: createMethod(3),
|
2174 |
|
2175 |
|
2176 | every: createMethod(4),
|
2177 |
|
2178 |
|
2179 | find: createMethod(5),
|
2180 |
|
2181 |
|
2182 | findIndex: createMethod(6),
|
2183 |
|
2184 |
|
2185 | filterReject: createMethod(7)
|
2186 | };
|
2187 |
|
2188 |
|
2189 | }),
|
2190 |
|
2191 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2192 |
|
2193 | var uncurryThis = __webpack_require__(12);
|
2194 | var aCallable = __webpack_require__(27);
|
2195 |
|
2196 | var bind = uncurryThis(uncurryThis.bind);
|
2197 |
|
2198 |
|
2199 | module.exports = function (fn, that) {
|
2200 | aCallable(fn);
|
2201 | return that === undefined ? fn : bind ? bind(fn, that) : function (/* ...args */) {
|
2202 | return fn.apply(that, arguments);
|
2203 | };
|
2204 | };
|
2205 |
|
2206 |
|
2207 | }),
|
2208 |
|
2209 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2210 |
|
2211 | var arraySpeciesConstructor = __webpack_require__(80);
|
2212 |
|
2213 |
|
2214 |
|
2215 | module.exports = function (originalArray, length) {
|
2216 | return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
|
2217 | };
|
2218 |
|
2219 |
|
2220 | }),
|
2221 |
|
2222 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2223 |
|
2224 | var global = __webpack_require__(3);
|
2225 | var isArray = __webpack_require__(63);
|
2226 | var isConstructor = __webpack_require__(81);
|
2227 | var isObject = __webpack_require__(17);
|
2228 | var wellKnownSymbol = __webpack_require__(30);
|
2229 |
|
2230 | var SPECIES = wellKnownSymbol('species');
|
2231 | var Array = global.Array;
|
2232 |
|
2233 |
|
2234 |
|
2235 | module.exports = function (originalArray) {
|
2236 | var C;
|
2237 | if (isArray(originalArray)) {
|
2238 | C = originalArray.constructor;
|
2239 |
|
2240 | if (isConstructor(C) && (C === Array || isArray(C.prototype))) C = undefined;
|
2241 | else if (isObject(C)) {
|
2242 | C = C[SPECIES];
|
2243 | if (C === null) C = undefined;
|
2244 | }
|
2245 | } return C === undefined ? Array : C;
|
2246 | };
|
2247 |
|
2248 |
|
2249 | }),
|
2250 |
|
2251 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2252 |
|
2253 | var uncurryThis = __webpack_require__(12);
|
2254 | var fails = __webpack_require__(6);
|
2255 | var isCallable = __webpack_require__(18);
|
2256 | var classof = __webpack_require__(65);
|
2257 | var getBuiltIn = __webpack_require__(20);
|
2258 | var inspectSource = __webpack_require__(44);
|
2259 |
|
2260 | var noop = function () { };
|
2261 | var empty = [];
|
2262 | var construct = getBuiltIn('Reflect', 'construct');
|
2263 | var constructorRegExp = /^\s*(?:class|function)\b/;
|
2264 | var exec = uncurryThis(constructorRegExp.exec);
|
2265 | var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
|
2266 |
|
2267 | var isConstructorModern = function (argument) {
|
2268 | if (!isCallable(argument)) return false;
|
2269 | try {
|
2270 | construct(noop, empty, argument);
|
2271 | return true;
|
2272 | } catch (error) {
|
2273 | return false;
|
2274 | }
|
2275 | };
|
2276 |
|
2277 | var isConstructorLegacy = function (argument) {
|
2278 | if (!isCallable(argument)) return false;
|
2279 | switch (classof(argument)) {
|
2280 | case 'AsyncFunction':
|
2281 | case 'GeneratorFunction':
|
2282 | case 'AsyncGeneratorFunction': return false;
|
2283 |
|
2284 | } return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
|
2285 | };
|
2286 |
|
2287 |
|
2288 |
|
2289 | module.exports = !construct || fails(function () {
|
2290 | var called;
|
2291 | return isConstructorModern(isConstructorModern.call)
|
2292 | || !isConstructorModern(Object)
|
2293 | || !isConstructorModern(function () { called = true; })
|
2294 | || called;
|
2295 | }) ? isConstructorLegacy : isConstructorModern;
|
2296 |
|
2297 |
|
2298 | }),
|
2299 |
|
2300 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2301 |
|
2302 | "use strict";
|
2303 |
|
2304 |
|
2305 |
|
2306 | var $ = __webpack_require__(2);
|
2307 | var DESCRIPTORS = __webpack_require__(5);
|
2308 | var global = __webpack_require__(3);
|
2309 | var uncurryThis = __webpack_require__(12);
|
2310 | var hasOwn = __webpack_require__(35);
|
2311 | var isCallable = __webpack_require__(18);
|
2312 | var isPrototypeOf = __webpack_require__(21);
|
2313 | var toString = __webpack_require__(64);
|
2314 | var defineProperty = (__webpack_require__(41).f);
|
2315 | var copyConstructorProperties = __webpack_require__(50);
|
2316 |
|
2317 | var NativeSymbol = global.Symbol;
|
2318 | var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
|
2319 |
|
2320 | if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) ||
|
2321 |
|
2322 | NativeSymbol().description !== undefined
|
2323 | )) {
|
2324 | var EmptyStringDescriptionStore = {};
|
2325 |
|
2326 | var SymbolWrapper = function Symbol() {
|
2327 | var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]);
|
2328 | var result = isPrototypeOf(SymbolPrototype, this)
|
2329 | ? new NativeSymbol(description)
|
2330 |
|
2331 | : description === undefined ? NativeSymbol() : NativeSymbol(description);
|
2332 | if (description === '') EmptyStringDescriptionStore[result] = true;
|
2333 | return result;
|
2334 | };
|
2335 |
|
2336 | copyConstructorProperties(SymbolWrapper, NativeSymbol);
|
2337 | SymbolWrapper.prototype = SymbolPrototype;
|
2338 | SymbolPrototype.constructor = SymbolWrapper;
|
2339 |
|
2340 | var NATIVE_SYMBOL = String(NativeSymbol('test')) == 'Symbol(test)';
|
2341 | var symbolToString = uncurryThis(SymbolPrototype.toString);
|
2342 | var symbolValueOf = uncurryThis(SymbolPrototype.valueOf);
|
2343 | var regexp = /^Symbol\((.*)\)[^)]+$/;
|
2344 | var replace = uncurryThis(''.replace);
|
2345 | var stringSlice = uncurryThis(''.slice);
|
2346 |
|
2347 | defineProperty(SymbolPrototype, 'description', {
|
2348 | configurable: true,
|
2349 | get: function description() {
|
2350 | var symbol = symbolValueOf(this);
|
2351 | var string = symbolToString(symbol);
|
2352 | if (hasOwn(EmptyStringDescriptionStore, symbol)) return '';
|
2353 | var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1');
|
2354 | return desc === '' ? undefined : desc;
|
2355 | }
|
2356 | });
|
2357 |
|
2358 | $({ global: true, forced: true }, {
|
2359 | Symbol: SymbolWrapper
|
2360 | });
|
2361 | }
|
2362 |
|
2363 |
|
2364 | }),
|
2365 |
|
2366 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2367 |
|
2368 | var defineWellKnownSymbol = __webpack_require__(74);
|
2369 |
|
2370 |
|
2371 |
|
2372 | defineWellKnownSymbol('asyncIterator');
|
2373 |
|
2374 |
|
2375 | }),
|
2376 |
|
2377 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2378 |
|
2379 | var defineWellKnownSymbol = __webpack_require__(74);
|
2380 |
|
2381 |
|
2382 |
|
2383 | defineWellKnownSymbol('hasInstance');
|
2384 |
|
2385 |
|
2386 | }),
|
2387 |
|
2388 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2389 |
|
2390 | var defineWellKnownSymbol = __webpack_require__(74);
|
2391 |
|
2392 |
|
2393 |
|
2394 | defineWellKnownSymbol('isConcatSpreadable');
|
2395 |
|
2396 |
|
2397 | }),
|
2398 |
|
2399 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2400 |
|
2401 | var defineWellKnownSymbol = __webpack_require__(74);
|
2402 |
|
2403 |
|
2404 |
|
2405 | defineWellKnownSymbol('iterator');
|
2406 |
|
2407 |
|
2408 | }),
|
2409 |
|
2410 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2411 |
|
2412 | var defineWellKnownSymbol = __webpack_require__(74);
|
2413 |
|
2414 |
|
2415 |
|
2416 | defineWellKnownSymbol('match');
|
2417 |
|
2418 |
|
2419 | }),
|
2420 |
|
2421 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2422 |
|
2423 | var defineWellKnownSymbol = __webpack_require__(74);
|
2424 |
|
2425 |
|
2426 |
|
2427 | defineWellKnownSymbol('matchAll');
|
2428 |
|
2429 |
|
2430 | }),
|
2431 |
|
2432 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2433 |
|
2434 | var defineWellKnownSymbol = __webpack_require__(74);
|
2435 |
|
2436 |
|
2437 |
|
2438 | defineWellKnownSymbol('replace');
|
2439 |
|
2440 |
|
2441 | }),
|
2442 |
|
2443 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2444 |
|
2445 | var defineWellKnownSymbol = __webpack_require__(74);
|
2446 |
|
2447 |
|
2448 |
|
2449 | defineWellKnownSymbol('search');
|
2450 |
|
2451 |
|
2452 | }),
|
2453 |
|
2454 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2455 |
|
2456 | var defineWellKnownSymbol = __webpack_require__(74);
|
2457 |
|
2458 |
|
2459 |
|
2460 | defineWellKnownSymbol('species');
|
2461 |
|
2462 |
|
2463 | }),
|
2464 |
|
2465 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2466 |
|
2467 | var defineWellKnownSymbol = __webpack_require__(74);
|
2468 |
|
2469 |
|
2470 |
|
2471 | defineWellKnownSymbol('split');
|
2472 |
|
2473 |
|
2474 | }),
|
2475 |
|
2476 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2477 |
|
2478 | var defineWellKnownSymbol = __webpack_require__(74);
|
2479 |
|
2480 |
|
2481 |
|
2482 | defineWellKnownSymbol('toPrimitive');
|
2483 |
|
2484 |
|
2485 | }),
|
2486 |
|
2487 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2488 |
|
2489 | var defineWellKnownSymbol = __webpack_require__(74);
|
2490 |
|
2491 |
|
2492 |
|
2493 | defineWellKnownSymbol('toStringTag');
|
2494 |
|
2495 |
|
2496 | }),
|
2497 |
|
2498 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2499 |
|
2500 | var defineWellKnownSymbol = __webpack_require__(74);
|
2501 |
|
2502 |
|
2503 |
|
2504 | defineWellKnownSymbol('unscopables');
|
2505 |
|
2506 |
|
2507 | }),
|
2508 |
|
2509 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2510 |
|
2511 | "use strict";
|
2512 |
|
2513 | var $ = __webpack_require__(2);
|
2514 | var global = __webpack_require__(3);
|
2515 | var isPrototypeOf = __webpack_require__(21);
|
2516 | var getPrototypeOf = __webpack_require__(97);
|
2517 | var setPrototypeOf = __webpack_require__(99);
|
2518 | var copyConstructorProperties = __webpack_require__(50);
|
2519 | var create = __webpack_require__(67);
|
2520 | var createNonEnumerableProperty = __webpack_require__(40);
|
2521 | var createPropertyDescriptor = __webpack_require__(9);
|
2522 | var clearErrorStack = __webpack_require__(101);
|
2523 | var installErrorCause = __webpack_require__(102);
|
2524 | var iterate = __webpack_require__(103);
|
2525 | var normalizeStringArgument = __webpack_require__(109);
|
2526 | var wellKnownSymbol = __webpack_require__(30);
|
2527 | var ERROR_STACK_INSTALLABLE = __webpack_require__(110);
|
2528 |
|
2529 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
2530 | var Error = global.Error;
|
2531 | var push = [].push;
|
2532 |
|
2533 | var $AggregateError = function AggregateError(errors, message /* , options */) {
|
2534 | var options = arguments.length > 2 ? arguments[2] : undefined;
|
2535 | var isInstance = isPrototypeOf(AggregateErrorPrototype, this);
|
2536 | var that;
|
2537 | if (setPrototypeOf) {
|
2538 | that = setPrototypeOf(new Error(undefined), isInstance ? getPrototypeOf(this) : AggregateErrorPrototype);
|
2539 | } else {
|
2540 | that = isInstance ? this : create(AggregateErrorPrototype);
|
2541 | createNonEnumerableProperty(that, TO_STRING_TAG, 'Error');
|
2542 | }
|
2543 | createNonEnumerableProperty(that, 'message', normalizeStringArgument(message, ''));
|
2544 | if (ERROR_STACK_INSTALLABLE) createNonEnumerableProperty(that, 'stack', clearErrorStack(that.stack, 1));
|
2545 | installErrorCause(that, options);
|
2546 | var errorsArray = [];
|
2547 | iterate(errors, push, { that: errorsArray });
|
2548 | createNonEnumerableProperty(that, 'errors', errorsArray);
|
2549 | return that;
|
2550 | };
|
2551 |
|
2552 | if (setPrototypeOf) setPrototypeOf($AggregateError, Error);
|
2553 | else copyConstructorProperties($AggregateError, Error);
|
2554 |
|
2555 | var AggregateErrorPrototype = $AggregateError.prototype = create(Error.prototype, {
|
2556 | constructor: createPropertyDescriptor(1, $AggregateError),
|
2557 | message: createPropertyDescriptor(1, ''),
|
2558 | name: createPropertyDescriptor(1, 'AggregateError')
|
2559 | });
|
2560 |
|
2561 | // `AggregateError` constructor
|
2562 | // https://tc39.es/ecma262/#sec-aggregate-error-constructor
|
2563 | $({ global: true }, {
|
2564 | AggregateError: $AggregateError
|
2565 | });
|
2566 |
|
2567 |
|
2568 | }),
|
2569 |
|
2570 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2571 |
|
2572 | var global = __webpack_require__(3);
|
2573 | var hasOwn = __webpack_require__(35);
|
2574 | var isCallable = __webpack_require__(18);
|
2575 | var toObject = __webpack_require__(36);
|
2576 | var sharedKey = __webpack_require__(47);
|
2577 | var CORRECT_PROTOTYPE_GETTER = __webpack_require__(98);
|
2578 |
|
2579 | var IE_PROTO = sharedKey('IE_PROTO');
|
2580 | var Object = global.Object;
|
2581 | var ObjectPrototype = Object.prototype;
|
2582 |
|
2583 |
|
2584 |
|
2585 | module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) {
|
2586 | var object = toObject(O);
|
2587 | if (hasOwn(object, IE_PROTO)) return object[IE_PROTO];
|
2588 | var constructor = object.constructor;
|
2589 | if (isCallable(constructor) && object instanceof constructor) {
|
2590 | return constructor.prototype;
|
2591 | } return object instanceof Object ? ObjectPrototype : null;
|
2592 | };
|
2593 |
|
2594 |
|
2595 | /***/ }),
|
2596 | /* 98 */
|
2597 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
2598 |
|
2599 | var fails = __webpack_require__(6);
|
2600 |
|
2601 | module.exports = !fails(function () {
|
2602 | function F() { }
|
2603 | F.prototype.constructor = null;
|
2604 |
|
2605 | return Object.getPrototypeOf(new F()) !== F.prototype;
|
2606 | });
|
2607 |
|
2608 |
|
2609 | }),
|
2610 |
|
2611 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2612 |
|
2613 |
|
2614 | var uncurryThis = __webpack_require__(12);
|
2615 | var anObject = __webpack_require__(42);
|
2616 | var aPossiblePrototype = __webpack_require__(100);
|
2617 |
|
2618 |
|
2619 |
|
2620 |
|
2621 |
|
2622 | module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
2623 | var CORRECT_SETTER = false;
|
2624 | var test = {};
|
2625 | var setter;
|
2626 | try {
|
2627 |
|
2628 | setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
2629 | setter(test, []);
|
2630 | CORRECT_SETTER = test instanceof Array;
|
2631 | } catch (error) { }
|
2632 | return function setPrototypeOf(O, proto) {
|
2633 | anObject(O);
|
2634 | aPossiblePrototype(proto);
|
2635 | if (CORRECT_SETTER) setter(O, proto);
|
2636 | else O.__proto__ = proto;
|
2637 | return O;
|
2638 | };
|
2639 | }() : undefined);
|
2640 |
|
2641 |
|
2642 | }),
|
2643 |
|
2644 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2645 |
|
2646 | var global = __webpack_require__(3);
|
2647 | var isCallable = __webpack_require__(18);
|
2648 |
|
2649 | var String = global.String;
|
2650 | var TypeError = global.TypeError;
|
2651 |
|
2652 | module.exports = function (argument) {
|
2653 | if (typeof argument == 'object' || isCallable(argument)) return argument;
|
2654 | throw TypeError("Can't set " + String(argument) + ' as a prototype');
|
2655 | };
|
2656 |
|
2657 |
|
2658 | }),
|
2659 |
|
2660 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2661 |
|
2662 | var uncurryThis = __webpack_require__(12);
|
2663 | var arraySlice = __webpack_require__(72);
|
2664 |
|
2665 | var replace = uncurryThis(''.replace);
|
2666 | var split = uncurryThis(''.split);
|
2667 | var join = uncurryThis([].join);
|
2668 |
|
2669 | var TEST = (function (arg) { return String(Error(arg).stack); })('zxcasd');
|
2670 | var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
|
2671 | var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
|
2672 | var IS_FIREFOX_OR_SAFARI_STACK = /@[^\n]*\n/.test(TEST) && !/zxcasd/.test(TEST);
|
2673 |
|
2674 | module.exports = function (stack, dropEntries) {
|
2675 | if (typeof stack != 'string') return stack;
|
2676 | if (IS_V8_OR_CHAKRA_STACK) {
|
2677 | while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
|
2678 | } else if (IS_FIREFOX_OR_SAFARI_STACK) {
|
2679 | return join(arraySlice(split(stack, '\n'), dropEntries), '\n');
|
2680 | } return stack;
|
2681 | };
|
2682 |
|
2683 |
|
2684 | }),
|
2685 |
|
2686 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2687 |
|
2688 | var isObject = __webpack_require__(17);
|
2689 | var createNonEnumerableProperty = __webpack_require__(40);
|
2690 |
|
2691 |
|
2692 |
|
2693 | module.exports = function (O, options) {
|
2694 | if (isObject(options) && 'cause' in options) {
|
2695 | createNonEnumerableProperty(O, 'cause', options.cause);
|
2696 | }
|
2697 | };
|
2698 |
|
2699 |
|
2700 | }),
|
2701 |
|
2702 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2703 |
|
2704 | var global = __webpack_require__(3);
|
2705 | var bind = __webpack_require__(78);
|
2706 | var call = __webpack_require__(7);
|
2707 | var anObject = __webpack_require__(42);
|
2708 | var tryToString = __webpack_require__(28);
|
2709 | var isArrayIteratorMethod = __webpack_require__(104);
|
2710 | var lengthOfArrayLike = __webpack_require__(57);
|
2711 | var isPrototypeOf = __webpack_require__(21);
|
2712 | var getIterator = __webpack_require__(106);
|
2713 | var getIteratorMethod = __webpack_require__(107);
|
2714 | var iteratorClose = __webpack_require__(108);
|
2715 |
|
2716 | var TypeError = global.TypeError;
|
2717 |
|
2718 | var Result = function (stopped, result) {
|
2719 | this.stopped = stopped;
|
2720 | this.result = result;
|
2721 | };
|
2722 |
|
2723 | var ResultPrototype = Result.prototype;
|
2724 |
|
2725 | module.exports = function (iterable, unboundFunction, options) {
|
2726 | var that = options && options.that;
|
2727 | var AS_ENTRIES = !!(options && options.AS_ENTRIES);
|
2728 | var IS_ITERATOR = !!(options && options.IS_ITERATOR);
|
2729 | var INTERRUPTED = !!(options && options.INTERRUPTED);
|
2730 | var fn = bind(unboundFunction, that);
|
2731 | var iterator, iterFn, index, length, result, next, step;
|
2732 |
|
2733 | var stop = function (condition) {
|
2734 | if (iterator) iteratorClose(iterator, 'normal', condition);
|
2735 | return new Result(true, condition);
|
2736 | };
|
2737 |
|
2738 | var callFn = function (value) {
|
2739 | if (AS_ENTRIES) {
|
2740 | anObject(value);
|
2741 | return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
|
2742 | } return INTERRUPTED ? fn(value, stop) : fn(value);
|
2743 | };
|
2744 |
|
2745 | if (IS_ITERATOR) {
|
2746 | iterator = iterable;
|
2747 | } else {
|
2748 | iterFn = getIteratorMethod(iterable);
|
2749 | if (!iterFn) throw TypeError(tryToString(iterable) + ' is not iterable');
|
2750 |
|
2751 | if (isArrayIteratorMethod(iterFn)) {
|
2752 | for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
|
2753 | result = callFn(iterable[index]);
|
2754 | if (result && isPrototypeOf(ResultPrototype, result)) return result;
|
2755 | } return new Result(false);
|
2756 | }
|
2757 | iterator = getIterator(iterable, iterFn);
|
2758 | }
|
2759 |
|
2760 | next = iterator.next;
|
2761 | while (!(step = call(next, iterator)).done) {
|
2762 | try {
|
2763 | result = callFn(step.value);
|
2764 | } catch (error) {
|
2765 | iteratorClose(iterator, 'throw', error);
|
2766 | }
|
2767 | if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
|
2768 | } return new Result(false);
|
2769 | };
|
2770 |
|
2771 |
|
2772 | }),
|
2773 |
|
2774 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2775 |
|
2776 | var wellKnownSymbol = __webpack_require__(30);
|
2777 | var Iterators = __webpack_require__(105);
|
2778 |
|
2779 | var ITERATOR = wellKnownSymbol('iterator');
|
2780 | var ArrayPrototype = Array.prototype;
|
2781 |
|
2782 |
|
2783 | module.exports = function (it) {
|
2784 | return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
|
2785 | };
|
2786 |
|
2787 |
|
2788 | }),
|
2789 |
|
2790 | (function(module) {
|
2791 |
|
2792 | module.exports = {};
|
2793 |
|
2794 |
|
2795 | }),
|
2796 |
|
2797 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2798 |
|
2799 | var global = __webpack_require__(3);
|
2800 | var call = __webpack_require__(7);
|
2801 | var aCallable = __webpack_require__(27);
|
2802 | var anObject = __webpack_require__(42);
|
2803 | var tryToString = __webpack_require__(28);
|
2804 | var getIteratorMethod = __webpack_require__(107);
|
2805 |
|
2806 | var TypeError = global.TypeError;
|
2807 |
|
2808 | module.exports = function (argument, usingIterator) {
|
2809 | var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
|
2810 | if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
|
2811 | throw TypeError(tryToString(argument) + ' is not iterable');
|
2812 | };
|
2813 |
|
2814 |
|
2815 | }),
|
2816 |
|
2817 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2818 |
|
2819 | var classof = __webpack_require__(65);
|
2820 | var getMethod = __webpack_require__(26);
|
2821 | var Iterators = __webpack_require__(105);
|
2822 | var wellKnownSymbol = __webpack_require__(30);
|
2823 |
|
2824 | var ITERATOR = wellKnownSymbol('iterator');
|
2825 |
|
2826 | module.exports = function (it) {
|
2827 | if (it != undefined) return getMethod(it, ITERATOR)
|
2828 | || getMethod(it, '@@iterator')
|
2829 | || Iterators[classof(it)];
|
2830 | };
|
2831 |
|
2832 |
|
2833 | }),
|
2834 |
|
2835 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2836 |
|
2837 | var call = __webpack_require__(7);
|
2838 | var anObject = __webpack_require__(42);
|
2839 | var getMethod = __webpack_require__(26);
|
2840 |
|
2841 | module.exports = function (iterator, kind, value) {
|
2842 | var innerResult, innerError;
|
2843 | anObject(iterator);
|
2844 | try {
|
2845 | innerResult = getMethod(iterator, 'return');
|
2846 | if (!innerResult) {
|
2847 | if (kind === 'throw') throw value;
|
2848 | return value;
|
2849 | }
|
2850 | innerResult = call(innerResult, iterator);
|
2851 | } catch (error) {
|
2852 | innerError = true;
|
2853 | innerResult = error;
|
2854 | }
|
2855 | if (kind === 'throw') throw value;
|
2856 | if (innerError) throw innerResult;
|
2857 | anObject(innerResult);
|
2858 | return value;
|
2859 | };
|
2860 |
|
2861 |
|
2862 | }),
|
2863 |
|
2864 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2865 |
|
2866 | var toString = __webpack_require__(64);
|
2867 |
|
2868 | module.exports = function (argument, $default) {
|
2869 | return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);
|
2870 | };
|
2871 |
|
2872 |
|
2873 | }),
|
2874 |
|
2875 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2876 |
|
2877 | var fails = __webpack_require__(6);
|
2878 | var createPropertyDescriptor = __webpack_require__(9);
|
2879 |
|
2880 | module.exports = !fails(function () {
|
2881 | var error = Error('a');
|
2882 | if (!('stack' in error)) return true;
|
2883 |
|
2884 | Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));
|
2885 | return error.stack !== 7;
|
2886 | });
|
2887 |
|
2888 |
|
2889 | }),
|
2890 |
|
2891 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2892 |
|
2893 | "use strict";
|
2894 |
|
2895 | var $ = __webpack_require__(2);
|
2896 | var toObject = __webpack_require__(36);
|
2897 | var lengthOfArrayLike = __webpack_require__(57);
|
2898 | var toIntegerOrInfinity = __webpack_require__(56);
|
2899 | var addToUnscopables = __webpack_require__(112);
|
2900 |
|
2901 |
|
2902 |
|
2903 | $({ target: 'Array', proto: true }, {
|
2904 | at: function at(index) {
|
2905 | var O = toObject(this);
|
2906 | var len = lengthOfArrayLike(O);
|
2907 | var relativeIndex = toIntegerOrInfinity(index);
|
2908 | var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex;
|
2909 | return (k < 0 || k >= len) ? undefined : O[k];
|
2910 | }
|
2911 | });
|
2912 |
|
2913 | addToUnscopables('at');
|
2914 |
|
2915 |
|
2916 | }),
|
2917 |
|
2918 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
2919 |
|
2920 | var wellKnownSymbol = __webpack_require__(30);
|
2921 | var create = __webpack_require__(67);
|
2922 | var definePropertyModule = __webpack_require__(41);
|
2923 |
|
2924 | var UNSCOPABLES = wellKnownSymbol('unscopables');
|
2925 | var ArrayPrototype = Array.prototype;
|
2926 |
|
2927 |
|
2928 |
|
2929 | if (ArrayPrototype[UNSCOPABLES] == undefined) {
|
2930 | definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
|
2931 | configurable: true,
|
2932 | value: create(null)
|
2933 | });
|
2934 | }
|
2935 |
|
2936 |
|
2937 | module.exports = function (key) {
|
2938 | ArrayPrototype[UNSCOPABLES][key] = true;
|
2939 | };
|
2940 |
|
2941 |
|
2942 | }),
|
2943 |
|
2944 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
2945 |
|
2946 | "use strict";
|
2947 |
|
2948 | var $ = __webpack_require__(2);
|
2949 | var global = __webpack_require__(3);
|
2950 | var fails = __webpack_require__(6);
|
2951 | var isArray = __webpack_require__(63);
|
2952 | var isObject = __webpack_require__(17);
|
2953 | var toObject = __webpack_require__(36);
|
2954 | var lengthOfArrayLike = __webpack_require__(57);
|
2955 | var createProperty = __webpack_require__(114);
|
2956 | var arraySpeciesCreate = __webpack_require__(79);
|
2957 | var arrayMethodHasSpeciesSupport = __webpack_require__(115);
|
2958 | var wellKnownSymbol = __webpack_require__(30);
|
2959 | var V8_VERSION = __webpack_require__(24);
|
2960 |
|
2961 | var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');
|
2962 | var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
|
2963 | var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
|
2964 | var TypeError = global.TypeError;
|
2965 |
|
2966 |
|
2967 |
|
2968 |
|
2969 | var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function () {
|
2970 | var array = [];
|
2971 | array[IS_CONCAT_SPREADABLE] = false;
|
2972 | return array.concat()[0] !== array;
|
2973 | });
|
2974 |
|
2975 | var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');
|
2976 |
|
2977 | var isConcatSpreadable = function (O) {
|
2978 | if (!isObject(O)) return false;
|
2979 | var spreadable = O[IS_CONCAT_SPREADABLE];
|
2980 | return spreadable !== undefined ? !!spreadable : isArray(O);
|
2981 | };
|
2982 |
|
2983 | var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
|
2984 |
|
2985 |
|
2986 |
|
2987 |
|
2988 | $({ target: 'Array', proto: true, forced: FORCED }, {
|
2989 |
|
2990 | concat: function concat(arg) {
|
2991 | var O = toObject(this);
|
2992 | var A = arraySpeciesCreate(O, 0);
|
2993 | var n = 0;
|
2994 | var i, k, length, len, E;
|
2995 | for (i = -1, length = arguments.length; i < length; i++) {
|
2996 | E = i === -1 ? O : arguments[i];
|
2997 | if (isConcatSpreadable(E)) {
|
2998 | len = lengthOfArrayLike(E);
|
2999 | if (n + len > MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
3000 | for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);
|
3001 | } else {
|
3002 | if (n >= MAX_SAFE_INTEGER) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
|
3003 | createProperty(A, n++, E);
|
3004 | }
|
3005 | }
|
3006 | A.length = n;
|
3007 | return A;
|
3008 | }
|
3009 | });
|
3010 |
|
3011 |
|
3012 | }),
|
3013 |
|
3014 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
3015 |
|
3016 | "use strict";
|
3017 |
|
3018 | var toPropertyKey = __webpack_require__(15);
|
3019 | var definePropertyModule = __webpack_require__(41);
|
3020 | var createPropertyDescriptor = __webpack_require__(9);
|
3021 |
|
3022 | module.exports = function (object, key, value) {
|
3023 | var propertyKey = toPropertyKey(key);
|
3024 | if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
|
3025 | else object[propertyKey] = value;
|
3026 | };
|
3027 |
|
3028 |
|
3029 | }),
|
3030 |
|
3031 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
3032 |
|
3033 | var fails = __webpack_require__(6);
|
3034 | var wellKnownSymbol = __webpack_require__(30);
|
3035 | var V8_VERSION = __webpack_require__(24);
|
3036 |
|
3037 | var SPECIES = wellKnownSymbol('species');
|
3038 |
|
3039 | module.exports = function (METHOD_NAME) {
|
3040 |
|
3041 |
|
3042 |
|
3043 | return V8_VERSION >= 51 || !fails(function () {
|
3044 | var array = [];
|
3045 | var constructor = array.constructor = {};
|
3046 | constructor[SPECIES] = function () {
|
3047 | return { foo: 1 };
|
3048 | };
|
3049 | return array[METHOD_NAME](Boolean).foo !== 1;
|
3050 | });
|
3051 | };
|
3052 |
|
3053 |
|
3054 | }),
|
3055 |
|
3056 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3057 |
|
3058 | var $ = __webpack_require__(2);
|
3059 | var copyWithin = __webpack_require__(117);
|
3060 | var addToUnscopables = __webpack_require__(112);
|
3061 |
|
3062 |
|
3063 |
|
3064 | $({ target: 'Array', proto: true }, {
|
3065 | copyWithin: copyWithin
|
3066 | });
|
3067 |
|
3068 |
|
3069 | addToUnscopables('copyWithin');
|
3070 |
|
3071 |
|
3072 | }),
|
3073 |
|
3074 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
3075 |
|
3076 | "use strict";
|
3077 |
|
3078 | var toObject = __webpack_require__(36);
|
3079 | var toAbsoluteIndex = __webpack_require__(55);
|
3080 | var lengthOfArrayLike = __webpack_require__(57);
|
3081 |
|
3082 | var min = Math.min;
|
3083 |
|
3084 |
|
3085 |
|
3086 |
|
3087 | module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {
|
3088 | var O = toObject(this);
|
3089 | var len = lengthOfArrayLike(O);
|
3090 | var to = toAbsoluteIndex(target, len);
|
3091 | var from = toAbsoluteIndex(start, len);
|
3092 | var end = arguments.length > 2 ? arguments[2] : undefined;
|
3093 | var count = min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);
|
3094 | var inc = 1;
|
3095 | if (from < to && to < from + count) {
|
3096 | inc = -1;
|
3097 | from += count - 1;
|
3098 | to += count - 1;
|
3099 | }
|
3100 | while (count-- > 0) {
|
3101 | if (from in O) O[to] = O[from];
|
3102 | else delete O[to];
|
3103 | to += inc;
|
3104 | from += inc;
|
3105 | } return O;
|
3106 | };
|
3107 |
|
3108 |
|
3109 | }),
|
3110 |
|
3111 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3112 |
|
3113 | "use strict";
|
3114 |
|
3115 | var $ = __webpack_require__(2);
|
3116 | var $every = (__webpack_require__(77).every);
|
3117 | var arrayMethodIsStrict = __webpack_require__(119);
|
3118 |
|
3119 | var STRICT_METHOD = arrayMethodIsStrict('every');
|
3120 |
|
3121 |
|
3122 |
|
3123 | $({ target: 'Array', proto: true, forced: !STRICT_METHOD }, {
|
3124 | every: function every(callbackfn /* , thisArg */) {
|
3125 | return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
3126 | }
|
3127 | });
|
3128 |
|
3129 |
|
3130 | }),
|
3131 |
|
3132 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
3133 |
|
3134 | "use strict";
|
3135 |
|
3136 | var fails = __webpack_require__(6);
|
3137 |
|
3138 | module.exports = function (METHOD_NAME, argument) {
|
3139 | var method = [][METHOD_NAME];
|
3140 | return !!method && fails(function () {
|
3141 |
|
3142 | method.call(null, argument || function () { throw 1; }, 1);
|
3143 | });
|
3144 | };
|
3145 |
|
3146 |
|
3147 | }),
|
3148 |
|
3149 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3150 |
|
3151 | var $ = __webpack_require__(2);
|
3152 | var fill = __webpack_require__(121);
|
3153 | var addToUnscopables = __webpack_require__(112);
|
3154 |
|
3155 |
|
3156 |
|
3157 | $({ target: 'Array', proto: true }, {
|
3158 | fill: fill
|
3159 | });
|
3160 |
|
3161 |
|
3162 | addToUnscopables('fill');
|
3163 |
|
3164 |
|
3165 | }),
|
3166 |
|
3167 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
3168 |
|
3169 | "use strict";
|
3170 |
|
3171 | var toObject = __webpack_require__(36);
|
3172 | var toAbsoluteIndex = __webpack_require__(55);
|
3173 | var lengthOfArrayLike = __webpack_require__(57);
|
3174 |
|
3175 |
|
3176 |
|
3177 | module.exports = function fill(value /* , start = 0, end = @length */) {
|
3178 | var O = toObject(this);
|
3179 | var length = lengthOfArrayLike(O);
|
3180 | var argumentsLength = arguments.length;
|
3181 | var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length);
|
3182 | var end = argumentsLength > 2 ? arguments[2] : undefined;
|
3183 | var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
|
3184 | while (endPos > index) O[index++] = value;
|
3185 | return O;
|
3186 | };
|
3187 |
|
3188 |
|
3189 | }),
|
3190 |
|
3191 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3192 |
|
3193 | "use strict";
|
3194 |
|
3195 | var $ = __webpack_require__(2);
|
3196 | var $filter = (__webpack_require__(77).filter);
|
3197 | var arrayMethodHasSpeciesSupport = __webpack_require__(115);
|
3198 |
|
3199 | var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
|
3200 |
|
3201 |
|
3202 |
|
3203 |
|
3204 | $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
|
3205 | filter: function filter(callbackfn /* , thisArg */) {
|
3206 | return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
3207 | }
|
3208 | });
|
3209 |
|
3210 |
|
3211 | }),
|
3212 |
|
3213 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3214 |
|
3215 | "use strict";
|
3216 |
|
3217 | var $ = __webpack_require__(2);
|
3218 | var $find = (__webpack_require__(77).find);
|
3219 | var addToUnscopables = __webpack_require__(112);
|
3220 |
|
3221 | var FIND = 'find';
|
3222 | var SKIPS_HOLES = true;
|
3223 |
|
3224 |
|
3225 | if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });
|
3226 |
|
3227 |
|
3228 |
|
3229 | $({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
|
3230 | find: function find(callbackfn /* , that = undefined */) {
|
3231 | return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
3232 | }
|
3233 | });
|
3234 |
|
3235 |
|
3236 | addToUnscopables(FIND);
|
3237 |
|
3238 |
|
3239 | }),
|
3240 |
|
3241 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3242 |
|
3243 | "use strict";
|
3244 |
|
3245 | var $ = __webpack_require__(2);
|
3246 | var $findIndex = (__webpack_require__(77).findIndex);
|
3247 | var addToUnscopables = __webpack_require__(112);
|
3248 |
|
3249 | var FIND_INDEX = 'findIndex';
|
3250 | var SKIPS_HOLES = true;
|
3251 |
|
3252 |
|
3253 | if (FIND_INDEX in []) Array(1)[FIND_INDEX](function () { SKIPS_HOLES = false; });
|
3254 |
|
3255 |
|
3256 |
|
3257 | $({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
|
3258 | findIndex: function findIndex(callbackfn /* , that = undefined */) {
|
3259 | return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
3260 | }
|
3261 | });
|
3262 |
|
3263 |
|
3264 | addToUnscopables(FIND_INDEX);
|
3265 |
|
3266 |
|
3267 | }),
|
3268 |
|
3269 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3270 |
|
3271 | "use strict";
|
3272 |
|
3273 | var $ = __webpack_require__(2);
|
3274 | var flattenIntoArray = __webpack_require__(126);
|
3275 | var toObject = __webpack_require__(36);
|
3276 | var lengthOfArrayLike = __webpack_require__(57);
|
3277 | var toIntegerOrInfinity = __webpack_require__(56);
|
3278 | var arraySpeciesCreate = __webpack_require__(79);
|
3279 |
|
3280 |
|
3281 |
|
3282 | $({ target: 'Array', proto: true }, {
|
3283 | flat: function flat(/* depthArg = 1 */) {
|
3284 | var depthArg = arguments.length ? arguments[0] : undefined;
|
3285 | var O = toObject(this);
|
3286 | var sourceLen = lengthOfArrayLike(O);
|
3287 | var A = arraySpeciesCreate(O, 0);
|
3288 | A.length = flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toIntegerOrInfinity(depthArg));
|
3289 | return A;
|
3290 | }
|
3291 | });
|
3292 |
|
3293 |
|
3294 | }),
|
3295 |
|
3296 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
3297 |
|
3298 | "use strict";
|
3299 |
|
3300 | var global = __webpack_require__(3);
|
3301 | var isArray = __webpack_require__(63);
|
3302 | var lengthOfArrayLike = __webpack_require__(57);
|
3303 | var bind = __webpack_require__(78);
|
3304 |
|
3305 | var TypeError = global.TypeError;
|
3306 |
|
3307 |
|
3308 |
|
3309 | var flattenIntoArray = function (target, original, source, sourceLen, start, depth, mapper, thisArg) {
|
3310 | var targetIndex = start;
|
3311 | var sourceIndex = 0;
|
3312 | var mapFn = mapper ? bind(mapper, thisArg) : false;
|
3313 | var element, elementLen;
|
3314 |
|
3315 | while (sourceIndex < sourceLen) {
|
3316 | if (sourceIndex in source) {
|
3317 | element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
|
3318 |
|
3319 | if (depth > 0 && isArray(element)) {
|
3320 | elementLen = lengthOfArrayLike(element);
|
3321 | targetIndex = flattenIntoArray(target, original, element, elementLen, targetIndex, depth - 1) - 1;
|
3322 | } else {
|
3323 | if (targetIndex >= 0x1FFFFFFFFFFFFF) throw TypeError('Exceed the acceptable array length');
|
3324 | target[targetIndex] = element;
|
3325 | }
|
3326 |
|
3327 | targetIndex++;
|
3328 | }
|
3329 | sourceIndex++;
|
3330 | }
|
3331 | return targetIndex;
|
3332 | };
|
3333 |
|
3334 | module.exports = flattenIntoArray;
|
3335 |
|
3336 |
|
3337 | }),
|
3338 |
|
3339 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3340 |
|
3341 | "use strict";
|
3342 |
|
3343 | var $ = __webpack_require__(2);
|
3344 | var flattenIntoArray = __webpack_require__(126);
|
3345 | var aCallable = __webpack_require__(27);
|
3346 | var toObject = __webpack_require__(36);
|
3347 | var lengthOfArrayLike = __webpack_require__(57);
|
3348 | var arraySpeciesCreate = __webpack_require__(79);
|
3349 |
|
3350 |
|
3351 |
|
3352 | $({ target: 'Array', proto: true }, {
|
3353 | flatMap: function flatMap(callbackfn /* , thisArg */) {
|
3354 | var O = toObject(this);
|
3355 | var sourceLen = lengthOfArrayLike(O);
|
3356 | var A;
|
3357 | aCallable(callbackfn);
|
3358 | A = arraySpeciesCreate(O, 0);
|
3359 | A.length = flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
3360 | return A;
|
3361 | }
|
3362 | });
|
3363 |
|
3364 |
|
3365 | }),
|
3366 |
|
3367 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3368 |
|
3369 | "use strict";
|
3370 |
|
3371 | var $ = __webpack_require__(2);
|
3372 | var forEach = __webpack_require__(129);
|
3373 |
|
3374 |
|
3375 |
|
3376 |
|
3377 | $({ target: 'Array', proto: true, forced: [].forEach != forEach }, {
|
3378 | forEach: forEach
|
3379 | });
|
3380 |
|
3381 |
|
3382 | }),
|
3383 |
|
3384 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
3385 |
|
3386 | "use strict";
|
3387 |
|
3388 | var $forEach = (__webpack_require__(77).forEach);
|
3389 | var arrayMethodIsStrict = __webpack_require__(119);
|
3390 |
|
3391 | var STRICT_METHOD = arrayMethodIsStrict('forEach');
|
3392 |
|
3393 |
|
3394 |
|
3395 | module.exports = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) {
|
3396 | return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
3397 |
|
3398 | } : [].forEach;
|
3399 |
|
3400 |
|
3401 | }),
|
3402 |
|
3403 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3404 |
|
3405 | var $ = __webpack_require__(2);
|
3406 | var from = __webpack_require__(131);
|
3407 | var checkCorrectnessOfIteration = __webpack_require__(133);
|
3408 |
|
3409 | var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
|
3410 |
|
3411 | Array.from(iterable);
|
3412 | });
|
3413 |
|
3414 |
|
3415 |
|
3416 | $({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
|
3417 | from: from
|
3418 | });
|
3419 |
|
3420 |
|
3421 | }),
|
3422 |
|
3423 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
3424 |
|
3425 | "use strict";
|
3426 |
|
3427 | var global = __webpack_require__(3);
|
3428 | var bind = __webpack_require__(78);
|
3429 | var call = __webpack_require__(7);
|
3430 | var toObject = __webpack_require__(36);
|
3431 | var callWithSafeIterationClosing = __webpack_require__(132);
|
3432 | var isArrayIteratorMethod = __webpack_require__(104);
|
3433 | var isConstructor = __webpack_require__(81);
|
3434 | var lengthOfArrayLike = __webpack_require__(57);
|
3435 | var createProperty = __webpack_require__(114);
|
3436 | var getIterator = __webpack_require__(106);
|
3437 | var getIteratorMethod = __webpack_require__(107);
|
3438 |
|
3439 | var Array = global.Array;
|
3440 |
|
3441 |
|
3442 |
|
3443 | module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
|
3444 | var O = toObject(arrayLike);
|
3445 | var IS_CONSTRUCTOR = isConstructor(this);
|
3446 | var argumentsLength = arguments.length;
|
3447 | var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
|
3448 | var mapping = mapfn !== undefined;
|
3449 | if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
|
3450 | var iteratorMethod = getIteratorMethod(O);
|
3451 | var index = 0;
|
3452 | var length, result, step, iterator, next, value;
|
3453 |
|
3454 | if (iteratorMethod && !(this == Array && isArrayIteratorMethod(iteratorMethod))) {
|
3455 | iterator = getIterator(O, iteratorMethod);
|
3456 | next = iterator.next;
|
3457 | result = IS_CONSTRUCTOR ? new this() : [];
|
3458 | for (;!(step = call(next, iterator)).done; index++) {
|
3459 | value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
|
3460 | createProperty(result, index, value);
|
3461 | }
|
3462 | } else {
|
3463 | length = lengthOfArrayLike(O);
|
3464 | result = IS_CONSTRUCTOR ? new this(length) : Array(length);
|
3465 | for (;length > index; index++) {
|
3466 | value = mapping ? mapfn(O[index], index) : O[index];
|
3467 | createProperty(result, index, value);
|
3468 | }
|
3469 | }
|
3470 | result.length = index;
|
3471 | return result;
|
3472 | };
|
3473 |
|
3474 |
|
3475 | }),
|
3476 |
|
3477 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
3478 |
|
3479 | var anObject = __webpack_require__(42);
|
3480 | var iteratorClose = __webpack_require__(108);
|
3481 |
|
3482 |
|
3483 | module.exports = function (iterator, fn, value, ENTRIES) {
|
3484 | try {
|
3485 | return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
|
3486 | } catch (error) {
|
3487 | iteratorClose(iterator, 'throw', error);
|
3488 | }
|
3489 | };
|
3490 |
|
3491 |
|
3492 | }),
|
3493 |
|
3494 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
3495 |
|
3496 | var wellKnownSymbol = __webpack_require__(30);
|
3497 |
|
3498 | var ITERATOR = wellKnownSymbol('iterator');
|
3499 | var SAFE_CLOSING = false;
|
3500 |
|
3501 | try {
|
3502 | var called = 0;
|
3503 | var iteratorWithReturn = {
|
3504 | next: function () {
|
3505 | return { done: !!called++ };
|
3506 | },
|
3507 | 'return': function () {
|
3508 | SAFE_CLOSING = true;
|
3509 | }
|
3510 | };
|
3511 | iteratorWithReturn[ITERATOR] = function () {
|
3512 | return this;
|
3513 | };
|
3514 |
|
3515 | Array.from(iteratorWithReturn, function () { throw 2; });
|
3516 | } catch (error) { }
|
3517 |
|
3518 | module.exports = function (exec, SKIP_CLOSING) {
|
3519 | if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
|
3520 | var ITERATION_SUPPORT = false;
|
3521 | try {
|
3522 | var object = {};
|
3523 | object[ITERATOR] = function () {
|
3524 | return {
|
3525 | next: function () {
|
3526 | return { done: ITERATION_SUPPORT = true };
|
3527 | }
|
3528 | };
|
3529 | };
|
3530 | exec(object);
|
3531 | } catch (error) { }
|
3532 | return ITERATION_SUPPORT;
|
3533 | };
|
3534 |
|
3535 |
|
3536 | }),
|
3537 |
|
3538 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3539 |
|
3540 | "use strict";
|
3541 |
|
3542 | var $ = __webpack_require__(2);
|
3543 | var $includes = (__webpack_require__(54).includes);
|
3544 | var addToUnscopables = __webpack_require__(112);
|
3545 |
|
3546 |
|
3547 |
|
3548 | $({ target: 'Array', proto: true }, {
|
3549 | includes: function includes(el /* , fromIndex = 0 */) {
|
3550 | return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
|
3551 | }
|
3552 | });
|
3553 |
|
3554 |
|
3555 | addToUnscopables('includes');
|
3556 |
|
3557 |
|
3558 | }),
|
3559 |
|
3560 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3561 |
|
3562 | "use strict";
|
3563 |
|
3564 |
|
3565 | var $ = __webpack_require__(2);
|
3566 | var uncurryThis = __webpack_require__(12);
|
3567 | var $IndexOf = (__webpack_require__(54).indexOf);
|
3568 | var arrayMethodIsStrict = __webpack_require__(119);
|
3569 |
|
3570 | var un$IndexOf = uncurryThis([].indexOf);
|
3571 |
|
3572 | var NEGATIVE_ZERO = !!un$IndexOf && 1 / un$IndexOf([1], 1, -0) < 0;
|
3573 | var STRICT_METHOD = arrayMethodIsStrict('indexOf');
|
3574 |
|
3575 |
|
3576 |
|
3577 | $({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
|
3578 | indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
|
3579 | var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
|
3580 | return NEGATIVE_ZERO
|
3581 |
|
3582 | ? un$IndexOf(this, searchElement, fromIndex) || 0
|
3583 | : $IndexOf(this, searchElement, fromIndex);
|
3584 | }
|
3585 | });
|
3586 |
|
3587 |
|
3588 | }),
|
3589 |
|
3590 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3591 |
|
3592 | var $ = __webpack_require__(2);
|
3593 | var isArray = __webpack_require__(63);
|
3594 |
|
3595 |
|
3596 |
|
3597 | $({ target: 'Array', stat: true }, {
|
3598 | isArray: isArray
|
3599 | });
|
3600 |
|
3601 |
|
3602 | }),
|
3603 |
|
3604 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
3605 |
|
3606 | "use strict";
|
3607 |
|
3608 | var toIndexedObject = __webpack_require__(10);
|
3609 | var addToUnscopables = __webpack_require__(112);
|
3610 | var Iterators = __webpack_require__(105);
|
3611 | var InternalStateModule = __webpack_require__(45);
|
3612 | var defineIterator = __webpack_require__(138);
|
3613 |
|
3614 | var ARRAY_ITERATOR = 'Array Iterator';
|
3615 | var setInternalState = InternalStateModule.set;
|
3616 | var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
|
3617 |
|
3618 |
|
3619 |
|
3620 |
|
3621 |
|
3622 |
|
3623 |
|
3624 |
|
3625 |
|
3626 |
|
3627 |
|
3628 | module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
|
3629 | setInternalState(this, {
|
3630 | type: ARRAY_ITERATOR,
|
3631 | target: toIndexedObject(iterated),
|
3632 | index: 0,
|
3633 | kind: kind
|
3634 | });
|
3635 |
|
3636 |
|
3637 | }, function () {
|
3638 | var state = getInternalState(this);
|
3639 | var target = state.target;
|
3640 | var kind = state.kind;
|
3641 | var index = state.index++;
|
3642 | if (!target || index >= target.length) {
|
3643 | state.target = undefined;
|
3644 | return { value: undefined, done: true };
|
3645 | }
|
3646 | if (kind == 'keys') return { value: index, done: false };
|
3647 | if (kind == 'values') return { value: target[index], done: false };
|
3648 | return { value: [index, target[index]], done: false };
|
3649 | }, 'values');
|
3650 |
|
3651 |
|
3652 |
|
3653 |
|
3654 | Iterators.Arguments = Iterators.Array;
|
3655 |
|
3656 |
|
3657 | addToUnscopables('keys');
|
3658 | addToUnscopables('values');
|
3659 | addToUnscopables('entries');
|
3660 |
|
3661 |
|
3662 | }),
|
3663 |
|
3664 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
3665 |
|
3666 | "use strict";
|
3667 |
|
3668 | var $ = __webpack_require__(2);
|
3669 | var call = __webpack_require__(7);
|
3670 | var IS_PURE = __webpack_require__(32);
|
3671 | var FunctionName = __webpack_require__(49);
|
3672 | var isCallable = __webpack_require__(18);
|
3673 | var createIteratorConstructor = __webpack_require__(139);
|
3674 | var getPrototypeOf = __webpack_require__(97);
|
3675 | var setPrototypeOf = __webpack_require__(99);
|
3676 | var setToStringTag = __webpack_require__(76);
|
3677 | var createNonEnumerableProperty = __webpack_require__(40);
|
3678 | var redefine = __webpack_require__(43);
|
3679 | var wellKnownSymbol = __webpack_require__(30);
|
3680 | var Iterators = __webpack_require__(105);
|
3681 | var IteratorsCore = __webpack_require__(140);
|
3682 |
|
3683 | var PROPER_FUNCTION_NAME = FunctionName.PROPER;
|
3684 | var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
|
3685 | var IteratorPrototype = IteratorsCore.IteratorPrototype;
|
3686 | var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
|
3687 | var ITERATOR = wellKnownSymbol('iterator');
|
3688 | var KEYS = 'keys';
|
3689 | var VALUES = 'values';
|
3690 | var ENTRIES = 'entries';
|
3691 |
|
3692 | var returnThis = function () { return this; };
|
3693 |
|
3694 | module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
|
3695 | createIteratorConstructor(IteratorConstructor, NAME, next);
|
3696 |
|
3697 | var getIterationMethod = function (KIND) {
|
3698 | if (KIND === DEFAULT && defaultIterator) return defaultIterator;
|
3699 | if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
|
3700 | switch (KIND) {
|
3701 | case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
|
3702 | case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
|
3703 | case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
|
3704 | } return function () { return new IteratorConstructor(this); };
|
3705 | };
|
3706 |
|
3707 | var TO_STRING_TAG = NAME + ' Iterator';
|
3708 | var INCORRECT_VALUES_NAME = false;
|
3709 | var IterablePrototype = Iterable.prototype;
|
3710 | var nativeIterator = IterablePrototype[ITERATOR]
|
3711 | || IterablePrototype['@@iterator']
|
3712 | || DEFAULT && IterablePrototype[DEFAULT];
|
3713 | var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
|
3714 | var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
|
3715 | var CurrentIteratorPrototype, methods, KEY;
|
3716 |
|
3717 |
|
3718 | if (anyNativeIterator) {
|
3719 | CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
|
3720 | if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
|
3721 | if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
|
3722 | if (setPrototypeOf) {
|
3723 | setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
|
3724 | } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {
|
3725 | redefine(CurrentIteratorPrototype, ITERATOR, returnThis);
|
3726 | }
|
3727 | }
|
3728 |
|
3729 | setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
|
3730 | if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
|
3731 | }
|
3732 | }
|
3733 |
|
3734 |
|
3735 | if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
3736 | if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {
|
3737 | createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
|
3738 | } else {
|
3739 | INCORRECT_VALUES_NAME = true;
|
3740 | defaultIterator = function values() { return call(nativeIterator, this); };
|
3741 | }
|
3742 | }
|
3743 |
|
3744 |
|
3745 | if (DEFAULT) {
|
3746 | methods = {
|
3747 | values: getIterationMethod(VALUES),
|
3748 | keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
|
3749 | entries: getIterationMethod(ENTRIES)
|
3750 | };
|
3751 | if (FORCED) for (KEY in methods) {
|
3752 | if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
3753 | redefine(IterablePrototype, KEY, methods[KEY]);
|
3754 | }
|
3755 | } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
|
3756 | }
|
3757 |
|
3758 |
|
3759 | if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
|
3760 | redefine(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });
|
3761 | }
|
3762 | Iterators[NAME] = defaultIterator;
|
3763 |
|
3764 | return methods;
|
3765 | };
|
3766 |
|
3767 |
|
3768 | }),
|
3769 |
|
3770 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
3771 |
|
3772 | "use strict";
|
3773 |
|
3774 | var IteratorPrototype = (__webpack_require__(140).IteratorPrototype);
|
3775 | var create = __webpack_require__(67);
|
3776 | var createPropertyDescriptor = __webpack_require__(9);
|
3777 | var setToStringTag = __webpack_require__(76);
|
3778 | var Iterators = __webpack_require__(105);
|
3779 |
|
3780 | var returnThis = function () { return this; };
|
3781 |
|
3782 | module.exports = function (IteratorConstructor, NAME, next) {
|
3783 | var TO_STRING_TAG = NAME + ' Iterator';
|
3784 | IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) });
|
3785 | setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
|
3786 | Iterators[TO_STRING_TAG] = returnThis;
|
3787 | return IteratorConstructor;
|
3788 | };
|
3789 |
|
3790 |
|
3791 | }),
|
3792 |
|
3793 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
3794 |
|
3795 | "use strict";
|
3796 |
|
3797 | var fails = __webpack_require__(6);
|
3798 | var isCallable = __webpack_require__(18);
|
3799 | var create = __webpack_require__(67);
|
3800 | var getPrototypeOf = __webpack_require__(97);
|
3801 | var redefine = __webpack_require__(43);
|
3802 | var wellKnownSymbol = __webpack_require__(30);
|
3803 | var IS_PURE = __webpack_require__(32);
|
3804 |
|
3805 | var ITERATOR = wellKnownSymbol('iterator');
|
3806 | var BUGGY_SAFARI_ITERATORS = false;
|
3807 |
|
3808 |
|
3809 |
|
3810 | var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
3811 |
|
3812 |
|
3813 | if ([].keys) {
|
3814 | arrayIterator = [].keys();
|
3815 |
|
3816 | if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
|
3817 | else {
|
3818 | PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
|
3819 | if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
|
3820 | }
|
3821 | }
|
3822 |
|
3823 | var NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () {
|
3824 | var test = {};
|
3825 |
|
3826 | return IteratorPrototype[ITERATOR].call(test) !== test;
|
3827 | });
|
3828 |
|
3829 | if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
|
3830 | else if (IS_PURE) IteratorPrototype = create(IteratorPrototype);
|
3831 |
|
3832 |
|
3833 |
|
3834 | if (!isCallable(IteratorPrototype[ITERATOR])) {
|
3835 | redefine(IteratorPrototype, ITERATOR, function () {
|
3836 | return this;
|
3837 | });
|
3838 | }
|
3839 |
|
3840 | module.exports = {
|
3841 | IteratorPrototype: IteratorPrototype,
|
3842 | BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
|
3843 | };
|
3844 |
|
3845 |
|
3846 | }),
|
3847 |
|
3848 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3849 |
|
3850 | "use strict";
|
3851 |
|
3852 | var $ = __webpack_require__(2);
|
3853 | var uncurryThis = __webpack_require__(12);
|
3854 | var IndexedObject = __webpack_require__(11);
|
3855 | var toIndexedObject = __webpack_require__(10);
|
3856 | var arrayMethodIsStrict = __webpack_require__(119);
|
3857 |
|
3858 | var un$Join = uncurryThis([].join);
|
3859 |
|
3860 | var ES3_STRINGS = IndexedObject != Object;
|
3861 | var STRICT_METHOD = arrayMethodIsStrict('join', ',');
|
3862 |
|
3863 |
|
3864 |
|
3865 | $({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD }, {
|
3866 | join: function join(separator) {
|
3867 | return un$Join(toIndexedObject(this), separator === undefined ? ',' : separator);
|
3868 | }
|
3869 | });
|
3870 |
|
3871 |
|
3872 | }),
|
3873 |
|
3874 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3875 |
|
3876 | var $ = __webpack_require__(2);
|
3877 | var lastIndexOf = __webpack_require__(143);
|
3878 |
|
3879 |
|
3880 |
|
3881 |
|
3882 | $({ target: 'Array', proto: true, forced: lastIndexOf !== [].lastIndexOf }, {
|
3883 | lastIndexOf: lastIndexOf
|
3884 | });
|
3885 |
|
3886 |
|
3887 | }),
|
3888 |
|
3889 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
3890 |
|
3891 | "use strict";
|
3892 |
|
3893 |
|
3894 | var apply = __webpack_require__(62);
|
3895 | var toIndexedObject = __webpack_require__(10);
|
3896 | var toIntegerOrInfinity = __webpack_require__(56);
|
3897 | var lengthOfArrayLike = __webpack_require__(57);
|
3898 | var arrayMethodIsStrict = __webpack_require__(119);
|
3899 |
|
3900 | var min = Math.min;
|
3901 | var $lastIndexOf = [].lastIndexOf;
|
3902 | var NEGATIVE_ZERO = !!$lastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0;
|
3903 | var STRICT_METHOD = arrayMethodIsStrict('lastIndexOf');
|
3904 | var FORCED = NEGATIVE_ZERO || !STRICT_METHOD;
|
3905 |
|
3906 |
|
3907 |
|
3908 | module.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
|
3909 |
|
3910 | if (NEGATIVE_ZERO) return apply($lastIndexOf, this, arguments) || 0;
|
3911 | var O = toIndexedObject(this);
|
3912 | var length = lengthOfArrayLike(O);
|
3913 | var index = length - 1;
|
3914 | if (arguments.length > 1) index = min(index, toIntegerOrInfinity(arguments[1]));
|
3915 | if (index < 0) index = length + index;
|
3916 | for (;index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0;
|
3917 | return -1;
|
3918 | } : $lastIndexOf;
|
3919 |
|
3920 |
|
3921 | }),
|
3922 |
|
3923 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3924 |
|
3925 | "use strict";
|
3926 |
|
3927 | var $ = __webpack_require__(2);
|
3928 | var $map = (__webpack_require__(77).map);
|
3929 | var arrayMethodHasSpeciesSupport = __webpack_require__(115);
|
3930 |
|
3931 | var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
|
3932 |
|
3933 |
|
3934 |
|
3935 |
|
3936 | $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
|
3937 | map: function map(callbackfn /* , thisArg */) {
|
3938 | return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
3939 | }
|
3940 | });
|
3941 |
|
3942 |
|
3943 | }),
|
3944 |
|
3945 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3946 |
|
3947 | "use strict";
|
3948 |
|
3949 | var $ = __webpack_require__(2);
|
3950 | var global = __webpack_require__(3);
|
3951 | var fails = __webpack_require__(6);
|
3952 | var isConstructor = __webpack_require__(81);
|
3953 | var createProperty = __webpack_require__(114);
|
3954 |
|
3955 | var Array = global.Array;
|
3956 |
|
3957 | var ISNT_GENERIC = fails(function () {
|
3958 | function F() { }
|
3959 | return !(Array.of.call(F) instanceof F);
|
3960 | });
|
3961 |
|
3962 |
|
3963 |
|
3964 |
|
3965 | $({ target: 'Array', stat: true, forced: ISNT_GENERIC }, {
|
3966 | of: function of(/* ...args */) {
|
3967 | var index = 0;
|
3968 | var argumentsLength = arguments.length;
|
3969 | var result = new (isConstructor(this) ? this : Array)(argumentsLength);
|
3970 | while (argumentsLength > index) createProperty(result, index, arguments[index++]);
|
3971 | result.length = argumentsLength;
|
3972 | return result;
|
3973 | }
|
3974 | });
|
3975 |
|
3976 |
|
3977 | }),
|
3978 |
|
3979 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
3980 |
|
3981 | "use strict";
|
3982 |
|
3983 | var $ = __webpack_require__(2);
|
3984 | var $reduce = (__webpack_require__(147).left);
|
3985 | var arrayMethodIsStrict = __webpack_require__(119);
|
3986 | var CHROME_VERSION = __webpack_require__(24);
|
3987 | var IS_NODE = __webpack_require__(148);
|
3988 |
|
3989 | var STRICT_METHOD = arrayMethodIsStrict('reduce');
|
3990 |
|
3991 |
|
3992 | var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
|
3993 |
|
3994 |
|
3995 |
|
3996 | $({ target: 'Array', proto: true, forced: !STRICT_METHOD || CHROME_BUG }, {
|
3997 | reduce: function reduce(callbackfn /* , initialValue */) {
|
3998 | var length = arguments.length;
|
3999 | return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
|
4000 | }
|
4001 | });
|
4002 |
|
4003 |
|
4004 | }),
|
4005 |
|
4006 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
4007 |
|
4008 | var global = __webpack_require__(3);
|
4009 | var aCallable = __webpack_require__(27);
|
4010 | var toObject = __webpack_require__(36);
|
4011 | var IndexedObject = __webpack_require__(11);
|
4012 | var lengthOfArrayLike = __webpack_require__(57);
|
4013 |
|
4014 | var TypeError = global.TypeError;
|
4015 |
|
4016 |
|
4017 | var createMethod = function (IS_RIGHT) {
|
4018 | return function (that, callbackfn, argumentsLength, memo) {
|
4019 | aCallable(callbackfn);
|
4020 | var O = toObject(that);
|
4021 | var self = IndexedObject(O);
|
4022 | var length = lengthOfArrayLike(O);
|
4023 | var index = IS_RIGHT ? length - 1 : 0;
|
4024 | var i = IS_RIGHT ? -1 : 1;
|
4025 | if (argumentsLength < 2) while (true) {
|
4026 | if (index in self) {
|
4027 | memo = self[index];
|
4028 | index += i;
|
4029 | break;
|
4030 | }
|
4031 | index += i;
|
4032 | if (IS_RIGHT ? index < 0 : length <= index) {
|
4033 | throw TypeError('Reduce of empty array with no initial value');
|
4034 | }
|
4035 | }
|
4036 | for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
|
4037 | memo = callbackfn(memo, self[index], index, O);
|
4038 | }
|
4039 | return memo;
|
4040 | };
|
4041 | };
|
4042 |
|
4043 | module.exports = {
|
4044 |
|
4045 |
|
4046 | left: createMethod(false),
|
4047 |
|
4048 |
|
4049 | right: createMethod(true)
|
4050 | };
|
4051 |
|
4052 |
|
4053 | }),
|
4054 |
|
4055 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
4056 |
|
4057 | var classof = __webpack_require__(13);
|
4058 | var global = __webpack_require__(3);
|
4059 |
|
4060 | module.exports = classof(global.process) == 'process';
|
4061 |
|
4062 |
|
4063 | }),
|
4064 |
|
4065 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4066 |
|
4067 | "use strict";
|
4068 |
|
4069 | var $ = __webpack_require__(2);
|
4070 | var $reduceRight = (__webpack_require__(147).right);
|
4071 | var arrayMethodIsStrict = __webpack_require__(119);
|
4072 | var CHROME_VERSION = __webpack_require__(24);
|
4073 | var IS_NODE = __webpack_require__(148);
|
4074 |
|
4075 | var STRICT_METHOD = arrayMethodIsStrict('reduceRight');
|
4076 |
|
4077 |
|
4078 | var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
|
4079 |
|
4080 |
|
4081 |
|
4082 | $({ target: 'Array', proto: true, forced: !STRICT_METHOD || CHROME_BUG }, {
|
4083 | reduceRight: function reduceRight(callbackfn /* , initialValue */) {
|
4084 | return $reduceRight(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
|
4085 | }
|
4086 | });
|
4087 |
|
4088 |
|
4089 | }),
|
4090 |
|
4091 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4092 |
|
4093 | "use strict";
|
4094 |
|
4095 | var $ = __webpack_require__(2);
|
4096 | var uncurryThis = __webpack_require__(12);
|
4097 | var isArray = __webpack_require__(63);
|
4098 |
|
4099 | var un$Reverse = uncurryThis([].reverse);
|
4100 | var test = [1, 2];
|
4101 |
|
4102 |
|
4103 |
|
4104 |
|
4105 |
|
4106 | $({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {
|
4107 | reverse: function reverse() {
|
4108 |
|
4109 | if (isArray(this)) this.length = this.length;
|
4110 | return un$Reverse(this);
|
4111 | }
|
4112 | });
|
4113 |
|
4114 |
|
4115 | }),
|
4116 |
|
4117 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4118 |
|
4119 | "use strict";
|
4120 |
|
4121 | var $ = __webpack_require__(2);
|
4122 | var global = __webpack_require__(3);
|
4123 | var isArray = __webpack_require__(63);
|
4124 | var isConstructor = __webpack_require__(81);
|
4125 | var isObject = __webpack_require__(17);
|
4126 | var toAbsoluteIndex = __webpack_require__(55);
|
4127 | var lengthOfArrayLike = __webpack_require__(57);
|
4128 | var toIndexedObject = __webpack_require__(10);
|
4129 | var createProperty = __webpack_require__(114);
|
4130 | var wellKnownSymbol = __webpack_require__(30);
|
4131 | var arrayMethodHasSpeciesSupport = __webpack_require__(115);
|
4132 | var un$Slice = __webpack_require__(72);
|
4133 |
|
4134 | var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
|
4135 |
|
4136 | var SPECIES = wellKnownSymbol('species');
|
4137 | var Array = global.Array;
|
4138 | var max = Math.max;
|
4139 |
|
4140 |
|
4141 |
|
4142 |
|
4143 | $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
|
4144 | slice: function slice(start, end) {
|
4145 | var O = toIndexedObject(this);
|
4146 | var length = lengthOfArrayLike(O);
|
4147 | var k = toAbsoluteIndex(start, length);
|
4148 | var fin = toAbsoluteIndex(end === undefined ? length : end, length);
|
4149 |
|
4150 | var Constructor, result, n;
|
4151 | if (isArray(O)) {
|
4152 | Constructor = O.constructor;
|
4153 |
|
4154 | if (isConstructor(Constructor) && (Constructor === Array || isArray(Constructor.prototype))) {
|
4155 | Constructor = undefined;
|
4156 | } else if (isObject(Constructor)) {
|
4157 | Constructor = Constructor[SPECIES];
|
4158 | if (Constructor === null) Constructor = undefined;
|
4159 | }
|
4160 | if (Constructor === Array || Constructor === undefined) {
|
4161 | return un$Slice(O, k, fin);
|
4162 | }
|
4163 | }
|
4164 | result = new (Constructor === undefined ? Array : Constructor)(max(fin - k, 0));
|
4165 | for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
|
4166 | result.length = n;
|
4167 | return result;
|
4168 | }
|
4169 | });
|
4170 |
|
4171 |
|
4172 | }),
|
4173 |
|
4174 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4175 |
|
4176 | "use strict";
|
4177 |
|
4178 | var $ = __webpack_require__(2);
|
4179 | var $some = (__webpack_require__(77).some);
|
4180 | var arrayMethodIsStrict = __webpack_require__(119);
|
4181 |
|
4182 | var STRICT_METHOD = arrayMethodIsStrict('some');
|
4183 |
|
4184 |
|
4185 |
|
4186 | $({ target: 'Array', proto: true, forced: !STRICT_METHOD }, {
|
4187 | some: function some(callbackfn /* , thisArg */) {
|
4188 | return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
4189 | }
|
4190 | });
|
4191 |
|
4192 |
|
4193 | }),
|
4194 |
|
4195 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4196 |
|
4197 | "use strict";
|
4198 |
|
4199 | var $ = __webpack_require__(2);
|
4200 | var uncurryThis = __webpack_require__(12);
|
4201 | var aCallable = __webpack_require__(27);
|
4202 | var toObject = __webpack_require__(36);
|
4203 | var lengthOfArrayLike = __webpack_require__(57);
|
4204 | var toString = __webpack_require__(64);
|
4205 | var fails = __webpack_require__(6);
|
4206 | var internalSort = __webpack_require__(154);
|
4207 | var arrayMethodIsStrict = __webpack_require__(119);
|
4208 | var FF = __webpack_require__(155);
|
4209 | var IE_OR_EDGE = __webpack_require__(156);
|
4210 | var V8 = __webpack_require__(24);
|
4211 | var WEBKIT = __webpack_require__(157);
|
4212 |
|
4213 | var test = [];
|
4214 | var un$Sort = uncurryThis(test.sort);
|
4215 | var push = uncurryThis(test.push);
|
4216 |
|
4217 |
|
4218 | var FAILS_ON_UNDEFINED = fails(function () {
|
4219 | test.sort(undefined);
|
4220 | });
|
4221 |
|
4222 | var FAILS_ON_NULL = fails(function () {
|
4223 | test.sort(null);
|
4224 | });
|
4225 |
|
4226 | var STRICT_METHOD = arrayMethodIsStrict('sort');
|
4227 |
|
4228 | var STABLE_SORT = !fails(function () {
|
4229 |
|
4230 | if (V8) return V8 < 70;
|
4231 | if (FF && FF > 3) return;
|
4232 | if (IE_OR_EDGE) return true;
|
4233 | if (WEBKIT) return WEBKIT < 603;
|
4234 |
|
4235 | var result = '';
|
4236 | var code, chr, value, index;
|
4237 |
|
4238 |
|
4239 | for (code = 65; code < 76; code++) {
|
4240 | chr = String.fromCharCode(code);
|
4241 |
|
4242 | switch (code) {
|
4243 | case 66: case 69: case 70: case 72: value = 3; break;
|
4244 | case 68: case 71: value = 4; break;
|
4245 | default: value = 2;
|
4246 | }
|
4247 |
|
4248 | for (index = 0; index < 47; index++) {
|
4249 | test.push({ k: chr + index, v: value });
|
4250 | }
|
4251 | }
|
4252 |
|
4253 | test.sort(function (a, b) { return b.v - a.v; });
|
4254 |
|
4255 | for (index = 0; index < test.length; index++) {
|
4256 | chr = test[index].k.charAt(0);
|
4257 | if (result.charAt(result.length - 1) !== chr) result += chr;
|
4258 | }
|
4259 |
|
4260 | return result !== 'DGBEFHACIJK';
|
4261 | });
|
4262 |
|
4263 | var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;
|
4264 |
|
4265 | var getSortCompare = function (comparefn) {
|
4266 | return function (x, y) {
|
4267 | if (y === undefined) return -1;
|
4268 | if (x === undefined) return 1;
|
4269 | if (comparefn !== undefined) return +comparefn(x, y) || 0;
|
4270 | return toString(x) > toString(y) ? 1 : -1;
|
4271 | };
|
4272 | };
|
4273 |
|
4274 |
|
4275 |
|
4276 | $({ target: 'Array', proto: true, forced: FORCED }, {
|
4277 | sort: function sort(comparefn) {
|
4278 | if (comparefn !== undefined) aCallable(comparefn);
|
4279 |
|
4280 | var array = toObject(this);
|
4281 |
|
4282 | if (STABLE_SORT) return comparefn === undefined ? un$Sort(array) : un$Sort(array, comparefn);
|
4283 |
|
4284 | var items = [];
|
4285 | var arrayLength = lengthOfArrayLike(array);
|
4286 | var itemsLength, index;
|
4287 |
|
4288 | for (index = 0; index < arrayLength; index++) {
|
4289 | if (index in array) push(items, array[index]);
|
4290 | }
|
4291 |
|
4292 | internalSort(items, getSortCompare(comparefn));
|
4293 |
|
4294 | itemsLength = items.length;
|
4295 | index = 0;
|
4296 |
|
4297 | while (index < itemsLength) array[index] = items[index++];
|
4298 | while (index < arrayLength) delete array[index++];
|
4299 |
|
4300 | return array;
|
4301 | }
|
4302 | });
|
4303 |
|
4304 |
|
4305 | }),
|
4306 |
|
4307 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
4308 |
|
4309 | var arraySlice = __webpack_require__(72);
|
4310 |
|
4311 | var floor = Math.floor;
|
4312 |
|
4313 | var mergeSort = function (array, comparefn) {
|
4314 | var length = array.length;
|
4315 | var middle = floor(length / 2);
|
4316 | return length < 8 ? insertionSort(array, comparefn) : merge(
|
4317 | array,
|
4318 | mergeSort(arraySlice(array, 0, middle), comparefn),
|
4319 | mergeSort(arraySlice(array, middle), comparefn),
|
4320 | comparefn
|
4321 | );
|
4322 | };
|
4323 |
|
4324 | var insertionSort = function (array, comparefn) {
|
4325 | var length = array.length;
|
4326 | var i = 1;
|
4327 | var element, j;
|
4328 |
|
4329 | while (i < length) {
|
4330 | j = i;
|
4331 | element = array[i];
|
4332 | while (j && comparefn(array[j - 1], element) > 0) {
|
4333 | array[j] = array[--j];
|
4334 | }
|
4335 | if (j !== i++) array[j] = element;
|
4336 | } return array;
|
4337 | };
|
4338 |
|
4339 | var merge = function (array, left, right, comparefn) {
|
4340 | var llength = left.length;
|
4341 | var rlength = right.length;
|
4342 | var lindex = 0;
|
4343 | var rindex = 0;
|
4344 |
|
4345 | while (lindex < llength || rindex < rlength) {
|
4346 | array[lindex + rindex] = (lindex < llength && rindex < rlength)
|
4347 | ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
|
4348 | : lindex < llength ? left[lindex++] : right[rindex++];
|
4349 | } return array;
|
4350 | };
|
4351 |
|
4352 | module.exports = mergeSort;
|
4353 |
|
4354 |
|
4355 | }),
|
4356 |
|
4357 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
4358 |
|
4359 | var userAgent = __webpack_require__(25);
|
4360 |
|
4361 | var firefox = userAgent.match(/firefox\/(\d+)/i);
|
4362 |
|
4363 | module.exports = !!firefox && +firefox[1];
|
4364 |
|
4365 |
|
4366 | }),
|
4367 |
|
4368 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
4369 |
|
4370 | var UA = __webpack_require__(25);
|
4371 |
|
4372 | module.exports = /MSIE|Trident/.test(UA);
|
4373 |
|
4374 |
|
4375 | }),
|
4376 |
|
4377 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
4378 |
|
4379 | var userAgent = __webpack_require__(25);
|
4380 |
|
4381 | var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
|
4382 |
|
4383 | module.exports = !!webkit && +webkit[1];
|
4384 |
|
4385 |
|
4386 | }),
|
4387 |
|
4388 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4389 |
|
4390 | var setSpecies = __webpack_require__(159);
|
4391 |
|
4392 |
|
4393 |
|
4394 | setSpecies('Array');
|
4395 |
|
4396 |
|
4397 | }),
|
4398 |
|
4399 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
4400 |
|
4401 | "use strict";
|
4402 |
|
4403 | var getBuiltIn = __webpack_require__(20);
|
4404 | var definePropertyModule = __webpack_require__(41);
|
4405 | var wellKnownSymbol = __webpack_require__(30);
|
4406 | var DESCRIPTORS = __webpack_require__(5);
|
4407 |
|
4408 | var SPECIES = wellKnownSymbol('species');
|
4409 |
|
4410 | module.exports = function (CONSTRUCTOR_NAME) {
|
4411 | var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
|
4412 | var defineProperty = definePropertyModule.f;
|
4413 |
|
4414 | if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
|
4415 | defineProperty(Constructor, SPECIES, {
|
4416 | configurable: true,
|
4417 | get: function () { return this; }
|
4418 | });
|
4419 | }
|
4420 | };
|
4421 |
|
4422 |
|
4423 | }),
|
4424 |
|
4425 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4426 |
|
4427 | "use strict";
|
4428 |
|
4429 | var $ = __webpack_require__(2);
|
4430 | var global = __webpack_require__(3);
|
4431 | var toAbsoluteIndex = __webpack_require__(55);
|
4432 | var toIntegerOrInfinity = __webpack_require__(56);
|
4433 | var lengthOfArrayLike = __webpack_require__(57);
|
4434 | var toObject = __webpack_require__(36);
|
4435 | var arraySpeciesCreate = __webpack_require__(79);
|
4436 | var createProperty = __webpack_require__(114);
|
4437 | var arrayMethodHasSpeciesSupport = __webpack_require__(115);
|
4438 |
|
4439 | var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
|
4440 |
|
4441 | var TypeError = global.TypeError;
|
4442 | var max = Math.max;
|
4443 | var min = Math.min;
|
4444 | var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
|
4445 | var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded';
|
4446 |
|
4447 |
|
4448 |
|
4449 |
|
4450 | $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
|
4451 | splice: function splice(start, deleteCount /* , ...items */) {
|
4452 | var O = toObject(this);
|
4453 | var len = lengthOfArrayLike(O);
|
4454 | var actualStart = toAbsoluteIndex(start, len);
|
4455 | var argumentsLength = arguments.length;
|
4456 | var insertCount, actualDeleteCount, A, k, from, to;
|
4457 | if (argumentsLength === 0) {
|
4458 | insertCount = actualDeleteCount = 0;
|
4459 | } else if (argumentsLength === 1) {
|
4460 | insertCount = 0;
|
4461 | actualDeleteCount = len - actualStart;
|
4462 | } else {
|
4463 | insertCount = argumentsLength - 2;
|
4464 | actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
|
4465 | }
|
4466 | if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) {
|
4467 | throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);
|
4468 | }
|
4469 | A = arraySpeciesCreate(O, actualDeleteCount);
|
4470 | for (k = 0; k < actualDeleteCount; k++) {
|
4471 | from = actualStart + k;
|
4472 | if (from in O) createProperty(A, k, O[from]);
|
4473 | }
|
4474 | A.length = actualDeleteCount;
|
4475 | if (insertCount < actualDeleteCount) {
|
4476 | for (k = actualStart; k < len - actualDeleteCount; k++) {
|
4477 | from = k + actualDeleteCount;
|
4478 | to = k + insertCount;
|
4479 | if (from in O) O[to] = O[from];
|
4480 | else delete O[to];
|
4481 | }
|
4482 | for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1];
|
4483 | } else if (insertCount > actualDeleteCount) {
|
4484 | for (k = len - actualDeleteCount; k > actualStart; k--) {
|
4485 | from = k + actualDeleteCount - 1;
|
4486 | to = k + insertCount - 1;
|
4487 | if (from in O) O[to] = O[from];
|
4488 | else delete O[to];
|
4489 | }
|
4490 | }
|
4491 | for (k = 0; k < insertCount; k++) {
|
4492 | O[k + actualStart] = arguments[k + 2];
|
4493 | }
|
4494 | O.length = len - actualDeleteCount + insertCount;
|
4495 | return A;
|
4496 | }
|
4497 | });
|
4498 |
|
4499 |
|
4500 | }),
|
4501 |
|
4502 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4503 |
|
4504 |
|
4505 |
|
4506 | var addToUnscopables = __webpack_require__(112);
|
4507 |
|
4508 |
|
4509 | addToUnscopables('flat');
|
4510 |
|
4511 |
|
4512 | }),
|
4513 |
|
4514 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4515 |
|
4516 |
|
4517 |
|
4518 | var addToUnscopables = __webpack_require__(112);
|
4519 |
|
4520 |
|
4521 | addToUnscopables('flatMap');
|
4522 |
|
4523 |
|
4524 | }),
|
4525 |
|
4526 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4527 |
|
4528 | "use strict";
|
4529 |
|
4530 | var $ = __webpack_require__(2);
|
4531 | var global = __webpack_require__(3);
|
4532 | var arrayBufferModule = __webpack_require__(164);
|
4533 | var setSpecies = __webpack_require__(159);
|
4534 |
|
4535 | var ARRAY_BUFFER = 'ArrayBuffer';
|
4536 | var ArrayBuffer = arrayBufferModule[ARRAY_BUFFER];
|
4537 | var NativeArrayBuffer = global[ARRAY_BUFFER];
|
4538 |
|
4539 |
|
4540 |
|
4541 | $({ global: true, forced: NativeArrayBuffer !== ArrayBuffer }, {
|
4542 | ArrayBuffer: ArrayBuffer
|
4543 | });
|
4544 |
|
4545 | setSpecies(ARRAY_BUFFER);
|
4546 |
|
4547 |
|
4548 | }),
|
4549 |
|
4550 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
4551 |
|
4552 | "use strict";
|
4553 |
|
4554 | var global = __webpack_require__(3);
|
4555 | var uncurryThis = __webpack_require__(12);
|
4556 | var DESCRIPTORS = __webpack_require__(5);
|
4557 | var NATIVE_ARRAY_BUFFER = __webpack_require__(165);
|
4558 | var FunctionName = __webpack_require__(49);
|
4559 | var createNonEnumerableProperty = __webpack_require__(40);
|
4560 | var redefineAll = __webpack_require__(166);
|
4561 | var fails = __webpack_require__(6);
|
4562 | var anInstance = __webpack_require__(167);
|
4563 | var toIntegerOrInfinity = __webpack_require__(56);
|
4564 | var toLength = __webpack_require__(58);
|
4565 | var toIndex = __webpack_require__(168);
|
4566 | var IEEE754 = __webpack_require__(169);
|
4567 | var getPrototypeOf = __webpack_require__(97);
|
4568 | var setPrototypeOf = __webpack_require__(99);
|
4569 | var getOwnPropertyNames = (__webpack_require__(52).f);
|
4570 | var defineProperty = (__webpack_require__(41).f);
|
4571 | var arrayFill = __webpack_require__(121);
|
4572 | var arraySlice = __webpack_require__(72);
|
4573 | var setToStringTag = __webpack_require__(76);
|
4574 | var InternalStateModule = __webpack_require__(45);
|
4575 |
|
4576 | var PROPER_FUNCTION_NAME = FunctionName.PROPER;
|
4577 | var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
|
4578 | var getInternalState = InternalStateModule.get;
|
4579 | var setInternalState = InternalStateModule.set;
|
4580 | var ARRAY_BUFFER = 'ArrayBuffer';
|
4581 | var DATA_VIEW = 'DataView';
|
4582 | var PROTOTYPE = 'prototype';
|
4583 | var WRONG_LENGTH = 'Wrong length';
|
4584 | var WRONG_INDEX = 'Wrong index';
|
4585 | var NativeArrayBuffer = global[ARRAY_BUFFER];
|
4586 | var $ArrayBuffer = NativeArrayBuffer;
|
4587 | var ArrayBufferPrototype = $ArrayBuffer && $ArrayBuffer[PROTOTYPE];
|
4588 | var $DataView = global[DATA_VIEW];
|
4589 | var DataViewPrototype = $DataView && $DataView[PROTOTYPE];
|
4590 | var ObjectPrototype = Object.prototype;
|
4591 | var Array = global.Array;
|
4592 | var RangeError = global.RangeError;
|
4593 | var fill = uncurryThis(arrayFill);
|
4594 | var reverse = uncurryThis([].reverse);
|
4595 |
|
4596 | var packIEEE754 = IEEE754.pack;
|
4597 | var unpackIEEE754 = IEEE754.unpack;
|
4598 |
|
4599 | var packInt8 = function (number) {
|
4600 | return [number & 0xFF];
|
4601 | };
|
4602 |
|
4603 | var packInt16 = function (number) {
|
4604 | return [number & 0xFF, number >> 8 & 0xFF];
|
4605 | };
|
4606 |
|
4607 | var packInt32 = function (number) {
|
4608 | return [number & 0xFF, number >> 8 & 0xFF, number >> 16 & 0xFF, number >> 24 & 0xFF];
|
4609 | };
|
4610 |
|
4611 | var unpackInt32 = function (buffer) {
|
4612 | return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0];
|
4613 | };
|
4614 |
|
4615 | var packFloat32 = function (number) {
|
4616 | return packIEEE754(number, 23, 4);
|
4617 | };
|
4618 |
|
4619 | var packFloat64 = function (number) {
|
4620 | return packIEEE754(number, 52, 8);
|
4621 | };
|
4622 |
|
4623 | var addGetter = function (Constructor, key) {
|
4624 | defineProperty(Constructor[PROTOTYPE], key, { get: function () { return getInternalState(this)[key]; } });
|
4625 | };
|
4626 |
|
4627 | var get = function (view, count, index, isLittleEndian) {
|
4628 | var intIndex = toIndex(index);
|
4629 | var store = getInternalState(view);
|
4630 | if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX);
|
4631 | var bytes = getInternalState(store.buffer).bytes;
|
4632 | var start = intIndex + store.byteOffset;
|
4633 | var pack = arraySlice(bytes, start, start + count);
|
4634 | return isLittleEndian ? pack : reverse(pack);
|
4635 | };
|
4636 |
|
4637 | var set = function (view, count, index, conversion, value, isLittleEndian) {
|
4638 | var intIndex = toIndex(index);
|
4639 | var store = getInternalState(view);
|
4640 | if (intIndex + count > store.byteLength) throw RangeError(WRONG_INDEX);
|
4641 | var bytes = getInternalState(store.buffer).bytes;
|
4642 | var start = intIndex + store.byteOffset;
|
4643 | var pack = conversion(+value);
|
4644 | for (var i = 0; i < count; i++) bytes[start + i] = pack[isLittleEndian ? i : count - i - 1];
|
4645 | };
|
4646 |
|
4647 | if (!NATIVE_ARRAY_BUFFER) {
|
4648 | $ArrayBuffer = function ArrayBuffer(length) {
|
4649 | anInstance(this, ArrayBufferPrototype);
|
4650 | var byteLength = toIndex(length);
|
4651 | setInternalState(this, {
|
4652 | bytes: fill(Array(byteLength), 0),
|
4653 | byteLength: byteLength
|
4654 | });
|
4655 | if (!DESCRIPTORS) this.byteLength = byteLength;
|
4656 | };
|
4657 |
|
4658 | ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE];
|
4659 |
|
4660 | $DataView = function DataView(buffer, byteOffset, byteLength) {
|
4661 | anInstance(this, DataViewPrototype);
|
4662 | anInstance(buffer, ArrayBufferPrototype);
|
4663 | var bufferLength = getInternalState(buffer).byteLength;
|
4664 | var offset = toIntegerOrInfinity(byteOffset);
|
4665 | if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset');
|
4666 | byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);
|
4667 | if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);
|
4668 | setInternalState(this, {
|
4669 | buffer: buffer,
|
4670 | byteLength: byteLength,
|
4671 | byteOffset: offset
|
4672 | });
|
4673 | if (!DESCRIPTORS) {
|
4674 | this.buffer = buffer;
|
4675 | this.byteLength = byteLength;
|
4676 | this.byteOffset = offset;
|
4677 | }
|
4678 | };
|
4679 |
|
4680 | DataViewPrototype = $DataView[PROTOTYPE];
|
4681 |
|
4682 | if (DESCRIPTORS) {
|
4683 | addGetter($ArrayBuffer, 'byteLength');
|
4684 | addGetter($DataView, 'buffer');
|
4685 | addGetter($DataView, 'byteLength');
|
4686 | addGetter($DataView, 'byteOffset');
|
4687 | }
|
4688 |
|
4689 | redefineAll(DataViewPrototype, {
|
4690 | getInt8: function getInt8(byteOffset) {
|
4691 | return get(this, 1, byteOffset)[0] << 24 >> 24;
|
4692 | },
|
4693 | getUint8: function getUint8(byteOffset) {
|
4694 | return get(this, 1, byteOffset)[0];
|
4695 | },
|
4696 | getInt16: function getInt16(byteOffset /* , littleEndian */) {
|
4697 | var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined);
|
4698 | return (bytes[1] << 8 | bytes[0]) << 16 >> 16;
|
4699 | },
|
4700 | getUint16: function getUint16(byteOffset /* , littleEndian */) {
|
4701 | var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : undefined);
|
4702 | return bytes[1] << 8 | bytes[0];
|
4703 | },
|
4704 | getInt32: function getInt32(byteOffset /* , littleEndian */) {
|
4705 | return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined));
|
4706 | },
|
4707 | getUint32: function getUint32(byteOffset /* , littleEndian */) {
|
4708 | return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined)) >>> 0;
|
4709 | },
|
4710 | getFloat32: function getFloat32(byteOffset /* , littleEndian */) {
|
4711 | return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 23);
|
4712 | },
|
4713 | getFloat64: function getFloat64(byteOffset /* , littleEndian */) {
|
4714 | return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : undefined), 52);
|
4715 | },
|
4716 | setInt8: function setInt8(byteOffset, value) {
|
4717 | set(this, 1, byteOffset, packInt8, value);
|
4718 | },
|
4719 | setUint8: function setUint8(byteOffset, value) {
|
4720 | set(this, 1, byteOffset, packInt8, value);
|
4721 | },
|
4722 | setInt16: function setInt16(byteOffset, value /* , littleEndian */) {
|
4723 | set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined);
|
4724 | },
|
4725 | setUint16: function setUint16(byteOffset, value /* , littleEndian */) {
|
4726 | set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : undefined);
|
4727 | },
|
4728 | setInt32: function setInt32(byteOffset, value /* , littleEndian */) {
|
4729 | set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined);
|
4730 | },
|
4731 | setUint32: function setUint32(byteOffset, value /* , littleEndian */) {
|
4732 | set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : undefined);
|
4733 | },
|
4734 | setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {
|
4735 | set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : undefined);
|
4736 | },
|
4737 | setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {
|
4738 | set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : undefined);
|
4739 | }
|
4740 | });
|
4741 | } else {
|
4742 | var INCORRECT_ARRAY_BUFFER_NAME = PROPER_FUNCTION_NAME && NativeArrayBuffer.name !== ARRAY_BUFFER;
|
4743 |
|
4744 | if (!fails(function () {
|
4745 | NativeArrayBuffer(1);
|
4746 | }) || !fails(function () {
|
4747 | new NativeArrayBuffer(-1);
|
4748 | }) || fails(function () {
|
4749 | new NativeArrayBuffer();
|
4750 | new NativeArrayBuffer(1.5);
|
4751 | new NativeArrayBuffer(NaN);
|
4752 | return INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME;
|
4753 | })) {
|
4754 |
|
4755 | $ArrayBuffer = function ArrayBuffer(length) {
|
4756 | anInstance(this, ArrayBufferPrototype);
|
4757 | return new NativeArrayBuffer(toIndex(length));
|
4758 | };
|
4759 |
|
4760 | $ArrayBuffer[PROTOTYPE] = ArrayBufferPrototype;
|
4761 |
|
4762 | for (var keys = getOwnPropertyNames(NativeArrayBuffer), j = 0, key; keys.length > j;) {
|
4763 | if (!((key = keys[j++]) in $ArrayBuffer)) {
|
4764 | createNonEnumerableProperty($ArrayBuffer, key, NativeArrayBuffer[key]);
|
4765 | }
|
4766 | }
|
4767 |
|
4768 | ArrayBufferPrototype.constructor = $ArrayBuffer;
|
4769 | } else if (INCORRECT_ARRAY_BUFFER_NAME && CONFIGURABLE_FUNCTION_NAME) {
|
4770 | createNonEnumerableProperty(NativeArrayBuffer, 'name', ARRAY_BUFFER);
|
4771 | }
|
4772 |
|
4773 |
|
4774 | if (setPrototypeOf && getPrototypeOf(DataViewPrototype) !== ObjectPrototype) {
|
4775 | setPrototypeOf(DataViewPrototype, ObjectPrototype);
|
4776 | }
|
4777 |
|
4778 |
|
4779 | var testView = new $DataView(new $ArrayBuffer(2));
|
4780 | var $setInt8 = uncurryThis(DataViewPrototype.setInt8);
|
4781 | testView.setInt8(0, 2147483648);
|
4782 | testView.setInt8(1, 2147483649);
|
4783 | if (testView.getInt8(0) || !testView.getInt8(1)) redefineAll(DataViewPrototype, {
|
4784 | setInt8: function setInt8(byteOffset, value) {
|
4785 | $setInt8(this, byteOffset, value << 24 >> 24);
|
4786 | },
|
4787 | setUint8: function setUint8(byteOffset, value) {
|
4788 | $setInt8(this, byteOffset, value << 24 >> 24);
|
4789 | }
|
4790 | }, { unsafe: true });
|
4791 | }
|
4792 |
|
4793 | setToStringTag($ArrayBuffer, ARRAY_BUFFER);
|
4794 | setToStringTag($DataView, DATA_VIEW);
|
4795 |
|
4796 | module.exports = {
|
4797 | ArrayBuffer: $ArrayBuffer,
|
4798 | DataView: $DataView
|
4799 | };
|
4800 |
|
4801 |
|
4802 | }),
|
4803 |
|
4804 | (function(module) {
|
4805 |
|
4806 |
|
4807 | module.exports = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined';
|
4808 |
|
4809 |
|
4810 | }),
|
4811 |
|
4812 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
4813 |
|
4814 | var redefine = __webpack_require__(43);
|
4815 |
|
4816 | module.exports = function (target, src, options) {
|
4817 | for (var key in src) redefine(target, key, src[key], options);
|
4818 | return target;
|
4819 | };
|
4820 |
|
4821 |
|
4822 | }),
|
4823 |
|
4824 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
4825 |
|
4826 | var global = __webpack_require__(3);
|
4827 | var isPrototypeOf = __webpack_require__(21);
|
4828 |
|
4829 | var TypeError = global.TypeError;
|
4830 |
|
4831 | module.exports = function (it, Prototype) {
|
4832 | if (isPrototypeOf(Prototype, it)) return it;
|
4833 | throw TypeError('Incorrect invocation');
|
4834 | };
|
4835 |
|
4836 |
|
4837 | }),
|
4838 |
|
4839 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
4840 |
|
4841 | var global = __webpack_require__(3);
|
4842 | var toIntegerOrInfinity = __webpack_require__(56);
|
4843 | var toLength = __webpack_require__(58);
|
4844 |
|
4845 | var RangeError = global.RangeError;
|
4846 |
|
4847 |
|
4848 |
|
4849 | module.exports = function (it) {
|
4850 | if (it === undefined) return 0;
|
4851 | var number = toIntegerOrInfinity(it);
|
4852 | var length = toLength(number);
|
4853 | if (number !== length) throw RangeError('Wrong length or index');
|
4854 | return length;
|
4855 | };
|
4856 |
|
4857 |
|
4858 | }),
|
4859 |
|
4860 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
4861 |
|
4862 |
|
4863 | var global = __webpack_require__(3);
|
4864 |
|
4865 | var Array = global.Array;
|
4866 | var abs = Math.abs;
|
4867 | var pow = Math.pow;
|
4868 | var floor = Math.floor;
|
4869 | var log = Math.log;
|
4870 | var LN2 = Math.LN2;
|
4871 |
|
4872 | var pack = function (number, mantissaLength, bytes) {
|
4873 | var buffer = Array(bytes);
|
4874 | var exponentLength = bytes * 8 - mantissaLength - 1;
|
4875 | var eMax = (1 << exponentLength) - 1;
|
4876 | var eBias = eMax >> 1;
|
4877 | var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0;
|
4878 | var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0;
|
4879 | var index = 0;
|
4880 | var exponent, mantissa, c;
|
4881 | number = abs(number);
|
4882 |
|
4883 | if (number != number || number === Infinity) {
|
4884 |
|
4885 | mantissa = number != number ? 1 : 0;
|
4886 | exponent = eMax;
|
4887 | } else {
|
4888 | exponent = floor(log(number) / LN2);
|
4889 | if (number * (c = pow(2, -exponent)) < 1) {
|
4890 | exponent--;
|
4891 | c *= 2;
|
4892 | }
|
4893 | if (exponent + eBias >= 1) {
|
4894 | number += rt / c;
|
4895 | } else {
|
4896 | number += rt * pow(2, 1 - eBias);
|
4897 | }
|
4898 | if (number * c >= 2) {
|
4899 | exponent++;
|
4900 | c /= 2;
|
4901 | }
|
4902 | if (exponent + eBias >= eMax) {
|
4903 | mantissa = 0;
|
4904 | exponent = eMax;
|
4905 | } else if (exponent + eBias >= 1) {
|
4906 | mantissa = (number * c - 1) * pow(2, mantissaLength);
|
4907 | exponent = exponent + eBias;
|
4908 | } else {
|
4909 | mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength);
|
4910 | exponent = 0;
|
4911 | }
|
4912 | }
|
4913 | for (; mantissaLength >= 8; buffer[index++] = mantissa & 255, mantissa /= 256, mantissaLength -= 8);
|
4914 | exponent = exponent << mantissaLength | mantissa;
|
4915 | exponentLength += mantissaLength;
|
4916 | for (; exponentLength > 0; buffer[index++] = exponent & 255, exponent /= 256, exponentLength -= 8);
|
4917 | buffer[--index] |= sign * 128;
|
4918 | return buffer;
|
4919 | };
|
4920 |
|
4921 | var unpack = function (buffer, mantissaLength) {
|
4922 | var bytes = buffer.length;
|
4923 | var exponentLength = bytes * 8 - mantissaLength - 1;
|
4924 | var eMax = (1 << exponentLength) - 1;
|
4925 | var eBias = eMax >> 1;
|
4926 | var nBits = exponentLength - 7;
|
4927 | var index = bytes - 1;
|
4928 | var sign = buffer[index--];
|
4929 | var exponent = sign & 127;
|
4930 | var mantissa;
|
4931 | sign >>= 7;
|
4932 | for (; nBits > 0; exponent = exponent * 256 + buffer[index], index--, nBits -= 8);
|
4933 | mantissa = exponent & (1 << -nBits) - 1;
|
4934 | exponent >>= -nBits;
|
4935 | nBits += mantissaLength;
|
4936 | for (; nBits > 0; mantissa = mantissa * 256 + buffer[index], index--, nBits -= 8);
|
4937 | if (exponent === 0) {
|
4938 | exponent = 1 - eBias;
|
4939 | } else if (exponent === eMax) {
|
4940 | return mantissa ? NaN : sign ? -Infinity : Infinity;
|
4941 | } else {
|
4942 | mantissa = mantissa + pow(2, mantissaLength);
|
4943 | exponent = exponent - eBias;
|
4944 | } return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength);
|
4945 | };
|
4946 |
|
4947 | module.exports = {
|
4948 | pack: pack,
|
4949 | unpack: unpack
|
4950 | };
|
4951 |
|
4952 |
|
4953 | }),
|
4954 |
|
4955 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
4956 |
|
4957 | var $ = __webpack_require__(2);
|
4958 | var ArrayBufferViewCore = __webpack_require__(171);
|
4959 |
|
4960 | var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;
|
4961 |
|
4962 |
|
4963 |
|
4964 | $({ target: 'ArrayBuffer', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, {
|
4965 | isView: ArrayBufferViewCore.isView
|
4966 | });
|
4967 |
|
4968 |
|
4969 | }),
|
4970 |
|
4971 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
4972 |
|
4973 | "use strict";
|
4974 |
|
4975 | var NATIVE_ARRAY_BUFFER = __webpack_require__(165);
|
4976 | var DESCRIPTORS = __webpack_require__(5);
|
4977 | var global = __webpack_require__(3);
|
4978 | var isCallable = __webpack_require__(18);
|
4979 | var isObject = __webpack_require__(17);
|
4980 | var hasOwn = __webpack_require__(35);
|
4981 | var classof = __webpack_require__(65);
|
4982 | var tryToString = __webpack_require__(28);
|
4983 | var createNonEnumerableProperty = __webpack_require__(40);
|
4984 | var redefine = __webpack_require__(43);
|
4985 | var defineProperty = (__webpack_require__(41).f);
|
4986 | var isPrototypeOf = __webpack_require__(21);
|
4987 | var getPrototypeOf = __webpack_require__(97);
|
4988 | var setPrototypeOf = __webpack_require__(99);
|
4989 | var wellKnownSymbol = __webpack_require__(30);
|
4990 | var uid = __webpack_require__(37);
|
4991 |
|
4992 | var Int8Array = global.Int8Array;
|
4993 | var Int8ArrayPrototype = Int8Array && Int8Array.prototype;
|
4994 | var Uint8ClampedArray = global.Uint8ClampedArray;
|
4995 | var Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype;
|
4996 | var TypedArray = Int8Array && getPrototypeOf(Int8Array);
|
4997 | var TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype);
|
4998 | var ObjectPrototype = Object.prototype;
|
4999 | var TypeError = global.TypeError;
|
5000 |
|
5001 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
5002 | var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');
|
5003 | var TYPED_ARRAY_CONSTRUCTOR = uid('TYPED_ARRAY_CONSTRUCTOR');
|
5004 |
|
5005 | var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(global.opera) !== 'Opera';
|
5006 | var TYPED_ARRAY_TAG_REQIRED = false;
|
5007 | var NAME, Constructor, Prototype;
|
5008 |
|
5009 | var TypedArrayConstructorsList = {
|
5010 | Int8Array: 1,
|
5011 | Uint8Array: 1,
|
5012 | Uint8ClampedArray: 1,
|
5013 | Int16Array: 2,
|
5014 | Uint16Array: 2,
|
5015 | Int32Array: 4,
|
5016 | Uint32Array: 4,
|
5017 | Float32Array: 4,
|
5018 | Float64Array: 8
|
5019 | };
|
5020 |
|
5021 | var BigIntArrayConstructorsList = {
|
5022 | BigInt64Array: 8,
|
5023 | BigUint64Array: 8
|
5024 | };
|
5025 |
|
5026 | var isView = function isView(it) {
|
5027 | if (!isObject(it)) return false;
|
5028 | var klass = classof(it);
|
5029 | return klass === 'DataView'
|
5030 | || hasOwn(TypedArrayConstructorsList, klass)
|
5031 | || hasOwn(BigIntArrayConstructorsList, klass);
|
5032 | };
|
5033 |
|
5034 | var isTypedArray = function (it) {
|
5035 | if (!isObject(it)) return false;
|
5036 | var klass = classof(it);
|
5037 | return hasOwn(TypedArrayConstructorsList, klass)
|
5038 | || hasOwn(BigIntArrayConstructorsList, klass);
|
5039 | };
|
5040 |
|
5041 | var aTypedArray = function (it) {
|
5042 | if (isTypedArray(it)) return it;
|
5043 | throw TypeError('Target is not a typed array');
|
5044 | };
|
5045 |
|
5046 | var aTypedArrayConstructor = function (C) {
|
5047 | if (isCallable(C) && (!setPrototypeOf || isPrototypeOf(TypedArray, C))) return C;
|
5048 | throw TypeError(tryToString(C) + ' is not a typed array constructor');
|
5049 | };
|
5050 |
|
5051 | var exportTypedArrayMethod = function (KEY, property, forced) {
|
5052 | if (!DESCRIPTORS) return;
|
5053 | if (forced) for (var ARRAY in TypedArrayConstructorsList) {
|
5054 | var TypedArrayConstructor = global[ARRAY];
|
5055 | if (TypedArrayConstructor && hasOwn(TypedArrayConstructor.prototype, KEY)) try {
|
5056 | delete TypedArrayConstructor.prototype[KEY];
|
5057 | } catch (error) { }
|
5058 | }
|
5059 | if (!TypedArrayPrototype[KEY] || forced) {
|
5060 | redefine(TypedArrayPrototype, KEY, forced ? property
|
5061 | : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property);
|
5062 | }
|
5063 | };
|
5064 |
|
5065 | var exportTypedArrayStaticMethod = function (KEY, property, forced) {
|
5066 | var ARRAY, TypedArrayConstructor;
|
5067 | if (!DESCRIPTORS) return;
|
5068 | if (setPrototypeOf) {
|
5069 | if (forced) for (ARRAY in TypedArrayConstructorsList) {
|
5070 | TypedArrayConstructor = global[ARRAY];
|
5071 | if (TypedArrayConstructor && hasOwn(TypedArrayConstructor, KEY)) try {
|
5072 | delete TypedArrayConstructor[KEY];
|
5073 | } catch (error) { }
|
5074 | }
|
5075 | if (!TypedArray[KEY] || forced) {
|
5076 |
|
5077 | try {
|
5078 | return redefine(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && TypedArray[KEY] || property);
|
5079 | } catch (error) { }
|
5080 | } else return;
|
5081 | }
|
5082 | for (ARRAY in TypedArrayConstructorsList) {
|
5083 | TypedArrayConstructor = global[ARRAY];
|
5084 | if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) {
|
5085 | redefine(TypedArrayConstructor, KEY, property);
|
5086 | }
|
5087 | }
|
5088 | };
|
5089 |
|
5090 | for (NAME in TypedArrayConstructorsList) {
|
5091 | Constructor = global[NAME];
|
5092 | Prototype = Constructor && Constructor.prototype;
|
5093 | if (Prototype) createNonEnumerableProperty(Prototype, TYPED_ARRAY_CONSTRUCTOR, Constructor);
|
5094 | else NATIVE_ARRAY_BUFFER_VIEWS = false;
|
5095 | }
|
5096 |
|
5097 | for (NAME in BigIntArrayConstructorsList) {
|
5098 | Constructor = global[NAME];
|
5099 | Prototype = Constructor && Constructor.prototype;
|
5100 | if (Prototype) createNonEnumerableProperty(Prototype, TYPED_ARRAY_CONSTRUCTOR, Constructor);
|
5101 | }
|
5102 |
|
5103 |
|
5104 | if (!NATIVE_ARRAY_BUFFER_VIEWS || !isCallable(TypedArray) || TypedArray === Function.prototype) {
|
5105 |
|
5106 | TypedArray = function TypedArray() {
|
5107 | throw TypeError('Incorrect invocation');
|
5108 | };
|
5109 | if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {
|
5110 | if (global[NAME]) setPrototypeOf(global[NAME], TypedArray);
|
5111 | }
|
5112 | }
|
5113 |
|
5114 | if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) {
|
5115 | TypedArrayPrototype = TypedArray.prototype;
|
5116 | if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {
|
5117 | if (global[NAME]) setPrototypeOf(global[NAME].prototype, TypedArrayPrototype);
|
5118 | }
|
5119 | }
|
5120 |
|
5121 |
|
5122 | if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) {
|
5123 | setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype);
|
5124 | }
|
5125 |
|
5126 | if (DESCRIPTORS && !hasOwn(TypedArrayPrototype, TO_STRING_TAG)) {
|
5127 | TYPED_ARRAY_TAG_REQIRED = true;
|
5128 | defineProperty(TypedArrayPrototype, TO_STRING_TAG, { get: function () {
|
5129 | return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined;
|
5130 | } });
|
5131 | for (NAME in TypedArrayConstructorsList) if (global[NAME]) {
|
5132 | createNonEnumerableProperty(global[NAME], TYPED_ARRAY_TAG, NAME);
|
5133 | }
|
5134 | }
|
5135 |
|
5136 | module.exports = {
|
5137 | NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS,
|
5138 | TYPED_ARRAY_CONSTRUCTOR: TYPED_ARRAY_CONSTRUCTOR,
|
5139 | TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQIRED && TYPED_ARRAY_TAG,
|
5140 | aTypedArray: aTypedArray,
|
5141 | aTypedArrayConstructor: aTypedArrayConstructor,
|
5142 | exportTypedArrayMethod: exportTypedArrayMethod,
|
5143 | exportTypedArrayStaticMethod: exportTypedArrayStaticMethod,
|
5144 | isView: isView,
|
5145 | isTypedArray: isTypedArray,
|
5146 | TypedArray: TypedArray,
|
5147 | TypedArrayPrototype: TypedArrayPrototype
|
5148 | };
|
5149 |
|
5150 |
|
5151 | }),
|
5152 |
|
5153 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5154 |
|
5155 | "use strict";
|
5156 |
|
5157 | var $ = __webpack_require__(2);
|
5158 | var uncurryThis = __webpack_require__(12);
|
5159 | var fails = __webpack_require__(6);
|
5160 | var ArrayBufferModule = __webpack_require__(164);
|
5161 | var anObject = __webpack_require__(42);
|
5162 | var toAbsoluteIndex = __webpack_require__(55);
|
5163 | var toLength = __webpack_require__(58);
|
5164 | var speciesConstructor = __webpack_require__(173);
|
5165 |
|
5166 | var ArrayBuffer = ArrayBufferModule.ArrayBuffer;
|
5167 | var DataView = ArrayBufferModule.DataView;
|
5168 | var DataViewPrototype = DataView.prototype;
|
5169 | var un$ArrayBufferSlice = uncurryThis(ArrayBuffer.prototype.slice);
|
5170 | var getUint8 = uncurryThis(DataViewPrototype.getUint8);
|
5171 | var setUint8 = uncurryThis(DataViewPrototype.setUint8);
|
5172 |
|
5173 | var INCORRECT_SLICE = fails(function () {
|
5174 | return !new ArrayBuffer(2).slice(1, undefined).byteLength;
|
5175 | });
|
5176 |
|
5177 |
|
5178 |
|
5179 | $({ target: 'ArrayBuffer', proto: true, unsafe: true, forced: INCORRECT_SLICE }, {
|
5180 | slice: function slice(start, end) {
|
5181 | if (un$ArrayBufferSlice && end === undefined) {
|
5182 | return un$ArrayBufferSlice(anObject(this), start);
|
5183 | }
|
5184 | var length = anObject(this).byteLength;
|
5185 | var first = toAbsoluteIndex(start, length);
|
5186 | var fin = toAbsoluteIndex(end === undefined ? length : end, length);
|
5187 | var result = new (speciesConstructor(this, ArrayBuffer))(toLength(fin - first));
|
5188 | var viewSource = new DataView(this);
|
5189 | var viewTarget = new DataView(result);
|
5190 | var index = 0;
|
5191 | while (first < fin) {
|
5192 | setUint8(viewTarget, index++, getUint8(viewSource, first++));
|
5193 | } return result;
|
5194 | }
|
5195 | });
|
5196 |
|
5197 |
|
5198 | }),
|
5199 |
|
5200 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
5201 |
|
5202 | var anObject = __webpack_require__(42);
|
5203 | var aConstructor = __webpack_require__(174);
|
5204 | var wellKnownSymbol = __webpack_require__(30);
|
5205 |
|
5206 | var SPECIES = wellKnownSymbol('species');
|
5207 |
|
5208 |
|
5209 |
|
5210 | module.exports = function (O, defaultConstructor) {
|
5211 | var C = anObject(O).constructor;
|
5212 | var S;
|
5213 | return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aConstructor(S);
|
5214 | };
|
5215 |
|
5216 |
|
5217 | }),
|
5218 |
|
5219 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
5220 |
|
5221 | var global = __webpack_require__(3);
|
5222 | var isConstructor = __webpack_require__(81);
|
5223 | var tryToString = __webpack_require__(28);
|
5224 |
|
5225 | var TypeError = global.TypeError;
|
5226 |
|
5227 |
|
5228 | module.exports = function (argument) {
|
5229 | if (isConstructor(argument)) return argument;
|
5230 | throw TypeError(tryToString(argument) + ' is not a constructor');
|
5231 | };
|
5232 |
|
5233 |
|
5234 | }),
|
5235 |
|
5236 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5237 |
|
5238 | var $ = __webpack_require__(2);
|
5239 | var ArrayBufferModule = __webpack_require__(164);
|
5240 | var NATIVE_ARRAY_BUFFER = __webpack_require__(165);
|
5241 |
|
5242 |
|
5243 |
|
5244 | $({ global: true, forced: !NATIVE_ARRAY_BUFFER }, {
|
5245 | DataView: ArrayBufferModule.DataView
|
5246 | });
|
5247 |
|
5248 |
|
5249 | }),
|
5250 |
|
5251 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5252 |
|
5253 | "use strict";
|
5254 |
|
5255 | var $ = __webpack_require__(2);
|
5256 | var uncurryThis = __webpack_require__(12);
|
5257 | var fails = __webpack_require__(6);
|
5258 |
|
5259 | var FORCED = fails(function () {
|
5260 | return new Date(16e11).getYear() !== 120;
|
5261 | });
|
5262 |
|
5263 | var getFullYear = uncurryThis(Date.prototype.getFullYear);
|
5264 |
|
5265 |
|
5266 |
|
5267 | $({ target: 'Date', proto: true, forced: FORCED }, {
|
5268 | getYear: function getYear() {
|
5269 | return getFullYear(this) - 1900;
|
5270 | }
|
5271 | });
|
5272 |
|
5273 |
|
5274 | }),
|
5275 |
|
5276 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5277 |
|
5278 | var $ = __webpack_require__(2);
|
5279 | var global = __webpack_require__(3);
|
5280 | var uncurryThis = __webpack_require__(12);
|
5281 |
|
5282 | var Date = global.Date;
|
5283 | var getTime = uncurryThis(Date.prototype.getTime);
|
5284 |
|
5285 |
|
5286 |
|
5287 | $({ target: 'Date', stat: true }, {
|
5288 | now: function now() {
|
5289 | return getTime(new Date());
|
5290 | }
|
5291 | });
|
5292 |
|
5293 |
|
5294 | }),
|
5295 |
|
5296 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5297 |
|
5298 | "use strict";
|
5299 |
|
5300 | var $ = __webpack_require__(2);
|
5301 | var uncurryThis = __webpack_require__(12);
|
5302 | var toIntegerOrInfinity = __webpack_require__(56);
|
5303 |
|
5304 | var DatePrototype = Date.prototype;
|
5305 | var getTime = uncurryThis(DatePrototype.getTime);
|
5306 | var setFullYear = uncurryThis(DatePrototype.setFullYear);
|
5307 |
|
5308 |
|
5309 |
|
5310 | $({ target: 'Date', proto: true }, {
|
5311 | setYear: function setYear(year) {
|
5312 |
|
5313 | getTime(this);
|
5314 | var yi = toIntegerOrInfinity(year);
|
5315 | var yyyy = 0 <= yi && yi <= 99 ? yi + 1900 : yi;
|
5316 | return setFullYear(this, yyyy);
|
5317 | }
|
5318 | });
|
5319 |
|
5320 |
|
5321 | }),
|
5322 |
|
5323 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5324 |
|
5325 | var $ = __webpack_require__(2);
|
5326 |
|
5327 |
|
5328 |
|
5329 | $({ target: 'Date', proto: true }, {
|
5330 | toGMTString: Date.prototype.toUTCString
|
5331 | });
|
5332 |
|
5333 |
|
5334 | }),
|
5335 |
|
5336 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5337 |
|
5338 | var $ = __webpack_require__(2);
|
5339 | var toISOString = __webpack_require__(181);
|
5340 |
|
5341 |
|
5342 |
|
5343 |
|
5344 | $({ target: 'Date', proto: true, forced: Date.prototype.toISOString !== toISOString }, {
|
5345 | toISOString: toISOString
|
5346 | });
|
5347 |
|
5348 |
|
5349 | }),
|
5350 |
|
5351 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
5352 |
|
5353 | "use strict";
|
5354 |
|
5355 | var global = __webpack_require__(3);
|
5356 | var uncurryThis = __webpack_require__(12);
|
5357 | var fails = __webpack_require__(6);
|
5358 | var padStart = (__webpack_require__(182).start);
|
5359 |
|
5360 | var RangeError = global.RangeError;
|
5361 | var abs = Math.abs;
|
5362 | var DatePrototype = Date.prototype;
|
5363 | var n$DateToISOString = DatePrototype.toISOString;
|
5364 | var getTime = uncurryThis(DatePrototype.getTime);
|
5365 | var getUTCDate = uncurryThis(DatePrototype.getUTCDate);
|
5366 | var getUTCFullYear = uncurryThis(DatePrototype.getUTCFullYear);
|
5367 | var getUTCHours = uncurryThis(DatePrototype.getUTCHours);
|
5368 | var getUTCMilliseconds = uncurryThis(DatePrototype.getUTCMilliseconds);
|
5369 | var getUTCMinutes = uncurryThis(DatePrototype.getUTCMinutes);
|
5370 | var getUTCMonth = uncurryThis(DatePrototype.getUTCMonth);
|
5371 | var getUTCSeconds = uncurryThis(DatePrototype.getUTCSeconds);
|
5372 |
|
5373 |
|
5374 |
|
5375 |
|
5376 | module.exports = (fails(function () {
|
5377 | return n$DateToISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';
|
5378 | }) || !fails(function () {
|
5379 | n$DateToISOString.call(new Date(NaN));
|
5380 | })) ? function toISOString() {
|
5381 | if (!isFinite(getTime(this))) throw RangeError('Invalid time value');
|
5382 | var date = this;
|
5383 | var year = getUTCFullYear(date);
|
5384 | var milliseconds = getUTCMilliseconds(date);
|
5385 | var sign = year < 0 ? '-' : year > 9999 ? '+' : '';
|
5386 | return sign + padStart(abs(year), sign ? 6 : 4, 0) +
|
5387 | '-' + padStart(getUTCMonth(date) + 1, 2, 0) +
|
5388 | '-' + padStart(getUTCDate(date), 2, 0) +
|
5389 | 'T' + padStart(getUTCHours(date), 2, 0) +
|
5390 | ':' + padStart(getUTCMinutes(date), 2, 0) +
|
5391 | ':' + padStart(getUTCSeconds(date), 2, 0) +
|
5392 | '.' + padStart(milliseconds, 3, 0) +
|
5393 | 'Z';
|
5394 | } : n$DateToISOString;
|
5395 |
|
5396 |
|
5397 | }),
|
5398 |
|
5399 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
5400 |
|
5401 |
|
5402 | var uncurryThis = __webpack_require__(12);
|
5403 | var toLength = __webpack_require__(58);
|
5404 | var toString = __webpack_require__(64);
|
5405 | var $repeat = __webpack_require__(183);
|
5406 | var requireObjectCoercible = __webpack_require__(14);
|
5407 |
|
5408 | var repeat = uncurryThis($repeat);
|
5409 | var stringSlice = uncurryThis(''.slice);
|
5410 | var ceil = Math.ceil;
|
5411 |
|
5412 |
|
5413 | var createMethod = function (IS_END) {
|
5414 | return function ($this, maxLength, fillString) {
|
5415 | var S = toString(requireObjectCoercible($this));
|
5416 | var intMaxLength = toLength(maxLength);
|
5417 | var stringLength = S.length;
|
5418 | var fillStr = fillString === undefined ? ' ' : toString(fillString);
|
5419 | var fillLen, stringFiller;
|
5420 | if (intMaxLength <= stringLength || fillStr == '') return S;
|
5421 | fillLen = intMaxLength - stringLength;
|
5422 | stringFiller = repeat(fillStr, ceil(fillLen / fillStr.length));
|
5423 | if (stringFiller.length > fillLen) stringFiller = stringSlice(stringFiller, 0, fillLen);
|
5424 | return IS_END ? S + stringFiller : stringFiller + S;
|
5425 | };
|
5426 | };
|
5427 |
|
5428 | module.exports = {
|
5429 |
|
5430 |
|
5431 | start: createMethod(false),
|
5432 |
|
5433 |
|
5434 | end: createMethod(true)
|
5435 | };
|
5436 |
|
5437 |
|
5438 | }),
|
5439 |
|
5440 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
5441 |
|
5442 | "use strict";
|
5443 |
|
5444 | var global = __webpack_require__(3);
|
5445 | var toIntegerOrInfinity = __webpack_require__(56);
|
5446 | var toString = __webpack_require__(64);
|
5447 | var requireObjectCoercible = __webpack_require__(14);
|
5448 |
|
5449 | var RangeError = global.RangeError;
|
5450 |
|
5451 |
|
5452 |
|
5453 | module.exports = function repeat(count) {
|
5454 | var str = toString(requireObjectCoercible(this));
|
5455 | var result = '';
|
5456 | var n = toIntegerOrInfinity(count);
|
5457 | if (n < 0 || n == Infinity) throw RangeError('Wrong number of repetitions');
|
5458 | for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;
|
5459 | return result;
|
5460 | };
|
5461 |
|
5462 |
|
5463 | }),
|
5464 |
|
5465 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5466 |
|
5467 | "use strict";
|
5468 |
|
5469 | var $ = __webpack_require__(2);
|
5470 | var fails = __webpack_require__(6);
|
5471 | var toObject = __webpack_require__(36);
|
5472 | var toPrimitive = __webpack_require__(16);
|
5473 |
|
5474 | var FORCED = fails(function () {
|
5475 | return new Date(NaN).toJSON() !== null
|
5476 | || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1;
|
5477 | });
|
5478 |
|
5479 |
|
5480 |
|
5481 | $({ target: 'Date', proto: true, forced: FORCED }, {
|
5482 |
|
5483 | toJSON: function toJSON(key) {
|
5484 | var O = toObject(this);
|
5485 | var pv = toPrimitive(O, 'number');
|
5486 | return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();
|
5487 | }
|
5488 | });
|
5489 |
|
5490 |
|
5491 | }),
|
5492 |
|
5493 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5494 |
|
5495 | var hasOwn = __webpack_require__(35);
|
5496 | var redefine = __webpack_require__(43);
|
5497 | var dateToPrimitive = __webpack_require__(186);
|
5498 | var wellKnownSymbol = __webpack_require__(30);
|
5499 |
|
5500 | var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
5501 | var DatePrototype = Date.prototype;
|
5502 |
|
5503 |
|
5504 |
|
5505 | if (!hasOwn(DatePrototype, TO_PRIMITIVE)) {
|
5506 | redefine(DatePrototype, TO_PRIMITIVE, dateToPrimitive);
|
5507 | }
|
5508 |
|
5509 |
|
5510 | }),
|
5511 |
|
5512 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
5513 |
|
5514 | "use strict";
|
5515 |
|
5516 | var global = __webpack_require__(3);
|
5517 | var anObject = __webpack_require__(42);
|
5518 | var ordinaryToPrimitive = __webpack_require__(29);
|
5519 |
|
5520 | var TypeError = global.TypeError;
|
5521 |
|
5522 |
|
5523 |
|
5524 | module.exports = function (hint) {
|
5525 | anObject(this);
|
5526 | if (hint === 'string' || hint === 'default') hint = 'string';
|
5527 | else if (hint !== 'number') throw TypeError('Incorrect hint');
|
5528 | return ordinaryToPrimitive(this, hint);
|
5529 | };
|
5530 |
|
5531 |
|
5532 | }),
|
5533 |
|
5534 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5535 |
|
5536 | var uncurryThis = __webpack_require__(12);
|
5537 | var redefine = __webpack_require__(43);
|
5538 |
|
5539 | var DatePrototype = Date.prototype;
|
5540 | var INVALID_DATE = 'Invalid Date';
|
5541 | var TO_STRING = 'toString';
|
5542 | var un$DateToString = uncurryThis(DatePrototype[TO_STRING]);
|
5543 | var getTime = uncurryThis(DatePrototype.getTime);
|
5544 |
|
5545 |
|
5546 |
|
5547 | if (String(new Date(NaN)) != INVALID_DATE) {
|
5548 | redefine(DatePrototype, TO_STRING, function toString() {
|
5549 | var value = getTime(this);
|
5550 |
|
5551 | return value === value ? un$DateToString(this) : INVALID_DATE;
|
5552 | });
|
5553 | }
|
5554 |
|
5555 |
|
5556 | }),
|
5557 |
|
5558 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5559 |
|
5560 | "use strict";
|
5561 |
|
5562 | var $ = __webpack_require__(2);
|
5563 | var uncurryThis = __webpack_require__(12);
|
5564 | var toString = __webpack_require__(64);
|
5565 |
|
5566 | var charAt = uncurryThis(''.charAt);
|
5567 | var charCodeAt = uncurryThis(''.charCodeAt);
|
5568 | var exec = uncurryThis(/./.exec);
|
5569 | var numberToString = uncurryThis(1.0.toString);
|
5570 | var toUpperCase = uncurryThis(''.toUpperCase);
|
5571 |
|
5572 | var raw = /[\w*+\-./@]/;
|
5573 |
|
5574 | var hex = function (code, length) {
|
5575 | var result = numberToString(code, 16);
|
5576 | while (result.length < length) result = '0' + result;
|
5577 | return result;
|
5578 | };
|
5579 |
|
5580 |
|
5581 |
|
5582 | $({ global: true }, {
|
5583 | escape: function escape(string) {
|
5584 | var str = toString(string);
|
5585 | var result = '';
|
5586 | var length = str.length;
|
5587 | var index = 0;
|
5588 | var chr, code;
|
5589 | while (index < length) {
|
5590 | chr = charAt(str, index++);
|
5591 | if (exec(raw, chr)) {
|
5592 | result += chr;
|
5593 | } else {
|
5594 | code = charCodeAt(chr, 0);
|
5595 | if (code < 256) {
|
5596 | result += '%' + hex(code, 2);
|
5597 | } else {
|
5598 | result += '%u' + toUpperCase(hex(code, 4));
|
5599 | }
|
5600 | }
|
5601 | } return result;
|
5602 | }
|
5603 | });
|
5604 |
|
5605 |
|
5606 | }),
|
5607 |
|
5608 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5609 |
|
5610 | var $ = __webpack_require__(2);
|
5611 | var bind = __webpack_require__(190);
|
5612 |
|
5613 |
|
5614 |
|
5615 | $({ target: 'Function', proto: true }, {
|
5616 | bind: bind
|
5617 | });
|
5618 |
|
5619 |
|
5620 | }),
|
5621 |
|
5622 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
5623 |
|
5624 | "use strict";
|
5625 |
|
5626 | var global = __webpack_require__(3);
|
5627 | var uncurryThis = __webpack_require__(12);
|
5628 | var aCallable = __webpack_require__(27);
|
5629 | var isObject = __webpack_require__(17);
|
5630 | var hasOwn = __webpack_require__(35);
|
5631 | var arraySlice = __webpack_require__(72);
|
5632 |
|
5633 | var Function = global.Function;
|
5634 | var concat = uncurryThis([].concat);
|
5635 | var join = uncurryThis([].join);
|
5636 | var factories = {};
|
5637 |
|
5638 | var construct = function (C, argsLength, args) {
|
5639 | if (!hasOwn(factories, argsLength)) {
|
5640 | for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';
|
5641 | factories[argsLength] = Function('C,a', 'return new C(' + join(list, ',') + ')');
|
5642 | } return factories[argsLength](C, args);
|
5643 | };
|
5644 |
|
5645 |
|
5646 |
|
5647 | module.exports = Function.bind || function bind(that /* , ...args */) {
|
5648 | var F = aCallable(this);
|
5649 | var Prototype = F.prototype;
|
5650 | var partArgs = arraySlice(arguments, 1);
|
5651 | var boundFunction = function bound(/* args... */) {
|
5652 | var args = concat(partArgs, arraySlice(arguments));
|
5653 | return this instanceof boundFunction ? construct(F, args.length, args) : F.apply(that, args);
|
5654 | };
|
5655 | if (isObject(Prototype)) boundFunction.prototype = Prototype;
|
5656 | return boundFunction;
|
5657 | };
|
5658 |
|
5659 |
|
5660 | }),
|
5661 |
|
5662 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5663 |
|
5664 | "use strict";
|
5665 |
|
5666 | var isCallable = __webpack_require__(18);
|
5667 | var isObject = __webpack_require__(17);
|
5668 | var definePropertyModule = __webpack_require__(41);
|
5669 | var getPrototypeOf = __webpack_require__(97);
|
5670 | var wellKnownSymbol = __webpack_require__(30);
|
5671 |
|
5672 | var HAS_INSTANCE = wellKnownSymbol('hasInstance');
|
5673 | var FunctionPrototype = Function.prototype;
|
5674 |
|
5675 |
|
5676 |
|
5677 | if (!(HAS_INSTANCE in FunctionPrototype)) {
|
5678 | definePropertyModule.f(FunctionPrototype, HAS_INSTANCE, { value: function (O) {
|
5679 | if (!isCallable(this) || !isObject(O)) return false;
|
5680 | var P = this.prototype;
|
5681 | if (!isObject(P)) return O instanceof this;
|
5682 |
|
5683 | while (O = getPrototypeOf(O)) if (P === O) return true;
|
5684 | return false;
|
5685 | } });
|
5686 | }
|
5687 |
|
5688 |
|
5689 | }),
|
5690 |
|
5691 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5692 |
|
5693 | var DESCRIPTORS = __webpack_require__(5);
|
5694 | var FUNCTION_NAME_EXISTS = (__webpack_require__(49).EXISTS);
|
5695 | var uncurryThis = __webpack_require__(12);
|
5696 | var defineProperty = (__webpack_require__(41).f);
|
5697 |
|
5698 | var FunctionPrototype = Function.prototype;
|
5699 | var functionToString = uncurryThis(FunctionPrototype.toString);
|
5700 | var nameRE = /^\s*function ([^ (]*)/;
|
5701 | var regExpExec = uncurryThis(nameRE.exec);
|
5702 | var NAME = 'name';
|
5703 |
|
5704 |
|
5705 |
|
5706 | if (DESCRIPTORS && !FUNCTION_NAME_EXISTS) {
|
5707 | defineProperty(FunctionPrototype, NAME, {
|
5708 | configurable: true,
|
5709 | get: function () {
|
5710 | try {
|
5711 | return regExpExec(nameRE, functionToString(this))[1];
|
5712 | } catch (error) {
|
5713 | return '';
|
5714 | }
|
5715 | }
|
5716 | });
|
5717 | }
|
5718 |
|
5719 |
|
5720 | }),
|
5721 |
|
5722 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5723 |
|
5724 | var $ = __webpack_require__(2);
|
5725 | var global = __webpack_require__(3);
|
5726 |
|
5727 |
|
5728 |
|
5729 | $({ global: true }, {
|
5730 | globalThis: global
|
5731 | });
|
5732 |
|
5733 |
|
5734 | }),
|
5735 |
|
5736 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5737 |
|
5738 | var $ = __webpack_require__(2);
|
5739 | var global = __webpack_require__(3);
|
5740 | var getBuiltIn = __webpack_require__(20);
|
5741 | var apply = __webpack_require__(62);
|
5742 | var uncurryThis = __webpack_require__(12);
|
5743 | var fails = __webpack_require__(6);
|
5744 |
|
5745 | var Array = global.Array;
|
5746 | var $stringify = getBuiltIn('JSON', 'stringify');
|
5747 | var exec = uncurryThis(/./.exec);
|
5748 | var charAt = uncurryThis(''.charAt);
|
5749 | var charCodeAt = uncurryThis(''.charCodeAt);
|
5750 | var replace = uncurryThis(''.replace);
|
5751 | var numberToString = uncurryThis(1.0.toString);
|
5752 |
|
5753 | var tester = /[\uD800-\uDFFF]/g;
|
5754 | var low = /^[\uD800-\uDBFF]$/;
|
5755 | var hi = /^[\uDC00-\uDFFF]$/;
|
5756 |
|
5757 | var fix = function (match, offset, string) {
|
5758 | var prev = charAt(string, offset - 1);
|
5759 | var next = charAt(string, offset + 1);
|
5760 | if ((exec(low, match) && !exec(hi, next)) || (exec(hi, match) && !exec(low, prev))) {
|
5761 | return '\\u' + numberToString(charCodeAt(match, 0), 16);
|
5762 | } return match;
|
5763 | };
|
5764 |
|
5765 | var FORCED = fails(function () {
|
5766 | return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
|
5767 | || $stringify('\uDEAD') !== '"\\udead"';
|
5768 | });
|
5769 |
|
5770 | if ($stringify) {
|
5771 |
|
5772 |
|
5773 |
|
5774 | $({ target: 'JSON', stat: true, forced: FORCED }, {
|
5775 |
|
5776 | stringify: function stringify(it, replacer, space) {
|
5777 | for (var i = 0, l = arguments.length, args = Array(l); i < l; i++) args[i] = arguments[i];
|
5778 | var result = apply($stringify, null, args);
|
5779 | return typeof result == 'string' ? replace(result, tester, fix) : result;
|
5780 | }
|
5781 | });
|
5782 | }
|
5783 |
|
5784 |
|
5785 | }),
|
5786 |
|
5787 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5788 |
|
5789 | var global = __webpack_require__(3);
|
5790 | var setToStringTag = __webpack_require__(76);
|
5791 |
|
5792 |
|
5793 |
|
5794 | setToStringTag(global.JSON, 'JSON', true);
|
5795 |
|
5796 |
|
5797 | }),
|
5798 |
|
5799 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
5800 |
|
5801 | "use strict";
|
5802 |
|
5803 | var collection = __webpack_require__(197);
|
5804 | var collectionStrong = __webpack_require__(203);
|
5805 |
|
5806 |
|
5807 |
|
5808 | collection('Map', function (init) {
|
5809 | return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };
|
5810 | }, collectionStrong);
|
5811 |
|
5812 |
|
5813 | }),
|
5814 |
|
5815 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
5816 |
|
5817 | "use strict";
|
5818 |
|
5819 | var $ = __webpack_require__(2);
|
5820 | var global = __webpack_require__(3);
|
5821 | var uncurryThis = __webpack_require__(12);
|
5822 | var isForced = __webpack_require__(61);
|
5823 | var redefine = __webpack_require__(43);
|
5824 | var InternalMetadataModule = __webpack_require__(198);
|
5825 | var iterate = __webpack_require__(103);
|
5826 | var anInstance = __webpack_require__(167);
|
5827 | var isCallable = __webpack_require__(18);
|
5828 | var isObject = __webpack_require__(17);
|
5829 | var fails = __webpack_require__(6);
|
5830 | var checkCorrectnessOfIteration = __webpack_require__(133);
|
5831 | var setToStringTag = __webpack_require__(76);
|
5832 | var inheritIfRequired = __webpack_require__(202);
|
5833 |
|
5834 | module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
|
5835 | var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
|
5836 | var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
|
5837 | var ADDER = IS_MAP ? 'set' : 'add';
|
5838 | var NativeConstructor = global[CONSTRUCTOR_NAME];
|
5839 | var NativePrototype = NativeConstructor && NativeConstructor.prototype;
|
5840 | var Constructor = NativeConstructor;
|
5841 | var exported = {};
|
5842 |
|
5843 | var fixMethod = function (KEY) {
|
5844 | var uncurriedNativeMethod = uncurryThis(NativePrototype[KEY]);
|
5845 | redefine(NativePrototype, KEY,
|
5846 | KEY == 'add' ? function add(value) {
|
5847 | uncurriedNativeMethod(this, value === 0 ? 0 : value);
|
5848 | return this;
|
5849 | } : KEY == 'delete' ? function (key) {
|
5850 | return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
|
5851 | } : KEY == 'get' ? function get(key) {
|
5852 | return IS_WEAK && !isObject(key) ? undefined : uncurriedNativeMethod(this, key === 0 ? 0 : key);
|
5853 | } : KEY == 'has' ? function has(key) {
|
5854 | return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
|
5855 | } : function set(key, value) {
|
5856 | uncurriedNativeMethod(this, key === 0 ? 0 : key, value);
|
5857 | return this;
|
5858 | }
|
5859 | );
|
5860 | };
|
5861 |
|
5862 | var REPLACE = isForced(
|
5863 | CONSTRUCTOR_NAME,
|
5864 | !isCallable(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails(function () {
|
5865 | new NativeConstructor().entries().next();
|
5866 | }))
|
5867 | );
|
5868 |
|
5869 | if (REPLACE) {
|
5870 |
|
5871 | Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
|
5872 | InternalMetadataModule.enable();
|
5873 | } else if (isForced(CONSTRUCTOR_NAME, true)) {
|
5874 | var instance = new Constructor();
|
5875 |
|
5876 | var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
|
5877 |
|
5878 | var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
|
5879 |
|
5880 |
|
5881 | var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); });
|
5882 |
|
5883 | var BUGGY_ZERO = !IS_WEAK && fails(function () {
|
5884 |
|
5885 | var $instance = new NativeConstructor();
|
5886 | var index = 5;
|
5887 | while (index--) $instance[ADDER](index, index);
|
5888 | return !$instance.has(-0);
|
5889 | });
|
5890 |
|
5891 | if (!ACCEPT_ITERABLES) {
|
5892 | Constructor = wrapper(function (dummy, iterable) {
|
5893 | anInstance(dummy, NativePrototype);
|
5894 | var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
|
5895 | if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
|
5896 | return that;
|
5897 | });
|
5898 | Constructor.prototype = NativePrototype;
|
5899 | NativePrototype.constructor = Constructor;
|
5900 | }
|
5901 |
|
5902 | if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
|
5903 | fixMethod('delete');
|
5904 | fixMethod('has');
|
5905 | IS_MAP && fixMethod('get');
|
5906 | }
|
5907 |
|
5908 | if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
|
5909 |
|
5910 |
|
5911 | if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear;
|
5912 | }
|
5913 |
|
5914 | exported[CONSTRUCTOR_NAME] = Constructor;
|
5915 | $({ global: true, forced: Constructor != NativeConstructor }, exported);
|
5916 |
|
5917 | setToStringTag(Constructor, CONSTRUCTOR_NAME);
|
5918 |
|
5919 | if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
|
5920 |
|
5921 | return Constructor;
|
5922 | };
|
5923 |
|
5924 |
|
5925 | }),
|
5926 |
|
5927 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
5928 |
|
5929 | var $ = __webpack_require__(2);
|
5930 | var uncurryThis = __webpack_require__(12);
|
5931 | var hiddenKeys = __webpack_require__(48);
|
5932 | var isObject = __webpack_require__(17);
|
5933 | var hasOwn = __webpack_require__(35);
|
5934 | var defineProperty = (__webpack_require__(41).f);
|
5935 | var getOwnPropertyNamesModule = __webpack_require__(52);
|
5936 | var getOwnPropertyNamesExternalModule = __webpack_require__(71);
|
5937 | var isExtensible = __webpack_require__(199);
|
5938 | var uid = __webpack_require__(37);
|
5939 | var FREEZING = __webpack_require__(201);
|
5940 |
|
5941 | var REQUIRED = false;
|
5942 | var METADATA = uid('meta');
|
5943 | var id = 0;
|
5944 |
|
5945 | var setMetadata = function (it) {
|
5946 | defineProperty(it, METADATA, { value: {
|
5947 | objectID: 'O' + id++,
|
5948 | weakData: {}
|
5949 | } });
|
5950 | };
|
5951 |
|
5952 | var fastKey = function (it, create) {
|
5953 |
|
5954 | if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
|
5955 | if (!hasOwn(it, METADATA)) {
|
5956 |
|
5957 | if (!isExtensible(it)) return 'F';
|
5958 |
|
5959 | if (!create) return 'E';
|
5960 |
|
5961 | setMetadata(it);
|
5962 |
|
5963 | } return it[METADATA].objectID;
|
5964 | };
|
5965 |
|
5966 | var getWeakData = function (it, create) {
|
5967 | if (!hasOwn(it, METADATA)) {
|
5968 |
|
5969 | if (!isExtensible(it)) return true;
|
5970 |
|
5971 | if (!create) return false;
|
5972 |
|
5973 | setMetadata(it);
|
5974 |
|
5975 | } return it[METADATA].weakData;
|
5976 | };
|
5977 |
|
5978 |
|
5979 | var onFreeze = function (it) {
|
5980 | if (FREEZING && REQUIRED && isExtensible(it) && !hasOwn(it, METADATA)) setMetadata(it);
|
5981 | return it;
|
5982 | };
|
5983 |
|
5984 | var enable = function () {
|
5985 | meta.enable = function () { };
|
5986 | REQUIRED = true;
|
5987 | var getOwnPropertyNames = getOwnPropertyNamesModule.f;
|
5988 | var splice = uncurryThis([].splice);
|
5989 | var test = {};
|
5990 | test[METADATA] = 1;
|
5991 |
|
5992 |
|
5993 | if (getOwnPropertyNames(test).length) {
|
5994 | getOwnPropertyNamesModule.f = function (it) {
|
5995 | var result = getOwnPropertyNames(it);
|
5996 | for (var i = 0, length = result.length; i < length; i++) {
|
5997 | if (result[i] === METADATA) {
|
5998 | splice(result, i, 1);
|
5999 | break;
|
6000 | }
|
6001 | } return result;
|
6002 | };
|
6003 |
|
6004 | $({ target: 'Object', stat: true, forced: true }, {
|
6005 | getOwnPropertyNames: getOwnPropertyNamesExternalModule.f
|
6006 | });
|
6007 | }
|
6008 | };
|
6009 |
|
6010 | var meta = module.exports = {
|
6011 | enable: enable,
|
6012 | fastKey: fastKey,
|
6013 | getWeakData: getWeakData,
|
6014 | onFreeze: onFreeze
|
6015 | };
|
6016 |
|
6017 | hiddenKeys[METADATA] = true;
|
6018 |
|
6019 |
|
6020 | }),
|
6021 |
|
6022 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
6023 |
|
6024 | var fails = __webpack_require__(6);
|
6025 | var isObject = __webpack_require__(17);
|
6026 | var classof = __webpack_require__(13);
|
6027 | var ARRAY_BUFFER_NON_EXTENSIBLE = __webpack_require__(200);
|
6028 |
|
6029 |
|
6030 | var $isExtensible = Object.isExtensible;
|
6031 | var FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); });
|
6032 |
|
6033 |
|
6034 |
|
6035 | module.exports = (FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE) ? function isExtensible(it) {
|
6036 | if (!isObject(it)) return false;
|
6037 | if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) == 'ArrayBuffer') return false;
|
6038 | return $isExtensible ? $isExtensible(it) : true;
|
6039 | } : $isExtensible;
|
6040 |
|
6041 |
|
6042 | }),
|
6043 |
|
6044 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
6045 |
|
6046 |
|
6047 | var fails = __webpack_require__(6);
|
6048 |
|
6049 | module.exports = fails(function () {
|
6050 | if (typeof ArrayBuffer == 'function') {
|
6051 | var buffer = new ArrayBuffer(8);
|
6052 |
|
6053 | if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 });
|
6054 | }
|
6055 | });
|
6056 |
|
6057 |
|
6058 | }),
|
6059 |
|
6060 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
6061 |
|
6062 | var fails = __webpack_require__(6);
|
6063 |
|
6064 | module.exports = !fails(function () {
|
6065 |
|
6066 | return Object.isExtensible(Object.preventExtensions({}));
|
6067 | });
|
6068 |
|
6069 |
|
6070 | }),
|
6071 |
|
6072 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
6073 |
|
6074 | var isCallable = __webpack_require__(18);
|
6075 | var isObject = __webpack_require__(17);
|
6076 | var setPrototypeOf = __webpack_require__(99);
|
6077 |
|
6078 |
|
6079 | module.exports = function ($this, dummy, Wrapper) {
|
6080 | var NewTarget, NewTargetPrototype;
|
6081 | if (
|
6082 |
|
6083 | setPrototypeOf &&
|
6084 |
|
6085 | isCallable(NewTarget = dummy.constructor) &&
|
6086 | NewTarget !== Wrapper &&
|
6087 | isObject(NewTargetPrototype = NewTarget.prototype) &&
|
6088 | NewTargetPrototype !== Wrapper.prototype
|
6089 | ) setPrototypeOf($this, NewTargetPrototype);
|
6090 | return $this;
|
6091 | };
|
6092 |
|
6093 |
|
6094 | }),
|
6095 |
|
6096 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
6097 |
|
6098 | "use strict";
|
6099 |
|
6100 | var defineProperty = (__webpack_require__(41).f);
|
6101 | var create = __webpack_require__(67);
|
6102 | var redefineAll = __webpack_require__(166);
|
6103 | var bind = __webpack_require__(78);
|
6104 | var anInstance = __webpack_require__(167);
|
6105 | var iterate = __webpack_require__(103);
|
6106 | var defineIterator = __webpack_require__(138);
|
6107 | var setSpecies = __webpack_require__(159);
|
6108 | var DESCRIPTORS = __webpack_require__(5);
|
6109 | var fastKey = (__webpack_require__(198).fastKey);
|
6110 | var InternalStateModule = __webpack_require__(45);
|
6111 |
|
6112 | var setInternalState = InternalStateModule.set;
|
6113 | var internalStateGetterFor = InternalStateModule.getterFor;
|
6114 |
|
6115 | module.exports = {
|
6116 | getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
|
6117 | var Constructor = wrapper(function (that, iterable) {
|
6118 | anInstance(that, Prototype);
|
6119 | setInternalState(that, {
|
6120 | type: CONSTRUCTOR_NAME,
|
6121 | index: create(null),
|
6122 | first: undefined,
|
6123 | last: undefined,
|
6124 | size: 0
|
6125 | });
|
6126 | if (!DESCRIPTORS) that.size = 0;
|
6127 | if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
|
6128 | });
|
6129 |
|
6130 | var Prototype = Constructor.prototype;
|
6131 |
|
6132 | var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
6133 |
|
6134 | var define = function (that, key, value) {
|
6135 | var state = getInternalState(that);
|
6136 | var entry = getEntry(that, key);
|
6137 | var previous, index;
|
6138 |
|
6139 | if (entry) {
|
6140 | entry.value = value;
|
6141 |
|
6142 | } else {
|
6143 | state.last = entry = {
|
6144 | index: index = fastKey(key, true),
|
6145 | key: key,
|
6146 | value: value,
|
6147 | previous: previous = state.last,
|
6148 | next: undefined,
|
6149 | removed: false
|
6150 | };
|
6151 | if (!state.first) state.first = entry;
|
6152 | if (previous) previous.next = entry;
|
6153 | if (DESCRIPTORS) state.size++;
|
6154 | else that.size++;
|
6155 |
|
6156 | if (index !== 'F') state.index[index] = entry;
|
6157 | } return that;
|
6158 | };
|
6159 |
|
6160 | var getEntry = function (that, key) {
|
6161 | var state = getInternalState(that);
|
6162 |
|
6163 | var index = fastKey(key);
|
6164 | var entry;
|
6165 | if (index !== 'F') return state.index[index];
|
6166 |
|
6167 | for (entry = state.first; entry; entry = entry.next) {
|
6168 | if (entry.key == key) return entry;
|
6169 | }
|
6170 | };
|
6171 |
|
6172 | redefineAll(Prototype, {
|
6173 |
|
6174 |
|
6175 |
|
6176 | clear: function clear() {
|
6177 | var that = this;
|
6178 | var state = getInternalState(that);
|
6179 | var data = state.index;
|
6180 | var entry = state.first;
|
6181 | while (entry) {
|
6182 | entry.removed = true;
|
6183 | if (entry.previous) entry.previous = entry.previous.next = undefined;
|
6184 | delete data[entry.index];
|
6185 | entry = entry.next;
|
6186 | }
|
6187 | state.first = state.last = undefined;
|
6188 | if (DESCRIPTORS) state.size = 0;
|
6189 | else that.size = 0;
|
6190 | },
|
6191 |
|
6192 |
|
6193 |
|
6194 | 'delete': function (key) {
|
6195 | var that = this;
|
6196 | var state = getInternalState(that);
|
6197 | var entry = getEntry(that, key);
|
6198 | if (entry) {
|
6199 | var next = entry.next;
|
6200 | var prev = entry.previous;
|
6201 | delete state.index[entry.index];
|
6202 | entry.removed = true;
|
6203 | if (prev) prev.next = next;
|
6204 | if (next) next.previous = prev;
|
6205 | if (state.first == entry) state.first = next;
|
6206 | if (state.last == entry) state.last = prev;
|
6207 | if (DESCRIPTORS) state.size--;
|
6208 | else that.size--;
|
6209 | } return !!entry;
|
6210 | },
|
6211 |
|
6212 |
|
6213 |
|
6214 | forEach: function forEach(callbackfn /* , that = undefined */) {
|
6215 | var state = getInternalState(this);
|
6216 | var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
6217 | var entry;
|
6218 | while (entry = entry ? entry.next : state.first) {
|
6219 | boundFunction(entry.value, entry.key, this);
|
6220 |
|
6221 | while (entry && entry.removed) entry = entry.previous;
|
6222 | }
|
6223 | },
|
6224 |
|
6225 |
|
6226 |
|
6227 | has: function has(key) {
|
6228 | return !!getEntry(this, key);
|
6229 | }
|
6230 | });
|
6231 |
|
6232 | redefineAll(Prototype, IS_MAP ? {
|
6233 |
|
6234 |
|
6235 | get: function get(key) {
|
6236 | var entry = getEntry(this, key);
|
6237 | return entry && entry.value;
|
6238 | },
|
6239 |
|
6240 |
|
6241 | set: function set(key, value) {
|
6242 | return define(this, key === 0 ? 0 : key, value);
|
6243 | }
|
6244 | } : {
|
6245 |
|
6246 |
|
6247 | add: function add(value) {
|
6248 | return define(this, value = value === 0 ? 0 : value, value);
|
6249 | }
|
6250 | });
|
6251 | if (DESCRIPTORS) defineProperty(Prototype, 'size', {
|
6252 | get: function () {
|
6253 | return getInternalState(this).size;
|
6254 | }
|
6255 | });
|
6256 | return Constructor;
|
6257 | },
|
6258 | setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) {
|
6259 | var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
|
6260 | var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
6261 | var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
|
6262 |
|
6263 |
|
6264 |
|
6265 |
|
6266 |
|
6267 |
|
6268 |
|
6269 |
|
6270 |
|
6271 | defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) {
|
6272 | setInternalState(this, {
|
6273 | type: ITERATOR_NAME,
|
6274 | target: iterated,
|
6275 | state: getInternalCollectionState(iterated),
|
6276 | kind: kind,
|
6277 | last: undefined
|
6278 | });
|
6279 | }, function () {
|
6280 | var state = getInternalIteratorState(this);
|
6281 | var kind = state.kind;
|
6282 | var entry = state.last;
|
6283 |
|
6284 | while (entry && entry.removed) entry = entry.previous;
|
6285 |
|
6286 | if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
|
6287 |
|
6288 | state.target = undefined;
|
6289 | return { value: undefined, done: true };
|
6290 | }
|
6291 |
|
6292 | if (kind == 'keys') return { value: entry.key, done: false };
|
6293 | if (kind == 'values') return { value: entry.value, done: false };
|
6294 | return { value: [entry.key, entry.value], done: false };
|
6295 | }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
|
6296 |
|
6297 |
|
6298 |
|
6299 |
|
6300 | setSpecies(CONSTRUCTOR_NAME);
|
6301 | }
|
6302 | };
|
6303 |
|
6304 |
|
6305 | }),
|
6306 |
|
6307 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6308 |
|
6309 | var $ = __webpack_require__(2);
|
6310 | var log1p = __webpack_require__(205);
|
6311 |
|
6312 |
|
6313 | var $acosh = Math.acosh;
|
6314 | var log = Math.log;
|
6315 | var sqrt = Math.sqrt;
|
6316 | var LN2 = Math.LN2;
|
6317 |
|
6318 | var FORCED = !$acosh
|
6319 |
|
6320 | || Math.floor($acosh(Number.MAX_VALUE)) != 710
|
6321 |
|
6322 | || $acosh(Infinity) != Infinity;
|
6323 |
|
6324 |
|
6325 |
|
6326 | $({ target: 'Math', stat: true, forced: FORCED }, {
|
6327 | acosh: function acosh(x) {
|
6328 | return (x = +x) < 1 ? NaN : x > 94906265.62425156
|
6329 | ? log(x) + LN2
|
6330 | : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1));
|
6331 | }
|
6332 | });
|
6333 |
|
6334 |
|
6335 | }),
|
6336 |
|
6337 | (function(module) {
|
6338 |
|
6339 | var log = Math.log;
|
6340 |
|
6341 |
|
6342 |
|
6343 |
|
6344 | module.exports = Math.log1p || function log1p(x) {
|
6345 | return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : log(1 + x);
|
6346 | };
|
6347 |
|
6348 |
|
6349 | }),
|
6350 |
|
6351 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6352 |
|
6353 | var $ = __webpack_require__(2);
|
6354 |
|
6355 |
|
6356 | var $asinh = Math.asinh;
|
6357 | var log = Math.log;
|
6358 | var sqrt = Math.sqrt;
|
6359 |
|
6360 | function asinh(x) {
|
6361 | return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : log(x + sqrt(x * x + 1));
|
6362 | }
|
6363 |
|
6364 |
|
6365 |
|
6366 |
|
6367 | $({ target: 'Math', stat: true, forced: !($asinh && 1 / $asinh(0) > 0) }, {
|
6368 | asinh: asinh
|
6369 | });
|
6370 |
|
6371 |
|
6372 | }),
|
6373 |
|
6374 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6375 |
|
6376 | var $ = __webpack_require__(2);
|
6377 |
|
6378 |
|
6379 | var $atanh = Math.atanh;
|
6380 | var log = Math.log;
|
6381 |
|
6382 |
|
6383 |
|
6384 |
|
6385 | $({ target: 'Math', stat: true, forced: !($atanh && 1 / $atanh(-0) < 0) }, {
|
6386 | atanh: function atanh(x) {
|
6387 | return (x = +x) == 0 ? x : log((1 + x) / (1 - x)) / 2;
|
6388 | }
|
6389 | });
|
6390 |
|
6391 |
|
6392 | }),
|
6393 |
|
6394 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6395 |
|
6396 | var $ = __webpack_require__(2);
|
6397 | var sign = __webpack_require__(209);
|
6398 |
|
6399 | var abs = Math.abs;
|
6400 | var pow = Math.pow;
|
6401 |
|
6402 |
|
6403 |
|
6404 | $({ target: 'Math', stat: true }, {
|
6405 | cbrt: function cbrt(x) {
|
6406 | return sign(x = +x) * pow(abs(x), 1 / 3);
|
6407 | }
|
6408 | });
|
6409 |
|
6410 |
|
6411 | }),
|
6412 |
|
6413 | (function(module) {
|
6414 |
|
6415 |
|
6416 |
|
6417 |
|
6418 | module.exports = Math.sign || function sign(x) {
|
6419 |
|
6420 | return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
|
6421 | };
|
6422 |
|
6423 |
|
6424 | }),
|
6425 |
|
6426 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6427 |
|
6428 | var $ = __webpack_require__(2);
|
6429 |
|
6430 | var floor = Math.floor;
|
6431 | var log = Math.log;
|
6432 | var LOG2E = Math.LOG2E;
|
6433 |
|
6434 |
|
6435 |
|
6436 | $({ target: 'Math', stat: true }, {
|
6437 | clz32: function clz32(x) {
|
6438 | return (x >>>= 0) ? 31 - floor(log(x + 0.5) * LOG2E) : 32;
|
6439 | }
|
6440 | });
|
6441 |
|
6442 |
|
6443 | }),
|
6444 |
|
6445 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6446 |
|
6447 | var $ = __webpack_require__(2);
|
6448 | var expm1 = __webpack_require__(212);
|
6449 |
|
6450 |
|
6451 | var $cosh = Math.cosh;
|
6452 | var abs = Math.abs;
|
6453 | var E = Math.E;
|
6454 |
|
6455 |
|
6456 |
|
6457 | $({ target: 'Math', stat: true, forced: !$cosh || $cosh(710) === Infinity }, {
|
6458 | cosh: function cosh(x) {
|
6459 | var t = expm1(abs(x) - 1) + 1;
|
6460 | return (t + 1 / (t * E * E)) * (E / 2);
|
6461 | }
|
6462 | });
|
6463 |
|
6464 |
|
6465 | }),
|
6466 |
|
6467 | (function(module) {
|
6468 |
|
6469 |
|
6470 | var $expm1 = Math.expm1;
|
6471 | var exp = Math.exp;
|
6472 |
|
6473 |
|
6474 |
|
6475 | module.exports = (!$expm1
|
6476 |
|
6477 | || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168
|
6478 |
|
6479 | || $expm1(-2e-17) != -2e-17
|
6480 | ) ? function expm1(x) {
|
6481 | return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : exp(x) - 1;
|
6482 | } : $expm1;
|
6483 |
|
6484 |
|
6485 | }),
|
6486 |
|
6487 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6488 |
|
6489 | var $ = __webpack_require__(2);
|
6490 | var expm1 = __webpack_require__(212);
|
6491 |
|
6492 |
|
6493 |
|
6494 |
|
6495 | $({ target: 'Math', stat: true, forced: expm1 != Math.expm1 }, { expm1: expm1 });
|
6496 |
|
6497 |
|
6498 | }),
|
6499 |
|
6500 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6501 |
|
6502 | var $ = __webpack_require__(2);
|
6503 | var fround = __webpack_require__(215);
|
6504 |
|
6505 |
|
6506 |
|
6507 | $({ target: 'Math', stat: true }, { fround: fround });
|
6508 |
|
6509 |
|
6510 | }),
|
6511 |
|
6512 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
6513 |
|
6514 | var sign = __webpack_require__(209);
|
6515 |
|
6516 | var abs = Math.abs;
|
6517 | var pow = Math.pow;
|
6518 | var EPSILON = pow(2, -52);
|
6519 | var EPSILON32 = pow(2, -23);
|
6520 | var MAX32 = pow(2, 127) * (2 - EPSILON32);
|
6521 | var MIN32 = pow(2, -126);
|
6522 |
|
6523 | var roundTiesToEven = function (n) {
|
6524 | return n + 1 / EPSILON - 1 / EPSILON;
|
6525 | };
|
6526 |
|
6527 |
|
6528 |
|
6529 |
|
6530 | module.exports = Math.fround || function fround(x) {
|
6531 | var $abs = abs(x);
|
6532 | var $sign = sign(x);
|
6533 | var a, result;
|
6534 | if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;
|
6535 | a = (1 + EPSILON32 / EPSILON) * $abs;
|
6536 | result = a - (a - $abs);
|
6537 |
|
6538 | if (result > MAX32 || result != result) return $sign * Infinity;
|
6539 | return $sign * result;
|
6540 | };
|
6541 |
|
6542 |
|
6543 | }),
|
6544 |
|
6545 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6546 |
|
6547 | var $ = __webpack_require__(2);
|
6548 |
|
6549 |
|
6550 | var $hypot = Math.hypot;
|
6551 | var abs = Math.abs;
|
6552 | var sqrt = Math.sqrt;
|
6553 |
|
6554 |
|
6555 |
|
6556 | var BUGGY = !!$hypot && $hypot(Infinity, NaN) !== Infinity;
|
6557 |
|
6558 |
|
6559 |
|
6560 | $({ target: 'Math', stat: true, forced: BUGGY }, {
|
6561 |
|
6562 | hypot: function hypot(value1, value2) {
|
6563 | var sum = 0;
|
6564 | var i = 0;
|
6565 | var aLen = arguments.length;
|
6566 | var larg = 0;
|
6567 | var arg, div;
|
6568 | while (i < aLen) {
|
6569 | arg = abs(arguments[i++]);
|
6570 | if (larg < arg) {
|
6571 | div = larg / arg;
|
6572 | sum = sum * div * div + 1;
|
6573 | larg = arg;
|
6574 | } else if (arg > 0) {
|
6575 | div = arg / larg;
|
6576 | sum += div * div;
|
6577 | } else sum += arg;
|
6578 | }
|
6579 | return larg === Infinity ? Infinity : larg * sqrt(sum);
|
6580 | }
|
6581 | });
|
6582 |
|
6583 |
|
6584 | }),
|
6585 |
|
6586 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6587 |
|
6588 | var $ = __webpack_require__(2);
|
6589 | var fails = __webpack_require__(6);
|
6590 |
|
6591 |
|
6592 | var $imul = Math.imul;
|
6593 |
|
6594 | var FORCED = fails(function () {
|
6595 | return $imul(0xFFFFFFFF, 5) != -5 || $imul.length != 2;
|
6596 | });
|
6597 |
|
6598 |
|
6599 |
|
6600 |
|
6601 | $({ target: 'Math', stat: true, forced: FORCED }, {
|
6602 | imul: function imul(x, y) {
|
6603 | var UINT16 = 0xFFFF;
|
6604 | var xn = +x;
|
6605 | var yn = +y;
|
6606 | var xl = UINT16 & xn;
|
6607 | var yl = UINT16 & yn;
|
6608 | return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);
|
6609 | }
|
6610 | });
|
6611 |
|
6612 |
|
6613 | }),
|
6614 |
|
6615 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6616 |
|
6617 | var $ = __webpack_require__(2);
|
6618 |
|
6619 | var log = Math.log;
|
6620 | var LOG10E = Math.LOG10E;
|
6621 |
|
6622 |
|
6623 |
|
6624 | $({ target: 'Math', stat: true }, {
|
6625 | log10: function log10(x) {
|
6626 | return log(x) * LOG10E;
|
6627 | }
|
6628 | });
|
6629 |
|
6630 |
|
6631 | }),
|
6632 |
|
6633 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6634 |
|
6635 | var $ = __webpack_require__(2);
|
6636 | var log1p = __webpack_require__(205);
|
6637 |
|
6638 |
|
6639 |
|
6640 | $({ target: 'Math', stat: true }, { log1p: log1p });
|
6641 |
|
6642 |
|
6643 | }),
|
6644 |
|
6645 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6646 |
|
6647 | var $ = __webpack_require__(2);
|
6648 |
|
6649 | var log = Math.log;
|
6650 | var LN2 = Math.LN2;
|
6651 |
|
6652 |
|
6653 |
|
6654 | $({ target: 'Math', stat: true }, {
|
6655 | log2: function log2(x) {
|
6656 | return log(x) / LN2;
|
6657 | }
|
6658 | });
|
6659 |
|
6660 |
|
6661 | }),
|
6662 |
|
6663 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6664 |
|
6665 | var $ = __webpack_require__(2);
|
6666 | var sign = __webpack_require__(209);
|
6667 |
|
6668 |
|
6669 |
|
6670 | $({ target: 'Math', stat: true }, {
|
6671 | sign: sign
|
6672 | });
|
6673 |
|
6674 |
|
6675 | }),
|
6676 |
|
6677 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6678 |
|
6679 | var $ = __webpack_require__(2);
|
6680 | var fails = __webpack_require__(6);
|
6681 | var expm1 = __webpack_require__(212);
|
6682 |
|
6683 | var abs = Math.abs;
|
6684 | var exp = Math.exp;
|
6685 | var E = Math.E;
|
6686 |
|
6687 | var FORCED = fails(function () {
|
6688 |
|
6689 | return Math.sinh(-2e-17) != -2e-17;
|
6690 | });
|
6691 |
|
6692 |
|
6693 |
|
6694 |
|
6695 | $({ target: 'Math', stat: true, forced: FORCED }, {
|
6696 | sinh: function sinh(x) {
|
6697 | return abs(x = +x) < 1 ? (expm1(x) - expm1(-x)) / 2 : (exp(x - 1) - exp(-x - 1)) * (E / 2);
|
6698 | }
|
6699 | });
|
6700 |
|
6701 |
|
6702 | }),
|
6703 |
|
6704 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6705 |
|
6706 | var $ = __webpack_require__(2);
|
6707 | var expm1 = __webpack_require__(212);
|
6708 |
|
6709 | var exp = Math.exp;
|
6710 |
|
6711 |
|
6712 |
|
6713 | $({ target: 'Math', stat: true }, {
|
6714 | tanh: function tanh(x) {
|
6715 | var a = expm1(x = +x);
|
6716 | var b = expm1(-x);
|
6717 | return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));
|
6718 | }
|
6719 | });
|
6720 |
|
6721 |
|
6722 | }),
|
6723 |
|
6724 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6725 |
|
6726 | var setToStringTag = __webpack_require__(76);
|
6727 |
|
6728 |
|
6729 |
|
6730 | setToStringTag(Math, 'Math', true);
|
6731 |
|
6732 |
|
6733 | }),
|
6734 |
|
6735 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6736 |
|
6737 | var $ = __webpack_require__(2);
|
6738 |
|
6739 | var ceil = Math.ceil;
|
6740 | var floor = Math.floor;
|
6741 |
|
6742 |
|
6743 |
|
6744 | $({ target: 'Math', stat: true }, {
|
6745 | trunc: function trunc(it) {
|
6746 | return (it > 0 ? floor : ceil)(it);
|
6747 | }
|
6748 | });
|
6749 |
|
6750 |
|
6751 | }),
|
6752 |
|
6753 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6754 |
|
6755 | "use strict";
|
6756 |
|
6757 | var DESCRIPTORS = __webpack_require__(5);
|
6758 | var global = __webpack_require__(3);
|
6759 | var uncurryThis = __webpack_require__(12);
|
6760 | var isForced = __webpack_require__(61);
|
6761 | var redefine = __webpack_require__(43);
|
6762 | var hasOwn = __webpack_require__(35);
|
6763 | var inheritIfRequired = __webpack_require__(202);
|
6764 | var isPrototypeOf = __webpack_require__(21);
|
6765 | var isSymbol = __webpack_require__(19);
|
6766 | var toPrimitive = __webpack_require__(16);
|
6767 | var fails = __webpack_require__(6);
|
6768 | var getOwnPropertyNames = (__webpack_require__(52).f);
|
6769 | var getOwnPropertyDescriptor = (__webpack_require__(4).f);
|
6770 | var defineProperty = (__webpack_require__(41).f);
|
6771 | var thisNumberValue = __webpack_require__(227);
|
6772 | var trim = (__webpack_require__(228).trim);
|
6773 |
|
6774 | var NUMBER = 'Number';
|
6775 | var NativeNumber = global[NUMBER];
|
6776 | var NumberPrototype = NativeNumber.prototype;
|
6777 | var TypeError = global.TypeError;
|
6778 | var arraySlice = uncurryThis(''.slice);
|
6779 | var charCodeAt = uncurryThis(''.charCodeAt);
|
6780 |
|
6781 |
|
6782 |
|
6783 | var toNumeric = function (value) {
|
6784 | var primValue = toPrimitive(value, 'number');
|
6785 | return typeof primValue == 'bigint' ? primValue : toNumber(primValue);
|
6786 | };
|
6787 |
|
6788 |
|
6789 |
|
6790 | var toNumber = function (argument) {
|
6791 | var it = toPrimitive(argument, 'number');
|
6792 | var first, third, radix, maxCode, digits, length, index, code;
|
6793 | if (isSymbol(it)) throw TypeError('Cannot convert a Symbol value to a number');
|
6794 | if (typeof it == 'string' && it.length > 2) {
|
6795 | it = trim(it);
|
6796 | first = charCodeAt(it, 0);
|
6797 | if (first === 43 || first === 45) {
|
6798 | third = charCodeAt(it, 2);
|
6799 | if (third === 88 || third === 120) return NaN;
|
6800 | } else if (first === 48) {
|
6801 | switch (charCodeAt(it, 1)) {
|
6802 | case 66: case 98: radix = 2; maxCode = 49; break;
|
6803 | case 79: case 111: radix = 8; maxCode = 55; break;
|
6804 | default: return +it;
|
6805 | }
|
6806 | digits = arraySlice(it, 2);
|
6807 | length = digits.length;
|
6808 | for (index = 0; index < length; index++) {
|
6809 | code = charCodeAt(digits, index);
|
6810 |
|
6811 |
|
6812 | if (code < 48 || code > maxCode) return NaN;
|
6813 | } return parseInt(digits, radix);
|
6814 | }
|
6815 | } return +it;
|
6816 | };
|
6817 |
|
6818 |
|
6819 |
|
6820 | if (isForced(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'))) {
|
6821 | var NumberWrapper = function Number(value) {
|
6822 | var n = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value));
|
6823 | var dummy = this;
|
6824 |
|
6825 | return isPrototypeOf(NumberPrototype, dummy) && fails(function () { thisNumberValue(dummy); })
|
6826 | ? inheritIfRequired(Object(n), dummy, NumberWrapper) : n;
|
6827 | };
|
6828 | for (var keys = DESCRIPTORS ? getOwnPropertyNames(NativeNumber) : (
|
6829 |
|
6830 | 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
|
6831 |
|
6832 | 'EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,' +
|
6833 |
|
6834 | 'fromString,range'
|
6835 | ).split(','), j = 0, key; keys.length > j; j++) {
|
6836 | if (hasOwn(NativeNumber, key = keys[j]) && !hasOwn(NumberWrapper, key)) {
|
6837 | defineProperty(NumberWrapper, key, getOwnPropertyDescriptor(NativeNumber, key));
|
6838 | }
|
6839 | }
|
6840 | NumberWrapper.prototype = NumberPrototype;
|
6841 | NumberPrototype.constructor = NumberWrapper;
|
6842 | redefine(global, NUMBER, NumberWrapper);
|
6843 | }
|
6844 |
|
6845 |
|
6846 | }),
|
6847 |
|
6848 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
6849 |
|
6850 | var uncurryThis = __webpack_require__(12);
|
6851 |
|
6852 |
|
6853 |
|
6854 | module.exports = uncurryThis(1.0.valueOf);
|
6855 |
|
6856 |
|
6857 | }),
|
6858 |
|
6859 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
6860 |
|
6861 | var uncurryThis = __webpack_require__(12);
|
6862 | var requireObjectCoercible = __webpack_require__(14);
|
6863 | var toString = __webpack_require__(64);
|
6864 | var whitespaces = __webpack_require__(229);
|
6865 |
|
6866 | var replace = uncurryThis(''.replace);
|
6867 | var whitespace = '[' + whitespaces + ']';
|
6868 | var ltrim = RegExp('^' + whitespace + whitespace + '*');
|
6869 | var rtrim = RegExp(whitespace + whitespace + '*$');
|
6870 |
|
6871 |
|
6872 | var createMethod = function (TYPE) {
|
6873 | return function ($this) {
|
6874 | var string = toString(requireObjectCoercible($this));
|
6875 | if (TYPE & 1) string = replace(string, ltrim, '');
|
6876 | if (TYPE & 2) string = replace(string, rtrim, '');
|
6877 | return string;
|
6878 | };
|
6879 | };
|
6880 |
|
6881 | module.exports = {
|
6882 |
|
6883 |
|
6884 | start: createMethod(1),
|
6885 |
|
6886 |
|
6887 | end: createMethod(2),
|
6888 |
|
6889 |
|
6890 | trim: createMethod(3)
|
6891 | };
|
6892 |
|
6893 |
|
6894 | }),
|
6895 |
|
6896 | (function(module) {
|
6897 |
|
6898 |
|
6899 | module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
|
6900 | '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
|
6901 |
|
6902 |
|
6903 | }),
|
6904 |
|
6905 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6906 |
|
6907 | var $ = __webpack_require__(2);
|
6908 |
|
6909 |
|
6910 |
|
6911 | $({ target: 'Number', stat: true }, {
|
6912 | EPSILON: Math.pow(2, -52)
|
6913 | });
|
6914 |
|
6915 |
|
6916 | }),
|
6917 |
|
6918 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6919 |
|
6920 | var $ = __webpack_require__(2);
|
6921 | var numberIsFinite = __webpack_require__(232);
|
6922 |
|
6923 |
|
6924 |
|
6925 | $({ target: 'Number', stat: true }, { isFinite: numberIsFinite });
|
6926 |
|
6927 |
|
6928 | }),
|
6929 |
|
6930 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
6931 |
|
6932 | var global = __webpack_require__(3);
|
6933 |
|
6934 | var globalIsFinite = global.isFinite;
|
6935 |
|
6936 |
|
6937 |
|
6938 |
|
6939 | module.exports = Number.isFinite || function isFinite(it) {
|
6940 | return typeof it == 'number' && globalIsFinite(it);
|
6941 | };
|
6942 |
|
6943 |
|
6944 | }),
|
6945 |
|
6946 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6947 |
|
6948 | var $ = __webpack_require__(2);
|
6949 | var isIntegralNumber = __webpack_require__(234);
|
6950 |
|
6951 |
|
6952 |
|
6953 | $({ target: 'Number', stat: true }, {
|
6954 | isInteger: isIntegralNumber
|
6955 | });
|
6956 |
|
6957 |
|
6958 | }),
|
6959 |
|
6960 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
6961 |
|
6962 | var isObject = __webpack_require__(17);
|
6963 |
|
6964 | var floor = Math.floor;
|
6965 |
|
6966 |
|
6967 |
|
6968 |
|
6969 | module.exports = Number.isInteger || function isInteger(it) {
|
6970 | return !isObject(it) && isFinite(it) && floor(it) === it;
|
6971 | };
|
6972 |
|
6973 |
|
6974 | }),
|
6975 |
|
6976 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6977 |
|
6978 | var $ = __webpack_require__(2);
|
6979 |
|
6980 |
|
6981 |
|
6982 | $({ target: 'Number', stat: true }, {
|
6983 | isNaN: function isNaN(number) {
|
6984 |
|
6985 | return number != number;
|
6986 | }
|
6987 | });
|
6988 |
|
6989 |
|
6990 | }),
|
6991 |
|
6992 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
6993 |
|
6994 | var $ = __webpack_require__(2);
|
6995 | var isIntegralNumber = __webpack_require__(234);
|
6996 |
|
6997 | var abs = Math.abs;
|
6998 |
|
6999 |
|
7000 |
|
7001 | $({ target: 'Number', stat: true }, {
|
7002 | isSafeInteger: function isSafeInteger(number) {
|
7003 | return isIntegralNumber(number) && abs(number) <= 0x1FFFFFFFFFFFFF;
|
7004 | }
|
7005 | });
|
7006 |
|
7007 |
|
7008 | }),
|
7009 |
|
7010 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7011 |
|
7012 | var $ = __webpack_require__(2);
|
7013 |
|
7014 |
|
7015 |
|
7016 | $({ target: 'Number', stat: true }, {
|
7017 | MAX_SAFE_INTEGER: 0x1FFFFFFFFFFFFF
|
7018 | });
|
7019 |
|
7020 |
|
7021 | }),
|
7022 |
|
7023 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7024 |
|
7025 | var $ = __webpack_require__(2);
|
7026 |
|
7027 |
|
7028 |
|
7029 | $({ target: 'Number', stat: true }, {
|
7030 | MIN_SAFE_INTEGER: -0x1FFFFFFFFFFFFF
|
7031 | });
|
7032 |
|
7033 |
|
7034 | }),
|
7035 |
|
7036 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7037 |
|
7038 | var $ = __webpack_require__(2);
|
7039 | var parseFloat = __webpack_require__(240);
|
7040 |
|
7041 |
|
7042 |
|
7043 |
|
7044 | $({ target: 'Number', stat: true, forced: Number.parseFloat != parseFloat }, {
|
7045 | parseFloat: parseFloat
|
7046 | });
|
7047 |
|
7048 |
|
7049 | }),
|
7050 |
|
7051 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
7052 |
|
7053 | var global = __webpack_require__(3);
|
7054 | var fails = __webpack_require__(6);
|
7055 | var uncurryThis = __webpack_require__(12);
|
7056 | var toString = __webpack_require__(64);
|
7057 | var trim = (__webpack_require__(228).trim);
|
7058 | var whitespaces = __webpack_require__(229);
|
7059 |
|
7060 | var charAt = uncurryThis(''.charAt);
|
7061 | var n$ParseFloat = global.parseFloat;
|
7062 | var Symbol = global.Symbol;
|
7063 | var ITERATOR = Symbol && Symbol.iterator;
|
7064 | var FORCED = 1 / n$ParseFloat(whitespaces + '-0') !== -Infinity
|
7065 |
|
7066 | || (ITERATOR && !fails(function () { n$ParseFloat(Object(ITERATOR)); }));
|
7067 |
|
7068 |
|
7069 |
|
7070 | module.exports = FORCED ? function parseFloat(string) {
|
7071 | var trimmedString = trim(toString(string));
|
7072 | var result = n$ParseFloat(trimmedString);
|
7073 | return result === 0 && charAt(trimmedString, 0) == '-' ? -0 : result;
|
7074 | } : n$ParseFloat;
|
7075 |
|
7076 |
|
7077 | }),
|
7078 |
|
7079 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7080 |
|
7081 | var $ = __webpack_require__(2);
|
7082 | var parseInt = __webpack_require__(242);
|
7083 |
|
7084 |
|
7085 |
|
7086 |
|
7087 | $({ target: 'Number', stat: true, forced: Number.parseInt != parseInt }, {
|
7088 | parseInt: parseInt
|
7089 | });
|
7090 |
|
7091 |
|
7092 | }),
|
7093 |
|
7094 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
7095 |
|
7096 | var global = __webpack_require__(3);
|
7097 | var fails = __webpack_require__(6);
|
7098 | var uncurryThis = __webpack_require__(12);
|
7099 | var toString = __webpack_require__(64);
|
7100 | var trim = (__webpack_require__(228).trim);
|
7101 | var whitespaces = __webpack_require__(229);
|
7102 |
|
7103 | var $parseInt = global.parseInt;
|
7104 | var Symbol = global.Symbol;
|
7105 | var ITERATOR = Symbol && Symbol.iterator;
|
7106 | var hex = /^[+-]?0x/i;
|
7107 | var exec = uncurryThis(hex.exec);
|
7108 | var FORCED = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22
|
7109 |
|
7110 | || (ITERATOR && !fails(function () { $parseInt(Object(ITERATOR)); }));
|
7111 |
|
7112 |
|
7113 |
|
7114 | module.exports = FORCED ? function parseInt(string, radix) {
|
7115 | var S = trim(toString(string));
|
7116 | return $parseInt(S, (radix >>> 0) || (exec(hex, S) ? 16 : 10));
|
7117 | } : $parseInt;
|
7118 |
|
7119 |
|
7120 | }),
|
7121 |
|
7122 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7123 |
|
7124 | "use strict";
|
7125 |
|
7126 | var $ = __webpack_require__(2);
|
7127 | var global = __webpack_require__(3);
|
7128 | var uncurryThis = __webpack_require__(12);
|
7129 | var toIntegerOrInfinity = __webpack_require__(56);
|
7130 | var thisNumberValue = __webpack_require__(227);
|
7131 | var $repeat = __webpack_require__(183);
|
7132 | var fails = __webpack_require__(6);
|
7133 |
|
7134 | var RangeError = global.RangeError;
|
7135 | var String = global.String;
|
7136 | var floor = Math.floor;
|
7137 | var repeat = uncurryThis($repeat);
|
7138 | var stringSlice = uncurryThis(''.slice);
|
7139 | var un$ToFixed = uncurryThis(1.0.toFixed);
|
7140 |
|
7141 | var pow = function (x, n, acc) {
|
7142 | return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);
|
7143 | };
|
7144 |
|
7145 | var log = function (x) {
|
7146 | var n = 0;
|
7147 | var x2 = x;
|
7148 | while (x2 >= 4096) {
|
7149 | n += 12;
|
7150 | x2 /= 4096;
|
7151 | }
|
7152 | while (x2 >= 2) {
|
7153 | n += 1;
|
7154 | x2 /= 2;
|
7155 | } return n;
|
7156 | };
|
7157 |
|
7158 | var multiply = function (data, n, c) {
|
7159 | var index = -1;
|
7160 | var c2 = c;
|
7161 | while (++index < 6) {
|
7162 | c2 += n * data[index];
|
7163 | data[index] = c2 % 1e7;
|
7164 | c2 = floor(c2 / 1e7);
|
7165 | }
|
7166 | };
|
7167 |
|
7168 | var divide = function (data, n) {
|
7169 | var index = 6;
|
7170 | var c = 0;
|
7171 | while (--index >= 0) {
|
7172 | c += data[index];
|
7173 | data[index] = floor(c / n);
|
7174 | c = (c % n) * 1e7;
|
7175 | }
|
7176 | };
|
7177 |
|
7178 | var dataToString = function (data) {
|
7179 | var index = 6;
|
7180 | var s = '';
|
7181 | while (--index >= 0) {
|
7182 | if (s !== '' || index === 0 || data[index] !== 0) {
|
7183 | var t = String(data[index]);
|
7184 | s = s === '' ? t : s + repeat('0', 7 - t.length) + t;
|
7185 | }
|
7186 | } return s;
|
7187 | };
|
7188 |
|
7189 | var FORCED = fails(function () {
|
7190 | return un$ToFixed(0.00008, 3) !== '0.000' ||
|
7191 | un$ToFixed(0.9, 0) !== '1' ||
|
7192 | un$ToFixed(1.255, 2) !== '1.25' ||
|
7193 | un$ToFixed(1000000000000000128.0, 0) !== '1000000000000000128';
|
7194 | }) || !fails(function () {
|
7195 |
|
7196 | un$ToFixed({});
|
7197 | });
|
7198 |
|
7199 |
|
7200 |
|
7201 | $({ target: 'Number', proto: true, forced: FORCED }, {
|
7202 | toFixed: function toFixed(fractionDigits) {
|
7203 | var number = thisNumberValue(this);
|
7204 | var fractDigits = toIntegerOrInfinity(fractionDigits);
|
7205 | var data = [0, 0, 0, 0, 0, 0];
|
7206 | var sign = '';
|
7207 | var result = '0';
|
7208 | var e, z, j, k;
|
7209 |
|
7210 | if (fractDigits < 0 || fractDigits > 20) throw RangeError('Incorrect fraction digits');
|
7211 |
|
7212 | if (number != number) return 'NaN';
|
7213 | if (number <= -1e21 || number >= 1e21) return String(number);
|
7214 | if (number < 0) {
|
7215 | sign = '-';
|
7216 | number = -number;
|
7217 | }
|
7218 | if (number > 1e-21) {
|
7219 | e = log(number * pow(2, 69, 1)) - 69;
|
7220 | z = e < 0 ? number * pow(2, -e, 1) : number / pow(2, e, 1);
|
7221 | z *= 0x10000000000000;
|
7222 | e = 52 - e;
|
7223 | if (e > 0) {
|
7224 | multiply(data, 0, z);
|
7225 | j = fractDigits;
|
7226 | while (j >= 7) {
|
7227 | multiply(data, 1e7, 0);
|
7228 | j -= 7;
|
7229 | }
|
7230 | multiply(data, pow(10, j, 1), 0);
|
7231 | j = e - 1;
|
7232 | while (j >= 23) {
|
7233 | divide(data, 1 << 23);
|
7234 | j -= 23;
|
7235 | }
|
7236 | divide(data, 1 << j);
|
7237 | multiply(data, 1, 1);
|
7238 | divide(data, 2);
|
7239 | result = dataToString(data);
|
7240 | } else {
|
7241 | multiply(data, 0, z);
|
7242 | multiply(data, 1 << -e, 0);
|
7243 | result = dataToString(data) + repeat('0', fractDigits);
|
7244 | }
|
7245 | }
|
7246 | if (fractDigits > 0) {
|
7247 | k = result.length;
|
7248 | result = sign + (k <= fractDigits
|
7249 | ? '0.' + repeat('0', fractDigits - k) + result
|
7250 | : stringSlice(result, 0, k - fractDigits) + '.' + stringSlice(result, k - fractDigits));
|
7251 | } else {
|
7252 | result = sign + result;
|
7253 | } return result;
|
7254 | }
|
7255 | });
|
7256 |
|
7257 |
|
7258 | }),
|
7259 |
|
7260 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7261 |
|
7262 | "use strict";
|
7263 |
|
7264 | var $ = __webpack_require__(2);
|
7265 | var uncurryThis = __webpack_require__(12);
|
7266 | var fails = __webpack_require__(6);
|
7267 | var thisNumberValue = __webpack_require__(227);
|
7268 |
|
7269 | var un$ToPrecision = uncurryThis(1.0.toPrecision);
|
7270 |
|
7271 | var FORCED = fails(function () {
|
7272 |
|
7273 | return un$ToPrecision(1, undefined) !== '1';
|
7274 | }) || !fails(function () {
|
7275 |
|
7276 | un$ToPrecision({});
|
7277 | });
|
7278 |
|
7279 |
|
7280 |
|
7281 | $({ target: 'Number', proto: true, forced: FORCED }, {
|
7282 | toPrecision: function toPrecision(precision) {
|
7283 | return precision === undefined
|
7284 | ? un$ToPrecision(thisNumberValue(this))
|
7285 | : un$ToPrecision(thisNumberValue(this), precision);
|
7286 | }
|
7287 | });
|
7288 |
|
7289 |
|
7290 | }),
|
7291 |
|
7292 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7293 |
|
7294 | var $ = __webpack_require__(2);
|
7295 | var assign = __webpack_require__(246);
|
7296 |
|
7297 |
|
7298 |
|
7299 |
|
7300 | $({ target: 'Object', stat: true, forced: Object.assign !== assign }, {
|
7301 | assign: assign
|
7302 | });
|
7303 |
|
7304 |
|
7305 | }),
|
7306 |
|
7307 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
7308 |
|
7309 | "use strict";
|
7310 |
|
7311 | var DESCRIPTORS = __webpack_require__(5);
|
7312 | var uncurryThis = __webpack_require__(12);
|
7313 | var call = __webpack_require__(7);
|
7314 | var fails = __webpack_require__(6);
|
7315 | var objectKeys = __webpack_require__(69);
|
7316 | var getOwnPropertySymbolsModule = __webpack_require__(60);
|
7317 | var propertyIsEnumerableModule = __webpack_require__(8);
|
7318 | var toObject = __webpack_require__(36);
|
7319 | var IndexedObject = __webpack_require__(11);
|
7320 |
|
7321 |
|
7322 | var $assign = Object.assign;
|
7323 |
|
7324 | var defineProperty = Object.defineProperty;
|
7325 | var concat = uncurryThis([].concat);
|
7326 |
|
7327 |
|
7328 |
|
7329 | module.exports = !$assign || fails(function () {
|
7330 |
|
7331 | if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
|
7332 | enumerable: true,
|
7333 | get: function () {
|
7334 | defineProperty(this, 'b', {
|
7335 | value: 3,
|
7336 | enumerable: false
|
7337 | });
|
7338 | }
|
7339 | }), { b: 2 })).b !== 1) return true;
|
7340 |
|
7341 | var A = {};
|
7342 | var B = {};
|
7343 |
|
7344 | var symbol = Symbol();
|
7345 | var alphabet = 'abcdefghijklmnopqrst';
|
7346 | A[symbol] = 7;
|
7347 | alphabet.split('').forEach(function (chr) { B[chr] = chr; });
|
7348 | return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
|
7349 | }) ? function assign(target, source) {
|
7350 | var T = toObject(target);
|
7351 | var argumentsLength = arguments.length;
|
7352 | var index = 1;
|
7353 | var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
7354 | var propertyIsEnumerable = propertyIsEnumerableModule.f;
|
7355 | while (argumentsLength > index) {
|
7356 | var S = IndexedObject(arguments[index++]);
|
7357 | var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
|
7358 | var length = keys.length;
|
7359 | var j = 0;
|
7360 | var key;
|
7361 | while (length > j) {
|
7362 | key = keys[j++];
|
7363 | if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
|
7364 | }
|
7365 | } return T;
|
7366 | } : $assign;
|
7367 |
|
7368 |
|
7369 | }),
|
7370 |
|
7371 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7372 |
|
7373 | var $ = __webpack_require__(2);
|
7374 | var DESCRIPTORS = __webpack_require__(5);
|
7375 | var create = __webpack_require__(67);
|
7376 |
|
7377 |
|
7378 |
|
7379 | $({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {
|
7380 | create: create
|
7381 | });
|
7382 |
|
7383 |
|
7384 | }),
|
7385 |
|
7386 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7387 |
|
7388 | "use strict";
|
7389 |
|
7390 | var $ = __webpack_require__(2);
|
7391 | var DESCRIPTORS = __webpack_require__(5);
|
7392 | var FORCED = __webpack_require__(249);
|
7393 | var aCallable = __webpack_require__(27);
|
7394 | var toObject = __webpack_require__(36);
|
7395 | var definePropertyModule = __webpack_require__(41);
|
7396 |
|
7397 |
|
7398 |
|
7399 | if (DESCRIPTORS) {
|
7400 | $({ target: 'Object', proto: true, forced: FORCED }, {
|
7401 | __defineGetter__: function __defineGetter__(P, getter) {
|
7402 | definePropertyModule.f(toObject(this), P, { get: aCallable(getter), enumerable: true, configurable: true });
|
7403 | }
|
7404 | });
|
7405 | }
|
7406 |
|
7407 |
|
7408 | }),
|
7409 |
|
7410 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
7411 |
|
7412 | "use strict";
|
7413 |
|
7414 | var IS_PURE = __webpack_require__(32);
|
7415 | var global = __webpack_require__(3);
|
7416 | var fails = __webpack_require__(6);
|
7417 | var WEBKIT = __webpack_require__(157);
|
7418 |
|
7419 |
|
7420 | module.exports = IS_PURE || !fails(function () {
|
7421 |
|
7422 |
|
7423 | if (WEBKIT && WEBKIT < 535) return;
|
7424 | var key = Math.random();
|
7425 |
|
7426 |
|
7427 | __defineSetter__.call(null, key, function () { });
|
7428 | delete global[key];
|
7429 | });
|
7430 |
|
7431 |
|
7432 | }),
|
7433 |
|
7434 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7435 |
|
7436 | var $ = __webpack_require__(2);
|
7437 | var DESCRIPTORS = __webpack_require__(5);
|
7438 | var defineProperties = __webpack_require__(68);
|
7439 |
|
7440 |
|
7441 |
|
7442 | $({ target: 'Object', stat: true, forced: !DESCRIPTORS, sham: !DESCRIPTORS }, {
|
7443 | defineProperties: defineProperties
|
7444 | });
|
7445 |
|
7446 |
|
7447 | }),
|
7448 |
|
7449 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7450 |
|
7451 | var $ = __webpack_require__(2);
|
7452 | var DESCRIPTORS = __webpack_require__(5);
|
7453 | var objectDefinePropertyModile = __webpack_require__(41);
|
7454 |
|
7455 |
|
7456 |
|
7457 | $({ target: 'Object', stat: true, forced: !DESCRIPTORS, sham: !DESCRIPTORS }, {
|
7458 | defineProperty: objectDefinePropertyModile.f
|
7459 | });
|
7460 |
|
7461 |
|
7462 | }),
|
7463 |
|
7464 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7465 |
|
7466 | "use strict";
|
7467 |
|
7468 | var $ = __webpack_require__(2);
|
7469 | var DESCRIPTORS = __webpack_require__(5);
|
7470 | var FORCED = __webpack_require__(249);
|
7471 | var aCallable = __webpack_require__(27);
|
7472 | var toObject = __webpack_require__(36);
|
7473 | var definePropertyModule = __webpack_require__(41);
|
7474 |
|
7475 |
|
7476 |
|
7477 | if (DESCRIPTORS) {
|
7478 | $({ target: 'Object', proto: true, forced: FORCED }, {
|
7479 | __defineSetter__: function __defineSetter__(P, setter) {
|
7480 | definePropertyModule.f(toObject(this), P, { set: aCallable(setter), enumerable: true, configurable: true });
|
7481 | }
|
7482 | });
|
7483 | }
|
7484 |
|
7485 |
|
7486 | }),
|
7487 |
|
7488 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7489 |
|
7490 | var $ = __webpack_require__(2);
|
7491 | var $entries = (__webpack_require__(254).entries);
|
7492 |
|
7493 |
|
7494 |
|
7495 | $({ target: 'Object', stat: true }, {
|
7496 | entries: function entries(O) {
|
7497 | return $entries(O);
|
7498 | }
|
7499 | });
|
7500 |
|
7501 |
|
7502 | }),
|
7503 |
|
7504 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
7505 |
|
7506 | var DESCRIPTORS = __webpack_require__(5);
|
7507 | var uncurryThis = __webpack_require__(12);
|
7508 | var objectKeys = __webpack_require__(69);
|
7509 | var toIndexedObject = __webpack_require__(10);
|
7510 | var $propertyIsEnumerable = (__webpack_require__(8).f);
|
7511 |
|
7512 | var propertyIsEnumerable = uncurryThis($propertyIsEnumerable);
|
7513 | var push = uncurryThis([].push);
|
7514 |
|
7515 |
|
7516 | var createMethod = function (TO_ENTRIES) {
|
7517 | return function (it) {
|
7518 | var O = toIndexedObject(it);
|
7519 | var keys = objectKeys(O);
|
7520 | var length = keys.length;
|
7521 | var i = 0;
|
7522 | var result = [];
|
7523 | var key;
|
7524 | while (length > i) {
|
7525 | key = keys[i++];
|
7526 | if (!DESCRIPTORS || propertyIsEnumerable(O, key)) {
|
7527 | push(result, TO_ENTRIES ? [key, O[key]] : O[key]);
|
7528 | }
|
7529 | }
|
7530 | return result;
|
7531 | };
|
7532 | };
|
7533 |
|
7534 | module.exports = {
|
7535 |
|
7536 |
|
7537 | entries: createMethod(true),
|
7538 |
|
7539 |
|
7540 | values: createMethod(false)
|
7541 | };
|
7542 |
|
7543 |
|
7544 | }),
|
7545 |
|
7546 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7547 |
|
7548 | var $ = __webpack_require__(2);
|
7549 | var FREEZING = __webpack_require__(201);
|
7550 | var fails = __webpack_require__(6);
|
7551 | var isObject = __webpack_require__(17);
|
7552 | var onFreeze = (__webpack_require__(198).onFreeze);
|
7553 |
|
7554 |
|
7555 | var $freeze = Object.freeze;
|
7556 | var FAILS_ON_PRIMITIVES = fails(function () { $freeze(1); });
|
7557 |
|
7558 |
|
7559 |
|
7560 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, {
|
7561 | freeze: function freeze(it) {
|
7562 | return $freeze && isObject(it) ? $freeze(onFreeze(it)) : it;
|
7563 | }
|
7564 | });
|
7565 |
|
7566 |
|
7567 | }),
|
7568 |
|
7569 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7570 |
|
7571 | var $ = __webpack_require__(2);
|
7572 | var iterate = __webpack_require__(103);
|
7573 | var createProperty = __webpack_require__(114);
|
7574 |
|
7575 |
|
7576 |
|
7577 | $({ target: 'Object', stat: true }, {
|
7578 | fromEntries: function fromEntries(iterable) {
|
7579 | var obj = {};
|
7580 | iterate(iterable, function (k, v) {
|
7581 | createProperty(obj, k, v);
|
7582 | }, { AS_ENTRIES: true });
|
7583 | return obj;
|
7584 | }
|
7585 | });
|
7586 |
|
7587 |
|
7588 | }),
|
7589 |
|
7590 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7591 |
|
7592 | var $ = __webpack_require__(2);
|
7593 | var fails = __webpack_require__(6);
|
7594 | var toIndexedObject = __webpack_require__(10);
|
7595 | var nativeGetOwnPropertyDescriptor = (__webpack_require__(4).f);
|
7596 | var DESCRIPTORS = __webpack_require__(5);
|
7597 |
|
7598 | var FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); });
|
7599 | var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES;
|
7600 |
|
7601 |
|
7602 |
|
7603 | $({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, {
|
7604 | getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
|
7605 | return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);
|
7606 | }
|
7607 | });
|
7608 |
|
7609 |
|
7610 | }),
|
7611 |
|
7612 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7613 |
|
7614 | var $ = __webpack_require__(2);
|
7615 | var DESCRIPTORS = __webpack_require__(5);
|
7616 | var ownKeys = __webpack_require__(51);
|
7617 | var toIndexedObject = __webpack_require__(10);
|
7618 | var getOwnPropertyDescriptorModule = __webpack_require__(4);
|
7619 | var createProperty = __webpack_require__(114);
|
7620 |
|
7621 |
|
7622 |
|
7623 | $({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {
|
7624 | getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
|
7625 | var O = toIndexedObject(object);
|
7626 | var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
7627 | var keys = ownKeys(O);
|
7628 | var result = {};
|
7629 | var index = 0;
|
7630 | var key, descriptor;
|
7631 | while (keys.length > index) {
|
7632 | descriptor = getOwnPropertyDescriptor(O, key = keys[index++]);
|
7633 | if (descriptor !== undefined) createProperty(result, key, descriptor);
|
7634 | }
|
7635 | return result;
|
7636 | }
|
7637 | });
|
7638 |
|
7639 |
|
7640 | }),
|
7641 |
|
7642 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7643 |
|
7644 | var $ = __webpack_require__(2);
|
7645 | var fails = __webpack_require__(6);
|
7646 | var getOwnPropertyNames = (__webpack_require__(71).f);
|
7647 |
|
7648 |
|
7649 | var FAILS_ON_PRIMITIVES = fails(function () { return !Object.getOwnPropertyNames(1); });
|
7650 |
|
7651 |
|
7652 |
|
7653 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
|
7654 | getOwnPropertyNames: getOwnPropertyNames
|
7655 | });
|
7656 |
|
7657 |
|
7658 | }),
|
7659 |
|
7660 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7661 |
|
7662 | var $ = __webpack_require__(2);
|
7663 | var fails = __webpack_require__(6);
|
7664 | var toObject = __webpack_require__(36);
|
7665 | var nativeGetPrototypeOf = __webpack_require__(97);
|
7666 | var CORRECT_PROTOTYPE_GETTER = __webpack_require__(98);
|
7667 |
|
7668 | var FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); });
|
7669 |
|
7670 |
|
7671 |
|
7672 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {
|
7673 | getPrototypeOf: function getPrototypeOf(it) {
|
7674 | return nativeGetPrototypeOf(toObject(it));
|
7675 | }
|
7676 | });
|
7677 |
|
7678 |
|
7679 |
|
7680 | }),
|
7681 |
|
7682 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7683 |
|
7684 | var $ = __webpack_require__(2);
|
7685 | var hasOwn = __webpack_require__(35);
|
7686 |
|
7687 |
|
7688 |
|
7689 | $({ target: 'Object', stat: true }, {
|
7690 | hasOwn: hasOwn
|
7691 | });
|
7692 |
|
7693 |
|
7694 | }),
|
7695 |
|
7696 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7697 |
|
7698 | var $ = __webpack_require__(2);
|
7699 | var is = __webpack_require__(263);
|
7700 |
|
7701 |
|
7702 |
|
7703 | $({ target: 'Object', stat: true }, {
|
7704 | is: is
|
7705 | });
|
7706 |
|
7707 |
|
7708 | }),
|
7709 |
|
7710 | (function(module) {
|
7711 |
|
7712 |
|
7713 |
|
7714 |
|
7715 | module.exports = Object.is || function is(x, y) {
|
7716 |
|
7717 | return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
|
7718 | };
|
7719 |
|
7720 |
|
7721 | }),
|
7722 |
|
7723 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7724 |
|
7725 | var $ = __webpack_require__(2);
|
7726 | var $isExtensible = __webpack_require__(199);
|
7727 |
|
7728 |
|
7729 |
|
7730 |
|
7731 | $({ target: 'Object', stat: true, forced: Object.isExtensible !== $isExtensible }, {
|
7732 | isExtensible: $isExtensible
|
7733 | });
|
7734 |
|
7735 |
|
7736 | }),
|
7737 |
|
7738 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7739 |
|
7740 | var $ = __webpack_require__(2);
|
7741 | var fails = __webpack_require__(6);
|
7742 | var isObject = __webpack_require__(17);
|
7743 | var classof = __webpack_require__(13);
|
7744 | var ARRAY_BUFFER_NON_EXTENSIBLE = __webpack_require__(200);
|
7745 |
|
7746 |
|
7747 | var $isFrozen = Object.isFrozen;
|
7748 | var FAILS_ON_PRIMITIVES = fails(function () { $isFrozen(1); });
|
7749 |
|
7750 |
|
7751 |
|
7752 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE }, {
|
7753 | isFrozen: function isFrozen(it) {
|
7754 | if (!isObject(it)) return true;
|
7755 | if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) == 'ArrayBuffer') return true;
|
7756 | return $isFrozen ? $isFrozen(it) : false;
|
7757 | }
|
7758 | });
|
7759 |
|
7760 |
|
7761 | }),
|
7762 |
|
7763 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7764 |
|
7765 | var $ = __webpack_require__(2);
|
7766 | var fails = __webpack_require__(6);
|
7767 | var isObject = __webpack_require__(17);
|
7768 | var classof = __webpack_require__(13);
|
7769 | var ARRAY_BUFFER_NON_EXTENSIBLE = __webpack_require__(200);
|
7770 |
|
7771 |
|
7772 | var $isSealed = Object.isSealed;
|
7773 | var FAILS_ON_PRIMITIVES = fails(function () { $isSealed(1); });
|
7774 |
|
7775 |
|
7776 |
|
7777 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE }, {
|
7778 | isSealed: function isSealed(it) {
|
7779 | if (!isObject(it)) return true;
|
7780 | if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) == 'ArrayBuffer') return true;
|
7781 | return $isSealed ? $isSealed(it) : false;
|
7782 | }
|
7783 | });
|
7784 |
|
7785 |
|
7786 | }),
|
7787 |
|
7788 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7789 |
|
7790 | var $ = __webpack_require__(2);
|
7791 | var toObject = __webpack_require__(36);
|
7792 | var nativeKeys = __webpack_require__(69);
|
7793 | var fails = __webpack_require__(6);
|
7794 |
|
7795 | var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });
|
7796 |
|
7797 |
|
7798 |
|
7799 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
|
7800 | keys: function keys(it) {
|
7801 | return nativeKeys(toObject(it));
|
7802 | }
|
7803 | });
|
7804 |
|
7805 |
|
7806 | }),
|
7807 |
|
7808 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7809 |
|
7810 | "use strict";
|
7811 |
|
7812 | var $ = __webpack_require__(2);
|
7813 | var DESCRIPTORS = __webpack_require__(5);
|
7814 | var FORCED = __webpack_require__(249);
|
7815 | var toObject = __webpack_require__(36);
|
7816 | var toPropertyKey = __webpack_require__(15);
|
7817 | var getPrototypeOf = __webpack_require__(97);
|
7818 | var getOwnPropertyDescriptor = (__webpack_require__(4).f);
|
7819 |
|
7820 |
|
7821 |
|
7822 | if (DESCRIPTORS) {
|
7823 | $({ target: 'Object', proto: true, forced: FORCED }, {
|
7824 | __lookupGetter__: function __lookupGetter__(P) {
|
7825 | var O = toObject(this);
|
7826 | var key = toPropertyKey(P);
|
7827 | var desc;
|
7828 | do {
|
7829 | if (desc = getOwnPropertyDescriptor(O, key)) return desc.get;
|
7830 | } while (O = getPrototypeOf(O));
|
7831 | }
|
7832 | });
|
7833 | }
|
7834 |
|
7835 |
|
7836 | }),
|
7837 |
|
7838 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7839 |
|
7840 | "use strict";
|
7841 |
|
7842 | var $ = __webpack_require__(2);
|
7843 | var DESCRIPTORS = __webpack_require__(5);
|
7844 | var FORCED = __webpack_require__(249);
|
7845 | var toObject = __webpack_require__(36);
|
7846 | var toPropertyKey = __webpack_require__(15);
|
7847 | var getPrototypeOf = __webpack_require__(97);
|
7848 | var getOwnPropertyDescriptor = (__webpack_require__(4).f);
|
7849 |
|
7850 |
|
7851 |
|
7852 | if (DESCRIPTORS) {
|
7853 | $({ target: 'Object', proto: true, forced: FORCED }, {
|
7854 | __lookupSetter__: function __lookupSetter__(P) {
|
7855 | var O = toObject(this);
|
7856 | var key = toPropertyKey(P);
|
7857 | var desc;
|
7858 | do {
|
7859 | if (desc = getOwnPropertyDescriptor(O, key)) return desc.set;
|
7860 | } while (O = getPrototypeOf(O));
|
7861 | }
|
7862 | });
|
7863 | }
|
7864 |
|
7865 |
|
7866 | }),
|
7867 |
|
7868 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7869 |
|
7870 | var $ = __webpack_require__(2);
|
7871 | var isObject = __webpack_require__(17);
|
7872 | var onFreeze = (__webpack_require__(198).onFreeze);
|
7873 | var FREEZING = __webpack_require__(201);
|
7874 | var fails = __webpack_require__(6);
|
7875 |
|
7876 |
|
7877 | var $preventExtensions = Object.preventExtensions;
|
7878 | var FAILS_ON_PRIMITIVES = fails(function () { $preventExtensions(1); });
|
7879 |
|
7880 |
|
7881 |
|
7882 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, {
|
7883 | preventExtensions: function preventExtensions(it) {
|
7884 | return $preventExtensions && isObject(it) ? $preventExtensions(onFreeze(it)) : it;
|
7885 | }
|
7886 | });
|
7887 |
|
7888 |
|
7889 | }),
|
7890 |
|
7891 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7892 |
|
7893 | var $ = __webpack_require__(2);
|
7894 | var isObject = __webpack_require__(17);
|
7895 | var onFreeze = (__webpack_require__(198).onFreeze);
|
7896 | var FREEZING = __webpack_require__(201);
|
7897 | var fails = __webpack_require__(6);
|
7898 |
|
7899 |
|
7900 | var $seal = Object.seal;
|
7901 | var FAILS_ON_PRIMITIVES = fails(function () { $seal(1); });
|
7902 |
|
7903 |
|
7904 |
|
7905 | $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, {
|
7906 | seal: function seal(it) {
|
7907 | return $seal && isObject(it) ? $seal(onFreeze(it)) : it;
|
7908 | }
|
7909 | });
|
7910 |
|
7911 |
|
7912 | }),
|
7913 |
|
7914 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7915 |
|
7916 | var $ = __webpack_require__(2);
|
7917 | var setPrototypeOf = __webpack_require__(99);
|
7918 |
|
7919 |
|
7920 |
|
7921 | $({ target: 'Object', stat: true }, {
|
7922 | setPrototypeOf: setPrototypeOf
|
7923 | });
|
7924 |
|
7925 |
|
7926 | }),
|
7927 |
|
7928 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7929 |
|
7930 | var TO_STRING_TAG_SUPPORT = __webpack_require__(66);
|
7931 | var redefine = __webpack_require__(43);
|
7932 | var toString = __webpack_require__(274);
|
7933 |
|
7934 |
|
7935 |
|
7936 | if (!TO_STRING_TAG_SUPPORT) {
|
7937 | redefine(Object.prototype, 'toString', toString, { unsafe: true });
|
7938 | }
|
7939 |
|
7940 |
|
7941 | }),
|
7942 |
|
7943 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
7944 |
|
7945 | "use strict";
|
7946 |
|
7947 | var TO_STRING_TAG_SUPPORT = __webpack_require__(66);
|
7948 | var classof = __webpack_require__(65);
|
7949 |
|
7950 |
|
7951 |
|
7952 | module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
|
7953 | return '[object ' + classof(this) + ']';
|
7954 | };
|
7955 |
|
7956 |
|
7957 | }),
|
7958 |
|
7959 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7960 |
|
7961 | var $ = __webpack_require__(2);
|
7962 | var $values = (__webpack_require__(254).values);
|
7963 |
|
7964 |
|
7965 |
|
7966 | $({ target: 'Object', stat: true }, {
|
7967 | values: function values(O) {
|
7968 | return $values(O);
|
7969 | }
|
7970 | });
|
7971 |
|
7972 |
|
7973 | }),
|
7974 |
|
7975 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7976 |
|
7977 | var $ = __webpack_require__(2);
|
7978 | var $parseFloat = __webpack_require__(240);
|
7979 |
|
7980 |
|
7981 |
|
7982 | $({ global: true, forced: parseFloat != $parseFloat }, {
|
7983 | parseFloat: $parseFloat
|
7984 | });
|
7985 |
|
7986 |
|
7987 | }),
|
7988 |
|
7989 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
7990 |
|
7991 | var $ = __webpack_require__(2);
|
7992 | var $parseInt = __webpack_require__(242);
|
7993 |
|
7994 |
|
7995 |
|
7996 | $({ global: true, forced: parseInt != $parseInt }, {
|
7997 | parseInt: $parseInt
|
7998 | });
|
7999 |
|
8000 |
|
8001 | }),
|
8002 |
|
8003 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
8004 |
|
8005 | "use strict";
|
8006 |
|
8007 | var $ = __webpack_require__(2);
|
8008 | var IS_PURE = __webpack_require__(32);
|
8009 | var global = __webpack_require__(3);
|
8010 | var getBuiltIn = __webpack_require__(20);
|
8011 | var call = __webpack_require__(7);
|
8012 | var NativePromise = __webpack_require__(279);
|
8013 | var redefine = __webpack_require__(43);
|
8014 | var redefineAll = __webpack_require__(166);
|
8015 | var setPrototypeOf = __webpack_require__(99);
|
8016 | var setToStringTag = __webpack_require__(76);
|
8017 | var setSpecies = __webpack_require__(159);
|
8018 | var aCallable = __webpack_require__(27);
|
8019 | var isCallable = __webpack_require__(18);
|
8020 | var isObject = __webpack_require__(17);
|
8021 | var anInstance = __webpack_require__(167);
|
8022 | var inspectSource = __webpack_require__(44);
|
8023 | var iterate = __webpack_require__(103);
|
8024 | var checkCorrectnessOfIteration = __webpack_require__(133);
|
8025 | var speciesConstructor = __webpack_require__(173);
|
8026 | var task = (__webpack_require__(280).set);
|
8027 | var microtask = __webpack_require__(282);
|
8028 | var promiseResolve = __webpack_require__(285);
|
8029 | var hostReportErrors = __webpack_require__(287);
|
8030 | var newPromiseCapabilityModule = __webpack_require__(286);
|
8031 | var perform = __webpack_require__(288);
|
8032 | var InternalStateModule = __webpack_require__(45);
|
8033 | var isForced = __webpack_require__(61);
|
8034 | var wellKnownSymbol = __webpack_require__(30);
|
8035 | var IS_BROWSER = __webpack_require__(289);
|
8036 | var IS_NODE = __webpack_require__(148);
|
8037 | var V8_VERSION = __webpack_require__(24);
|
8038 |
|
8039 | var SPECIES = wellKnownSymbol('species');
|
8040 | var PROMISE = 'Promise';
|
8041 |
|
8042 | var getInternalState = InternalStateModule.get;
|
8043 | var setInternalState = InternalStateModule.set;
|
8044 | var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
|
8045 | var NativePromisePrototype = NativePromise && NativePromise.prototype;
|
8046 | var PromiseConstructor = NativePromise;
|
8047 | var PromisePrototype = NativePromisePrototype;
|
8048 | var TypeError = global.TypeError;
|
8049 | var document = global.document;
|
8050 | var process = global.process;
|
8051 | var newPromiseCapability = newPromiseCapabilityModule.f;
|
8052 | var newGenericPromiseCapability = newPromiseCapability;
|
8053 |
|
8054 | var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);
|
8055 | var NATIVE_REJECTION_EVENT = isCallable(global.PromiseRejectionEvent);
|
8056 | var UNHANDLED_REJECTION = 'unhandledrejection';
|
8057 | var REJECTION_HANDLED = 'rejectionhandled';
|
8058 | var PENDING = 0;
|
8059 | var FULFILLED = 1;
|
8060 | var REJECTED = 2;
|
8061 | var HANDLED = 1;
|
8062 | var UNHANDLED = 2;
|
8063 | var SUBCLASSING = false;
|
8064 |
|
8065 | var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
|
8066 |
|
8067 | var FORCED = isForced(PROMISE, function () {
|
8068 | var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(PromiseConstructor);
|
8069 | var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(PromiseConstructor);
|
8070 |
|
8071 |
|
8072 |
|
8073 | if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
|
8074 |
|
8075 | if (IS_PURE && !PromisePrototype['finally']) return true;
|
8076 |
|
8077 |
|
8078 |
|
8079 | if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false;
|
8080 |
|
8081 | var promise = new PromiseConstructor(function (resolve) { resolve(1); });
|
8082 | var FakePromise = function (exec) {
|
8083 | exec(function () { }, function () { });
|
8084 | };
|
8085 | var constructor = promise.constructor = {};
|
8086 | constructor[SPECIES] = FakePromise;
|
8087 | SUBCLASSING = promise.then(function () { }) instanceof FakePromise;
|
8088 | if (!SUBCLASSING) return true;
|
8089 |
|
8090 | return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_REJECTION_EVENT;
|
8091 | });
|
8092 |
|
8093 | var INCORRECT_ITERATION = FORCED || !checkCorrectnessOfIteration(function (iterable) {
|
8094 | PromiseConstructor.all(iterable)['catch'](function () { });
|
8095 | });
|
8096 |
|
8097 |
|
8098 | var isThenable = function (it) {
|
8099 | var then;
|
8100 | return isObject(it) && isCallable(then = it.then) ? then : false;
|
8101 | };
|
8102 |
|
8103 | var notify = function (state, isReject) {
|
8104 | if (state.notified) return;
|
8105 | state.notified = true;
|
8106 | var chain = state.reactions;
|
8107 | microtask(function () {
|
8108 | var value = state.value;
|
8109 | var ok = state.state == FULFILLED;
|
8110 | var index = 0;
|
8111 |
|
8112 | while (chain.length > index) {
|
8113 | var reaction = chain[index++];
|
8114 | var handler = ok ? reaction.ok : reaction.fail;
|
8115 | var resolve = reaction.resolve;
|
8116 | var reject = reaction.reject;
|
8117 | var domain = reaction.domain;
|
8118 | var result, then, exited;
|
8119 | try {
|
8120 | if (handler) {
|
8121 | if (!ok) {
|
8122 | if (state.rejection === UNHANDLED) onHandleUnhandled(state);
|
8123 | state.rejection = HANDLED;
|
8124 | }
|
8125 | if (handler === true) result = value;
|
8126 | else {
|
8127 | if (domain) domain.enter();
|
8128 | result = handler(value);
|
8129 | if (domain) {
|
8130 | domain.exit();
|
8131 | exited = true;
|
8132 | }
|
8133 | }
|
8134 | if (result === reaction.promise) {
|
8135 | reject(TypeError('Promise-chain cycle'));
|
8136 | } else if (then = isThenable(result)) {
|
8137 | call(then, result, resolve, reject);
|
8138 | } else resolve(result);
|
8139 | } else reject(value);
|
8140 | } catch (error) {
|
8141 | if (domain && !exited) domain.exit();
|
8142 | reject(error);
|
8143 | }
|
8144 | }
|
8145 | state.reactions = [];
|
8146 | state.notified = false;
|
8147 | if (isReject && !state.rejection) onUnhandled(state);
|
8148 | });
|
8149 | };
|
8150 |
|
8151 | var dispatchEvent = function (name, promise, reason) {
|
8152 | var event, handler;
|
8153 | if (DISPATCH_EVENT) {
|
8154 | event = document.createEvent('Event');
|
8155 | event.promise = promise;
|
8156 | event.reason = reason;
|
8157 | event.initEvent(name, false, true);
|
8158 | global.dispatchEvent(event);
|
8159 | } else event = { promise: promise, reason: reason };
|
8160 | if (!NATIVE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);
|
8161 | else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
|
8162 | };
|
8163 |
|
8164 | var onUnhandled = function (state) {
|
8165 | call(task, global, function () {
|
8166 | var promise = state.facade;
|
8167 | var value = state.value;
|
8168 | var IS_UNHANDLED = isUnhandled(state);
|
8169 | var result;
|
8170 | if (IS_UNHANDLED) {
|
8171 | result = perform(function () {
|
8172 | if (IS_NODE) {
|
8173 | process.emit('unhandledRejection', value, promise);
|
8174 | } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
|
8175 | });
|
8176 |
|
8177 | state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
|
8178 | if (result.error) throw result.value;
|
8179 | }
|
8180 | });
|
8181 | };
|
8182 |
|
8183 | var isUnhandled = function (state) {
|
8184 | return state.rejection !== HANDLED && !state.parent;
|
8185 | };
|
8186 |
|
8187 | var onHandleUnhandled = function (state) {
|
8188 | call(task, global, function () {
|
8189 | var promise = state.facade;
|
8190 | if (IS_NODE) {
|
8191 | process.emit('rejectionHandled', promise);
|
8192 | } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
|
8193 | });
|
8194 | };
|
8195 |
|
8196 | var bind = function (fn, state, unwrap) {
|
8197 | return function (value) {
|
8198 | fn(state, value, unwrap);
|
8199 | };
|
8200 | };
|
8201 |
|
8202 | var internalReject = function (state, value, unwrap) {
|
8203 | if (state.done) return;
|
8204 | state.done = true;
|
8205 | if (unwrap) state = unwrap;
|
8206 | state.value = value;
|
8207 | state.state = REJECTED;
|
8208 | notify(state, true);
|
8209 | };
|
8210 |
|
8211 | var internalResolve = function (state, value, unwrap) {
|
8212 | if (state.done) return;
|
8213 | state.done = true;
|
8214 | if (unwrap) state = unwrap;
|
8215 | try {
|
8216 | if (state.facade === value) throw TypeError("Promise can't be resolved itself");
|
8217 | var then = isThenable(value);
|
8218 | if (then) {
|
8219 | microtask(function () {
|
8220 | var wrapper = { done: false };
|
8221 | try {
|
8222 | call(then, value,
|
8223 | bind(internalResolve, wrapper, state),
|
8224 | bind(internalReject, wrapper, state)
|
8225 | );
|
8226 | } catch (error) {
|
8227 | internalReject(wrapper, error, state);
|
8228 | }
|
8229 | });
|
8230 | } else {
|
8231 | state.value = value;
|
8232 | state.state = FULFILLED;
|
8233 | notify(state, false);
|
8234 | }
|
8235 | } catch (error) {
|
8236 | internalReject({ done: false }, error, state);
|
8237 | }
|
8238 | };
|
8239 |
|
8240 |
|
8241 | if (FORCED) {
|
8242 |
|
8243 | PromiseConstructor = function Promise(executor) {
|
8244 | anInstance(this, PromisePrototype);
|
8245 | aCallable(executor);
|
8246 | call(Internal, this);
|
8247 | var state = getInternalState(this);
|
8248 | try {
|
8249 | executor(bind(internalResolve, state), bind(internalReject, state));
|
8250 | } catch (error) {
|
8251 | internalReject(state, error);
|
8252 | }
|
8253 | };
|
8254 | PromisePrototype = PromiseConstructor.prototype;
|
8255 |
|
8256 | Internal = function Promise(executor) {
|
8257 | setInternalState(this, {
|
8258 | type: PROMISE,
|
8259 | done: false,
|
8260 | notified: false,
|
8261 | parent: false,
|
8262 | reactions: [],
|
8263 | rejection: false,
|
8264 | state: PENDING,
|
8265 | value: undefined
|
8266 | });
|
8267 | };
|
8268 | Internal.prototype = redefineAll(PromisePrototype, {
|
8269 |
|
8270 |
|
8271 | then: function then(onFulfilled, onRejected) {
|
8272 | var state = getInternalPromiseState(this);
|
8273 | var reactions = state.reactions;
|
8274 | var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
|
8275 | reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
|
8276 | reaction.fail = isCallable(onRejected) && onRejected;
|
8277 | reaction.domain = IS_NODE ? process.domain : undefined;
|
8278 | state.parent = true;
|
8279 | reactions[reactions.length] = reaction;
|
8280 | if (state.state != PENDING) notify(state, false);
|
8281 | return reaction.promise;
|
8282 | },
|
8283 |
|
8284 |
|
8285 | 'catch': function (onRejected) {
|
8286 | return this.then(undefined, onRejected);
|
8287 | }
|
8288 | });
|
8289 | OwnPromiseCapability = function () {
|
8290 | var promise = new Internal();
|
8291 | var state = getInternalState(promise);
|
8292 | this.promise = promise;
|
8293 | this.resolve = bind(internalResolve, state);
|
8294 | this.reject = bind(internalReject, state);
|
8295 | };
|
8296 | newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
|
8297 | return C === PromiseConstructor || C === PromiseWrapper
|
8298 | ? new OwnPromiseCapability(C)
|
8299 | : newGenericPromiseCapability(C);
|
8300 | };
|
8301 |
|
8302 | if (!IS_PURE && isCallable(NativePromise) && NativePromisePrototype !== Object.prototype) {
|
8303 | nativeThen = NativePromisePrototype.then;
|
8304 |
|
8305 | if (!SUBCLASSING) {
|
8306 |
|
8307 | redefine(NativePromisePrototype, 'then', function then(onFulfilled, onRejected) {
|
8308 | var that = this;
|
8309 | return new PromiseConstructor(function (resolve, reject) {
|
8310 | call(nativeThen, that, resolve, reject);
|
8311 | }).then(onFulfilled, onRejected);
|
8312 |
|
8313 | }, { unsafe: true });
|
8314 |
|
8315 |
|
8316 | redefine(NativePromisePrototype, 'catch', PromisePrototype['catch'], { unsafe: true });
|
8317 | }
|
8318 |
|
8319 |
|
8320 | try {
|
8321 | delete NativePromisePrototype.constructor;
|
8322 | } catch (error) { }
|
8323 |
|
8324 |
|
8325 | if (setPrototypeOf) {
|
8326 | setPrototypeOf(NativePromisePrototype, PromisePrototype);
|
8327 | }
|
8328 | }
|
8329 | }
|
8330 |
|
8331 | $({ global: true, wrap: true, forced: FORCED }, {
|
8332 | Promise: PromiseConstructor
|
8333 | });
|
8334 |
|
8335 | setToStringTag(PromiseConstructor, PROMISE, false, true);
|
8336 | setSpecies(PROMISE);
|
8337 |
|
8338 | PromiseWrapper = getBuiltIn(PROMISE);
|
8339 |
|
8340 |
|
8341 | $({ target: PROMISE, stat: true, forced: FORCED }, {
|
8342 |
|
8343 |
|
8344 | reject: function reject(r) {
|
8345 | var capability = newPromiseCapability(this);
|
8346 | call(capability.reject, undefined, r);
|
8347 | return capability.promise;
|
8348 | }
|
8349 | });
|
8350 |
|
8351 | $({ target: PROMISE, stat: true, forced: IS_PURE || FORCED }, {
|
8352 |
|
8353 |
|
8354 | resolve: function resolve(x) {
|
8355 | return promiseResolve(IS_PURE && this === PromiseWrapper ? PromiseConstructor : this, x);
|
8356 | }
|
8357 | });
|
8358 |
|
8359 | $({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION }, {
|
8360 |
|
8361 |
|
8362 | all: function all(iterable) {
|
8363 | var C = this;
|
8364 | var capability = newPromiseCapability(C);
|
8365 | var resolve = capability.resolve;
|
8366 | var reject = capability.reject;
|
8367 | var result = perform(function () {
|
8368 | var $promiseResolve = aCallable(C.resolve);
|
8369 | var values = [];
|
8370 | var counter = 0;
|
8371 | var remaining = 1;
|
8372 | iterate(iterable, function (promise) {
|
8373 | var index = counter++;
|
8374 | var alreadyCalled = false;
|
8375 | remaining++;
|
8376 | call($promiseResolve, C, promise).then(function (value) {
|
8377 | if (alreadyCalled) return;
|
8378 | alreadyCalled = true;
|
8379 | values[index] = value;
|
8380 | --remaining || resolve(values);
|
8381 | }, reject);
|
8382 | });
|
8383 | --remaining || resolve(values);
|
8384 | });
|
8385 | if (result.error) reject(result.value);
|
8386 | return capability.promise;
|
8387 | },
|
8388 |
|
8389 |
|
8390 | race: function race(iterable) {
|
8391 | var C = this;
|
8392 | var capability = newPromiseCapability(C);
|
8393 | var reject = capability.reject;
|
8394 | var result = perform(function () {
|
8395 | var $promiseResolve = aCallable(C.resolve);
|
8396 | iterate(iterable, function (promise) {
|
8397 | call($promiseResolve, C, promise).then(capability.resolve, reject);
|
8398 | });
|
8399 | });
|
8400 | if (result.error) reject(result.value);
|
8401 | return capability.promise;
|
8402 | }
|
8403 | });
|
8404 |
|
8405 |
|
8406 | }),
|
8407 |
|
8408 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
8409 |
|
8410 | var global = __webpack_require__(3);
|
8411 |
|
8412 | module.exports = global.Promise;
|
8413 |
|
8414 |
|
8415 | }),
|
8416 |
|
8417 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
8418 |
|
8419 | var global = __webpack_require__(3);
|
8420 | var apply = __webpack_require__(62);
|
8421 | var bind = __webpack_require__(78);
|
8422 | var isCallable = __webpack_require__(18);
|
8423 | var hasOwn = __webpack_require__(35);
|
8424 | var fails = __webpack_require__(6);
|
8425 | var html = __webpack_require__(70);
|
8426 | var arraySlice = __webpack_require__(72);
|
8427 | var createElement = __webpack_require__(39);
|
8428 | var IS_IOS = __webpack_require__(281);
|
8429 | var IS_NODE = __webpack_require__(148);
|
8430 |
|
8431 | var set = global.setImmediate;
|
8432 | var clear = global.clearImmediate;
|
8433 | var process = global.process;
|
8434 | var Dispatch = global.Dispatch;
|
8435 | var Function = global.Function;
|
8436 | var MessageChannel = global.MessageChannel;
|
8437 | var String = global.String;
|
8438 | var counter = 0;
|
8439 | var queue = {};
|
8440 | var ONREADYSTATECHANGE = 'onreadystatechange';
|
8441 | var location, defer, channel, port;
|
8442 |
|
8443 | try {
|
8444 |
|
8445 | location = global.location;
|
8446 | } catch (error) { }
|
8447 |
|
8448 | var run = function (id) {
|
8449 | if (hasOwn(queue, id)) {
|
8450 | var fn = queue[id];
|
8451 | delete queue[id];
|
8452 | fn();
|
8453 | }
|
8454 | };
|
8455 |
|
8456 | var runner = function (id) {
|
8457 | return function () {
|
8458 | run(id);
|
8459 | };
|
8460 | };
|
8461 |
|
8462 | var listener = function (event) {
|
8463 | run(event.data);
|
8464 | };
|
8465 |
|
8466 | var post = function (id) {
|
8467 |
|
8468 | global.postMessage(String(id), location.protocol + '//' + location.host);
|
8469 | };
|
8470 |
|
8471 |
|
8472 | if (!set || !clear) {
|
8473 | set = function setImmediate(fn) {
|
8474 | var args = arraySlice(arguments, 1);
|
8475 | queue[++counter] = function () {
|
8476 | apply(isCallable(fn) ? fn : Function(fn), undefined, args);
|
8477 | };
|
8478 | defer(counter);
|
8479 | return counter;
|
8480 | };
|
8481 | clear = function clearImmediate(id) {
|
8482 | delete queue[id];
|
8483 | };
|
8484 |
|
8485 | if (IS_NODE) {
|
8486 | defer = function (id) {
|
8487 | process.nextTick(runner(id));
|
8488 | };
|
8489 |
|
8490 | } else if (Dispatch && Dispatch.now) {
|
8491 | defer = function (id) {
|
8492 | Dispatch.now(runner(id));
|
8493 | };
|
8494 |
|
8495 |
|
8496 | } else if (MessageChannel && !IS_IOS) {
|
8497 | channel = new MessageChannel();
|
8498 | port = channel.port2;
|
8499 | channel.port1.onmessage = listener;
|
8500 | defer = bind(port.postMessage, port);
|
8501 |
|
8502 |
|
8503 | } else if (
|
8504 | global.addEventListener &&
|
8505 | isCallable(global.postMessage) &&
|
8506 | !global.importScripts &&
|
8507 | location && location.protocol !== 'file:' &&
|
8508 | !fails(post)
|
8509 | ) {
|
8510 | defer = post;
|
8511 | global.addEventListener('message', listener, false);
|
8512 |
|
8513 | } else if (ONREADYSTATECHANGE in createElement('script')) {
|
8514 | defer = function (id) {
|
8515 | html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
|
8516 | html.removeChild(this);
|
8517 | run(id);
|
8518 | };
|
8519 | };
|
8520 |
|
8521 | } else {
|
8522 | defer = function (id) {
|
8523 | setTimeout(runner(id), 0);
|
8524 | };
|
8525 | }
|
8526 | }
|
8527 |
|
8528 | module.exports = {
|
8529 | set: set,
|
8530 | clear: clear
|
8531 | };
|
8532 |
|
8533 |
|
8534 | /***/ }),
|
8535 | /* 281 */
|
8536 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
8537 |
|
8538 | var userAgent = __webpack_require__(25);
|
8539 |
|
8540 | module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
|
8541 |
|
8542 |
|
8543 | }),
|
8544 |
|
8545 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
8546 |
|
8547 | var global = __webpack_require__(3);
|
8548 | var bind = __webpack_require__(78);
|
8549 | var getOwnPropertyDescriptor = (__webpack_require__(4).f);
|
8550 | var macrotask = (__webpack_require__(280).set);
|
8551 | var IS_IOS = __webpack_require__(281);
|
8552 | var IS_IOS_PEBBLE = __webpack_require__(283);
|
8553 | var IS_WEBOS_WEBKIT = __webpack_require__(284);
|
8554 | var IS_NODE = __webpack_require__(148);
|
8555 |
|
8556 | var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
|
8557 | var document = global.document;
|
8558 | var process = global.process;
|
8559 | var Promise = global.Promise;
|
8560 |
|
8561 | var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global, 'queueMicrotask');
|
8562 | var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
|
8563 |
|
8564 | var flush, head, last, notify, toggle, node, promise, then;
|
8565 |
|
8566 |
|
8567 | if (!queueMicrotask) {
|
8568 | flush = function () {
|
8569 | var parent, fn;
|
8570 | if (IS_NODE && (parent = process.domain)) parent.exit();
|
8571 | while (head) {
|
8572 | fn = head.fn;
|
8573 | head = head.next;
|
8574 | try {
|
8575 | fn();
|
8576 | } catch (error) {
|
8577 | if (head) notify();
|
8578 | else last = undefined;
|
8579 | throw error;
|
8580 | }
|
8581 | } last = undefined;
|
8582 | if (parent) parent.enter();
|
8583 | };
|
8584 |
|
8585 |
|
8586 |
|
8587 | if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {
|
8588 | toggle = true;
|
8589 | node = document.createTextNode('');
|
8590 | new MutationObserver(flush).observe(node, { characterData: true });
|
8591 | notify = function () {
|
8592 | node.data = toggle = !toggle;
|
8593 | };
|
8594 |
|
8595 | } else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) {
|
8596 |
|
8597 | promise = Promise.resolve(undefined);
|
8598 |
|
8599 | promise.constructor = Promise;
|
8600 | then = bind(promise.then, promise);
|
8601 | notify = function () {
|
8602 | then(flush);
|
8603 | };
|
8604 |
|
8605 | } else if (IS_NODE) {
|
8606 | notify = function () {
|
8607 | process.nextTick(flush);
|
8608 | };
|
8609 |
|
8610 |
|
8611 |
|
8612 |
|
8613 |
|
8614 |
|
8615 | } else {
|
8616 |
|
8617 | macrotask = bind(macrotask, global);
|
8618 | notify = function () {
|
8619 | macrotask(flush);
|
8620 | };
|
8621 | }
|
8622 | }
|
8623 |
|
8624 | module.exports = queueMicrotask || function (fn) {
|
8625 | var task = { fn: fn, next: undefined };
|
8626 | if (last) last.next = task;
|
8627 | if (!head) {
|
8628 | head = task;
|
8629 | notify();
|
8630 | } last = task;
|
8631 | };
|
8632 |
|
8633 |
|
8634 | }),
|
8635 |
|
8636 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
8637 |
|
8638 | var userAgent = __webpack_require__(25);
|
8639 | var global = __webpack_require__(3);
|
8640 |
|
8641 | module.exports = /ipad|iphone|ipod/i.test(userAgent) && global.Pebble !== undefined;
|
8642 |
|
8643 |
|
8644 | }),
|
8645 |
|
8646 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
8647 |
|
8648 | var userAgent = __webpack_require__(25);
|
8649 |
|
8650 | module.exports = /web0s(?!.*chrome)/i.test(userAgent);
|
8651 |
|
8652 |
|
8653 | }),
|
8654 |
|
8655 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
8656 |
|
8657 | var anObject = __webpack_require__(42);
|
8658 | var isObject = __webpack_require__(17);
|
8659 | var newPromiseCapability = __webpack_require__(286);
|
8660 |
|
8661 | module.exports = function (C, x) {
|
8662 | anObject(C);
|
8663 | if (isObject(x) && x.constructor === C) return x;
|
8664 | var promiseCapability = newPromiseCapability.f(C);
|
8665 | var resolve = promiseCapability.resolve;
|
8666 | resolve(x);
|
8667 | return promiseCapability.promise;
|
8668 | };
|
8669 |
|
8670 |
|
8671 | }),
|
8672 |
|
8673 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
8674 |
|
8675 | "use strict";
|
8676 |
|
8677 | var aCallable = __webpack_require__(27);
|
8678 |
|
8679 | var PromiseCapability = function (C) {
|
8680 | var resolve, reject;
|
8681 | this.promise = new C(function ($$resolve, $$reject) {
|
8682 | if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
|
8683 | resolve = $$resolve;
|
8684 | reject = $$reject;
|
8685 | });
|
8686 | this.resolve = aCallable(resolve);
|
8687 | this.reject = aCallable(reject);
|
8688 | };
|
8689 |
|
8690 |
|
8691 |
|
8692 | module.exports.f = function (C) {
|
8693 | return new PromiseCapability(C);
|
8694 | };
|
8695 |
|
8696 |
|
8697 | }),
|
8698 |
|
8699 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
8700 |
|
8701 | var global = __webpack_require__(3);
|
8702 |
|
8703 | module.exports = function (a, b) {
|
8704 | var console = global.console;
|
8705 | if (console && console.error) {
|
8706 | arguments.length == 1 ? console.error(a) : console.error(a, b);
|
8707 | }
|
8708 | };
|
8709 |
|
8710 |
|
8711 | }),
|
8712 |
|
8713 | (function(module) {
|
8714 |
|
8715 | module.exports = function (exec) {
|
8716 | try {
|
8717 | return { error: false, value: exec() };
|
8718 | } catch (error) {
|
8719 | return { error: true, value: error };
|
8720 | }
|
8721 | };
|
8722 |
|
8723 |
|
8724 | }),
|
8725 |
|
8726 | (function(module) {
|
8727 |
|
8728 | module.exports = typeof window == 'object';
|
8729 |
|
8730 |
|
8731 | }),
|
8732 |
|
8733 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
8734 |
|
8735 | "use strict";
|
8736 |
|
8737 | var $ = __webpack_require__(2);
|
8738 | var call = __webpack_require__(7);
|
8739 | var aCallable = __webpack_require__(27);
|
8740 | var newPromiseCapabilityModule = __webpack_require__(286);
|
8741 | var perform = __webpack_require__(288);
|
8742 | var iterate = __webpack_require__(103);
|
8743 |
|
8744 |
|
8745 |
|
8746 | $({ target: 'Promise', stat: true }, {
|
8747 | allSettled: function allSettled(iterable) {
|
8748 | var C = this;
|
8749 | var capability = newPromiseCapabilityModule.f(C);
|
8750 | var resolve = capability.resolve;
|
8751 | var reject = capability.reject;
|
8752 | var result = perform(function () {
|
8753 | var promiseResolve = aCallable(C.resolve);
|
8754 | var values = [];
|
8755 | var counter = 0;
|
8756 | var remaining = 1;
|
8757 | iterate(iterable, function (promise) {
|
8758 | var index = counter++;
|
8759 | var alreadyCalled = false;
|
8760 | remaining++;
|
8761 | call(promiseResolve, C, promise).then(function (value) {
|
8762 | if (alreadyCalled) return;
|
8763 | alreadyCalled = true;
|
8764 | values[index] = { status: 'fulfilled', value: value };
|
8765 | --remaining || resolve(values);
|
8766 | }, function (error) {
|
8767 | if (alreadyCalled) return;
|
8768 | alreadyCalled = true;
|
8769 | values[index] = { status: 'rejected', reason: error };
|
8770 | --remaining || resolve(values);
|
8771 | });
|
8772 | });
|
8773 | --remaining || resolve(values);
|
8774 | });
|
8775 | if (result.error) reject(result.value);
|
8776 | return capability.promise;
|
8777 | }
|
8778 | });
|
8779 |
|
8780 |
|
8781 | }),
|
8782 |
|
8783 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
8784 |
|
8785 | "use strict";
|
8786 |
|
8787 | var $ = __webpack_require__(2);
|
8788 | var aCallable = __webpack_require__(27);
|
8789 | var getBuiltIn = __webpack_require__(20);
|
8790 | var call = __webpack_require__(7);
|
8791 | var newPromiseCapabilityModule = __webpack_require__(286);
|
8792 | var perform = __webpack_require__(288);
|
8793 | var iterate = __webpack_require__(103);
|
8794 |
|
8795 | var PROMISE_ANY_ERROR = 'No one promise resolved';
|
8796 |
|
8797 |
|
8798 |
|
8799 | $({ target: 'Promise', stat: true }, {
|
8800 | any: function any(iterable) {
|
8801 | var C = this;
|
8802 | var AggregateError = getBuiltIn('AggregateError');
|
8803 | var capability = newPromiseCapabilityModule.f(C);
|
8804 | var resolve = capability.resolve;
|
8805 | var reject = capability.reject;
|
8806 | var result = perform(function () {
|
8807 | var promiseResolve = aCallable(C.resolve);
|
8808 | var errors = [];
|
8809 | var counter = 0;
|
8810 | var remaining = 1;
|
8811 | var alreadyResolved = false;
|
8812 | iterate(iterable, function (promise) {
|
8813 | var index = counter++;
|
8814 | var alreadyRejected = false;
|
8815 | remaining++;
|
8816 | call(promiseResolve, C, promise).then(function (value) {
|
8817 | if (alreadyRejected || alreadyResolved) return;
|
8818 | alreadyResolved = true;
|
8819 | resolve(value);
|
8820 | }, function (error) {
|
8821 | if (alreadyRejected || alreadyResolved) return;
|
8822 | alreadyRejected = true;
|
8823 | errors[index] = error;
|
8824 | --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
|
8825 | });
|
8826 | });
|
8827 | --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
|
8828 | });
|
8829 | if (result.error) reject(result.value);
|
8830 | return capability.promise;
|
8831 | }
|
8832 | });
|
8833 |
|
8834 |
|
8835 | }),
|
8836 |
|
8837 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
8838 |
|
8839 | "use strict";
|
8840 |
|
8841 | var $ = __webpack_require__(2);
|
8842 | var IS_PURE = __webpack_require__(32);
|
8843 | var NativePromise = __webpack_require__(279);
|
8844 | var fails = __webpack_require__(6);
|
8845 | var getBuiltIn = __webpack_require__(20);
|
8846 | var isCallable = __webpack_require__(18);
|
8847 | var speciesConstructor = __webpack_require__(173);
|
8848 | var promiseResolve = __webpack_require__(285);
|
8849 | var redefine = __webpack_require__(43);
|
8850 |
|
8851 |
|
8852 | var NON_GENERIC = !!NativePromise && fails(function () {
|
8853 | NativePromise.prototype['finally'].call({ then: function () { } }, function () { });
|
8854 | });
|
8855 |
|
8856 |
|
8857 |
|
8858 | $({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {
|
8859 | 'finally': function (onFinally) {
|
8860 | var C = speciesConstructor(this, getBuiltIn('Promise'));
|
8861 | var isFunction = isCallable(onFinally);
|
8862 | return this.then(
|
8863 | isFunction ? function (x) {
|
8864 | return promiseResolve(C, onFinally()).then(function () { return x; });
|
8865 | } : onFinally,
|
8866 | isFunction ? function (e) {
|
8867 | return promiseResolve(C, onFinally()).then(function () { throw e; });
|
8868 | } : onFinally
|
8869 | );
|
8870 | }
|
8871 | });
|
8872 |
|
8873 |
|
8874 | if (!IS_PURE && isCallable(NativePromise)) {
|
8875 | var method = getBuiltIn('Promise').prototype['finally'];
|
8876 | if (NativePromise.prototype['finally'] !== method) {
|
8877 | redefine(NativePromise.prototype, 'finally', method, { unsafe: true });
|
8878 | }
|
8879 | }
|
8880 |
|
8881 |
|
8882 | }),
|
8883 |
|
8884 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
8885 |
|
8886 | var $ = __webpack_require__(2);
|
8887 | var functionApply = __webpack_require__(62);
|
8888 | var aCallable = __webpack_require__(27);
|
8889 | var anObject = __webpack_require__(42);
|
8890 | var fails = __webpack_require__(6);
|
8891 |
|
8892 |
|
8893 | var OPTIONAL_ARGUMENTS_LIST = !fails(function () {
|
8894 |
|
8895 | Reflect.apply(function () { });
|
8896 | });
|
8897 |
|
8898 |
|
8899 |
|
8900 | $({ target: 'Reflect', stat: true, forced: OPTIONAL_ARGUMENTS_LIST }, {
|
8901 | apply: function apply(target, thisArgument, argumentsList) {
|
8902 | return functionApply(aCallable(target), thisArgument, anObject(argumentsList));
|
8903 | }
|
8904 | });
|
8905 |
|
8906 |
|
8907 | }),
|
8908 |
|
8909 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
8910 |
|
8911 | var $ = __webpack_require__(2);
|
8912 | var getBuiltIn = __webpack_require__(20);
|
8913 | var apply = __webpack_require__(62);
|
8914 | var bind = __webpack_require__(190);
|
8915 | var aConstructor = __webpack_require__(174);
|
8916 | var anObject = __webpack_require__(42);
|
8917 | var isObject = __webpack_require__(17);
|
8918 | var create = __webpack_require__(67);
|
8919 | var fails = __webpack_require__(6);
|
8920 |
|
8921 | var nativeConstruct = getBuiltIn('Reflect', 'construct');
|
8922 | var ObjectPrototype = Object.prototype;
|
8923 | var push = [].push;
|
8924 |
|
8925 |
|
8926 |
|
8927 |
|
8928 |
|
8929 | var NEW_TARGET_BUG = fails(function () {
|
8930 | function F() { }
|
8931 | return !(nativeConstruct(function () { }, [], F) instanceof F);
|
8932 | });
|
8933 |
|
8934 | var ARGS_BUG = !fails(function () {
|
8935 | nativeConstruct(function () { });
|
8936 | });
|
8937 |
|
8938 | var FORCED = NEW_TARGET_BUG || ARGS_BUG;
|
8939 |
|
8940 | $({ target: 'Reflect', stat: true, forced: FORCED, sham: FORCED }, {
|
8941 | construct: function construct(Target, args /* , newTarget */) {
|
8942 | aConstructor(Target);
|
8943 | anObject(args);
|
8944 | var newTarget = arguments.length < 3 ? Target : aConstructor(arguments[2]);
|
8945 | if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget);
|
8946 | if (Target == newTarget) {
|
8947 |
|
8948 | switch (args.length) {
|
8949 | case 0: return new Target();
|
8950 | case 1: return new Target(args[0]);
|
8951 | case 2: return new Target(args[0], args[1]);
|
8952 | case 3: return new Target(args[0], args[1], args[2]);
|
8953 | case 4: return new Target(args[0], args[1], args[2], args[3]);
|
8954 | }
|
8955 |
|
8956 | var $args = [null];
|
8957 | apply(push, $args, args);
|
8958 | return new (apply(bind, Target, $args))();
|
8959 | }
|
8960 |
|
8961 | var proto = newTarget.prototype;
|
8962 | var instance = create(isObject(proto) ? proto : ObjectPrototype);
|
8963 | var result = apply(Target, instance, args);
|
8964 | return isObject(result) ? result : instance;
|
8965 | }
|
8966 | });
|
8967 |
|
8968 |
|
8969 | }),
|
8970 |
|
8971 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
8972 |
|
8973 | var $ = __webpack_require__(2);
|
8974 | var DESCRIPTORS = __webpack_require__(5);
|
8975 | var anObject = __webpack_require__(42);
|
8976 | var toPropertyKey = __webpack_require__(15);
|
8977 | var definePropertyModule = __webpack_require__(41);
|
8978 | var fails = __webpack_require__(6);
|
8979 |
|
8980 |
|
8981 | var ERROR_INSTEAD_OF_FALSE = fails(function () {
|
8982 |
|
8983 | Reflect.defineProperty(definePropertyModule.f({}, 1, { value: 1 }), 1, { value: 2 });
|
8984 | });
|
8985 |
|
8986 |
|
8987 |
|
8988 | $({ target: 'Reflect', stat: true, forced: ERROR_INSTEAD_OF_FALSE, sham: !DESCRIPTORS }, {
|
8989 | defineProperty: function defineProperty(target, propertyKey, attributes) {
|
8990 | anObject(target);
|
8991 | var key = toPropertyKey(propertyKey);
|
8992 | anObject(attributes);
|
8993 | try {
|
8994 | definePropertyModule.f(target, key, attributes);
|
8995 | return true;
|
8996 | } catch (error) {
|
8997 | return false;
|
8998 | }
|
8999 | }
|
9000 | });
|
9001 |
|
9002 |
|
9003 | }),
|
9004 |
|
9005 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9006 |
|
9007 | var $ = __webpack_require__(2);
|
9008 | var anObject = __webpack_require__(42);
|
9009 | var getOwnPropertyDescriptor = (__webpack_require__(4).f);
|
9010 |
|
9011 |
|
9012 |
|
9013 | $({ target: 'Reflect', stat: true }, {
|
9014 | deleteProperty: function deleteProperty(target, propertyKey) {
|
9015 | var descriptor = getOwnPropertyDescriptor(anObject(target), propertyKey);
|
9016 | return descriptor && !descriptor.configurable ? false : delete target[propertyKey];
|
9017 | }
|
9018 | });
|
9019 |
|
9020 |
|
9021 | }),
|
9022 |
|
9023 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9024 |
|
9025 | var $ = __webpack_require__(2);
|
9026 | var call = __webpack_require__(7);
|
9027 | var isObject = __webpack_require__(17);
|
9028 | var anObject = __webpack_require__(42);
|
9029 | var isDataDescriptor = __webpack_require__(298);
|
9030 | var getOwnPropertyDescriptorModule = __webpack_require__(4);
|
9031 | var getPrototypeOf = __webpack_require__(97);
|
9032 |
|
9033 |
|
9034 |
|
9035 | function get(target, propertyKey /* , receiver */) {
|
9036 | var receiver = arguments.length < 3 ? target : arguments[2];
|
9037 | var descriptor, prototype;
|
9038 | if (anObject(target) === receiver) return target[propertyKey];
|
9039 | descriptor = getOwnPropertyDescriptorModule.f(target, propertyKey);
|
9040 | if (descriptor) return isDataDescriptor(descriptor)
|
9041 | ? descriptor.value
|
9042 | : descriptor.get === undefined ? undefined : call(descriptor.get, receiver);
|
9043 | if (isObject(prototype = getPrototypeOf(target))) return get(prototype, propertyKey, receiver);
|
9044 | }
|
9045 |
|
9046 | $({ target: 'Reflect', stat: true }, {
|
9047 | get: get
|
9048 | });
|
9049 |
|
9050 |
|
9051 | /***/ }),
|
9052 | /* 298 */
|
9053 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
9054 |
|
9055 | var hasOwn = __webpack_require__(35);
|
9056 |
|
9057 | module.exports = function (descriptor) {
|
9058 | return descriptor !== undefined && (hasOwn(descriptor, 'value') || hasOwn(descriptor, 'writable'));
|
9059 | };
|
9060 |
|
9061 |
|
9062 | }),
|
9063 |
|
9064 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9065 |
|
9066 | var $ = __webpack_require__(2);
|
9067 | var DESCRIPTORS = __webpack_require__(5);
|
9068 | var anObject = __webpack_require__(42);
|
9069 | var getOwnPropertyDescriptorModule = __webpack_require__(4);
|
9070 |
|
9071 |
|
9072 |
|
9073 | $({ target: 'Reflect', stat: true, sham: !DESCRIPTORS }, {
|
9074 | getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) {
|
9075 | return getOwnPropertyDescriptorModule.f(anObject(target), propertyKey);
|
9076 | }
|
9077 | });
|
9078 |
|
9079 |
|
9080 | }),
|
9081 |
|
9082 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9083 |
|
9084 | var $ = __webpack_require__(2);
|
9085 | var anObject = __webpack_require__(42);
|
9086 | var objectGetPrototypeOf = __webpack_require__(97);
|
9087 | var CORRECT_PROTOTYPE_GETTER = __webpack_require__(98);
|
9088 |
|
9089 |
|
9090 |
|
9091 | $({ target: 'Reflect', stat: true, sham: !CORRECT_PROTOTYPE_GETTER }, {
|
9092 | getPrototypeOf: function getPrototypeOf(target) {
|
9093 | return objectGetPrototypeOf(anObject(target));
|
9094 | }
|
9095 | });
|
9096 |
|
9097 |
|
9098 | }),
|
9099 |
|
9100 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9101 |
|
9102 | var $ = __webpack_require__(2);
|
9103 |
|
9104 |
|
9105 |
|
9106 | $({ target: 'Reflect', stat: true }, {
|
9107 | has: function has(target, propertyKey) {
|
9108 | return propertyKey in target;
|
9109 | }
|
9110 | });
|
9111 |
|
9112 |
|
9113 | }),
|
9114 |
|
9115 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9116 |
|
9117 | var $ = __webpack_require__(2);
|
9118 | var anObject = __webpack_require__(42);
|
9119 | var $isExtensible = __webpack_require__(199);
|
9120 |
|
9121 |
|
9122 |
|
9123 | $({ target: 'Reflect', stat: true }, {
|
9124 | isExtensible: function isExtensible(target) {
|
9125 | anObject(target);
|
9126 | return $isExtensible(target);
|
9127 | }
|
9128 | });
|
9129 |
|
9130 |
|
9131 | }),
|
9132 |
|
9133 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9134 |
|
9135 | var $ = __webpack_require__(2);
|
9136 | var ownKeys = __webpack_require__(51);
|
9137 |
|
9138 |
|
9139 |
|
9140 | $({ target: 'Reflect', stat: true }, {
|
9141 | ownKeys: ownKeys
|
9142 | });
|
9143 |
|
9144 |
|
9145 | }),
|
9146 |
|
9147 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9148 |
|
9149 | var $ = __webpack_require__(2);
|
9150 | var getBuiltIn = __webpack_require__(20);
|
9151 | var anObject = __webpack_require__(42);
|
9152 | var FREEZING = __webpack_require__(201);
|
9153 |
|
9154 |
|
9155 |
|
9156 | $({ target: 'Reflect', stat: true, sham: !FREEZING }, {
|
9157 | preventExtensions: function preventExtensions(target) {
|
9158 | anObject(target);
|
9159 | try {
|
9160 | var objectPreventExtensions = getBuiltIn('Object', 'preventExtensions');
|
9161 | if (objectPreventExtensions) objectPreventExtensions(target);
|
9162 | return true;
|
9163 | } catch (error) {
|
9164 | return false;
|
9165 | }
|
9166 | }
|
9167 | });
|
9168 |
|
9169 |
|
9170 | }),
|
9171 |
|
9172 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9173 |
|
9174 | var $ = __webpack_require__(2);
|
9175 | var call = __webpack_require__(7);
|
9176 | var anObject = __webpack_require__(42);
|
9177 | var isObject = __webpack_require__(17);
|
9178 | var isDataDescriptor = __webpack_require__(298);
|
9179 | var fails = __webpack_require__(6);
|
9180 | var definePropertyModule = __webpack_require__(41);
|
9181 | var getOwnPropertyDescriptorModule = __webpack_require__(4);
|
9182 | var getPrototypeOf = __webpack_require__(97);
|
9183 | var createPropertyDescriptor = __webpack_require__(9);
|
9184 |
|
9185 |
|
9186 |
|
9187 | function set(target, propertyKey, V /* , receiver */) {
|
9188 | var receiver = arguments.length < 4 ? target : arguments[3];
|
9189 | var ownDescriptor = getOwnPropertyDescriptorModule.f(anObject(target), propertyKey);
|
9190 | var existingDescriptor, prototype, setter;
|
9191 | if (!ownDescriptor) {
|
9192 | if (isObject(prototype = getPrototypeOf(target))) {
|
9193 | return set(prototype, propertyKey, V, receiver);
|
9194 | }
|
9195 | ownDescriptor = createPropertyDescriptor(0);
|
9196 | }
|
9197 | if (isDataDescriptor(ownDescriptor)) {
|
9198 | if (ownDescriptor.writable === false || !isObject(receiver)) return false;
|
9199 | if (existingDescriptor = getOwnPropertyDescriptorModule.f(receiver, propertyKey)) {
|
9200 | if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false;
|
9201 | existingDescriptor.value = V;
|
9202 | definePropertyModule.f(receiver, propertyKey, existingDescriptor);
|
9203 | } else definePropertyModule.f(receiver, propertyKey, createPropertyDescriptor(0, V));
|
9204 | } else {
|
9205 | setter = ownDescriptor.set;
|
9206 | if (setter === undefined) return false;
|
9207 | call(setter, receiver, V);
|
9208 | } return true;
|
9209 | }
|
9210 |
|
9211 |
|
9212 |
|
9213 | var MS_EDGE_BUG = fails(function () {
|
9214 | var Constructor = function () { };
|
9215 | var object = definePropertyModule.f(new Constructor(), 'a', { configurable: true });
|
9216 |
|
9217 | return Reflect.set(Constructor.prototype, 'a', 1, object) !== false;
|
9218 | });
|
9219 |
|
9220 | $({ target: 'Reflect', stat: true, forced: MS_EDGE_BUG }, {
|
9221 | set: set
|
9222 | });
|
9223 |
|
9224 |
|
9225 | /***/ }),
|
9226 | /* 306 */
|
9227 | /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9228 |
|
9229 | var $ = __webpack_require__(2);
|
9230 | var anObject = __webpack_require__(42);
|
9231 | var aPossiblePrototype = __webpack_require__(100);
|
9232 | var objectSetPrototypeOf = __webpack_require__(99);
|
9233 |
|
9234 |
|
9235 |
|
9236 | if (objectSetPrototypeOf) $({ target: 'Reflect', stat: true }, {
|
9237 | setPrototypeOf: function setPrototypeOf(target, proto) {
|
9238 | anObject(target);
|
9239 | aPossiblePrototype(proto);
|
9240 | try {
|
9241 | objectSetPrototypeOf(target, proto);
|
9242 | return true;
|
9243 | } catch (error) {
|
9244 | return false;
|
9245 | }
|
9246 | }
|
9247 | });
|
9248 |
|
9249 |
|
9250 | }),
|
9251 |
|
9252 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9253 |
|
9254 | var $ = __webpack_require__(2);
|
9255 | var global = __webpack_require__(3);
|
9256 | var setToStringTag = __webpack_require__(76);
|
9257 |
|
9258 | $({ global: true }, { Reflect: {} });
|
9259 |
|
9260 |
|
9261 |
|
9262 | setToStringTag(global.Reflect, 'Reflect', true);
|
9263 |
|
9264 |
|
9265 | }),
|
9266 |
|
9267 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9268 |
|
9269 | var DESCRIPTORS = __webpack_require__(5);
|
9270 | var global = __webpack_require__(3);
|
9271 | var uncurryThis = __webpack_require__(12);
|
9272 | var isForced = __webpack_require__(61);
|
9273 | var inheritIfRequired = __webpack_require__(202);
|
9274 | var createNonEnumerableProperty = __webpack_require__(40);
|
9275 | var defineProperty = (__webpack_require__(41).f);
|
9276 | var getOwnPropertyNames = (__webpack_require__(52).f);
|
9277 | var isPrototypeOf = __webpack_require__(21);
|
9278 | var isRegExp = __webpack_require__(309);
|
9279 | var toString = __webpack_require__(64);
|
9280 | var regExpFlags = __webpack_require__(310);
|
9281 | var stickyHelpers = __webpack_require__(311);
|
9282 | var redefine = __webpack_require__(43);
|
9283 | var fails = __webpack_require__(6);
|
9284 | var hasOwn = __webpack_require__(35);
|
9285 | var enforceInternalState = (__webpack_require__(45).enforce);
|
9286 | var setSpecies = __webpack_require__(159);
|
9287 | var wellKnownSymbol = __webpack_require__(30);
|
9288 | var UNSUPPORTED_DOT_ALL = __webpack_require__(312);
|
9289 | var UNSUPPORTED_NCG = __webpack_require__(313);
|
9290 |
|
9291 | var MATCH = wellKnownSymbol('match');
|
9292 | var NativeRegExp = global.RegExp;
|
9293 | var RegExpPrototype = NativeRegExp.prototype;
|
9294 | var SyntaxError = global.SyntaxError;
|
9295 | var getFlags = uncurryThis(regExpFlags);
|
9296 | var exec = uncurryThis(RegExpPrototype.exec);
|
9297 | var charAt = uncurryThis(''.charAt);
|
9298 | var replace = uncurryThis(''.replace);
|
9299 | var stringIndexOf = uncurryThis(''.indexOf);
|
9300 | var stringSlice = uncurryThis(''.slice);
|
9301 |
|
9302 | var IS_NCG = /^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/;
|
9303 | var re1 = /a/g;
|
9304 | var re2 = /a/g;
|
9305 |
|
9306 |
|
9307 | var CORRECT_NEW = new NativeRegExp(re1) !== re1;
|
9308 |
|
9309 | var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
|
9310 |
|
9311 | var BASE_FORCED = DESCRIPTORS &&
|
9312 | (!CORRECT_NEW || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG || fails(function () {
|
9313 | re2[MATCH] = false;
|
9314 |
|
9315 | return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i';
|
9316 | }));
|
9317 |
|
9318 | var handleDotAll = function (string) {
|
9319 | var length = string.length;
|
9320 | var index = 0;
|
9321 | var result = '';
|
9322 | var brackets = false;
|
9323 | var chr;
|
9324 | for (; index <= length; index++) {
|
9325 | chr = charAt(string, index);
|
9326 | if (chr === '\\') {
|
9327 | result += chr + charAt(string, ++index);
|
9328 | continue;
|
9329 | }
|
9330 | if (!brackets && chr === '.') {
|
9331 | result += '[\\s\\S]';
|
9332 | } else {
|
9333 | if (chr === '[') {
|
9334 | brackets = true;
|
9335 | } else if (chr === ']') {
|
9336 | brackets = false;
|
9337 | } result += chr;
|
9338 | }
|
9339 | } return result;
|
9340 | };
|
9341 |
|
9342 | var handleNCG = function (string) {
|
9343 | var length = string.length;
|
9344 | var index = 0;
|
9345 | var result = '';
|
9346 | var named = [];
|
9347 | var names = {};
|
9348 | var brackets = false;
|
9349 | var ncg = false;
|
9350 | var groupid = 0;
|
9351 | var groupname = '';
|
9352 | var chr;
|
9353 | for (; index <= length; index++) {
|
9354 | chr = charAt(string, index);
|
9355 | if (chr === '\\') {
|
9356 | chr = chr + charAt(string, ++index);
|
9357 | } else if (chr === ']') {
|
9358 | brackets = false;
|
9359 | } else if (!brackets) switch (true) {
|
9360 | case chr === '[':
|
9361 | brackets = true;
|
9362 | break;
|
9363 | case chr === '(':
|
9364 | if (exec(IS_NCG, stringSlice(string, index + 1))) {
|
9365 | index += 2;
|
9366 | ncg = true;
|
9367 | }
|
9368 | result += chr;
|
9369 | groupid++;
|
9370 | continue;
|
9371 | case chr === '>' && ncg:
|
9372 | if (groupname === '' || hasOwn(names, groupname)) {
|
9373 | throw new SyntaxError('Invalid capture group name');
|
9374 | }
|
9375 | names[groupname] = true;
|
9376 | named[named.length] = [groupname, groupid];
|
9377 | ncg = false;
|
9378 | groupname = '';
|
9379 | continue;
|
9380 | }
|
9381 | if (ncg) groupname += chr;
|
9382 | else result += chr;
|
9383 | } return [result, named];
|
9384 | };
|
9385 |
|
9386 |
|
9387 |
|
9388 | if (isForced('RegExp', BASE_FORCED)) {
|
9389 | var RegExpWrapper = function RegExp(pattern, flags) {
|
9390 | var thisIsRegExp = isPrototypeOf(RegExpPrototype, this);
|
9391 | var patternIsRegExp = isRegExp(pattern);
|
9392 | var flagsAreUndefined = flags === undefined;
|
9393 | var groups = [];
|
9394 | var rawPattern = pattern;
|
9395 | var rawFlags, dotAll, sticky, handled, result, state;
|
9396 |
|
9397 | if (!thisIsRegExp && patternIsRegExp && flagsAreUndefined && pattern.constructor === RegExpWrapper) {
|
9398 | return pattern;
|
9399 | }
|
9400 |
|
9401 | if (patternIsRegExp || isPrototypeOf(RegExpPrototype, pattern)) {
|
9402 | pattern = pattern.source;
|
9403 | if (flagsAreUndefined) flags = 'flags' in rawPattern ? rawPattern.flags : getFlags(rawPattern);
|
9404 | }
|
9405 |
|
9406 | pattern = pattern === undefined ? '' : toString(pattern);
|
9407 | flags = flags === undefined ? '' : toString(flags);
|
9408 | rawPattern = pattern;
|
9409 |
|
9410 | if (UNSUPPORTED_DOT_ALL && 'dotAll' in re1) {
|
9411 | dotAll = !!flags && stringIndexOf(flags, 's') > -1;
|
9412 | if (dotAll) flags = replace(flags, /s/g, '');
|
9413 | }
|
9414 |
|
9415 | rawFlags = flags;
|
9416 |
|
9417 | if (UNSUPPORTED_Y && 'sticky' in re1) {
|
9418 | sticky = !!flags && stringIndexOf(flags, 'y') > -1;
|
9419 | if (sticky) flags = replace(flags, /y/g, '');
|
9420 | }
|
9421 |
|
9422 | if (UNSUPPORTED_NCG) {
|
9423 | handled = handleNCG(pattern);
|
9424 | pattern = handled[0];
|
9425 | groups = handled[1];
|
9426 | }
|
9427 |
|
9428 | result = inheritIfRequired(NativeRegExp(pattern, flags), thisIsRegExp ? this : RegExpPrototype, RegExpWrapper);
|
9429 |
|
9430 | if (dotAll || sticky || groups.length) {
|
9431 | state = enforceInternalState(result);
|
9432 | if (dotAll) {
|
9433 | state.dotAll = true;
|
9434 | state.raw = RegExpWrapper(handleDotAll(pattern), rawFlags);
|
9435 | }
|
9436 | if (sticky) state.sticky = true;
|
9437 | if (groups.length) state.groups = groups;
|
9438 | }
|
9439 |
|
9440 | if (pattern !== rawPattern) try {
|
9441 |
|
9442 | createNonEnumerableProperty(result, 'source', rawPattern === '' ? '(?:)' : rawPattern);
|
9443 | } catch (error) { }
|
9444 |
|
9445 | return result;
|
9446 | };
|
9447 |
|
9448 | var proxy = function (key) {
|
9449 | key in RegExpWrapper || defineProperty(RegExpWrapper, key, {
|
9450 | configurable: true,
|
9451 | get: function () { return NativeRegExp[key]; },
|
9452 | set: function (it) { NativeRegExp[key] = it; }
|
9453 | });
|
9454 | };
|
9455 |
|
9456 | for (var keys = getOwnPropertyNames(NativeRegExp), index = 0; keys.length > index;) {
|
9457 | proxy(keys[index++]);
|
9458 | }
|
9459 |
|
9460 | RegExpPrototype.constructor = RegExpWrapper;
|
9461 | RegExpWrapper.prototype = RegExpPrototype;
|
9462 | redefine(global, 'RegExp', RegExpWrapper);
|
9463 | }
|
9464 |
|
9465 |
|
9466 | setSpecies('RegExp');
|
9467 |
|
9468 |
|
9469 | }),
|
9470 |
|
9471 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
9472 |
|
9473 | var isObject = __webpack_require__(17);
|
9474 | var classof = __webpack_require__(13);
|
9475 | var wellKnownSymbol = __webpack_require__(30);
|
9476 |
|
9477 | var MATCH = wellKnownSymbol('match');
|
9478 |
|
9479 |
|
9480 |
|
9481 | module.exports = function (it) {
|
9482 | var isRegExp;
|
9483 | return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');
|
9484 | };
|
9485 |
|
9486 |
|
9487 | }),
|
9488 |
|
9489 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
9490 |
|
9491 | "use strict";
|
9492 |
|
9493 | var anObject = __webpack_require__(42);
|
9494 |
|
9495 |
|
9496 |
|
9497 | module.exports = function () {
|
9498 | var that = anObject(this);
|
9499 | var result = '';
|
9500 | if (that.global) result += 'g';
|
9501 | if (that.ignoreCase) result += 'i';
|
9502 | if (that.multiline) result += 'm';
|
9503 | if (that.dotAll) result += 's';
|
9504 | if (that.unicode) result += 'u';
|
9505 | if (that.sticky) result += 'y';
|
9506 | return result;
|
9507 | };
|
9508 |
|
9509 |
|
9510 | }),
|
9511 |
|
9512 | (function(__unused_webpack_module, exports, __webpack_require__) {
|
9513 |
|
9514 | var fails = __webpack_require__(6);
|
9515 | var global = __webpack_require__(3);
|
9516 |
|
9517 |
|
9518 | var $RegExp = global.RegExp;
|
9519 |
|
9520 | exports.UNSUPPORTED_Y = fails(function () {
|
9521 | var re = $RegExp('a', 'y');
|
9522 | re.lastIndex = 2;
|
9523 | return re.exec('abcd') != null;
|
9524 | });
|
9525 |
|
9526 | exports.BROKEN_CARET = fails(function () {
|
9527 |
|
9528 | var re = $RegExp('^r', 'gy');
|
9529 | re.lastIndex = 2;
|
9530 | return re.exec('str') != null;
|
9531 | });
|
9532 |
|
9533 |
|
9534 | }),
|
9535 |
|
9536 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
9537 |
|
9538 | var fails = __webpack_require__(6);
|
9539 | var global = __webpack_require__(3);
|
9540 |
|
9541 |
|
9542 | var $RegExp = global.RegExp;
|
9543 |
|
9544 | module.exports = fails(function () {
|
9545 | var re = $RegExp('.', 's');
|
9546 | return !(re.dotAll && re.exec('\n') && re.flags === 's');
|
9547 | });
|
9548 |
|
9549 |
|
9550 | }),
|
9551 |
|
9552 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
9553 |
|
9554 | var fails = __webpack_require__(6);
|
9555 | var global = __webpack_require__(3);
|
9556 |
|
9557 |
|
9558 | var $RegExp = global.RegExp;
|
9559 |
|
9560 | module.exports = fails(function () {
|
9561 | var re = $RegExp('(?<a>b)', 'g');
|
9562 | return re.exec('b').groups.a !== 'b' ||
|
9563 | 'b'.replace(re, '$<a>c') !== 'bc';
|
9564 | });
|
9565 |
|
9566 |
|
9567 | }),
|
9568 |
|
9569 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9570 |
|
9571 | var global = __webpack_require__(3);
|
9572 | var DESCRIPTORS = __webpack_require__(5);
|
9573 | var UNSUPPORTED_DOT_ALL = __webpack_require__(312);
|
9574 | var classof = __webpack_require__(13);
|
9575 | var defineProperty = (__webpack_require__(41).f);
|
9576 | var getInternalState = (__webpack_require__(45).get);
|
9577 |
|
9578 | var RegExpPrototype = RegExp.prototype;
|
9579 | var TypeError = global.TypeError;
|
9580 |
|
9581 |
|
9582 |
|
9583 | if (DESCRIPTORS && UNSUPPORTED_DOT_ALL) {
|
9584 | defineProperty(RegExpPrototype, 'dotAll', {
|
9585 | configurable: true,
|
9586 | get: function () {
|
9587 | if (this === RegExpPrototype) return undefined;
|
9588 |
|
9589 |
|
9590 | if (classof(this) === 'RegExp') {
|
9591 | return !!getInternalState(this).dotAll;
|
9592 | }
|
9593 | throw TypeError('Incompatible receiver, RegExp required');
|
9594 | }
|
9595 | });
|
9596 | }
|
9597 |
|
9598 |
|
9599 | }),
|
9600 |
|
9601 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9602 |
|
9603 | "use strict";
|
9604 |
|
9605 | var $ = __webpack_require__(2);
|
9606 | var exec = __webpack_require__(316);
|
9607 |
|
9608 |
|
9609 |
|
9610 | $({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
|
9611 | exec: exec
|
9612 | });
|
9613 |
|
9614 |
|
9615 | }),
|
9616 |
|
9617 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
9618 |
|
9619 | "use strict";
|
9620 |
|
9621 |
|
9622 |
|
9623 | var call = __webpack_require__(7);
|
9624 | var uncurryThis = __webpack_require__(12);
|
9625 | var toString = __webpack_require__(64);
|
9626 | var regexpFlags = __webpack_require__(310);
|
9627 | var stickyHelpers = __webpack_require__(311);
|
9628 | var shared = __webpack_require__(31);
|
9629 | var create = __webpack_require__(67);
|
9630 | var getInternalState = (__webpack_require__(45).get);
|
9631 | var UNSUPPORTED_DOT_ALL = __webpack_require__(312);
|
9632 | var UNSUPPORTED_NCG = __webpack_require__(313);
|
9633 |
|
9634 | var nativeReplace = shared('native-string-replace', String.prototype.replace);
|
9635 | var nativeExec = RegExp.prototype.exec;
|
9636 | var patchedExec = nativeExec;
|
9637 | var charAt = uncurryThis(''.charAt);
|
9638 | var indexOf = uncurryThis(''.indexOf);
|
9639 | var replace = uncurryThis(''.replace);
|
9640 | var stringSlice = uncurryThis(''.slice);
|
9641 |
|
9642 | var UPDATES_LAST_INDEX_WRONG = (function () {
|
9643 | var re1 = /a/;
|
9644 | var re2 = /b*/g;
|
9645 | call(nativeExec, re1, 'a');
|
9646 | call(nativeExec, re2, 'a');
|
9647 | return re1.lastIndex !== 0 || re2.lastIndex !== 0;
|
9648 | })();
|
9649 |
|
9650 | var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET;
|
9651 |
|
9652 |
|
9653 | var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
|
9654 |
|
9655 | var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
|
9656 |
|
9657 | if (PATCH) {
|
9658 |
|
9659 | patchedExec = function exec(string) {
|
9660 | var re = this;
|
9661 | var state = getInternalState(re);
|
9662 | var str = toString(string);
|
9663 | var raw = state.raw;
|
9664 | var result, reCopy, lastIndex, match, i, object, group;
|
9665 |
|
9666 | if (raw) {
|
9667 | raw.lastIndex = re.lastIndex;
|
9668 | result = call(patchedExec, raw, str);
|
9669 | re.lastIndex = raw.lastIndex;
|
9670 | return result;
|
9671 | }
|
9672 |
|
9673 | var groups = state.groups;
|
9674 | var sticky = UNSUPPORTED_Y && re.sticky;
|
9675 | var flags = call(regexpFlags, re);
|
9676 | var source = re.source;
|
9677 | var charsAdded = 0;
|
9678 | var strCopy = str;
|
9679 |
|
9680 | if (sticky) {
|
9681 | flags = replace(flags, 'y', '');
|
9682 | if (indexOf(flags, 'g') === -1) {
|
9683 | flags += 'g';
|
9684 | }
|
9685 |
|
9686 | strCopy = stringSlice(str, re.lastIndex);
|
9687 |
|
9688 | if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt(str, re.lastIndex - 1) !== '\n')) {
|
9689 | source = '(?: ' + source + ')';
|
9690 | strCopy = ' ' + strCopy;
|
9691 | charsAdded++;
|
9692 | }
|
9693 |
|
9694 |
|
9695 | reCopy = new RegExp('^(?:' + source + ')', flags);
|
9696 | }
|
9697 |
|
9698 | if (NPCG_INCLUDED) {
|
9699 | reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
|
9700 | }
|
9701 | if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
|
9702 |
|
9703 | match = call(nativeExec, sticky ? reCopy : re, strCopy);
|
9704 |
|
9705 | if (sticky) {
|
9706 | if (match) {
|
9707 | match.input = stringSlice(match.input, charsAdded);
|
9708 | match[0] = stringSlice(match[0], charsAdded);
|
9709 | match.index = re.lastIndex;
|
9710 | re.lastIndex += match[0].length;
|
9711 | } else re.lastIndex = 0;
|
9712 | } else if (UPDATES_LAST_INDEX_WRONG && match) {
|
9713 | re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
|
9714 | }
|
9715 | if (NPCG_INCLUDED && match && match.length > 1) {
|
9716 |
|
9717 |
|
9718 | call(nativeReplace, match[0], reCopy, function () {
|
9719 | for (i = 1; i < arguments.length - 2; i++) {
|
9720 | if (arguments[i] === undefined) match[i] = undefined;
|
9721 | }
|
9722 | });
|
9723 | }
|
9724 |
|
9725 | if (match && groups) {
|
9726 | match.groups = object = create(null);
|
9727 | for (i = 0; i < groups.length; i++) {
|
9728 | group = groups[i];
|
9729 | object[group[0]] = match[group[1]];
|
9730 | }
|
9731 | }
|
9732 |
|
9733 | return match;
|
9734 | };
|
9735 | }
|
9736 |
|
9737 | module.exports = patchedExec;
|
9738 |
|
9739 |
|
9740 | }),
|
9741 |
|
9742 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9743 |
|
9744 | var DESCRIPTORS = __webpack_require__(5);
|
9745 | var objectDefinePropertyModule = __webpack_require__(41);
|
9746 | var regExpFlags = __webpack_require__(310);
|
9747 | var fails = __webpack_require__(6);
|
9748 |
|
9749 | var RegExpPrototype = RegExp.prototype;
|
9750 |
|
9751 | var FORCED = DESCRIPTORS && fails(function () {
|
9752 |
|
9753 | return Object.getOwnPropertyDescriptor(RegExpPrototype, 'flags').get.call({ dotAll: true, sticky: true }) !== 'sy';
|
9754 | });
|
9755 |
|
9756 |
|
9757 |
|
9758 | if (FORCED) objectDefinePropertyModule.f(RegExpPrototype, 'flags', {
|
9759 | configurable: true,
|
9760 | get: regExpFlags
|
9761 | });
|
9762 |
|
9763 |
|
9764 | /***/ }),
|
9765 | /* 318 */
|
9766 | /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9767 |
|
9768 | var global = __webpack_require__(3);
|
9769 | var DESCRIPTORS = __webpack_require__(5);
|
9770 | var UNSUPPORTED_Y = (__webpack_require__(311).UNSUPPORTED_Y);
|
9771 | var classof = __webpack_require__(13);
|
9772 | var defineProperty = (__webpack_require__(41).f);
|
9773 | var getInternalState = (__webpack_require__(45).get);
|
9774 |
|
9775 | var RegExpPrototype = RegExp.prototype;
|
9776 | var TypeError = global.TypeError;
|
9777 |
|
9778 |
|
9779 |
|
9780 | if (DESCRIPTORS && UNSUPPORTED_Y) {
|
9781 | defineProperty(RegExpPrototype, 'sticky', {
|
9782 | configurable: true,
|
9783 | get: function () {
|
9784 | if (this === RegExpPrototype) return undefined;
|
9785 |
|
9786 |
|
9787 | if (classof(this) === 'RegExp') {
|
9788 | return !!getInternalState(this).sticky;
|
9789 | }
|
9790 | throw TypeError('Incompatible receiver, RegExp required');
|
9791 | }
|
9792 | });
|
9793 | }
|
9794 |
|
9795 |
|
9796 | }),
|
9797 |
|
9798 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9799 |
|
9800 | "use strict";
|
9801 |
|
9802 |
|
9803 | __webpack_require__(315);
|
9804 | var $ = __webpack_require__(2);
|
9805 | var global = __webpack_require__(3);
|
9806 | var call = __webpack_require__(7);
|
9807 | var uncurryThis = __webpack_require__(12);
|
9808 | var isCallable = __webpack_require__(18);
|
9809 | var isObject = __webpack_require__(17);
|
9810 |
|
9811 | var DELEGATES_TO_EXEC = function () {
|
9812 | var execCalled = false;
|
9813 | var re = /[ac]/;
|
9814 | re.exec = function () {
|
9815 | execCalled = true;
|
9816 | return /./.exec.apply(this, arguments);
|
9817 | };
|
9818 | return re.test('abc') === true && execCalled;
|
9819 | }();
|
9820 |
|
9821 | var Error = global.Error;
|
9822 | var un$Test = uncurryThis(/./.test);
|
9823 |
|
9824 |
|
9825 |
|
9826 | $({ target: 'RegExp', proto: true, forced: !DELEGATES_TO_EXEC }, {
|
9827 | test: function (str) {
|
9828 | var exec = this.exec;
|
9829 | if (!isCallable(exec)) return un$Test(this, str);
|
9830 | var result = call(exec, this, str);
|
9831 | if (result !== null && !isObject(result)) {
|
9832 | throw new Error('RegExp exec method returned something other than an Object or null');
|
9833 | }
|
9834 | return !!result;
|
9835 | }
|
9836 | });
|
9837 |
|
9838 |
|
9839 | }),
|
9840 |
|
9841 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9842 |
|
9843 | "use strict";
|
9844 |
|
9845 | var uncurryThis = __webpack_require__(12);
|
9846 | var PROPER_FUNCTION_NAME = (__webpack_require__(49).PROPER);
|
9847 | var redefine = __webpack_require__(43);
|
9848 | var anObject = __webpack_require__(42);
|
9849 | var isPrototypeOf = __webpack_require__(21);
|
9850 | var $toString = __webpack_require__(64);
|
9851 | var fails = __webpack_require__(6);
|
9852 | var regExpFlags = __webpack_require__(310);
|
9853 |
|
9854 | var TO_STRING = 'toString';
|
9855 | var RegExpPrototype = RegExp.prototype;
|
9856 | var n$ToString = RegExpPrototype[TO_STRING];
|
9857 | var getFlags = uncurryThis(regExpFlags);
|
9858 |
|
9859 | var NOT_GENERIC = fails(function () { return n$ToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
|
9860 |
|
9861 | var INCORRECT_NAME = PROPER_FUNCTION_NAME && n$ToString.name != TO_STRING;
|
9862 |
|
9863 |
|
9864 |
|
9865 | if (NOT_GENERIC || INCORRECT_NAME) {
|
9866 | redefine(RegExp.prototype, TO_STRING, function toString() {
|
9867 | var R = anObject(this);
|
9868 | var p = $toString(R.source);
|
9869 | var rf = R.flags;
|
9870 | var f = $toString(rf === undefined && isPrototypeOf(RegExpPrototype, R) && !('flags' in RegExpPrototype) ? getFlags(R) : rf);
|
9871 | return '/' + p + '/' + f;
|
9872 | }, { unsafe: true });
|
9873 | }
|
9874 |
|
9875 |
|
9876 | }),
|
9877 |
|
9878 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9879 |
|
9880 | "use strict";
|
9881 |
|
9882 | var collection = __webpack_require__(197);
|
9883 | var collectionStrong = __webpack_require__(203);
|
9884 |
|
9885 |
|
9886 |
|
9887 | collection('Set', function (init) {
|
9888 | return function Set() { return init(this, arguments.length ? arguments[0] : undefined); };
|
9889 | }, collectionStrong);
|
9890 |
|
9891 |
|
9892 | }),
|
9893 |
|
9894 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9895 |
|
9896 | "use strict";
|
9897 |
|
9898 | var $ = __webpack_require__(2);
|
9899 | var uncurryThis = __webpack_require__(12);
|
9900 | var requireObjectCoercible = __webpack_require__(14);
|
9901 | var toIntegerOrInfinity = __webpack_require__(56);
|
9902 | var toString = __webpack_require__(64);
|
9903 | var fails = __webpack_require__(6);
|
9904 |
|
9905 | var charAt = uncurryThis(''.charAt);
|
9906 |
|
9907 | var FORCED = fails(function () {
|
9908 | return '𠮷'.at(0) !== '\uD842';
|
9909 | });
|
9910 |
|
9911 |
|
9912 |
|
9913 | $({ target: 'String', proto: true, forced: FORCED }, {
|
9914 | at: function at(index) {
|
9915 | var S = toString(requireObjectCoercible(this));
|
9916 | var len = S.length;
|
9917 | var relativeIndex = toIntegerOrInfinity(index);
|
9918 | var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex;
|
9919 | return (k < 0 || k >= len) ? undefined : charAt(S, k);
|
9920 | }
|
9921 | });
|
9922 |
|
9923 |
|
9924 | }),
|
9925 |
|
9926 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9927 |
|
9928 | "use strict";
|
9929 |
|
9930 | var $ = __webpack_require__(2);
|
9931 | var codeAt = (__webpack_require__(324).codeAt);
|
9932 |
|
9933 |
|
9934 |
|
9935 | $({ target: 'String', proto: true }, {
|
9936 | codePointAt: function codePointAt(pos) {
|
9937 | return codeAt(this, pos);
|
9938 | }
|
9939 | });
|
9940 |
|
9941 |
|
9942 | }),
|
9943 |
|
9944 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
9945 |
|
9946 | var uncurryThis = __webpack_require__(12);
|
9947 | var toIntegerOrInfinity = __webpack_require__(56);
|
9948 | var toString = __webpack_require__(64);
|
9949 | var requireObjectCoercible = __webpack_require__(14);
|
9950 |
|
9951 | var charAt = uncurryThis(''.charAt);
|
9952 | var charCodeAt = uncurryThis(''.charCodeAt);
|
9953 | var stringSlice = uncurryThis(''.slice);
|
9954 |
|
9955 | var createMethod = function (CONVERT_TO_STRING) {
|
9956 | return function ($this, pos) {
|
9957 | var S = toString(requireObjectCoercible($this));
|
9958 | var position = toIntegerOrInfinity(pos);
|
9959 | var size = S.length;
|
9960 | var first, second;
|
9961 | if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
9962 | first = charCodeAt(S, position);
|
9963 | return first < 0xD800 || first > 0xDBFF || position + 1 === size
|
9964 | || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
|
9965 | ? CONVERT_TO_STRING
|
9966 | ? charAt(S, position)
|
9967 | : first
|
9968 | : CONVERT_TO_STRING
|
9969 | ? stringSlice(S, position, position + 2)
|
9970 | : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
9971 | };
|
9972 | };
|
9973 |
|
9974 | module.exports = {
|
9975 |
|
9976 |
|
9977 | codeAt: createMethod(false),
|
9978 |
|
9979 |
|
9980 | charAt: createMethod(true)
|
9981 | };
|
9982 |
|
9983 |
|
9984 | }),
|
9985 |
|
9986 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
9987 |
|
9988 | "use strict";
|
9989 |
|
9990 | var $ = __webpack_require__(2);
|
9991 | var uncurryThis = __webpack_require__(12);
|
9992 | var getOwnPropertyDescriptor = (__webpack_require__(4).f);
|
9993 | var toLength = __webpack_require__(58);
|
9994 | var toString = __webpack_require__(64);
|
9995 | var notARegExp = __webpack_require__(326);
|
9996 | var requireObjectCoercible = __webpack_require__(14);
|
9997 | var correctIsRegExpLogic = __webpack_require__(327);
|
9998 | var IS_PURE = __webpack_require__(32);
|
9999 |
|
10000 |
|
10001 | var un$EndsWith = uncurryThis(''.endsWith);
|
10002 | var slice = uncurryThis(''.slice);
|
10003 | var min = Math.min;
|
10004 |
|
10005 | var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('endsWith');
|
10006 |
|
10007 | var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () {
|
10008 | var descriptor = getOwnPropertyDescriptor(String.prototype, 'endsWith');
|
10009 | return descriptor && !descriptor.writable;
|
10010 | }();
|
10011 |
|
10012 |
|
10013 |
|
10014 | $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
|
10015 | endsWith: function endsWith(searchString /* , endPosition = @length */) {
|
10016 | var that = toString(requireObjectCoercible(this));
|
10017 | notARegExp(searchString);
|
10018 | var endPosition = arguments.length > 1 ? arguments[1] : undefined;
|
10019 | var len = that.length;
|
10020 | var end = endPosition === undefined ? len : min(toLength(endPosition), len);
|
10021 | var search = toString(searchString);
|
10022 | return un$EndsWith
|
10023 | ? un$EndsWith(that, search, end)
|
10024 | : slice(that, end - search.length, end) === search;
|
10025 | }
|
10026 | });
|
10027 |
|
10028 |
|
10029 | }),
|
10030 |
|
10031 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
10032 |
|
10033 | var global = __webpack_require__(3);
|
10034 | var isRegExp = __webpack_require__(309);
|
10035 |
|
10036 | var TypeError = global.TypeError;
|
10037 |
|
10038 | module.exports = function (it) {
|
10039 | if (isRegExp(it)) {
|
10040 | throw TypeError("The method doesn't accept regular expressions");
|
10041 | } return it;
|
10042 | };
|
10043 |
|
10044 |
|
10045 | }),
|
10046 |
|
10047 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
10048 |
|
10049 | var wellKnownSymbol = __webpack_require__(30);
|
10050 |
|
10051 | var MATCH = wellKnownSymbol('match');
|
10052 |
|
10053 | module.exports = function (METHOD_NAME) {
|
10054 | var regexp = /./;
|
10055 | try {
|
10056 | '/./'[METHOD_NAME](regexp);
|
10057 | } catch (error1) {
|
10058 | try {
|
10059 | regexp[MATCH] = false;
|
10060 | return '/./'[METHOD_NAME](regexp);
|
10061 | } catch (error2) { }
|
10062 | } return false;
|
10063 | };
|
10064 |
|
10065 |
|
10066 | }),
|
10067 |
|
10068 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10069 |
|
10070 | var $ = __webpack_require__(2);
|
10071 | var global = __webpack_require__(3);
|
10072 | var uncurryThis = __webpack_require__(12);
|
10073 | var toAbsoluteIndex = __webpack_require__(55);
|
10074 |
|
10075 | var RangeError = global.RangeError;
|
10076 | var fromCharCode = String.fromCharCode;
|
10077 |
|
10078 | var $fromCodePoint = String.fromCodePoint;
|
10079 | var join = uncurryThis([].join);
|
10080 |
|
10081 |
|
10082 | var INCORRECT_LENGTH = !!$fromCodePoint && $fromCodePoint.length != 1;
|
10083 |
|
10084 |
|
10085 |
|
10086 | $({ target: 'String', stat: true, forced: INCORRECT_LENGTH }, {
|
10087 |
|
10088 | fromCodePoint: function fromCodePoint(x) {
|
10089 | var elements = [];
|
10090 | var length = arguments.length;
|
10091 | var i = 0;
|
10092 | var code;
|
10093 | while (length > i) {
|
10094 | code = +arguments[i++];
|
10095 | if (toAbsoluteIndex(code, 0x10FFFF) !== code) throw RangeError(code + ' is not a valid code point');
|
10096 | elements[i] = code < 0x10000
|
10097 | ? fromCharCode(code)
|
10098 | : fromCharCode(((code -= 0x10000) >> 10) + 0xD800, code % 0x400 + 0xDC00);
|
10099 | } return join(elements, '');
|
10100 | }
|
10101 | });
|
10102 |
|
10103 |
|
10104 | }),
|
10105 |
|
10106 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10107 |
|
10108 | "use strict";
|
10109 |
|
10110 | var $ = __webpack_require__(2);
|
10111 | var uncurryThis = __webpack_require__(12);
|
10112 | var notARegExp = __webpack_require__(326);
|
10113 | var requireObjectCoercible = __webpack_require__(14);
|
10114 | var toString = __webpack_require__(64);
|
10115 | var correctIsRegExpLogic = __webpack_require__(327);
|
10116 |
|
10117 | var stringIndexOf = uncurryThis(''.indexOf);
|
10118 |
|
10119 |
|
10120 |
|
10121 | $({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
|
10122 | includes: function includes(searchString /* , position = 0 */) {
|
10123 | return !!~stringIndexOf(
|
10124 | toString(requireObjectCoercible(this)),
|
10125 | toString(notARegExp(searchString)),
|
10126 | arguments.length > 1 ? arguments[1] : undefined
|
10127 | );
|
10128 | }
|
10129 | });
|
10130 |
|
10131 |
|
10132 | }),
|
10133 |
|
10134 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10135 |
|
10136 | "use strict";
|
10137 |
|
10138 | var charAt = (__webpack_require__(324).charAt);
|
10139 | var toString = __webpack_require__(64);
|
10140 | var InternalStateModule = __webpack_require__(45);
|
10141 | var defineIterator = __webpack_require__(138);
|
10142 |
|
10143 | var STRING_ITERATOR = 'String Iterator';
|
10144 | var setInternalState = InternalStateModule.set;
|
10145 | var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
|
10146 |
|
10147 |
|
10148 |
|
10149 | defineIterator(String, 'String', function (iterated) {
|
10150 | setInternalState(this, {
|
10151 | type: STRING_ITERATOR,
|
10152 | string: toString(iterated),
|
10153 | index: 0
|
10154 | });
|
10155 |
|
10156 |
|
10157 | }, function next() {
|
10158 | var state = getInternalState(this);
|
10159 | var string = state.string;
|
10160 | var index = state.index;
|
10161 | var point;
|
10162 | if (index >= string.length) return { value: undefined, done: true };
|
10163 | point = charAt(string, index);
|
10164 | state.index += point.length;
|
10165 | return { value: point, done: false };
|
10166 | });
|
10167 |
|
10168 |
|
10169 | }),
|
10170 |
|
10171 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10172 |
|
10173 | "use strict";
|
10174 |
|
10175 | var call = __webpack_require__(7);
|
10176 | var fixRegExpWellKnownSymbolLogic = __webpack_require__(332);
|
10177 | var anObject = __webpack_require__(42);
|
10178 | var toLength = __webpack_require__(58);
|
10179 | var toString = __webpack_require__(64);
|
10180 | var requireObjectCoercible = __webpack_require__(14);
|
10181 | var getMethod = __webpack_require__(26);
|
10182 | var advanceStringIndex = __webpack_require__(333);
|
10183 | var regExpExec = __webpack_require__(334);
|
10184 |
|
10185 |
|
10186 | fixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {
|
10187 | return [
|
10188 |
|
10189 |
|
10190 | function match(regexp) {
|
10191 | var O = requireObjectCoercible(this);
|
10192 | var matcher = regexp == undefined ? undefined : getMethod(regexp, MATCH);
|
10193 | return matcher ? call(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString(O));
|
10194 | },
|
10195 |
|
10196 |
|
10197 | function (string) {
|
10198 | var rx = anObject(this);
|
10199 | var S = toString(string);
|
10200 | var res = maybeCallNative(nativeMatch, rx, S);
|
10201 |
|
10202 | if (res.done) return res.value;
|
10203 |
|
10204 | if (!rx.global) return regExpExec(rx, S);
|
10205 |
|
10206 | var fullUnicode = rx.unicode;
|
10207 | rx.lastIndex = 0;
|
10208 | var A = [];
|
10209 | var n = 0;
|
10210 | var result;
|
10211 | while ((result = regExpExec(rx, S)) !== null) {
|
10212 | var matchStr = toString(result[0]);
|
10213 | A[n] = matchStr;
|
10214 | if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
|
10215 | n++;
|
10216 | }
|
10217 | return n === 0 ? null : A;
|
10218 | }
|
10219 | ];
|
10220 | });
|
10221 |
|
10222 |
|
10223 | }),
|
10224 |
|
10225 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
10226 |
|
10227 | "use strict";
|
10228 |
|
10229 |
|
10230 | __webpack_require__(315);
|
10231 | var uncurryThis = __webpack_require__(12);
|
10232 | var redefine = __webpack_require__(43);
|
10233 | var regexpExec = __webpack_require__(316);
|
10234 | var fails = __webpack_require__(6);
|
10235 | var wellKnownSymbol = __webpack_require__(30);
|
10236 | var createNonEnumerableProperty = __webpack_require__(40);
|
10237 |
|
10238 | var SPECIES = wellKnownSymbol('species');
|
10239 | var RegExpPrototype = RegExp.prototype;
|
10240 |
|
10241 | module.exports = function (KEY, exec, FORCED, SHAM) {
|
10242 | var SYMBOL = wellKnownSymbol(KEY);
|
10243 |
|
10244 | var DELEGATES_TO_SYMBOL = !fails(function () {
|
10245 |
|
10246 | var O = {};
|
10247 | O[SYMBOL] = function () { return 7; };
|
10248 | return ''[KEY](O) != 7;
|
10249 | });
|
10250 |
|
10251 | var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
|
10252 |
|
10253 | var execCalled = false;
|
10254 | var re = /a/;
|
10255 |
|
10256 | if (KEY === 'split') {
|
10257 |
|
10258 |
|
10259 |
|
10260 | re = {};
|
10261 |
|
10262 |
|
10263 | re.constructor = {};
|
10264 | re.constructor[SPECIES] = function () { return re; };
|
10265 | re.flags = '';
|
10266 | re[SYMBOL] = /./[SYMBOL];
|
10267 | }
|
10268 |
|
10269 | re.exec = function () { execCalled = true; return null; };
|
10270 |
|
10271 | re[SYMBOL]('');
|
10272 | return !execCalled;
|
10273 | });
|
10274 |
|
10275 | if (
|
10276 | !DELEGATES_TO_SYMBOL ||
|
10277 | !DELEGATES_TO_EXEC ||
|
10278 | FORCED
|
10279 | ) {
|
10280 | var uncurriedNativeRegExpMethod = uncurryThis(/./[SYMBOL]);
|
10281 | var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
|
10282 | var uncurriedNativeMethod = uncurryThis(nativeMethod);
|
10283 | var $exec = regexp.exec;
|
10284 | if ($exec === regexpExec || $exec === RegExpPrototype.exec) {
|
10285 | if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
|
10286 |
|
10287 |
|
10288 |
|
10289 | return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
|
10290 | }
|
10291 | return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
|
10292 | }
|
10293 | return { done: false };
|
10294 | });
|
10295 |
|
10296 | redefine(String.prototype, KEY, methods[0]);
|
10297 | redefine(RegExpPrototype, SYMBOL, methods[1]);
|
10298 | }
|
10299 |
|
10300 | if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
|
10301 | };
|
10302 |
|
10303 |
|
10304 | }),
|
10305 |
|
10306 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
10307 |
|
10308 | "use strict";
|
10309 |
|
10310 | var charAt = (__webpack_require__(324).charAt);
|
10311 |
|
10312 |
|
10313 |
|
10314 | module.exports = function (S, index, unicode) {
|
10315 | return index + (unicode ? charAt(S, index).length : 1);
|
10316 | };
|
10317 |
|
10318 |
|
10319 | }),
|
10320 |
|
10321 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
10322 |
|
10323 | var global = __webpack_require__(3);
|
10324 | var call = __webpack_require__(7);
|
10325 | var anObject = __webpack_require__(42);
|
10326 | var isCallable = __webpack_require__(18);
|
10327 | var classof = __webpack_require__(13);
|
10328 | var regexpExec = __webpack_require__(316);
|
10329 |
|
10330 | var TypeError = global.TypeError;
|
10331 |
|
10332 |
|
10333 |
|
10334 | module.exports = function (R, S) {
|
10335 | var exec = R.exec;
|
10336 | if (isCallable(exec)) {
|
10337 | var result = call(exec, R, S);
|
10338 | if (result !== null) anObject(result);
|
10339 | return result;
|
10340 | }
|
10341 | if (classof(R) === 'RegExp') return call(regexpExec, R, S);
|
10342 | throw TypeError('RegExp#exec called on incompatible receiver');
|
10343 | };
|
10344 |
|
10345 |
|
10346 | }),
|
10347 |
|
10348 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10349 |
|
10350 | "use strict";
|
10351 |
|
10352 |
|
10353 | var $ = __webpack_require__(2);
|
10354 | var global = __webpack_require__(3);
|
10355 | var call = __webpack_require__(7);
|
10356 | var uncurryThis = __webpack_require__(12);
|
10357 | var createIteratorConstructor = __webpack_require__(139);
|
10358 | var requireObjectCoercible = __webpack_require__(14);
|
10359 | var toLength = __webpack_require__(58);
|
10360 | var toString = __webpack_require__(64);
|
10361 | var anObject = __webpack_require__(42);
|
10362 | var classof = __webpack_require__(13);
|
10363 | var isPrototypeOf = __webpack_require__(21);
|
10364 | var isRegExp = __webpack_require__(309);
|
10365 | var regExpFlags = __webpack_require__(310);
|
10366 | var getMethod = __webpack_require__(26);
|
10367 | var redefine = __webpack_require__(43);
|
10368 | var fails = __webpack_require__(6);
|
10369 | var wellKnownSymbol = __webpack_require__(30);
|
10370 | var speciesConstructor = __webpack_require__(173);
|
10371 | var advanceStringIndex = __webpack_require__(333);
|
10372 | var regExpExec = __webpack_require__(334);
|
10373 | var InternalStateModule = __webpack_require__(45);
|
10374 | var IS_PURE = __webpack_require__(32);
|
10375 |
|
10376 | var MATCH_ALL = wellKnownSymbol('matchAll');
|
10377 | var REGEXP_STRING = 'RegExp String';
|
10378 | var REGEXP_STRING_ITERATOR = REGEXP_STRING + ' Iterator';
|
10379 | var setInternalState = InternalStateModule.set;
|
10380 | var getInternalState = InternalStateModule.getterFor(REGEXP_STRING_ITERATOR);
|
10381 | var RegExpPrototype = RegExp.prototype;
|
10382 | var TypeError = global.TypeError;
|
10383 | var getFlags = uncurryThis(regExpFlags);
|
10384 | var stringIndexOf = uncurryThis(''.indexOf);
|
10385 | var un$MatchAll = uncurryThis(''.matchAll);
|
10386 |
|
10387 | var WORKS_WITH_NON_GLOBAL_REGEX = !!un$MatchAll && !fails(function () {
|
10388 | un$MatchAll('a', /./);
|
10389 | });
|
10390 |
|
10391 | var $RegExpStringIterator = createIteratorConstructor(function RegExpStringIterator(regexp, string, $global, fullUnicode) {
|
10392 | setInternalState(this, {
|
10393 | type: REGEXP_STRING_ITERATOR,
|
10394 | regexp: regexp,
|
10395 | string: string,
|
10396 | global: $global,
|
10397 | unicode: fullUnicode,
|
10398 | done: false
|
10399 | });
|
10400 | }, REGEXP_STRING, function next() {
|
10401 | var state = getInternalState(this);
|
10402 | if (state.done) return { value: undefined, done: true };
|
10403 | var R = state.regexp;
|
10404 | var S = state.string;
|
10405 | var match = regExpExec(R, S);
|
10406 | if (match === null) return { value: undefined, done: state.done = true };
|
10407 | if (state.global) {
|
10408 | if (toString(match[0]) === '') R.lastIndex = advanceStringIndex(S, toLength(R.lastIndex), state.unicode);
|
10409 | return { value: match, done: false };
|
10410 | }
|
10411 | state.done = true;
|
10412 | return { value: match, done: false };
|
10413 | });
|
10414 |
|
10415 | var $matchAll = function (string) {
|
10416 | var R = anObject(this);
|
10417 | var S = toString(string);
|
10418 | var C, flagsValue, flags, matcher, $global, fullUnicode;
|
10419 | C = speciesConstructor(R, RegExp);
|
10420 | flagsValue = R.flags;
|
10421 | if (flagsValue === undefined && isPrototypeOf(RegExpPrototype, R) && !('flags' in RegExpPrototype)) {
|
10422 | flagsValue = getFlags(R);
|
10423 | }
|
10424 | flags = flagsValue === undefined ? '' : toString(flagsValue);
|
10425 | matcher = new C(C === RegExp ? R.source : R, flags);
|
10426 | $global = !!~stringIndexOf(flags, 'g');
|
10427 | fullUnicode = !!~stringIndexOf(flags, 'u');
|
10428 | matcher.lastIndex = toLength(R.lastIndex);
|
10429 | return new $RegExpStringIterator(matcher, S, $global, fullUnicode);
|
10430 | };
|
10431 |
|
10432 |
|
10433 |
|
10434 | $({ target: 'String', proto: true, forced: WORKS_WITH_NON_GLOBAL_REGEX }, {
|
10435 | matchAll: function matchAll(regexp) {
|
10436 | var O = requireObjectCoercible(this);
|
10437 | var flags, S, matcher, rx;
|
10438 | if (regexp != null) {
|
10439 | if (isRegExp(regexp)) {
|
10440 | flags = toString(requireObjectCoercible('flags' in RegExpPrototype
|
10441 | ? regexp.flags
|
10442 | : getFlags(regexp)
|
10443 | ));
|
10444 | if (!~stringIndexOf(flags, 'g')) throw TypeError('`.matchAll` does not allow non-global regexes');
|
10445 | }
|
10446 | if (WORKS_WITH_NON_GLOBAL_REGEX) return un$MatchAll(O, regexp);
|
10447 | matcher = getMethod(regexp, MATCH_ALL);
|
10448 | if (matcher === undefined && IS_PURE && classof(regexp) == 'RegExp') matcher = $matchAll;
|
10449 | if (matcher) return call(matcher, regexp, O);
|
10450 | } else if (WORKS_WITH_NON_GLOBAL_REGEX) return un$MatchAll(O, regexp);
|
10451 | S = toString(O);
|
10452 | rx = new RegExp(regexp, 'g');
|
10453 | return IS_PURE ? call($matchAll, rx, S) : rx[MATCH_ALL](S);
|
10454 | }
|
10455 | });
|
10456 |
|
10457 | IS_PURE || MATCH_ALL in RegExpPrototype || redefine(RegExpPrototype, MATCH_ALL, $matchAll);
|
10458 |
|
10459 |
|
10460 | }),
|
10461 |
|
10462 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10463 |
|
10464 | "use strict";
|
10465 |
|
10466 | var $ = __webpack_require__(2);
|
10467 | var $padEnd = (__webpack_require__(182).end);
|
10468 | var WEBKIT_BUG = __webpack_require__(337);
|
10469 |
|
10470 |
|
10471 |
|
10472 | $({ target: 'String', proto: true, forced: WEBKIT_BUG }, {
|
10473 | padEnd: function padEnd(maxLength /* , fillString = ' ' */) {
|
10474 | return $padEnd(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);
|
10475 | }
|
10476 | });
|
10477 |
|
10478 |
|
10479 | }),
|
10480 |
|
10481 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
10482 |
|
10483 |
|
10484 | var userAgent = __webpack_require__(25);
|
10485 |
|
10486 | module.exports = /Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(userAgent);
|
10487 |
|
10488 |
|
10489 | }),
|
10490 |
|
10491 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10492 |
|
10493 | "use strict";
|
10494 |
|
10495 | var $ = __webpack_require__(2);
|
10496 | var $padStart = (__webpack_require__(182).start);
|
10497 | var WEBKIT_BUG = __webpack_require__(337);
|
10498 |
|
10499 |
|
10500 |
|
10501 | $({ target: 'String', proto: true, forced: WEBKIT_BUG }, {
|
10502 | padStart: function padStart(maxLength /* , fillString = ' ' */) {
|
10503 | return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);
|
10504 | }
|
10505 | });
|
10506 |
|
10507 |
|
10508 | }),
|
10509 |
|
10510 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10511 |
|
10512 | var $ = __webpack_require__(2);
|
10513 | var uncurryThis = __webpack_require__(12);
|
10514 | var toIndexedObject = __webpack_require__(10);
|
10515 | var toObject = __webpack_require__(36);
|
10516 | var toString = __webpack_require__(64);
|
10517 | var lengthOfArrayLike = __webpack_require__(57);
|
10518 |
|
10519 | var push = uncurryThis([].push);
|
10520 | var join = uncurryThis([].join);
|
10521 |
|
10522 |
|
10523 |
|
10524 | $({ target: 'String', stat: true }, {
|
10525 | raw: function raw(template) {
|
10526 | var rawTemplate = toIndexedObject(toObject(template).raw);
|
10527 | var literalSegments = lengthOfArrayLike(rawTemplate);
|
10528 | var argumentsLength = arguments.length;
|
10529 | var elements = [];
|
10530 | var i = 0;
|
10531 | while (literalSegments > i) {
|
10532 | push(elements, toString(rawTemplate[i++]));
|
10533 | if (i === literalSegments) return join(elements, '');
|
10534 | if (i < argumentsLength) push(elements, toString(arguments[i]));
|
10535 | }
|
10536 | }
|
10537 | });
|
10538 |
|
10539 |
|
10540 | }),
|
10541 |
|
10542 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10543 |
|
10544 | var $ = __webpack_require__(2);
|
10545 | var repeat = __webpack_require__(183);
|
10546 |
|
10547 |
|
10548 |
|
10549 | $({ target: 'String', proto: true }, {
|
10550 | repeat: repeat
|
10551 | });
|
10552 |
|
10553 |
|
10554 | }),
|
10555 |
|
10556 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10557 |
|
10558 | "use strict";
|
10559 |
|
10560 | var apply = __webpack_require__(62);
|
10561 | var call = __webpack_require__(7);
|
10562 | var uncurryThis = __webpack_require__(12);
|
10563 | var fixRegExpWellKnownSymbolLogic = __webpack_require__(332);
|
10564 | var fails = __webpack_require__(6);
|
10565 | var anObject = __webpack_require__(42);
|
10566 | var isCallable = __webpack_require__(18);
|
10567 | var toIntegerOrInfinity = __webpack_require__(56);
|
10568 | var toLength = __webpack_require__(58);
|
10569 | var toString = __webpack_require__(64);
|
10570 | var requireObjectCoercible = __webpack_require__(14);
|
10571 | var advanceStringIndex = __webpack_require__(333);
|
10572 | var getMethod = __webpack_require__(26);
|
10573 | var getSubstitution = __webpack_require__(342);
|
10574 | var regExpExec = __webpack_require__(334);
|
10575 | var wellKnownSymbol = __webpack_require__(30);
|
10576 |
|
10577 | var REPLACE = wellKnownSymbol('replace');
|
10578 | var max = Math.max;
|
10579 | var min = Math.min;
|
10580 | var concat = uncurryThis([].concat);
|
10581 | var push = uncurryThis([].push);
|
10582 | var stringIndexOf = uncurryThis(''.indexOf);
|
10583 | var stringSlice = uncurryThis(''.slice);
|
10584 |
|
10585 | var maybeToString = function (it) {
|
10586 | return it === undefined ? it : String(it);
|
10587 | };
|
10588 |
|
10589 |
|
10590 |
|
10591 | var REPLACE_KEEPS_$0 = (function () {
|
10592 |
|
10593 | return 'a'.replace(/./, '$0') === '$0';
|
10594 | })();
|
10595 |
|
10596 |
|
10597 | var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
|
10598 | if (/./[REPLACE]) {
|
10599 | return /./[REPLACE]('a', '$0') === '';
|
10600 | }
|
10601 | return false;
|
10602 | })();
|
10603 |
|
10604 | var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
|
10605 | var re = /./;
|
10606 | re.exec = function () {
|
10607 | var result = [];
|
10608 | result.groups = { a: '7' };
|
10609 | return result;
|
10610 | };
|
10611 |
|
10612 | return ''.replace(re, '$<a>') !== '7';
|
10613 | });
|
10614 |
|
10615 |
|
10616 | fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
|
10617 | var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
|
10618 |
|
10619 | return [
|
10620 |
|
10621 |
|
10622 | function replace(searchValue, replaceValue) {
|
10623 | var O = requireObjectCoercible(this);
|
10624 | var replacer = searchValue == undefined ? undefined : getMethod(searchValue, REPLACE);
|
10625 | return replacer
|
10626 | ? call(replacer, searchValue, O, replaceValue)
|
10627 | : call(nativeReplace, toString(O), searchValue, replaceValue);
|
10628 | },
|
10629 |
|
10630 |
|
10631 | function (string, replaceValue) {
|
10632 | var rx = anObject(this);
|
10633 | var S = toString(string);
|
10634 |
|
10635 | if (
|
10636 | typeof replaceValue == 'string' &&
|
10637 | stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
|
10638 | stringIndexOf(replaceValue, '$<') === -1
|
10639 | ) {
|
10640 | var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
|
10641 | if (res.done) return res.value;
|
10642 | }
|
10643 |
|
10644 | var functionalReplace = isCallable(replaceValue);
|
10645 | if (!functionalReplace) replaceValue = toString(replaceValue);
|
10646 |
|
10647 | var global = rx.global;
|
10648 | if (global) {
|
10649 | var fullUnicode = rx.unicode;
|
10650 | rx.lastIndex = 0;
|
10651 | }
|
10652 | var results = [];
|
10653 | while (true) {
|
10654 | var result = regExpExec(rx, S);
|
10655 | if (result === null) break;
|
10656 |
|
10657 | push(results, result);
|
10658 | if (!global) break;
|
10659 |
|
10660 | var matchStr = toString(result[0]);
|
10661 | if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
|
10662 | }
|
10663 |
|
10664 | var accumulatedResult = '';
|
10665 | var nextSourcePosition = 0;
|
10666 | for (var i = 0; i < results.length; i++) {
|
10667 | result = results[i];
|
10668 |
|
10669 | var matched = toString(result[0]);
|
10670 | var position = max(min(toIntegerOrInfinity(result.index), S.length), 0);
|
10671 | var captures = [];
|
10672 |
|
10673 |
|
10674 |
|
10675 |
|
10676 |
|
10677 | for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j]));
|
10678 | var namedCaptures = result.groups;
|
10679 | if (functionalReplace) {
|
10680 | var replacerArgs = concat([matched], captures, position, S);
|
10681 | if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);
|
10682 | var replacement = toString(apply(replaceValue, undefined, replacerArgs));
|
10683 | } else {
|
10684 | replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
|
10685 | }
|
10686 | if (position >= nextSourcePosition) {
|
10687 | accumulatedResult += stringSlice(S, nextSourcePosition, position) + replacement;
|
10688 | nextSourcePosition = position + matched.length;
|
10689 | }
|
10690 | }
|
10691 | return accumulatedResult + stringSlice(S, nextSourcePosition);
|
10692 | }
|
10693 | ];
|
10694 | }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
|
10695 |
|
10696 |
|
10697 | }),
|
10698 |
|
10699 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
10700 |
|
10701 | var uncurryThis = __webpack_require__(12);
|
10702 | var toObject = __webpack_require__(36);
|
10703 |
|
10704 | var floor = Math.floor;
|
10705 | var charAt = uncurryThis(''.charAt);
|
10706 | var replace = uncurryThis(''.replace);
|
10707 | var stringSlice = uncurryThis(''.slice);
|
10708 | var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
|
10709 | var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
|
10710 |
|
10711 |
|
10712 |
|
10713 | module.exports = function (matched, str, position, captures, namedCaptures, replacement) {
|
10714 | var tailPos = position + matched.length;
|
10715 | var m = captures.length;
|
10716 | var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
|
10717 | if (namedCaptures !== undefined) {
|
10718 | namedCaptures = toObject(namedCaptures);
|
10719 | symbols = SUBSTITUTION_SYMBOLS;
|
10720 | }
|
10721 | return replace(replacement, symbols, function (match, ch) {
|
10722 | var capture;
|
10723 | switch (charAt(ch, 0)) {
|
10724 | case '$': return '$';
|
10725 | case '&': return matched;
|
10726 | case '`': return stringSlice(str, 0, position);
|
10727 | case "'": return stringSlice(str, tailPos);
|
10728 | case '<':
|
10729 | capture = namedCaptures[stringSlice(ch, 1, -1)];
|
10730 | break;
|
10731 | default:
|
10732 | var n = +ch;
|
10733 | if (n === 0) return match;
|
10734 | if (n > m) {
|
10735 | var f = floor(n / 10);
|
10736 | if (f === 0) return match;
|
10737 | if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
|
10738 | return match;
|
10739 | }
|
10740 | capture = captures[n - 1];
|
10741 | }
|
10742 | return capture === undefined ? '' : capture;
|
10743 | });
|
10744 | };
|
10745 |
|
10746 |
|
10747 | }),
|
10748 |
|
10749 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10750 |
|
10751 | "use strict";
|
10752 |
|
10753 | var $ = __webpack_require__(2);
|
10754 | var global = __webpack_require__(3);
|
10755 | var call = __webpack_require__(7);
|
10756 | var uncurryThis = __webpack_require__(12);
|
10757 | var requireObjectCoercible = __webpack_require__(14);
|
10758 | var isCallable = __webpack_require__(18);
|
10759 | var isRegExp = __webpack_require__(309);
|
10760 | var toString = __webpack_require__(64);
|
10761 | var getMethod = __webpack_require__(26);
|
10762 | var regExpFlags = __webpack_require__(310);
|
10763 | var getSubstitution = __webpack_require__(342);
|
10764 | var wellKnownSymbol = __webpack_require__(30);
|
10765 | var IS_PURE = __webpack_require__(32);
|
10766 |
|
10767 | var REPLACE = wellKnownSymbol('replace');
|
10768 | var RegExpPrototype = RegExp.prototype;
|
10769 | var TypeError = global.TypeError;
|
10770 | var getFlags = uncurryThis(regExpFlags);
|
10771 | var indexOf = uncurryThis(''.indexOf);
|
10772 | var replace = uncurryThis(''.replace);
|
10773 | var stringSlice = uncurryThis(''.slice);
|
10774 | var max = Math.max;
|
10775 |
|
10776 | var stringIndexOf = function (string, searchValue, fromIndex) {
|
10777 | if (fromIndex > string.length) return -1;
|
10778 | if (searchValue === '') return fromIndex;
|
10779 | return indexOf(string, searchValue, fromIndex);
|
10780 | };
|
10781 |
|
10782 |
|
10783 |
|
10784 | $({ target: 'String', proto: true }, {
|
10785 | replaceAll: function replaceAll(searchValue, replaceValue) {
|
10786 | var O = requireObjectCoercible(this);
|
10787 | var IS_REG_EXP, flags, replacer, string, searchString, functionalReplace, searchLength, advanceBy, replacement;
|
10788 | var position = 0;
|
10789 | var endOfLastMatch = 0;
|
10790 | var result = '';
|
10791 | if (searchValue != null) {
|
10792 | IS_REG_EXP = isRegExp(searchValue);
|
10793 | if (IS_REG_EXP) {
|
10794 | flags = toString(requireObjectCoercible('flags' in RegExpPrototype
|
10795 | ? searchValue.flags
|
10796 | : getFlags(searchValue)
|
10797 | ));
|
10798 | if (!~indexOf(flags, 'g')) throw TypeError('`.replaceAll` does not allow non-global regexes');
|
10799 | }
|
10800 | replacer = getMethod(searchValue, REPLACE);
|
10801 | if (replacer) {
|
10802 | return call(replacer, searchValue, O, replaceValue);
|
10803 | } else if (IS_PURE && IS_REG_EXP) {
|
10804 | return replace(toString(O), searchValue, replaceValue);
|
10805 | }
|
10806 | }
|
10807 | string = toString(O);
|
10808 | searchString = toString(searchValue);
|
10809 | functionalReplace = isCallable(replaceValue);
|
10810 | if (!functionalReplace) replaceValue = toString(replaceValue);
|
10811 | searchLength = searchString.length;
|
10812 | advanceBy = max(1, searchLength);
|
10813 | position = stringIndexOf(string, searchString, 0);
|
10814 | while (position !== -1) {
|
10815 | replacement = functionalReplace
|
10816 | ? toString(replaceValue(searchString, position, string))
|
10817 | : getSubstitution(searchString, string, position, [], undefined, replaceValue);
|
10818 | result += stringSlice(string, endOfLastMatch, position) + replacement;
|
10819 | endOfLastMatch = position + searchLength;
|
10820 | position = stringIndexOf(string, searchString, position + advanceBy);
|
10821 | }
|
10822 | if (endOfLastMatch < string.length) {
|
10823 | result += stringSlice(string, endOfLastMatch);
|
10824 | }
|
10825 | return result;
|
10826 | }
|
10827 | });
|
10828 |
|
10829 |
|
10830 | }),
|
10831 |
|
10832 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10833 |
|
10834 | "use strict";
|
10835 |
|
10836 | var call = __webpack_require__(7);
|
10837 | var fixRegExpWellKnownSymbolLogic = __webpack_require__(332);
|
10838 | var anObject = __webpack_require__(42);
|
10839 | var requireObjectCoercible = __webpack_require__(14);
|
10840 | var sameValue = __webpack_require__(263);
|
10841 | var toString = __webpack_require__(64);
|
10842 | var getMethod = __webpack_require__(26);
|
10843 | var regExpExec = __webpack_require__(334);
|
10844 |
|
10845 |
|
10846 | fixRegExpWellKnownSymbolLogic('search', function (SEARCH, nativeSearch, maybeCallNative) {
|
10847 | return [
|
10848 |
|
10849 |
|
10850 | function search(regexp) {
|
10851 | var O = requireObjectCoercible(this);
|
10852 | var searcher = regexp == undefined ? undefined : getMethod(regexp, SEARCH);
|
10853 | return searcher ? call(searcher, regexp, O) : new RegExp(regexp)[SEARCH](toString(O));
|
10854 | },
|
10855 |
|
10856 |
|
10857 | function (string) {
|
10858 | var rx = anObject(this);
|
10859 | var S = toString(string);
|
10860 | var res = maybeCallNative(nativeSearch, rx, S);
|
10861 |
|
10862 | if (res.done) return res.value;
|
10863 |
|
10864 | var previousLastIndex = rx.lastIndex;
|
10865 | if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
|
10866 | var result = regExpExec(rx, S);
|
10867 | if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
|
10868 | return result === null ? -1 : result.index;
|
10869 | }
|
10870 | ];
|
10871 | });
|
10872 |
|
10873 |
|
10874 | }),
|
10875 |
|
10876 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
10877 |
|
10878 | "use strict";
|
10879 |
|
10880 | var apply = __webpack_require__(62);
|
10881 | var call = __webpack_require__(7);
|
10882 | var uncurryThis = __webpack_require__(12);
|
10883 | var fixRegExpWellKnownSymbolLogic = __webpack_require__(332);
|
10884 | var isRegExp = __webpack_require__(309);
|
10885 | var anObject = __webpack_require__(42);
|
10886 | var requireObjectCoercible = __webpack_require__(14);
|
10887 | var speciesConstructor = __webpack_require__(173);
|
10888 | var advanceStringIndex = __webpack_require__(333);
|
10889 | var toLength = __webpack_require__(58);
|
10890 | var toString = __webpack_require__(64);
|
10891 | var getMethod = __webpack_require__(26);
|
10892 | var arraySlice = __webpack_require__(72);
|
10893 | var callRegExpExec = __webpack_require__(334);
|
10894 | var regexpExec = __webpack_require__(316);
|
10895 | var stickyHelpers = __webpack_require__(311);
|
10896 | var fails = __webpack_require__(6);
|
10897 |
|
10898 | var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
|
10899 | var MAX_UINT32 = 0xFFFFFFFF;
|
10900 | var min = Math.min;
|
10901 | var $push = [].push;
|
10902 | var exec = uncurryThis(/./.exec);
|
10903 | var push = uncurryThis($push);
|
10904 | var stringSlice = uncurryThis(''.slice);
|
10905 |
|
10906 |
|
10907 |
|
10908 | var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
|
10909 |
|
10910 | var re = /(?:)/;
|
10911 | var originalExec = re.exec;
|
10912 | re.exec = function () { return originalExec.apply(this, arguments); };
|
10913 | var result = 'ab'.split(re);
|
10914 | return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
|
10915 | });
|
10916 |
|
10917 |
|
10918 | fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {
|
10919 | var internalSplit;
|
10920 | if (
|
10921 | 'abbc'.split(/(b)*/)[1] == 'c' ||
|
10922 |
|
10923 | 'test'.split(/(?:)/, -1).length != 4 ||
|
10924 | 'ab'.split(/(?:ab)*/).length != 2 ||
|
10925 | '.'.split(/(.?)(.?)/).length != 4 ||
|
10926 |
|
10927 | '.'.split(/()()/).length > 1 ||
|
10928 | ''.split(/.?/).length
|
10929 | ) {
|
10930 |
|
10931 | internalSplit = function (separator, limit) {
|
10932 | var string = toString(requireObjectCoercible(this));
|
10933 | var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
|
10934 | if (lim === 0) return [];
|
10935 | if (separator === undefined) return [string];
|
10936 |
|
10937 | if (!isRegExp(separator)) {
|
10938 | return call(nativeSplit, string, separator, lim);
|
10939 | }
|
10940 | var output = [];
|
10941 | var flags = (separator.ignoreCase ? 'i' : '') +
|
10942 | (separator.multiline ? 'm' : '') +
|
10943 | (separator.unicode ? 'u' : '') +
|
10944 | (separator.sticky ? 'y' : '');
|
10945 | var lastLastIndex = 0;
|
10946 |
|
10947 | var separatorCopy = new RegExp(separator.source, flags + 'g');
|
10948 | var match, lastIndex, lastLength;
|
10949 | while (match = call(regexpExec, separatorCopy, string)) {
|
10950 | lastIndex = separatorCopy.lastIndex;
|
10951 | if (lastIndex > lastLastIndex) {
|
10952 | push(output, stringSlice(string, lastLastIndex, match.index));
|
10953 | if (match.length > 1 && match.index < string.length) apply($push, output, arraySlice(match, 1));
|
10954 | lastLength = match[0].length;
|
10955 | lastLastIndex = lastIndex;
|
10956 | if (output.length >= lim) break;
|
10957 | }
|
10958 | if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++;
|
10959 | }
|
10960 | if (lastLastIndex === string.length) {
|
10961 | if (lastLength || !exec(separatorCopy, '')) push(output, '');
|
10962 | } else push(output, stringSlice(string, lastLastIndex));
|
10963 | return output.length > lim ? arraySlice(output, 0, lim) : output;
|
10964 | };
|
10965 |
|
10966 | } else if ('0'.split(undefined, 0).length) {
|
10967 | internalSplit = function (separator, limit) {
|
10968 | return separator === undefined && limit === 0 ? [] : call(nativeSplit, this, separator, limit);
|
10969 | };
|
10970 | } else internalSplit = nativeSplit;
|
10971 |
|
10972 | return [
|
10973 |
|
10974 |
|
10975 | function split(separator, limit) {
|
10976 | var O = requireObjectCoercible(this);
|
10977 | var splitter = separator == undefined ? undefined : getMethod(separator, SPLIT);
|
10978 | return splitter
|
10979 | ? call(splitter, separator, O, limit)
|
10980 | : call(internalSplit, toString(O), separator, limit);
|
10981 | },
|
10982 |
|
10983 |
|
10984 |
|
10985 |
|
10986 |
|
10987 | function (string, limit) {
|
10988 | var rx = anObject(this);
|
10989 | var S = toString(string);
|
10990 | var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
|
10991 |
|
10992 | if (res.done) return res.value;
|
10993 |
|
10994 | var C = speciesConstructor(rx, RegExp);
|
10995 |
|
10996 | var unicodeMatching = rx.unicode;
|
10997 | var flags = (rx.ignoreCase ? 'i' : '') +
|
10998 | (rx.multiline ? 'm' : '') +
|
10999 | (rx.unicode ? 'u' : '') +
|
11000 | (UNSUPPORTED_Y ? 'g' : 'y');
|
11001 |
|
11002 |
|
11003 |
|
11004 | var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
|
11005 | var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
|
11006 | if (lim === 0) return [];
|
11007 | if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
|
11008 | var p = 0;
|
11009 | var q = 0;
|
11010 | var A = [];
|
11011 | while (q < S.length) {
|
11012 | splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
|
11013 | var z = callRegExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S);
|
11014 | var e;
|
11015 | if (
|
11016 | z === null ||
|
11017 | (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p
|
11018 | ) {
|
11019 | q = advanceStringIndex(S, q, unicodeMatching);
|
11020 | } else {
|
11021 | push(A, stringSlice(S, p, q));
|
11022 | if (A.length === lim) return A;
|
11023 | for (var i = 1; i <= z.length - 1; i++) {
|
11024 | push(A, z[i]);
|
11025 | if (A.length === lim) return A;
|
11026 | }
|
11027 | q = p = e;
|
11028 | }
|
11029 | }
|
11030 | push(A, stringSlice(S, p));
|
11031 | return A;
|
11032 | }
|
11033 | ];
|
11034 | }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
|
11035 |
|
11036 |
|
11037 | }),
|
11038 |
|
11039 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11040 |
|
11041 | "use strict";
|
11042 |
|
11043 | var $ = __webpack_require__(2);
|
11044 | var uncurryThis = __webpack_require__(12);
|
11045 | var getOwnPropertyDescriptor = (__webpack_require__(4).f);
|
11046 | var toLength = __webpack_require__(58);
|
11047 | var toString = __webpack_require__(64);
|
11048 | var notARegExp = __webpack_require__(326);
|
11049 | var requireObjectCoercible = __webpack_require__(14);
|
11050 | var correctIsRegExpLogic = __webpack_require__(327);
|
11051 | var IS_PURE = __webpack_require__(32);
|
11052 |
|
11053 |
|
11054 | var un$StartsWith = uncurryThis(''.startsWith);
|
11055 | var stringSlice = uncurryThis(''.slice);
|
11056 | var min = Math.min;
|
11057 |
|
11058 | var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith');
|
11059 |
|
11060 | var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () {
|
11061 | var descriptor = getOwnPropertyDescriptor(String.prototype, 'startsWith');
|
11062 | return descriptor && !descriptor.writable;
|
11063 | }();
|
11064 |
|
11065 |
|
11066 |
|
11067 | $({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
|
11068 | startsWith: function startsWith(searchString /* , position = 0 */) {
|
11069 | var that = toString(requireObjectCoercible(this));
|
11070 | notARegExp(searchString);
|
11071 | var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length));
|
11072 | var search = toString(searchString);
|
11073 | return un$StartsWith
|
11074 | ? un$StartsWith(that, search, index)
|
11075 | : stringSlice(that, index, index + search.length) === search;
|
11076 | }
|
11077 | });
|
11078 |
|
11079 |
|
11080 | }),
|
11081 |
|
11082 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11083 |
|
11084 | "use strict";
|
11085 |
|
11086 | var $ = __webpack_require__(2);
|
11087 | var uncurryThis = __webpack_require__(12);
|
11088 | var requireObjectCoercible = __webpack_require__(14);
|
11089 | var toIntegerOrInfinity = __webpack_require__(56);
|
11090 | var toString = __webpack_require__(64);
|
11091 |
|
11092 | var stringSlice = uncurryThis(''.slice);
|
11093 | var max = Math.max;
|
11094 | var min = Math.min;
|
11095 |
|
11096 |
|
11097 | var FORCED = !''.substr || 'ab'.substr(-1) !== 'b';
|
11098 |
|
11099 |
|
11100 |
|
11101 | $({ target: 'String', proto: true, forced: FORCED }, {
|
11102 | substr: function substr(start, length) {
|
11103 | var that = toString(requireObjectCoercible(this));
|
11104 | var size = that.length;
|
11105 | var intStart = toIntegerOrInfinity(start);
|
11106 | var intLength, intEnd;
|
11107 | if (intStart === Infinity) intStart = 0;
|
11108 | if (intStart < 0) intStart = max(size + intStart, 0);
|
11109 | intLength = length === undefined ? size : toIntegerOrInfinity(length);
|
11110 | if (intLength <= 0 || intLength === Infinity) return '';
|
11111 | intEnd = min(intStart + intLength, size);
|
11112 | return intStart >= intEnd ? '' : stringSlice(that, intStart, intEnd);
|
11113 | }
|
11114 | });
|
11115 |
|
11116 |
|
11117 | }),
|
11118 |
|
11119 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11120 |
|
11121 | "use strict";
|
11122 |
|
11123 | var $ = __webpack_require__(2);
|
11124 | var $trim = (__webpack_require__(228).trim);
|
11125 | var forcedStringTrimMethod = __webpack_require__(349);
|
11126 |
|
11127 |
|
11128 |
|
11129 | $({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
|
11130 | trim: function trim() {
|
11131 | return $trim(this);
|
11132 | }
|
11133 | });
|
11134 |
|
11135 |
|
11136 | }),
|
11137 |
|
11138 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
11139 |
|
11140 | var PROPER_FUNCTION_NAME = (__webpack_require__(49).PROPER);
|
11141 | var fails = __webpack_require__(6);
|
11142 | var whitespaces = __webpack_require__(229);
|
11143 |
|
11144 | var non = '\u200B\u0085\u180E';
|
11145 |
|
11146 |
|
11147 |
|
11148 | module.exports = function (METHOD_NAME) {
|
11149 | return fails(function () {
|
11150 | return !!whitespaces[METHOD_NAME]()
|
11151 | || non[METHOD_NAME]() !== non
|
11152 | || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);
|
11153 | });
|
11154 | };
|
11155 |
|
11156 |
|
11157 | }),
|
11158 |
|
11159 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11160 |
|
11161 | "use strict";
|
11162 |
|
11163 | var $ = __webpack_require__(2);
|
11164 | var $trimEnd = (__webpack_require__(228).end);
|
11165 | var forcedStringTrimMethod = __webpack_require__(349);
|
11166 |
|
11167 | var FORCED = forcedStringTrimMethod('trimEnd');
|
11168 |
|
11169 | var trimEnd = FORCED ? function trimEnd() {
|
11170 | return $trimEnd(this);
|
11171 |
|
11172 | } : ''.trimEnd;
|
11173 |
|
11174 |
|
11175 |
|
11176 |
|
11177 | $({ target: 'String', proto: true, name: 'trimEnd', forced: FORCED }, {
|
11178 | trimEnd: trimEnd,
|
11179 | trimRight: trimEnd
|
11180 | });
|
11181 |
|
11182 |
|
11183 | }),
|
11184 |
|
11185 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11186 |
|
11187 | "use strict";
|
11188 |
|
11189 | var $ = __webpack_require__(2);
|
11190 | var $trimStart = (__webpack_require__(228).start);
|
11191 | var forcedStringTrimMethod = __webpack_require__(349);
|
11192 |
|
11193 | var FORCED = forcedStringTrimMethod('trimStart');
|
11194 |
|
11195 | var trimStart = FORCED ? function trimStart() {
|
11196 | return $trimStart(this);
|
11197 |
|
11198 | } : ''.trimStart;
|
11199 |
|
11200 |
|
11201 |
|
11202 |
|
11203 | $({ target: 'String', proto: true, name: 'trimStart', forced: FORCED }, {
|
11204 | trimStart: trimStart,
|
11205 | trimLeft: trimStart
|
11206 | });
|
11207 |
|
11208 |
|
11209 | }),
|
11210 |
|
11211 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11212 |
|
11213 | "use strict";
|
11214 |
|
11215 | var $ = __webpack_require__(2);
|
11216 | var createHTML = __webpack_require__(353);
|
11217 | var forcedStringHTMLMethod = __webpack_require__(354);
|
11218 |
|
11219 |
|
11220 |
|
11221 | $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('anchor') }, {
|
11222 | anchor: function anchor(name) {
|
11223 | return createHTML(this, 'a', 'name', name);
|
11224 | }
|
11225 | });
|
11226 |
|
11227 |
|
11228 | }),
|
11229 |
|
11230 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
11231 |
|
11232 | var uncurryThis = __webpack_require__(12);
|
11233 | var requireObjectCoercible = __webpack_require__(14);
|
11234 | var toString = __webpack_require__(64);
|
11235 |
|
11236 | var quot = /"/g;
|
11237 | var replace = uncurryThis(''.replace);
|
11238 |
|
11239 |
|
11240 |
|
11241 | module.exports = function (string, tag, attribute, value) {
|
11242 | var S = toString(requireObjectCoercible(string));
|
11243 | var p1 = '<' + tag;
|
11244 | if (attribute !== '') p1 += ' ' + attribute + '="' + replace(toString(value), quot, '"') + '"';
|
11245 | return p1 + '>' + S + '</' + tag + '>';
|
11246 | };
|
11247 |
|
11248 |
|
11249 | }),
|
11250 |
|
11251 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
11252 |
|
11253 | var fails = __webpack_require__(6);
|
11254 |
|
11255 |
|
11256 |
|
11257 | module.exports = function (METHOD_NAME) {
|
11258 | return fails(function () {
|
11259 | var test = ''[METHOD_NAME]('"');
|
11260 | return test !== test.toLowerCase() || test.split('"').length > 3;
|
11261 | });
|
11262 | };
|
11263 |
|
11264 |
|
11265 | }),
|
11266 |
|
11267 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11268 |
|
11269 | "use strict";
|
11270 |
|
11271 | var $ = __webpack_require__(2);
|
11272 | var createHTML = __webpack_require__(353);
|
11273 | var forcedStringHTMLMethod = __webpack_require__(354);
|
11274 |
|
11275 |
|
11276 |
|
11277 | $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('big') }, {
|
11278 | big: function big() {
|
11279 | return createHTML(this, 'big', '', '');
|
11280 | }
|
11281 | });
|
11282 |
|
11283 |
|
11284 | }),
|
11285 |
|
11286 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11287 |
|
11288 | "use strict";
|
11289 |
|
11290 | var $ = __webpack_require__(2);
|
11291 | var createHTML = __webpack_require__(353);
|
11292 | var forcedStringHTMLMethod = __webpack_require__(354);
|
11293 |
|
11294 |
|
11295 |
|
11296 | $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('blink') }, {
|
11297 | blink: function blink() {
|
11298 | return createHTML(this, 'blink', '', '');
|
11299 | }
|
11300 | });
|
11301 |
|
11302 |
|
11303 | }),
|
11304 |
|
11305 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11306 |
|
11307 | "use strict";
|
11308 |
|
11309 | var $ = __webpack_require__(2);
|
11310 | var createHTML = __webpack_require__(353);
|
11311 | var forcedStringHTMLMethod = __webpack_require__(354);
|
11312 |
|
11313 |
|
11314 |
|
11315 | $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('bold') }, {
|
11316 | bold: function bold() {
|
11317 | return createHTML(this, 'b', '', '');
|
11318 | }
|
11319 | });
|
11320 |
|
11321 |
|
11322 | }),
|
11323 |
|
11324 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11325 |
|
11326 | "use strict";
|
11327 |
|
11328 | var $ = __webpack_require__(2);
|
11329 | var createHTML = __webpack_require__(353);
|
11330 | var forcedStringHTMLMethod = __webpack_require__(354);
|
11331 |
|
11332 |
|
11333 |
|
11334 | $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('fixed') }, {
|
11335 | fixed: function fixed() {
|
11336 | return createHTML(this, 'tt', '', '');
|
11337 | }
|
11338 | });
|
11339 |
|
11340 |
|
11341 | }),
|
11342 |
|
11343 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11344 |
|
11345 | "use strict";
|
11346 |
|
11347 | var $ = __webpack_require__(2);
|
11348 | var createHTML = __webpack_require__(353);
|
11349 | var forcedStringHTMLMethod = __webpack_require__(354);
|
11350 |
|
11351 |
|
11352 |
|
11353 | $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('fontcolor') }, {
|
11354 | fontcolor: function fontcolor(color) {
|
11355 | return createHTML(this, 'font', 'color', color);
|
11356 | }
|
11357 | });
|
11358 |
|
11359 |
|
11360 | }),
|
11361 |
|
11362 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11363 |
|
11364 | "use strict";
|
11365 |
|
11366 | var $ = __webpack_require__(2);
|
11367 | var createHTML = __webpack_require__(353);
|
11368 | var forcedStringHTMLMethod = __webpack_require__(354);
|
11369 |
|
11370 |
|
11371 |
|
11372 | $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('fontsize') }, {
|
11373 | fontsize: function fontsize(size) {
|
11374 | return createHTML(this, 'font', 'size', size);
|
11375 | }
|
11376 | });
|
11377 |
|
11378 |
|
11379 | }),
|
11380 |
|
11381 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11382 |
|
11383 | "use strict";
|
11384 |
|
11385 | var $ = __webpack_require__(2);
|
11386 | var createHTML = __webpack_require__(353);
|
11387 | var forcedStringHTMLMethod = __webpack_require__(354);
|
11388 |
|
11389 |
|
11390 |
|
11391 | $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('italics') }, {
|
11392 | italics: function italics() {
|
11393 | return createHTML(this, 'i', '', '');
|
11394 | }
|
11395 | });
|
11396 |
|
11397 |
|
11398 | }),
|
11399 |
|
11400 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11401 |
|
11402 | "use strict";
|
11403 |
|
11404 | var $ = __webpack_require__(2);
|
11405 | var createHTML = __webpack_require__(353);
|
11406 | var forcedStringHTMLMethod = __webpack_require__(354);
|
11407 |
|
11408 |
|
11409 |
|
11410 | $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('link') }, {
|
11411 | link: function link(url) {
|
11412 | return createHTML(this, 'a', 'href', url);
|
11413 | }
|
11414 | });
|
11415 |
|
11416 |
|
11417 | }),
|
11418 |
|
11419 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11420 |
|
11421 | "use strict";
|
11422 |
|
11423 | var $ = __webpack_require__(2);
|
11424 | var createHTML = __webpack_require__(353);
|
11425 | var forcedStringHTMLMethod = __webpack_require__(354);
|
11426 |
|
11427 |
|
11428 |
|
11429 | $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('small') }, {
|
11430 | small: function small() {
|
11431 | return createHTML(this, 'small', '', '');
|
11432 | }
|
11433 | });
|
11434 |
|
11435 |
|
11436 | }),
|
11437 |
|
11438 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11439 |
|
11440 | "use strict";
|
11441 |
|
11442 | var $ = __webpack_require__(2);
|
11443 | var createHTML = __webpack_require__(353);
|
11444 | var forcedStringHTMLMethod = __webpack_require__(354);
|
11445 |
|
11446 |
|
11447 |
|
11448 | $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('strike') }, {
|
11449 | strike: function strike() {
|
11450 | return createHTML(this, 'strike', '', '');
|
11451 | }
|
11452 | });
|
11453 |
|
11454 |
|
11455 | }),
|
11456 |
|
11457 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11458 |
|
11459 | "use strict";
|
11460 |
|
11461 | var $ = __webpack_require__(2);
|
11462 | var createHTML = __webpack_require__(353);
|
11463 | var forcedStringHTMLMethod = __webpack_require__(354);
|
11464 |
|
11465 |
|
11466 |
|
11467 | $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('sub') }, {
|
11468 | sub: function sub() {
|
11469 | return createHTML(this, 'sub', '', '');
|
11470 | }
|
11471 | });
|
11472 |
|
11473 |
|
11474 | }),
|
11475 |
|
11476 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11477 |
|
11478 | "use strict";
|
11479 |
|
11480 | var $ = __webpack_require__(2);
|
11481 | var createHTML = __webpack_require__(353);
|
11482 | var forcedStringHTMLMethod = __webpack_require__(354);
|
11483 |
|
11484 |
|
11485 |
|
11486 | $({ target: 'String', proto: true, forced: forcedStringHTMLMethod('sup') }, {
|
11487 | sup: function sup() {
|
11488 | return createHTML(this, 'sup', '', '');
|
11489 | }
|
11490 | });
|
11491 |
|
11492 |
|
11493 | }),
|
11494 |
|
11495 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11496 |
|
11497 | var createTypedArrayConstructor = __webpack_require__(368);
|
11498 |
|
11499 |
|
11500 |
|
11501 | createTypedArrayConstructor('Float32', function (init) {
|
11502 | return function Float32Array(data, byteOffset, length) {
|
11503 | return init(this, data, byteOffset, length);
|
11504 | };
|
11505 | });
|
11506 |
|
11507 |
|
11508 | }),
|
11509 |
|
11510 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
11511 |
|
11512 | "use strict";
|
11513 |
|
11514 | var $ = __webpack_require__(2);
|
11515 | var global = __webpack_require__(3);
|
11516 | var call = __webpack_require__(7);
|
11517 | var DESCRIPTORS = __webpack_require__(5);
|
11518 | var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = __webpack_require__(369);
|
11519 | var ArrayBufferViewCore = __webpack_require__(171);
|
11520 | var ArrayBufferModule = __webpack_require__(164);
|
11521 | var anInstance = __webpack_require__(167);
|
11522 | var createPropertyDescriptor = __webpack_require__(9);
|
11523 | var createNonEnumerableProperty = __webpack_require__(40);
|
11524 | var isIntegralNumber = __webpack_require__(234);
|
11525 | var toLength = __webpack_require__(58);
|
11526 | var toIndex = __webpack_require__(168);
|
11527 | var toOffset = __webpack_require__(370);
|
11528 | var toPropertyKey = __webpack_require__(15);
|
11529 | var hasOwn = __webpack_require__(35);
|
11530 | var classof = __webpack_require__(65);
|
11531 | var isObject = __webpack_require__(17);
|
11532 | var isSymbol = __webpack_require__(19);
|
11533 | var create = __webpack_require__(67);
|
11534 | var isPrototypeOf = __webpack_require__(21);
|
11535 | var setPrototypeOf = __webpack_require__(99);
|
11536 | var getOwnPropertyNames = (__webpack_require__(52).f);
|
11537 | var typedArrayFrom = __webpack_require__(372);
|
11538 | var forEach = (__webpack_require__(77).forEach);
|
11539 | var setSpecies = __webpack_require__(159);
|
11540 | var definePropertyModule = __webpack_require__(41);
|
11541 | var getOwnPropertyDescriptorModule = __webpack_require__(4);
|
11542 | var InternalStateModule = __webpack_require__(45);
|
11543 | var inheritIfRequired = __webpack_require__(202);
|
11544 |
|
11545 | var getInternalState = InternalStateModule.get;
|
11546 | var setInternalState = InternalStateModule.set;
|
11547 | var nativeDefineProperty = definePropertyModule.f;
|
11548 | var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
11549 | var round = Math.round;
|
11550 | var RangeError = global.RangeError;
|
11551 | var ArrayBuffer = ArrayBufferModule.ArrayBuffer;
|
11552 | var ArrayBufferPrototype = ArrayBuffer.prototype;
|
11553 | var DataView = ArrayBufferModule.DataView;
|
11554 | var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;
|
11555 | var TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR;
|
11556 | var TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG;
|
11557 | var TypedArray = ArrayBufferViewCore.TypedArray;
|
11558 | var TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype;
|
11559 | var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
|
11560 | var isTypedArray = ArrayBufferViewCore.isTypedArray;
|
11561 | var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';
|
11562 | var WRONG_LENGTH = 'Wrong length';
|
11563 |
|
11564 | var fromList = function (C, list) {
|
11565 | aTypedArrayConstructor(C);
|
11566 | var index = 0;
|
11567 | var length = list.length;
|
11568 | var result = new C(length);
|
11569 | while (length > index) result[index] = list[index++];
|
11570 | return result;
|
11571 | };
|
11572 |
|
11573 | var addGetter = function (it, key) {
|
11574 | nativeDefineProperty(it, key, { get: function () {
|
11575 | return getInternalState(this)[key];
|
11576 | } });
|
11577 | };
|
11578 |
|
11579 | var isArrayBuffer = function (it) {
|
11580 | var klass;
|
11581 | return isPrototypeOf(ArrayBufferPrototype, it) || (klass = classof(it)) == 'ArrayBuffer' || klass == 'SharedArrayBuffer';
|
11582 | };
|
11583 |
|
11584 | var isTypedArrayIndex = function (target, key) {
|
11585 | return isTypedArray(target)
|
11586 | && !isSymbol(key)
|
11587 | && key in target
|
11588 | && isIntegralNumber(+key)
|
11589 | && key >= 0;
|
11590 | };
|
11591 |
|
11592 | var wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) {
|
11593 | key = toPropertyKey(key);
|
11594 | return isTypedArrayIndex(target, key)
|
11595 | ? createPropertyDescriptor(2, target[key])
|
11596 | : nativeGetOwnPropertyDescriptor(target, key);
|
11597 | };
|
11598 |
|
11599 | var wrappedDefineProperty = function defineProperty(target, key, descriptor) {
|
11600 | key = toPropertyKey(key);
|
11601 | if (isTypedArrayIndex(target, key)
|
11602 | && isObject(descriptor)
|
11603 | && hasOwn(descriptor, 'value')
|
11604 | && !hasOwn(descriptor, 'get')
|
11605 | && !hasOwn(descriptor, 'set')
|
11606 |
|
11607 | && !descriptor.configurable
|
11608 | && (!hasOwn(descriptor, 'writable') || descriptor.writable)
|
11609 | && (!hasOwn(descriptor, 'enumerable') || descriptor.enumerable)
|
11610 | ) {
|
11611 | target[key] = descriptor.value;
|
11612 | return target;
|
11613 | } return nativeDefineProperty(target, key, descriptor);
|
11614 | };
|
11615 |
|
11616 | if (DESCRIPTORS) {
|
11617 | if (!NATIVE_ARRAY_BUFFER_VIEWS) {
|
11618 | getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor;
|
11619 | definePropertyModule.f = wrappedDefineProperty;
|
11620 | addGetter(TypedArrayPrototype, 'buffer');
|
11621 | addGetter(TypedArrayPrototype, 'byteOffset');
|
11622 | addGetter(TypedArrayPrototype, 'byteLength');
|
11623 | addGetter(TypedArrayPrototype, 'length');
|
11624 | }
|
11625 |
|
11626 | $({ target: 'Object', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, {
|
11627 | getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor,
|
11628 | defineProperty: wrappedDefineProperty
|
11629 | });
|
11630 |
|
11631 | module.exports = function (TYPE, wrapper, CLAMPED) {
|
11632 | var BYTES = TYPE.match(/\d+$/)[0] / 8;
|
11633 | var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? 'Clamped' : '') + 'Array';
|
11634 | var GETTER = 'get' + TYPE;
|
11635 | var SETTER = 'set' + TYPE;
|
11636 | var NativeTypedArrayConstructor = global[CONSTRUCTOR_NAME];
|
11637 | var TypedArrayConstructor = NativeTypedArrayConstructor;
|
11638 | var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype;
|
11639 | var exported = {};
|
11640 |
|
11641 | var getter = function (that, index) {
|
11642 | var data = getInternalState(that);
|
11643 | return data.view[GETTER](index * BYTES + data.byteOffset, true);
|
11644 | };
|
11645 |
|
11646 | var setter = function (that, index, value) {
|
11647 | var data = getInternalState(that);
|
11648 | if (CLAMPED) value = (value = round(value)) < 0 ? 0 : value > 0xFF ? 0xFF : value & 0xFF;
|
11649 | data.view[SETTER](index * BYTES + data.byteOffset, value, true);
|
11650 | };
|
11651 |
|
11652 | var addElement = function (that, index) {
|
11653 | nativeDefineProperty(that, index, {
|
11654 | get: function () {
|
11655 | return getter(this, index);
|
11656 | },
|
11657 | set: function (value) {
|
11658 | return setter(this, index, value);
|
11659 | },
|
11660 | enumerable: true
|
11661 | });
|
11662 | };
|
11663 |
|
11664 | if (!NATIVE_ARRAY_BUFFER_VIEWS) {
|
11665 | TypedArrayConstructor = wrapper(function (that, data, offset, $length) {
|
11666 | anInstance(that, TypedArrayConstructorPrototype);
|
11667 | var index = 0;
|
11668 | var byteOffset = 0;
|
11669 | var buffer, byteLength, length;
|
11670 | if (!isObject(data)) {
|
11671 | length = toIndex(data);
|
11672 | byteLength = length * BYTES;
|
11673 | buffer = new ArrayBuffer(byteLength);
|
11674 | } else if (isArrayBuffer(data)) {
|
11675 | buffer = data;
|
11676 | byteOffset = toOffset(offset, BYTES);
|
11677 | var $len = data.byteLength;
|
11678 | if ($length === undefined) {
|
11679 | if ($len % BYTES) throw RangeError(WRONG_LENGTH);
|
11680 | byteLength = $len - byteOffset;
|
11681 | if (byteLength < 0) throw RangeError(WRONG_LENGTH);
|
11682 | } else {
|
11683 | byteLength = toLength($length) * BYTES;
|
11684 | if (byteLength + byteOffset > $len) throw RangeError(WRONG_LENGTH);
|
11685 | }
|
11686 | length = byteLength / BYTES;
|
11687 | } else if (isTypedArray(data)) {
|
11688 | return fromList(TypedArrayConstructor, data);
|
11689 | } else {
|
11690 | return call(typedArrayFrom, TypedArrayConstructor, data);
|
11691 | }
|
11692 | setInternalState(that, {
|
11693 | buffer: buffer,
|
11694 | byteOffset: byteOffset,
|
11695 | byteLength: byteLength,
|
11696 | length: length,
|
11697 | view: new DataView(buffer)
|
11698 | });
|
11699 | while (index < length) addElement(that, index++);
|
11700 | });
|
11701 |
|
11702 | if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray);
|
11703 | TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create(TypedArrayPrototype);
|
11704 | } else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) {
|
11705 | TypedArrayConstructor = wrapper(function (dummy, data, typedArrayOffset, $length) {
|
11706 | anInstance(dummy, TypedArrayConstructorPrototype);
|
11707 | return inheritIfRequired(function () {
|
11708 | if (!isObject(data)) return new NativeTypedArrayConstructor(toIndex(data));
|
11709 | if (isArrayBuffer(data)) return $length !== undefined
|
11710 | ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES), $length)
|
11711 | : typedArrayOffset !== undefined
|
11712 | ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES))
|
11713 | : new NativeTypedArrayConstructor(data);
|
11714 | if (isTypedArray(data)) return fromList(TypedArrayConstructor, data);
|
11715 | return call(typedArrayFrom, TypedArrayConstructor, data);
|
11716 | }(), dummy, TypedArrayConstructor);
|
11717 | });
|
11718 |
|
11719 | if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray);
|
11720 | forEach(getOwnPropertyNames(NativeTypedArrayConstructor), function (key) {
|
11721 | if (!(key in TypedArrayConstructor)) {
|
11722 | createNonEnumerableProperty(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]);
|
11723 | }
|
11724 | });
|
11725 | TypedArrayConstructor.prototype = TypedArrayConstructorPrototype;
|
11726 | }
|
11727 |
|
11728 | if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) {
|
11729 | createNonEnumerableProperty(TypedArrayConstructorPrototype, 'constructor', TypedArrayConstructor);
|
11730 | }
|
11731 |
|
11732 | createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_CONSTRUCTOR, TypedArrayConstructor);
|
11733 |
|
11734 | if (TYPED_ARRAY_TAG) {
|
11735 | createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME);
|
11736 | }
|
11737 |
|
11738 | exported[CONSTRUCTOR_NAME] = TypedArrayConstructor;
|
11739 |
|
11740 | $({
|
11741 | global: true, forced: TypedArrayConstructor != NativeTypedArrayConstructor, sham: !NATIVE_ARRAY_BUFFER_VIEWS
|
11742 | }, exported);
|
11743 |
|
11744 | if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) {
|
11745 | createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES);
|
11746 | }
|
11747 |
|
11748 | if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) {
|
11749 | createNonEnumerableProperty(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES);
|
11750 | }
|
11751 |
|
11752 | setSpecies(CONSTRUCTOR_NAME);
|
11753 | };
|
11754 | } else module.exports = function () { };
|
11755 |
|
11756 |
|
11757 | }),
|
11758 |
|
11759 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
11760 |
|
11761 |
|
11762 | var global = __webpack_require__(3);
|
11763 | var fails = __webpack_require__(6);
|
11764 | var checkCorrectnessOfIteration = __webpack_require__(133);
|
11765 | var NATIVE_ARRAY_BUFFER_VIEWS = (__webpack_require__(171).NATIVE_ARRAY_BUFFER_VIEWS);
|
11766 |
|
11767 | var ArrayBuffer = global.ArrayBuffer;
|
11768 | var Int8Array = global.Int8Array;
|
11769 |
|
11770 | module.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () {
|
11771 | Int8Array(1);
|
11772 | }) || !fails(function () {
|
11773 | new Int8Array(-1);
|
11774 | }) || !checkCorrectnessOfIteration(function (iterable) {
|
11775 | new Int8Array();
|
11776 | new Int8Array(null);
|
11777 | new Int8Array(1.5);
|
11778 | new Int8Array(iterable);
|
11779 | }, true) || fails(function () {
|
11780 |
|
11781 | return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1;
|
11782 | });
|
11783 |
|
11784 |
|
11785 | }),
|
11786 |
|
11787 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
11788 |
|
11789 | var global = __webpack_require__(3);
|
11790 | var toPositiveInteger = __webpack_require__(371);
|
11791 |
|
11792 | var RangeError = global.RangeError;
|
11793 |
|
11794 | module.exports = function (it, BYTES) {
|
11795 | var offset = toPositiveInteger(it);
|
11796 | if (offset % BYTES) throw RangeError('Wrong offset');
|
11797 | return offset;
|
11798 | };
|
11799 |
|
11800 |
|
11801 | }),
|
11802 |
|
11803 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
11804 |
|
11805 | var global = __webpack_require__(3);
|
11806 | var toIntegerOrInfinity = __webpack_require__(56);
|
11807 |
|
11808 | var RangeError = global.RangeError;
|
11809 |
|
11810 | module.exports = function (it) {
|
11811 | var result = toIntegerOrInfinity(it);
|
11812 | if (result < 0) throw RangeError("The argument can't be less than 0");
|
11813 | return result;
|
11814 | };
|
11815 |
|
11816 |
|
11817 | }),
|
11818 |
|
11819 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
11820 |
|
11821 | var bind = __webpack_require__(78);
|
11822 | var call = __webpack_require__(7);
|
11823 | var aConstructor = __webpack_require__(174);
|
11824 | var toObject = __webpack_require__(36);
|
11825 | var lengthOfArrayLike = __webpack_require__(57);
|
11826 | var getIterator = __webpack_require__(106);
|
11827 | var getIteratorMethod = __webpack_require__(107);
|
11828 | var isArrayIteratorMethod = __webpack_require__(104);
|
11829 | var aTypedArrayConstructor = (__webpack_require__(171).aTypedArrayConstructor);
|
11830 |
|
11831 | module.exports = function from(source /* , mapfn, thisArg */) {
|
11832 | var C = aConstructor(this);
|
11833 | var O = toObject(source);
|
11834 | var argumentsLength = arguments.length;
|
11835 | var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
|
11836 | var mapping = mapfn !== undefined;
|
11837 | var iteratorMethod = getIteratorMethod(O);
|
11838 | var i, length, result, step, iterator, next;
|
11839 | if (iteratorMethod && !isArrayIteratorMethod(iteratorMethod)) {
|
11840 | iterator = getIterator(O, iteratorMethod);
|
11841 | next = iterator.next;
|
11842 | O = [];
|
11843 | while (!(step = call(next, iterator)).done) {
|
11844 | O.push(step.value);
|
11845 | }
|
11846 | }
|
11847 | if (mapping && argumentsLength > 2) {
|
11848 | mapfn = bind(mapfn, arguments[2]);
|
11849 | }
|
11850 | length = lengthOfArrayLike(O);
|
11851 | result = new (aTypedArrayConstructor(C))(length);
|
11852 | for (i = 0; length > i; i++) {
|
11853 | result[i] = mapping ? mapfn(O[i], i) : O[i];
|
11854 | }
|
11855 | return result;
|
11856 | };
|
11857 |
|
11858 |
|
11859 | }),
|
11860 |
|
11861 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11862 |
|
11863 | var createTypedArrayConstructor = __webpack_require__(368);
|
11864 |
|
11865 |
|
11866 |
|
11867 | createTypedArrayConstructor('Float64', function (init) {
|
11868 | return function Float64Array(data, byteOffset, length) {
|
11869 | return init(this, data, byteOffset, length);
|
11870 | };
|
11871 | });
|
11872 |
|
11873 |
|
11874 | }),
|
11875 |
|
11876 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11877 |
|
11878 | var createTypedArrayConstructor = __webpack_require__(368);
|
11879 |
|
11880 |
|
11881 |
|
11882 | createTypedArrayConstructor('Int8', function (init) {
|
11883 | return function Int8Array(data, byteOffset, length) {
|
11884 | return init(this, data, byteOffset, length);
|
11885 | };
|
11886 | });
|
11887 |
|
11888 |
|
11889 | }),
|
11890 |
|
11891 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11892 |
|
11893 | var createTypedArrayConstructor = __webpack_require__(368);
|
11894 |
|
11895 |
|
11896 |
|
11897 | createTypedArrayConstructor('Int16', function (init) {
|
11898 | return function Int16Array(data, byteOffset, length) {
|
11899 | return init(this, data, byteOffset, length);
|
11900 | };
|
11901 | });
|
11902 |
|
11903 |
|
11904 | }),
|
11905 |
|
11906 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11907 |
|
11908 | var createTypedArrayConstructor = __webpack_require__(368);
|
11909 |
|
11910 |
|
11911 |
|
11912 | createTypedArrayConstructor('Int32', function (init) {
|
11913 | return function Int32Array(data, byteOffset, length) {
|
11914 | return init(this, data, byteOffset, length);
|
11915 | };
|
11916 | });
|
11917 |
|
11918 |
|
11919 | }),
|
11920 |
|
11921 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11922 |
|
11923 | var createTypedArrayConstructor = __webpack_require__(368);
|
11924 |
|
11925 |
|
11926 |
|
11927 | createTypedArrayConstructor('Uint8', function (init) {
|
11928 | return function Uint8Array(data, byteOffset, length) {
|
11929 | return init(this, data, byteOffset, length);
|
11930 | };
|
11931 | });
|
11932 |
|
11933 |
|
11934 | }),
|
11935 |
|
11936 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11937 |
|
11938 | var createTypedArrayConstructor = __webpack_require__(368);
|
11939 |
|
11940 |
|
11941 |
|
11942 | createTypedArrayConstructor('Uint8', function (init) {
|
11943 | return function Uint8ClampedArray(data, byteOffset, length) {
|
11944 | return init(this, data, byteOffset, length);
|
11945 | };
|
11946 | }, true);
|
11947 |
|
11948 |
|
11949 | }),
|
11950 |
|
11951 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11952 |
|
11953 | var createTypedArrayConstructor = __webpack_require__(368);
|
11954 |
|
11955 |
|
11956 |
|
11957 | createTypedArrayConstructor('Uint16', function (init) {
|
11958 | return function Uint16Array(data, byteOffset, length) {
|
11959 | return init(this, data, byteOffset, length);
|
11960 | };
|
11961 | });
|
11962 |
|
11963 |
|
11964 | }),
|
11965 |
|
11966 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11967 |
|
11968 | var createTypedArrayConstructor = __webpack_require__(368);
|
11969 |
|
11970 |
|
11971 |
|
11972 | createTypedArrayConstructor('Uint32', function (init) {
|
11973 | return function Uint32Array(data, byteOffset, length) {
|
11974 | return init(this, data, byteOffset, length);
|
11975 | };
|
11976 | });
|
11977 |
|
11978 |
|
11979 | }),
|
11980 |
|
11981 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
11982 |
|
11983 | "use strict";
|
11984 |
|
11985 | var ArrayBufferViewCore = __webpack_require__(171);
|
11986 | var lengthOfArrayLike = __webpack_require__(57);
|
11987 | var toIntegerOrInfinity = __webpack_require__(56);
|
11988 |
|
11989 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
11990 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
11991 |
|
11992 |
|
11993 |
|
11994 | exportTypedArrayMethod('at', function at(index) {
|
11995 | var O = aTypedArray(this);
|
11996 | var len = lengthOfArrayLike(O);
|
11997 | var relativeIndex = toIntegerOrInfinity(index);
|
11998 | var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex;
|
11999 | return (k < 0 || k >= len) ? undefined : O[k];
|
12000 | });
|
12001 |
|
12002 |
|
12003 | }),
|
12004 |
|
12005 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12006 |
|
12007 | "use strict";
|
12008 |
|
12009 | var uncurryThis = __webpack_require__(12);
|
12010 | var ArrayBufferViewCore = __webpack_require__(171);
|
12011 | var $ArrayCopyWithin = __webpack_require__(117);
|
12012 |
|
12013 | var u$ArrayCopyWithin = uncurryThis($ArrayCopyWithin);
|
12014 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
12015 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
12016 |
|
12017 |
|
12018 |
|
12019 | exportTypedArrayMethod('copyWithin', function copyWithin(target, start /* , end */) {
|
12020 | return u$ArrayCopyWithin(aTypedArray(this), target, start, arguments.length > 2 ? arguments[2] : undefined);
|
12021 | });
|
12022 |
|
12023 |
|
12024 | }),
|
12025 |
|
12026 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12027 |
|
12028 | "use strict";
|
12029 |
|
12030 | var ArrayBufferViewCore = __webpack_require__(171);
|
12031 | var $every = (__webpack_require__(77).every);
|
12032 |
|
12033 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
12034 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
12035 |
|
12036 |
|
12037 |
|
12038 | exportTypedArrayMethod('every', function every(callbackfn /* , thisArg */) {
|
12039 | return $every(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
12040 | });
|
12041 |
|
12042 |
|
12043 | }),
|
12044 |
|
12045 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12046 |
|
12047 | "use strict";
|
12048 |
|
12049 | var ArrayBufferViewCore = __webpack_require__(171);
|
12050 | var call = __webpack_require__(7);
|
12051 | var $fill = __webpack_require__(121);
|
12052 |
|
12053 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
12054 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
12055 |
|
12056 |
|
12057 |
|
12058 | exportTypedArrayMethod('fill', function fill(value /* , start, end */) {
|
12059 | var length = arguments.length;
|
12060 | return call(
|
12061 | $fill,
|
12062 | aTypedArray(this),
|
12063 | value,
|
12064 | length > 1 ? arguments[1] : undefined,
|
12065 | length > 2 ? arguments[2] : undefined
|
12066 | );
|
12067 | });
|
12068 |
|
12069 |
|
12070 | }),
|
12071 |
|
12072 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12073 |
|
12074 | "use strict";
|
12075 |
|
12076 | var ArrayBufferViewCore = __webpack_require__(171);
|
12077 | var $filter = (__webpack_require__(77).filter);
|
12078 | var fromSpeciesAndList = __webpack_require__(386);
|
12079 |
|
12080 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
12081 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
12082 |
|
12083 |
|
12084 |
|
12085 | exportTypedArrayMethod('filter', function filter(callbackfn /* , thisArg */) {
|
12086 | var list = $filter(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
12087 | return fromSpeciesAndList(this, list);
|
12088 | });
|
12089 |
|
12090 |
|
12091 | }),
|
12092 |
|
12093 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
12094 |
|
12095 | var arrayFromConstructorAndList = __webpack_require__(387);
|
12096 | var typedArraySpeciesConstructor = __webpack_require__(388);
|
12097 |
|
12098 | module.exports = function (instance, list) {
|
12099 | return arrayFromConstructorAndList(typedArraySpeciesConstructor(instance), list);
|
12100 | };
|
12101 |
|
12102 |
|
12103 | }),
|
12104 |
|
12105 | (function(module) {
|
12106 |
|
12107 | module.exports = function (Constructor, list) {
|
12108 | var index = 0;
|
12109 | var length = list.length;
|
12110 | var result = new Constructor(length);
|
12111 | while (length > index) result[index] = list[index++];
|
12112 | return result;
|
12113 | };
|
12114 |
|
12115 |
|
12116 | }),
|
12117 |
|
12118 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
12119 |
|
12120 | var ArrayBufferViewCore = __webpack_require__(171);
|
12121 | var speciesConstructor = __webpack_require__(173);
|
12122 |
|
12123 | var TYPED_ARRAY_CONSTRUCTOR = ArrayBufferViewCore.TYPED_ARRAY_CONSTRUCTOR;
|
12124 | var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
|
12125 |
|
12126 |
|
12127 |
|
12128 | module.exports = function (originalArray) {
|
12129 | return aTypedArrayConstructor(speciesConstructor(originalArray, originalArray[TYPED_ARRAY_CONSTRUCTOR]));
|
12130 | };
|
12131 |
|
12132 |
|
12133 | }),
|
12134 |
|
12135 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12136 |
|
12137 | "use strict";
|
12138 |
|
12139 | var ArrayBufferViewCore = __webpack_require__(171);
|
12140 | var $find = (__webpack_require__(77).find);
|
12141 |
|
12142 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
12143 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
12144 |
|
12145 |
|
12146 |
|
12147 | exportTypedArrayMethod('find', function find(predicate /* , thisArg */) {
|
12148 | return $find(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
|
12149 | });
|
12150 |
|
12151 |
|
12152 | }),
|
12153 |
|
12154 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12155 |
|
12156 | "use strict";
|
12157 |
|
12158 | var ArrayBufferViewCore = __webpack_require__(171);
|
12159 | var $findIndex = (__webpack_require__(77).findIndex);
|
12160 |
|
12161 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
12162 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
12163 |
|
12164 |
|
12165 |
|
12166 | exportTypedArrayMethod('findIndex', function findIndex(predicate /* , thisArg */) {
|
12167 | return $findIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
|
12168 | });
|
12169 |
|
12170 |
|
12171 | }),
|
12172 |
|
12173 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12174 |
|
12175 | "use strict";
|
12176 |
|
12177 | var ArrayBufferViewCore = __webpack_require__(171);
|
12178 | var $forEach = (__webpack_require__(77).forEach);
|
12179 |
|
12180 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
12181 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
12182 |
|
12183 |
|
12184 |
|
12185 | exportTypedArrayMethod('forEach', function forEach(callbackfn /* , thisArg */) {
|
12186 | $forEach(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
12187 | });
|
12188 |
|
12189 |
|
12190 | }),
|
12191 |
|
12192 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12193 |
|
12194 | "use strict";
|
12195 |
|
12196 | var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = __webpack_require__(369);
|
12197 | var exportTypedArrayStaticMethod = (__webpack_require__(171).exportTypedArrayStaticMethod);
|
12198 | var typedArrayFrom = __webpack_require__(372);
|
12199 |
|
12200 |
|
12201 |
|
12202 | exportTypedArrayStaticMethod('from', typedArrayFrom, TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS);
|
12203 |
|
12204 |
|
12205 | }),
|
12206 |
|
12207 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12208 |
|
12209 | "use strict";
|
12210 |
|
12211 | var ArrayBufferViewCore = __webpack_require__(171);
|
12212 | var $includes = (__webpack_require__(54).includes);
|
12213 |
|
12214 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
12215 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
12216 |
|
12217 |
|
12218 |
|
12219 | exportTypedArrayMethod('includes', function includes(searchElement /* , fromIndex */) {
|
12220 | return $includes(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
|
12221 | });
|
12222 |
|
12223 |
|
12224 | }),
|
12225 |
|
12226 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12227 |
|
12228 | "use strict";
|
12229 |
|
12230 | var ArrayBufferViewCore = __webpack_require__(171);
|
12231 | var $indexOf = (__webpack_require__(54).indexOf);
|
12232 |
|
12233 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
12234 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
12235 |
|
12236 |
|
12237 |
|
12238 | exportTypedArrayMethod('indexOf', function indexOf(searchElement /* , fromIndex */) {
|
12239 | return $indexOf(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
|
12240 | });
|
12241 |
|
12242 |
|
12243 | }),
|
12244 |
|
12245 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12246 |
|
12247 | "use strict";
|
12248 |
|
12249 | var global = __webpack_require__(3);
|
12250 | var uncurryThis = __webpack_require__(12);
|
12251 | var PROPER_FUNCTION_NAME = (__webpack_require__(49).PROPER);
|
12252 | var ArrayBufferViewCore = __webpack_require__(171);
|
12253 | var ArrayIterators = __webpack_require__(137);
|
12254 | var wellKnownSymbol = __webpack_require__(30);
|
12255 |
|
12256 | var ITERATOR = wellKnownSymbol('iterator');
|
12257 | var Uint8Array = global.Uint8Array;
|
12258 | var arrayValues = uncurryThis(ArrayIterators.values);
|
12259 | var arrayKeys = uncurryThis(ArrayIterators.keys);
|
12260 | var arrayEntries = uncurryThis(ArrayIterators.entries);
|
12261 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
12262 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
12263 | var nativeTypedArrayIterator = Uint8Array && Uint8Array.prototype[ITERATOR];
|
12264 |
|
12265 | var PROPER_ARRAY_VALUES_NAME = !!nativeTypedArrayIterator && nativeTypedArrayIterator.name === 'values';
|
12266 |
|
12267 | var typedArrayValues = function values() {
|
12268 | return arrayValues(aTypedArray(this));
|
12269 | };
|
12270 |
|
12271 |
|
12272 |
|
12273 | exportTypedArrayMethod('entries', function entries() {
|
12274 | return arrayEntries(aTypedArray(this));
|
12275 | });
|
12276 |
|
12277 |
|
12278 | exportTypedArrayMethod('keys', function keys() {
|
12279 | return arrayKeys(aTypedArray(this));
|
12280 | });
|
12281 |
|
12282 |
|
12283 | exportTypedArrayMethod('values', typedArrayValues, PROPER_FUNCTION_NAME && !PROPER_ARRAY_VALUES_NAME);
|
12284 |
|
12285 |
|
12286 | exportTypedArrayMethod(ITERATOR, typedArrayValues, PROPER_FUNCTION_NAME && !PROPER_ARRAY_VALUES_NAME);
|
12287 |
|
12288 |
|
12289 | }),
|
12290 |
|
12291 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12292 |
|
12293 | "use strict";
|
12294 |
|
12295 | var ArrayBufferViewCore = __webpack_require__(171);
|
12296 | var uncurryThis = __webpack_require__(12);
|
12297 |
|
12298 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
12299 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
12300 | var $join = uncurryThis([].join);
|
12301 |
|
12302 |
|
12303 |
|
12304 | exportTypedArrayMethod('join', function join(separator) {
|
12305 | return $join(aTypedArray(this), separator);
|
12306 | });
|
12307 |
|
12308 |
|
12309 | }),
|
12310 |
|
12311 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12312 |
|
12313 | "use strict";
|
12314 |
|
12315 | var ArrayBufferViewCore = __webpack_require__(171);
|
12316 | var apply = __webpack_require__(62);
|
12317 | var $lastIndexOf = __webpack_require__(143);
|
12318 |
|
12319 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
12320 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
12321 |
|
12322 |
|
12323 |
|
12324 | exportTypedArrayMethod('lastIndexOf', function lastIndexOf(searchElement /* , fromIndex */) {
|
12325 | var length = arguments.length;
|
12326 | return apply($lastIndexOf, aTypedArray(this), length > 1 ? [searchElement, arguments[1]] : [searchElement]);
|
12327 | });
|
12328 |
|
12329 |
|
12330 | }),
|
12331 |
|
12332 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12333 |
|
12334 | "use strict";
|
12335 |
|
12336 | var ArrayBufferViewCore = __webpack_require__(171);
|
12337 | var $map = (__webpack_require__(77).map);
|
12338 | var typedArraySpeciesConstructor = __webpack_require__(388);
|
12339 |
|
12340 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
12341 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
12342 |
|
12343 |
|
12344 |
|
12345 | exportTypedArrayMethod('map', function map(mapfn /* , thisArg */) {
|
12346 | return $map(aTypedArray(this), mapfn, arguments.length > 1 ? arguments[1] : undefined, function (O, length) {
|
12347 | return new (typedArraySpeciesConstructor(O))(length);
|
12348 | });
|
12349 | });
|
12350 |
|
12351 |
|
12352 | }),
|
12353 |
|
12354 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12355 |
|
12356 | "use strict";
|
12357 |
|
12358 | var ArrayBufferViewCore = __webpack_require__(171);
|
12359 | var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = __webpack_require__(369);
|
12360 |
|
12361 | var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
|
12362 | var exportTypedArrayStaticMethod = ArrayBufferViewCore.exportTypedArrayStaticMethod;
|
12363 |
|
12364 |
|
12365 |
|
12366 | exportTypedArrayStaticMethod('of', function of(/* ...items */) {
|
12367 | var index = 0;
|
12368 | var length = arguments.length;
|
12369 | var result = new (aTypedArrayConstructor(this))(length);
|
12370 | while (length > index) result[index] = arguments[index++];
|
12371 | return result;
|
12372 | }, TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS);
|
12373 |
|
12374 |
|
12375 | }),
|
12376 |
|
12377 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12378 |
|
12379 | "use strict";
|
12380 |
|
12381 | var ArrayBufferViewCore = __webpack_require__(171);
|
12382 | var $reduce = (__webpack_require__(147).left);
|
12383 |
|
12384 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
12385 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
12386 |
|
12387 |
|
12388 |
|
12389 | exportTypedArrayMethod('reduce', function reduce(callbackfn /* , initialValue */) {
|
12390 | var length = arguments.length;
|
12391 | return $reduce(aTypedArray(this), callbackfn, length, length > 1 ? arguments[1] : undefined);
|
12392 | });
|
12393 |
|
12394 |
|
12395 | }),
|
12396 |
|
12397 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12398 |
|
12399 | "use strict";
|
12400 |
|
12401 | var ArrayBufferViewCore = __webpack_require__(171);
|
12402 | var $reduceRight = (__webpack_require__(147).right);
|
12403 |
|
12404 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
12405 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
12406 |
|
12407 |
|
12408 |
|
12409 | exportTypedArrayMethod('reduceRight', function reduceRight(callbackfn /* , initialValue */) {
|
12410 | var length = arguments.length;
|
12411 | return $reduceRight(aTypedArray(this), callbackfn, length, length > 1 ? arguments[1] : undefined);
|
12412 | });
|
12413 |
|
12414 |
|
12415 | }),
|
12416 |
|
12417 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12418 |
|
12419 | "use strict";
|
12420 |
|
12421 | var ArrayBufferViewCore = __webpack_require__(171);
|
12422 |
|
12423 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
12424 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
12425 | var floor = Math.floor;
|
12426 |
|
12427 |
|
12428 |
|
12429 | exportTypedArrayMethod('reverse', function reverse() {
|
12430 | var that = this;
|
12431 | var length = aTypedArray(that).length;
|
12432 | var middle = floor(length / 2);
|
12433 | var index = 0;
|
12434 | var value;
|
12435 | while (index < middle) {
|
12436 | value = that[index];
|
12437 | that[index++] = that[--length];
|
12438 | that[length] = value;
|
12439 | } return that;
|
12440 | });
|
12441 |
|
12442 |
|
12443 | }),
|
12444 |
|
12445 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12446 |
|
12447 | "use strict";
|
12448 |
|
12449 | var global = __webpack_require__(3);
|
12450 | var ArrayBufferViewCore = __webpack_require__(171);
|
12451 | var lengthOfArrayLike = __webpack_require__(57);
|
12452 | var toOffset = __webpack_require__(370);
|
12453 | var toObject = __webpack_require__(36);
|
12454 | var fails = __webpack_require__(6);
|
12455 |
|
12456 | var RangeError = global.RangeError;
|
12457 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
12458 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
12459 |
|
12460 | var FORCED = fails(function () {
|
12461 |
|
12462 | new Int8Array(1).set({});
|
12463 | });
|
12464 |
|
12465 |
|
12466 |
|
12467 | exportTypedArrayMethod('set', function set(arrayLike /* , offset */) {
|
12468 | aTypedArray(this);
|
12469 | var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1);
|
12470 | var length = this.length;
|
12471 | var src = toObject(arrayLike);
|
12472 | var len = lengthOfArrayLike(src);
|
12473 | var index = 0;
|
12474 | if (len + offset > length) throw RangeError('Wrong length');
|
12475 | while (index < len) this[offset + index] = src[index++];
|
12476 | }, FORCED);
|
12477 |
|
12478 |
|
12479 | }),
|
12480 |
|
12481 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12482 |
|
12483 | "use strict";
|
12484 |
|
12485 | var ArrayBufferViewCore = __webpack_require__(171);
|
12486 | var typedArraySpeciesConstructor = __webpack_require__(388);
|
12487 | var fails = __webpack_require__(6);
|
12488 | var arraySlice = __webpack_require__(72);
|
12489 |
|
12490 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
12491 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
12492 |
|
12493 | var FORCED = fails(function () {
|
12494 |
|
12495 | new Int8Array(1).slice();
|
12496 | });
|
12497 |
|
12498 |
|
12499 |
|
12500 | exportTypedArrayMethod('slice', function slice(start, end) {
|
12501 | var list = arraySlice(aTypedArray(this), start, end);
|
12502 | var C = typedArraySpeciesConstructor(this);
|
12503 | var index = 0;
|
12504 | var length = list.length;
|
12505 | var result = new C(length);
|
12506 | while (length > index) result[index] = list[index++];
|
12507 | return result;
|
12508 | }, FORCED);
|
12509 |
|
12510 |
|
12511 | }),
|
12512 |
|
12513 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12514 |
|
12515 | "use strict";
|
12516 |
|
12517 | var ArrayBufferViewCore = __webpack_require__(171);
|
12518 | var $some = (__webpack_require__(77).some);
|
12519 |
|
12520 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
12521 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
12522 |
|
12523 |
|
12524 |
|
12525 | exportTypedArrayMethod('some', function some(callbackfn /* , thisArg */) {
|
12526 | return $some(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
12527 | });
|
12528 |
|
12529 |
|
12530 | }),
|
12531 |
|
12532 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12533 |
|
12534 | "use strict";
|
12535 |
|
12536 | var global = __webpack_require__(3);
|
12537 | var uncurryThis = __webpack_require__(12);
|
12538 | var fails = __webpack_require__(6);
|
12539 | var aCallable = __webpack_require__(27);
|
12540 | var internalSort = __webpack_require__(154);
|
12541 | var ArrayBufferViewCore = __webpack_require__(171);
|
12542 | var FF = __webpack_require__(155);
|
12543 | var IE_OR_EDGE = __webpack_require__(156);
|
12544 | var V8 = __webpack_require__(24);
|
12545 | var WEBKIT = __webpack_require__(157);
|
12546 |
|
12547 | var Array = global.Array;
|
12548 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
12549 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
12550 | var Uint16Array = global.Uint16Array;
|
12551 | var un$Sort = Uint16Array && uncurryThis(Uint16Array.prototype.sort);
|
12552 |
|
12553 |
|
12554 | var ACCEPT_INCORRECT_ARGUMENTS = !!un$Sort && !(fails(function () {
|
12555 | un$Sort(new Uint16Array(2), null);
|
12556 | }) && fails(function () {
|
12557 | un$Sort(new Uint16Array(2), {});
|
12558 | }));
|
12559 |
|
12560 | var STABLE_SORT = !!un$Sort && !fails(function () {
|
12561 |
|
12562 | if (V8) return V8 < 74;
|
12563 | if (FF) return FF < 67;
|
12564 | if (IE_OR_EDGE) return true;
|
12565 | if (WEBKIT) return WEBKIT < 602;
|
12566 |
|
12567 | var array = new Uint16Array(516);
|
12568 | var expected = Array(516);
|
12569 | var index, mod;
|
12570 |
|
12571 | for (index = 0; index < 516; index++) {
|
12572 | mod = index % 4;
|
12573 | array[index] = 515 - index;
|
12574 | expected[index] = index - 2 * mod + 3;
|
12575 | }
|
12576 |
|
12577 | un$Sort(array, function (a, b) {
|
12578 | return (a / 4 | 0) - (b / 4 | 0);
|
12579 | });
|
12580 |
|
12581 | for (index = 0; index < 516; index++) {
|
12582 | if (array[index] !== expected[index]) return true;
|
12583 | }
|
12584 | });
|
12585 |
|
12586 | var getSortCompare = function (comparefn) {
|
12587 | return function (x, y) {
|
12588 | if (comparefn !== undefined) return +comparefn(x, y) || 0;
|
12589 |
|
12590 | if (y !== y) return -1;
|
12591 |
|
12592 | if (x !== x) return 1;
|
12593 | if (x === 0 && y === 0) return 1 / x > 0 && 1 / y < 0 ? 1 : -1;
|
12594 | return x > y;
|
12595 | };
|
12596 | };
|
12597 |
|
12598 |
|
12599 |
|
12600 | exportTypedArrayMethod('sort', function sort(comparefn) {
|
12601 | if (comparefn !== undefined) aCallable(comparefn);
|
12602 | if (STABLE_SORT) return un$Sort(this, comparefn);
|
12603 |
|
12604 | return internalSort(aTypedArray(this), getSortCompare(comparefn));
|
12605 | }, !STABLE_SORT || ACCEPT_INCORRECT_ARGUMENTS);
|
12606 |
|
12607 |
|
12608 | }),
|
12609 |
|
12610 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12611 |
|
12612 | "use strict";
|
12613 |
|
12614 | var ArrayBufferViewCore = __webpack_require__(171);
|
12615 | var toLength = __webpack_require__(58);
|
12616 | var toAbsoluteIndex = __webpack_require__(55);
|
12617 | var typedArraySpeciesConstructor = __webpack_require__(388);
|
12618 |
|
12619 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
12620 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
12621 |
|
12622 |
|
12623 |
|
12624 | exportTypedArrayMethod('subarray', function subarray(begin, end) {
|
12625 | var O = aTypedArray(this);
|
12626 | var length = O.length;
|
12627 | var beginIndex = toAbsoluteIndex(begin, length);
|
12628 | var C = typedArraySpeciesConstructor(O);
|
12629 | return new C(
|
12630 | O.buffer,
|
12631 | O.byteOffset + beginIndex * O.BYTES_PER_ELEMENT,
|
12632 | toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - beginIndex)
|
12633 | );
|
12634 | });
|
12635 |
|
12636 |
|
12637 | }),
|
12638 |
|
12639 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12640 |
|
12641 | "use strict";
|
12642 |
|
12643 | var global = __webpack_require__(3);
|
12644 | var apply = __webpack_require__(62);
|
12645 | var ArrayBufferViewCore = __webpack_require__(171);
|
12646 | var fails = __webpack_require__(6);
|
12647 | var arraySlice = __webpack_require__(72);
|
12648 |
|
12649 | var Int8Array = global.Int8Array;
|
12650 | var aTypedArray = ArrayBufferViewCore.aTypedArray;
|
12651 | var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
|
12652 | var $toLocaleString = [].toLocaleString;
|
12653 |
|
12654 |
|
12655 | var TO_LOCALE_STRING_BUG = !!Int8Array && fails(function () {
|
12656 | $toLocaleString.call(new Int8Array(1));
|
12657 | });
|
12658 |
|
12659 | var FORCED = fails(function () {
|
12660 | return [1, 2].toLocaleString() != new Int8Array([1, 2]).toLocaleString();
|
12661 | }) || !fails(function () {
|
12662 | Int8Array.prototype.toLocaleString.call([1, 2]);
|
12663 | });
|
12664 |
|
12665 |
|
12666 |
|
12667 | exportTypedArrayMethod('toLocaleString', function toLocaleString() {
|
12668 | return apply(
|
12669 | $toLocaleString,
|
12670 | TO_LOCALE_STRING_BUG ? arraySlice(aTypedArray(this)) : aTypedArray(this),
|
12671 | arraySlice(arguments)
|
12672 | );
|
12673 | }, FORCED);
|
12674 |
|
12675 |
|
12676 | }),
|
12677 |
|
12678 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12679 |
|
12680 | "use strict";
|
12681 |
|
12682 | var exportTypedArrayMethod = (__webpack_require__(171).exportTypedArrayMethod);
|
12683 | var fails = __webpack_require__(6);
|
12684 | var global = __webpack_require__(3);
|
12685 | var uncurryThis = __webpack_require__(12);
|
12686 |
|
12687 | var Uint8Array = global.Uint8Array;
|
12688 | var Uint8ArrayPrototype = Uint8Array && Uint8Array.prototype || {};
|
12689 | var arrayToString = [].toString;
|
12690 | var join = uncurryThis([].join);
|
12691 |
|
12692 | if (fails(function () { arrayToString.call({}); })) {
|
12693 | arrayToString = function toString() {
|
12694 | return join(this);
|
12695 | };
|
12696 | }
|
12697 |
|
12698 | var IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString != arrayToString;
|
12699 |
|
12700 |
|
12701 |
|
12702 | exportTypedArrayMethod('toString', arrayToString, IS_NOT_ARRAY_METHOD);
|
12703 |
|
12704 |
|
12705 | }),
|
12706 |
|
12707 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12708 |
|
12709 | "use strict";
|
12710 |
|
12711 | var $ = __webpack_require__(2);
|
12712 | var uncurryThis = __webpack_require__(12);
|
12713 | var toString = __webpack_require__(64);
|
12714 |
|
12715 | var fromCharCode = String.fromCharCode;
|
12716 | var charAt = uncurryThis(''.charAt);
|
12717 | var exec = uncurryThis(/./.exec);
|
12718 | var stringSlice = uncurryThis(''.slice);
|
12719 |
|
12720 | var hex2 = /^[\da-f]{2}$/i;
|
12721 | var hex4 = /^[\da-f]{4}$/i;
|
12722 |
|
12723 |
|
12724 |
|
12725 | $({ global: true }, {
|
12726 | unescape: function unescape(string) {
|
12727 | var str = toString(string);
|
12728 | var result = '';
|
12729 | var length = str.length;
|
12730 | var index = 0;
|
12731 | var chr, part;
|
12732 | while (index < length) {
|
12733 | chr = charAt(str, index++);
|
12734 | if (chr === '%') {
|
12735 | if (charAt(str, index) === 'u') {
|
12736 | part = stringSlice(str, index + 1, index + 5);
|
12737 | if (exec(hex4, part)) {
|
12738 | result += fromCharCode(parseInt(part, 16));
|
12739 | index += 5;
|
12740 | continue;
|
12741 | }
|
12742 | } else {
|
12743 | part = stringSlice(str, index, index + 2);
|
12744 | if (exec(hex2, part)) {
|
12745 | result += fromCharCode(parseInt(part, 16));
|
12746 | index += 2;
|
12747 | continue;
|
12748 | }
|
12749 | }
|
12750 | }
|
12751 | result += chr;
|
12752 | } return result;
|
12753 | }
|
12754 | });
|
12755 |
|
12756 |
|
12757 | }),
|
12758 |
|
12759 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12760 |
|
12761 | "use strict";
|
12762 |
|
12763 | var global = __webpack_require__(3);
|
12764 | var uncurryThis = __webpack_require__(12);
|
12765 | var redefineAll = __webpack_require__(166);
|
12766 | var InternalMetadataModule = __webpack_require__(198);
|
12767 | var collection = __webpack_require__(197);
|
12768 | var collectionWeak = __webpack_require__(412);
|
12769 | var isObject = __webpack_require__(17);
|
12770 | var isExtensible = __webpack_require__(199);
|
12771 | var enforceIternalState = (__webpack_require__(45).enforce);
|
12772 | var NATIVE_WEAK_MAP = __webpack_require__(46);
|
12773 |
|
12774 | var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;
|
12775 | var InternalWeakMap;
|
12776 |
|
12777 | var wrapper = function (init) {
|
12778 | return function WeakMap() {
|
12779 | return init(this, arguments.length ? arguments[0] : undefined);
|
12780 | };
|
12781 | };
|
12782 |
|
12783 |
|
12784 |
|
12785 | var $WeakMap = collection('WeakMap', wrapper, collectionWeak);
|
12786 |
|
12787 |
|
12788 |
|
12789 |
|
12790 | if (NATIVE_WEAK_MAP && IS_IE11) {
|
12791 | InternalWeakMap = collectionWeak.getConstructor(wrapper, 'WeakMap', true);
|
12792 | InternalMetadataModule.enable();
|
12793 | var WeakMapPrototype = $WeakMap.prototype;
|
12794 | var nativeDelete = uncurryThis(WeakMapPrototype['delete']);
|
12795 | var nativeHas = uncurryThis(WeakMapPrototype.has);
|
12796 | var nativeGet = uncurryThis(WeakMapPrototype.get);
|
12797 | var nativeSet = uncurryThis(WeakMapPrototype.set);
|
12798 | redefineAll(WeakMapPrototype, {
|
12799 | 'delete': function (key) {
|
12800 | if (isObject(key) && !isExtensible(key)) {
|
12801 | var state = enforceIternalState(this);
|
12802 | if (!state.frozen) state.frozen = new InternalWeakMap();
|
12803 | return nativeDelete(this, key) || state.frozen['delete'](key);
|
12804 | } return nativeDelete(this, key);
|
12805 | },
|
12806 | has: function has(key) {
|
12807 | if (isObject(key) && !isExtensible(key)) {
|
12808 | var state = enforceIternalState(this);
|
12809 | if (!state.frozen) state.frozen = new InternalWeakMap();
|
12810 | return nativeHas(this, key) || state.frozen.has(key);
|
12811 | } return nativeHas(this, key);
|
12812 | },
|
12813 | get: function get(key) {
|
12814 | if (isObject(key) && !isExtensible(key)) {
|
12815 | var state = enforceIternalState(this);
|
12816 | if (!state.frozen) state.frozen = new InternalWeakMap();
|
12817 | return nativeHas(this, key) ? nativeGet(this, key) : state.frozen.get(key);
|
12818 | } return nativeGet(this, key);
|
12819 | },
|
12820 | set: function set(key, value) {
|
12821 | if (isObject(key) && !isExtensible(key)) {
|
12822 | var state = enforceIternalState(this);
|
12823 | if (!state.frozen) state.frozen = new InternalWeakMap();
|
12824 | nativeHas(this, key) ? nativeSet(this, key, value) : state.frozen.set(key, value);
|
12825 | } else nativeSet(this, key, value);
|
12826 | return this;
|
12827 | }
|
12828 | });
|
12829 | }
|
12830 |
|
12831 |
|
12832 | }),
|
12833 |
|
12834 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
12835 |
|
12836 | "use strict";
|
12837 |
|
12838 | var uncurryThis = __webpack_require__(12);
|
12839 | var redefineAll = __webpack_require__(166);
|
12840 | var getWeakData = (__webpack_require__(198).getWeakData);
|
12841 | var anObject = __webpack_require__(42);
|
12842 | var isObject = __webpack_require__(17);
|
12843 | var anInstance = __webpack_require__(167);
|
12844 | var iterate = __webpack_require__(103);
|
12845 | var ArrayIterationModule = __webpack_require__(77);
|
12846 | var hasOwn = __webpack_require__(35);
|
12847 | var InternalStateModule = __webpack_require__(45);
|
12848 |
|
12849 | var setInternalState = InternalStateModule.set;
|
12850 | var internalStateGetterFor = InternalStateModule.getterFor;
|
12851 | var find = ArrayIterationModule.find;
|
12852 | var findIndex = ArrayIterationModule.findIndex;
|
12853 | var splice = uncurryThis([].splice);
|
12854 | var id = 0;
|
12855 |
|
12856 |
|
12857 | var uncaughtFrozenStore = function (store) {
|
12858 | return store.frozen || (store.frozen = new UncaughtFrozenStore());
|
12859 | };
|
12860 |
|
12861 | var UncaughtFrozenStore = function () {
|
12862 | this.entries = [];
|
12863 | };
|
12864 |
|
12865 | var findUncaughtFrozen = function (store, key) {
|
12866 | return find(store.entries, function (it) {
|
12867 | return it[0] === key;
|
12868 | });
|
12869 | };
|
12870 |
|
12871 | UncaughtFrozenStore.prototype = {
|
12872 | get: function (key) {
|
12873 | var entry = findUncaughtFrozen(this, key);
|
12874 | if (entry) return entry[1];
|
12875 | },
|
12876 | has: function (key) {
|
12877 | return !!findUncaughtFrozen(this, key);
|
12878 | },
|
12879 | set: function (key, value) {
|
12880 | var entry = findUncaughtFrozen(this, key);
|
12881 | if (entry) entry[1] = value;
|
12882 | else this.entries.push([key, value]);
|
12883 | },
|
12884 | 'delete': function (key) {
|
12885 | var index = findIndex(this.entries, function (it) {
|
12886 | return it[0] === key;
|
12887 | });
|
12888 | if (~index) splice(this.entries, index, 1);
|
12889 | return !!~index;
|
12890 | }
|
12891 | };
|
12892 |
|
12893 | module.exports = {
|
12894 | getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
|
12895 | var Constructor = wrapper(function (that, iterable) {
|
12896 | anInstance(that, Prototype);
|
12897 | setInternalState(that, {
|
12898 | type: CONSTRUCTOR_NAME,
|
12899 | id: id++,
|
12900 | frozen: undefined
|
12901 | });
|
12902 | if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
|
12903 | });
|
12904 |
|
12905 | var Prototype = Constructor.prototype;
|
12906 |
|
12907 | var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
12908 |
|
12909 | var define = function (that, key, value) {
|
12910 | var state = getInternalState(that);
|
12911 | var data = getWeakData(anObject(key), true);
|
12912 | if (data === true) uncaughtFrozenStore(state).set(key, value);
|
12913 | else data[state.id] = value;
|
12914 | return that;
|
12915 | };
|
12916 |
|
12917 | redefineAll(Prototype, {
|
12918 |
|
12919 |
|
12920 |
|
12921 | 'delete': function (key) {
|
12922 | var state = getInternalState(this);
|
12923 | if (!isObject(key)) return false;
|
12924 | var data = getWeakData(key);
|
12925 | if (data === true) return uncaughtFrozenStore(state)['delete'](key);
|
12926 | return data && hasOwn(data, state.id) && delete data[state.id];
|
12927 | },
|
12928 |
|
12929 |
|
12930 |
|
12931 | has: function has(key) {
|
12932 | var state = getInternalState(this);
|
12933 | if (!isObject(key)) return false;
|
12934 | var data = getWeakData(key);
|
12935 | if (data === true) return uncaughtFrozenStore(state).has(key);
|
12936 | return data && hasOwn(data, state.id);
|
12937 | }
|
12938 | });
|
12939 |
|
12940 | redefineAll(Prototype, IS_MAP ? {
|
12941 |
|
12942 |
|
12943 | get: function get(key) {
|
12944 | var state = getInternalState(this);
|
12945 | if (isObject(key)) {
|
12946 | var data = getWeakData(key);
|
12947 | if (data === true) return uncaughtFrozenStore(state).get(key);
|
12948 | return data ? data[state.id] : undefined;
|
12949 | }
|
12950 | },
|
12951 |
|
12952 |
|
12953 | set: function set(key, value) {
|
12954 | return define(this, key, value);
|
12955 | }
|
12956 | } : {
|
12957 |
|
12958 |
|
12959 | add: function add(value) {
|
12960 | return define(this, value, true);
|
12961 | }
|
12962 | });
|
12963 |
|
12964 | return Constructor;
|
12965 | }
|
12966 | };
|
12967 |
|
12968 |
|
12969 | }),
|
12970 |
|
12971 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12972 |
|
12973 | "use strict";
|
12974 |
|
12975 | var collection = __webpack_require__(197);
|
12976 | var collectionWeak = __webpack_require__(412);
|
12977 |
|
12978 |
|
12979 |
|
12980 | collection('WeakSet', function (init) {
|
12981 | return function WeakSet() { return init(this, arguments.length ? arguments[0] : undefined); };
|
12982 | }, collectionWeak);
|
12983 |
|
12984 |
|
12985 | }),
|
12986 |
|
12987 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
12988 |
|
12989 | var global = __webpack_require__(3);
|
12990 | var DOMIterables = __webpack_require__(415);
|
12991 | var DOMTokenListPrototype = __webpack_require__(416);
|
12992 | var forEach = __webpack_require__(129);
|
12993 | var createNonEnumerableProperty = __webpack_require__(40);
|
12994 |
|
12995 | var handlePrototype = function (CollectionPrototype) {
|
12996 |
|
12997 | if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {
|
12998 | createNonEnumerableProperty(CollectionPrototype, 'forEach', forEach);
|
12999 | } catch (error) {
|
13000 | CollectionPrototype.forEach = forEach;
|
13001 | }
|
13002 | };
|
13003 |
|
13004 | for (var COLLECTION_NAME in DOMIterables) {
|
13005 | if (DOMIterables[COLLECTION_NAME]) {
|
13006 | handlePrototype(global[COLLECTION_NAME] && global[COLLECTION_NAME].prototype);
|
13007 | }
|
13008 | }
|
13009 |
|
13010 | handlePrototype(DOMTokenListPrototype);
|
13011 |
|
13012 |
|
13013 | }),
|
13014 |
|
13015 | (function(module) {
|
13016 |
|
13017 |
|
13018 |
|
13019 | module.exports = {
|
13020 | CSSRuleList: 0,
|
13021 | CSSStyleDeclaration: 0,
|
13022 | CSSValueList: 0,
|
13023 | ClientRectList: 0,
|
13024 | DOMRectList: 0,
|
13025 | DOMStringList: 0,
|
13026 | DOMTokenList: 1,
|
13027 | DataTransferItemList: 0,
|
13028 | FileList: 0,
|
13029 | HTMLAllCollection: 0,
|
13030 | HTMLCollection: 0,
|
13031 | HTMLFormElement: 0,
|
13032 | HTMLSelectElement: 0,
|
13033 | MediaList: 0,
|
13034 | MimeTypeArray: 0,
|
13035 | NamedNodeMap: 0,
|
13036 | NodeList: 1,
|
13037 | PaintRequestList: 0,
|
13038 | Plugin: 0,
|
13039 | PluginArray: 0,
|
13040 | SVGLengthList: 0,
|
13041 | SVGNumberList: 0,
|
13042 | SVGPathSegList: 0,
|
13043 | SVGPointList: 0,
|
13044 | SVGStringList: 0,
|
13045 | SVGTransformList: 0,
|
13046 | SourceBufferList: 0,
|
13047 | StyleSheetList: 0,
|
13048 | TextTrackCueList: 0,
|
13049 | TextTrackList: 0,
|
13050 | TouchList: 0
|
13051 | };
|
13052 |
|
13053 |
|
13054 | }),
|
13055 |
|
13056 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
13057 |
|
13058 |
|
13059 | var documentCreateElement = __webpack_require__(39);
|
13060 |
|
13061 | var classList = documentCreateElement('span').classList;
|
13062 | var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype;
|
13063 |
|
13064 | module.exports = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype;
|
13065 |
|
13066 |
|
13067 | }),
|
13068 |
|
13069 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
13070 |
|
13071 | var global = __webpack_require__(3);
|
13072 | var DOMIterables = __webpack_require__(415);
|
13073 | var DOMTokenListPrototype = __webpack_require__(416);
|
13074 | var ArrayIteratorMethods = __webpack_require__(137);
|
13075 | var createNonEnumerableProperty = __webpack_require__(40);
|
13076 | var wellKnownSymbol = __webpack_require__(30);
|
13077 |
|
13078 | var ITERATOR = wellKnownSymbol('iterator');
|
13079 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
13080 | var ArrayValues = ArrayIteratorMethods.values;
|
13081 |
|
13082 | var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
|
13083 | if (CollectionPrototype) {
|
13084 |
|
13085 | if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
|
13086 | createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
|
13087 | } catch (error) {
|
13088 | CollectionPrototype[ITERATOR] = ArrayValues;
|
13089 | }
|
13090 | if (!CollectionPrototype[TO_STRING_TAG]) {
|
13091 | createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
|
13092 | }
|
13093 | if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
|
13094 |
|
13095 | if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
|
13096 | createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
|
13097 | } catch (error) {
|
13098 | CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
|
13099 | }
|
13100 | }
|
13101 | }
|
13102 | };
|
13103 |
|
13104 | for (var COLLECTION_NAME in DOMIterables) {
|
13105 | handlePrototype(global[COLLECTION_NAME] && global[COLLECTION_NAME].prototype, COLLECTION_NAME);
|
13106 | }
|
13107 |
|
13108 | handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
|
13109 |
|
13110 |
|
13111 | }),
|
13112 |
|
13113 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
13114 |
|
13115 | var $ = __webpack_require__(2);
|
13116 | var global = __webpack_require__(3);
|
13117 | var task = __webpack_require__(280);
|
13118 |
|
13119 | var FORCED = !global.setImmediate || !global.clearImmediate;
|
13120 |
|
13121 |
|
13122 | $({ global: true, bind: true, enumerable: true, forced: FORCED }, {
|
13123 |
|
13124 |
|
13125 | setImmediate: task.set,
|
13126 |
|
13127 |
|
13128 | clearImmediate: task.clear
|
13129 | });
|
13130 |
|
13131 |
|
13132 | }),
|
13133 |
|
13134 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
13135 |
|
13136 | var $ = __webpack_require__(2);
|
13137 | var global = __webpack_require__(3);
|
13138 | var microtask = __webpack_require__(282);
|
13139 | var IS_NODE = __webpack_require__(148);
|
13140 |
|
13141 | var process = global.process;
|
13142 |
|
13143 |
|
13144 |
|
13145 | $({ global: true, enumerable: true, noTargetGet: true }, {
|
13146 | queueMicrotask: function queueMicrotask(fn) {
|
13147 | var domain = IS_NODE && process.domain;
|
13148 | microtask(domain ? domain.bind(fn) : fn);
|
13149 | }
|
13150 | });
|
13151 |
|
13152 |
|
13153 | }),
|
13154 |
|
13155 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
13156 |
|
13157 | var $ = __webpack_require__(2);
|
13158 | var global = __webpack_require__(3);
|
13159 | var apply = __webpack_require__(62);
|
13160 | var isCallable = __webpack_require__(18);
|
13161 | var userAgent = __webpack_require__(25);
|
13162 | var arraySlice = __webpack_require__(72);
|
13163 |
|
13164 | var MSIE = /MSIE .\./.test(userAgent);
|
13165 | var Function = global.Function;
|
13166 |
|
13167 | var wrap = function (scheduler) {
|
13168 | return function (handler, timeout /* , ...arguments */) {
|
13169 | var boundArgs = arguments.length > 2;
|
13170 | var args = boundArgs ? arraySlice(arguments, 2) : undefined;
|
13171 | return scheduler(boundArgs ? function () {
|
13172 | apply(isCallable(handler) ? handler : Function(handler), this, args);
|
13173 | } : handler, timeout);
|
13174 | };
|
13175 | };
|
13176 |
|
13177 |
|
13178 |
|
13179 | $({ global: true, bind: true, forced: MSIE }, {
|
13180 |
|
13181 |
|
13182 | setTimeout: wrap(global.setTimeout),
|
13183 |
|
13184 |
|
13185 | setInterval: wrap(global.setInterval)
|
13186 | });
|
13187 |
|
13188 |
|
13189 | }),
|
13190 |
|
13191 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
13192 |
|
13193 | "use strict";
|
13194 |
|
13195 |
|
13196 | __webpack_require__(330);
|
13197 | var $ = __webpack_require__(2);
|
13198 | var DESCRIPTORS = __webpack_require__(5);
|
13199 | var USE_NATIVE_URL = __webpack_require__(422);
|
13200 | var global = __webpack_require__(3);
|
13201 | var bind = __webpack_require__(78);
|
13202 | var call = __webpack_require__(7);
|
13203 | var uncurryThis = __webpack_require__(12);
|
13204 | var defineProperties = __webpack_require__(68);
|
13205 | var redefine = __webpack_require__(43);
|
13206 | var anInstance = __webpack_require__(167);
|
13207 | var hasOwn = __webpack_require__(35);
|
13208 | var assign = __webpack_require__(246);
|
13209 | var arrayFrom = __webpack_require__(131);
|
13210 | var arraySlice = __webpack_require__(72);
|
13211 | var codeAt = (__webpack_require__(324).codeAt);
|
13212 | var toASCII = __webpack_require__(423);
|
13213 | var $toString = __webpack_require__(64);
|
13214 | var setToStringTag = __webpack_require__(76);
|
13215 | var URLSearchParamsModule = __webpack_require__(424);
|
13216 | var InternalStateModule = __webpack_require__(45);
|
13217 |
|
13218 | var setInternalState = InternalStateModule.set;
|
13219 | var getInternalURLState = InternalStateModule.getterFor('URL');
|
13220 | var URLSearchParams = URLSearchParamsModule.URLSearchParams;
|
13221 | var getInternalSearchParamsState = URLSearchParamsModule.getState;
|
13222 |
|
13223 | var NativeURL = global.URL;
|
13224 | var TypeError = global.TypeError;
|
13225 | var parseInt = global.parseInt;
|
13226 | var floor = Math.floor;
|
13227 | var pow = Math.pow;
|
13228 | var charAt = uncurryThis(''.charAt);
|
13229 | var exec = uncurryThis(/./.exec);
|
13230 | var join = uncurryThis([].join);
|
13231 | var numberToString = uncurryThis(1.0.toString);
|
13232 | var pop = uncurryThis([].pop);
|
13233 | var push = uncurryThis([].push);
|
13234 | var replace = uncurryThis(''.replace);
|
13235 | var shift = uncurryThis([].shift);
|
13236 | var split = uncurryThis(''.split);
|
13237 | var stringSlice = uncurryThis(''.slice);
|
13238 | var toLowerCase = uncurryThis(''.toLowerCase);
|
13239 | var unshift = uncurryThis([].unshift);
|
13240 |
|
13241 | var INVALID_AUTHORITY = 'Invalid authority';
|
13242 | var INVALID_SCHEME = 'Invalid scheme';
|
13243 | var INVALID_HOST = 'Invalid host';
|
13244 | var INVALID_PORT = 'Invalid port';
|
13245 |
|
13246 | var ALPHA = /[a-z]/i;
|
13247 |
|
13248 | var ALPHANUMERIC = /[\d+-.a-z]/i;
|
13249 | var DIGIT = /\d/;
|
13250 | var HEX_START = /^0x/i;
|
13251 | var OCT = /^[0-7]+$/;
|
13252 | var DEC = /^\d+$/;
|
13253 | var HEX = /^[\da-f]+$/i;
|
13254 |
|
13255 | var FORBIDDEN_HOST_CODE_POINT = /[\0\t\n\r #%/:<>?@[\\\]^|]/;
|
13256 | var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\0\t\n\r #/:<>?@[\\\]^|]/;
|
13257 | var LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\u0000-\u0020]+|[\u0000-\u0020]+$/g;
|
13258 | var TAB_AND_NEW_LINE = /[\t\n\r]/g;
|
13259 |
|
13260 | var EOF;
|
13261 |
|
13262 | var parseHost = function (url, input) {
|
13263 | var result, codePoints, index;
|
13264 | if (charAt(input, 0) == '[') {
|
13265 | if (charAt(input, input.length - 1) != ']') return INVALID_HOST;
|
13266 | result = parseIPv6(stringSlice(input, 1, -1));
|
13267 | if (!result) return INVALID_HOST;
|
13268 | url.host = result;
|
13269 |
|
13270 | } else if (!isSpecial(url)) {
|
13271 | if (exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT, input)) return INVALID_HOST;
|
13272 | result = '';
|
13273 | codePoints = arrayFrom(input);
|
13274 | for (index = 0; index < codePoints.length; index++) {
|
13275 | result += percentEncode(codePoints[index], C0ControlPercentEncodeSet);
|
13276 | }
|
13277 | url.host = result;
|
13278 | } else {
|
13279 | input = toASCII(input);
|
13280 | if (exec(FORBIDDEN_HOST_CODE_POINT, input)) return INVALID_HOST;
|
13281 | result = parseIPv4(input);
|
13282 | if (result === null) return INVALID_HOST;
|
13283 | url.host = result;
|
13284 | }
|
13285 | };
|
13286 |
|
13287 | var parseIPv4 = function (input) {
|
13288 | var parts = split(input, '.');
|
13289 | var partsLength, numbers, index, part, radix, number, ipv4;
|
13290 | if (parts.length && parts[parts.length - 1] == '') {
|
13291 | parts.length--;
|
13292 | }
|
13293 | partsLength = parts.length;
|
13294 | if (partsLength > 4) return input;
|
13295 | numbers = [];
|
13296 | for (index = 0; index < partsLength; index++) {
|
13297 | part = parts[index];
|
13298 | if (part == '') return input;
|
13299 | radix = 10;
|
13300 | if (part.length > 1 && charAt(part, 0) == '0') {
|
13301 | radix = exec(HEX_START, part) ? 16 : 8;
|
13302 | part = stringSlice(part, radix == 8 ? 1 : 2);
|
13303 | }
|
13304 | if (part === '') {
|
13305 | number = 0;
|
13306 | } else {
|
13307 | if (!exec(radix == 10 ? DEC : radix == 8 ? OCT : HEX, part)) return input;
|
13308 | number = parseInt(part, radix);
|
13309 | }
|
13310 | push(numbers, number);
|
13311 | }
|
13312 | for (index = 0; index < partsLength; index++) {
|
13313 | number = numbers[index];
|
13314 | if (index == partsLength - 1) {
|
13315 | if (number >= pow(256, 5 - partsLength)) return null;
|
13316 | } else if (number > 255) return null;
|
13317 | }
|
13318 | ipv4 = pop(numbers);
|
13319 | for (index = 0; index < numbers.length; index++) {
|
13320 | ipv4 += numbers[index] * pow(256, 3 - index);
|
13321 | }
|
13322 | return ipv4;
|
13323 | };
|
13324 |
|
13325 |
|
13326 | var parseIPv6 = function (input) {
|
13327 | var address = [0, 0, 0, 0, 0, 0, 0, 0];
|
13328 | var pieceIndex = 0;
|
13329 | var compress = null;
|
13330 | var pointer = 0;
|
13331 | var value, length, numbersSeen, ipv4Piece, number, swaps, swap;
|
13332 |
|
13333 | var chr = function () {
|
13334 | return charAt(input, pointer);
|
13335 | };
|
13336 |
|
13337 | if (chr() == ':') {
|
13338 | if (charAt(input, 1) != ':') return;
|
13339 | pointer += 2;
|
13340 | pieceIndex++;
|
13341 | compress = pieceIndex;
|
13342 | }
|
13343 | while (chr()) {
|
13344 | if (pieceIndex == 8) return;
|
13345 | if (chr() == ':') {
|
13346 | if (compress !== null) return;
|
13347 | pointer++;
|
13348 | pieceIndex++;
|
13349 | compress = pieceIndex;
|
13350 | continue;
|
13351 | }
|
13352 | value = length = 0;
|
13353 | while (length < 4 && exec(HEX, chr())) {
|
13354 | value = value * 16 + parseInt(chr(), 16);
|
13355 | pointer++;
|
13356 | length++;
|
13357 | }
|
13358 | if (chr() == '.') {
|
13359 | if (length == 0) return;
|
13360 | pointer -= length;
|
13361 | if (pieceIndex > 6) return;
|
13362 | numbersSeen = 0;
|
13363 | while (chr()) {
|
13364 | ipv4Piece = null;
|
13365 | if (numbersSeen > 0) {
|
13366 | if (chr() == '.' && numbersSeen < 4) pointer++;
|
13367 | else return;
|
13368 | }
|
13369 | if (!exec(DIGIT, chr())) return;
|
13370 | while (exec(DIGIT, chr())) {
|
13371 | number = parseInt(chr(), 10);
|
13372 | if (ipv4Piece === null) ipv4Piece = number;
|
13373 | else if (ipv4Piece == 0) return;
|
13374 | else ipv4Piece = ipv4Piece * 10 + number;
|
13375 | if (ipv4Piece > 255) return;
|
13376 | pointer++;
|
13377 | }
|
13378 | address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece;
|
13379 | numbersSeen++;
|
13380 | if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++;
|
13381 | }
|
13382 | if (numbersSeen != 4) return;
|
13383 | break;
|
13384 | } else if (chr() == ':') {
|
13385 | pointer++;
|
13386 | if (!chr()) return;
|
13387 | } else if (chr()) return;
|
13388 | address[pieceIndex++] = value;
|
13389 | }
|
13390 | if (compress !== null) {
|
13391 | swaps = pieceIndex - compress;
|
13392 | pieceIndex = 7;
|
13393 | while (pieceIndex != 0 && swaps > 0) {
|
13394 | swap = address[pieceIndex];
|
13395 | address[pieceIndex--] = address[compress + swaps - 1];
|
13396 | address[compress + --swaps] = swap;
|
13397 | }
|
13398 | } else if (pieceIndex != 8) return;
|
13399 | return address;
|
13400 | };
|
13401 |
|
13402 | var findLongestZeroSequence = function (ipv6) {
|
13403 | var maxIndex = null;
|
13404 | var maxLength = 1;
|
13405 | var currStart = null;
|
13406 | var currLength = 0;
|
13407 | var index = 0;
|
13408 | for (; index < 8; index++) {
|
13409 | if (ipv6[index] !== 0) {
|
13410 | if (currLength > maxLength) {
|
13411 | maxIndex = currStart;
|
13412 | maxLength = currLength;
|
13413 | }
|
13414 | currStart = null;
|
13415 | currLength = 0;
|
13416 | } else {
|
13417 | if (currStart === null) currStart = index;
|
13418 | ++currLength;
|
13419 | }
|
13420 | }
|
13421 | if (currLength > maxLength) {
|
13422 | maxIndex = currStart;
|
13423 | maxLength = currLength;
|
13424 | }
|
13425 | return maxIndex;
|
13426 | };
|
13427 |
|
13428 | var serializeHost = function (host) {
|
13429 | var result, index, compress, ignore0;
|
13430 |
|
13431 | if (typeof host == 'number') {
|
13432 | result = [];
|
13433 | for (index = 0; index < 4; index++) {
|
13434 | unshift(result, host % 256);
|
13435 | host = floor(host / 256);
|
13436 | } return join(result, '.');
|
13437 |
|
13438 | } else if (typeof host == 'object') {
|
13439 | result = '';
|
13440 | compress = findLongestZeroSequence(host);
|
13441 | for (index = 0; index < 8; index++) {
|
13442 | if (ignore0 && host[index] === 0) continue;
|
13443 | if (ignore0) ignore0 = false;
|
13444 | if (compress === index) {
|
13445 | result += index ? ':' : '::';
|
13446 | ignore0 = true;
|
13447 | } else {
|
13448 | result += numberToString(host[index], 16);
|
13449 | if (index < 7) result += ':';
|
13450 | }
|
13451 | }
|
13452 | return '[' + result + ']';
|
13453 | } return host;
|
13454 | };
|
13455 |
|
13456 | var C0ControlPercentEncodeSet = {};
|
13457 | var fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, {
|
13458 | ' ': 1, '"': 1, '<': 1, '>': 1, '`': 1
|
13459 | });
|
13460 | var pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, {
|
13461 | '#': 1, '?': 1, '{': 1, '}': 1
|
13462 | });
|
13463 | var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, {
|
13464 | '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\': 1, ']': 1, '^': 1, '|': 1
|
13465 | });
|
13466 |
|
13467 | var percentEncode = function (chr, set) {
|
13468 | var code = codeAt(chr, 0);
|
13469 | return code > 0x20 && code < 0x7F && !hasOwn(set, chr) ? chr : encodeURIComponent(chr);
|
13470 | };
|
13471 |
|
13472 | var specialSchemes = {
|
13473 | ftp: 21,
|
13474 | file: null,
|
13475 | http: 80,
|
13476 | https: 443,
|
13477 | ws: 80,
|
13478 | wss: 443
|
13479 | };
|
13480 |
|
13481 | var isSpecial = function (url) {
|
13482 | return hasOwn(specialSchemes, url.scheme);
|
13483 | };
|
13484 |
|
13485 | var includesCredentials = function (url) {
|
13486 | return url.username != '' || url.password != '';
|
13487 | };
|
13488 |
|
13489 | var cannotHaveUsernamePasswordPort = function (url) {
|
13490 | return !url.host || url.cannotBeABaseURL || url.scheme == 'file';
|
13491 | };
|
13492 |
|
13493 | var isWindowsDriveLetter = function (string, normalized) {
|
13494 | var second;
|
13495 | return string.length == 2 && exec(ALPHA, charAt(string, 0))
|
13496 | && ((second = charAt(string, 1)) == ':' || (!normalized && second == '|'));
|
13497 | };
|
13498 |
|
13499 | var startsWithWindowsDriveLetter = function (string) {
|
13500 | var third;
|
13501 | return string.length > 1 && isWindowsDriveLetter(stringSlice(string, 0, 2)) && (
|
13502 | string.length == 2 ||
|
13503 | ((third = charAt(string, 2)) === '/' || third === '\\' || third === '?' || third === '#')
|
13504 | );
|
13505 | };
|
13506 |
|
13507 | var shortenURLsPath = function (url) {
|
13508 | var path = url.path;
|
13509 | var pathSize = path.length;
|
13510 | if (pathSize && (url.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) {
|
13511 | path.length--;
|
13512 | }
|
13513 | };
|
13514 |
|
13515 | var isSingleDot = function (segment) {
|
13516 | return segment === '.' || toLowerCase(segment) === '%2e';
|
13517 | };
|
13518 |
|
13519 | var isDoubleDot = function (segment) {
|
13520 | segment = toLowerCase(segment);
|
13521 | return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e';
|
13522 | };
|
13523 |
|
13524 |
|
13525 | var SCHEME_START = {};
|
13526 | var SCHEME = {};
|
13527 | var NO_SCHEME = {};
|
13528 | var SPECIAL_RELATIVE_OR_AUTHORITY = {};
|
13529 | var PATH_OR_AUTHORITY = {};
|
13530 | var RELATIVE = {};
|
13531 | var RELATIVE_SLASH = {};
|
13532 | var SPECIAL_AUTHORITY_SLASHES = {};
|
13533 | var SPECIAL_AUTHORITY_IGNORE_SLASHES = {};
|
13534 | var AUTHORITY = {};
|
13535 | var HOST = {};
|
13536 | var HOSTNAME = {};
|
13537 | var PORT = {};
|
13538 | var FILE = {};
|
13539 | var FILE_SLASH = {};
|
13540 | var FILE_HOST = {};
|
13541 | var PATH_START = {};
|
13542 | var PATH = {};
|
13543 | var CANNOT_BE_A_BASE_URL_PATH = {};
|
13544 | var QUERY = {};
|
13545 | var FRAGMENT = {};
|
13546 |
|
13547 |
|
13548 | var parseURL = function (url, input, stateOverride, base) {
|
13549 | var state = stateOverride || SCHEME_START;
|
13550 | var pointer = 0;
|
13551 | var buffer = '';
|
13552 | var seenAt = false;
|
13553 | var seenBracket = false;
|
13554 | var seenPasswordToken = false;
|
13555 | var codePoints, chr, bufferCodePoints, failure;
|
13556 |
|
13557 | if (!stateOverride) {
|
13558 | url.scheme = '';
|
13559 | url.username = '';
|
13560 | url.password = '';
|
13561 | url.host = null;
|
13562 | url.port = null;
|
13563 | url.path = [];
|
13564 | url.query = null;
|
13565 | url.fragment = null;
|
13566 | url.cannotBeABaseURL = false;
|
13567 | input = replace(input, LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, '');
|
13568 | }
|
13569 |
|
13570 | input = replace(input, TAB_AND_NEW_LINE, '');
|
13571 |
|
13572 | codePoints = arrayFrom(input);
|
13573 |
|
13574 | while (pointer <= codePoints.length) {
|
13575 | chr = codePoints[pointer];
|
13576 | switch (state) {
|
13577 | case SCHEME_START:
|
13578 | if (chr && exec(ALPHA, chr)) {
|
13579 | buffer += toLowerCase(chr);
|
13580 | state = SCHEME;
|
13581 | } else if (!stateOverride) {
|
13582 | state = NO_SCHEME;
|
13583 | continue;
|
13584 | } else return INVALID_SCHEME;
|
13585 | break;
|
13586 |
|
13587 | case SCHEME:
|
13588 | if (chr && (exec(ALPHANUMERIC, chr) || chr == '+' || chr == '-' || chr == '.')) {
|
13589 | buffer += toLowerCase(chr);
|
13590 | } else if (chr == ':') {
|
13591 | if (stateOverride && (
|
13592 | (isSpecial(url) != hasOwn(specialSchemes, buffer)) ||
|
13593 | (buffer == 'file' && (includesCredentials(url) || url.port !== null)) ||
|
13594 | (url.scheme == 'file' && !url.host)
|
13595 | )) return;
|
13596 | url.scheme = buffer;
|
13597 | if (stateOverride) {
|
13598 | if (isSpecial(url) && specialSchemes[url.scheme] == url.port) url.port = null;
|
13599 | return;
|
13600 | }
|
13601 | buffer = '';
|
13602 | if (url.scheme == 'file') {
|
13603 | state = FILE;
|
13604 | } else if (isSpecial(url) && base && base.scheme == url.scheme) {
|
13605 | state = SPECIAL_RELATIVE_OR_AUTHORITY;
|
13606 | } else if (isSpecial(url)) {
|
13607 | state = SPECIAL_AUTHORITY_SLASHES;
|
13608 | } else if (codePoints[pointer + 1] == '/') {
|
13609 | state = PATH_OR_AUTHORITY;
|
13610 | pointer++;
|
13611 | } else {
|
13612 | url.cannotBeABaseURL = true;
|
13613 | push(url.path, '');
|
13614 | state = CANNOT_BE_A_BASE_URL_PATH;
|
13615 | }
|
13616 | } else if (!stateOverride) {
|
13617 | buffer = '';
|
13618 | state = NO_SCHEME;
|
13619 | pointer = 0;
|
13620 | continue;
|
13621 | } else return INVALID_SCHEME;
|
13622 | break;
|
13623 |
|
13624 | case NO_SCHEME:
|
13625 | if (!base || (base.cannotBeABaseURL && chr != '#')) return INVALID_SCHEME;
|
13626 | if (base.cannotBeABaseURL && chr == '#') {
|
13627 | url.scheme = base.scheme;
|
13628 | url.path = arraySlice(base.path);
|
13629 | url.query = base.query;
|
13630 | url.fragment = '';
|
13631 | url.cannotBeABaseURL = true;
|
13632 | state = FRAGMENT;
|
13633 | break;
|
13634 | }
|
13635 | state = base.scheme == 'file' ? FILE : RELATIVE;
|
13636 | continue;
|
13637 |
|
13638 | case SPECIAL_RELATIVE_OR_AUTHORITY:
|
13639 | if (chr == '/' && codePoints[pointer + 1] == '/') {
|
13640 | state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
|
13641 | pointer++;
|
13642 | } else {
|
13643 | state = RELATIVE;
|
13644 | continue;
|
13645 | } break;
|
13646 |
|
13647 | case PATH_OR_AUTHORITY:
|
13648 | if (chr == '/') {
|
13649 | state = AUTHORITY;
|
13650 | break;
|
13651 | } else {
|
13652 | state = PATH;
|
13653 | continue;
|
13654 | }
|
13655 |
|
13656 | case RELATIVE:
|
13657 | url.scheme = base.scheme;
|
13658 | if (chr == EOF) {
|
13659 | url.username = base.username;
|
13660 | url.password = base.password;
|
13661 | url.host = base.host;
|
13662 | url.port = base.port;
|
13663 | url.path = arraySlice(base.path);
|
13664 | url.query = base.query;
|
13665 | } else if (chr == '/' || (chr == '\\' && isSpecial(url))) {
|
13666 | state = RELATIVE_SLASH;
|
13667 | } else if (chr == '?') {
|
13668 | url.username = base.username;
|
13669 | url.password = base.password;
|
13670 | url.host = base.host;
|
13671 | url.port = base.port;
|
13672 | url.path = arraySlice(base.path);
|
13673 | url.query = '';
|
13674 | state = QUERY;
|
13675 | } else if (chr == '#') {
|
13676 | url.username = base.username;
|
13677 | url.password = base.password;
|
13678 | url.host = base.host;
|
13679 | url.port = base.port;
|
13680 | url.path = arraySlice(base.path);
|
13681 | url.query = base.query;
|
13682 | url.fragment = '';
|
13683 | state = FRAGMENT;
|
13684 | } else {
|
13685 | url.username = base.username;
|
13686 | url.password = base.password;
|
13687 | url.host = base.host;
|
13688 | url.port = base.port;
|
13689 | url.path = arraySlice(base.path);
|
13690 | url.path.length--;
|
13691 | state = PATH;
|
13692 | continue;
|
13693 | } break;
|
13694 |
|
13695 | case RELATIVE_SLASH:
|
13696 | if (isSpecial(url) && (chr == '/' || chr == '\\')) {
|
13697 | state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
|
13698 | } else if (chr == '/') {
|
13699 | state = AUTHORITY;
|
13700 | } else {
|
13701 | url.username = base.username;
|
13702 | url.password = base.password;
|
13703 | url.host = base.host;
|
13704 | url.port = base.port;
|
13705 | state = PATH;
|
13706 | continue;
|
13707 | } break;
|
13708 |
|
13709 | case SPECIAL_AUTHORITY_SLASHES:
|
13710 | state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
|
13711 | if (chr != '/' || charAt(buffer, pointer + 1) != '/') continue;
|
13712 | pointer++;
|
13713 | break;
|
13714 |
|
13715 | case SPECIAL_AUTHORITY_IGNORE_SLASHES:
|
13716 | if (chr != '/' && chr != '\\') {
|
13717 | state = AUTHORITY;
|
13718 | continue;
|
13719 | } break;
|
13720 |
|
13721 | case AUTHORITY:
|
13722 | if (chr == '@') {
|
13723 | if (seenAt) buffer = '%40' + buffer;
|
13724 | seenAt = true;
|
13725 | bufferCodePoints = arrayFrom(buffer);
|
13726 | for (var i = 0; i < bufferCodePoints.length; i++) {
|
13727 | var codePoint = bufferCodePoints[i];
|
13728 | if (codePoint == ':' && !seenPasswordToken) {
|
13729 | seenPasswordToken = true;
|
13730 | continue;
|
13731 | }
|
13732 | var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet);
|
13733 | if (seenPasswordToken) url.password += encodedCodePoints;
|
13734 | else url.username += encodedCodePoints;
|
13735 | }
|
13736 | buffer = '';
|
13737 | } else if (
|
13738 | chr == EOF || chr == '/' || chr == '?' || chr == '#' ||
|
13739 | (chr == '\\' && isSpecial(url))
|
13740 | ) {
|
13741 | if (seenAt && buffer == '') return INVALID_AUTHORITY;
|
13742 | pointer -= arrayFrom(buffer).length + 1;
|
13743 | buffer = '';
|
13744 | state = HOST;
|
13745 | } else buffer += chr;
|
13746 | break;
|
13747 |
|
13748 | case HOST:
|
13749 | case HOSTNAME:
|
13750 | if (stateOverride && url.scheme == 'file') {
|
13751 | state = FILE_HOST;
|
13752 | continue;
|
13753 | } else if (chr == ':' && !seenBracket) {
|
13754 | if (buffer == '') return INVALID_HOST;
|
13755 | failure = parseHost(url, buffer);
|
13756 | if (failure) return failure;
|
13757 | buffer = '';
|
13758 | state = PORT;
|
13759 | if (stateOverride == HOSTNAME) return;
|
13760 | } else if (
|
13761 | chr == EOF || chr == '/' || chr == '?' || chr == '#' ||
|
13762 | (chr == '\\' && isSpecial(url))
|
13763 | ) {
|
13764 | if (isSpecial(url) && buffer == '') return INVALID_HOST;
|
13765 | if (stateOverride && buffer == '' && (includesCredentials(url) || url.port !== null)) return;
|
13766 | failure = parseHost(url, buffer);
|
13767 | if (failure) return failure;
|
13768 | buffer = '';
|
13769 | state = PATH_START;
|
13770 | if (stateOverride) return;
|
13771 | continue;
|
13772 | } else {
|
13773 | if (chr == '[') seenBracket = true;
|
13774 | else if (chr == ']') seenBracket = false;
|
13775 | buffer += chr;
|
13776 | } break;
|
13777 |
|
13778 | case PORT:
|
13779 | if (exec(DIGIT, chr)) {
|
13780 | buffer += chr;
|
13781 | } else if (
|
13782 | chr == EOF || chr == '/' || chr == '?' || chr == '#' ||
|
13783 | (chr == '\\' && isSpecial(url)) ||
|
13784 | stateOverride
|
13785 | ) {
|
13786 | if (buffer != '') {
|
13787 | var port = parseInt(buffer, 10);
|
13788 | if (port > 0xFFFF) return INVALID_PORT;
|
13789 | url.port = (isSpecial(url) && port === specialSchemes[url.scheme]) ? null : port;
|
13790 | buffer = '';
|
13791 | }
|
13792 | if (stateOverride) return;
|
13793 | state = PATH_START;
|
13794 | continue;
|
13795 | } else return INVALID_PORT;
|
13796 | break;
|
13797 |
|
13798 | case FILE:
|
13799 | url.scheme = 'file';
|
13800 | if (chr == '/' || chr == '\\') state = FILE_SLASH;
|
13801 | else if (base && base.scheme == 'file') {
|
13802 | if (chr == EOF) {
|
13803 | url.host = base.host;
|
13804 | url.path = arraySlice(base.path);
|
13805 | url.query = base.query;
|
13806 | } else if (chr == '?') {
|
13807 | url.host = base.host;
|
13808 | url.path = arraySlice(base.path);
|
13809 | url.query = '';
|
13810 | state = QUERY;
|
13811 | } else if (chr == '#') {
|
13812 | url.host = base.host;
|
13813 | url.path = arraySlice(base.path);
|
13814 | url.query = base.query;
|
13815 | url.fragment = '';
|
13816 | state = FRAGMENT;
|
13817 | } else {
|
13818 | if (!startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))) {
|
13819 | url.host = base.host;
|
13820 | url.path = arraySlice(base.path);
|
13821 | shortenURLsPath(url);
|
13822 | }
|
13823 | state = PATH;
|
13824 | continue;
|
13825 | }
|
13826 | } else {
|
13827 | state = PATH;
|
13828 | continue;
|
13829 | } break;
|
13830 |
|
13831 | case FILE_SLASH:
|
13832 | if (chr == '/' || chr == '\\') {
|
13833 | state = FILE_HOST;
|
13834 | break;
|
13835 | }
|
13836 | if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))) {
|
13837 | if (isWindowsDriveLetter(base.path[0], true)) push(url.path, base.path[0]);
|
13838 | else url.host = base.host;
|
13839 | }
|
13840 | state = PATH;
|
13841 | continue;
|
13842 |
|
13843 | case FILE_HOST:
|
13844 | if (chr == EOF || chr == '/' || chr == '\\' || chr == '?' || chr == '#') {
|
13845 | if (!stateOverride && isWindowsDriveLetter(buffer)) {
|
13846 | state = PATH;
|
13847 | } else if (buffer == '') {
|
13848 | url.host = '';
|
13849 | if (stateOverride) return;
|
13850 | state = PATH_START;
|
13851 | } else {
|
13852 | failure = parseHost(url, buffer);
|
13853 | if (failure) return failure;
|
13854 | if (url.host == 'localhost') url.host = '';
|
13855 | if (stateOverride) return;
|
13856 | buffer = '';
|
13857 | state = PATH_START;
|
13858 | } continue;
|
13859 | } else buffer += chr;
|
13860 | break;
|
13861 |
|
13862 | case PATH_START:
|
13863 | if (isSpecial(url)) {
|
13864 | state = PATH;
|
13865 | if (chr != '/' && chr != '\\') continue;
|
13866 | } else if (!stateOverride && chr == '?') {
|
13867 | url.query = '';
|
13868 | state = QUERY;
|
13869 | } else if (!stateOverride && chr == '#') {
|
13870 | url.fragment = '';
|
13871 | state = FRAGMENT;
|
13872 | } else if (chr != EOF) {
|
13873 | state = PATH;
|
13874 | if (chr != '/') continue;
|
13875 | } break;
|
13876 |
|
13877 | case PATH:
|
13878 | if (
|
13879 | chr == EOF || chr == '/' ||
|
13880 | (chr == '\\' && isSpecial(url)) ||
|
13881 | (!stateOverride && (chr == '?' || chr == '#'))
|
13882 | ) {
|
13883 | if (isDoubleDot(buffer)) {
|
13884 | shortenURLsPath(url);
|
13885 | if (chr != '/' && !(chr == '\\' && isSpecial(url))) {
|
13886 | push(url.path, '');
|
13887 | }
|
13888 | } else if (isSingleDot(buffer)) {
|
13889 | if (chr != '/' && !(chr == '\\' && isSpecial(url))) {
|
13890 | push(url.path, '');
|
13891 | }
|
13892 | } else {
|
13893 | if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) {
|
13894 | if (url.host) url.host = '';
|
13895 | buffer = charAt(buffer, 0) + ':';
|
13896 | }
|
13897 | push(url.path, buffer);
|
13898 | }
|
13899 | buffer = '';
|
13900 | if (url.scheme == 'file' && (chr == EOF || chr == '?' || chr == '#')) {
|
13901 | while (url.path.length > 1 && url.path[0] === '') {
|
13902 | shift(url.path);
|
13903 | }
|
13904 | }
|
13905 | if (chr == '?') {
|
13906 | url.query = '';
|
13907 | state = QUERY;
|
13908 | } else if (chr == '#') {
|
13909 | url.fragment = '';
|
13910 | state = FRAGMENT;
|
13911 | }
|
13912 | } else {
|
13913 | buffer += percentEncode(chr, pathPercentEncodeSet);
|
13914 | } break;
|
13915 |
|
13916 | case CANNOT_BE_A_BASE_URL_PATH:
|
13917 | if (chr == '?') {
|
13918 | url.query = '';
|
13919 | state = QUERY;
|
13920 | } else if (chr == '#') {
|
13921 | url.fragment = '';
|
13922 | state = FRAGMENT;
|
13923 | } else if (chr != EOF) {
|
13924 | url.path[0] += percentEncode(chr, C0ControlPercentEncodeSet);
|
13925 | } break;
|
13926 |
|
13927 | case QUERY:
|
13928 | if (!stateOverride && chr == '#') {
|
13929 | url.fragment = '';
|
13930 | state = FRAGMENT;
|
13931 | } else if (chr != EOF) {
|
13932 | if (chr == "'" && isSpecial(url)) url.query += '%27';
|
13933 | else if (chr == '#') url.query += '%23';
|
13934 | else url.query += percentEncode(chr, C0ControlPercentEncodeSet);
|
13935 | } break;
|
13936 |
|
13937 | case FRAGMENT:
|
13938 | if (chr != EOF) url.fragment += percentEncode(chr, fragmentPercentEncodeSet);
|
13939 | break;
|
13940 | }
|
13941 |
|
13942 | pointer++;
|
13943 | }
|
13944 | };
|
13945 |
|
13946 |
|
13947 |
|
13948 | var URLConstructor = function URL(url /* , base */) {
|
13949 | var that = anInstance(this, URLPrototype);
|
13950 | var base = arguments.length > 1 ? arguments[1] : undefined;
|
13951 | var urlString = $toString(url);
|
13952 | var state = setInternalState(that, { type: 'URL' });
|
13953 | var baseState, failure;
|
13954 | if (base !== undefined) {
|
13955 | try {
|
13956 | baseState = getInternalURLState(base);
|
13957 | } catch (error) {
|
13958 | failure = parseURL(baseState = {}, $toString(base));
|
13959 | if (failure) throw TypeError(failure);
|
13960 | }
|
13961 | }
|
13962 | failure = parseURL(state, urlString, null, baseState);
|
13963 | if (failure) throw TypeError(failure);
|
13964 | var searchParams = state.searchParams = new URLSearchParams();
|
13965 | var searchParamsState = getInternalSearchParamsState(searchParams);
|
13966 | searchParamsState.updateSearchParams(state.query);
|
13967 | searchParamsState.updateURL = function () {
|
13968 | state.query = $toString(searchParams) || null;
|
13969 | };
|
13970 | if (!DESCRIPTORS) {
|
13971 | that.href = call(serializeURL, that);
|
13972 | that.origin = call(getOrigin, that);
|
13973 | that.protocol = call(getProtocol, that);
|
13974 | that.username = call(getUsername, that);
|
13975 | that.password = call(getPassword, that);
|
13976 | that.host = call(getHost, that);
|
13977 | that.hostname = call(getHostname, that);
|
13978 | that.port = call(getPort, that);
|
13979 | that.pathname = call(getPathname, that);
|
13980 | that.search = call(getSearch, that);
|
13981 | that.searchParams = call(getSearchParams, that);
|
13982 | that.hash = call(getHash, that);
|
13983 | }
|
13984 | };
|
13985 |
|
13986 | var URLPrototype = URLConstructor.prototype;
|
13987 |
|
13988 | var serializeURL = function () {
|
13989 | var url = getInternalURLState(this);
|
13990 | var scheme = url.scheme;
|
13991 | var username = url.username;
|
13992 | var password = url.password;
|
13993 | var host = url.host;
|
13994 | var port = url.port;
|
13995 | var path = url.path;
|
13996 | var query = url.query;
|
13997 | var fragment = url.fragment;
|
13998 | var output = scheme + ':';
|
13999 | if (host !== null) {
|
14000 | output += '//';
|
14001 | if (includesCredentials(url)) {
|
14002 | output += username + (password ? ':' + password : '') + '@';
|
14003 | }
|
14004 | output += serializeHost(host);
|
14005 | if (port !== null) output += ':' + port;
|
14006 | } else if (scheme == 'file') output += '//';
|
14007 | output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + join(path, '/') : '';
|
14008 | if (query !== null) output += '?' + query;
|
14009 | if (fragment !== null) output += '#' + fragment;
|
14010 | return output;
|
14011 | };
|
14012 |
|
14013 | var getOrigin = function () {
|
14014 | var url = getInternalURLState(this);
|
14015 | var scheme = url.scheme;
|
14016 | var port = url.port;
|
14017 | if (scheme == 'blob') try {
|
14018 | return new URLConstructor(scheme.path[0]).origin;
|
14019 | } catch (error) {
|
14020 | return 'null';
|
14021 | }
|
14022 | if (scheme == 'file' || !isSpecial(url)) return 'null';
|
14023 | return scheme + '://' + serializeHost(url.host) + (port !== null ? ':' + port : '');
|
14024 | };
|
14025 |
|
14026 | var getProtocol = function () {
|
14027 | return getInternalURLState(this).scheme + ':';
|
14028 | };
|
14029 |
|
14030 | var getUsername = function () {
|
14031 | return getInternalURLState(this).username;
|
14032 | };
|
14033 |
|
14034 | var getPassword = function () {
|
14035 | return getInternalURLState(this).password;
|
14036 | };
|
14037 |
|
14038 | var getHost = function () {
|
14039 | var url = getInternalURLState(this);
|
14040 | var host = url.host;
|
14041 | var port = url.port;
|
14042 | return host === null ? ''
|
14043 | : port === null ? serializeHost(host)
|
14044 | : serializeHost(host) + ':' + port;
|
14045 | };
|
14046 |
|
14047 | var getHostname = function () {
|
14048 | var host = getInternalURLState(this).host;
|
14049 | return host === null ? '' : serializeHost(host);
|
14050 | };
|
14051 |
|
14052 | var getPort = function () {
|
14053 | var port = getInternalURLState(this).port;
|
14054 | return port === null ? '' : $toString(port);
|
14055 | };
|
14056 |
|
14057 | var getPathname = function () {
|
14058 | var url = getInternalURLState(this);
|
14059 | var path = url.path;
|
14060 | return url.cannotBeABaseURL ? path[0] : path.length ? '/' + join(path, '/') : '';
|
14061 | };
|
14062 |
|
14063 | var getSearch = function () {
|
14064 | var query = getInternalURLState(this).query;
|
14065 | return query ? '?' + query : '';
|
14066 | };
|
14067 |
|
14068 | var getSearchParams = function () {
|
14069 | return getInternalURLState(this).searchParams;
|
14070 | };
|
14071 |
|
14072 | var getHash = function () {
|
14073 | var fragment = getInternalURLState(this).fragment;
|
14074 | return fragment ? '#' + fragment : '';
|
14075 | };
|
14076 |
|
14077 | var accessorDescriptor = function (getter, setter) {
|
14078 | return { get: getter, set: setter, configurable: true, enumerable: true };
|
14079 | };
|
14080 |
|
14081 | if (DESCRIPTORS) {
|
14082 | defineProperties(URLPrototype, {
|
14083 |
|
14084 |
|
14085 | href: accessorDescriptor(serializeURL, function (href) {
|
14086 | var url = getInternalURLState(this);
|
14087 | var urlString = $toString(href);
|
14088 | var failure = parseURL(url, urlString);
|
14089 | if (failure) throw TypeError(failure);
|
14090 | getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);
|
14091 | }),
|
14092 |
|
14093 |
|
14094 | origin: accessorDescriptor(getOrigin),
|
14095 |
|
14096 |
|
14097 | protocol: accessorDescriptor(getProtocol, function (protocol) {
|
14098 | var url = getInternalURLState(this);
|
14099 | parseURL(url, $toString(protocol) + ':', SCHEME_START);
|
14100 | }),
|
14101 |
|
14102 |
|
14103 | username: accessorDescriptor(getUsername, function (username) {
|
14104 | var url = getInternalURLState(this);
|
14105 | var codePoints = arrayFrom($toString(username));
|
14106 | if (cannotHaveUsernamePasswordPort(url)) return;
|
14107 | url.username = '';
|
14108 | for (var i = 0; i < codePoints.length; i++) {
|
14109 | url.username += percentEncode(codePoints[i], userinfoPercentEncodeSet);
|
14110 | }
|
14111 | }),
|
14112 |
|
14113 |
|
14114 | password: accessorDescriptor(getPassword, function (password) {
|
14115 | var url = getInternalURLState(this);
|
14116 | var codePoints = arrayFrom($toString(password));
|
14117 | if (cannotHaveUsernamePasswordPort(url)) return;
|
14118 | url.password = '';
|
14119 | for (var i = 0; i < codePoints.length; i++) {
|
14120 | url.password += percentEncode(codePoints[i], userinfoPercentEncodeSet);
|
14121 | }
|
14122 | }),
|
14123 |
|
14124 |
|
14125 | host: accessorDescriptor(getHost, function (host) {
|
14126 | var url = getInternalURLState(this);
|
14127 | if (url.cannotBeABaseURL) return;
|
14128 | parseURL(url, $toString(host), HOST);
|
14129 | }),
|
14130 |
|
14131 |
|
14132 | hostname: accessorDescriptor(getHostname, function (hostname) {
|
14133 | var url = getInternalURLState(this);
|
14134 | if (url.cannotBeABaseURL) return;
|
14135 | parseURL(url, $toString(hostname), HOSTNAME);
|
14136 | }),
|
14137 |
|
14138 |
|
14139 | port: accessorDescriptor(getPort, function (port) {
|
14140 | var url = getInternalURLState(this);
|
14141 | if (cannotHaveUsernamePasswordPort(url)) return;
|
14142 | port = $toString(port);
|
14143 | if (port == '') url.port = null;
|
14144 | else parseURL(url, port, PORT);
|
14145 | }),
|
14146 |
|
14147 |
|
14148 | pathname: accessorDescriptor(getPathname, function (pathname) {
|
14149 | var url = getInternalURLState(this);
|
14150 | if (url.cannotBeABaseURL) return;
|
14151 | url.path = [];
|
14152 | parseURL(url, $toString(pathname), PATH_START);
|
14153 | }),
|
14154 |
|
14155 |
|
14156 | search: accessorDescriptor(getSearch, function (search) {
|
14157 | var url = getInternalURLState(this);
|
14158 | search = $toString(search);
|
14159 | if (search == '') {
|
14160 | url.query = null;
|
14161 | } else {
|
14162 | if ('?' == charAt(search, 0)) search = stringSlice(search, 1);
|
14163 | url.query = '';
|
14164 | parseURL(url, search, QUERY);
|
14165 | }
|
14166 | getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query);
|
14167 | }),
|
14168 |
|
14169 |
|
14170 | searchParams: accessorDescriptor(getSearchParams),
|
14171 |
|
14172 |
|
14173 | hash: accessorDescriptor(getHash, function (hash) {
|
14174 | var url = getInternalURLState(this);
|
14175 | hash = $toString(hash);
|
14176 | if (hash == '') {
|
14177 | url.fragment = null;
|
14178 | return;
|
14179 | }
|
14180 | if ('#' == charAt(hash, 0)) hash = stringSlice(hash, 1);
|
14181 | url.fragment = '';
|
14182 | parseURL(url, hash, FRAGMENT);
|
14183 | })
|
14184 | });
|
14185 | }
|
14186 |
|
14187 |
|
14188 |
|
14189 | redefine(URLPrototype, 'toJSON', function toJSON() {
|
14190 | return call(serializeURL, this);
|
14191 | }, { enumerable: true });
|
14192 |
|
14193 |
|
14194 |
|
14195 | redefine(URLPrototype, 'toString', function toString() {
|
14196 | return call(serializeURL, this);
|
14197 | }, { enumerable: true });
|
14198 |
|
14199 | if (NativeURL) {
|
14200 | var nativeCreateObjectURL = NativeURL.createObjectURL;
|
14201 | var nativeRevokeObjectURL = NativeURL.revokeObjectURL;
|
14202 |
|
14203 |
|
14204 | if (nativeCreateObjectURL) redefine(URLConstructor, 'createObjectURL', bind(nativeCreateObjectURL, NativeURL));
|
14205 |
|
14206 |
|
14207 | if (nativeRevokeObjectURL) redefine(URLConstructor, 'revokeObjectURL', bind(nativeRevokeObjectURL, NativeURL));
|
14208 | }
|
14209 |
|
14210 | setToStringTag(URLConstructor, 'URL');
|
14211 |
|
14212 | $({ global: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, {
|
14213 | URL: URLConstructor
|
14214 | });
|
14215 |
|
14216 |
|
14217 | }),
|
14218 |
|
14219 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
14220 |
|
14221 | var fails = __webpack_require__(6);
|
14222 | var wellKnownSymbol = __webpack_require__(30);
|
14223 | var IS_PURE = __webpack_require__(32);
|
14224 |
|
14225 | var ITERATOR = wellKnownSymbol('iterator');
|
14226 |
|
14227 | module.exports = !fails(function () {
|
14228 | var url = new URL('b?a=1&b=2&c=3', 'http://a');
|
14229 | var searchParams = url.searchParams;
|
14230 | var result = '';
|
14231 | url.pathname = 'c%20d';
|
14232 | searchParams.forEach(function (value, key) {
|
14233 | searchParams['delete']('b');
|
14234 | result += key + value;
|
14235 | });
|
14236 | return (IS_PURE && !url.toJSON)
|
14237 | || !searchParams.sort
|
14238 | || url.href !== 'http://a/c%20d?a=1&c=3'
|
14239 | || searchParams.get('c') !== '3'
|
14240 | || String(new URLSearchParams('?a=1')) !== 'a=1'
|
14241 | || !searchParams[ITERATOR]
|
14242 |
|
14243 | || new URL('https://a@b').username !== 'a'
|
14244 | || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b'
|
14245 |
|
14246 | || new URL('http://тест').host !== 'xn--e1aybc'
|
14247 |
|
14248 | || new URL('http://a#б').hash !== '#%D0%B1'
|
14249 |
|
14250 | || result !== 'a1c3'
|
14251 |
|
14252 | || new URL('http://x', undefined).host !== 'x';
|
14253 | });
|
14254 |
|
14255 |
|
14256 | }),
|
14257 |
|
14258 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
14259 |
|
14260 | "use strict";
|
14261 |
|
14262 |
|
14263 | var global = __webpack_require__(3);
|
14264 | var uncurryThis = __webpack_require__(12);
|
14265 |
|
14266 | var maxInt = 2147483647;
|
14267 | var base = 36;
|
14268 | var tMin = 1;
|
14269 | var tMax = 26;
|
14270 | var skew = 38;
|
14271 | var damp = 700;
|
14272 | var initialBias = 72;
|
14273 | var initialN = 128;
|
14274 | var delimiter = '-';
|
14275 | var regexNonASCII = /[^\0-\u007E]/;
|
14276 | var regexSeparators = /[.\u3002\uFF0E\uFF61]/g;
|
14277 | var OVERFLOW_ERROR = 'Overflow: input needs wider integers to process';
|
14278 | var baseMinusTMin = base - tMin;
|
14279 |
|
14280 | var RangeError = global.RangeError;
|
14281 | var exec = uncurryThis(regexSeparators.exec);
|
14282 | var floor = Math.floor;
|
14283 | var fromCharCode = String.fromCharCode;
|
14284 | var charCodeAt = uncurryThis(''.charCodeAt);
|
14285 | var join = uncurryThis([].join);
|
14286 | var push = uncurryThis([].push);
|
14287 | var replace = uncurryThis(''.replace);
|
14288 | var split = uncurryThis(''.split);
|
14289 | var toLowerCase = uncurryThis(''.toLowerCase);
|
14290 |
|
14291 |
|
14292 |
|
14293 |
|
14294 |
|
14295 |
|
14296 |
|
14297 |
|
14298 | var ucs2decode = function (string) {
|
14299 | var output = [];
|
14300 | var counter = 0;
|
14301 | var length = string.length;
|
14302 | while (counter < length) {
|
14303 | var value = charCodeAt(string, counter++);
|
14304 | if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
|
14305 |
|
14306 | var extra = charCodeAt(string, counter++);
|
14307 | if ((extra & 0xFC00) == 0xDC00) {
|
14308 | push(output, ((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
|
14309 | } else {
|
14310 |
|
14311 |
|
14312 | push(output, value);
|
14313 | counter--;
|
14314 | }
|
14315 | } else {
|
14316 | push(output, value);
|
14317 | }
|
14318 | }
|
14319 | return output;
|
14320 | };
|
14321 |
|
14322 |
|
14323 |
|
14324 |
|
14325 | var digitToBasic = function (digit) {
|
14326 |
|
14327 |
|
14328 | return digit + 22 + 75 * (digit < 26);
|
14329 | };
|
14330 |
|
14331 |
|
14332 |
|
14333 |
|
14334 |
|
14335 | var adapt = function (delta, numPoints, firstTime) {
|
14336 | var k = 0;
|
14337 | delta = firstTime ? floor(delta / damp) : delta >> 1;
|
14338 | delta += floor(delta / numPoints);
|
14339 | for (; delta > baseMinusTMin * tMax >> 1; k += base) {
|
14340 | delta = floor(delta / baseMinusTMin);
|
14341 | }
|
14342 | return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
|
14343 | };
|
14344 |
|
14345 |
|
14346 |
|
14347 |
|
14348 |
|
14349 |
|
14350 | var encode = function (input) {
|
14351 | var output = [];
|
14352 |
|
14353 |
|
14354 | input = ucs2decode(input);
|
14355 |
|
14356 |
|
14357 | var inputLength = input.length;
|
14358 |
|
14359 |
|
14360 | var n = initialN;
|
14361 | var delta = 0;
|
14362 | var bias = initialBias;
|
14363 | var i, currentValue;
|
14364 |
|
14365 |
|
14366 | for (i = 0; i < input.length; i++) {
|
14367 | currentValue = input[i];
|
14368 | if (currentValue < 0x80) {
|
14369 | push(output, fromCharCode(currentValue));
|
14370 | }
|
14371 | }
|
14372 |
|
14373 | var basicLength = output.length;
|
14374 | var handledCPCount = basicLength;
|
14375 |
|
14376 |
|
14377 | if (basicLength) {
|
14378 | push(output, delimiter);
|
14379 | }
|
14380 |
|
14381 |
|
14382 | while (handledCPCount < inputLength) {
|
14383 |
|
14384 | var m = maxInt;
|
14385 | for (i = 0; i < input.length; i++) {
|
14386 | currentValue = input[i];
|
14387 | if (currentValue >= n && currentValue < m) {
|
14388 | m = currentValue;
|
14389 | }
|
14390 | }
|
14391 |
|
14392 |
|
14393 | var handledCPCountPlusOne = handledCPCount + 1;
|
14394 | if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
|
14395 | throw RangeError(OVERFLOW_ERROR);
|
14396 | }
|
14397 |
|
14398 | delta += (m - n) * handledCPCountPlusOne;
|
14399 | n = m;
|
14400 |
|
14401 | for (i = 0; i < input.length; i++) {
|
14402 | currentValue = input[i];
|
14403 | if (currentValue < n && ++delta > maxInt) {
|
14404 | throw RangeError(OVERFLOW_ERROR);
|
14405 | }
|
14406 | if (currentValue == n) {
|
14407 |
|
14408 | var q = delta;
|
14409 | for (var k = base; ; k += base) {
|
14410 | var t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
|
14411 | if (q < t) break;
|
14412 | var qMinusT = q - t;
|
14413 | var baseMinusT = base - t;
|
14414 | push(output, fromCharCode(digitToBasic(t + qMinusT % baseMinusT)));
|
14415 | q = floor(qMinusT / baseMinusT);
|
14416 | }
|
14417 |
|
14418 | push(output, fromCharCode(digitToBasic(q)));
|
14419 | bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
|
14420 | delta = 0;
|
14421 | ++handledCPCount;
|
14422 | }
|
14423 | }
|
14424 |
|
14425 | ++delta;
|
14426 | ++n;
|
14427 | }
|
14428 | return join(output, '');
|
14429 | };
|
14430 |
|
14431 | module.exports = function (input) {
|
14432 | var encoded = [];
|
14433 | var labels = split(replace(toLowerCase(input), regexSeparators, '\u002E'), '.');
|
14434 | var i, label;
|
14435 | for (i = 0; i < labels.length; i++) {
|
14436 | label = labels[i];
|
14437 | push(encoded, exec(regexNonASCII, label) ? 'xn--' + encode(label) : label);
|
14438 | }
|
14439 | return join(encoded, '.');
|
14440 | };
|
14441 |
|
14442 |
|
14443 | }),
|
14444 |
|
14445 | (function(module, __unused_webpack_exports, __webpack_require__) {
|
14446 |
|
14447 | "use strict";
|
14448 |
|
14449 |
|
14450 | __webpack_require__(137);
|
14451 | var $ = __webpack_require__(2);
|
14452 | var global = __webpack_require__(3);
|
14453 | var getBuiltIn = __webpack_require__(20);
|
14454 | var call = __webpack_require__(7);
|
14455 | var uncurryThis = __webpack_require__(12);
|
14456 | var USE_NATIVE_URL = __webpack_require__(422);
|
14457 | var redefine = __webpack_require__(43);
|
14458 | var redefineAll = __webpack_require__(166);
|
14459 | var setToStringTag = __webpack_require__(76);
|
14460 | var createIteratorConstructor = __webpack_require__(139);
|
14461 | var InternalStateModule = __webpack_require__(45);
|
14462 | var anInstance = __webpack_require__(167);
|
14463 | var isCallable = __webpack_require__(18);
|
14464 | var hasOwn = __webpack_require__(35);
|
14465 | var bind = __webpack_require__(78);
|
14466 | var classof = __webpack_require__(65);
|
14467 | var anObject = __webpack_require__(42);
|
14468 | var isObject = __webpack_require__(17);
|
14469 | var $toString = __webpack_require__(64);
|
14470 | var create = __webpack_require__(67);
|
14471 | var createPropertyDescriptor = __webpack_require__(9);
|
14472 | var getIterator = __webpack_require__(106);
|
14473 | var getIteratorMethod = __webpack_require__(107);
|
14474 | var wellKnownSymbol = __webpack_require__(30);
|
14475 | var arraySort = __webpack_require__(154);
|
14476 |
|
14477 | var ITERATOR = wellKnownSymbol('iterator');
|
14478 | var URL_SEARCH_PARAMS = 'URLSearchParams';
|
14479 | var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator';
|
14480 | var setInternalState = InternalStateModule.set;
|
14481 | var getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS);
|
14482 | var getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR);
|
14483 |
|
14484 | var n$Fetch = getBuiltIn('fetch');
|
14485 | var N$Request = getBuiltIn('Request');
|
14486 | var Headers = getBuiltIn('Headers');
|
14487 | var RequestPrototype = N$Request && N$Request.prototype;
|
14488 | var HeadersPrototype = Headers && Headers.prototype;
|
14489 | var RegExp = global.RegExp;
|
14490 | var TypeError = global.TypeError;
|
14491 | var decodeURIComponent = global.decodeURIComponent;
|
14492 | var encodeURIComponent = global.encodeURIComponent;
|
14493 | var charAt = uncurryThis(''.charAt);
|
14494 | var join = uncurryThis([].join);
|
14495 | var push = uncurryThis([].push);
|
14496 | var replace = uncurryThis(''.replace);
|
14497 | var shift = uncurryThis([].shift);
|
14498 | var splice = uncurryThis([].splice);
|
14499 | var split = uncurryThis(''.split);
|
14500 | var stringSlice = uncurryThis(''.slice);
|
14501 |
|
14502 | var plus = /\+/g;
|
14503 | var sequences = Array(4);
|
14504 |
|
14505 | var percentSequence = function (bytes) {
|
14506 | return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp('((?:%[\\da-f]{2}){' + bytes + '})', 'gi'));
|
14507 | };
|
14508 |
|
14509 | var percentDecode = function (sequence) {
|
14510 | try {
|
14511 | return decodeURIComponent(sequence);
|
14512 | } catch (error) {
|
14513 | return sequence;
|
14514 | }
|
14515 | };
|
14516 |
|
14517 | var deserialize = function (it) {
|
14518 | var result = replace(it, plus, ' ');
|
14519 | var bytes = 4;
|
14520 | try {
|
14521 | return decodeURIComponent(result);
|
14522 | } catch (error) {
|
14523 | while (bytes) {
|
14524 | result = replace(result, percentSequence(bytes--), percentDecode);
|
14525 | }
|
14526 | return result;
|
14527 | }
|
14528 | };
|
14529 |
|
14530 | var find = /[!'()~]|%20/g;
|
14531 |
|
14532 | var replacements = {
|
14533 | '!': '%21',
|
14534 | "'": '%27',
|
14535 | '(': '%28',
|
14536 | ')': '%29',
|
14537 | '~': '%7E',
|
14538 | '%20': '+'
|
14539 | };
|
14540 |
|
14541 | var replacer = function (match) {
|
14542 | return replacements[match];
|
14543 | };
|
14544 |
|
14545 | var serialize = function (it) {
|
14546 | return replace(encodeURIComponent(it), find, replacer);
|
14547 | };
|
14548 |
|
14549 | var parseSearchParams = function (result, query) {
|
14550 | if (query) {
|
14551 | var attributes = split(query, '&');
|
14552 | var index = 0;
|
14553 | var attribute, entry;
|
14554 | while (index < attributes.length) {
|
14555 | attribute = attributes[index++];
|
14556 | if (attribute.length) {
|
14557 | entry = split(attribute, '=');
|
14558 | push(result, {
|
14559 | key: deserialize(shift(entry)),
|
14560 | value: deserialize(join(entry, '='))
|
14561 | });
|
14562 | }
|
14563 | }
|
14564 | }
|
14565 | };
|
14566 |
|
14567 | var updateSearchParams = function (query) {
|
14568 | this.entries.length = 0;
|
14569 | parseSearchParams(this.entries, query);
|
14570 | };
|
14571 |
|
14572 | var validateArgumentsLength = function (passed, required) {
|
14573 | if (passed < required) throw TypeError('Not enough arguments');
|
14574 | };
|
14575 |
|
14576 | var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) {
|
14577 | setInternalState(this, {
|
14578 | type: URL_SEARCH_PARAMS_ITERATOR,
|
14579 | iterator: getIterator(getInternalParamsState(params).entries),
|
14580 | kind: kind
|
14581 | });
|
14582 | }, 'Iterator', function next() {
|
14583 | var state = getInternalIteratorState(this);
|
14584 | var kind = state.kind;
|
14585 | var step = state.iterator.next();
|
14586 | var entry = step.value;
|
14587 | if (!step.done) {
|
14588 | step.value = kind === 'keys' ? entry.key : kind === 'values' ? entry.value : [entry.key, entry.value];
|
14589 | } return step;
|
14590 | });
|
14591 |
|
14592 |
|
14593 |
|
14594 | var URLSearchParamsConstructor = function URLSearchParams(/* init */) {
|
14595 | anInstance(this, URLSearchParamsPrototype);
|
14596 | var init = arguments.length > 0 ? arguments[0] : undefined;
|
14597 | var that = this;
|
14598 | var entries = [];
|
14599 | var iteratorMethod, iterator, next, step, entryIterator, entryNext, first, second, key;
|
14600 |
|
14601 | setInternalState(that, {
|
14602 | type: URL_SEARCH_PARAMS,
|
14603 | entries: entries,
|
14604 | updateURL: function () { },
|
14605 | updateSearchParams: updateSearchParams
|
14606 | });
|
14607 |
|
14608 | if (init !== undefined) {
|
14609 | if (isObject(init)) {
|
14610 | iteratorMethod = getIteratorMethod(init);
|
14611 | if (iteratorMethod) {
|
14612 | iterator = getIterator(init, iteratorMethod);
|
14613 | next = iterator.next;
|
14614 | while (!(step = call(next, iterator)).done) {
|
14615 | entryIterator = getIterator(anObject(step.value));
|
14616 | entryNext = entryIterator.next;
|
14617 | if (
|
14618 | (first = call(entryNext, entryIterator)).done ||
|
14619 | (second = call(entryNext, entryIterator)).done ||
|
14620 | !call(entryNext, entryIterator).done
|
14621 | ) throw TypeError('Expected sequence with length 2');
|
14622 | push(entries, { key: $toString(first.value), value: $toString(second.value) });
|
14623 | }
|
14624 | } else for (key in init) if (hasOwn(init, key)) push(entries, { key: key, value: $toString(init[key]) });
|
14625 | } else {
|
14626 | parseSearchParams(
|
14627 | entries,
|
14628 | typeof init == 'string' ? charAt(init, 0) === '?' ? stringSlice(init, 1) : init : $toString(init)
|
14629 | );
|
14630 | }
|
14631 | }
|
14632 | };
|
14633 |
|
14634 | var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;
|
14635 |
|
14636 | redefineAll(URLSearchParamsPrototype, {
|
14637 |
|
14638 |
|
14639 | append: function append(name, value) {
|
14640 | validateArgumentsLength(arguments.length, 2);
|
14641 | var state = getInternalParamsState(this);
|
14642 | push(state.entries, { key: $toString(name), value: $toString(value) });
|
14643 | state.updateURL();
|
14644 | },
|
14645 |
|
14646 |
|
14647 | 'delete': function (name) {
|
14648 | validateArgumentsLength(arguments.length, 1);
|
14649 | var state = getInternalParamsState(this);
|
14650 | var entries = state.entries;
|
14651 | var key = $toString(name);
|
14652 | var index = 0;
|
14653 | while (index < entries.length) {
|
14654 | if (entries[index].key === key) splice(entries, index, 1);
|
14655 | else index++;
|
14656 | }
|
14657 | state.updateURL();
|
14658 | },
|
14659 |
|
14660 |
|
14661 | get: function get(name) {
|
14662 | validateArgumentsLength(arguments.length, 1);
|
14663 | var entries = getInternalParamsState(this).entries;
|
14664 | var key = $toString(name);
|
14665 | var index = 0;
|
14666 | for (; index < entries.length; index++) {
|
14667 | if (entries[index].key === key) return entries[index].value;
|
14668 | }
|
14669 | return null;
|
14670 | },
|
14671 |
|
14672 |
|
14673 | getAll: function getAll(name) {
|
14674 | validateArgumentsLength(arguments.length, 1);
|
14675 | var entries = getInternalParamsState(this).entries;
|
14676 | var key = $toString(name);
|
14677 | var result = [];
|
14678 | var index = 0;
|
14679 | for (; index < entries.length; index++) {
|
14680 | if (entries[index].key === key) push(result, entries[index].value);
|
14681 | }
|
14682 | return result;
|
14683 | },
|
14684 |
|
14685 |
|
14686 | has: function has(name) {
|
14687 | validateArgumentsLength(arguments.length, 1);
|
14688 | var entries = getInternalParamsState(this).entries;
|
14689 | var key = $toString(name);
|
14690 | var index = 0;
|
14691 | while (index < entries.length) {
|
14692 | if (entries[index++].key === key) return true;
|
14693 | }
|
14694 | return false;
|
14695 | },
|
14696 |
|
14697 |
|
14698 | set: function set(name, value) {
|
14699 | validateArgumentsLength(arguments.length, 1);
|
14700 | var state = getInternalParamsState(this);
|
14701 | var entries = state.entries;
|
14702 | var found = false;
|
14703 | var key = $toString(name);
|
14704 | var val = $toString(value);
|
14705 | var index = 0;
|
14706 | var entry;
|
14707 | for (; index < entries.length; index++) {
|
14708 | entry = entries[index];
|
14709 | if (entry.key === key) {
|
14710 | if (found) splice(entries, index--, 1);
|
14711 | else {
|
14712 | found = true;
|
14713 | entry.value = val;
|
14714 | }
|
14715 | }
|
14716 | }
|
14717 | if (!found) push(entries, { key: key, value: val });
|
14718 | state.updateURL();
|
14719 | },
|
14720 |
|
14721 |
|
14722 | sort: function sort() {
|
14723 | var state = getInternalParamsState(this);
|
14724 | arraySort(state.entries, function (a, b) {
|
14725 | return a.key > b.key ? 1 : -1;
|
14726 | });
|
14727 | state.updateURL();
|
14728 | },
|
14729 |
|
14730 | forEach: function forEach(callback /* , thisArg */) {
|
14731 | var entries = getInternalParamsState(this).entries;
|
14732 | var boundFunction = bind(callback, arguments.length > 1 ? arguments[1] : undefined);
|
14733 | var index = 0;
|
14734 | var entry;
|
14735 | while (index < entries.length) {
|
14736 | entry = entries[index++];
|
14737 | boundFunction(entry.value, entry.key, this);
|
14738 | }
|
14739 | },
|
14740 |
|
14741 | keys: function keys() {
|
14742 | return new URLSearchParamsIterator(this, 'keys');
|
14743 | },
|
14744 |
|
14745 | values: function values() {
|
14746 | return new URLSearchParamsIterator(this, 'values');
|
14747 | },
|
14748 |
|
14749 | entries: function entries() {
|
14750 | return new URLSearchParamsIterator(this, 'entries');
|
14751 | }
|
14752 | }, { enumerable: true });
|
14753 |
|
14754 |
|
14755 | redefine(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries, { name: 'entries' });
|
14756 |
|
14757 |
|
14758 |
|
14759 | redefine(URLSearchParamsPrototype, 'toString', function toString() {
|
14760 | var entries = getInternalParamsState(this).entries;
|
14761 | var result = [];
|
14762 | var index = 0;
|
14763 | var entry;
|
14764 | while (index < entries.length) {
|
14765 | entry = entries[index++];
|
14766 | push(result, serialize(entry.key) + '=' + serialize(entry.value));
|
14767 | } return join(result, '&');
|
14768 | }, { enumerable: true });
|
14769 |
|
14770 | setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS);
|
14771 |
|
14772 | $({ global: true, forced: !USE_NATIVE_URL }, {
|
14773 | URLSearchParams: URLSearchParamsConstructor
|
14774 | });
|
14775 |
|
14776 |
|
14777 | if (!USE_NATIVE_URL && isCallable(Headers)) {
|
14778 | var headersHas = uncurryThis(HeadersPrototype.has);
|
14779 | var headersSet = uncurryThis(HeadersPrototype.set);
|
14780 |
|
14781 | var wrapRequestOptions = function (init) {
|
14782 | if (isObject(init)) {
|
14783 | var body = init.body;
|
14784 | var headers;
|
14785 | if (classof(body) === URL_SEARCH_PARAMS) {
|
14786 | headers = init.headers ? new Headers(init.headers) : new Headers();
|
14787 | if (!headersHas(headers, 'content-type')) {
|
14788 | headersSet(headers, 'content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
|
14789 | }
|
14790 | return create(init, {
|
14791 | body: createPropertyDescriptor(0, $toString(body)),
|
14792 | headers: createPropertyDescriptor(0, headers)
|
14793 | });
|
14794 | }
|
14795 | } return init;
|
14796 | };
|
14797 |
|
14798 | if (isCallable(n$Fetch)) {
|
14799 | $({ global: true, enumerable: true, forced: true }, {
|
14800 | fetch: function fetch(input /* , init */) {
|
14801 | return n$Fetch(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {});
|
14802 | }
|
14803 | });
|
14804 | }
|
14805 |
|
14806 | if (isCallable(N$Request)) {
|
14807 | var RequestConstructor = function Request(input /* , init */) {
|
14808 | anInstance(this, RequestPrototype);
|
14809 | return new N$Request(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {});
|
14810 | };
|
14811 |
|
14812 | RequestPrototype.constructor = RequestConstructor;
|
14813 | RequestConstructor.prototype = RequestPrototype;
|
14814 |
|
14815 | $({ global: true, forced: true }, {
|
14816 | Request: RequestConstructor
|
14817 | });
|
14818 | }
|
14819 | }
|
14820 |
|
14821 | module.exports = {
|
14822 | URLSearchParams: URLSearchParamsConstructor,
|
14823 | getState: getInternalParamsState
|
14824 | };
|
14825 |
|
14826 |
|
14827 | }),
|
14828 |
|
14829 | (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
|
14830 |
|
14831 | "use strict";
|
14832 |
|
14833 | var $ = __webpack_require__(2);
|
14834 | var call = __webpack_require__(7);
|
14835 |
|
14836 |
|
14837 |
|
14838 | $({ target: 'URL', proto: true, enumerable: true }, {
|
14839 | toJSON: function toJSON() {
|
14840 | return call(URL.prototype.toString, this);
|
14841 | }
|
14842 | });
|
14843 |
|
14844 |
|
14845 | }),
|
14846 |
|
14847 | (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
14848 |
|
14849 | "use strict";
|
14850 |
|
14851 | __webpack_require__.r(__webpack_exports__);
|
14852 |
|
14853 |
|
14854 | __webpack_require__.d(__webpack_exports__, {
|
14855 | "bb": function() { return bb; },
|
14856 | "default": function() { return bb; }
|
14857 | });
|
14858 |
|
14859 |
|
14860 | var resolver_shape_namespaceObject = {};
|
14861 | __webpack_require__.r(resolver_shape_namespaceObject);
|
14862 | __webpack_require__.d(resolver_shape_namespaceObject, {
|
14863 | "area": function() { return _area; },
|
14864 | "areaLineRange": function() { return areaLineRange; },
|
14865 | "areaSpline": function() { return areaSpline; },
|
14866 | "areaSplineRange": function() { return areaSplineRange; },
|
14867 | "areaStep": function() { return areaStep; },
|
14868 | "bar": function() { return resolver_shape_bar; },
|
14869 | "bubble": function() { return resolver_shape_bubble; },
|
14870 | "candlestick": function() { return resolver_shape_candlestick; },
|
14871 | "donut": function() { return shape_donut; },
|
14872 | "gauge": function() { return resolver_shape_gauge; },
|
14873 | "line": function() { return resolver_shape_line; },
|
14874 | "pie": function() { return resolver_shape_pie; },
|
14875 | "radar": function() { return resolver_shape_radar; },
|
14876 | "scatter": function() { return shape_scatter; },
|
14877 | "spline": function() { return shape_spline; },
|
14878 | "step": function() { return shape_step; }
|
14879 | });
|
14880 |
|
14881 |
|
14882 | var resolver_interaction_namespaceObject = {};
|
14883 | __webpack_require__.r(resolver_interaction_namespaceObject);
|
14884 | __webpack_require__.d(resolver_interaction_namespaceObject, {
|
14885 | "selection": function() { return _selectionModule; },
|
14886 | "subchart": function() { return subchartModule; },
|
14887 | "zoom": function() { return zoomModule; }
|
14888 | });
|
14889 |
|
14890 | ;
|
14891 | var t0 = new Date(),
|
14892 | t1 = new Date();
|
14893 | function newInterval(floori, offseti, count, field) {
|
14894 | function interval(date) {
|
14895 | return floori(date = arguments.length === 0 ? new Date() : new Date(+date)), date;
|
14896 | }
|
14897 |
|
14898 | interval.floor = function (date) {
|
14899 | return floori(date = new Date(+date)), date;
|
14900 | };
|
14901 |
|
14902 | interval.ceil = function (date) {
|
14903 | return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;
|
14904 | };
|
14905 |
|
14906 | interval.round = function (date) {
|
14907 | var d0 = interval(date),
|
14908 | d1 = interval.ceil(date);
|
14909 | return date - d0 < d1 - date ? d0 : d1;
|
14910 | };
|
14911 |
|
14912 | interval.offset = function (date, step) {
|
14913 | return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;
|
14914 | };
|
14915 |
|
14916 | interval.range = function (start, stop, step) {
|
14917 | var range = [],
|
14918 | previous;
|
14919 | start = interval.ceil(start);
|
14920 | step = step == null ? 1 : Math.floor(step);
|
14921 | if (!(start < stop) || !(step > 0)) return range;
|
14922 |
|
14923 | do {
|
14924 | range.push(previous = new Date(+start)), offseti(start, step), floori(start);
|
14925 | } while (previous < start && start < stop);
|
14926 |
|
14927 | return range;
|
14928 | };
|
14929 |
|
14930 | interval.filter = function (test) {
|
14931 | return newInterval(function (date) {
|
14932 | if (date >= date) while (floori(date), !test(date)) {
|
14933 | date.setTime(date - 1);
|
14934 | }
|
14935 | }, function (date, step) {
|
14936 | if (date >= date) {
|
14937 | if (step < 0) while (++step <= 0) {
|
14938 | while (offseti(date, -1), !test(date)) {}
|
14939 |
|
14940 | } else while (--step >= 0) {
|
14941 | while (offseti(date, 1), !test(date)) {}
|
14942 |
|
14943 | }
|
14944 | }
|
14945 | });
|
14946 | };
|
14947 |
|
14948 | if (count) {
|
14949 | interval.count = function (start, end) {
|
14950 | t0.setTime(+start), t1.setTime(+end);
|
14951 | floori(t0), floori(t1);
|
14952 | return Math.floor(count(t0, t1));
|
14953 | };
|
14954 |
|
14955 | interval.every = function (step) {
|
14956 | step = Math.floor(step);
|
14957 | return !isFinite(step) || !(step > 0) ? null : !(step > 1) ? interval : interval.filter(field ? function (d) {
|
14958 | return field(d) % step === 0;
|
14959 | } : function (d) {
|
14960 | return interval.count(0, d) % step === 0;
|
14961 | });
|
14962 | };
|
14963 | }
|
14964 |
|
14965 | return interval;
|
14966 | }
|
14967 | ;
|
14968 | var durationSecond = 1e3;
|
14969 | var durationMinute = 60000;
|
14970 | var durationHour = 3600000;
|
14971 | var durationDay = 86400000;
|
14972 | var durationWeek = 604800000;
|
14973 | var durationMonth = 2592000000;
|
14974 | var durationYear = 31536000000;
|
14975 | ;
|
14976 |
|
14977 |
|
14978 |
|
14979 | function utcWeekday(i) {
|
14980 | return newInterval(function (date) {
|
14981 | date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);
|
14982 | date.setUTCHours(0, 0, 0, 0);
|
14983 | }, function (date, step) {
|
14984 | date.setUTCDate(date.getUTCDate() + step * 7);
|
14985 | }, function (start, end) {
|
14986 | return (end - start) / durationWeek;
|
14987 | });
|
14988 | }
|
14989 |
|
14990 | var utcSunday = utcWeekday(0);
|
14991 | var utcMonday = utcWeekday(1);
|
14992 | var utcTuesday = utcWeekday(2);
|
14993 | var utcWednesday = utcWeekday(3);
|
14994 | var utcThursday = utcWeekday(4);
|
14995 | var utcFriday = utcWeekday(5);
|
14996 | var utcSaturday = utcWeekday(6);
|
14997 | var utcSundays = utcSunday.range;
|
14998 | var utcMondays = utcMonday.range;
|
14999 | var utcTuesdays = utcTuesday.range;
|
15000 | var utcWednesdays = utcWednesday.range;
|
15001 | var utcThursdays = utcThursday.range;
|
15002 | var utcFridays = utcFriday.range;
|
15003 | var utcSaturdays = utcSaturday.range;
|
15004 | ;
|
15005 |
|
15006 |
|
15007 | var utcDay = newInterval(function (date) {
|
15008 | date.setUTCHours(0, 0, 0, 0);
|
15009 | }, function (date, step) {
|
15010 | date.setUTCDate(date.getUTCDate() + step);
|
15011 | }, function (start, end) {
|
15012 | return (end - start) / durationDay;
|
15013 | }, function (date) {
|
15014 | return date.getUTCDate() - 1;
|
15015 | });
|
15016 | var src_utcDay = (utcDay);
|
15017 | var utcDays = utcDay.range;
|
15018 | ;
|
15019 |
|
15020 |
|
15021 |
|
15022 | function weekday(i) {
|
15023 | return newInterval(function (date) {
|
15024 | date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
|
15025 | date.setHours(0, 0, 0, 0);
|
15026 | }, function (date, step) {
|
15027 | date.setDate(date.getDate() + step * 7);
|
15028 | }, function (start, end) {
|
15029 | return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;
|
15030 | });
|
15031 | }
|
15032 |
|
15033 | var sunday = weekday(0);
|
15034 | var monday = weekday(1);
|
15035 | var tuesday = weekday(2);
|
15036 | var wednesday = weekday(3);
|
15037 | var thursday = weekday(4);
|
15038 | var friday = weekday(5);
|
15039 | var saturday = weekday(6);
|
15040 | var sundays = sunday.range;
|
15041 | var mondays = monday.range;
|
15042 | var tuesdays = tuesday.range;
|
15043 | var wednesdays = wednesday.range;
|
15044 | var thursdays = thursday.range;
|
15045 | var fridays = friday.range;
|
15046 | var saturdays = saturday.range;
|
15047 | ;
|
15048 |
|
15049 |
|
15050 | var day = newInterval(function (date) {
|
15051 | return date.setHours(0, 0, 0, 0);
|
15052 | }, function (date, step) {
|
15053 | return date.setDate(date.getDate() + step);
|
15054 | }, function (start, end) {
|
15055 | return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay;
|
15056 | }, function (date) {
|
15057 | return date.getDate() - 1;
|
15058 | });
|
15059 | var src_day = (day);
|
15060 | var days = day.range;
|
15061 | ;
|
15062 |
|
15063 | var year = newInterval(function (date) {
|
15064 | date.setMonth(0, 1);
|
15065 | date.setHours(0, 0, 0, 0);
|
15066 | }, function (date, step) {
|
15067 | date.setFullYear(date.getFullYear() + step);
|
15068 | }, function (start, end) {
|
15069 | return end.getFullYear() - start.getFullYear();
|
15070 | }, function (date) {
|
15071 | return date.getFullYear();
|
15072 | });
|
15073 |
|
15074 | year.every = function (k) {
|
15075 | return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function (date) {
|
15076 | date.setFullYear(Math.floor(date.getFullYear() / k) * k);
|
15077 | date.setMonth(0, 1);
|
15078 | date.setHours(0, 0, 0, 0);
|
15079 | }, function (date, step) {
|
15080 | date.setFullYear(date.getFullYear() + step * k);
|
15081 | });
|
15082 | };
|
15083 |
|
15084 | var src_year = (year);
|
15085 | var years = year.range;
|
15086 | ;
|
15087 |
|
15088 | var utcYear = newInterval(function (date) {
|
15089 | date.setUTCMonth(0, 1);
|
15090 | date.setUTCHours(0, 0, 0, 0);
|
15091 | }, function (date, step) {
|
15092 | date.setUTCFullYear(date.getUTCFullYear() + step);
|
15093 | }, function (start, end) {
|
15094 | return end.getUTCFullYear() - start.getUTCFullYear();
|
15095 | }, function (date) {
|
15096 | return date.getUTCFullYear();
|
15097 | });
|
15098 |
|
15099 | utcYear.every = function (k) {
|
15100 | return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function (date) {
|
15101 | date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);
|
15102 | date.setUTCMonth(0, 1);
|
15103 | date.setUTCHours(0, 0, 0, 0);
|
15104 | }, function (date, step) {
|
15105 | date.setUTCFullYear(date.getUTCFullYear() + step * k);
|
15106 | });
|
15107 | };
|
15108 |
|
15109 | var src_utcYear = (utcYear);
|
15110 | var utcYears = utcYear.range;
|
15111 | ;
|
15112 |
|
15113 |
|
15114 | function localDate(d) {
|
15115 | if (0 <= d.y && d.y < 100) {
|
15116 | var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);
|
15117 | date.setFullYear(d.y);
|
15118 | return date;
|
15119 | }
|
15120 |
|
15121 | return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);
|
15122 | }
|
15123 |
|
15124 | function utcDate(d) {
|
15125 | if (0 <= d.y && d.y < 100) {
|
15126 | var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));
|
15127 | date.setUTCFullYear(d.y);
|
15128 | return date;
|
15129 | }
|
15130 |
|
15131 | return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));
|
15132 | }
|
15133 |
|
15134 | function newDate(y, m, d) {
|
15135 | return {
|
15136 | y: y,
|
15137 | m: m,
|
15138 | d: d,
|
15139 | H: 0,
|
15140 | M: 0,
|
15141 | S: 0,
|
15142 | L: 0
|
15143 | };
|
15144 | }
|
15145 |
|
15146 | function formatLocale(locale) {
|
15147 | var locale_dateTime = locale.dateTime,
|
15148 | locale_date = locale.date,
|
15149 | locale_time = locale.time,
|
15150 | locale_periods = locale.periods,
|
15151 | locale_weekdays = locale.days,
|
15152 | locale_shortWeekdays = locale.shortDays,
|
15153 | locale_months = locale.months,
|
15154 | locale_shortMonths = locale.shortMonths,
|
15155 | periodRe = formatRe(locale_periods),
|
15156 | periodLookup = formatLookup(locale_periods),
|
15157 | weekdayRe = formatRe(locale_weekdays),
|
15158 | weekdayLookup = formatLookup(locale_weekdays),
|
15159 | shortWeekdayRe = formatRe(locale_shortWeekdays),
|
15160 | shortWeekdayLookup = formatLookup(locale_shortWeekdays),
|
15161 | monthRe = formatRe(locale_months),
|
15162 | monthLookup = formatLookup(locale_months),
|
15163 | shortMonthRe = formatRe(locale_shortMonths),
|
15164 | shortMonthLookup = formatLookup(locale_shortMonths),
|
15165 | formats = {
|
15166 | "a": function (d) {
|
15167 | return locale_shortWeekdays[d.getDay()];
|
15168 | },
|
15169 | "A": function (d) {
|
15170 | return locale_weekdays[d.getDay()];
|
15171 | },
|
15172 | "b": function (d) {
|
15173 | return locale_shortMonths[d.getMonth()];
|
15174 | },
|
15175 | "B": function (d) {
|
15176 | return locale_months[d.getMonth()];
|
15177 | },
|
15178 | "c": null,
|
15179 | "d": formatDayOfMonth,
|
15180 | "e": formatDayOfMonth,
|
15181 | "f": formatMicroseconds,
|
15182 | "g": formatYearISO,
|
15183 | "G": formatFullYearISO,
|
15184 | "H": formatHour24,
|
15185 | "I": formatHour12,
|
15186 | "j": formatDayOfYear,
|
15187 | "L": formatMilliseconds,
|
15188 | "m": formatMonthNumber,
|
15189 | "M": formatMinutes,
|
15190 | "p": function (d) {
|
15191 | return locale_periods[+(d.getHours() >= 12)];
|
15192 | },
|
15193 | "q": function (d) {
|
15194 | return 1 + ~~(d.getMonth() / 3);
|
15195 | },
|
15196 | "Q": formatUnixTimestamp,
|
15197 | "s": formatUnixTimestampSeconds,
|
15198 | "S": formatSeconds,
|
15199 | "u": formatWeekdayNumberMonday,
|
15200 | "U": formatWeekNumberSunday,
|
15201 | "V": formatWeekNumberISO,
|
15202 | "w": formatWeekdayNumberSunday,
|
15203 | "W": formatWeekNumberMonday,
|
15204 | "x": null,
|
15205 | "X": null,
|
15206 | "y": formatYear,
|
15207 | "Y": formatFullYear,
|
15208 | "Z": formatZone,
|
15209 | "%": formatLiteralPercent
|
15210 | },
|
15211 | utcFormats = {
|
15212 | "a": function (d) {
|
15213 | return locale_shortWeekdays[d.getUTCDay()];
|
15214 | },
|
15215 | "A": function (d) {
|
15216 | return locale_weekdays[d.getUTCDay()];
|
15217 | },
|
15218 | "b": function (d) {
|
15219 | return locale_shortMonths[d.getUTCMonth()];
|
15220 | },
|
15221 | "B": function (d) {
|
15222 | return locale_months[d.getUTCMonth()];
|
15223 | },
|
15224 | "c": null,
|
15225 | "d": formatUTCDayOfMonth,
|
15226 | "e": formatUTCDayOfMonth,
|
15227 | "f": formatUTCMicroseconds,
|
15228 | "g": formatUTCYearISO,
|
15229 | "G": formatUTCFullYearISO,
|
15230 | "H": formatUTCHour24,
|
15231 | "I": formatUTCHour12,
|
15232 | "j": formatUTCDayOfYear,
|
15233 | "L": formatUTCMilliseconds,
|
15234 | "m": formatUTCMonthNumber,
|
15235 | "M": formatUTCMinutes,
|
15236 | "p": function (d) {
|
15237 | return locale_periods[+(d.getUTCHours() >= 12)];
|
15238 | },
|
15239 | "q": function (d) {
|
15240 | return 1 + ~~(d.getUTCMonth() / 3);
|
15241 | },
|
15242 | "Q": formatUnixTimestamp,
|
15243 | "s": formatUnixTimestampSeconds,
|
15244 | "S": formatUTCSeconds,
|
15245 | "u": formatUTCWeekdayNumberMonday,
|
15246 | "U": formatUTCWeekNumberSunday,
|
15247 | "V": formatUTCWeekNumberISO,
|
15248 | "w": formatUTCWeekdayNumberSunday,
|
15249 | "W": formatUTCWeekNumberMonday,
|
15250 | "x": null,
|
15251 | "X": null,
|
15252 | "y": formatUTCYear,
|
15253 | "Y": formatUTCFullYear,
|
15254 | "Z": formatUTCZone,
|
15255 | "%": formatLiteralPercent
|
15256 | },
|
15257 | parses = {
|
15258 | "a": function (d, string, i) {
|
15259 | var n = shortWeekdayRe.exec(string.slice(i));
|
15260 | return n ? (d.w = shortWeekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
15261 | },
|
15262 | "A": function (d, string, i) {
|
15263 | var n = weekdayRe.exec(string.slice(i));
|
15264 | return n ? (d.w = weekdayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
15265 | },
|
15266 | "b": function (d, string, i) {
|
15267 | var n = shortMonthRe.exec(string.slice(i));
|
15268 | return n ? (d.m = shortMonthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
15269 | },
|
15270 | "B": function (d, string, i) {
|
15271 | var n = monthRe.exec(string.slice(i));
|
15272 | return n ? (d.m = monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
15273 | },
|
15274 | "c": function (d, string, i) {
|
15275 | return parseSpecifier(d, locale_dateTime, string, i);
|
15276 | },
|
15277 | "d": parseDayOfMonth,
|
15278 | "e": parseDayOfMonth,
|
15279 | "f": parseMicroseconds,
|
15280 | "g": parseYear,
|
15281 | "G": parseFullYear,
|
15282 | "H": parseHour24,
|
15283 | "I": parseHour24,
|
15284 | "j": parseDayOfYear,
|
15285 | "L": parseMilliseconds,
|
15286 | "m": parseMonthNumber,
|
15287 | "M": parseMinutes,
|
15288 | "p": function (d, string, i) {
|
15289 | var n = periodRe.exec(string.slice(i));
|
15290 | return n ? (d.p = periodLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
|
15291 | },
|
15292 | "q": parseQuarter,
|
15293 | "Q": parseUnixTimestamp,
|
15294 | "s": parseUnixTimestampSeconds,
|
15295 | "S": parseSeconds,
|
15296 | "u": parseWeekdayNumberMonday,
|
15297 | "U": parseWeekNumberSunday,
|
15298 | "V": parseWeekNumberISO,
|
15299 | "w": parseWeekdayNumberSunday,
|
15300 | "W": parseWeekNumberMonday,
|
15301 | "x": function (d, string, i) {
|
15302 | return parseSpecifier(d, locale_date, string, i);
|
15303 | },
|
15304 | "X": function (d, string, i) {
|
15305 | return parseSpecifier(d, locale_time, string, i);
|
15306 | },
|
15307 | "y": parseYear,
|
15308 | "Y": parseFullYear,
|
15309 | "Z": parseZone,
|
15310 | "%": parseLiteralPercent
|
15311 | };
|
15312 |
|
15313 | formats.x = newFormat(locale_date, formats);
|
15314 | formats.X = newFormat(locale_time, formats);
|
15315 | formats.c = newFormat(locale_dateTime, formats);
|
15316 | utcFormats.x = newFormat(locale_date, utcFormats);
|
15317 | utcFormats.X = newFormat(locale_time, utcFormats);
|
15318 | utcFormats.c = newFormat(locale_dateTime, utcFormats);
|
15319 |
|
15320 | function newFormat(specifier, formats) {
|
15321 | return function (date) {
|
15322 | var string = [],
|
15323 | i = -1,
|
15324 | j = 0,
|
15325 | n = specifier.length,
|
15326 | c,
|
15327 | pad,
|
15328 | format;
|
15329 | if (!(date instanceof Date)) date = new Date(+date);
|
15330 |
|
15331 | while (++i < n) {
|
15332 | if (specifier.charCodeAt(i) === 37) {
|
15333 | string.push(specifier.slice(j, i));
|
15334 | if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);else pad = c === "e" ? " " : "0";
|
15335 | if (format = formats[c]) c = format(date, pad);
|
15336 | string.push(c);
|
15337 | j = i + 1;
|
15338 | }
|
15339 | }
|
15340 |
|
15341 | string.push(specifier.slice(j, i));
|
15342 | return string.join("");
|
15343 | };
|
15344 | }
|
15345 |
|
15346 | function newParse(specifier, Z) {
|
15347 | return function (string) {
|
15348 | var d = newDate(1900, undefined, 1),
|
15349 | i = parseSpecifier(d, specifier, string += "", 0),
|
15350 | week,
|
15351 | day;
|
15352 | if (i != string.length) return null;
|
15353 |
|
15354 | if ("Q" in d) return new Date(d.Q);
|
15355 | if ("s" in d) return new Date(d.s * 1e3 + ("L" in d ? d.L : 0));
|
15356 |
|
15357 | if (Z && !("Z" in d)) d.Z = 0;
|
15358 |
|
15359 | if ("p" in d) d.H = d.H % 12 + d.p * 12;
|
15360 |
|
15361 | if (d.m === undefined) d.m = "q" in d ? d.q : 0;
|
15362 |
|
15363 | if ("V" in d) {
|
15364 | if (d.V < 1 || d.V > 53) return null;
|
15365 | if (!("w" in d)) d.w = 1;
|
15366 |
|
15367 | if ("Z" in d) {
|
15368 | week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();
|
15369 | week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);
|
15370 | week = src_utcDay.offset(week, (d.V - 1) * 7);
|
15371 | d.y = week.getUTCFullYear();
|
15372 | d.m = week.getUTCMonth();
|
15373 | d.d = week.getUTCDate() + (d.w + 6) % 7;
|
15374 | } else {
|
15375 | week = localDate(newDate(d.y, 0, 1)), day = week.getDay();
|
15376 | week = day > 4 || day === 0 ? monday.ceil(week) : monday(week);
|
15377 | week = src_day.offset(week, (d.V - 1) * 7);
|
15378 | d.y = week.getFullYear();
|
15379 | d.m = week.getMonth();
|
15380 | d.d = week.getDate() + (d.w + 6) % 7;
|
15381 | }
|
15382 | } else if ("W" in d || "U" in d) {
|
15383 | if (!("w" in d)) d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0;
|
15384 | day = "Z" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();
|
15385 | d.m = 0;
|
15386 | d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;
|
15387 | }
|
15388 |
|
15389 |
|
15390 |
|
15391 | if ("Z" in d) {
|
15392 | d.H += d.Z / 100 | 0;
|
15393 | d.M += d.Z % 100;
|
15394 | return utcDate(d);
|
15395 | }
|
15396 |
|
15397 |
|
15398 | return localDate(d);
|
15399 | };
|
15400 | }
|
15401 |
|
15402 | function parseSpecifier(d, specifier, string, j) {
|
15403 | var i = 0,
|
15404 | n = specifier.length,
|
15405 | m = string.length,
|
15406 | c,
|
15407 | parse;
|
15408 |
|
15409 | while (i < n) {
|
15410 | if (j >= m) return -1;
|
15411 | c = specifier.charCodeAt(i++);
|
15412 |
|
15413 | if (c === 37) {
|
15414 | c = specifier.charAt(i++);
|
15415 | parse = parses[c in pads ? specifier.charAt(i++) : c];
|
15416 | if (!parse || (j = parse(d, string, j)) < 0) return -1;
|
15417 | } else if (c != string.charCodeAt(j++)) {
|
15418 | return -1;
|
15419 | }
|
15420 | }
|
15421 |
|
15422 | return j;
|
15423 | }
|
15424 |
|
15425 | return {
|
15426 | format: function format(specifier) {
|
15427 | var f = newFormat(specifier += "", formats);
|
15428 |
|
15429 | f.toString = function () {
|
15430 | return specifier;
|
15431 | };
|
15432 |
|
15433 | return f;
|
15434 | },
|
15435 | parse: function parse(specifier) {
|
15436 | var p = newParse(specifier += "", !1);
|
15437 |
|
15438 | p.toString = function () {
|
15439 | return specifier;
|
15440 | };
|
15441 |
|
15442 | return p;
|
15443 | },
|
15444 | utcFormat: function utcFormat(specifier) {
|
15445 | var f = newFormat(specifier += "", utcFormats);
|
15446 |
|
15447 | f.toString = function () {
|
15448 | return specifier;
|
15449 | };
|
15450 |
|
15451 | return f;
|
15452 | },
|
15453 | utcParse: function utcParse(specifier) {
|
15454 | var p = newParse(specifier += "", !0);
|
15455 |
|
15456 | p.toString = function () {
|
15457 | return specifier;
|
15458 | };
|
15459 |
|
15460 | return p;
|
15461 | }
|
15462 | };
|
15463 | }
|
15464 | var pads = {
|
15465 | "-": "",
|
15466 | "_": " ",
|
15467 | "0": "0"
|
15468 | },
|
15469 | numberRe = /^\s*\d+/,
|
15470 |
|
15471 | percentRe = /^%/,
|
15472 | requoteRe = /[\\^$*+?|[\]().{}]/g;
|
15473 |
|
15474 | function pad(value, fill, width) {
|
15475 | var sign = value < 0 ? "-" : "",
|
15476 | string = (sign ? -value : value) + "",
|
15477 | length = string.length;
|
15478 | return sign + (length < width ? Array(width - length + 1).join(fill) + string : string);
|
15479 | }
|
15480 |
|
15481 | function requote(s) {
|
15482 | return s.replace(requoteRe, "\\$&");
|
15483 | }
|
15484 |
|
15485 | function formatRe(names) {
|
15486 | return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i");
|
15487 | }
|
15488 |
|
15489 | function formatLookup(names) {
|
15490 | return new Map(names.map(function (name, i) {
|
15491 | return [name.toLowerCase(), i];
|
15492 | }));
|
15493 | }
|
15494 |
|
15495 | function parseWeekdayNumberSunday(d, string, i) {
|
15496 | var n = numberRe.exec(string.slice(i, i + 1));
|
15497 | return n ? (d.w = +n[0], i + n[0].length) : -1;
|
15498 | }
|
15499 |
|
15500 | function parseWeekdayNumberMonday(d, string, i) {
|
15501 | var n = numberRe.exec(string.slice(i, i + 1));
|
15502 | return n ? (d.u = +n[0], i + n[0].length) : -1;
|
15503 | }
|
15504 |
|
15505 | function parseWeekNumberSunday(d, string, i) {
|
15506 | var n = numberRe.exec(string.slice(i, i + 2));
|
15507 | return n ? (d.U = +n[0], i + n[0].length) : -1;
|
15508 | }
|
15509 |
|
15510 | function parseWeekNumberISO(d, string, i) {
|
15511 | var n = numberRe.exec(string.slice(i, i + 2));
|
15512 | return n ? (d.V = +n[0], i + n[0].length) : -1;
|
15513 | }
|
15514 |
|
15515 | function parseWeekNumberMonday(d, string, i) {
|
15516 | var n = numberRe.exec(string.slice(i, i + 2));
|
15517 | return n ? (d.W = +n[0], i + n[0].length) : -1;
|
15518 | }
|
15519 |
|
15520 | function parseFullYear(d, string, i) {
|
15521 | var n = numberRe.exec(string.slice(i, i + 4));
|
15522 | return n ? (d.y = +n[0], i + n[0].length) : -1;
|
15523 | }
|
15524 |
|
15525 | function parseYear(d, string, i) {
|
15526 | var n = numberRe.exec(string.slice(i, i + 2));
|
15527 | return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2e3), i + n[0].length) : -1;
|
15528 | }
|
15529 |
|
15530 | function parseZone(d, string, i) {
|
15531 | var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i, i + 6));
|
15532 | return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i + n[0].length) : -1;
|
15533 | }
|
15534 |
|
15535 | function parseQuarter(d, string, i) {
|
15536 | var n = numberRe.exec(string.slice(i, i + 1));
|
15537 | return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;
|
15538 | }
|
15539 |
|
15540 | function parseMonthNumber(d, string, i) {
|
15541 | var n = numberRe.exec(string.slice(i, i + 2));
|
15542 | return n ? (d.m = n[0] - 1, i + n[0].length) : -1;
|
15543 | }
|
15544 |
|
15545 | function parseDayOfMonth(d, string, i) {
|
15546 | var n = numberRe.exec(string.slice(i, i + 2));
|
15547 | return n ? (d.d = +n[0], i + n[0].length) : -1;
|
15548 | }
|
15549 |
|
15550 | function parseDayOfYear(d, string, i) {
|
15551 | var n = numberRe.exec(string.slice(i, i + 3));
|
15552 | return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;
|
15553 | }
|
15554 |
|
15555 | function parseHour24(d, string, i) {
|
15556 | var n = numberRe.exec(string.slice(i, i + 2));
|
15557 | return n ? (d.H = +n[0], i + n[0].length) : -1;
|
15558 | }
|
15559 |
|
15560 | function parseMinutes(d, string, i) {
|
15561 | var n = numberRe.exec(string.slice(i, i + 2));
|
15562 | return n ? (d.M = +n[0], i + n[0].length) : -1;
|
15563 | }
|
15564 |
|
15565 | function parseSeconds(d, string, i) {
|
15566 | var n = numberRe.exec(string.slice(i, i + 2));
|
15567 | return n ? (d.S = +n[0], i + n[0].length) : -1;
|
15568 | }
|
15569 |
|
15570 | function parseMilliseconds(d, string, i) {
|
15571 | var n = numberRe.exec(string.slice(i, i + 3));
|
15572 | return n ? (d.L = +n[0], i + n[0].length) : -1;
|
15573 | }
|
15574 |
|
15575 | function parseMicroseconds(d, string, i) {
|
15576 | var n = numberRe.exec(string.slice(i, i + 6));
|
15577 | return n ? (d.L = Math.floor(n[0] / 1e3), i + n[0].length) : -1;
|
15578 | }
|
15579 |
|
15580 | function parseLiteralPercent(d, string, i) {
|
15581 | var n = percentRe.exec(string.slice(i, i + 1));
|
15582 | return n ? i + n[0].length : -1;
|
15583 | }
|
15584 |
|
15585 | function parseUnixTimestamp(d, string, i) {
|
15586 | var n = numberRe.exec(string.slice(i));
|
15587 | return n ? (d.Q = +n[0], i + n[0].length) : -1;
|
15588 | }
|
15589 |
|
15590 | function parseUnixTimestampSeconds(d, string, i) {
|
15591 | var n = numberRe.exec(string.slice(i));
|
15592 | return n ? (d.s = +n[0], i + n[0].length) : -1;
|
15593 | }
|
15594 |
|
15595 | function formatDayOfMonth(d, p) {
|
15596 | return pad(d.getDate(), p, 2);
|
15597 | }
|
15598 |
|
15599 | function formatHour24(d, p) {
|
15600 | return pad(d.getHours(), p, 2);
|
15601 | }
|
15602 |
|
15603 | function formatHour12(d, p) {
|
15604 | return pad(d.getHours() % 12 || 12, p, 2);
|
15605 | }
|
15606 |
|
15607 | function formatDayOfYear(d, p) {
|
15608 | return pad(1 + src_day.count(src_year(d), d), p, 3);
|
15609 | }
|
15610 |
|
15611 | function formatMilliseconds(d, p) {
|
15612 | return pad(d.getMilliseconds(), p, 3);
|
15613 | }
|
15614 |
|
15615 | function formatMicroseconds(d, p) {
|
15616 | return formatMilliseconds(d, p) + "000";
|
15617 | }
|
15618 |
|
15619 | function formatMonthNumber(d, p) {
|
15620 | return pad(d.getMonth() + 1, p, 2);
|
15621 | }
|
15622 |
|
15623 | function formatMinutes(d, p) {
|
15624 | return pad(d.getMinutes(), p, 2);
|
15625 | }
|
15626 |
|
15627 | function formatSeconds(d, p) {
|
15628 | return pad(d.getSeconds(), p, 2);
|
15629 | }
|
15630 |
|
15631 | function formatWeekdayNumberMonday(d) {
|
15632 | var day = d.getDay();
|
15633 | return day === 0 ? 7 : day;
|
15634 | }
|
15635 |
|
15636 | function formatWeekNumberSunday(d, p) {
|
15637 | return pad(sunday.count(src_year(d) - 1, d), p, 2);
|
15638 | }
|
15639 |
|
15640 | function dISO(d) {
|
15641 | var day = d.getDay();
|
15642 | return day >= 4 || day === 0 ? thursday(d) : thursday.ceil(d);
|
15643 | }
|
15644 |
|
15645 | function formatWeekNumberISO(d, p) {
|
15646 | d = dISO(d);
|
15647 | return pad(thursday.count(src_year(d), d) + (src_year(d).getDay() === 4), p, 2);
|
15648 | }
|
15649 |
|
15650 | function formatWeekdayNumberSunday(d) {
|
15651 | return d.getDay();
|
15652 | }
|
15653 |
|
15654 | function formatWeekNumberMonday(d, p) {
|
15655 | return pad(monday.count(src_year(d) - 1, d), p, 2);
|
15656 | }
|
15657 |
|
15658 | function formatYear(d, p) {
|
15659 | return pad(d.getFullYear() % 100, p, 2);
|
15660 | }
|
15661 |
|
15662 | function formatYearISO(d, p) {
|
15663 | d = dISO(d);
|
15664 | return pad(d.getFullYear() % 100, p, 2);
|
15665 | }
|
15666 |
|
15667 | function formatFullYear(d, p) {
|
15668 | return pad(d.getFullYear() % 1e4, p, 4);
|
15669 | }
|
15670 |
|
15671 | function formatFullYearISO(d, p) {
|
15672 | var day = d.getDay();
|
15673 | d = day >= 4 || day === 0 ? thursday(d) : thursday.ceil(d);
|
15674 | return pad(d.getFullYear() % 1e4, p, 4);
|
15675 | }
|
15676 |
|
15677 | function formatZone(d) {
|
15678 | var z = d.getTimezoneOffset();
|
15679 | return (z > 0 ? "-" : (z *= -1, "+")) + pad(z / 60 | 0, "0", 2) + pad(z % 60, "0", 2);
|
15680 | }
|
15681 |
|
15682 | function formatUTCDayOfMonth(d, p) {
|
15683 | return pad(d.getUTCDate(), p, 2);
|
15684 | }
|
15685 |
|
15686 | function formatUTCHour24(d, p) {
|
15687 | return pad(d.getUTCHours(), p, 2);
|
15688 | }
|
15689 |
|
15690 | function formatUTCHour12(d, p) {
|
15691 | return pad(d.getUTCHours() % 12 || 12, p, 2);
|
15692 | }
|
15693 |
|
15694 | function formatUTCDayOfYear(d, p) {
|
15695 | return pad(1 + src_utcDay.count(src_utcYear(d), d), p, 3);
|
15696 | }
|
15697 |
|
15698 | function formatUTCMilliseconds(d, p) {
|
15699 | return pad(d.getUTCMilliseconds(), p, 3);
|
15700 | }
|
15701 |
|
15702 | function formatUTCMicroseconds(d, p) {
|
15703 | return formatUTCMilliseconds(d, p) + "000";
|
15704 | }
|
15705 |
|
15706 | function formatUTCMonthNumber(d, p) {
|
15707 | return pad(d.getUTCMonth() + 1, p, 2);
|
15708 | }
|
15709 |
|
15710 | function formatUTCMinutes(d, p) {
|
15711 | return pad(d.getUTCMinutes(), p, 2);
|
15712 | }
|
15713 |
|
15714 | function formatUTCSeconds(d, p) {
|
15715 | return pad(d.getUTCSeconds(), p, 2);
|
15716 | }
|
15717 |
|
15718 | function formatUTCWeekdayNumberMonday(d) {
|
15719 | var dow = d.getUTCDay();
|
15720 | return dow === 0 ? 7 : dow;
|
15721 | }
|
15722 |
|
15723 | function formatUTCWeekNumberSunday(d, p) {
|
15724 | return pad(utcSunday.count(src_utcYear(d) - 1, d), p, 2);
|
15725 | }
|
15726 |
|
15727 | function UTCdISO(d) {
|
15728 | var day = d.getUTCDay();
|
15729 | return day >= 4 || day === 0 ? utcThursday(d) : utcThursday.ceil(d);
|
15730 | }
|
15731 |
|
15732 | function formatUTCWeekNumberISO(d, p) {
|
15733 | d = UTCdISO(d);
|
15734 | return pad(utcThursday.count(src_utcYear(d), d) + (src_utcYear(d).getUTCDay() === 4), p, 2);
|
15735 | }
|
15736 |
|
15737 | function formatUTCWeekdayNumberSunday(d) {
|
15738 | return d.getUTCDay();
|
15739 | }
|
15740 |
|
15741 | function formatUTCWeekNumberMonday(d, p) {
|
15742 | return pad(utcMonday.count(src_utcYear(d) - 1, d), p, 2);
|
15743 | }
|
15744 |
|
15745 | function formatUTCYear(d, p) {
|
15746 | return pad(d.getUTCFullYear() % 100, p, 2);
|
15747 | }
|
15748 |
|
15749 | function formatUTCYearISO(d, p) {
|
15750 | d = UTCdISO(d);
|
15751 | return pad(d.getUTCFullYear() % 100, p, 2);
|
15752 | }
|
15753 |
|
15754 | function formatUTCFullYear(d, p) {
|
15755 | return pad(d.getUTCFullYear() % 1e4, p, 4);
|
15756 | }
|
15757 |
|
15758 | function formatUTCFullYearISO(d, p) {
|
15759 | var day = d.getUTCDay();
|
15760 | d = day >= 4 || day === 0 ? utcThursday(d) : utcThursday.ceil(d);
|
15761 | return pad(d.getUTCFullYear() % 1e4, p, 4);
|
15762 | }
|
15763 |
|
15764 | function formatUTCZone() {
|
15765 | return "+0000";
|
15766 | }
|
15767 |
|
15768 | function formatLiteralPercent() {
|
15769 | return "%";
|
15770 | }
|
15771 |
|
15772 | function formatUnixTimestamp(d) {
|
15773 | return +d;
|
15774 | }
|
15775 |
|
15776 | function formatUnixTimestampSeconds(d) {
|
15777 | return Math.floor(+d / 1e3);
|
15778 | }
|
15779 | ;
|
15780 |
|
15781 | var locale;
|
15782 | var timeFormat;
|
15783 | var timeParse;
|
15784 | var utcFormat;
|
15785 | var utcParse;
|
15786 | defaultLocale({
|
15787 | dateTime: "%x, %X",
|
15788 | date: "%-m/%-d/%Y",
|
15789 | time: "%-I:%M:%S %p",
|
15790 | periods: ["AM", "PM"],
|
15791 | days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
|
15792 | shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
15793 | months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
|
15794 | shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
|
15795 | });
|
15796 | function defaultLocale(definition) {
|
15797 | locale = formatLocale(definition);
|
15798 | timeFormat = locale.format;
|
15799 | timeParse = locale.parse;
|
15800 | utcFormat = locale.utcFormat;
|
15801 | utcParse = locale.utcParse;
|
15802 | return locale;
|
15803 | }
|
15804 | ;
|
15805 | function none() {}
|
15806 |
|
15807 | function selector(selector) {
|
15808 | return selector == null ? none : function () {
|
15809 | return this.querySelector(selector);
|
15810 | };
|
15811 | }
|
15812 | ;
|
15813 |
|
15814 |
|
15815 | function selection_select(select) {
|
15816 | if (typeof select !== "function") select = selector(select);
|
15817 |
|
15818 | for (var groups = this._groups, m = groups.length, subgroups = Array(m), j = 0; j < m; ++j) {
|
15819 | for (var group = groups[j], n = group.length, subgroup = subgroups[j] = Array(n), node, subnode, i = 0; i < n; ++i) {
|
15820 | if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {
|
15821 | if ("__data__" in node) subnode.__data__ = node.__data__;
|
15822 | subgroup[i] = subnode;
|
15823 | }
|
15824 | }
|
15825 | }
|
15826 |
|
15827 | return new Selection(subgroups, this._parents);
|
15828 | }
|
15829 | ;
|
15830 |
|
15831 |
|
15832 |
|
15833 |
|
15834 |
|
15835 |
|
15836 | function array(x) {
|
15837 | return x == null ? [] : Array.isArray(x) ? x : Array.from(x);
|
15838 | }
|
15839 | ;
|
15840 | function empty() {
|
15841 | return [];
|
15842 | }
|
15843 |
|
15844 | function selectorAll(selector) {
|
15845 | return selector == null ? empty : function () {
|
15846 | return this.querySelectorAll(selector);
|
15847 | };
|
15848 | }
|
15849 | ;
|
15850 |
|
15851 |
|
15852 |
|
15853 |
|
15854 | function arrayAll(select) {
|
15855 | return function () {
|
15856 | return array(select.apply(this, arguments));
|
15857 | };
|
15858 | }
|
15859 |
|
15860 | function selectAll(select) {
|
15861 | if (typeof select === "function") select = arrayAll(select);else select = selectorAll(select);
|
15862 |
|
15863 | for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {
|
15864 | for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
|
15865 | if (node = group[i]) {
|
15866 | subgroups.push(select.call(node, node.__data__, i, group));
|
15867 | parents.push(node);
|
15868 | }
|
15869 | }
|
15870 | }
|
15871 |
|
15872 | return new Selection(subgroups, parents);
|
15873 | }
|
15874 | ;
|
15875 | function matcher(selector) {
|
15876 | return function () {
|
15877 | return this.matches(selector);
|
15878 | };
|
15879 | }
|
15880 | function childMatcher(selector) {
|
15881 | return function (node) {
|
15882 | return node.matches(selector);
|
15883 | };
|
15884 | }
|
15885 | ;
|
15886 |
|
15887 | var find = Array.prototype.find;
|
15888 |
|
15889 | function childFind(match) {
|
15890 | return function () {
|
15891 | return find.call(this.children, match);
|
15892 | };
|
15893 | }
|
15894 |
|
15895 | function childFirst() {
|
15896 | return this.firstElementChild;
|
15897 | }
|
15898 |
|
15899 | function selectChild(match) {
|
15900 | return this.select(match == null ? childFirst : childFind(typeof match === "function" ? match : childMatcher(match)));
|
15901 | }
|
15902 | ;
|
15903 |
|
15904 | var filter = Array.prototype.filter;
|
15905 |
|
15906 | function children() {
|
15907 | return Array.from(this.children);
|
15908 | }
|
15909 |
|
15910 | function childrenFilter(match) {
|
15911 | return function () {
|
15912 | return filter.call(this.children, match);
|
15913 | };
|
15914 | }
|
15915 |
|
15916 | function selectChildren(match) {
|
15917 | return this.selectAll(match == null ? children : childrenFilter(typeof match === "function" ? match : childMatcher(match)));
|
15918 | }
|
15919 | ;
|
15920 |
|
15921 |
|
15922 | function selection_filter(match) {
|
15923 | if (typeof match !== "function") match = matcher(match);
|
15924 |
|
15925 | for (var groups = this._groups, m = groups.length, subgroups = Array(m), j = 0; j < m; ++j) {
|
15926 | for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {
|
15927 | if ((node = group[i]) && match.call(node, node.__data__, i, group)) {
|
15928 | subgroup.push(node);
|
15929 | }
|
15930 | }
|
15931 | }
|
15932 |
|
15933 | return new Selection(subgroups, this._parents);
|
15934 | }
|
15935 | ;
|
15936 | function sparse(update) {
|
15937 | return Array(update.length);
|
15938 | }
|
15939 | ;
|
15940 |
|
15941 |
|
15942 | function enter() {
|
15943 | return new Selection(this._enter || this._groups.map(sparse), this._parents);
|
15944 | }
|
15945 | function EnterNode(parent, datum) {
|
15946 | this.ownerDocument = parent.ownerDocument;
|
15947 | this.namespaceURI = parent.namespaceURI;
|
15948 | this._next = null;
|
15949 | this._parent = parent;
|
15950 | this.__data__ = datum;
|
15951 | }
|
15952 | EnterNode.prototype = {
|
15953 | constructor: EnterNode,
|
15954 | appendChild: function appendChild(child) {
|
15955 | return this._parent.insertBefore(child, this._next);
|
15956 | },
|
15957 | insertBefore: function insertBefore(child, next) {
|
15958 | return this._parent.insertBefore(child, next);
|
15959 | },
|
15960 | querySelector: function querySelector(selector) {
|
15961 | return this._parent.querySelector(selector);
|
15962 | },
|
15963 | querySelectorAll: function querySelectorAll(selector) {
|
15964 | return this._parent.querySelectorAll(selector);
|
15965 | }
|
15966 | };
|
15967 | ;
|
15968 | function constant(x) {
|
15969 | return function () {
|
15970 | return x;
|
15971 | };
|
15972 | }
|
15973 | ;
|
15974 |
|
15975 |
|
15976 |
|
15977 |
|
15978 | function bindIndex(parent, group, enter, update, exit, data) {
|
15979 | var i = 0,
|
15980 | node,
|
15981 | groupLength = group.length,
|
15982 | dataLength = data.length;
|
15983 |
|
15984 |
|
15985 |
|
15986 | for (; i < dataLength; ++i) {
|
15987 | if (node = group[i]) {
|
15988 | node.__data__ = data[i];
|
15989 | update[i] = node;
|
15990 | } else {
|
15991 | enter[i] = new EnterNode(parent, data[i]);
|
15992 | }
|
15993 | }
|
15994 |
|
15995 |
|
15996 | for (; i < groupLength; ++i) {
|
15997 | if (node = group[i]) {
|
15998 | exit[i] = node;
|
15999 | }
|
16000 | }
|
16001 | }
|
16002 |
|
16003 | function bindKey(parent, group, enter, update, exit, data, key) {
|
16004 | var i,
|
16005 | node,
|
16006 | nodeByKeyValue = new Map(),
|
16007 | groupLength = group.length,
|
16008 | dataLength = data.length,
|
16009 | keyValues = Array(groupLength),
|
16010 | keyValue;
|
16011 |
|
16012 |
|
16013 | for (i = 0; i < groupLength; ++i) {
|
16014 | if (node = group[i]) {
|
16015 | keyValues[i] = keyValue = key.call(node, node.__data__, i, group) + "";
|
16016 |
|
16017 | if (nodeByKeyValue.has(keyValue)) {
|
16018 | exit[i] = node;
|
16019 | } else {
|
16020 | nodeByKeyValue.set(keyValue, node);
|
16021 | }
|
16022 | }
|
16023 | }
|
16024 |
|
16025 |
|
16026 |
|
16027 |
|
16028 | for (i = 0; i < dataLength; ++i) {
|
16029 | keyValue = key.call(parent, data[i], i, data) + "";
|
16030 |
|
16031 | if (node = nodeByKeyValue.get(keyValue)) {
|
16032 | update[i] = node;
|
16033 | node.__data__ = data[i];
|
16034 | nodeByKeyValue.delete(keyValue);
|
16035 | } else {
|
16036 | enter[i] = new EnterNode(parent, data[i]);
|
16037 | }
|
16038 | }
|
16039 |
|
16040 |
|
16041 | for (i = 0; i < groupLength; ++i) {
|
16042 | if ((node = group[i]) && nodeByKeyValue.get(keyValues[i]) === node) {
|
16043 | exit[i] = node;
|
16044 | }
|
16045 | }
|
16046 | }
|
16047 |
|
16048 | function datum(node) {
|
16049 | return node.__data__;
|
16050 | }
|
16051 |
|
16052 | function data(value, key) {
|
16053 | if (!arguments.length) return Array.from(this, datum);
|
16054 | var bind = key ? bindKey : bindIndex,
|
16055 | parents = this._parents,
|
16056 | groups = this._groups;
|
16057 | if (typeof value !== "function") value = constant(value);
|
16058 |
|
16059 | for (var m = groups.length, update = Array(m), enter = Array(m), exit = Array(m), j = 0; j < m; ++j) {
|
16060 | var parent = parents[j],
|
16061 | group = groups[j],
|
16062 | groupLength = group.length,
|
16063 | data = arraylike(value.call(parent, parent && parent.__data__, j, parents)),
|
16064 | dataLength = data.length,
|
16065 | enterGroup = enter[j] = Array(dataLength),
|
16066 | updateGroup = update[j] = Array(dataLength),
|
16067 | exitGroup = exit[j] = Array(groupLength);
|
16068 | bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);
|
16069 |
|
16070 |
|
16071 |
|
16072 | for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {
|
16073 | if (previous = enterGroup[i0]) {
|
16074 | if (i0 >= i1) i1 = i0 + 1;
|
16075 |
|
16076 | while (!(next = updateGroup[i1]) && ++i1 < dataLength) {}
|
16077 |
|
16078 | previous._next = next || null;
|
16079 | }
|
16080 | }
|
16081 | }
|
16082 |
|
16083 | update = new Selection(update, parents);
|
16084 | update._enter = enter;
|
16085 | update._exit = exit;
|
16086 | return update;
|
16087 | }
|
16088 |
|
16089 |
|
16090 |
|
16091 |
|
16092 |
|
16093 |
|
16094 | function arraylike(data) {
|
16095 | return typeof data === "object" && "length" in data ? data
|
16096 | : Array.from(data);
|
16097 | }
|
16098 | ;
|
16099 |
|
16100 |
|
16101 | function exit() {
|
16102 | return new Selection(this._exit || this._groups.map(sparse), this._parents);
|
16103 | }
|
16104 | ;
|
16105 | function join(onenter, onupdate, onexit) {
|
16106 | var enter = this.enter(),
|
16107 | update = this,
|
16108 | exit = this.exit();
|
16109 |
|
16110 | if (typeof onenter === "function") {
|
16111 | enter = onenter(enter);
|
16112 | if (enter) enter = enter.selection();
|
16113 | } else {
|
16114 | enter = enter.append(onenter + "");
|
16115 | }
|
16116 |
|
16117 | if (onupdate != null) {
|
16118 | update = onupdate(update);
|
16119 | if (update) update = update.selection();
|
16120 | }
|
16121 |
|
16122 | if (onexit == null) exit.remove();else onexit(exit);
|
16123 | return enter && update ? enter.merge(update).order() : update;
|
16124 | }
|
16125 | ;
|
16126 |
|
16127 | function merge(context) {
|
16128 | for (var selection = context.selection ? context.selection() : context, 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) {
|
16129 | for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = Array(n), node, i = 0; i < n; ++i) {
|
16130 | if (node = group0[i] || group1[i]) {
|
16131 | merge[i] = node;
|
16132 | }
|
16133 | }
|
16134 | }
|
16135 |
|
16136 | for (; j < m0; ++j) {
|
16137 | merges[j] = groups0[j];
|
16138 | }
|
16139 |
|
16140 | return new Selection(merges, this._parents);
|
16141 | }
|
16142 | ;
|
16143 | function order() {
|
16144 | for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) {
|
16145 | for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) {
|
16146 | if (node = group[i]) {
|
16147 | if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next);
|
16148 | next = node;
|
16149 | }
|
16150 | }
|
16151 | }
|
16152 |
|
16153 | return this;
|
16154 | }
|
16155 | ;
|
16156 |
|
16157 | function sort(compare) {
|
16158 | if (!compare) compare = ascending;
|
16159 |
|
16160 | function compareNode(a, b) {
|
16161 | return a && b ? compare(a.__data__, b.__data__) : !a - !b;
|
16162 | }
|
16163 |
|
16164 | for (var groups = this._groups, m = groups.length, sortgroups = Array(m), j = 0; j < m; ++j) {
|
16165 | for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = Array(n), node, i = 0; i < n; ++i) {
|
16166 | if (node = group[i]) {
|
16167 | sortgroup[i] = node;
|
16168 | }
|
16169 | }
|
16170 |
|
16171 | sortgroup.sort(compareNode);
|
16172 | }
|
16173 |
|
16174 | return new Selection(sortgroups, this._parents).order();
|
16175 | }
|
16176 |
|
16177 | function ascending(a, b) {
|
16178 | return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
|
16179 | }
|
16180 | ;
|
16181 | function call() {
|
16182 | var callback = arguments[0];
|
16183 | arguments[0] = this;
|
16184 | callback.apply(null, arguments);
|
16185 | return this;
|
16186 | }
|
16187 | ;
|
16188 | function nodes() {
|
16189 | return Array.from(this);
|
16190 | }
|
16191 | ;
|
16192 | function node() {
|
16193 | for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {
|
16194 | for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {
|
16195 | node = group[i];
|
16196 | if (node) return node;
|
16197 | }
|
16198 | }
|
16199 |
|
16200 | return null;
|
16201 | }
|
16202 | ;
|
16203 | function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: !0 }; return { 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."); }
|
16204 |
|
16205 | function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
16206 |
|
16207 | function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
16208 |
|
16209 | function size() {
|
16210 | var size = 0;
|
16211 |
|
16212 | for (var _iterator = _createForOfIteratorHelperLoose(this), _step; !(_step = _iterator()).done;) {
|
16213 | _step.value;
|
16214 | ++size;
|
16215 | }
|
16216 |
|
16217 |
|
16218 | return size;
|
16219 | }
|
16220 | ;
|
16221 | function selection_empty() {
|
16222 | return !this.node();
|
16223 | }
|
16224 | ;
|
16225 | function each(callback) {
|
16226 | for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {
|
16227 | for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {
|
16228 | if (node = group[i]) callback.call(node, node.__data__, i, group);
|
16229 | }
|
16230 | }
|
16231 |
|
16232 | return this;
|
16233 | }
|
16234 | ;
|
16235 | var xhtml = "http://www.w3.org/1999/xhtml";
|
16236 | var namespaces = ({
|
16237 | svg: "http://www.w3.org/2000/svg",
|
16238 | xhtml: "http://www.w3.org/1999/xhtml",
|
16239 | xlink: "http://www.w3.org/1999/xlink",
|
16240 | xml: "http://www.w3.org/XML/1998/namespace",
|
16241 | xmlns: "http://www.w3.org/2000/xmlns/"
|
16242 | });
|
16243 | ;
|
16244 |
|
16245 | function namespace(name) {
|
16246 | var prefix = name += "",
|
16247 | i = prefix.indexOf(":");
|
16248 | if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1);
|
16249 | return namespaces.hasOwnProperty(prefix) ? {
|
16250 | space: namespaces[prefix],
|
16251 | local: name
|
16252 | } : name;
|
16253 | }
|
16254 | ;
|
16255 |
|
16256 |
|
16257 | function attrRemove(name) {
|
16258 | return function () {
|
16259 | this.removeAttribute(name);
|
16260 | };
|
16261 | }
|
16262 |
|
16263 | function attrRemoveNS(fullname) {
|
16264 | return function () {
|
16265 | this.removeAttributeNS(fullname.space, fullname.local);
|
16266 | };
|
16267 | }
|
16268 |
|
16269 | function attrConstant(name, value) {
|
16270 | return function () {
|
16271 | this.setAttribute(name, value);
|
16272 | };
|
16273 | }
|
16274 |
|
16275 | function attrConstantNS(fullname, value) {
|
16276 | return function () {
|
16277 | this.setAttributeNS(fullname.space, fullname.local, value);
|
16278 | };
|
16279 | }
|
16280 |
|
16281 | function attrFunction(name, value) {
|
16282 | return function () {
|
16283 | var v = value.apply(this, arguments);
|
16284 | if (v == null) this.removeAttribute(name);else this.setAttribute(name, v);
|
16285 | };
|
16286 | }
|
16287 |
|
16288 | function attrFunctionNS(fullname, value) {
|
16289 | return function () {
|
16290 | var v = value.apply(this, arguments);
|
16291 | if (v == null) this.removeAttributeNS(fullname.space, fullname.local);else this.setAttributeNS(fullname.space, fullname.local, v);
|
16292 | };
|
16293 | }
|
16294 |
|
16295 | function attr(name, value) {
|
16296 | var fullname = namespace(name);
|
16297 |
|
16298 | if (arguments.length < 2) {
|
16299 | var node = this.node();
|
16300 | return fullname.local ? node.getAttributeNS(fullname.space, fullname.local) : node.getAttribute(fullname);
|
16301 | }
|
16302 |
|
16303 | return this.each((value == null ? fullname.local ? attrRemoveNS : attrRemove : typeof value === "function" ? fullname.local ? attrFunctionNS : attrFunction : fullname.local ? attrConstantNS : attrConstant)(fullname, value));
|
16304 | }
|
16305 | ;
|
16306 | function src_window(node) {
|
16307 | return node.ownerDocument && node.ownerDocument.defaultView
|
16308 | || node.document && node
|
16309 | || node.defaultView;
|
16310 | }
|
16311 | ;
|
16312 |
|
16313 |
|
16314 | function styleRemove(name) {
|
16315 | return function () {
|
16316 | this.style.removeProperty(name);
|
16317 | };
|
16318 | }
|
16319 |
|
16320 | function styleConstant(name, value, priority) {
|
16321 | return function () {
|
16322 | this.style.setProperty(name, value, priority);
|
16323 | };
|
16324 | }
|
16325 |
|
16326 | function styleFunction(name, value, priority) {
|
16327 | return function () {
|
16328 | var v = value.apply(this, arguments);
|
16329 | if (v == null) this.style.removeProperty(name);else this.style.setProperty(name, v, priority);
|
16330 | };
|
16331 | }
|
16332 |
|
16333 | function style(name, value, priority) {
|
16334 | return arguments.length > 1 ? this.each((value == null ? styleRemove : typeof value === "function" ? styleFunction : styleConstant)(name, value, priority == null ? "" : priority)) : styleValue(this.node(), name);
|
16335 | }
|
16336 | function styleValue(node, name) {
|
16337 | return node.style.getPropertyValue(name) || src_window(node).getComputedStyle(node, null).getPropertyValue(name);
|
16338 | }
|
16339 | ;
|
16340 | function propertyRemove(name) {
|
16341 | return function () {
|
16342 | delete this[name];
|
16343 | };
|
16344 | }
|
16345 |
|
16346 | function propertyConstant(name, value) {
|
16347 | return function () {
|
16348 | this[name] = value;
|
16349 | };
|
16350 | }
|
16351 |
|
16352 | function propertyFunction(name, value) {
|
16353 | return function () {
|
16354 | var v = value.apply(this, arguments);
|
16355 | if (v == null) delete this[name];else this[name] = v;
|
16356 | };
|
16357 | }
|
16358 |
|
16359 | function property(name, value) {
|
16360 | return arguments.length > 1 ? this.each((value == null ? propertyRemove : typeof value === "function" ? propertyFunction : propertyConstant)(name, value)) : this.node()[name];
|
16361 | }
|
16362 | ;
|
16363 | function classArray(string) {
|
16364 | return string.trim().split(/^|\s+/);
|
16365 | }
|
16366 |
|
16367 | function classList(node) {
|
16368 | return node.classList || new ClassList(node);
|
16369 | }
|
16370 |
|
16371 | function ClassList(node) {
|
16372 | this._node = node;
|
16373 | this._names = classArray(node.getAttribute("class") || "");
|
16374 | }
|
16375 |
|
16376 | ClassList.prototype = {
|
16377 | add: function add(name) {
|
16378 | var i = this._names.indexOf(name);
|
16379 |
|
16380 | if (i < 0) {
|
16381 | this._names.push(name);
|
16382 |
|
16383 | this._node.setAttribute("class", this._names.join(" "));
|
16384 | }
|
16385 | },
|
16386 | remove: function remove(name) {
|
16387 | var i = this._names.indexOf(name);
|
16388 |
|
16389 | if (i >= 0) {
|
16390 | this._names.splice(i, 1);
|
16391 |
|
16392 | this._node.setAttribute("class", this._names.join(" "));
|
16393 | }
|
16394 | },
|
16395 | contains: function contains(name) {
|
16396 | return this._names.indexOf(name) >= 0;
|
16397 | }
|
16398 | };
|
16399 |
|
16400 | function classedAdd(node, names) {
|
16401 | var list = classList(node),
|
16402 | i = -1,
|
16403 | n = names.length;
|
16404 |
|
16405 | while (++i < n) {
|
16406 | list.add(names[i]);
|
16407 | }
|
16408 | }
|
16409 |
|
16410 | function classedRemove(node, names) {
|
16411 | var list = classList(node),
|
16412 | i = -1,
|
16413 | n = names.length;
|
16414 |
|
16415 | while (++i < n) {
|
16416 | list.remove(names[i]);
|
16417 | }
|
16418 | }
|
16419 |
|
16420 | function classedTrue(names) {
|
16421 | return function () {
|
16422 | classedAdd(this, names);
|
16423 | };
|
16424 | }
|
16425 |
|
16426 | function classedFalse(names) {
|
16427 | return function () {
|
16428 | classedRemove(this, names);
|
16429 | };
|
16430 | }
|
16431 |
|
16432 | function classedFunction(names, value) {
|
16433 | return function () {
|
16434 | (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);
|
16435 | };
|
16436 | }
|
16437 |
|
16438 | function classed(name, value) {
|
16439 | var names = classArray(name + "");
|
16440 |
|
16441 | if (arguments.length < 2) {
|
16442 | var list = classList(this.node()),
|
16443 | i = -1,
|
16444 | n = names.length;
|
16445 |
|
16446 | while (++i < n) {
|
16447 | if (!list.contains(names[i])) return !1;
|
16448 | }
|
16449 |
|
16450 | return !0;
|
16451 | }
|
16452 |
|
16453 | return this.each((typeof value === "function" ? classedFunction : value ? classedTrue : classedFalse)(names, value));
|
16454 | }
|
16455 | ;
|
16456 | function textRemove() {
|
16457 | this.textContent = "";
|
16458 | }
|
16459 |
|
16460 | function textConstant(value) {
|
16461 | return function () {
|
16462 | this.textContent = value;
|
16463 | };
|
16464 | }
|
16465 |
|
16466 | function textFunction(value) {
|
16467 | return function () {
|
16468 | var v = value.apply(this, arguments);
|
16469 | this.textContent = v == null ? "" : v;
|
16470 | };
|
16471 | }
|
16472 |
|
16473 | function selection_text(value) {
|
16474 | return arguments.length ? this.each(value == null ? textRemove : (typeof value === "function" ? textFunction : textConstant)(value)) : this.node().textContent;
|
16475 | }
|
16476 | ;
|
16477 | function htmlRemove() {
|
16478 | this.innerHTML = "";
|
16479 | }
|
16480 |
|
16481 | function htmlConstant(value) {
|
16482 | return function () {
|
16483 | this.innerHTML = value;
|
16484 | };
|
16485 | }
|
16486 |
|
16487 | function htmlFunction(value) {
|
16488 | return function () {
|
16489 | var v = value.apply(this, arguments);
|
16490 | this.innerHTML = v == null ? "" : v;
|
16491 | };
|
16492 | }
|
16493 |
|
16494 | function html(value) {
|
16495 | return arguments.length ? this.each(value == null ? htmlRemove : (typeof value === "function" ? htmlFunction : htmlConstant)(value)) : this.node().innerHTML;
|
16496 | }
|
16497 | ;
|
16498 | function raise() {
|
16499 | if (this.nextSibling) this.parentNode.appendChild(this);
|
16500 | }
|
16501 |
|
16502 | function selection_raise() {
|
16503 | return this.each(raise);
|
16504 | }
|
16505 | ;
|
16506 | function lower() {
|
16507 | if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);
|
16508 | }
|
16509 |
|
16510 | function selection_lower() {
|
16511 | return this.each(lower);
|
16512 | }
|
16513 | ;
|
16514 |
|
16515 |
|
16516 |
|
16517 | function creatorInherit(name) {
|
16518 | return function () {
|
16519 | var document = this.ownerDocument,
|
16520 | uri = this.namespaceURI;
|
16521 | return uri === xhtml && document.documentElement.namespaceURI === xhtml ? document.createElement(name) : document.createElementNS(uri, name);
|
16522 | };
|
16523 | }
|
16524 |
|
16525 | function creatorFixed(fullname) {
|
16526 | return function () {
|
16527 | return this.ownerDocument.createElementNS(fullname.space, fullname.local);
|
16528 | };
|
16529 | }
|
16530 |
|
16531 | function creator(name) {
|
16532 | var fullname = namespace(name);
|
16533 | return (fullname.local ? creatorFixed : creatorInherit)(fullname);
|
16534 | }
|
16535 | ;
|
16536 |
|
16537 | function append(name) {
|
16538 | var create = typeof name === "function" ? name : creator(name);
|
16539 | return this.select(function () {
|
16540 | return this.appendChild(create.apply(this, arguments));
|
16541 | });
|
16542 | }
|
16543 | ;
|
16544 |
|
16545 |
|
16546 |
|
16547 | function constantNull() {
|
16548 | return null;
|
16549 | }
|
16550 |
|
16551 | function insert(name, before) {
|
16552 | var create = typeof name === "function" ? name : creator(name),
|
16553 | select = before == null ? constantNull : typeof before === "function" ? before : selector(before);
|
16554 | return this.select(function () {
|
16555 | return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);
|
16556 | });
|
16557 | }
|
16558 | ;
|
16559 | function remove() {
|
16560 | var parent = this.parentNode;
|
16561 | if (parent) parent.removeChild(this);
|
16562 | }
|
16563 |
|
16564 | function selection_remove() {
|
16565 | return this.each(remove);
|
16566 | }
|
16567 | ;
|
16568 | function selection_cloneShallow() {
|
16569 | var clone = this.cloneNode(!1),
|
16570 | parent = this.parentNode;
|
16571 | return parent ? parent.insertBefore(clone, this.nextSibling) : clone;
|
16572 | }
|
16573 |
|
16574 | function selection_cloneDeep() {
|
16575 | var clone = this.cloneNode(!0),
|
16576 | parent = this.parentNode;
|
16577 | return parent ? parent.insertBefore(clone, this.nextSibling) : clone;
|
16578 | }
|
16579 |
|
16580 | function clone(deep) {
|
16581 | return this.select(deep ? selection_cloneDeep : selection_cloneShallow);
|
16582 | }
|
16583 | ;
|
16584 | function selection_datum(value) {
|
16585 | return arguments.length ? this.property("__data__", value) : this.node().__data__;
|
16586 | }
|
16587 | ;
|
16588 | function contextListener(listener) {
|
16589 | return function (event) {
|
16590 | listener.call(this, event, this.__data__);
|
16591 | };
|
16592 | }
|
16593 |
|
16594 | function parseTypenames(typenames) {
|
16595 | return typenames.trim().split(/^|\s+/).map(function (t) {
|
16596 | var name = "",
|
16597 | i = t.indexOf(".");
|
16598 | if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);
|
16599 | return {
|
16600 | type: t,
|
16601 | name: name
|
16602 | };
|
16603 | });
|
16604 | }
|
16605 |
|
16606 | function onRemove(typename) {
|
16607 | return function () {
|
16608 | var on = this.__on;
|
16609 | if (!on) return;
|
16610 |
|
16611 | for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {
|
16612 | if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {
|
16613 | this.removeEventListener(o.type, o.listener, o.options);
|
16614 | } else {
|
16615 | on[++i] = o;
|
16616 | }
|
16617 | }
|
16618 |
|
16619 | if (++i) on.length = i;else delete this.__on;
|
16620 | };
|
16621 | }
|
16622 |
|
16623 | function onAdd(typename, value, options) {
|
16624 | return function () {
|
16625 | var on = this.__on,
|
16626 | o,
|
16627 | listener = contextListener(value);
|
16628 | if (on) for (var j = 0, m = on.length; j < m; ++j) {
|
16629 | if ((o = on[j]).type === typename.type && o.name === typename.name) {
|
16630 | this.removeEventListener(o.type, o.listener, o.options);
|
16631 | this.addEventListener(o.type, o.listener = listener, o.options = options);
|
16632 | o.value = value;
|
16633 | return;
|
16634 | }
|
16635 | }
|
16636 | this.addEventListener(typename.type, listener, options);
|
16637 | o = {
|
16638 | type: typename.type,
|
16639 | name: typename.name,
|
16640 | value: value,
|
16641 | listener: listener,
|
16642 | options: options
|
16643 | };
|
16644 | if (!on) this.__on = [o];else on.push(o);
|
16645 | };
|
16646 | }
|
16647 |
|
16648 | function on(typename, value, options) {
|
16649 | var typenames = parseTypenames(typename + ""),
|
16650 | i,
|
16651 | n = typenames.length,
|
16652 | t;
|
16653 |
|
16654 | if (arguments.length < 2) {
|
16655 | var on = this.node().__on;
|
16656 |
|
16657 | if (on) for (var j = 0, m = on.length, o; j < m; ++j) {
|
16658 | for (i = 0, o = on[j]; i < n; ++i) {
|
16659 | if ((t = typenames[i]).type === o.type && t.name === o.name) {
|
16660 | return o.value;
|
16661 | }
|
16662 | }
|
16663 | }
|
16664 | return;
|
16665 | }
|
16666 |
|
16667 | on = value ? onAdd : onRemove;
|
16668 |
|
16669 | for (i = 0; i < n; ++i) {
|
16670 | this.each(on(typenames[i], value, options));
|
16671 | }
|
16672 |
|
16673 | return this;
|
16674 | }
|
16675 | ;
|
16676 |
|
16677 |
|
16678 | function dispatchEvent(node, type, params) {
|
16679 | var window = src_window(node),
|
16680 | event = window.CustomEvent;
|
16681 |
|
16682 | if (typeof event === "function") {
|
16683 | event = new event(type, params);
|
16684 | } else {
|
16685 | event = window.document.createEvent("Event");
|
16686 | if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;else event.initEvent(type, !1, !1);
|
16687 | }
|
16688 |
|
16689 | node.dispatchEvent(event);
|
16690 | }
|
16691 |
|
16692 | function dispatchConstant(type, params) {
|
16693 | return function () {
|
16694 | return dispatchEvent(this, type, params);
|
16695 | };
|
16696 | }
|
16697 |
|
16698 | function dispatchFunction(type, params) {
|
16699 | return function () {
|
16700 | return dispatchEvent(this, type, params.apply(this, arguments));
|
16701 | };
|
16702 | }
|
16703 |
|
16704 | function dispatch(type, params) {
|
16705 | return this.each((typeof params === "function" ? dispatchFunction : dispatchConstant)(type, params));
|
16706 | }
|
16707 |
|
16708 | var regenerator = __webpack_require__(427);
|
16709 | ;
|
16710 |
|
16711 |
|
16712 | var _marked = regenerator.mark(_callee);
|
16713 |
|
16714 | function _callee() {
|
16715 | var groups, j, m, group, i, n, node;
|
16716 | return regenerator.wrap(function (_context) {
|
16717 | while (1) {
|
16718 | switch (_context.prev = _context.next) {
|
16719 | case 0:
|
16720 | groups = this._groups, j = 0, m = groups.length;
|
16721 |
|
16722 | case 1:
|
16723 | if (!(j < m)) {
|
16724 | _context.next = 13;
|
16725 | break;
|
16726 | }
|
16727 |
|
16728 | group = groups[j], i = 0, n = group.length;
|
16729 |
|
16730 | case 3:
|
16731 | if (!(i < n)) {
|
16732 | _context.next = 10;
|
16733 | break;
|
16734 | }
|
16735 |
|
16736 | if (!(node = group[i])) {
|
16737 | _context.next = 7;
|
16738 | break;
|
16739 | }
|
16740 |
|
16741 | _context.next = 7;
|
16742 | return node;
|
16743 |
|
16744 | case 7:
|
16745 | ++i;
|
16746 | _context.next = 3;
|
16747 | break;
|
16748 |
|
16749 | case 10:
|
16750 | ++j;
|
16751 | _context.next = 1;
|
16752 | break;
|
16753 |
|
16754 | case 13:
|
16755 | case "end":
|
16756 | return _context.stop();
|
16757 | }
|
16758 | }
|
16759 | }, _marked, this);
|
16760 | }
|
16761 | ;
|
16762 | var _selection$prototype;
|
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 | var root = [null];
|
16799 | function Selection(groups, parents) {
|
16800 | this._groups = groups;
|
16801 | this._parents = parents;
|
16802 | }
|
16803 |
|
16804 | function selection() {
|
16805 | return new Selection([[document.documentElement]], root);
|
16806 | }
|
16807 |
|
16808 | function selection_selection() {
|
16809 | return this;
|
16810 | }
|
16811 |
|
16812 | Selection.prototype = selection.prototype = (_selection$prototype = {
|
16813 | constructor: Selection,
|
16814 | select: selection_select,
|
16815 | selectAll: selectAll,
|
16816 | selectChild: selectChild,
|
16817 | selectChildren: selectChildren,
|
16818 | filter: selection_filter,
|
16819 | data: data,
|
16820 | enter: enter,
|
16821 | exit: exit,
|
16822 | join: join,
|
16823 | merge: merge,
|
16824 | selection: selection_selection,
|
16825 | order: order,
|
16826 | sort: sort,
|
16827 | call: call,
|
16828 | nodes: nodes,
|
16829 | node: node,
|
16830 | size: size,
|
16831 | empty: selection_empty,
|
16832 | each: each,
|
16833 | attr: attr,
|
16834 | style: style,
|
16835 | property: property,
|
16836 | classed: classed,
|
16837 | text: selection_text,
|
16838 | html: html,
|
16839 | raise: selection_raise,
|
16840 | lower: selection_lower,
|
16841 | append: append,
|
16842 | insert: insert,
|
16843 | remove: selection_remove,
|
16844 | clone: clone,
|
16845 | datum: selection_datum,
|
16846 | on: on,
|
16847 | dispatch: dispatch
|
16848 | }, _selection$prototype[Symbol.iterator] = _callee, _selection$prototype);
|
16849 | /* harmony default export */ var src_selection = (selection);
|
16850 | ;// CONCATENATED MODULE: ./node_modules/d3-selection/src/select.js
|
16851 |
|
16852 | /* harmony default export */ function src_select(selector) {
|
16853 | return typeof selector === "string" ? new Selection([[document.querySelector(selector)]], [document.documentElement]) : new Selection([[selector]], root);
|
16854 | }
|
16855 | ;
|
16856 |
|
16857 |
|
16858 |
|
16859 |
|
16860 |
|
16861 |
|
16862 |
|
16863 |
|
16864 |
|
16865 |
|
16866 |
|
16867 |
|
16868 |
|
16869 | var win = function () {
|
16870 | 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;
|
16871 | return root || Function("return this")();
|
16872 | }();
|
16873 |
|
16874 |
|
16875 |
|
16876 |
|
16877 | win.requestIdleCallback = win.requestIdleCallback || function (cb) {
|
16878 | return setTimeout(cb, 1);
|
16879 | };
|
16880 |
|
16881 | win.cancelIdleCallback = win.cancelIdleCallback || function (id) {
|
16882 | return clearTimeout(id);
|
16883 | };
|
16884 |
|
16885 | var browser_doc = win == null ? void 0 : win.document;
|
16886 | ;
|
16887 |
|
16888 |
|
16889 |
|
16890 |
|
16891 |
|
16892 |
|
16893 |
|
16894 |
|
16895 |
|
16896 | var TYPE = {
|
16897 | AREA: "area",
|
16898 | AREA_LINE_RANGE: "area-line-range",
|
16899 | AREA_SPLINE: "area-spline",
|
16900 | AREA_SPLINE_RANGE: "area-spline-range",
|
16901 | AREA_STEP: "area-step",
|
16902 | BAR: "bar",
|
16903 | BUBBLE: "bubble",
|
16904 | CANDLESTICK: "candlestick",
|
16905 | DONUT: "donut",
|
16906 | GAUGE: "gauge",
|
16907 | LINE: "line",
|
16908 | PIE: "pie",
|
16909 | RADAR: "radar",
|
16910 | SCATTER: "scatter",
|
16911 | SPLINE: "spline",
|
16912 | STEP: "step"
|
16913 | };
|
16914 |
|
16915 |
|
16916 |
|
16917 |
|
16918 |
|
16919 | var TYPE_METHOD_NEEDED = {
|
16920 | AREA: "initArea",
|
16921 | AREA_LINE_RANGE: "initArea",
|
16922 | AREA_SPLINE: "initArea",
|
16923 | AREA_SPLINE_RANGE: "initArea",
|
16924 | AREA_STEP: "initArea",
|
16925 | BAR: "initBar",
|
16926 | BUBBLE: "initCircle",
|
16927 | CANDLESTICK: "initCandlestick",
|
16928 | DONUT: "initArc",
|
16929 | GAUGE: "initArc",
|
16930 | LINE: "initLine",
|
16931 | PIE: "initArc",
|
16932 | RADAR: "initCircle",
|
16933 | SCATTER: "initCircle",
|
16934 | SPLINE: "initLine",
|
16935 | STEP: "initLine"
|
16936 | };
|
16937 |
|
16938 |
|
16939 |
|
16940 |
|
16941 |
|
16942 | var TYPE_BY_CATEGORY = {
|
16943 | Area: [TYPE.AREA, TYPE.AREA_SPLINE, TYPE.AREA_SPLINE_RANGE, TYPE.AREA_LINE_RANGE, TYPE.AREA_STEP],
|
16944 | AreaRange: [TYPE.AREA_SPLINE_RANGE, TYPE.AREA_LINE_RANGE],
|
16945 | Arc: [TYPE.PIE, TYPE.DONUT, TYPE.GAUGE, TYPE.RADAR],
|
16946 | Line: [TYPE.LINE, TYPE.SPLINE, TYPE.AREA, TYPE.AREA_SPLINE, TYPE.AREA_SPLINE_RANGE, TYPE.AREA_LINE_RANGE, TYPE.STEP, TYPE.AREA_STEP],
|
16947 | Step: [TYPE.STEP, TYPE.AREA_STEP],
|
16948 | Spline: [TYPE.SPLINE, TYPE.AREA_SPLINE, TYPE.AREA_SPLINE_RANGE]
|
16949 | };
|
16950 | ;
|
16951 | function _defineProperty(obj, key, value) {
|
16952 | if (key in obj) {
|
16953 | Object.defineProperty(obj, key, {
|
16954 | value: value,
|
16955 | enumerable: true,
|
16956 | configurable: true,
|
16957 | writable: true
|
16958 | });
|
16959 | } else {
|
16960 | obj[key] = value;
|
16961 | }
|
16962 |
|
16963 | return obj;
|
16964 | }
|
16965 | ;
|
16966 | function sourceEvent(event) {
|
16967 | var sourceEvent;
|
16968 |
|
16969 | while (sourceEvent = event.sourceEvent) {
|
16970 | event = sourceEvent;
|
16971 | }
|
16972 |
|
16973 | return event;
|
16974 | }
|
16975 | ;
|
16976 |
|
16977 | function src_pointer(event, node) {
|
16978 | event = sourceEvent(event);
|
16979 | if (node === undefined) node = event.currentTarget;
|
16980 |
|
16981 | if (node) {
|
16982 | var svg = node.ownerSVGElement || node;
|
16983 |
|
16984 | if (svg.createSVGPoint) {
|
16985 | var point = svg.createSVGPoint();
|
16986 | point.x = event.clientX, point.y = event.clientY;
|
16987 | point = point.matrixTransform(node.getScreenCTM().inverse());
|
16988 | return [point.x, point.y];
|
16989 | }
|
16990 |
|
16991 | if (node.getBoundingClientRect) {
|
16992 | var rect = node.getBoundingClientRect();
|
16993 | return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];
|
16994 | }
|
16995 | }
|
16996 |
|
16997 | return [event.pageX, event.pageY];
|
16998 | }
|
16999 | ;
|
17000 | var noop = {
|
17001 | value: function value() {}
|
17002 | };
|
17003 |
|
17004 | function dispatch_dispatch() {
|
17005 | for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {
|
17006 | if (!(t = arguments[i] + "") || t in _ || /[\s.]/.test(t)) throw new Error("illegal type: " + t);
|
17007 | _[t] = [];
|
17008 | }
|
17009 |
|
17010 | return new Dispatch(_);
|
17011 | }
|
17012 |
|
17013 | function Dispatch(_) {
|
17014 | this._ = _;
|
17015 | }
|
17016 |
|
17017 | function dispatch_parseTypenames(typenames, types) {
|
17018 | return typenames.trim().split(/^|\s+/).map(function (t) {
|
17019 | var name = "",
|
17020 | i = t.indexOf(".");
|
17021 | if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);
|
17022 | if (t && !types.hasOwnProperty(t)) throw new Error("unknown type: " + t);
|
17023 | return {
|
17024 | type: t,
|
17025 | name: name
|
17026 | };
|
17027 | });
|
17028 | }
|
17029 |
|
17030 | Dispatch.prototype = dispatch_dispatch.prototype = {
|
17031 | constructor: Dispatch,
|
17032 | on: function on(typename, callback) {
|
17033 | var _ = this._,
|
17034 | T = dispatch_parseTypenames(typename + "", _),
|
17035 | t,
|
17036 | i = -1,
|
17037 | n = T.length;
|
17038 |
|
17039 | if (arguments.length < 2) {
|
17040 | while (++i < n) {
|
17041 | if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;
|
17042 | }
|
17043 |
|
17044 | return;
|
17045 | } // If a type was specified, set the callback for the given type and name.
|
17046 | // Otherwise, if a null callback was specified, remove callbacks of the given name.
|
17047 |
|
17048 |
|
17049 | if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback);
|
17050 |
|
17051 | while (++i < n) {
|
17052 | if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);else if (callback == null) for (t in _) {
|
17053 | _[t] = set(_[t], typename.name, null);
|
17054 | }
|
17055 | }
|
17056 |
|
17057 | return this;
|
17058 | },
|
17059 | copy: function () {
|
17060 | var copy = {},
|
17061 | _ = this._;
|
17062 |
|
17063 | for (var t in _) {
|
17064 | copy[t] = _[t].slice();
|
17065 | }
|
17066 |
|
17067 | return new Dispatch(copy);
|
17068 | },
|
17069 | call: function call(type, that) {
|
17070 | if ((n = arguments.length - 2) > 0) for (var args = Array(n), i = 0, n, t; i < n; ++i) {
|
17071 | args[i] = arguments[i + 2];
|
17072 | }
|
17073 | if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type);
|
17074 |
|
17075 | for (t = this._[type], i = 0, n = t.length; i < n; ++i) {
|
17076 | t[i].value.apply(that, args);
|
17077 | }
|
17078 | },
|
17079 | apply: function apply(type, that, args) {
|
17080 | if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type);
|
17081 |
|
17082 | for (var t = this._[type], i = 0, n = t.length; i < n; ++i) {
|
17083 | t[i].value.apply(that, args);
|
17084 | }
|
17085 | }
|
17086 | };
|
17087 |
|
17088 | function get(type, name) {
|
17089 | for (var i = 0, n = type.length, c; i < n; ++i) {
|
17090 | if ((c = type[i]).name === name) {
|
17091 | return c.value;
|
17092 | }
|
17093 | }
|
17094 | }
|
17095 |
|
17096 | function set(type, name, callback) {
|
17097 | for (var i = 0, n = type.length; i < n; ++i) {
|
17098 | if (type[i].name === name) {
|
17099 | type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));
|
17100 | break;
|
17101 | }
|
17102 | }
|
17103 |
|
17104 | if (callback != null) type.push({
|
17105 | name: name,
|
17106 | value: callback
|
17107 | });
|
17108 | return type;
|
17109 | }
|
17110 |
|
17111 | var src_dispatch = (dispatch_dispatch);
|
17112 | ;
|
17113 |
|
17114 |
|
17115 | var nonpassive = {
|
17116 | passive: !1
|
17117 | };
|
17118 | var nonpassivecapture = {
|
17119 | capture: !0,
|
17120 | passive: !1
|
17121 | };
|
17122 | function nopropagation(event) {
|
17123 | event.stopImmediatePropagation();
|
17124 | }
|
17125 | function noevent(event) {
|
17126 | event.preventDefault();
|
17127 | event.stopImmediatePropagation();
|
17128 | }
|
17129 | ;
|
17130 |
|
17131 |
|
17132 | function nodrag(view) {
|
17133 | var root = view.document.documentElement,
|
17134 | selection = src_select(view).on("dragstart.drag", noevent, nonpassivecapture);
|
17135 |
|
17136 | if ("onselectstart" in root) {
|
17137 | selection.on("selectstart.drag", noevent, nonpassivecapture);
|
17138 | } else {
|
17139 | root.__noselect = root.style.MozUserSelect;
|
17140 | root.style.MozUserSelect = "none";
|
17141 | }
|
17142 | }
|
17143 | function yesdrag(view, noclick) {
|
17144 | var root = view.document.documentElement,
|
17145 | selection = src_select(view).on("dragstart.drag", null);
|
17146 |
|
17147 | if (noclick) {
|
17148 | selection.on("click.drag", noevent, nonpassivecapture);
|
17149 | setTimeout(function () {
|
17150 | selection.on("click.drag", null);
|
17151 | }, 0);
|
17152 | }
|
17153 |
|
17154 | if ("onselectstart" in root) {
|
17155 | selection.on("selectstart.drag", null);
|
17156 | } else {
|
17157 | root.style.MozUserSelect = root.__noselect;
|
17158 | delete root.__noselect;
|
17159 | }
|
17160 | }
|
17161 | ;
|
17162 | function src_define(constructor, factory, prototype) {
|
17163 | constructor.prototype = factory.prototype = prototype;
|
17164 | prototype.constructor = constructor;
|
17165 | }
|
17166 | function extend(parent, definition) {
|
17167 | var prototype = Object.create(parent.prototype);
|
17168 |
|
17169 | for (var key in definition) {
|
17170 | prototype[key] = definition[key];
|
17171 | }
|
17172 |
|
17173 | return prototype;
|
17174 | }
|
17175 | ;
|
17176 |
|
17177 | function Color() {}
|
17178 | var _darker = .7;
|
17179 |
|
17180 |
|
17181 | var _brighter = 1 / _darker;
|
17182 |
|
17183 |
|
17184 | var reI = "\\s*([+-]?\\d+)\\s*",
|
17185 | reN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",
|
17186 | reP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",
|
17187 | reHex = /^#([0-9a-f]{3,8})$/,
|
17188 | reRgbInteger = new RegExp("^rgb\\(\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*\\)$"),
|
17189 | reRgbPercent = new RegExp("^rgb\\(\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*,\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*,\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*\\)$"),
|
17190 | reRgbaInteger = new RegExp("^rgba\\(\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d+)\\s*,\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*\\)$"),
|
17191 | 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*\\)$"),
|
17192 | reHslPercent = new RegExp("^hsl\\(\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*,\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*,\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*\\)$"),
|
17193 | 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*\\)$"),
|
17194 | named = {
|
17195 | aliceblue: 0xf0f8ff,
|
17196 | antiquewhite: 0xfaebd7,
|
17197 | aqua: 65535,
|
17198 | aquamarine: 8388564,
|
17199 | azure: 0xf0ffff,
|
17200 | beige: 0xf5f5dc,
|
17201 | bisque: 0xffe4c4,
|
17202 | black: 0,
|
17203 | blanchedalmond: 0xffebcd,
|
17204 | blue: 255,
|
17205 | blueviolet: 9055202,
|
17206 | brown: 0xa52a2a,
|
17207 | burlywood: 0xdeb887,
|
17208 | cadetblue: 6266528,
|
17209 | chartreuse: 8388352,
|
17210 | chocolate: 0xd2691e,
|
17211 | coral: 0xff7f50,
|
17212 | cornflowerblue: 6591981,
|
17213 | cornsilk: 0xfff8dc,
|
17214 | crimson: 0xdc143c,
|
17215 | cyan: 65535,
|
17216 | darkblue: 139,
|
17217 | darkcyan: 35723,
|
17218 | darkgoldenrod: 0xb8860b,
|
17219 | darkgray: 0xa9a9a9,
|
17220 | darkgreen: 25600,
|
17221 | darkgrey: 0xa9a9a9,
|
17222 | darkkhaki: 0xbdb76b,
|
17223 | darkmagenta: 9109643,
|
17224 | darkolivegreen: 5597999,
|
17225 | darkorange: 0xff8c00,
|
17226 | darkorchid: 0x9932cc,
|
17227 | darkred: 9109504,
|
17228 | darksalmon: 0xe9967a,
|
17229 | darkseagreen: 9419919,
|
17230 | darkslateblue: 4734347,
|
17231 | darkslategray: 3100495,
|
17232 | darkslategrey: 3100495,
|
17233 | darkturquoise: 52945,
|
17234 | darkviolet: 9699539,
|
17235 | deeppink: 0xff1493,
|
17236 | deepskyblue: 49151,
|
17237 | dimgray: 6908265,
|
17238 | dimgrey: 6908265,
|
17239 | dodgerblue: 2003199,
|
17240 | firebrick: 0xb22222,
|
17241 | floralwhite: 0xfffaf0,
|
17242 | forestgreen: 2263842,
|
17243 | fuchsia: 0xff00ff,
|
17244 | gainsboro: 0xdcdcdc,
|
17245 | ghostwhite: 0xf8f8ff,
|
17246 | gold: 0xffd700,
|
17247 | goldenrod: 0xdaa520,
|
17248 | gray: 8421504,
|
17249 | green: 32768,
|
17250 | greenyellow: 0xadff2f,
|
17251 | grey: 8421504,
|
17252 | honeydew: 0xf0fff0,
|
17253 | hotpink: 0xff69b4,
|
17254 | indianred: 0xcd5c5c,
|
17255 | indigo: 4915330,
|
17256 | ivory: 0xfffff0,
|
17257 | khaki: 0xf0e68c,
|
17258 | lavender: 0xe6e6fa,
|
17259 | lavenderblush: 0xfff0f5,
|
17260 | lawngreen: 8190976,
|
17261 | lemonchiffon: 0xfffacd,
|
17262 | lightblue: 0xadd8e6,
|
17263 | lightcoral: 0xf08080,
|
17264 | lightcyan: 0xe0ffff,
|
17265 | lightgoldenrodyellow: 0xfafad2,
|
17266 | lightgray: 0xd3d3d3,
|
17267 | lightgreen: 9498256,
|
17268 | lightgrey: 0xd3d3d3,
|
17269 | lightpink: 0xffb6c1,
|
17270 | lightsalmon: 0xffa07a,
|
17271 | lightseagreen: 2142890,
|
17272 | lightskyblue: 8900346,
|
17273 | lightslategray: 7833753,
|
17274 | lightslategrey: 7833753,
|
17275 | lightsteelblue: 0xb0c4de,
|
17276 | lightyellow: 0xffffe0,
|
17277 | lime: 65280,
|
17278 | limegreen: 3329330,
|
17279 | linen: 0xfaf0e6,
|
17280 | magenta: 0xff00ff,
|
17281 | maroon: 8388608,
|
17282 | mediumaquamarine: 6737322,
|
17283 | mediumblue: 205,
|
17284 | mediumorchid: 0xba55d3,
|
17285 | mediumpurple: 9662683,
|
17286 | mediumseagreen: 3978097,
|
17287 | mediumslateblue: 8087790,
|
17288 | mediumspringgreen: 64154,
|
17289 | mediumturquoise: 4772300,
|
17290 | mediumvioletred: 0xc71585,
|
17291 | midnightblue: 1644912,
|
17292 | mintcream: 0xf5fffa,
|
17293 | mistyrose: 0xffe4e1,
|
17294 | moccasin: 0xffe4b5,
|
17295 | navajowhite: 0xffdead,
|
17296 | navy: 128,
|
17297 | oldlace: 0xfdf5e6,
|
17298 | olive: 8421376,
|
17299 | olivedrab: 7048739,
|
17300 | orange: 0xffa500,
|
17301 | orangered: 0xff4500,
|
17302 | orchid: 0xda70d6,
|
17303 | palegoldenrod: 0xeee8aa,
|
17304 | palegreen: 0x98fb98,
|
17305 | paleturquoise: 0xafeeee,
|
17306 | palevioletred: 0xdb7093,
|
17307 | papayawhip: 0xffefd5,
|
17308 | peachpuff: 0xffdab9,
|
17309 | peru: 0xcd853f,
|
17310 | pink: 0xffc0cb,
|
17311 | plum: 0xdda0dd,
|
17312 | powderblue: 0xb0e0e6,
|
17313 | purple: 8388736,
|
17314 | rebeccapurple: 6697881,
|
17315 | red: 0xff0000,
|
17316 | rosybrown: 0xbc8f8f,
|
17317 | royalblue: 4286945,
|
17318 | saddlebrown: 9127187,
|
17319 | salmon: 0xfa8072,
|
17320 | sandybrown: 0xf4a460,
|
17321 | seagreen: 3050327,
|
17322 | seashell: 0xfff5ee,
|
17323 | sienna: 0xa0522d,
|
17324 | silver: 0xc0c0c0,
|
17325 | skyblue: 8900331,
|
17326 | slateblue: 6970061,
|
17327 | slategray: 7372944,
|
17328 | slategrey: 7372944,
|
17329 | snow: 0xfffafa,
|
17330 | springgreen: 65407,
|
17331 | steelblue: 4620980,
|
17332 | tan: 0xd2b48c,
|
17333 | teal: 32896,
|
17334 | thistle: 0xd8bfd8,
|
17335 | tomato: 0xff6347,
|
17336 | turquoise: 4251856,
|
17337 | violet: 0xee82ee,
|
17338 | wheat: 0xf5deb3,
|
17339 | white: 0xffffff,
|
17340 | whitesmoke: 0xf5f5f5,
|
17341 | yellow: 0xffff00,
|
17342 | yellowgreen: 0x9acd32
|
17343 | };
|
17344 | src_define(Color, color, {
|
17345 | copy: function copy(channels) {
|
17346 | return Object.assign(new this.constructor(), this, channels);
|
17347 | },
|
17348 | displayable: function displayable() {
|
17349 | return this.rgb().displayable();
|
17350 | },
|
17351 | hex: color_formatHex,
|
17352 |
|
17353 | formatHex: color_formatHex,
|
17354 | formatHsl: color_formatHsl,
|
17355 | formatRgb: color_formatRgb,
|
17356 | toString: color_formatRgb
|
17357 | });
|
17358 |
|
17359 | function color_formatHex() {
|
17360 | return this.rgb().formatHex();
|
17361 | }
|
17362 |
|
17363 | function color_formatHsl() {
|
17364 | return hslConvert(this).formatHsl();
|
17365 | }
|
17366 |
|
17367 | function color_formatRgb() {
|
17368 | return this.rgb().formatRgb();
|
17369 | }
|
17370 |
|
17371 | function color(format) {
|
17372 | var m, l;
|
17373 | format = (format + "").trim().toLowerCase();
|
17374 | return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m)
|
17375 | : l === 3 ? new Rgb(m >> 8 & 15 | m >> 4 & 240, m >> 4 & 15 | m & 240, (m & 15) << 4 | m & 15, 1)
|
17376 | : l === 8 ? rgba(m >> 24 & 255, m >> 16 & 255, m >> 8 & 255, (m & 255) / 255)
|
17377 | : 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)
|
17378 | : null
|
17379 | ) : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1)
|
17380 | : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1)
|
17381 | : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4])
|
17382 | : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4])
|
17383 | : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1)
|
17384 | : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4])
|
17385 | : named.hasOwnProperty(format) ? rgbn(named[format])
|
17386 | : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null;
|
17387 | }
|
17388 |
|
17389 | function rgbn(n) {
|
17390 | return new Rgb(n >> 16 & 255, n >> 8 & 255, n & 255, 1);
|
17391 | }
|
17392 |
|
17393 | function rgba(r, g, b, a) {
|
17394 | if (a <= 0) r = g = b = NaN;
|
17395 | return new Rgb(r, g, b, a);
|
17396 | }
|
17397 |
|
17398 | function rgbConvert(o) {
|
17399 | if (!(o instanceof Color)) o = color(o);
|
17400 | if (!o) return new Rgb();
|
17401 | o = o.rgb();
|
17402 | return new Rgb(o.r, o.g, o.b, o.opacity);
|
17403 | }
|
17404 | function color_rgb(r, g, b, opacity) {
|
17405 | return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
|
17406 | }
|
17407 | function Rgb(r, g, b, opacity) {
|
17408 | this.r = +r;
|
17409 | this.g = +g;
|
17410 | this.b = +b;
|
17411 | this.opacity = +opacity;
|
17412 | }
|
17413 | src_define(Rgb, color_rgb, extend(Color, {
|
17414 | brighter: function brighter(k) {
|
17415 | k = k == null ? _brighter : Math.pow(_brighter, k);
|
17416 | return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
|
17417 | },
|
17418 | darker: function darker(k) {
|
17419 | k = k == null ? _darker : Math.pow(_darker, k);
|
17420 | return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
|
17421 | },
|
17422 | rgb: function () {
|
17423 | return this;
|
17424 | },
|
17425 | displayable: function displayable() {
|
17426 | 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;
|
17427 | },
|
17428 | hex: rgb_formatHex,
|
17429 |
|
17430 | formatHex: rgb_formatHex,
|
17431 | formatRgb: rgb_formatRgb,
|
17432 | toString: rgb_formatRgb
|
17433 | }));
|
17434 |
|
17435 | function rgb_formatHex() {
|
17436 | return "#" + hex(this.r) + hex(this.g) + hex(this.b);
|
17437 | }
|
17438 |
|
17439 | function rgb_formatRgb() {
|
17440 | var a = this.opacity;
|
17441 | a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));
|
17442 | return (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 + ")");
|
17443 | }
|
17444 |
|
17445 | function hex(value) {
|
17446 | value = Math.max(0, Math.min(255, Math.round(value) || 0));
|
17447 | return (value < 16 ? "0" : "") + value.toString(16);
|
17448 | }
|
17449 |
|
17450 | function hsla(h, s, l, a) {
|
17451 | if (a <= 0) h = s = l = NaN;else if (l <= 0 || l >= 1) h = s = NaN;else if (s <= 0) h = NaN;
|
17452 | return new Hsl(h, s, l, a);
|
17453 | }
|
17454 |
|
17455 | function hslConvert(o) {
|
17456 | if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
|
17457 | if (!(o instanceof Color)) o = color(o);
|
17458 | if (!o) return new Hsl();
|
17459 | if (o instanceof Hsl) return o;
|
17460 | o = o.rgb();
|
17461 | var r = o.r / 255,
|
17462 | g = o.g / 255,
|
17463 | b = o.b / 255,
|
17464 | min = Math.min(r, g, b),
|
17465 | max = Math.max(r, g, b),
|
17466 | h = NaN,
|
17467 | s = max - min,
|
17468 | l = (max + min) / 2;
|
17469 |
|
17470 | if (s) {
|
17471 | if (r === max) h = (g - b) / s + (g < b) * 6;else if (g === max) h = (b - r) / s + 2;else h = (r - g) / s + 4;
|
17472 | s /= l < .5 ? max + min : 2 - max - min;
|
17473 | h *= 60;
|
17474 | } else {
|
17475 | s = l > 0 && l < 1 ? 0 : h;
|
17476 | }
|
17477 |
|
17478 | return new Hsl(h, s, l, o.opacity);
|
17479 | }
|
17480 | function hsl(h, s, l, opacity) {
|
17481 | return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);
|
17482 | }
|
17483 |
|
17484 | function Hsl(h, s, l, opacity) {
|
17485 | this.h = +h;
|
17486 | this.s = +s;
|
17487 | this.l = +l;
|
17488 | this.opacity = +opacity;
|
17489 | }
|
17490 |
|
17491 | src_define(Hsl, hsl, extend(Color, {
|
17492 | brighter: function brighter(k) {
|
17493 | k = k == null ? _brighter : Math.pow(_brighter, k);
|
17494 | return new Hsl(this.h, this.s, this.l * k, this.opacity);
|
17495 | },
|
17496 | darker: function darker(k) {
|
17497 | k = k == null ? _darker : Math.pow(_darker, k);
|
17498 | return new Hsl(this.h, this.s, this.l * k, this.opacity);
|
17499 | },
|
17500 | rgb: function () {
|
17501 | var h = this.h % 360 + (this.h < 0) * 360,
|
17502 | s = isNaN(h) || isNaN(this.s) ? 0 : this.s,
|
17503 | l = this.l,
|
17504 | m2 = l + (l < .5 ? l : 1 - l) * s,
|
17505 | m1 = 2 * l - m2;
|
17506 | 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);
|
17507 | },
|
17508 | displayable: function displayable() {
|
17509 | return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
|
17510 | },
|
17511 | formatHsl: function formatHsl() {
|
17512 | var a = this.opacity;
|
17513 | a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));
|
17514 | return (a === 1 ? "hsl(" : "hsla(") + (this.h || 0) + ", " + (this.s || 0) * 100 + "%, " + (this.l || 0) * 100 + "%" + (a === 1 ? ")" : ", " + a + ")");
|
17515 | }
|
17516 | }));
|
17517 |
|
17518 |
|
17519 | function hsl2rgb(h, m1, m2) {
|
17520 | return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255;
|
17521 | }
|
17522 | ;
|
17523 | function basis(t1, v0, v1, v2, v3) {
|
17524 | var t2 = t1 * t1,
|
17525 | t3 = t2 * t1;
|
17526 | 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;
|
17527 | }
|
17528 | function src_basis(values) {
|
17529 | var n = values.length - 1;
|
17530 | return function (t) {
|
17531 | var i = t <= 0 ? t = 0 : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),
|
17532 | v1 = values[i],
|
17533 | v2 = values[i + 1],
|
17534 | v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,
|
17535 | v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;
|
17536 | return basis((t - i / n) * n, v0, v1, v2, v3);
|
17537 | };
|
17538 | }
|
17539 | ;
|
17540 |
|
17541 | function basisClosed(values) {
|
17542 | var n = values.length;
|
17543 | return function (t) {
|
17544 | var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),
|
17545 | v0 = values[(i + n - 1) % n],
|
17546 | v1 = values[i % n],
|
17547 | v2 = values[(i + 1) % n],
|
17548 | v3 = values[(i + 2) % n];
|
17549 | return basis((t - i / n) * n, v0, v1, v2, v3);
|
17550 | };
|
17551 | }
|
17552 | ;
|
17553 | var src_constant = (function (x) {
|
17554 | return function () {
|
17555 | return x;
|
17556 | };
|
17557 | });
|
17558 | ;
|
17559 |
|
17560 |
|
17561 | function linear(a, d) {
|
17562 | return function (t) {
|
17563 | return a + t * d;
|
17564 | };
|
17565 | }
|
17566 |
|
17567 | function exponential(a, b, y) {
|
17568 | return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function (t) {
|
17569 | return Math.pow(a + t * b, y);
|
17570 | };
|
17571 | }
|
17572 |
|
17573 | function hue(a, b) {
|
17574 | var d = b - a;
|
17575 | return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : src_constant(isNaN(a) ? b : a);
|
17576 | }
|
17577 | function gamma(y) {
|
17578 | return (y = +y) === 1 ? nogamma : function (a, b) {
|
17579 | return b - a ? exponential(a, b, y) : src_constant(isNaN(a) ? b : a);
|
17580 | };
|
17581 | }
|
17582 | function nogamma(a, b) {
|
17583 | var d = b - a;
|
17584 | return d ? linear(a, d) : src_constant(isNaN(a) ? b : a);
|
17585 | }
|
17586 | ;
|
17587 |
|
17588 |
|
17589 |
|
17590 |
|
17591 | var rgb = ((function rgbGamma(y) {
|
17592 | var color = gamma(y);
|
17593 |
|
17594 | function rgb(start, end) {
|
17595 | var r = color((start = color_rgb(start)).r, (end = color_rgb(end)).r),
|
17596 | g = color(start.g, end.g),
|
17597 | b = color(start.b, end.b),
|
17598 | opacity = nogamma(start.opacity, end.opacity);
|
17599 | return function (t) {
|
17600 | start.r = r(t);
|
17601 | start.g = g(t);
|
17602 | start.b = b(t);
|
17603 | start.opacity = opacity(t);
|
17604 | return start + "";
|
17605 | };
|
17606 | }
|
17607 |
|
17608 | rgb.gamma = rgbGamma;
|
17609 | return rgb;
|
17610 | })(1));
|
17611 |
|
17612 | function rgbSpline(spline) {
|
17613 | return function (colors) {
|
17614 | var n = colors.length,
|
17615 | r = Array(n),
|
17616 | g = Array(n),
|
17617 | b = Array(n),
|
17618 | i,
|
17619 | color;
|
17620 |
|
17621 | for (i = 0; i < n; ++i) {
|
17622 | color = color_rgb(colors[i]);
|
17623 | r[i] = color.r || 0;
|
17624 | g[i] = color.g || 0;
|
17625 | b[i] = color.b || 0;
|
17626 | }
|
17627 |
|
17628 | r = spline(r);
|
17629 | g = spline(g);
|
17630 | b = spline(b);
|
17631 | color.opacity = 1;
|
17632 | return function (t) {
|
17633 | color.r = r(t);
|
17634 | color.g = g(t);
|
17635 | color.b = b(t);
|
17636 | return color + "";
|
17637 | };
|
17638 | };
|
17639 | }
|
17640 |
|
17641 | var rgbBasis = rgbSpline(src_basis);
|
17642 | var rgbBasisClosed = rgbSpline(basisClosed);
|
17643 | ;
|
17644 | function numberArray(a, b) {
|
17645 | if (!b) b = [];
|
17646 | var n = a ? Math.min(b.length, a.length) : 0,
|
17647 | c = b.slice(),
|
17648 | i;
|
17649 | return function (t) {
|
17650 | for (i = 0; i < n; ++i) {
|
17651 | c[i] = a[i] * (1 - t) + b[i] * t;
|
17652 | }
|
17653 |
|
17654 | return c;
|
17655 | };
|
17656 | }
|
17657 | function isNumberArray(x) {
|
17658 | return ArrayBuffer.isView(x) && !(x instanceof DataView);
|
17659 | }
|
17660 | ;
|
17661 |
|
17662 |
|
17663 | function src_array(a, b) {
|
17664 | return (isNumberArray(b) ? numberArray : genericArray)(a, b);
|
17665 | }
|
17666 | function genericArray(a, b) {
|
17667 | var nb = b ? b.length : 0,
|
17668 | na = a ? Math.min(nb, a.length) : 0,
|
17669 | x = Array(na),
|
17670 | c = Array(nb),
|
17671 | i;
|
17672 |
|
17673 | for (i = 0; i < na; ++i) {
|
17674 | x[i] = value(a[i], b[i]);
|
17675 | }
|
17676 |
|
17677 | for (; i < nb; ++i) {
|
17678 | c[i] = b[i];
|
17679 | }
|
17680 |
|
17681 | return function (t) {
|
17682 | for (i = 0; i < na; ++i) {
|
17683 | c[i] = x[i](t);
|
17684 | }
|
17685 |
|
17686 | return c;
|
17687 | };
|
17688 | }
|
17689 | ;
|
17690 | function date(a, b) {
|
17691 | var d = new Date();
|
17692 | return a = +a, b = +b, function (t) {
|
17693 | return d.setTime(a * (1 - t) + b * t), d;
|
17694 | };
|
17695 | }
|
17696 | ;
|
17697 | function number(a, b) {
|
17698 | return a = +a, b = +b, function (t) {
|
17699 | return a * (1 - t) + b * t;
|
17700 | };
|
17701 | }
|
17702 | ;
|
17703 |
|
17704 | function object(a, b) {
|
17705 | var i = {},
|
17706 | c = {},
|
17707 | k;
|
17708 | if (a === null || typeof a !== "object") a = {};
|
17709 | if (b === null || typeof b !== "object") b = {};
|
17710 |
|
17711 | for (k in b) {
|
17712 | if (k in a) {
|
17713 | i[k] = value(a[k], b[k]);
|
17714 | } else {
|
17715 | c[k] = b[k];
|
17716 | }
|
17717 | }
|
17718 |
|
17719 | return function (t) {
|
17720 | for (k in i) {
|
17721 | c[k] = i[k](t);
|
17722 | }
|
17723 |
|
17724 | return c;
|
17725 | };
|
17726 | }
|
17727 | ;
|
17728 |
|
17729 | var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,
|
17730 | reB = new RegExp(reA.source, "g");
|
17731 |
|
17732 | function zero(b) {
|
17733 | return function () {
|
17734 | return b;
|
17735 | };
|
17736 | }
|
17737 |
|
17738 | function one(b) {
|
17739 | return function (t) {
|
17740 | return b(t) + "";
|
17741 | };
|
17742 | }
|
17743 |
|
17744 | function string(a, b) {
|
17745 | var bi = reA.lastIndex = reB.lastIndex = 0,
|
17746 |
|
17747 | am,
|
17748 |
|
17749 | bm,
|
17750 |
|
17751 | bs,
|
17752 |
|
17753 | i = -1,
|
17754 |
|
17755 | s = [],
|
17756 |
|
17757 | q = [];
|
17758 |
|
17759 |
|
17760 | a = a + "", b = b + "";
|
17761 |
|
17762 | while ((am = reA.exec(a)) && (bm = reB.exec(b))) {
|
17763 | if ((bs = bm.index) > bi) {
|
17764 |
|
17765 | bs = b.slice(bi, bs);
|
17766 | if (s[i]) s[i] += bs;
|
17767 | else s[++i] = bs;
|
17768 | }
|
17769 |
|
17770 | if ((am = am[0]) === (bm = bm[0])) {
|
17771 |
|
17772 | if (s[i]) s[i] += bm;
|
17773 | else s[++i] = bm;
|
17774 | } else {
|
17775 |
|
17776 | s[++i] = null;
|
17777 | q.push({
|
17778 | i: i,
|
17779 | x: number(am, bm)
|
17780 | });
|
17781 | }
|
17782 |
|
17783 | bi = reB.lastIndex;
|
17784 | }
|
17785 |
|
17786 |
|
17787 | if (bi < b.length) {
|
17788 | bs = b.slice(bi);
|
17789 | if (s[i]) s[i] += bs;
|
17790 | else s[++i] = bs;
|
17791 | }
|
17792 |
|
17793 |
|
17794 |
|
17795 | return s.length < 2 ? q[0] ? one(q[0].x) : zero(b) : (b = q.length, function (t) {
|
17796 | for (var i = 0, o; i < b; ++i) {
|
17797 | s[(o = q[i]).i] = o.x(t);
|
17798 | }
|
17799 |
|
17800 | return s.join("");
|
17801 | });
|
17802 | }
|
17803 | ;
|
17804 |
|
17805 |
|
17806 |
|
17807 |
|
17808 |
|
17809 |
|
17810 |
|
17811 |
|
17812 |
|
17813 | function value(a, b) {
|
17814 | var t = typeof b,
|
17815 | c;
|
17816 | return b == null || t === "boolean" ? src_constant(b) : (t === "number" ? number : t === "string" ? (c = color(b)) ? (b = c, rgb) : string : b instanceof 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);
|
17817 | }
|
17818 | ;
|
17819 | var timer_frame = 0,
|
17820 |
|
17821 | timeout = 0,
|
17822 |
|
17823 | interval = 0,
|
17824 |
|
17825 | pokeDelay = 1e3,
|
17826 |
|
17827 | taskHead,
|
17828 | taskTail,
|
17829 | clockLast = 0,
|
17830 | clockNow = 0,
|
17831 | clockSkew = 0,
|
17832 | clock = typeof performance === "object" && performance.now ? performance : Date,
|
17833 | setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function (f) {
|
17834 | setTimeout(f, 17);
|
17835 | };
|
17836 | function now() {
|
17837 | return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);
|
17838 | }
|
17839 |
|
17840 | function clearNow() {
|
17841 | clockNow = 0;
|
17842 | }
|
17843 |
|
17844 | function Timer() {
|
17845 | this._call = this._time = this._next = null;
|
17846 | }
|
17847 | Timer.prototype = timer.prototype = {
|
17848 | constructor: Timer,
|
17849 | restart: function restart(callback, delay, time) {
|
17850 | if (typeof callback !== "function") throw new TypeError("callback is not a function");
|
17851 | time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);
|
17852 |
|
17853 | if (!this._next && taskTail !== this) {
|
17854 | if (taskTail) taskTail._next = this;else taskHead = this;
|
17855 | taskTail = this;
|
17856 | }
|
17857 |
|
17858 | this._call = callback;
|
17859 | this._time = time;
|
17860 | sleep();
|
17861 | },
|
17862 | stop: function stop() {
|
17863 | if (this._call) {
|
17864 | this._call = null;
|
17865 | this._time = Infinity;
|
17866 | sleep();
|
17867 | }
|
17868 | }
|
17869 | };
|
17870 | function timer(callback, delay, time) {
|
17871 | var t = new Timer();
|
17872 | t.restart(callback, delay, time);
|
17873 | return t;
|
17874 | }
|
17875 | function timerFlush() {
|
17876 | now();
|
17877 |
|
17878 | ++timer_frame;
|
17879 |
|
17880 | var t = taskHead,
|
17881 | e;
|
17882 |
|
17883 | while (t) {
|
17884 | if ((e = clockNow - t._time) >= 0) t._call.call(undefined, e);
|
17885 | t = t._next;
|
17886 | }
|
17887 |
|
17888 | --timer_frame;
|
17889 | }
|
17890 |
|
17891 | function wake() {
|
17892 | clockNow = (clockLast = clock.now()) + clockSkew;
|
17893 | timer_frame = timeout = 0;
|
17894 |
|
17895 | try {
|
17896 | timerFlush();
|
17897 | } finally {
|
17898 | timer_frame = 0;
|
17899 | nap();
|
17900 | clockNow = 0;
|
17901 | }
|
17902 | }
|
17903 |
|
17904 | function poke() {
|
17905 | var now = clock.now(),
|
17906 | delay = now - clockLast;
|
17907 | if (delay > pokeDelay) clockSkew -= delay, clockLast = now;
|
17908 | }
|
17909 |
|
17910 | function nap() {
|
17911 | var t0,
|
17912 | t1 = taskHead,
|
17913 | t2,
|
17914 | time = Infinity;
|
17915 |
|
17916 | while (t1) {
|
17917 | if (t1._call) {
|
17918 | if (time > t1._time) time = t1._time;
|
17919 | t0 = t1, t1 = t1._next;
|
17920 | } else {
|
17921 | t2 = t1._next, t1._next = null;
|
17922 | t1 = t0 ? t0._next = t2 : taskHead = t2;
|
17923 | }
|
17924 | }
|
17925 |
|
17926 | taskTail = t0;
|
17927 | sleep(time);
|
17928 | }
|
17929 |
|
17930 | function sleep(time) {
|
17931 | if (timer_frame) return;
|
17932 |
|
17933 | if (timeout) timeout = clearTimeout(timeout);
|
17934 | var delay = time - clockNow;
|
17935 |
|
17936 | if (delay > 24) {
|
17937 | if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);
|
17938 | if (interval) interval = clearInterval(interval);
|
17939 | } else {
|
17940 | if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);
|
17941 | timer_frame = 1, setFrame(wake);
|
17942 | }
|
17943 | }
|
17944 | ;
|
17945 |
|
17946 | function src_timeout(callback, delay, time) {
|
17947 | var t = new Timer();
|
17948 | delay = delay == null ? 0 : +delay;
|
17949 | t.restart(function (elapsed) {
|
17950 | t.stop();
|
17951 | callback(elapsed + delay);
|
17952 | }, delay, time);
|
17953 | return t;
|
17954 | }
|
17955 | ;
|
17956 |
|
17957 |
|
17958 | var emptyOn = src_dispatch("start", "end", "cancel", "interrupt"),
|
17959 | emptyTween = [];
|
17960 | var CREATED = 0;
|
17961 | var SCHEDULED = 1;
|
17962 | var STARTING = 2;
|
17963 | var STARTED = 3;
|
17964 | var RUNNING = 4;
|
17965 | var ENDING = 5;
|
17966 | var ENDED = 6;
|
17967 | function schedule(node, name, id, index, group, timing) {
|
17968 | var schedules = node.__transition;
|
17969 | if (!schedules) node.__transition = {};else if (id in schedules) return;
|
17970 | create(node, id, {
|
17971 | name: name,
|
17972 | index: index,
|
17973 |
|
17974 | group: group,
|
17975 |
|
17976 | on: emptyOn,
|
17977 | tween: emptyTween,
|
17978 | time: timing.time,
|
17979 | delay: timing.delay,
|
17980 | duration: timing.duration,
|
17981 | ease: timing.ease,
|
17982 | timer: null,
|
17983 | state: CREATED
|
17984 | });
|
17985 | }
|
17986 | function init(node, id) {
|
17987 | var schedule = schedule_get(node, id);
|
17988 | if (schedule.state > CREATED) throw new Error("too late; already scheduled");
|
17989 | return schedule;
|
17990 | }
|
17991 | function schedule_set(node, id) {
|
17992 | var schedule = schedule_get(node, id);
|
17993 | if (schedule.state > STARTED) throw new Error("too late; already running");
|
17994 | return schedule;
|
17995 | }
|
17996 | function schedule_get(node, id) {
|
17997 | var schedule = node.__transition;
|
17998 | if (!schedule || !(schedule = schedule[id])) throw new Error("transition not found");
|
17999 | return schedule;
|
18000 | }
|
18001 |
|
18002 | function create(node, id, self) {
|
18003 | var schedules = node.__transition,
|
18004 | tween;
|
18005 |
|
18006 |
|
18007 | schedules[id] = self;
|
18008 | self.timer = timer(function (elapsed) {
|
18009 | self.state = SCHEDULED;
|
18010 | self.timer.restart(start, self.delay, self.time);
|
18011 |
|
18012 | if (self.delay <= elapsed) start(elapsed - self.delay);
|
18013 | }, 0, self.time);
|
18014 |
|
18015 | function start(elapsed) {
|
18016 | var i, j, n, o;
|
18017 |
|
18018 | if (self.state !== SCHEDULED) return stop();
|
18019 |
|
18020 | for (i in schedules) {
|
18021 | o = schedules[i];
|
18022 | if (o.name !== self.name) continue;
|
18023 |
|
18024 |
|
18025 |
|
18026 | if (o.state === STARTED) return src_timeout(start);
|
18027 |
|
18028 | if (o.state === RUNNING) {
|
18029 | o.state = ENDED;
|
18030 | o.timer.stop();
|
18031 | o.on.call("interrupt", node, node.__data__, o.index, o.group);
|
18032 | delete schedules[i];
|
18033 | }
|
18034 | else if (+i < id) {
|
18035 | o.state = ENDED;
|
18036 | o.timer.stop();
|
18037 | o.on.call("cancel", node, node.__data__, o.index, o.group);
|
18038 | delete schedules[i];
|
18039 | }
|
18040 | }
|
18041 |
|
18042 |
|
18043 |
|
18044 |
|
18045 |
|
18046 | src_timeout(function () {
|
18047 | if (self.state === STARTED) {
|
18048 | self.state = RUNNING;
|
18049 | self.timer.restart(tick, self.delay, self.time);
|
18050 | tick(elapsed);
|
18051 | }
|
18052 | });
|
18053 |
|
18054 |
|
18055 | self.state = STARTING;
|
18056 | self.on.call("start", node, node.__data__, self.index, self.group);
|
18057 | if (self.state !== STARTING) return;
|
18058 |
|
18059 | self.state = STARTED;
|
18060 |
|
18061 | tween = Array(n = self.tween.length);
|
18062 |
|
18063 | for (i = 0, j = -1; i < n; ++i) {
|
18064 | if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) {
|
18065 | tween[++j] = o;
|
18066 | }
|
18067 | }
|
18068 |
|
18069 | tween.length = j + 1;
|
18070 | }
|
18071 |
|
18072 | function tick(elapsed) {
|
18073 | var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1),
|
18074 | i = -1,
|
18075 | n = tween.length;
|
18076 |
|
18077 | while (++i < n) {
|
18078 | tween[i].call(node, t);
|
18079 | }
|
18080 |
|
18081 |
|
18082 | if (self.state === ENDING) {
|
18083 | self.on.call("end", node, node.__data__, self.index, self.group);
|
18084 | stop();
|
18085 | }
|
18086 | }
|
18087 |
|
18088 | function stop() {
|
18089 | self.state = ENDED;
|
18090 | self.timer.stop();
|
18091 | delete schedules[id];
|
18092 |
|
18093 | for (var i in schedules) {
|
18094 | return;
|
18095 | }
|
18096 |
|
18097 |
|
18098 | delete node.__transition;
|
18099 | }
|
18100 | }
|
18101 | ;
|
18102 |
|
18103 | function interrupt(node, name) {
|
18104 | var schedules = node.__transition,
|
18105 | schedule,
|
18106 | active,
|
18107 | empty = !0,
|
18108 | i;
|
18109 | if (!schedules) return;
|
18110 | name = name == null ? null : name + "";
|
18111 |
|
18112 | for (i in schedules) {
|
18113 | if ((schedule = schedules[i]).name !== name) {
|
18114 | empty = !1;
|
18115 | continue;
|
18116 | }
|
18117 |
|
18118 | active = schedule.state > STARTING && schedule.state < ENDING;
|
18119 | schedule.state = ENDED;
|
18120 | schedule.timer.stop();
|
18121 | schedule.on.call(active ? "interrupt" : "cancel", node, node.__data__, schedule.index, schedule.group);
|
18122 | delete schedules[i];
|
18123 | }
|
18124 |
|
18125 | if (empty) delete node.__transition;
|
18126 | }
|
18127 | ;
|
18128 |
|
18129 | function selection_interrupt(name) {
|
18130 | return this.each(function () {
|
18131 | interrupt(this, name);
|
18132 | });
|
18133 | }
|
18134 | ;
|
18135 | var degrees = 180 / Math.PI;
|
18136 | var identity = {
|
18137 | translateX: 0,
|
18138 | translateY: 0,
|
18139 | rotate: 0,
|
18140 | skewX: 0,
|
18141 | scaleX: 1,
|
18142 | scaleY: 1
|
18143 | };
|
18144 | function decompose(a, b, c, d, e, f) {
|
18145 | var scaleX, scaleY, skewX;
|
18146 | if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;
|
18147 | if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;
|
18148 | if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;
|
18149 | if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;
|
18150 | return {
|
18151 | translateX: e,
|
18152 | translateY: f,
|
18153 | rotate: Math.atan2(b, a) * degrees,
|
18154 | skewX: Math.atan(skewX) * degrees,
|
18155 | scaleX: scaleX,
|
18156 | scaleY: scaleY
|
18157 | };
|
18158 | }
|
18159 | ;
|
18160 |
|
18161 | var svgNode;
|
18162 |
|
18163 |
|
18164 | function parseCss(value) {
|
18165 | var m = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value + "");
|
18166 | return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f);
|
18167 | }
|
18168 | function parseSvg(value) {
|
18169 | if (value == null) return identity;
|
18170 | if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
18171 | svgNode.setAttribute("transform", value);
|
18172 | if (!(value = svgNode.transform.baseVal.consolidate())) return identity;
|
18173 | value = value.matrix;
|
18174 | return decompose(value.a, value.b, value.c, value.d, value.e, value.f);
|
18175 | }
|
18176 | ;
|
18177 |
|
18178 |
|
18179 |
|
18180 | function interpolateTransform(parse, pxComma, pxParen, degParen) {
|
18181 | function pop(s) {
|
18182 | return s.length ? s.pop() + " " : "";
|
18183 | }
|
18184 |
|
18185 | function translate(xa, ya, xb, yb, s, q) {
|
18186 | if (xa !== xb || ya !== yb) {
|
18187 | var i = s.push("translate(", null, pxComma, null, pxParen);
|
18188 | q.push({
|
18189 | i: i - 4,
|
18190 | x: number(xa, xb)
|
18191 | }, {
|
18192 | i: i - 2,
|
18193 | x: number(ya, yb)
|
18194 | });
|
18195 | } else if (xb || yb) {
|
18196 | s.push("translate(" + xb + pxComma + yb + pxParen);
|
18197 | }
|
18198 | }
|
18199 |
|
18200 | function rotate(a, b, s, q) {
|
18201 | if (a !== b) {
|
18202 | if (a - b > 180) b += 360;else if (b - a > 180) a += 360;
|
18203 |
|
18204 | q.push({
|
18205 | i: s.push(pop(s) + "rotate(", null, degParen) - 2,
|
18206 | x: number(a, b)
|
18207 | });
|
18208 | } else if (b) {
|
18209 | s.push(pop(s) + "rotate(" + b + degParen);
|
18210 | }
|
18211 | }
|
18212 |
|
18213 | function skewX(a, b, s, q) {
|
18214 | if (a !== b) {
|
18215 | q.push({
|
18216 | i: s.push(pop(s) + "skewX(", null, degParen) - 2,
|
18217 | x: number(a, b)
|
18218 | });
|
18219 | } else if (b) {
|
18220 | s.push(pop(s) + "skewX(" + b + degParen);
|
18221 | }
|
18222 | }
|
18223 |
|
18224 | function scale(xa, ya, xb, yb, s, q) {
|
18225 | if (xa !== xb || ya !== yb) {
|
18226 | var i = s.push(pop(s) + "scale(", null, ",", null, ")");
|
18227 | q.push({
|
18228 | i: i - 4,
|
18229 | x: number(xa, xb)
|
18230 | }, {
|
18231 | i: i - 2,
|
18232 | x: number(ya, yb)
|
18233 | });
|
18234 | } else if (xb !== 1 || yb !== 1) {
|
18235 | s.push(pop(s) + "scale(" + xb + "," + yb + ")");
|
18236 | }
|
18237 | }
|
18238 |
|
18239 | return function (a, b) {
|
18240 | var s = [],
|
18241 |
|
18242 | q = [];
|
18243 |
|
18244 | a = parse(a), b = parse(b);
|
18245 | translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);
|
18246 | rotate(a.rotate, b.rotate, s, q);
|
18247 | skewX(a.skewX, b.skewX, s, q);
|
18248 | scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);
|
18249 | a = b = null;
|
18250 |
|
18251 | return function (t) {
|
18252 | var i = -1,
|
18253 | n = q.length,
|
18254 | o;
|
18255 |
|
18256 | while (++i < n) {
|
18257 | s[(o = q[i]).i] = o.x(t);
|
18258 | }
|
18259 |
|
18260 | return s.join("");
|
18261 | };
|
18262 | };
|
18263 | }
|
18264 |
|
18265 | var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)");
|
18266 | var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")");
|
18267 | ;
|
18268 |
|
18269 |
|
18270 | function tweenRemove(id, name) {
|
18271 | var tween0, tween1;
|
18272 | return function () {
|
18273 | var schedule = schedule_set(this, id),
|
18274 | tween = schedule.tween;
|
18275 |
|
18276 |
|
18277 |
|
18278 | if (tween !== tween0) {
|
18279 | tween1 = tween0 = tween;
|
18280 |
|
18281 | for (var i = 0, n = tween1.length; i < n; ++i) {
|
18282 | if (tween1[i].name === name) {
|
18283 | tween1 = tween1.slice();
|
18284 | tween1.splice(i, 1);
|
18285 | break;
|
18286 | }
|
18287 | }
|
18288 | }
|
18289 |
|
18290 | schedule.tween = tween1;
|
18291 | };
|
18292 | }
|
18293 |
|
18294 | function tweenFunction(id, name, value) {
|
18295 | var tween0, tween1;
|
18296 | if (typeof value !== "function") throw new Error();
|
18297 | return function () {
|
18298 | var schedule = schedule_set(this, id),
|
18299 | tween = schedule.tween;
|
18300 |
|
18301 |
|
18302 |
|
18303 | if (tween !== tween0) {
|
18304 | tween1 = (tween0 = tween).slice();
|
18305 |
|
18306 | for (var t = {
|
18307 | name: name,
|
18308 | value: value
|
18309 | }, i = 0, n = tween1.length; i < n; ++i) {
|
18310 | if (tween1[i].name === name) {
|
18311 | tween1[i] = t;
|
18312 | break;
|
18313 | }
|
18314 | }
|
18315 |
|
18316 | if (i === n) tween1.push(t);
|
18317 | }
|
18318 |
|
18319 | schedule.tween = tween1;
|
18320 | };
|
18321 | }
|
18322 |
|
18323 | function tween(name, value) {
|
18324 | var id = this._id;
|
18325 | name += "";
|
18326 |
|
18327 | if (arguments.length < 2) {
|
18328 | for (var tween = schedule_get(this.node(), id).tween, i = 0, n = tween.length, t; i < n; ++i) {
|
18329 | if ((t = tween[i]).name === name) {
|
18330 | return t.value;
|
18331 | }
|
18332 | }
|
18333 |
|
18334 | return null;
|
18335 | }
|
18336 |
|
18337 | return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value));
|
18338 | }
|
18339 | function tweenValue(transition, name, value) {
|
18340 | var id = transition._id;
|
18341 | transition.each(function () {
|
18342 | var schedule = schedule_set(this, id);
|
18343 | (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);
|
18344 | });
|
18345 | return function (node) {
|
18346 | return schedule_get(node, id).value[name];
|
18347 | };
|
18348 | }
|
18349 | ;
|
18350 |
|
18351 |
|
18352 | function interpolate(a, b) {
|
18353 | var c;
|
18354 | return (typeof b === "number" ? number : b instanceof color ? rgb : (c = color(b)) ? (b = c, rgb) : string)(a, b);
|
18355 | }
|
18356 | ;
|
18357 |
|
18358 |
|
18359 |
|
18360 |
|
18361 |
|
18362 | function attr_attrRemove(name) {
|
18363 | return function () {
|
18364 | this.removeAttribute(name);
|
18365 | };
|
18366 | }
|
18367 |
|
18368 | function attr_attrRemoveNS(fullname) {
|
18369 | return function () {
|
18370 | this.removeAttributeNS(fullname.space, fullname.local);
|
18371 | };
|
18372 | }
|
18373 |
|
18374 | function attr_attrConstant(name, interpolate, value1) {
|
18375 | var string00, interpolate0;
|
18376 | return function () {
|
18377 | var string0 = this.getAttribute(name);
|
18378 | return string0 === value1 + "" ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1);
|
18379 | };
|
18380 | }
|
18381 |
|
18382 | function attr_attrConstantNS(fullname, interpolate, value1) {
|
18383 | var string00, interpolate0;
|
18384 | return function () {
|
18385 | var string0 = this.getAttributeNS(fullname.space, fullname.local);
|
18386 | return string0 === value1 + "" ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1);
|
18387 | };
|
18388 | }
|
18389 |
|
18390 | function attr_attrFunction(name, interpolate, value) {
|
18391 | var string00, string10, interpolate0;
|
18392 | return function () {
|
18393 | var string0,
|
18394 | value1 = value(this),
|
18395 | string1;
|
18396 | if (value1 == null) return void this.removeAttribute(name);
|
18397 | string0 = this.getAttribute(name);
|
18398 | string1 = value1 + "";
|
18399 | return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
|
18400 | };
|
18401 | }
|
18402 |
|
18403 | function attr_attrFunctionNS(fullname, interpolate, value) {
|
18404 | var string00, string10, interpolate0;
|
18405 | return function () {
|
18406 | var string0,
|
18407 | value1 = value(this),
|
18408 | string1;
|
18409 | if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);
|
18410 | string0 = this.getAttributeNS(fullname.space, fullname.local);
|
18411 | string1 = value1 + "";
|
18412 | return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
|
18413 | };
|
18414 | }
|
18415 |
|
18416 | function transition_attr(name, value) {
|
18417 | var fullname = namespace(name),
|
18418 | i = fullname === "transform" ? interpolateTransformSvg : interpolate;
|
18419 | 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));
|
18420 | }
|
18421 | ;
|
18422 |
|
18423 |
|
18424 | function attrInterpolate(name, i) {
|
18425 | return function (t) {
|
18426 | this.setAttribute(name, i.call(this, t));
|
18427 | };
|
18428 | }
|
18429 |
|
18430 | function attrInterpolateNS(fullname, i) {
|
18431 | return function (t) {
|
18432 | this.setAttributeNS(fullname.space, fullname.local, i.call(this, t));
|
18433 | };
|
18434 | }
|
18435 |
|
18436 | function attrTweenNS(fullname, value) {
|
18437 | var t0, i0;
|
18438 |
|
18439 | function tween() {
|
18440 | var i = value.apply(this, arguments);
|
18441 | if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i);
|
18442 | return t0;
|
18443 | }
|
18444 |
|
18445 | tween._value = value;
|
18446 | return tween;
|
18447 | }
|
18448 |
|
18449 | function attrTween(name, value) {
|
18450 | var t0, i0;
|
18451 |
|
18452 | function tween() {
|
18453 | var i = value.apply(this, arguments);
|
18454 | if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i);
|
18455 | return t0;
|
18456 | }
|
18457 |
|
18458 | tween._value = value;
|
18459 | return tween;
|
18460 | }
|
18461 |
|
18462 | function transition_attrTween(name, value) {
|
18463 | var key = "attr." + name;
|
18464 | if (arguments.length < 2) return (key = this.tween(key)) && key._value;
|
18465 | if (value == null) return this.tween(key, null);
|
18466 | if (typeof value !== "function") throw new Error();
|
18467 | var fullname = namespace(name);
|
18468 | return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));
|
18469 | }
|
18470 | ;
|
18471 |
|
18472 |
|
18473 | function delayFunction(id, value) {
|
18474 | return function () {
|
18475 | init(this, id).delay = +value.apply(this, arguments);
|
18476 | };
|
18477 | }
|
18478 |
|
18479 | function delayConstant(id, value) {
|
18480 | return value = +value, function () {
|
18481 | init(this, id).delay = value;
|
18482 | };
|
18483 | }
|
18484 |
|
18485 | function delay(value) {
|
18486 | var id = this._id;
|
18487 | return arguments.length ? this.each((typeof value === "function" ? delayFunction : delayConstant)(id, value)) : schedule_get(this.node(), id).delay;
|
18488 | }
|
18489 | ;
|
18490 |
|
18491 |
|
18492 | function durationFunction(id, value) {
|
18493 | return function () {
|
18494 | schedule_set(this, id).duration = +value.apply(this, arguments);
|
18495 | };
|
18496 | }
|
18497 |
|
18498 | function durationConstant(id, value) {
|
18499 | return value = +value, function () {
|
18500 | schedule_set(this, id).duration = value;
|
18501 | };
|
18502 | }
|
18503 |
|
18504 | function duration(value) {
|
18505 | var id = this._id;
|
18506 | return arguments.length ? this.each((typeof value === "function" ? durationFunction : durationConstant)(id, value)) : schedule_get(this.node(), id).duration;
|
18507 | }
|
18508 | ;
|
18509 |
|
18510 |
|
18511 | function easeConstant(id, value) {
|
18512 | if (typeof value !== "function") throw new Error();
|
18513 | return function () {
|
18514 | schedule_set(this, id).ease = value;
|
18515 | };
|
18516 | }
|
18517 |
|
18518 | function ease(value) {
|
18519 | var id = this._id;
|
18520 | return arguments.length ? this.each(easeConstant(id, value)) : schedule_get(this.node(), id).ease;
|
18521 | }
|
18522 | ;
|
18523 |
|
18524 |
|
18525 | function easeVarying(id, value) {
|
18526 | return function () {
|
18527 | var v = value.apply(this, arguments);
|
18528 | if (typeof v !== "function") throw new Error();
|
18529 | schedule_set(this, id).ease = v;
|
18530 | };
|
18531 | }
|
18532 |
|
18533 | function transition_easeVarying(value) {
|
18534 | if (typeof value !== "function") throw new Error();
|
18535 | return this.each(easeVarying(this._id, value));
|
18536 | }
|
18537 | ;
|
18538 |
|
18539 |
|
18540 | function transition_filter(match) {
|
18541 | if (typeof match !== "function") match = matcher(match);
|
18542 |
|
18543 | for (var groups = this._groups, m = groups.length, subgroups = Array(m), j = 0; j < m; ++j) {
|
18544 | for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {
|
18545 | if ((node = group[i]) && match.call(node, node.__data__, i, group)) {
|
18546 | subgroup.push(node);
|
18547 | }
|
18548 | }
|
18549 | }
|
18550 |
|
18551 | return new Transition(subgroups, this._parents, this._name, this._id);
|
18552 | }
|
18553 | ;
|
18554 |
|
18555 | function transition_merge(transition) {
|
18556 | if (transition._id !== this._id) throw new Error();
|
18557 |
|
18558 | 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) {
|
18559 | for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = Array(n), node, i = 0; i < n; ++i) {
|
18560 | if (node = group0[i] || group1[i]) {
|
18561 | merge[i] = node;
|
18562 | }
|
18563 | }
|
18564 | }
|
18565 |
|
18566 | for (; j < m0; ++j) {
|
18567 | merges[j] = groups0[j];
|
18568 | }
|
18569 |
|
18570 | return new Transition(merges, this._parents, this._name, this._id);
|
18571 | }
|
18572 | ;
|
18573 |
|
18574 |
|
18575 | function start(name) {
|
18576 | return (name + "").trim().split(/^|\s+/).every(function (t) {
|
18577 | var i = t.indexOf(".");
|
18578 | if (i >= 0) t = t.slice(0, i);
|
18579 | return !t || t === "start";
|
18580 | });
|
18581 | }
|
18582 |
|
18583 | function onFunction(id, name, listener) {
|
18584 | var on0,
|
18585 | on1,
|
18586 | sit = start(name) ? init : schedule_set;
|
18587 | return function () {
|
18588 | var schedule = sit(this, id),
|
18589 | on = schedule.on;
|
18590 |
|
18591 |
|
18592 |
|
18593 | if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);
|
18594 | schedule.on = on1;
|
18595 | };
|
18596 | }
|
18597 |
|
18598 | function transition_on(name, listener) {
|
18599 | var id = this._id;
|
18600 | return arguments.length < 2 ? schedule_get(this.node(), id).on.on(name) : this.each(onFunction(id, name, listener));
|
18601 | }
|
18602 | ;
|
18603 | function removeFunction(id) {
|
18604 | return function () {
|
18605 | var parent = this.parentNode;
|
18606 |
|
18607 | for (var i in this.__transition) {
|
18608 | if (+i !== id) return;
|
18609 | }
|
18610 |
|
18611 | if (parent) parent.removeChild(this);
|
18612 | };
|
18613 | }
|
18614 |
|
18615 | function transition_remove() {
|
18616 | return this.on("end.remove", removeFunction(this._id));
|
18617 | }
|
18618 | ;
|
18619 |
|
18620 |
|
18621 |
|
18622 | function transition_select(select) {
|
18623 | var name = this._name,
|
18624 | id = this._id;
|
18625 | if (typeof select !== "function") select = selector(select);
|
18626 |
|
18627 | for (var groups = this._groups, m = groups.length, subgroups = Array(m), j = 0; j < m; ++j) {
|
18628 | for (var group = groups[j], n = group.length, subgroup = subgroups[j] = Array(n), node, subnode, i = 0; i < n; ++i) {
|
18629 | if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {
|
18630 | if ("__data__" in node) subnode.__data__ = node.__data__;
|
18631 | subgroup[i] = subnode;
|
18632 | schedule(subgroup[i], name, id, i, subgroup, schedule_get(node, id));
|
18633 | }
|
18634 | }
|
18635 | }
|
18636 |
|
18637 | return new Transition(subgroups, this._parents, name, id);
|
18638 | }
|
18639 | ;
|
18640 |
|
18641 |
|
18642 |
|
18643 | function transition_selectAll(select) {
|
18644 | var name = this._name,
|
18645 | id = this._id;
|
18646 | if (typeof select !== "function") select = selectorAll(select);
|
18647 |
|
18648 | for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {
|
18649 | for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
|
18650 | if (node = group[i]) {
|
18651 | for (var children = select.call(node, node.__data__, i, group), child, inherit = schedule_get(node, id), k = 0, l = children.length; k < l; ++k) {
|
18652 | if (child = children[k]) {
|
18653 | schedule(child, name, id, k, children, inherit);
|
18654 | }
|
18655 | }
|
18656 |
|
18657 | subgroups.push(children);
|
18658 | parents.push(node);
|
18659 | }
|
18660 | }
|
18661 | }
|
18662 |
|
18663 | return new Transition(subgroups, parents, name, id);
|
18664 | }
|
18665 | ;
|
18666 |
|
18667 | var selection_Selection = src_selection.prototype.constructor;
|
18668 | function transition_selection() {
|
18669 | return new selection_Selection(this._groups, this._parents);
|
18670 | }
|
18671 | ;
|
18672 |
|
18673 |
|
18674 |
|
18675 |
|
18676 |
|
18677 |
|
18678 | function styleNull(name, interpolate) {
|
18679 | var string00, string10, interpolate0;
|
18680 | return function () {
|
18681 | var string0 = styleValue(this, name),
|
18682 | string1 = (this.style.removeProperty(name), styleValue(this, name));
|
18683 | return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : interpolate0 = interpolate(string00 = string0, string10 = string1);
|
18684 | };
|
18685 | }
|
18686 |
|
18687 | function style_styleRemove(name) {
|
18688 | return function () {
|
18689 | this.style.removeProperty(name);
|
18690 | };
|
18691 | }
|
18692 |
|
18693 | function style_styleConstant(name, interpolate, value1) {
|
18694 | var string00, interpolate0;
|
18695 | return function () {
|
18696 | var string0 = styleValue(this, name);
|
18697 | return string0 === value1 + "" ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1);
|
18698 | };
|
18699 | }
|
18700 |
|
18701 | function style_styleFunction(name, interpolate, value) {
|
18702 | var string00, string10, interpolate0;
|
18703 | return function () {
|
18704 | var string0 = styleValue(this, name),
|
18705 | value1 = value(this),
|
18706 | string1 = value1 + "";
|
18707 | if (value1 == null) string1 = value1 = (this.style.removeProperty(name), styleValue(this, name));
|
18708 | return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
|
18709 | };
|
18710 | }
|
18711 |
|
18712 | function styleMaybeRemove(id, name) {
|
18713 | var on0,
|
18714 | on1,
|
18715 | listener0,
|
18716 | key = "style." + name,
|
18717 | remove;
|
18718 | return function () {
|
18719 | var schedule = schedule_set(this, id),
|
18720 | on = schedule.on,
|
18721 | listener = schedule.value[key] == null ? remove || (remove = style_styleRemove(name)) : undefined;
|
18722 |
|
18723 |
|
18724 |
|
18725 | if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on("end." + key, listener0 = listener);
|
18726 | schedule.on = on1;
|
18727 | };
|
18728 | }
|
18729 |
|
18730 | function transition_style(name, value, priority) {
|
18731 | var i = (name += "") === "transform" ? interpolateTransformCss : interpolate;
|
18732 | 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);
|
18733 | }
|
18734 | ;
|
18735 | function styleInterpolate(name, i, priority) {
|
18736 | return function (t) {
|
18737 | this.style.setProperty(name, i.call(this, t), priority);
|
18738 | };
|
18739 | }
|
18740 |
|
18741 | function styleTween(name, value, priority) {
|
18742 | var t, i0;
|
18743 |
|
18744 | function tween() {
|
18745 | var i = value.apply(this, arguments);
|
18746 | if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority);
|
18747 | return t;
|
18748 | }
|
18749 |
|
18750 | tween._value = value;
|
18751 | return tween;
|
18752 | }
|
18753 |
|
18754 | function transition_styleTween(name, value, priority) {
|
18755 | var key = "style." + (name += "");
|
18756 | if (arguments.length < 2) return (key = this.tween(key)) && key._value;
|
18757 | if (value == null) return this.tween(key, null);
|
18758 | if (typeof value !== "function") throw new Error();
|
18759 | return this.tween(key, styleTween(name, value, priority == null ? "" : priority));
|
18760 | }
|
18761 | ;
|
18762 |
|
18763 |
|
18764 | function text_textConstant(value) {
|
18765 | return function () {
|
18766 | this.textContent = value;
|
18767 | };
|
18768 | }
|
18769 |
|
18770 | function text_textFunction(value) {
|
18771 | return function () {
|
18772 | var value1 = value(this);
|
18773 | this.textContent = value1 == null ? "" : value1;
|
18774 | };
|
18775 | }
|
18776 |
|
18777 | function transition_text(value) {
|
18778 | return this.tween("text", typeof value === "function" ? text_textFunction(tweenValue(this, "text", value)) : text_textConstant(value == null ? "" : value + ""));
|
18779 | }
|
18780 | ;
|
18781 | function textInterpolate(i) {
|
18782 | return function (t) {
|
18783 | this.textContent = i.call(this, t);
|
18784 | };
|
18785 | }
|
18786 |
|
18787 | function textTween(value) {
|
18788 | var t0, i0;
|
18789 |
|
18790 | function tween() {
|
18791 | var i = value.apply(this, arguments);
|
18792 | if (i !== i0) t0 = (i0 = i) && textInterpolate(i);
|
18793 | return t0;
|
18794 | }
|
18795 |
|
18796 | tween._value = value;
|
18797 | return tween;
|
18798 | }
|
18799 |
|
18800 | function transition_textTween(value) {
|
18801 | var key = "text";
|
18802 | if (arguments.length < 1) return (key = this.tween(key)) && key._value;
|
18803 | if (value == null) return this.tween(key, null);
|
18804 | if (typeof value !== "function") throw new Error();
|
18805 | return this.tween(key, textTween(value));
|
18806 | }
|
18807 | ;
|
18808 |
|
18809 |
|
18810 | function transition() {
|
18811 | for (var name = this._name, id0 = this._id, id1 = newId(), groups = this._groups, m = groups.length, j = 0; j < m; ++j) {
|
18812 | for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
|
18813 | if (node = group[i]) {
|
18814 | var inherit = schedule_get(node, id0);
|
18815 | schedule(node, name, id1, i, group, {
|
18816 | time: inherit.time + inherit.delay + inherit.duration,
|
18817 | delay: 0,
|
18818 | duration: inherit.duration,
|
18819 | ease: inherit.ease
|
18820 | });
|
18821 | }
|
18822 | }
|
18823 | }
|
18824 |
|
18825 | return new Transition(groups, this._parents, name, id1);
|
18826 | }
|
18827 | ;
|
18828 |
|
18829 | function end() {
|
18830 | var on0,
|
18831 | on1,
|
18832 | that = this,
|
18833 | id = that._id,
|
18834 | size = that.size();
|
18835 | return new Promise(function (resolve, reject) {
|
18836 | var cancel = {
|
18837 | value: reject
|
18838 | },
|
18839 | end = {
|
18840 | value: function value() {
|
18841 | if (--size === 0) resolve();
|
18842 | }
|
18843 | };
|
18844 | that.each(function () {
|
18845 | var schedule = schedule_set(this, id),
|
18846 | on = schedule.on;
|
18847 |
|
18848 |
|
18849 |
|
18850 | if (on !== on0) {
|
18851 | on1 = (on0 = on).copy();
|
18852 |
|
18853 | on1._.cancel.push(cancel);
|
18854 |
|
18855 | on1._.interrupt.push(cancel);
|
18856 |
|
18857 | on1._.end.push(end);
|
18858 | }
|
18859 |
|
18860 | schedule.on = on1;
|
18861 | });
|
18862 |
|
18863 | if (size === 0) resolve();
|
18864 | });
|
18865 | }
|
18866 | ;
|
18867 | var _transition$prototype;
|
18868 |
|
18869 |
|
18870 |
|
18871 |
|
18872 |
|
18873 |
|
18874 |
|
18875 |
|
18876 |
|
18877 |
|
18878 |
|
18879 |
|
18880 |
|
18881 |
|
18882 |
|
18883 |
|
18884 |
|
18885 |
|
18886 |
|
18887 |
|
18888 |
|
18889 |
|
18890 | var id = 0;
|
18891 | function Transition(groups, parents, name, id) {
|
18892 | this._groups = groups;
|
18893 | this._parents = parents;
|
18894 | this._name = name;
|
18895 | this._id = id;
|
18896 | }
|
18897 | function transition_transition(name) {
|
18898 | return src_selection().transition(name);
|
18899 | }
|
18900 | function newId() {
|
18901 | return ++id;
|
18902 | }
|
18903 | var selection_prototype = src_selection.prototype;
|
18904 | Transition.prototype = transition_transition.prototype = (_transition$prototype = {
|
18905 | constructor: Transition,
|
18906 | select: transition_select,
|
18907 | selectAll: transition_selectAll,
|
18908 | selectChild: selection_prototype.selectChild,
|
18909 | selectChildren: selection_prototype.selectChildren,
|
18910 | filter: transition_filter,
|
18911 | merge: transition_merge,
|
18912 | selection: transition_selection,
|
18913 | transition: transition,
|
18914 | call: selection_prototype.call,
|
18915 | nodes: selection_prototype.nodes,
|
18916 | node: selection_prototype.node,
|
18917 | size: selection_prototype.size,
|
18918 | empty: selection_prototype.empty,
|
18919 | each: selection_prototype.each,
|
18920 | on: transition_on,
|
18921 | attr: transition_attr,
|
18922 | attrTween: transition_attrTween,
|
18923 | style: transition_style,
|
18924 | styleTween: transition_styleTween,
|
18925 | text: transition_text,
|
18926 | textTween: transition_textTween,
|
18927 | remove: transition_remove,
|
18928 | tween: tween,
|
18929 | delay: delay,
|
18930 | duration: duration,
|
18931 | ease: ease,
|
18932 | easeVarying: transition_easeVarying,
|
18933 | end: end
|
18934 | }, _transition$prototype[Symbol.iterator] = selection_prototype[Symbol.iterator], _transition$prototype);
|
18935 | ;// CONCATENATED MODULE: ./node_modules/d3-ease/src/cubic.js
|
18936 | function cubicIn(t) {
|
18937 | return t * t * t;
|
18938 | }
|
18939 | function cubicOut(t) {
|
18940 | return --t * t * t + 1;
|
18941 | }
|
18942 | function cubicInOut(t) {
|
18943 | return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
|
18944 | }
|
18945 | ;
|
18946 |
|
18947 |
|
18948 |
|
18949 |
|
18950 | var defaultTiming = {
|
18951 | time: null,
|
18952 |
|
18953 | delay: 0,
|
18954 | duration: 250,
|
18955 | ease: cubicInOut
|
18956 | };
|
18957 |
|
18958 | function inherit(node, id) {
|
18959 | var timing;
|
18960 |
|
18961 | while (!(timing = node.__transition) || !(timing = timing[id])) {
|
18962 | if (!(node = node.parentNode)) {
|
18963 | throw new Error("transition " + id + " not found");
|
18964 | }
|
18965 | }
|
18966 |
|
18967 | return timing;
|
18968 | }
|
18969 |
|
18970 | function selection_transition(name) {
|
18971 | var id, timing;
|
18972 |
|
18973 | if (name instanceof Transition) {
|
18974 | id = name._id, name = name._name;
|
18975 | } else {
|
18976 | id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + "";
|
18977 | }
|
18978 |
|
18979 | for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {
|
18980 | for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
|
18981 | if (node = group[i]) {
|
18982 | schedule(node, name, id, i, group, timing || inherit(node, id));
|
18983 | }
|
18984 | }
|
18985 | }
|
18986 |
|
18987 | return new Transition(groups, this._parents, name, id);
|
18988 | }
|
18989 | ;
|
18990 |
|
18991 |
|
18992 |
|
18993 | src_selection.prototype.interrupt = selection_interrupt;
|
18994 | src_selection.prototype.transition = selection_transition;
|
18995 | ;
|
18996 |
|
18997 |
|
18998 |
|
18999 |
|
19000 | ;
|
19001 | var d3_brush_src_constant = (function (x) {
|
19002 | return function () {
|
19003 | return x;
|
19004 | };
|
19005 | });
|
19006 | ;
|
19007 | function BrushEvent(type, _ref) {
|
19008 | var sourceEvent = _ref.sourceEvent,
|
19009 | target = _ref.target,
|
19010 | selection = _ref.selection,
|
19011 | mode = _ref.mode,
|
19012 | dispatch = _ref.dispatch;
|
19013 | Object.defineProperties(this, {
|
19014 | type: {
|
19015 | value: type,
|
19016 | enumerable: !0,
|
19017 | configurable: !0
|
19018 | },
|
19019 | sourceEvent: {
|
19020 | value: sourceEvent,
|
19021 | enumerable: !0,
|
19022 | configurable: !0
|
19023 | },
|
19024 | target: {
|
19025 | value: target,
|
19026 | enumerable: !0,
|
19027 | configurable: !0
|
19028 | },
|
19029 | selection: {
|
19030 | value: selection,
|
19031 | enumerable: !0,
|
19032 | configurable: !0
|
19033 | },
|
19034 | mode: {
|
19035 | value: mode,
|
19036 | enumerable: !0,
|
19037 | configurable: !0
|
19038 | },
|
19039 | _: {
|
19040 | value: dispatch
|
19041 | }
|
19042 | });
|
19043 | }
|
19044 | ;
|
19045 | function noevent_nopropagation(event) {
|
19046 | event.stopImmediatePropagation();
|
19047 | }
|
19048 | function src_noevent(event) {
|
19049 | event.preventDefault();
|
19050 | event.stopImmediatePropagation();
|
19051 | }
|
19052 | ;
|
19053 | function brush_createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = brush_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: !0 }; return { 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."); }
|
19054 |
|
19055 | function brush_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return brush_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return brush_arrayLikeToArray(o, minLen); }
|
19056 |
|
19057 | function brush_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
19058 |
|
19059 |
|
19060 |
|
19061 |
|
19062 |
|
19063 |
|
19064 |
|
19065 |
|
19066 |
|
19067 | var MODE_DRAG = {
|
19068 | name: "drag"
|
19069 | },
|
19070 | MODE_SPACE = {
|
19071 | name: "space"
|
19072 | },
|
19073 | MODE_HANDLE = {
|
19074 | name: "handle"
|
19075 | },
|
19076 | MODE_CENTER = {
|
19077 | name: "center"
|
19078 | },
|
19079 | abs = Math.abs,
|
19080 | max = Math.max,
|
19081 | min = Math.min;
|
19082 |
|
19083 | function number1(e) {
|
19084 | return [+e[0], +e[1]];
|
19085 | }
|
19086 |
|
19087 | function number2(e) {
|
19088 | return [number1(e[0]), number1(e[1])];
|
19089 | }
|
19090 |
|
19091 | var X = {
|
19092 | name: "x",
|
19093 | handles: ["w", "e"].map(type),
|
19094 | input: function input(x, e) {
|
19095 | return x == null ? null : [[+x[0], e[0][1]], [+x[1], e[1][1]]];
|
19096 | },
|
19097 | output: function output(xy) {
|
19098 | return xy && [xy[0][0], xy[1][0]];
|
19099 | }
|
19100 | },
|
19101 | Y = {
|
19102 | name: "y",
|
19103 | handles: ["n", "s"].map(type),
|
19104 | input: function input(y, e) {
|
19105 | return y == null ? null : [[e[0][0], +y[0]], [e[1][0], +y[1]]];
|
19106 | },
|
19107 | output: function output(xy) {
|
19108 | return xy && [xy[0][1], xy[1][1]];
|
19109 | }
|
19110 | },
|
19111 | XY = {
|
19112 | name: "xy",
|
19113 | handles: ["n", "w", "e", "s", "nw", "ne", "sw", "se"].map(type),
|
19114 | input: function input(xy) {
|
19115 | return xy == null ? null : number2(xy);
|
19116 | },
|
19117 | output: function output(xy) {
|
19118 | return xy;
|
19119 | }
|
19120 | },
|
19121 | cursors = {
|
19122 | overlay: "crosshair",
|
19123 | selection: "move",
|
19124 | n: "ns-resize",
|
19125 | e: "ew-resize",
|
19126 | s: "ns-resize",
|
19127 | w: "ew-resize",
|
19128 | nw: "nwse-resize",
|
19129 | ne: "nesw-resize",
|
19130 | se: "nwse-resize",
|
19131 | sw: "nesw-resize"
|
19132 | },
|
19133 | flipX = {
|
19134 | e: "w",
|
19135 | w: "e",
|
19136 | nw: "ne",
|
19137 | ne: "nw",
|
19138 | se: "sw",
|
19139 | sw: "se"
|
19140 | },
|
19141 | flipY = {
|
19142 | n: "s",
|
19143 | s: "n",
|
19144 | nw: "sw",
|
19145 | ne: "se",
|
19146 | se: "ne",
|
19147 | sw: "nw"
|
19148 | },
|
19149 | signsX = {
|
19150 | overlay: 1,
|
19151 | selection: 1,
|
19152 | n: null,
|
19153 | e: 1,
|
19154 | s: null,
|
19155 | w: -1,
|
19156 | nw: -1,
|
19157 | ne: 1,
|
19158 | se: 1,
|
19159 | sw: -1
|
19160 | },
|
19161 | signsY = {
|
19162 | overlay: 1,
|
19163 | selection: 1,
|
19164 | n: -1,
|
19165 | e: null,
|
19166 | s: 1,
|
19167 | w: null,
|
19168 | nw: -1,
|
19169 | ne: -1,
|
19170 | se: 1,
|
19171 | sw: 1
|
19172 | };
|
19173 |
|
19174 | function type(t) {
|
19175 | return {
|
19176 | type: t
|
19177 | };
|
19178 | }
|
19179 |
|
19180 |
|
19181 | function defaultFilter(event) {
|
19182 | return !event.ctrlKey && !event.button;
|
19183 | }
|
19184 |
|
19185 | function defaultExtent() {
|
19186 | var svg = this.ownerSVGElement || this;
|
19187 |
|
19188 | if (svg.hasAttribute("viewBox")) {
|
19189 | svg = svg.viewBox.baseVal;
|
19190 | return [[svg.x, svg.y], [svg.x + svg.width, svg.y + svg.height]];
|
19191 | }
|
19192 |
|
19193 | return [[0, 0], [svg.width.baseVal.value, svg.height.baseVal.value]];
|
19194 | }
|
19195 |
|
19196 | function defaultTouchable() {
|
19197 | return navigator.maxTouchPoints || "ontouchstart" in this;
|
19198 | }
|
19199 |
|
19200 |
|
19201 | function local(node) {
|
19202 | while (!node.__brush) {
|
19203 | if (!(node = node.parentNode)) return;
|
19204 | }
|
19205 |
|
19206 | return node.__brush;
|
19207 | }
|
19208 |
|
19209 | function brush_empty(extent) {
|
19210 | return extent[0][0] === extent[1][0] || extent[0][1] === extent[1][1];
|
19211 | }
|
19212 |
|
19213 | function brushSelection(node) {
|
19214 | var state = node.__brush;
|
19215 | return state ? state.dim.output(state.selection) : null;
|
19216 | }
|
19217 | function brushX() {
|
19218 | return brush_brush(X);
|
19219 | }
|
19220 | function brushY() {
|
19221 | return brush_brush(Y);
|
19222 | }
|
19223 | function brush() {
|
19224 | return brush_brush(XY);
|
19225 | }
|
19226 |
|
19227 | function brush_brush(dim) {
|
19228 | var extent = defaultExtent,
|
19229 | filter = defaultFilter,
|
19230 | touchable = defaultTouchable,
|
19231 | keys = !0,
|
19232 | listeners = src_dispatch("start", "brush", "end"),
|
19233 | handleSize = 6,
|
19234 | touchending;
|
19235 |
|
19236 | function brush(group) {
|
19237 | var overlay = group.property("__brush", initialize).selectAll(".overlay").data([type("overlay")]);
|
19238 | overlay.enter().append("rect").attr("class", "overlay").attr("pointer-events", "all").attr("cursor", cursors.overlay).merge(overlay).each(function () {
|
19239 | var extent = local(this).extent;
|
19240 | 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]);
|
19241 | });
|
19242 | 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");
|
19243 | var handle = group.selectAll(".handle").data(dim.handles, function (d) {
|
19244 | return d.type;
|
19245 | });
|
19246 | handle.exit().remove();
|
19247 | handle.enter().append("rect").attr("class", function (d) {
|
19248 | return "handle handle--" + d.type;
|
19249 | }).attr("cursor", function (d) {
|
19250 | return cursors[d.type];
|
19251 | });
|
19252 | 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)");
|
19253 | }
|
19254 |
|
19255 | brush.move = function (group, selection, event) {
|
19256 | if (group.tween) {
|
19257 | group.on("start.brush", function (event) {
|
19258 | emitter(this, arguments).beforestart().start(event);
|
19259 | }).on("interrupt.brush end.brush", function (event) {
|
19260 | emitter(this, arguments).end(event);
|
19261 | }).tween("brush", function () {
|
19262 | var that = this,
|
19263 | state = that.__brush,
|
19264 | emit = emitter(that, arguments),
|
19265 | selection0 = state.selection,
|
19266 | selection1 = dim.input(typeof selection === "function" ? selection.apply(this, arguments) : selection, state.extent),
|
19267 | i = value(selection0, selection1);
|
19268 |
|
19269 | function tween(t) {
|
19270 | state.selection = t === 1 && selection1 === null ? null : i(t);
|
19271 | redraw.call(that);
|
19272 | emit.brush();
|
19273 | }
|
19274 |
|
19275 | return selection0 !== null && selection1 !== null ? tween : tween(1);
|
19276 | });
|
19277 | } else {
|
19278 | group.each(function () {
|
19279 | var that = this,
|
19280 | args = arguments,
|
19281 | state = that.__brush,
|
19282 | selection1 = dim.input(typeof selection === "function" ? selection.apply(that, args) : selection, state.extent),
|
19283 | emit = emitter(that, args).beforestart();
|
19284 | interrupt(that);
|
19285 | state.selection = selection1 === null ? null : selection1;
|
19286 | redraw.call(that);
|
19287 | emit.start(event).brush(event).end(event);
|
19288 | });
|
19289 | }
|
19290 | };
|
19291 |
|
19292 | brush.clear = function (group, event) {
|
19293 | brush.move(group, null, event);
|
19294 | };
|
19295 |
|
19296 | function redraw() {
|
19297 | var group = src_select(this),
|
19298 | selection = local(this).selection;
|
19299 |
|
19300 | if (selection) {
|
19301 | 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]);
|
19302 | group.selectAll(".handle").style("display", null).attr("x", function (d) {
|
19303 | return d.type[d.type.length - 1] === "e" ? selection[1][0] - handleSize / 2 : selection[0][0] - handleSize / 2;
|
19304 | }).attr("y", function (d) {
|
19305 | return d.type[0] === "s" ? selection[1][1] - handleSize / 2 : selection[0][1] - handleSize / 2;
|
19306 | }).attr("width", function (d) {
|
19307 | return d.type === "n" || d.type === "s" ? selection[1][0] - selection[0][0] + handleSize : handleSize;
|
19308 | }).attr("height", function (d) {
|
19309 | return d.type === "e" || d.type === "w" ? selection[1][1] - selection[0][1] + handleSize : handleSize;
|
19310 | });
|
19311 | } else {
|
19312 | group.selectAll(".selection,.handle").style("display", "none").attr("x", null).attr("y", null).attr("width", null).attr("height", null);
|
19313 | }
|
19314 | }
|
19315 |
|
19316 | function emitter(that, args, clean) {
|
19317 | var emit = that.__brush.emitter;
|
19318 | return emit && (!clean || !emit.clean) ? emit : new Emitter(that, args, clean);
|
19319 | }
|
19320 |
|
19321 | function Emitter(that, args, clean) {
|
19322 | this.that = that;
|
19323 | this.args = args;
|
19324 | this.state = that.__brush;
|
19325 | this.active = 0;
|
19326 | this.clean = clean;
|
19327 | }
|
19328 |
|
19329 | Emitter.prototype = {
|
19330 | beforestart: function beforestart() {
|
19331 | if (++this.active === 1) this.state.emitter = this, this.starting = !0;
|
19332 | return this;
|
19333 | },
|
19334 | start: function start(event, mode) {
|
19335 | if (this.starting) this.starting = !1, this.emit("start", event, mode);else this.emit("brush", event);
|
19336 | return this;
|
19337 | },
|
19338 | brush: function (event, mode) {
|
19339 | this.emit("brush", event, mode);
|
19340 | return this;
|
19341 | },
|
19342 | end: function end(event, mode) {
|
19343 | if (--this.active === 0) delete this.state.emitter, this.emit("end", event, mode);
|
19344 | return this;
|
19345 | },
|
19346 | emit: function emit(type, event, mode) {
|
19347 | var d = src_select(this.that).datum();
|
19348 | listeners.call(type, this.that, new BrushEvent(type, {
|
19349 | sourceEvent: event,
|
19350 | target: brush,
|
19351 | selection: dim.output(this.state.selection),
|
19352 | mode: mode,
|
19353 | dispatch: listeners
|
19354 | }), d);
|
19355 | }
|
19356 | };
|
19357 |
|
19358 | function started(event) {
|
19359 | if (touchending && !event.touches) return;
|
19360 | if (!filter.apply(this, arguments)) return;
|
19361 | var that = this,
|
19362 | type = event.target.__data__.type,
|
19363 | mode = (keys && event.metaKey ? type = "overlay" : type) === "selection" ? MODE_DRAG : keys && event.altKey ? MODE_CENTER : MODE_HANDLE,
|
19364 | signX = dim === Y ? null : signsX[type],
|
19365 | signY = dim === X ? null : signsY[type],
|
19366 | state = local(that),
|
19367 | extent = state.extent,
|
19368 | selection = state.selection,
|
19369 | W = extent[0][0],
|
19370 | w0,
|
19371 | w1,
|
19372 | N = extent[0][1],
|
19373 | n0,
|
19374 | n1,
|
19375 | E = extent[1][0],
|
19376 | e0,
|
19377 | e1,
|
19378 | S = extent[1][1],
|
19379 | s0,
|
19380 | s1,
|
19381 | dx = 0,
|
19382 | dy = 0,
|
19383 | moving,
|
19384 | shifting = signX && signY && keys && event.shiftKey,
|
19385 | lockX,
|
19386 | lockY,
|
19387 | points = Array.from(event.touches || [event], function (t) {
|
19388 | var i = t.identifier;
|
19389 | t = src_pointer(t, that);
|
19390 | t.point0 = t.slice();
|
19391 | t.identifier = i;
|
19392 | return t;
|
19393 | });
|
19394 | interrupt(that);
|
19395 | var emit = emitter(that, arguments, !0).beforestart();
|
19396 |
|
19397 | if (type === "overlay") {
|
19398 | if (selection) moving = !0;
|
19399 | var pts = [points[0], points[1] || points[0]];
|
19400 | 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])]];
|
19401 | if (points.length > 1) move(event);
|
19402 | } else {
|
19403 | w0 = selection[0][0];
|
19404 | n0 = selection[0][1];
|
19405 | e0 = selection[1][0];
|
19406 | s0 = selection[1][1];
|
19407 | }
|
19408 |
|
19409 | w1 = w0;
|
19410 | n1 = n0;
|
19411 | e1 = e0;
|
19412 | s1 = s0;
|
19413 | var group = src_select(that).attr("pointer-events", "none"),
|
19414 | overlay = group.selectAll(".overlay").attr("cursor", cursors[type]);
|
19415 |
|
19416 | if (event.touches) {
|
19417 | emit.moved = moved;
|
19418 | emit.ended = ended;
|
19419 | } else {
|
19420 | var view = src_select(event.view).on("mousemove.brush", moved, !0).on("mouseup.brush", ended, !0);
|
19421 | if (keys) view.on("keydown.brush", keydowned, !0).on("keyup.brush", keyupped, !0);
|
19422 | nodrag(event.view);
|
19423 | }
|
19424 |
|
19425 | redraw.call(that);
|
19426 | emit.start(event, mode.name);
|
19427 |
|
19428 | function moved(event) {
|
19429 | for (var _iterator = brush_createForOfIteratorHelperLoose(event.changedTouches || [event]), _step; !(_step = _iterator()).done;) {
|
19430 | var p = _step.value;
|
19431 |
|
19432 | for (var _iterator3 = brush_createForOfIteratorHelperLoose(points), _step3; !(_step3 = _iterator3()).done;) {
|
19433 | var d = _step3.value;
|
19434 | if (d.identifier === p.identifier) d.cur = src_pointer(p, that);
|
19435 | }
|
19436 | }
|
19437 |
|
19438 | if (shifting && !lockX && !lockY && points.length === 1) {
|
19439 | var point = points[0];
|
19440 | if (abs(point.cur[0] - point[0]) > abs(point.cur[1] - point[1])) lockY = !0;else lockX = !0;
|
19441 | }
|
19442 |
|
19443 | for (var _iterator2 = brush_createForOfIteratorHelperLoose(points), _step2; !(_step2 = _iterator2()).done;) {
|
19444 | var _point = _step2.value;
|
19445 | if (_point.cur) _point[0] = _point.cur[0], _point[1] = _point.cur[1];
|
19446 | }
|
19447 |
|
19448 | moving = !0;
|
19449 | src_noevent(event);
|
19450 | move(event);
|
19451 | }
|
19452 |
|
19453 | function move(event) {
|
19454 | var point = points[0],
|
19455 | point0 = point.point0,
|
19456 | t;
|
19457 | dx = point[0] - point0[0];
|
19458 | dy = point[1] - point0[1];
|
19459 |
|
19460 | switch (mode) {
|
19461 | case MODE_SPACE:
|
19462 | case MODE_DRAG:
|
19463 | {
|
19464 | if (signX) dx = max(W - w0, min(E - e0, dx)), w1 = w0 + dx, e1 = e0 + dx;
|
19465 | if (signY) dy = max(N - n0, min(S - s0, dy)), n1 = n0 + dy, s1 = s0 + dy;
|
19466 | break;
|
19467 | }
|
19468 |
|
19469 | case MODE_HANDLE:
|
19470 | {
|
19471 | if (points[1]) {
|
19472 | if (signX) w1 = max(W, min(E, points[0][0])), e1 = max(W, min(E, points[1][0])), signX = 1;
|
19473 | if (signY) n1 = max(N, min(S, points[0][1])), s1 = max(N, min(S, points[1][1])), signY = 1;
|
19474 | } else {
|
19475 | if (signX < 0) dx = max(W - w0, min(E - w0, dx)), w1 = w0 + dx, e1 = e0;else if (signX > 0) dx = max(W - e0, min(E - e0, dx)), w1 = w0, e1 = e0 + dx;
|
19476 | if (signY < 0) dy = max(N - n0, min(S - n0, dy)), n1 = n0 + dy, s1 = s0;else if (signY > 0) dy = max(N - s0, min(S - s0, dy)), n1 = n0, s1 = s0 + dy;
|
19477 | }
|
19478 |
|
19479 | break;
|
19480 | }
|
19481 |
|
19482 | case MODE_CENTER:
|
19483 | {
|
19484 | if (signX) w1 = max(W, min(E, w0 - dx * signX)), e1 = max(W, min(E, e0 + dx * signX));
|
19485 | if (signY) n1 = max(N, min(S, n0 - dy * signY)), s1 = max(N, min(S, s0 + dy * signY));
|
19486 | break;
|
19487 | }
|
19488 | }
|
19489 |
|
19490 | if (e1 < w1) {
|
19491 | signX *= -1;
|
19492 | t = w0, w0 = e0, e0 = t;
|
19493 | t = w1, w1 = e1, e1 = t;
|
19494 | if (type in flipX) overlay.attr("cursor", cursors[type = flipX[type]]);
|
19495 | }
|
19496 |
|
19497 | if (s1 < n1) {
|
19498 | signY *= -1;
|
19499 | t = n0, n0 = s0, s0 = t;
|
19500 | t = n1, n1 = s1, s1 = t;
|
19501 | if (type in flipY) overlay.attr("cursor", cursors[type = flipY[type]]);
|
19502 | }
|
19503 |
|
19504 | if (state.selection) selection = state.selection;
|
19505 |
|
19506 | if (lockX) w1 = selection[0][0], e1 = selection[1][0];
|
19507 | if (lockY) n1 = selection[0][1], s1 = selection[1][1];
|
19508 |
|
19509 | if (selection[0][0] !== w1 || selection[0][1] !== n1 || selection[1][0] !== e1 || selection[1][1] !== s1) {
|
19510 | state.selection = [[w1, n1], [e1, s1]];
|
19511 | redraw.call(that);
|
19512 | emit.brush(event, mode.name);
|
19513 | }
|
19514 | }
|
19515 |
|
19516 | function ended(event) {
|
19517 | noevent_nopropagation(event);
|
19518 |
|
19519 | if (event.touches) {
|
19520 | if (event.touches.length) return;
|
19521 | if (touchending) clearTimeout(touchending);
|
19522 | touchending = setTimeout(function () {
|
19523 | touchending = null;
|
19524 | }, 500);
|
19525 | } else {
|
19526 | yesdrag(event.view, moving);
|
19527 | view.on("keydown.brush keyup.brush mousemove.brush mouseup.brush", null);
|
19528 | }
|
19529 |
|
19530 | group.attr("pointer-events", "all");
|
19531 | overlay.attr("cursor", cursors.overlay);
|
19532 | if (state.selection) selection = state.selection;
|
19533 |
|
19534 | if (brush_empty(selection)) state.selection = null, redraw.call(that);
|
19535 | emit.end(event, mode.name);
|
19536 | }
|
19537 |
|
19538 | function keydowned(event) {
|
19539 | switch (event.keyCode) {
|
19540 | case 16:
|
19541 | {
|
19542 |
|
19543 | shifting = signX && signY;
|
19544 | break;
|
19545 | }
|
19546 |
|
19547 | case 18:
|
19548 | {
|
19549 |
|
19550 | if (mode === MODE_HANDLE) {
|
19551 | if (signX) e0 = e1 - dx * signX, w0 = w1 + dx * signX;
|
19552 | if (signY) s0 = s1 - dy * signY, n0 = n1 + dy * signY;
|
19553 | mode = MODE_CENTER;
|
19554 | move(event);
|
19555 | }
|
19556 |
|
19557 | break;
|
19558 | }
|
19559 |
|
19560 | case 32:
|
19561 | {
|
19562 |
|
19563 | if (mode === MODE_HANDLE || mode === MODE_CENTER) {
|
19564 | if (signX < 0) e0 = e1 - dx;else if (signX > 0) w0 = w1 - dx;
|
19565 | if (signY < 0) s0 = s1 - dy;else if (signY > 0) n0 = n1 - dy;
|
19566 | mode = MODE_SPACE;
|
19567 | overlay.attr("cursor", cursors.selection);
|
19568 | move(event);
|
19569 | }
|
19570 |
|
19571 | break;
|
19572 | }
|
19573 |
|
19574 | default:
|
19575 | return;
|
19576 | }
|
19577 |
|
19578 | src_noevent(event);
|
19579 | }
|
19580 |
|
19581 | function keyupped(event) {
|
19582 | switch (event.keyCode) {
|
19583 | case 16:
|
19584 | {
|
19585 |
|
19586 | if (shifting) {
|
19587 | lockX = lockY = shifting = !1;
|
19588 | move(event);
|
19589 | }
|
19590 |
|
19591 | break;
|
19592 | }
|
19593 |
|
19594 | case 18:
|
19595 | {
|
19596 |
|
19597 | if (mode === MODE_CENTER) {
|
19598 | if (signX < 0) e0 = e1;else if (signX > 0) w0 = w1;
|
19599 | if (signY < 0) s0 = s1;else if (signY > 0) n0 = n1;
|
19600 | mode = MODE_HANDLE;
|
19601 | move(event);
|
19602 | }
|
19603 |
|
19604 | break;
|
19605 | }
|
19606 |
|
19607 | case 32:
|
19608 | {
|
19609 |
|
19610 | if (mode === MODE_SPACE) {
|
19611 | if (event.altKey) {
|
19612 | if (signX) e0 = e1 - dx * signX, w0 = w1 + dx * signX;
|
19613 | if (signY) s0 = s1 - dy * signY, n0 = n1 + dy * signY;
|
19614 | mode = MODE_CENTER;
|
19615 | } else {
|
19616 | if (signX < 0) e0 = e1;else if (signX > 0) w0 = w1;
|
19617 | if (signY < 0) s0 = s1;else if (signY > 0) n0 = n1;
|
19618 | mode = MODE_HANDLE;
|
19619 | }
|
19620 |
|
19621 | overlay.attr("cursor", cursors[type]);
|
19622 | move(event);
|
19623 | }
|
19624 |
|
19625 | break;
|
19626 | }
|
19627 |
|
19628 | default:
|
19629 | return;
|
19630 | }
|
19631 |
|
19632 | src_noevent(event);
|
19633 | }
|
19634 | }
|
19635 |
|
19636 | function touchmoved(event) {
|
19637 | emitter(this, arguments).moved(event);
|
19638 | }
|
19639 |
|
19640 | function touchended(event) {
|
19641 | emitter(this, arguments).ended(event);
|
19642 | }
|
19643 |
|
19644 | function initialize() {
|
19645 | var state = this.__brush || {
|
19646 | selection: null
|
19647 | };
|
19648 | state.extent = number2(extent.apply(this, arguments));
|
19649 | state.dim = dim;
|
19650 | return state;
|
19651 | }
|
19652 |
|
19653 | brush.extent = function (_) {
|
19654 | return arguments.length ? (extent = typeof _ === "function" ? _ : d3_brush_src_constant(number2(_)), brush) : extent;
|
19655 | };
|
19656 |
|
19657 | brush.filter = function (_) {
|
19658 | return arguments.length ? (filter = typeof _ === "function" ? _ : d3_brush_src_constant(!!_), brush) : filter;
|
19659 | };
|
19660 |
|
19661 | brush.touchable = function (_) {
|
19662 | return arguments.length ? (touchable = typeof _ === "function" ? _ : d3_brush_src_constant(!!_), brush) : touchable;
|
19663 | };
|
19664 |
|
19665 | brush.handleSize = function (_) {
|
19666 | return arguments.length ? (handleSize = +_, brush) : handleSize;
|
19667 | };
|
19668 |
|
19669 | brush.keyModifiers = function (_) {
|
19670 | return arguments.length ? (keys = !!_, brush) : keys;
|
19671 | };
|
19672 |
|
19673 | brush.on = function () {
|
19674 | var value = listeners.on.apply(listeners, arguments);
|
19675 | return value === listeners ? brush : value;
|
19676 | };
|
19677 |
|
19678 | return brush;
|
19679 | }
|
19680 | ;
|
19681 |
|
19682 | ;
|
19683 |
|
19684 |
|
19685 |
|
19686 |
|
19687 |
|
19688 |
|
19689 |
|
19690 |
|
19691 |
|
19692 | var config_classes = ({
|
19693 | arc: "bb-arc",
|
19694 | arcLabelLine: "bb-arc-label-line",
|
19695 | arcs: "bb-arcs",
|
19696 | area: "bb-area",
|
19697 | areas: "bb-areas",
|
19698 | axis: "bb-axis",
|
19699 | axisX: "bb-axis-x",
|
19700 | axisXLabel: "bb-axis-x-label",
|
19701 | axisY: "bb-axis-y",
|
19702 | axisY2: "bb-axis-y2",
|
19703 | axisY2Label: "bb-axis-y2-label",
|
19704 | axisYLabel: "bb-axis-y-label",
|
19705 | bar: "bb-bar",
|
19706 | bars: "bb-bars",
|
19707 | brush: "bb-brush",
|
19708 | button: "bb-button",
|
19709 | buttonZoomReset: "bb-zoom-reset",
|
19710 | candlestick: "bb-candlestick",
|
19711 | candlesticks: "bb-candlesticks",
|
19712 | chart: "bb-chart",
|
19713 | chartArc: "bb-chart-arc",
|
19714 | chartArcs: "bb-chart-arcs",
|
19715 | chartArcsBackground: "bb-chart-arcs-background",
|
19716 | chartArcsGaugeMax: "bb-chart-arcs-gauge-max",
|
19717 | chartArcsGaugeMin: "bb-chart-arcs-gauge-min",
|
19718 | chartArcsGaugeUnit: "bb-chart-arcs-gauge-unit",
|
19719 | chartArcsTitle: "bb-chart-arcs-title",
|
19720 | chartArcsGaugeTitle: "bb-chart-arcs-gauge-title",
|
19721 | chartBar: "bb-chart-bar",
|
19722 | chartBars: "bb-chart-bars",
|
19723 | chartCandlestick: "bb-chart-candlestick",
|
19724 | chartCandlesticks: "bb-chart-candlesticks",
|
19725 | chartCircles: "bb-chart-circles",
|
19726 | chartLine: "bb-chart-line",
|
19727 | chartLines: "bb-chart-lines",
|
19728 | chartRadar: "bb-chart-radar",
|
19729 | chartRadars: "bb-chart-radars",
|
19730 | chartText: "bb-chart-text",
|
19731 | chartTexts: "bb-chart-texts",
|
19732 | circle: "bb-circle",
|
19733 | circles: "bb-circles",
|
19734 | colorPattern: "bb-color-pattern",
|
19735 | colorScale: "bb-colorscale",
|
19736 | defocused: "bb-defocused",
|
19737 | dragarea: "bb-dragarea",
|
19738 | empty: "bb-empty",
|
19739 | eventRect: "bb-event-rect",
|
19740 | eventRects: "bb-event-rects",
|
19741 | eventRectsMultiple: "bb-event-rects-multiple",
|
19742 | eventRectsSingle: "bb-event-rects-single",
|
19743 | focused: "bb-focused",
|
19744 | gaugeValue: "bb-gauge-value",
|
19745 | grid: "bb-grid",
|
19746 | gridLines: "bb-grid-lines",
|
19747 | legend: "bb-legend",
|
19748 | legendBackground: "bb-legend-background",
|
19749 | legendItem: "bb-legend-item",
|
19750 | legendItemEvent: "bb-legend-item-event",
|
19751 | legendItemFocused: "bb-legend-item-focused",
|
19752 | legendItemHidden: "bb-legend-item-hidden",
|
19753 | legendItemPoint: "bb-legend-item-point",
|
19754 | legendItemTile: "bb-legend-item-tile",
|
19755 | level: "bb-level",
|
19756 | levels: "bb-levels",
|
19757 | line: "bb-line",
|
19758 | lines: "bb-lines",
|
19759 | main: "bb-main",
|
19760 | region: "bb-region",
|
19761 | regions: "bb-regions",
|
19762 | selectedCircle: "bb-selected-circle",
|
19763 | selectedCircles: "bb-selected-circles",
|
19764 | shape: "bb-shape",
|
19765 | shapes: "bb-shapes",
|
19766 | stanfordElements: "bb-stanford-elements",
|
19767 | stanfordLine: "bb-stanford-line",
|
19768 | stanfordLines: "bb-stanford-lines",
|
19769 | stanfordRegion: "bb-stanford-region",
|
19770 | stanfordRegions: "bb-stanford-regions",
|
19771 | subchart: "bb-subchart",
|
19772 | target: "bb-target",
|
19773 | text: "bb-text",
|
19774 | texts: "bb-texts",
|
19775 | title: "bb-title",
|
19776 | tooltip: "bb-tooltip",
|
19777 | tooltipContainer: "bb-tooltip-container",
|
19778 | tooltipName: "bb-tooltip-name",
|
19779 | valueDown: "bb-value-down",
|
19780 | valueUp: "bb-value-up",
|
19781 | xgrid: "bb-xgrid",
|
19782 | xgridFocus: "bb-xgrid-focus",
|
19783 | xgridLine: "bb-xgrid-line",
|
19784 | xgridLines: "bb-xgrid-lines",
|
19785 | xgrids: "bb-xgrids",
|
19786 | ygrid: "bb-ygrid",
|
19787 | ygridFocus: "bb-ygrid-focus",
|
19788 | ygridLine: "bb-ygrid-line",
|
19789 | ygridLines: "bb-ygrid-lines",
|
19790 | ygrids: "bb-ygrids",
|
19791 | zoomBrush: "bb-zoom-brush",
|
19792 | EXPANDED: "_expanded_",
|
19793 | SELECTED: "_selected_",
|
19794 | INCLUDED: "_included_",
|
19795 | TextOverlapping: "text-overlapping"
|
19796 | });
|
19797 | ;
|
19798 |
|
19799 |
|
19800 | function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
19801 |
|
19802 | function _objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
19803 |
|
19804 |
|
19805 |
|
19806 |
|
19807 |
|
19808 |
|
19809 |
|
19810 |
|
19811 |
|
19812 |
|
19813 |
|
19814 |
|
19815 | var isValue = function (v) {
|
19816 | return v || v === 0;
|
19817 | },
|
19818 | isFunction = function (v) {
|
19819 | return typeof v === "function";
|
19820 | },
|
19821 | isString = function (v) {
|
19822 | return typeof v === "string";
|
19823 | },
|
19824 | isNumber = function (v) {
|
19825 | return typeof v === "number";
|
19826 | },
|
19827 | isUndefined = function (v) {
|
19828 | return typeof v === "undefined";
|
19829 | },
|
19830 | isDefined = function (v) {
|
19831 | return typeof v !== "undefined";
|
19832 | },
|
19833 | isboolean = function (v) {
|
19834 | return typeof v === "boolean";
|
19835 | },
|
19836 | ceil10 = function (v) {
|
19837 | return Math.ceil(v / 10) * 10;
|
19838 | },
|
19839 | asHalfPixel = function (n) {
|
19840 | return Math.ceil(n) + .5;
|
19841 | },
|
19842 | diffDomain = function (d) {
|
19843 | return d[1] - d[0];
|
19844 | },
|
19845 | isObjectType = function (v) {
|
19846 | return typeof v === "object";
|
19847 | },
|
19848 | isEmpty = function (o) {
|
19849 | return isUndefined(o) || o === null || isString(o) && o.length === 0 || isObjectType(o) && !(o instanceof Date) && Object.keys(o).length === 0 || isNumber(o) && isNaN(o);
|
19850 | },
|
19851 | notEmpty = function (o) {
|
19852 | return !isEmpty(o);
|
19853 | },
|
19854 | isArray = function (arr) {
|
19855 | return Array.isArray(arr);
|
19856 | },
|
19857 | isObject = function (obj) {
|
19858 | return obj && !(obj != null && obj.nodeType) && isObjectType(obj) && !isArray(obj);
|
19859 | };
|
19860 |
|
19861 |
|
19862 |
|
19863 |
|
19864 |
|
19865 |
|
19866 |
|
19867 |
|
19868 |
|
19869 |
|
19870 | function getOption(options, key, defaultValue) {
|
19871 | return isDefined(options[key]) ? options[key] : defaultValue;
|
19872 | }
|
19873 |
|
19874 |
|
19875 |
|
19876 |
|
19877 |
|
19878 |
|
19879 |
|
19880 |
|
19881 |
|
19882 | function hasValue(dict, value) {
|
19883 | var found = !1;
|
19884 | Object.keys(dict).forEach(function (key) {
|
19885 | return dict[key] === value && (found = !0);
|
19886 | });
|
19887 | return found;
|
19888 | }
|
19889 |
|
19890 |
|
19891 |
|
19892 |
|
19893 |
|
19894 |
|
19895 |
|
19896 |
|
19897 |
|
19898 | function callFn(fn) {
|
19899 | for (var isFn = isFunction(fn), _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
19900 | args[_key - 1] = arguments[_key];
|
19901 | }
|
19902 |
|
19903 | isFn && fn.call.apply(fn, args);
|
19904 | return isFn;
|
19905 | }
|
19906 |
|
19907 |
|
19908 |
|
19909 |
|
19910 |
|
19911 |
|
19912 |
|
19913 |
|
19914 | function endall(transition, cb) {
|
19915 | var n = 0,
|
19916 | end = function () {
|
19917 | for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
19918 | args[_key2] = arguments[_key2];
|
19919 | }
|
19920 |
|
19921 | --n || cb.apply.apply(cb, [this].concat(args));
|
19922 | };
|
19923 |
|
19924 |
|
19925 | if ("duration" in transition) {
|
19926 | transition.each(function () {
|
19927 | return ++n;
|
19928 | }).on("end", end);
|
19929 | } else {
|
19930 | ++n;
|
19931 | transition.call(end);
|
19932 | }
|
19933 | }
|
19934 |
|
19935 |
|
19936 |
|
19937 |
|
19938 |
|
19939 |
|
19940 |
|
19941 |
|
19942 | function sanitise(str) {
|
19943 | return isString(str) ? str.replace(/</g, "<").replace(/>/g, ">") : str;
|
19944 | }
|
19945 |
|
19946 |
|
19947 |
|
19948 |
|
19949 |
|
19950 |
|
19951 |
|
19952 |
|
19953 |
|
19954 |
|
19955 | function setTextValue(node, text, dy, toMiddle) {
|
19956 | if (dy === void 0) {
|
19957 | dy = [-1, 1];
|
19958 | }
|
19959 |
|
19960 | if (toMiddle === void 0) {
|
19961 | toMiddle = !1;
|
19962 | }
|
19963 |
|
19964 | if (!node || !isString(text)) {
|
19965 | return;
|
19966 | }
|
19967 |
|
19968 | if (text.indexOf("\n") === -1) {
|
19969 | node.text(text);
|
19970 | } else {
|
19971 | var diff = [node.text(), text].map(function (v) {
|
19972 | return v.replace(/[\s\n]/g, "");
|
19973 | });
|
19974 |
|
19975 | if (diff[0] !== diff[1]) {
|
19976 | var multiline = text.split("\n"),
|
19977 | len = toMiddle ? multiline.length - 1 : 1;
|
19978 |
|
19979 | node.html("");
|
19980 | multiline.forEach(function (v, i) {
|
19981 | node.append("tspan").attr("x", 0).attr("dy", (i === 0 ? dy[0] * len : dy[1]) + "em").text(v);
|
19982 | });
|
19983 | }
|
19984 | }
|
19985 | }
|
19986 |
|
19987 |
|
19988 |
|
19989 |
|
19990 |
|
19991 |
|
19992 |
|
19993 |
|
19994 | function getRectSegList(path) {
|
19995 | |
19996 |
|
19997 |
|
19998 |
|
19999 |
|
20000 |
|
20001 |
|
20002 | var _path$getBBox = path.getBBox(),
|
20003 | x = _path$getBBox.x,
|
20004 | y = _path$getBBox.y,
|
20005 | width = _path$getBBox.width,
|
20006 | height = _path$getBBox.height;
|
20007 |
|
20008 | return [{
|
20009 | x: x,
|
20010 | y: y + height
|
20011 | },
|
20012 | {
|
20013 | x: x,
|
20014 | y: y
|
20015 | },
|
20016 | {
|
20017 | x: x + width,
|
20018 | y: y
|
20019 | },
|
20020 | {
|
20021 | x: x + width,
|
20022 | y: y + height
|
20023 | }
|
20024 | ];
|
20025 | }
|
20026 |
|
20027 |
|
20028 |
|
20029 |
|
20030 |
|
20031 |
|
20032 |
|
20033 |
|
20034 | function getPathBox(path) {
|
20035 | var _path$getBoundingClie = path.getBoundingClientRect(),
|
20036 | width = _path$getBoundingClie.width,
|
20037 | height = _path$getBoundingClie.height,
|
20038 | items = getRectSegList(path),
|
20039 | x = items[0].x,
|
20040 | y = Math.min(items[0].y, items[1].y);
|
20041 |
|
20042 | return {
|
20043 | x: x,
|
20044 | y: y,
|
20045 | width: width,
|
20046 | height: height
|
20047 | };
|
20048 | }
|
20049 |
|
20050 |
|
20051 |
|
20052 |
|
20053 |
|
20054 |
|
20055 |
|
20056 |
|
20057 |
|
20058 | function getPointer(event, element) {
|
20059 | var _ref,
|
20060 | touches = event && ((_ref = event.touches || event.sourceEvent && event.sourceEvent.touches) == null ? void 0 : _ref[0]),
|
20061 | pointer = src_pointer(touches || event, element);
|
20062 |
|
20063 | return pointer.map(function (v) {
|
20064 | return isNaN(v) ? 0 : v;
|
20065 | });
|
20066 | }
|
20067 |
|
20068 |
|
20069 |
|
20070 |
|
20071 |
|
20072 |
|
20073 |
|
20074 |
|
20075 | function getBrushSelection(ctx) {
|
20076 | var event = ctx.event,
|
20077 | $el = ctx.$el,
|
20078 | main = $el.subchart.main || $el.main,
|
20079 | selection;
|
20080 |
|
20081 |
|
20082 | if (event && event.type === "brush") {
|
20083 | selection = event.selection;
|
20084 | } else if (main && (selection = main.select("." + config_classes.brush).node())) {
|
20085 | selection = brushSelection(selection);
|
20086 | }
|
20087 |
|
20088 | return selection;
|
20089 | }
|
20090 |
|
20091 |
|
20092 |
|
20093 |
|
20094 |
|
20095 |
|
20096 |
|
20097 |
|
20098 |
|
20099 | function getBoundingRect(node) {
|
20100 | var needEvaluate = !("rect" in node) || "rect" in node && node.hasAttribute("width") && node.rect.width !== +node.getAttribute("width");
|
20101 | return needEvaluate ? node.rect = node.getBoundingClientRect() : node.rect;
|
20102 | }
|
20103 |
|
20104 |
|
20105 |
|
20106 |
|
20107 |
|
20108 |
|
20109 |
|
20110 |
|
20111 | function getRandom(asStr) {
|
20112 | if (asStr === void 0) {
|
20113 | asStr = !0;
|
20114 | }
|
20115 |
|
20116 | var rand = Math.random();
|
20117 | return asStr ? rand + "" : rand;
|
20118 | }
|
20119 |
|
20120 |
|
20121 |
|
20122 |
|
20123 |
|
20124 |
|
20125 |
|
20126 |
|
20127 |
|
20128 |
|
20129 |
|
20130 |
|
20131 | function findIndex(arr, v, start, end, isRotated) {
|
20132 | if (start > end) {
|
20133 | return -1;
|
20134 | }
|
20135 |
|
20136 | var mid = Math.floor((start + end) / 2),
|
20137 | _arr$mid = arr[mid],
|
20138 | x = _arr$mid.x,
|
20139 | _arr$mid$w = _arr$mid.w,
|
20140 | w = _arr$mid$w === void 0 ? 0 : _arr$mid$w;
|
20141 |
|
20142 | if (isRotated) {
|
20143 | x = arr[mid].y;
|
20144 | w = arr[mid].h;
|
20145 | }
|
20146 |
|
20147 | if (v >= x && v <= x + w) {
|
20148 | return mid;
|
20149 | }
|
20150 |
|
20151 | return v < x ? findIndex(arr, v, start, mid - 1, isRotated) : findIndex(arr, v, mid + 1, end, isRotated);
|
20152 | }
|
20153 |
|
20154 |
|
20155 |
|
20156 |
|
20157 |
|
20158 |
|
20159 |
|
20160 |
|
20161 | function brushEmpty(ctx) {
|
20162 | var selection = getBrushSelection(ctx);
|
20163 |
|
20164 | if (selection) {
|
20165 |
|
20166 |
|
20167 |
|
20168 | return selection[0] === selection[1];
|
20169 | }
|
20170 |
|
20171 | return !0;
|
20172 | }
|
20173 |
|
20174 |
|
20175 |
|
20176 |
|
20177 |
|
20178 |
|
20179 |
|
20180 |
|
20181 | function deepClone() {
|
20182 | for (var clone = function (v) {
|
20183 | if (isObject(v) && v.constructor) {
|
20184 | var r = new v.constructor();
|
20185 |
|
20186 | for (var k in v) {
|
20187 | r[k] = clone(v[k]);
|
20188 | }
|
20189 |
|
20190 | return r;
|
20191 | }
|
20192 |
|
20193 | return v;
|
20194 | }, _len3 = arguments.length, objectN = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
20195 | objectN[_key3] = arguments[_key3];
|
20196 | }
|
20197 |
|
20198 | return objectN.map(function (v) {
|
20199 | return clone(v);
|
20200 | }).reduce(function (a, c) {
|
20201 | return _objectSpread(_objectSpread({}, a), c);
|
20202 | });
|
20203 | }
|
20204 |
|
20205 |
|
20206 |
|
20207 |
|
20208 |
|
20209 |
|
20210 |
|
20211 |
|
20212 |
|
20213 | function util_extend(target, source) {
|
20214 | if (target === void 0) {
|
20215 | target = {};
|
20216 | }
|
20217 |
|
20218 | if (isArray(source)) {
|
20219 | source.forEach(function (v) {
|
20220 | return util_extend(target, v);
|
20221 | });
|
20222 | }
|
20223 |
|
20224 |
|
20225 | for (var p in source) {
|
20226 | if (/^\d+$/.test(p) || p in target) {
|
20227 | continue;
|
20228 | }
|
20229 |
|
20230 | target[p] = source[p];
|
20231 | }
|
20232 |
|
20233 | return target;
|
20234 | }
|
20235 |
|
20236 |
|
20237 |
|
20238 |
|
20239 |
|
20240 |
|
20241 |
|
20242 |
|
20243 | var capitalize = function (str) {
|
20244 | return str.charAt(0).toUpperCase() + str.slice(1);
|
20245 | };
|
20246 |
|
20247 |
|
20248 |
|
20249 |
|
20250 |
|
20251 |
|
20252 |
|
20253 |
|
20254 |
|
20255 | function camelize(str, separator) {
|
20256 | if (separator === void 0) {
|
20257 | separator = "-";
|
20258 | }
|
20259 |
|
20260 | return str.split(separator).map(function (v, i) {
|
20261 | return i ? v.charAt(0).toUpperCase() + v.slice(1).toLowerCase() : v.toLowerCase();
|
20262 | }).join("");
|
20263 | }
|
20264 |
|
20265 |
|
20266 |
|
20267 |
|
20268 |
|
20269 |
|
20270 |
|
20271 |
|
20272 | var toArray = function (v) {
|
20273 | return [].slice.call(v);
|
20274 | };
|
20275 |
|
20276 |
|
20277 |
|
20278 |
|
20279 |
|
20280 |
|
20281 |
|
20282 |
|
20283 | function getCssRules(styleSheets) {
|
20284 | var rules = [];
|
20285 | styleSheets.forEach(function (sheet) {
|
20286 | try {
|
20287 | if (sheet.cssRules && sheet.cssRules.length) {
|
20288 | rules = rules.concat(toArray(sheet.cssRules));
|
20289 | }
|
20290 | } catch (e) {
|
20291 | console.error("Error while reading rules from " + sheet.href + ": " + e.toString());
|
20292 | }
|
20293 | });
|
20294 | return rules;
|
20295 | }
|
20296 |
|
20297 |
|
20298 |
|
20299 |
|
20300 |
|
20301 |
|
20302 |
|
20303 |
|
20304 | function getTranslation(node) {
|
20305 | var transform = node ? node.transform : null,
|
20306 | baseVal = transform && transform.baseVal;
|
20307 | return baseVal && baseVal.numberOfItems ? baseVal.getItem(0).matrix : {
|
20308 | a: 0,
|
20309 | b: 0,
|
20310 | c: 0,
|
20311 | d: 0,
|
20312 | e: 0,
|
20313 | f: 0
|
20314 | };
|
20315 | }
|
20316 |
|
20317 |
|
20318 |
|
20319 |
|
20320 |
|
20321 |
|
20322 |
|
20323 |
|
20324 | function getUnique(data) {
|
20325 | var isDate = data[0] instanceof Date,
|
20326 | d = (isDate ? data.map(Number) : data).filter(function (v, i, self) {
|
20327 | return self.indexOf(v) === i;
|
20328 | });
|
20329 | return isDate ? d.map(function (v) {
|
20330 | return new Date(v);
|
20331 | }) : d;
|
20332 | }
|
20333 |
|
20334 |
|
20335 |
|
20336 |
|
20337 |
|
20338 |
|
20339 |
|
20340 |
|
20341 | function mergeArray(arr) {
|
20342 | return arr && arr.length ? arr.reduce(function (p, c) {
|
20343 | return p.concat(c);
|
20344 | }) : [];
|
20345 | }
|
20346 |
|
20347 |
|
20348 |
|
20349 |
|
20350 |
|
20351 |
|
20352 |
|
20353 |
|
20354 |
|
20355 | function mergeObj(target) {
|
20356 | for (var _len4 = arguments.length, objectN = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
|
20357 | objectN[_key4 - 1] = arguments[_key4];
|
20358 | }
|
20359 |
|
20360 | if (!objectN.length || objectN.length === 1 && !objectN[0]) {
|
20361 | return target;
|
20362 | }
|
20363 |
|
20364 | var source = objectN.shift();
|
20365 |
|
20366 | if (isObject(target) && isObject(source)) {
|
20367 | Object.keys(source).forEach(function (key) {
|
20368 | var value = source[key];
|
20369 |
|
20370 | if (isObject(value)) {
|
20371 | target[key] || (target[key] = {});
|
20372 | target[key] = mergeObj(target[key], value);
|
20373 | } else {
|
20374 | target[key] = isArray(value) ? value.concat() : value;
|
20375 | }
|
20376 | });
|
20377 | }
|
20378 |
|
20379 | return mergeObj.apply(void 0, [target].concat(objectN));
|
20380 | }
|
20381 |
|
20382 |
|
20383 |
|
20384 |
|
20385 |
|
20386 |
|
20387 |
|
20388 |
|
20389 |
|
20390 | function sortValue(data, isAsc) {
|
20391 | if (isAsc === void 0) {
|
20392 | isAsc = !0;
|
20393 | }
|
20394 |
|
20395 | var fn;
|
20396 |
|
20397 | if (data[0] instanceof Date) {
|
20398 | fn = isAsc ? function (a, b) {
|
20399 | return a - b;
|
20400 | } : function (a, b) {
|
20401 | return b - a;
|
20402 | };
|
20403 | } else {
|
20404 | if (isAsc && !data.every(isNaN)) {
|
20405 | fn = function (a, b) {
|
20406 | return a - b;
|
20407 | };
|
20408 | } else if (!isAsc) {
|
20409 | fn = function (a, b) {
|
20410 | return a > b && -1 || a < b && 1 || a === b && 0;
|
20411 | };
|
20412 | }
|
20413 | }
|
20414 |
|
20415 | return data.concat().sort(fn);
|
20416 | }
|
20417 |
|
20418 |
|
20419 |
|
20420 |
|
20421 |
|
20422 |
|
20423 |
|
20424 |
|
20425 |
|
20426 | function getMinMax(type, data) {
|
20427 | var res = data.filter(function (v) {
|
20428 | return notEmpty(v);
|
20429 | });
|
20430 |
|
20431 | if (res.length) {
|
20432 | if (isNumber(res[0])) {
|
20433 | res = Math[type].apply(Math, res);
|
20434 | } else if (res[0] instanceof Date) {
|
20435 | res = sortValue(res, type === "min")[0];
|
20436 | }
|
20437 | } else {
|
20438 | res = undefined;
|
20439 | }
|
20440 |
|
20441 | return res;
|
20442 | }
|
20443 |
|
20444 |
|
20445 |
|
20446 |
|
20447 |
|
20448 |
|
20449 |
|
20450 |
|
20451 |
|
20452 |
|
20453 | var getRange = function (start, end, step) {
|
20454 | if (step === void 0) {
|
20455 | step = 1;
|
20456 | }
|
20457 |
|
20458 | var res = [],
|
20459 | n = Math.max(0, Math.ceil((end - start) / step)) | 0;
|
20460 |
|
20461 | for (var i = start; i < n; i++) {
|
20462 | res.push(start + i * step);
|
20463 | }
|
20464 |
|
20465 | return res;
|
20466 | },
|
20467 | emulateEvent = {
|
20468 | mouse: function () {
|
20469 | var getParams = function () {
|
20470 | return {
|
20471 | bubbles: !1,
|
20472 | cancelable: !1,
|
20473 | screenX: 0,
|
20474 | screenY: 0,
|
20475 | clientX: 0,
|
20476 | clientY: 0
|
20477 | };
|
20478 | };
|
20479 |
|
20480 | try {
|
20481 |
|
20482 | new MouseEvent("t");
|
20483 | return function (el, eventType, params) {
|
20484 | if (params === void 0) {
|
20485 | params = getParams();
|
20486 | }
|
20487 |
|
20488 | el.dispatchEvent(new MouseEvent(eventType, params));
|
20489 | };
|
20490 | } catch (e) {
|
20491 |
|
20492 | return function (el, eventType, params) {
|
20493 | if (params === void 0) {
|
20494 | params = getParams();
|
20495 | }
|
20496 |
|
20497 | var mouseEvent = browser_doc.createEvent("MouseEvent");
|
20498 |
|
20499 | mouseEvent.initMouseEvent(eventType, params.bubbles, params.cancelable, win, 0,
|
20500 | params.screenX, params.screenY, params.clientX, params.clientY, !1, !1, !1, !1, 0, null);
|
20501 | el.dispatchEvent(mouseEvent);
|
20502 | };
|
20503 | }
|
20504 | }(),
|
20505 | touch: function touch(el, eventType, params) {
|
20506 | var touchObj = new Touch(mergeObj({
|
20507 | identifier: Date.now(),
|
20508 | target: el,
|
20509 | radiusX: 2.5,
|
20510 | radiusY: 2.5,
|
20511 | rotationAngle: 10,
|
20512 | force: .5
|
20513 | }, params));
|
20514 | el.dispatchEvent(new TouchEvent(eventType, {
|
20515 | cancelable: !0,
|
20516 | bubbles: !0,
|
20517 | shiftKey: !0,
|
20518 | touches: [touchObj],
|
20519 | targetTouches: [],
|
20520 | changedTouches: [touchObj]
|
20521 | }));
|
20522 | }
|
20523 | };
|
20524 |
|
20525 |
|
20526 |
|
20527 |
|
20528 |
|
20529 |
|
20530 |
|
20531 |
|
20532 |
|
20533 | function tplProcess(tpl, data) {
|
20534 | var res = tpl;
|
20535 |
|
20536 | for (var x in data) {
|
20537 | res = res.replace(new RegExp("{=" + x + "}", "g"), data[x]);
|
20538 | }
|
20539 |
|
20540 | return res;
|
20541 | }
|
20542 |
|
20543 |
|
20544 |
|
20545 |
|
20546 |
|
20547 |
|
20548 |
|
20549 |
|
20550 |
|
20551 | function parseDate(date) {
|
20552 | var parsedDate;
|
20553 |
|
20554 | if (date instanceof Date) {
|
20555 | parsedDate = date;
|
20556 | } else if (isString(date)) {
|
20557 | var config = this.config,
|
20558 | format = this.format;
|
20559 | parsedDate = format.dataTime(config.data_xFormat)(date);
|
20560 | } else if (isNumber(date) && !isNaN(date)) {
|
20561 | parsedDate = new Date(+date);
|
20562 | }
|
20563 |
|
20564 | if (!parsedDate || isNaN(+parsedDate)) {
|
20565 | console && console.error && console.error("Failed to parse x '" + date + "' to Date object");
|
20566 | }
|
20567 |
|
20568 | return parsedDate;
|
20569 | }
|
20570 |
|
20571 |
|
20572 |
|
20573 |
|
20574 |
|
20575 |
|
20576 |
|
20577 | function isTabVisible() {
|
20578 | return !browser_doc.hidden;
|
20579 | }
|
20580 |
|
20581 |
|
20582 |
|
20583 |
|
20584 |
|
20585 |
|
20586 |
|
20587 |
|
20588 |
|
20589 | function convertInputType(mouse, touch) {
|
20590 | var isMobile = !1;
|
20591 |
|
20592 | if (/Mobi/.test(win.navigator.userAgent) && touch) {
|
20593 |
|
20594 | var hasTouchPoints = win.navigator && "maxTouchPoints" in win.navigator && win.navigator.maxTouchPoints > 0,
|
20595 | hasTouch = "ontouchmove" in win || win.DocumentTouch && browser_doc instanceof win.DocumentTouch;
|
20596 |
|
20597 |
|
20598 | isMobile = hasTouchPoints || hasTouch;
|
20599 | }
|
20600 |
|
20601 | var hasMouse = mouse && !isMobile ? "onmouseover" in win : !1;
|
20602 | return hasMouse && "mouse" || isMobile && "touch" || null;
|
20603 | }
|
20604 | ;
|
20605 |
|
20606 |
|
20607 |
|
20608 |
|
20609 |
|
20610 |
|
20611 |
|
20612 |
|
20613 |
|
20614 |
|
20615 |
|
20616 |
|
20617 |
|
20618 |
|
20619 |
|
20620 |
|
20621 |
|
20622 | function checkModuleImport(ctx) {
|
20623 | var $$ = ctx,
|
20624 | config = $$.config,
|
20625 | type = "";
|
20626 |
|
20627 | if (isEmpty(config.data_type || config.data_types) && !$$[TYPE_METHOD_NEEDED.LINE]) {
|
20628 | type = "line";
|
20629 | } else {
|
20630 | for (var x in TYPE_METHOD_NEEDED) {
|
20631 | var t = TYPE[x];
|
20632 |
|
20633 | if ($$.hasType(t) && !$$[TYPE_METHOD_NEEDED[x]]) {
|
20634 | type = t;
|
20635 | break;
|
20636 | }
|
20637 | }
|
20638 | }
|
20639 |
|
20640 | type && logError("Please, make sure if %c" + camelize(type), "module has been imported and specified correctly.");
|
20641 | }
|
20642 |
|
20643 |
|
20644 |
|
20645 |
|
20646 |
|
20647 |
|
20648 |
|
20649 |
|
20650 | function logError(head, tail) {
|
20651 | var _window$console,
|
20652 | prefix = "[billboard.js]",
|
20653 | hasConsole = (_window$console = win.console) == null ? void 0 : _window$console.error;
|
20654 |
|
20655 | if (hasConsole) {
|
20656 | console.error("\u274C " + prefix + " " + head, "background:red;color:white;display:block;font-size:15px", tail);
|
20657 | console.info("%cℹ️", "font-size:15px", "https://github.com/naver/billboard.js/wiki/CHANGELOG-v2#modularization-by-its-functionality");
|
20658 | }
|
20659 |
|
20660 | throw Error(prefix + " " + head.replace(/\%c([a-z-]+)/i, "'$1' ") + " " + tail);
|
20661 | }
|
20662 | ;
|
20663 |
|
20664 |
|
20665 |
|
20666 |
|
20667 |
|
20668 |
|
20669 |
|
20670 |
|
20671 |
|
20672 |
|
20673 |
|
20674 | var Element = function () {
|
20675 | return {
|
20676 | chart: null,
|
20677 | main: null,
|
20678 | svg: null,
|
20679 | axis: {
|
20680 |
|
20681 | x: null,
|
20682 | y: null,
|
20683 | y2: null,
|
20684 | subX: null
|
20685 | },
|
20686 | defs: null,
|
20687 | tooltip: null,
|
20688 | legend: null,
|
20689 | title: null,
|
20690 | subchart: {
|
20691 | main: null,
|
20692 |
|
20693 | bar: null,
|
20694 |
|
20695 | line: null,
|
20696 |
|
20697 | area: null
|
20698 |
|
20699 | },
|
20700 | arcs: null,
|
20701 | bar: null,
|
20702 |
|
20703 | candlestick: null,
|
20704 | line: null,
|
20705 |
|
20706 | area: null,
|
20707 |
|
20708 | circle: null,
|
20709 |
|
20710 | radar: null,
|
20711 | text: null,
|
20712 |
|
20713 | grid: {
|
20714 | main: null,
|
20715 |
|
20716 | x: null,
|
20717 |
|
20718 | y: null
|
20719 |
|
20720 | },
|
20721 | gridLines: {
|
20722 | main: null,
|
20723 |
|
20724 | x: null,
|
20725 |
|
20726 | y: null
|
20727 |
|
20728 | },
|
20729 | region: {
|
20730 | main: null,
|
20731 |
|
20732 | list: null
|
20733 |
|
20734 | },
|
20735 | eventRect: null,
|
20736 | zoomResetBtn: null
|
20737 |
|
20738 | };
|
20739 | };
|
20740 |
|
20741 |
|
20742 | ;
|
20743 |
|
20744 |
|
20745 |
|
20746 |
|
20747 |
|
20748 |
|
20749 |
|
20750 |
|
20751 |
|
20752 |
|
20753 |
|
20754 | var State = function () {
|
20755 | return {
|
20756 |
|
20757 | width: 0,
|
20758 | width2: 0,
|
20759 | height: 0,
|
20760 | height2: 0,
|
20761 | margin: {
|
20762 | top: 0,
|
20763 | bottom: 0,
|
20764 | left: 0,
|
20765 | right: 0
|
20766 | },
|
20767 | margin2: {
|
20768 | top: 0,
|
20769 | bottom: 0,
|
20770 | left: 0,
|
20771 | right: 0
|
20772 | },
|
20773 | margin3: {
|
20774 | top: 0,
|
20775 | bottom: 0,
|
20776 | left: 0,
|
20777 | right: 0
|
20778 | },
|
20779 | arcWidth: 0,
|
20780 | arcHeight: 0,
|
20781 | xAxisHeight: 0,
|
20782 | hasAxis: !1,
|
20783 | hasRadar: !1,
|
20784 | current: {
|
20785 |
|
20786 | width: 0,
|
20787 | height: 0,
|
20788 | dataMax: 0,
|
20789 | maxTickWidths: {
|
20790 | x: {
|
20791 | size: 0,
|
20792 | ticks: [],
|
20793 | clipPath: 0,
|
20794 | domain: ""
|
20795 | },
|
20796 | y: {
|
20797 | size: 0,
|
20798 | domain: ""
|
20799 | },
|
20800 | y2: {
|
20801 | size: 0,
|
20802 | domain: ""
|
20803 | }
|
20804 | },
|
20805 |
|
20806 | types: []
|
20807 | },
|
20808 |
|
20809 | isLegendRight: !1,
|
20810 | isLegendInset: !1,
|
20811 | isLegendTop: !1,
|
20812 | isLegendLeft: !1,
|
20813 | legendStep: 0,
|
20814 | legendItemWidth: 0,
|
20815 | legendItemHeight: 0,
|
20816 | legendHasRendered: !1,
|
20817 | eventReceiver: {
|
20818 | currentIdx: -1,
|
20819 |
|
20820 | rect: {},
|
20821 |
|
20822 | data: [],
|
20823 |
|
20824 | coords: []
|
20825 |
|
20826 | },
|
20827 | axis: {
|
20828 | x: {
|
20829 | padding: {
|
20830 | left: 0,
|
20831 | right: 0
|
20832 | },
|
20833 | tickCount: 0
|
20834 | }
|
20835 | },
|
20836 | rotatedPadding: {
|
20837 | left: 30,
|
20838 | right: 0,
|
20839 | top: 5
|
20840 | },
|
20841 | withoutFadeIn: {},
|
20842 | inputType: "",
|
20843 | datetimeId: "",
|
20844 |
|
20845 | clip: {
|
20846 | id: "",
|
20847 | idXAxis: "",
|
20848 | idYAxis: "",
|
20849 | idXAxisTickTexts: "",
|
20850 | idGrid: "",
|
20851 | idSubchart: "",
|
20852 |
|
20853 | path: "",
|
20854 | pathXAxis: "",
|
20855 | pathYAxis: "",
|
20856 | pathXAxisTickTexts: "",
|
20857 | pathGrid: ""
|
20858 | },
|
20859 |
|
20860 | event: null,
|
20861 |
|
20862 | dragStart: null,
|
20863 | dragging: !1,
|
20864 | flowing: !1,
|
20865 | cancelClick: !1,
|
20866 | mouseover: !1,
|
20867 | rendered: !1,
|
20868 | transiting: !1,
|
20869 | redrawing: !1,
|
20870 |
|
20871 | resizing: !1,
|
20872 |
|
20873 | toggling: !1,
|
20874 |
|
20875 | zooming: !1,
|
20876 | hasNegativeValue: !1,
|
20877 | hasPositiveValue: !0,
|
20878 | orgAreaOpacity: "0.2",
|
20879 |
|
20880 | hiddenTargetIds: [],
|
20881 | hiddenLegendIds: [],
|
20882 | focusedTargetIds: [],
|
20883 | defocusedTargetIds: [],
|
20884 |
|
20885 | radius: 0,
|
20886 | innerRadius: 0,
|
20887 | outerRadius: undefined,
|
20888 | innerRadiusRatio: 0,
|
20889 | gaugeArcWidth: 0,
|
20890 | radiusExpanded: 0,
|
20891 |
|
20892 | xgridAttr: {
|
20893 | x1: null,
|
20894 | x2: null,
|
20895 | y1: null,
|
20896 | y2: null
|
20897 | }
|
20898 | };
|
20899 | };
|
20900 |
|
20901 |
|
20902 | ;
|
20903 |
|
20904 |
|
20905 |
|
20906 |
|
20907 |
|
20908 |
|
20909 |
|
20910 | var classes = {
|
20911 | element: Element,
|
20912 | state: State
|
20913 | };
|
20914 |
|
20915 |
|
20916 |
|
20917 |
|
20918 |
|
20919 |
|
20920 |
|
20921 | var Store = function () {
|
20922 | function Store() {
|
20923 | var _this = this;
|
20924 |
|
20925 | Object.keys(classes).forEach(function (v) {
|
20926 | _this[v] = new classes[v]();
|
20927 | });
|
20928 | }
|
20929 |
|
20930 | var _proto = Store.prototype;
|
20931 |
|
20932 | _proto.getStore = function getStore(name) {
|
20933 | return this[name];
|
20934 | };
|
20935 |
|
20936 | return Store;
|
20937 | }();
|
20938 |
|
20939 |
|
20940 | ;
|
20941 |
|
20942 |
|
20943 |
|
20944 |
|
20945 |
|
20946 |
|
20947 |
|
20948 |
|
20949 | var main = ({
|
20950 | |
20951 |
|
20952 |
|
20953 |
|
20954 |
|
20955 |
|
20956 |
|
20957 |
|
20958 |
|
20959 |
|
20960 |
|
20961 |
|
20962 |
|
20963 |
|
20964 |
|
20965 |
|
20966 |
|
20967 |
|
20968 |
|
20969 |
|
20970 |
|
20971 |
|
20972 |
|
20973 |
|
20974 |
|
20975 |
|
20976 | bindto: "#chart",
|
20977 |
|
20978 | |
20979 |
|
20980 |
|
20981 |
|
20982 |
|
20983 |
|
20984 |
|
20985 |
|
20986 |
|
20987 |
|
20988 |
|
20989 |
|
20990 |
|
20991 |
|
20992 |
|
20993 |
|
20994 |
|
20995 |
|
20996 |
|
20997 | background: {},
|
20998 |
|
20999 | |
21000 |
|
21001 |
|
21002 |
|
21003 |
|
21004 |
|
21005 |
|
21006 |
|
21007 |
|
21008 |
|
21009 |
|
21010 |
|
21011 |
|
21012 |
|
21013 | clipPath: !0,
|
21014 |
|
21015 | |
21016 |
|
21017 |
|
21018 |
|
21019 |
|
21020 |
|
21021 |
|
21022 |
|
21023 |
|
21024 |
|
21025 |
|
21026 |
|
21027 | svg_classname: undefined,
|
21028 |
|
21029 | |
21030 |
|
21031 |
|
21032 |
|
21033 |
|
21034 |
|
21035 |
|
21036 |
|
21037 |
|
21038 |
|
21039 |
|
21040 |
|
21041 |
|
21042 |
|
21043 |
|
21044 |
|
21045 | size_width: undefined,
|
21046 | size_height: undefined,
|
21047 |
|
21048 | |
21049 |
|
21050 |
|
21051 |
|
21052 |
|
21053 |
|
21054 |
|
21055 |
|
21056 |
|
21057 |
|
21058 |
|
21059 |
|
21060 |
|
21061 |
|
21062 |
|
21063 |
|
21064 |
|
21065 |
|
21066 | padding_left: undefined,
|
21067 | padding_right: undefined,
|
21068 | padding_top: undefined,
|
21069 | padding_bottom: undefined,
|
21070 |
|
21071 | |
21072 |
|
21073 |
|
21074 |
|
21075 |
|
21076 |
|
21077 |
|
21078 |
|
21079 |
|
21080 |
|
21081 |
|
21082 |
|
21083 | resize_auto: !0,
|
21084 |
|
21085 | |
21086 |
|
21087 |
|
21088 |
|
21089 |
|
21090 |
|
21091 |
|
21092 |
|
21093 |
|
21094 |
|
21095 |
|
21096 |
|
21097 | onover: undefined,
|
21098 |
|
21099 | |
21100 |
|
21101 |
|
21102 |
|
21103 |
|
21104 |
|
21105 |
|
21106 |
|
21107 |
|
21108 |
|
21109 |
|
21110 |
|
21111 | onout: undefined,
|
21112 |
|
21113 | |
21114 |
|
21115 |
|
21116 |
|
21117 |
|
21118 |
|
21119 |
|
21120 |
|
21121 |
|
21122 |
|
21123 |
|
21124 |
|
21125 | onresize: undefined,
|
21126 |
|
21127 | |
21128 |
|
21129 |
|
21130 |
|
21131 |
|
21132 |
|
21133 |
|
21134 |
|
21135 |
|
21136 |
|
21137 |
|
21138 |
|
21139 | onresized: undefined,
|
21140 |
|
21141 | |
21142 |
|
21143 |
|
21144 |
|
21145 |
|
21146 |
|
21147 |
|
21148 |
|
21149 |
|
21150 |
|
21151 |
|
21152 |
|
21153 | onbeforeinit: undefined,
|
21154 |
|
21155 | |
21156 |
|
21157 |
|
21158 |
|
21159 |
|
21160 |
|
21161 |
|
21162 |
|
21163 |
|
21164 |
|
21165 |
|
21166 |
|
21167 | oninit: undefined,
|
21168 |
|
21169 | |
21170 |
|
21171 |
|
21172 |
|
21173 |
|
21174 |
|
21175 |
|
21176 |
|
21177 |
|
21178 |
|
21179 |
|
21180 |
|
21181 | onafterinit: undefined,
|
21182 |
|
21183 | |
21184 |
|
21185 |
|
21186 |
|
21187 |
|
21188 |
|
21189 |
|
21190 |
|
21191 |
|
21192 |
|
21193 |
|
21194 |
|
21195 | onrendered: undefined,
|
21196 |
|
21197 | |
21198 |
|
21199 |
|
21200 |
|
21201 |
|
21202 |
|
21203 |
|
21204 |
|
21205 |
|
21206 |
|
21207 |
|
21208 |
|
21209 |
|
21210 | transition_duration: 250,
|
21211 |
|
21212 | |
21213 |
|
21214 |
|
21215 |
|
21216 |
|
21217 |
|
21218 |
|
21219 |
|
21220 |
|
21221 |
|
21222 |
|
21223 |
|
21224 | plugins: [],
|
21225 |
|
21226 | |
21227 |
|
21228 |
|
21229 |
|
21230 |
|
21231 |
|
21232 |
|
21233 |
|
21234 |
|
21235 |
|
21236 |
|
21237 |
|
21238 |
|
21239 |
|
21240 |
|
21241 |
|
21242 |
|
21243 |
|
21244 |
|
21245 |
|
21246 |
|
21247 |
|
21248 |
|
21249 |
|
21250 |
|
21251 |
|
21252 |
|
21253 |
|
21254 |
|
21255 |
|
21256 |
|
21257 |
|
21258 |
|
21259 |
|
21260 |
|
21261 |
|
21262 |
|
21263 |
|
21264 |
|
21265 |
|
21266 | render: {},
|
21267 |
|
21268 | |
21269 |
|
21270 |
|
21271 |
|
21272 |
|
21273 |
|
21274 |
|
21275 |
|
21276 |
|
21277 |
|
21278 |
|
21279 |
|
21280 |
|
21281 |
|
21282 |
|
21283 |
|
21284 |
|
21285 |
|
21286 |
|
21287 |
|
21288 |
|
21289 |
|
21290 | regions: []
|
21291 | });
|
21292 | ;
|
21293 |
|
21294 |
|
21295 |
|
21296 |
|
21297 |
|
21298 |
|
21299 |
|
21300 |
|
21301 | var data_data = ({
|
21302 | |
21303 |
|
21304 |
|
21305 |
|
21306 |
|
21307 |
|
21308 |
|
21309 |
|
21310 |
|
21311 |
|
21312 |
|
21313 |
|
21314 | data_x: undefined,
|
21315 |
|
21316 | |
21317 |
|
21318 |
|
21319 |
|
21320 |
|
21321 |
|
21322 |
|
21323 |
|
21324 |
|
21325 |
|
21326 |
|
21327 |
|
21328 |
|
21329 |
|
21330 |
|
21331 |
|
21332 |
|
21333 |
|
21334 |
|
21335 | data_idConverter: function data_idConverter(id) {
|
21336 | return id;
|
21337 | },
|
21338 |
|
21339 | |
21340 |
|
21341 |
|
21342 |
|
21343 |
|
21344 |
|
21345 |
|
21346 |
|
21347 |
|
21348 |
|
21349 |
|
21350 |
|
21351 |
|
21352 |
|
21353 |
|
21354 | data_names: {},
|
21355 |
|
21356 | |
21357 |
|
21358 |
|
21359 |
|
21360 |
|
21361 |
|
21362 |
|
21363 |
|
21364 |
|
21365 |
|
21366 |
|
21367 |
|
21368 |
|
21369 |
|
21370 |
|
21371 | data_classes: {},
|
21372 |
|
21373 | |
21374 |
|
21375 |
|
21376 |
|
21377 |
|
21378 |
|
21379 |
|
21380 |
|
21381 |
|
21382 |
|
21383 |
|
21384 |
|
21385 |
|
21386 |
|
21387 |
|
21388 |
|
21389 |
|
21390 |
|
21391 |
|
21392 |
|
21393 |
|
21394 |
|
21395 |
|
21396 |
|
21397 |
|
21398 |
|
21399 |
|
21400 |
|
21401 |
|
21402 |
|
21403 |
|
21404 |
|
21405 |
|
21406 |
|
21407 |
|
21408 |
|
21409 |
|
21410 |
|
21411 |
|
21412 |
|
21413 |
|
21414 |
|
21415 |
|
21416 |
|
21417 |
|
21418 |
|
21419 |
|
21420 |
|
21421 |
|
21422 |
|
21423 |
|
21424 |
|
21425 |
|
21426 |
|
21427 |
|
21428 |
|
21429 |
|
21430 | data_type: undefined,
|
21431 |
|
21432 | |
21433 |
|
21434 |
|
21435 |
|
21436 |
|
21437 |
|
21438 |
|
21439 |
|
21440 |
|
21441 |
|
21442 |
|
21443 |
|
21444 |
|
21445 |
|
21446 |
|
21447 |
|
21448 |
|
21449 |
|
21450 |
|
21451 |
|
21452 |
|
21453 |
|
21454 |
|
21455 |
|
21456 |
|
21457 |
|
21458 |
|
21459 |
|
21460 |
|
21461 |
|
21462 |
|
21463 |
|
21464 |
|
21465 |
|
21466 |
|
21467 |
|
21468 |
|
21469 |
|
21470 |
|
21471 |
|
21472 |
|
21473 |
|
21474 |
|
21475 |
|
21476 |
|
21477 |
|
21478 |
|
21479 | data_types: {},
|
21480 |
|
21481 | |
21482 |
|
21483 |
|
21484 |
|
21485 |
|
21486 |
|
21487 |
|
21488 |
|
21489 |
|
21490 |
|
21491 |
|
21492 |
|
21493 |
|
21494 |
|
21495 |
|
21496 |
|
21497 |
|
21498 |
|
21499 |
|
21500 |
|
21501 |
|
21502 |
|
21503 |
|
21504 |
|
21505 |
|
21506 |
|
21507 |
|
21508 |
|
21509 |
|
21510 |
|
21511 |
|
21512 |
|
21513 |
|
21514 |
|
21515 |
|
21516 |
|
21517 |
|
21518 |
|
21519 |
|
21520 |
|
21521 |
|
21522 |
|
21523 |
|
21524 |
|
21525 |
|
21526 |
|
21527 |
|
21528 |
|
21529 |
|
21530 |
|
21531 | data_order: "desc",
|
21532 |
|
21533 | |
21534 |
|
21535 |
|
21536 |
|
21537 |
|
21538 |
|
21539 |
|
21540 |
|
21541 |
|
21542 |
|
21543 |
|
21544 |
|
21545 |
|
21546 |
|
21547 | data_groups: [],
|
21548 |
|
21549 | |
21550 |
|
21551 |
|
21552 |
|
21553 |
|
21554 |
|
21555 |
|
21556 |
|
21557 |
|
21558 |
|
21559 |
|
21560 |
|
21561 |
|
21562 | data_color: undefined,
|
21563 |
|
21564 | |
21565 |
|
21566 |
|
21567 |
|
21568 |
|
21569 |
|
21570 |
|
21571 |
|
21572 |
|
21573 |
|
21574 |
|
21575 |
|
21576 |
|
21577 |
|
21578 |
|
21579 |
|
21580 |
|
21581 | data_colors: {},
|
21582 |
|
21583 | |
21584 |
|
21585 |
|
21586 |
|
21587 |
|
21588 |
|
21589 |
|
21590 |
|
21591 |
|
21592 |
|
21593 |
|
21594 |
|
21595 |
|
21596 |
|
21597 |
|
21598 |
|
21599 |
|
21600 |
|
21601 |
|
21602 |
|
21603 |
|
21604 |
|
21605 |
|
21606 |
|
21607 |
|
21608 |
|
21609 |
|
21610 |
|
21611 |
|
21612 |
|
21613 |
|
21614 |
|
21615 |
|
21616 |
|
21617 |
|
21618 |
|
21619 |
|
21620 |
|
21621 |
|
21622 |
|
21623 |
|
21624 |
|
21625 |
|
21626 |
|
21627 |
|
21628 |
|
21629 |
|
21630 |
|
21631 |
|
21632 |
|
21633 |
|
21634 |
|
21635 |
|
21636 |
|
21637 |
|
21638 |
|
21639 |
|
21640 |
|
21641 |
|
21642 |
|
21643 |
|
21644 |
|
21645 |
|
21646 |
|
21647 |
|
21648 |
|
21649 |
|
21650 |
|
21651 |
|
21652 |
|
21653 |
|
21654 |
|
21655 |
|
21656 |
|
21657 |
|
21658 |
|
21659 |
|
21660 |
|
21661 |
|
21662 |
|
21663 |
|
21664 |
|
21665 |
|
21666 |
|
21667 |
|
21668 |
|
21669 |
|
21670 |
|
21671 |
|
21672 |
|
21673 |
|
21674 |
|
21675 | data_labels: {},
|
21676 | data_labels_backgroundColors: undefined,
|
21677 | data_labels_colors: undefined,
|
21678 | data_labels_position: {},
|
21679 |
|
21680 | |
21681 |
|
21682 |
|
21683 |
|
21684 |
|
21685 |
|
21686 |
|
21687 |
|
21688 |
|
21689 |
|
21690 |
|
21691 |
|
21692 |
|
21693 |
|
21694 |
|
21695 |
|
21696 | data_hide: !1,
|
21697 |
|
21698 | |
21699 |
|
21700 |
|
21701 |
|
21702 |
|
21703 |
|
21704 |
|
21705 |
|
21706 |
|
21707 |
|
21708 |
|
21709 |
|
21710 |
|
21711 |
|
21712 |
|
21713 |
|
21714 |
|
21715 |
|
21716 | data_filter: undefined,
|
21717 |
|
21718 | |
21719 |
|
21720 |
|
21721 |
|
21722 |
|
21723 |
|
21724 |
|
21725 |
|
21726 |
|
21727 |
|
21728 |
|
21729 |
|
21730 |
|
21731 |
|
21732 |
|
21733 |
|
21734 |
|
21735 |
|
21736 |
|
21737 | data_onclick: function data_onclick() {},
|
21738 |
|
21739 | |
21740 |
|
21741 |
|
21742 |
|
21743 |
|
21744 |
|
21745 |
|
21746 |
|
21747 |
|
21748 |
|
21749 |
|
21750 |
|
21751 |
|
21752 |
|
21753 |
|
21754 |
|
21755 |
|
21756 |
|
21757 |
|
21758 | data_onover: function data_onover() {},
|
21759 |
|
21760 | |
21761 |
|
21762 |
|
21763 |
|
21764 |
|
21765 |
|
21766 |
|
21767 |
|
21768 |
|
21769 |
|
21770 |
|
21771 |
|
21772 |
|
21773 |
|
21774 |
|
21775 |
|
21776 |
|
21777 |
|
21778 |
|
21779 | data_onout: function data_onout() {},
|
21780 |
|
21781 | |
21782 |
|
21783 |
|
21784 |
|
21785 |
|
21786 |
|
21787 |
|
21788 |
|
21789 |
|
21790 |
|
21791 |
|
21792 |
|
21793 |
|
21794 |
|
21795 |
|
21796 | data_onshown: undefined,
|
21797 |
|
21798 | |
21799 |
|
21800 |
|
21801 |
|
21802 |
|
21803 |
|
21804 |
|
21805 |
|
21806 |
|
21807 |
|
21808 |
|
21809 |
|
21810 |
|
21811 |
|
21812 |
|
21813 | data_onhidden: undefined,
|
21814 |
|
21815 | |
21816 |
|
21817 |
|
21818 |
|
21819 |
|
21820 |
|
21821 |
|
21822 |
|
21823 |
|
21824 |
|
21825 |
|
21826 |
|
21827 |
|
21828 |
|
21829 | data_onmin: undefined,
|
21830 |
|
21831 | |
21832 |
|
21833 |
|
21834 |
|
21835 |
|
21836 |
|
21837 |
|
21838 |
|
21839 |
|
21840 |
|
21841 |
|
21842 |
|
21843 |
|
21844 |
|
21845 | data_onmax: undefined,
|
21846 |
|
21847 | |
21848 |
|
21849 |
|
21850 |
|
21851 |
|
21852 |
|
21853 |
|
21854 |
|
21855 |
|
21856 |
|
21857 |
|
21858 |
|
21859 | data_url: undefined,
|
21860 |
|
21861 | |
21862 |
|
21863 |
|
21864 |
|
21865 |
|
21866 |
|
21867 |
|
21868 |
|
21869 |
|
21870 |
|
21871 |
|
21872 |
|
21873 |
|
21874 |
|
21875 |
|
21876 |
|
21877 |
|
21878 | data_headers: undefined,
|
21879 |
|
21880 | |
21881 |
|
21882 |
|
21883 |
|
21884 |
|
21885 |
|
21886 |
|
21887 |
|
21888 |
|
21889 |
|
21890 |
|
21891 |
|
21892 |
|
21893 |
|
21894 |
|
21895 |
|
21896 |
|
21897 |
|
21898 |
|
21899 |
|
21900 |
|
21901 |
|
21902 | data_json: undefined,
|
21903 |
|
21904 | |
21905 |
|
21906 |
|
21907 |
|
21908 |
|
21909 |
|
21910 |
|
21911 |
|
21912 |
|
21913 |
|
21914 |
|
21915 |
|
21916 |
|
21917 |
|
21918 |
|
21919 |
|
21920 |
|
21921 |
|
21922 |
|
21923 |
|
21924 |
|
21925 |
|
21926 |
|
21927 |
|
21928 |
|
21929 |
|
21930 |
|
21931 |
|
21932 |
|
21933 |
|
21934 |
|
21935 |
|
21936 |
|
21937 |
|
21938 |
|
21939 |
|
21940 |
|
21941 |
|
21942 |
|
21943 |
|
21944 |
|
21945 |
|
21946 |
|
21947 |
|
21948 |
|
21949 |
|
21950 |
|
21951 |
|
21952 |
|
21953 |
|
21954 |
|
21955 |
|
21956 |
|
21957 |
|
21958 |
|
21959 |
|
21960 |
|
21961 |
|
21962 |
|
21963 |
|
21964 |
|
21965 |
|
21966 |
|
21967 |
|
21968 |
|
21969 |
|
21970 |
|
21971 |
|
21972 |
|
21973 |
|
21974 |
|
21975 |
|
21976 |
|
21977 |
|
21978 |
|
21979 |
|
21980 |
|
21981 |
|
21982 | data_rows: undefined,
|
21983 |
|
21984 | |
21985 |
|
21986 |
|
21987 |
|
21988 |
|
21989 |
|
21990 |
|
21991 |
|
21992 |
|
21993 |
|
21994 |
|
21995 |
|
21996 |
|
21997 |
|
21998 |
|
21999 |
|
22000 |
|
22001 |
|
22002 |
|
22003 |
|
22004 |
|
22005 |
|
22006 |
|
22007 |
|
22008 |
|
22009 |
|
22010 |
|
22011 |
|
22012 |
|
22013 |
|
22014 |
|
22015 |
|
22016 |
|
22017 |
|
22018 |
|
22019 |
|
22020 |
|
22021 |
|
22022 |
|
22023 |
|
22024 |
|
22025 |
|
22026 |
|
22027 |
|
22028 |
|
22029 |
|
22030 |
|
22031 |
|
22032 |
|
22033 |
|
22034 |
|
22035 |
|
22036 |
|
22037 |
|
22038 |
|
22039 |
|
22040 |
|
22041 |
|
22042 | data_columns: undefined,
|
22043 |
|
22044 | |
22045 |
|
22046 |
|
22047 |
|
22048 |
|
22049 |
|
22050 |
|
22051 |
|
22052 |
|
22053 |
|
22054 |
|
22055 |
|
22056 |
|
22057 |
|
22058 |
|
22059 | data_mimeType: "csv",
|
22060 |
|
22061 | |
22062 |
|
22063 |
|
22064 |
|
22065 |
|
22066 |
|
22067 |
|
22068 |
|
22069 |
|
22070 |
|
22071 |
|
22072 |
|
22073 |
|
22074 |
|
22075 |
|
22076 |
|
22077 |
|
22078 |
|
22079 |
|
22080 |
|
22081 |
|
22082 | data_keys: undefined,
|
22083 |
|
22084 | |
22085 |
|
22086 |
|
22087 |
|
22088 |
|
22089 |
|
22090 |
|
22091 |
|
22092 |
|
22093 |
|
22094 |
|
22095 |
|
22096 |
|
22097 |
|
22098 |
|
22099 |
|
22100 | data_empty_label_text: ""
|
22101 | });
|
22102 | ;
|
22103 |
|
22104 |
|
22105 |
|
22106 |
|
22107 |
|
22108 |
|
22109 |
|
22110 |
|
22111 | var common_color = ({
|
22112 | |
22113 |
|
22114 |
|
22115 |
|
22116 |
|
22117 |
|
22118 |
|
22119 |
|
22120 |
|
22121 |
|
22122 |
|
22123 |
|
22124 |
|
22125 |
|
22126 |
|
22127 |
|
22128 |
|
22129 |
|
22130 |
|
22131 |
|
22132 |
|
22133 |
|
22134 |
|
22135 |
|
22136 |
|
22137 |
|
22138 |
|
22139 |
|
22140 |
|
22141 |
|
22142 |
|
22143 |
|
22144 |
|
22145 |
|
22146 |
|
22147 |
|
22148 |
|
22149 |
|
22150 |
|
22151 |
|
22152 |
|
22153 |
|
22154 |
|
22155 |
|
22156 |
|
22157 |
|
22158 |
|
22159 |
|
22160 |
|
22161 |
|
22162 |
|
22163 |
|
22164 |
|
22165 |
|
22166 |
|
22167 |
|
22168 |
|
22169 |
|
22170 |
|
22171 |
|
22172 |
|
22173 |
|
22174 |
|
22175 |
|
22176 |
|
22177 |
|
22178 |
|
22179 |
|
22180 |
|
22181 |
|
22182 |
|
22183 |
|
22184 |
|
22185 |
|
22186 | color_pattern: [],
|
22187 | color_tiles: undefined,
|
22188 | color_threshold: {},
|
22189 | color_onover: undefined
|
22190 | });
|
22191 | ;
|
22192 |
|
22193 |
|
22194 |
|
22195 |
|
22196 |
|
22197 |
|
22198 |
|
22199 |
|
22200 | var interaction = ({
|
22201 | |
22202 |
|
22203 |
|
22204 |
|
22205 |
|
22206 |
|
22207 |
|
22208 |
|
22209 |
|
22210 |
|
22211 |
|
22212 |
|
22213 |
|
22214 |
|
22215 |
|
22216 |
|
22217 |
|
22218 |
|
22219 |
|
22220 |
|
22221 |
|
22222 |
|
22223 |
|
22224 |
|
22225 |
|
22226 |
|
22227 |
|
22228 |
|
22229 |
|
22230 |
|
22231 |
|
22232 |
|
22233 | interaction_enabled: !0,
|
22234 | interaction_brighten: !0,
|
22235 | interaction_inputType_mouse: !0,
|
22236 | interaction_inputType_touch: {}
|
22237 | });
|
22238 | ;
|
22239 |
|
22240 |
|
22241 |
|
22242 |
|
22243 |
|
22244 |
|
22245 |
|
22246 |
|
22247 | var legend = ({
|
22248 | |
22249 |
|
22250 |
|
22251 |
|
22252 |
|
22253 |
|
22254 |
|
22255 |
|
22256 |
|
22257 |
|
22258 |
|
22259 |
|
22260 |
|
22261 |
|
22262 |
|
22263 |
|
22264 |
|
22265 |
|
22266 |
|
22267 |
|
22268 |
|
22269 |
|
22270 |
|
22271 |
|
22272 |
|
22273 |
|
22274 |
|
22275 |
|
22276 |
|
22277 |
|
22278 |
|
22279 |
|
22280 |
|
22281 |
|
22282 |
|
22283 |
|
22284 |
|
22285 |
|
22286 |
|
22287 |
|
22288 |
|
22289 |
|
22290 |
|
22291 |
|
22292 |
|
22293 |
|
22294 |
|
22295 |
|
22296 |
|
22297 |
|
22298 |
|
22299 |
|
22300 |
|
22301 |
|
22302 |
|
22303 |
|
22304 |
|
22305 |
|
22306 |
|
22307 |
|
22308 |
|
22309 |
|
22310 |
|
22311 |
|
22312 |
|
22313 |
|
22314 |
|
22315 |
|
22316 |
|
22317 |
|
22318 |
|
22319 |
|
22320 |
|
22321 |
|
22322 |
|
22323 |
|
22324 |
|
22325 |
|
22326 |
|
22327 |
|
22328 |
|
22329 |
|
22330 |
|
22331 |
|
22332 |
|
22333 | legend_show: !0,
|
22334 | legend_hide: !1,
|
22335 | legend_contents_bindto: undefined,
|
22336 | legend_contents_template: undefined,
|
22337 | legend_position: "bottom",
|
22338 | legend_inset_anchor: "top-left",
|
22339 | legend_inset_x: 10,
|
22340 | legend_inset_y: 0,
|
22341 | legend_inset_step: undefined,
|
22342 | legend_item_onclick: undefined,
|
22343 | legend_item_onover: undefined,
|
22344 | legend_item_onout: undefined,
|
22345 | legend_equally: !1,
|
22346 | legend_padding: 0,
|
22347 | legend_item_tile_width: 10,
|
22348 | legend_item_tile_height: 10,
|
22349 | legend_usePoint: !1
|
22350 | });
|
22351 | ;
|
22352 |
|
22353 |
|
22354 |
|
22355 |
|
22356 |
|
22357 |
|
22358 |
|
22359 |
|
22360 | var title = ({
|
22361 | |
22362 |
|
22363 |
|
22364 |
|
22365 |
|
22366 |
|
22367 |
|
22368 |
|
22369 |
|
22370 |
|
22371 |
|
22372 |
|
22373 |
|
22374 |
|
22375 |
|
22376 |
|
22377 |
|
22378 |
|
22379 |
|
22380 |
|
22381 |
|
22382 |
|
22383 |
|
22384 |
|
22385 |
|
22386 |
|
22387 |
|
22388 |
|
22389 |
|
22390 | title_text: undefined,
|
22391 | title_padding: {
|
22392 | top: 0,
|
22393 | right: 0,
|
22394 | bottom: 0,
|
22395 | left: 0
|
22396 | },
|
22397 | title_position: "center"
|
22398 | });
|
22399 | ;
|
22400 |
|
22401 |
|
22402 |
|
22403 |
|
22404 |
|
22405 |
|
22406 |
|
22407 |
|
22408 | var tooltip = ({
|
22409 | |
22410 |
|
22411 |
|
22412 |
|
22413 |
|
22414 |
|
22415 |
|
22416 |
|
22417 |
|
22418 |
|
22419 |
|
22420 |
|
22421 |
|
22422 |
|
22423 |
|
22424 |
|
22425 |
|
22426 |
|
22427 |
|
22428 |
|
22429 |
|
22430 |
|
22431 |
|
22432 |
|
22433 |
|
22434 |
|
22435 |
|
22436 |
|
22437 |
|
22438 |
|
22439 |
|
22440 |
|
22441 |
|
22442 |
|
22443 |
|
22444 |
|
22445 |
|
22446 |
|
22447 |
|
22448 |
|
22449 |
|
22450 |
|
22451 |
|
22452 |
|
22453 |
|
22454 |
|
22455 |
|
22456 |
|
22457 |
|
22458 |
|
22459 |
|
22460 |
|
22461 |
|
22462 |
|
22463 |
|
22464 |
|
22465 |
|
22466 |
|
22467 |
|
22468 |
|
22469 |
|
22470 |
|
22471 |
|
22472 |
|
22473 |
|
22474 |
|
22475 |
|
22476 |
|
22477 |
|
22478 |
|
22479 |
|
22480 |
|
22481 |
|
22482 |
|
22483 |
|
22484 |
|
22485 |
|
22486 |
|
22487 |
|
22488 |
|
22489 |
|
22490 |
|
22491 |
|
22492 |
|
22493 |
|
22494 |
|
22495 |
|
22496 |
|
22497 |
|
22498 |
|
22499 |
|
22500 |
|
22501 |
|
22502 |
|
22503 |
|
22504 |
|
22505 |
|
22506 |
|
22507 |
|
22508 |
|
22509 |
|
22510 |
|
22511 |
|
22512 |
|
22513 |
|
22514 |
|
22515 |
|
22516 |
|
22517 |
|
22518 |
|
22519 |
|
22520 |
|
22521 |
|
22522 |
|
22523 |
|
22524 |
|
22525 |
|
22526 |
|
22527 |
|
22528 |
|
22529 |
|
22530 |
|
22531 |
|
22532 |
|
22533 |
|
22534 |
|
22535 |
|
22536 |
|
22537 |
|
22538 |
|
22539 |
|
22540 |
|
22541 |
|
22542 |
|
22543 |
|
22544 |
|
22545 |
|
22546 |
|
22547 |
|
22548 |
|
22549 |
|
22550 |
|
22551 |
|
22552 |
|
22553 |
|
22554 |
|
22555 |
|
22556 |
|
22557 |
|
22558 |
|
22559 |
|
22560 |
|
22561 |
|
22562 |
|
22563 |
|
22564 |
|
22565 |
|
22566 |
|
22567 |
|
22568 |
|
22569 |
|
22570 |
|
22571 |
|
22572 |
|
22573 |
|
22574 |
|
22575 |
|
22576 |
|
22577 |
|
22578 |
|
22579 |
|
22580 |
|
22581 |
|
22582 |
|
22583 |
|
22584 |
|
22585 |
|
22586 |
|
22587 |
|
22588 |
|
22589 |
|
22590 |
|
22591 | tooltip_show: !0,
|
22592 | tooltip_doNotHide: !1,
|
22593 | tooltip_grouped: !0,
|
22594 | tooltip_format_title: undefined,
|
22595 | tooltip_format_name: undefined,
|
22596 | tooltip_format_value: undefined,
|
22597 | tooltip_position: undefined,
|
22598 | tooltip_contents: {},
|
22599 | tooltip_init_show: !1,
|
22600 | tooltip_init_x: 0,
|
22601 | tooltip_init_position: {
|
22602 | top: "0px",
|
22603 | left: "50px"
|
22604 | },
|
22605 | tooltip_linked: !1,
|
22606 | tooltip_linked_name: "",
|
22607 | tooltip_onshow: function tooltip_onshow() {},
|
22608 | tooltip_onhide: function tooltip_onhide() {},
|
22609 | tooltip_onshown: function tooltip_onshown() {},
|
22610 | tooltip_onhidden: function tooltip_onhidden() {},
|
22611 | tooltip_order: null
|
22612 | });
|
22613 | ;
|
22614 |
|
22615 |
|
22616 | function Options_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
22617 |
|
22618 | function Options_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { Options_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { Options_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
22619 |
|
22620 |
|
22621 |
|
22622 |
|
22623 |
|
22624 |
|
22625 |
|
22626 |
|
22627 |
|
22628 |
|
22629 |
|
22630 |
|
22631 |
|
22632 |
|
22633 |
|
22634 |
|
22635 |
|
22636 |
|
22637 |
|
22638 |
|
22639 |
|
22640 | var Options = function () {
|
22641 | Options.setOptions = function setOptions(options) {
|
22642 | this.data = options.reduce(function (a, c) {
|
22643 | return Options_objectSpread(Options_objectSpread({}, a), c);
|
22644 | }, this.data);
|
22645 | };
|
22646 |
|
22647 | function Options() {
|
22648 | return deepClone(main, data_data, common_color, interaction, legend, title, tooltip, Options.data);
|
22649 | }
|
22650 |
|
22651 | return Options;
|
22652 | }();
|
22653 |
|
22654 | Options.data = {};
|
22655 |
|
22656 | ;
|
22657 |
|
22658 |
|
22659 |
|
22660 |
|
22661 |
|
22662 |
|
22663 |
|
22664 |
|
22665 |
|
22666 |
|
22667 |
|
22668 | var KEY = {
|
22669 | bubbleBaseLength: "$baseLength",
|
22670 | colorPattern: "__colorPattern__",
|
22671 | dataMinMax: "$dataMinMax",
|
22672 | dataTotalSum: "$dataTotalSum",
|
22673 | dataTotalPerIndex: "$totalPerIndex",
|
22674 | legendItemTextBox: "legendItemTextBox",
|
22675 | radarPoints: "$radarPoints",
|
22676 | setOverOut: "setOverOut",
|
22677 | callOverOutForTouch: "callOverOutForTouch",
|
22678 | textRect: "textRect"
|
22679 | };
|
22680 |
|
22681 | var Cache = function () {
|
22682 | function Cache() {
|
22683 | this.cache = {};
|
22684 | }
|
22685 |
|
22686 | var _proto = Cache.prototype;
|
22687 |
|
22688 | |
22689 |
|
22690 |
|
22691 |
|
22692 |
|
22693 |
|
22694 |
|
22695 |
|
22696 | _proto.add = function add(key, value, isDataType) {
|
22697 | if (isDataType === void 0) {
|
22698 | isDataType = !1;
|
22699 | }
|
22700 |
|
22701 | this.cache[key] = isDataType ? this.cloneTarget(value) : value;
|
22702 | return this.cache[key];
|
22703 | }
|
22704 | |
22705 |
|
22706 |
|
22707 |
|
22708 |
|
22709 | ;
|
22710 |
|
22711 | _proto.remove = function remove(key) {
|
22712 | var _this = this;
|
22713 |
|
22714 | toArray(key).forEach(function (v) {
|
22715 | return delete _this.cache[v];
|
22716 | });
|
22717 | }
|
22718 | |
22719 |
|
22720 |
|
22721 |
|
22722 |
|
22723 |
|
22724 |
|
22725 | ;
|
22726 |
|
22727 | _proto.get = function get(key, isDataType) {
|
22728 | if (isDataType === void 0) {
|
22729 | isDataType = !1;
|
22730 | }
|
22731 |
|
22732 | if (isDataType) {
|
22733 | var targets = [];
|
22734 |
|
22735 | for (var i = 0, id; id = key[i]; i++) {
|
22736 | if (id in this.cache) {
|
22737 | targets.push(this.cloneTarget(this.cache[id]));
|
22738 | }
|
22739 | }
|
22740 |
|
22741 | return targets;
|
22742 | } else {
|
22743 | var value = this.cache[key];
|
22744 | return isValue(value) ? value : null;
|
22745 | }
|
22746 | }
|
22747 | |
22748 |
|
22749 |
|
22750 |
|
22751 |
|
22752 | ;
|
22753 |
|
22754 | _proto.reset = function reset(all) {
|
22755 | var $$ = this;
|
22756 |
|
22757 | for (var x in $$.cache) {
|
22758 |
|
22759 | if (all || /^\$/.test(x)) {
|
22760 | $$.cache[x] = null;
|
22761 | }
|
22762 | }
|
22763 | }
|
22764 | |
22765 |
|
22766 |
|
22767 |
|
22768 |
|
22769 |
|
22770 |
|
22771 | ;
|
22772 |
|
22773 | _proto.cloneTarget = function cloneTarget(target) {
|
22774 | return {
|
22775 | id: target.id,
|
22776 | id_org: target.id_org,
|
22777 | values: target.values.map(function (d) {
|
22778 | return {
|
22779 | x: d.x,
|
22780 | value: d.value,
|
22781 | id: d.id
|
22782 | };
|
22783 | })
|
22784 | };
|
22785 | };
|
22786 |
|
22787 | return Cache;
|
22788 | }();
|
22789 |
|
22790 |
|
22791 | ;
|
22792 |
|
22793 |
|
22794 |
|
22795 |
|
22796 |
|
22797 |
|
22798 | var generator_setTimeout = win.setTimeout,
|
22799 | generator_clearTimeout = win.clearTimeout;
|
22800 |
|
22801 |
|
22802 |
|
22803 |
|
22804 |
|
22805 |
|
22806 | function generateResize() {
|
22807 | var fn = [],
|
22808 | timeout,
|
22809 | callResizeFn = function () {
|
22810 |
|
22811 | callResizeFn.clear();
|
22812 | timeout = generator_setTimeout(function () {
|
22813 | fn.forEach(function (f) {
|
22814 | return f();
|
22815 | });
|
22816 | }, 200);
|
22817 | };
|
22818 |
|
22819 | callResizeFn.clear = function () {
|
22820 | if (timeout) {
|
22821 | generator_clearTimeout(timeout);
|
22822 | timeout = null;
|
22823 | }
|
22824 | };
|
22825 |
|
22826 | callResizeFn.add = function (f) {
|
22827 | return fn.push(f);
|
22828 | };
|
22829 |
|
22830 | callResizeFn.remove = function (f) {
|
22831 | return fn.splice(fn.indexOf(f), 1);
|
22832 | };
|
22833 |
|
22834 | return callResizeFn;
|
22835 | }
|
22836 |
|
22837 |
|
22838 |
|
22839 |
|
22840 |
|
22841 |
|
22842 | function generateWait() {
|
22843 | var transitionsToWait = [],
|
22844 | f = function (t, callback) {
|
22845 | var timer;
|
22846 |
|
22847 | function loop() {
|
22848 | var done = 0;
|
22849 |
|
22850 | for (var i = 0, _t; _t = transitionsToWait[i]; i++) {
|
22851 | if (_t === !0 || _t.empty != null && _t.empty()) {
|
22852 | done++;
|
22853 | continue;
|
22854 | }
|
22855 |
|
22856 | try {
|
22857 | _t.transition();
|
22858 | } catch (e) {
|
22859 | done++;
|
22860 | }
|
22861 | }
|
22862 |
|
22863 | timer && generator_clearTimeout(timer);
|
22864 |
|
22865 | if (done === transitionsToWait.length) {
|
22866 | callback == null ? void 0 : callback();
|
22867 | } else {
|
22868 | timer = generator_setTimeout(loop, 50);
|
22869 | }
|
22870 | }
|
22871 |
|
22872 | loop();
|
22873 | };
|
22874 |
|
22875 | f.add = function (t) {
|
22876 | isArray(t) ? transitionsToWait = transitionsToWait.concat(t) : transitionsToWait.push(t);
|
22877 | };
|
22878 |
|
22879 | return f;
|
22880 | }
|
22881 | ;
|
22882 | var EOL = {},
|
22883 | EOF = {},
|
22884 | QUOTE = 34,
|
22885 | NEWLINE = 10,
|
22886 | RETURN = 13;
|
22887 |
|
22888 | function objectConverter(columns) {
|
22889 | return new Function("d", "return {" + columns.map(function (name, i) {
|
22890 | return JSON.stringify(name) + ": d[" + i + "] || \"\"";
|
22891 | }).join(",") + "}");
|
22892 | }
|
22893 |
|
22894 | function customConverter(columns, f) {
|
22895 | var object = objectConverter(columns);
|
22896 | return function (row, i) {
|
22897 | return f(object(row), i, columns);
|
22898 | };
|
22899 | }
|
22900 |
|
22901 |
|
22902 | function inferColumns(rows) {
|
22903 | var columnSet = Object.create(null),
|
22904 | columns = [];
|
22905 | rows.forEach(function (row) {
|
22906 | for (var column in row) {
|
22907 | if (!(column in columnSet)) {
|
22908 | columns.push(columnSet[column] = column);
|
22909 | }
|
22910 | }
|
22911 | });
|
22912 | return columns;
|
22913 | }
|
22914 |
|
22915 | function dsv_pad(value, width) {
|
22916 | var s = value + "",
|
22917 | length = s.length;
|
22918 | return length < width ? Array(width - length + 1).join(0) + s : s;
|
22919 | }
|
22920 |
|
22921 | function dsv_formatYear(year) {
|
22922 | return year < 0 ? "-" + dsv_pad(-year, 6) : year > 9999 ? "+" + dsv_pad(year, 6) : dsv_pad(year, 4);
|
22923 | }
|
22924 |
|
22925 | function formatDate(date) {
|
22926 | var hours = date.getUTCHours(),
|
22927 | minutes = date.getUTCMinutes(),
|
22928 | seconds = date.getUTCSeconds(),
|
22929 | milliseconds = date.getUTCMilliseconds();
|
22930 | 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" : "");
|
22931 | }
|
22932 |
|
22933 | function dsv(delimiter) {
|
22934 | var reFormat = new RegExp("[\"" + delimiter + "\n\r]"),
|
22935 | DELIMITER = delimiter.charCodeAt(0);
|
22936 |
|
22937 | function parseRows(text, f) {
|
22938 | var rows = [],
|
22939 |
|
22940 | N = text.length,
|
22941 | I = 0,
|
22942 |
|
22943 | n = 0,
|
22944 |
|
22945 | t,
|
22946 |
|
22947 | eof = N <= 0,
|
22948 |
|
22949 | eol = !1;
|
22950 |
|
22951 |
|
22952 | if (text.charCodeAt(N - 1) === NEWLINE) --N;
|
22953 | if (text.charCodeAt(N - 1) === RETURN) --N;
|
22954 |
|
22955 | function token() {
|
22956 | if (eof) return EOF;
|
22957 | if (eol) return eol = !1, EOL;
|
22958 |
|
22959 | var i,
|
22960 | j = I,
|
22961 | c;
|
22962 |
|
22963 | if (text.charCodeAt(j) === QUOTE) {
|
22964 | while (I++ < N && text.charCodeAt(I) !== QUOTE || text.charCodeAt(++I) === QUOTE) {}
|
22965 |
|
22966 | if ((i = I) >= N) eof = !0;else if ((c = text.charCodeAt(I++)) === NEWLINE) eol = !0;else if (c === RETURN) {
|
22967 | eol = !0;
|
22968 | if (text.charCodeAt(I) === NEWLINE) ++I;
|
22969 | }
|
22970 | return text.slice(j + 1, i - 1).replace(/""/g, "\"");
|
22971 | } // Find next delimiter or newline.
|
22972 |
|
22973 |
|
22974 | while (I < N) {
|
22975 | if ((c = text.charCodeAt(i = I++)) === NEWLINE) eol = !0;else if (c === RETURN) {
|
22976 | eol = !0;
|
22977 | if (text.charCodeAt(I) === NEWLINE) ++I;
|
22978 | } else if (c !== DELIMITER) continue;
|
22979 | return text.slice(j, i);
|
22980 | } // Return last token before EOF.
|
22981 |
|
22982 |
|
22983 | return eof = !0, text.slice(j, N);
|
22984 | }
|
22985 |
|
22986 | while ((t = token()) !== EOF) {
|
22987 | var row = [];
|
22988 |
|
22989 | while (t !== EOL && t !== EOF) {
|
22990 | row.push(t), t = token();
|
22991 | }
|
22992 |
|
22993 | if (f && (row = f(row, n++)) == null) continue;
|
22994 | rows.push(row);
|
22995 | }
|
22996 |
|
22997 | return rows;
|
22998 | }
|
22999 |
|
23000 | function preformatBody(rows, columns) {
|
23001 | return rows.map(function (row) {
|
23002 | return columns.map(function (column) {
|
23003 | return formatValue(row[column]);
|
23004 | }).join(delimiter);
|
23005 | });
|
23006 | }
|
23007 |
|
23008 | function formatRow(row) {
|
23009 | return row.map(formatValue).join(delimiter);
|
23010 | }
|
23011 |
|
23012 | function formatValue(value) {
|
23013 | return value == null ? "" : value instanceof Date ? formatDate(value) : reFormat.test(value += "") ? "\"" + value.replace(/"/g, "\"\"") + "\"" : value;
|
23014 | }
|
23015 |
|
23016 | return {
|
23017 | parse: function (text, f) {
|
23018 | var convert,
|
23019 | columns,
|
23020 | rows = parseRows(text, function (row, i) {
|
23021 | if (convert) return convert(row, i - 1);
|
23022 | columns = row, convert = f ? customConverter(row, f) : objectConverter(row);
|
23023 | });
|
23024 | rows.columns = columns || [];
|
23025 | return rows;
|
23026 | },
|
23027 | parseRows: parseRows,
|
23028 | format: function (rows, columns) {
|
23029 | if (columns == null) columns = inferColumns(rows);
|
23030 | return [columns.map(formatValue).join(delimiter)].concat(preformatBody(rows, columns)).join("\n");
|
23031 | },
|
23032 | formatBody: function (rows, columns) {
|
23033 | if (columns == null) columns = inferColumns(rows);
|
23034 | return preformatBody(rows, columns).join("\n");
|
23035 | },
|
23036 | formatRows: function (rows) {
|
23037 | return rows.map(formatRow).join("\n");
|
23038 | },
|
23039 | formatRow: formatRow,
|
23040 | formatValue: formatValue
|
23041 | };
|
23042 | }
|
23043 | ;// CONCATENATED MODULE: ./node_modules/d3-dsv/src/csv.js
|
23044 |
|
23045 | var csv = dsv(",");
|
23046 | var csvParse = csv.parse;
|
23047 | var csvParseRows = csv.parseRows;
|
23048 | var csvFormat = csv.format;
|
23049 | var csvFormatBody = csv.formatBody;
|
23050 | var csvFormatRows = csv.formatRows;
|
23051 | var csvFormatRow = csv.formatRow;
|
23052 | var csvFormatValue = csv.formatValue;
|
23053 | ;// CONCATENATED MODULE: ./node_modules/d3-dsv/src/tsv.js
|
23054 |
|
23055 | var tsv = dsv("\t");
|
23056 | var tsvParse = tsv.parse;
|
23057 | var tsvParseRows = tsv.parseRows;
|
23058 | var tsvFormat = tsv.format;
|
23059 | var tsvFormatBody = tsv.formatBody;
|
23060 | var tsvFormatRows = tsv.formatRows;
|
23061 | var tsvFormatRow = tsv.formatRow;
|
23062 | var tsvFormatValue = tsv.formatValue;
|
23063 | ;// CONCATENATED MODULE: ./src/ChartInternal/data/convert.ts
|
23064 | /**
|
23065 | * Copyright (c) 2017 ~ present NAVER Corp.
|
23066 | * billboard.js project is licensed under the MIT license
|
23067 | */
|
23068 |
|
23069 |
|
23070 | /**
|
23071 | * Data convert
|
23072 | * @memberof ChartInternal
|
23073 | * @private
|
23074 | */
|
23075 |
|
23076 | /* harmony default export */ var convert = ({
|
23077 | /**
|
23078 | * Convert data according its type
|
23079 | * @param {object} args data object
|
23080 | * @param {Function} [callback] callback for url(XHR) type loading
|
23081 | * @returns {object}
|
23082 | * @private
|
23083 | */
|
23084 | convertData: function convertData(args, callback) {
|
23085 | var data;
|
23086 |
|
23087 | if (args.bindto) {
|
23088 | data = {};
|
23089 | ["url", "mimeType", "headers", "keys", "json", "keys", "rows", "columns"].forEach(function (v) {
|
23090 | var key = "data_" + v;
|
23091 |
|
23092 | if (key in args) {
|
23093 | data[v] = args[key];
|
23094 | }
|
23095 | });
|
23096 | } else {
|
23097 | data = args;
|
23098 | }
|
23099 |
|
23100 | if (data.url && callback) {
|
23101 | this.convertUrlToData(data.url, data.mimeType, data.headers, data.keys, callback);
|
23102 | } else if (data.json) {
|
23103 | data = this.convertJsonToData(data.json, data.keys);
|
23104 | } else if (data.rows) {
|
23105 | data = this.convertRowsToData(data.rows);
|
23106 | } else if (data.columns) {
|
23107 | data = this.convertColumnsToData(data.columns);
|
23108 | } else if (args.bindto) {
|
23109 | throw Error("url or json or rows or columns is required.");
|
23110 | }
|
23111 |
|
23112 | return isArray(data) && data;
|
23113 | },
|
23114 |
|
23115 | /**
|
23116 | * Convert URL data
|
23117 | * @param {string} url Remote URL
|
23118 | * @param {string} mimeType MIME type string: json | csv | tsv
|
23119 | * @param {object} headers Header object
|
23120 | * @param {object} keys Key object
|
23121 | * @param {Function} done Callback function
|
23122 | * @private
|
23123 | */
|
23124 | convertUrlToData: function convertUrlToData(url, mimeType, headers, keys, done) {
|
23125 | var _this = this;
|
23126 |
|
23127 | if (mimeType === void 0) {
|
23128 | mimeType = "csv";
|
23129 | }
|
23130 |
|
23131 | var req = new XMLHttpRequest();
|
23132 | req.open("GET", url);
|
23133 |
|
23134 | if (headers) {
|
23135 | Object.keys(headers).forEach(function (key) {
|
23136 | req.setRequestHeader(key, headers[key]);
|
23137 | });
|
23138 | }
|
23139 |
|
23140 | req.onreadystatechange = function () {
|
23141 | if (req.readyState === 4) {
|
23142 | if (req.status === 200) {
|
23143 | var response = req.responseText;
|
23144 | response && done.call(_this, _this["convert" + capitalize(mimeType) + "ToData"](mimeType === "json" ? JSON.parse(response) : response, keys));
|
23145 | } else {
|
23146 | throw new Error(url + ": Something went wrong loading!");
|
23147 | }
|
23148 | }
|
23149 | };
|
23150 |
|
23151 | req.send();
|
23152 | },
|
23153 |
|
23154 | /**
|
23155 | * Convert CSV/TSV data
|
23156 | * @param {object} parser Parser object
|
23157 | * @param {object} xsv Data
|
23158 | * @private
|
23159 | * @returns {object}
|
23160 | */
|
23161 | convertCsvTsvToData: function convertCsvTsvToData(parser, xsv) {
|
23162 | var rows = parser.rows(xsv),
|
23163 | d;
|
23164 |
|
23165 | if (rows.length === 1) {
|
23166 | d = [{}];
|
23167 | rows[0].forEach(function (id) {
|
23168 | d[0][id] = null;
|
23169 | });
|
23170 | } else {
|
23171 | d = parser.parse(xsv);
|
23172 | }
|
23173 |
|
23174 | return d;
|
23175 | },
|
23176 | convertCsvToData: function convertCsvToData(xsv) {
|
23177 | return this.convertCsvTsvToData({
|
23178 | rows: csvParseRows,
|
23179 | parse: csvParse
|
23180 | }, xsv);
|
23181 | },
|
23182 | convertTsvToData: function convertTsvToData(tsv) {
|
23183 | return this.convertCsvTsvToData({
|
23184 | rows: tsvParseRows,
|
23185 | parse: tsvParse
|
23186 | }, tsv);
|
23187 | },
|
23188 | convertJsonToData: function convertJsonToData(json, keysParam) {
|
23189 | var _this2 = this,
|
23190 | config = this.config,
|
23191 | newRows = [],
|
23192 | targetKeys,
|
23193 | data;
|
23194 |
|
23195 | if (isArray(json)) {
|
23196 | var keys = keysParam || config.data_keys;
|
23197 |
|
23198 | if (keys.x) {
|
23199 | targetKeys = keys.value.concat(keys.x);
|
23200 | config.data_x = keys.x;
|
23201 | } else {
|
23202 | targetKeys = keys.value;
|
23203 | }
|
23204 |
|
23205 | newRows.push(targetKeys);
|
23206 | json.forEach(function (o) {
|
23207 | var newRow = targetKeys.map(function (key) {
|
23208 | // convert undefined to null because undefined data will be removed in convertDataToTargets()
|
23209 | var v = _this2.findValueInJson(o, key);
|
23210 |
|
23211 | if (isUndefined(v)) {
|
23212 | v = null;
|
23213 | }
|
23214 |
|
23215 | return v;
|
23216 | });
|
23217 | newRows.push(newRow);
|
23218 | });
|
23219 | data = this.convertRowsToData(newRows);
|
23220 | } else {
|
23221 | Object.keys(json).forEach(function (key) {
|
23222 | var tmp = json[key].concat();
|
23223 | tmp.unshift(key);
|
23224 | newRows.push(tmp);
|
23225 | });
|
23226 | data = this.convertColumnsToData(newRows);
|
23227 | }
|
23228 |
|
23229 | return data;
|
23230 | },
|
23231 | findValueInJson: function findValueInJson(object, path) {
|
23232 | if (object[path] !== undefined) {
|
23233 | return object[path];
|
23234 | }
|
23235 |
|
23236 | var convertedPath = path.replace(/\[(\w+)\]/g, ".$1"),
|
23237 | pathArray = convertedPath.replace(/^\./, "").split("."),
|
23238 | target = object; // convert indexes to properties (replace [] with .)
|
23239 |
|
23240 | pathArray.some(function (k) {
|
23241 | return !(target = target && k in target ? target[k] : undefined);
|
23242 | });
|
23243 | return target;
|
23244 | },
|
23245 | convertRowsToData: function convertRowsToData(rows) {
|
23246 | var keys = rows[0],
|
23247 | newRows = [];
|
23248 | rows.forEach(function (row, i) {
|
23249 | if (i > 0) {
|
23250 | var newRow = {};
|
23251 | row.forEach(function (v, j) {
|
23252 | if (isUndefined(v)) {
|
23253 | throw new Error("Source data is missing a component at (" + i + ", " + j + ")!");
|
23254 | }
|
23255 |
|
23256 | newRow[keys[j]] = v;
|
23257 | });
|
23258 | newRows.push(newRow);
|
23259 | }
|
23260 | });
|
23261 | return newRows;
|
23262 | },
|
23263 | convertColumnsToData: function convertColumnsToData(columns) {
|
23264 | var newRows = [];
|
23265 | columns.forEach(function (col, i) {
|
23266 | var key = col[0];
|
23267 | col.forEach(function (v, j) {
|
23268 | if (j > 0) {
|
23269 | if (isUndefined(newRows[j - 1])) {
|
23270 | newRows[j - 1] = {};
|
23271 | }
|
23272 |
|
23273 | if (isUndefined(v)) {
|
23274 | throw new Error("Source data is missing a component at (" + i + ", " + j + ")!");
|
23275 | }
|
23276 |
|
23277 | newRows[j - 1][key] = v;
|
23278 | }
|
23279 | });
|
23280 | });
|
23281 | return newRows;
|
23282 | },
|
23283 | convertDataToTargets: function convertDataToTargets(data, appendXs) {
|
23284 | var _this3 = this,
|
23285 | $$ = this,
|
23286 | axis = $$.axis,
|
23287 | config = $$.config,
|
23288 | state = $$.state,
|
23289 | isCategorized = !1,
|
23290 | isTimeSeries = !1,
|
23291 | isCustomX = !1;
|
23292 |
|
23293 | if (axis) {
|
23294 | isCategorized = axis.isCategorized();
|
23295 | isTimeSeries = axis.isTimeSeries();
|
23296 | isCustomX = axis.isCustomX();
|
23297 | }
|
23298 |
|
23299 | var dataKeys = Object.keys(data[0] || {}),
|
23300 | ids = dataKeys.length ? dataKeys.filter($$.isNotX, $$) : [],
|
23301 | xs = dataKeys.length ? dataKeys.filter($$.isX, $$) : [],
|
23302 | xsData;
|
23303 | // save x for update data by load when custom x and bb.x API
|
23304 | ids.forEach(function (id) {
|
23305 | var xKey = _this3.getXKey(id);
|
23306 |
|
23307 | if (isCustomX || isTimeSeries) {
|
23308 | // if included in input data
|
23309 | if (xs.indexOf(xKey) >= 0) {
|
23310 | xsData = (appendXs && $$.data.xs[id] || []).concat(data.map(function (d) {
|
23311 | return d[xKey];
|
23312 | }).filter(isValue).map(function (rawX, i) {
|
23313 | return $$.generateTargetX(rawX, id, i);
|
23314 | }));
|
23315 | } else if (config.data_x) {
|
23316 | // if not included in input data, find from preloaded data of other id's x
|
23317 | xsData = _this3.getOtherTargetXs();
|
23318 | } else if (notEmpty(config.data_xs)) {
|
23319 | // if not included in input data, find from preloaded data
|
23320 | xsData = $$.getXValuesOfXKey(xKey, $$.data.targets);
|
23321 | } // MEMO: if no x included, use same x of current will be used
|
23322 |
|
23323 | } else {
|
23324 | xsData = data.map(function (d, i) {
|
23325 | return i;
|
23326 | });
|
23327 | }
|
23328 |
|
23329 | xsData && (_this3.data.xs[id] = xsData);
|
23330 | }); // check x is defined
|
23331 |
|
23332 | ids.forEach(function (id) {
|
23333 | if (!_this3.data.xs[id]) {
|
23334 | throw new Error("x is not defined for id = \"" + id + "\".");
|
23335 | }
|
23336 | }); // convert to target
|
23337 |
|
23338 | var targets = ids.map(function (id, index) {
|
23339 | var convertedId = config.data_idConverter.bind($$.api)(id),
|
23340 | xKey = $$.getXKey(id),
|
23341 | isCategory = isCustomX && isCategorized,
|
23342 | hasCategory = isCategory && data.map(function (v) {
|
23343 | return v.x;
|
23344 | }).every(function (v) {
|
23345 | return config.axis_x_categories.indexOf(v) > -1;
|
23346 | }),
|
23347 | isDataAppend = data.__append__,
|
23348 | xIndex = xKey === null && isDataAppend ? $$.api.data.values(id).length : 0;
|
23349 | return {
|
23350 | id: convertedId,
|
23351 | id_org: id,
|
23352 | values: data.map(function (d, i) {
|
23353 | var rawX = d[xKey],
|
23354 | value = d[id],
|
23355 | x;
|
23356 | value = value !== null && !isNaN(value) && !isObject(value) ? +value : isArray(value) || isObject(value) ? value : null; // use x as categories if custom x and categorized
|
23357 |
|
23358 | if ((isCategory || state.hasRadar) && index === 0 && !isUndefined(rawX)) {
|
23359 | if (!hasCategory && index === 0 && i === 0 && !isDataAppend) {
|
23360 | config.axis_x_categories = [];
|
23361 | }
|
23362 |
|
23363 | x = config.axis_x_categories.indexOf(rawX);
|
23364 |
|
23365 | if (x === -1) {
|
23366 | x = config.axis_x_categories.length;
|
23367 | config.axis_x_categories.push(rawX);
|
23368 | }
|
23369 | } else {
|
23370 | x = $$.generateTargetX(rawX, id, xIndex + i);
|
23371 | } // mark as x = undefined if value is undefined and filter to remove after mapped
|
23372 |
|
23373 |
|
23374 | if (isUndefined(value) || $$.data.xs[id].length <= i) {
|
23375 | x = undefined;
|
23376 | }
|
23377 |
|
23378 | return {
|
23379 | x: x,
|
23380 | value: value,
|
23381 | id: convertedId
|
23382 | };
|
23383 | }).filter(function (v) {
|
23384 | return isDefined(v.x);
|
23385 | })
|
23386 | };
|
23387 | }); // finish targets
|
23388 |
|
23389 | targets.forEach(function (t) {
|
23390 | // sort values by its x
|
23391 | if (config.data_xSort) {
|
23392 | t.values = t.values.sort(function (v1, v2) {
|
23393 | var x1 = v1.x || v1.x === 0 ? v1.x : Infinity,
|
23394 | x2 = v2.x || v2.x === 0 ? v2.x : Infinity;
|
23395 | return x1 - x2;
|
23396 | });
|
23397 | } // indexing each value
|
23398 |
|
23399 |
|
23400 | t.values.forEach(function (v, i) {
|
23401 | return v.index = i;
|
23402 | }); // this needs to be sorted because its index and value.index is identical
|
23403 |
|
23404 | $$.data.xs[t.id].sort(function (v1, v2) {
|
23405 | return v1 - v2;
|
23406 | });
|
23407 | }); // cache information about values
|
23408 |
|
23409 | state.hasNegativeValue = $$.hasNegativeValueInTargets(targets);
|
23410 | state.hasPositiveValue = $$.hasPositiveValueInTargets(targets); // set target types
|
23411 |
|
23412 | if (config.data_type) {
|
23413 | $$.setTargetType($$.mapToIds(targets).filter(function (id) {
|
23414 | return !(id in config.data_types);
|
23415 | }), config.data_type);
|
23416 | } // cache as original id keyed
|
23417 |
|
23418 |
|
23419 | targets.forEach(function (d) {
|
23420 | return $$.cache.add(d.id_org, d, !0);
|
23421 | });
|
23422 | return targets;
|
23423 | }
|
23424 | });
|
23425 | ;// CONCATENATED MODULE: ./src/ChartInternal/data/data.ts
|
23426 | /**
|
23427 | * Copyright (c) 2017 ~ present NAVER Corp.
|
23428 | * billboard.js project is licensed under the MIT license
|
23429 | */
|
23430 |
|
23431 |
|
23432 |
|
23433 | /* harmony default export */ var ChartInternal_data_data = ({
|
23434 | isX: function isX(key) {
|
23435 | var $$ = this,
|
23436 | config = $$.config,
|
23437 | dataKey = config.data_x && key === config.data_x,
|
23438 | existValue = notEmpty(config.data_xs) && hasValue(config.data_xs, key);
|
23439 | return dataKey || existValue;
|
23440 | },
|
23441 | isNotX: function isNotX(key) {
|
23442 | return !this.isX(key);
|
23443 | },
|
23444 | isStackNormalized: function isStackNormalized() {
|
23445 | var config = this.config;
|
23446 | return !!(config.data_stack_normalize && config.data_groups.length);
|
23447 | },
|
23448 | isGrouped: function isGrouped(id) {
|
23449 | var groups = this.config.data_groups;
|
23450 | return id ? groups.some(function (v) {
|
23451 | return v.indexOf(id) >= 0 && v.length > 1;
|
23452 | }) : groups.length > 0;
|
23453 | },
|
23454 | getXKey: function getXKey(id) {
|
23455 | var $$ = this,
|
23456 | config = $$.config;
|
23457 | return config.data_x ? config.data_x : notEmpty(config.data_xs) ? config.data_xs[id] : null;
|
23458 | },
|
23459 | getXValuesOfXKey: function getXValuesOfXKey(key, targets) {
|
23460 | var $$ = this,
|
23461 | ids = targets && notEmpty(targets) ? $$.mapToIds(targets) : [],
|
23462 | xValues;
|
23463 | ids.forEach(function (id) {
|
23464 | if ($$.getXKey(id) === key) {
|
23465 | xValues = $$.data.xs[id];
|
23466 | }
|
23467 | });
|
23468 | return xValues;
|
23469 | },
|
23470 |
|
23471 | /**
|
23472 | * Get index number based on given x Axis value
|
23473 | * @param {Date|number|string} x x Axis to be compared
|
23474 | * @param {Array} basedX x Axis list to be based on
|
23475 | * @returns {number} index number
|
23476 | * @private
|
23477 | */
|
23478 | getIndexByX: function getIndexByX(x, basedX) {
|
23479 | var $$ = this;
|
23480 | return basedX ? basedX.indexOf(isString(x) ? x : +x) : ($$.filterByX($$.data.targets, x)[0] || {
|
23481 | index: null
|
23482 | }).index;
|
23483 | },
|
23484 | getXValue: function getXValue(id, i) {
|
23485 | var $$ = this;
|
23486 | return id in $$.data.xs && $$.data.xs[id] && isValue($$.data.xs[id][i]) ? $$.data.xs[id][i] : i;
|
23487 | },
|
23488 | getOtherTargetXs: function getOtherTargetXs() {
|
23489 | var $$ = this,
|
23490 | idsForX = Object.keys($$.data.xs);
|
23491 | return idsForX.length ? $$.data.xs[idsForX[0]] : null;
|
23492 | },
|
23493 | getOtherTargetX: function getOtherTargetX(index) {
|
23494 | var xs = this.getOtherTargetXs();
|
23495 | return xs && index < xs.length ? xs[index] : null;
|
23496 | },
|
23497 | addXs: function addXs(xs) {
|
23498 | var $$ = this,
|
23499 | config = $$.config;
|
23500 | Object.keys(xs).forEach(function (id) {
|
23501 | config.data_xs[id] = xs[id];
|
23502 | });
|
23503 | },
|
23504 | isMultipleX: function isMultipleX() {
|
23505 | return notEmpty(this.config.data_xs) || !this.config.data_xSort || this.hasType("bubble") || this.hasType("scatter");
|
23506 | },
|
23507 | addName: function addName(data) {
|
23508 | var $$ = this,
|
23509 | config = $$.config,
|
23510 | name;
|
23511 |
|
23512 | if (data) {
|
23513 | name = config.data_names[data.id];
|
23514 | data.name = name !== undefined ? name : data.id;
|
23515 | }
|
23516 |
|
23517 | return data;
|
23518 | },
|
23519 |
|
23520 | /**
|
23521 | * Get all values on given index
|
23522 | * @param {number} index Index
|
23523 | * @param {boolean} filterNull Filter nullish value
|
23524 | * @returns {Array}
|
23525 | * @private
|
23526 | */
|
23527 | getAllValuesOnIndex: function getAllValuesOnIndex(index, filterNull) {
|
23528 | if (filterNull === void 0) {
|
23529 | filterNull = !1;
|
23530 | }
|
23531 |
|
23532 | var $$ = this,
|
23533 | value = $$.filterTargetsToShow($$.data.targets).map(function (t) {
|
23534 | return $$.addName($$.getValueOnIndex(t.values, index));
|
23535 | });
|
23536 |
|
23537 | if (filterNull) {
|
23538 | value = value.filter(function (v) {
|
23539 | return isValue(v.value);
|
23540 | });
|
23541 | }
|
23542 |
|
23543 | return value;
|
23544 | },
|
23545 | getValueOnIndex: function getValueOnIndex(values, index) {
|
23546 | var valueOnIndex = values.filter(function (v) {
|
23547 | return v.index === index;
|
23548 | });
|
23549 | return valueOnIndex.length ? valueOnIndex[0] : null;
|
23550 | },
|
23551 | updateTargetX: function updateTargetX(targets, x) {
|
23552 | var $$ = this;
|
23553 | targets.forEach(function (t) {
|
23554 | t.values.forEach(function (v, i) {
|
23555 | v.x = $$.generateTargetX(x[i], t.id, i);
|
23556 | });
|
23557 | $$.data.xs[t.id] = x;
|
23558 | });
|
23559 | },
|
23560 | updateTargetXs: function updateTargetXs(targets, xs) {
|
23561 | var $$ = this;
|
23562 | targets.forEach(function (t) {
|
23563 | xs[t.id] && $$.updateTargetX([t], xs[t.id]);
|
23564 | });
|
23565 | },
|
23566 | generateTargetX: function generateTargetX(rawX, id, index) {
|
23567 | var _axis,
|
23568 | $$ = this,
|
23569 | axis = $$.axis,
|
23570 | x = (_axis = axis) != null && _axis.isCategorized() ? index : rawX || index,
|
23571 | _axis2,
|
23572 | _axis3,
|
23573 | _axis4;
|
23574 |
|
23575 | if ((_axis2 = axis) != null && _axis2.isTimeSeries()) {
|
23576 | var fn = parseDate.bind($$);
|
23577 | x = rawX ? fn(rawX) : fn($$.getXValue(id, index));
|
23578 | } else if ((_axis3 = axis) != null && _axis3.isCustomX() && !((_axis4 = axis) != null && _axis4.isCategorized())) {
|
23579 | x = isValue(rawX) ? +rawX : $$.getXValue(id, index);
|
23580 | }
|
23581 |
|
23582 | return x;
|
23583 | },
|
23584 | updateXs: function updateXs(values) {
|
23585 | if (values.length) {
|
23586 | this.axis.xs = values.map(function (v) {
|
23587 | return v.x;
|
23588 | });
|
23589 | }
|
23590 | },
|
23591 | getPrevX: function getPrevX(i) {
|
23592 | var x = this.axis.xs[i - 1];
|
23593 | return isDefined(x) ? x : null;
|
23594 | },
|
23595 | getNextX: function getNextX(i) {
|
23596 | var x = this.axis.xs[i + 1];
|
23597 | return isDefined(x) ? x : null;
|
23598 | },
|
23599 |
|
23600 | /**
|
23601 | * Get base value isAreaRangeType
|
23602 | * @param {object} data Data object
|
23603 | * @returns {number}
|
23604 | * @private
|
23605 | */
|
23606 | getBaseValue: function getBaseValue(data) {
|
23607 | var $$ = this,
|
23608 | hasAxis = $$.state.hasAxis,
|
23609 | value = data.value;
|
23610 |
|
23611 | // In case of area-range, data is given as: [low, mid, high] or {low, mid, high}
|
23612 | // will take the 'mid' as the base value
|
23613 | if (value && hasAxis) {
|
23614 | if ($$.isAreaRangeType(data)) {
|
23615 | value = $$.getRangedData(data, "mid");
|
23616 | } else if ($$.isBubbleZType(data)) {
|
23617 | value = $$.getBubbleZData(value, "y");
|
23618 | }
|
23619 | }
|
23620 |
|
23621 | return value;
|
23622 | },
|
23623 |
|
23624 | /**
|
23625 | * Get min/max value from the data
|
23626 | * @private
|
23627 | * @param {Array} data array data to be evaluated
|
23628 | * @returns {{min: {number}, max: {number}}}
|
23629 | */
|
23630 | getMinMaxValue: function getMinMaxValue(data) {
|
23631 | var getBaseValue = this.getBaseValue.bind(this),
|
23632 | min,
|
23633 | max;
|
23634 | (data || this.data.targets.map(function (t) {
|
23635 | return t.values;
|
23636 | })).forEach(function (v, i) {
|
23637 | var value = v.map(getBaseValue).filter(isNumber);
|
23638 | min = Math.min.apply(Math, [i ? min : Infinity].concat(value));
|
23639 | max = Math.max.apply(Math, [i ? max : -Infinity].concat(value));
|
23640 | });
|
23641 | return {
|
23642 | min: min,
|
23643 | max: max
|
23644 | };
|
23645 | },
|
23646 |
|
23647 | /**
|
23648 | * Get the min/max data
|
23649 | * @private
|
23650 | * @returns {{min: Array, max: Array}}
|
23651 | */
|
23652 | getMinMaxData: function getMinMaxData() {
|
23653 | var $$ = this,
|
23654 | cacheKey = KEY.dataMinMax,
|
23655 | minMaxData = $$.cache.get(cacheKey);
|
23656 |
|
23657 | if (!minMaxData) {
|
23658 | var data = $$.data.targets.map(function (t) {
|
23659 | return t.values;
|
23660 | }),
|
23661 | minMax = $$.getMinMaxValue(data),
|
23662 | min = [],
|
23663 | max = [];
|
23664 | data.forEach(function (v) {
|
23665 | var minData = $$.getFilteredDataByValue(v, minMax.min),
|
23666 | maxData = $$.getFilteredDataByValue(v, minMax.max);
|
23667 |
|
23668 | if (minData.length) {
|
23669 | min = min.concat(minData);
|
23670 | }
|
23671 |
|
23672 | if (maxData.length) {
|
23673 | max = max.concat(maxData);
|
23674 | }
|
23675 | }); // update the cached data
|
23676 |
|
23677 | $$.cache.add(cacheKey, minMaxData = {
|
23678 | min: min,
|
23679 | max: max
|
23680 | });
|
23681 | }
|
23682 |
|
23683 | return minMaxData;
|
23684 | },
|
23685 |
|
23686 | /**
|
23687 | * Get sum of data per index
|
23688 | * @private
|
23689 | * @returns {Array}
|
23690 | */
|
23691 | getTotalPerIndex: function getTotalPerIndex() {
|
23692 | var $$ = this,
|
23693 | cacheKey = KEY.dataTotalPerIndex,
|
23694 | sum = $$.cache.get(cacheKey);
|
23695 |
|
23696 | if ($$.isStackNormalized() && !sum) {
|
23697 | sum = [];
|
23698 | $$.data.targets.forEach(function (row) {
|
23699 | row.values.forEach(function (v, i) {
|
23700 | if (!sum[i]) {
|
23701 | sum[i] = 0;
|
23702 | }
|
23703 |
|
23704 | sum[i] += isNumber(v.value) ? v.value : 0;
|
23705 | });
|
23706 | });
|
23707 | }
|
23708 |
|
23709 | return sum;
|
23710 | },
|
23711 |
|
23712 | /**
|
23713 | * Get total data sum
|
23714 | * @param {boolean} subtractHidden Subtract hidden data from total
|
23715 | * @returns {number}
|
23716 | * @private
|
23717 | */
|
23718 | getTotalDataSum: function getTotalDataSum(subtractHidden) {
|
23719 | var $$ = this,
|
23720 | cacheKey = KEY.dataTotalSum,
|
23721 | total = $$.cache.get(cacheKey);
|
23722 |
|
23723 | if (!isNumber(total)) {
|
23724 | var sum = mergeArray($$.data.targets.map(function (t) {
|
23725 | return t.values;
|
23726 | })).map(function (v) {
|
23727 | return v.value;
|
23728 | }).reduce(function (p, c) {
|
23729 | return p + c;
|
23730 | });
|
23731 | $$.cache.add(cacheKey, total = sum);
|
23732 | }
|
23733 |
|
23734 | if (subtractHidden) {
|
23735 | total -= $$.getHiddenTotalDataSum();
|
23736 | }
|
23737 |
|
23738 | return total;
|
23739 | },
|
23740 |
|
23741 | /**
|
23742 | * Get total hidden data sum
|
23743 | * @returns {number}
|
23744 | * @private
|
23745 | */
|
23746 | getHiddenTotalDataSum: function getHiddenTotalDataSum() {
|
23747 | var $$ = this,
|
23748 | api = $$.api,
|
23749 | hiddenTargetIds = $$.state.hiddenTargetIds,
|
23750 | total = 0;
|
23751 |
|
23752 | if (hiddenTargetIds.length) {
|
23753 | total = api.data.values.bind(api)(hiddenTargetIds).reduce(function (p, c) {
|
23754 | return p + c;
|
23755 | });
|
23756 | }
|
23757 |
|
23758 | return total;
|
23759 | },
|
23760 |
|
23761 | /**
|
23762 | * Get filtered data by value
|
23763 | * @param {object} data Data
|
23764 | * @param {number} value Value to be filtered
|
23765 | * @returns {Array} filtered array data
|
23766 | * @private
|
23767 | */
|
23768 | getFilteredDataByValue: function getFilteredDataByValue(data, value) {
|
23769 | var _this = this;
|
23770 |
|
23771 | return data.filter(function (t) {
|
23772 | return _this.getBaseValue(t) === value;
|
23773 | });
|
23774 | },
|
23775 |
|
23776 | /**
|
23777 | * Return the max length of the data
|
23778 | * @returns {number} max data length
|
23779 | * @private
|
23780 | */
|
23781 | getMaxDataCount: function getMaxDataCount() {
|
23782 | return Math.max.apply(Math, this.data.targets.map(function (t) {
|
23783 | return t.values.length;
|
23784 | }));
|
23785 | },
|
23786 | getMaxDataCountTarget: function getMaxDataCountTarget() {
|
23787 | var target = this.filterTargetsToShow() || [],
|
23788 | length = target.length;
|
23789 |
|
23790 | if (length > 1) {
|
23791 | target = target.map(function (t) {
|
23792 | return t.values;
|
23793 | }).reduce(function (a, b) {
|
23794 | return a.concat(b);
|
23795 | }).map(function (v) {
|
23796 | return v.x;
|
23797 | });
|
23798 | target = sortValue(getUnique(target)).map(function (x, index) {
|
23799 | return {
|
23800 | x: x,
|
23801 | index: index
|
23802 | };
|
23803 | });
|
23804 | } else if (length) {
|
23805 | target = target[0].values;
|
23806 | }
|
23807 |
|
23808 | return target;
|
23809 | },
|
23810 | mapToIds: function mapToIds(targets) {
|
23811 | return targets.map(function (d) {
|
23812 | return d.id;
|
23813 | });
|
23814 | },
|
23815 | mapToTargetIds: function mapToTargetIds(ids) {
|
23816 | var $$ = this;
|
23817 | return ids ? isArray(ids) ? ids.concat() : [ids] : $$.mapToIds($$.data.targets);
|
23818 | },
|
23819 | hasTarget: function hasTarget(targets, id) {
|
23820 | var ids = this.mapToIds(targets);
|
23821 |
|
23822 | for (var i = 0, val; val = ids[i]; i++) {
|
23823 | if (val === id) {
|
23824 | return !0;
|
23825 | }
|
23826 | }
|
23827 |
|
23828 | return !1;
|
23829 | },
|
23830 | isTargetToShow: function isTargetToShow(targetId) {
|
23831 | return this.state.hiddenTargetIds.indexOf(targetId) < 0;
|
23832 | },
|
23833 | isLegendToShow: function isLegendToShow(targetId) {
|
23834 | return this.state.hiddenLegendIds.indexOf(targetId) < 0;
|
23835 | },
|
23836 | filterTargetsToShow: function filterTargetsToShow(targets) {
|
23837 | var $$ = this;
|
23838 | return (targets || $$.data.targets).filter(function (t) {
|
23839 | return $$.isTargetToShow(t.id);
|
23840 | });
|
23841 | },
|
23842 | mapTargetsToUniqueXs: function mapTargetsToUniqueXs(targets) {
|
23843 | var $$ = this,
|
23844 | axis = $$.axis,
|
23845 | xs = [];
|
23846 |
|
23847 | if (targets != null && targets.length) {
|
23848 | var _axis5;
|
23849 |
|
23850 | xs = getUnique(mergeArray(targets.map(function (t) {
|
23851 | return t.values.map(function (v) {
|
23852 | return +v.x;
|
23853 | });
|
23854 | })));
|
23855 | xs = (_axis5 = axis) != null && _axis5.isTimeSeries() ? xs.map(function (x) {
|
23856 | return new Date(+x);
|
23857 | }) : xs.map(Number);
|
23858 | }
|
23859 |
|
23860 | return sortValue(xs);
|
23861 | },
|
23862 |
|
23863 | /**
|
23864 | * Add to the state target Ids
|
23865 | * @param {string} type State's prop name
|
23866 | * @param {Array|string} targetIds Target ids array
|
23867 | * @private
|
23868 | */
|
23869 | addTargetIds: function addTargetIds(type, targetIds) {
|
23870 | var state = this.state,
|
23871 | ids = isArray(targetIds) ? targetIds : [targetIds];
|
23872 | ids.forEach(function (v) {
|
23873 | state[type].indexOf(v) < 0 && state[type].push(v);
|
23874 | });
|
23875 | },
|
23876 |
|
23877 | /**
|
23878 | * Remove from the state target Ids
|
23879 | * @param {string} type State's prop name
|
23880 | * @param {Array|string} targetIds Target ids array
|
23881 | * @private
|
23882 | */
|
23883 | removeTargetIds: function removeTargetIds(type, targetIds) {
|
23884 | var state = this.state,
|
23885 | ids = isArray(targetIds) ? targetIds : [targetIds];
|
23886 | ids.forEach(function (v) {
|
23887 | var index = state[type].indexOf(v);
|
23888 | index >= 0 && state[type].splice(index, 1);
|
23889 | });
|
23890 | },
|
23891 | addHiddenTargetIds: function addHiddenTargetIds(targetIds) {
|
23892 | this.addTargetIds("hiddenTargetIds", targetIds);
|
23893 | },
|
23894 | removeHiddenTargetIds: function removeHiddenTargetIds(targetIds) {
|
23895 | this.removeTargetIds("hiddenTargetIds", targetIds);
|
23896 | },
|
23897 | addHiddenLegendIds: function addHiddenLegendIds(targetIds) {
|
23898 | this.addTargetIds("hiddenLegendIds", targetIds);
|
23899 | },
|
23900 | removeHiddenLegendIds: function removeHiddenLegendIds(targetIds) {
|
23901 | this.removeTargetIds("hiddenLegendIds", targetIds);
|
23902 | },
|
23903 | getValuesAsIdKeyed: function getValuesAsIdKeyed(targets) {
|
23904 | var $$ = this,
|
23905 | hasAxis = $$.state.hasAxis,
|
23906 | ys = {},
|
23907 | isMultipleX = $$.isMultipleX(),
|
23908 | xs = isMultipleX ? $$.mapTargetsToUniqueXs(targets).map(function (v) {
|
23909 | return isString(v) ? v : +v;
|
23910 | }) : null;
|
23911 | targets.forEach(function (t) {
|
23912 | var data = [];
|
23913 | t.values.filter(function (_ref) {
|
23914 | var value = _ref.value;
|
23915 | return isValue(value) || value === null;
|
23916 | }).forEach(function (v) {
|
23917 | var value = v.value; // exclude 'volume' value to correct mis domain calculation
|
23918 |
|
23919 | if (value !== null && $$.isCandlestickType(v)) {
|
23920 | value = isArray(value) ? value.slice(0, 4) : [value.open, value.high, value.low, value.close];
|
23921 | }
|
23922 |
|
23923 | if (isArray(value)) {
|
23924 | data.push.apply(data, value);
|
23925 | } else if (isObject(value) && "high" in value) {
|
23926 | data.push.apply(data, Object.values(value));
|
23927 | } else if ($$.isBubbleZType(v)) {
|
23928 | data.push(hasAxis && $$.getBubbleZData(value, "y"));
|
23929 | } else {
|
23930 | if (isMultipleX) {
|
23931 | data[$$.getIndexByX(v.x, xs)] = value;
|
23932 | } else {
|
23933 | data.push(value);
|
23934 | }
|
23935 | }
|
23936 | });
|
23937 | ys[t.id] = data;
|
23938 | });
|
23939 | return ys;
|
23940 | },
|
23941 | checkValueInTargets: function checkValueInTargets(targets, checker) {
|
23942 | var ids = Object.keys(targets),
|
23943 | values;
|
23944 |
|
23945 | for (var i = 0; i < ids.length; i++) {
|
23946 | values = targets[ids[i]].values;
|
23947 |
|
23948 | for (var j = 0; j < values.length; j++) {
|
23949 | if (checker(values[j].value)) {
|
23950 | return !0;
|
23951 | }
|
23952 | }
|
23953 | }
|
23954 |
|
23955 | return !1;
|
23956 | },
|
23957 | hasMultiTargets: function hasMultiTargets() {
|
23958 | return this.filterTargetsToShow().length > 1;
|
23959 | },
|
23960 | hasNegativeValueInTargets: function hasNegativeValueInTargets(targets) {
|
23961 | return this.checkValueInTargets(targets, function (v) {
|
23962 | return v < 0;
|
23963 | });
|
23964 | },
|
23965 | hasPositiveValueInTargets: function hasPositiveValueInTargets(targets) {
|
23966 | return this.checkValueInTargets(targets, function (v) {
|
23967 | return v > 0;
|
23968 | });
|
23969 | },
|
23970 |
|
23971 | /**
|
23972 | * Sort targets data
|
23973 | * @param {Array} targetsValue Target value
|
23974 | * @returns {Array}
|
23975 | * @private
|
23976 | */
|
23977 | orderTargets: function orderTargets(targetsValue) {
|
23978 | var $$ = this,
|
23979 | targets = [].concat(targetsValue),
|
23980 | fn = $$.getSortCompareFn();
|
23981 | fn && targets.sort(fn);
|
23982 | return targets;
|
23983 | },
|
23984 |
|
23985 | /**
|
23986 | * Get data.order compare function
|
23987 | * @param {boolean} isArc Is for Arc type sort or not
|
23988 | * @returns {Function} compare function
|
23989 | * @private
|
23990 | */
|
23991 | getSortCompareFn: function getSortCompareFn(isArc) {
|
23992 | if (isArc === void 0) {
|
23993 | isArc = !1;
|
23994 | }
|
23995 |
|
23996 | var $$ = this,
|
23997 | config = $$.config,
|
23998 | order = config.data_order,
|
23999 | orderAsc = /asc/i.test(order),
|
24000 | orderDesc = /desc/i.test(order),
|
24001 | fn;
|
24002 |
|
24003 | if (orderAsc || orderDesc) {
|
24004 | var reducer = function (p, c) {
|
24005 | return p + Math.abs(c.value);
|
24006 | };
|
24007 |
|
24008 | fn = function (t1, t2) {
|
24009 | var t1Sum = t1.values.reduce(reducer, 0),
|
24010 | t2Sum = t2.values.reduce(reducer, 0);
|
24011 | return isArc ? orderAsc ? t1Sum - t2Sum : t2Sum - t1Sum : orderAsc ? t2Sum - t1Sum : t1Sum - t2Sum;
|
24012 | };
|
24013 | } else if (isFunction(order)) {
|
24014 | fn = order.bind($$.api);
|
24015 | }
|
24016 |
|
24017 | return fn || null;
|
24018 | },
|
24019 | filterByX: function filterByX(targets, x) {
|
24020 | return mergeArray(targets.map(function (t) {
|
24021 | return t.values;
|
24022 | })).filter(function (v) {
|
24023 | return v.x - x === 0;
|
24024 | });
|
24025 | },
|
24026 | filterRemoveNull: function filterRemoveNull(data) {
|
24027 | var _this2 = this;
|
24028 |
|
24029 | return data.filter(function (d) {
|
24030 | return isValue(_this2.getBaseValue(d));
|
24031 | });
|
24032 | },
|
24033 | filterByXDomain: function filterByXDomain(targets, xDomain) {
|
24034 | return targets.map(function (t) {
|
24035 | return {
|
24036 | id: t.id,
|
24037 | id_org: t.id_org,
|
24038 | values: t.values.filter(function (v) {
|
24039 | return xDomain[0] <= v.x && v.x <= xDomain[1];
|
24040 | })
|
24041 | };
|
24042 | });
|
24043 | },
|
24044 | hasDataLabel: function hasDataLabel() {
|
24045 | var dataLabels = this.config.data_labels;
|
24046 | return isboolean(dataLabels) && dataLabels || isObjectType(dataLabels) && notEmpty(dataLabels);
|
24047 | },
|
24048 |
|
24049 | /**
|
24050 | * Get data index from the event coodinates
|
24051 | * @param {Event} event Event object
|
24052 | * @returns {number}
|
24053 | */
|
24054 | getDataIndexFromEvent: function getDataIndexFromEvent(event) {
|
24055 | var $$ = this,
|
24056 | config = $$.config,
|
24057 | _$$$state = $$.state,
|
24058 | inputType = _$$$state.inputType,
|
24059 | _$$$state$eventReceiv = _$$$state.eventReceiver,
|
24060 | coords = _$$$state$eventReceiv.coords,
|
24061 | rect = _$$$state$eventReceiv.rect,
|
24062 | isRotated = config.axis_rotated,
|
24063 | e = inputType === "touch" && event.changedTouches ? event.changedTouches[0] : event,
|
24064 | index = findIndex(coords, isRotated ? e.clientY - rect.top : e.clientX - rect.left, 0, coords.length - 1, isRotated);
|
24065 | return index;
|
24066 | },
|
24067 | getDataLabelLength: function getDataLabelLength(min, max, key) {
|
24068 | var $$ = this,
|
24069 | lengths = [0, 0];
|
24070 | $$.$el.chart.select("svg").selectAll(".dummy").data([min, max]).enter().append("text").text(function (d) {
|
24071 | return $$.dataLabelFormat(d.id)(d);
|
24072 | }).each(function (d, i) {
|
24073 | lengths[i] = this.getBoundingClientRect()[key] * 1.3;
|
24074 | }).remove();
|
24075 | return lengths;
|
24076 | },
|
24077 | isNoneArc: function isNoneArc(d) {
|
24078 | return this.hasTarget(this.data.targets, d.id);
|
24079 | },
|
24080 | isArc: function isArc(d) {
|
24081 | return "data" in d && this.hasTarget(this.data.targets, d.data.id);
|
24082 | },
|
24083 | findSameXOfValues: function findSameXOfValues(values, index) {
|
24084 | var targetX = values[index].x,
|
24085 | sames = [],
|
24086 | i;
|
24087 |
|
24088 | for (i = index - 1; i >= 0; i--) {
|
24089 | if (targetX !== values[i].x) {
|
24090 | break;
|
24091 | }
|
24092 |
|
24093 | sames.push(values[i]);
|
24094 | }
|
24095 |
|
24096 | for (i = index; i < values.length; i++) {
|
24097 | if (targetX !== values[i].x) {
|
24098 | break;
|
24099 | }
|
24100 |
|
24101 | sames.push(values[i]);
|
24102 | }
|
24103 |
|
24104 | return sames;
|
24105 | },
|
24106 | findClosestFromTargets: function findClosestFromTargets(targets, pos) {
|
24107 | var $$ = this,
|
24108 | candidates = targets.map(function (target) {
|
24109 | return $$.findClosest(target.values, pos);
|
24110 | });
|
24111 | // map to array of closest points of each target
|
24112 | // decide closest point and return
|
24113 | return $$.findClosest(candidates, pos);
|
24114 | },
|
24115 | findClosest: function findClosest(values, pos) {
|
24116 | var $$ = this,
|
24117 | config = $$.config,
|
24118 | main = $$.$el.main,
|
24119 | data = values.filter(function (v) {
|
24120 | return v && isValue(v.value);
|
24121 | }),
|
24122 | minDist = config.point_sensitivity,
|
24123 | closest;
|
24124 | // find mouseovering bar
|
24125 | data.filter(function (v) {
|
24126 | return $$.isBarType(v.id);
|
24127 | }).forEach(function (v) {
|
24128 | var shape = main.select("." + config_classes.bars + $$.getTargetSelectorSuffix(v.id) + " ." + config_classes.bar + "-" + v.index).node();
|
24129 |
|
24130 | if (!closest && $$.isWithinBar(shape)) {
|
24131 | closest = v;
|
24132 | }
|
24133 | }); // find closest point from non-bar
|
24134 |
|
24135 | data.filter(function (v) {
|
24136 | return !$$.isBarType(v.id);
|
24137 | }).forEach(function (v) {
|
24138 | var d = $$.dist(v, pos);
|
24139 |
|
24140 | if (d < minDist) {
|
24141 | minDist = d;
|
24142 | closest = v;
|
24143 | }
|
24144 | });
|
24145 | return closest;
|
24146 | },
|
24147 | dist: function dist(data, pos) {
|
24148 | var $$ = this,
|
24149 | isRotated = $$.config.axis_rotated,
|
24150 | scale = $$.scale,
|
24151 | xIndex = isRotated ? 1 : 0,
|
24152 | yIndex = isRotated ? 0 : 1,
|
24153 | y = $$.circleY(data, data.index),
|
24154 | x = (scale.zoom || scale.x)(data.x);
|
24155 | return Math.sqrt(Math.pow(x - pos[xIndex], 2) + Math.pow(y - pos[yIndex], 2));
|
24156 | },
|
24157 |
|
24158 | /**
|
24159 | * Convert data for step type
|
24160 | * @param {Array} values Object data values
|
24161 | * @returns {Array}
|
24162 | * @private
|
24163 | */
|
24164 | convertValuesToStep: function convertValuesToStep(values) {
|
24165 | var $$ = this,
|
24166 | axis = $$.axis,
|
24167 | config = $$.config,
|
24168 | stepType = config.line_step_type,
|
24169 | isCategorized = axis ? axis.isCategorized() : !1,
|
24170 | converted = isArray(values) ? values.concat() : [values];
|
24171 |
|
24172 | if (!(isCategorized || /step\-(after|before)/.test(stepType))) {
|
24173 | return values;
|
24174 | } // insert & append cloning first/last value to be fully rendered covering on each gap sides
|
24175 |
|
24176 |
|
24177 | var head = converted[0],
|
24178 | tail = converted[converted.length - 1],
|
24179 | id = head.id,
|
24180 | x = head.x;
|
24181 | // insert head
|
24182 | converted.unshift({
|
24183 | x: --x,
|
24184 | value: head.value,
|
24185 | id: id
|
24186 | });
|
24187 | isCategorized && stepType === "step-after" && converted.unshift({
|
24188 | x: --x,
|
24189 | value: head.value,
|
24190 | id: id
|
24191 | }); // append tail
|
24192 |
|
24193 | x = tail.x;
|
24194 | converted.push({
|
24195 | x: ++x,
|
24196 | value: tail.value,
|
24197 | id: id
|
24198 | });
|
24199 | isCategorized && stepType === "step-before" && converted.push({
|
24200 | x: ++x,
|
24201 | value: tail.value,
|
24202 | id: id
|
24203 | });
|
24204 | return converted;
|
24205 | },
|
24206 | convertValuesToRange: function convertValuesToRange(values) {
|
24207 | var converted = isArray(values) ? values.concat() : [values],
|
24208 | ranges = [];
|
24209 | converted.forEach(function (range) {
|
24210 | var x = range.x,
|
24211 | id = range.id;
|
24212 | ranges.push({
|
24213 | x: x,
|
24214 | id: id,
|
24215 | value: range.value[0]
|
24216 | });
|
24217 | ranges.push({
|
24218 | x: x,
|
24219 | id: id,
|
24220 | value: range.value[2]
|
24221 | });
|
24222 | });
|
24223 | return ranges;
|
24224 | },
|
24225 | updateDataAttributes: function updateDataAttributes(name, attrs) {
|
24226 | var $$ = this,
|
24227 | config = $$.config,
|
24228 | current = config["data_" + name];
|
24229 |
|
24230 | if (isUndefined(attrs)) {
|
24231 | return current;
|
24232 | }
|
24233 |
|
24234 | Object.keys(attrs).forEach(function (id) {
|
24235 | current[id] = attrs[id];
|
24236 | });
|
24237 | $$.redraw({
|
24238 | withLegend: !0
|
24239 | });
|
24240 | return current;
|
24241 | },
|
24242 | getRangedData: function getRangedData(d, key, type) {
|
24243 | if (key === void 0) {
|
24244 | key = "";
|
24245 | }
|
24246 |
|
24247 | if (type === void 0) {
|
24248 | type = "areaRange";
|
24249 | }
|
24250 |
|
24251 | var value = d == null ? void 0 : d.value;
|
24252 |
|
24253 | if (isArray(value)) {
|
24254 | // @ts-ignore
|
24255 | var index = {
|
24256 | areaRange: ["high", "mid", "low"],
|
24257 | candlestick: ["open", "high", "low", "close", "volume"]
|
24258 | }[type].indexOf(key);
|
24259 | return index >= 0 && value ? value[index] : undefined;
|
24260 | } else if (value) {
|
24261 | return value[key];
|
24262 | }
|
24263 |
|
24264 | return value;
|
24265 | },
|
24266 |
|
24267 | /**
|
24268 | * Get ratio value
|
24269 | * @param {string} type Ratio for given type
|
24270 | * @param {object} d Data value object
|
24271 | * @param {boolean} asPercent Convert the return as percent or not
|
24272 | * @returns {number} Ratio value
|
24273 | * @private
|
24274 | */
|
24275 | getRatio: function getRatio(type, d, asPercent) {
|
24276 | if (asPercent === void 0) {
|
24277 | asPercent = !1;
|
24278 | }
|
24279 |
|
24280 | var $$ = this,
|
24281 | config = $$.config,
|
24282 | state = $$.state,
|
24283 | api = $$.api,
|
24284 | ratio = 0;
|
24285 |
|
24286 | if (d && api.data.shown().length) {
|
24287 | ratio = d.ratio || d.value;
|
24288 |
|
24289 | if (type === "arc") {
|
24290 | // if has padAngle set, calculate rate based on value
|
24291 | if ($$.pie.padAngle()()) {
|
24292 | ratio = d.value / $$.getTotalDataSum(!0); // otherwise, based on the rendered angle value
|
24293 | } else {
|
24294 | var gaugeArcLength = config.gauge_fullCircle ? $$.getArcLength() : $$.getStartAngle() * -2,
|
24295 | arcLength = $$.hasType("gauge") ? gaugeArcLength : Math.PI * 2;
|
24296 | ratio = (d.endAngle - d.startAngle) / arcLength;
|
24297 | }
|
24298 | } else if (type === "index") {
|
24299 | var dataValues = api.data.values.bind(api),
|
24300 | total = this.getTotalPerIndex();
|
24301 |
|
24302 | if (state.hiddenTargetIds.length) {
|
24303 | var hiddenSum = dataValues(state.hiddenTargetIds, !1);
|
24304 |
|
24305 | if (hiddenSum.length) {
|
24306 | hiddenSum = hiddenSum.reduce(function (acc, curr) {
|
24307 | return acc.map(function (v, i) {
|
24308 | return (isNumber(v) ? v : 0) + curr[i];
|
24309 | });
|
24310 | });
|
24311 | total = total.map(function (v, i) {
|
24312 | return v - hiddenSum[i];
|
24313 | });
|
24314 | }
|
24315 | }
|
24316 |
|
24317 | d.ratio = isNumber(d.value) && total && total[d.index] > 0 ? d.value / total[d.index] : 0;
|
24318 | ratio = d.ratio;
|
24319 | } else if (type === "radar") {
|
24320 | ratio = parseFloat(Math.max(d.value, 0) + "") / state.current.dataMax * config.radar_size_ratio;
|
24321 | } else if (type === "bar") {
|
24322 | var yScale = $$.getYScaleById.bind($$)(d.id),
|
24323 | max = yScale.domain().reduce(function (a, c) {
|
24324 | return c - a;
|
24325 | });
|
24326 | // when all data are 0, return 0
|
24327 | ratio = max === 0 ? 0 : Math.abs(d.value) / max;
|
24328 | }
|
24329 | }
|
24330 |
|
24331 | return asPercent && ratio ? ratio * 100 : ratio;
|
24332 | },
|
24333 |
|
24334 | /**
|
24335 | * Sort data index to be aligned with x axis.
|
24336 | * @param {Array} tickValues Tick array values
|
24337 | * @private
|
24338 | */
|
24339 | updateDataIndexByX: function updateDataIndexByX(tickValues) {
|
24340 | var $$ = this,
|
24341 | tickValueMap = tickValues.reduce(function (out, tick, index) {
|
24342 | out[+tick.x] = index;
|
24343 | return out;
|
24344 | }, {});
|
24345 | $$.data.targets.forEach(function (t) {
|
24346 | t.values.forEach(function (value, valueIndex) {
|
24347 | var index = tickValueMap[+value.x];
|
24348 |
|
24349 | if (index === undefined) {
|
24350 | index = valueIndex;
|
24351 | }
|
24352 |
|
24353 | value.index = index;
|
24354 | });
|
24355 | });
|
24356 | },
|
24357 |
|
24358 | /**
|
24359 | * Determine if bubble has dimension data
|
24360 | * @param {object|Array} d data value
|
24361 | * @returns {boolean}
|
24362 | * @private
|
24363 | */
|
24364 | isBubbleZType: function isBubbleZType(d) {
|
24365 | var $$ = this;
|
24366 | return $$.isBubbleType(d) && (isObject(d.value) && ("z" in d.value || "y" in d.value) || isArray(d.value) && d.value.length === 2);
|
24367 | },
|
24368 |
|
24369 | /**
|
24370 | * Get data object by id
|
24371 | * @param {string} id data id
|
24372 | * @returns {object}
|
24373 | * @private
|
24374 | */
|
24375 | getDataById: function getDataById(id) {
|
24376 | var _d$,
|
24377 | d = this.cache.get(id) || this.api.data(id);
|
24378 |
|
24379 | return (_d$ = d == null ? void 0 : d[0]) != null ? _d$ : d;
|
24380 | }
|
24381 | });
|
24382 | ;// CONCATENATED MODULE: ./src/ChartInternal/data/load.ts
|
24383 | /**
|
24384 | * Copyright (c) 2017 ~ present NAVER Corp.
|
24385 | * billboard.js project is licensed under the MIT license
|
24386 | */
|
24387 |
|
24388 |
|
24389 | /* harmony default export */ var load = ({
|
24390 | load: function load(rawTargets, args) {
|
24391 | var _args$done,
|
24392 | $$ = this,
|
24393 | append = args.append,
|
24394 | targets = rawTargets;
|
24395 |
|
24396 | if (targets) {
|
24397 | // filter loading targets if needed
|
24398 | if (args.filter) {
|
24399 | targets = targets.filter(args.filter);
|
24400 | } // set type if args.types || args.type specified
|
24401 |
|
24402 |
|
24403 | if (args.type || args.types) {
|
24404 | targets.forEach(function (t) {
|
24405 | var _args$types,
|
24406 | type = ((_args$types = args.types) == null ? void 0 : _args$types[t.id]) || args.type;
|
24407 |
|
24408 | $$.setTargetType(t.id, type);
|
24409 | });
|
24410 | } // Update/Add data
|
24411 |
|
24412 |
|
24413 | $$.data.targets.forEach(function (d) {
|
24414 | for (var i = 0; i < targets.length; i++) {
|
24415 | if (d.id === targets[i].id) {
|
24416 | d.values = append ? d.values.concat(targets[i].values) : targets[i].values;
|
24417 | targets.splice(i, 1);
|
24418 | break;
|
24419 | }
|
24420 | }
|
24421 | });
|
24422 | $$.data.targets = $$.data.targets.concat(targets); // add remained
|
24423 | } // Set targets
|
24424 |
|
24425 |
|
24426 | $$.updateTargets($$.data.targets); // Redraw with new targets
|
24427 |
|
24428 | $$.redraw({
|
24429 | withUpdateOrgXDomain: !0,
|
24430 | withUpdateXDomain: !0,
|
24431 | withLegend: !0
|
24432 | }); // Update current state chart type and elements list after redraw
|
24433 |
|
24434 | $$.updateTypesElements();
|
24435 | (_args$done = args.done) == null ? void 0 : _args$done.call($$.api);
|
24436 | },
|
24437 | loadFromArgs: function loadFromArgs(args) {
|
24438 | var $$ = this; // prevent load when chart is already destroyed
|
24439 |
|
24440 | if (!$$.config) {
|
24441 | return;
|
24442 | } // reset internally cached data
|
24443 |
|
24444 |
|
24445 | $$.cache.reset();
|
24446 | var data = args.data || $$.convertData(args, function (d) {
|
24447 | return $$.load($$.convertDataToTargets(d), args);
|
24448 | });
|
24449 | args.append && (data.__append__ = !0);
|
24450 | data && $$.load($$.convertDataToTargets(data), args);
|
24451 | },
|
24452 | unload: function unload(rawTargetIds, customDoneCb) {
|
24453 | var $$ = this,
|
24454 | state = $$.state,
|
24455 | $el = $$.$el,
|
24456 | $T = $$.$T,
|
24457 | done = customDoneCb,
|
24458 | targetIds = rawTargetIds;
|
24459 | // reset internally cached data
|
24460 | $$.cache.reset();
|
24461 |
|
24462 | if (!done) {
|
24463 | done = function () {};
|
24464 | } // filter existing target
|
24465 |
|
24466 |
|
24467 | targetIds = targetIds.filter(function (id) {
|
24468 | return $$.hasTarget($$.data.targets, id);
|
24469 | }); // If no target, call done and return
|
24470 |
|
24471 | if (!targetIds || targetIds.length === 0) {
|
24472 | done();
|
24473 | return;
|
24474 | }
|
24475 |
|
24476 | var targets = $el.svg.selectAll(targetIds.map(function (id) {
|
24477 | return $$.selectorTarget(id);
|
24478 | }));
|
24479 | $T(targets).style("opacity", "0").remove().call(endall, done);
|
24480 | targetIds.forEach(function (id) {
|
24481 | // Reset fadein for future load
|
24482 | state.withoutFadeIn[id] = !1; // Remove target's elements
|
24483 |
|
24484 | if ($el.legend) {
|
24485 | $el.legend.selectAll("." + config_classes.legendItem + $$.getTargetSelectorSuffix(id)).remove();
|
24486 | } // Remove target
|
24487 |
|
24488 |
|
24489 | $$.data.targets = $$.data.targets.filter(function (t) {
|
24490 | return t.id !== id;
|
24491 | });
|
24492 | }); // Update current state chart type and elements list after redraw
|
24493 |
|
24494 | $$.updateTypesElements();
|
24495 | }
|
24496 | });
|
24497 | ;// CONCATENATED MODULE: ./node_modules/d3-drag/src/constant.js
|
24498 | /* harmony default export */ var d3_drag_src_constant = (function (x) {
|
24499 | return function () {
|
24500 | return x;
|
24501 | };
|
24502 | });
|
24503 | ;// CONCATENATED MODULE: ./node_modules/d3-drag/src/event.js
|
24504 | function DragEvent(type, _ref) {
|
24505 | var sourceEvent = _ref.sourceEvent,
|
24506 | subject = _ref.subject,
|
24507 | target = _ref.target,
|
24508 | identifier = _ref.identifier,
|
24509 | active = _ref.active,
|
24510 | x = _ref.x,
|
24511 | y = _ref.y,
|
24512 | dx = _ref.dx,
|
24513 | dy = _ref.dy,
|
24514 | dispatch = _ref.dispatch;
|
24515 | Object.defineProperties(this, {
|
24516 | type: {
|
24517 | value: type,
|
24518 | enumerable: !0,
|
24519 | configurable: !0
|
24520 | },
|
24521 | sourceEvent: {
|
24522 | value: sourceEvent,
|
24523 | enumerable: !0,
|
24524 | configurable: !0
|
24525 | },
|
24526 | subject: {
|
24527 | value: subject,
|
24528 | enumerable: !0,
|
24529 | configurable: !0
|
24530 | },
|
24531 | target: {
|
24532 | value: target,
|
24533 | enumerable: !0,
|
24534 | configurable: !0
|
24535 | },
|
24536 | identifier: {
|
24537 | value: identifier,
|
24538 | enumerable: !0,
|
24539 | configurable: !0
|
24540 | },
|
24541 | active: {
|
24542 | value: active,
|
24543 | enumerable: !0,
|
24544 | configurable: !0
|
24545 | },
|
24546 | x: {
|
24547 | value: x,
|
24548 | enumerable: !0,
|
24549 | configurable: !0
|
24550 | },
|
24551 | y: {
|
24552 | value: y,
|
24553 | enumerable: !0,
|
24554 | configurable: !0
|
24555 | },
|
24556 | dx: {
|
24557 | value: dx,
|
24558 | enumerable: !0,
|
24559 | configurable: !0
|
24560 | },
|
24561 | dy: {
|
24562 | value: dy,
|
24563 | enumerable: !0,
|
24564 | configurable: !0
|
24565 | },
|
24566 | _: {
|
24567 | value: dispatch
|
24568 | }
|
24569 | });
|
24570 | }
|
24571 |
|
24572 | DragEvent.prototype.on = function () {
|
24573 | var value = this._.on.apply(this._, arguments);
|
24574 |
|
24575 | return value === this._ ? this : value;
|
24576 | };
|
24577 | ;// CONCATENATED MODULE: ./node_modules/d3-drag/src/drag.js
|
24578 |
|
24579 |
|
24580 |
|
24581 |
|
24582 |
|
24583 | // Ignore right-click, since that should open the context menu.
|
24584 |
|
24585 | function drag_defaultFilter(event) {
|
24586 | return !event.ctrlKey && !event.button;
|
24587 | }
|
24588 |
|
24589 | function defaultContainer() {
|
24590 | return this.parentNode;
|
24591 | }
|
24592 |
|
24593 | function defaultSubject(event, d) {
|
24594 | return d == null ? {
|
24595 | x: event.x,
|
24596 | y: event.y
|
24597 | } : d;
|
24598 | }
|
24599 |
|
24600 | function drag_defaultTouchable() {
|
24601 | return navigator.maxTouchPoints || "ontouchstart" in this;
|
24602 | }
|
24603 |
|
24604 | /* harmony default export */ function drag() {
|
24605 | var filter = drag_defaultFilter,
|
24606 | container = defaultContainer,
|
24607 | subject = defaultSubject,
|
24608 | touchable = drag_defaultTouchable,
|
24609 | gestures = {},
|
24610 | listeners = src_dispatch("start", "drag", "end"),
|
24611 | active = 0,
|
24612 | mousedownx,
|
24613 | mousedowny,
|
24614 | mousemoving,
|
24615 | touchending,
|
24616 | clickDistance2 = 0;
|
24617 |
|
24618 | function drag(selection) {
|
24619 | selection.on("mousedown.drag", mousedowned).filter(touchable).on("touchstart.drag", touchstarted).on("touchmove.drag", touchmoved, nonpassive).on("touchend.drag touchcancel.drag", touchended).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
|
24620 | }
|
24621 |
|
24622 | function mousedowned(event, d) {
|
24623 | if (touchending || !filter.call(this, event, d)) return;
|
24624 | var gesture = beforestart(this, container.call(this, event, d), event, d, "mouse");
|
24625 | if (!gesture) return;
|
24626 | src_select(event.view).on("mousemove.drag", mousemoved, nonpassivecapture).on("mouseup.drag", mouseupped, nonpassivecapture);
|
24627 | nodrag(event.view);
|
24628 | nopropagation(event);
|
24629 | mousemoving = !1;
|
24630 | mousedownx = event.clientX;
|
24631 | mousedowny = event.clientY;
|
24632 | gesture("start", event);
|
24633 | }
|
24634 |
|
24635 | function mousemoved(event) {
|
24636 | noevent(event);
|
24637 |
|
24638 | if (!mousemoving) {
|
24639 | var dx = event.clientX - mousedownx,
|
24640 | dy = event.clientY - mousedowny;
|
24641 | mousemoving = dx * dx + dy * dy > clickDistance2;
|
24642 | }
|
24643 |
|
24644 | gestures.mouse("drag", event);
|
24645 | }
|
24646 |
|
24647 | function mouseupped(event) {
|
24648 | src_select(event.view).on("mousemove.drag mouseup.drag", null);
|
24649 | yesdrag(event.view, mousemoving);
|
24650 | noevent(event);
|
24651 | gestures.mouse("end", event);
|
24652 | }
|
24653 |
|
24654 | function touchstarted(event, d) {
|
24655 | if (!filter.call(this, event, d)) return;
|
24656 | var touches = event.changedTouches,
|
24657 | c = container.call(this, event, d),
|
24658 | n = touches.length,
|
24659 | i,
|
24660 | gesture;
|
24661 |
|
24662 | for (i = 0; i < n; ++i) {
|
24663 | if (gesture = beforestart(this, c, event, d, touches[i].identifier, touches[i])) {
|
24664 | nopropagation(event);
|
24665 | gesture("start", event, touches[i]);
|
24666 | }
|
24667 | }
|
24668 | }
|
24669 |
|
24670 | function touchmoved(event) {
|
24671 | var touches = event.changedTouches,
|
24672 | n = touches.length,
|
24673 | i,
|
24674 | gesture;
|
24675 |
|
24676 | for (i = 0; i < n; ++i) {
|
24677 | if (gesture = gestures[touches[i].identifier]) {
|
24678 | noevent(event);
|
24679 | gesture("drag", event, touches[i]);
|
24680 | }
|
24681 | }
|
24682 | }
|
24683 |
|
24684 | function touchended(event) {
|
24685 | var touches = event.changedTouches,
|
24686 | n = touches.length,
|
24687 | i,
|
24688 | gesture;
|
24689 | if (touchending) clearTimeout(touchending);
|
24690 | touchending = setTimeout(function () {
|
24691 | touchending = null;
|
24692 | }, 500); // Ghost clicks are delayed!
|
24693 |
|
24694 | for (i = 0; i < n; ++i) {
|
24695 | if (gesture = gestures[touches[i].identifier]) {
|
24696 | nopropagation(event);
|
24697 | gesture("end", event, touches[i]);
|
24698 | }
|
24699 | }
|
24700 | }
|
24701 |
|
24702 | function beforestart(that, container, event, d, identifier, touch) {
|
24703 | var dispatch = listeners.copy(),
|
24704 | p = src_pointer(touch || event, container),
|
24705 | dx,
|
24706 | dy,
|
24707 | s;
|
24708 | if ((s = subject.call(that, new DragEvent("beforestart", {
|
24709 | sourceEvent: event,
|
24710 | target: drag,
|
24711 | identifier: identifier,
|
24712 | active: active,
|
24713 | x: p[0],
|
24714 | y: p[1],
|
24715 | dx: 0,
|
24716 | dy: 0,
|
24717 | dispatch: dispatch
|
24718 | }), d)) == null) return;
|
24719 | dx = s.x - p[0] || 0;
|
24720 | dy = s.y - p[1] || 0;
|
24721 | return function gesture(type, event, touch) {
|
24722 | var p0 = p,
|
24723 | n;
|
24724 |
|
24725 | switch (type) {
|
24726 | case "start":
|
24727 | gestures[identifier] = gesture, n = active++;
|
24728 | break;
|
24729 |
|
24730 | case "end":
|
24731 | delete gestures[identifier], --active;
|
24732 | // falls through
|
24733 |
|
24734 | case "drag":
|
24735 | p = src_pointer(touch || event, container), n = active;
|
24736 | break;
|
24737 | }
|
24738 |
|
24739 | dispatch.call(type, that, new DragEvent(type, {
|
24740 | sourceEvent: event,
|
24741 | subject: s,
|
24742 | target: drag,
|
24743 | identifier: identifier,
|
24744 | active: n,
|
24745 | x: p[0] + dx,
|
24746 | y: p[1] + dy,
|
24747 | dx: p[0] - p0[0],
|
24748 | dy: p[1] - p0[1],
|
24749 | dispatch: dispatch
|
24750 | }), d);
|
24751 | };
|
24752 | }
|
24753 |
|
24754 | drag.filter = function (_) {
|
24755 | return arguments.length ? (filter = typeof _ === "function" ? _ : d3_drag_src_constant(!!_), drag) : filter;
|
24756 | };
|
24757 |
|
24758 | drag.container = function (_) {
|
24759 | return arguments.length ? (container = typeof _ === "function" ? _ : d3_drag_src_constant(_), drag) : container;
|
24760 | };
|
24761 |
|
24762 | drag.subject = function (_) {
|
24763 | return arguments.length ? (subject = typeof _ === "function" ? _ : d3_drag_src_constant(_), drag) : subject;
|
24764 | };
|
24765 |
|
24766 | drag.touchable = function (_) {
|
24767 | return arguments.length ? (touchable = typeof _ === "function" ? _ : d3_drag_src_constant(!!_), drag) : touchable;
|
24768 | };
|
24769 |
|
24770 | drag.on = function () {
|
24771 | var value = listeners.on.apply(listeners, arguments);
|
24772 | return value === listeners ? drag : value;
|
24773 | };
|
24774 |
|
24775 | drag.clickDistance = function (_) {
|
24776 | return arguments.length ? (clickDistance2 = (_ = +_) * _, drag) : Math.sqrt(clickDistance2);
|
24777 | };
|
24778 |
|
24779 | return drag;
|
24780 | }
|
24781 | ;// CONCATENATED MODULE: ./src/ChartInternal/interactions/interaction.ts
|
24782 | /**
|
24783 | * Copyright (c) 2017 ~ present NAVER Corp.
|
24784 | * billboard.js project is licensed under the MIT license
|
24785 | */
|
24786 |
|
24787 |
|
24788 |
|
24789 |
|
24790 |
|
24791 | /* harmony default export */ var interactions_interaction = ({
|
24792 | selectRectForSingle: function selectRectForSingle(context, eventRect, index) {
|
24793 | var $$ = this,
|
24794 | config = $$.config,
|
24795 | main = $$.$el.main,
|
24796 | isSelectionEnabled = config.data_selection_enabled,
|
24797 | isSelectionGrouped = config.data_selection_grouped,
|
24798 | isSelectable = config.data_selection_isselectable,
|
24799 | isTooltipGrouped = config.tooltip_grouped,
|
24800 | selectedData = $$.getAllValuesOnIndex(index);
|
24801 |
|
24802 | if (isTooltipGrouped) {
|
24803 | $$.showTooltip(selectedData, context);
|
24804 | $$.showGridFocus == null ? void 0 : $$.showGridFocus(selectedData);
|
24805 |
|
24806 | if (!isSelectionEnabled || isSelectionGrouped) {
|
24807 | return;
|
24808 | }
|
24809 | }
|
24810 |
|
24811 | main.selectAll("." + config_classes.shape + "-" + index).each(function () {
|
24812 | src_select(this).classed(config_classes.EXPANDED, !0);
|
24813 |
|
24814 | if (isSelectionEnabled) {
|
24815 | eventRect.style("cursor", isSelectionGrouped ? "pointer" : null);
|
24816 | }
|
24817 |
|
24818 | if (!isTooltipGrouped) {
|
24819 | $$.hideGridFocus == null ? void 0 : $$.hideGridFocus();
|
24820 | $$.hideTooltip();
|
24821 | isSelectionGrouped || $$.setExpand(index);
|
24822 | }
|
24823 | }).filter(function (d) {
|
24824 | return $$.isWithinShape(this, d);
|
24825 | }).call(function (selected) {
|
24826 | var _isSelectable,
|
24827 | d = selected.data();
|
24828 |
|
24829 | if (isSelectionEnabled && (isSelectionGrouped || (_isSelectable = isSelectable) != null && _isSelectable.bind($$.api)(d))) {
|
24830 | eventRect.style("cursor", "pointer");
|
24831 | }
|
24832 |
|
24833 | if (!isTooltipGrouped) {
|
24834 | $$.showTooltip(d, context);
|
24835 | $$.showGridFocus == null ? void 0 : $$.showGridFocus(d);
|
24836 | $$.unexpandCircles == null ? void 0 : $$.unexpandCircles();
|
24837 | selected.each(function (d) {
|
24838 | return $$.setExpand(index, d.id);
|
24839 | });
|
24840 | }
|
24841 | });
|
24842 | },
|
24843 |
|
24844 | /**
|
24845 | * Expand data shape/point
|
24846 | * @param {number} index Index number
|
24847 | * @param {string} id Data id
|
24848 | * @param {boolean} reset Reset expand state
|
24849 | * @private
|
24850 | */
|
24851 | setExpand: function setExpand(index, id, reset) {
|
24852 | var $$ = this,
|
24853 | config = $$.config,
|
24854 | circle = $$.$el.circle;
|
24855 | circle && config.point_focus_expand_enabled && $$.expandCircles(index, id, reset); // bar, candlestick
|
24856 |
|
24857 | $$.expandBarTypeShapes(!0, index, id, reset);
|
24858 | },
|
24859 |
|
24860 | /**
|
24861 | * Expand/Unexpand bar type shapes
|
24862 | * @param {boolean} expand Expand or unexpand
|
24863 | * @param {number} i Shape index
|
24864 | * @param {string} id Data id
|
24865 | * @param {boolean} reset Reset expand style
|
24866 | * @private
|
24867 | */
|
24868 | expandBarTypeShapes: function expandBarTypeShapes(expand, i, id, reset) {
|
24869 | if (expand === void 0) {
|
24870 | expand = !0;
|
24871 | }
|
24872 |
|
24873 | var $$ = this;
|
24874 | ["bar", "candlestick"].filter(function (v) {
|
24875 | return $$.$el[v];
|
24876 | }).forEach(function (v) {
|
24877 | reset && $$.$el[v].classed(config_classes.EXPANDED, !1);
|
24878 | $$.getShapeByIndex(v, i, id).classed(config_classes.EXPANDED, expand);
|
24879 | });
|
24880 | },
|
24881 |
|
24882 | /**
|
24883 | * Handle data.onover/out callback options
|
24884 | * @param {boolean} isOver Over or not
|
24885 | * @param {number|object} d data object
|
24886 | * @private
|
24887 | */
|
24888 | setOverOut: function setOverOut(isOver, d) {
|
24889 | var $$ = this,
|
24890 | config = $$.config,
|
24891 | hasRadar = $$.state.hasRadar,
|
24892 | main = $$.$el.main,
|
24893 | isArc = isObject(d);
|
24894 |
|
24895 | // Call event handler
|
24896 | if (isArc || d !== -1) {
|
24897 | var callback = config[isOver ? "data_onover" : "data_onout"].bind($$.api);
|
24898 | config.color_onover && $$.setOverColor(isOver, d, isArc);
|
24899 |
|
24900 | if (isArc) {
|
24901 | callback(d, main.select("." + config_classes.arc + $$.getTargetSelectorSuffix(d.id)).node());
|
24902 | } else if (!config.tooltip_grouped) {
|
24903 | var last = $$.cache.get(KEY.setOverOut) || [],
|
24904 | shape = main.selectAll("." + config_classes.shape + "-" + d).filter(function (d) {
|
24905 | return $$.isWithinShape(this, d);
|
24906 | });
|
24907 | shape.each(function (d) {
|
24908 | var _this = this;
|
24909 |
|
24910 | if (last.length === 0 || last.every(function (v) {
|
24911 | return v !== _this;
|
24912 | })) {
|
24913 | callback(d, this);
|
24914 | last.push(this);
|
24915 | }
|
24916 | });
|
24917 |
|
24918 | if (last.length > 0 && shape.empty()) {
|
24919 | callback = config.data_onout.bind($$.api);
|
24920 | last.forEach(function (v) {
|
24921 | return callback(src_select(v).datum(), v);
|
24922 | });
|
24923 | last = [];
|
24924 | }
|
24925 |
|
24926 | $$.cache.add(KEY.setOverOut, last);
|
24927 | } else {
|
24928 | if (isOver) {
|
24929 | config.point_focus_only && hasRadar ? $$.showCircleFocus($$.getAllValuesOnIndex(d, !0)) : $$.setExpand(d, null, !0);
|
24930 | }
|
24931 |
|
24932 | $$.isMultipleX() || main.selectAll("." + config_classes.shape + "-" + d).each(function (d) {
|
24933 | callback(d, this);
|
24934 | });
|
24935 | }
|
24936 | }
|
24937 | },
|
24938 |
|
24939 | /**
|
24940 | * Call data.onover/out callback for touch event
|
24941 | * @param {number|object} d target index or data object for Arc type
|
24942 | * @private
|
24943 | */
|
24944 | callOverOutForTouch: function callOverOutForTouch(d) {
|
24945 | var $$ = this,
|
24946 | last = $$.cache.get(KEY.callOverOutForTouch);
|
24947 |
|
24948 | if (isObject(d) && last ? d.id !== last.id : d !== last) {
|
24949 | (last || isNumber(last)) && $$.setOverOut(!1, last);
|
24950 | (d || isNumber(d)) && $$.setOverOut(!0, d);
|
24951 | $$.cache.add(KEY.callOverOutForTouch, d);
|
24952 | }
|
24953 | },
|
24954 |
|
24955 | /**
|
24956 | * Return draggable selection function
|
24957 | * @returns {Function}
|
24958 | * @private
|
24959 | */
|
24960 | getDraggableSelection: function getDraggableSelection() {
|
24961 | var $$ = this,
|
24962 | config = $$.config,
|
24963 | state = $$.state;
|
24964 | return config.interaction_enabled && config.data_selection_draggable && $$.drag ? drag().on("drag", function (event) {
|
24965 | state.event = event;
|
24966 | $$.drag(getPointer(event, this));
|
24967 | }).on("start", function (event) {
|
24968 | state.event = event;
|
24969 | $$.dragstart(getPointer(event, this));
|
24970 | }).on("end", function (event) {
|
24971 | state.event = event;
|
24972 | $$.dragend();
|
24973 | }) : function () {};
|
24974 | },
|
24975 |
|
24976 | /**
|
24977 | * Dispatch a mouse event.
|
24978 | * @private
|
24979 | * @param {string} type event type
|
24980 | * @param {number} index Index of eventRect
|
24981 | * @param {Array} mouse x and y coordinate value
|
24982 | */
|
24983 | dispatchEvent: function dispatchEvent(type, index, mouse) {
|
24984 | var $$ = this,
|
24985 | config = $$.config,
|
24986 | _$$$state = $$.state,
|
24987 | eventReceiver = _$$$state.eventReceiver,
|
24988 | hasAxis = _$$$state.hasAxis,
|
24989 | hasRadar = _$$$state.hasRadar,
|
24990 | _$$$$el = $$.$el,
|
24991 | eventRect = _$$$$el.eventRect,
|
24992 | arcs = _$$$$el.arcs,
|
24993 | radar = _$$$$el.radar,
|
24994 | isMultipleX = $$.isMultipleX(),
|
24995 | element = (hasRadar ? radar.axes.select("." + config_classes.axis + "-" + index + " text") : eventRect || arcs.selectAll("." + config_classes.target + " path").filter(function (d, i) {
|
24996 | return i === index;
|
24997 | })).node(),
|
24998 | _element$getBoundingC = element.getBoundingClientRect(),
|
24999 | width = _element$getBoundingC.width,
|
25000 | left = _element$getBoundingC.left,
|
25001 | top = _element$getBoundingC.top;
|
25002 |
|
25003 | if (hasAxis && !hasRadar && !isMultipleX) {
|
25004 | var coords = eventReceiver.coords[index];
|
25005 | width = coords.w;
|
25006 | left += coords.x;
|
25007 | top += coords.y;
|
25008 | }
|
25009 |
|
25010 | var x = left + (mouse ? mouse[0] : 0) + (isMultipleX || config.axis_rotated ? 0 : width / 2),
|
25011 | y = top + (mouse ? mouse[1] : 0);
|
25012 | emulateEvent[/^(mouse|click)/.test(type) ? "mouse" : "touch"](element, type, {
|
25013 | screenX: x,
|
25014 | screenY: y,
|
25015 | clientX: x,
|
25016 | clientY: y
|
25017 | });
|
25018 | },
|
25019 | setDragStatus: function setDragStatus(isDragging) {
|
25020 | this.state.dragging = isDragging;
|
25021 | },
|
25022 |
|
25023 | /**
|
25024 | * Unbind zoom events
|
25025 | * @private
|
25026 | */
|
25027 | unbindZoomEvent: function unbindZoomEvent() {
|
25028 | var _zoomResetBtn,
|
25029 | $$ = this,
|
25030 | _$$$$el2 = $$.$el,
|
25031 | eventRect = _$$$$el2.eventRect,
|
25032 | zoomResetBtn = _$$$$el2.zoomResetBtn;
|
25033 |
|
25034 | eventRect.on(".zoom", null).on(".drag", null);
|
25035 | (_zoomResetBtn = zoomResetBtn) == null ? void 0 : _zoomResetBtn.style("display", "none");
|
25036 | }
|
25037 | });
|
25038 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/class.ts
|
25039 | /**
|
25040 | * Copyright (c) 2017 ~ present NAVER Corp.
|
25041 | * billboard.js project is licensed under the MIT license
|
25042 | */
|
25043 |
|
25044 | /* harmony default export */ var internals_class = ({
|
25045 | generateClass: function generateClass(prefix, targetId) {
|
25046 | return " " + prefix + " " + (prefix + this.getTargetSelectorSuffix(targetId));
|
25047 | },
|
25048 |
|
25049 | /**
|
25050 | * Get class string
|
25051 | * @param {string} type Shape type
|
25052 | * @param {boolean} withShape Get with shape prefix
|
25053 | * @returns {string} Class string
|
25054 | * @private
|
25055 | */
|
25056 | getClass: function getClass(type, withShape) {
|
25057 | var _this = this,
|
25058 | isPlural = /s$/.test(type),
|
25059 | useIdKey = /^(area|arc|line)s?$/.test(type),
|
25060 | key = isPlural ? "id" : "index";
|
25061 |
|
25062 | return function (d) {
|
25063 | var data = d.data || d,
|
25064 | result = (withShape ? _this.generateClass(config_classes[isPlural ? "shapes" : "shape"], data[key]) : "") + _this.generateClass(config_classes[type], data[useIdKey ? "id" : key]);
|
25065 |
|
25066 | return result.trim();
|
25067 | };
|
25068 | },
|
25069 |
|
25070 | /**
|
25071 | * Get chart class string
|
25072 | * @param {string} type Shape type
|
25073 | * @returns {string} Class string
|
25074 | * @private
|
25075 | */
|
25076 | getChartClass: function getChartClass(type) {
|
25077 | var _this2 = this;
|
25078 |
|
25079 | return function (d) {
|
25080 | return config_classes["chart" + type] + _this2.classTarget((d.data ? d.data : d).id);
|
25081 | };
|
25082 | },
|
25083 | generateExtraLineClass: function generateExtraLineClass() {
|
25084 | var $$ = this,
|
25085 | classes = $$.config.line_classes || [],
|
25086 | ids = [];
|
25087 | return function (d) {
|
25088 | var _d$data,
|
25089 | id = d.id || ((_d$data = d.data) == null ? void 0 : _d$data.id) || d;
|
25090 |
|
25091 | if (ids.indexOf(id) < 0) {
|
25092 | ids.push(id);
|
25093 | }
|
25094 |
|
25095 | return classes[ids.indexOf(id) % classes.length];
|
25096 | };
|
25097 | },
|
25098 | classRegion: function classRegion(d, i) {
|
25099 | return this.generateClass(config_classes.region, i) + " " + ("class" in d ? d.class : "");
|
25100 | },
|
25101 | classTarget: function classTarget(id) {
|
25102 | var additionalClassSuffix = this.config.data_classes[id],
|
25103 | additionalClass = "";
|
25104 |
|
25105 | if (additionalClassSuffix) {
|
25106 | additionalClass = " " + config_classes.target + "-" + additionalClassSuffix;
|
25107 | }
|
25108 |
|
25109 | return this.generateClass(config_classes.target, id) + additionalClass;
|
25110 | },
|
25111 | classFocus: function classFocus(d) {
|
25112 | return this.classFocused(d) + this.classDefocused(d);
|
25113 | },
|
25114 | classFocused: function classFocused(d) {
|
25115 | return " " + (this.state.focusedTargetIds.indexOf(d.id) >= 0 ? config_classes.focused : "");
|
25116 | },
|
25117 | classDefocused: function classDefocused(d) {
|
25118 | return " " + (this.state.defocusedTargetIds.indexOf(d.id) >= 0 ? config_classes.defocused : "");
|
25119 | },
|
25120 | getTargetSelectorSuffix: function getTargetSelectorSuffix(targetId) {
|
25121 | var targetStr = targetId || targetId === 0 ? "-" + targetId : "";
|
25122 | return targetStr.replace(/([\s?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\])/g, "-");
|
25123 | },
|
25124 | selectorTarget: function selectorTarget(id, prefix) {
|
25125 | var pfx = prefix || "",
|
25126 | target = this.getTargetSelectorSuffix(id);
|
25127 | // select target & circle
|
25128 | return pfx + "." + (config_classes.target + target) + ", " + pfx + "." + (config_classes.circles + target);
|
25129 | },
|
25130 | selectorTargets: function selectorTargets(idsValue, prefix) {
|
25131 | var _this3 = this,
|
25132 | ids = idsValue || [];
|
25133 |
|
25134 | return ids.length ? ids.map(function (id) {
|
25135 | return _this3.selectorTarget(id, prefix);
|
25136 | }) : null;
|
25137 | },
|
25138 | selectorLegend: function selectorLegend(id) {
|
25139 | return "." + (config_classes.legendItem + this.getTargetSelectorSuffix(id));
|
25140 | },
|
25141 | selectorLegends: function selectorLegends(ids) {
|
25142 | var _this4 = this;
|
25143 |
|
25144 | return ids != null && ids.length ? ids.map(function (id) {
|
25145 | return _this4.selectorLegend(id);
|
25146 | }) : null;
|
25147 | }
|
25148 | });
|
25149 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/category.ts
|
25150 | /**
|
25151 | * Copyright (c) 2017 ~ present NAVER Corp.
|
25152 | * billboard.js project is licensed under the MIT license
|
25153 | */
|
25154 | /* harmony default export */ var category = ({
|
25155 | /**
|
25156 | * Category Name
|
25157 | * @param {number} i Index number
|
25158 | * @returns {string} category Name
|
25159 | * @private
|
25160 | */
|
25161 | categoryName: function categoryName(i) {
|
25162 | var categories = this.config.axis_x_categories;
|
25163 | return i < (categories == null ? void 0 : categories.length) ? categories[i] : i;
|
25164 | }
|
25165 | });
|
25166 | ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
|
25167 | function _assertThisInitialized(self) {
|
25168 | if (self === void 0) {
|
25169 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
25170 | }
|
25171 |
|
25172 | return self;
|
25173 | }
|
25174 | ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
|
25175 | function _setPrototypeOf(o, p) {
|
25176 | _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
25177 | o.__proto__ = p;
|
25178 | return o;
|
25179 | };
|
25180 |
|
25181 | return _setPrototypeOf(o, p);
|
25182 | }
|
25183 | ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
|
25184 |
|
25185 | function _inheritsLoose(subClass, superClass) {
|
25186 | subClass.prototype = Object.create(superClass.prototype);
|
25187 | subClass.prototype.constructor = subClass;
|
25188 | _setPrototypeOf(subClass, superClass);
|
25189 | }
|
25190 | ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
|
25191 | function _getPrototypeOf(o) {
|
25192 | _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
25193 | return o.__proto__ || Object.getPrototypeOf(o);
|
25194 | };
|
25195 | return _getPrototypeOf(o);
|
25196 | }
|
25197 | ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/isNativeFunction.js
|
25198 | function _isNativeFunction(fn) {
|
25199 | return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
25200 | }
|
25201 | ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js
|
25202 | function _isNativeReflectConstruct() {
|
25203 | if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
25204 | if (Reflect.construct.sham) return false;
|
25205 | if (typeof Proxy === "function") return true;
|
25206 |
|
25207 | try {
|
25208 | Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
25209 | return true;
|
25210 | } catch (e) {
|
25211 | return false;
|
25212 | }
|
25213 | }
|
25214 | ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/construct.js
|
25215 |
|
25216 |
|
25217 | function _construct(Parent, args, Class) {
|
25218 | if (_isNativeReflectConstruct()) {
|
25219 | _construct = Reflect.construct;
|
25220 | } else {
|
25221 | _construct = function _construct(Parent, args, Class) {
|
25222 | var a = [null];
|
25223 | a.push.apply(a, args);
|
25224 | var Constructor = Function.bind.apply(Parent, a);
|
25225 | var instance = new Constructor();
|
25226 | if (Class) _setPrototypeOf(instance, Class.prototype);
|
25227 | return instance;
|
25228 | };
|
25229 | }
|
25230 |
|
25231 | return _construct.apply(null, arguments);
|
25232 | }
|
25233 | ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js
|
25234 |
|
25235 |
|
25236 |
|
25237 |
|
25238 | function _wrapNativeSuper(Class) {
|
25239 | var _cache = typeof Map === "function" ? new Map() : undefined;
|
25240 |
|
25241 | _wrapNativeSuper = function _wrapNativeSuper(Class) {
|
25242 | if (Class === null || !_isNativeFunction(Class)) return Class;
|
25243 |
|
25244 | if (typeof Class !== "function") {
|
25245 | throw new TypeError("Super expression must either be null or a function");
|
25246 | }
|
25247 |
|
25248 | if (typeof _cache !== "undefined") {
|
25249 | if (_cache.has(Class)) return _cache.get(Class);
|
25250 |
|
25251 | _cache.set(Class, Wrapper);
|
25252 | }
|
25253 |
|
25254 | function Wrapper() {
|
25255 | return _construct(Class, arguments, _getPrototypeOf(this).constructor);
|
25256 | }
|
25257 |
|
25258 | Wrapper.prototype = Object.create(Class.prototype, {
|
25259 | constructor: {
|
25260 | value: Wrapper,
|
25261 | enumerable: false,
|
25262 | writable: true,
|
25263 | configurable: true
|
25264 | }
|
25265 | });
|
25266 | return _setPrototypeOf(Wrapper, Class);
|
25267 | };
|
25268 |
|
25269 | return _wrapNativeSuper(Class);
|
25270 | }
|
25271 | ;// CONCATENATED MODULE: ./node_modules/internmap/src/index.js
|
25272 |
|
25273 |
|
25274 |
|
25275 |
|
25276 | function src_createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = src_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: !0 }; return { 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."); }
|
25277 |
|
25278 | function src_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return src_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return src_arrayLikeToArray(o, minLen); }
|
25279 |
|
25280 | function src_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
25281 |
|
25282 | var InternMap = /*#__PURE__*/function (_Map) {
|
25283 | _inheritsLoose(InternMap, _Map);
|
25284 |
|
25285 | function InternMap(entries, key) {
|
25286 | var _this;
|
25287 |
|
25288 | if (key === void 0) {
|
25289 | key = keyof;
|
25290 | }
|
25291 |
|
25292 | _this = _Map.call(this) || this;
|
25293 | Object.defineProperties(_assertThisInitialized(_this), {
|
25294 | _intern: {
|
25295 | value: new Map()
|
25296 | },
|
25297 | _key: {
|
25298 | value: key
|
25299 | }
|
25300 | });
|
25301 |
|
25302 | if (entries != null) {
|
25303 | for (var _iterator = src_createForOfIteratorHelperLoose(entries), _step; !(_step = _iterator()).done;) {
|
25304 | var _step$value = _step.value,
|
25305 | _key2 = _step$value[0],
|
25306 | value = _step$value[1];
|
25307 |
|
25308 | _this.set(_key2, value);
|
25309 | }
|
25310 | }
|
25311 |
|
25312 | return _this;
|
25313 | }
|
25314 |
|
25315 | var _proto = InternMap.prototype;
|
25316 |
|
25317 | _proto.get = function get(key) {
|
25318 | return _Map.prototype.get.call(this, intern_get(this, key));
|
25319 | };
|
25320 |
|
25321 | _proto.has = function has(key) {
|
25322 | return _Map.prototype.has.call(this, intern_get(this, key));
|
25323 | };
|
25324 |
|
25325 | _proto.set = function set(key, value) {
|
25326 | return _Map.prototype.set.call(this, intern_set(this, key), value);
|
25327 | };
|
25328 |
|
25329 | _proto.delete = function _delete(key) {
|
25330 | return _Map.prototype.delete.call(this, intern_delete(this, key));
|
25331 | };
|
25332 |
|
25333 | return InternMap;
|
25334 | }( /*#__PURE__*/_wrapNativeSuper(Map));
|
25335 | var InternSet = /*#__PURE__*/function (_Set) {
|
25336 | _inheritsLoose(InternSet, _Set);
|
25337 |
|
25338 | function InternSet(values, key) {
|
25339 | var _this2;
|
25340 |
|
25341 | if (key === void 0) {
|
25342 | key = keyof;
|
25343 | }
|
25344 |
|
25345 | _this2 = _Set.call(this) || this;
|
25346 | Object.defineProperties(_assertThisInitialized(_this2), {
|
25347 | _intern: {
|
25348 | value: new Map()
|
25349 | },
|
25350 | _key: {
|
25351 | value: key
|
25352 | }
|
25353 | });
|
25354 |
|
25355 | if (values != null) {
|
25356 | for (var _iterator2 = src_createForOfIteratorHelperLoose(values), _step2, value; !(_step2 = _iterator2()).done;) {
|
25357 | value = _step2.value;
|
25358 |
|
25359 | _this2.add(value);
|
25360 | }
|
25361 | }
|
25362 |
|
25363 | return _this2;
|
25364 | }
|
25365 |
|
25366 | var _proto2 = InternSet.prototype;
|
25367 |
|
25368 | _proto2.has = function has(value) {
|
25369 | return _Set.prototype.has.call(this, intern_get(this, value));
|
25370 | };
|
25371 |
|
25372 | _proto2.add = function add(value) {
|
25373 | return _Set.prototype.add.call(this, intern_set(this, value));
|
25374 | };
|
25375 |
|
25376 | _proto2.delete = function _delete(value) {
|
25377 | return _Set.prototype.delete.call(this, intern_delete(this, value));
|
25378 | };
|
25379 |
|
25380 | return InternSet;
|
25381 | }( /*#__PURE__*/_wrapNativeSuper(Set));
|
25382 |
|
25383 | function intern_get(_ref, value) {
|
25384 | var _intern = _ref._intern,
|
25385 | _key = _ref._key,
|
25386 | key = _key(value);
|
25387 |
|
25388 | return _intern.has(key) ? _intern.get(key) : value;
|
25389 | }
|
25390 |
|
25391 | function intern_set(_ref2, value) {
|
25392 | var _intern = _ref2._intern,
|
25393 | _key = _ref2._key,
|
25394 | key = _key(value);
|
25395 |
|
25396 | if (_intern.has(key)) return _intern.get(key);
|
25397 |
|
25398 | _intern.set(key, value);
|
25399 |
|
25400 | return value;
|
25401 | }
|
25402 |
|
25403 | function intern_delete(_ref3, value) {
|
25404 | var _intern = _ref3._intern,
|
25405 | _key = _ref3._key,
|
25406 | key = _key(value);
|
25407 |
|
25408 | if (_intern.has(key)) {
|
25409 | value = _intern.get(key);
|
25410 |
|
25411 | _intern.delete(key);
|
25412 | }
|
25413 |
|
25414 | return value;
|
25415 | }
|
25416 |
|
25417 | function keyof(value) {
|
25418 | return value !== null && typeof value === "object" ? value.valueOf() : value;
|
25419 | }
|
25420 | ;// CONCATENATED MODULE: ./node_modules/d3-scale/src/init.js
|
25421 | function initRange(domain, range) {
|
25422 | switch (arguments.length) {
|
25423 | case 0:
|
25424 | break;
|
25425 |
|
25426 | case 1:
|
25427 | this.range(domain);
|
25428 | break;
|
25429 |
|
25430 | default:
|
25431 | this.range(range).domain(domain);
|
25432 | break;
|
25433 | }
|
25434 |
|
25435 | return this;
|
25436 | }
|
25437 | function initInterpolator(domain, interpolator) {
|
25438 | switch (arguments.length) {
|
25439 | case 0:
|
25440 | break;
|
25441 |
|
25442 | case 1:
|
25443 | {
|
25444 | if (typeof domain === "function") this.interpolator(domain);else this.range(domain);
|
25445 | break;
|
25446 | }
|
25447 |
|
25448 | default:
|
25449 | {
|
25450 | this.domain(domain);
|
25451 | if (typeof interpolator === "function") this.interpolator(interpolator);else this.range(interpolator);
|
25452 | break;
|
25453 | }
|
25454 | }
|
25455 |
|
25456 | return this;
|
25457 | }
|
25458 | ;// CONCATENATED MODULE: ./node_modules/d3-scale/src/ordinal.js
|
25459 | function ordinal_createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = ordinal_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: !0 }; return { 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."); }
|
25460 |
|
25461 | function ordinal_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return ordinal_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ordinal_arrayLikeToArray(o, minLen); }
|
25462 |
|
25463 | function ordinal_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
25464 |
|
25465 |
|
25466 |
|
25467 | var implicit = Symbol("implicit");
|
25468 | function ordinal() {
|
25469 | var index = new InternMap(),
|
25470 | domain = [],
|
25471 | range = [],
|
25472 | unknown = implicit;
|
25473 |
|
25474 | function scale(d) {
|
25475 | var i = index.get(d);
|
25476 |
|
25477 | if (i === undefined) {
|
25478 | if (unknown !== implicit) return unknown;
|
25479 | index.set(d, i = domain.push(d) - 1);
|
25480 | }
|
25481 |
|
25482 | return range[i % range.length];
|
25483 | }
|
25484 |
|
25485 | scale.domain = function (_) {
|
25486 | if (!arguments.length) return domain.slice();
|
25487 | domain = [], index = new InternMap();
|
25488 |
|
25489 | for (var _iterator = ordinal_createForOfIteratorHelperLoose(_), _step; !(_step = _iterator()).done;) {
|
25490 | var value = _step.value;
|
25491 | if (index.has(value)) continue;
|
25492 | index.set(value, domain.push(value) - 1);
|
25493 | }
|
25494 |
|
25495 | return scale;
|
25496 | };
|
25497 |
|
25498 | scale.range = function (_) {
|
25499 | return arguments.length ? (range = Array.from(_), scale) : range.slice();
|
25500 | };
|
25501 |
|
25502 | scale.unknown = function (_) {
|
25503 | return arguments.length ? (unknown = _, scale) : unknown;
|
25504 | };
|
25505 |
|
25506 | scale.copy = function () {
|
25507 | return ordinal(domain, range).unknown(unknown);
|
25508 | };
|
25509 |
|
25510 | initRange.apply(scale, arguments);
|
25511 | return scale;
|
25512 | }
|
25513 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/color.ts
|
25514 | /**
|
25515 | * Copyright (c) 2017 ~ present NAVER Corp.
|
25516 | * billboard.js project is licensed under the MIT license
|
25517 | */
|
25518 |
|
25519 |
|
25520 |
|
25521 |
|
25522 |
|
25523 |
|
25524 | /**
|
25525 | * Set pattern's background color
|
25526 | * (it adds a <rect> element to simulate bg-color)
|
25527 | * @param {SVGPatternElement} pattern SVG pattern element
|
25528 | * @param {string} color Color string
|
25529 | * @param {string} id ID to be set
|
25530 | * @returns {{id: string, node: SVGPatternElement}}
|
25531 | * @private
|
25532 | */
|
25533 |
|
25534 | var colorizePattern = function (pattern, color, id) {
|
25535 | var node = src_select(pattern.cloneNode(!0));
|
25536 | node.attr("id", id).insert("rect", ":first-child").attr("width", node.attr("width")).attr("height", node.attr("height")).style("fill", color);
|
25537 | return {
|
25538 | id: id,
|
25539 | node: node.node()
|
25540 | };
|
25541 | },
|
25542 | schemeCategory10 = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "#8c564b", "#e377c2", "#7f7f7f", "#bcbd22", "#17becf"]; // Replacement of d3.schemeCategory10.
|
25543 | // Contained differently depend on d3 version: v4(d3-scale), v5(d3-scale-chromatic)
|
25544 |
|
25545 |
|
25546 | /* harmony default export */ var internals_color = ({
|
25547 | /**
|
25548 | * Get color pattern from CSS file
|
25549 | * CSS should be defined as: background-image: url("#00c73c;#fa7171; ...");
|
25550 | * @returns {Array}
|
25551 | * @private
|
25552 | */
|
25553 | getColorFromCss: function getColorFromCss() {
|
25554 | var cacheKey = KEY.colorPattern,
|
25555 | body = browser_doc.body,
|
25556 | pattern = body[cacheKey];
|
25557 |
|
25558 | if (!pattern) {
|
25559 | var span = browser_doc.createElement("span");
|
25560 | span.className = config_classes.colorPattern;
|
25561 | span.style.display = "none";
|
25562 | body.appendChild(span);
|
25563 | var content = win.getComputedStyle(span).backgroundImage;
|
25564 | span.parentNode.removeChild(span);
|
25565 |
|
25566 | if (content.indexOf(";") > -1) {
|
25567 | pattern = content.replace(/url[^#]*|["'()]|(\s|%20)/g, "").split(";").map(function (v) {
|
25568 | return v.trim().replace(/[\"'\s]/g, "");
|
25569 | }).filter(Boolean);
|
25570 | body[cacheKey] = pattern;
|
25571 | }
|
25572 | }
|
25573 |
|
25574 | return pattern;
|
25575 | },
|
25576 | generateColor: function generateColor() {
|
25577 | var $$ = this,
|
25578 | config = $$.config,
|
25579 | colors = config.data_colors,
|
25580 | callback = config.data_color,
|
25581 | ids = [],
|
25582 | pattern = notEmpty(config.color_pattern) ? config.color_pattern : ordinal($$.getColorFromCss() || schemeCategory10).range(),
|
25583 | originalColorPattern = pattern;
|
25584 |
|
25585 | if (isFunction(config.color_tiles)) {
|
25586 | var tiles = config.color_tiles.bind($$.api)(),
|
25587 | colorizedPatterns = pattern.map(function (p, index) {
|
25588 | var color = p.replace(/[#\(\)\s,]/g, ""),
|
25589 | id = $$.state.datetimeId + "-pattern-" + color + "-" + index;
|
25590 | return colorizePattern(tiles[index % tiles.length], p, id);
|
25591 | }); // Add background color to patterns
|
25592 |
|
25593 | pattern = colorizedPatterns.map(function (p) {
|
25594 | return "url(#" + p.id + ")";
|
25595 | });
|
25596 | $$.patterns = colorizedPatterns;
|
25597 | }
|
25598 |
|
25599 | return function (d) {
|
25600 | var _d$data,
|
25601 | id = d.id || ((_d$data = d.data) == null ? void 0 : _d$data.id) || d,
|
25602 | isLine = $$.isTypeOf(id, ["line", "spline", "step"]) || !config.data_types[id],
|
25603 | color;
|
25604 |
|
25605 | // if callback function is provided
|
25606 | if (isFunction(colors[id])) {
|
25607 | color = colors[id].bind($$.api)(d); // if specified, choose that color
|
25608 | } else if (colors[id]) {
|
25609 | color = colors[id]; // if not specified, choose from pattern
|
25610 | } else {
|
25611 | if (ids.indexOf(id) < 0) {
|
25612 | ids.push(id);
|
25613 | }
|
25614 |
|
25615 | color = isLine ? originalColorPattern[ids.indexOf(id) % originalColorPattern.length] : pattern[ids.indexOf(id) % pattern.length];
|
25616 | colors[id] = color;
|
25617 | }
|
25618 |
|
25619 | return isFunction(callback) ? callback.bind($$.api)(color, d) : color;
|
25620 | };
|
25621 | },
|
25622 | generateLevelColor: function generateLevelColor() {
|
25623 | var $$ = this,
|
25624 | config = $$.config,
|
25625 | colors = config.color_pattern,
|
25626 | threshold = config.color_threshold,
|
25627 | asValue = threshold.unit === "value",
|
25628 | max = threshold.max || 100,
|
25629 | values = threshold.values && threshold.values.length ? threshold.values : [];
|
25630 | return notEmpty(threshold) ? function (value) {
|
25631 | var v = asValue ? value : value * 100 / max,
|
25632 | color = colors[colors.length - 1];
|
25633 |
|
25634 | for (var i = 0, l = values.length; i < l; i++) {
|
25635 | if (v <= values[i]) {
|
25636 | color = colors[i];
|
25637 | break;
|
25638 | }
|
25639 | }
|
25640 |
|
25641 | return color;
|
25642 | } : null;
|
25643 | },
|
25644 |
|
25645 | /**
|
25646 | * Append data backgound color filter definition
|
25647 | * @private
|
25648 | */
|
25649 | generateDataLabelBackgroundColorFilter: function generateDataLabelBackgroundColorFilter() {
|
25650 | var $$ = this,
|
25651 | $el = $$.$el,
|
25652 | config = $$.config,
|
25653 | state = $$.state,
|
25654 | backgroundColors = config.data_labels_backgroundColors;
|
25655 |
|
25656 | if (backgroundColors) {
|
25657 | var ids = [];
|
25658 |
|
25659 | if (isString(backgroundColors)) {
|
25660 | ids.push("");
|
25661 | } else if (isObject(backgroundColors)) {
|
25662 | ids = Object.keys(backgroundColors);
|
25663 | }
|
25664 |
|
25665 | ids.forEach(function (v) {
|
25666 | var id = state.datetimeId + "-labels-bg" + $$.getTargetSelectorSuffix(v);
|
25667 | $el.defs.append("filter").attr("x", "0").attr("y", "0").attr("width", "1").attr("height", "1").attr("id", id).html("<feFlood flood-color=\"" + (v === "" ? backgroundColors : backgroundColors[v]) + "\" /><feComposite in=\"SourceGraphic\"/>");
|
25668 | });
|
25669 | }
|
25670 | },
|
25671 |
|
25672 | /**
|
25673 | * Set the data over color.
|
25674 | * When is out, will restate in its previous color value
|
25675 | * @param {boolean} isOver true: set overed color, false: restore
|
25676 | * @param {number|object} d target index or data object for Arc type
|
25677 | * @private
|
25678 | */
|
25679 | setOverColor: function setOverColor(isOver, d) {
|
25680 | var $$ = this,
|
25681 | config = $$.config,
|
25682 | main = $$.$el.main,
|
25683 | onover = config.color_onover,
|
25684 | color = isOver ? onover : $$.color;
|
25685 |
|
25686 | if (isObject(color)) {
|
25687 | color = function (_ref) {
|
25688 | var id = _ref.id;
|
25689 | return id in onover ? onover[id] : $$.color(id);
|
25690 | };
|
25691 | } else if (isString(color)) {
|
25692 | color = function () {
|
25693 | return onover;
|
25694 | };
|
25695 | } else if (isFunction(onover)) {
|
25696 | color = color.bind($$.api);
|
25697 | }
|
25698 |
|
25699 | main.selectAll(isObject(d) ? // when is Arc type
|
25700 | "." + config_classes.arc + $$.getTargetSelectorSuffix(d.id) : "." + config_classes.shape + "-" + d).style("fill", color);
|
25701 | }
|
25702 | });
|
25703 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/domain.ts
|
25704 | /**
|
25705 | * Copyright (c) 2017 ~ present NAVER Corp.
|
25706 | * billboard.js project is licensed under the MIT license
|
25707 | */
|
25708 |
|
25709 |
|
25710 | /* harmony default export */ var domain = ({
|
25711 | getYDomainMinMax: function getYDomainMinMax(targets, type) {
|
25712 | var $$ = this,
|
25713 | axis = $$.axis,
|
25714 | config = $$.config,
|
25715 | isMin = type === "min",
|
25716 | dataGroups = config.data_groups,
|
25717 | ids = $$.mapToIds(targets),
|
25718 | ys = $$.getValuesAsIdKeyed(targets);
|
25719 |
|
25720 | if (dataGroups.length > 0) {
|
25721 | var hasValue = $$["has" + (isMin ? "Negative" : "Positive") + "ValueInTargets"](targets);
|
25722 | dataGroups.forEach(function (groupIds) {
|
25723 | // Determine baseId
|
25724 | var idsInGroup = groupIds.filter(function (v) {
|
25725 | return ids.indexOf(v) >= 0;
|
25726 | });
|
25727 |
|
25728 | if (idsInGroup.length) {
|
25729 | var baseId = idsInGroup[0],
|
25730 | baseAxisId = axis.getId(baseId);
|
25731 |
|
25732 | // Initialize base value. Set to 0 if not match with the condition
|
25733 | if (hasValue && ys[baseId]) {
|
25734 | ys[baseId] = ys[baseId].map(function (v) {
|
25735 | return (isMin ? v < 0 : v > 0) ? v : 0;
|
25736 | });
|
25737 | }
|
25738 |
|
25739 | idsInGroup.filter(function (v, i) {
|
25740 | return i > 0;
|
25741 | }).forEach(function (id) {
|
25742 | if (ys[id]) {
|
25743 | var axisId = axis.getId(id);
|
25744 | ys[id].forEach(function (v, i) {
|
25745 | var val = +v,
|
25746 | meetCondition = isMin ? val > 0 : val < 0;
|
25747 |
|
25748 | if (axisId === baseAxisId && !(hasValue && meetCondition)) {
|
25749 | ys[baseId][i] += val;
|
25750 | }
|
25751 | });
|
25752 | }
|
25753 | });
|
25754 | }
|
25755 | });
|
25756 | }
|
25757 |
|
25758 | return getMinMax(type, Object.keys(ys).map(function (key) {
|
25759 | return getMinMax(type, ys[key]);
|
25760 | }));
|
25761 | },
|
25762 |
|
25763 | /**
|
25764 | * Check if hidden targets bound to the given axis id
|
25765 | * @param {string} id ID to be checked
|
25766 | * @returns {boolean}
|
25767 | * @private
|
25768 | */
|
25769 | isHiddenTargetWithYDomain: function isHiddenTargetWithYDomain(id) {
|
25770 | var $$ = this;
|
25771 | return $$.state.hiddenTargetIds.some(function (v) {
|
25772 | return $$.axis.getId(v) === id;
|
25773 | });
|
25774 | },
|
25775 | getYDomain: function getYDomain(targets, axisId, xDomain) {
|
25776 | var _scale,
|
25777 | $$ = this,
|
25778 | axis = $$.axis,
|
25779 | config = $$.config,
|
25780 | scale = $$.scale,
|
25781 | pfx = "axis_" + axisId;
|
25782 |
|
25783 | if ($$.isStackNormalized()) {
|
25784 | return [0, 100];
|
25785 | }
|
25786 |
|
25787 | var isLog = ((_scale = scale) == null ? void 0 : _scale[axisId]) && scale[axisId].type === "log",
|
25788 | targetsByAxisId = targets.filter(function (t) {
|
25789 | return axis.getId(t.id) === axisId;
|
25790 | }),
|
25791 | yTargets = xDomain ? $$.filterByXDomain(targetsByAxisId, xDomain) : targetsByAxisId;
|
25792 |
|
25793 | if (yTargets.length === 0) {
|
25794 | // use domain of the other axis if target of axisId is none
|
25795 | if ($$.isHiddenTargetWithYDomain(axisId)) {
|
25796 | return scale[axisId].domain();
|
25797 | } else {
|
25798 | return axisId === "y2" ? scale.y.domain() : // When all data bounds to y2, y Axis domain is called prior y2.
|
25799 | // So, it needs to call to get y2 domain here
|
25800 | $$.getYDomain(targets, "y2", xDomain);
|
25801 | }
|
25802 | }
|
25803 |
|
25804 | var yMin = config[pfx + "_min"],
|
25805 | yMax = config[pfx + "_max"],
|
25806 | center = config[pfx + "_center"],
|
25807 | isInverted = config[pfx + "_inverted"],
|
25808 | showHorizontalDataLabel = $$.hasDataLabel() && config.axis_rotated,
|
25809 | showVerticalDataLabel = $$.hasDataLabel() && !config.axis_rotated,
|
25810 | yDomainMin = $$.getYDomainMinMax(yTargets, "min"),
|
25811 | yDomainMax = $$.getYDomainMinMax(yTargets, "max"),
|
25812 | isZeroBased = [TYPE.BAR, TYPE.BUBBLE, TYPE.SCATTER].concat(TYPE_BY_CATEGORY.Line).some(function (v) {
|
25813 | var type = v.indexOf("area") > -1 ? "area" : v;
|
25814 | return $$.hasType(v, yTargets) && config[type + "_zerobased"];
|
25815 | });
|
25816 | // MEMO: avoid inverting domain unexpectedly
|
25817 | yDomainMin = isValue(yMin) ? yMin : isValue(yMax) ? yDomainMin < yMax ? yDomainMin : yMax - 10 : yDomainMin;
|
25818 | yDomainMax = isValue(yMax) ? yMax : isValue(yMin) ? yMin < yDomainMax ? yDomainMax : yMin + 10 : yDomainMax;
|
25819 |
|
25820 | if (isNaN(yDomainMin)) {
|
25821 | // set minimum to zero when not number
|
25822 | yDomainMin = 0;
|
25823 | }
|
25824 |
|
25825 | if (isNaN(yDomainMax)) {
|
25826 | // set maximum to have same value as yDomainMin
|
25827 | yDomainMax = yDomainMin;
|
25828 | }
|
25829 |
|
25830 | if (yDomainMin === yDomainMax) {
|
25831 | yDomainMin < 0 ? yDomainMax = 0 : yDomainMin = 0;
|
25832 | }
|
25833 |
|
25834 | var isAllPositive = yDomainMin >= 0 && yDomainMax >= 0,
|
25835 | isAllNegative = yDomainMin <= 0 && yDomainMax <= 0;
|
25836 |
|
25837 | // Cancel zerobased if axis_*_min / axis_*_max specified
|
25838 | if (isValue(yMin) && isAllPositive || isValue(yMax) && isAllNegative) {
|
25839 | isZeroBased = !1;
|
25840 | } // Bar/Area chart should be 0-based if all positive|negative
|
25841 |
|
25842 |
|
25843 | if (isZeroBased) {
|
25844 | isAllPositive && (yDomainMin = 0);
|
25845 | isAllNegative && (yDomainMax = 0);
|
25846 | }
|
25847 |
|
25848 | var domainLength = Math.abs(yDomainMax - yDomainMin),
|
25849 | padding = {
|
25850 | top: domainLength * .1,
|
25851 | bottom: domainLength * .1
|
25852 | };
|
25853 |
|
25854 | if (isDefined(center)) {
|
25855 | var yDomainAbs = Math.max(Math.abs(yDomainMin), Math.abs(yDomainMax));
|
25856 | yDomainMax = center + yDomainAbs;
|
25857 | yDomainMin = center - yDomainAbs;
|
25858 | } // add padding for data label
|
25859 |
|
25860 |
|
25861 | if (showHorizontalDataLabel) {
|
25862 | var diff = diffDomain(scale.y.range()),
|
25863 | ratio = $$.getDataLabelLength(yDomainMin, yDomainMax, "width").map(function (v) {
|
25864 | return v / diff;
|
25865 | });
|
25866 | ["bottom", "top"].forEach(function (v, i) {
|
25867 | padding[v] += domainLength * (ratio[i] / (1 - ratio[0] - ratio[1]));
|
25868 | });
|
25869 | } else if (showVerticalDataLabel) {
|
25870 | var lengths = $$.getDataLabelLength(yDomainMin, yDomainMax, "height");
|
25871 | ["bottom", "top"].forEach(function (v, i) {
|
25872 | padding[v] += $$.convertPixelToScale("y", lengths[i], domainLength);
|
25873 | });
|
25874 | } // if padding is set, the domain will be updated relative the current domain value
|
25875 | // ex) $$.height=300, padding.top=150, domainLength=4 --> domain=6
|
25876 |
|
25877 |
|
25878 | var p = config[pfx + "_padding"];
|
25879 |
|
25880 | if (notEmpty(p)) {
|
25881 | ["bottom", "top"].forEach(function (v) {
|
25882 | padding[v] = axis.getPadding(p, v, padding[v], domainLength);
|
25883 | });
|
25884 | } // Bar/Area chart should be 0-based if all positive|negative
|
25885 |
|
25886 |
|
25887 | if (isZeroBased) {
|
25888 | isAllPositive && (padding.bottom = yDomainMin);
|
25889 | isAllNegative && (padding.top = -yDomainMax);
|
25890 | }
|
25891 |
|
25892 | var domain = isLog ? [yDomainMin, yDomainMax].map(function (v) {
|
25893 | return v < 0 ? 0 : v;
|
25894 | }) : [yDomainMin - padding.bottom, yDomainMax + padding.top];
|
25895 | return isInverted ? domain.reverse() : domain;
|
25896 | },
|
25897 | getXDomainMinMax: function getXDomainMinMax(targets, type) {
|
25898 | var _$$$axis,
|
25899 | $$ = this,
|
25900 | configValue = $$.config["axis_x_" + type],
|
25901 | dataValue = getMinMax(type, targets.map(function (t) {
|
25902 | return getMinMax(type, t.values.map(function (v) {
|
25903 | return v.x;
|
25904 | }));
|
25905 | })),
|
25906 | value = isObject(configValue) ? configValue.value : configValue;
|
25907 |
|
25908 | value = isDefined(value) && (_$$$axis = $$.axis) != null && _$$$axis.isTimeSeries() ? parseDate.bind(this)(value) : value;
|
25909 |
|
25910 | if (isObject(configValue) && configValue.fit && (type === "min" && value < dataValue || type === "max" && value > dataValue)) {
|
25911 | value = undefined;
|
25912 | }
|
25913 |
|
25914 | return isDefined(value) ? value : dataValue;
|
25915 | },
|
25916 |
|
25917 | /**
|
25918 | * Get x Axis padding
|
25919 | * @param {Array} domain x Axis domain
|
25920 | * @param {number} tickCount Tick count
|
25921 | * @returns {object} Padding object values with 'left' & 'right' key
|
25922 | * @private
|
25923 | */
|
25924 | getXDomainPadding: function getXDomainPadding(domain, tickCount) {
|
25925 | var $$ = this,
|
25926 | axis = $$.axis,
|
25927 | config = $$.config,
|
25928 | padding = config.axis_x_padding,
|
25929 | isTimeSeriesTickCount = axis.isTimeSeries() && tickCount,
|
25930 | diff = diffDomain(domain),
|
25931 | defaultValue;
|
25932 |
|
25933 | // determine default padding value
|
25934 | if (axis.isCategorized() || isTimeSeriesTickCount) {
|
25935 | defaultValue = 0;
|
25936 | } else if ($$.hasType("bar")) {
|
25937 | var maxDataCount = $$.getMaxDataCount();
|
25938 | defaultValue = maxDataCount > 1 ? diff / (maxDataCount - 1) / 2 : .5;
|
25939 | } else {
|
25940 | defaultValue = diff * .01;
|
25941 | }
|
25942 |
|
25943 | var _ref = isNumber(padding) ? {
|
25944 | left: padding,
|
25945 | right: padding
|
25946 | } : padding,
|
25947 | _ref$left = _ref.left,
|
25948 | left = _ref$left === void 0 ? defaultValue : _ref$left,
|
25949 | _ref$right = _ref.right,
|
25950 | right = _ref$right === void 0 ? defaultValue : _ref$right; // when the unit is pixel, convert pixels to axis scale value
|
25951 |
|
25952 |
|
25953 | if (padding.unit === "px") {
|
25954 | var domainLength = Math.abs(diff + diff * .2);
|
25955 | left = axis.getPadding(padding, "left", defaultValue, domainLength);
|
25956 | right = axis.getPadding(padding, "right", defaultValue, domainLength);
|
25957 | } else {
|
25958 | var range = diff + left + right;
|
25959 |
|
25960 | if (isTimeSeriesTickCount && range) {
|
25961 | var relativeTickWidth = diff / tickCount / range;
|
25962 | left = left / range / relativeTickWidth;
|
25963 | right = right / range / relativeTickWidth;
|
25964 | }
|
25965 | }
|
25966 |
|
25967 | return {
|
25968 | left: left,
|
25969 | right: right
|
25970 | };
|
25971 | },
|
25972 |
|
25973 | /**
|
25974 | * Get x Axis domain
|
25975 | * @param {Array} targets targets
|
25976 | * @returns {Array} x Axis domain
|
25977 | * @private
|
25978 | */
|
25979 | getXDomain: function getXDomain(targets) {
|
25980 | var $$ = this,
|
25981 | axis = $$.axis,
|
25982 | x = $$.scale.x,
|
25983 | domain = [$$.getXDomainMinMax(targets, "min"), $$.getXDomainMinMax(targets, "max")],
|
25984 | _domain = domain,
|
25985 | _domain$ = _domain[0],
|
25986 | min = _domain$ === void 0 ? 0 : _domain$,
|
25987 | _domain$2 = _domain[1],
|
25988 | max = _domain$2 === void 0 ? 0 : _domain$2;
|
25989 |
|
25990 | if (x.type !== "log") {
|
25991 | var isCategorized = axis.isCategorized(),
|
25992 | isTimeSeries = axis.isTimeSeries(),
|
25993 | padding = $$.getXDomainPadding(domain),
|
25994 | _domain2 = domain,
|
25995 | firstX = _domain2[0],
|
25996 | lastX = _domain2[1];
|
25997 |
|
25998 | // show center of x domain if min and max are the same
|
25999 | if (firstX - lastX === 0 && !isCategorized) {
|
26000 | if (isTimeSeries) {
|
26001 | firstX = new Date(firstX.getTime() * .5);
|
26002 | lastX = new Date(lastX.getTime() * 1.5);
|
26003 | } else {
|
26004 | firstX = firstX === 0 ? 1 : firstX * .5;
|
26005 | lastX = lastX === 0 ? -1 : lastX * 1.5;
|
26006 | }
|
26007 | }
|
26008 |
|
26009 | if (firstX || firstX === 0) {
|
26010 | min = isTimeSeries ? new Date(firstX.getTime() - padding.left) : firstX - padding.left;
|
26011 | }
|
26012 |
|
26013 | if (lastX || lastX === 0) {
|
26014 | max = isTimeSeries ? new Date(lastX.getTime() + padding.right) : lastX + padding.right;
|
26015 | }
|
26016 | }
|
26017 |
|
26018 | return [min, max];
|
26019 | },
|
26020 | updateXDomain: function updateXDomain(targets, withUpdateXDomain, withUpdateOrgXDomain, withTrim, domain) {
|
26021 | var $$ = this,
|
26022 | config = $$.config,
|
26023 | org = $$.org,
|
26024 | _$$$scale = $$.scale,
|
26025 | x = _$$$scale.x,
|
26026 | subX = _$$$scale.subX,
|
26027 | zoomEnabled = config.zoom_enabled;
|
26028 |
|
26029 | if (withUpdateOrgXDomain) {
|
26030 | var _$$$brush;
|
26031 |
|
26032 | x.domain(domain || sortValue($$.getXDomain(targets)));
|
26033 | org.xDomain = x.domain();
|
26034 | zoomEnabled && $$.zoom.updateScaleExtent();
|
26035 | subX.domain(x.domain());
|
26036 | (_$$$brush = $$.brush) == null ? void 0 : _$$$brush.scale(subX);
|
26037 | }
|
26038 |
|
26039 | if (withUpdateXDomain) {
|
26040 | var domainValue = domain || !$$.brush || brushEmpty($$) ? org.xDomain : getBrushSelection($$).map(subX.invert);
|
26041 | x.domain(domainValue);
|
26042 | zoomEnabled && $$.zoom.updateScaleExtent();
|
26043 | } // Trim domain when too big by zoom mousemove event
|
26044 |
|
26045 |
|
26046 | withTrim && x.domain($$.trimXDomain(x.orgDomain()));
|
26047 | return x.domain();
|
26048 | },
|
26049 | trimXDomain: function trimXDomain(domain) {
|
26050 | var zoomDomain = this.getZoomDomain(),
|
26051 | min = zoomDomain[0],
|
26052 | max = zoomDomain[1];
|
26053 |
|
26054 | if (domain[0] <= min) {
|
26055 | domain[1] = +domain[1] + (min - domain[0]);
|
26056 | domain[0] = min;
|
26057 | }
|
26058 |
|
26059 | if (max <= domain[1]) {
|
26060 | domain[0] = +domain[0] - (domain[1] - max);
|
26061 | domain[1] = max;
|
26062 | }
|
26063 |
|
26064 | return domain;
|
26065 | },
|
26066 |
|
26067 | /**
|
26068 | * Get zoom domain
|
26069 | * @returns {Array} zoom domain
|
26070 | * @private
|
26071 | */
|
26072 | getZoomDomain: function getZoomDomain() {
|
26073 | var $$ = this,
|
26074 | config = $$.config,
|
26075 | org = $$.org,
|
26076 | _org$xDomain = org.xDomain,
|
26077 | min = _org$xDomain[0],
|
26078 | max = _org$xDomain[1];
|
26079 |
|
26080 | if (isDefined(config.zoom_x_min)) {
|
26081 | min = getMinMax("min", [min, config.zoom_x_min]);
|
26082 | }
|
26083 |
|
26084 | if (isDefined(config.zoom_x_max)) {
|
26085 | max = getMinMax("max", [max, config.zoom_x_max]);
|
26086 | }
|
26087 |
|
26088 | return [min, max];
|
26089 | },
|
26090 |
|
26091 | /**
|
26092 | * Converts pixels to axis' scale values
|
26093 | * @param {string} type Axis type
|
26094 | * @param {number} pixels Pixels
|
26095 | * @param {number} domainLength Domain length
|
26096 | * @returns {number}
|
26097 | * @private
|
26098 | */
|
26099 | convertPixelToScale: function convertPixelToScale(type, pixels, domainLength) {
|
26100 | var $$ = this,
|
26101 | config = $$.config,
|
26102 | state = $$.state,
|
26103 | isRotated = config.axis_rotated,
|
26104 | length;
|
26105 |
|
26106 | if (type === "x") {
|
26107 | length = isRotated ? "height" : "width";
|
26108 | } else {
|
26109 | length = isRotated ? "width" : "height";
|
26110 | }
|
26111 |
|
26112 | return domainLength * (pixels / state[length]);
|
26113 | }
|
26114 | });
|
26115 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/format.ts
|
26116 | /**
|
26117 | * Copyright (c) 2017 ~ present NAVER Corp.
|
26118 | * billboard.js project is licensed under the MIT license
|
26119 | */
|
26120 |
|
26121 |
|
26122 | /**
|
26123 | * Get formatted
|
26124 | * @param {object} $$ Context
|
26125 | * @param {string} typeValue Axis type
|
26126 | * @param {number} v Value to be formatted
|
26127 | * @returns {number | string}
|
26128 | * @private
|
26129 | */
|
26130 | function getFormat($$, typeValue, v) {
|
26131 | var config = $$.config,
|
26132 | type = "axis_" + typeValue + "_tick_format",
|
26133 | format = config[type] ? config[type] : $$.defaultValueFormat;
|
26134 | return format(v);
|
26135 | }
|
26136 |
|
26137 | /* harmony default export */ var format = ({
|
26138 | yFormat: function yFormat(v) {
|
26139 | return getFormat(this, "y", v);
|
26140 | },
|
26141 | y2Format: function y2Format(v) {
|
26142 | return getFormat(this, "y2", v);
|
26143 | },
|
26144 |
|
26145 | /**
|
26146 | * Get default value format function
|
26147 | * @returns {Function} formatter function
|
26148 | * @private
|
26149 | */
|
26150 | getDefaultValueFormat: function getDefaultValueFormat() {
|
26151 | var $$ = this,
|
26152 | hasArc = $$.hasArcType();
|
26153 | return hasArc && !$$.hasType("gauge") ? $$.defaultArcValueFormat : $$.defaultValueFormat;
|
26154 | },
|
26155 | defaultValueFormat: function defaultValueFormat(v) {
|
26156 | return isValue(v) ? +v : "";
|
26157 | },
|
26158 | defaultArcValueFormat: function defaultArcValueFormat(v, ratio) {
|
26159 | return (ratio * 100).toFixed(1) + "%";
|
26160 | },
|
26161 | dataLabelFormat: function dataLabelFormat(targetId) {
|
26162 | var $$ = this,
|
26163 | dataLabels = $$.config.data_labels,
|
26164 | defaultFormat = function (v) {
|
26165 | return isValue(v) ? +v : "";
|
26166 | },
|
26167 | format = defaultFormat;
|
26168 |
|
26169 | // find format according to axis id
|
26170 | if (isFunction(dataLabels.format)) {
|
26171 | format = dataLabels.format;
|
26172 | } else if (isObjectType(dataLabels.format)) {
|
26173 | if (dataLabels.format[targetId]) {
|
26174 | format = dataLabels.format[targetId] === !0 ? defaultFormat : dataLabels.format[targetId];
|
26175 | } else {
|
26176 | format = function () {
|
26177 | return "";
|
26178 | };
|
26179 | }
|
26180 | }
|
26181 |
|
26182 | return format.bind($$.api);
|
26183 | }
|
26184 | });
|
26185 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/legend.ts
|
26186 | /**
|
26187 | * Copyright (c) 2017 ~ present NAVER Corp.
|
26188 | * billboard.js project is licensed under the MIT license
|
26189 | */
|
26190 |
|
26191 |
|
26192 |
|
26193 |
|
26194 |
|
26195 | /* harmony default export */ var internals_legend = ({
|
26196 | /**
|
26197 | * Initialize the legend.
|
26198 | * @private
|
26199 | */
|
26200 | initLegend: function initLegend() {
|
26201 | var $$ = this,
|
26202 | config = $$.config,
|
26203 | $el = $$.$el;
|
26204 | $$.legendItemTextBox = {};
|
26205 | $$.state.legendHasRendered = !1;
|
26206 |
|
26207 | if (config.legend_show) {
|
26208 | if (!config.legend_contents_bindto) {
|
26209 | $el.legend = $$.$el.svg.append("g").classed(config_classes.legend, !0).attr("transform", $$.getTranslate("legend"));
|
26210 | } // MEMO: call here to update legend box and translate for all
|
26211 | // MEMO: translate will be updated by this, so transform not needed in updateLegend()
|
26212 |
|
26213 |
|
26214 | $$.updateLegend();
|
26215 | } else {
|
26216 | $$.state.hiddenLegendIds = $$.mapToIds($$.data.targets);
|
26217 | }
|
26218 | },
|
26219 |
|
26220 | /**
|
26221 | * Update legend element
|
26222 | * @param {Array} targetIds ID's of target
|
26223 | * @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.
|
26224 | * @param {object} transitions Return value of the generateTransitions
|
26225 | * @private
|
26226 | */
|
26227 | updateLegend: function updateLegend(targetIds, options, transitions) {
|
26228 | var $$ = this,
|
26229 | config = $$.config,
|
26230 | state = $$.state,
|
26231 | scale = $$.scale,
|
26232 | $el = $$.$el,
|
26233 | optionz = options || {
|
26234 | withTransform: !1,
|
26235 | withTransitionForTransform: !1,
|
26236 | withTransition: !1
|
26237 | };
|
26238 | optionz.withTransition = getOption(optionz, "withTransition", !0);
|
26239 | optionz.withTransitionForTransform = getOption(optionz, "withTransitionForTransform", !0);
|
26240 |
|
26241 | if (config.legend_contents_bindto && config.legend_contents_template) {
|
26242 | $$.updateLegendTemplate();
|
26243 | } else {
|
26244 | $$.updateLegendElement(targetIds || $$.mapToIds($$.data.targets), optionz, transitions);
|
26245 | } // toggle legend state
|
26246 |
|
26247 |
|
26248 | $el.legend.selectAll("." + config_classes.legendItem).classed(config_classes.legendItemHidden, function (id) {
|
26249 | var hide = !$$.isTargetToShow(id);
|
26250 |
|
26251 | if (hide) {
|
26252 | this.style.opacity = null;
|
26253 | }
|
26254 |
|
26255 | return hide;
|
26256 | }); // Update size and scale
|
26257 |
|
26258 | $$.updateScales(!1, !scale.zoom);
|
26259 | $$.updateSvgSize(); // Update g positions
|
26260 |
|
26261 | $$.transformAll(optionz.withTransitionForTransform, transitions);
|
26262 | state.legendHasRendered = !0;
|
26263 | },
|
26264 |
|
26265 | /**
|
26266 | * Update legend using template option
|
26267 | * @private
|
26268 | */
|
26269 | updateLegendTemplate: function updateLegendTemplate() {
|
26270 | var $$ = this,
|
26271 | config = $$.config,
|
26272 | $el = $$.$el,
|
26273 | wrapper = src_select(config.legend_contents_bindto),
|
26274 | template = config.legend_contents_template;
|
26275 |
|
26276 | if (!wrapper.empty()) {
|
26277 | var targets = $$.mapToIds($$.data.targets),
|
26278 | ids = [],
|
26279 | html = "";
|
26280 | targets.forEach(function (v) {
|
26281 | var content = isFunction(template) ? template.bind($$.api)(v, $$.color(v), $$.api.data(v)[0].values) : tplProcess(template, {
|
26282 | COLOR: $$.color(v),
|
26283 | TITLE: v
|
26284 | });
|
26285 |
|
26286 | if (content) {
|
26287 | ids.push(v);
|
26288 | html += content;
|
26289 | }
|
26290 | });
|
26291 | var legendItem = wrapper.html(html).selectAll(function () {
|
26292 | return this.childNodes;
|
26293 | }).data(ids);
|
26294 | $$.setLegendItem(legendItem);
|
26295 | $el.legend = wrapper;
|
26296 | }
|
26297 | },
|
26298 |
|
26299 | /**
|
26300 | * Update the size of the legend.
|
26301 | * @param {Obejct} size Size object
|
26302 | * @private
|
26303 | */
|
26304 | updateSizeForLegend: function updateSizeForLegend(size) {
|
26305 | var $$ = this,
|
26306 | config = $$.config,
|
26307 | _$$$state = $$.state,
|
26308 | isLegendTop = _$$$state.isLegendTop,
|
26309 | isLegendLeft = _$$$state.isLegendLeft,
|
26310 | isLegendRight = _$$$state.isLegendRight,
|
26311 | isLegendInset = _$$$state.isLegendInset,
|
26312 | current = _$$$state.current,
|
26313 | width = size.width,
|
26314 | height = size.height,
|
26315 | insetLegendPosition = {
|
26316 | top: isLegendTop ? $$.getCurrentPaddingTop() + config.legend_inset_y + 5.5 : current.height - height - $$.getCurrentPaddingBottom() - config.legend_inset_y,
|
26317 | left: isLegendLeft ? $$.getCurrentPaddingLeft() + config.legend_inset_x + .5 : current.width - width - $$.getCurrentPaddingRight() - config.legend_inset_x + .5
|
26318 | };
|
26319 | $$.state.margin3 = {
|
26320 | top: isLegendRight ? 0 : isLegendInset ? insetLegendPosition.top : current.height - height,
|
26321 | right: NaN,
|
26322 | bottom: 0,
|
26323 | left: isLegendRight ? current.width - width : isLegendInset ? insetLegendPosition.left : 0
|
26324 | };
|
26325 | },
|
26326 |
|
26327 | /**
|
26328 | * Transform Legend
|
26329 | * @param {boolean} withTransition whether or not to transition.
|
26330 | * @private
|
26331 | */
|
26332 | transformLegend: function transformLegend(withTransition) {
|
26333 | var $$ = this,
|
26334 | legend = $$.$el.legend,
|
26335 | $T = $$.$T;
|
26336 | $T(legend, withTransition).attr("transform", $$.getTranslate("legend"));
|
26337 | },
|
26338 |
|
26339 | /**
|
26340 | * Update the legend step
|
26341 | * @param {number} step Step value
|
26342 | * @private
|
26343 | */
|
26344 | updateLegendStep: function updateLegendStep(step) {
|
26345 | this.state.legendStep = step;
|
26346 | },
|
26347 |
|
26348 | /**
|
26349 | * Update legend item width
|
26350 | * @param {number} width Width value
|
26351 | * @private
|
26352 | */
|
26353 | updateLegendItemWidth: function updateLegendItemWidth(width) {
|
26354 | this.state.legendItemWidth = width;
|
26355 | },
|
26356 |
|
26357 | /**
|
26358 | * Update legend item height
|
26359 | * @param {number} height Height value
|
26360 | * @private
|
26361 | */
|
26362 | updateLegendItemHeight: function updateLegendItemHeight(height) {
|
26363 | this.state.legendItemHeight = height;
|
26364 | },
|
26365 |
|
26366 | /**
|
26367 | * Update legend item color
|
26368 | * @param {string} id Corresponding data ID value
|
26369 | * @param {string} color Color value
|
26370 | * @private
|
26371 | */
|
26372 | updateLegendItemColor: function updateLegendItemColor(id, color) {
|
26373 | var legend = this.$el.legend;
|
26374 |
|
26375 | if (legend) {
|
26376 | legend.select("." + config_classes.legendItem + "-" + id + " line").style("stroke", color);
|
26377 | }
|
26378 | },
|
26379 |
|
26380 | /**
|
26381 | * Get the width of the legend
|
26382 | * @returns {number} width
|
26383 | * @private
|
26384 | */
|
26385 | getLegendWidth: function getLegendWidth() {
|
26386 | var $$ = this,
|
26387 | _$$$state2 = $$.state,
|
26388 | width = _$$$state2.current.width,
|
26389 | isLegendRight = _$$$state2.isLegendRight,
|
26390 | isLegendInset = _$$$state2.isLegendInset,
|
26391 | legendItemWidth = _$$$state2.legendItemWidth,
|
26392 | legendStep = _$$$state2.legendStep;
|
26393 | return $$.config.legend_show ? isLegendRight || isLegendInset ? legendItemWidth * (legendStep + 1) : width : 0;
|
26394 | },
|
26395 |
|
26396 | /**
|
26397 | * Get the height of the legend
|
26398 | * @returns {number} height
|
26399 | * @private
|
26400 | */
|
26401 | getLegendHeight: function getLegendHeight() {
|
26402 | var $$ = this,
|
26403 | _$$$state3 = $$.state,
|
26404 | current = _$$$state3.current,
|
26405 | isLegendRight = _$$$state3.isLegendRight,
|
26406 | legendItemHeight = _$$$state3.legendItemHeight,
|
26407 | legendStep = _$$$state3.legendStep;
|
26408 | return $$.config.legend_show ? isLegendRight ? current.height : Math.max(20, legendItemHeight) * (legendStep + 1) : 0;
|
26409 | },
|
26410 |
|
26411 | /**
|
26412 | * Get the opacity of the legend that is unfocused
|
26413 | * @param {d3.selection} legendItem Legend item node
|
26414 | * @returns {string|null} opacity
|
26415 | * @private
|
26416 | */
|
26417 | opacityForUnfocusedLegend: function opacityForUnfocusedLegend(legendItem) {
|
26418 | return legendItem.classed(config_classes.legendItemHidden) ? null : "0.3";
|
26419 | },
|
26420 |
|
26421 | /**
|
26422 | * Toggles the focus of the legend
|
26423 | * @param {Array} targetIds ID's of target
|
26424 | * @param {boolean} focus whether or not to focus.
|
26425 | * @private
|
26426 | */
|
26427 | toggleFocusLegend: function toggleFocusLegend(targetIds, focus) {
|
26428 | var $$ = this,
|
26429 | legend = $$.$el.legend,
|
26430 | $T = $$.$T,
|
26431 | targetIdz = $$.mapToTargetIds(targetIds);
|
26432 | legend && $T(legend.selectAll("." + config_classes.legendItem).filter(function (id) {
|
26433 | return targetIdz.indexOf(id) >= 0;
|
26434 | }).classed(config_classes.legendItemFocused, focus)).style("opacity", function () {
|
26435 | return focus ? null : $$.opacityForUnfocusedLegend.call($$, src_select(this));
|
26436 | });
|
26437 | },
|
26438 |
|
26439 | /**
|
26440 | * Revert the legend to its default state
|
26441 | * @private
|
26442 | */
|
26443 | revertLegend: function revertLegend() {
|
26444 | var $$ = this,
|
26445 | legend = $$.$el.legend,
|
26446 | $T = $$.$T;
|
26447 | legend && $T(legend.selectAll("." + config_classes.legendItem).classed(config_classes.legendItemFocused, !1)).style("opacity", null);
|
26448 | },
|
26449 |
|
26450 | /**
|
26451 | * Shows the legend
|
26452 | * @param {Array} targetIds ID's of target
|
26453 | * @private
|
26454 | */
|
26455 | showLegend: function showLegend(targetIds) {
|
26456 | var $$ = this,
|
26457 | config = $$.config,
|
26458 | $el = $$.$el,
|
26459 | $T = $$.$T;
|
26460 |
|
26461 | if (!config.legend_show) {
|
26462 | config.legend_show = !0;
|
26463 | $el.legend ? $el.legend.style("visibility", null) : $$.initLegend();
|
26464 | $$.state.legendHasRendered || $$.updateLegend();
|
26465 | }
|
26466 |
|
26467 | $$.removeHiddenLegendIds(targetIds);
|
26468 | $T($el.legend.selectAll($$.selectorLegends(targetIds)).style("visibility", null)).style("opacity", null);
|
26469 | },
|
26470 |
|
26471 | /**
|
26472 | * Hide the legend
|
26473 | * @param {Array} targetIds ID's of target
|
26474 | * @private
|
26475 | */
|
26476 | hideLegend: function hideLegend(targetIds) {
|
26477 | var $$ = this,
|
26478 | config = $$.config,
|
26479 | legend = $$.$el.legend;
|
26480 |
|
26481 | if (config.legend_show && isEmpty(targetIds)) {
|
26482 | config.legend_show = !1;
|
26483 | legend.style("visibility", "hidden");
|
26484 | }
|
26485 |
|
26486 | $$.addHiddenLegendIds(targetIds);
|
26487 | legend.selectAll($$.selectorLegends(targetIds)).style("opacity", "0").style("visibility", "hidden");
|
26488 | },
|
26489 |
|
26490 | /**
|
26491 | * Get legend item textbox dimension
|
26492 | * @param {string} id Data ID
|
26493 | * @param {HTMLElement|d3.selection} textElement Text node element
|
26494 | * @returns {object} Bounding rect
|
26495 | * @private
|
26496 | */
|
26497 | getLegendItemTextBox: function getLegendItemTextBox(id, textElement) {
|
26498 | var $$ = this,
|
26499 | cache = $$.cache,
|
26500 | state = $$.state,
|
26501 | data,
|
26502 | cacheKey = KEY.legendItemTextBox;
|
26503 |
|
26504 | if (id) {
|
26505 | data = !state.redrawing && cache.get(cacheKey) || {};
|
26506 |
|
26507 | if (!data[id]) {
|
26508 | data[id] = $$.getTextRect(textElement, config_classes.legendItem);
|
26509 | cache.add(cacheKey, data);
|
26510 | }
|
26511 |
|
26512 | data = data[id];
|
26513 | }
|
26514 |
|
26515 | return data;
|
26516 | },
|
26517 |
|
26518 | /**
|
26519 | * Set legend item style & bind events
|
26520 | * @param {d3.selection} item Item node
|
26521 | * @private
|
26522 | */
|
26523 | setLegendItem: function setLegendItem(item) {
|
26524 | var $$ = this,
|
26525 | api = $$.api,
|
26526 | config = $$.config,
|
26527 | state = $$.state,
|
26528 | isTouch = state.inputType === "touch",
|
26529 | hasGauge = $$.hasType("gauge");
|
26530 | item.attr("class", function (id) {
|
26531 | var node = src_select(this),
|
26532 | itemClass = !node.empty() && node.attr("class") || "";
|
26533 | return itemClass + $$.generateClass(config_classes.legendItem, id);
|
26534 | }).style("visibility", function (id) {
|
26535 | return $$.isLegendToShow(id) ? null : "hidden";
|
26536 | });
|
26537 |
|
26538 | if (config.interaction_enabled) {
|
26539 | item.style("cursor", "pointer").on("click", function (event, id) {
|
26540 | if (!callFn(config.legend_item_onclick, api, id)) {
|
26541 | if (event.altKey) {
|
26542 | api.hide();
|
26543 | api.show(id);
|
26544 | } else {
|
26545 | api.toggle(id);
|
26546 | src_select(this).classed(config_classes.legendItemFocused, !1);
|
26547 | }
|
26548 | }
|
26549 |
|
26550 | isTouch && $$.hideTooltip();
|
26551 | });
|
26552 | isTouch || item.on("mouseout", function (event, id) {
|
26553 | if (!callFn(config.legend_item_onout, api, id)) {
|
26554 | src_select(this).classed(config_classes.legendItemFocused, !1);
|
26555 |
|
26556 | if (hasGauge) {
|
26557 | $$.undoMarkOverlapped($$, "." + config_classes.gaugeValue);
|
26558 | }
|
26559 |
|
26560 | $$.api.revert();
|
26561 | }
|
26562 | }).on("mouseover", function (event, id) {
|
26563 | if (!callFn(config.legend_item_onover, api, id)) {
|
26564 | src_select(this).classed(config_classes.legendItemFocused, !0);
|
26565 |
|
26566 | if (hasGauge) {
|
26567 | $$.markOverlapped(id, $$, "." + config_classes.gaugeValue);
|
26568 | }
|
26569 |
|
26570 | if (!state.transiting && $$.isTargetToShow(id)) {
|
26571 | api.focus(id);
|
26572 | }
|
26573 | }
|
26574 | });
|
26575 | }
|
26576 | },
|
26577 |
|
26578 | /**
|
26579 | * Update the legend
|
26580 | * @param {Array} targetIds ID's of target
|
26581 | * @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.
|
26582 | * @private
|
26583 | */
|
26584 | updateLegendElement: function updateLegendElement(targetIds, options) {
|
26585 | var $$ = this,
|
26586 | config = $$.config,
|
26587 | state = $$.state,
|
26588 | legend = $$.$el.legend,
|
26589 | $T = $$.$T,
|
26590 | posMin = 10,
|
26591 | tileWidth = config.legend_item_tile_width + 5,
|
26592 | maxWidth = 0,
|
26593 | maxHeight = 0,
|
26594 | xForLegend,
|
26595 | yForLegend,
|
26596 | totalLength = 0,
|
26597 | offsets = {},
|
26598 | widths = {},
|
26599 | heights = {},
|
26600 | margins = [0],
|
26601 | steps = {},
|
26602 | step = 0,
|
26603 | background,
|
26604 | isLegendRightOrInset = state.isLegendRight || state.isLegendInset,
|
26605 | targetIdz = targetIds.filter(function (id) {
|
26606 | return !isDefined(config.data_names[id]) || config.data_names[id] !== null;
|
26607 | }),
|
26608 | withTransition = options.withTransition,
|
26609 | updatePositions = function (textElement, id, index) {
|
26610 | var isLast = index === targetIdz.length - 1,
|
26611 | box = $$.getLegendItemTextBox(id, textElement),
|
26612 | itemWidth = box.width + tileWidth + (isLast && !isLegendRightOrInset ? 0 : 10) + config.legend_padding,
|
26613 | itemHeight = box.height + 4,
|
26614 | itemLength = isLegendRightOrInset ? itemHeight : itemWidth,
|
26615 | areaLength = isLegendRightOrInset ? $$.getLegendHeight() : $$.getLegendWidth(),
|
26616 | margin,
|
26617 | updateValues = function (id2, withoutStep) {
|
26618 | if (!withoutStep) {
|
26619 | margin = (areaLength - totalLength - itemLength) / 2;
|
26620 |
|
26621 | if (margin < posMin) {
|
26622 | margin = (areaLength - itemLength) / 2;
|
26623 | totalLength = 0;
|
26624 | step++;
|
26625 | }
|
26626 | }
|
26627 |
|
26628 | steps[id2] = step;
|
26629 | margins[step] = state.isLegendInset ? 10 : margin;
|
26630 | offsets[id2] = totalLength;
|
26631 | totalLength += itemLength;
|
26632 | };
|
26633 |
|
26634 | if (index === 0) {
|
26635 | totalLength = 0;
|
26636 | step = 0;
|
26637 | maxWidth = 0;
|
26638 | maxHeight = 0;
|
26639 | }
|
26640 |
|
26641 | if (config.legend_show && !$$.isLegendToShow(id)) {
|
26642 | widths[id] = 0;
|
26643 | heights[id] = 0;
|
26644 | steps[id] = 0;
|
26645 | offsets[id] = 0;
|
26646 | return;
|
26647 | }
|
26648 |
|
26649 | widths[id] = itemWidth;
|
26650 | heights[id] = itemHeight;
|
26651 |
|
26652 | if (!maxWidth || itemWidth >= maxWidth) {
|
26653 | maxWidth = itemWidth;
|
26654 | }
|
26655 |
|
26656 | if (!maxHeight || itemHeight >= maxHeight) {
|
26657 | maxHeight = itemHeight;
|
26658 | }
|
26659 |
|
26660 | var maxLength = isLegendRightOrInset ? maxHeight : maxWidth;
|
26661 |
|
26662 | if (config.legend_equally) {
|
26663 | Object.keys(widths).forEach(function (id2) {
|
26664 | return widths[id2] = maxWidth;
|
26665 | });
|
26666 | Object.keys(heights).forEach(function (id2) {
|
26667 | return heights[id2] = maxHeight;
|
26668 | });
|
26669 | margin = (areaLength - maxLength * targetIdz.length) / 2;
|
26670 |
|
26671 | if (margin < posMin) {
|
26672 | totalLength = 0;
|
26673 | step = 0;
|
26674 | targetIdz.forEach(function (id2) {
|
26675 | return updateValues(id2);
|
26676 | });
|
26677 | } else {
|
26678 | updateValues(id, !0);
|
26679 | }
|
26680 | } else {
|
26681 | updateValues(id);
|
26682 | }
|
26683 | };
|
26684 |
|
26685 | if (state.isLegendInset) {
|
26686 | step = config.legend_inset_step ? config.legend_inset_step : targetIdz.length;
|
26687 | $$.updateLegendStep(step);
|
26688 | }
|
26689 |
|
26690 | if (state.isLegendRight) {
|
26691 | xForLegend = function (id) {
|
26692 | return maxWidth * steps[id];
|
26693 | };
|
26694 |
|
26695 | yForLegend = function (id) {
|
26696 | return margins[steps[id]] + offsets[id];
|
26697 | };
|
26698 | } else if (state.isLegendInset) {
|
26699 | xForLegend = function (id) {
|
26700 | return maxWidth * steps[id] + 10;
|
26701 | };
|
26702 |
|
26703 | yForLegend = function (id) {
|
26704 | return margins[steps[id]] + offsets[id];
|
26705 | };
|
26706 | } else {
|
26707 | xForLegend = function (id) {
|
26708 | return margins[steps[id]] + offsets[id];
|
26709 | };
|
26710 |
|
26711 | yForLegend = function (id) {
|
26712 | return maxHeight * steps[id];
|
26713 | };
|
26714 | }
|
26715 |
|
26716 | var xForLegendText = function (id, i) {
|
26717 | return xForLegend(id, i) + 4 + config.legend_item_tile_width;
|
26718 | },
|
26719 | xForLegendRect = function (id, i) {
|
26720 | return xForLegend(id, i);
|
26721 | },
|
26722 | x1ForLegendTile = function (id, i) {
|
26723 | return xForLegend(id, i) - 2;
|
26724 | },
|
26725 | x2ForLegendTile = function (id, i) {
|
26726 | return xForLegend(id, i) - 2 + config.legend_item_tile_width;
|
26727 | },
|
26728 | yForLegendText = function (id, i) {
|
26729 | return yForLegend(id, i) + 9;
|
26730 | },
|
26731 | yForLegendRect = function (id, i) {
|
26732 | return yForLegend(id, i) - 5;
|
26733 | },
|
26734 | yForLegendTile = function (id, i) {
|
26735 | return yForLegend(id, i) + 4;
|
26736 | },
|
26737 | pos = -200,
|
26738 | l = legend.selectAll("." + config_classes.legendItem).data(targetIdz).enter().append("g");
|
26739 |
|
26740 | $$.setLegendItem(l);
|
26741 | l.append("text").text(function (id) {
|
26742 | return isDefined(config.data_names[id]) ? config.data_names[id] : id;
|
26743 | }).each(function (id, i) {
|
26744 | updatePositions(this, id, i);
|
26745 | }).style("pointer-events", "none").attr("x", isLegendRightOrInset ? xForLegendText : pos).attr("y", isLegendRightOrInset ? pos : yForLegendText);
|
26746 | l.append("rect").attr("class", config_classes.legendItemEvent).style("fill-opacity", "0").attr("x", isLegendRightOrInset ? xForLegendRect : pos).attr("y", isLegendRightOrInset ? pos : yForLegendRect);
|
26747 |
|
26748 | var getColor = function (id) {
|
26749 | var data = $$.getDataById(id);
|
26750 | return $$.levelColor ? $$.levelColor(data.values[0].value) : $$.color(data);
|
26751 | },
|
26752 | usePoint = config.legend_usePoint;
|
26753 |
|
26754 | if (usePoint) {
|
26755 | var ids = [];
|
26756 | l.append(function (d) {
|
26757 | var pattern = notEmpty(config.point_pattern) ? config.point_pattern : [config.point_type];
|
26758 | ids.indexOf(d) === -1 && ids.push(d);
|
26759 | var point = pattern[ids.indexOf(d) % pattern.length];
|
26760 |
|
26761 | if (point === "rectangle") {
|
26762 | point = "rect";
|
26763 | }
|
26764 |
|
26765 | return browser_doc.createElementNS(namespaces.svg, "hasValidPointType" in $$ && $$.hasValidPointType(point) ? point : "use");
|
26766 | }).attr("class", config_classes.legendItemPoint).style("fill", getColor).style("pointer-events", "none").attr("href", function (data, idx, selection) {
|
26767 | var node = selection[idx],
|
26768 | nodeName = node.nodeName.toLowerCase(),
|
26769 | id = $$.getTargetSelectorSuffix(data);
|
26770 | return nodeName === "use" ? "#" + state.datetimeId + "-point" + id : undefined;
|
26771 | });
|
26772 | } else {
|
26773 | 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);
|
26774 | } // Set background for inset legend
|
26775 |
|
26776 |
|
26777 | background = legend.select("." + config_classes.legendBackground + " rect");
|
26778 |
|
26779 | if (state.isLegendInset && maxWidth > 0 && background.size() === 0) {
|
26780 | background = legend.insert("g", "." + config_classes.legendItem).attr("class", config_classes.legendBackground).append("rect");
|
26781 | }
|
26782 |
|
26783 | var texts = legend.selectAll("text").data(targetIdz).text(function (id) {
|
26784 | return isDefined(config.data_names[id]) ? config.data_names[id] : id;
|
26785 | }) // MEMO: needed for update
|
26786 | .each(function (id, i) {
|
26787 | updatePositions(this, id, i);
|
26788 | });
|
26789 | $T(texts, withTransition).attr("x", xForLegendText).attr("y", yForLegendText);
|
26790 | var rects = legend.selectAll("rect." + config_classes.legendItemEvent).data(targetIdz);
|
26791 | $T(rects, withTransition).attr("width", function (id) {
|
26792 | return widths[id];
|
26793 | }).attr("height", function (id) {
|
26794 | return heights[id];
|
26795 | }).attr("x", xForLegendRect).attr("y", yForLegendRect);
|
26796 |
|
26797 | if (usePoint) {
|
26798 | var tiles = legend.selectAll("." + config_classes.legendItemPoint).data(targetIdz);
|
26799 | $T(tiles, withTransition).each(function () {
|
26800 | var nodeName = this.nodeName.toLowerCase(),
|
26801 | pointR = config.point_r,
|
26802 | x = "x",
|
26803 | y = "y",
|
26804 | xOffset = 2,
|
26805 | yOffset = 2.5,
|
26806 | radius,
|
26807 | width,
|
26808 | height;
|
26809 |
|
26810 | if (nodeName === "circle") {
|
26811 | var size = pointR * .2;
|
26812 | x = "cx";
|
26813 | y = "cy";
|
26814 | radius = pointR + size;
|
26815 | xOffset = pointR * 2;
|
26816 | yOffset = -size;
|
26817 | } else if (nodeName === "rect") {
|
26818 | var _size = pointR * 2.5;
|
26819 |
|
26820 | width = _size;
|
26821 | height = _size;
|
26822 | yOffset = 3;
|
26823 | }
|
26824 |
|
26825 | src_select(this).attr(x, function (d) {
|
26826 | return x1ForLegendTile(d) + xOffset;
|
26827 | }).attr(y, function (d) {
|
26828 | return yForLegendTile(d) - yOffset;
|
26829 | }).attr("r", radius).attr("width", width).attr("height", height);
|
26830 | });
|
26831 | } else {
|
26832 | var _tiles = legend.selectAll("line." + config_classes.legendItemTile).data(targetIdz);
|
26833 |
|
26834 | $T(_tiles, withTransition).style("stroke", getColor).attr("x1", x1ForLegendTile).attr("y1", yForLegendTile).attr("x2", x2ForLegendTile).attr("y2", yForLegendTile);
|
26835 | }
|
26836 |
|
26837 | if (background) {
|
26838 | $T(background, withTransition).attr("height", $$.getLegendHeight() - 12).attr("width", maxWidth * (step + 1) + 10);
|
26839 | } // Update all to reflect change of legend
|
26840 |
|
26841 |
|
26842 | $$.updateLegendItemWidth(maxWidth);
|
26843 | $$.updateLegendItemHeight(maxHeight);
|
26844 | $$.updateLegendStep(step);
|
26845 | }
|
26846 | });
|
26847 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/redraw.ts
|
26848 | /**
|
26849 | * Copyright (c) 2017 ~ present NAVER Corp.
|
26850 | * billboard.js project is licensed under the MIT license
|
26851 | */
|
26852 |
|
26853 |
|
26854 |
|
26855 |
|
26856 | /* harmony default export */ var redraw = ({
|
26857 | redraw: function redraw(options) {
|
26858 | var _$$$axis;
|
26859 |
|
26860 | if (options === void 0) {
|
26861 | options = {};
|
26862 | }
|
26863 |
|
26864 | var $$ = this,
|
26865 | config = $$.config,
|
26866 | state = $$.state,
|
26867 | $el = $$.$el,
|
26868 | main = $el.main;
|
26869 | state.redrawing = !0;
|
26870 | var targetsToShow = $$.filterTargetsToShow($$.data.targets),
|
26871 | _options = options,
|
26872 | flow = _options.flow,
|
26873 | initializing = _options.initializing,
|
26874 | wth = $$.getWithOption(options),
|
26875 | duration = wth.Transition ? config.transition_duration : 0,
|
26876 | durationForExit = wth.TransitionForExit ? duration : 0,
|
26877 | durationForAxis = wth.TransitionForAxis ? duration : 0,
|
26878 | transitions = (_$$$axis = $$.axis) == null ? void 0 : _$$$axis.generateTransitions(durationForAxis);
|
26879 | $$.updateSizes(initializing); // update legend and transform each g
|
26880 |
|
26881 | if (wth.Legend && config.legend_show) {
|
26882 | options.withTransition = !!duration;
|
26883 | $$.updateLegend($$.mapToIds($$.data.targets), options, transitions);
|
26884 | } else if (wth.Dimension) {
|
26885 | // need to update dimension (e.g. axis.y.tick.values) because y tick values should change
|
26886 | // no need to update axis in it because they will be updated in redraw()
|
26887 | $$.updateDimension(!0);
|
26888 | } // update circleY based on updated parameters
|
26889 |
|
26890 |
|
26891 | if (!$$.hasArcType() || state.hasRadar) {
|
26892 | $$.updateCircleY && ($$.circleY = $$.updateCircleY());
|
26893 | } // update axis
|
26894 |
|
26895 |
|
26896 | if (state.hasAxis) {
|
26897 | // @TODO: Make 'init' state to be accessible everywhere not passing as argument.
|
26898 | $$.axis.redrawAxis(targetsToShow, wth, transitions, flow, initializing); // Data empty label positioning and text.
|
26899 |
|
26900 | 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); // grid
|
26901 |
|
26902 | $$.hasGrid() && $$.updateGrid(); // rect for regions
|
26903 |
|
26904 | config.regions.length && $$.updateRegion();
|
26905 | ["bar", "candlestick", "line", "area"].forEach(function (v) {
|
26906 | var name = capitalize(v);
|
26907 |
|
26908 | if (/^(line|area)$/.test(v) && $$.hasTypeOf(name) || $$.hasType(v)) {
|
26909 | $$["update" + name](wth.TransitionForExit);
|
26910 | }
|
26911 | }); // circles for select
|
26912 |
|
26913 | $el.text && main.selectAll("." + config_classes.selectedCircles).filter($$.isBarType.bind($$)).selectAll("circle").remove(); // event rects will redrawn when flow called
|
26914 |
|
26915 | if (config.interaction_enabled && !flow && wth.EventRect) {
|
26916 | $$.redrawEventRect();
|
26917 | $$.bindZoomEvent == null ? void 0 : $$.bindZoomEvent();
|
26918 | }
|
26919 | } else {
|
26920 | // arc
|
26921 | $el.arcs && $$.redrawArc(duration, durationForExit, wth.Transform); // radar
|
26922 |
|
26923 | $el.radar && $$.redrawRadar();
|
26924 | } // @TODO: Axis & Radar type
|
26925 |
|
26926 |
|
26927 | if (!state.resizing && ($$.hasPointType() || state.hasRadar)) {
|
26928 | $$.updateCircle();
|
26929 | } // text
|
26930 |
|
26931 |
|
26932 | $$.hasDataLabel() && !$$.hasArcType(null, ["radar"]) && $$.updateText(); // title
|
26933 |
|
26934 | $$.redrawTitle == null ? void 0 : $$.redrawTitle();
|
26935 | initializing && $$.updateTypesElements();
|
26936 | $$.generateRedrawList(targetsToShow, flow, duration, wth.Subchart);
|
26937 | $$.callPluginHook("$redraw", options, duration);
|
26938 | },
|
26939 |
|
26940 | /**
|
26941 | * Generate redraw list
|
26942 | * @param {object} targets targets data to be shown
|
26943 | * @param {object} flow flow object
|
26944 | * @param {number} duration duration value
|
26945 | * @param {boolean} withSubchart whether or not to show subchart
|
26946 | * @private
|
26947 | */
|
26948 | generateRedrawList: function generateRedrawList(targets, flow, duration, withSubchart) {
|
26949 | var $$ = this,
|
26950 | config = $$.config,
|
26951 | state = $$.state,
|
26952 | shape = $$.getDrawShape();
|
26953 |
|
26954 | if (state.hasAxis) {
|
26955 | // subchart
|
26956 | config.subchart_show && $$.redrawSubchart(withSubchart, duration, shape);
|
26957 | } // generate flow
|
26958 |
|
26959 |
|
26960 | var flowFn = flow && $$.generateFlow({
|
26961 | targets: targets,
|
26962 | flow: flow,
|
26963 | duration: flow.duration,
|
26964 | shape: shape,
|
26965 | xv: $$.xv.bind($$)
|
26966 | }),
|
26967 | withTransition = (duration || flowFn) && isTabVisible(),
|
26968 | redrawList = $$.getRedrawList(shape, flow, flowFn, withTransition),
|
26969 | afterRedraw = function () {
|
26970 | flowFn && flowFn();
|
26971 | state.redrawing = !1;
|
26972 | callFn(config.onrendered, $$.api);
|
26973 | };
|
26974 |
|
26975 | if (afterRedraw) {
|
26976 | // Only use transition when current tab is visible.
|
26977 | if (withTransition && redrawList.length) {
|
26978 | // Wait for end of transitions for callback
|
26979 | var waitForDraw = generateWait(); // transition should be derived from one transition
|
26980 |
|
26981 | transition_transition().duration(duration).each(function () {
|
26982 | redrawList.reduce(function (acc, t1) {
|
26983 | return acc.concat(t1);
|
26984 | }, []).forEach(function (t) {
|
26985 | return waitForDraw.add(t);
|
26986 | });
|
26987 | }).call(waitForDraw, afterRedraw);
|
26988 | } else if (!state.transiting) {
|
26989 | afterRedraw();
|
26990 | }
|
26991 | } // update fadein condition
|
26992 |
|
26993 |
|
26994 | $$.mapToIds($$.data.targets).forEach(function (id) {
|
26995 | state.withoutFadeIn[id] = !0;
|
26996 | });
|
26997 | },
|
26998 | getRedrawList: function getRedrawList(shape, flow, flowFn, withTransition) {
|
26999 | var $$ = this,
|
27000 | config = $$.config,
|
27001 | _$$$state = $$.state,
|
27002 | hasAxis = _$$$state.hasAxis,
|
27003 | hasRadar = _$$$state.hasRadar,
|
27004 | grid = $$.$el.grid,
|
27005 | _shape$pos = shape.pos,
|
27006 | cx = _shape$pos.cx,
|
27007 | cy = _shape$pos.cy,
|
27008 | xForText = _shape$pos.xForText,
|
27009 | yForText = _shape$pos.yForText,
|
27010 | list = [];
|
27011 |
|
27012 | if (hasAxis) {
|
27013 | if (config.grid_x_lines.length || config.grid_y_lines.length) {
|
27014 | list.push($$.redrawGrid(withTransition));
|
27015 | }
|
27016 |
|
27017 | if (config.regions.length) {
|
27018 | list.push($$.redrawRegion(withTransition));
|
27019 | }
|
27020 |
|
27021 | Object.keys(shape.type).forEach(function (v) {
|
27022 | var name = capitalize(v),
|
27023 | drawFn = shape.type[v];
|
27024 |
|
27025 | if (/^(area|line)$/.test(v) && $$.hasTypeOf(name) || $$.hasType(v)) {
|
27026 | list.push($$["redraw" + name](drawFn, withTransition));
|
27027 | }
|
27028 | });
|
27029 | !flow && grid.main && list.push($$.updateGridFocus());
|
27030 | }
|
27031 |
|
27032 | if (!$$.hasArcType() || hasRadar) {
|
27033 | notEmpty(config.data_labels) && config.data_labels !== !1 && list.push($$.redrawText(xForText, yForText, flow, withTransition));
|
27034 | }
|
27035 |
|
27036 | if (($$.hasPointType() || hasRadar) && !config.point_focus_only) {
|
27037 | $$.redrawCircle && list.push($$.redrawCircle(cx, cy, withTransition, flowFn));
|
27038 | }
|
27039 |
|
27040 | return list;
|
27041 | },
|
27042 | updateAndRedraw: function updateAndRedraw(options) {
|
27043 | if (options === void 0) {
|
27044 | options = {};
|
27045 | }
|
27046 |
|
27047 | var $$ = this,
|
27048 | config = $$.config,
|
27049 | state = $$.state,
|
27050 | transitions;
|
27051 | // same with redraw
|
27052 | options.withTransition = getOption(options, "withTransition", !0);
|
27053 | options.withTransform = getOption(options, "withTransform", !1);
|
27054 | options.withLegend = getOption(options, "withLegend", !1); // NOT same with redraw
|
27055 |
|
27056 | options.withUpdateXDomain = !0;
|
27057 | options.withUpdateOrgXDomain = !0;
|
27058 | options.withTransitionForExit = !1;
|
27059 | options.withTransitionForTransform = getOption(options, "withTransitionForTransform", options.withTransition); // MEMO: called in updateLegend in redraw if withLegend
|
27060 |
|
27061 | if (!(options.withLegend && config.legend_show)) {
|
27062 | if (state.hasAxis) {
|
27063 | transitions = $$.axis.generateTransitions(options.withTransitionForAxis ? config.transition_duration : 0);
|
27064 | } // Update scales
|
27065 |
|
27066 |
|
27067 | $$.updateScales();
|
27068 | $$.updateSvgSize(); // Update g positions
|
27069 |
|
27070 | $$.transformAll(options.withTransitionForTransform, transitions);
|
27071 | } // Draw with new sizes & scales
|
27072 |
|
27073 |
|
27074 | $$.redraw(options, transitions);
|
27075 | },
|
27076 | redrawWithoutRescale: function redrawWithoutRescale() {
|
27077 | this.redraw({
|
27078 | withY: !1,
|
27079 | withLegend: !0,
|
27080 | withSubchart: !1,
|
27081 | withEventRect: !1,
|
27082 | withTransitionForAxis: !1
|
27083 | });
|
27084 | }
|
27085 | });
|
27086 | ;// CONCATENATED MODULE: ./node_modules/d3-array/src/ticks.js
|
27087 | var e10 = Math.sqrt(50),
|
27088 | e5 = Math.sqrt(10),
|
27089 | e2 = Math.sqrt(2);
|
27090 | function ticks(start, stop, count) {
|
27091 | var reverse,
|
27092 | i = -1,
|
27093 | n,
|
27094 | ticks,
|
27095 | step;
|
27096 | stop = +stop, start = +start, count = +count;
|
27097 | if (start === stop && count > 0) return [start];
|
27098 | if (reverse = stop < start) n = start, start = stop, stop = n;
|
27099 | if ((step = tickIncrement(start, stop, count)) === 0 || !isFinite(step)) return [];
|
27100 |
|
27101 | if (step > 0) {
|
27102 | var r0 = Math.round(start / step),
|
27103 | r1 = Math.round(stop / step);
|
27104 | if (r0 * step < start) ++r0;
|
27105 | if (r1 * step > stop) --r1;
|
27106 | ticks = Array(n = r1 - r0 + 1);
|
27107 |
|
27108 | while (++i < n) {
|
27109 | ticks[i] = (r0 + i) * step;
|
27110 | }
|
27111 | } else {
|
27112 | step = -step;
|
27113 |
|
27114 | var _r = Math.round(start * step),
|
27115 | _r2 = Math.round(stop * step);
|
27116 |
|
27117 | if (_r / step < start) ++_r;
|
27118 | if (_r2 / step > stop) --_r2;
|
27119 | ticks = Array(n = _r2 - _r + 1);
|
27120 |
|
27121 | while (++i < n) {
|
27122 | ticks[i] = (_r + i) / step;
|
27123 | }
|
27124 | }
|
27125 |
|
27126 | if (reverse) ticks.reverse();
|
27127 | return ticks;
|
27128 | }
|
27129 | function tickIncrement(start, stop, count) {
|
27130 | var step = (stop - start) / Math.max(0, count),
|
27131 | power = Math.floor(Math.log(step) / Math.LN10),
|
27132 | error = step / Math.pow(10, power);
|
27133 | 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);
|
27134 | }
|
27135 | function tickStep(start, stop, count) {
|
27136 | var step0 = Math.abs(stop - start) / Math.max(0, count),
|
27137 | step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)),
|
27138 | error = step0 / step1;
|
27139 | if (error >= e10) step1 *= 10;else if (error >= e5) step1 *= 5;else if (error >= e2) step1 *= 2;
|
27140 | return stop < start ? -step1 : step1;
|
27141 | }
|
27142 | ;// CONCATENATED MODULE: ./node_modules/d3-array/src/ascending.js
|
27143 | function ascending_ascending(a, b) {
|
27144 | return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
|
27145 | }
|
27146 | ;// CONCATENATED MODULE: ./node_modules/d3-array/src/bisector.js
|
27147 |
|
27148 | function bisector(f) {
|
27149 | var delta = f,
|
27150 | compare1 = f,
|
27151 | compare2 = f;
|
27152 |
|
27153 | if (f.length !== 2) {
|
27154 | delta = function (d, x) {
|
27155 | return f(d) - x;
|
27156 | };
|
27157 |
|
27158 | compare1 = ascending_ascending;
|
27159 |
|
27160 | compare2 = function (d, x) {
|
27161 | return ascending_ascending(f(d), x);
|
27162 | };
|
27163 | }
|
27164 |
|
27165 | function left(a, x, lo, hi) {
|
27166 | if (lo === void 0) {
|
27167 | lo = 0;
|
27168 | }
|
27169 |
|
27170 | if (hi === void 0) {
|
27171 | hi = a.length;
|
27172 | }
|
27173 |
|
27174 | if (lo < hi) {
|
27175 | if (compare1(x, x) !== 0) return hi;
|
27176 |
|
27177 | do {
|
27178 | var mid = lo + hi >>> 1;
|
27179 | if (compare2(a[mid], x) < 0) lo = mid + 1;else hi = mid;
|
27180 | } while (lo < hi);
|
27181 | }
|
27182 |
|
27183 | return lo;
|
27184 | }
|
27185 |
|
27186 | function right(a, x, lo, hi) {
|
27187 | if (lo === void 0) {
|
27188 | lo = 0;
|
27189 | }
|
27190 |
|
27191 | if (hi === void 0) {
|
27192 | hi = a.length;
|
27193 | }
|
27194 |
|
27195 | if (lo < hi) {
|
27196 | if (compare1(x, x) !== 0) return hi;
|
27197 |
|
27198 | do {
|
27199 | var mid = lo + hi >>> 1;
|
27200 | if (compare2(a[mid], x) <= 0) lo = mid + 1;else hi = mid;
|
27201 | } while (lo < hi);
|
27202 | }
|
27203 |
|
27204 | return lo;
|
27205 | }
|
27206 |
|
27207 | function center(a, x, lo, hi) {
|
27208 | if (lo === void 0) {
|
27209 | lo = 0;
|
27210 | }
|
27211 |
|
27212 | if (hi === void 0) {
|
27213 | hi = a.length;
|
27214 | }
|
27215 |
|
27216 | var i = left(a, x, lo, hi - 1);
|
27217 | return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;
|
27218 | }
|
27219 |
|
27220 | return {
|
27221 | left: left,
|
27222 | center: center,
|
27223 | right: right
|
27224 | };
|
27225 | }
|
27226 | ;// CONCATENATED MODULE: ./node_modules/d3-array/src/number.js
|
27227 |
|
27228 |
|
27229 | var number_marked = /*#__PURE__*/regenerator.mark(numbers);
|
27230 |
|
27231 | function number_createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = number_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: !0 }; return { 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."); }
|
27232 |
|
27233 | function number_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return number_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return number_arrayLikeToArray(o, minLen); }
|
27234 |
|
27235 | function number_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
27236 |
|
27237 | function number_number(x) {
|
27238 | return x === null ? NaN : +x;
|
27239 | }
|
27240 | function numbers(values, valueof) {
|
27241 | var _iterator, _step, value, index, _iterator2, _step2, _value;
|
27242 |
|
27243 | return regenerator.wrap(function (_context) {
|
27244 | while (1) {
|
27245 | switch (_context.prev = _context.next) {
|
27246 | case 0:
|
27247 | if (!(valueof === undefined)) {
|
27248 | _context.next = 11;
|
27249 | break;
|
27250 | }
|
27251 |
|
27252 | _iterator = number_createForOfIteratorHelperLoose(values);
|
27253 |
|
27254 | case 2:
|
27255 | if ((_step = _iterator()).done) {
|
27256 | _context.next = 9;
|
27257 | break;
|
27258 | }
|
27259 |
|
27260 | value = _step.value;
|
27261 |
|
27262 | if (!(value != null && (value = +value) >= value)) {
|
27263 | _context.next = 7;
|
27264 | break;
|
27265 | }
|
27266 |
|
27267 | _context.next = 7;
|
27268 | return value;
|
27269 |
|
27270 | case 7:
|
27271 | _context.next = 2;
|
27272 | break;
|
27273 |
|
27274 | case 9:
|
27275 | _context.next = 20;
|
27276 | break;
|
27277 |
|
27278 | case 11:
|
27279 | index = -1;
|
27280 | _iterator2 = number_createForOfIteratorHelperLoose(values);
|
27281 |
|
27282 | case 13:
|
27283 | if ((_step2 = _iterator2()).done) {
|
27284 | _context.next = 20;
|
27285 | break;
|
27286 | }
|
27287 |
|
27288 | _value = _step2.value;
|
27289 |
|
27290 | if (!((_value = valueof(_value, ++index, values)) != null && (_value = +_value) >= _value)) {
|
27291 | _context.next = 18;
|
27292 | break;
|
27293 | }
|
27294 |
|
27295 | _context.next = 18;
|
27296 | return _value;
|
27297 |
|
27298 | case 18:
|
27299 | _context.next = 13;
|
27300 | break;
|
27301 |
|
27302 | case 20:
|
27303 | case "end":
|
27304 | return _context.stop();
|
27305 | }
|
27306 | }
|
27307 | }, number_marked);
|
27308 | }
|
27309 | ;// CONCATENATED MODULE: ./node_modules/d3-array/src/bisect.js
|
27310 |
|
27311 |
|
27312 |
|
27313 | var ascendingBisect = bisector(ascending_ascending);
|
27314 | var bisectRight = ascendingBisect.right;
|
27315 | var bisectLeft = ascendingBisect.left;
|
27316 | var bisectCenter = bisector(number_number).center;
|
27317 | /* harmony default export */ var bisect = (bisectRight);
|
27318 | ;// CONCATENATED MODULE: ./node_modules/d3-interpolate/src/round.js
|
27319 | /* harmony default export */ function round(a, b) {
|
27320 | return a = +a, b = +b, function (t) {
|
27321 | return Math.round(a * (1 - t) + b * t);
|
27322 | };
|
27323 | }
|
27324 | ;// CONCATENATED MODULE: ./node_modules/d3-scale/src/constant.js
|
27325 | function constants(x) {
|
27326 | return function () {
|
27327 | return x;
|
27328 | };
|
27329 | }
|
27330 | ;// CONCATENATED MODULE: ./node_modules/d3-scale/src/number.js
|
27331 | function src_number_number(x) {
|
27332 | return +x;
|
27333 | }
|
27334 | ;// CONCATENATED MODULE: ./node_modules/d3-scale/src/continuous.js
|
27335 |
|
27336 |
|
27337 |
|
27338 |
|
27339 | var unit = [0, 1];
|
27340 | function continuous_identity(x) {
|
27341 | return x;
|
27342 | }
|
27343 |
|
27344 | function normalize(a, b) {
|
27345 | return (b -= a = +a) ? function (x) {
|
27346 | return (x - a) / b;
|
27347 | } : constants(isNaN(b) ? NaN : .5);
|
27348 | }
|
27349 |
|
27350 | function clamper(a, b) {
|
27351 | var t;
|
27352 | if (a > b) t = a, a = b, b = t;
|
27353 | return function (x) {
|
27354 | return Math.max(a, Math.min(b, x));
|
27355 | };
|
27356 | } // normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].
|
27357 | // interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].
|
27358 |
|
27359 |
|
27360 | function bimap(domain, range, interpolate) {
|
27361 | var d0 = domain[0],
|
27362 | d1 = domain[1],
|
27363 | r0 = range[0],
|
27364 | r1 = range[1];
|
27365 | if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);
|
27366 | return function (x) {
|
27367 | return r0(d0(x));
|
27368 | };
|
27369 | }
|
27370 |
|
27371 | function polymap(domain, range, interpolate) {
|
27372 | var j = Math.min(domain.length, range.length) - 1,
|
27373 | d = Array(j),
|
27374 | r = Array(j),
|
27375 | i = -1; // Reverse descending domains.
|
27376 |
|
27377 | if (domain[j] < domain[0]) {
|
27378 | domain = domain.slice().reverse();
|
27379 | range = range.slice().reverse();
|
27380 | }
|
27381 |
|
27382 | while (++i < j) {
|
27383 | d[i] = normalize(domain[i], domain[i + 1]);
|
27384 | r[i] = interpolate(range[i], range[i + 1]);
|
27385 | }
|
27386 |
|
27387 | return function (x) {
|
27388 | var i = bisect(domain, x, 1, j) - 1;
|
27389 | return r[i](d[i](x));
|
27390 | };
|
27391 | }
|
27392 |
|
27393 | function copy(source, target) {
|
27394 | return target.domain(source.domain()).range(source.range()).interpolate(source.interpolate()).clamp(source.clamp()).unknown(source.unknown());
|
27395 | }
|
27396 | function transformer() {
|
27397 | var domain = unit,
|
27398 | range = unit,
|
27399 | interpolate = value,
|
27400 | transform,
|
27401 | untransform,
|
27402 | unknown,
|
27403 | clamp = continuous_identity,
|
27404 | piecewise,
|
27405 | output,
|
27406 | input;
|
27407 |
|
27408 | function rescale() {
|
27409 | var n = Math.min(domain.length, range.length);
|
27410 | if (clamp !== continuous_identity) clamp = clamper(domain[0], domain[n - 1]);
|
27411 | piecewise = n > 2 ? polymap : bimap;
|
27412 | output = input = null;
|
27413 | return scale;
|
27414 | }
|
27415 |
|
27416 | function scale(x) {
|
27417 | return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate)))(transform(clamp(x)));
|
27418 | }
|
27419 |
|
27420 | scale.invert = function (y) {
|
27421 | return clamp(untransform((input || (input = piecewise(range, domain.map(transform), number)))(y)));
|
27422 | };
|
27423 |
|
27424 | scale.domain = function (_) {
|
27425 | return arguments.length ? (domain = Array.from(_, src_number_number), rescale()) : domain.slice();
|
27426 | };
|
27427 |
|
27428 | scale.range = function (_) {
|
27429 | return arguments.length ? (range = Array.from(_), rescale()) : range.slice();
|
27430 | };
|
27431 |
|
27432 | scale.rangeRound = function (_) {
|
27433 | return range = Array.from(_), interpolate = round, rescale();
|
27434 | };
|
27435 |
|
27436 | scale.clamp = function (_) {
|
27437 | return arguments.length ? (clamp = _ ? !0 : continuous_identity, rescale()) : clamp !== continuous_identity;
|
27438 | };
|
27439 |
|
27440 | scale.interpolate = function (_) {
|
27441 | return arguments.length ? (interpolate = _, rescale()) : interpolate;
|
27442 | };
|
27443 |
|
27444 | scale.unknown = function (_) {
|
27445 | return arguments.length ? (unknown = _, scale) : unknown;
|
27446 | };
|
27447 |
|
27448 | return function (t, u) {
|
27449 | transform = t, untransform = u;
|
27450 | return rescale();
|
27451 | };
|
27452 | }
|
27453 | function continuous() {
|
27454 | return transformer()(continuous_identity, continuous_identity);
|
27455 | }
|
27456 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/formatSpecifier.js
|
27457 | // [[fill]align][sign][symbol][0][width][,][.precision][~][type]
|
27458 | var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
|
27459 | function formatSpecifier(specifier) {
|
27460 | if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier);
|
27461 | var match;
|
27462 | return new FormatSpecifier({
|
27463 | fill: match[1],
|
27464 | align: match[2],
|
27465 | sign: match[3],
|
27466 | symbol: match[4],
|
27467 | zero: match[5],
|
27468 | width: match[6],
|
27469 | comma: match[7],
|
27470 | precision: match[8] && match[8].slice(1),
|
27471 | trim: match[9],
|
27472 | type: match[10]
|
27473 | });
|
27474 | }
|
27475 | formatSpecifier.prototype = FormatSpecifier.prototype; // instanceof
|
27476 |
|
27477 | function FormatSpecifier(specifier) {
|
27478 | this.fill = specifier.fill === undefined ? " " : specifier.fill + "";
|
27479 | this.align = specifier.align === undefined ? ">" : specifier.align + "";
|
27480 | this.sign = specifier.sign === undefined ? "-" : specifier.sign + "";
|
27481 | this.symbol = specifier.symbol === undefined ? "" : specifier.symbol + "";
|
27482 | this.zero = !!specifier.zero;
|
27483 | this.width = specifier.width === undefined ? undefined : +specifier.width;
|
27484 | this.comma = !!specifier.comma;
|
27485 | this.precision = specifier.precision === undefined ? undefined : +specifier.precision;
|
27486 | this.trim = !!specifier.trim;
|
27487 | this.type = specifier.type === undefined ? "" : specifier.type + "";
|
27488 | }
|
27489 |
|
27490 | FormatSpecifier.prototype.toString = function () {
|
27491 | 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;
|
27492 | };
|
27493 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/formatDecimal.js
|
27494 | /* harmony default export */ function formatDecimal(x) {
|
27495 | return Math.abs(x = Math.round(x)) >= 1e21 ? x.toLocaleString("en").replace(/,/g, "") : x.toString(10);
|
27496 | } // Computes the decimal coefficient and exponent of the specified number x with
|
27497 | // significant digits p, where x is positive and p is in [1, 21] or undefined.
|
27498 | // For example, formatDecimalParts(1.23) returns ["123", 0].
|
27499 |
|
27500 | function formatDecimalParts(x, p) {
|
27501 | if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null; // NaN, ±Infinity
|
27502 |
|
27503 | var i,
|
27504 | coefficient = x.slice(0, i); // The string returned by toExponential either has the form \d\.\d+e[-+]\d+
|
27505 | // (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3).
|
27506 |
|
27507 | return [coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient, +x.slice(i + 1)];
|
27508 | }
|
27509 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/exponent.js
|
27510 |
|
27511 | /* harmony default export */ function exponent(x) {
|
27512 | return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;
|
27513 | }
|
27514 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/precisionPrefix.js
|
27515 |
|
27516 | /* harmony default export */ function precisionPrefix(step, value) {
|
27517 | return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));
|
27518 | }
|
27519 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/formatGroup.js
|
27520 | /* harmony default export */ function formatGroup(grouping, thousands) {
|
27521 | return function (value, width) {
|
27522 | var i = value.length,
|
27523 | t = [],
|
27524 | j = 0,
|
27525 | g = grouping[0],
|
27526 | length = 0;
|
27527 |
|
27528 | while (i > 0 && g > 0) {
|
27529 | if (length + g + 1 > width) g = Math.max(1, width - length);
|
27530 | t.push(value.substring(i -= g, i + g));
|
27531 | if ((length += g + 1) > width) break;
|
27532 | g = grouping[j = (j + 1) % grouping.length];
|
27533 | }
|
27534 |
|
27535 | return t.reverse().join(thousands);
|
27536 | };
|
27537 | }
|
27538 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/formatNumerals.js
|
27539 | /* harmony default export */ function formatNumerals(numerals) {
|
27540 | return function (value) {
|
27541 | return value.replace(/[0-9]/g, function (i) {
|
27542 | return numerals[+i];
|
27543 | });
|
27544 | };
|
27545 | }
|
27546 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/formatTrim.js
|
27547 | // Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.
|
27548 | /* harmony default export */ function formatTrim(s) {
|
27549 | out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {
|
27550 | switch (s[i]) {
|
27551 | case ".":
|
27552 | i0 = i1 = i;
|
27553 | break;
|
27554 |
|
27555 | case "0":
|
27556 | if (i0 === 0) i0 = i;
|
27557 | i1 = i;
|
27558 | break;
|
27559 |
|
27560 | default:
|
27561 | if (!+s[i]) break out;
|
27562 | if (i0 > 0) i0 = 0;
|
27563 | break;
|
27564 | }
|
27565 | }
|
27566 |
|
27567 | return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;
|
27568 | }
|
27569 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/formatPrefixAuto.js
|
27570 |
|
27571 | var prefixExponent;
|
27572 | /* harmony default export */ function formatPrefixAuto(x, p) {
|
27573 | var d = formatDecimalParts(x, p);
|
27574 | if (!d) return x + "";
|
27575 | var coefficient = d[0],
|
27576 | exponent = d[1],
|
27577 | i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,
|
27578 | n = coefficient.length;
|
27579 | 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!
|
27580 | }
|
27581 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/formatRounded.js
|
27582 |
|
27583 | /* harmony default export */ function formatRounded(x, p) {
|
27584 | var d = formatDecimalParts(x, p);
|
27585 | if (!d) return x + "";
|
27586 | var coefficient = d[0],
|
27587 | exponent = d[1];
|
27588 | 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");
|
27589 | }
|
27590 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/formatTypes.js
|
27591 |
|
27592 |
|
27593 |
|
27594 | /* harmony default export */ var formatTypes = ({
|
27595 | "%": function _(x, p) {
|
27596 | return (x * 100).toFixed(p);
|
27597 | },
|
27598 | "b": function b(x) {
|
27599 | return Math.round(x).toString(2);
|
27600 | },
|
27601 | "c": function c(x) {
|
27602 | return x + "";
|
27603 | },
|
27604 | "d": formatDecimal,
|
27605 | "e": function e(x, p) {
|
27606 | return x.toExponential(p);
|
27607 | },
|
27608 | "f": function f(x, p) {
|
27609 | return x.toFixed(p);
|
27610 | },
|
27611 | "g": function g(x, p) {
|
27612 | return x.toPrecision(p);
|
27613 | },
|
27614 | "o": function o(x) {
|
27615 | return Math.round(x).toString(8);
|
27616 | },
|
27617 | "p": function p(x, _p) {
|
27618 | return formatRounded(x * 100, _p);
|
27619 | },
|
27620 | "r": formatRounded,
|
27621 | "s": formatPrefixAuto,
|
27622 | "X": function X(x) {
|
27623 | return Math.round(x).toString(16).toUpperCase();
|
27624 | },
|
27625 | "x": function x(_x) {
|
27626 | return Math.round(_x).toString(16);
|
27627 | }
|
27628 | });
|
27629 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/identity.js
|
27630 | /* harmony default export */ function src_identity(x) {
|
27631 | return x;
|
27632 | }
|
27633 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/locale.js
|
27634 |
|
27635 |
|
27636 |
|
27637 |
|
27638 |
|
27639 |
|
27640 |
|
27641 |
|
27642 | var map = Array.prototype.map,
|
27643 | prefixes = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
|
27644 | /* harmony default export */ function src_locale(locale) {
|
27645 | var group = locale.grouping === undefined || locale.thousands === undefined ? src_identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + ""),
|
27646 | currencyPrefix = locale.currency === undefined ? "" : locale.currency[0] + "",
|
27647 | currencySuffix = locale.currency === undefined ? "" : locale.currency[1] + "",
|
27648 | decimal = locale.decimal === undefined ? "." : locale.decimal + "",
|
27649 | numerals = locale.numerals === undefined ? src_identity : formatNumerals(map.call(locale.numerals, String)),
|
27650 | percent = locale.percent === undefined ? "%" : locale.percent + "",
|
27651 | minus = locale.minus === undefined ? "−" : locale.minus + "",
|
27652 | nan = locale.nan === undefined ? "NaN" : locale.nan + "";
|
27653 |
|
27654 | function newFormat(specifier) {
|
27655 | specifier = formatSpecifier(specifier);
|
27656 | var fill = specifier.fill,
|
27657 | align = specifier.align,
|
27658 | sign = specifier.sign,
|
27659 | symbol = specifier.symbol,
|
27660 | zero = specifier.zero,
|
27661 | width = specifier.width,
|
27662 | comma = specifier.comma,
|
27663 | precision = specifier.precision,
|
27664 | trim = specifier.trim,
|
27665 | type = specifier.type; // The "n" type is an alias for ",g".
|
27666 |
|
27667 | if (type === "n") comma = !0, type = "g"; // The "" type, and any invalid type, is an alias for ".12~g".
|
27668 | else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = !0, type = "g"; // If zero fill is specified, padding goes after sign and before digits.
|
27669 |
|
27670 | if (zero || fill === "0" && align === "=") zero = !0, fill = "0", align = "="; // Compute the prefix and suffix.
|
27671 | // For SI-prefix, the suffix is lazily computed.
|
27672 |
|
27673 | var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "",
|
27674 | suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : "",
|
27675 | formatType = formatTypes[type],
|
27676 | maybeSuffix = /[defgprs%]/.test(type); // What format function should we use?
|
27677 | // Is this an integer type?
|
27678 | // Can this type generate exponential notation?
|
27679 |
|
27680 | // Set the default precision if not specified,
|
27681 | // or clamp the specified precision to the supported range.
|
27682 | // For significant precision, it must be in [1, 21].
|
27683 | // For fixed precision, it must be in [0, 20].
|
27684 | precision = precision === undefined ? 6 : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision)) : Math.max(0, Math.min(20, precision));
|
27685 |
|
27686 | function format(value) {
|
27687 | var valuePrefix = prefix,
|
27688 | valueSuffix = suffix,
|
27689 | i,
|
27690 | n,
|
27691 | c;
|
27692 |
|
27693 | if (type === "c") {
|
27694 | valueSuffix = formatType(value) + valueSuffix;
|
27695 | value = "";
|
27696 | } else {
|
27697 | value = +value; // Determine the sign. -0 is not less than 0, but 1 / -0 is!
|
27698 |
|
27699 | var valueNegative = value < 0 || 1 / value < 0; // Perform the initial formatting.
|
27700 |
|
27701 | value = isNaN(value) ? nan : formatType(Math.abs(value), precision); // Trim insignificant zeros.
|
27702 |
|
27703 | if (trim) value = formatTrim(value); // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.
|
27704 |
|
27705 | if (valueNegative && +value === 0 && sign !== "+") valueNegative = !1; // Compute the prefix and suffix.
|
27706 |
|
27707 | valuePrefix = (valueNegative ? sign === "(" ? sign : minus : sign === "-" || sign === "(" ? "" : sign) + valuePrefix;
|
27708 | valueSuffix = (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : ""); // Break the formatted value into the integer “value” part that can be
|
27709 | // grouped, and fractional or exponential “suffix” part that is not.
|
27710 |
|
27711 | if (maybeSuffix) {
|
27712 | i = -1, n = value.length;
|
27713 |
|
27714 | while (++i < n) {
|
27715 | if (c = value.charCodeAt(i), 48 > c || c > 57) {
|
27716 | valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;
|
27717 | value = value.slice(0, i);
|
27718 | break;
|
27719 | }
|
27720 | }
|
27721 | }
|
27722 | } // If the fill character is not "0", grouping is applied before padding.
|
27723 |
|
27724 |
|
27725 | if (comma && !zero) value = group(value, Infinity); // Compute the padding.
|
27726 |
|
27727 | var length = valuePrefix.length + value.length + valueSuffix.length,
|
27728 | padding = length < width ? Array(width - length + 1).join(fill) : ""; // If the fill character is "0", grouping is applied after padding.
|
27729 |
|
27730 | if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = ""; // Reconstruct the final output based on the desired alignment.
|
27731 |
|
27732 | switch (align) {
|
27733 | case "<":
|
27734 | value = valuePrefix + value + valueSuffix + padding;
|
27735 | break;
|
27736 |
|
27737 | case "=":
|
27738 | value = valuePrefix + padding + value + valueSuffix;
|
27739 | break;
|
27740 |
|
27741 | case "^":
|
27742 | value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length);
|
27743 | break;
|
27744 |
|
27745 | default:
|
27746 | value = padding + valuePrefix + value + valueSuffix;
|
27747 | break;
|
27748 | }
|
27749 |
|
27750 | return numerals(value);
|
27751 | }
|
27752 |
|
27753 | format.toString = function () {
|
27754 | return specifier + "";
|
27755 | };
|
27756 |
|
27757 | return format;
|
27758 | }
|
27759 |
|
27760 | return {
|
27761 | format: newFormat,
|
27762 | formatPrefix: function (specifier, value) {
|
27763 | var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)),
|
27764 | e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,
|
27765 | k = Math.pow(10, -e),
|
27766 | prefix = prefixes[8 + e / 3];
|
27767 | return function (value) {
|
27768 | return f(k * value) + prefix;
|
27769 | };
|
27770 | }
|
27771 | };
|
27772 | }
|
27773 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/defaultLocale.js
|
27774 |
|
27775 | var defaultLocale_locale;
|
27776 | var defaultLocale_format;
|
27777 | var formatPrefix;
|
27778 | defaultLocale_defaultLocale({
|
27779 | thousands: ",",
|
27780 | grouping: [3],
|
27781 | currency: ["$", ""]
|
27782 | });
|
27783 | function defaultLocale_defaultLocale(definition) {
|
27784 | defaultLocale_locale = src_locale(definition);
|
27785 | defaultLocale_format = defaultLocale_locale.format;
|
27786 | formatPrefix = defaultLocale_locale.formatPrefix;
|
27787 | return defaultLocale_locale;
|
27788 | }
|
27789 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/precisionRound.js
|
27790 |
|
27791 | /* harmony default export */ function precisionRound(step, max) {
|
27792 | step = Math.abs(step), max = Math.abs(max) - step;
|
27793 | return Math.max(0, exponent(max) - exponent(step)) + 1;
|
27794 | }
|
27795 | ;// CONCATENATED MODULE: ./node_modules/d3-format/src/precisionFixed.js
|
27796 |
|
27797 | /* harmony default export */ function precisionFixed(step) {
|
27798 | return Math.max(0, -exponent(Math.abs(step)));
|
27799 | }
|
27800 | ;// CONCATENATED MODULE: ./node_modules/d3-scale/src/tickFormat.js
|
27801 |
|
27802 |
|
27803 | function tickFormat(start, stop, count, specifier) {
|
27804 | var step = tickStep(start, stop, count),
|
27805 | precision;
|
27806 | specifier = formatSpecifier(specifier == null ? ",f" : specifier);
|
27807 |
|
27808 | switch (specifier.type) {
|
27809 | case "s":
|
27810 | {
|
27811 | var value = Math.max(Math.abs(start), Math.abs(stop));
|
27812 | if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;
|
27813 | return formatPrefix(specifier, value);
|
27814 | }
|
27815 |
|
27816 | case "":
|
27817 | case "e":
|
27818 | case "g":
|
27819 | case "p":
|
27820 | case "r":
|
27821 | {
|
27822 | if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === "e");
|
27823 | break;
|
27824 | }
|
27825 |
|
27826 | case "f":
|
27827 | case "%":
|
27828 | {
|
27829 | if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === "%") * 2;
|
27830 | break;
|
27831 | }
|
27832 | }
|
27833 |
|
27834 | return defaultLocale_format(specifier);
|
27835 | }
|
27836 | ;// CONCATENATED MODULE: ./node_modules/d3-scale/src/linear.js
|
27837 |
|
27838 |
|
27839 |
|
27840 |
|
27841 | function linearish(scale) {
|
27842 | var domain = scale.domain;
|
27843 |
|
27844 | scale.ticks = function (count) {
|
27845 | var d = domain();
|
27846 | return ticks(d[0], d[d.length - 1], count == null ? 10 : count);
|
27847 | };
|
27848 |
|
27849 | scale.tickFormat = function (count, specifier) {
|
27850 | var d = domain();
|
27851 | return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);
|
27852 | };
|
27853 |
|
27854 | scale.nice = function (count) {
|
27855 | if (count == null) count = 10;
|
27856 | var d = domain(),
|
27857 | i0 = 0,
|
27858 | i1 = d.length - 1,
|
27859 | start = d[i0],
|
27860 | stop = d[i1],
|
27861 | prestep,
|
27862 | step,
|
27863 | maxIter = 10;
|
27864 |
|
27865 | if (stop < start) {
|
27866 | step = start, start = stop, stop = step;
|
27867 | step = i0, i0 = i1, i1 = step;
|
27868 | }
|
27869 |
|
27870 | while (maxIter-- > 0) {
|
27871 | step = tickIncrement(start, stop, count);
|
27872 |
|
27873 | if (step === prestep) {
|
27874 | d[i0] = start;
|
27875 | d[i1] = stop;
|
27876 | return domain(d);
|
27877 | } else if (step > 0) {
|
27878 | start = Math.floor(start / step) * step;
|
27879 | stop = Math.ceil(stop / step) * step;
|
27880 | } else if (step < 0) {
|
27881 | start = Math.ceil(start * step) / step;
|
27882 | stop = Math.floor(stop * step) / step;
|
27883 | } else {
|
27884 | break;
|
27885 | }
|
27886 |
|
27887 | prestep = step;
|
27888 | }
|
27889 |
|
27890 | return scale;
|
27891 | };
|
27892 |
|
27893 | return scale;
|
27894 | }
|
27895 | function linear_linear() {
|
27896 | var scale = continuous();
|
27897 |
|
27898 | scale.copy = function () {
|
27899 | return copy(scale, linear_linear());
|
27900 | };
|
27901 |
|
27902 | initRange.apply(scale, arguments);
|
27903 | return linearish(scale);
|
27904 | }
|
27905 | ;// CONCATENATED MODULE: ./node_modules/d3-scale/src/symlog.js
|
27906 |
|
27907 |
|
27908 |
|
27909 |
|
27910 | function transformSymlog(c) {
|
27911 | return function (x) {
|
27912 | return Math.sign(x) * Math.log1p(Math.abs(x / c));
|
27913 | };
|
27914 | }
|
27915 |
|
27916 | function transformSymexp(c) {
|
27917 | return function (x) {
|
27918 | return Math.sign(x) * Math.expm1(Math.abs(x)) * c;
|
27919 | };
|
27920 | }
|
27921 |
|
27922 | function symlogish(transform) {
|
27923 | var c = 1,
|
27924 | scale = transform(transformSymlog(c), transformSymexp(c));
|
27925 |
|
27926 | scale.constant = function (_) {
|
27927 | return arguments.length ? transform(transformSymlog(c = +_), transformSymexp(c)) : c;
|
27928 | };
|
27929 |
|
27930 | return linearish(scale);
|
27931 | }
|
27932 | function symlog() {
|
27933 | var scale = symlogish(transformer());
|
27934 |
|
27935 | scale.copy = function () {
|
27936 | return copy(scale, symlog()).constant(scale.constant());
|
27937 | };
|
27938 |
|
27939 | return initRange.apply(scale, arguments);
|
27940 | }
|
27941 | ;// CONCATENATED MODULE: ./node_modules/d3-scale/src/nice.js
|
27942 | function nice(domain, interval) {
|
27943 | domain = domain.slice();
|
27944 | var i0 = 0,
|
27945 | i1 = domain.length - 1,
|
27946 | x0 = domain[i0],
|
27947 | x1 = domain[i1],
|
27948 | t;
|
27949 |
|
27950 | if (x1 < x0) {
|
27951 | t = i0, i0 = i1, i1 = t;
|
27952 | t = x0, x0 = x1, x1 = t;
|
27953 | }
|
27954 |
|
27955 | domain[i0] = interval.floor(x0);
|
27956 | domain[i1] = interval.ceil(x1);
|
27957 | return domain;
|
27958 | }
|
27959 | ;// CONCATENATED MODULE: ./node_modules/d3-scale/src/log.js
|
27960 |
|
27961 |
|
27962 |
|
27963 |
|
27964 |
|
27965 |
|
27966 | function transformLog(x) {
|
27967 | return Math.log(x);
|
27968 | }
|
27969 |
|
27970 | function transformExp(x) {
|
27971 | return Math.exp(x);
|
27972 | }
|
27973 |
|
27974 | function transformLogn(x) {
|
27975 | return -Math.log(-x);
|
27976 | }
|
27977 |
|
27978 | function transformExpn(x) {
|
27979 | return -Math.exp(-x);
|
27980 | }
|
27981 |
|
27982 | function pow10(x) {
|
27983 | return isFinite(x) ? +("1e" + x) : x < 0 ? 0 : x;
|
27984 | }
|
27985 |
|
27986 | function powp(base) {
|
27987 | return base === 10 ? pow10 : base === Math.E ? Math.exp : function (x) {
|
27988 | return Math.pow(base, x);
|
27989 | };
|
27990 | }
|
27991 |
|
27992 | function logp(base) {
|
27993 | return base === Math.E ? Math.log : base === 10 && Math.log10 || base === 2 && Math.log2 || (base = Math.log(base), function (x) {
|
27994 | return Math.log(x) / base;
|
27995 | });
|
27996 | }
|
27997 |
|
27998 | function reflect(f) {
|
27999 | return function (x, k) {
|
28000 | return -f(-x, k);
|
28001 | };
|
28002 | }
|
28003 |
|
28004 | function loggish(transform) {
|
28005 | var scale = transform(transformLog, transformExp),
|
28006 | domain = scale.domain,
|
28007 | base = 10,
|
28008 | logs,
|
28009 | pows;
|
28010 |
|
28011 | function rescale() {
|
28012 | logs = logp(base), pows = powp(base);
|
28013 |
|
28014 | if (domain()[0] < 0) {
|
28015 | logs = reflect(logs), pows = reflect(pows);
|
28016 | transform(transformLogn, transformExpn);
|
28017 | } else {
|
28018 | transform(transformLog, transformExp);
|
28019 | }
|
28020 |
|
28021 | return scale;
|
28022 | }
|
28023 |
|
28024 | scale.base = function (_) {
|
28025 | return arguments.length ? (base = +_, rescale()) : base;
|
28026 | };
|
28027 |
|
28028 | scale.domain = function (_) {
|
28029 | return arguments.length ? (domain(_), rescale()) : domain();
|
28030 | };
|
28031 |
|
28032 | scale.ticks = function (count) {
|
28033 | var d = domain(),
|
28034 | u = d[0],
|
28035 | v = d[d.length - 1],
|
28036 | r = v < u;
|
28037 |
|
28038 | if (r) {
|
28039 | var _ref = [v, u];
|
28040 | u = _ref[0];
|
28041 | v = _ref[1];
|
28042 | }
|
28043 |
|
28044 | var i = logs(u),
|
28045 | j = logs(v),
|
28046 | k,
|
28047 | t,
|
28048 | n = count == null ? 10 : +count,
|
28049 | z = [];
|
28050 |
|
28051 | if (!(base % 1) && j - i < n) {
|
28052 | i = Math.floor(i), j = Math.ceil(j);
|
28053 | if (u > 0) for (; i <= j; ++i) {
|
28054 | for (k = 1; k < base; ++k) {
|
28055 | t = i < 0 ? k / pows(-i) : k * pows(i);
|
28056 | if (t < u) continue;
|
28057 | if (t > v) break;
|
28058 | z.push(t);
|
28059 | }
|
28060 | } else for (; i <= j; ++i) {
|
28061 | for (k = base - 1; k >= 1; --k) {
|
28062 | t = i > 0 ? k / pows(-i) : k * pows(i);
|
28063 | if (t < u) continue;
|
28064 | if (t > v) break;
|
28065 | z.push(t);
|
28066 | }
|
28067 | }
|
28068 | if (z.length * 2 < n) z = ticks(u, v, n);
|
28069 | } else {
|
28070 | z = ticks(i, j, Math.min(j - i, n)).map(pows);
|
28071 | }
|
28072 |
|
28073 | return r ? z.reverse() : z;
|
28074 | };
|
28075 |
|
28076 | scale.tickFormat = function (count, specifier) {
|
28077 | if (count == null) count = 10;
|
28078 | if (specifier == null) specifier = base === 10 ? "s" : ",";
|
28079 |
|
28080 | if (typeof specifier !== "function") {
|
28081 | if (!(base % 1) && (specifier = formatSpecifier(specifier)).precision == null) specifier.trim = !0;
|
28082 | specifier = defaultLocale_format(specifier);
|
28083 | }
|
28084 |
|
28085 | if (count === Infinity) return specifier;
|
28086 | var k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?
|
28087 |
|
28088 | return function (d) {
|
28089 | var i = d / pows(Math.round(logs(d)));
|
28090 | if (i * base < base - .5) i *= base;
|
28091 | return i <= k ? specifier(d) : "";
|
28092 | };
|
28093 | };
|
28094 |
|
28095 | scale.nice = function () {
|
28096 | return domain(nice(domain(), {
|
28097 | floor: function floor(x) {
|
28098 | return pows(Math.floor(logs(x)));
|
28099 | },
|
28100 | ceil: function ceil(x) {
|
28101 | return pows(Math.ceil(logs(x)));
|
28102 | }
|
28103 | }));
|
28104 | };
|
28105 |
|
28106 | return scale;
|
28107 | }
|
28108 | function log() {
|
28109 | var scale = loggish(transformer()).domain([1, 10]);
|
28110 |
|
28111 | scale.copy = function () {
|
28112 | return copy(scale, log()).base(scale.base());
|
28113 | };
|
28114 |
|
28115 | initRange.apply(scale, arguments);
|
28116 | return scale;
|
28117 | }
|
28118 | ;// CONCATENATED MODULE: ./node_modules/d3-time/src/millisecond.js
|
28119 |
|
28120 | var millisecond = newInterval(function () {// noop
|
28121 | }, function (date, step) {
|
28122 | date.setTime(+date + step);
|
28123 | }, function (start, end) {
|
28124 | return end - start;
|
28125 | }); // An optimized implementation for this simple case.
|
28126 |
|
28127 | millisecond.every = function (k) {
|
28128 | k = Math.floor(k);
|
28129 | if (!isFinite(k) || !(k > 0)) return null;
|
28130 | if (!(k > 1)) return millisecond;
|
28131 | return newInterval(function (date) {
|
28132 | date.setTime(Math.floor(date / k) * k);
|
28133 | }, function (date, step) {
|
28134 | date.setTime(+date + step * k);
|
28135 | }, function (start, end) {
|
28136 | return (end - start) / k;
|
28137 | });
|
28138 | };
|
28139 |
|
28140 | /* harmony default export */ var src_millisecond = (millisecond);
|
28141 | var milliseconds = millisecond.range;
|
28142 | ;// CONCATENATED MODULE: ./node_modules/d3-time/src/second.js
|
28143 |
|
28144 |
|
28145 | var second = newInterval(function (date) {
|
28146 | date.setTime(date - date.getMilliseconds());
|
28147 | }, function (date, step) {
|
28148 | date.setTime(+date + step * durationSecond);
|
28149 | }, function (start, end) {
|
28150 | return (end - start) / durationSecond;
|
28151 | }, function (date) {
|
28152 | return date.getUTCSeconds();
|
28153 | });
|
28154 | /* harmony default export */ var src_second = (second);
|
28155 | var seconds = second.range;
|
28156 | ;// CONCATENATED MODULE: ./node_modules/d3-time/src/minute.js
|
28157 |
|
28158 |
|
28159 | var minute = newInterval(function (date) {
|
28160 | date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);
|
28161 | }, function (date, step) {
|
28162 | date.setTime(+date + step * durationMinute);
|
28163 | }, function (start, end) {
|
28164 | return (end - start) / durationMinute;
|
28165 | }, function (date) {
|
28166 | return date.getMinutes();
|
28167 | });
|
28168 | /* harmony default export */ var src_minute = (minute);
|
28169 | var minutes = minute.range;
|
28170 | ;// CONCATENATED MODULE: ./node_modules/d3-time/src/hour.js
|
28171 |
|
28172 |
|
28173 | var hour = newInterval(function (date) {
|
28174 | date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);
|
28175 | }, function (date, step) {
|
28176 | date.setTime(+date + step * durationHour);
|
28177 | }, function (start, end) {
|
28178 | return (end - start) / durationHour;
|
28179 | }, function (date) {
|
28180 | return date.getHours();
|
28181 | });
|
28182 | /* harmony default export */ var src_hour = (hour);
|
28183 | var hours = hour.range;
|
28184 | ;// CONCATENATED MODULE: ./node_modules/d3-time/src/month.js
|
28185 |
|
28186 | var month = newInterval(function (date) {
|
28187 | date.setDate(1);
|
28188 | date.setHours(0, 0, 0, 0);
|
28189 | }, function (date, step) {
|
28190 | date.setMonth(date.getMonth() + step);
|
28191 | }, function (start, end) {
|
28192 | return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;
|
28193 | }, function (date) {
|
28194 | return date.getMonth();
|
28195 | });
|
28196 | /* harmony default export */ var src_month = (month);
|
28197 | var months = month.range;
|
28198 | ;// CONCATENATED MODULE: ./node_modules/d3-time/src/utcMinute.js
|
28199 |
|
28200 |
|
28201 | var utcMinute = newInterval(function (date) {
|
28202 | date.setUTCSeconds(0, 0);
|
28203 | }, function (date, step) {
|
28204 | date.setTime(+date + step * durationMinute);
|
28205 | }, function (start, end) {
|
28206 | return (end - start) / durationMinute;
|
28207 | }, function (date) {
|
28208 | return date.getUTCMinutes();
|
28209 | });
|
28210 | /* harmony default export */ var src_utcMinute = (utcMinute);
|
28211 | var utcMinutes = utcMinute.range;
|
28212 | ;// CONCATENATED MODULE: ./node_modules/d3-time/src/utcHour.js
|
28213 |
|
28214 |
|
28215 | var utcHour = newInterval(function (date) {
|
28216 | date.setUTCMinutes(0, 0, 0);
|
28217 | }, function (date, step) {
|
28218 | date.setTime(+date + step * durationHour);
|
28219 | }, function (start, end) {
|
28220 | return (end - start) / durationHour;
|
28221 | }, function (date) {
|
28222 | return date.getUTCHours();
|
28223 | });
|
28224 | /* harmony default export */ var src_utcHour = (utcHour);
|
28225 | var utcHours = utcHour.range;
|
28226 | ;// CONCATENATED MODULE: ./node_modules/d3-time/src/utcMonth.js
|
28227 |
|
28228 | var utcMonth = newInterval(function (date) {
|
28229 | date.setUTCDate(1);
|
28230 | date.setUTCHours(0, 0, 0, 0);
|
28231 | }, function (date, step) {
|
28232 | date.setUTCMonth(date.getUTCMonth() + step);
|
28233 | }, function (start, end) {
|
28234 | return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;
|
28235 | }, function (date) {
|
28236 | return date.getUTCMonth();
|
28237 | });
|
28238 | /* harmony default export */ var src_utcMonth = (utcMonth);
|
28239 | var utcMonths = utcMonth.range;
|
28240 | ;// CONCATENATED MODULE: ./node_modules/d3-time/src/ticks.js
|
28241 |
|
28242 |
|
28243 |
|
28244 |
|
28245 |
|
28246 |
|
28247 |
|
28248 |
|
28249 |
|
28250 |
|
28251 |
|
28252 |
|
28253 |
|
28254 |
|
28255 |
|
28256 |
|
28257 |
|
28258 | function ticker(year, month, week, day, hour, minute) {
|
28259 | var tickIntervals = [[src_second, 1, durationSecond], [src_second, 5, 5 * durationSecond], [src_second, 15, 15 * durationSecond], [src_second, 30, 30 * durationSecond], [minute, 1, durationMinute], [minute, 5, 5 * durationMinute], [minute, 15, 15 * durationMinute], [minute, 30, 30 * durationMinute], [hour, 1, durationHour], [hour, 3, 3 * durationHour], [hour, 6, 6 * durationHour], [hour, 12, 12 * durationHour], [day, 1, durationDay], [day, 2, 2 * durationDay], [week, 1, durationWeek], [month, 1, durationMonth], [month, 3, 3 * durationMonth], [year, 1, durationYear]];
|
28260 |
|
28261 | function ticks(start, stop, count) {
|
28262 | var reverse = stop < start;
|
28263 |
|
28264 | if (reverse) {
|
28265 | var _ref = [stop, start];
|
28266 | start = _ref[0];
|
28267 | stop = _ref[1];
|
28268 | }
|
28269 |
|
28270 | var interval = count && typeof count.range === "function" ? count : tickInterval(start, stop, count),
|
28271 | ticks = interval ? interval.range(start, +stop + 1) : [];
|
28272 | // inclusive stop
|
28273 | return reverse ? ticks.reverse() : ticks;
|
28274 | }
|
28275 |
|
28276 | function tickInterval(start, stop, count) {
|
28277 | var target = Math.abs(stop - start) / count,
|
28278 | i = bisector(function (_ref2) {
|
28279 | var step = _ref2[2];
|
28280 | return step;
|
28281 | }).right(tickIntervals, target);
|
28282 | if (i === tickIntervals.length) return year.every(tickStep(start / durationYear, stop / durationYear, count));
|
28283 | if (i === 0) return src_millisecond.every(Math.max(tickStep(start, stop, count), 1));
|
28284 | var _tickIntervals = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i],
|
28285 | t = _tickIntervals[0],
|
28286 | step = _tickIntervals[1];
|
28287 | return t.every(step);
|
28288 | }
|
28289 |
|
28290 | return [ticks, tickInterval];
|
28291 | }
|
28292 |
|
28293 | var _ticker = ticker(src_utcYear, src_utcMonth, utcSunday, src_utcDay, src_utcHour, src_utcMinute),
|
28294 | utcTicks = _ticker[0],
|
28295 | utcTickInterval = _ticker[1],
|
28296 | _ticker2 = ticker(src_year, src_month, sunday, src_day, src_hour, src_minute),
|
28297 | timeTicks = _ticker2[0],
|
28298 | timeTickInterval = _ticker2[1];
|
28299 |
|
28300 |
|
28301 | ;// CONCATENATED MODULE: ./node_modules/d3-scale/src/time.js
|
28302 |
|
28303 |
|
28304 |
|
28305 |
|
28306 |
|
28307 |
|
28308 | function time_date(t) {
|
28309 | return new Date(t);
|
28310 | }
|
28311 |
|
28312 | function time_number(t) {
|
28313 | return t instanceof Date ? +t : +new Date(+t);
|
28314 | }
|
28315 |
|
28316 | function calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format) {
|
28317 | var scale = continuous(),
|
28318 | invert = scale.invert,
|
28319 | domain = scale.domain,
|
28320 | formatMillisecond = format(".%L"),
|
28321 | formatSecond = format(":%S"),
|
28322 | formatMinute = format("%I:%M"),
|
28323 | formatHour = format("%I %p"),
|
28324 | formatDay = format("%a %d"),
|
28325 | formatWeek = format("%b %d"),
|
28326 | formatMonth = format("%B"),
|
28327 | formatYear = format("%Y");
|
28328 |
|
28329 | function tickFormat(date) {
|
28330 | 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);
|
28331 | }
|
28332 |
|
28333 | scale.invert = function (y) {
|
28334 | return new Date(invert(y));
|
28335 | };
|
28336 |
|
28337 | scale.domain = function (_) {
|
28338 | return arguments.length ? domain(Array.from(_, time_number)) : domain().map(time_date);
|
28339 | };
|
28340 |
|
28341 | scale.ticks = function (interval) {
|
28342 | var d = domain();
|
28343 | return ticks(d[0], d[d.length - 1], interval == null ? 10 : interval);
|
28344 | };
|
28345 |
|
28346 | scale.tickFormat = function (count, specifier) {
|
28347 | return specifier == null ? tickFormat : format(specifier);
|
28348 | };
|
28349 |
|
28350 | scale.nice = function (interval) {
|
28351 | var d = domain();
|
28352 | if (!interval || typeof interval.range !== "function") interval = tickInterval(d[0], d[d.length - 1], interval == null ? 10 : interval);
|
28353 | return interval ? domain(nice(d, interval)) : scale;
|
28354 | };
|
28355 |
|
28356 | scale.copy = function () {
|
28357 | return copy(scale, calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format));
|
28358 | };
|
28359 |
|
28360 | return scale;
|
28361 | }
|
28362 | function time() {
|
28363 | return initRange.apply(calendar(timeTicks, timeTickInterval, src_year, src_month, sunday, src_day, src_hour, src_minute, src_second, timeFormat).domain([new Date(2e3, 0, 1), new Date(2e3, 0, 2)]), arguments);
|
28364 | }
|
28365 | ;// CONCATENATED MODULE: ./node_modules/d3-scale/src/utcTime.js
|
28366 |
|
28367 |
|
28368 |
|
28369 |
|
28370 | function utcTime() {
|
28371 | return initRange.apply(calendar(utcTicks, utcTickInterval, src_utcYear, src_utcMonth, utcSunday, src_utcDay, src_utcHour, src_utcMinute, src_second, utcFormat).domain([Date.UTC(2e3, 0, 1), Date.UTC(2e3, 0, 2)]), arguments);
|
28372 | }
|
28373 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/scale.ts
|
28374 | /**
|
28375 | * Copyright (c) 2017 ~ present NAVER Corp.
|
28376 | * billboard.js project is licensed under the MIT license
|
28377 | */
|
28378 |
|
28379 |
|
28380 |
|
28381 | /**
|
28382 | * Get scale
|
28383 | * @param {string} [type='linear'] Scale type
|
28384 | * @param {number} [min] Min range
|
28385 | * @param {number} [max] Max range
|
28386 | * @returns {d3.scaleLinear|d3.scaleTime} scale
|
28387 | * @private
|
28388 | */
|
28389 | function getScale(type, min, max) {
|
28390 | if (type === void 0) {
|
28391 | type = "linear";
|
28392 | }
|
28393 |
|
28394 | if (min === void 0) {
|
28395 | min = 0;
|
28396 | }
|
28397 |
|
28398 | if (max === void 0) {
|
28399 | max = 1;
|
28400 | }
|
28401 |
|
28402 | var scale = {
|
28403 | linear: linear_linear,
|
28404 | log: symlog,
|
28405 | _log: log,
|
28406 | time: time,
|
28407 | utc: utcTime
|
28408 | }[type]();
|
28409 | scale.type = type;
|
28410 | /_?log/.test(type) && scale.clamp(!0);
|
28411 | return scale.range([min, max]);
|
28412 | }
|
28413 | /* harmony default export */ var scale = ({
|
28414 | /**
|
28415 | * Get x Axis scale function
|
28416 | * @param {number} min Min value
|
28417 | * @param {number} max Max value
|
28418 | * @param {Array} domain Domain value
|
28419 | * @param {Function} offset The offset getter to be sum
|
28420 | * @returns {Function} scale
|
28421 | * @private
|
28422 | */
|
28423 | getXScale: function getXScale(min, max, domain, offset) {
|
28424 | var $$ = this,
|
28425 | scale = $$.scale.zoom || getScale($$.axis.getAxisType("x"), min, max);
|
28426 | return $$.getCustomizedScale(domain ? scale.domain(domain) : scale, offset);
|
28427 | },
|
28428 |
|
28429 | /**
|
28430 | * Get y Axis scale function
|
28431 | * @param {string} id Axis id: 'y' or 'y2'
|
28432 | * @param {number} min Min value
|
28433 | * @param {number} max Max value
|
28434 | * @param {Array} domain Domain value
|
28435 | * @returns {Function} Scale function
|
28436 | * @private
|
28437 | */
|
28438 | getYScale: function getYScale(id, min, max, domain) {
|
28439 | var $$ = this,
|
28440 | scale = getScale($$.axis.getAxisType(id), min, max);
|
28441 | domain && scale.domain(domain);
|
28442 | return scale;
|
28443 | },
|
28444 |
|
28445 | /**
|
28446 | * Get y Axis scale
|
28447 | * @param {string} id Axis id
|
28448 | * @param {boolean} isSub Weather is sub Axis
|
28449 | * @returns {Function} Scale function
|
28450 | * @private
|
28451 | */
|
28452 | getYScaleById: function getYScaleById(id, isSub) {
|
28453 | if (isSub === void 0) {
|
28454 | isSub = !1;
|
28455 | }
|
28456 |
|
28457 | var isY2 = this.axis.getId(id) === "y2",
|
28458 | key = isSub ? isY2 ? "subY2" : "subY" : isY2 ? "y2" : "y";
|
28459 | return this.scale[key];
|
28460 | },
|
28461 |
|
28462 | /**
|
28463 | * Get customized scale
|
28464 | * @param {d3.scaleLinear|d3.scaleTime} scaleValue Scale function
|
28465 | * @param {Function} offsetValue Offset getter to be sum
|
28466 | * @returns {Function} Scale function
|
28467 | * @private
|
28468 | */
|
28469 | getCustomizedScale: function getCustomizedScale(scaleValue, offsetValue) {
|
28470 | var $$ = this,
|
28471 | offset = offsetValue || function () {
|
28472 | return $$.axis.x.tickOffset();
|
28473 | },
|
28474 | scale = function (d, raw) {
|
28475 | var v = scaleValue(d) + offset();
|
28476 | return raw ? v : Math.ceil(v);
|
28477 | };
|
28478 |
|
28479 | // copy original scale methods
|
28480 | for (var key in scaleValue) {
|
28481 | scale[key] = scaleValue[key];
|
28482 | }
|
28483 |
|
28484 | scale.orgDomain = function () {
|
28485 | return scaleValue.domain();
|
28486 | };
|
28487 |
|
28488 | scale.orgScale = function () {
|
28489 | return scaleValue;
|
28490 | }; // define custom domain() for categorized axis
|
28491 |
|
28492 |
|
28493 | if ($$.axis.isCategorized()) {
|
28494 | scale.domain = function (domainValue) {
|
28495 | var domain = domainValue;
|
28496 |
|
28497 | if (!arguments.length) {
|
28498 | domain = this.orgDomain();
|
28499 | return [domain[0], domain[1] + 1];
|
28500 | }
|
28501 |
|
28502 | scaleValue.domain(domain);
|
28503 | return scale;
|
28504 | };
|
28505 | }
|
28506 |
|
28507 | return scale;
|
28508 | },
|
28509 |
|
28510 | /**
|
28511 | * Update scale
|
28512 | * @param {boolean} isInit Param is given at the init rendering
|
28513 | * @param {boolean} updateXDomain If update x domain
|
28514 | * @private
|
28515 | */
|
28516 | updateScales: function updateScales(isInit, updateXDomain) {
|
28517 | if (updateXDomain === void 0) {
|
28518 | updateXDomain = !0;
|
28519 | }
|
28520 |
|
28521 | var $$ = this,
|
28522 | axis = $$.axis,
|
28523 | config = $$.config,
|
28524 | format = $$.format,
|
28525 | org = $$.org,
|
28526 | scale = $$.scale,
|
28527 | _$$$state = $$.state,
|
28528 | width = _$$$state.width,
|
28529 | height = _$$$state.height,
|
28530 | width2 = _$$$state.width2,
|
28531 | height2 = _$$$state.height2,
|
28532 | hasAxis = _$$$state.hasAxis;
|
28533 |
|
28534 | if (hasAxis) {
|
28535 | var _scale$x,
|
28536 | isRotated = config.axis_rotated,
|
28537 | min = {
|
28538 | x: isRotated ? 1 : 0,
|
28539 | y: isRotated ? 0 : height,
|
28540 | subX: isRotated ? 1 : 0,
|
28541 | subY: isRotated ? 0 : height2
|
28542 | },
|
28543 | max = {
|
28544 | x: isRotated ? height : width,
|
28545 | y: isRotated ? width : 1,
|
28546 | subX: isRotated ? height : width,
|
28547 | subY: isRotated ? width2 : 1
|
28548 | },
|
28549 | xDomain = updateXDomain && ((_scale$x = scale.x) == null ? void 0 : _scale$x.orgDomain()),
|
28550 | xSubDomain = updateXDomain && org.xDomain;
|
28551 |
|
28552 | scale.x = $$.getXScale(min.x, max.x, xDomain, function () {
|
28553 | return axis.x.tickOffset();
|
28554 | });
|
28555 | scale.subX = $$.getXScale(min.x, max.x, xSubDomain, function (d) {
|
28556 | return d % 1 ? 0 : axis.subX.tickOffset();
|
28557 | });
|
28558 | format.xAxisTick = axis.getXAxisTickFormat();
|
28559 | format.subXAxisTick = axis.getXAxisTickFormat(!0);
|
28560 | axis.setAxis("x", scale.x, config.axis_x_tick_outer, isInit);
|
28561 |
|
28562 | if (config.subchart_show) {
|
28563 | axis.setAxis("subX", scale.subX, config.axis_x_tick_outer, isInit);
|
28564 | } // y Axis
|
28565 |
|
28566 |
|
28567 | scale.y = $$.getYScale("y", min.y, max.y, scale.y ? scale.y.domain() : config.axis_y_default);
|
28568 | scale.subY = $$.getYScale("y", min.subY, max.subY, scale.subY ? scale.subY.domain() : config.axis_y_default);
|
28569 | axis.setAxis("y", scale.y, config.axis_y_tick_outer, isInit); // y2 Axis
|
28570 |
|
28571 | if (config.axis_y2_show) {
|
28572 | scale.y2 = $$.getYScale("y2", min.y, max.y, scale.y2 ? scale.y2.domain() : config.axis_y2_default);
|
28573 | scale.subY2 = $$.getYScale("y2", min.subY, max.subY, scale.subY2 ? scale.subY2.domain() : config.axis_y2_default);
|
28574 | axis.setAxis("y2", scale.y2, config.axis_y2_tick_outer, isInit);
|
28575 | }
|
28576 | } else {
|
28577 | // update for arc
|
28578 | $$.updateArc == null ? void 0 : $$.updateArc();
|
28579 | }
|
28580 | },
|
28581 |
|
28582 | /**
|
28583 | * Get the zoom or unzoomed scaled value
|
28584 | * @param {Date|number|object} d Data value
|
28585 | * @returns {number|null}
|
28586 | * @private
|
28587 | */
|
28588 | xx: function xx(d) {
|
28589 | var $$ = this,
|
28590 | config = $$.config,
|
28591 | _$$$scale = $$.scale,
|
28592 | x = _$$$scale.x,
|
28593 | zoom = _$$$scale.zoom,
|
28594 | fn = config.zoom_enabled && zoom ? zoom : x;
|
28595 | return d ? fn(isValue(d.x) ? d.x : d) : null;
|
28596 | },
|
28597 | xv: function xv(d) {
|
28598 | var $$ = this,
|
28599 | axis = $$.axis,
|
28600 | config = $$.config,
|
28601 | _$$$scale2 = $$.scale,
|
28602 | x = _$$$scale2.x,
|
28603 | zoom = _$$$scale2.zoom,
|
28604 | fn = config.zoom_enabled && zoom ? zoom : x,
|
28605 | value = $$.getBaseValue(d);
|
28606 |
|
28607 | if (axis.isTimeSeries()) {
|
28608 | value = parseDate.call($$, value);
|
28609 | } else if (axis.isCategorized() && isString(value)) {
|
28610 | value = config.axis_x_categories.indexOf(value);
|
28611 | }
|
28612 |
|
28613 | return Math.ceil(fn(value));
|
28614 | },
|
28615 | yv: function yv(d) {
|
28616 | var $$ = this,
|
28617 | _$$$scale3 = $$.scale,
|
28618 | y = _$$$scale3.y,
|
28619 | y2 = _$$$scale3.y2,
|
28620 | yScale = d.axis && d.axis === "y2" ? y2 : y;
|
28621 | return Math.ceil(yScale($$.getBaseValue(d)));
|
28622 | },
|
28623 | subxx: function subxx(d) {
|
28624 | return d ? this.scale.subX(d.x) : null;
|
28625 | }
|
28626 | });
|
28627 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/basis.js
|
28628 | function _point(that, x, y) {
|
28629 | 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);
|
28630 | }
|
28631 |
|
28632 |
|
28633 | function Basis(context) {
|
28634 | this._context = context;
|
28635 | }
|
28636 | Basis.prototype = {
|
28637 | areaStart: function areaStart() {
|
28638 | this._line = 0;
|
28639 | },
|
28640 | areaEnd: function areaEnd() {
|
28641 | this._line = NaN;
|
28642 | },
|
28643 | lineStart: function lineStart() {
|
28644 | this._x0 = this._x1 = this._y0 = this._y1 = NaN;
|
28645 | this._point = 0;
|
28646 | },
|
28647 | lineEnd: function lineEnd() {
|
28648 | switch (this._point) {
|
28649 | case 3:
|
28650 | _point(this, this._x1, this._y1);
|
28651 |
|
28652 | // falls through
|
28653 |
|
28654 | case 2:
|
28655 | this._context.lineTo(this._x1, this._y1);
|
28656 |
|
28657 | break;
|
28658 | }
|
28659 |
|
28660 | if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
|
28661 | this._line = 1 - this._line;
|
28662 | },
|
28663 | point: function point(x, y) {
|
28664 | x = +x, y = +y;
|
28665 |
|
28666 | switch (this._point) {
|
28667 | case 0:
|
28668 | this._point = 1;
|
28669 | this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y);
|
28670 | break;
|
28671 |
|
28672 | case 1:
|
28673 | this._point = 2;
|
28674 | break;
|
28675 |
|
28676 | case 2:
|
28677 | this._point = 3;
|
28678 |
|
28679 | this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6);
|
28680 |
|
28681 | // falls through
|
28682 |
|
28683 | default:
|
28684 | _point(this, x, y);
|
28685 |
|
28686 | break;
|
28687 | }
|
28688 |
|
28689 | this._x0 = this._x1, this._x1 = x;
|
28690 | this._y0 = this._y1, this._y1 = y;
|
28691 | }
|
28692 | };
|
28693 | /* harmony default export */ function curve_basis(context) {
|
28694 | return new Basis(context);
|
28695 | }
|
28696 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/noop.js
|
28697 | /* harmony default export */ function src_noop() {}
|
28698 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/basisClosed.js
|
28699 |
|
28700 |
|
28701 |
|
28702 | function BasisClosed(context) {
|
28703 | this._context = context;
|
28704 | }
|
28705 |
|
28706 | BasisClosed.prototype = {
|
28707 | areaStart: src_noop,
|
28708 | areaEnd: src_noop,
|
28709 | lineStart: function lineStart() {
|
28710 | this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;
|
28711 | this._point = 0;
|
28712 | },
|
28713 | lineEnd: function lineEnd() {
|
28714 | switch (this._point) {
|
28715 | case 1:
|
28716 | {
|
28717 | this._context.moveTo(this._x2, this._y2);
|
28718 |
|
28719 | this._context.closePath();
|
28720 |
|
28721 | break;
|
28722 | }
|
28723 |
|
28724 | case 2:
|
28725 | {
|
28726 | this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);
|
28727 |
|
28728 | this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);
|
28729 |
|
28730 | this._context.closePath();
|
28731 |
|
28732 | break;
|
28733 | }
|
28734 |
|
28735 | case 3:
|
28736 | {
|
28737 | this.point(this._x2, this._y2);
|
28738 | this.point(this._x3, this._y3);
|
28739 | this.point(this._x4, this._y4);
|
28740 | break;
|
28741 | }
|
28742 | }
|
28743 | },
|
28744 | point: function point(x, y) {
|
28745 | x = +x, y = +y;
|
28746 |
|
28747 | switch (this._point) {
|
28748 | case 0:
|
28749 | this._point = 1;
|
28750 | this._x2 = x, this._y2 = y;
|
28751 | break;
|
28752 |
|
28753 | case 1:
|
28754 | this._point = 2;
|
28755 | this._x3 = x, this._y3 = y;
|
28756 | break;
|
28757 |
|
28758 | case 2:
|
28759 | this._point = 3;
|
28760 | this._x4 = x, this._y4 = y;
|
28761 |
|
28762 | this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6);
|
28763 |
|
28764 | break;
|
28765 |
|
28766 | default:
|
28767 | _point(this, x, y);
|
28768 |
|
28769 | break;
|
28770 | }
|
28771 |
|
28772 | this._x0 = this._x1, this._x1 = x;
|
28773 | this._y0 = this._y1, this._y1 = y;
|
28774 | }
|
28775 | };
|
28776 | /* harmony default export */ function curve_basisClosed(context) {
|
28777 | return new BasisClosed(context);
|
28778 | }
|
28779 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/basisOpen.js
|
28780 |
|
28781 |
|
28782 | function BasisOpen(context) {
|
28783 | this._context = context;
|
28784 | }
|
28785 |
|
28786 | BasisOpen.prototype = {
|
28787 | areaStart: function areaStart() {
|
28788 | this._line = 0;
|
28789 | },
|
28790 | areaEnd: function areaEnd() {
|
28791 | this._line = NaN;
|
28792 | },
|
28793 | lineStart: function lineStart() {
|
28794 | this._x0 = this._x1 = this._y0 = this._y1 = NaN;
|
28795 | this._point = 0;
|
28796 | },
|
28797 | lineEnd: function lineEnd() {
|
28798 | if (this._line || this._line !== 0 && this._point === 3) this._context.closePath();
|
28799 | this._line = 1 - this._line;
|
28800 | },
|
28801 | point: function point(x, y) {
|
28802 | x = +x, y = +y;
|
28803 |
|
28804 | switch (this._point) {
|
28805 | case 0:
|
28806 | this._point = 1;
|
28807 | break;
|
28808 |
|
28809 | case 1:
|
28810 | this._point = 2;
|
28811 | break;
|
28812 |
|
28813 | case 2:
|
28814 | this._point = 3;
|
28815 | var x0 = (this._x0 + 4 * this._x1 + x) / 6,
|
28816 | y0 = (this._y0 + 4 * this._y1 + y) / 6;
|
28817 | this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0);
|
28818 | break;
|
28819 |
|
28820 | case 3:
|
28821 | this._point = 4;
|
28822 | // falls through
|
28823 |
|
28824 | default:
|
28825 | _point(this, x, y);
|
28826 |
|
28827 | break;
|
28828 | }
|
28829 |
|
28830 | this._x0 = this._x1, this._x1 = x;
|
28831 | this._y0 = this._y1, this._y1 = y;
|
28832 | }
|
28833 | };
|
28834 | /* harmony default export */ function basisOpen(context) {
|
28835 | return new BasisOpen(context);
|
28836 | }
|
28837 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/bundle.js
|
28838 |
|
28839 |
|
28840 | function Bundle(context, beta) {
|
28841 | this._basis = new Basis(context);
|
28842 | this._beta = beta;
|
28843 | }
|
28844 |
|
28845 | Bundle.prototype = {
|
28846 | lineStart: function lineStart() {
|
28847 | this._x = [];
|
28848 | this._y = [];
|
28849 |
|
28850 | this._basis.lineStart();
|
28851 | },
|
28852 | lineEnd: function lineEnd() {
|
28853 | var x = this._x,
|
28854 | y = this._y,
|
28855 | j = x.length - 1;
|
28856 |
|
28857 | if (j > 0) {
|
28858 | var x0 = x[0],
|
28859 | y0 = y[0],
|
28860 | dx = x[j] - x0,
|
28861 | dy = y[j] - y0,
|
28862 | i = -1,
|
28863 | t;
|
28864 |
|
28865 | while (++i <= j) {
|
28866 | t = i / j;
|
28867 |
|
28868 | this._basis.point(this._beta * x[i] + (1 - this._beta) * (x0 + t * dx), this._beta * y[i] + (1 - this._beta) * (y0 + t * dy));
|
28869 | }
|
28870 | }
|
28871 |
|
28872 | this._x = this._y = null;
|
28873 |
|
28874 | this._basis.lineEnd();
|
28875 | },
|
28876 | point: function point(x, y) {
|
28877 | this._x.push(+x);
|
28878 |
|
28879 | this._y.push(+y);
|
28880 | }
|
28881 | };
|
28882 | /* harmony default export */ var bundle = ((function custom(beta) {
|
28883 | function bundle(context) {
|
28884 | return beta === 1 ? new Basis(context) : new Bundle(context, beta);
|
28885 | }
|
28886 |
|
28887 | bundle.beta = function (beta) {
|
28888 | return custom(+beta);
|
28889 | };
|
28890 |
|
28891 | return bundle;
|
28892 | })(.85));
|
28893 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/cardinal.js
|
28894 | function cardinal_point(that, x, y) {
|
28895 | 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);
|
28896 | }
|
28897 |
|
28898 |
|
28899 | function Cardinal(context, tension) {
|
28900 | this._context = context;
|
28901 | this._k = (1 - tension) / 6;
|
28902 | }
|
28903 | Cardinal.prototype = {
|
28904 | areaStart: function areaStart() {
|
28905 | this._line = 0;
|
28906 | },
|
28907 | areaEnd: function areaEnd() {
|
28908 | this._line = NaN;
|
28909 | },
|
28910 | lineStart: function lineStart() {
|
28911 | this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
|
28912 | this._point = 0;
|
28913 | },
|
28914 | lineEnd: function lineEnd() {
|
28915 | switch (this._point) {
|
28916 | case 2:
|
28917 | this._context.lineTo(this._x2, this._y2);
|
28918 |
|
28919 | break;
|
28920 |
|
28921 | case 3:
|
28922 | cardinal_point(this, this._x1, this._y1);
|
28923 |
|
28924 | break;
|
28925 | }
|
28926 |
|
28927 | if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
|
28928 | this._line = 1 - this._line;
|
28929 | },
|
28930 | point: function point(x, y) {
|
28931 | x = +x, y = +y;
|
28932 |
|
28933 | switch (this._point) {
|
28934 | case 0:
|
28935 | this._point = 1;
|
28936 | this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y);
|
28937 | break;
|
28938 |
|
28939 | case 1:
|
28940 | this._point = 2;
|
28941 | this._x1 = x, this._y1 = y;
|
28942 | break;
|
28943 |
|
28944 | case 2:
|
28945 | this._point = 3;
|
28946 | // falls through
|
28947 |
|
28948 | default:
|
28949 | cardinal_point(this, x, y);
|
28950 |
|
28951 | break;
|
28952 | }
|
28953 |
|
28954 | this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
|
28955 | this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
|
28956 | }
|
28957 | };
|
28958 | /* harmony default export */ var cardinal = ((function custom(tension) {
|
28959 | function cardinal(context) {
|
28960 | return new Cardinal(context, tension);
|
28961 | }
|
28962 |
|
28963 | cardinal.tension = function (tension) {
|
28964 | return custom(+tension);
|
28965 | };
|
28966 |
|
28967 | return cardinal;
|
28968 | })(0));
|
28969 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/cardinalClosed.js
|
28970 |
|
28971 |
|
28972 | function CardinalClosed(context, tension) {
|
28973 | this._context = context;
|
28974 | this._k = (1 - tension) / 6;
|
28975 | }
|
28976 | CardinalClosed.prototype = {
|
28977 | areaStart: src_noop,
|
28978 | areaEnd: src_noop,
|
28979 | lineStart: function lineStart() {
|
28980 | 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;
|
28981 | this._point = 0;
|
28982 | },
|
28983 | lineEnd: function lineEnd() {
|
28984 | switch (this._point) {
|
28985 | case 1:
|
28986 | {
|
28987 | this._context.moveTo(this._x3, this._y3);
|
28988 |
|
28989 | this._context.closePath();
|
28990 |
|
28991 | break;
|
28992 | }
|
28993 |
|
28994 | case 2:
|
28995 | {
|
28996 | this._context.lineTo(this._x3, this._y3);
|
28997 |
|
28998 | this._context.closePath();
|
28999 |
|
29000 | break;
|
29001 | }
|
29002 |
|
29003 | case 3:
|
29004 | {
|
29005 | this.point(this._x3, this._y3);
|
29006 | this.point(this._x4, this._y4);
|
29007 | this.point(this._x5, this._y5);
|
29008 | break;
|
29009 | }
|
29010 | }
|
29011 | },
|
29012 | point: function point(x, y) {
|
29013 | x = +x, y = +y;
|
29014 |
|
29015 | switch (this._point) {
|
29016 | case 0:
|
29017 | this._point = 1;
|
29018 | this._x3 = x, this._y3 = y;
|
29019 | break;
|
29020 |
|
29021 | case 1:
|
29022 | this._point = 2;
|
29023 |
|
29024 | this._context.moveTo(this._x4 = x, this._y4 = y);
|
29025 |
|
29026 | break;
|
29027 |
|
29028 | case 2:
|
29029 | this._point = 3;
|
29030 | this._x5 = x, this._y5 = y;
|
29031 | break;
|
29032 |
|
29033 | default:
|
29034 | cardinal_point(this, x, y);
|
29035 |
|
29036 | break;
|
29037 | }
|
29038 |
|
29039 | this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
|
29040 | this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
|
29041 | }
|
29042 | };
|
29043 | /* harmony default export */ var cardinalClosed = ((function custom(tension) {
|
29044 | function cardinal(context) {
|
29045 | return new CardinalClosed(context, tension);
|
29046 | }
|
29047 |
|
29048 | cardinal.tension = function (tension) {
|
29049 | return custom(+tension);
|
29050 | };
|
29051 |
|
29052 | return cardinal;
|
29053 | })(0));
|
29054 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/cardinalOpen.js
|
29055 |
|
29056 | function CardinalOpen(context, tension) {
|
29057 | this._context = context;
|
29058 | this._k = (1 - tension) / 6;
|
29059 | }
|
29060 | CardinalOpen.prototype = {
|
29061 | areaStart: function areaStart() {
|
29062 | this._line = 0;
|
29063 | },
|
29064 | areaEnd: function areaEnd() {
|
29065 | this._line = NaN;
|
29066 | },
|
29067 | lineStart: function lineStart() {
|
29068 | this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
|
29069 | this._point = 0;
|
29070 | },
|
29071 | lineEnd: function lineEnd() {
|
29072 | if (this._line || this._line !== 0 && this._point === 3) this._context.closePath();
|
29073 | this._line = 1 - this._line;
|
29074 | },
|
29075 | point: function point(x, y) {
|
29076 | x = +x, y = +y;
|
29077 |
|
29078 | switch (this._point) {
|
29079 | case 0:
|
29080 | this._point = 1;
|
29081 | break;
|
29082 |
|
29083 | case 1:
|
29084 | this._point = 2;
|
29085 | break;
|
29086 |
|
29087 | case 2:
|
29088 | this._point = 3;
|
29089 | this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2);
|
29090 | break;
|
29091 |
|
29092 | case 3:
|
29093 | this._point = 4;
|
29094 | // falls through
|
29095 |
|
29096 | default:
|
29097 | cardinal_point(this, x, y);
|
29098 |
|
29099 | break;
|
29100 | }
|
29101 |
|
29102 | this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
|
29103 | this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
|
29104 | }
|
29105 | };
|
29106 | /* harmony default export */ var cardinalOpen = ((function custom(tension) {
|
29107 | function cardinal(context) {
|
29108 | return new CardinalOpen(context, tension);
|
29109 | }
|
29110 |
|
29111 | cardinal.tension = function (tension) {
|
29112 | return custom(+tension);
|
29113 | };
|
29114 |
|
29115 | return cardinal;
|
29116 | })(0));
|
29117 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/math.js
|
29118 | var math_abs = Math.abs;
|
29119 | var atan2 = Math.atan2;
|
29120 | var cos = Math.cos;
|
29121 | var math_max = Math.max;
|
29122 | var math_min = Math.min;
|
29123 | var sin = Math.sin;
|
29124 | var sqrt = Math.sqrt;
|
29125 | var epsilon = 1e-12;
|
29126 | var pi = Math.PI;
|
29127 | var halfPi = pi / 2;
|
29128 | var tau = 2 * pi;
|
29129 | function acos(x) {
|
29130 | return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);
|
29131 | }
|
29132 | function asin(x) {
|
29133 | return x >= 1 ? halfPi : x <= -1 ? -halfPi : Math.asin(x);
|
29134 | }
|
29135 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/catmullRom.js
|
29136 |
|
29137 |
|
29138 |
|
29139 | function catmullRom_point(that, x, y) {
|
29140 | var x1 = that._x1,
|
29141 | y1 = that._y1,
|
29142 | x2 = that._x2,
|
29143 | y2 = that._y2;
|
29144 |
|
29145 | if (that._l01_a > epsilon) {
|
29146 | var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,
|
29147 | n = 3 * that._l01_a * (that._l01_a + that._l12_a);
|
29148 | x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;
|
29149 | y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;
|
29150 | }
|
29151 |
|
29152 | if (that._l23_a > epsilon) {
|
29153 | var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,
|
29154 | m = 3 * that._l23_a * (that._l23_a + that._l12_a);
|
29155 | x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;
|
29156 | y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;
|
29157 | }
|
29158 |
|
29159 | that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);
|
29160 | }
|
29161 |
|
29162 |
|
29163 |
|
29164 | function CatmullRom(context, alpha) {
|
29165 | this._context = context;
|
29166 | this._alpha = alpha;
|
29167 | }
|
29168 |
|
29169 | CatmullRom.prototype = {
|
29170 | areaStart: function areaStart() {
|
29171 | this._line = 0;
|
29172 | },
|
29173 | areaEnd: function areaEnd() {
|
29174 | this._line = NaN;
|
29175 | },
|
29176 | lineStart: function lineStart() {
|
29177 | this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
|
29178 | this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
|
29179 | },
|
29180 | lineEnd: function lineEnd() {
|
29181 | switch (this._point) {
|
29182 | case 2:
|
29183 | this._context.lineTo(this._x2, this._y2);
|
29184 |
|
29185 | break;
|
29186 |
|
29187 | case 3:
|
29188 | this.point(this._x2, this._y2);
|
29189 | break;
|
29190 | }
|
29191 |
|
29192 | if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
|
29193 | this._line = 1 - this._line;
|
29194 | },
|
29195 | point: function point(x, y) {
|
29196 | x = +x, y = +y;
|
29197 |
|
29198 | if (this._point) {
|
29199 | var x23 = this._x2 - x,
|
29200 | y23 = this._y2 - y;
|
29201 | this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
|
29202 | }
|
29203 |
|
29204 | switch (this._point) {
|
29205 | case 0:
|
29206 | this._point = 1;
|
29207 | this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y);
|
29208 | break;
|
29209 |
|
29210 | case 1:
|
29211 | this._point = 2;
|
29212 | break;
|
29213 |
|
29214 | case 2:
|
29215 | this._point = 3;
|
29216 | // falls through
|
29217 |
|
29218 | default:
|
29219 | catmullRom_point(this, x, y);
|
29220 |
|
29221 | break;
|
29222 | }
|
29223 |
|
29224 | this._l01_a = this._l12_a, this._l12_a = this._l23_a;
|
29225 | this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
|
29226 | this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
|
29227 | this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
|
29228 | }
|
29229 | };
|
29230 | /* harmony default export */ var catmullRom = ((function custom(alpha) {
|
29231 | function catmullRom(context) {
|
29232 | return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);
|
29233 | }
|
29234 |
|
29235 | catmullRom.alpha = function (alpha) {
|
29236 | return custom(+alpha);
|
29237 | };
|
29238 |
|
29239 | return catmullRom;
|
29240 | })(.5));
|
29241 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/catmullRomClosed.js
|
29242 |
|
29243 |
|
29244 |
|
29245 |
|
29246 | function CatmullRomClosed(context, alpha) {
|
29247 | this._context = context;
|
29248 | this._alpha = alpha;
|
29249 | }
|
29250 |
|
29251 | CatmullRomClosed.prototype = {
|
29252 | areaStart: src_noop,
|
29253 | areaEnd: src_noop,
|
29254 | lineStart: function lineStart() {
|
29255 | 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;
|
29256 | this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
|
29257 | },
|
29258 | lineEnd: function lineEnd() {
|
29259 | switch (this._point) {
|
29260 | case 1:
|
29261 | {
|
29262 | this._context.moveTo(this._x3, this._y3);
|
29263 |
|
29264 | this._context.closePath();
|
29265 |
|
29266 | break;
|
29267 | }
|
29268 |
|
29269 | case 2:
|
29270 | {
|
29271 | this._context.lineTo(this._x3, this._y3);
|
29272 |
|
29273 | this._context.closePath();
|
29274 |
|
29275 | break;
|
29276 | }
|
29277 |
|
29278 | case 3:
|
29279 | {
|
29280 | this.point(this._x3, this._y3);
|
29281 | this.point(this._x4, this._y4);
|
29282 | this.point(this._x5, this._y5);
|
29283 | break;
|
29284 | }
|
29285 | }
|
29286 | },
|
29287 | point: function point(x, y) {
|
29288 | x = +x, y = +y;
|
29289 |
|
29290 | if (this._point) {
|
29291 | var x23 = this._x2 - x,
|
29292 | y23 = this._y2 - y;
|
29293 | this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
|
29294 | }
|
29295 |
|
29296 | switch (this._point) {
|
29297 | case 0:
|
29298 | this._point = 1;
|
29299 | this._x3 = x, this._y3 = y;
|
29300 | break;
|
29301 |
|
29302 | case 1:
|
29303 | this._point = 2;
|
29304 |
|
29305 | this._context.moveTo(this._x4 = x, this._y4 = y);
|
29306 |
|
29307 | break;
|
29308 |
|
29309 | case 2:
|
29310 | this._point = 3;
|
29311 | this._x5 = x, this._y5 = y;
|
29312 | break;
|
29313 |
|
29314 | default:
|
29315 | catmullRom_point(this, x, y);
|
29316 |
|
29317 | break;
|
29318 | }
|
29319 |
|
29320 | this._l01_a = this._l12_a, this._l12_a = this._l23_a;
|
29321 | this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
|
29322 | this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
|
29323 | this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
|
29324 | }
|
29325 | };
|
29326 | /* harmony default export */ var catmullRomClosed = ((function custom(alpha) {
|
29327 | function catmullRom(context) {
|
29328 | return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);
|
29329 | }
|
29330 |
|
29331 | catmullRom.alpha = function (alpha) {
|
29332 | return custom(+alpha);
|
29333 | };
|
29334 |
|
29335 | return catmullRom;
|
29336 | })(.5));
|
29337 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/catmullRomOpen.js
|
29338 |
|
29339 |
|
29340 |
|
29341 | function CatmullRomOpen(context, alpha) {
|
29342 | this._context = context;
|
29343 | this._alpha = alpha;
|
29344 | }
|
29345 |
|
29346 | CatmullRomOpen.prototype = {
|
29347 | areaStart: function areaStart() {
|
29348 | this._line = 0;
|
29349 | },
|
29350 | areaEnd: function areaEnd() {
|
29351 | this._line = NaN;
|
29352 | },
|
29353 | lineStart: function lineStart() {
|
29354 | this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN;
|
29355 | this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0;
|
29356 | },
|
29357 | lineEnd: function lineEnd() {
|
29358 | if (this._line || this._line !== 0 && this._point === 3) this._context.closePath();
|
29359 | this._line = 1 - this._line;
|
29360 | },
|
29361 | point: function point(x, y) {
|
29362 | x = +x, y = +y;
|
29363 |
|
29364 | if (this._point) {
|
29365 | var x23 = this._x2 - x,
|
29366 | y23 = this._y2 - y;
|
29367 | this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
|
29368 | }
|
29369 |
|
29370 | switch (this._point) {
|
29371 | case 0:
|
29372 | this._point = 1;
|
29373 | break;
|
29374 |
|
29375 | case 1:
|
29376 | this._point = 2;
|
29377 | break;
|
29378 |
|
29379 | case 2:
|
29380 | this._point = 3;
|
29381 | this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2);
|
29382 | break;
|
29383 |
|
29384 | case 3:
|
29385 | this._point = 4;
|
29386 | // falls through
|
29387 |
|
29388 | default:
|
29389 | catmullRom_point(this, x, y);
|
29390 |
|
29391 | break;
|
29392 | }
|
29393 |
|
29394 | this._l01_a = this._l12_a, this._l12_a = this._l23_a;
|
29395 | this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
|
29396 | this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
|
29397 | this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
|
29398 | }
|
29399 | };
|
29400 | /* harmony default export */ var catmullRomOpen = ((function custom(alpha) {
|
29401 | function catmullRom(context) {
|
29402 | return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);
|
29403 | }
|
29404 |
|
29405 | catmullRom.alpha = function (alpha) {
|
29406 | return custom(+alpha);
|
29407 | };
|
29408 |
|
29409 | return catmullRom;
|
29410 | })(.5));
|
29411 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/monotone.js
|
29412 | function sign(x) {
|
29413 | return x < 0 ? -1 : 1;
|
29414 | } // Calculate the slopes of the tangents (Hermite-type interpolation) based on
|
29415 | // the following paper: Steffen, M. 1990. A Simple Method for Monotonic
|
29416 | // Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.
|
29417 | // NOV(II), P. 443, 1990.
|
29418 |
|
29419 |
|
29420 | function slope3(that, x2, y2) {
|
29421 | var h0 = that._x1 - that._x0,
|
29422 | h1 = x2 - that._x1,
|
29423 | s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),
|
29424 | s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0);
|
29425 | return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), .5 * Math.abs((s0 * h1 + s1 * h0) / (h0 + h1))) || 0;
|
29426 | } // Calculate a one-sided slope.
|
29427 |
|
29428 |
|
29429 | function slope2(that, t) {
|
29430 | var h = that._x1 - that._x0;
|
29431 | return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;
|
29432 | } // According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations
|
29433 | // "you can express cubic Hermite interpolation in terms of cubic Bézier curves
|
29434 | // with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1".
|
29435 |
|
29436 |
|
29437 | function monotone_point(that, t0, t1) {
|
29438 | var x0 = that._x0,
|
29439 | y0 = that._y0,
|
29440 | x1 = that._x1,
|
29441 | y1 = that._y1,
|
29442 | dx = (x1 - x0) / 3;
|
29443 |
|
29444 | that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);
|
29445 | }
|
29446 |
|
29447 | function MonotoneX(context) {
|
29448 | this._context = context;
|
29449 | }
|
29450 |
|
29451 | MonotoneX.prototype = {
|
29452 | areaStart: function areaStart() {
|
29453 | this._line = 0;
|
29454 | },
|
29455 | areaEnd: function areaEnd() {
|
29456 | this._line = NaN;
|
29457 | },
|
29458 | lineStart: function lineStart() {
|
29459 | this._x0 = this._x1 = this._y0 = this._y1 = this._t0 = NaN;
|
29460 | this._point = 0;
|
29461 | },
|
29462 | lineEnd: function lineEnd() {
|
29463 | switch (this._point) {
|
29464 | case 2:
|
29465 | this._context.lineTo(this._x1, this._y1);
|
29466 |
|
29467 | break;
|
29468 |
|
29469 | case 3:
|
29470 | monotone_point(this, this._t0, slope2(this, this._t0));
|
29471 |
|
29472 | break;
|
29473 | }
|
29474 |
|
29475 | if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
|
29476 | this._line = 1 - this._line;
|
29477 | },
|
29478 | point: function point(x, y) {
|
29479 | var t1 = NaN;
|
29480 | x = +x, y = +y;
|
29481 | if (x === this._x1 && y === this._y1) return; // Ignore coincident points.
|
29482 |
|
29483 | switch (this._point) {
|
29484 | case 0:
|
29485 | this._point = 1;
|
29486 | this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y);
|
29487 | break;
|
29488 |
|
29489 | case 1:
|
29490 | this._point = 2;
|
29491 | break;
|
29492 |
|
29493 | case 2:
|
29494 | this._point = 3;
|
29495 |
|
29496 | monotone_point(this, slope2(this, t1 = slope3(this, x, y)), t1);
|
29497 |
|
29498 | break;
|
29499 |
|
29500 | default:
|
29501 | monotone_point(this, this._t0, t1 = slope3(this, x, y));
|
29502 |
|
29503 | break;
|
29504 | }
|
29505 |
|
29506 | this._x0 = this._x1, this._x1 = x;
|
29507 | this._y0 = this._y1, this._y1 = y;
|
29508 | this._t0 = t1;
|
29509 | }
|
29510 | };
|
29511 |
|
29512 | function MonotoneY(context) {
|
29513 | this._context = new ReflectContext(context);
|
29514 | }
|
29515 |
|
29516 | (MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function (x, y) {
|
29517 | MonotoneX.prototype.point.call(this, y, x);
|
29518 | };
|
29519 |
|
29520 | function ReflectContext(context) {
|
29521 | this._context = context;
|
29522 | }
|
29523 |
|
29524 | ReflectContext.prototype = {
|
29525 | moveTo: function moveTo(x, y) {
|
29526 | this._context.moveTo(y, x);
|
29527 | },
|
29528 | closePath: function closePath() {
|
29529 | this._context.closePath();
|
29530 | },
|
29531 | lineTo: function lineTo(x, y) {
|
29532 | this._context.lineTo(y, x);
|
29533 | },
|
29534 | bezierCurveTo: function bezierCurveTo(x1, y1, x2, y2, x, y) {
|
29535 | this._context.bezierCurveTo(y1, x1, y2, x2, y, x);
|
29536 | }
|
29537 | };
|
29538 | function monotoneX(context) {
|
29539 | return new MonotoneX(context);
|
29540 | }
|
29541 | function monotoneY(context) {
|
29542 | return new MonotoneY(context);
|
29543 | }
|
29544 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/natural.js
|
29545 | function Natural(context) {
|
29546 | this._context = context;
|
29547 | }
|
29548 |
|
29549 | Natural.prototype = {
|
29550 | areaStart: function areaStart() {
|
29551 | this._line = 0;
|
29552 | },
|
29553 | areaEnd: function areaEnd() {
|
29554 | this._line = NaN;
|
29555 | },
|
29556 | lineStart: function lineStart() {
|
29557 | this._x = [];
|
29558 | this._y = [];
|
29559 | },
|
29560 | lineEnd: function lineEnd() {
|
29561 | var x = this._x,
|
29562 | y = this._y,
|
29563 | n = x.length;
|
29564 |
|
29565 | if (n) {
|
29566 | this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);
|
29567 |
|
29568 | if (n === 2) {
|
29569 | this._context.lineTo(x[1], y[1]);
|
29570 | } else {
|
29571 | for (var px = controlPoints(x), py = controlPoints(y), i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {
|
29572 | this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);
|
29573 | }
|
29574 | }
|
29575 | }
|
29576 |
|
29577 | if (this._line || this._line !== 0 && n === 1) this._context.closePath();
|
29578 | this._line = 1 - this._line;
|
29579 | this._x = this._y = null;
|
29580 | },
|
29581 | point: function point(x, y) {
|
29582 | this._x.push(+x);
|
29583 |
|
29584 | this._y.push(+y);
|
29585 | }
|
29586 | }; // See https://www.particleincell.com/2012/bezier-splines/ for derivation.
|
29587 |
|
29588 | function controlPoints(x) {
|
29589 | var i,
|
29590 | n = x.length - 1,
|
29591 | m,
|
29592 | a = Array(n),
|
29593 | b = Array(n),
|
29594 | r = Array(n);
|
29595 | a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];
|
29596 |
|
29597 | for (i = 1; i < n - 1; ++i) {
|
29598 | a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];
|
29599 | }
|
29600 |
|
29601 | a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];
|
29602 |
|
29603 | for (i = 1; i < n; ++i) {
|
29604 | m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];
|
29605 | }
|
29606 |
|
29607 | a[n - 1] = r[n - 1] / b[n - 1];
|
29608 |
|
29609 | for (i = n - 2; i >= 0; --i) {
|
29610 | a[i] = (r[i] - a[i + 1]) / b[i];
|
29611 | }
|
29612 |
|
29613 | b[n - 1] = (x[n] + a[n - 1]) / 2;
|
29614 |
|
29615 | for (i = 0; i < n - 1; ++i) {
|
29616 | b[i] = 2 * x[i + 1] - a[i + 1];
|
29617 | }
|
29618 |
|
29619 | return [a, b];
|
29620 | }
|
29621 |
|
29622 | /* harmony default export */ function natural(context) {
|
29623 | return new Natural(context);
|
29624 | }
|
29625 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/linearClosed.js
|
29626 |
|
29627 |
|
29628 | function LinearClosed(context) {
|
29629 | this._context = context;
|
29630 | }
|
29631 |
|
29632 | LinearClosed.prototype = {
|
29633 | areaStart: src_noop,
|
29634 | areaEnd: src_noop,
|
29635 | lineStart: function lineStart() {
|
29636 | this._point = 0;
|
29637 | },
|
29638 | lineEnd: function lineEnd() {
|
29639 | if (this._point) this._context.closePath();
|
29640 | },
|
29641 | point: function point(x, y) {
|
29642 | x = +x, y = +y;
|
29643 | if (this._point) this._context.lineTo(x, y);else this._point = 1, this._context.moveTo(x, y);
|
29644 | }
|
29645 | };
|
29646 | /* harmony default export */ function linearClosed(context) {
|
29647 | return new LinearClosed(context);
|
29648 | }
|
29649 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/linear.js
|
29650 | function Linear(context) {
|
29651 | this._context = context;
|
29652 | }
|
29653 |
|
29654 | Linear.prototype = {
|
29655 | areaStart: function areaStart() {
|
29656 | this._line = 0;
|
29657 | },
|
29658 | areaEnd: function areaEnd() {
|
29659 | this._line = NaN;
|
29660 | },
|
29661 | lineStart: function lineStart() {
|
29662 | this._point = 0;
|
29663 | },
|
29664 | lineEnd: function lineEnd() {
|
29665 | if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
|
29666 | this._line = 1 - this._line;
|
29667 | },
|
29668 | point: function point(x, y) {
|
29669 | x = +x, y = +y;
|
29670 |
|
29671 | switch (this._point) {
|
29672 | case 0:
|
29673 | this._point = 1;
|
29674 | this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y);
|
29675 | break;
|
29676 |
|
29677 | case 1:
|
29678 | this._point = 2;
|
29679 | // falls through
|
29680 |
|
29681 | default:
|
29682 | this._context.lineTo(x, y);
|
29683 |
|
29684 | break;
|
29685 | }
|
29686 | }
|
29687 | };
|
29688 | /* harmony default export */ function curve_linear(context) {
|
29689 | return new Linear(context);
|
29690 | }
|
29691 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/curve/step.js
|
29692 | function Step(context, t) {
|
29693 | this._context = context;
|
29694 | this._t = t;
|
29695 | }
|
29696 |
|
29697 | Step.prototype = {
|
29698 | areaStart: function areaStart() {
|
29699 | this._line = 0;
|
29700 | },
|
29701 | areaEnd: function areaEnd() {
|
29702 | this._line = NaN;
|
29703 | },
|
29704 | lineStart: function lineStart() {
|
29705 | this._x = this._y = NaN;
|
29706 | this._point = 0;
|
29707 | },
|
29708 | lineEnd: function lineEnd() {
|
29709 | if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);
|
29710 | if (this._line || this._line !== 0 && this._point === 1) this._context.closePath();
|
29711 | if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;
|
29712 | },
|
29713 | point: function point(x, y) {
|
29714 | x = +x, y = +y;
|
29715 |
|
29716 | switch (this._point) {
|
29717 | case 0:
|
29718 | this._point = 1;
|
29719 | this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y);
|
29720 | break;
|
29721 |
|
29722 | case 1:
|
29723 | this._point = 2;
|
29724 | // falls through
|
29725 |
|
29726 | default:
|
29727 | {
|
29728 | if (this._t <= 0) {
|
29729 | this._context.lineTo(this._x, y);
|
29730 |
|
29731 | this._context.lineTo(x, y);
|
29732 | } else {
|
29733 | var x1 = this._x * (1 - this._t) + x * this._t;
|
29734 |
|
29735 | this._context.lineTo(x1, this._y);
|
29736 |
|
29737 | this._context.lineTo(x1, y);
|
29738 | }
|
29739 |
|
29740 | break;
|
29741 | }
|
29742 | }
|
29743 |
|
29744 | this._x = x, this._y = y;
|
29745 | }
|
29746 | };
|
29747 | /* harmony default export */ function step(context) {
|
29748 | return new Step(context, .5);
|
29749 | }
|
29750 | function stepBefore(context) {
|
29751 | return new Step(context, 0);
|
29752 | }
|
29753 | function stepAfter(context) {
|
29754 | return new Step(context, 1);
|
29755 | }
|
29756 | ;// CONCATENATED MODULE: ./src/ChartInternal/shape/shape.ts
|
29757 | /**
|
29758 | * Copyright (c) 2017 ~ present NAVER Corp.
|
29759 | * billboard.js project is licensed under the MIT license
|
29760 | */
|
29761 |
|
29762 |
|
29763 |
|
29764 |
|
29765 | /* harmony default export */ var shape = ({
|
29766 | /**
|
29767 | * Get the shape draw function
|
29768 | * @returns {object}
|
29769 | * @private
|
29770 | */
|
29771 | getDrawShape: function getDrawShape() {
|
29772 | var $$ = this,
|
29773 | isRotated = $$.config.axis_rotated,
|
29774 | hasRadar = $$.state.hasRadar,
|
29775 | shape = {
|
29776 | type: {},
|
29777 | indices: {},
|
29778 | pos: {}
|
29779 | };
|
29780 | ["bar", "candlestick", "line", "area"].forEach(function (v) {
|
29781 | var name = capitalize(/^(bubble|scatter)$/.test(v) ? "line" : v);
|
29782 |
|
29783 | if ($$.hasType(v) || $$.hasTypeOf(name) || v === "line" && ($$.hasType("bubble") || $$.hasType("scatter"))) {
|
29784 | var indices = $$.getShapeIndices($$["is" + name + "Type"]),
|
29785 | drawFn = $$["generateDraw" + name];
|
29786 | shape.indices[v] = indices;
|
29787 | shape.type[v] = drawFn ? drawFn.bind($$)(indices, !1) : undefined;
|
29788 | }
|
29789 | });
|
29790 |
|
29791 | if (!$$.hasArcType() || hasRadar) {
|
29792 | // generate circle x/y functions depending on updated params
|
29793 | var cx = hasRadar ? $$.radarCircleX : isRotated ? $$.circleY : $$.circleX,
|
29794 | cy = hasRadar ? $$.radarCircleY : isRotated ? $$.circleX : $$.circleY;
|
29795 | shape.pos = {
|
29796 | xForText: $$.generateXYForText(shape.indices, !0),
|
29797 | yForText: $$.generateXYForText(shape.indices, !1),
|
29798 | cx: (cx || function () {}).bind($$),
|
29799 | cy: (cy || function () {}).bind($$)
|
29800 | };
|
29801 | }
|
29802 |
|
29803 | return shape;
|
29804 | },
|
29805 | getShapeIndices: function getShapeIndices(typeFilter) {
|
29806 | var $$ = this,
|
29807 | config = $$.config,
|
29808 | xs = config.data_xs,
|
29809 | hasXs = notEmpty(xs),
|
29810 | indices = {},
|
29811 | i = hasXs ? {} : 0;
|
29812 |
|
29813 | if (hasXs) {
|
29814 | getUnique(Object.keys(xs).map(function (v) {
|
29815 | return xs[v];
|
29816 | })).forEach(function (v) {
|
29817 | i[v] = 0;
|
29818 | indices[v] = {};
|
29819 | });
|
29820 | }
|
29821 |
|
29822 | $$.filterTargetsToShow($$.data.targets.filter(typeFilter, $$)).forEach(function (d) {
|
29823 | var xKey = d.id in xs ? xs[d.id] : "",
|
29824 | ind = xKey ? indices[xKey] : indices;
|
29825 |
|
29826 | for (var j = 0, groups; groups = config.data_groups[j]; j++) {
|
29827 | if (groups.indexOf(d.id) < 0) {
|
29828 | continue;
|
29829 | }
|
29830 |
|
29831 | for (var k = 0, row; row = groups[k]; k++) {
|
29832 | if (row in ind) {
|
29833 | ind[d.id] = ind[row];
|
29834 | break;
|
29835 | }
|
29836 | }
|
29837 | }
|
29838 |
|
29839 | if (isUndefined(ind[d.id])) {
|
29840 | ind[d.id] = xKey ? i[xKey]++ : i++;
|
29841 | ind.__max__ = (xKey ? i[xKey] : i) - 1;
|
29842 | }
|
29843 | });
|
29844 | return indices;
|
29845 | },
|
29846 |
|
29847 | /**
|
29848 | * Get indices value based on data ID value
|
29849 | * @param {object} indices Indices object
|
29850 | * @param {string} id Data id value
|
29851 | * @returns {object} Indices object
|
29852 | * @private
|
29853 | */
|
29854 | getIndices: function getIndices(indices, id) {
|
29855 | var xs = this.config.data_xs;
|
29856 | return notEmpty(xs) ? indices[xs[id]] : indices;
|
29857 | },
|
29858 |
|
29859 | /**
|
29860 | * Get indices max number
|
29861 | * @param {object} indices Indices object
|
29862 | * @returns {number} Max number
|
29863 | * @private
|
29864 | */
|
29865 | getIndicesMax: function getIndicesMax(indices) {
|
29866 | return notEmpty(this.config.data_xs) ? // if is multiple xs, return total sum of xs' __max__ value
|
29867 | Object.keys(indices).map(function (v) {
|
29868 | return indices[v].__max__ || 0;
|
29869 | }).reduce(function (acc, curr) {
|
29870 | return acc + curr;
|
29871 | }) : indices.__max__;
|
29872 | },
|
29873 | getShapeX: function getShapeX(offset, indices, isSub) {
|
29874 | var $$ = this,
|
29875 | config = $$.config,
|
29876 | scale = $$.scale,
|
29877 | currScale = isSub ? scale.subX : scale.zoom || scale.x,
|
29878 | barPadding = config.bar_padding,
|
29879 | sum = function (p, c) {
|
29880 | return p + c;
|
29881 | },
|
29882 | halfWidth = isObjectType(offset) && (offset._$total.length ? offset._$total.reduce(sum) / 2 : 0);
|
29883 |
|
29884 | return function (d) {
|
29885 | var ind = $$.getIndices(indices, d.id, "getShapeX"),
|
29886 | index = d.id in ind ? ind[d.id] : 0,
|
29887 | targetsNum = (ind.__max__ || 0) + 1,
|
29888 | x = 0;
|
29889 |
|
29890 | if (notEmpty(d.x)) {
|
29891 | var xPos = currScale(d.x, !0);
|
29892 |
|
29893 | if (halfWidth) {
|
29894 | x = xPos - (offset[d.id] || offset._$width) + offset._$total.slice(0, index + 1).reduce(sum) - halfWidth;
|
29895 | } else {
|
29896 | x = xPos - (isNumber(offset) ? offset : offset._$width) * (targetsNum / 2 - index);
|
29897 | }
|
29898 | } // adjust x position for bar.padding optionq
|
29899 |
|
29900 |
|
29901 | if (offset && x && targetsNum > 1 && barPadding) {
|
29902 | if (index) {
|
29903 | x += barPadding * index;
|
29904 | }
|
29905 |
|
29906 | if (targetsNum > 2) {
|
29907 | x -= (targetsNum - 1) * barPadding / 2;
|
29908 | } else if (targetsNum === 2) {
|
29909 | x -= barPadding / 2;
|
29910 | }
|
29911 | }
|
29912 |
|
29913 | return x;
|
29914 | };
|
29915 | },
|
29916 | getShapeY: function getShapeY(isSub) {
|
29917 | var $$ = this,
|
29918 | isStackNormalized = $$.isStackNormalized();
|
29919 | return function (d) {
|
29920 | var value = d.value;
|
29921 |
|
29922 | if (isNumber(d)) {
|
29923 | value = d;
|
29924 | } else if (isStackNormalized) {
|
29925 | value = $$.getRatio("index", d, !0);
|
29926 | } else if ($$.isBubbleZType(d)) {
|
29927 | value = $$.getBubbleZData(d.value, "y");
|
29928 | }
|
29929 |
|
29930 | return $$.getYScaleById(d.id, isSub)(value);
|
29931 | };
|
29932 | },
|
29933 |
|
29934 | /**
|
29935 | * Get shape based y Axis min value
|
29936 | * @param {string} id Data id
|
29937 | * @returns {number}
|
29938 | * @private
|
29939 | */
|
29940 | getShapeYMin: function getShapeYMin(id) {
|
29941 | var $$ = this,
|
29942 | scale = $$.scale[$$.axis.getId(id)],
|
29943 | _scale$domain = scale.domain(),
|
29944 | yMin = _scale$domain[0];
|
29945 |
|
29946 | return !$$.isGrouped(id) && yMin > 0 ? yMin : 0;
|
29947 | },
|
29948 |
|
29949 | /**
|
29950 | * Get Shape's offset data
|
29951 | * @param {Function} typeFilter Type filter function
|
29952 | * @returns {object}
|
29953 | * @private
|
29954 | */
|
29955 | getShapeOffsetData: function getShapeOffsetData(typeFilter) {
|
29956 | var $$ = this,
|
29957 | targets = $$.orderTargets($$.filterTargetsToShow($$.data.targets.filter(typeFilter, $$))),
|
29958 | isStackNormalized = $$.isStackNormalized(),
|
29959 | shapeOffsetTargets = targets.map(function (target) {
|
29960 | var rowValues = target.values,
|
29961 | values = {};
|
29962 |
|
29963 | if ($$.isStepType(target)) {
|
29964 | rowValues = $$.convertValuesToStep(rowValues);
|
29965 | }
|
29966 |
|
29967 | var rowValueMapByXValue = rowValues.reduce(function (out, d) {
|
29968 | var key = +d.x;
|
29969 | out[key] = d;
|
29970 | values[key] = isStackNormalized ? $$.getRatio("index", d, !0) : d.value;
|
29971 | return out;
|
29972 | }, {});
|
29973 | return {
|
29974 | id: target.id,
|
29975 | rowValues: rowValues,
|
29976 | rowValueMapByXValue: rowValueMapByXValue,
|
29977 | values: values
|
29978 | };
|
29979 | }),
|
29980 | indexMapByTargetId = targets.reduce(function (out, _ref, index) {
|
29981 | var id = _ref.id;
|
29982 | out[id] = index;
|
29983 | return out;
|
29984 | }, {});
|
29985 | return {
|
29986 | indexMapByTargetId: indexMapByTargetId,
|
29987 | shapeOffsetTargets: shapeOffsetTargets
|
29988 | };
|
29989 | },
|
29990 | getShapeOffset: function getShapeOffset(typeFilter, indices, isSub) {
|
29991 | var $$ = this,
|
29992 | _$$$getShapeOffsetDat = $$.getShapeOffsetData(typeFilter),
|
29993 | shapeOffsetTargets = _$$$getShapeOffsetDat.shapeOffsetTargets,
|
29994 | indexMapByTargetId = _$$$getShapeOffsetDat.indexMapByTargetId;
|
29995 |
|
29996 | return function (d, idx) {
|
29997 | var id = d.id,
|
29998 | value = d.value,
|
29999 | x = d.x,
|
30000 | ind = $$.getIndices(indices, id),
|
30001 | scale = $$.getYScaleById(id, isSub),
|
30002 | y0 = scale($$.getShapeYMin(id)),
|
30003 | dataXAsNumber = +x,
|
30004 | offset = y0;
|
30005 | shapeOffsetTargets.filter(function (t) {
|
30006 | return t.id !== id;
|
30007 | }).forEach(function (t) {
|
30008 | var tid = t.id,
|
30009 | rowValueMapByXValue = t.rowValueMapByXValue,
|
30010 | rowValues = t.rowValues,
|
30011 | tvalues = t.values;
|
30012 |
|
30013 | if (ind[tid] === ind[id] && indexMapByTargetId[tid] < indexMapByTargetId[id]) {
|
30014 | var _row,
|
30015 | row = rowValues[idx];
|
30016 |
|
30017 | // check if the x values line up
|
30018 | if (!row || +row.x !== dataXAsNumber) {
|
30019 | row = rowValueMapByXValue[dataXAsNumber];
|
30020 | }
|
30021 |
|
30022 | if (((_row = row) == null ? void 0 : _row.value) * value >= 0 && isNumber(tvalues[dataXAsNumber])) {
|
30023 | offset += scale(tvalues[dataXAsNumber]) - y0;
|
30024 | }
|
30025 | }
|
30026 | });
|
30027 | return offset;
|
30028 | };
|
30029 | },
|
30030 | getBarW: function getBarW(type, axis, targetsNum) {
|
30031 | var $$ = this,
|
30032 | config = $$.config,
|
30033 | org = $$.org,
|
30034 | scale = $$.scale,
|
30035 | maxDataCount = $$.getMaxDataCount(),
|
30036 | isGrouped = type === "bar" && config.data_groups.length,
|
30037 | configName = type + "_width",
|
30038 | tickInterval = scale.zoom && !$$.axis.isCategorized() ? org.xDomain.map(function (v) {
|
30039 | return scale.zoom(v);
|
30040 | }).reduce(function (a, c) {
|
30041 | return Math.abs(a) + c;
|
30042 | }) / maxDataCount : axis.tickInterval(maxDataCount),
|
30043 | getWidth = function (id) {
|
30044 | var width = id ? config[configName][id] : config[configName],
|
30045 | ratio = id ? width.ratio : config[configName + "_ratio"],
|
30046 | max = id ? width.max : config[configName + "_max"],
|
30047 | w = isNumber(width) ? width : targetsNum ? tickInterval * ratio / targetsNum : 0;
|
30048 | return max && w > max ? max : w;
|
30049 | },
|
30050 | result = getWidth();
|
30051 |
|
30052 | if (!isGrouped && isObjectType(config[configName])) {
|
30053 | result = {
|
30054 | _$width: result,
|
30055 | _$total: []
|
30056 | };
|
30057 | $$.filterTargetsToShow($$.data.targets).forEach(function (v) {
|
30058 | if (config[configName][v.id]) {
|
30059 | result[v.id] = getWidth(v.id);
|
30060 |
|
30061 | result._$total.push(result[v.id] || result._$width);
|
30062 | }
|
30063 | });
|
30064 | }
|
30065 |
|
30066 | return result;
|
30067 | },
|
30068 |
|
30069 | /**
|
30070 | * Get shape element
|
30071 | * @param {string} shapeName Shape string
|
30072 | * @param {number} i Index number
|
30073 | * @param {string} id Data series id
|
30074 | * @returns {d3Selection}
|
30075 | * @private
|
30076 | */
|
30077 | getShapeByIndex: function getShapeByIndex(shapeName, i, id) {
|
30078 | var $$ = this,
|
30079 | $el = $$.$el,
|
30080 | suffix = isValue(i) ? "-" + i : "",
|
30081 | shape = $el[shapeName];
|
30082 |
|
30083 | // filter from shape reference if has
|
30084 | if (shape && !shape.empty()) {
|
30085 | shape = shape.filter(function (d) {
|
30086 | return id ? d.id === id : !0;
|
30087 | }).filter(function (d) {
|
30088 | return isValue(i) ? d.index === i : !0;
|
30089 | });
|
30090 | } else {
|
30091 | shape = (id ? $el.main.selectAll("." + config_classes[shapeName + "s"] + $$.getTargetSelectorSuffix(id)) : $el.main).selectAll("." + config_classes[shapeName] + suffix);
|
30092 | }
|
30093 |
|
30094 | return shape;
|
30095 | },
|
30096 | isWithinShape: function isWithinShape(that, d) {
|
30097 | var $$ = this,
|
30098 | shape = src_select(that),
|
30099 | isWithin;
|
30100 |
|
30101 | if (!$$.isTargetToShow(d.id)) {
|
30102 | isWithin = !1;
|
30103 | } else if ($$.hasValidPointType != null && $$.hasValidPointType(that.nodeName)) {
|
30104 | isWithin = $$.isStepType(d) ? $$.isWithinStep(that, $$.getYScaleById(d.id)(d.value)) : $$.isWithinCircle(that, $$.isBubbleType(d) ? $$.pointSelectR(d) * 1.5 : 0);
|
30105 | } else if (that.nodeName === "path") {
|
30106 | isWithin = shape.classed(config_classes.bar) ? $$.isWithinBar(that) : !0;
|
30107 | }
|
30108 |
|
30109 | return isWithin;
|
30110 | },
|
30111 | getInterpolate: function getInterpolate(d) {
|
30112 | var $$ = this,
|
30113 | interpolation = $$.getInterpolateType(d);
|
30114 | return {
|
30115 | "basis": curve_basis,
|
30116 | "basis-closed": curve_basisClosed,
|
30117 | "basis-open": basisOpen,
|
30118 | "bundle": bundle,
|
30119 | "cardinal": cardinal,
|
30120 | "cardinal-closed": cardinalClosed,
|
30121 | "cardinal-open": cardinalOpen,
|
30122 | "catmull-rom": catmullRom,
|
30123 | "catmull-rom-closed": catmullRomClosed,
|
30124 | "catmull-rom-open": catmullRomOpen,
|
30125 | "monotone-x": monotoneX,
|
30126 | "monotone-y": monotoneY,
|
30127 | "natural": natural,
|
30128 | "linear-closed": linearClosed,
|
30129 | "linear": curve_linear,
|
30130 | "step": step,
|
30131 | "step-after": stepAfter,
|
30132 | "step-before": stepBefore
|
30133 | }[interpolation];
|
30134 | },
|
30135 | getInterpolateType: function getInterpolateType(d) {
|
30136 | var $$ = this,
|
30137 | config = $$.config,
|
30138 | type = config.spline_interpolation_type,
|
30139 | interpolation = $$.isInterpolationType(type) ? type : "cardinal";
|
30140 | return $$.isSplineType(d) ? interpolation : $$.isStepType(d) ? config.line_step_type : "linear";
|
30141 | }
|
30142 | });
|
30143 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/size.ts
|
30144 | /**
|
30145 | * Copyright (c) 2017 ~ present NAVER Corp.
|
30146 | * billboard.js project is licensed under the MIT license
|
30147 | */
|
30148 |
|
30149 |
|
30150 |
|
30151 | /* harmony default export */ var internals_size = ({
|
30152 | /**
|
30153 | * Update container size
|
30154 | * @private
|
30155 | */
|
30156 | setContainerSize: function setContainerSize() {
|
30157 | var $$ = this,
|
30158 | state = $$.state;
|
30159 | state.current.width = $$.getCurrentWidth();
|
30160 | state.current.height = $$.getCurrentHeight();
|
30161 | },
|
30162 | getCurrentWidth: function getCurrentWidth() {
|
30163 | var $$ = this;
|
30164 | return $$.config.size_width || $$.getParentWidth();
|
30165 | },
|
30166 | getCurrentHeight: function getCurrentHeight() {
|
30167 | var $$ = this,
|
30168 | config = $$.config,
|
30169 | h = config.size_height || $$.getParentHeight();
|
30170 | return h > 0 ? h : 320 / ($$.hasType("gauge") && !config.gauge_fullCircle ? 2 : 1);
|
30171 | },
|
30172 | getCurrentPaddingTop: function getCurrentPaddingTop() {
|
30173 | var $$ = this,
|
30174 | config = $$.config,
|
30175 | hasAxis = $$.state.hasAxis,
|
30176 | $el = $$.$el,
|
30177 | axesLen = hasAxis ? config.axis_y2_axes.length : 0,
|
30178 | padding = isValue(config.padding_top) ? config.padding_top : 0;
|
30179 |
|
30180 | if ($el.title && $el.title.node()) {
|
30181 | padding += $$.getTitlePadding();
|
30182 | }
|
30183 |
|
30184 | if (axesLen && config.axis_rotated) {
|
30185 | padding += $$.getHorizontalAxisHeight("y2") * axesLen;
|
30186 | }
|
30187 |
|
30188 | return padding;
|
30189 | },
|
30190 | getCurrentPaddingBottom: function getCurrentPaddingBottom() {
|
30191 | var $$ = this,
|
30192 | config = $$.config,
|
30193 | hasAxis = $$.state.hasAxis,
|
30194 | axisId = config.axis_rotated ? "y" : "x",
|
30195 | axesLen = hasAxis ? config["axis_" + axisId + "_axes"].length : 0,
|
30196 | padding = isValue(config.padding_bottom) ? config.padding_bottom : 0;
|
30197 | return padding + (axesLen ? $$.getHorizontalAxisHeight(axisId) * axesLen : 0);
|
30198 | },
|
30199 | getCurrentPaddingLeft: function getCurrentPaddingLeft(withoutRecompute) {
|
30200 | var $$ = this,
|
30201 | config = $$.config,
|
30202 | hasAxis = $$.state.hasAxis,
|
30203 | isRotated = config.axis_rotated,
|
30204 | axisId = isRotated ? "x" : "y",
|
30205 | axesLen = hasAxis ? config["axis_" + axisId + "_axes"].length : 0,
|
30206 | axisWidth = hasAxis ? $$.getAxisWidthByAxisId(axisId, withoutRecompute) : 0,
|
30207 | padding;
|
30208 |
|
30209 | if (isValue(config.padding_left)) {
|
30210 | padding = config.padding_left;
|
30211 | } else if (hasAxis && isRotated) {
|
30212 | padding = !config.axis_x_show ? 1 : Math.max(ceil10(axisWidth), 40);
|
30213 | } else if (hasAxis && (!config.axis_y_show || config.axis_y_inner)) {
|
30214 | // && !config.axis_rotated
|
30215 | padding = $$.axis.getAxisLabelPosition("y").isOuter ? 30 : 1;
|
30216 | } else {
|
30217 | padding = ceil10(axisWidth);
|
30218 | }
|
30219 |
|
30220 | return padding + axisWidth * axesLen;
|
30221 | },
|
30222 | getCurrentPaddingRight: function getCurrentPaddingRight(withXAxisTickTextOverflow) {
|
30223 | if (withXAxisTickTextOverflow === void 0) {
|
30224 | withXAxisTickTextOverflow = !1;
|
30225 | }
|
30226 |
|
30227 | var $$ = this,
|
30228 | config = $$.config,
|
30229 | hasAxis = $$.state.hasAxis,
|
30230 | defaultPadding = 10,
|
30231 | legendWidthOnRight = $$.state.isLegendRight ? $$.getLegendWidth() + 20 : 0,
|
30232 | axesLen = hasAxis ? config.axis_y2_axes.length : 0,
|
30233 | axisWidth = hasAxis ? $$.getAxisWidthByAxisId("y2") : 0,
|
30234 | xAxisTickTextOverflow = withXAxisTickTextOverflow ? $$.axis.getXAxisTickTextY2Overflow(defaultPadding) : 0,
|
30235 | padding;
|
30236 |
|
30237 | if (isValue(config.padding_right)) {
|
30238 | padding = config.padding_right + 1; // 1 is needed not to hide tick line
|
30239 | } else if ($$.axis && config.axis_rotated) {
|
30240 | padding = defaultPadding + legendWidthOnRight;
|
30241 | } else if ($$.axis && (!config.axis_y2_show || config.axis_y2_inner)) {
|
30242 | // && !config.axis_rotated
|
30243 | padding = Math.max(2 + legendWidthOnRight + ($$.axis.getAxisLabelPosition("y2").isOuter ? 20 : 0), xAxisTickTextOverflow);
|
30244 | } else {
|
30245 | padding = Math.max(ceil10(axisWidth) + legendWidthOnRight, xAxisTickTextOverflow);
|
30246 | }
|
30247 |
|
30248 | return padding + axisWidth * axesLen;
|
30249 | },
|
30250 |
|
30251 | /**
|
30252 | * Get the parent rect element's size
|
30253 | * @param {string} key property/attribute name
|
30254 | * @returns {number}
|
30255 | * @private
|
30256 | */
|
30257 | getParentRectValue: function getParentRectValue(key) {
|
30258 | var offsetName = "offset" + capitalize(key),
|
30259 | parent = this.$el.chart.node(),
|
30260 | v = 0;
|
30261 |
|
30262 | while (v < 30 && parent && parent.tagName !== "BODY") {
|
30263 | try {
|
30264 | v = parent.getBoundingClientRect()[key];
|
30265 | } catch (e) {
|
30266 | if (offsetName in parent) {
|
30267 | // In IE in certain cases getBoundingClientRect
|
30268 | // will cause an "unspecified error"
|
30269 | v = parent[offsetName];
|
30270 | }
|
30271 | }
|
30272 |
|
30273 | parent = parent.parentNode;
|
30274 | } // Sometimes element's dimension value is incorrect(ex. flex container)
|
30275 | // In this case, use body's offset instead.
|
30276 |
|
30277 |
|
30278 | var bodySize = browser_doc.body[offsetName];
|
30279 | v > bodySize && (v = bodySize);
|
30280 | return v;
|
30281 | },
|
30282 | getParentWidth: function getParentWidth() {
|
30283 | return this.getParentRectValue("width");
|
30284 | },
|
30285 | getParentHeight: function getParentHeight() {
|
30286 | var h = this.$el.chart.style("height"),
|
30287 | height = 0;
|
30288 |
|
30289 | if (h) {
|
30290 | height = /px$/.test(h) ? parseInt(h, 10) : this.getParentRectValue("height");
|
30291 | }
|
30292 |
|
30293 | return height;
|
30294 | },
|
30295 | getSvgLeft: function getSvgLeft(withoutRecompute) {
|
30296 | var $$ = this,
|
30297 | config = $$.config,
|
30298 | $el = $$.$el,
|
30299 | hasLeftAxisRect = config.axis_rotated || !config.axis_rotated && !config.axis_y_inner,
|
30300 | leftAxisClass = config.axis_rotated ? config_classes.axisX : config_classes.axisY,
|
30301 | leftAxis = $el.main.select("." + leftAxisClass).node(),
|
30302 | svgRect = leftAxis && hasLeftAxisRect ? leftAxis.getBoundingClientRect() : {
|
30303 | right: 0
|
30304 | },
|
30305 | chartRect = $el.chart.node().getBoundingClientRect(),
|
30306 | hasArc = $$.hasArcType(),
|
30307 | svgLeft = svgRect.right - chartRect.left - (hasArc ? 0 : $$.getCurrentPaddingLeft(withoutRecompute));
|
30308 | return svgLeft > 0 ? svgLeft : 0;
|
30309 | },
|
30310 | updateDimension: function updateDimension(withoutAxis) {
|
30311 | var $$ = this,
|
30312 | config = $$.config,
|
30313 | hasAxis = $$.state.hasAxis,
|
30314 | $el = $$.$el;
|
30315 |
|
30316 | if (hasAxis && !withoutAxis && $$.axis.x && config.axis_rotated) {
|
30317 | var _$$$axis$subX;
|
30318 |
|
30319 | (_$$$axis$subX = $$.axis.subX) == null ? void 0 : _$$$axis$subX.create($el.axis.subX);
|
30320 | } // pass 'withoutAxis' param to not animate at the init rendering
|
30321 |
|
30322 |
|
30323 | $$.updateScales(withoutAxis);
|
30324 | $$.updateSvgSize();
|
30325 | $$.transformAll(!1);
|
30326 | },
|
30327 | updateSvgSize: function updateSvgSize() {
|
30328 | var $$ = this,
|
30329 | _$$$state = $$.state,
|
30330 | clip = _$$$state.clip,
|
30331 | current = _$$$state.current,
|
30332 | hasAxis = _$$$state.hasAxis,
|
30333 | width = _$$$state.width,
|
30334 | height = _$$$state.height,
|
30335 | svg = $$.$el.svg;
|
30336 | svg.attr("width", current.width).attr("height", current.height);
|
30337 |
|
30338 | if (hasAxis) {
|
30339 | var brush = svg.select("." + config_classes.brush + " .overlay"),
|
30340 | brushSize = {
|
30341 | width: 0,
|
30342 | height: 0
|
30343 | };
|
30344 |
|
30345 | if (brush.size()) {
|
30346 | brushSize.width = +brush.attr("width");
|
30347 | brushSize.height = +brush.attr("height");
|
30348 | }
|
30349 |
|
30350 | svg.selectAll(["#" + clip.id, "#" + clip.idGrid]).select("rect").attr("width", width).attr("height", height);
|
30351 | svg.select("#" + clip.idXAxis).select("rect").call($$.setXAxisClipPath.bind($$));
|
30352 | svg.select("#" + clip.idYAxis).select("rect").call($$.setYAxisClipPath.bind($$));
|
30353 | clip.idSubchart && svg.select("#" + clip.idSubchart).select("rect").attr("width", width).attr("height", brushSize.height);
|
30354 | }
|
30355 | },
|
30356 |
|
30357 | /**
|
30358 | * Update size values
|
30359 | * @param {boolean} isInit If is called at initialization
|
30360 | * @private
|
30361 | */
|
30362 | updateSizes: function updateSizes(isInit) {
|
30363 | var $$ = this,
|
30364 | config = $$.config,
|
30365 | state = $$.state,
|
30366 | legend = $$.$el.legend,
|
30367 | isRotated = config.axis_rotated,
|
30368 | hasArc = $$.hasArcType();
|
30369 | isInit || $$.setContainerSize();
|
30370 | var currLegend = {
|
30371 | width: legend ? $$.getLegendWidth() : 0,
|
30372 | height: legend ? $$.getLegendHeight() : 0
|
30373 | };
|
30374 |
|
30375 | if (!hasArc && config.axis_x_show && config.axis_x_tick_autorotate) {
|
30376 | $$.updateXAxisTickClip();
|
30377 | }
|
30378 |
|
30379 | var legendHeightForBottom = state.isLegendRight || state.isLegendInset ? 0 : currLegend.height,
|
30380 | xAxisHeight = isRotated || hasArc ? 0 : $$.getHorizontalAxisHeight("x"),
|
30381 | subchartXAxisHeight = config.subchart_axis_x_show && config.subchart_axis_x_tick_text_show ? xAxisHeight : 30,
|
30382 | subchartHeight = config.subchart_show && !hasArc ? config.subchart_size_height + subchartXAxisHeight : 0;
|
30383 | // for main
|
30384 | state.margin = !hasArc && isRotated ? {
|
30385 | top: $$.getHorizontalAxisHeight("y2") + $$.getCurrentPaddingTop(),
|
30386 | right: hasArc ? 0 : $$.getCurrentPaddingRight(!0),
|
30387 | bottom: $$.getHorizontalAxisHeight("y") + legendHeightForBottom + $$.getCurrentPaddingBottom(),
|
30388 | left: subchartHeight + (hasArc ? 0 : $$.getCurrentPaddingLeft())
|
30389 | } : {
|
30390 | top: 4 + $$.getCurrentPaddingTop(),
|
30391 | // for top tick text
|
30392 | right: hasArc ? 0 : $$.getCurrentPaddingRight(!0),
|
30393 | bottom: xAxisHeight + subchartHeight + legendHeightForBottom + $$.getCurrentPaddingBottom(),
|
30394 | left: hasArc ? 0 : $$.getCurrentPaddingLeft()
|
30395 | }; // for subchart
|
30396 |
|
30397 | state.margin2 = isRotated ? {
|
30398 | top: state.margin.top,
|
30399 | right: NaN,
|
30400 | bottom: 20 + legendHeightForBottom,
|
30401 | left: $$.state.rotatedPadding.left
|
30402 | } : {
|
30403 | top: state.current.height - subchartHeight - legendHeightForBottom,
|
30404 | right: NaN,
|
30405 | bottom: subchartXAxisHeight + legendHeightForBottom,
|
30406 | left: state.margin.left
|
30407 | }; // for legend
|
30408 |
|
30409 | state.margin3 = {
|
30410 | top: 0,
|
30411 | right: NaN,
|
30412 | bottom: 0,
|
30413 | left: 0
|
30414 | };
|
30415 | $$.updateSizeForLegend == null ? void 0 : $$.updateSizeForLegend(currLegend);
|
30416 | state.width = state.current.width - state.margin.left - state.margin.right;
|
30417 | state.height = state.current.height - state.margin.top - state.margin.bottom;
|
30418 |
|
30419 | if (state.width < 0) {
|
30420 | state.width = 0;
|
30421 | }
|
30422 |
|
30423 | if (state.height < 0) {
|
30424 | state.height = 0;
|
30425 | }
|
30426 |
|
30427 | state.width2 = isRotated ? state.margin.left - state.rotatedPadding.left - state.rotatedPadding.right : state.width;
|
30428 | state.height2 = isRotated ? state.height : state.current.height - state.margin2.top - state.margin2.bottom;
|
30429 |
|
30430 | if (state.width2 < 0) {
|
30431 | state.width2 = 0;
|
30432 | }
|
30433 |
|
30434 | if (state.height2 < 0) {
|
30435 | state.height2 = 0;
|
30436 | } // for arc
|
30437 |
|
30438 |
|
30439 | var hasGauge = $$.hasType("gauge"),
|
30440 | isLegendRight = config.legend_show && state.isLegendRight;
|
30441 | state.arcWidth = state.width - (isLegendRight ? currLegend.width + 10 : 0);
|
30442 | state.arcHeight = state.height - (isLegendRight && !hasGauge ? 0 : 10);
|
30443 |
|
30444 | if (hasGauge && !config.gauge_fullCircle) {
|
30445 | state.arcHeight += state.height - $$.getPaddingBottomForGauge();
|
30446 | }
|
30447 |
|
30448 | $$.updateRadius == null ? void 0 : $$.updateRadius();
|
30449 |
|
30450 | if (state.isLegendRight && hasArc) {
|
30451 | state.margin3.left = state.arcWidth / 2 + state.radiusExpanded * 1.1;
|
30452 | }
|
30453 | }
|
30454 | });
|
30455 | ;// CONCATENATED MODULE: ./node_modules/d3-selection/src/selectAll.js
|
30456 |
|
30457 |
|
30458 | /* harmony default export */ function src_selectAll(selector) {
|
30459 | return typeof selector === "string" ? new Selection([document.querySelectorAll(selector)], [document.documentElement]) : new Selection([array(selector)], root);
|
30460 | }
|
30461 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/text.ts
|
30462 | /**
|
30463 | * Copyright (c) 2017 ~ present NAVER Corp.
|
30464 | * billboard.js project is licensed under the MIT license
|
30465 | */
|
30466 |
|
30467 |
|
30468 |
|
30469 |
|
30470 | /* harmony default export */ var internals_text = ({
|
30471 | opacityForText: function opacityForText(d) {
|
30472 | var $$ = this;
|
30473 | return $$.isBarType(d) && !$$.meetsLabelThreshold(Math.abs($$.getRatio("bar", d)), "bar") ? "0" : $$.hasDataLabel ? null : "0";
|
30474 | },
|
30475 |
|
30476 | /**
|
30477 | * Initializes the text
|
30478 | * @private
|
30479 | */
|
30480 | initText: function initText() {
|
30481 | var $el = this.$el;
|
30482 | $el.main.select("." + config_classes.chart).append("g").attr("class", config_classes.chartTexts);
|
30483 | },
|
30484 |
|
30485 | /**
|
30486 | * Update chartText
|
30487 | * @param {object} targets $$.data.targets
|
30488 | * @private
|
30489 | */
|
30490 | updateTargetsForText: function updateTargetsForText(targets) {
|
30491 | var $$ = this,
|
30492 | classChartText = $$.getChartClass("Text"),
|
30493 | classTexts = $$.getClass("texts", "id"),
|
30494 | classFocus = $$.classFocus.bind($$),
|
30495 | mainTextUpdate = $$.$el.main.select("." + config_classes.chartTexts).selectAll("." + config_classes.chartText).data(targets).attr("class", function (d) {
|
30496 | return classChartText(d) + classFocus(d);
|
30497 | }),
|
30498 | mainTextEnter = mainTextUpdate.enter().append("g").style("opacity", "0").attr("class", classChartText).style("pointer-events", "none");
|
30499 | mainTextEnter.append("g").attr("class", classTexts);
|
30500 | },
|
30501 |
|
30502 | /**
|
30503 | * Update text
|
30504 | * @private
|
30505 | */
|
30506 | updateText: function updateText() {
|
30507 | var $$ = this,
|
30508 | $el = $$.$el,
|
30509 | $T = $$.$T,
|
30510 | config = $$.config,
|
30511 | classText = $$.getClass("text", "index"),
|
30512 | text = $el.main.selectAll("." + config_classes.texts).selectAll("." + config_classes.text).data($$.labelishData.bind($$));
|
30513 | $T(text.exit()).style("fill-opacity", "0").remove();
|
30514 | $el.text = text.enter().append("text").merge(text).attr("class", classText).attr("text-anchor", function (d) {
|
30515 | // when value is negative or
|
30516 | var isEndAnchor = d.value < 0;
|
30517 |
|
30518 | if ($$.isCandlestickType(d)) {
|
30519 | var data = $$.getCandlestickData(d);
|
30520 | isEndAnchor = !(data != null && data._isUp);
|
30521 | }
|
30522 |
|
30523 | return config.axis_rotated ? isEndAnchor ? "end" : "start" : "middle";
|
30524 | }).style("fill", $$.updateTextColor.bind($$)).style("fill-opacity", "0").each(function (d, i, texts) {
|
30525 | var node = src_select(this),
|
30526 | value = d.value;
|
30527 |
|
30528 | if ($$.isBubbleZType(d)) {
|
30529 | value = $$.getBubbleZData(value, "z");
|
30530 | } else if ($$.isCandlestickType(d)) {
|
30531 | var data = $$.getCandlestickData(d);
|
30532 |
|
30533 | if (data) {
|
30534 | value = data.close;
|
30535 | }
|
30536 | }
|
30537 |
|
30538 | value = $$.dataLabelFormat(d.id)(value, d.id, i, texts);
|
30539 |
|
30540 | if (isNumber(value)) {
|
30541 | this.textContent = value;
|
30542 | } else {
|
30543 | setTextValue(node, value);
|
30544 | }
|
30545 | });
|
30546 | },
|
30547 | updateTextColor: function updateTextColor(d) {
|
30548 | var $$ = this,
|
30549 | config = $$.config,
|
30550 | labelColors = config.data_labels_colors,
|
30551 | defaultColor = $$.isArcType(d) && !$$.isRadarType(d) ? null : $$.color(d),
|
30552 | color;
|
30553 |
|
30554 | if (isString(labelColors)) {
|
30555 | color = labelColors;
|
30556 | } else if (isObject(labelColors)) {
|
30557 | var _ref = d.data || d,
|
30558 | id = _ref.id;
|
30559 |
|
30560 | color = labelColors[id];
|
30561 | } else if (isFunction(labelColors)) {
|
30562 | color = labelColors.bind($$.api)(defaultColor, d);
|
30563 | }
|
30564 |
|
30565 | if ($$.isCandlestickType(d) && !isFunction(labelColors)) {
|
30566 | var value = $$.getCandlestickData(d);
|
30567 |
|
30568 | if (!(value != null && value._isUp)) {
|
30569 | var downColor = config.candlestick_color_down;
|
30570 | color = isObject(downColor) ? downColor[d.id] : downColor;
|
30571 | }
|
30572 | }
|
30573 |
|
30574 | return color || defaultColor;
|
30575 | },
|
30576 |
|
30577 | /**
|
30578 | * Update data label text background color
|
30579 | * @param {object} d Data object
|
30580 | * @returns {string|null}
|
30581 | * @private
|
30582 | */
|
30583 | updateTextBacgroundColor: function updateTextBacgroundColor(d) {
|
30584 | var $$ = this,
|
30585 | $el = $$.$el,
|
30586 | config = $$.config,
|
30587 | backgroundColor = config.data_labels_backgroundColors,
|
30588 | color = "";
|
30589 |
|
30590 | if (isString(backgroundColor) || isObject(backgroundColor)) {
|
30591 | var id = isString(backgroundColor) ? "" : $$.getTargetSelectorSuffix("id" in d ? d.id : d.data.id),
|
30592 | filter = $el.defs.select(["filter[id*='labels-bg", "']"].join(id));
|
30593 |
|
30594 | if (filter.size()) {
|
30595 | color = "url(#" + filter.attr("id") + ")";
|
30596 | }
|
30597 | }
|
30598 |
|
30599 | return color || null;
|
30600 | },
|
30601 |
|
30602 | /**
|
30603 | * Redraw chartText
|
30604 | * @param {Function} x Positioning function for x
|
30605 | * @param {Function} y Positioning function for y
|
30606 | * @param {boolean} forFlow Weather is flow
|
30607 | * @param {boolean} withTransition transition is enabled
|
30608 | * @returns {Array}
|
30609 | * @private
|
30610 | */
|
30611 | redrawText: function redrawText(x, y, forFlow, withTransition) {
|
30612 | var $$ = this,
|
30613 | $T = $$.$T,
|
30614 | t = getRandom(!0);
|
30615 | $$.$el.text.style("fill", $$.updateTextColor.bind($$)).attr("filter", $$.updateTextBacgroundColor.bind($$)).style("fill-opacity", forFlow ? 0 : $$.opacityForText.bind($$)).each(function (d, i) {
|
30616 | // do not apply transition for newly added text elements
|
30617 | var node = $T(this, !!(withTransition && this.getAttribute("x")), t),
|
30618 | posX = x.bind(this)(d, i),
|
30619 | posY = y.bind(this)(d, i);
|
30620 |
|
30621 | // when is multiline
|
30622 | if (this.childElementCount) {
|
30623 | node.attr("transform", "translate(" + posX + " " + posY + ")");
|
30624 | } else {
|
30625 | node.attr("x", posX).attr("y", posY);
|
30626 | }
|
30627 | }); // need to return 'true' as of being pushed to the redraw list
|
30628 | // ref: getRedrawList()
|
30629 |
|
30630 | return !0;
|
30631 | },
|
30632 |
|
30633 | /**
|
30634 | * Gets the getBoundingClientRect value of the element
|
30635 | * @param {HTMLElement|d3.selection} element Target element
|
30636 | * @param {string} className Class name
|
30637 | * @returns {object} value of element.getBoundingClientRect()
|
30638 | * @private
|
30639 | */
|
30640 | getTextRect: function getTextRect(element, className) {
|
30641 | var $$ = this,
|
30642 | base = element.node ? element.node() : element;
|
30643 |
|
30644 | if (!/text/i.test(base.tagName)) {
|
30645 | base = base.querySelector("text");
|
30646 | }
|
30647 |
|
30648 | var text = base.textContent,
|
30649 | cacheKey = KEY.textRect + "-" + text.replace(/\W/g, "_"),
|
30650 | rect = $$.cache.get(cacheKey);
|
30651 |
|
30652 | if (!rect) {
|
30653 | $$.$el.svg.append("text").style("visibility", "hidden").style("font", src_select(base).style("font")).classed(className, !0).text(text).call(function (v) {
|
30654 | rect = getBoundingRect(v.node());
|
30655 | }).remove();
|
30656 | $$.cache.add(cacheKey, rect);
|
30657 | }
|
30658 |
|
30659 | return rect;
|
30660 | },
|
30661 |
|
30662 | /**
|
30663 | * Gets the x or y coordinate of the text
|
30664 | * @param {object} indices Indices values
|
30665 | * @param {boolean} forX whether or not to x
|
30666 | * @returns {number} coordinates
|
30667 | * @private
|
30668 | */
|
30669 | generateXYForText: function generateXYForText(indices, forX) {
|
30670 | var $$ = this,
|
30671 | types = Object.keys(indices),
|
30672 | points = {},
|
30673 | getter = forX ? $$.getXForText : $$.getYForText;
|
30674 | $$.hasType("radar") && types.push("radar");
|
30675 | types.forEach(function (v) {
|
30676 | points[v] = $$["generateGet" + capitalize(v) + "Points"](indices[v], !1);
|
30677 | });
|
30678 | return function (d, i) {
|
30679 | var type = $$.isAreaType(d) && "area" || $$.isBarType(d) && "bar" || $$.isCandlestickType(d) && "candlestick" || $$.isRadarType(d) && "radar" || "line";
|
30680 | return getter.call($$, points[type](d, i), d, this);
|
30681 | };
|
30682 | },
|
30683 |
|
30684 | /**
|
30685 | * Get centerized text position for bar type data.label.text
|
30686 | * @param {object} d Data object
|
30687 | * @param {Array} points Data points position
|
30688 | * @param {HTMLElement} textElement Data label text element
|
30689 | * @returns {number} Position value
|
30690 | * @private
|
30691 | */
|
30692 | getCenteredTextPos: function getCenteredTextPos(d, points, textElement) {
|
30693 | var $$ = this,
|
30694 | config = $$.config,
|
30695 | isRotated = config.axis_rotated;
|
30696 |
|
30697 | if (config.data_labels.centered && $$.isBarType(d)) {
|
30698 | var rect = getBoundingRect(textElement),
|
30699 | isPositive = d.value >= 0;
|
30700 |
|
30701 | if (isRotated) {
|
30702 | var w = (isPositive ? points[1][1] - points[0][1] : points[0][1] - points[1][1]) / 2 + rect.width / 2;
|
30703 | return isPositive ? -w - 3 : w + 2;
|
30704 | } else {
|
30705 | var h = (isPositive ? points[0][1] - points[1][1] : points[1][1] - points[0][1]) / 2 + rect.height / 2;
|
30706 | return isPositive ? h : -h - 2;
|
30707 | }
|
30708 | }
|
30709 |
|
30710 | return 0;
|
30711 | },
|
30712 |
|
30713 | /**
|
30714 | * Get data.labels.position value
|
30715 | * @param {string} id Data id value
|
30716 | * @param {string} type x | y
|
30717 | * @returns {number} Position value
|
30718 | * @private
|
30719 | */
|
30720 | getTextPos: function getTextPos(id, type) {
|
30721 | var pos = this.config.data_labels_position;
|
30722 | return (id in pos ? pos[id] : pos)[type] || 0;
|
30723 | },
|
30724 |
|
30725 | /**
|
30726 | * Gets the x coordinate of the text
|
30727 | * @param {object} points Data points position
|
30728 | * @param {object} d Data object
|
30729 | * @param {HTMLElement} textElement Data label text element
|
30730 | * @returns {number} x coordinate
|
30731 | * @private
|
30732 | */
|
30733 | getXForText: function getXForText(points, d, textElement) {
|
30734 | var $$ = this,
|
30735 | config = $$.config,
|
30736 | state = $$.state,
|
30737 | isRotated = config.axis_rotated,
|
30738 | xPos = points[0][0];
|
30739 |
|
30740 | if ($$.hasType("candlestick")) {
|
30741 | if (isRotated) {
|
30742 | xPos = $$.getCandlestickData(d)._isUp ? points[2][2] + 4 : points[2][1] - 4;
|
30743 | } else {
|
30744 | xPos += (points[1][0] - xPos) / 2;
|
30745 | }
|
30746 | } else {
|
30747 | if (isRotated) {
|
30748 | var padding = $$.isBarType(d) ? 4 : 6;
|
30749 | xPos = points[2][1] + padding * (d.value < 0 ? -1 : 1);
|
30750 | } else {
|
30751 | xPos = $$.hasType("bar") ? (points[2][0] + points[0][0]) / 2 : xPos;
|
30752 | }
|
30753 | } // show labels regardless of the domain if value is null
|
30754 |
|
30755 |
|
30756 | if (d.value === null) {
|
30757 | if (xPos > state.width) {
|
30758 | var _getBoundingRect = getBoundingRect(textElement),
|
30759 | width = _getBoundingRect.width;
|
30760 |
|
30761 | xPos = state.width - width;
|
30762 | } else if (xPos < 0) {
|
30763 | xPos = 4;
|
30764 | }
|
30765 | }
|
30766 |
|
30767 | if (isRotated) {
|
30768 | xPos += $$.getCenteredTextPos(d, points, textElement);
|
30769 | }
|
30770 |
|
30771 | return xPos + $$.getTextPos(d.id, "x");
|
30772 | },
|
30773 |
|
30774 | /**
|
30775 | * Gets the y coordinate of the text
|
30776 | * @param {object} points Data points position
|
30777 | * @param {object} d Data object
|
30778 | * @param {HTMLElement} textElement Data label text element
|
30779 | * @returns {number} y coordinate
|
30780 | * @private
|
30781 | */
|
30782 | getYForText: function getYForText(points, d, textElement) {
|
30783 | var $$ = this,
|
30784 | config = $$.config,
|
30785 | state = $$.state,
|
30786 | isRotated = config.axis_rotated,
|
30787 | r = config.point_r,
|
30788 | rect = getBoundingRect(textElement),
|
30789 | value = d.value,
|
30790 | baseY = 3,
|
30791 | yPos;
|
30792 |
|
30793 | if ($$.isCandlestickType(d)) {
|
30794 | value = $$.getCandlestickData(d);
|
30795 |
|
30796 | if (isRotated) {
|
30797 | yPos = points[0][0];
|
30798 | yPos += (points[1][0] - yPos) / 2 + baseY;
|
30799 | } else {
|
30800 | yPos = value && value._isUp ? points[2][2] - baseY : points[2][1] + baseY * 4;
|
30801 | }
|
30802 | } else {
|
30803 | if (isRotated) {
|
30804 | yPos = (points[0][0] + points[2][0] + rect.height * .6) / 2;
|
30805 | } else {
|
30806 | yPos = points[2][1];
|
30807 |
|
30808 | if (isNumber(r) && r > 5 && ($$.isLineType(d) || $$.isScatterType(d))) {
|
30809 | baseY += config.point_r / 2.3;
|
30810 | }
|
30811 |
|
30812 | if (value < 0 || value === 0 && !state.hasPositiveValue && state.hasNegativeValue) {
|
30813 | yPos += rect.height + ($$.isBarType(d) ? -baseY : baseY);
|
30814 | } else {
|
30815 | var diff = -baseY * 2;
|
30816 |
|
30817 | if ($$.isBarType(d)) {
|
30818 | diff = -baseY;
|
30819 | } else if ($$.isBubbleType(d)) {
|
30820 | diff = baseY;
|
30821 | }
|
30822 |
|
30823 | yPos += diff;
|
30824 | }
|
30825 | }
|
30826 | } // show labels regardless of the domain if value is null
|
30827 |
|
30828 |
|
30829 | if (d.value === null && !isRotated) {
|
30830 | var boxHeight = rect.height;
|
30831 |
|
30832 | if (yPos < boxHeight) {
|
30833 | yPos = boxHeight;
|
30834 | } else if (yPos > state.height) {
|
30835 | yPos = state.height - 4;
|
30836 | }
|
30837 | }
|
30838 |
|
30839 | if (!isRotated) {
|
30840 | yPos += $$.getCenteredTextPos(d, points, textElement);
|
30841 | }
|
30842 |
|
30843 | return yPos + $$.getTextPos(d.id, "y");
|
30844 | },
|
30845 |
|
30846 | /**
|
30847 | * Calculate if two or more text nodes are overlapping
|
30848 | * Mark overlapping text nodes with "text-overlapping" class
|
30849 | * @param {string} id Axis id
|
30850 | * @param {ChartInternal} $$ ChartInternal context
|
30851 | * @param {string} selector Selector string
|
30852 | * @private
|
30853 | */
|
30854 | markOverlapped: function markOverlapped(id, $$, selector) {
|
30855 | var textNodes = $$.$el.arcs.selectAll(selector),
|
30856 | filteredTextNodes = textNodes.filter(function (node) {
|
30857 | return node.data.id !== id;
|
30858 | }),
|
30859 | textNode = textNodes.filter(function (node) {
|
30860 | return node.data.id === id;
|
30861 | }),
|
30862 | translate = getTranslation(textNode.node()),
|
30863 | calcHypo = function (x, y) {
|
30864 | return Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
|
30865 | };
|
30866 |
|
30867 | textNode.node() && filteredTextNodes.each(function () {
|
30868 | var coordinate = getTranslation(this),
|
30869 | filteredTextNode = src_select(this),
|
30870 | nodeForWidth = calcHypo(translate.e, translate.f) > calcHypo(coordinate.e, coordinate.f) ? textNode : filteredTextNode,
|
30871 | overlapsX = Math.ceil(Math.abs(translate.e - coordinate.e)) < Math.ceil(nodeForWidth.node().getComputedTextLength()),
|
30872 | overlapsY = Math.ceil(Math.abs(translate.f - coordinate.f)) < parseInt(textNode.style("font-size"), 10);
|
30873 | filteredTextNode.classed(config_classes.TextOverlapping, overlapsX && overlapsY);
|
30874 | });
|
30875 | },
|
30876 |
|
30877 | /**
|
30878 | * Calculate if two or more text nodes are overlapping
|
30879 | * Remove "text-overlapping" class on selected text nodes
|
30880 | * @param {ChartInternal} $$ ChartInternal context
|
30881 | * @param {string} selector Selector string
|
30882 | * @private
|
30883 | */
|
30884 | undoMarkOverlapped: function undoMarkOverlapped($$, selector) {
|
30885 | $$.$el.arcs.selectAll(selector).each(function () {
|
30886 | src_selectAll([this, this.previousSibling]).classed(config_classes.TextOverlapping, !1);
|
30887 | });
|
30888 | },
|
30889 |
|
30890 | /**
|
30891 | * Check if meets the ratio to show data label text
|
30892 | * @param {number} ratio ratio to meet
|
30893 | * @param {string} type chart type
|
30894 | * @returns {boolean}
|
30895 | * @private
|
30896 | */
|
30897 | meetsLabelThreshold: function meetsLabelThreshold(ratio, type) {
|
30898 | if (ratio === void 0) {
|
30899 | ratio = 0;
|
30900 | }
|
30901 |
|
30902 | var $$ = this,
|
30903 | config = $$.config,
|
30904 | threshold = config[type + "_label_threshold"] || 0;
|
30905 | return ratio >= threshold;
|
30906 | }
|
30907 | });
|
30908 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/title.ts
|
30909 | /**
|
30910 | * Copyright (c) 2017 ~ present NAVER Corp.
|
30911 | * billboard.js project is licensed under the MIT license
|
30912 | */
|
30913 |
|
30914 |
|
30915 | /**
|
30916 | * Get the text position
|
30917 | * @param {string} pos right, left or center
|
30918 | * @param {number} width chart width
|
30919 | * @returns {string|number} text-anchor value or position in pixel
|
30920 | * @private
|
30921 | */
|
30922 |
|
30923 | function getTextPos(pos, width) {
|
30924 | if (pos === void 0) {
|
30925 | pos = "left";
|
30926 | }
|
30927 |
|
30928 | var isNum = isNumber(width),
|
30929 | position;
|
30930 |
|
30931 | if (pos.indexOf("center") > -1) {
|
30932 | position = isNum ? width / 2 : "middle";
|
30933 | } else if (pos.indexOf("right") > -1) {
|
30934 | position = isNum ? width : "end";
|
30935 | } else {
|
30936 | position = isNum ? 0 : "start";
|
30937 | }
|
30938 |
|
30939 | return position;
|
30940 | }
|
30941 |
|
30942 | /* harmony default export */ var internals_title = ({
|
30943 | /**
|
30944 | * Initializes the title
|
30945 | * @private
|
30946 | */
|
30947 | initTitle: function initTitle() {
|
30948 | var $$ = this,
|
30949 | config = $$.config,
|
30950 | $el = $$.$el;
|
30951 |
|
30952 | if (config.title_text) {
|
30953 | $el.title = $el.svg.append("g");
|
30954 | var text = $el.title.append("text").style("text-anchor", getTextPos(config.title_position)).attr("class", config_classes.title);
|
30955 | setTextValue(text, config.title_text, [.3, 1.5]);
|
30956 | }
|
30957 | },
|
30958 |
|
30959 | /**
|
30960 | * Redraw title
|
30961 | * @private
|
30962 | */
|
30963 | redrawTitle: function redrawTitle() {
|
30964 | var $$ = this,
|
30965 | config = $$.config,
|
30966 | current = $$.state.current,
|
30967 | title = $$.$el.title;
|
30968 |
|
30969 | if (title) {
|
30970 | var y = $$.yForTitle.call($$);
|
30971 |
|
30972 | if (/g/i.test(title.node().tagName)) {
|
30973 | title.attr("transform", "translate(" + getTextPos(config.title_position, current.width) + ", " + y + ")");
|
30974 | } else {
|
30975 | title.attr("x", $$.xForTitle.call($$)).attr("y", y);
|
30976 | }
|
30977 | }
|
30978 | },
|
30979 |
|
30980 | /**
|
30981 | * Returns the x attribute value of the title
|
30982 | * @returns {number} x attribute value
|
30983 | * @private
|
30984 | */
|
30985 | xForTitle: function xForTitle() {
|
30986 | var $$ = this,
|
30987 | config = $$.config,
|
30988 | current = $$.state.current,
|
30989 | position = config.title_position || "left",
|
30990 | textRectWidth = $$.getTextRect($$.$el.title, config_classes.title).width,
|
30991 | x;
|
30992 |
|
30993 | if (/(right|center)/.test(position)) {
|
30994 | x = current.width - textRectWidth;
|
30995 |
|
30996 | if (position.indexOf("right") >= 0) {
|
30997 | x = current.width - textRectWidth - config.title_padding.right;
|
30998 | } else if (position.indexOf("center") >= 0) {
|
30999 | x = (current.width - textRectWidth) / 2;
|
31000 | }
|
31001 | } else {
|
31002 | // left
|
31003 | x = config.title_padding.left || 0;
|
31004 | }
|
31005 |
|
31006 | return x;
|
31007 | },
|
31008 |
|
31009 | /**
|
31010 | * Returns the y attribute value of the title
|
31011 | * @returns {number} y attribute value
|
31012 | * @private
|
31013 | */
|
31014 | yForTitle: function yForTitle() {
|
31015 | var $$ = this;
|
31016 | return ($$.config.title_padding.top || 0) + $$.getTextRect($$.$el.title, config_classes.title).height;
|
31017 | },
|
31018 |
|
31019 | /**
|
31020 | * Get title padding
|
31021 | * @returns {number} padding value
|
31022 | * @private
|
31023 | */
|
31024 | getTitlePadding: function getTitlePadding() {
|
31025 | var $$ = this;
|
31026 | return $$.yForTitle() + ($$.config.title_padding.bottom || 0);
|
31027 | }
|
31028 | });
|
31029 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/tooltip.ts
|
31030 | /**
|
31031 | * Copyright (c) 2017 ~ present NAVER Corp.
|
31032 | * billboard.js project is licensed under the MIT license
|
31033 | */
|
31034 |
|
31035 |
|
31036 |
|
31037 |
|
31038 | /* harmony default export */ var internals_tooltip = ({
|
31039 | /**
|
31040 | * Initializes the tooltip
|
31041 | * @private
|
31042 | */
|
31043 | initTooltip: function initTooltip() {
|
31044 | var $$ = this,
|
31045 | config = $$.config,
|
31046 | $el = $$.$el;
|
31047 | $el.tooltip = src_select(config.tooltip_contents.bindto);
|
31048 |
|
31049 | if ($el.tooltip.empty()) {
|
31050 | $el.tooltip = $el.chart.style("position", "relative").append("div").attr("class", config_classes.tooltipContainer).style("position", "absolute").style("pointer-events", "none").style("display", "none");
|
31051 | }
|
31052 |
|
31053 | $$.bindTooltipResizePos();
|
31054 | },
|
31055 | initShowTooltip: function initShowTooltip() {
|
31056 | var $$ = this,
|
31057 | config = $$.config,
|
31058 | $el = $$.$el,
|
31059 | _$$$state = $$.state,
|
31060 | hasAxis = _$$$state.hasAxis,
|
31061 | hasRadar = _$$$state.hasRadar;
|
31062 |
|
31063 | // Show tooltip if needed
|
31064 | if (config.tooltip_init_show) {
|
31065 | var _$$$axis,
|
31066 | _$$$axis2,
|
31067 | isArc = !(hasAxis && hasRadar);
|
31068 |
|
31069 | if ((_$$$axis = $$.axis) != null && _$$$axis.isTimeSeries() && isString(config.tooltip_init_x)) {
|
31070 | var targets = $$.data.targets[0],
|
31071 | i,
|
31072 | val;
|
31073 | config.tooltip_init_x = parseDate.call($$, config.tooltip_init_x);
|
31074 |
|
31075 | for (i = 0; val = targets.values[i]; i++) {
|
31076 | if (val.x - config.tooltip_init_x === 0) {
|
31077 | break;
|
31078 | }
|
31079 | }
|
31080 |
|
31081 | config.tooltip_init_x = i;
|
31082 | }
|
31083 |
|
31084 | var data = $$.data.targets.map(function (d) {
|
31085 | var x = isArc ? 0 : config.tooltip_init_x;
|
31086 | return $$.addName(d.values[x]);
|
31087 | });
|
31088 |
|
31089 | if (isArc) {
|
31090 | data = [data[config.tooltip_init_x]];
|
31091 | }
|
31092 |
|
31093 | $el.tooltip.html($$.getTooltipHTML(data, (_$$$axis2 = $$.axis) == null ? void 0 : _$$$axis2.getXAxisTickFormat(), $$.getDefaultValueFormat(), $$.color));
|
31094 |
|
31095 | if (!config.tooltip_contents.bindto) {
|
31096 | $el.tooltip.style("top", config.tooltip_init_position.top).style("left", config.tooltip_init_position.left).style("display", null);
|
31097 | }
|
31098 | }
|
31099 | },
|
31100 |
|
31101 | /**
|
31102 | * Get the tooltip HTML string
|
31103 | * @param {Array} args Arguments
|
31104 | * @returns {string} Formatted HTML string
|
31105 | * @private
|
31106 | */
|
31107 | getTooltipHTML: function getTooltipHTML() {
|
31108 | var $$ = this,
|
31109 | api = $$.api,
|
31110 | config = $$.config;
|
31111 | return isFunction(config.tooltip_contents) ? config.tooltip_contents.bind(api).apply(void 0, arguments) : $$.getTooltipContent.apply($$, arguments);
|
31112 | },
|
31113 |
|
31114 | /**
|
31115 | * Returns the tooltip content(HTML string)
|
31116 | * @param {object} d data
|
31117 | * @param {Function} defaultTitleFormat Default title format
|
31118 | * @param {Function} defaultValueFormat Default format for each data value in the tooltip.
|
31119 | * @param {Function} color Color function
|
31120 | * @returns {string} html
|
31121 | * @private
|
31122 | */
|
31123 | getTooltipContent: function getTooltipContent(d, defaultTitleFormat, defaultValueFormat, color) {
|
31124 | var $$ = this,
|
31125 | api = $$.api,
|
31126 | config = $$.config,
|
31127 | state = $$.state,
|
31128 | _map = ["title", "name", "value"].map(function (v) {
|
31129 | var fn = config["tooltip_format_" + v];
|
31130 | return isFunction(fn) ? fn.bind(api) : fn;
|
31131 | }),
|
31132 | titleFormat = _map[0],
|
31133 | nameFormat = _map[1],
|
31134 | valueFormat = _map[2];
|
31135 |
|
31136 | titleFormat = titleFormat || defaultTitleFormat;
|
31137 |
|
31138 | nameFormat = nameFormat || function (name) {
|
31139 | return name;
|
31140 | };
|
31141 |
|
31142 | valueFormat = valueFormat || ($$.isStackNormalized() ? function (v, ratio) {
|
31143 | return (ratio * 100).toFixed(2) + "%";
|
31144 | } : defaultValueFormat);
|
31145 |
|
31146 | var order = config.tooltip_order,
|
31147 | getRowValue = function (row) {
|
31148 | return $$.axis && $$.isBubbleZType(row) ? $$.getBubbleZData(row.value, "z") : $$.getBaseValue(row);
|
31149 | },
|
31150 | getBgColor = $$.levelColor ? function (row) {
|
31151 | return $$.levelColor(row.value);
|
31152 | } : function (row) {
|
31153 | return color(row);
|
31154 | },
|
31155 | contents = config.tooltip_contents,
|
31156 | tplStr = contents.template,
|
31157 | targetIds = $$.mapToTargetIds();
|
31158 |
|
31159 | if (order === null && config.data_groups.length) {
|
31160 | // for stacked data, order should aligned with the visually displayed data
|
31161 | var ids = $$.orderTargets($$.data.targets).map(function (i2) {
|
31162 | return i2.id;
|
31163 | }).reverse();
|
31164 | d.sort(function (a, b) {
|
31165 | var v1 = a ? a.value : null,
|
31166 | v2 = b ? b.value : null;
|
31167 |
|
31168 | if (v1 > 0 && v2 > 0) {
|
31169 | v1 = a.id ? ids.indexOf(a.id) : null;
|
31170 | v2 = b.id ? ids.indexOf(b.id) : null;
|
31171 | }
|
31172 |
|
31173 | return v1 - v2;
|
31174 | });
|
31175 | } else if (/^(asc|desc)$/.test(order)) {
|
31176 | d.sort(function (a, b) {
|
31177 | var v1 = a ? getRowValue(a) : null,
|
31178 | v2 = b ? getRowValue(b) : null;
|
31179 | return order === "asc" ? v1 - v2 : v2 - v1;
|
31180 | });
|
31181 | } else if (isFunction(order)) {
|
31182 | d.sort(order.bind(api));
|
31183 | }
|
31184 |
|
31185 | var tpl = $$.getTooltipContentTemplate(tplStr),
|
31186 | len = d.length,
|
31187 | text,
|
31188 | row,
|
31189 | param,
|
31190 | value,
|
31191 | i;
|
31192 |
|
31193 | for (i = 0; i < len; i++) {
|
31194 | row = d[i];
|
31195 |
|
31196 | if (!row || !(getRowValue(row) || getRowValue(row) === 0)) {
|
31197 | continue;
|
31198 | }
|
31199 |
|
31200 | if (isUndefined(text)) {
|
31201 | var title = (state.hasAxis || state.hasRadar) && sanitise(titleFormat ? titleFormat(row.x) : row.x);
|
31202 | text = tplProcess(tpl[0], {
|
31203 | CLASS_TOOLTIP: config_classes.tooltip,
|
31204 | TITLE: isValue(title) ? tplStr ? title : "<tr><th colspan=\"2\">" + title + "</th></tr>" : ""
|
31205 | });
|
31206 | }
|
31207 |
|
31208 | if (!row.ratio && $$.$el.arcs) {
|
31209 | row.ratio = $$.getRatio("arc", $$.$el.arcs.select("path." + config_classes.arc + "-" + row.id).data()[0]);
|
31210 | }
|
31211 |
|
31212 | param = [row.ratio, row.id, row.index, d];
|
31213 | value = sanitise(valueFormat.apply(void 0, [getRowValue(row)].concat(param)));
|
31214 |
|
31215 | if ($$.isAreaRangeType(row)) {
|
31216 | var _map2 = ["high", "low"].map(function (v) {
|
31217 | return sanitise(valueFormat.apply(void 0, [$$.getRangedData(row, v)].concat(param)));
|
31218 | }),
|
31219 | high = _map2[0],
|
31220 | low = _map2[1];
|
31221 |
|
31222 | value = "<b>Mid:</b> " + value + " <b>High:</b> " + high + " <b>Low:</b> " + low;
|
31223 | } else if ($$.isCandlestickType(row)) {
|
31224 | var _map3 = ["open", "high", "low", "close", "volume"].map(function (v) {
|
31225 | return sanitise(valueFormat.apply(void 0, [$$.getRangedData(row, v, "candlestick")].concat(param)));
|
31226 | }),
|
31227 | open = _map3[0],
|
31228 | _high = _map3[1],
|
31229 | _low = _map3[2],
|
31230 | close = _map3[3],
|
31231 | volume = _map3[4];
|
31232 |
|
31233 | value = "<b>Open:</b> " + open + " <b>High:</b> " + _high + " <b>Low:</b> " + _low + " <b>Close:</b> " + close + (volume ? " <b>Volume:</b> " + volume : "");
|
31234 | }
|
31235 |
|
31236 | if (value !== undefined) {
|
31237 | var _ret = function () {
|
31238 | // Skip elements when their name is set to null
|
31239 | if (row.name === null) {
|
31240 | return "continue";
|
31241 | }
|
31242 |
|
31243 | var name = sanitise(nameFormat.apply(void 0, [row.name].concat(param))),
|
31244 | color = getBgColor(row),
|
31245 | contentValue = {
|
31246 | CLASS_TOOLTIP_NAME: config_classes.tooltipName + $$.getTargetSelectorSuffix(row.id),
|
31247 | COLOR: tplStr || !$$.patterns ? color : "<svg><rect style=\"fill:" + color + "\" width=\"10\" height=\"10\"></rect></svg>",
|
31248 | NAME: name,
|
31249 | VALUE: value
|
31250 | };
|
31251 |
|
31252 | if (tplStr && isObject(contents.text)) {
|
31253 | var index = targetIds.indexOf(row.id);
|
31254 | Object.keys(contents.text).forEach(function (key) {
|
31255 | contentValue[key] = contents.text[key][index];
|
31256 | });
|
31257 | }
|
31258 |
|
31259 | text += tplProcess(tpl[1], contentValue);
|
31260 | }();
|
31261 |
|
31262 | if (_ret === "continue") continue;
|
31263 | }
|
31264 | }
|
31265 |
|
31266 | return text + "</table>";
|
31267 | },
|
31268 |
|
31269 | /**
|
31270 | * Get the content template string
|
31271 | * @param {string} tplStr Tempalte string
|
31272 | * @returns {Array} Template string
|
31273 | * @private
|
31274 | */
|
31275 | getTooltipContentTemplate: function getTooltipContentTemplate(tplStr) {
|
31276 | 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(/{{(.*)}}/);
|
31277 | },
|
31278 |
|
31279 | /**
|
31280 | * Returns the position of the tooltip
|
31281 | * @param {object} dataToShow data
|
31282 | * @param {string} tWidth Width value of tooltip element
|
31283 | * @param {string} tHeight Height value of tooltip element
|
31284 | * @param {HTMLElement} element Tooltip element
|
31285 | * @returns {object} top, left value
|
31286 | * @private
|
31287 | */
|
31288 | tooltipPosition: function tooltipPosition(dataToShow, tWidth, tHeight, element) {
|
31289 | var $$ = this,
|
31290 | config = $$.config,
|
31291 | scale = $$.scale,
|
31292 | state = $$.state,
|
31293 | _state = state,
|
31294 | width = _state.width,
|
31295 | height = _state.height,
|
31296 | current = _state.current,
|
31297 | isLegendRight = _state.isLegendRight,
|
31298 | inputType = _state.inputType,
|
31299 | event = _state.event,
|
31300 | hasGauge = $$.hasType("gauge") && !config.gauge_fullCircle,
|
31301 | svgLeft = $$.getSvgLeft(!0),
|
31302 | chartRight = svgLeft + current.width - $$.getCurrentPaddingRight(),
|
31303 | chartLeft = $$.getCurrentPaddingLeft(!0),
|
31304 | size = 20,
|
31305 | _getPointer = getPointer(event, element),
|
31306 | x = _getPointer[0],
|
31307 | y = _getPointer[1];
|
31308 |
|
31309 | // Determine tooltip position
|
31310 | if ($$.hasArcType()) {
|
31311 | var raw = inputType === "touch" || $$.hasType("radar");
|
31312 |
|
31313 | if (!raw) {
|
31314 | y += hasGauge ? height : height / 2;
|
31315 | x += (width - (isLegendRight ? $$.getLegendWidth() : 0)) / 2;
|
31316 | }
|
31317 | } else {
|
31318 | var dataScale = scale.x(dataToShow[0].x);
|
31319 |
|
31320 | if (config.axis_rotated) {
|
31321 | y = dataScale + size;
|
31322 | x += svgLeft + 100;
|
31323 | chartRight -= svgLeft;
|
31324 | } else {
|
31325 | y -= 5;
|
31326 | x = svgLeft + chartLeft + size + ($$.scale.zoom ? x : dataScale);
|
31327 | }
|
31328 | } // when tooltip left + tWidth > chart's width
|
31329 |
|
31330 |
|
31331 | if (x + tWidth + 15 > chartRight) {
|
31332 | x -= tWidth + chartLeft;
|
31333 | }
|
31334 |
|
31335 | if (y + tHeight > current.height) {
|
31336 | y -= hasGauge ? tHeight * 3 : tHeight + 30;
|
31337 | }
|
31338 |
|
31339 | var pos = {
|
31340 | top: y,
|
31341 | left: x
|
31342 | }; // make sure to not be positioned out of viewport
|
31343 |
|
31344 | Object.keys(pos).forEach(function (v) {
|
31345 | if (pos[v] < 0) {
|
31346 | pos[v] = 0;
|
31347 | }
|
31348 | });
|
31349 | return pos;
|
31350 | },
|
31351 |
|
31352 | /**
|
31353 | * Show the tooltip
|
31354 | * @param {object} selectedData Data object
|
31355 | * @param {SVGElement} eventRect Event <rect> element
|
31356 | * @private
|
31357 | */
|
31358 | showTooltip: function showTooltip(selectedData, eventRect) {
|
31359 | var $$ = this,
|
31360 | config = $$.config,
|
31361 | scale = $$.scale,
|
31362 | state = $$.state,
|
31363 | tooltip = $$.$el.tooltip,
|
31364 | bindto = config.tooltip_contents.bindto,
|
31365 | dataToShow = selectedData.filter(function (d) {
|
31366 | return d && isValue($$.getBaseValue(d));
|
31367 | });
|
31368 |
|
31369 | if (!tooltip || dataToShow.length === 0 || !config.tooltip_show) {
|
31370 | return;
|
31371 | }
|
31372 |
|
31373 | var datum = tooltip.datum(),
|
31374 | _ref = datum || {},
|
31375 | _ref$width = _ref.width,
|
31376 | width = _ref$width === void 0 ? 0 : _ref$width,
|
31377 | _ref$height = _ref.height,
|
31378 | height = _ref$height === void 0 ? 0 : _ref$height,
|
31379 | dataStr = JSON.stringify(selectedData);
|
31380 |
|
31381 | if (!datum || datum.current !== dataStr) {
|
31382 | var index = selectedData.concat().sort()[0].index;
|
31383 | callFn(config.tooltip_onshow, $$.api, selectedData); // set tooltip content
|
31384 |
|
31385 | tooltip.html($$.getTooltipHTML(selectedData, // data
|
31386 | $$.axis ? $$.axis.getXAxisTickFormat() : $$.categoryName.bind($$), // defaultTitleFormat
|
31387 | $$.getDefaultValueFormat(), // defaultValueFormat
|
31388 | $$.color // color
|
31389 | )).style("display", null).style("visibility", null) // for IE9
|
31390 | .datum(datum = {
|
31391 | index: index,
|
31392 | current: dataStr,
|
31393 | width: width = tooltip.property("offsetWidth"),
|
31394 | height: height = tooltip.property("offsetHeight")
|
31395 | });
|
31396 | callFn(config.tooltip_onshown, $$.api, selectedData);
|
31397 |
|
31398 | $$._handleLinkedCharts(!0, index);
|
31399 | }
|
31400 |
|
31401 | if (!bindto) {
|
31402 | var _config$tooltip_posit,
|
31403 | _selectedData$filter,
|
31404 | fnPos = ((_config$tooltip_posit = config.tooltip_position) == null ? void 0 : _config$tooltip_posit.bind($$.api)) || $$.tooltipPosition.bind($$),
|
31405 | _getPointer2 = getPointer(state.event, eventRect),
|
31406 | x = _getPointer2[0],
|
31407 | y = _getPointer2[1],
|
31408 | currPos = {
|
31409 | x: x,
|
31410 | y: y
|
31411 | },
|
31412 | data = (_selectedData$filter = selectedData.filter(Boolean)) == null ? void 0 : _selectedData$filter.shift();
|
31413 |
|
31414 | if (scale.x && data && "x" in data) {
|
31415 | currPos.xAxis = scale.x(data.x);
|
31416 | } // Get tooltip dimensions
|
31417 |
|
31418 |
|
31419 | var pos = fnPos(dataToShow, width, height, eventRect, currPos);
|
31420 | ["top", "left"].forEach(function (v) {
|
31421 | var value = pos[v];
|
31422 | tooltip.style(v, value + "px"); // Remember left pos in percentage to be used on resize call
|
31423 |
|
31424 | if (v === "left" && !datum.xPosInPercent) {
|
31425 | datum.xPosInPercent = value / state.current.width * 100;
|
31426 | }
|
31427 | });
|
31428 | }
|
31429 | },
|
31430 |
|
31431 | /**
|
31432 | * Adjust tooltip position on resize event
|
31433 | * @private
|
31434 | */
|
31435 | bindTooltipResizePos: function bindTooltipResizePos() {
|
31436 | var $$ = this,
|
31437 | resizeFunction = $$.resizeFunction,
|
31438 | state = $$.state,
|
31439 | tooltip = $$.$el.tooltip;
|
31440 | resizeFunction.add(function () {
|
31441 | if (tooltip.style("display") === "block") {
|
31442 | var current = state.current,
|
31443 | _tooltip$datum = tooltip.datum(),
|
31444 | width = _tooltip$datum.width,
|
31445 | xPosInPercent = _tooltip$datum.xPosInPercent,
|
31446 | _value = current.width / 100 * xPosInPercent,
|
31447 | diff = current.width - (_value + width);
|
31448 |
|
31449 | // if tooltip size overs current viewport size
|
31450 | if (diff < 0) {
|
31451 | _value += diff;
|
31452 | }
|
31453 |
|
31454 | tooltip.style("left", _value + "px");
|
31455 | }
|
31456 | });
|
31457 | },
|
31458 |
|
31459 | /**
|
31460 | * Hide the tooltip
|
31461 | * @param {boolean} force Force to hide
|
31462 | * @private
|
31463 | */
|
31464 | hideTooltip: function hideTooltip(force) {
|
31465 | var $$ = this,
|
31466 | api = $$.api,
|
31467 | config = $$.config,
|
31468 | tooltip = $$.$el.tooltip;
|
31469 |
|
31470 | if (tooltip && tooltip.style("display") !== "none" && (!config.tooltip_doNotHide || force)) {
|
31471 | var selectedData = JSON.parse(tooltip.datum().current);
|
31472 | callFn(config.tooltip_onhide, api, selectedData); // hide tooltip
|
31473 |
|
31474 | tooltip.style("display", "none").style("visibility", "hidden") // for IE9
|
31475 | .datum(null);
|
31476 | callFn(config.tooltip_onhidden, api, selectedData);
|
31477 | }
|
31478 | },
|
31479 |
|
31480 | /**
|
31481 | * Toggle display for linked chart instances
|
31482 | * @param {boolean} show true: show, false: hide
|
31483 | * @param {number} index x Axis index
|
31484 | * @private
|
31485 | */
|
31486 | _handleLinkedCharts: function _handleLinkedCharts(show, index) {
|
31487 | var _event,
|
31488 | $$ = this,
|
31489 | charts = $$.charts,
|
31490 | config = $$.config,
|
31491 | event = $$.state.event;
|
31492 |
|
31493 | // Prevent propagation among instances if isn't instantiated from the user's event
|
31494 | // https://github.com/naver/billboard.js/issues/1979
|
31495 | if ((_event = event) != null && _event.isTrusted && config.tooltip_linked && charts.length > 1) {
|
31496 | var linkedName = config.tooltip_linked_name;
|
31497 | charts.filter(function (c) {
|
31498 | return c !== $$.api;
|
31499 | }).forEach(function (c) {
|
31500 | var _c$internal = c.internal,
|
31501 | config = _c$internal.config,
|
31502 | $el = _c$internal.$el,
|
31503 | isLinked = config.tooltip_linked,
|
31504 | name = config.tooltip_linked_name,
|
31505 | isInDom = browser_doc.body.contains($el.chart.node());
|
31506 |
|
31507 | if (isLinked && linkedName === name && isInDom) {
|
31508 | var data = $el.tooltip.data()[0],
|
31509 | isNotSameIndex = index !== (data == null ? void 0 : data.index);
|
31510 |
|
31511 | try {
|
31512 | c.tooltip[show && isNotSameIndex ? "show" : "hide"]({
|
31513 | index: index
|
31514 | });
|
31515 | } catch (e) {}
|
31516 | }
|
31517 | });
|
31518 | }
|
31519 | }
|
31520 | });
|
31521 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/transform.ts
|
31522 | /**
|
31523 | * Copyright (c) 2017 ~ present NAVER Corp.
|
31524 | * billboard.js project is licensed under the MIT license
|
31525 | */
|
31526 |
|
31527 |
|
31528 | /* harmony default export */ var transform = ({
|
31529 | getTranslate: function getTranslate(target, index) {
|
31530 | if (index === void 0) {
|
31531 | index = 0;
|
31532 | }
|
31533 |
|
31534 | var $$ = this,
|
31535 | config = $$.config,
|
31536 | state = $$.state,
|
31537 | isRotated = config.axis_rotated,
|
31538 | padding = 0,
|
31539 | x,
|
31540 | y;
|
31541 |
|
31542 | if (index && /^(x|y2?)$/.test(target)) {
|
31543 | padding = $$.getAxisSize(target) * index;
|
31544 | }
|
31545 |
|
31546 | if (target === "main") {
|
31547 | x = asHalfPixel(state.margin.left);
|
31548 | y = asHalfPixel(state.margin.top);
|
31549 | } else if (target === "context") {
|
31550 | x = asHalfPixel(state.margin2.left);
|
31551 | y = asHalfPixel(state.margin2.top);
|
31552 | } else if (target === "legend") {
|
31553 | x = state.margin3.left;
|
31554 | y = state.margin3.top;
|
31555 | } else if (target === "x") {
|
31556 | x = isRotated ? -padding : 0;
|
31557 | y = isRotated ? 0 : state.height + padding;
|
31558 | } else if (target === "y") {
|
31559 | x = isRotated ? 0 : -padding;
|
31560 | y = isRotated ? state.height + padding : 0;
|
31561 | } else if (target === "y2") {
|
31562 | x = isRotated ? 0 : state.width + padding;
|
31563 | y = isRotated ? 1 - padding : 0;
|
31564 | } else if (target === "subX") {
|
31565 | x = 0;
|
31566 | y = isRotated ? 0 : state.height2;
|
31567 | } else if (target === "arc") {
|
31568 | x = state.arcWidth / 2;
|
31569 | y = state.arcHeight / 2;
|
31570 | } else if (target === "radar") {
|
31571 | var _$$$getRadarSize = $$.getRadarSize(),
|
31572 | width = _$$$getRadarSize[0];
|
31573 |
|
31574 | x = state.width / 2 - width;
|
31575 | y = asHalfPixel(state.margin.top);
|
31576 | }
|
31577 |
|
31578 | return "translate(" + x + ", " + y + ")";
|
31579 | },
|
31580 | transformMain: function transformMain(withTransition, transitions) {
|
31581 | var $$ = this,
|
31582 | main = $$.$el.main,
|
31583 | $T = $$.$T,
|
31584 | xAxis = transitions != null && transitions.axisX ? transitions.axisX : $T(main.select("." + config_classes.axisX), withTransition),
|
31585 | yAxis = transitions != null && transitions.axisY ? transitions.axisY : $T(main.select("." + config_classes.axisY), withTransition),
|
31586 | y2Axis = transitions != null && transitions.axisY2 ? transitions.axisY2 : $T(main.select("." + config_classes.axisY2), withTransition);
|
31587 | $T(main, withTransition).attr("transform", $$.getTranslate("main"));
|
31588 | xAxis.attr("transform", $$.getTranslate("x"));
|
31589 | yAxis.attr("transform", $$.getTranslate("y"));
|
31590 | y2Axis.attr("transform", $$.getTranslate("y2"));
|
31591 | main.select("." + config_classes.chartArcs).attr("transform", $$.getTranslate("arc"));
|
31592 | },
|
31593 | transformAll: function transformAll(withTransition, transitions) {
|
31594 | var $$ = this,
|
31595 | config = $$.config,
|
31596 | hasAxis = $$.state.hasAxis,
|
31597 | $el = $$.$el;
|
31598 | $$.transformMain(withTransition, transitions);
|
31599 | hasAxis && config.subchart_show && $$.transformContext(withTransition, transitions);
|
31600 | $el.legend && $$.transformLegend(withTransition);
|
31601 | }
|
31602 | });
|
31603 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/type.ts
|
31604 | /**
|
31605 | * Copyright (c) 2017 ~ present NAVER Corp.
|
31606 | * billboard.js project is licensed under the MIT license
|
31607 | */
|
31608 |
|
31609 |
|
31610 | /* harmony default export */ var internals_type = ({
|
31611 | setTargetType: function setTargetType(targetIds, type) {
|
31612 | var $$ = this,
|
31613 | config = $$.config,
|
31614 | withoutFadeIn = $$.state.withoutFadeIn;
|
31615 | $$.mapToTargetIds(targetIds).forEach(function (id) {
|
31616 | withoutFadeIn[id] = type === config.data_types[id];
|
31617 | config.data_types[id] = type;
|
31618 | });
|
31619 |
|
31620 | if (!targetIds) {
|
31621 | config.data_type = type;
|
31622 | }
|
31623 | },
|
31624 |
|
31625 | /**
|
31626 | * Updte current used chart types
|
31627 | * @private
|
31628 | */
|
31629 | updateTypesElements: function updateTypesElements() {
|
31630 | var $$ = this,
|
31631 | current = $$.state.current;
|
31632 | Object.keys(TYPE).forEach(function (v) {
|
31633 | var t = TYPE[v],
|
31634 | has = $$.hasType(t, null, !0),
|
31635 | idx = current.types.indexOf(t);
|
31636 |
|
31637 | if (idx === -1 && has) {
|
31638 | current.types.push(t);
|
31639 | } else if (idx > -1 && !has) {
|
31640 | current.types.splice(idx, 1);
|
31641 | }
|
31642 | }); // Update current chart elements reference
|
31643 |
|
31644 | $$.setChartElements();
|
31645 | },
|
31646 |
|
31647 | /**
|
31648 | * Check if given chart types exists
|
31649 | * @param {string} type Chart type
|
31650 | * @param {Array} targetsValue Data array
|
31651 | * @param {boolean} checkFromData Force to check type cotains from data targets
|
31652 | * @returns {boolean}
|
31653 | * @private
|
31654 | */
|
31655 | hasType: function hasType(type, targetsValue, checkFromData) {
|
31656 | var _current$types, _targets;
|
31657 |
|
31658 | if (checkFromData === void 0) {
|
31659 | checkFromData = !1;
|
31660 | }
|
31661 |
|
31662 | var $$ = this,
|
31663 | config = $$.config,
|
31664 | current = $$.state.current,
|
31665 | types = config.data_types,
|
31666 | targets = targetsValue || $$.data.targets,
|
31667 | has = !1;
|
31668 |
|
31669 | if (!checkFromData && ((_current$types = current.types) == null ? void 0 : _current$types.indexOf(type)) > -1) {
|
31670 | has = !0;
|
31671 | } else if ((_targets = targets) != null && _targets.length) {
|
31672 | targets.forEach(function (target) {
|
31673 | var t = types[target.id];
|
31674 |
|
31675 | if (t === type || !t && type === "line") {
|
31676 | has = !0;
|
31677 | }
|
31678 | });
|
31679 | } else if (Object.keys(types).length) {
|
31680 | Object.keys(types).forEach(function (id) {
|
31681 | if (types[id] === type) {
|
31682 | has = !0;
|
31683 | }
|
31684 | });
|
31685 | } else {
|
31686 | has = config.data_type === type;
|
31687 | }
|
31688 |
|
31689 | return has;
|
31690 | },
|
31691 |
|
31692 | /**
|
31693 | * Check if contains given chart types
|
31694 | * @param {string} type Type key
|
31695 | * @param {object} targets Target data
|
31696 | * @param {Array} exclude Excluded types
|
31697 | * @returns {boolean}
|
31698 | * @private
|
31699 | */
|
31700 | hasTypeOf: function hasTypeOf(type, targets, exclude) {
|
31701 | var _this = this;
|
31702 |
|
31703 | if (exclude === void 0) {
|
31704 | exclude = [];
|
31705 | }
|
31706 |
|
31707 | if (type in TYPE_BY_CATEGORY) {
|
31708 | return !TYPE_BY_CATEGORY[type].filter(function (v) {
|
31709 | return exclude.indexOf(v) === -1;
|
31710 | }).every(function (v) {
|
31711 | return !_this.hasType(v, targets);
|
31712 | });
|
31713 | }
|
31714 |
|
31715 | return !1;
|
31716 | },
|
31717 |
|
31718 | /**
|
31719 | * Check if given data is certain chart type
|
31720 | * @param {object} d Data object
|
31721 | * @param {string|Array} type chart type
|
31722 | * @returns {boolean}
|
31723 | * @private
|
31724 | */
|
31725 | isTypeOf: function isTypeOf(d, type) {
|
31726 | var id = isString(d) ? d : d.id,
|
31727 | dataType = this.config.data_types[id] || this.config.data_type;
|
31728 | return isArray(type) ? type.indexOf(dataType) >= 0 : dataType === type;
|
31729 | },
|
31730 | hasPointType: function hasPointType() {
|
31731 | var $$ = this;
|
31732 | return $$.hasTypeOf("Line") || $$.hasType("bubble") || $$.hasType("scatter");
|
31733 | },
|
31734 |
|
31735 | /**
|
31736 | * Check if contains arc types chart
|
31737 | * @param {object} targets Target data
|
31738 | * @param {Array} exclude Excluded types
|
31739 | * @returns {boolean}
|
31740 | * @private
|
31741 | */
|
31742 | hasArcType: function hasArcType(targets, exclude) {
|
31743 | return this.hasTypeOf("Arc", targets, exclude);
|
31744 | },
|
31745 | hasMultiArcGauge: function hasMultiArcGauge() {
|
31746 | return this.hasType("gauge") && this.config.gauge_type === "multi";
|
31747 | },
|
31748 | isLineType: function isLineType(d) {
|
31749 | var id = isString(d) ? d : d.id;
|
31750 | return !this.config.data_types[id] || this.isTypeOf(id, TYPE_BY_CATEGORY.Line);
|
31751 | },
|
31752 | isStepType: function isStepType(d) {
|
31753 | return this.isTypeOf(d, TYPE_BY_CATEGORY.Step);
|
31754 | },
|
31755 | isSplineType: function isSplineType(d) {
|
31756 | return this.isTypeOf(d, TYPE_BY_CATEGORY.Spline);
|
31757 | },
|
31758 | isAreaType: function isAreaType(d) {
|
31759 | return this.isTypeOf(d, TYPE_BY_CATEGORY.Area);
|
31760 | },
|
31761 | isAreaRangeType: function isAreaRangeType(d) {
|
31762 | return this.isTypeOf(d, TYPE_BY_CATEGORY.AreaRange);
|
31763 | },
|
31764 | isBarType: function isBarType(d) {
|
31765 | return this.isTypeOf(d, "bar");
|
31766 | },
|
31767 | isBubbleType: function isBubbleType(d) {
|
31768 | return this.isTypeOf(d, "bubble");
|
31769 | },
|
31770 | isCandlestickType: function isCandlestickType(d) {
|
31771 | return this.isTypeOf(d, "candlestick");
|
31772 | },
|
31773 | isScatterType: function isScatterType(d) {
|
31774 | return this.isTypeOf(d, "scatter");
|
31775 | },
|
31776 | isPieType: function isPieType(d) {
|
31777 | return this.isTypeOf(d, "pie");
|
31778 | },
|
31779 | isGaugeType: function isGaugeType(d) {
|
31780 | return this.isTypeOf(d, "gauge");
|
31781 | },
|
31782 | isDonutType: function isDonutType(d) {
|
31783 | return this.isTypeOf(d, "donut");
|
31784 | },
|
31785 | isRadarType: function isRadarType(d) {
|
31786 | return this.isTypeOf(d, "radar");
|
31787 | },
|
31788 | isArcType: function isArcType(d) {
|
31789 | return this.isPieType(d) || this.isDonutType(d) || this.isGaugeType(d) || this.isRadarType(d);
|
31790 | },
|
31791 | // determine if is 'circle' data point
|
31792 | isCirclePoint: function isCirclePoint(node) {
|
31793 | var config = this.config,
|
31794 | pattern = config.point_pattern,
|
31795 | isCircle = !1;
|
31796 |
|
31797 | if ((node == null ? void 0 : node.tagName) === "circle") {
|
31798 | isCircle = !0;
|
31799 | } else {
|
31800 | isCircle = config.point_type === "circle" && (!pattern || isArray(pattern) && pattern.length === 0);
|
31801 | }
|
31802 |
|
31803 | return isCircle;
|
31804 | },
|
31805 | lineData: function lineData(d) {
|
31806 | return this.isLineType(d) ? [d] : [];
|
31807 | },
|
31808 | arcData: function arcData(d) {
|
31809 | return this.isArcType(d.data) ? [d] : [];
|
31810 | },
|
31811 |
|
31812 | /**
|
31813 | * Get data adapt for data label showing
|
31814 | * @param {object} d Data object
|
31815 | * @returns {Array}
|
31816 | * @private
|
31817 | */
|
31818 | labelishData: function labelishData(d) {
|
31819 | return this.isBarType(d) || this.isLineType(d) || this.isScatterType(d) || this.isBubbleType(d) || this.isCandlestickType(d) || this.isRadarType(d) ? d.values.filter(function (v) {
|
31820 | return isNumber(v.value) || !!v.value;
|
31821 | }) : [];
|
31822 | },
|
31823 | barLineBubbleData: function barLineBubbleData(d) {
|
31824 | return this.isBarType(d) || this.isLineType(d) || this.isBubbleType(d) ? d.values : [];
|
31825 | },
|
31826 | // https://github.com/d3/d3-shape#curves
|
31827 | isInterpolationType: function isInterpolationType(type) {
|
31828 | 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;
|
31829 | }
|
31830 | });
|
31831 | ;// CONCATENATED MODULE: ./src/ChartInternal/ChartInternal.ts
|
31832 | /**
|
31833 | * Copyright (c) 2017 ~ present NAVER Corp.
|
31834 | * billboard.js project is licensed under the MIT license
|
31835 | * @ignore
|
31836 | */
|
31837 |
|
31838 |
|
31839 |
|
31840 |
|
31841 |
|
31842 |
|
31843 |
|
31844 |
|
31845 |
|
31846 | // data
|
31847 |
|
31848 |
|
31849 |
|
31850 | // interactions
|
31851 |
|
31852 | // internals
|
31853 |
|
31854 |
|
31855 | // used to retrieve radar Axis name
|
31856 |
|
31857 |
|
31858 |
|
31859 |
|
31860 |
|
31861 |
|
31862 |
|
31863 |
|
31864 |
|
31865 |
|
31866 |
|
31867 |
|
31868 |
|
31869 |
|
31870 | /**
|
31871 | * Internal chart class.
|
31872 | * - Note: Instantiated internally, not exposed for public.
|
31873 | * @class ChartInternal
|
31874 | * @ignore
|
31875 | * @private
|
31876 | */
|
31877 |
|
31878 | var ChartInternal = /*#__PURE__*/function () {
|
31879 | // API interface
|
31880 | // config object
|
31881 | // cache instance
|
31882 | // elements
|
31883 | // state variables
|
31884 | // all Chart instances array within page (equivalent of 'bb.instances')
|
31885 | // data object
|
31886 | // Axis
|
31887 | // Axis
|
31888 | // scales
|
31889 | // original values
|
31890 | // formatter function
|
31891 | // format function
|
31892 | function ChartInternal(api) {
|
31893 | this.api = void 0;
|
31894 | this.config = void 0;
|
31895 | this.cache = void 0;
|
31896 | this.$el = void 0;
|
31897 | this.state = void 0;
|
31898 | this.charts = void 0;
|
31899 | this.data = {
|
31900 | xs: {},
|
31901 | targets: []
|
31902 | };
|
31903 | this.axis = void 0;
|
31904 | this.scale = {
|
31905 | x: null,
|
31906 | y: null,
|
31907 | y2: null,
|
31908 | subX: null,
|
31909 | subY: null,
|
31910 | subY2: null,
|
31911 | zoom: null
|
31912 | };
|
31913 | this.org = {
|
31914 | xScale: null,
|
31915 | xDomain: null
|
31916 | };
|
31917 | this.color = void 0;
|
31918 | this.patterns = void 0;
|
31919 | this.levelColor = void 0;
|
31920 | this.point = void 0;
|
31921 | this.brush = void 0;
|
31922 | this.format = {
|
31923 | extraLineClasses: null,
|
31924 | xAxisTick: null,
|
31925 | dataTime: null,
|
31926 | // dataTimeFormat
|
31927 | defaultAxisTime: null,
|
31928 | // defaultAxisTimeFormat
|
31929 | axisTime: null // axisTimeFormat
|
31930 |
|
31931 | };
|
31932 | var $$ = this;
|
31933 | $$.api = api; // Chart class instance alias
|
31934 |
|
31935 | $$.config = new Options();
|
31936 | $$.cache = new Cache();
|
31937 | var store = new Store();
|
31938 | $$.$el = store.getStore("element");
|
31939 | $$.state = store.getStore("state");
|
31940 | $$.$T = $$.$T.bind($$);
|
31941 | }
|
31942 | /**
|
31943 | * Get the selection based on transition config
|
31944 | * @param {SVGElement|d3Selection} selection Target selection
|
31945 | * @param {boolean} force Force transition
|
31946 | * @param {string} name Transition name
|
31947 | * @returns {d3Selection}
|
31948 | * @private
|
31949 | */
|
31950 |
|
31951 |
|
31952 | var _proto = ChartInternal.prototype;
|
31953 |
|
31954 | _proto.$T = function $T(selection, force, name) {
|
31955 | var config = this.config,
|
31956 | state = this.state,
|
31957 | duration = config.transition_duration,
|
31958 | subchart = config.subchart_show,
|
31959 | t = selection;
|
31960 |
|
31961 | if (t) {
|
31962 | // in case of non d3 selection, wrap with d3 selection
|
31963 | if ("tagName" in t) {
|
31964 | t = src_select(t);
|
31965 | } // do not transit on:
|
31966 | // - wheel zoom (state.zooming = true)
|
31967 | // - when has no subchart
|
31968 | // - initialization
|
31969 | // - resizing
|
31970 |
|
31971 |
|
31972 | var transit = (force !== !1 && duration || force) && (!state.zooming || state.dragging) && !state.resizing && state.rendered && !subchart;
|
31973 | t = transit ? t.transition(name).duration(duration) : t;
|
31974 | }
|
31975 |
|
31976 | return t;
|
31977 | };
|
31978 |
|
31979 | _proto.beforeInit = function beforeInit() {
|
31980 | var $$ = this;
|
31981 | $$.callPluginHook("$beforeInit"); // can do something
|
31982 |
|
31983 | callFn($$.config.onbeforeinit, $$.api);
|
31984 | };
|
31985 |
|
31986 | _proto.afterInit = function afterInit() {
|
31987 | var $$ = this;
|
31988 | $$.callPluginHook("$afterInit"); // can do something
|
31989 |
|
31990 | callFn($$.config.onafterinit, $$.api);
|
31991 | };
|
31992 |
|
31993 | _proto.init = function init() {
|
31994 | var $$ = this,
|
31995 | config = $$.config,
|
31996 | state = $$.state,
|
31997 | $el = $$.$el;
|
31998 | checkModuleImport($$);
|
31999 | state.hasAxis = !$$.hasArcType();
|
32000 | state.hasRadar = !state.hasAxis && $$.hasType("radar");
|
32001 | $$.initParams();
|
32002 | var bindto = {
|
32003 | element: config.bindto,
|
32004 | classname: "bb"
|
32005 | };
|
32006 |
|
32007 | if (isObject(config.bindto)) {
|
32008 | bindto.element = config.bindto.element || "#chart";
|
32009 | bindto.classname = config.bindto.classname || bindto.classname;
|
32010 | } // select bind element
|
32011 |
|
32012 |
|
32013 | $el.chart = isFunction(bindto.element.node) ? config.bindto.element : src_select(bindto.element || []);
|
32014 |
|
32015 | if ($el.chart.empty()) {
|
32016 | $el.chart = src_select(browser_doc.body.appendChild(browser_doc.createElement("div")));
|
32017 | }
|
32018 |
|
32019 | $el.chart.html("").classed(bindto.classname, !0);
|
32020 | $$.initToRender();
|
32021 | }
|
32022 | /**
|
32023 | * Initialize the rendering process
|
32024 | * @param {boolean} forced Force to render process
|
32025 | * @private
|
32026 | */
|
32027 | ;
|
32028 |
|
32029 | _proto.initToRender = function initToRender(forced) {
|
32030 | var $$ = this,
|
32031 | config = $$.config,
|
32032 | state = $$.state,
|
32033 | chart = $$.$el.chart,
|
32034 | isHidden = function () {
|
32035 | return chart.style("display") === "none" || chart.style("visibility") === "hidden";
|
32036 | },
|
32037 | isLazy = config.render.lazy || isHidden(),
|
32038 | MutationObserver = win.MutationObserver;
|
32039 |
|
32040 | if (isLazy && MutationObserver && config.render.observe !== !1 && !forced) {
|
32041 | new MutationObserver(function (mutation, observer) {
|
32042 | if (!isHidden()) {
|
32043 | observer.disconnect();
|
32044 | state.rendered || $$.initToRender(!0);
|
32045 | }
|
32046 | }).observe(chart.node(), {
|
32047 | attributes: !0,
|
32048 | attributeFilter: ["class", "style"]
|
32049 | });
|
32050 | }
|
32051 |
|
32052 | if (!isLazy || forced) {
|
32053 | var convertedData = $$.convertData(config, $$.initWithData);
|
32054 | convertedData && $$.initWithData(convertedData);
|
32055 | $$.afterInit();
|
32056 | }
|
32057 | };
|
32058 |
|
32059 | _proto.initParams = function initParams() {
|
32060 | var $$ = this,
|
32061 | _ref = $$,
|
32062 | config = _ref.config,
|
32063 | format = _ref.format,
|
32064 | state = _ref.state,
|
32065 | isRotated = config.axis_rotated;
|
32066 | // datetime to be used for uniqueness
|
32067 | state.datetimeId = "bb-" + +new Date();
|
32068 | $$.color = $$.generateColor();
|
32069 | $$.levelColor = $$.generateLevelColor();
|
32070 |
|
32071 | if ($$.hasPointType()) {
|
32072 | $$.point = $$.generatePoint();
|
32073 | }
|
32074 |
|
32075 | if (state.hasAxis) {
|
32076 | $$.initClip();
|
32077 | format.extraLineClasses = $$.generateExtraLineClass();
|
32078 | format.dataTime = config.data_xLocaltime ? timeParse : utcParse;
|
32079 | format.axisTime = config.axis_x_localtime ? timeFormat : utcFormat;
|
32080 | var isDragZoom = $$.config.zoom_enabled && $$.config.zoom_type === "drag";
|
32081 |
|
32082 | format.defaultAxisTime = function (d) {
|
32083 | var _$$$scale = $$.scale,
|
32084 | x = _$$$scale.x,
|
32085 | zoom = _$$$scale.zoom,
|
32086 | isZoomed = isDragZoom ? zoom : zoom && x.orgDomain().toString() !== zoom.domain().toString(),
|
32087 | 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";
|
32088 | return format.axisTime(specifier)(d);
|
32089 | };
|
32090 | }
|
32091 |
|
32092 | state.isLegendRight = config.legend_position === "right";
|
32093 | state.isLegendInset = config.legend_position === "inset";
|
32094 | state.isLegendTop = config.legend_inset_anchor === "top-left" || config.legend_inset_anchor === "top-right";
|
32095 | state.isLegendLeft = config.legend_inset_anchor === "top-left" || config.legend_inset_anchor === "bottom-left";
|
32096 | state.rotatedPaddingRight = isRotated && !config.axis_x_show ? 0 : 30;
|
32097 | state.inputType = convertInputType(config.interaction_inputType_mouse, config.interaction_inputType_touch);
|
32098 | };
|
32099 |
|
32100 | _proto.initWithData = function initWithData(data) {
|
32101 | var $$ = this,
|
32102 | config = $$.config,
|
32103 | scale = $$.scale,
|
32104 | state = $$.state,
|
32105 | $el = $$.$el,
|
32106 | org = $$.org,
|
32107 | hasAxis = state.hasAxis,
|
32108 | hasInteraction = config.interaction_enabled;
|
32109 |
|
32110 | // for arc type, set axes to not be shown
|
32111 | // $$.hasArcType() && ["x", "y", "y2"].forEach(id => (config[`axis_${id}_show`] = false));
|
32112 | if (hasAxis) {
|
32113 | $$.axis = $$.getAxisInstance();
|
32114 | config.zoom_enabled && $$.initZoom();
|
32115 | } // Init data as targets
|
32116 |
|
32117 |
|
32118 | $$.data.xs = {};
|
32119 | $$.data.targets = $$.convertDataToTargets(data);
|
32120 |
|
32121 | if (config.data_filter) {
|
32122 | $$.data.targets = $$.data.targets.filter(config.data_filter.bind($$.api));
|
32123 | } // Set targets to hide if needed
|
32124 |
|
32125 |
|
32126 | if (config.data_hide) {
|
32127 | $$.addHiddenTargetIds(config.data_hide === !0 ? $$.mapToIds($$.data.targets) : config.data_hide);
|
32128 | }
|
32129 |
|
32130 | if (config.legend_hide) {
|
32131 | $$.addHiddenLegendIds(config.legend_hide === !0 ? $$.mapToIds($$.data.targets) : config.legend_hide);
|
32132 | } // Init sizes and scales
|
32133 |
|
32134 |
|
32135 | $$.updateSizes();
|
32136 | $$.updateScales(!0); // retrieve scale after the 'updateScales()' is called
|
32137 |
|
32138 | var x = scale.x,
|
32139 | y = scale.y,
|
32140 | y2 = scale.y2,
|
32141 | subX = scale.subX,
|
32142 | subY = scale.subY,
|
32143 | subY2 = scale.subY2; // Set domains for each scale
|
32144 |
|
32145 | if (x) {
|
32146 | x.domain(sortValue($$.getXDomain($$.data.targets)));
|
32147 | subX.domain(x.domain()); // Save original x domain for zoom update
|
32148 |
|
32149 | org.xDomain = x.domain();
|
32150 | }
|
32151 |
|
32152 | if (y) {
|
32153 | y.domain($$.getYDomain($$.data.targets, "y"));
|
32154 | subY.domain(y.domain());
|
32155 | }
|
32156 |
|
32157 | if (y2) {
|
32158 | y2.domain($$.getYDomain($$.data.targets, "y2"));
|
32159 | subY2 && subY2.domain(y2.domain());
|
32160 | } // -- Basic Elements --
|
32161 |
|
32162 |
|
32163 | $el.svg = $el.chart.append("svg").style("overflow", "hidden").style("display", "block");
|
32164 |
|
32165 | if (hasInteraction && state.inputType) {
|
32166 | var isTouch = state.inputType === "touch";
|
32167 | $el.svg.on(isTouch ? "touchstart" : "mouseenter", function () {
|
32168 | return callFn(config.onover, $$.api);
|
32169 | }).on(isTouch ? "touchend" : "mouseleave", function () {
|
32170 | return callFn(config.onout, $$.api);
|
32171 | });
|
32172 | }
|
32173 |
|
32174 | config.svg_classname && $el.svg.attr("class", config.svg_classname); // Define defs
|
32175 |
|
32176 | var hasColorPatterns = isFunction(config.color_tiles) && $$.patterns;
|
32177 |
|
32178 | if (hasAxis || hasColorPatterns || config.data_labels_backgroundColors) {
|
32179 | $el.defs = $el.svg.append("defs");
|
32180 |
|
32181 | if (hasAxis) {
|
32182 | ["id", "idXAxis", "idYAxis", "idGrid"].forEach(function (v) {
|
32183 | $$.appendClip($el.defs, state.clip[v]);
|
32184 | });
|
32185 | } // Append data backgound color filter definition
|
32186 |
|
32187 |
|
32188 | $$.generateDataLabelBackgroundColorFilter(); // set color patterns
|
32189 |
|
32190 | if (hasColorPatterns) {
|
32191 | $$.patterns.forEach(function (p) {
|
32192 | return $el.defs.append(function () {
|
32193 | return p.node;
|
32194 | });
|
32195 | });
|
32196 | }
|
32197 | }
|
32198 |
|
32199 | $$.updateSvgSize(); // Bind resize event
|
32200 |
|
32201 | $$.bindResize(); // Define regions
|
32202 |
|
32203 | var main = $el.svg.append("g").classed(config_classes.main, !0).attr("transform", $$.getTranslate("main"));
|
32204 | $el.main = main; // initialize subchart when subchart show option is set
|
32205 |
|
32206 | config.subchart_show && $$.initSubchart();
|
32207 | config.tooltip_show && $$.initTooltip();
|
32208 | config.title_text && $$.initTitle();
|
32209 | config.legend_show && $$.initLegend(); // -- Main Region --
|
32210 | // text when empty
|
32211 |
|
32212 | if (config.data_empty_label_text) {
|
32213 | 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.
|
32214 | .attr("dominant-baseline", "middle"); // vertical centering of text at y position in all browsers, except IE.
|
32215 | }
|
32216 |
|
32217 | if (hasAxis) {
|
32218 | // Regions
|
32219 | config.regions.length && $$.initRegion(); // Add Axis here, when clipPath is 'false'
|
32220 |
|
32221 | config.clipPath || $$.axis.init();
|
32222 | } // Define g for chart area
|
32223 |
|
32224 |
|
32225 | main.append("g").attr("class", config_classes.chart).attr("clip-path", state.clip.path);
|
32226 | $$.callPluginHook("$init");
|
32227 |
|
32228 | if (hasAxis) {
|
32229 | var _$$$axis;
|
32230 |
|
32231 | // Cover whole with rects for events
|
32232 | hasInteraction && ($$.initEventRect == null ? void 0 : $$.initEventRect()); // Grids
|
32233 |
|
32234 | $$.initGrid(); // Add Axis here, when clipPath is 'true'
|
32235 |
|
32236 | config.clipPath && ((_$$$axis = $$.axis) == null ? void 0 : _$$$axis.init());
|
32237 | }
|
32238 |
|
32239 | $$.initChartElements(); // Set targets
|
32240 |
|
32241 | $$.updateTargets($$.data.targets); // Draw with targets
|
32242 |
|
32243 | $$.updateDimension(); // oninit callback
|
32244 |
|
32245 | callFn(config.oninit, $$.api); // Set background
|
32246 |
|
32247 | $$.setBackground();
|
32248 | $$.redraw({
|
32249 | withTransition: !1,
|
32250 | withTransform: !0,
|
32251 | withUpdateXDomain: !0,
|
32252 | withUpdateOrgXDomain: !0,
|
32253 | withTransitionForAxis: !1,
|
32254 | initializing: !0
|
32255 | }); // data.onmin/max callback
|
32256 |
|
32257 | if (config.data_onmin || config.data_onmax) {
|
32258 | var minMax = $$.getMinMaxData();
|
32259 | callFn(config.data_onmin, $$.api, minMax.min);
|
32260 | callFn(config.data_onmax, $$.api, minMax.max);
|
32261 | }
|
32262 |
|
32263 | config.tooltip_show && $$.initShowTooltip();
|
32264 | state.rendered = !0;
|
32265 | }
|
32266 | /**
|
32267 | * Initialize chart elements
|
32268 | * @private
|
32269 | */
|
32270 | ;
|
32271 |
|
32272 | _proto.initChartElements = function initChartElements() {
|
32273 | var $$ = this,
|
32274 | _$$$state = $$.state,
|
32275 | hasAxis = _$$$state.hasAxis,
|
32276 | hasRadar = _$$$state.hasRadar,
|
32277 | types = [];
|
32278 |
|
32279 | if (hasAxis) {
|
32280 | ["bar", "bubble", "candlestick", "line"].forEach(function (v) {
|
32281 | var name = capitalize(v);
|
32282 |
|
32283 | if (v === "line" && $$.hasTypeOf(name) || $$.hasType(v)) {
|
32284 | types.push(name);
|
32285 | }
|
32286 | });
|
32287 | } else {
|
32288 | if (!hasRadar) {
|
32289 | types.push("Arc", "Pie");
|
32290 | }
|
32291 |
|
32292 | if ($$.hasType("gauge")) {
|
32293 | types.push("Gauge");
|
32294 | } else if (hasRadar) {
|
32295 | types.push("Radar");
|
32296 | }
|
32297 | }
|
32298 |
|
32299 | types.forEach(function (v) {
|
32300 | $$["init" + v]();
|
32301 | });
|
32302 | notEmpty($$.config.data_labels) && !$$.hasArcType(null, ["radar"]) && $$.initText();
|
32303 | }
|
32304 | /**
|
32305 | * Set chart elements
|
32306 | * @private
|
32307 | */
|
32308 | ;
|
32309 |
|
32310 | _proto.setChartElements = function setChartElements() {
|
32311 | var $$ = this,
|
32312 | _$$$$el = $$.$el,
|
32313 | chart = _$$$$el.chart,
|
32314 | svg = _$$$$el.svg,
|
32315 | defs = _$$$$el.defs,
|
32316 | main = _$$$$el.main,
|
32317 | tooltip = _$$$$el.tooltip,
|
32318 | legend = _$$$$el.legend,
|
32319 | title = _$$$$el.title,
|
32320 | grid = _$$$$el.grid,
|
32321 | arc = _$$$$el.arcs,
|
32322 | circles = _$$$$el.circle,
|
32323 | bars = _$$$$el.bar,
|
32324 | candlestick = _$$$$el.candlestick,
|
32325 | lines = _$$$$el.line,
|
32326 | areas = _$$$$el.area,
|
32327 | texts = _$$$$el.text;
|
32328 | $$.api.$ = {
|
32329 | chart: chart,
|
32330 | svg: svg,
|
32331 | defs: defs,
|
32332 | main: main,
|
32333 | tooltip: tooltip,
|
32334 | legend: legend,
|
32335 | title: title,
|
32336 | grid: grid,
|
32337 | arc: arc,
|
32338 | circles: circles,
|
32339 | bar: {
|
32340 | bars: bars
|
32341 | },
|
32342 | candlestick: candlestick,
|
32343 | line: {
|
32344 | lines: lines,
|
32345 | areas: areas
|
32346 | },
|
32347 | text: {
|
32348 | texts: texts
|
32349 | }
|
32350 | };
|
32351 | }
|
32352 | /**
|
32353 | * Set background element/image
|
32354 | * @private
|
32355 | */
|
32356 | ;
|
32357 |
|
32358 | _proto.setBackground = function setBackground() {
|
32359 | var $$ = this,
|
32360 | bg = $$.config.background,
|
32361 | state = $$.state,
|
32362 | svg = $$.$el.svg;
|
32363 |
|
32364 | if (notEmpty(bg)) {
|
32365 | var element = svg.select("g").insert(bg.imgUrl ? "image" : "rect", ":first-child");
|
32366 |
|
32367 | if (bg.imgUrl) {
|
32368 | element.attr("href", bg.imgUrl);
|
32369 | } else if (bg.color) {
|
32370 | element.style("fill", bg.color).attr("clip-path", state.clip.path);
|
32371 | }
|
32372 |
|
32373 | element.attr("class", bg.class || null).attr("width", "100%").attr("height", "100%");
|
32374 | }
|
32375 | }
|
32376 | /**
|
32377 | * Update targeted element with given data
|
32378 | * @param {object} targets Data object formatted as 'target'
|
32379 | * @private
|
32380 | */
|
32381 | ;
|
32382 |
|
32383 | _proto.updateTargets = function updateTargets(targets) {
|
32384 | var $$ = this,
|
32385 | _$$$state2 = $$.state,
|
32386 | hasAxis = _$$$state2.hasAxis,
|
32387 | hasRadar = _$$$state2.hasRadar;
|
32388 | // Text
|
32389 | $$.updateTargetsForText(targets);
|
32390 |
|
32391 | if (hasAxis) {
|
32392 | ["bar", "candlestick", "line"].forEach(function (v) {
|
32393 | var name = capitalize(v);
|
32394 |
|
32395 | if (v === "line" && $$.hasTypeOf(name) || $$.hasType(v)) {
|
32396 | $$["updateTargetsFor" + name](targets.filter($$["is" + name + "Type"].bind($$)));
|
32397 | }
|
32398 | }); // Sub Chart
|
32399 |
|
32400 | $$.updateTargetsForSubchart && $$.updateTargetsForSubchart(targets);
|
32401 | } else {
|
32402 | // Arc & Radar
|
32403 | $$.hasArcType(targets) && (hasRadar ? $$.updateTargetsForRadar(targets.filter($$.isRadarType.bind($$))) : $$.updateTargetsForArc(targets.filter($$.isArcType.bind($$))));
|
32404 | } // circle
|
32405 |
|
32406 |
|
32407 | if ($$.hasType("bubble") || $$.hasType("scatter")) {
|
32408 | $$.updateTargetForCircle == null ? void 0 : $$.updateTargetForCircle();
|
32409 | } // Fade-in each chart
|
32410 |
|
32411 |
|
32412 | $$.showTargets();
|
32413 | }
|
32414 | /**
|
32415 | * Display targeted elements
|
32416 | * @private
|
32417 | */
|
32418 | ;
|
32419 |
|
32420 | _proto.showTargets = function showTargets() {
|
32421 | var $$ = this,
|
32422 | svg = $$.$el.svg,
|
32423 | $T = $$.$T;
|
32424 | $T(svg.selectAll("." + config_classes.target).filter(function (d) {
|
32425 | return $$.isTargetToShow(d.id);
|
32426 | })).style("opacity", null);
|
32427 | };
|
32428 |
|
32429 | _proto.getWithOption = function getWithOption(options) {
|
32430 | var withOptions = {
|
32431 | Dimension: !0,
|
32432 | EventRect: !0,
|
32433 | Legend: !1,
|
32434 | Subchart: !0,
|
32435 | Transform: !1,
|
32436 | Transition: !0,
|
32437 | TrimXDomain: !0,
|
32438 | UpdateXAxis: "UpdateXDomain",
|
32439 | UpdateXDomain: !1,
|
32440 | UpdateOrgXDomain: !1,
|
32441 | TransitionForExit: "Transition",
|
32442 | TransitionForAxis: "Transition",
|
32443 | Y: !0
|
32444 | };
|
32445 | Object.keys(withOptions).forEach(function (key) {
|
32446 | var defVal = withOptions[key];
|
32447 |
|
32448 | if (isString(defVal)) {
|
32449 | defVal = withOptions[defVal];
|
32450 | }
|
32451 |
|
32452 | withOptions[key] = getOption(options, "with" + key, defVal);
|
32453 | });
|
32454 | return withOptions;
|
32455 | };
|
32456 |
|
32457 | _proto.initialOpacity = function initialOpacity(d) {
|
32458 | var $$ = this,
|
32459 | withoutFadeIn = $$.state.withoutFadeIn;
|
32460 | return $$.getBaseValue(d) !== null && withoutFadeIn[d.id] ? null : "0";
|
32461 | };
|
32462 |
|
32463 | _proto.bindResize = function bindResize() {
|
32464 | var $$ = this,
|
32465 | config = $$.config,
|
32466 | state = $$.state,
|
32467 | resizeFunction = generateResize(),
|
32468 | list = [];
|
32469 | list.push(function () {
|
32470 | return callFn(config.onresize, $$, $$.api);
|
32471 | });
|
32472 |
|
32473 | if (config.resize_auto) {
|
32474 | list.push(function () {
|
32475 | state.resizing = !0;
|
32476 | $$.api.flush(!1);
|
32477 | });
|
32478 | }
|
32479 |
|
32480 | list.push(function () {
|
32481 | callFn(config.onresized, $$, $$.api);
|
32482 | state.resizing = !1;
|
32483 | }); // add resize functions
|
32484 |
|
32485 | list.forEach(function (v) {
|
32486 | return resizeFunction.add(v);
|
32487 | });
|
32488 | $$.resizeFunction = resizeFunction; // attach resize event
|
32489 |
|
32490 | win.addEventListener("resize", $$.resizeFunction = resizeFunction);
|
32491 | }
|
32492 | /**
|
32493 | * Call plugin hook
|
32494 | * @param {string} phase The lifecycle phase
|
32495 | * @param {Array} args Arguments
|
32496 | * @private
|
32497 | */
|
32498 | ;
|
32499 |
|
32500 | _proto.callPluginHook = function callPluginHook(phase) {
|
32501 | for (var _this = this, _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
32502 | args[_key - 1] = arguments[_key];
|
32503 | }
|
32504 |
|
32505 | this.config.plugins.forEach(function (v) {
|
32506 | if (phase === "$beforeInit") {
|
32507 | v.$$ = _this;
|
32508 |
|
32509 | _this.api.plugins.push(v);
|
32510 | }
|
32511 |
|
32512 | v[phase].apply(v, args);
|
32513 | });
|
32514 | };
|
32515 |
|
32516 | return ChartInternal;
|
32517 | }();
|
32518 |
|
32519 |
|
32520 | util_extend(ChartInternal.prototype, [// common
|
32521 | 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]);
|
32522 | ;// CONCATENATED MODULE: ./src/config/config.ts
|
32523 | /**
|
32524 | * Copyright (c) 2017 ~ present NAVER Corp.
|
32525 | * billboard.js project is licensed under the MIT license
|
32526 | */
|
32527 |
|
32528 |
|
32529 | /**
|
32530 | * Load configuration option
|
32531 | * @param {object} config User's generation config value
|
32532 | * @private
|
32533 | */
|
32534 | function loadConfig(config) {
|
32535 | var thisConfig = this.config,
|
32536 | target,
|
32537 | keys,
|
32538 | read,
|
32539 | find = function () {
|
32540 | var key = keys.shift();
|
32541 |
|
32542 | if (key && target && isObjectType(target) && key in target) {
|
32543 | target = target[key];
|
32544 | return find();
|
32545 | } else if (!key) {
|
32546 | return target;
|
32547 | }
|
32548 |
|
32549 | return undefined;
|
32550 | };
|
32551 |
|
32552 | Object.keys(thisConfig).forEach(function (key) {
|
32553 | target = config;
|
32554 | keys = key.split("_");
|
32555 | read = find();
|
32556 |
|
32557 | if (isDefined(read)) {
|
32558 | thisConfig[key] = read;
|
32559 | }
|
32560 | });
|
32561 | }
|
32562 | ;// CONCATENATED MODULE: ./src/Chart/api/chart.ts
|
32563 | /**
|
32564 | * Copyright (c) 2017 ~ present NAVER Corp.
|
32565 | * billboard.js project is licensed under the MIT license
|
32566 | */
|
32567 |
|
32568 |
|
32569 | /* harmony default export */ var chart = ({
|
32570 | /**
|
32571 | * Resize the chart.
|
32572 | * @function resize
|
32573 | * @instance
|
32574 | * @memberof Chart
|
32575 | * @param {object} size This argument should include width and height in pixels.
|
32576 | * @param {number} [size.width] width value
|
32577 | * @param {number} [size.height] height value
|
32578 | * @example
|
32579 | * // Resize to 640x480
|
32580 | * chart.resize({
|
32581 | * width: 640,
|
32582 | * height: 480
|
32583 | * });
|
32584 | */
|
32585 | resize: function resize(size) {
|
32586 | var $$ = this.internal,
|
32587 | config = $$.config,
|
32588 | state = $$.state;
|
32589 |
|
32590 | if (state.rendered) {
|
32591 | config.size_width = size ? size.width : null;
|
32592 | config.size_height = size ? size.height : null;
|
32593 | state.resizing = !0;
|
32594 | this.flush(!1, !0);
|
32595 | $$.resizeFunction();
|
32596 | }
|
32597 | },
|
32598 |
|
32599 | /**
|
32600 | * Force to redraw.
|
32601 | * - **NOTE:** When zoom/subchart is used, the zoomed state will be resetted.
|
32602 | * @function flush
|
32603 | * @instance
|
32604 | * @memberof Chart
|
32605 | * @param {boolean} [soft] For soft redraw.
|
32606 | * @example
|
32607 | * chart.flush();
|
32608 | *
|
32609 | * // for soft redraw
|
32610 | * chart.flush(true);
|
32611 | */
|
32612 | flush: function flush(soft) {
|
32613 | var $$ = this.internal,
|
32614 | state = $$.state,
|
32615 | zoomResetBtn = $$.$el.zoomResetBtn;
|
32616 |
|
32617 | if (state.rendered) {
|
32618 | var _zoomResetBtn;
|
32619 |
|
32620 | // reset possible zoom scale when is called from resize event
|
32621 | // eslint-disable-next-line prefer-rest-params
|
32622 | if (state.resizing) {
|
32623 | var _$$$brush;
|
32624 |
|
32625 | // arguments[1] is given when is called from resize
|
32626 | (_$$$brush = $$.brush) == null ? void 0 : _$$$brush.updateResize();
|
32627 | } else {
|
32628 | var _$$$axis;
|
32629 |
|
32630 | // re-update config info
|
32631 | (_$$$axis = $$.axis) == null ? void 0 : _$$$axis.setOrient();
|
32632 | } // hide possible reset zoom button
|
32633 | // https://github.com/naver/billboard.js/issues/2201
|
32634 |
|
32635 |
|
32636 | (_zoomResetBtn = zoomResetBtn) == null ? void 0 : _zoomResetBtn.style("display", "none");
|
32637 | $$.scale.zoom = null;
|
32638 | soft ? $$.redraw({
|
32639 | withTransform: !0,
|
32640 | withUpdateXDomain: !0,
|
32641 | withUpdateOrgXDomain: !0,
|
32642 | withLegend: !0
|
32643 | }) : $$.updateAndRedraw({
|
32644 | withLegend: !0,
|
32645 | withTransition: !1,
|
32646 | withTransitionForTransform: !1
|
32647 | }); // reset subchart selection & selection state
|
32648 |
|
32649 | if (!state.resizing && $$.brush) {
|
32650 | $$.brush.getSelection().call($$.brush.move);
|
32651 | $$.unselectRect();
|
32652 | }
|
32653 | } else {
|
32654 | $$.initToRender(!0);
|
32655 | }
|
32656 | },
|
32657 |
|
32658 | /**
|
32659 | * Reset the chart object and remove element and events completely.
|
32660 | * @function destroy
|
32661 | * @instance
|
32662 | * @memberof Chart
|
32663 | * @returns {null}
|
32664 | * @example
|
32665 | * chart.destroy();
|
32666 | */
|
32667 | destroy: function destroy() {
|
32668 | var _this = this,
|
32669 | $$ = this.internal,
|
32670 | _$$$$el = $$.$el,
|
32671 | chart = _$$$$el.chart,
|
32672 | svg = _$$$$el.svg;
|
32673 |
|
32674 | if (notEmpty($$)) {
|
32675 | $$.callPluginHook("$willDestroy");
|
32676 | $$.charts.splice($$.charts.indexOf(this), 1); // clear timers && pending transition
|
32677 |
|
32678 | svg.select("*").interrupt();
|
32679 | $$.resizeFunction.clear();
|
32680 | win.removeEventListener("resize", $$.resizeFunction);
|
32681 | chart.classed("bb", !1).html(""); // releasing own references
|
32682 |
|
32683 | Object.keys(this).forEach(function (key) {
|
32684 | key === "internal" && Object.keys($$).forEach(function (k) {
|
32685 | $$[k] = null;
|
32686 | });
|
32687 | _this[key] = null;
|
32688 | delete _this[key];
|
32689 | }); // release prototype chains
|
32690 |
|
32691 | for (var key in this) {
|
32692 | this[key] = function () {};
|
32693 | }
|
32694 | }
|
32695 |
|
32696 | return null;
|
32697 | },
|
32698 |
|
32699 | /**
|
32700 | * Get or set single config option value.
|
32701 | * @function config
|
32702 | * @instance
|
32703 | * @memberof Chart
|
32704 | * @param {string} name The option key name.
|
32705 | * @param {*} [value] The value accepted for indicated option.
|
32706 | * @param {boolean} [redraw] Set to redraw with the new option changes.
|
32707 | * - **NOTE:** Doesn't guarantee work in all circumstances. It can be applied for limited options only.
|
32708 | * @returns {*}
|
32709 | * @example
|
32710 | * // Getter
|
32711 | * chart.config("gauge.max");
|
32712 | *
|
32713 | * // Setter
|
32714 | * chart.config("gauge.max", 100);
|
32715 | *
|
32716 | * // Setter & redraw with the new option
|
32717 | * chart.config("gauge.max", 100, true);
|
32718 | */
|
32719 | config: function (name, value, redraw) {
|
32720 | var $$ = this.internal,
|
32721 | config = $$.config,
|
32722 | key = name == null ? void 0 : name.replace(/\./g, "_"),
|
32723 | res;
|
32724 |
|
32725 | if (key in config) {
|
32726 | if (isDefined(value)) {
|
32727 | config[key] = value;
|
32728 | res = value;
|
32729 | redraw && this.flush();
|
32730 | } else {
|
32731 | res = config[key];
|
32732 | }
|
32733 | }
|
32734 |
|
32735 | return res;
|
32736 | }
|
32737 | });
|
32738 | ;// CONCATENATED MODULE: ./src/Chart/api/color.ts
|
32739 | /**
|
32740 | * Copyright (c) 2017 ~ present NAVER Corp.
|
32741 | * billboard.js project is licensed under the MIT license
|
32742 | */
|
32743 | /* harmony default export */ var api_color = ({
|
32744 | /**
|
32745 | * Get the color
|
32746 | * @function color
|
32747 | * @instance
|
32748 | * @memberof Chart
|
32749 | * @param {string} id id to get the color
|
32750 | * @returns {string}
|
32751 | * @example
|
32752 | * chart.color("data1");
|
32753 | */
|
32754 | color: function color(id) {
|
32755 | return this.internal.color(id); // more patterns
|
32756 | }
|
32757 | });
|
32758 | ;// CONCATENATED MODULE: ./src/Chart/api/data.ts
|
32759 | /**
|
32760 | * Copyright (c) 2017 ~ present NAVER Corp.
|
32761 | * billboard.js project is licensed under the MIT license
|
32762 | */
|
32763 |
|
32764 |
|
32765 | /**
|
32766 | * Get data loaded in the chart.
|
32767 | * @function data
|
32768 | * @instance
|
32769 | * @memberof Chart
|
32770 | * @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.
|
32771 | * @returns {Array} Data objects
|
32772 | * @example
|
32773 | * // Get only data1 data
|
32774 | * chart.data("data1");
|
32775 | * // --> [{id: "data1", id_org: "data1", values: Array(6)}, ...]
|
32776 | *
|
32777 | * // Get data1 and data2 data
|
32778 | * chart.data(["data1", "data2"]);
|
32779 | *
|
32780 | * // Get all data
|
32781 | * chart.data();
|
32782 | */
|
32783 | function api_data_data(targetIds) {
|
32784 | var targets = this.internal.data.targets;
|
32785 |
|
32786 | if (!isUndefined(targetIds)) {
|
32787 | var ids = isArray(targetIds) ? targetIds : [targetIds];
|
32788 | return targets.filter(function (t) {
|
32789 | return ids.some(function (v) {
|
32790 | return v === t.id;
|
32791 | });
|
32792 | });
|
32793 | }
|
32794 |
|
32795 | return targets;
|
32796 | }
|
32797 |
|
32798 | util_extend(api_data_data, {
|
32799 | /**
|
32800 | * Get data shown in the chart.
|
32801 | * @function data․shown
|
32802 | * @instance
|
32803 | * @memberof Chart
|
32804 | * @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.
|
32805 | * @returns {Array} Data objects
|
32806 | * @example
|
32807 | * // Get shown data by filtering to include only data1 data
|
32808 | * chart.data.shown("data1");
|
32809 | * // --> [{id: "data1", id_org: "data1", values: Array(6)}, ...]
|
32810 | *
|
32811 | * // Get shown data by filtering to include data1 and data2 data
|
32812 | * chart.data.shown(["data1", "data2"]);
|
32813 | *
|
32814 | * // Get all shown data
|
32815 | * chart.data.shown();
|
32816 | */
|
32817 | shown: function shown(targetIds) {
|
32818 | return this.internal.filterTargetsToShow(this.data(targetIds));
|
32819 | },
|
32820 |
|
32821 | /**
|
32822 | * Get values of the data loaded in the chart.
|
32823 | * @function data․values
|
32824 | * @instance
|
32825 | * @memberof Chart
|
32826 | * @param {string|Array|null} targetIds This API returns the values of specified target. If this argument is not given, null will be retruned
|
32827 | * @param {boolean} [flat=true] Get flatten values
|
32828 | * @returns {Array} Data values
|
32829 | * @example
|
32830 | * // Get data1 values
|
32831 | * chart.data.values("data1");
|
32832 | * // --> [10, 20, 30, 40]
|
32833 | */
|
32834 | values: function (targetIds, flat) {
|
32835 | if (flat === void 0) {
|
32836 | flat = !0;
|
32837 | }
|
32838 |
|
32839 | var values = null;
|
32840 |
|
32841 | if (targetIds) {
|
32842 | var targets = this.data(targetIds);
|
32843 |
|
32844 | if (isArray(targets)) {
|
32845 | values = [];
|
32846 | targets.forEach(function (v) {
|
32847 | var dataValue = v.values.map(function (d) {
|
32848 | return d.value;
|
32849 | });
|
32850 | flat ? values = values.concat(dataValue) : values.push(dataValue);
|
32851 | });
|
32852 | }
|
32853 | }
|
32854 |
|
32855 | return values;
|
32856 | },
|
32857 |
|
32858 | /**
|
32859 | * Get and set names of the data loaded in the chart.
|
32860 | * @function data․names
|
32861 | * @instance
|
32862 | * @memberof Chart
|
32863 | * @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
|
32864 | * @returns {object} Corresponding names according its key value, if specified names values.
|
32865 | * @example
|
32866 | * // Get current names
|
32867 | * chart.data.names();
|
32868 | * // --> {data1: "test1", data2: "test2"}
|
32869 | *
|
32870 | * // Update names
|
32871 | * chart.data.names({
|
32872 | * data1: "New Name 1",
|
32873 | * data2: "New Name 2"
|
32874 | *});
|
32875 | */
|
32876 | names: function names(_names) {
|
32877 | var $$ = this.internal;
|
32878 | return $$.updateDataAttributes("names", _names);
|
32879 | },
|
32880 |
|
32881 | /**
|
32882 | * Get and set colors of the data loaded in the chart.
|
32883 | * @function data․colors
|
32884 | * @instance
|
32885 | * @memberof Chart
|
32886 | * @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).
|
32887 | * @returns {object} Corresponding data color value according its key value.
|
32888 | * @example
|
32889 | * // Get current colors
|
32890 | * chart.data.colors();
|
32891 | * // --> {data1: "#00c73c", data2: "#fa7171"}
|
32892 | *
|
32893 | * // Update colors
|
32894 | * chart.data.colors({
|
32895 | * data1: "#FFFFFF",
|
32896 | * data2: "#000000"
|
32897 | * });
|
32898 | */
|
32899 | colors: function colors(_colors) {
|
32900 | return this.internal.updateDataAttributes("colors", _colors);
|
32901 | },
|
32902 |
|
32903 | /**
|
32904 | * Get and set axes of the data loaded in the chart.
|
32905 | * - **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
|
32906 | * @function data․axes
|
32907 | * @instance
|
32908 | * @memberof Chart
|
32909 | * @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
|
32910 | * @returns {object} Corresponding axes value for data, if specified axes value.
|
32911 | * @example
|
32912 | * // Get current axes
|
32913 | * chart.data.axes();
|
32914 | * // --> {data1: "y"}
|
32915 | *
|
32916 | * // Update axes
|
32917 | * chart.data.axes({
|
32918 | * data1: "y",
|
32919 | * data2: "y2"
|
32920 | * });
|
32921 | */
|
32922 | axes: function axes(_axes) {
|
32923 | return this.internal.updateDataAttributes("axes", _axes);
|
32924 | },
|
32925 |
|
32926 | /**
|
32927 | * Get the minimum data value bound to the chart
|
32928 | * @function data․min
|
32929 | * @instance
|
32930 | * @memberof Chart
|
32931 | * @returns {Array} Data objects
|
32932 | * @example
|
32933 | * // Get current axes
|
32934 | * chart.data.min();
|
32935 | * // --> [{x: 0, value: 30, id: "data1", index: 0}, ...]
|
32936 | */
|
32937 | min: function min() {
|
32938 | return this.internal.getMinMaxData().min;
|
32939 | },
|
32940 |
|
32941 | /**
|
32942 | * Get the maximum data value bound to the chart
|
32943 | * @function data․max
|
32944 | * @instance
|
32945 | * @memberof Chart
|
32946 | * @returns {Array} Data objects
|
32947 | * @example
|
32948 | * // Get current axes
|
32949 | * chart.data.max();
|
32950 | * // --> [{x: 3, value: 400, id: "data1", index: 3}, ...]
|
32951 | */
|
32952 | max: function max() {
|
32953 | return this.internal.getMinMaxData().max;
|
32954 | }
|
32955 | });
|
32956 | /* harmony default export */ var api_data = ({
|
32957 | data: api_data_data
|
32958 | });
|
32959 | ;// CONCATENATED MODULE: ./src/Chart/api/export.ts
|
32960 | /**
|
32961 | * Copyright (c) 2017 ~ present NAVER Corp.
|
32962 | * billboard.js project is licensed under the MIT license
|
32963 | */
|
32964 |
|
32965 |
|
32966 |
|
32967 |
|
32968 | /**
|
32969 | * Encode to base64
|
32970 | * @param {string} str string to be encoded
|
32971 | * @returns {string}
|
32972 | * @private
|
32973 | * @see https://developer.mozilla.org/ko/docs/Web/API/WindowBase64/Base64_encoding_and_decoding
|
32974 | */
|
32975 | var b64EncodeUnicode = function (str) {
|
32976 | return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function (match, p) {
|
32977 | return String.fromCharCode(+("0x" + p));
|
32978 | }));
|
32979 | };
|
32980 | /**
|
32981 | * Convert svg node to data url
|
32982 | * @param {HTMLElement} node target node
|
32983 | * @param {object} option object containing {width, height, preserveAspectRatio}
|
32984 | * @param {object} orgSize object containing {width, height}
|
32985 | * @returns {string}
|
32986 | * @private
|
32987 | */
|
32988 |
|
32989 |
|
32990 | function nodeToSvgDataUrl(node, option, orgSize) {
|
32991 | var _ref = option || orgSize,
|
32992 | width = _ref.width,
|
32993 | height = _ref.height,
|
32994 | serializer = new XMLSerializer(),
|
32995 | clone = node.cloneNode(!0),
|
32996 | cssText = getCssRules(toArray(browser_doc.styleSheets)).filter(function (r) {
|
32997 | return r.cssText;
|
32998 | }).map(function (r) {
|
32999 | return r.cssText;
|
33000 | });
|
33001 |
|
33002 | clone.setAttribute("xmlns", namespaces.xhtml);
|
33003 | var nodeXml = serializer.serializeToString(clone),
|
33004 | style = browser_doc.createElement("style"); // escape css for XML
|
33005 |
|
33006 | style.appendChild(browser_doc.createTextNode(cssText.join("\n")));
|
33007 | var styleXml = serializer.serializeToString(style),
|
33008 | dataStr = ("<svg xmlns=\"" + namespaces.svg + "\" width=\"" + width + "\" height=\"" + height + "\" \n\t\tviewBox=\"0 0 " + orgSize.width + " " + orgSize.height + "\" \n\t\tpreserveAspectRatio=\"" + ((option == null ? void 0 : 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
|
33009 | // https://msdn.microsoft.com/en-us/library/hh834675(v=vs.85).aspx
|
33010 |
|
33011 | return "data:image/svg+xml;base64," + b64EncodeUnicode(dataStr);
|
33012 | }
|
33013 |
|
33014 | /* harmony default export */ var api_export = ({
|
33015 | /**
|
33016 | * Export chart as an image.
|
33017 | * - **NOTE:**
|
33018 | * - 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
|
33019 | * - The basic CSS file(ex. billboard.css) should be at same domain as API call context to get correct styled export image.
|
33020 | * @function export
|
33021 | * @instance
|
33022 | * @memberof Chart
|
33023 | * @param {object} option Export option
|
33024 | * @param {string} [option.mimeType="image/png"] The desired output image format. (ex. 'image/png' for png, 'image/jpeg' for jpeg format)
|
33025 | * @param {number} [option.width={currentWidth}] width
|
33026 | * @param {number} [option.height={currentHeigth}] height
|
33027 | * @param {boolean} [option.preserveAspectRatio=true] Preserve aspect ratio on given size
|
33028 | * @param {Function} [callback] The callback to be invoked when export is ready.
|
33029 | * @returns {string} dataURI
|
33030 | * @example
|
33031 | * chart.export();
|
33032 | * // --> "data:image/svg+xml;base64,PHN..."
|
33033 | *
|
33034 | * // Initialize the download automatically
|
33035 | * chart.export({mimeType: "image/png"}, dataUrl => {
|
33036 | * const link = document.createElement("a");
|
33037 | *
|
33038 | * link.download = `${Date.now()}.png`;
|
33039 | * link.href = dataUrl;
|
33040 | * link.innerHTML = "Download chart as image";
|
33041 | *
|
33042 | * document.body.appendChild(link);
|
33043 | * });
|
33044 | *
|
33045 | * // Resize the exported image
|
33046 | * chart.export(
|
33047 | * {
|
33048 | * width: 800,
|
33049 | * height: 600,
|
33050 | * preserveAspectRatio: false,
|
33051 | * mimeType: "image/png"
|
33052 | * },
|
33053 | * dataUrl => { ... }
|
33054 | * );
|
33055 | */
|
33056 | export: function _export(option, callback) {
|
33057 | var _this = this,
|
33058 | $$ = this.internal,
|
33059 | state = $$.state,
|
33060 | chart = $$.$el.chart,
|
33061 | _state$current = state.current,
|
33062 | width = _state$current.width,
|
33063 | height = _state$current.height,
|
33064 | opt = mergeObj({
|
33065 | width: width,
|
33066 | height: height,
|
33067 | preserveAspectRatio: !0,
|
33068 | mimeType: "image/png"
|
33069 | }, option),
|
33070 | svgDataUrl = nodeToSvgDataUrl(chart.node(), opt, {
|
33071 | width: width,
|
33072 | height: height
|
33073 | });
|
33074 |
|
33075 | if (callback && isFunction(callback)) {
|
33076 | var img = new Image();
|
33077 | img.crossOrigin = "Anonymous";
|
33078 |
|
33079 | img.onload = function () {
|
33080 | var canvas = browser_doc.createElement("canvas"),
|
33081 | ctx = canvas.getContext("2d");
|
33082 | canvas.width = opt.width || width;
|
33083 | canvas.height = opt.height || height;
|
33084 | ctx.drawImage(img, 0, 0);
|
33085 | callback.bind(_this)(canvas.toDataURL(opt.mimeType));
|
33086 | };
|
33087 |
|
33088 | img.src = svgDataUrl;
|
33089 | }
|
33090 |
|
33091 | return svgDataUrl;
|
33092 | }
|
33093 | });
|
33094 | ;// CONCATENATED MODULE: ./src/Chart/api/focus.ts
|
33095 | /**
|
33096 | * Copyright (c) 2017 ~ present NAVER Corp.
|
33097 | * billboard.js project is licensed under the MIT license
|
33098 | */
|
33099 |
|
33100 |
|
33101 | /* harmony default export */ var api_focus = ({
|
33102 | /**
|
33103 | * This API highlights specified targets and fade out the others.<br><br>
|
33104 | * 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.
|
33105 | * @function focus
|
33106 | * @instance
|
33107 | * @memberof Chart
|
33108 | * @param {string|Array} targetIdsValue Target ids to be highlighted.
|
33109 | * @example
|
33110 | * // data1 will be highlighted and the others will be faded out
|
33111 | * chart.focus("data1");
|
33112 | *
|
33113 | * // data1 and data2 will be highlighted and the others will be faded out
|
33114 | * chart.focus(["data1", "data2"]);
|
33115 | *
|
33116 | * // all targets will be highlighted
|
33117 | * chart.focus();
|
33118 | */
|
33119 | focus: function focus(targetIdsValue) {
|
33120 | var $$ = this.internal,
|
33121 | state = $$.state,
|
33122 | targetIds = $$.mapToTargetIds(targetIdsValue),
|
33123 | candidates = $$.$el.svg.selectAll($$.selectorTargets(targetIds.filter($$.isTargetToShow, $$)));
|
33124 | this.revert();
|
33125 | this.defocus();
|
33126 | candidates.classed(config_classes.focused, !0).classed(config_classes.defocused, !1);
|
33127 |
|
33128 | if ($$.hasArcType() && !state.hasRadar) {
|
33129 | $$.expandArc(targetIds);
|
33130 | $$.hasType("gauge") && $$.markOverlapped(targetIdsValue, $$, "." + config_classes.gaugeValue);
|
33131 | }
|
33132 |
|
33133 | $$.toggleFocusLegend(targetIds, !0);
|
33134 | state.focusedTargetIds = targetIds;
|
33135 | state.defocusedTargetIds = state.defocusedTargetIds.filter(function (id) {
|
33136 | return targetIds.indexOf(id) < 0;
|
33137 | });
|
33138 | },
|
33139 |
|
33140 | /**
|
33141 | * This API fades out specified targets and reverts the others.<br><br>
|
33142 | * 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.
|
33143 | * @function defocus
|
33144 | * @instance
|
33145 | * @memberof Chart
|
33146 | * @param {string|Array} targetIdsValue Target ids to be faded out.
|
33147 | * @example
|
33148 | * // data1 will be faded out and the others will be reverted.
|
33149 | * chart.defocus("data1");
|
33150 | *
|
33151 | * // data1 and data2 will be faded out and the others will be reverted.
|
33152 | * chart.defocus(["data1", "data2"]);
|
33153 | *
|
33154 | * // all targets will be faded out.
|
33155 | * chart.defocus();
|
33156 | */
|
33157 | defocus: function defocus(targetIdsValue) {
|
33158 | var $$ = this.internal,
|
33159 | state = $$.state,
|
33160 | targetIds = $$.mapToTargetIds(targetIdsValue),
|
33161 | candidates = $$.$el.svg.selectAll($$.selectorTargets(targetIds.filter($$.isTargetToShow, $$)));
|
33162 | candidates.classed(config_classes.focused, !1).classed(config_classes.defocused, !0);
|
33163 |
|
33164 | if ($$.hasArcType()) {
|
33165 | $$.unexpandArc(targetIds);
|
33166 | $$.hasType("gauge") && $$.undoMarkOverlapped($$, "." + config_classes.gaugeValue);
|
33167 | }
|
33168 |
|
33169 | $$.toggleFocusLegend(targetIds, !1);
|
33170 | state.focusedTargetIds = state.focusedTargetIds.filter(function (id) {
|
33171 | return targetIds.indexOf(id) < 0;
|
33172 | });
|
33173 | state.defocusedTargetIds = targetIds;
|
33174 | },
|
33175 |
|
33176 | /**
|
33177 | * This API reverts specified targets.<br><br>
|
33178 | * 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.
|
33179 | * @function revert
|
33180 | * @instance
|
33181 | * @memberof Chart
|
33182 | * @param {string|Array} targetIdsValue Target ids to be reverted
|
33183 | * @example
|
33184 | * // data1 will be reverted.
|
33185 | * chart.revert("data1");
|
33186 | *
|
33187 | * // data1 and data2 will be reverted.
|
33188 | * chart.revert(["data1", "data2"]);
|
33189 | *
|
33190 | * // all targets will be reverted.
|
33191 | * chart.revert();
|
33192 | */
|
33193 | revert: function revert(targetIdsValue) {
|
33194 | var $$ = this.internal,
|
33195 | config = $$.config,
|
33196 | state = $$.state,
|
33197 | $el = $$.$el,
|
33198 | targetIds = $$.mapToTargetIds(targetIdsValue),
|
33199 | candidates = $el.svg.selectAll($$.selectorTargets(targetIds));
|
33200 | // should be for all targets
|
33201 | candidates.classed(config_classes.focused, !1).classed(config_classes.defocused, !1);
|
33202 | $$.hasArcType() && $$.unexpandArc(targetIds);
|
33203 |
|
33204 | if (config.legend_show) {
|
33205 | $$.showLegend(targetIds.filter($$.isLegendToShow.bind($$)));
|
33206 | $el.legend.selectAll($$.selectorLegends(targetIds)).filter(function () {
|
33207 | return src_select(this).classed(config_classes.legendItemFocused);
|
33208 | }).classed(config_classes.legendItemFocused, !1);
|
33209 | }
|
33210 |
|
33211 | state.focusedTargetIds = [];
|
33212 | state.defocusedTargetIds = [];
|
33213 | }
|
33214 | });
|
33215 | ;// CONCATENATED MODULE: ./src/Chart/api/legend.ts
|
33216 | /**
|
33217 | * Copyright (c) 2017 ~ present NAVER Corp.
|
33218 | * billboard.js project is licensed under the MIT license
|
33219 | */
|
33220 |
|
33221 | /**
|
33222 | * Define legend
|
33223 | * @ignore
|
33224 | */
|
33225 | var legend_legend = {
|
33226 | /**
|
33227 | * Show legend for each target.
|
33228 | * @function legend․show
|
33229 | * @instance
|
33230 | * @memberof Chart
|
33231 | * @param {string|Array} targetIds
|
33232 | * - If targetIds is given, specified target's legend will be shown.
|
33233 | * - If only one target is the candidate, String can be passed.
|
33234 | * - If no argument is given, all of target's legend will be shown.
|
33235 | * @example
|
33236 | * // Show legend for data1.
|
33237 | * chart.legend.show("data1");
|
33238 | *
|
33239 | * // Show legend for data1 and data2.
|
33240 | * chart.legend.show(["data1", "data2"]);
|
33241 | *
|
33242 | * // Show all legend.
|
33243 | * chart.legend.show();
|
33244 | */
|
33245 | show: function show(targetIds) {
|
33246 | var $$ = this.internal;
|
33247 | $$.showLegend($$.mapToTargetIds(targetIds));
|
33248 | $$.updateAndRedraw({
|
33249 | withLegend: !0
|
33250 | });
|
33251 | },
|
33252 |
|
33253 | /**
|
33254 | * Hide legend for each target.
|
33255 | * @function legend․hide
|
33256 | * @instance
|
33257 | * @memberof Chart
|
33258 | * @param {string|Array} targetIds
|
33259 | * - If targetIds is given, specified target's legend will be hidden.
|
33260 | * - If only one target is the candidate, String can be passed.
|
33261 | * - If no argument is given, all of target's legend will be hidden.
|
33262 | * @example
|
33263 | * // Hide legend for data1.
|
33264 | * chart.legend.hide("data1");
|
33265 | *
|
33266 | * // Hide legend for data1 and data2.
|
33267 | * chart.legend.hide(["data1", "data2"]);
|
33268 | *
|
33269 | * // Hide all legend.
|
33270 | * chart.legend.hide();
|
33271 | */
|
33272 | hide: function hide(targetIds) {
|
33273 | var $$ = this.internal;
|
33274 | $$.hideLegend($$.mapToTargetIds(targetIds));
|
33275 | $$.updateAndRedraw({
|
33276 | withLegend: !0
|
33277 | });
|
33278 | }
|
33279 | };
|
33280 | /* harmony default export */ var api_legend = ({
|
33281 | legend: legend_legend
|
33282 | });
|
33283 | ;// CONCATENATED MODULE: ./src/Chart/api/load.ts
|
33284 | /**
|
33285 | * Copyright (c) 2017 ~ present NAVER Corp.
|
33286 | * billboard.js project is licensed under the MIT license
|
33287 | */
|
33288 |
|
33289 |
|
33290 | /* harmony default export */ var api_load = ({
|
33291 | /**
|
33292 | * Load data to the chart.<br><br>
|
33293 | * 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.
|
33294 | * - <b>Note:</b>
|
33295 | * - unload should be used if some data needs to be unloaded simultaneously.
|
33296 | * 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>
|
33297 | * - done will be called after data loaded, but it's not after rendering.
|
33298 | * It's because rendering will finish after some transition and there is some time lag between loading and rendering
|
33299 | * @function load
|
33300 | * @instance
|
33301 | * @memberof Chart
|
33302 | * @param {object} args The object can consist with following members:<br>
|
33303 | *
|
33304 | * | Key | Description |
|
33305 | * | --- | --- |
|
33306 | * | - 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 |
|
33307 | * | data | Data objects to be loaded. Checkout the example. |
|
33308 | * | append | Load data appending it to the current dataseries.<br>If the existing chart has`x` value, should provide with corresponding `x` value for newly loaded data. |
|
33309 | * | names | Same as data.names() |
|
33310 | * | xs | Same as data.xs option |
|
33311 | * | classes | The classes specified by data.classes will be updated. classes must be Object that has target id as keys. |
|
33312 | * | categories | The categories specified by axis.x.categories or data.x will be updated. categories must be Array. |
|
33313 | * | axes | The axes specified by data.axes will be updated. axes must be Object that has target id as keys. |
|
33314 | * | colors | The colors specified by data.colors will be updated. colors must be Object that has target id as keys. |
|
33315 | * | headers | Set request header if loading via `data.url`.<br>@see [data․headers](Options.html#.data%25E2%2580%25A4headers) |
|
33316 | * | 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) |
|
33317 | * | mimeType | Set 'json' if loading JSON via url.<br>@see [data․mimeType](Options.html#.data%25E2%2580%25A4mimeType) |
|
33318 | * | - type<br>- types | The type of targets will be updated. type must be String and types must be Object. |
|
33319 | * | 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. |
|
33320 | * | done | The specified function will be called after data loaded.|
|
33321 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Data.DataFromURL)
|
33322 | * @example
|
33323 | * // Load data1 and unload data2 and data3
|
33324 | * chart.load({
|
33325 | * columns: [
|
33326 | * ["data1", 100, 200, 150, ...],
|
33327 | * ...
|
33328 | * ],
|
33329 | * unload: ["data2", "data3"],
|
33330 | * url: "...",
|
33331 | * done: function() { ... }
|
33332 | * });
|
33333 | * @example
|
33334 | * const chart = bb.generate({
|
33335 | * data: {
|
33336 | * columns: [
|
33337 | * ["data1", 20, 30, 40]
|
33338 | * ]
|
33339 | * }
|
33340 | * });
|
33341 | *
|
33342 | * chart.load({
|
33343 | * columns: [
|
33344 | * // with 'append' option, the 'data1' will have `[20,30,40,50,60]`.
|
33345 | * ["data1", 50, 60]
|
33346 | * ],
|
33347 | * append: true
|
33348 | * });
|
33349 | * @example
|
33350 | * const chart = bb.generate({
|
33351 | * data: {
|
33352 | * x: "x",
|
33353 | * xFormat: "%Y-%m-%dT%H:%M:%S",
|
33354 | * columns: [
|
33355 | * ["x", "2021-01-03T03:00:00", "2021-01-04T12:00:00", "2021-01-05T21:00:00"],
|
33356 | * ["data1", 36, 30, 24]
|
33357 | * ]
|
33358 | * },
|
33359 | * axis: {
|
33360 | * x: {
|
33361 | * type: "timeseries"
|
33362 | * }
|
33363 | * }
|
33364 | * };
|
33365 | *
|
33366 | * chart.load({
|
33367 | * columns: [
|
33368 | * // when existing chart has `x` value, should provide correponding 'x' value.
|
33369 | * // with 'append' option, the 'data1' will have `[36,30,24,37]`.
|
33370 | * ["x", "2021-02-01T08:00:00"],
|
33371 | * ["data1", 37]
|
33372 | * ],
|
33373 | * append: true
|
33374 | * });
|
33375 | * @example
|
33376 | * // myAPI.json
|
33377 | * // {
|
33378 | * // "data1": [220, 240, 270, 250, 280],
|
33379 | * // "data2": [180, 150, 300, 70, 120]
|
33380 | * // }
|
33381 | *
|
33382 | * chart.load({
|
33383 | * url: './data/myAPI.json',
|
33384 | * mimeType: "json",
|
33385 | *
|
33386 | * // set request header if is needed
|
33387 | * headers: {
|
33388 | * "Content-Type": "text/json"
|
33389 | * }
|
33390 | * });
|
33391 | * @example
|
33392 | * chart.load({
|
33393 | * data: [
|
33394 | * // equivalent as: columns: [["data1", 30, 200, 100]]
|
33395 | * {"data1": 30}, {"data1": 200}, {"data1": 100}
|
33396 | *
|
33397 | * // or
|
33398 | * // equivalent as: columns: [["data1", 10, 20], ["data2", 13, 30]]
|
33399 | * // {"data1": 10, "data2": 13}, {"data1": 20, "data2": 30}}
|
33400 | * ]
|
33401 | * });
|
33402 | * @example
|
33403 | * chart.load({
|
33404 | * json: [
|
33405 | * {name: "www.site1.com", upload: 800, download: 500, total: 400},
|
33406 | * ],
|
33407 | * keys: {
|
33408 | * x: "name",
|
33409 | * value: ["upload", "download"]
|
33410 | * }
|
33411 | * });
|
33412 | * @example
|
33413 | * chart.load({
|
33414 | * json: {
|
33415 | * data1:[30, 20, 50, 40, 60, 50],
|
33416 | * data2:[200, 130, 90, 240, 130, 220],
|
33417 | * }
|
33418 | * });
|
33419 | */
|
33420 | load: function load(args) {
|
33421 | var $$ = this.internal,
|
33422 | config = $$.config;
|
33423 | // update xs if specified
|
33424 | args.xs && $$.addXs(args.xs); // update names if exists
|
33425 |
|
33426 | "names" in args && this.data.names(args.names); // update classes if exists
|
33427 |
|
33428 | "classes" in args && Object.keys(args.classes).forEach(function (id) {
|
33429 | config.data_classes[id] = args.classes[id];
|
33430 | }); // update categories if exists
|
33431 |
|
33432 | if ("categories" in args && $$.axis.isCategorized()) {
|
33433 | config.axis_x_categories = args.categories;
|
33434 | } // update axes if exists
|
33435 |
|
33436 |
|
33437 | "axes" in args && Object.keys(args.axes).forEach(function (id) {
|
33438 | config.data_axes[id] = args.axes[id];
|
33439 | }); // update colors if exists
|
33440 |
|
33441 | "colors" in args && Object.keys(args.colors).forEach(function (id) {
|
33442 | config.data_colors[id] = args.colors[id];
|
33443 | }); // unload if needed
|
33444 |
|
33445 | if ("unload" in args && args.unload !== !1) {
|
33446 | // TODO: do not unload if target will load (included in url/rows/columns)
|
33447 | $$.unload($$.mapToTargetIds(args.unload === !0 ? null : args.unload), function () {
|
33448 | // to mitigate improper rendering for multiple consecutive calls
|
33449 | // https://github.com/naver/billboard.js/issues/2121
|
33450 | win.requestIdleCallback(function () {
|
33451 | return $$.loadFromArgs(args);
|
33452 | });
|
33453 | });
|
33454 | } else {
|
33455 | $$.loadFromArgs(args);
|
33456 | }
|
33457 | },
|
33458 |
|
33459 | /**
|
33460 | * Unload data to the chart.<br><br>
|
33461 | * 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.
|
33462 | * - <b>Note:</b>
|
33463 | * 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>
|
33464 | * `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.
|
33465 | * @function unload
|
33466 | * @instance
|
33467 | * @memberof Chart
|
33468 | * @param {object} argsValue
|
33469 | * | key | Type | Description |
|
33470 | * | --- | --- | --- |
|
33471 | * | ids | String | Array | Target id data to be unloaded. If not given, all data will be unloaded. |
|
33472 | * | done | Fuction | Callback after data is unloaded. |
|
33473 | * @example
|
33474 | * // Unload data2 and data3
|
33475 | * chart.unload({
|
33476 | * ids: ["data2", "data3"],
|
33477 | * done: function() {
|
33478 | * // called after the unloaded
|
33479 | * }
|
33480 | * });
|
33481 | */
|
33482 | unload: function unload(argsValue) {
|
33483 | var _this = this,
|
33484 | $$ = this.internal,
|
33485 | args = argsValue || {};
|
33486 |
|
33487 | if (isArray(args)) {
|
33488 | args = {
|
33489 | ids: args
|
33490 | };
|
33491 | } else if (isString(args)) {
|
33492 | args = {
|
33493 | ids: [args]
|
33494 | };
|
33495 | }
|
33496 |
|
33497 | var ids = $$.mapToTargetIds(args.ids);
|
33498 | $$.unload(ids, function () {
|
33499 | $$.redraw({
|
33500 | withUpdateOrgXDomain: !0,
|
33501 | withUpdateXDomain: !0,
|
33502 | withLegend: !0
|
33503 | });
|
33504 | $$.cache.remove(ids);
|
33505 | args.done && args.done.call(_this);
|
33506 | });
|
33507 | }
|
33508 | });
|
33509 | ;// CONCATENATED MODULE: ./src/Chart/api/show.ts
|
33510 | /**
|
33511 | * Copyright (c) 2017 ~ present NAVER Corp.
|
33512 | * billboard.js project is licensed under the MIT license
|
33513 | */
|
33514 |
|
33515 | /**
|
33516 | * Show/Hide data series
|
33517 | * @param {boolean} show Show or hide
|
33518 | * @param {Array} targetIdsValue Target id values
|
33519 | * @param {object} options Options
|
33520 | * @private
|
33521 | */
|
33522 |
|
33523 | function showHide(show, targetIdsValue, options) {
|
33524 | var _this = this,
|
33525 | $$ = this.internal,
|
33526 | targetIds = $$.mapToTargetIds(targetIdsValue),
|
33527 | hiddenIds = $$.state.hiddenTargetIds.map(function (v) {
|
33528 | return targetIds.indexOf(v) > -1 && v;
|
33529 | }).filter(Boolean);
|
33530 |
|
33531 | $$.state.toggling = !0;
|
33532 | $$[(show ? "remove" : "add") + "HiddenTargetIds"](targetIds);
|
33533 | var targets = $$.$el.svg.selectAll($$.selectorTargets(targetIds)),
|
33534 | opacity = show ? null : "0";
|
33535 |
|
33536 | if (show && hiddenIds.length) {
|
33537 | targets.style("display", null);
|
33538 | callFn($$.config.data_onshown, this, hiddenIds);
|
33539 | }
|
33540 |
|
33541 | $$.$T(targets).style("opacity", opacity, "important").call(endall, function () {
|
33542 | // https://github.com/naver/billboard.js/issues/1758
|
33543 | if (!show && hiddenIds.length === 0) {
|
33544 | targets.style("display", "none");
|
33545 | callFn($$.config.data_onhidden, _this, targetIds);
|
33546 | }
|
33547 |
|
33548 | targets.style("opacity", opacity);
|
33549 | });
|
33550 | options.withLegend && $$[(show ? "show" : "hide") + "Legend"](targetIds);
|
33551 | $$.redraw({
|
33552 | withUpdateOrgXDomain: !0,
|
33553 | withUpdateXDomain: !0,
|
33554 | withLegend: !0
|
33555 | });
|
33556 | $$.state.toggling = !1;
|
33557 | }
|
33558 |
|
33559 | /* harmony default export */ var show = ({
|
33560 | /**
|
33561 | * Show data series on chart
|
33562 | * @function show
|
33563 | * @instance
|
33564 | * @memberof Chart
|
33565 | * @param {string|Array} [targetIdsValue] The target id value.
|
33566 | * @param {object} [options] The object can consist with following members:<br>
|
33567 | *
|
33568 | * | Key | Type | default | Description |
|
33569 | * | --- | --- | --- | --- |
|
33570 | * | withLegend | boolean | false | whether or not display legend |
|
33571 | *
|
33572 | * @example
|
33573 | * // show 'data1'
|
33574 | * chart.show("data1");
|
33575 | *
|
33576 | * // show 'data1' and 'data3'
|
33577 | * chart.show(["data1", "data3"]);
|
33578 | */
|
33579 | show: function show(targetIdsValue, options) {
|
33580 | if (options === void 0) {
|
33581 | options = {};
|
33582 | }
|
33583 |
|
33584 | showHide.call(this, !0, targetIdsValue, options);
|
33585 | },
|
33586 |
|
33587 | /**
|
33588 | * Hide data series from chart
|
33589 | * @function hide
|
33590 | * @instance
|
33591 | * @memberof Chart
|
33592 | * @param {string|Array} [targetIdsValue] The target id value.
|
33593 | * @param {object} [options] The object can consist with following members:<br>
|
33594 | *
|
33595 | * | Key | Type | default | Description |
|
33596 | * | --- | --- | --- | --- |
|
33597 | * | withLegend | boolean | false | whether or not display legend |
|
33598 | *
|
33599 | * @example
|
33600 | * // hide 'data1'
|
33601 | * chart.hide("data1");
|
33602 | *
|
33603 | * // hide 'data1' and 'data3'
|
33604 | * chart.hide(["data1", "data3"]);
|
33605 | */
|
33606 | hide: function hide(targetIdsValue, options) {
|
33607 | if (options === void 0) {
|
33608 | options = {};
|
33609 | }
|
33610 |
|
33611 | showHide.call(this, !1, targetIdsValue, options);
|
33612 | },
|
33613 |
|
33614 | /**
|
33615 | * Toggle data series on chart. When target data is hidden, it will show. If is shown, it will hide in vice versa.
|
33616 | * @function toggle
|
33617 | * @instance
|
33618 | * @memberof Chart
|
33619 | * @param {string|Array} [targetIds] The target id value.
|
33620 | * @param {object} [options] The object can consist with following members:<br>
|
33621 | *
|
33622 | * | Key | Type | default | Description |
|
33623 | * | --- | --- | --- | --- |
|
33624 | * | withLegend | boolean | false | whether or not display legend |
|
33625 | *
|
33626 | * @example
|
33627 | * // toggle 'data1'
|
33628 | * chart.toggle("data1");
|
33629 | *
|
33630 | * // toggle 'data1' and 'data3'
|
33631 | * chart.toggle(["data1", "data3"]);
|
33632 | */
|
33633 | toggle: function toggle(targetIds, options) {
|
33634 | var _this2 = this;
|
33635 |
|
33636 | if (options === void 0) {
|
33637 | options = {};
|
33638 | }
|
33639 |
|
33640 | var $$ = this.internal,
|
33641 | targets = {
|
33642 | show: [],
|
33643 | hide: []
|
33644 | };
|
33645 | // sort show & hide target ids
|
33646 | $$.mapToTargetIds(targetIds).forEach(function (id) {
|
33647 | return targets[$$.isTargetToShow(id) ? "hide" : "show"].push(id);
|
33648 | }); // perform show & hide task separately
|
33649 | // https://github.com/naver/billboard.js/issues/454
|
33650 |
|
33651 | targets.show.length && this.show(targets.show, options);
|
33652 | targets.hide.length && setTimeout(function () {
|
33653 | return _this2.hide(targets.hide, options);
|
33654 | }, 0);
|
33655 | }
|
33656 | });
|
33657 | ;// CONCATENATED MODULE: ./src/Chart/api/tooltip.ts
|
33658 | /**
|
33659 | * Copyright (c) 2017 ~ present NAVER Corp.
|
33660 | * billboard.js project is licensed under the MIT license
|
33661 | */
|
33662 |
|
33663 | /**
|
33664 | * Define tooltip
|
33665 | * @ignore
|
33666 | */
|
33667 |
|
33668 | var tooltip_tooltip = {
|
33669 | /**
|
33670 | * Show tooltip
|
33671 | * @function tooltip․show
|
33672 | * @instance
|
33673 | * @memberof Chart
|
33674 | * @param {object} args The object can consist with following members:<br>
|
33675 | *
|
33676 | * | Key | Type | Description |
|
33677 | * | --- | --- | --- |
|
33678 | * | index | Number | Determine focus by index |
|
33679 | * | x | Number | Date | Determine focus by x Axis index |
|
33680 | * | 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]` |
|
33681 | * | 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. |
|
33682 | *
|
33683 | * @example
|
33684 | * // show the 2nd x Axis coordinate tooltip
|
33685 | * // for Arc(gauge, donut & pie) and radar type, approch showing tooltip by using "index" number.
|
33686 | * chart.tooltip.show({
|
33687 | * index: 1
|
33688 | * });
|
33689 | *
|
33690 | * // show tooltip for the 3rd x Axis in x:50 and y:100 coordinate of '.bb-event-rect' of the x Axis.
|
33691 | * chart.tooltip.show({
|
33692 | * x: 2,
|
33693 | * mouse: [50, 100]
|
33694 | * });
|
33695 | *
|
33696 | * // show tooltip for timeseries x axis
|
33697 | * chart.tooltip.show({
|
33698 | * x: new Date("2018-01-02 00:00")
|
33699 | * });
|
33700 | *
|
33701 | * // when data.xs is used
|
33702 | * chart.tooltip.show({
|
33703 | * data: {
|
33704 | * x: 3, // x Axis value
|
33705 | * id: "data1", // data id
|
33706 | * value: 500 // data value
|
33707 | * }
|
33708 | * });
|
33709 | *
|
33710 | * // when data.xs isn't used, but tooltip.grouped=false is set
|
33711 | * chart.tooltip.show({
|
33712 | * data: {
|
33713 | * index: 3, // or 'x' key value
|
33714 | * id: "data1", // data id
|
33715 | * value: 500 // data value
|
33716 | * }
|
33717 | * });
|
33718 | */
|
33719 | show: function show(args) {
|
33720 | var $$ = this.internal,
|
33721 | config = $$.config,
|
33722 | inputType = $$.state.inputType,
|
33723 | index,
|
33724 | mouse;
|
33725 |
|
33726 | // determine mouse position on the chart
|
33727 | if (args.mouse) {
|
33728 | mouse = args.mouse;
|
33729 | } // determine focus data
|
33730 |
|
33731 |
|
33732 | if (args.data) {
|
33733 | var data = args.data,
|
33734 | y = $$.getYScaleById(data.id)(data.value);
|
33735 |
|
33736 | if ($$.isMultipleX()) {
|
33737 | // if multiple xs, target point will be determined by mouse
|
33738 | mouse = [$$.scale.x(data.x), y];
|
33739 | } else {
|
33740 | if (!config.tooltip_grouped) {
|
33741 | mouse = [0, y];
|
33742 | }
|
33743 |
|
33744 | index = isValue(data.index) ? data.index : $$.getIndexByX(data.x);
|
33745 | }
|
33746 | } else if (isDefined(args.x)) {
|
33747 | index = $$.getIndexByX(args.x);
|
33748 | } else if (isDefined(args.index)) {
|
33749 | index = args.index;
|
33750 | }
|
33751 |
|
33752 | (inputType === "mouse" ? ["mouseover", "mousemove"] : ["touchstart"]).forEach(function (eventName) {
|
33753 | $$.dispatchEvent(eventName, index, mouse);
|
33754 | });
|
33755 | },
|
33756 |
|
33757 | /**
|
33758 | * Hide tooltip
|
33759 | * @function tooltip․hide
|
33760 | * @instance
|
33761 | * @memberof Chart
|
33762 | */
|
33763 | hide: function hide() {
|
33764 | var $$ = this.internal,
|
33765 | inputType = $$.state.inputType,
|
33766 | tooltip = $$.$el.tooltip,
|
33767 | data = tooltip == null ? void 0 : tooltip.datum();
|
33768 |
|
33769 | if (data) {
|
33770 | var index = JSON.parse(data.current)[0].index; // make to finalize, possible pending event flow set from '.tooltip.show()' call
|
33771 |
|
33772 | (inputType === "mouse" ? ["mouseout"] : ["touchend"]).forEach(function (eventName) {
|
33773 | $$.dispatchEvent(eventName, index);
|
33774 | });
|
33775 | } // reset last touch point index
|
33776 |
|
33777 |
|
33778 | inputType === "touch" && $$.callOverOutForTouch();
|
33779 | $$.hideTooltip(!0);
|
33780 | $$.hideGridFocus();
|
33781 | $$.unexpandCircles == null ? void 0 : $$.unexpandCircles();
|
33782 | $$.expandBarTypeShapes(!1);
|
33783 | }
|
33784 | };
|
33785 | /* harmony default export */ var api_tooltip = ({
|
33786 | tooltip: tooltip_tooltip
|
33787 | });
|
33788 | ;// CONCATENATED MODULE: ./src/Chart/Chart.ts
|
33789 | /**
|
33790 | * Copyright (c) 2017 ~ present NAVER Corp.
|
33791 | * billboard.js project is licensed under the MIT license
|
33792 | */
|
33793 |
|
33794 |
|
33795 |
|
33796 |
|
33797 |
|
33798 |
|
33799 |
|
33800 |
|
33801 |
|
33802 |
|
33803 |
|
33804 |
|
33805 | /**
|
33806 | * Main chart class.
|
33807 | * - Note: Instantiated via `bb.generate()`.
|
33808 | * @class Chart
|
33809 | * @example
|
33810 | * var chart = bb.generate({
|
33811 | * data: {
|
33812 | * columns: [
|
33813 | * ["x", "2015-11-02", "2015-12-01", "2016-01-01", "2016-02-01", "2016-03-01"],
|
33814 | * ["count1", 11, 8, 7, 6, 5 ],
|
33815 | * ["count2", 9, 3, 6, 2, 8 ]
|
33816 | * ]}
|
33817 | * }
|
33818 | * @see {@link bb.generate} for the initialization.
|
33819 | */
|
33820 |
|
33821 | /**
|
33822 | * Access instance's primary node elements
|
33823 | * @member {object} $
|
33824 | * @property {object} $ Access instance's primary node elements
|
33825 | * @property {d3.selection} $.chart Wrapper element
|
33826 | * @property {d3.selection} $.svg Main svg element
|
33827 | * @property {d3.selection} $.defs Definition element
|
33828 | * @property {d3.selection} $.main Main grouping element
|
33829 | * @property {d3.selection} $.tooltip Tooltip element
|
33830 | * @property {d3.selection} $.legend Legend element
|
33831 | * @property {d3.selection} $.title Title element
|
33832 | * @property {d3.selection} $.grid Grid element
|
33833 | * @property {d3.selection} $.arc Arc element
|
33834 | * @property {d3.selection} $.circles Data point circle elements
|
33835 | * @property {object} $.bar Bar element object
|
33836 | * @property {d3.selection} $.bar.bars Bar elements
|
33837 | * @property {d3.selection} $.candlestick Candlestick elements
|
33838 | * @property {object} $.line Line element object
|
33839 | * @property {d3.selection} $.line.lines Line elements
|
33840 | * @property {d3.selection} $.line.areas Areas elements
|
33841 | * @property {object} $.text Text element object
|
33842 | * @property {d3.selection} $.text.texts Data label text elements
|
33843 | * @memberof Chart
|
33844 | * @example
|
33845 | * var chart = bb.generate({ ... });
|
33846 | *
|
33847 | * chart.$.chart; // wrapper element
|
33848 | * chart.$.line.circles; // all data point circle elements
|
33849 | */
|
33850 |
|
33851 | /**
|
33852 | * Plugin instance array
|
33853 | * @member {Array} plugins
|
33854 | * @memberof Chart
|
33855 | * @example
|
33856 | * var chart = bb.generate({
|
33857 | * ...
|
33858 | * plugins: [
|
33859 | * new bb.plugin.stanford({ ... }),
|
33860 | * new PluginA()
|
33861 | * ]
|
33862 | * });
|
33863 | *
|
33864 | * chart.plugins; // [Stanford, PluginA] - instance array
|
33865 | */
|
33866 |
|
33867 | var Chart = function Chart(options) {
|
33868 | this.plugins = [];
|
33869 | this.internal = void 0;
|
33870 | var $$ = new ChartInternal(this);
|
33871 | this.internal = $$; // bind to namespaced APIs
|
33872 |
|
33873 | (function bindThis(fn, target, argThis) {
|
33874 | Object.keys(fn).forEach(function (key) {
|
33875 | var isFunc = isFunction(fn[key]),
|
33876 | isChild = target !== argThis,
|
33877 | isNotNil = notEmpty(fn[key]),
|
33878 | hasChild = isNotNil && Object.keys(fn[key]).length > 0;
|
33879 |
|
33880 | if (isFunc && (!isChild && hasChild || isChild)) {
|
33881 | target[key] = fn[key].bind(argThis);
|
33882 | } else if (isNotNil && !isFunc) {
|
33883 | target[key] = {};
|
33884 | } else {
|
33885 | target[key] = fn[key];
|
33886 | }
|
33887 |
|
33888 | hasChild && bindThis(fn[key], target[key], argThis);
|
33889 | });
|
33890 | })(Chart.prototype, this, this);
|
33891 |
|
33892 | loadConfig.call($$, options);
|
33893 | $$.beforeInit();
|
33894 | $$.init();
|
33895 | }; // extend common APIs as part of Chart class
|
33896 |
|
33897 |
|
33898 |
|
33899 | util_extend(Chart.prototype, [chart, api_color, api_data, api_export, api_focus, api_legend, api_load, show, api_tooltip]);
|
33900 | ;// CONCATENATED MODULE: ./src/Chart/api/axis.ts
|
33901 | /**
|
33902 | * Copyright (c) 2017 ~ present NAVER Corp.
|
33903 | * billboard.js project is licensed under the MIT license
|
33904 | */
|
33905 |
|
33906 | /**
|
33907 | * Set the min/max value
|
33908 | * @param {Chart} $$ Chart instance
|
33909 | * @param {string} type Set type 'min' or 'max'
|
33910 | * @param {object} value Value to be set
|
33911 | * @private
|
33912 | */
|
33913 |
|
33914 | function setMinMax($$, type, value) {
|
33915 | var config = $$.config,
|
33916 | axisY = "axis_y_" + type,
|
33917 | axisY2 = "axis_y2_" + type;
|
33918 |
|
33919 | if (isDefined(value)) {
|
33920 | if (isObjectType(value)) {
|
33921 | isValue(value.x) && (config["axis_x_" + type] = value.x);
|
33922 | isValue(value.y) && (config[axisY] = value.y);
|
33923 | isValue(value.y2) && (config[axisY2] = value.y2);
|
33924 | } else {
|
33925 | config[axisY] = value;
|
33926 | config[axisY2] = value;
|
33927 | }
|
33928 |
|
33929 | $$.redraw({
|
33930 | withUpdateOrgXDomain: !0,
|
33931 | withUpdateXDomain: !0
|
33932 | });
|
33933 | }
|
33934 | }
|
33935 | /**
|
33936 | * Get the min/max value
|
33937 | * @param {Chart} $$ Chart instance
|
33938 | * @param {string} type Set type 'min' or 'max'
|
33939 | * @returns {{x, y, y2}}
|
33940 | * @private
|
33941 | */
|
33942 |
|
33943 |
|
33944 | function axis_getMinMax($$, type) {
|
33945 | var config = $$.config;
|
33946 | return {
|
33947 | x: config["axis_x_" + type],
|
33948 | y: config["axis_y_" + type],
|
33949 | y2: config["axis_y2_" + type]
|
33950 | };
|
33951 | }
|
33952 | /**
|
33953 | * Define axis
|
33954 | * @ignore
|
33955 | */
|
33956 |
|
33957 |
|
33958 | var axis = {
|
33959 | /**
|
33960 | * Get and set axis labels.
|
33961 | * @function axis․labels
|
33962 | * @instance
|
33963 | * @memberof Chart
|
33964 | * @param {object} labels specified axis' label to be updated.
|
33965 | * @param {string} [labels.x] x Axis string
|
33966 | * @param {string} [labels.y] y Axis string
|
33967 | * @param {string} [labels.y2] y2 Axis string
|
33968 | * @returns {object|undefined} axis labels text object
|
33969 | * @example
|
33970 | * // Update axis' label
|
33971 | * chart.axis.labels({
|
33972 | * x: "New X Axis Label",
|
33973 | * y: "New Y Axis Label",
|
33974 | * y2: "New Y2 Axis Label"
|
33975 | * });
|
33976 | *
|
33977 | * chart.axis.labels();
|
33978 | * // --> {
|
33979 | * // x: "New X Axis Label",
|
33980 | * // y: "New Y Axis Label",
|
33981 | * // y2: "New Y2 Axis Label"
|
33982 | * // }
|
33983 | */
|
33984 | labels: function labels(_labels) {
|
33985 | var $$ = this.internal,
|
33986 | labelText;
|
33987 |
|
33988 | if (_labels) {
|
33989 | Object.keys(_labels).forEach(function (axisId) {
|
33990 | $$.axis.setLabelText(axisId, _labels[axisId]);
|
33991 | });
|
33992 | $$.axis.updateLabels();
|
33993 | }
|
33994 |
|
33995 | ["x", "y", "y2"].forEach(function (v) {
|
33996 | var text = $$.axis.getLabelText(v);
|
33997 |
|
33998 | if (text) {
|
33999 | labelText || (labelText = {});
|
34000 | labelText[v] = text;
|
34001 | }
|
34002 | });
|
34003 | return labelText;
|
34004 | },
|
34005 |
|
34006 | /**
|
34007 | * Get and set axis min value.
|
34008 | * @function axis․min
|
34009 | * @instance
|
34010 | * @memberof Chart
|
34011 | * @param {object} min If min is given, specified axis' min value will be updated.<br>
|
34012 | * If no argument is given, the min values set on generating option for each axis will be returned.
|
34013 | * If not set any min values on generation, it will return `undefined`.
|
34014 | * @returns {object|undefined}
|
34015 | * @example
|
34016 | * // Update axis' min
|
34017 | * chart.axis.min({
|
34018 | * x: -10,
|
34019 | * y: 1000,
|
34020 | * y2: 100
|
34021 | * });
|
34022 | */
|
34023 | min: function min(_min) {
|
34024 | var $$ = this.internal;
|
34025 | return isValue(_min) ? setMinMax($$, "min", _min) : axis_getMinMax($$, "min");
|
34026 | },
|
34027 |
|
34028 | /**
|
34029 | * Get and set axis max value.
|
34030 | * @function axis․max
|
34031 | * @instance
|
34032 | * @memberof Chart
|
34033 | * @param {object} max If max is given, specified axis' max value will be updated.<br>
|
34034 | * If no argument is given, the max values set on generating option for each axis will be returned.
|
34035 | * If not set any max values on generation, it will return `undefined`.
|
34036 | * @returns {object|undefined}
|
34037 | * @example
|
34038 | * // Update axis' label
|
34039 | * chart.axis.max({
|
34040 | * x: 100,
|
34041 | * y: 1000,
|
34042 | * y2: 10000
|
34043 | * });
|
34044 | */
|
34045 | max: function max(_max) {
|
34046 | var $$ = this.internal;
|
34047 | return arguments.length ? setMinMax($$, "max", _max) : axis_getMinMax($$, "max");
|
34048 | },
|
34049 |
|
34050 | /**
|
34051 | * Get and set axis min and max value.
|
34052 | * @function axis․range
|
34053 | * @instance
|
34054 | * @memberof Chart
|
34055 | * @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.
|
34056 | * @returns {object|undefined}
|
34057 | * @example
|
34058 | * // Update axis' label
|
34059 | * chart.axis.range({
|
34060 | * min: {
|
34061 | * x: -10,
|
34062 | * y: -1000,
|
34063 | * y2: -10000
|
34064 | * },
|
34065 | * max: {
|
34066 | * x: 100,
|
34067 | * y: 1000,
|
34068 | * y2: 10000
|
34069 | * },
|
34070 | * });
|
34071 | */
|
34072 | range: function range(_range) {
|
34073 | var axis = this.axis;
|
34074 |
|
34075 | if (arguments.length) {
|
34076 | isDefined(_range.max) && axis.max(_range.max);
|
34077 | isDefined(_range.min) && axis.min(_range.min);
|
34078 | } else {
|
34079 | return {
|
34080 | max: axis.max(),
|
34081 | min: axis.min()
|
34082 | };
|
34083 | }
|
34084 |
|
34085 | return undefined;
|
34086 | }
|
34087 | };
|
34088 | /* harmony default export */ var api_axis = ({
|
34089 | axis: axis
|
34090 | });
|
34091 | ;// CONCATENATED MODULE: ./src/Chart/api/category.ts
|
34092 | /**
|
34093 | * Copyright (c) 2017 ~ present NAVER Corp.
|
34094 | * billboard.js project is licensed under the MIT license
|
34095 | */
|
34096 | /* harmony default export */ var api_category = ({
|
34097 | /**
|
34098 | * Set specified category name on category axis.
|
34099 | * @function category
|
34100 | * @instance
|
34101 | * @memberof Chart
|
34102 | * @param {number} i index of category to be changed
|
34103 | * @param {string} category category value to be changed
|
34104 | * @returns {string}
|
34105 | * @example
|
34106 | * chart.category(2, "Category 3");
|
34107 | */
|
34108 | category: function category(i, _category) {
|
34109 | var $$ = this.internal,
|
34110 | config = $$.config;
|
34111 |
|
34112 | if (arguments.length > 1) {
|
34113 | config.axis_x_categories[i] = _category;
|
34114 | $$.redraw();
|
34115 | }
|
34116 |
|
34117 | return config.axis_x_categories[i];
|
34118 | },
|
34119 |
|
34120 | /**
|
34121 | * Set category names on category axis.
|
34122 | * @function categories
|
34123 | * @instance
|
34124 | * @memberof Chart
|
34125 | * @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.
|
34126 | * @returns {Array}
|
34127 | * @example
|
34128 | * chart.categories([
|
34129 | * "Category 1", "Category 2", ...
|
34130 | * ]);
|
34131 | */
|
34132 | categories: function categories(_categories) {
|
34133 | var $$ = this.internal,
|
34134 | config = $$.config;
|
34135 |
|
34136 | if (!arguments.length) {
|
34137 | return config.axis_x_categories;
|
34138 | }
|
34139 |
|
34140 | config.axis_x_categories = _categories;
|
34141 | $$.redraw();
|
34142 | return config.axis_x_categories;
|
34143 | }
|
34144 | });
|
34145 | ;// CONCATENATED MODULE: ./src/Chart/api/grid.x.ts
|
34146 | /**
|
34147 | * Copyright (c) 2017 ~ present NAVER Corp.
|
34148 | * billboard.js project is licensed under the MIT license
|
34149 | */
|
34150 |
|
34151 |
|
34152 | /**
|
34153 | * Update x grid lines.
|
34154 | * @function xgrids
|
34155 | * @instance
|
34156 | * @memberof Chart
|
34157 | * @param {Array} grids X grid lines will be replaced with this argument. The format of this argument is the same as grid.x.lines.
|
34158 | * @returns {object}
|
34159 | * @example
|
34160 | * // Show 2 x grid lines
|
34161 | * chart.xgrids([
|
34162 | * {value: 1, text: "Label 1"},
|
34163 | * {value: 4, text: "Label 4"}
|
34164 | * ]);
|
34165 | * // --> Returns: [{value: 1, text: "Label 1"}, {value: 4, text: "Label 4"}]
|
34166 | */
|
34167 | function xgrids(grids) {
|
34168 | var $$ = this.internal,
|
34169 | config = $$.config;
|
34170 |
|
34171 | if (!grids) {
|
34172 | return config.grid_x_lines;
|
34173 | }
|
34174 |
|
34175 | config.grid_x_lines = grids;
|
34176 | $$.redrawWithoutRescale();
|
34177 | return config.grid_x_lines;
|
34178 | }
|
34179 |
|
34180 | util_extend(xgrids, {
|
34181 | /**
|
34182 | * Add x grid lines.<br>
|
34183 | * This API adds new x grid lines instead of replacing like xgrids.
|
34184 | * @function xgrids․add
|
34185 | * @instance
|
34186 | * @memberof Chart
|
34187 | * @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.
|
34188 | * @returns {object}
|
34189 | * @example
|
34190 | * // Add a new x grid line
|
34191 | * chart.xgrids.add(
|
34192 | * {value: 4, text: "Label 4"}
|
34193 | * );
|
34194 | *
|
34195 | * // Add new x grid lines
|
34196 | * chart.xgrids.add([
|
34197 | * {value: 2, text: "Label 2"},
|
34198 | * {value: 4, text: "Label 4"}
|
34199 | * ]);
|
34200 | */
|
34201 | add: function add(grids) {
|
34202 | return this.xgrids(this.internal.config.grid_x_lines.concat(grids || []));
|
34203 | },
|
34204 |
|
34205 | /**
|
34206 | * Remove x grid lines.<br>
|
34207 | * This API removes x grid lines.
|
34208 | * @function xgrids․remove
|
34209 | * @instance
|
34210 | * @memberof Chart
|
34211 | * @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.
|
34212 | * @example
|
34213 | * // x grid line on x = 2 will be removed
|
34214 | * chart.xgrids.remove({value: 2});
|
34215 | *
|
34216 | * // x grid lines that have 'grid-A' will be removed
|
34217 | * chart.xgrids.remove({
|
34218 | * class: "grid-A"
|
34219 | * });
|
34220 | *
|
34221 | * // all of x grid lines will be removed
|
34222 | * chart.xgrids.remove();
|
34223 | */
|
34224 | remove: function remove(params) {
|
34225 | // TODO: multiple
|
34226 | this.internal.removeGridLines(params, !0);
|
34227 | }
|
34228 | });
|
34229 | /* harmony default export */ var grid_x = ({
|
34230 | xgrids: xgrids
|
34231 | });
|
34232 | ;// CONCATENATED MODULE: ./src/Chart/api/grid.y.ts
|
34233 | /**
|
34234 | * Copyright (c) 2017 ~ present NAVER Corp.
|
34235 | * billboard.js project is licensed under the MIT license
|
34236 | */
|
34237 |
|
34238 | /**
|
34239 | * Update y grid lines.
|
34240 | * @function ygrids
|
34241 | * @instance
|
34242 | * @memberof Chart
|
34243 | * @param {Array} grids Y grid lines will be replaced with this argument. The format of this argument is the same as grid.y.lines.
|
34244 | * @returns {object}
|
34245 | * @example
|
34246 | * // Show 2 y grid lines
|
34247 | * chart.ygrids([
|
34248 | * {value: 100, text: "Label 1"},
|
34249 | * {value: 400, text: "Label 4"}
|
34250 | * ]);
|
34251 | * // --> Returns: [{value: 100, text: "Label 1"}, {value: 400, text: "Label 4"}]
|
34252 | */
|
34253 |
|
34254 | function ygrids(grids) {
|
34255 | var $$ = this.internal,
|
34256 | config = $$.config;
|
34257 |
|
34258 | if (!grids) {
|
34259 | return config.grid_y_lines;
|
34260 | }
|
34261 |
|
34262 | config.grid_y_lines = grids;
|
34263 | $$.redrawWithoutRescale();
|
34264 | return config.grid_y_lines;
|
34265 | }
|
34266 |
|
34267 | util_extend(ygrids, {
|
34268 | /**
|
34269 | * Add y grid lines.<br>
|
34270 | * This API adds new y grid lines instead of replacing like ygrids.
|
34271 | * @function ygrids․add
|
34272 | * @instance
|
34273 | * @memberof Chart
|
34274 | * @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.
|
34275 | * @returns {object}
|
34276 | * @example
|
34277 | * // Add a new x grid line
|
34278 | * chart.ygrids.add(
|
34279 | * {value: 400, text: "Label 4"}
|
34280 | * );
|
34281 | *
|
34282 | * // Add new x grid lines
|
34283 | * chart.ygrids.add([
|
34284 | * {value: 200, text: "Label 2"},
|
34285 | * {value: 400, text: "Label 4"}
|
34286 | * ]);
|
34287 | */
|
34288 | add: function add(grids) {
|
34289 | return this.ygrids(this.internal.config.grid_y_lines.concat(grids || []));
|
34290 | },
|
34291 |
|
34292 | /**
|
34293 | * Remove y grid lines.<br>
|
34294 | * This API removes x grid lines.
|
34295 | * @function ygrids․remove
|
34296 | * @instance
|
34297 | * @memberof Chart
|
34298 | * @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.
|
34299 | * @param {number} [params.value] target value
|
34300 | * @param {string} [params.class] target class
|
34301 | * @example
|
34302 | * // y grid line on y = 200 will be removed
|
34303 | * chart.ygrids.remove({value: 200});
|
34304 | *
|
34305 | * // y grid lines that have 'grid-A' will be removed
|
34306 | * chart.ygrids.remove({
|
34307 | * class: "grid-A"
|
34308 | * });
|
34309 | *
|
34310 | * // all of y grid lines will be removed
|
34311 | * chart.ygrids.remove();
|
34312 | */
|
34313 | remove: function remove(params) {
|
34314 | // TODO: multiple
|
34315 | this.internal.removeGridLines(params, !1);
|
34316 | }
|
34317 | });
|
34318 | /* harmony default export */ var grid_y = ({
|
34319 | ygrids: ygrids
|
34320 | });
|
34321 | ;// CONCATENATED MODULE: ./src/Chart/api/group.ts
|
34322 | /**
|
34323 | * Copyright (c) 2017 ~ present NAVER Corp.
|
34324 | * billboard.js project is licensed under the MIT license
|
34325 | */
|
34326 |
|
34327 | /* harmony default export */ var group = ({
|
34328 | /**
|
34329 | * Update groups for the targets.
|
34330 | * @function groups
|
34331 | * @instance
|
34332 | * @memberof Chart
|
34333 | * @param {Array} groups This argument needs to be an Array that includes one or more Array that includes target ids to be grouped.
|
34334 | * @returns {Array} Grouped data names array
|
34335 | * @example
|
34336 | * // data1 and data2 will be a new group.
|
34337 | * chart.groups([
|
34338 | * ["data1", "data2"]
|
34339 | * ]);
|
34340 | */
|
34341 | groups: function groups(_groups) {
|
34342 | var $$ = this.internal,
|
34343 | config = $$.config;
|
34344 |
|
34345 | if (isUndefined(_groups)) {
|
34346 | return config.data_groups;
|
34347 | }
|
34348 |
|
34349 | config.data_groups = _groups;
|
34350 | $$.redraw();
|
34351 | return config.data_groups;
|
34352 | }
|
34353 | });
|
34354 | ;// CONCATENATED MODULE: ./src/Chart/api/regions.ts
|
34355 | /**
|
34356 | * Copyright (c) 2017 ~ present NAVER Corp.
|
34357 | * billboard.js project is licensed under the MIT license
|
34358 | */
|
34359 |
|
34360 |
|
34361 |
|
34362 | /**
|
34363 | * Update regions.
|
34364 | * @function regions
|
34365 | * @instance
|
34366 | * @memberof Chart
|
34367 | * @param {Array} regions Regions will be replaced with this argument. The format of this argument is the same as regions.
|
34368 | * @returns {Array} regions
|
34369 | * @example
|
34370 | * // Show 2 regions
|
34371 | * chart.regions([
|
34372 | * {axis: "x", start: 5, class: "regionX"},
|
34373 | * {axis: "y", end: 50, class: "regionY"}
|
34374 | * ]);
|
34375 | */
|
34376 | function regions(regions) {
|
34377 | var $$ = this.internal,
|
34378 | config = $$.config;
|
34379 |
|
34380 | if (!regions) {
|
34381 | return config.regions;
|
34382 | }
|
34383 |
|
34384 | config.regions = regions;
|
34385 | $$.redrawWithoutRescale();
|
34386 | return regions;
|
34387 | }
|
34388 |
|
34389 | util_extend(regions, {
|
34390 | /**
|
34391 | * Add new region.<br><br>
|
34392 | * This API adds new region instead of replacing like regions.
|
34393 | * @function regions․add
|
34394 | * @instance
|
34395 | * @memberof Chart
|
34396 | * @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.
|
34397 | * @returns {Array} regions
|
34398 | * @example
|
34399 | * // Add a new region
|
34400 | * chart.regions.add(
|
34401 | * {axis: "x", start: 5, class: "regionX"}
|
34402 | * );
|
34403 | *
|
34404 | * // Add new regions
|
34405 | * chart.regions.add([
|
34406 | * {axis: "x", start: 5, class: "regionX"},
|
34407 | * {axis: "y", end: 50, class: "regionY"}
|
34408 | *]);
|
34409 | */
|
34410 | add: function add(regions) {
|
34411 | var $$ = this.internal,
|
34412 | config = $$.config;
|
34413 |
|
34414 | if (!regions) {
|
34415 | return config.regions;
|
34416 | }
|
34417 |
|
34418 | config.regions = config.regions.concat(regions);
|
34419 | $$.redrawWithoutRescale();
|
34420 | return config.regions;
|
34421 | },
|
34422 |
|
34423 | /**
|
34424 | * Remove regions.<br><br>
|
34425 | * This API removes regions.
|
34426 | * @function regions․remove
|
34427 | * @instance
|
34428 | * @memberof Chart
|
34429 | * @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.
|
34430 | * @returns {Array} regions Removed regions
|
34431 | * @example
|
34432 | * // regions that have 'region-A' or 'region-B' will be removed.
|
34433 | * chart.regions.remove({
|
34434 | * classes: [
|
34435 | * "region-A", "region-B"
|
34436 | * ]
|
34437 | * });
|
34438 | *
|
34439 | * // all of regions will be removed.
|
34440 | * chart.regions.remove();
|
34441 | */
|
34442 | remove: function remove(optionsValue) {
|
34443 | var $$ = this.internal,
|
34444 | config = $$.config,
|
34445 | $T = $$.$T,
|
34446 | options = optionsValue || {},
|
34447 | classes = getOption(options, "classes", [config_classes.region]),
|
34448 | regions = $$.$el.main.select("." + config_classes.regions).selectAll(classes.map(function (c) {
|
34449 | return "." + c;
|
34450 | }));
|
34451 | $T(regions).style("opacity", "0").remove();
|
34452 | regions = config.regions;
|
34453 |
|
34454 | if (Object.keys(options).length) {
|
34455 | regions = regions.filter(function (region) {
|
34456 | var found = !1;
|
34457 |
|
34458 | if (!region.class) {
|
34459 | return !0;
|
34460 | }
|
34461 |
|
34462 | region.class.split(" ").forEach(function (c) {
|
34463 | if (classes.indexOf(c) >= 0) {
|
34464 | found = !0;
|
34465 | }
|
34466 | });
|
34467 | return !found;
|
34468 | });
|
34469 | config.regions = regions;
|
34470 | } else {
|
34471 | config.regions = [];
|
34472 | }
|
34473 |
|
34474 | return regions;
|
34475 | }
|
34476 | });
|
34477 | /* harmony default export */ var api_regions = ({
|
34478 | regions: regions
|
34479 | });
|
34480 | ;// CONCATENATED MODULE: ./src/Chart/api/x.ts
|
34481 | /**
|
34482 | * Copyright (c) 2017 ~ present NAVER Corp.
|
34483 | * billboard.js project is licensed under the MIT license
|
34484 | */
|
34485 |
|
34486 | /* harmony default export */ var x = ({
|
34487 | /**
|
34488 | * Get and set x values for the chart.
|
34489 | * @function x
|
34490 | * @instance
|
34491 | * @memberof Chart
|
34492 | * @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.
|
34493 | * @returns {object} xs
|
34494 | * @example
|
34495 | * // Get current x values
|
34496 | * chart.x();
|
34497 | *
|
34498 | * // Update x values for all targets
|
34499 | * chart.x([100, 200, 300, 400, ...]);
|
34500 | */
|
34501 | x: function x(_x) {
|
34502 | var $$ = this.internal,
|
34503 | axis = $$.axis,
|
34504 | data = $$.data,
|
34505 | isCategorized = axis.isCustomX() && axis.isCategorized();
|
34506 |
|
34507 | if (isArray(_x)) {
|
34508 | if (isCategorized) {
|
34509 | this.categories(_x);
|
34510 | } else {
|
34511 | $$.updateTargetX(data.targets, _x);
|
34512 | $$.redraw({
|
34513 | withUpdateOrgXDomain: !0,
|
34514 | withUpdateXDomain: !0
|
34515 | });
|
34516 | }
|
34517 | }
|
34518 |
|
34519 | return isCategorized ? this.categories() : data.xs;
|
34520 | },
|
34521 |
|
34522 | /**
|
34523 | * Get and set x values for the chart.
|
34524 | * @function xs
|
34525 | * @instance
|
34526 | * @memberof Chart
|
34527 | * @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.
|
34528 | * @returns {object} xs
|
34529 | * @example
|
34530 | * // Get current x values
|
34531 | * chart.xs();
|
34532 | *
|
34533 | * // Update x values for all targets
|
34534 | * chart.xs({
|
34535 | * data1: [10, 20, 30, 40, ...],
|
34536 | * data2: [100, 200, 300, 400, ...]
|
34537 | * });
|
34538 | */
|
34539 | xs: function xs(_xs) {
|
34540 | var $$ = this.internal;
|
34541 |
|
34542 | if (isObject(_xs)) {
|
34543 | $$.updateTargetXs($$.data.targets, _xs);
|
34544 | $$.redraw({
|
34545 | withUpdateOrgXDomain: !0,
|
34546 | withUpdateXDomain: !0
|
34547 | });
|
34548 | }
|
34549 |
|
34550 | return $$.data.xs;
|
34551 | }
|
34552 | });
|
34553 | ;// CONCATENATED MODULE: ./src/Chart/api/flow.ts
|
34554 | /**
|
34555 | * Copyright (c) 2017 ~ present NAVER Corp.
|
34556 | * billboard.js project is licensed under the MIT license
|
34557 | */
|
34558 |
|
34559 | /* harmony default export */ var flow = ({
|
34560 | /**
|
34561 | * Flow data to the chart.<br><br>
|
34562 | * By this API, you can append new data points to the chart.
|
34563 | * @function flow
|
34564 | * @instance
|
34565 | * @memberof Chart
|
34566 | * @param {object} args The object can consist with following members:<br>
|
34567 | *
|
34568 | * | Key | Type | Description |
|
34569 | * | --- | --- | --- |
|
34570 | * | json | Object | Data as JSON format (@see [data․json](Options.html#.data%25E2%2580%25A4json)) |
|
34571 | * | rows | Array | Data in array as row format (@see [data․rows](Options.html#.data%25E2%2580%25A4json)) |
|
34572 | * | columns | Array | Data in array as column format (@see [data․columns](Options.html#.data%25E2%2580%25A4columns)) |
|
34573 | * | 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 |
|
34574 | * | length | Number | The lower x edge will move by the number of this argument |
|
34575 | * | duration | Number | The duration of the transition will be specified value. If not given, transition.duration will be used as default |
|
34576 | * | done | Function | The specified function will be called when flow ends |
|
34577 | *
|
34578 | * - **NOTE:**
|
34579 | * - If json, rows and columns given, the data will be loaded.
|
34580 | * - If data that has the same target id is given, the chart will be appended.
|
34581 | * - Otherwise, new target will be added. One of these is required when calling.
|
34582 | * - If json specified, keys is required as well as data.json.
|
34583 | * - If tab isn't visible(by evaluating `document.hidden`), will not be executed to prevent unnecessary work.
|
34584 | * @example
|
34585 | * // 2 data points will be apprended to the tail and popped from the head.
|
34586 | * // After that, 4 data points will be appended and no data points will be poppoed.
|
34587 | * chart.flow({
|
34588 | * columns: [
|
34589 | * ["x", "2018-01-11", "2018-01-21"],
|
34590 | * ["data1", 500, 200],
|
34591 | * ["data2", 100, 300],
|
34592 | * ["data3", 200, 120]
|
34593 | * ],
|
34594 | * to: "2013-01-11",
|
34595 | * done: function () {
|
34596 | * chart.flow({
|
34597 | * columns: [
|
34598 | * ["x", "2018-02-11", "2018-02-12", "2018-02-13", "2018-02-14"],
|
34599 | * ["data1", 200, 300, 100, 250],
|
34600 | * ["data2", 100, 90, 40, 120],
|
34601 | * ["data3", 100, 100, 300, 500]
|
34602 | * ],
|
34603 | * length: 2,
|
34604 | * duration: 1500
|
34605 | * });
|
34606 | * }
|
34607 | * });
|
34608 | */
|
34609 | flow: function flow(args) {
|
34610 | var $$ = this.internal,
|
34611 | data,
|
34612 | domain,
|
34613 | length = 0,
|
34614 | tail = 0,
|
34615 | diff,
|
34616 | to;
|
34617 |
|
34618 | if (args.json || args.rows || args.columns) {
|
34619 | data = $$.convertData(args);
|
34620 | }
|
34621 |
|
34622 | if ($$.state.redrawing || !data || !isTabVisible()) {
|
34623 | return;
|
34624 | }
|
34625 |
|
34626 | var notfoundIds = [],
|
34627 | orgDataCount = $$.getMaxDataCount(),
|
34628 | targets = $$.convertDataToTargets(data, !0),
|
34629 | isTimeSeries = $$.axis.isTimeSeries();
|
34630 | // Update/Add data
|
34631 | $$.data.targets.forEach(function (t) {
|
34632 | var found = !1;
|
34633 |
|
34634 | for (var i = 0; i < targets.length; i++) {
|
34635 | if (t.id === targets[i].id) {
|
34636 | found = !0;
|
34637 |
|
34638 | if (t.values[t.values.length - 1]) {
|
34639 | tail = t.values[t.values.length - 1].index + 1;
|
34640 | }
|
34641 |
|
34642 | length = targets[i].values.length;
|
34643 |
|
34644 | for (var j = 0; j < length; j++) {
|
34645 | targets[i].values[j].index = tail + j;
|
34646 |
|
34647 | if (!isTimeSeries) {
|
34648 | targets[i].values[j].x = tail + j;
|
34649 | }
|
34650 | }
|
34651 |
|
34652 | t.values = t.values.concat(targets[i].values);
|
34653 | targets.splice(i, 1);
|
34654 | break;
|
34655 | }
|
34656 | }
|
34657 |
|
34658 | found || notfoundIds.push(t.id);
|
34659 | }); // Append null for not found targets
|
34660 |
|
34661 | $$.data.targets.forEach(function (t) {
|
34662 | for (var i = 0; i < notfoundIds.length; i++) {
|
34663 | if (t.id === notfoundIds[i]) {
|
34664 | tail = t.values[t.values.length - 1].index + 1;
|
34665 |
|
34666 | for (var j = 0; j < length; j++) {
|
34667 | t.values.push({
|
34668 | id: t.id,
|
34669 | index: tail + j,
|
34670 | x: isTimeSeries ? $$.getOtherTargetX(tail + j) : tail + j,
|
34671 | value: null
|
34672 | });
|
34673 | }
|
34674 | }
|
34675 | }
|
34676 | }); // Generate null values for new target
|
34677 |
|
34678 | if ($$.data.targets.length) {
|
34679 | targets.forEach(function (t) {
|
34680 | var missing = [];
|
34681 |
|
34682 | for (var i = $$.data.targets[0].values[0].index; i < tail; i++) {
|
34683 | missing.push({
|
34684 | id: t.id,
|
34685 | index: i,
|
34686 | x: isTimeSeries ? $$.getOtherTargetX(i) : i,
|
34687 | value: null
|
34688 | });
|
34689 | }
|
34690 |
|
34691 | t.values.forEach(function (v) {
|
34692 | v.index += tail;
|
34693 |
|
34694 | if (!isTimeSeries) {
|
34695 | v.x += tail;
|
34696 | }
|
34697 | });
|
34698 | t.values = missing.concat(t.values);
|
34699 | });
|
34700 | }
|
34701 |
|
34702 | $$.data.targets = $$.data.targets.concat(targets); // add remained
|
34703 | // check data count because behavior needs to change when it"s only one
|
34704 | // const dataCount = $$.getMaxDataCount();
|
34705 |
|
34706 | var baseTarget = $$.data.targets[0],
|
34707 | baseValue = baseTarget.values[0];
|
34708 |
|
34709 | // Update length to flow if needed
|
34710 | if (isDefined(args.to)) {
|
34711 | length = 0;
|
34712 | to = isTimeSeries ? parseDate.call($$, args.to) : args.to;
|
34713 | baseTarget.values.forEach(function (v) {
|
34714 | v.x < to && length++;
|
34715 | });
|
34716 | } else if (isDefined(args.length)) {
|
34717 | length = args.length;
|
34718 | } // If only one data, update the domain to flow from left edge of the chart
|
34719 |
|
34720 |
|
34721 | if (!orgDataCount) {
|
34722 | if (isTimeSeries) {
|
34723 | diff = baseTarget.values.length > 1 ? baseTarget.values[baseTarget.values.length - 1].x - baseValue.x : baseValue.x - $$.getXDomain($$.data.targets)[0];
|
34724 | } else {
|
34725 | diff = 1;
|
34726 | }
|
34727 |
|
34728 | domain = [baseValue.x - diff, baseValue.x];
|
34729 | } else if (orgDataCount === 1 && isTimeSeries) {
|
34730 | diff = (baseTarget.values[baseTarget.values.length - 1].x - baseValue.x) / 2;
|
34731 | domain = [new Date(+baseValue.x - diff), new Date(+baseValue.x + diff)];
|
34732 | }
|
34733 |
|
34734 | domain && $$.updateXDomain(null, !0, !0, !1, domain); // Set targets
|
34735 |
|
34736 | $$.updateTargets($$.data.targets); // Redraw with new targets
|
34737 |
|
34738 | $$.redraw({
|
34739 | flow: {
|
34740 | index: baseValue.index,
|
34741 | length: length,
|
34742 | duration: isValue(args.duration) ? args.duration : $$.config.transition_duration,
|
34743 | done: args.done,
|
34744 | orgDataCount: orgDataCount
|
34745 | },
|
34746 | withLegend: !0,
|
34747 | withTransition: orgDataCount > 1,
|
34748 | withTrimXDomain: !1,
|
34749 | withUpdateXAxis: !0
|
34750 | });
|
34751 | }
|
34752 | });
|
34753 | ;// CONCATENATED MODULE: ./node_modules/d3-axis/src/identity.js
|
34754 | /* harmony default export */ function d3_axis_src_identity(x) {
|
34755 | return x;
|
34756 | }
|
34757 | ;// CONCATENATED MODULE: ./node_modules/d3-axis/src/axis.js
|
34758 |
|
34759 | var axis_top = 1,
|
34760 | right = 2,
|
34761 | bottom = 3,
|
34762 | left = 4,
|
34763 | axis_epsilon = 1e-6;
|
34764 |
|
34765 | function translateX(x) {
|
34766 | return "translate(" + x + ",0)";
|
34767 | }
|
34768 |
|
34769 | function translateY(y) {
|
34770 | return "translate(0," + y + ")";
|
34771 | }
|
34772 |
|
34773 | function axis_number(scale) {
|
34774 | return function (d) {
|
34775 | return +scale(d);
|
34776 | };
|
34777 | }
|
34778 |
|
34779 | function center(scale, offset) {
|
34780 | offset = Math.max(0, scale.bandwidth() - offset * 2) / 2;
|
34781 | if (scale.round()) offset = Math.round(offset);
|
34782 | return function (d) {
|
34783 | return +scale(d) + offset;
|
34784 | };
|
34785 | }
|
34786 |
|
34787 | function entering() {
|
34788 | return !this.__axis;
|
34789 | }
|
34790 |
|
34791 | function axis_axis(orient, scale) {
|
34792 | var tickArguments = [],
|
34793 | tickValues = null,
|
34794 | tickFormat = null,
|
34795 | tickSizeInner = 6,
|
34796 | tickSizeOuter = 6,
|
34797 | tickPadding = 3,
|
34798 | offset = typeof window !== "undefined" && window.devicePixelRatio > 1 ? 0 : .5,
|
34799 | k = orient === axis_top || orient === left ? -1 : 1,
|
34800 | x = orient === left || orient === right ? "x" : "y",
|
34801 | transform = orient === axis_top || orient === bottom ? translateX : translateY;
|
34802 |
|
34803 | function axis(context) {
|
34804 | var values = tickValues == null ? scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain() : tickValues,
|
34805 | format = tickFormat == null ? scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : d3_axis_src_identity : tickFormat,
|
34806 | spacing = Math.max(tickSizeInner, 0) + tickPadding,
|
34807 | range = scale.range(),
|
34808 | range0 = +range[0] + offset,
|
34809 | range1 = +range[range.length - 1] + offset,
|
34810 | position = (scale.bandwidth ? center : axis_number)(scale.copy(), offset),
|
34811 | selection = context.selection ? context.selection() : context,
|
34812 | path = selection.selectAll(".domain").data([null]),
|
34813 | tick = selection.selectAll(".tick").data(values, scale).order(),
|
34814 | tickExit = tick.exit(),
|
34815 | tickEnter = tick.enter().append("g").attr("class", "tick"),
|
34816 | line = tick.select("line"),
|
34817 | text = tick.select("text");
|
34818 | path = path.merge(path.enter().insert("path", ".tick").attr("class", "domain").attr("stroke", "currentColor"));
|
34819 | tick = tick.merge(tickEnter);
|
34820 | line = line.merge(tickEnter.append("line").attr("stroke", "currentColor").attr(x + "2", k * tickSizeInner));
|
34821 | 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"));
|
34822 |
|
34823 | if (context !== selection) {
|
34824 | path = path.transition(context);
|
34825 | tick = tick.transition(context);
|
34826 | line = line.transition(context);
|
34827 | text = text.transition(context);
|
34828 | tickExit = tickExit.transition(context).attr("opacity", axis_epsilon).attr("transform", function (d) {
|
34829 | return isFinite(d = position(d)) ? transform(d + offset) : this.getAttribute("transform");
|
34830 | });
|
34831 | tickEnter.attr("opacity", axis_epsilon).attr("transform", function (d) {
|
34832 | var p = this.parentNode.__axis;
|
34833 | return transform((p && isFinite(p = p(d)) ? p : position(d)) + offset);
|
34834 | });
|
34835 | }
|
34836 |
|
34837 | tickExit.remove();
|
34838 | 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);
|
34839 | tick.attr("opacity", 1).attr("transform", function (d) {
|
34840 | return transform(position(d) + offset);
|
34841 | });
|
34842 | line.attr(x + "2", k * tickSizeInner);
|
34843 | text.attr(x, k * spacing).text(format);
|
34844 | 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");
|
34845 | selection.each(function () {
|
34846 | this.__axis = position;
|
34847 | });
|
34848 | }
|
34849 |
|
34850 | axis.scale = function (_) {
|
34851 | return arguments.length ? (scale = _, axis) : scale;
|
34852 | };
|
34853 |
|
34854 | axis.ticks = function () {
|
34855 | return tickArguments = Array.from(arguments), axis;
|
34856 | };
|
34857 |
|
34858 | axis.tickArguments = function (_) {
|
34859 | return arguments.length ? (tickArguments = _ == null ? [] : Array.from(_), axis) : tickArguments.slice();
|
34860 | };
|
34861 |
|
34862 | axis.tickValues = function (_) {
|
34863 | return arguments.length ? (tickValues = _ == null ? null : Array.from(_), axis) : tickValues && tickValues.slice();
|
34864 | };
|
34865 |
|
34866 | axis.tickFormat = function (_) {
|
34867 | return arguments.length ? (tickFormat = _, axis) : tickFormat;
|
34868 | };
|
34869 |
|
34870 | axis.tickSize = function (_) {
|
34871 | return arguments.length ? (tickSizeInner = tickSizeOuter = +_, axis) : tickSizeInner;
|
34872 | };
|
34873 |
|
34874 | axis.tickSizeInner = function (_) {
|
34875 | return arguments.length ? (tickSizeInner = +_, axis) : tickSizeInner;
|
34876 | };
|
34877 |
|
34878 | axis.tickSizeOuter = function (_) {
|
34879 | return arguments.length ? (tickSizeOuter = +_, axis) : tickSizeOuter;
|
34880 | };
|
34881 |
|
34882 | axis.tickPadding = function (_) {
|
34883 | return arguments.length ? (tickPadding = +_, axis) : tickPadding;
|
34884 | };
|
34885 |
|
34886 | axis.offset = function (_) {
|
34887 | return arguments.length ? (offset = +_, axis) : offset;
|
34888 | };
|
34889 |
|
34890 | return axis;
|
34891 | }
|
34892 |
|
34893 | function axisTop(scale) {
|
34894 | return axis_axis(axis_top, scale);
|
34895 | }
|
34896 | function axisRight(scale) {
|
34897 | return axis_axis(right, scale);
|
34898 | }
|
34899 | function axisBottom(scale) {
|
34900 | return axis_axis(bottom, scale);
|
34901 | }
|
34902 | function axisLeft(scale) {
|
34903 | return axis_axis(left, scale);
|
34904 | }
|
34905 | ;// CONCATENATED MODULE: ./src/ChartInternal/Axis/AxisRendererHelper.ts
|
34906 | /**
|
34907 | * Copyright (c) 2017 ~ present NAVER Corp.
|
34908 | * billboard.js project is licensed under the MIT license
|
34909 | * @ignore
|
34910 | */
|
34911 |
|
34912 |
|
34913 |
|
34914 | var AxisRendererHelper = /*#__PURE__*/function () {
|
34915 | function AxisRendererHelper(owner) {
|
34916 | this.owner = void 0;
|
34917 | this.config = void 0;
|
34918 | this.scale = void 0;
|
34919 | var scale = getScale(),
|
34920 | config = owner.config,
|
34921 | params = owner.params;
|
34922 | this.owner = owner;
|
34923 | this.config = config;
|
34924 | this.scale = scale;
|
34925 |
|
34926 | if (config.noTransition || !params.config.transition_duration) {
|
34927 | config.withoutTransition = !0;
|
34928 | } // set range
|
34929 |
|
34930 |
|
34931 | config.range = this.scaleExtent((params.orgXScale || scale).range());
|
34932 | }
|
34933 | /**
|
34934 | * Compute a character dimension
|
34935 | * @param {d3.selection} node <g class=tick> node
|
34936 | * @returns {{w: number, h: number}}
|
34937 | * @private
|
34938 | */
|
34939 |
|
34940 |
|
34941 | AxisRendererHelper.getSizeFor1Char = function getSizeFor1Char(node) {
|
34942 | // default size for one character
|
34943 | var size = {
|
34944 | w: 5.5,
|
34945 | h: 11.5
|
34946 | };
|
34947 | node.empty() || node.select("text").text("0").call(function (el) {
|
34948 | try {
|
34949 | var _el$node$getBBox = el.node().getBBox(),
|
34950 | width = _el$node$getBBox.width,
|
34951 | height = _el$node$getBBox.height;
|
34952 |
|
34953 | if (width && height) {
|
34954 | size.w = width;
|
34955 | size.h = height;
|
34956 | }
|
34957 | } catch (e) {} finally {
|
34958 | el.text("");
|
34959 | }
|
34960 | });
|
34961 |
|
34962 | this.getSizeFor1Char = function () {
|
34963 | return size;
|
34964 | };
|
34965 |
|
34966 | return size;
|
34967 | }
|
34968 | /**
|
34969 | * Get tick transform setter function
|
34970 | * @param {string} id Axis id
|
34971 | * @returns {Function} transfrom setter function
|
34972 | * @private
|
34973 | */
|
34974 | ;
|
34975 |
|
34976 | var _proto = AxisRendererHelper.prototype;
|
34977 |
|
34978 | _proto.getTickTransformSetter = function getTickTransformSetter(id) {
|
34979 | var config = this.config,
|
34980 | fn = id === "x" ? function (value) {
|
34981 | return "translate(" + (value + config.tickOffset) + ",0)";
|
34982 | } : function (value) {
|
34983 | return "translate(0," + value + ")";
|
34984 | };
|
34985 | return function (selection, scale) {
|
34986 | selection.attr("transform", function (d) {
|
34987 | return fn(Math.ceil(scale(d)));
|
34988 | });
|
34989 | };
|
34990 | };
|
34991 |
|
34992 | _proto.scaleExtent = function scaleExtent(domain) {
|
34993 | var start = domain[0],
|
34994 | stop = domain[domain.length - 1];
|
34995 | return start < stop ? [start, stop] : [stop, start];
|
34996 | };
|
34997 |
|
34998 | _proto.generateTicks = function generateTicks(scale, isYAxes) {
|
34999 | var tickStepSize = this.owner.params.tickStepSize,
|
35000 | _scale$domain = scale.domain(),
|
35001 | start = _scale$domain[0],
|
35002 | end = _scale$domain[1],
|
35003 | ticks = [];
|
35004 |
|
35005 | // When 'axis[y|y2].tick.stepSize' option is set
|
35006 | if (isYAxes && tickStepSize) {
|
35007 | var interval = Math.round(start);
|
35008 |
|
35009 | while (interval <= end) {
|
35010 | ticks.push(interval);
|
35011 | interval += tickStepSize;
|
35012 | }
|
35013 | } else if (scale.ticks) {
|
35014 | var tickArguments = this.config.tickArguments; // adjust excessive tick count show
|
35015 |
|
35016 | if (scale.type === "log" && !tickArguments) {
|
35017 | // nicer symlog ticks didn't implemented yet: https://github.com/d3/d3-scale/issues/162
|
35018 | // get ticks values from logScale
|
35019 | var s = getScale("_log").domain([start > 0 ? start : 1, end]).range(scale.range());
|
35020 | ticks = s.ticks();
|
35021 |
|
35022 | for (var cnt = end.toFixed().length; ticks.length > 15; cnt--) {
|
35023 | ticks = s.ticks(cnt);
|
35024 | }
|
35025 |
|
35026 | ticks.splice(0, 1, start);
|
35027 | ticks.splice(ticks.length - 1, 1, end);
|
35028 | } else {
|
35029 | ticks = scale.ticks.apply(scale, this.config.tickArguments || []);
|
35030 | }
|
35031 |
|
35032 | ticks = ticks.map(function (v) {
|
35033 | // round the tick value if is number
|
35034 | var r = isString(v) && isNumber(v) && !isNaN(v) && Math.round(v * 10) / 10 || v;
|
35035 | return r;
|
35036 | });
|
35037 | } else {
|
35038 | for (var i = Math.ceil(start); i < end; i++) {
|
35039 | ticks.push(i);
|
35040 | }
|
35041 |
|
35042 | if (ticks.length > 0 && ticks[0] > 0) {
|
35043 | ticks.unshift(ticks[0] - (ticks[1] - ticks[0]));
|
35044 | }
|
35045 | }
|
35046 |
|
35047 | return ticks;
|
35048 | };
|
35049 |
|
35050 | _proto.copyScale = function copyScale() {
|
35051 | var newScale = this.scale.copy();
|
35052 |
|
35053 | if (!newScale.domain().length) {
|
35054 | newScale.domain(this.scale.domain());
|
35055 | }
|
35056 |
|
35057 | newScale.type = this.scale.type;
|
35058 | return newScale;
|
35059 | };
|
35060 |
|
35061 | _proto.textFormatted = function textFormatted(v) {
|
35062 | var tickFormat = this.config.tickFormat,
|
35063 | value = /\d+\.\d+0{5,}\d$/.test(v) ? +(v + "").replace(/0+\d$/, "") : v,
|
35064 | formatted = tickFormat ? tickFormat(value) : value; // to round float numbers from 'binary floating point'
|
35065 | // https://en.wikipedia.org/wiki/Double-precision_floating-point_format
|
35066 | // https://stackoverflow.com/questions/17849101/laymans-explanation-for-why-javascript-has-weird-floating-math-ieee-754-stand
|
35067 |
|
35068 | return isDefined(formatted) ? formatted : "";
|
35069 | };
|
35070 |
|
35071 | _proto.transitionise = function transitionise(selection) {
|
35072 | var config = this.config,
|
35073 | transitionSelection = selection;
|
35074 |
|
35075 | if (config.withoutTransition) {
|
35076 | transitionSelection = selection.interrupt();
|
35077 | } else if (config.transition || !this.owner.params.noTransition) {
|
35078 | // prevent for 'transition not found' case
|
35079 | // https://github.com/naver/billboard.js/issues/2140
|
35080 | try {
|
35081 | transitionSelection = selection.transition(config.transition);
|
35082 | } catch (e) {}
|
35083 | }
|
35084 |
|
35085 | return transitionSelection;
|
35086 | };
|
35087 |
|
35088 | return AxisRendererHelper;
|
35089 | }();
|
35090 |
|
35091 |
|
35092 | ;// CONCATENATED MODULE: ./src/ChartInternal/Axis/AxisRenderer.ts
|
35093 | /**
|
35094 | * Copyright (c) 2017 ~ present NAVER Corp.
|
35095 | * billboard.js project is licensed under the MIT license
|
35096 | * @ignore
|
35097 | */
|
35098 |
|
35099 |
|
35100 |
|
35101 |
|
35102 | var AxisRenderer = /*#__PURE__*/function () {
|
35103 | function AxisRenderer(params) {
|
35104 | if (params === void 0) {
|
35105 | params = {};
|
35106 | }
|
35107 |
|
35108 | this.helper = void 0;
|
35109 | this.config = void 0;
|
35110 | this.params = void 0;
|
35111 | this.g = void 0;
|
35112 | var config = {
|
35113 | innerTickSize: 6,
|
35114 | outerTickSize: params.outerTick ? 6 : 0,
|
35115 | orient: "bottom",
|
35116 | range: [],
|
35117 | tickArguments: null,
|
35118 | tickCentered: null,
|
35119 | tickCulling: !0,
|
35120 | tickFormat: null,
|
35121 | tickLength: 9,
|
35122 | tickOffset: 0,
|
35123 | tickPadding: 3,
|
35124 | tickValues: null,
|
35125 | transition: null,
|
35126 | noTransition: params.noTransition
|
35127 | };
|
35128 | config.tickLength = Math.max(config.innerTickSize, 0) + config.tickPadding;
|
35129 | this.config = config;
|
35130 | this.params = params;
|
35131 | this.helper = new AxisRendererHelper(this);
|
35132 | }
|
35133 | /**
|
35134 | * Create axis element
|
35135 | * @param {d3.selection} g Axis selection
|
35136 | * @private
|
35137 | */
|
35138 |
|
35139 |
|
35140 | var _proto = AxisRenderer.prototype;
|
35141 |
|
35142 | _proto.create = function create(g) {
|
35143 | var ctx = this,
|
35144 | config = this.config,
|
35145 | helper = this.helper,
|
35146 | params = this.params,
|
35147 | scale = helper.scale,
|
35148 | orient = config.orient,
|
35149 | splitTickText = this.splitTickText.bind(this),
|
35150 | isLeftRight = /^(left|right)$/.test(orient),
|
35151 | isTopBottom = /^(top|bottom)$/.test(orient),
|
35152 | tickTransform = helper.getTickTransformSetter(isTopBottom ? "x" : "y"),
|
35153 | axisPx = tickTransform === helper.axisX ? "y" : "x",
|
35154 | sign = /^(top|left)$/.test(orient) ? -1 : 1,
|
35155 | rotate = params.tickTextRotate;
|
35156 | this.config.range = scale.rangeExtent ? scale.rangeExtent() : helper.scaleExtent((params.orgXScale || scale).range());
|
35157 | var _config2 = config,
|
35158 | innerTickSize = _config2.innerTickSize,
|
35159 | tickLength = _config2.tickLength,
|
35160 | range = _config2.range,
|
35161 | id = params.id,
|
35162 | tickTextPos = id && /^(x|y|y2)$/.test(id) ? params.config["axis_" + id + "_tick_text_position"] : {
|
35163 | x: 0,
|
35164 | y: 0
|
35165 | },
|
35166 | prefix = id === "subX" ? "subchart_axis_x" : "axis_" + id,
|
35167 | axisShow = params.config[prefix + "_show"],
|
35168 | tickShow = {
|
35169 | tick: axisShow ? params.config[prefix + "_tick_show"] : !1,
|
35170 | text: axisShow ? params.config[prefix + "_tick_text_show"] : !1
|
35171 | },
|
35172 | $g; // // get the axis' tick position configuration
|
35173 |
|
35174 | g.each(function () {
|
35175 | var g = src_select(this),
|
35176 | scale0 = this.__chart__ || scale,
|
35177 | scale1 = helper.copyScale();
|
35178 | $g = g;
|
35179 | this.__chart__ = scale1;
|
35180 | config.tickOffset = params.isCategory ? Math.ceil((scale1(1) - scale1(0)) / 2) : 0; // update selection - data join
|
35181 |
|
35182 | var path = g.selectAll(".domain").data([0]); // enter + update selection
|
35183 |
|
35184 | path.enter().append("path").attr("class", "domain") // https://observablehq.com/@d3/d3-selection-2-0
|
35185 | .merge(path).attr("d", function () {
|
35186 | var outerTickSized = config.outerTickSize * sign;
|
35187 | return isTopBottom ? "M" + range[0] + "," + outerTickSized + "V0H" + range[1] + "V" + outerTickSized : "M" + outerTickSized + "," + range[0] + "H0V" + range[1] + "H" + outerTickSized;
|
35188 | });
|
35189 |
|
35190 | if (tickShow.tick || tickShow.text) {
|
35191 | // count of tick data in array
|
35192 | var ticks = config.tickValues || helper.generateTicks(scale1, isLeftRight),
|
35193 | tick = g.selectAll(".tick").data(ticks, scale1),
|
35194 | tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick"),
|
35195 | tickExit = tick.exit().remove(); // update selection
|
35196 |
|
35197 | // enter + update selection
|
35198 | tick = tickEnter.merge(tick);
|
35199 | tickShow.tick && tickEnter.append("line");
|
35200 | tickShow.text && tickEnter.append("text");
|
35201 | var sizeFor1Char = AxisRendererHelper.getSizeFor1Char(tick),
|
35202 | counts = [],
|
35203 | tspan = tick.select("text").selectAll("tspan").data(function (d, index) {
|
35204 | var split = params.tickMultiline ? splitTickText(d, scale1, ticks, isLeftRight, sizeFor1Char.w) : isArray(helper.textFormatted(d)) ? helper.textFormatted(d).concat() : [helper.textFormatted(d)];
|
35205 | counts[index] = split.length;
|
35206 | return split.map(function (splitted) {
|
35207 | return {
|
35208 | index: index,
|
35209 | splitted: splitted
|
35210 | };
|
35211 | });
|
35212 | });
|
35213 | tspan.exit().remove();
|
35214 | tspan = tspan.enter().append("tspan").merge(tspan).text(function (d) {
|
35215 | return d.splitted;
|
35216 | }); // set <tspan>'s position
|
35217 |
|
35218 | tspan.attr("x", isTopBottom ? 0 : tickLength * sign).attr("dx", function () {
|
35219 | var dx = 0;
|
35220 |
|
35221 | if (/(top|bottom)/.test(orient) && rotate) {
|
35222 | dx = 8 * Math.sin(Math.PI * (rotate / 180)) * (orient === "top" ? -1 : 1);
|
35223 | }
|
35224 |
|
35225 | return dx + (tickTextPos.x || 0);
|
35226 | }()).attr("dy", function (d, i) {
|
35227 | var dy = 0;
|
35228 |
|
35229 | if (orient !== "top") {
|
35230 | dy = sizeFor1Char.h;
|
35231 |
|
35232 | if (i === 0) {
|
35233 | dy = isLeftRight ? -((counts[d.index] - 1) * (sizeFor1Char.h / 2) - 3) : tickTextPos.y === 0 ? ".71em" : 0;
|
35234 | }
|
35235 | }
|
35236 |
|
35237 | return isNumber(dy) && tickTextPos.y ? dy + tickTextPos.y : dy || ".71em";
|
35238 | });
|
35239 | var lineUpdate = tick.select("line"),
|
35240 | textUpdate = tick.select("text");
|
35241 | tickEnter.select("line").attr(axisPx + "2", innerTickSize * sign);
|
35242 | tickEnter.select("text").attr(axisPx, tickLength * sign);
|
35243 | ctx.setTickLineTextPosition(lineUpdate, textUpdate); // Append <title> for tooltip display
|
35244 |
|
35245 | if (params.tickTitle) {
|
35246 | var title = textUpdate.select("title");
|
35247 | (title.empty() ? textUpdate.append("title") : title).text(function (index) {
|
35248 | return params.tickTitle[index];
|
35249 | });
|
35250 | }
|
35251 |
|
35252 | if (scale1.bandwidth) {
|
35253 | var x = scale1,
|
35254 | dx = x.bandwidth() / 2;
|
35255 |
|
35256 | scale0 = function (d) {
|
35257 | return x(d) + dx;
|
35258 | };
|
35259 |
|
35260 | scale1 = scale0;
|
35261 | } else if (scale0.bandwidth) {
|
35262 | scale0 = scale1;
|
35263 | } else {
|
35264 | tickTransform(tickExit, scale1);
|
35265 | } // when .flow(), it should follow flow's transition config
|
35266 | // otherwise make to use ChartInternals.$T()
|
35267 |
|
35268 |
|
35269 | tick = params.owner.state.flowing ? helper.transitionise(tick) : params.owner.$T(tick);
|
35270 | tickTransform(tickEnter, scale0);
|
35271 | tickTransform(tick.style("opacity", null), scale1);
|
35272 | }
|
35273 | });
|
35274 | this.g = $g;
|
35275 | }
|
35276 | /**
|
35277 | * Get tick x/y coordinate
|
35278 | * @returns {{x: number, y: number}}
|
35279 | * @private
|
35280 | */
|
35281 | ;
|
35282 |
|
35283 | _proto.getTickXY = function getTickXY() {
|
35284 | var config = this.config,
|
35285 | pos = {
|
35286 | x: 0,
|
35287 | y: 0
|
35288 | };
|
35289 |
|
35290 | if (this.params.isCategory) {
|
35291 | pos.x = config.tickCentered ? 0 : config.tickOffset;
|
35292 | pos.y = config.tickCentered ? config.tickOffset : 0;
|
35293 | }
|
35294 |
|
35295 | return pos;
|
35296 | }
|
35297 | /**
|
35298 | * Get tick size
|
35299 | * @param {object} d data object
|
35300 | * @returns {number}
|
35301 | * @private
|
35302 | */
|
35303 | ;
|
35304 |
|
35305 | _proto.getTickSize = function getTickSize(d) {
|
35306 | var scale = this.helper.scale,
|
35307 | config = this.config,
|
35308 | _config3 = config,
|
35309 | innerTickSize = _config3.innerTickSize,
|
35310 | range = _config3.range,
|
35311 | tickPosition = scale(d) + (config.tickCentered ? 0 : config.tickOffset);
|
35312 | return range[0] < tickPosition && tickPosition < range[1] ? innerTickSize : 0;
|
35313 | }
|
35314 | /**
|
35315 | * Set tick's line & text position
|
35316 | * @param {d3.selection} lineUpdate Line selection
|
35317 | * @param {d3.selection} textUpdate Text selection
|
35318 | * @private
|
35319 | */
|
35320 | ;
|
35321 |
|
35322 | _proto.setTickLineTextPosition = function setTickLineTextPosition(lineUpdate, textUpdate) {
|
35323 | var tickPos = this.getTickXY(),
|
35324 | _this$config = this.config,
|
35325 | innerTickSize = _this$config.innerTickSize,
|
35326 | orient = _this$config.orient,
|
35327 | tickLength = _this$config.tickLength,
|
35328 | tickOffset = _this$config.tickOffset,
|
35329 | rotate = this.params.tickTextRotate,
|
35330 | textAnchorForText = function (r) {
|
35331 | var value = ["start", "end"];
|
35332 | orient === "top" && value.reverse();
|
35333 | return !r ? "middle" : value[r > 0 ? 0 : 1];
|
35334 | },
|
35335 | textTransform = function (r) {
|
35336 | return r ? "rotate(" + r + ")" : null;
|
35337 | },
|
35338 | yForText = function (r) {
|
35339 | var r2 = r / (orient === "bottom" ? 15 : 23);
|
35340 | return r ? 11.5 - 2.5 * r2 * (r > 0 ? 1 : -1) : tickLength;
|
35341 | };
|
35342 |
|
35343 | switch (orient) {
|
35344 | case "bottom":
|
35345 | lineUpdate.attr("x1", tickPos.x).attr("x2", tickPos.x).attr("y2", this.getTickSize.bind(this));
|
35346 | textUpdate.attr("x", 0).attr("y", yForText(rotate)).style("text-anchor", textAnchorForText(rotate)).attr("transform", textTransform(rotate));
|
35347 | break;
|
35348 |
|
35349 | case "top":
|
35350 | lineUpdate.attr("x2", 0).attr("y2", -innerTickSize);
|
35351 | textUpdate.attr("x", 0).attr("y", -yForText(rotate) * 2).style("text-anchor", textAnchorForText(rotate)).attr("transform", textTransform(rotate));
|
35352 | break;
|
35353 |
|
35354 | case "left":
|
35355 | lineUpdate.attr("x2", -innerTickSize).attr("y1", tickPos.y).attr("y2", tickPos.y);
|
35356 | textUpdate.attr("x", -tickLength).attr("y", tickOffset).style("text-anchor", "end");
|
35357 | break;
|
35358 |
|
35359 | case "right":
|
35360 | lineUpdate.attr("x2", innerTickSize).attr("y2", 0);
|
35361 | textUpdate.attr("x", tickLength).attr("y", 0).style("text-anchor", "start");
|
35362 | }
|
35363 | } // this should be called only when category axis
|
35364 | ;
|
35365 |
|
35366 | _proto.splitTickText = function splitTickText(d, scale, ticks, isLeftRight, charWidth) {
|
35367 | var params = this.params,
|
35368 | tickText = this.helper.textFormatted(d),
|
35369 | splitted = isString(tickText) && tickText.indexOf("\n") > -1 ? tickText.split("\n") : [];
|
35370 |
|
35371 | if (splitted.length) {
|
35372 | return splitted;
|
35373 | }
|
35374 |
|
35375 | if (isArray(tickText)) {
|
35376 | return tickText;
|
35377 | }
|
35378 |
|
35379 | var tickWidth = params.tickWidth;
|
35380 |
|
35381 | if (!tickWidth || tickWidth <= 0) {
|
35382 | tickWidth = isLeftRight ? 95 : params.isCategory ? Math.ceil(scale(ticks[1]) - scale(ticks[0])) - 12 : 110;
|
35383 | } // split given text by tick width size
|
35384 | // eslint-disable-next-line
|
35385 |
|
35386 |
|
35387 | function split(splitted, text) {
|
35388 | var subtext, spaceIndex, textWidth;
|
35389 |
|
35390 | for (var i = 1; i < text.length; i++) {
|
35391 | if (text.charAt(i) === " ") {
|
35392 | spaceIndex = i;
|
35393 | }
|
35394 |
|
35395 | subtext = text.substr(0, i + 1);
|
35396 | textWidth = charWidth * subtext.length; // if text width gets over tick width, split by space index or current index
|
35397 |
|
35398 | if (tickWidth < textWidth) {
|
35399 | return split(splitted.concat(text.substr(0, spaceIndex || i)), text.slice(spaceIndex ? spaceIndex + 1 : i));
|
35400 | }
|
35401 | }
|
35402 |
|
35403 | return splitted.concat(text);
|
35404 | }
|
35405 |
|
35406 | return split(splitted, tickText + "");
|
35407 | };
|
35408 |
|
35409 | _proto.scale = function scale(x) {
|
35410 | if (!arguments.length) {
|
35411 | return this.helper.scale;
|
35412 | }
|
35413 |
|
35414 | this.helper.scale = x;
|
35415 | return this;
|
35416 | };
|
35417 |
|
35418 | _proto.orient = function orient(x) {
|
35419 | if (!arguments.length) {
|
35420 | return this.config.orient;
|
35421 | }
|
35422 |
|
35423 | this.config.orient = x in {
|
35424 | top: 1,
|
35425 | right: 1,
|
35426 | bottom: 1,
|
35427 | left: 1
|
35428 | } ? x + "" : "bottom";
|
35429 | return this;
|
35430 | };
|
35431 |
|
35432 | _proto.tickFormat = function tickFormat(format) {
|
35433 | var config = this.config;
|
35434 |
|
35435 | if (!arguments.length) {
|
35436 | return config.tickFormat;
|
35437 | }
|
35438 |
|
35439 | config.tickFormat = format;
|
35440 | return this;
|
35441 | };
|
35442 |
|
35443 | _proto.tickCentered = function tickCentered(isCentered) {
|
35444 | var config = this.config;
|
35445 |
|
35446 | if (!arguments.length) {
|
35447 | return config.tickCentered;
|
35448 | }
|
35449 |
|
35450 | config.tickCentered = isCentered;
|
35451 | return this;
|
35452 | }
|
35453 | /**
|
35454 | * Return tick's offset value.
|
35455 | * The value will be set for 'category' axis type.
|
35456 | * @returns {number}
|
35457 | * @private
|
35458 | */
|
35459 | ;
|
35460 |
|
35461 | _proto.tickOffset = function tickOffset() {
|
35462 | return this.config.tickOffset;
|
35463 | }
|
35464 | /**
|
35465 | * Get tick interval count
|
35466 | * @private
|
35467 | * @param {number} size Total data size
|
35468 | * @returns {number}
|
35469 | */
|
35470 | ;
|
35471 |
|
35472 | _proto.tickInterval = function tickInterval(size) {
|
35473 | var _this = this,
|
35474 | _this$config2 = this.config,
|
35475 | outerTickSize = _this$config2.outerTickSize,
|
35476 | tickOffset = _this$config2.tickOffset,
|
35477 | tickValues = _this$config2.tickValues,
|
35478 | interval;
|
35479 |
|
35480 | if (this.params.isCategory) {
|
35481 | interval = tickOffset * 2;
|
35482 | } else {
|
35483 | var length = this.g.select("path.domain").node().getTotalLength() - outerTickSize * 2;
|
35484 | interval = length / (size || this.g.selectAll("line").size()); // get the interval by its values
|
35485 |
|
35486 | var intervalByValue = tickValues ? tickValues.map(function (v, i, arr) {
|
35487 | var next = i + 1;
|
35488 | return next < arr.length ? _this.helper.scale(arr[next]) - _this.helper.scale(v) : null;
|
35489 | }).filter(Boolean) : [];
|
35490 | interval = Math.min.apply(Math, intervalByValue.concat([interval]));
|
35491 | }
|
35492 |
|
35493 | return interval === Infinity ? 0 : interval;
|
35494 | };
|
35495 |
|
35496 | _proto.ticks = function ticks() {
|
35497 | for (var config = this.config, _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
35498 | args[_key] = arguments[_key];
|
35499 | }
|
35500 |
|
35501 | if (!args.length) {
|
35502 | return config.tickArguments;
|
35503 | }
|
35504 |
|
35505 | config.tickArguments = toArray(args);
|
35506 | return this;
|
35507 | };
|
35508 |
|
35509 | _proto.tickCulling = function tickCulling(culling) {
|
35510 | var config = this.config;
|
35511 |
|
35512 | if (!arguments.length) {
|
35513 | return config.tickCulling;
|
35514 | }
|
35515 |
|
35516 | config.tickCulling = culling;
|
35517 | return this;
|
35518 | };
|
35519 |
|
35520 | _proto.tickValues = function tickValues(x) {
|
35521 | var _this2 = this,
|
35522 | config = this.config;
|
35523 |
|
35524 | if (isFunction(x)) {
|
35525 | config.tickValues = function () {
|
35526 | return x(_this2.helper.scale.domain());
|
35527 | };
|
35528 | } else {
|
35529 | if (!arguments.length) {
|
35530 | return config.tickValues;
|
35531 | }
|
35532 |
|
35533 | config.tickValues = x;
|
35534 | }
|
35535 |
|
35536 | return this;
|
35537 | };
|
35538 |
|
35539 | _proto.setTransition = function setTransition(t) {
|
35540 | this.config.transition = t;
|
35541 | return this;
|
35542 | };
|
35543 |
|
35544 | return AxisRenderer;
|
35545 | }();
|
35546 |
|
35547 |
|
35548 | ;// CONCATENATED MODULE: ./src/ChartInternal/Axis/Axis.ts
|
35549 | /**
|
35550 | * Copyright (c) 2017 ~ present NAVER Corp.
|
35551 | * billboard.js project is licensed under the MIT license
|
35552 | */
|
35553 |
|
35554 |
|
35555 |
|
35556 |
|
35557 |
|
35558 | /* harmony default export */ var Axis = ({
|
35559 | getAxisInstance: function getAxisInstance() {
|
35560 | return this.axis || new Axis_Axis(this);
|
35561 | }
|
35562 | });
|
35563 |
|
35564 | var Axis_Axis = /*#__PURE__*/function () {
|
35565 | function Axis(owner) {
|
35566 | this.owner = void 0;
|
35567 | this.x = void 0;
|
35568 | this.subX = void 0;
|
35569 | this.y = void 0;
|
35570 | this.y2 = void 0;
|
35571 | this.axesList = {};
|
35572 | this.tick = {
|
35573 | x: null,
|
35574 | y: null,
|
35575 | y2: null
|
35576 | };
|
35577 | this.xs = [];
|
35578 | this.orient = {
|
35579 | x: "bottom",
|
35580 | y: "left",
|
35581 | y2: "right",
|
35582 | subX: "bottom"
|
35583 | };
|
35584 | this.owner = owner;
|
35585 | this.setOrient();
|
35586 | }
|
35587 |
|
35588 | var _proto = Axis.prototype;
|
35589 |
|
35590 | _proto.getAxisClassName = function getAxisClassName(id) {
|
35591 | return config_classes.axis + " " + config_classes["axis" + capitalize(id)];
|
35592 | };
|
35593 |
|
35594 | _proto.isHorizontal = function isHorizontal($$, forHorizontal) {
|
35595 | var isRotated = $$.config.axis_rotated;
|
35596 | return forHorizontal ? isRotated : !isRotated;
|
35597 | };
|
35598 |
|
35599 | _proto.isCategorized = function isCategorized() {
|
35600 | var _this$owner = this.owner,
|
35601 | config = _this$owner.config,
|
35602 | state = _this$owner.state;
|
35603 | return config.axis_x_type.indexOf("category") >= 0 || state.hasRadar;
|
35604 | };
|
35605 |
|
35606 | _proto.isCustomX = function isCustomX() {
|
35607 | var config = this.owner.config;
|
35608 | return !this.isTimeSeries() && (config.data_x || notEmpty(config.data_xs));
|
35609 | };
|
35610 |
|
35611 | _proto.isTimeSeries = function isTimeSeries(id) {
|
35612 | if (id === void 0) {
|
35613 | id = "x";
|
35614 | }
|
35615 |
|
35616 | return this.owner.config["axis_" + id + "_type"] === "timeseries";
|
35617 | };
|
35618 |
|
35619 | _proto.isLog = function isLog(id) {
|
35620 | if (id === void 0) {
|
35621 | id = "x";
|
35622 | }
|
35623 |
|
35624 | return this.owner.config["axis_" + id + "_type"] === "log";
|
35625 | };
|
35626 |
|
35627 | _proto.isTimeSeriesY = function isTimeSeriesY() {
|
35628 | return this.isTimeSeries("y");
|
35629 | };
|
35630 |
|
35631 | _proto.getAxisType = function getAxisType(id) {
|
35632 | if (id === void 0) {
|
35633 | id = "x";
|
35634 | }
|
35635 |
|
35636 | var type = "linear";
|
35637 |
|
35638 | if (this.isTimeSeries(id)) {
|
35639 | type = this.owner.config.axis_x_localtime ? "time" : "utc";
|
35640 | } else if (this.isLog(id)) {
|
35641 | type = "log";
|
35642 | }
|
35643 |
|
35644 | return type;
|
35645 | };
|
35646 |
|
35647 | _proto.init = function init() {
|
35648 | var _this = this,
|
35649 | $$ = this.owner,
|
35650 | config = $$.config,
|
35651 | _$$$$el = $$.$el,
|
35652 | main = _$$$$el.main,
|
35653 | axis = _$$$$el.axis,
|
35654 | clip = $$.state.clip,
|
35655 | isRotated = config.axis_rotated,
|
35656 | target = ["x", "y"];
|
35657 |
|
35658 | config.axis_y2_show && target.push("y2");
|
35659 | target.forEach(function (v) {
|
35660 | var classAxis = _this.getAxisClassName(v),
|
35661 | classLabel = config_classes["axis" + v.toUpperCase() + "Label"];
|
35662 |
|
35663 | axis[v] = main.append("g").attr("class", classAxis).attr("clip-path", function () {
|
35664 | var res = null;
|
35665 |
|
35666 | if (v === "x") {
|
35667 | res = clip.pathXAxis;
|
35668 | } else if (v === "y") {
|
35669 | // && config.axis_y_inner) {
|
35670 | res = clip.pathYAxis;
|
35671 | }
|
35672 |
|
35673 | return res;
|
35674 | }).attr("transform", $$.getTranslate(v)).style("visibility", config["axis_" + v + "_show"] ? null : "hidden");
|
35675 | axis[v].append("text").attr("class", classLabel).attr("transform", ["rotate(-90)", null][v === "x" ? +!isRotated : +isRotated]).style("text-anchor", function () {
|
35676 | return _this.textAnchorForAxisLabel(v);
|
35677 | });
|
35678 |
|
35679 | _this.generateAxes(v);
|
35680 | });
|
35681 | }
|
35682 | /**
|
35683 | * Set axis orient according option value
|
35684 | * @private
|
35685 | */
|
35686 | ;
|
35687 |
|
35688 | _proto.setOrient = function setOrient() {
|
35689 | var $$ = this.owner,
|
35690 | _$$$config = $$.config,
|
35691 | isRotated = _$$$config.axis_rotated,
|
35692 | yInner = _$$$config.axis_y_inner,
|
35693 | y2Inner = _$$$config.axis_y2_inner;
|
35694 | this.orient = {
|
35695 | x: isRotated ? "left" : "bottom",
|
35696 | y: isRotated ? yInner ? "top" : "bottom" : yInner ? "right" : "left",
|
35697 | y2: isRotated ? y2Inner ? "bottom" : "top" : y2Inner ? "left" : "right",
|
35698 | subX: isRotated ? "left" : "bottom"
|
35699 | };
|
35700 | }
|
35701 | /**
|
35702 | * Generate axes
|
35703 | * It's used when axis' axes option is set
|
35704 | * @param {string} id Axis id
|
35705 | * @private
|
35706 | */
|
35707 | ;
|
35708 |
|
35709 | _proto.generateAxes = function generateAxes(id) {
|
35710 | var $$ = this.owner,
|
35711 | config = $$.config,
|
35712 | axes = [],
|
35713 | axesConfig = config["axis_" + id + "_axes"],
|
35714 | isRotated = config.axis_rotated,
|
35715 | d3Axis;
|
35716 |
|
35717 | if (id === "x") {
|
35718 | d3Axis = isRotated ? axisLeft : axisBottom;
|
35719 | } else if (id === "y") {
|
35720 | d3Axis = isRotated ? axisBottom : axisLeft;
|
35721 | } else if (id === "y2") {
|
35722 | d3Axis = isRotated ? axisTop : axisRight;
|
35723 | }
|
35724 |
|
35725 | if (axesConfig.length) {
|
35726 | axesConfig.forEach(function (v) {
|
35727 | var tick = v.tick || {},
|
35728 | scale = $$.scale[id].copy();
|
35729 | v.domain && scale.domain(v.domain);
|
35730 | axes.push(d3Axis(scale).ticks(tick.count).tickFormat(isFunction(tick.format) ? tick.format.bind($$.api) : function (x) {
|
35731 | return x;
|
35732 | }).tickValues(tick.values).tickSizeOuter(tick.outer === !1 ? 0 : 6));
|
35733 | });
|
35734 | }
|
35735 |
|
35736 | this.axesList[id] = axes;
|
35737 | }
|
35738 | /**
|
35739 | * Update axes nodes
|
35740 | * @private
|
35741 | */
|
35742 | ;
|
35743 |
|
35744 | _proto.updateAxes = function updateAxes() {
|
35745 | var _this2 = this,
|
35746 | $$ = this.owner,
|
35747 | config = $$.config,
|
35748 | main = $$.$el.main;
|
35749 |
|
35750 | Object.keys(this.axesList).forEach(function (id) {
|
35751 | var axesConfig = config["axis_" + id + "_axes"],
|
35752 | scale = $$.scale[id].copy(),
|
35753 | range = scale.range();
|
35754 |
|
35755 | _this2.axesList[id].forEach(function (v, i) {
|
35756 | var axisRange = v.scale().range(); // adjust range value with the current
|
35757 | // https://github.com/naver/billboard.js/issues/859
|
35758 |
|
35759 | if (!range.every(function (v, i) {
|
35760 | return v === axisRange[i];
|
35761 | })) {
|
35762 | v.scale().range(range);
|
35763 | }
|
35764 |
|
35765 | var className = _this2.getAxisClassName(id) + "-" + (i + 1),
|
35766 | g = main.select("." + className.replace(/\s/, "."));
|
35767 |
|
35768 | if (g.empty()) {
|
35769 | g = main.append("g").attr("class", className).style("visibility", config["axis_" + id + "_show"] ? null : "hidden").call(v);
|
35770 | } else {
|
35771 | axesConfig[i].domain && scale.domain(axesConfig[i].domain);
|
35772 | $$.$T(g).call(v.scale(scale));
|
35773 | }
|
35774 |
|
35775 | g.attr("transform", $$.getTranslate(id, i + 1));
|
35776 | });
|
35777 | });
|
35778 | }
|
35779 | /**
|
35780 | * Set Axis & tick values
|
35781 | * called from: updateScales()
|
35782 | * @param {string} id Axis id string
|
35783 | * @param {d3Scale} scale Scale
|
35784 | * @param {boolean} outerTick If show outer tick
|
35785 | * @param {boolean} noTransition If with no transition
|
35786 | * @private
|
35787 | */
|
35788 | ;
|
35789 |
|
35790 | _proto.setAxis = function setAxis(id, scale, outerTick, noTransition) {
|
35791 | var $$ = this.owner;
|
35792 |
|
35793 | if (id !== "subX") {
|
35794 | this.tick[id] = this.getTickValues(id);
|
35795 | } // @ts-ignore
|
35796 |
|
35797 |
|
35798 | this[id] = this.getAxis(id, scale, outerTick, // do not transit x Axis on zoom and resizing
|
35799 | // https://github.com/naver/billboard.js/issues/1949
|
35800 | id === "x" && ($$.scale.zoom || $$.config.subchart_show || $$.state.resizing) ? !0 : noTransition);
|
35801 | } // called from : getMaxTickWidth()
|
35802 | ;
|
35803 |
|
35804 | _proto.getAxis = function getAxis(id, scale, outerTick, noTransition, noTickTextRotate) {
|
35805 | var $$ = this.owner,
|
35806 | config = $$.config,
|
35807 | isX = /^(x|subX)$/.test(id),
|
35808 | type = isX ? "x" : id,
|
35809 | isCategory = isX && this.isCategorized(),
|
35810 | orient = this.orient[id],
|
35811 | tickTextRotate = noTickTextRotate ? 0 : $$.getAxisTickRotate(type),
|
35812 | tickFormat;
|
35813 |
|
35814 | if (isX) {
|
35815 | tickFormat = id === "subX" ? $$.format.subXAxisTick : $$.format.xAxisTick;
|
35816 | } else {
|
35817 | var fn = config["axis_" + id + "_tick_format"];
|
35818 |
|
35819 | if (isFunction(fn)) {
|
35820 | tickFormat = fn.bind($$.api);
|
35821 | }
|
35822 | }
|
35823 |
|
35824 | var tickValues = this.tick[type],
|
35825 | axisParams = mergeObj({
|
35826 | outerTick: outerTick,
|
35827 | noTransition: noTransition,
|
35828 | config: config,
|
35829 | id: id,
|
35830 | tickTextRotate: tickTextRotate,
|
35831 | owner: $$
|
35832 | }, isX && {
|
35833 | isCategory: isCategory,
|
35834 | tickMultiline: config.axis_x_tick_multiline,
|
35835 | tickWidth: config.axis_x_tick_width,
|
35836 | tickTitle: isCategory && config.axis_x_tick_tooltip && $$.api.categories(),
|
35837 | orgXScale: $$.scale.x
|
35838 | });
|
35839 |
|
35840 | if (!isX) {
|
35841 | axisParams.tickStepSize = config["axis_" + type + "_tick_stepSize"];
|
35842 | }
|
35843 |
|
35844 | var axis = new AxisRenderer(axisParams).scale(isX && $$.scale.zoom || scale).orient(orient);
|
35845 |
|
35846 | if (isX && this.isTimeSeries() && tickValues && !isFunction(tickValues)) {
|
35847 | var _fn = parseDate.bind($$);
|
35848 |
|
35849 | tickValues = tickValues.map(function (v) {
|
35850 | return _fn(v);
|
35851 | });
|
35852 | } else if (!isX && this.isTimeSeriesY()) {
|
35853 | // https://github.com/d3/d3/blob/master/CHANGES.md#time-intervals-d3-time
|
35854 | axis.ticks(config.axis_y_tick_time_value);
|
35855 | tickValues = null;
|
35856 | }
|
35857 |
|
35858 | tickValues && axis.tickValues(tickValues); // Set tick
|
35859 |
|
35860 | axis.tickFormat(tickFormat || !isX && $$.isStackNormalized() && function (x) {
|
35861 | return x + "%";
|
35862 | });
|
35863 |
|
35864 | if (isCategory) {
|
35865 | axis.tickCentered(config.axis_x_tick_centered);
|
35866 |
|
35867 | if (isEmpty(config.axis_x_tick_culling)) {
|
35868 | config.axis_x_tick_culling = !1;
|
35869 | }
|
35870 | }
|
35871 |
|
35872 | var tickCount = config["axis_" + type + "_tick_count"];
|
35873 | tickCount && axis.ticks(tickCount);
|
35874 | return axis;
|
35875 | };
|
35876 |
|
35877 | _proto.updateXAxisTickValues = function updateXAxisTickValues(targets, axis) {
|
35878 | var $$ = this.owner,
|
35879 | config = $$.config,
|
35880 | fit = config.axis_x_tick_fit,
|
35881 | count = config.axis_x_tick_count,
|
35882 | values;
|
35883 |
|
35884 | if (fit || count && fit) {
|
35885 | values = $$.mapTargetsToUniqueXs(targets); // if given count is greater than the value length, then limit the count.
|
35886 |
|
35887 | if (this.isCategorized() && count > values.length) {
|
35888 | count = values.length;
|
35889 | }
|
35890 |
|
35891 | values = this.generateTickValues(values, count, this.isTimeSeries());
|
35892 | }
|
35893 |
|
35894 | if (axis) {
|
35895 | axis.tickValues(values);
|
35896 | } else if (this.x) {
|
35897 | var _this$subX;
|
35898 |
|
35899 | this.x.tickValues(values);
|
35900 | (_this$subX = this.subX) == null ? void 0 : _this$subX.tickValues(values);
|
35901 | }
|
35902 |
|
35903 | return values;
|
35904 | };
|
35905 |
|
35906 | _proto.getId = function getId(id) {
|
35907 | var _this$owner2 = this.owner,
|
35908 | config = _this$owner2.config,
|
35909 | scale = _this$owner2.scale,
|
35910 | axis = config.data_axes[id];
|
35911 |
|
35912 | // when data.axes option has 'y2', but 'axis.y2.show=true' isn't set will return 'y'
|
35913 | if (!axis || !scale[axis]) {
|
35914 | axis = "y";
|
35915 | }
|
35916 |
|
35917 | return axis;
|
35918 | };
|
35919 |
|
35920 | _proto.getXAxisTickFormat = function getXAxisTickFormat(forSubchart) {
|
35921 | var $$ = this.owner,
|
35922 | config = $$.config,
|
35923 | format = $$.format,
|
35924 | tickFormat = forSubchart ? config.subchart_axis_x_tick_format || config.axis_x_tick_format : config.axis_x_tick_format,
|
35925 | isTimeSeries = this.isTimeSeries(),
|
35926 | isCategorized = this.isCategorized(),
|
35927 | currFormat;
|
35928 |
|
35929 | if (tickFormat) {
|
35930 | if (isFunction(tickFormat)) {
|
35931 | currFormat = tickFormat.bind($$.api);
|
35932 | } else if (isTimeSeries) {
|
35933 | currFormat = function (date) {
|
35934 | return date ? format.axisTime(tickFormat)(date) : "";
|
35935 | };
|
35936 | }
|
35937 | } else {
|
35938 | currFormat = isTimeSeries ? format.defaultAxisTime : isCategorized ? $$.categoryName : function (v) {
|
35939 | return v < 0 ? v.toFixed(0) : v;
|
35940 | };
|
35941 | }
|
35942 |
|
35943 | return isFunction(currFormat) ? function (v) {
|
35944 | return currFormat.apply($$, isCategorized ? [v, $$.categoryName(v)] : [v]);
|
35945 | } : currFormat;
|
35946 | };
|
35947 |
|
35948 | _proto.getTickValues = function getTickValues(id) {
|
35949 | var $$ = this.owner,
|
35950 | tickValues = $$.config["axis_" + id + "_tick_values"],
|
35951 | axis = $$[id + "Axis"];
|
35952 | return (isFunction(tickValues) ? tickValues.call($$.api) : tickValues) || (axis ? axis.tickValues() : undefined);
|
35953 | };
|
35954 |
|
35955 | _proto.getLabelOptionByAxisId = function getLabelOptionByAxisId(id) {
|
35956 | return this.owner.config["axis_" + id + "_label"];
|
35957 | };
|
35958 |
|
35959 | _proto.getLabelText = function getLabelText(id) {
|
35960 | var option = this.getLabelOptionByAxisId(id);
|
35961 | return isString(option) ? option : option ? option.text : null;
|
35962 | };
|
35963 |
|
35964 | _proto.setLabelText = function setLabelText(id, text) {
|
35965 | var $$ = this.owner,
|
35966 | config = $$.config,
|
35967 | option = this.getLabelOptionByAxisId(id);
|
35968 |
|
35969 | if (isString(option)) {
|
35970 | config["axis_" + id + "_label"] = text;
|
35971 | } else if (option) {
|
35972 | option.text = text;
|
35973 | }
|
35974 | };
|
35975 |
|
35976 | _proto.getLabelPosition = function getLabelPosition(id, defaultPosition) {
|
35977 | var isRotated = this.owner.config.axis_rotated,
|
35978 | option = this.getLabelOptionByAxisId(id),
|
35979 | position = isObjectType(option) && option.position ? option.position : defaultPosition[+!isRotated],
|
35980 | has = function (v) {
|
35981 | return !!~position.indexOf(v);
|
35982 | };
|
35983 |
|
35984 | return {
|
35985 | isInner: has("inner"),
|
35986 | isOuter: has("outer"),
|
35987 | isLeft: has("left"),
|
35988 | isCenter: has("center"),
|
35989 | isRight: has("right"),
|
35990 | isTop: has("top"),
|
35991 | isMiddle: has("middle"),
|
35992 | isBottom: has("bottom")
|
35993 | };
|
35994 | };
|
35995 |
|
35996 | _proto.getAxisLabelPosition = function getAxisLabelPosition(id) {
|
35997 | return this.getLabelPosition(id, id === "x" ? ["inner-top", "inner-right"] : ["inner-right", "inner-top"]);
|
35998 | };
|
35999 |
|
36000 | _proto.getLabelPositionById = function getLabelPositionById(id) {
|
36001 | return this.getAxisLabelPosition(id);
|
36002 | };
|
36003 |
|
36004 | _proto.xForAxisLabel = function xForAxisLabel(id) {
|
36005 | var $$ = this.owner,
|
36006 | _$$$state = $$.state,
|
36007 | width = _$$$state.width,
|
36008 | height = _$$$state.height,
|
36009 | position = this.getAxisLabelPosition(id),
|
36010 | x = position.isMiddle ? -height / 2 : 0;
|
36011 |
|
36012 | if (this.isHorizontal($$, id !== "x")) {
|
36013 | x = position.isLeft ? 0 : position.isCenter ? width / 2 : width;
|
36014 | } else if (position.isBottom) {
|
36015 | x = -height;
|
36016 | }
|
36017 |
|
36018 | return x;
|
36019 | };
|
36020 |
|
36021 | _proto.dxForAxisLabel = function dxForAxisLabel(id) {
|
36022 | var $$ = this.owner,
|
36023 | position = this.getAxisLabelPosition(id),
|
36024 | dx = position.isBottom ? "0.5em" : "0";
|
36025 |
|
36026 | if (this.isHorizontal($$, id !== "x")) {
|
36027 | dx = position.isLeft ? "0.5em" : position.isRight ? "-0.5em" : "0";
|
36028 | } else if (position.isTop) {
|
36029 | dx = "-0.5em";
|
36030 | }
|
36031 |
|
36032 | return dx;
|
36033 | };
|
36034 |
|
36035 | _proto.textAnchorForAxisLabel = function textAnchorForAxisLabel(id) {
|
36036 | var $$ = this.owner,
|
36037 | position = this.getAxisLabelPosition(id),
|
36038 | anchor = position.isMiddle ? "middle" : "end";
|
36039 |
|
36040 | if (this.isHorizontal($$, id !== "x")) {
|
36041 | anchor = position.isLeft ? "start" : position.isCenter ? "middle" : "end";
|
36042 | } else if (position.isBottom) {
|
36043 | anchor = "start";
|
36044 | }
|
36045 |
|
36046 | return anchor;
|
36047 | };
|
36048 |
|
36049 | _proto.dyForAxisLabel = function dyForAxisLabel(id) {
|
36050 | var $$ = this.owner,
|
36051 | config = $$.config,
|
36052 | isRotated = config.axis_rotated,
|
36053 | isInner = this.getAxisLabelPosition(id).isInner,
|
36054 | tickRotate = config["axis_" + id + "_tick_rotate"] ? $$.getHorizontalAxisHeight(id) : 0,
|
36055 | maxTickWidth = this.getMaxTickWidth(id),
|
36056 | dy;
|
36057 |
|
36058 | if (id === "x") {
|
36059 | var xHeight = config.axis_x_height;
|
36060 |
|
36061 | if (isRotated) {
|
36062 | dy = isInner ? "1.2em" : -25 - maxTickWidth;
|
36063 | } else if (isInner) {
|
36064 | dy = "-0.5em";
|
36065 | } else if (xHeight) {
|
36066 | dy = xHeight - 10;
|
36067 | } else if (tickRotate) {
|
36068 | dy = tickRotate - 10;
|
36069 | } else {
|
36070 | dy = "3em";
|
36071 | }
|
36072 | } else {
|
36073 | dy = {
|
36074 | y: ["-0.5em", 10, "3em", "1.2em", 10],
|
36075 | y2: ["1.2em", -20, "-2.2em", "-0.5em", 15]
|
36076 | }[id];
|
36077 |
|
36078 | if (isRotated) {
|
36079 | if (isInner) {
|
36080 | dy = dy[0];
|
36081 | } else if (tickRotate) {
|
36082 | dy = tickRotate * (id === "y2" ? -1 : 1) - dy[1];
|
36083 | } else {
|
36084 | dy = dy[2];
|
36085 | }
|
36086 | } else {
|
36087 | dy = isInner ? dy[3] : (dy[4] + (config["axis_" + id + "_inner"] ? 0 : maxTickWidth + dy[4])) * (id === "y" ? -1 : 1);
|
36088 | }
|
36089 | }
|
36090 |
|
36091 | return dy;
|
36092 | };
|
36093 |
|
36094 | _proto.getMaxTickWidth = function getMaxTickWidth(id, withoutRecompute) {
|
36095 | var $$ = this.owner,
|
36096 | config = $$.config,
|
36097 | current = $$.state.current,
|
36098 | _$$$$el2 = $$.$el,
|
36099 | svg = _$$$$el2.svg,
|
36100 | chart = _$$$$el2.chart,
|
36101 | currentTickMax = current.maxTickWidths[id],
|
36102 | maxWidth = 0;
|
36103 |
|
36104 | if (withoutRecompute || !config["axis_" + id + "_show"] || $$.filterTargetsToShow().length === 0) {
|
36105 | return currentTickMax.size;
|
36106 | }
|
36107 |
|
36108 | if (svg) {
|
36109 | var isYAxis = /^y2?$/.test(id),
|
36110 | targetsToShow = $$.filterTargetsToShow($$.data.targets),
|
36111 | scale = $$.scale[id].copy().domain($$["get" + (isYAxis ? "Y" : "X") + "Domain"](targetsToShow, id)),
|
36112 | domain = scale.domain(),
|
36113 | isDomainSame = domain[0] === domain[1] && domain.every(function (v) {
|
36114 | return v > 0;
|
36115 | }),
|
36116 | isCurrentMaxTickDomainSame = isArray(currentTickMax.domain) && currentTickMax.domain[0] === currentTickMax.domain[1] && currentTickMax.domain.every(function (v) {
|
36117 | return v > 0;
|
36118 | });
|
36119 |
|
36120 | // do not compute if domain or currentMaxTickDomain is same
|
36121 | if (isDomainSame || isCurrentMaxTickDomainSame) {
|
36122 | return currentTickMax.size;
|
36123 | } else {
|
36124 | currentTickMax.domain = domain;
|
36125 | } // reset old max state value to prevent from new data loading
|
36126 |
|
36127 |
|
36128 | if (!isYAxis) {
|
36129 | currentTickMax.ticks.splice(0);
|
36130 | }
|
36131 |
|
36132 | var axis = this.getAxis(id, scale, !1, !1, !0),
|
36133 | tickCount = config["axis_" + id + "_tick_count"],
|
36134 | tickValues = config["axis_" + id + "_tick_values"];
|
36135 |
|
36136 | // Make to generate the final tick text to be rendered
|
36137 | // https://github.com/naver/billboard.js/issues/920
|
36138 | // Do not generate if 'tick values' option is given
|
36139 | // https://github.com/naver/billboard.js/issues/1251
|
36140 | if (!tickValues && tickCount) {
|
36141 | axis.tickValues(this.generateTickValues(domain, tickCount, isYAxis ? this.isTimeSeriesY() : this.isTimeSeries()));
|
36142 | }
|
36143 |
|
36144 | isYAxis || this.updateXAxisTickValues(targetsToShow, axis);
|
36145 | var dummy = chart.append("svg").style("visibility", "hidden").style("position", "fixed").style("top", "0").style("left", "0");
|
36146 | axis.create(dummy);
|
36147 | dummy.selectAll("text").each(function (d, i) {
|
36148 | var currentTextWidth = this.getBoundingClientRect().width;
|
36149 | maxWidth = Math.max(maxWidth, currentTextWidth); // cache tick text width for getXAxisTickTextY2Overflow()
|
36150 |
|
36151 | if (!isYAxis) {
|
36152 | currentTickMax.ticks[i] = currentTextWidth;
|
36153 | }
|
36154 | });
|
36155 | dummy.remove();
|
36156 | }
|
36157 |
|
36158 | if (maxWidth > 0) {
|
36159 | currentTickMax.size = maxWidth;
|
36160 | }
|
36161 |
|
36162 | return currentTickMax.size;
|
36163 | };
|
36164 |
|
36165 | _proto.getXAxisTickTextY2Overflow = function getXAxisTickTextY2Overflow(defaultPadding) {
|
36166 | var $$ = this.owner,
|
36167 | axis = $$.axis,
|
36168 | config = $$.config,
|
36169 | state = $$.state,
|
36170 | xAxisTickRotate = $$.getAxisTickRotate("x");
|
36171 |
|
36172 | if ((axis.isCategorized() || axis.isTimeSeries()) && config.axis_x_tick_fit && !config.axis_x_tick_culling && !config.axis_x_tick_multiline && xAxisTickRotate > 0 && xAxisTickRotate < 90) {
|
36173 | var widthWithoutCurrentPaddingLeft = state.current.width - $$.getCurrentPaddingLeft(),
|
36174 | maxOverflow = this.getXAxisTickMaxOverflow(xAxisTickRotate, widthWithoutCurrentPaddingLeft - defaultPadding),
|
36175 | xAxisTickTextY2Overflow = Math.max(0, maxOverflow) + defaultPadding;
|
36176 | // for display inconsistencies between browsers
|
36177 | return Math.min(xAxisTickTextY2Overflow, widthWithoutCurrentPaddingLeft / 2);
|
36178 | }
|
36179 |
|
36180 | return 0;
|
36181 | };
|
36182 |
|
36183 | _proto.getXAxisTickMaxOverflow = function getXAxisTickMaxOverflow(xAxisTickRotate, widthWithoutCurrentPaddingLeft) {
|
36184 | var $$ = this.owner,
|
36185 | axis = $$.axis,
|
36186 | config = $$.config,
|
36187 | state = $$.state,
|
36188 | isTimeSeries = axis.isTimeSeries(),
|
36189 | tickTextWidths = state.current.maxTickWidths.x.ticks,
|
36190 | tickCount = tickTextWidths.length,
|
36191 | _state$axis$x$padding = state.axis.x.padding,
|
36192 | left = _state$axis$x$padding.left,
|
36193 | right = _state$axis$x$padding.right,
|
36194 | maxOverflow = 0,
|
36195 | remaining = tickCount - (isTimeSeries && config.axis_x_tick_fit ? .5 : 0);
|
36196 |
|
36197 | for (var i = 0; i < tickCount; i++) {
|
36198 | var tickIndex = i + 1,
|
36199 | rotatedTickTextWidth = Math.cos(Math.PI * xAxisTickRotate / 180) * tickTextWidths[i],
|
36200 | ticksBeforeTickText = tickIndex - (isTimeSeries ? 1 : .5) + left;
|
36201 |
|
36202 | // Skip ticks if there are no ticks before them
|
36203 | if (ticksBeforeTickText <= 0) {
|
36204 | continue;
|
36205 | }
|
36206 |
|
36207 | var tickLength = (widthWithoutCurrentPaddingLeft - rotatedTickTextWidth) / ticksBeforeTickText;
|
36208 | maxOverflow = Math.max(maxOverflow, rotatedTickTextWidth - tickLength / 2 - ((remaining - tickIndex) * tickLength + right * tickLength));
|
36209 | }
|
36210 |
|
36211 | var filteredTargets = $$.filterTargetsToShow($$.data.targets),
|
36212 | tickOffset = 0;
|
36213 |
|
36214 | if (!isTimeSeries && config.axis_x_tick_count <= filteredTargets.length && filteredTargets[0].values.length) {
|
36215 | var scale = getScale($$.axis.getAxisType("x"), 0, widthWithoutCurrentPaddingLeft - maxOverflow).domain([left * -1, $$.getXDomainMax($$.data.targets) + 1 + right]);
|
36216 | tickOffset = Math.ceil((scale(1) - scale(0)) / 2);
|
36217 | }
|
36218 |
|
36219 | return maxOverflow + tickOffset;
|
36220 | };
|
36221 |
|
36222 | _proto.updateLabels = function updateLabels(withTransition) {
|
36223 | var _this3 = this,
|
36224 | $$ = this.owner,
|
36225 | main = $$.$el.main,
|
36226 | $T = $$.$T,
|
36227 | labels = {
|
36228 | x: main.select("." + config_classes.axisX + " ." + config_classes.axisXLabel),
|
36229 | y: main.select("." + config_classes.axisY + " ." + config_classes.axisYLabel),
|
36230 | y2: main.select("." + config_classes.axisY2 + " ." + config_classes.axisY2Label)
|
36231 | };
|
36232 |
|
36233 | Object.keys(labels).filter(function (id) {
|
36234 | return !labels[id].empty();
|
36235 | }).forEach(function (v) {
|
36236 | var node = labels[v]; // @check $$.$T(node, withTransition)
|
36237 |
|
36238 | $T(node, withTransition).attr("x", function () {
|
36239 | return _this3.xForAxisLabel(v);
|
36240 | }).attr("dx", function () {
|
36241 | return _this3.dxForAxisLabel(v);
|
36242 | }).attr("dy", function () {
|
36243 | return _this3.dyForAxisLabel(v);
|
36244 | }).text(function () {
|
36245 | return _this3.getLabelText(v);
|
36246 | });
|
36247 | });
|
36248 | }
|
36249 | /**
|
36250 | * Get axis padding value
|
36251 | * @param {number|object} padding Padding object
|
36252 | * @param {string} key Key string of padding
|
36253 | * @param {Date|number} defaultValue Default value
|
36254 | * @param {number} domainLength Domain length
|
36255 | * @returns {number} Padding value in scale
|
36256 | * @private
|
36257 | */
|
36258 | ;
|
36259 |
|
36260 | _proto.getPadding = function getPadding(padding, key, defaultValue, domainLength) {
|
36261 | var p = isNumber(padding) ? padding : padding[key];
|
36262 |
|
36263 | if (!isValue(p)) {
|
36264 | return defaultValue;
|
36265 | }
|
36266 |
|
36267 | return this.owner.convertPixelToScale(/(bottom|top)/.test(key) ? "y" : "x", p, domainLength);
|
36268 | };
|
36269 |
|
36270 | _proto.generateTickValues = function generateTickValues(values, tickCount, forTimeSeries) {
|
36271 | var tickValues = values;
|
36272 |
|
36273 | if (tickCount) {
|
36274 | var targetCount = isFunction(tickCount) ? tickCount() : tickCount; // compute ticks according to tickCount
|
36275 |
|
36276 | if (targetCount === 1) {
|
36277 | tickValues = [values[0]];
|
36278 | } else if (targetCount === 2) {
|
36279 | tickValues = [values[0], values[values.length - 1]];
|
36280 | } else if (targetCount > 2) {
|
36281 | var isCategorized = this.isCategorized(),
|
36282 | count = targetCount - 2,
|
36283 | start = values[0],
|
36284 | end = values[values.length - 1],
|
36285 | tickValue;
|
36286 | // re-construct unique values
|
36287 | tickValues = [start];
|
36288 |
|
36289 | for (var i = 0; i < count; i++) {
|
36290 | tickValue = +start + (end - start) / (count + 1) * (i + 1);
|
36291 | tickValues.push(forTimeSeries ? new Date(tickValue) : isCategorized ? Math.round(tickValue) : tickValue);
|
36292 | }
|
36293 |
|
36294 | tickValues.push(end);
|
36295 | }
|
36296 | }
|
36297 |
|
36298 | if (!forTimeSeries) {
|
36299 | tickValues = tickValues.sort(function (a, b) {
|
36300 | return a - b;
|
36301 | });
|
36302 | }
|
36303 |
|
36304 | return tickValues;
|
36305 | };
|
36306 |
|
36307 | _proto.generateTransitions = function generateTransitions(withTransition) {
|
36308 | var $$ = this.owner,
|
36309 | axis = $$.$el.axis,
|
36310 | $T = $$.$T,
|
36311 | _map = ["x", "y", "y2", "subX"].map(function (v) {
|
36312 | return $T(axis[v], withTransition);
|
36313 | }),
|
36314 | axisX = _map[0],
|
36315 | axisY = _map[1],
|
36316 | axisY2 = _map[2],
|
36317 | axisSubX = _map[3];
|
36318 |
|
36319 | return {
|
36320 | axisX: axisX,
|
36321 | axisY: axisY,
|
36322 | axisY2: axisY2,
|
36323 | axisSubX: axisSubX
|
36324 | };
|
36325 | };
|
36326 |
|
36327 | _proto.redraw = function redraw(transitions, isHidden, isInit) {
|
36328 | var _this4 = this,
|
36329 | $$ = this.owner,
|
36330 | config = $$.config,
|
36331 | $el = $$.$el,
|
36332 | opacity = isHidden ? "0" : null;
|
36333 |
|
36334 | ["x", "y", "y2", "subX"].forEach(function (id) {
|
36335 | var axis = _this4[id],
|
36336 | $axis = $el.axis[id];
|
36337 |
|
36338 | if (axis && $axis) {
|
36339 | if (!isInit && !config.transition_duration) {
|
36340 | axis.config.withoutTransition = !0;
|
36341 | }
|
36342 |
|
36343 | $axis.style("opacity", opacity);
|
36344 | axis.create(transitions["axis" + capitalize(id)]);
|
36345 | }
|
36346 | });
|
36347 | this.updateAxes();
|
36348 | }
|
36349 | /**
|
36350 | * Redraw axis
|
36351 | * @param {Array} targetsToShow targets data to be shown
|
36352 | * @param {object} wth option object
|
36353 | * @param {d3.Transition} transitions Transition object
|
36354 | * @param {object} flow flow object
|
36355 | * @param {boolean} isInit called from initialization
|
36356 | * @private
|
36357 | */
|
36358 | ;
|
36359 |
|
36360 | _proto.redrawAxis = function redrawAxis(targetsToShow, wth, transitions, flow, isInit) {
|
36361 | var _this5 = this,
|
36362 | $$ = this.owner,
|
36363 | config = $$.config,
|
36364 | scale = $$.scale,
|
36365 | $el = $$.$el,
|
36366 | hasZoom = !!scale.zoom,
|
36367 | xDomainForZoom;
|
36368 |
|
36369 | if (!hasZoom && this.isCategorized() && targetsToShow.length === 0) {
|
36370 | scale.x.domain([0, $el.axis.x.selectAll(".tick").size()]);
|
36371 | }
|
36372 |
|
36373 | if (scale.x && targetsToShow.length) {
|
36374 | hasZoom || $$.updateXDomain(targetsToShow, wth.UpdateXDomain, wth.UpdateOrgXDomain, wth.TrimXDomain);
|
36375 |
|
36376 | if (!config.axis_x_tick_values) {
|
36377 | this.updateXAxisTickValues(targetsToShow);
|
36378 | }
|
36379 | } else if (this.x) {
|
36380 | var _this$subX2;
|
36381 |
|
36382 | this.x.tickValues([]);
|
36383 | (_this$subX2 = this.subX) == null ? void 0 : _this$subX2.tickValues([]);
|
36384 | }
|
36385 |
|
36386 | if (config.zoom_rescale && !flow) {
|
36387 | xDomainForZoom = scale.x.orgDomain();
|
36388 | }
|
36389 |
|
36390 | ["y", "y2"].forEach(function (key) {
|
36391 | var axisScale = scale[key];
|
36392 |
|
36393 | if (axisScale) {
|
36394 | var tickValues = config["axis_" + key + "_tick_values"],
|
36395 | tickCount = config["axis_" + key + "_tick_count"];
|
36396 | axisScale.domain($$.getYDomain(targetsToShow, key, xDomainForZoom));
|
36397 |
|
36398 | if (!tickValues && tickCount) {
|
36399 | var _axis = $$.axis[key],
|
36400 | domain = axisScale.domain();
|
36401 |
|
36402 | _axis.tickValues(_this5.generateTickValues(domain, domain.every(function (v) {
|
36403 | return v === 0;
|
36404 | }) ? 1 : tickCount, _this5.isTimeSeriesY()));
|
36405 | }
|
36406 | }
|
36407 | }); // axes
|
36408 |
|
36409 | this.redraw(transitions, $$.hasArcType(), isInit); // Update axis label
|
36410 |
|
36411 | this.updateLabels(wth.Transition); // show/hide if manual culling needed
|
36412 |
|
36413 | if ((wth.UpdateXDomain || wth.UpdateXAxis || wth.Y) && targetsToShow.length) {
|
36414 | this.setCulling();
|
36415 | } // Update sub domain
|
36416 |
|
36417 |
|
36418 | if (wth.Y) {
|
36419 | var _scale$subY, _scale$subY2;
|
36420 |
|
36421 | (_scale$subY = scale.subY) == null ? void 0 : _scale$subY.domain($$.getYDomain(targetsToShow, "y"));
|
36422 | (_scale$subY2 = scale.subY2) == null ? void 0 : _scale$subY2.domain($$.getYDomain(targetsToShow, "y2"));
|
36423 | }
|
36424 | }
|
36425 | /**
|
36426 | * Set manual culling
|
36427 | * @private
|
36428 | */
|
36429 | ;
|
36430 |
|
36431 | _proto.setCulling = function setCulling() {
|
36432 | var $$ = this.owner,
|
36433 | config = $$.config,
|
36434 | _$$$state2 = $$.state,
|
36435 | clip = _$$$state2.clip,
|
36436 | current = _$$$state2.current,
|
36437 | $el = $$.$el;
|
36438 | ["subX", "x", "y", "y2"].forEach(function (type) {
|
36439 | var axis = $el.axis[type],
|
36440 | id = type === "subX" ? "x" : type,
|
36441 | toCull = config["axis_" + id + "_tick_culling"]; // subchart x axis should be aligned with x axis culling
|
36442 |
|
36443 | if (axis && toCull) {
|
36444 | var tickText = axis.selectAll(".tick text"),
|
36445 | tickValues = sortValue(tickText.data()),
|
36446 | tickSize = tickValues.length,
|
36447 | cullingMax = config["axis_" + id + "_tick_culling_max"],
|
36448 | intervalForCulling;
|
36449 |
|
36450 | if (tickSize) {
|
36451 | for (var i = 1; i < tickSize; i++) {
|
36452 | if (tickSize / i < cullingMax) {
|
36453 | intervalForCulling = i;
|
36454 | break;
|
36455 | }
|
36456 | }
|
36457 |
|
36458 | tickText.each(function (d) {
|
36459 | this.style.display = tickValues.indexOf(d) % intervalForCulling ? "none" : null;
|
36460 | });
|
36461 | } else {
|
36462 | tickText.style("display", null);
|
36463 | } // set/unset x_axis_tick_clippath
|
36464 |
|
36465 |
|
36466 | if (type === "x") {
|
36467 | var clipPath = current.maxTickWidths.x.clipPath ? clip.pathXAxisTickTexts : null;
|
36468 | $el.svg.selectAll("." + config_classes.axisX + " .tick text").attr("clip-path", clipPath);
|
36469 | }
|
36470 | }
|
36471 | });
|
36472 | };
|
36473 |
|
36474 | return Axis;
|
36475 | }();
|
36476 | ;// CONCATENATED MODULE: ./src/ChartInternal/interactions/eventrect.ts
|
36477 | /**
|
36478 | * Copyright (c) 2017 ~ present NAVER Corp.
|
36479 | * billboard.js project is licensed under the MIT license
|
36480 | */
|
36481 |
|
36482 |
|
36483 | /* harmony default export */ var eventrect = ({
|
36484 | /**
|
36485 | * Initialize the area that detects the event.
|
36486 | * Add a container for the zone that detects the event.
|
36487 | * @private
|
36488 | */
|
36489 | initEventRect: function initEventRect() {
|
36490 | var $$ = this;
|
36491 | $$.$el.main.select("." + config_classes.chart).append("g").attr("class", config_classes.eventRects).style("fill-opacity", "0");
|
36492 | },
|
36493 |
|
36494 | /**
|
36495 | * Redraws the area that detects the event.
|
36496 | * @private
|
36497 | */
|
36498 | redrawEventRect: function redrawEventRect() {
|
36499 | var $$ = this,
|
36500 | config = $$.config,
|
36501 | state = $$.state,
|
36502 | $el = $$.$el,
|
36503 | isMultipleX = $$.isMultipleX();
|
36504 |
|
36505 | if ($el.eventRect) {
|
36506 | $$.updateEventRect($el.eventRect, !0);
|
36507 | } else {
|
36508 | 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),
|
36509 | eventRectUpdate = eventRects.selectAll("." + config_classes.eventRect).data([0]).enter().append("rect"); // append event <rect>
|
36510 |
|
36511 | $$.updateEventRect(eventRectUpdate); // bind event to <rect> element
|
36512 |
|
36513 | isMultipleX ? $$.generateEventRectsForMultipleXs(eventRectUpdate) : $$.generateEventRectsForSingleX(eventRectUpdate); // bind draggable selection
|
36514 |
|
36515 | eventRectUpdate.call($$.getDraggableSelection());
|
36516 | $el.eventRect = eventRectUpdate;
|
36517 |
|
36518 | if ($$.state.inputType === "touch" && !$el.svg.on("touchstart.eventRect") && !$$.hasArcType()) {
|
36519 | $$.bindTouchOnEventRect(isMultipleX);
|
36520 | }
|
36521 | }
|
36522 |
|
36523 | if (!isMultipleX) {
|
36524 | // Set data and update eventReceiver.data
|
36525 | var xAxisTickValues = $$.getMaxDataCountTarget(); // update data's index value to be alinged with the x Axis
|
36526 |
|
36527 | $$.updateDataIndexByX(xAxisTickValues);
|
36528 | $$.updateXs(xAxisTickValues);
|
36529 | $$.updatePointClass == null ? void 0 : $$.updatePointClass(!0);
|
36530 | state.eventReceiver.data = xAxisTickValues;
|
36531 | }
|
36532 |
|
36533 | $$.updateEventRectData();
|
36534 | },
|
36535 | bindTouchOnEventRect: function bindTouchOnEventRect(isMultipleX) {
|
36536 | var $$ = this,
|
36537 | config = $$.config,
|
36538 | state = $$.state,
|
36539 | _$$$$el = $$.$el,
|
36540 | eventRect = _$$$$el.eventRect,
|
36541 | svg = _$$$$el.svg,
|
36542 | selectRect = function (context) {
|
36543 | if (isMultipleX) {
|
36544 | $$.selectRectForMultipleXs(context);
|
36545 | } else {
|
36546 | var index = $$.getDataIndexFromEvent(state.event);
|
36547 | $$.callOverOutForTouch(index);
|
36548 | index === -1 ? $$.unselectRect() : $$.selectRectForSingle(context, eventRect, index);
|
36549 | }
|
36550 | },
|
36551 | unselectRect = function () {
|
36552 | $$.unselectRect();
|
36553 | $$.callOverOutForTouch();
|
36554 | },
|
36555 | preventDefault = config.interaction_inputType_touch.preventDefault,
|
36556 | isPrevented = isboolean(preventDefault) && preventDefault || !1,
|
36557 | preventThreshold = !isNaN(preventDefault) && preventDefault || null,
|
36558 | startPx,
|
36559 | preventEvent = function (event) {
|
36560 | var eventType = event.type,
|
36561 | touch = event.changedTouches[0],
|
36562 | currentXY = touch["client" + (config.axis_rotated ? "Y" : "X")];
|
36563 |
|
36564 | // prevent document scrolling
|
36565 | if (eventType === "touchstart") {
|
36566 | if (isPrevented) {
|
36567 | event.preventDefault();
|
36568 | } else if (preventThreshold !== null) {
|
36569 | startPx = currentXY;
|
36570 | }
|
36571 | } else if (eventType === "touchmove") {
|
36572 | if (isPrevented || startPx === !0 || preventThreshold !== null && Math.abs(startPx - currentXY) >= preventThreshold) {
|
36573 | // once prevented, keep prevented during whole 'touchmove' context
|
36574 | startPx = !0;
|
36575 | event.preventDefault();
|
36576 | }
|
36577 | }
|
36578 | };
|
36579 |
|
36580 | // bind touch events
|
36581 | eventRect.on("touchstart", function (event) {
|
36582 | state.event = event;
|
36583 | $$.updateEventRect();
|
36584 | }).on("touchstart.eventRect touchmove.eventRect", function (event) {
|
36585 | state.event = event;
|
36586 |
|
36587 | if (!eventRect.empty() && eventRect.classed(config_classes.eventRect)) {
|
36588 | // if touch points are > 1, means doing zooming interaction. In this case do not execute tooltip codes.
|
36589 | if (state.dragging || state.flowing || $$.hasArcType() || event.touches.length > 1) {
|
36590 | return;
|
36591 | }
|
36592 |
|
36593 | preventEvent(event);
|
36594 | selectRect(eventRect.node());
|
36595 | } else {
|
36596 | unselectRect();
|
36597 | }
|
36598 | }, !0).on("touchend.eventRect", function (event) {
|
36599 | state.event = event;
|
36600 |
|
36601 | if (!eventRect.empty() && eventRect.classed(config_classes.eventRect)) {
|
36602 | if ($$.hasArcType() || !$$.toggleShape || state.cancelClick) {
|
36603 | state.cancelClick && (state.cancelClick = !1);
|
36604 | }
|
36605 | }
|
36606 | }, !0);
|
36607 | svg.on("touchstart", function (event) {
|
36608 | state.event = event;
|
36609 | var target = event.target;
|
36610 |
|
36611 | if (target && target !== eventRect.node()) {
|
36612 | unselectRect();
|
36613 | }
|
36614 | });
|
36615 | },
|
36616 |
|
36617 | /**
|
36618 | * Update event rect size
|
36619 | * @param {d3Selection} eventRect Event <rect> element
|
36620 | * @param {boolean} force Force to update
|
36621 | * @private
|
36622 | */
|
36623 | updateEventRect: function updateEventRect(eventRect, force) {
|
36624 | if (force === void 0) {
|
36625 | force = !1;
|
36626 | }
|
36627 |
|
36628 | var $$ = this,
|
36629 | state = $$.state,
|
36630 | $el = $$.$el,
|
36631 | _state = state,
|
36632 | eventReceiver = _state.eventReceiver,
|
36633 | width = _state.width,
|
36634 | height = _state.height,
|
36635 | rendered = _state.rendered,
|
36636 | resizing = _state.resizing,
|
36637 | rectElement = eventRect || $el.eventRect;
|
36638 |
|
36639 | if (!rendered || resizing || force) {
|
36640 | rectElement.attr("x", 0).attr("y", 0).attr("width", width).attr("height", height); // only for init
|
36641 |
|
36642 | if (!rendered) {
|
36643 | rectElement.attr("class", config_classes.eventRect);
|
36644 | }
|
36645 | }
|
36646 |
|
36647 | (function updateClientRect() {
|
36648 | eventReceiver && (eventReceiver.rect = rectElement.node().getBoundingClientRect());
|
36649 | })();
|
36650 | },
|
36651 |
|
36652 | /**
|
36653 | * Updates the location and size of the eventRect.
|
36654 | * @private
|
36655 | */
|
36656 | updateEventRectData: function updateEventRectData() {
|
36657 | var $$ = this,
|
36658 | config = $$.config,
|
36659 | scale = $$.scale,
|
36660 | state = $$.state,
|
36661 | xScale = scale.zoom || scale.x,
|
36662 | isRotated = config.axis_rotated,
|
36663 | x,
|
36664 | y,
|
36665 | w,
|
36666 | h;
|
36667 |
|
36668 | if ($$.isMultipleX()) {
|
36669 | // TODO: rotated not supported yet
|
36670 | x = 0;
|
36671 | y = 0;
|
36672 | w = state.width;
|
36673 | h = state.height;
|
36674 | } else {
|
36675 | var rectW, rectX;
|
36676 |
|
36677 | if ($$.axis.isCategorized()) {
|
36678 | rectW = $$.getEventRectWidth();
|
36679 |
|
36680 | rectX = function (d) {
|
36681 | return xScale(d.x) - rectW / 2;
|
36682 | };
|
36683 | } else {
|
36684 | var getPrevNextX = function (_ref) {
|
36685 | var index = _ref.index;
|
36686 | return {
|
36687 | prev: $$.getPrevX(index),
|
36688 | next: $$.getNextX(index)
|
36689 | };
|
36690 | };
|
36691 |
|
36692 | rectW = function (d) {
|
36693 | var x = getPrevNextX(d),
|
36694 | xDomain = xScale.domain();
|
36695 |
|
36696 | // if there this is a single data point make the eventRect full width (or height)
|
36697 | if (x.prev === null && x.next === null) {
|
36698 | return isRotated ? state.height : state.width;
|
36699 | }
|
36700 |
|
36701 | Object.keys(x).forEach(function (key, i) {
|
36702 | var _x$key;
|
36703 |
|
36704 | x[key] = (_x$key = x[key]) != null ? _x$key : xDomain[i];
|
36705 | });
|
36706 | return Math.max(0, (xScale(x.next) - xScale(x.prev)) / 2);
|
36707 | };
|
36708 |
|
36709 | rectX = function (d) {
|
36710 | var x = getPrevNextX(d),
|
36711 | thisX = d.x;
|
36712 |
|
36713 | // if there this is a single data point position the eventRect at 0
|
36714 | if (x.prev === null && x.next === null) {
|
36715 | return 0;
|
36716 | }
|
36717 |
|
36718 | if (x.prev === null) {
|
36719 | x.prev = xScale.domain()[0];
|
36720 | }
|
36721 |
|
36722 | return (xScale(thisX) + xScale(x.prev)) / 2;
|
36723 | };
|
36724 | }
|
36725 |
|
36726 | x = isRotated ? 0 : rectX;
|
36727 | y = isRotated ? rectX : 0;
|
36728 | w = isRotated ? state.width : rectW;
|
36729 | h = isRotated ? rectW : state.height;
|
36730 | }
|
36731 |
|
36732 | var eventReceiver = state.eventReceiver,
|
36733 | call = function (fn, v) {
|
36734 | return isFunction(fn) ? fn(v) : fn;
|
36735 | };
|
36736 |
|
36737 | // reset for possible remains coords data before the data loading
|
36738 | eventReceiver.coords.splice(eventReceiver.data.length);
|
36739 | eventReceiver.data.forEach(function (d, i) {
|
36740 | eventReceiver.coords[i] = {
|
36741 | x: call(x, d),
|
36742 | y: call(y, d),
|
36743 | w: call(w, d),
|
36744 | h: call(h, d)
|
36745 | };
|
36746 | });
|
36747 | },
|
36748 | selectRectForMultipleXs: function selectRectForMultipleXs(context) {
|
36749 | var $$ = this,
|
36750 | config = $$.config,
|
36751 | state = $$.state,
|
36752 | targetsToShow = $$.filterTargetsToShow($$.data.targets);
|
36753 |
|
36754 | // do nothing when dragging
|
36755 | if (state.dragging || $$.hasArcType(targetsToShow)) {
|
36756 | return;
|
36757 | }
|
36758 |
|
36759 | var mouse = getPointer(state.event, context),
|
36760 | closest = $$.findClosestFromTargets(targetsToShow, mouse);
|
36761 |
|
36762 | if (state.mouseover && (!closest || closest.id !== state.mouseover.id)) {
|
36763 | config.data_onout.call($$.api, state.mouseover);
|
36764 | state.mouseover = undefined;
|
36765 | }
|
36766 |
|
36767 | if (!closest) {
|
36768 | $$.unselectRect();
|
36769 | return;
|
36770 | }
|
36771 |
|
36772 | var sameXData = $$.isBubbleType(closest) || $$.isScatterType(closest) || !config.tooltip_grouped ? [closest] : $$.filterByX(targetsToShow, closest.x),
|
36773 | selectedData = sameXData.map(function (d) {
|
36774 | return $$.addName(d);
|
36775 | }); // show tooltip when cursor is close to some point
|
36776 |
|
36777 | $$.showTooltip(selectedData, context); // expand points
|
36778 |
|
36779 | $$.setExpand(closest.index, closest.id, !0); // Show xgrid focus line
|
36780 |
|
36781 | $$.showGridFocus(selectedData); // Show cursor as pointer if point is close to mouse position
|
36782 |
|
36783 | if ($$.isBarType(closest.id) || $$.dist(closest, mouse) < config.point_sensitivity) {
|
36784 | $$.$el.svg.select("." + config_classes.eventRect).style("cursor", "pointer");
|
36785 |
|
36786 | if (!state.mouseover) {
|
36787 | config.data_onover.call($$.api, closest);
|
36788 | state.mouseover = closest;
|
36789 | }
|
36790 | }
|
36791 | },
|
36792 |
|
36793 | /**
|
36794 | * Unselect EventRect.
|
36795 | * @private
|
36796 | */
|
36797 | unselectRect: function unselectRect() {
|
36798 | var $$ = this,
|
36799 | config = $$.config,
|
36800 | _$$$$el2 = $$.$el,
|
36801 | circle = _$$$$el2.circle,
|
36802 | tooltip = _$$$$el2.tooltip;
|
36803 | $$.$el.svg.select("." + config_classes.eventRect).style("cursor", null);
|
36804 | $$.hideGridFocus();
|
36805 |
|
36806 | if (tooltip) {
|
36807 | $$.hideTooltip();
|
36808 |
|
36809 | $$._handleLinkedCharts(!1);
|
36810 | }
|
36811 |
|
36812 | circle && !config.point_focus_only && $$.unexpandCircles();
|
36813 | $$.expandBarTypeShapes(!1);
|
36814 | },
|
36815 |
|
36816 | /**
|
36817 | * Create eventRect for each data on the x-axis.
|
36818 | * Register touch and drag events.
|
36819 | * @param {object} eventRectEnter d3.select(CLASS.eventRects) object.
|
36820 | * @returns {object} d3.select(CLASS.eventRects) object.
|
36821 | * @private
|
36822 | */
|
36823 | generateEventRectsForSingleX: function generateEventRectsForSingleX(eventRectEnter) {
|
36824 | var $$ = this,
|
36825 | config = $$.config,
|
36826 | state = $$.state,
|
36827 | eventReceiver = state.eventReceiver,
|
36828 | rect = eventRectEnter.style("cursor", config.data_selection_enabled && config.data_selection_grouped ? "pointer" : null).on("click", function (event) {
|
36829 | state.event = event;
|
36830 | var _eventReceiver = eventReceiver,
|
36831 | currentIdx = _eventReceiver.currentIdx,
|
36832 | data = _eventReceiver.data,
|
36833 | d = data[currentIdx === -1 ? $$.getDataIndexFromEvent(event) : currentIdx];
|
36834 | $$.clickHandlerForSingleX.bind(this)(d, $$);
|
36835 | });
|
36836 |
|
36837 | if (state.inputType === "mouse") {
|
36838 | var getData = function (event) {
|
36839 | var index = event ? $$.getDataIndexFromEvent(event) : eventReceiver.currentIdx;
|
36840 | return index > -1 ? eventReceiver.data[index] : null;
|
36841 | };
|
36842 |
|
36843 | rect.on("mouseover", function (event) {
|
36844 | state.event = event;
|
36845 | $$.updateEventRect();
|
36846 | }).on("mousemove", function (event) {
|
36847 | var d = getData(event);
|
36848 | state.event = event;
|
36849 |
|
36850 | if (!d) {
|
36851 | return;
|
36852 | }
|
36853 |
|
36854 | var index = d.index,
|
36855 | stepType = config.line_step_type;
|
36856 |
|
36857 | // tooltip position match for step-before & step-after
|
36858 | if (config.line_step_tooltipMatch && $$.hasType("step") && /^step\-(before|after)$/.test(stepType)) {
|
36859 | var scale = $$.scale.zoom || $$.scale.x,
|
36860 | xs = $$.axis.xs[index],
|
36861 | inverted = scale.invert(getPointer(event, this)[0]);
|
36862 |
|
36863 | if (stepType === "step-after" && inverted < xs) {
|
36864 | index -= 1;
|
36865 | } else if (stepType === "step-before" && inverted > xs) {
|
36866 | index += 1;
|
36867 | }
|
36868 | } // do nothing while dragging/flowing
|
36869 |
|
36870 |
|
36871 | if (state.dragging || state.flowing || $$.hasArcType() || config.tooltip_grouped && index === eventReceiver.currentIdx) {
|
36872 | return;
|
36873 | }
|
36874 |
|
36875 | if (index !== eventReceiver.currentIdx) {
|
36876 | $$.setOverOut(!1, eventReceiver.currentIdx);
|
36877 | eventReceiver.currentIdx = index;
|
36878 | }
|
36879 |
|
36880 | index === -1 ? $$.unselectRect() : $$.selectRectForSingle(this, rect, index); // As of individual data point(or <path>) element can't bind mouseover/out event
|
36881 | // to determine current interacting element, so use 'mousemove' event instead.
|
36882 |
|
36883 | $$.setOverOut(index !== -1, index);
|
36884 | }).on("mouseout", function (event) {
|
36885 | state.event = event; // chart is destroyed
|
36886 |
|
36887 | if (!config || $$.hasArcType() || eventReceiver.currentIdx === -1) {
|
36888 | return;
|
36889 | }
|
36890 |
|
36891 | $$.unselectRect();
|
36892 | $$.setOverOut(!1, eventReceiver.currentIdx); // reset the event current index
|
36893 |
|
36894 | eventReceiver.currentIdx = -1;
|
36895 | });
|
36896 | }
|
36897 |
|
36898 | return rect;
|
36899 | },
|
36900 | clickHandlerForSingleX: function clickHandlerForSingleX(d, ctx) {
|
36901 | var $$ = ctx,
|
36902 | config = $$.config,
|
36903 | state = $$.state,
|
36904 | main = $$.$el.main;
|
36905 |
|
36906 | if (!d || $$.hasArcType() || state.cancelClick) {
|
36907 | state.cancelClick && (state.cancelClick = !1);
|
36908 | return;
|
36909 | }
|
36910 |
|
36911 | var index = d.index;
|
36912 | main.selectAll("." + config_classes.shape + "-" + index).each(function (d2) {
|
36913 | if (config.data_selection_grouped || $$.isWithinShape(this, d2)) {
|
36914 | $$.toggleShape == null ? void 0 : $$.toggleShape(this, d2, index);
|
36915 | config.data_onclick.bind($$.api)(d2, this);
|
36916 | }
|
36917 | });
|
36918 | },
|
36919 |
|
36920 | /**
|
36921 | * Create an eventRect,
|
36922 | * Register touch and drag events.
|
36923 | * @param {object} eventRectEnter d3.select(CLASS.eventRects) object.
|
36924 | * @private
|
36925 | */
|
36926 | generateEventRectsForMultipleXs: function generateEventRectsForMultipleXs(eventRectEnter) {
|
36927 | var $$ = this,
|
36928 | state = $$.state;
|
36929 | eventRectEnter.on("click", function (event) {
|
36930 | state.event = event;
|
36931 | $$.clickHandlerForMultipleXS.bind(this)($$);
|
36932 | });
|
36933 |
|
36934 | if (state.inputType === "mouse") {
|
36935 | eventRectEnter.on("mouseover mousemove", function (event) {
|
36936 | state.event = event;
|
36937 | $$.selectRectForMultipleXs(this);
|
36938 | }).on("mouseout", function (event) {
|
36939 | state.event = event; // chart is destroyed
|
36940 |
|
36941 | if (!$$.config || $$.hasArcType()) {
|
36942 | return;
|
36943 | }
|
36944 |
|
36945 | $$.unselectRect();
|
36946 | });
|
36947 | }
|
36948 | },
|
36949 | clickHandlerForMultipleXS: function clickHandlerForMultipleXS(ctx) {
|
36950 | var $$ = ctx,
|
36951 | config = $$.config,
|
36952 | state = $$.state,
|
36953 | targetsToShow = $$.filterTargetsToShow($$.data.targets);
|
36954 |
|
36955 | if ($$.hasArcType(targetsToShow)) {
|
36956 | return;
|
36957 | }
|
36958 |
|
36959 | var mouse = getPointer(state.event, this),
|
36960 | closest = $$.findClosestFromTargets(targetsToShow, mouse);
|
36961 |
|
36962 | if (!closest) {
|
36963 | return;
|
36964 | } // select if selection enabled
|
36965 |
|
36966 |
|
36967 | if ($$.isBarType(closest.id) || $$.dist(closest, mouse) < config.point_sensitivity) {
|
36968 | $$.$el.main.selectAll("." + config_classes.shapes + $$.getTargetSelectorSuffix(closest.id)).selectAll("." + config_classes.shape + "-" + closest.index).each(function () {
|
36969 | if (config.data_selection_grouped || $$.isWithinShape(this, closest)) {
|
36970 | $$.toggleShape == null ? void 0 : $$.toggleShape(this, closest, closest.index);
|
36971 | config.data_onclick.bind($$.api)(closest, this);
|
36972 | }
|
36973 | });
|
36974 | }
|
36975 | }
|
36976 | });
|
36977 | ;// CONCATENATED MODULE: ./node_modules/d3-ease/src/linear.js
|
36978 | var src_linear_linear = function (t) {
|
36979 | return +t;
|
36980 | };
|
36981 | ;// CONCATENATED MODULE: ./src/ChartInternal/interactions/flow.ts
|
36982 | /**
|
36983 | * Copyright (c) 2017 ~ present NAVER Corp.
|
36984 | * billboard.js project is licensed under the MIT license
|
36985 | */
|
36986 |
|
36987 |
|
36988 |
|
36989 |
|
36990 | /* harmony default export */ var interactions_flow = ({
|
36991 | /**
|
36992 | * Generate flow
|
36993 | * @param {object} args option object
|
36994 | * @returns {Function}
|
36995 | * @private
|
36996 | */
|
36997 | generateFlow: function generateFlow(args) {
|
36998 | var $$ = this,
|
36999 | data = $$.data,
|
37000 | state = $$.state,
|
37001 | $el = $$.$el;
|
37002 | return function () {
|
37003 | var flowLength = args.flow.length; // set flag
|
37004 |
|
37005 | state.flowing = !0; // remove head data after rendered
|
37006 |
|
37007 | data.targets.forEach(function (d) {
|
37008 | d.values.splice(0, flowLength);
|
37009 | }); // update elements related to x scale
|
37010 |
|
37011 | if ($$.updateXGrid) {
|
37012 | $$.updateXGrid(!0);
|
37013 | } // target elements
|
37014 |
|
37015 |
|
37016 | var elements = {};
|
37017 | ["axis.x", "grid.x", "gridLines.x", "region.list", "text", "bar", "line", "area", "circle"].forEach(function (v) {
|
37018 | var _node,
|
37019 | name = v.split("."),
|
37020 | node = $el[name[0]];
|
37021 |
|
37022 | if (node && name.length > 1) {
|
37023 | node = node[name[1]];
|
37024 | }
|
37025 |
|
37026 | if ((_node = node) != null && _node.size()) {
|
37027 | elements[v] = node;
|
37028 | }
|
37029 | });
|
37030 | $$.hideGridFocus();
|
37031 | $$.setFlowList(elements, args);
|
37032 | };
|
37033 | },
|
37034 |
|
37035 | /**
|
37036 | * Set flow list
|
37037 | * @param {object} elements Target elements
|
37038 | * @param {object} args option object
|
37039 | * @private
|
37040 | */
|
37041 | setFlowList: function setFlowList(elements, args) {
|
37042 | var $$ = this,
|
37043 | flow = args.flow,
|
37044 | targets = args.targets,
|
37045 | _flow = flow,
|
37046 | _flow$duration = _flow.duration,
|
37047 | duration = _flow$duration === void 0 ? args.duration : _flow$duration,
|
37048 | flowIndex = _flow.index,
|
37049 | flowLength = _flow.length,
|
37050 | orgDataCount = _flow.orgDataCount,
|
37051 | transform = $$.getFlowTransform(targets, orgDataCount, flowIndex, flowLength),
|
37052 | wait = generateWait(),
|
37053 | n;
|
37054 | wait.add(Object.keys(elements).map(function (v) {
|
37055 | n = elements[v].transition().ease(src_linear_linear).duration(duration);
|
37056 |
|
37057 | if (v === "axis.x") {
|
37058 | n = n.call(function (g) {
|
37059 | $$.axis.x.setTransition(g).create(g);
|
37060 | });
|
37061 | } else if (v === "region.list") {
|
37062 | n = n.filter($$.isRegionOnX).attr("transform", transform);
|
37063 | } else {
|
37064 | n = n.attr("transform", transform);
|
37065 | }
|
37066 |
|
37067 | return n;
|
37068 | }));
|
37069 | n.call(wait, function () {
|
37070 | $$.cleanUpFlow(elements, args);
|
37071 | });
|
37072 | },
|
37073 |
|
37074 | /**
|
37075 | * Clean up flow
|
37076 | * @param {object} elements Target elements
|
37077 | * @param {object} args option object
|
37078 | * @private
|
37079 | */
|
37080 | cleanUpFlow: function cleanUpFlow(elements, args) {
|
37081 | var $$ = this,
|
37082 | config = $$.config,
|
37083 | state = $$.state,
|
37084 | svg = $$.$el.svg,
|
37085 | isRotated = config.axis_rotated,
|
37086 | flow = args.flow,
|
37087 | shape = args.shape,
|
37088 | xv = args.xv,
|
37089 | _shape$pos = shape.pos,
|
37090 | cx = _shape$pos.cx,
|
37091 | cy = _shape$pos.cy,
|
37092 | xForText = _shape$pos.xForText,
|
37093 | yForText = _shape$pos.yForText,
|
37094 | _flow2 = flow,
|
37095 | _flow2$done = _flow2.done,
|
37096 | done = _flow2$done === void 0 ? function () {} : _flow2$done,
|
37097 | flowLength = _flow2.length;
|
37098 |
|
37099 | // Remove flowed elements
|
37100 | if (flowLength) {
|
37101 | ["circle", "text", "shape", "eventRect"].forEach(function (v) {
|
37102 | var target = [];
|
37103 |
|
37104 | for (var i = 0; i < flowLength; i++) {
|
37105 | target.push("." + config_classes[v] + "-" + i);
|
37106 | }
|
37107 |
|
37108 | svg.selectAll("." + config_classes[v + "s"]) // circles, shapes, texts, eventRects
|
37109 | .selectAll(target).remove();
|
37110 | });
|
37111 | svg.select("." + config_classes.xgrid).remove();
|
37112 | } // draw again for removing flowed elements and reverting attr
|
37113 |
|
37114 |
|
37115 | Object.keys(elements).forEach(function (v) {
|
37116 | var n = elements[v];
|
37117 |
|
37118 | if (v !== "axis.x") {
|
37119 | n.attr("transform", null);
|
37120 | }
|
37121 |
|
37122 | if (v === "grid.x") {
|
37123 | n.attr(state.xgridAttr);
|
37124 | } else if (v === "gridLines.x") {
|
37125 | n.attr("x1", isRotated ? 0 : xv).attr("x2", isRotated ? state.width : xv);
|
37126 | } else if (v === "gridLines.x") {
|
37127 | n.select("line").attr("x1", isRotated ? 0 : xv).attr("x2", isRotated ? state.width : xv);
|
37128 | n.select("text").attr("x", isRotated ? state.width : 0).attr("y", xv);
|
37129 | } else if (/^(area|bar|line)$/.test(v)) {
|
37130 | n.attr("d", shape.type[v]);
|
37131 | } else if (v === "text") {
|
37132 | n.attr("x", xForText).attr("y", yForText).style("fill-opacity", $$.opacityForText.bind($$));
|
37133 | } else if (v === "circle") {
|
37134 | if ($$.isCirclePoint()) {
|
37135 | n.attr("cx", cx).attr("cy", cy);
|
37136 | } else {
|
37137 | var xFunc = function (d) {
|
37138 | return cx(d) - config.point_r;
|
37139 | },
|
37140 | yFunc = function (d) {
|
37141 | return cy(d) - config.point_r;
|
37142 | };
|
37143 |
|
37144 | n.attr("x", xFunc).attr("y", yFunc).attr("cx", cx) // when pattern is used, it possibly contain 'circle' also.
|
37145 | .attr("cy", cy);
|
37146 | }
|
37147 | } else if (v === "region.list") {
|
37148 | n.select("rect").filter($$.isRegionOnX).attr("x", $$.regionX.bind($$)).attr("width", $$.regionWidth.bind($$));
|
37149 | }
|
37150 | });
|
37151 | config.interaction_enabled && $$.redrawEventRect(); // callback for end of flow
|
37152 |
|
37153 | done.call($$.api);
|
37154 | state.flowing = !1;
|
37155 | },
|
37156 |
|
37157 | /**
|
37158 | * Get flow transform value
|
37159 | * @param {object} targets target
|
37160 | * @param {number} orgDataCount original data count
|
37161 | * @param {number} flowIndex flow index
|
37162 | * @param {number} flowLength flow length
|
37163 | * @returns {string}
|
37164 | * @private
|
37165 | */
|
37166 | getFlowTransform: function getFlowTransform(targets, orgDataCount, flowIndex, flowLength) {
|
37167 | var _flowStart,
|
37168 | _flowEnd,
|
37169 | $$ = this,
|
37170 | data = $$.data,
|
37171 | x = $$.scale.x,
|
37172 | dataValues = data.targets[0].values,
|
37173 | flowStart = $$.getValueOnIndex(dataValues, flowIndex),
|
37174 | flowEnd = $$.getValueOnIndex(dataValues, flowIndex + flowLength),
|
37175 | translateX,
|
37176 | orgDomain = x.domain(),
|
37177 | domain = $$.updateXDomain(targets, !0, !0);
|
37178 |
|
37179 | // generate transform to flow
|
37180 | if (!orgDataCount) {
|
37181 | // if empty
|
37182 | if (dataValues.length !== 1) {
|
37183 | translateX = x(orgDomain[0]) - x(domain[0]);
|
37184 | } else {
|
37185 | if ($$.axis.isTimeSeries()) {
|
37186 | flowStart = $$.getValueOnIndex(dataValues, 0);
|
37187 | flowEnd = $$.getValueOnIndex(dataValues, dataValues.length - 1);
|
37188 | translateX = x(flowStart.x) - x(flowEnd.x);
|
37189 | } else {
|
37190 | translateX = diffDomain(domain) / 2;
|
37191 | }
|
37192 | }
|
37193 | } else if (orgDataCount === 1 || ((_flowStart = flowStart) == null ? void 0 : _flowStart.x) === ((_flowEnd = flowEnd) == null ? void 0 : _flowEnd.x)) {
|
37194 | translateX = x(orgDomain[0]) - x(domain[0]);
|
37195 | } else {
|
37196 | translateX = $$.axis.isTimeSeries() ? x(orgDomain[0]) - x(domain[0]) : x(flowStart.x) - x(flowEnd.x);
|
37197 | }
|
37198 |
|
37199 | var scaleX = diffDomain(orgDomain) / diffDomain(domain);
|
37200 | return "translate(" + translateX + ",0) scale(" + scaleX + ",1)";
|
37201 | }
|
37202 | });
|
37203 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/clip.ts
|
37204 | /**
|
37205 | * Copyright (c) 2017 ~ present NAVER Corp.
|
37206 | * billboard.js project is licensed under the MIT license
|
37207 | */
|
37208 |
|
37209 | /* harmony default export */ var clip = ({
|
37210 | initClip: function initClip() {
|
37211 | var $$ = this,
|
37212 | clip = $$.state.clip;
|
37213 | // MEMO: clipId needs to be unique because it conflicts when multiple charts exist
|
37214 | clip.id = $$.state.datetimeId + "-clip";
|
37215 | clip.idXAxis = clip.id + "-xaxis";
|
37216 | clip.idYAxis = clip.id + "-yaxis";
|
37217 | clip.idGrid = clip.id + "-grid"; // Define 'clip-path' attribute values
|
37218 |
|
37219 | clip.path = $$.getClipPath(clip.id);
|
37220 | clip.pathXAxis = $$.getClipPath(clip.idXAxis);
|
37221 | clip.pathYAxis = $$.getClipPath(clip.idYAxis);
|
37222 | clip.pathGrid = $$.getClipPath(clip.idGrid);
|
37223 | },
|
37224 | getClipPath: function getClipPath(id) {
|
37225 | var $$ = this,
|
37226 | config = $$.config;
|
37227 |
|
37228 | if (!config.clipPath && /-clip$/.test(id) || !config.axis_x_clipPath && /-clip-xaxis$/.test(id) || !config.axis_y_clipPath && /-clip-yaxis$/.test(id)) {
|
37229 | return null;
|
37230 | }
|
37231 |
|
37232 | var isIE9 = win.navigator ? win.navigator.appVersion.toLowerCase().indexOf("msie 9.") >= 0 : !1;
|
37233 | return "url(" + (isIE9 ? "" : browser_doc.URL.split("#")[0]) + "#" + id + ")";
|
37234 | },
|
37235 | appendClip: function appendClip(parent, id) {
|
37236 | id && parent.append("clipPath").attr("id", id).append("rect");
|
37237 | },
|
37238 |
|
37239 | /**
|
37240 | * Set x Axis clipPath dimension
|
37241 | * @param {d3Selecton} node clipPath <rect> selection
|
37242 | * @private
|
37243 | */
|
37244 | setXAxisClipPath: function setXAxisClipPath(node) {
|
37245 | var $$ = this,
|
37246 | config = $$.config,
|
37247 | _$$$state = $$.state,
|
37248 | margin = _$$$state.margin,
|
37249 | width = _$$$state.width,
|
37250 | height = _$$$state.height,
|
37251 | isRotated = config.axis_rotated,
|
37252 | left = Math.max(30, margin.left) - (isRotated ? 0 : 20),
|
37253 | x = isRotated ? -(1 + left) : -(left - 1),
|
37254 | y = -Math.max(15, margin.top),
|
37255 | w = isRotated ? margin.left + 20 : width + 10 + left,
|
37256 | h = (isRotated ? margin.top + height + 10 : margin.bottom) + 20;
|
37257 | node.attr("x", x).attr("y", y).attr("width", w).attr("height", h);
|
37258 | },
|
37259 |
|
37260 | /**
|
37261 | * Set y Axis clipPath dimension
|
37262 | * @param {d3Selecton} node clipPath <rect> selection
|
37263 | * @private
|
37264 | */
|
37265 | setYAxisClipPath: function setYAxisClipPath(node) {
|
37266 | var $$ = this,
|
37267 | config = $$.config,
|
37268 | _$$$state2 = $$.state,
|
37269 | margin = _$$$state2.margin,
|
37270 | width = _$$$state2.width,
|
37271 | height = _$$$state2.height,
|
37272 | isRotated = config.axis_rotated,
|
37273 | left = Math.max(30, margin.left) - (isRotated ? 20 : 0),
|
37274 | isInner = config.axis_y_inner,
|
37275 | x = isInner ? -1 : isRotated ? -(1 + left) : -(left - 1),
|
37276 | y = -(isRotated ? 20 : margin.top),
|
37277 | w = (isRotated ? width + 15 + left : margin.left + 20) + (isInner ? 20 : 0),
|
37278 | h = (isRotated ? margin.bottom : margin.top + height) + 10;
|
37279 | node.attr("x", x).attr("y", y).attr("width", w).attr("height", h);
|
37280 | },
|
37281 | updateXAxisTickClip: function updateXAxisTickClip() {
|
37282 | var $$ = this,
|
37283 | config = $$.config,
|
37284 | _$$$state3 = $$.state,
|
37285 | clip = _$$$state3.clip,
|
37286 | xAxisHeight = _$$$state3.xAxisHeight,
|
37287 | defs = $$.$el.defs,
|
37288 | newXAxisHeight = $$.getHorizontalAxisHeight("x");
|
37289 |
|
37290 | if (defs && !clip.idXAxisTickTexts) {
|
37291 | var clipId = clip.id + "-xaxisticktexts";
|
37292 | $$.appendClip(defs, clipId);
|
37293 | clip.pathXAxisTickTexts = $$.getClipPath(clip.idXAxisTickTexts);
|
37294 | clip.idXAxisTickTexts = clipId;
|
37295 | }
|
37296 |
|
37297 | if (!config.axis_x_tick_multiline && $$.getAxisTickRotate("x") && newXAxisHeight !== xAxisHeight) {
|
37298 | $$.setXAxisTickClipWidth();
|
37299 | $$.setXAxisTickTextClipPathWidth();
|
37300 | }
|
37301 |
|
37302 | $$.state.xAxisHeight = newXAxisHeight;
|
37303 | },
|
37304 | setXAxisTickClipWidth: function setXAxisTickClipWidth() {
|
37305 | var $$ = this,
|
37306 | config = $$.config,
|
37307 | maxTickWidths = $$.state.current.maxTickWidths,
|
37308 | xAxisTickRotate = $$.getAxisTickRotate("x");
|
37309 |
|
37310 | if (!config.axis_x_tick_multiline && xAxisTickRotate) {
|
37311 | var sinRotation = Math.sin(Math.PI / 180 * Math.abs(xAxisTickRotate));
|
37312 | maxTickWidths.x.clipPath = ($$.getHorizontalAxisHeight("x") - 20) / sinRotation;
|
37313 | } else {
|
37314 | maxTickWidths.x.clipPath = null;
|
37315 | }
|
37316 | },
|
37317 | setXAxisTickTextClipPathWidth: function setXAxisTickTextClipPathWidth() {
|
37318 | var $$ = this,
|
37319 | _$$$state4 = $$.state,
|
37320 | clip = _$$$state4.clip,
|
37321 | current = _$$$state4.current,
|
37322 | svg = $$.$el.svg;
|
37323 |
|
37324 | if (svg) {
|
37325 | svg.select("#" + clip.idXAxisTickTexts + " rect").attr("width", current.maxTickWidths.x.clipPath).attr("height", 30);
|
37326 | }
|
37327 | }
|
37328 | });
|
37329 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/grid.ts
|
37330 | /**
|
37331 | * Copyright (c) 2017 ~ present NAVER Corp.
|
37332 | * billboard.js project is licensed under the MIT license
|
37333 | */
|
37334 |
|
37335 |
|
37336 | // Grid position and text anchor helpers
|
37337 |
|
37338 | var getGridTextAnchor = function (d) {
|
37339 | return isValue(d.position) || "end";
|
37340 | },
|
37341 | getGridTextDx = function (d) {
|
37342 | return d.position === "start" ? 4 : d.position === "middle" ? 0 : -4;
|
37343 | };
|
37344 |
|
37345 | /**
|
37346 | * Get grid text x value getter function
|
37347 | * @param {boolean} isX Is x Axis
|
37348 | * @param {number} width Width value
|
37349 | * @param {number} height Height value
|
37350 | * @returns {Function}
|
37351 | * @private
|
37352 | */
|
37353 | function getGridTextX(isX, width, height) {
|
37354 | return function (d) {
|
37355 | var x = isX ? 0 : width;
|
37356 |
|
37357 | if (d.position === "start") {
|
37358 | x = isX ? -height : 0;
|
37359 | } else if (d.position === "middle") {
|
37360 | x = (isX ? -height : width) / 2;
|
37361 | }
|
37362 |
|
37363 | return x;
|
37364 | };
|
37365 | }
|
37366 | /**
|
37367 | * Update coordinate attributes value
|
37368 | * @param {d3.selection} el Target node
|
37369 | * @param {string} type Type
|
37370 | * @private
|
37371 | */
|
37372 |
|
37373 |
|
37374 | function smoothLines(el, type) {
|
37375 | if (type === "grid") {
|
37376 | el.each(function () {
|
37377 | var g = src_select(this);
|
37378 | ["x1", "x2", "y1", "y2"].forEach(function (v) {
|
37379 | return g.attr(v, Math.ceil(+g.attr(v)));
|
37380 | });
|
37381 | });
|
37382 | }
|
37383 | }
|
37384 |
|
37385 | /* harmony default export */ var grid = ({
|
37386 | hasGrid: function hasGrid() {
|
37387 | var config = this.config;
|
37388 | return ["x", "y"].some(function (v) {
|
37389 | return config["grid_" + v + "_show"] || config["grid_" + v + "_lines"].length;
|
37390 | });
|
37391 | },
|
37392 | initGrid: function initGrid() {
|
37393 | var $$ = this;
|
37394 | $$.hasGrid() && $$.initGridLines();
|
37395 | $$.initFocusGrid();
|
37396 | },
|
37397 | initGridLines: function initGridLines() {
|
37398 | var $$ = this,
|
37399 | config = $$.config,
|
37400 | clip = $$.state.clip,
|
37401 | $el = $$.$el;
|
37402 |
|
37403 | if (config.grid_x_lines.length || config.grid_y_lines.length) {
|
37404 | $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);
|
37405 | $el.gridLines.main.append("g").attr("class", config_classes.xgridLines);
|
37406 | $el.gridLines.main.append("g").attr("class", config_classes.ygridLines);
|
37407 | $el.gridLines.x = src_selectAll([]);
|
37408 | }
|
37409 | },
|
37410 | updateXGrid: function updateXGrid(withoutUpdate) {
|
37411 | var $$ = this,
|
37412 | config = $$.config,
|
37413 | scale = $$.scale,
|
37414 | state = $$.state,
|
37415 | _$$$$el = $$.$el,
|
37416 | main = _$$$$el.main,
|
37417 | grid = _$$$$el.grid,
|
37418 | isRotated = config.axis_rotated,
|
37419 | xgridData = $$.generateGridData(config.grid_x_type, scale.x),
|
37420 | tickOffset = $$.axis.isCategorized() ? $$.axis.x.tickOffset() : 0,
|
37421 | pos = function (d) {
|
37422 | return (scale.zoom || scale.x)(d) + tickOffset * (isRotated ? -1 : 1);
|
37423 | };
|
37424 |
|
37425 | state.xgridAttr = isRotated ? {
|
37426 | "x1": 0,
|
37427 | "x2": state.width,
|
37428 | "y1": pos,
|
37429 | "y2": pos
|
37430 | } : {
|
37431 | "x1": pos,
|
37432 | "x2": pos,
|
37433 | "y1": 0,
|
37434 | "y2": state.height
|
37435 | };
|
37436 | grid.x = main.select("." + config_classes.xgrids).selectAll("." + config_classes.xgrid).data(xgridData);
|
37437 | grid.x.exit().remove();
|
37438 | grid.x = grid.x.enter().append("line").attr("class", config_classes.xgrid).merge(grid.x);
|
37439 |
|
37440 | if (!withoutUpdate) {
|
37441 | grid.x.each(function () {
|
37442 | var grid = src_select(this);
|
37443 | Object.keys(state.xgridAttr).forEach(function (id) {
|
37444 | grid.attr(id, state.xgridAttr[id]).style("opacity", function () {
|
37445 | return grid.attr(isRotated ? "y1" : "x1") === (isRotated ? state.height : 0) ? "0" : null;
|
37446 | });
|
37447 | });
|
37448 | });
|
37449 | }
|
37450 | },
|
37451 | updateYGrid: function updateYGrid() {
|
37452 | var $$ = this,
|
37453 | config = $$.config,
|
37454 | state = $$.state,
|
37455 | _$$$$el2 = $$.$el,
|
37456 | grid = _$$$$el2.grid,
|
37457 | main = _$$$$el2.main,
|
37458 | isRotated = config.axis_rotated,
|
37459 | gridValues = $$.axis.y.tickValues() || $$.scale.y.ticks(config.grid_y_ticks),
|
37460 | pos = function (d) {
|
37461 | return Math.ceil($$.scale.y(d));
|
37462 | };
|
37463 |
|
37464 | grid.y = main.select("." + config_classes.ygrids).selectAll("." + config_classes.ygrid).data(gridValues);
|
37465 | grid.y.exit().remove();
|
37466 | grid.y = grid.y.enter().append("line").attr("class", config_classes.ygrid).merge(grid.y);
|
37467 | grid.y.attr("x1", isRotated ? pos : 0).attr("x2", isRotated ? pos : state.width).attr("y1", isRotated ? 0 : pos).attr("y2", isRotated ? state.height : pos);
|
37468 | smoothLines(grid.y, "grid");
|
37469 | },
|
37470 | updateGrid: function updateGrid() {
|
37471 | var $$ = this,
|
37472 | _$$$$el3 = $$.$el,
|
37473 | grid = _$$$$el3.grid,
|
37474 | gridLines = _$$$$el3.gridLines;
|
37475 | gridLines.main || $$.initGridLines(); // hide if arc type
|
37476 |
|
37477 | grid.main.style("visibility", $$.hasArcType() ? "hidden" : null);
|
37478 | $$.hideGridFocus();
|
37479 | $$.updateXGridLines();
|
37480 | $$.updateYGridLines();
|
37481 | },
|
37482 |
|
37483 | /**
|
37484 | * Update X Grid lines
|
37485 | * @private
|
37486 | */
|
37487 | updateXGridLines: function updateXGridLines() {
|
37488 | var $$ = this,
|
37489 | config = $$.config,
|
37490 | _$$$$el4 = $$.$el,
|
37491 | gridLines = _$$$$el4.gridLines,
|
37492 | main = _$$$$el4.main,
|
37493 | $T = $$.$T,
|
37494 | isRotated = config.axis_rotated;
|
37495 | config.grid_x_show && $$.updateXGrid();
|
37496 | var xLines = main.select("." + config_classes.xgridLines).selectAll("." + config_classes.xgridLine).data(config.grid_x_lines); // exit
|
37497 |
|
37498 | $T(xLines.exit()).style("opacity", "0").remove(); // enter
|
37499 |
|
37500 | var xgridLine = xLines.enter().append("g");
|
37501 | xgridLine.append("line").style("opacity", "0");
|
37502 | xgridLine.append("text").attr("transform", isRotated ? "" : "rotate(-90)").attr("dy", -5).style("opacity", "0");
|
37503 | xLines = xgridLine.merge(xLines);
|
37504 | $T(xLines.attr("class", function (d) {
|
37505 | return (config_classes.xgridLine + " " + (d.class || "")).trim();
|
37506 | }).select("text").attr("text-anchor", getGridTextAnchor).attr("dx", getGridTextDx)).text(function (d) {
|
37507 | return d.text;
|
37508 | }).style("opacity", null);
|
37509 | gridLines.x = xLines;
|
37510 | },
|
37511 |
|
37512 | /**
|
37513 | * Update Y Grid lines
|
37514 | * @private
|
37515 | */
|
37516 | updateYGridLines: function updateYGridLines() {
|
37517 | var $$ = this,
|
37518 | config = $$.config,
|
37519 | _$$$state = $$.state,
|
37520 | width = _$$$state.width,
|
37521 | height = _$$$state.height,
|
37522 | $el = $$.$el,
|
37523 | $T = $$.$T,
|
37524 | isRotated = config.axis_rotated;
|
37525 | config.grid_y_show && $$.updateYGrid();
|
37526 | var ygridLines = $el.main.select("." + config_classes.ygridLines).selectAll("." + config_classes.ygridLine).data(config.grid_y_lines); // exit
|
37527 |
|
37528 | $T(ygridLines.exit()).style("opacity", "0").remove(); // enter
|
37529 |
|
37530 | var ygridLine = ygridLines.enter().append("g");
|
37531 | ygridLine.append("line").style("opacity", "0");
|
37532 | ygridLine.append("text").attr("transform", isRotated ? "rotate(-90)" : "").style("opacity", "0");
|
37533 | ygridLines = ygridLine.merge(ygridLines); // update
|
37534 |
|
37535 | var yv = $$.yv.bind($$);
|
37536 | $T(ygridLines.attr("class", function (d) {
|
37537 | return (config_classes.ygridLine + " " + (d.class || "")).trim();
|
37538 | }).select("line")).attr("x1", isRotated ? yv : 0).attr("x2", isRotated ? yv : width).attr("y1", isRotated ? 0 : yv).attr("y2", isRotated ? height : yv).style("opacity", null);
|
37539 | $T(ygridLines.select("text").attr("text-anchor", getGridTextAnchor).attr("dx", getGridTextDx)).attr("dy", -5).attr("x", getGridTextX(isRotated, width, height)).attr("y", yv).text(function (d) {
|
37540 | return d.text;
|
37541 | }).style("opacity", null);
|
37542 | $el.gridLines.y = ygridLines;
|
37543 | },
|
37544 | redrawGrid: function redrawGrid(withTransition) {
|
37545 | var $$ = this,
|
37546 | isRotated = $$.config.axis_rotated,
|
37547 | _$$$state2 = $$.state,
|
37548 | width = _$$$state2.width,
|
37549 | height = _$$$state2.height,
|
37550 | gridLines = $$.$el.gridLines,
|
37551 | $T = $$.$T,
|
37552 | xv = $$.xv.bind($$),
|
37553 | lines = gridLines.x.select("line"),
|
37554 | texts = gridLines.x.select("text");
|
37555 | lines = $T(lines, withTransition).attr("x1", isRotated ? 0 : xv).attr("x2", isRotated ? width : xv).attr("y1", isRotated ? xv : 0).attr("y2", isRotated ? xv : height);
|
37556 | texts = $T(texts, withTransition).attr("x", getGridTextX(!isRotated, width, height)).attr("y", xv).text(function (d) {
|
37557 | return d.text;
|
37558 | });
|
37559 | return [lines.style("opacity", null), texts.style("opacity", null)];
|
37560 | },
|
37561 | initFocusGrid: function initFocusGrid() {
|
37562 | var $$ = this,
|
37563 | config = $$.config,
|
37564 | clip = $$.state.clip,
|
37565 | $el = $$.$el,
|
37566 | isFront = config.grid_front,
|
37567 | className = "." + config_classes[isFront && $el.gridLines.main ? "gridLines" : "chart"] + (isFront ? " + *" : ""),
|
37568 | grid = $el.main.insert("g", className).attr("clip-path", clip.pathGrid).attr("class", config_classes.grid);
|
37569 | $el.grid.main = grid;
|
37570 | config.grid_x_show && grid.append("g").attr("class", config_classes.xgrids);
|
37571 | config.grid_y_show && grid.append("g").attr("class", config_classes.ygrids);
|
37572 |
|
37573 | if (config.interaction_enabled && config.grid_focus_show) {
|
37574 | grid.append("g").attr("class", config_classes.xgridFocus).append("line").attr("class", config_classes.xgridFocus); // to show xy focus grid line, should be 'tooltip.grouped=false'
|
37575 |
|
37576 | if (config.grid_focus_y && !config.tooltip_grouped) {
|
37577 | grid.append("g").attr("class", config_classes.ygridFocus).append("line").attr("class", config_classes.ygridFocus);
|
37578 | }
|
37579 | }
|
37580 | },
|
37581 |
|
37582 | /**
|
37583 | * Show grid focus line
|
37584 | * @param {Array} data Selected data
|
37585 | * @private
|
37586 | */
|
37587 | showGridFocus: function showGridFocus(data) {
|
37588 | var $$ = this,
|
37589 | config = $$.config,
|
37590 | _$$$state3 = $$.state,
|
37591 | width = _$$$state3.width,
|
37592 | height = _$$$state3.height,
|
37593 | isRotated = config.axis_rotated,
|
37594 | focusEl = $$.$el.main.selectAll("line." + config_classes.xgridFocus + ", line." + config_classes.ygridFocus),
|
37595 | dataToShow = (data || [focusEl.datum()]).filter(function (d) {
|
37596 | return d && isValue($$.getBaseValue(d));
|
37597 | });
|
37598 |
|
37599 | // Hide when bubble/scatter/stanford plot exists
|
37600 | if (!config.tooltip_show || dataToShow.length === 0 || $$.hasType("bubble") || $$.hasArcType()) {
|
37601 | return;
|
37602 | }
|
37603 |
|
37604 | var isEdge = config.grid_focus_edge && !config.tooltip_grouped,
|
37605 | xx = $$.xx.bind($$);
|
37606 | focusEl.style("visibility", null).data(dataToShow.concat(dataToShow)).each(function (d) {
|
37607 | var el = src_select(this),
|
37608 | pos = {
|
37609 | x: xx(d),
|
37610 | y: $$.getYScaleById(d.id)(d.value)
|
37611 | },
|
37612 | xy;
|
37613 |
|
37614 | if (el.classed(config_classes.xgridFocus)) {
|
37615 | // will contain 'x1, y1, x2, y2' order
|
37616 | xy = isRotated ? [null, // x1
|
37617 | pos.x, // y1
|
37618 | isEdge ? pos.y : width, // x2
|
37619 | pos.x // y2
|
37620 | ] : [pos.x, isEdge ? pos.y : null, pos.x, height];
|
37621 | } else {
|
37622 | var isY2 = $$.axis.getId(d.id) === "y2";
|
37623 | xy = isRotated ? [pos.y, // x1
|
37624 | isEdge && !isY2 ? pos.x : null, // y1
|
37625 | pos.y, // x2
|
37626 | isEdge && isY2 ? pos.x : height // y2
|
37627 | ] : [isEdge && isY2 ? pos.x : null, pos.y, isEdge && !isY2 ? pos.x : width, pos.y];
|
37628 | }
|
37629 |
|
37630 | ["x1", "y1", "x2", "y2"].forEach(function (v, i) {
|
37631 | return el.attr(v, xy[i]);
|
37632 | });
|
37633 | });
|
37634 | smoothLines(focusEl, "grid");
|
37635 | $$.showCircleFocus == null ? void 0 : $$.showCircleFocus(data);
|
37636 | },
|
37637 | hideGridFocus: function hideGridFocus() {
|
37638 | var $$ = this,
|
37639 | _$$$state4 = $$.state,
|
37640 | inputType = _$$$state4.inputType,
|
37641 | resizing = _$$$state4.resizing,
|
37642 | main = $$.$el.main;
|
37643 |
|
37644 | if (inputType === "mouse" || !resizing) {
|
37645 | main.selectAll("line." + config_classes.xgridFocus + ", line." + config_classes.ygridFocus).style("visibility", "hidden");
|
37646 | $$.hideCircleFocus == null ? void 0 : $$.hideCircleFocus();
|
37647 | }
|
37648 | },
|
37649 | updateGridFocus: function updateGridFocus() {
|
37650 | var $$ = this,
|
37651 | _$$$state5 = $$.state,
|
37652 | inputType = _$$$state5.inputType,
|
37653 | width = _$$$state5.width,
|
37654 | height = _$$$state5.height,
|
37655 | resizing = _$$$state5.resizing,
|
37656 | grid = $$.$el.grid,
|
37657 | xgridFocus = grid.main.select("line." + config_classes.xgridFocus);
|
37658 |
|
37659 | if (inputType === "touch") {
|
37660 | if (xgridFocus.empty()) {
|
37661 | resizing && ($$.showCircleFocus == null ? void 0 : $$.showCircleFocus());
|
37662 | } else {
|
37663 | $$.showGridFocus();
|
37664 | }
|
37665 | } else {
|
37666 | var _isRotated = $$.config.axis_rotated;
|
37667 | xgridFocus.attr("x1", _isRotated ? 0 : -10).attr("x2", _isRotated ? width : -10).attr("y1", _isRotated ? -10 : 0).attr("y2", _isRotated ? -10 : height);
|
37668 | } // need to return 'true' as of being pushed to the redraw list
|
37669 | // ref: getRedrawList()
|
37670 |
|
37671 |
|
37672 | return !0;
|
37673 | },
|
37674 | generateGridData: function generateGridData(type, scale) {
|
37675 | var $$ = this,
|
37676 | tickNum = $$.$el.main.select("." + config_classes.axisX).selectAll(".tick").size(),
|
37677 | gridData = [];
|
37678 |
|
37679 | if (type === "year") {
|
37680 | var xDomain = $$.getXDomain(),
|
37681 | _xDomain$map = xDomain.map(function (v) {
|
37682 | return v.getFullYear();
|
37683 | }),
|
37684 | firstYear = _xDomain$map[0],
|
37685 | lastYear = _xDomain$map[1];
|
37686 |
|
37687 | for (var i = firstYear; i <= lastYear; i++) {
|
37688 | gridData.push(new Date(i + "-01-01 00:00:00"));
|
37689 | }
|
37690 | } else {
|
37691 | gridData = scale.ticks(10);
|
37692 |
|
37693 | if (gridData.length > tickNum) {
|
37694 | // use only int
|
37695 | gridData = gridData.filter(function (d) {
|
37696 | return (d + "").indexOf(".") < 0;
|
37697 | });
|
37698 | }
|
37699 | }
|
37700 |
|
37701 | return gridData;
|
37702 | },
|
37703 | getGridFilterToRemove: function getGridFilterToRemove(params) {
|
37704 | return params ? function (line) {
|
37705 | var found = !1;
|
37706 | (isArray(params) ? params.concat() : [params]).forEach(function (param) {
|
37707 | if ("value" in param && line.value === param.value || "class" in param && line.class === param.class) {
|
37708 | found = !0;
|
37709 | }
|
37710 | });
|
37711 | return found;
|
37712 | } : function () {
|
37713 | return !0;
|
37714 | };
|
37715 | },
|
37716 | removeGridLines: function removeGridLines(params, forX) {
|
37717 | var $$ = this,
|
37718 | config = $$.config,
|
37719 | $T = $$.$T,
|
37720 | toRemove = $$.getGridFilterToRemove(params),
|
37721 | classLines = forX ? config_classes.xgridLines : config_classes.ygridLines,
|
37722 | classLine = forX ? config_classes.xgridLine : config_classes.ygridLine;
|
37723 | $T($$.$el.main.select("." + classLines).selectAll("." + classLine).filter(toRemove)).style("opacity", "0").remove();
|
37724 | var gridLines = "grid_" + (forX ? "x" : "y") + "_lines";
|
37725 | config[gridLines] = config[gridLines].filter(function toShow(line) {
|
37726 | return !toRemove(line);
|
37727 | });
|
37728 | }
|
37729 | });
|
37730 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/region.ts
|
37731 | /**
|
37732 | * Copyright (c) 2017 ~ present NAVER Corp.
|
37733 | * billboard.js project is licensed under the MIT license
|
37734 | */
|
37735 | // selection
|
37736 |
|
37737 |
|
37738 |
|
37739 | /* harmony default export */ var region = ({
|
37740 | initRegion: function initRegion() {
|
37741 | var $$ = this,
|
37742 | $el = $$.$el;
|
37743 | $el.region.main = $el.main.insert("g", ":first-child").attr("clip-path", $$.state.clip.path).attr("class", config_classes.regions);
|
37744 | },
|
37745 | updateRegion: function updateRegion() {
|
37746 | var $$ = this,
|
37747 | config = $$.config,
|
37748 | region = $$.$el.region,
|
37749 | $T = $$.$T;
|
37750 |
|
37751 | if (!region.main) {
|
37752 | $$.initRegion();
|
37753 | } // hide if arc type
|
37754 |
|
37755 |
|
37756 | region.main.style("visibility", $$.hasArcType() ? "hidden" : null); // select <g> element
|
37757 |
|
37758 | var list = region.main.selectAll("." + config_classes.region).data(config.regions);
|
37759 | $T(list.exit()).style("opacity", "0").remove();
|
37760 | list = list.enter().append("g").merge(list).attr("class", $$.classRegion.bind($$));
|
37761 | list.append("rect").style("fill-opacity", "0");
|
37762 | region.list = list;
|
37763 | },
|
37764 | redrawRegion: function redrawRegion(withTransition) {
|
37765 | var $$ = this,
|
37766 | region = $$.$el.region,
|
37767 | $T = $$.$T,
|
37768 | regions = region.list.select("rect");
|
37769 | regions = $T(regions, withTransition).attr("x", $$.regionX.bind($$)).attr("y", $$.regionY.bind($$)).attr("width", $$.regionWidth.bind($$)).attr("height", $$.regionHeight.bind($$));
|
37770 | return [regions.style("fill-opacity", function (d) {
|
37771 | return isValue(d.opacity) ? d.opacity : null;
|
37772 | }).on("end", function () {
|
37773 | // remove unnecessary rect after transition
|
37774 | src_select(this.parentNode).selectAll("rect:not([x])").remove();
|
37775 | })];
|
37776 | },
|
37777 | getRegionXY: function getRegionXY(type, d) {
|
37778 | var $$ = this,
|
37779 | config = $$.config,
|
37780 | scale = $$.scale,
|
37781 | isRotated = config.axis_rotated,
|
37782 | isX = type === "x",
|
37783 | key = "start",
|
37784 | currScale,
|
37785 | pos = 0;
|
37786 |
|
37787 | if (d.axis === "y" || d.axis === "y2") {
|
37788 | if (!isX) {
|
37789 | key = "end";
|
37790 | }
|
37791 |
|
37792 | if ((isX ? isRotated : !isRotated) && key in d) {
|
37793 | currScale = scale[d.axis];
|
37794 | pos = currScale(d[key]);
|
37795 | }
|
37796 | } else if ((isX ? !isRotated : isRotated) && key in d) {
|
37797 | currScale = scale.zoom || scale.x;
|
37798 | pos = currScale($$.axis.isTimeSeries() ? parseDate.call($$, d[key]) : d[key]);
|
37799 | }
|
37800 |
|
37801 | return pos;
|
37802 | },
|
37803 | regionX: function regionX(d) {
|
37804 | return this.getRegionXY("x", d);
|
37805 | },
|
37806 | regionY: function regionY(d) {
|
37807 | return this.getRegionXY("y", d);
|
37808 | },
|
37809 | getRegionSize: function getRegionSize(type, d) {
|
37810 | var $$ = this,
|
37811 | config = $$.config,
|
37812 | scale = $$.scale,
|
37813 | state = $$.state,
|
37814 | isRotated = config.axis_rotated,
|
37815 | isWidth = type === "width",
|
37816 | start = $$[isWidth ? "regionX" : "regionY"](d),
|
37817 | currScale,
|
37818 | key = "end",
|
37819 | end = state[type];
|
37820 |
|
37821 | if (d.axis === "y" || d.axis === "y2") {
|
37822 | if (!isWidth) {
|
37823 | key = "start";
|
37824 | }
|
37825 |
|
37826 | if ((isWidth ? isRotated : !isRotated) && key in d) {
|
37827 | currScale = scale[d.axis];
|
37828 | end = currScale(d[key]);
|
37829 | }
|
37830 | } else if ((isWidth ? !isRotated : isRotated) && key in d) {
|
37831 | currScale = scale.zoom || scale.x;
|
37832 | end = currScale($$.axis.isTimeSeries() ? parseDate.call($$, d[key]) : d[key]);
|
37833 | }
|
37834 |
|
37835 | return end < start ? 0 : end - start;
|
37836 | },
|
37837 | regionWidth: function regionWidth(d) {
|
37838 | return this.getRegionSize("width", d);
|
37839 | },
|
37840 | regionHeight: function regionHeight(d) {
|
37841 | return this.getRegionSize("height", d);
|
37842 | },
|
37843 | isRegionOnX: function isRegionOnX(d) {
|
37844 | return !d.axis || d.axis === "x";
|
37845 | }
|
37846 | });
|
37847 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/size.axis.ts
|
37848 | /**
|
37849 | * Copyright (c) 2017 ~ present NAVER Corp.
|
37850 | * billboard.js project is licensed under the MIT license
|
37851 | */
|
37852 | /* harmony default export */ var size_axis = ({
|
37853 | /**
|
37854 | * Get Axis size according its position
|
37855 | * @param {string} id Axis id value - x, y or y2
|
37856 | * @returns {number} size Axis size value
|
37857 | * @private
|
37858 | */
|
37859 | getAxisSize: function getAxisSize(id) {
|
37860 | var $$ = this,
|
37861 | isRotated = $$.config.axis_rotated;
|
37862 | return isRotated && id === "x" || !isRotated && /y2?/.test(id) ? $$.getAxisWidthByAxisId(id, !0) : $$.getHorizontalAxisHeight(id);
|
37863 | },
|
37864 | getAxisWidthByAxisId: function getAxisWidthByAxisId(id, withoutRecompute) {
|
37865 | var $$ = this;
|
37866 |
|
37867 | if ($$.axis) {
|
37868 | var _$$$axis,
|
37869 | position = (_$$$axis = $$.axis) == null ? void 0 : _$$$axis.getLabelPositionById(id);
|
37870 |
|
37871 | return $$.axis.getMaxTickWidth(id, withoutRecompute) + (position.isInner ? 20 : 40);
|
37872 | } else {
|
37873 | return 40;
|
37874 | }
|
37875 | },
|
37876 | getHorizontalAxisHeight: function getHorizontalAxisHeight(id) {
|
37877 | var $$ = this,
|
37878 | config = $$.config,
|
37879 | state = $$.state,
|
37880 | _state = state,
|
37881 | current = _state.current,
|
37882 | rotatedPadding = _state.rotatedPadding,
|
37883 | isLegendRight = _state.isLegendRight,
|
37884 | isLegendInset = _state.isLegendInset,
|
37885 | isRotated = config.axis_rotated,
|
37886 | h = 30;
|
37887 |
|
37888 | if (id === "x" && !config.axis_x_show) {
|
37889 | return 8;
|
37890 | }
|
37891 |
|
37892 | if (id === "x" && config.axis_x_height) {
|
37893 | return config.axis_x_height;
|
37894 | }
|
37895 |
|
37896 | if (id === "y" && !config.axis_y_show) {
|
37897 | return config.legend_show && !isLegendRight && !isLegendInset ? 10 : 1;
|
37898 | }
|
37899 |
|
37900 | if (id === "y2" && !config.axis_y2_show) {
|
37901 | return rotatedPadding.top;
|
37902 | }
|
37903 |
|
37904 | var rotate = $$.getAxisTickRotate(id); // Calculate x/y axis height when tick rotated
|
37905 |
|
37906 | if ((id === "x" && !isRotated || /y2?/.test(id) && isRotated) && rotate) {
|
37907 | h = 30 + $$.axis.getMaxTickWidth(id) * Math.cos(Math.PI * (90 - Math.abs(rotate)) / 180);
|
37908 |
|
37909 | if (!config.axis_x_tick_multiline && current.height) {
|
37910 | if (h > current.height / 2) {
|
37911 | h = current.height / 2;
|
37912 | }
|
37913 | }
|
37914 | }
|
37915 |
|
37916 | return h + ($$.axis.getLabelPositionById(id).isInner ? 0 : 10) + (id === "y2" && !isRotated ? -10 : 0);
|
37917 | },
|
37918 | getEventRectWidth: function getEventRectWidth() {
|
37919 | return Math.max(0, this.axis.x.tickInterval());
|
37920 | },
|
37921 |
|
37922 | /**
|
37923 | * Get axis tick test rotate value
|
37924 | * @param {string} id Axis id
|
37925 | * @returns {number} rotate value
|
37926 | * @private
|
37927 | */
|
37928 | getAxisTickRotate: function getAxisTickRotate(id) {
|
37929 | var $$ = this,
|
37930 | axis = $$.axis,
|
37931 | config = $$.config,
|
37932 | state = $$.state,
|
37933 | $el = $$.$el,
|
37934 | rotate = config["axis_" + id + "_tick_rotate"];
|
37935 |
|
37936 | if (id === "x") {
|
37937 | var allowedXAxisTypes = axis.isCategorized() || axis.isTimeSeries();
|
37938 |
|
37939 | if (config.axis_x_tick_fit && allowedXAxisTypes) {
|
37940 | var xTickCount = config.axis_x_tick_count,
|
37941 | currentXTicksLength = state.current.maxTickWidths.x.ticks.length,
|
37942 | tickCount = 0;
|
37943 |
|
37944 | if (xTickCount) {
|
37945 | tickCount = xTickCount > currentXTicksLength ? currentXTicksLength : xTickCount;
|
37946 | } else if (currentXTicksLength) {
|
37947 | tickCount = currentXTicksLength;
|
37948 | }
|
37949 |
|
37950 | if (tickCount !== state.axis.x.tickCount) {
|
37951 | var targets = $$.data.targets;
|
37952 | state.axis.x.padding = $$.getXDomainPadding([$$.getXDomainMinMax(targets, "min"), $$.getXDomainMinMax(targets, "max")], tickCount);
|
37953 | }
|
37954 |
|
37955 | state.axis.x.tickCount = tickCount;
|
37956 | }
|
37957 |
|
37958 | if ($el.svg && config.axis_x_tick_fit && !config.axis_x_tick_multiline && !config.axis_x_tick_culling && config.axis_x_tick_autorotate && allowedXAxisTypes) {
|
37959 | rotate = $$.needToRotateXAxisTickTexts() ? config.axis_x_tick_rotate : 0;
|
37960 | }
|
37961 | }
|
37962 |
|
37963 | return rotate;
|
37964 | },
|
37965 |
|
37966 | /**
|
37967 | * Check weather axis tick text needs to be rotated
|
37968 | * @returns {boolean}
|
37969 | * @private
|
37970 | */
|
37971 | needToRotateXAxisTickTexts: function needToRotateXAxisTickTexts() {
|
37972 | var $$ = this,
|
37973 | _$$$state = $$.state,
|
37974 | axis = _$$$state.axis,
|
37975 | current = _$$$state.current,
|
37976 | xAxisLength = current.width - $$.getCurrentPaddingLeft(!1) - $$.getCurrentPaddingRight(),
|
37977 | tickCountWithPadding = axis.x.tickCount + axis.x.padding.left + axis.x.padding.right,
|
37978 | maxTickWidth = $$.axis.getMaxTickWidth("x"),
|
37979 | tickLength = tickCountWithPadding ? xAxisLength / tickCountWithPadding : 0;
|
37980 | return maxTickWidth > tickLength;
|
37981 | }
|
37982 | });
|
37983 | ;// CONCATENATED MODULE: ./src/config/Options/data/axis.ts
|
37984 | /**
|
37985 | * Copyright (c) 2017 ~ present NAVER Corp.
|
37986 | * billboard.js project is licensed under the MIT license
|
37987 | */
|
37988 |
|
37989 | /**
|
37990 | * Axis based chart data config options
|
37991 | */
|
37992 | /* harmony default export */ var data_axis = ({
|
37993 | /**
|
37994 | * Specify the keys of the x values for each data.<br><br>
|
37995 | * This option can be used if we want to show the data that has different x values.
|
37996 | * @name data․xs
|
37997 | * @memberof Options
|
37998 | * @type {object}
|
37999 | * @default {}
|
38000 | * @example
|
38001 | * data: {
|
38002 | * xs: {
|
38003 | * data1: "x1",
|
38004 | * data2: "x2"
|
38005 | * }
|
38006 | * }
|
38007 | */
|
38008 | data_xs: {},
|
38009 |
|
38010 | /**
|
38011 | * Set a format specifier to parse string specifed as x.
|
38012 | * @name data․xFormat
|
38013 | * @memberof Options
|
38014 | * @type {string}
|
38015 | * @default %Y-%m-%d
|
38016 | * @example
|
38017 | * data: {
|
38018 | * x: "x",
|
38019 | * columns: [
|
38020 | * ["x", "01012019", "02012019", "03012019"],
|
38021 | * ["data1", 30, 200, 100]
|
38022 | * ],
|
38023 | * // Format specifier to parse as datetime for given 'x' string value
|
38024 | * xFormat: "%m%d%Y"
|
38025 | * },
|
38026 | * axis: {
|
38027 | * x: {
|
38028 | * type: "timeseries"
|
38029 | * }
|
38030 | * }
|
38031 | * @see [D3's time specifier](https://github.com/d3/d3-time-format#locale_format)
|
38032 | */
|
38033 | data_xFormat: "%Y-%m-%d",
|
38034 |
|
38035 | /**
|
38036 | * Set localtime format to parse x axis.
|
38037 | * @name data․xLocaltime
|
38038 | * @memberof Options
|
38039 | * @type {boolean}
|
38040 | * @default true
|
38041 | * @example
|
38042 | * data: {
|
38043 | * xLocaltime: false
|
38044 | * }
|
38045 | */
|
38046 | data_xLocaltime: !0,
|
38047 |
|
38048 | /**
|
38049 | * Sort on x axis.
|
38050 | * @name data․xSort
|
38051 | * @memberof Options
|
38052 | * @type {boolean}
|
38053 | * @default true
|
38054 | * @example
|
38055 | * data: {
|
38056 | * xSort: false
|
38057 | * }
|
38058 | */
|
38059 | data_xSort: !0,
|
38060 |
|
38061 | /**
|
38062 | * Set y axis the data related to. y and y2 can be used.
|
38063 | * - **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
|
38064 | * @name data․axes
|
38065 | * @memberof Options
|
38066 | * @type {object}
|
38067 | * @default {}
|
38068 | * @example
|
38069 | * data: {
|
38070 | * axes: {
|
38071 | * data1: "y",
|
38072 | * data2: "y2"
|
38073 | * }
|
38074 | * }
|
38075 | */
|
38076 | data_axes: {},
|
38077 |
|
38078 | /**
|
38079 | * Define regions for each data.<br>
|
38080 | * The values must be an array for each data and it should include an object that has `start`, `end` and `style`.
|
38081 | * - The object type should be as:
|
38082 | * - start {number}: Start data point number. If not set, the start will be the first data point.
|
38083 | * - [end] {number}: End data point number. If not set, the end will be the last data point.
|
38084 | * - [style.dasharray="2 2"] {object}: The first number specifies a distance for the filled area, and the second a distance for the unfilled area.
|
38085 | * - **NOTE:** Currently this option supports only line chart and dashed style. If this option specified, the line will be dashed only in the regions.
|
38086 | * @name data․regions
|
38087 | * @memberof Options
|
38088 | * @type {object}
|
38089 | * @default {}
|
38090 | * @example
|
38091 | * data: {
|
38092 | * regions: {
|
38093 | * data1: [{
|
38094 | * start: 1,
|
38095 | * end: 2,
|
38096 | * style: {
|
38097 | * dasharray: "5 2"
|
38098 | * }
|
38099 | * }, {
|
38100 | * start: 3
|
38101 | * }],
|
38102 | * ...
|
38103 | * }
|
38104 | * }
|
38105 | */
|
38106 | data_regions: {},
|
38107 |
|
38108 | /**
|
38109 | * Set the stacking to be normalized
|
38110 | * - **NOTE:**
|
38111 | * - For stacking, '[data.groups](#.data%25E2%2580%25A4groups)' option should be set
|
38112 | * - y Axis will be set in percentage value (0 ~ 100%)
|
38113 | * - Must have postive values
|
38114 | * @name data․stack․normalize
|
38115 | * @memberof Options
|
38116 | * @type {boolean}
|
38117 | * @default false
|
38118 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Data.DataStackNormalized)
|
38119 | * @example
|
38120 | * data: {
|
38121 | * stack: {
|
38122 | * normalize: true
|
38123 | * }
|
38124 | * }
|
38125 | */
|
38126 | data_stack_normalize: !1
|
38127 | });
|
38128 | ;// CONCATENATED MODULE: ./src/config/Options/axis/x.ts
|
38129 | /**
|
38130 | * Copyright (c) 2017 ~ present NAVER Corp.
|
38131 | * billboard.js project is licensed under the MIT license
|
38132 | */
|
38133 |
|
38134 | /**
|
38135 | * x Axis config options
|
38136 | */
|
38137 | /* harmony default export */ var axis_x = ({
|
38138 | /**
|
38139 | * Set clip-path attribute for x axis element
|
38140 | * @name axis․x․clipPath
|
38141 | * @memberof Options
|
38142 | * @type {boolean}
|
38143 | * @default true
|
38144 | * @see [Demo]()
|
38145 | * @example
|
38146 | * // don't set 'clip-path' attribute
|
38147 | * clipPath: false
|
38148 | */
|
38149 | axis_x_clipPath: !0,
|
38150 |
|
38151 | /**
|
38152 | * Show or hide x axis.
|
38153 | * @name axis․x․show
|
38154 | * @memberof Options
|
38155 | * @type {boolean}
|
38156 | * @default true
|
38157 | * @example
|
38158 | * axis: {
|
38159 | * x: {
|
38160 | * show: false
|
38161 | * }
|
38162 | * }
|
38163 | */
|
38164 | axis_x_show: !0,
|
38165 |
|
38166 | /**
|
38167 | * Set type of x axis.<br><br>
|
38168 | * **Available Values:**
|
38169 | * - category
|
38170 | * - indexed
|
38171 | * - log
|
38172 | * - timeseries
|
38173 | *
|
38174 | * **NOTE:**<br>
|
38175 | * - **log** type:
|
38176 | * - the x values specified by [`data.x`](#.data%25E2%2580%25A4x)(or by any equivalent option), must be exclusively-positive.
|
38177 | * - x axis min value should be >= 0.
|
38178 | *
|
38179 | * @name axis․x․type
|
38180 | * @memberof Options
|
38181 | * @type {string}
|
38182 | * @default indexed
|
38183 | * @see [Demo: indexed](https://naver.github.io/billboard.js/demo/#Chart.AreaChart)
|
38184 | * @see [Demo: timeseries](https://naver.github.io/billboard.js/demo/#Chart.TimeseriesChart)
|
38185 | * @see [Demo: category](https://naver.github.io/billboard.js/demo/#Data.CategoryData)
|
38186 | * @see [Demo: log](https://naver.github.io/billboard.js/demo/#Axis.LogScales)
|
38187 | * @example
|
38188 | * axis: {
|
38189 | * x: {
|
38190 | * type: "timeseries"
|
38191 | * }
|
38192 | * }
|
38193 | */
|
38194 | axis_x_type: "indexed",
|
38195 |
|
38196 | /**
|
38197 | * Set how to treat the timezone of x values.<br>
|
38198 | * If true, treat x value as localtime. If false, convert to UTC internally.
|
38199 | * @name axis․x․localtime
|
38200 | * @memberof Options
|
38201 | * @type {boolean}
|
38202 | * @default true
|
38203 | * @example
|
38204 | * axis: {
|
38205 | * x: {
|
38206 | * localtime: false
|
38207 | * }
|
38208 | * }
|
38209 | */
|
38210 | axis_x_localtime: !0,
|
38211 |
|
38212 | /**
|
38213 | * Set category names on category axis.
|
38214 | * 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.
|
38215 | * @name axis․x․categories
|
38216 | * @memberof Options
|
38217 | * @type {Array}
|
38218 | * @default []
|
38219 | * @example
|
38220 | * axis: {
|
38221 | * x: {
|
38222 | * categories: ["Category 1", "Category 2", ...]
|
38223 | * }
|
38224 | * }
|
38225 | */
|
38226 | axis_x_categories: [],
|
38227 |
|
38228 | /**
|
38229 | * centerize ticks on category axis.
|
38230 | * @name axis․x․tick․centered
|
38231 | * @memberof Options
|
38232 | * @type {boolean}
|
38233 | * @default false
|
38234 | * @example
|
38235 | * axis: {
|
38236 | * x: {
|
38237 | * tick: {
|
38238 | * centered: true
|
38239 | * }
|
38240 | * }
|
38241 | * }
|
38242 | */
|
38243 | axis_x_tick_centered: !1,
|
38244 |
|
38245 | /**
|
38246 | * A function to format tick value. Format string is also available for timeseries data.
|
38247 | * @name axis․x․tick․format
|
38248 | * @memberof Options
|
38249 | * @type {Function|string}
|
38250 | * @default undefined
|
38251 | * @see [D3's time specifier](https://github.com/d3/d3-time-format#locale_format)
|
38252 | * @example
|
38253 | * axis: {
|
38254 | * x: {
|
38255 | * tick: {
|
38256 | * // for timeseries, a 'datetime' object is given as parameter
|
38257 | * format: function(x) {
|
38258 | * return x.getFullYear();
|
38259 | * }
|
38260 | *
|
38261 | * // for category, index(Number) and categoryName(String) are given as parameter
|
38262 | * format: function(index, categoryName) {
|
38263 | * return categoryName.substr(0, 10);
|
38264 | * },
|
38265 | *
|
38266 | * // for timeseries format specifier
|
38267 | * format: "%Y-%m-%d %H:%M:%S"
|
38268 | * }
|
38269 | * }
|
38270 | * }
|
38271 | */
|
38272 | axis_x_tick_format: undefined,
|
38273 |
|
38274 | /**
|
38275 | * Setting for culling ticks.<br><br>
|
38276 | * 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>
|
38277 | * We can change the number of ticks to be shown by axis.x.tick.culling.max.
|
38278 | * @name axis․x․tick․culling
|
38279 | * @memberof Options
|
38280 | * @type {boolean}
|
38281 | * @default
|
38282 | * - true for indexed axis and timeseries axis
|
38283 | * - false for category axis
|
38284 | * @example
|
38285 | * axis: {
|
38286 | * x: {
|
38287 | * tick: {
|
38288 | * culling: false
|
38289 | * }
|
38290 | * }
|
38291 | * }
|
38292 | */
|
38293 | axis_x_tick_culling: {},
|
38294 |
|
38295 | /**
|
38296 | * The number of tick texts will be adjusted to less than this value.
|
38297 | * @name axis․x․tick․culling․max
|
38298 | * @memberof Options
|
38299 | * @type {number}
|
38300 | * @default 10
|
38301 | * @example
|
38302 | * axis: {
|
38303 | * x: {
|
38304 | * tick: {
|
38305 | * culling: {
|
38306 | * max: 5
|
38307 | * }
|
38308 | * }
|
38309 | * }
|
38310 | * }
|
38311 | */
|
38312 | axis_x_tick_culling_max: 10,
|
38313 |
|
38314 | /**
|
38315 | * The number of x axis ticks to show.<br><br>
|
38316 | * 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).
|
38317 | * @name axis․x․tick․count
|
38318 | * @memberof Options
|
38319 | * @type {number}
|
38320 | * @default undefined
|
38321 | * @example
|
38322 | * axis: {
|
38323 | * x: {
|
38324 | * tick: {
|
38325 | * count: 5
|
38326 | * }
|
38327 | * }
|
38328 | * }
|
38329 | */
|
38330 | axis_x_tick_count: undefined,
|
38331 |
|
38332 | /**
|
38333 | * Show or hide x axis tick line.
|
38334 | * @name axis․x․tick․show
|
38335 | * @memberof Options
|
38336 | * @type {boolean}
|
38337 | * @default true
|
38338 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.HideTickLineText)
|
38339 | * @example
|
38340 | * axis: {
|
38341 | * x: {
|
38342 | * tick: {
|
38343 | * show: false
|
38344 | * }
|
38345 | * }
|
38346 | * }
|
38347 | */
|
38348 | axis_x_tick_show: !0,
|
38349 |
|
38350 | /**
|
38351 | * Show or hide x axis tick text.
|
38352 | * @name axis․x․tick․text․show
|
38353 | * @memberof Options
|
38354 | * @type {boolean}
|
38355 | * @default true
|
38356 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.HideTickLineText)
|
38357 | * @example
|
38358 | * axis: {
|
38359 | * x: {
|
38360 | * tick: {
|
38361 | * text: {
|
38362 | * show: false
|
38363 | * }
|
38364 | * }
|
38365 | * }
|
38366 | * }
|
38367 | */
|
38368 | axis_x_tick_text_show: !0,
|
38369 |
|
38370 | /**
|
38371 | * Set the x Axis tick text's position relatively its original position
|
38372 | * @name axis․x․tick․text․position
|
38373 | * @memberof Options
|
38374 | * @type {object}
|
38375 | * @default {x: 0, y:0}
|
38376 | * @example
|
38377 | * axis: {
|
38378 | * x: {
|
38379 | * tick: {
|
38380 | * text: {
|
38381 | * position: {
|
38382 | * x: 10,
|
38383 | * y: 10
|
38384 | * }
|
38385 | * }
|
38386 | * }
|
38387 | * }
|
38388 | * }
|
38389 | */
|
38390 | axis_x_tick_text_position: {
|
38391 | x: 0,
|
38392 | y: 0
|
38393 | },
|
38394 |
|
38395 | /**
|
38396 | * Fit x axis ticks.
|
38397 | * - **true**: ticks will be positioned nicely to have same intervals.
|
38398 | * - **false**: ticks will be positioned according to x value of the data points.
|
38399 | * @name axis․x․tick․fit
|
38400 | * @memberof Options
|
38401 | * @type {boolean}
|
38402 | * @default true
|
38403 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.XAxisTickFitting)
|
38404 | * @see [Demo: for timeseries zoom](https://naver.github.io/billboard.js/demo/#Axis.XAxisTickTimeseries)
|
38405 | * @example
|
38406 | * axis: {
|
38407 | * x: {
|
38408 | * tick: {
|
38409 | * fit: false
|
38410 | * }
|
38411 | * }
|
38412 | * }
|
38413 | */
|
38414 | axis_x_tick_fit: !0,
|
38415 |
|
38416 | /**
|
38417 | * Set the x values of ticks manually.<br><br>
|
38418 | * If this option is provided, the position of the ticks will be determined based on those values.<br>
|
38419 | * This option works with `timeseries` data and the x values will be parsed accoding to the type of the value and data.xFormat option.
|
38420 | * @name axis․x․tick․values
|
38421 | * @memberof Options
|
38422 | * @type {Array|Function}
|
38423 | * @default null
|
38424 | * @example
|
38425 | * axis: {
|
38426 | * x: {
|
38427 | * tick: {
|
38428 | * values: [1, 2, 4, 8, 16, 32, ...],
|
38429 | *
|
38430 | * // an Array value should be returned
|
38431 | * values: function() {
|
38432 | * return [ ... ];
|
38433 | * }
|
38434 | * }
|
38435 | * }
|
38436 | * }
|
38437 | */
|
38438 | axis_x_tick_values: null,
|
38439 |
|
38440 | /**
|
38441 | * Rotate x axis tick text if there is not enough space for 'category' and 'timeseries' type axis.
|
38442 | * - **NOTE:** The conditions where `autorotate` is enabled are:
|
38443 | * - axis.x.type='category' or 'timeseries
|
38444 | * - axis.x.tick.multiline=false
|
38445 | * - axis.x.tick.culling=false
|
38446 | * - axis.x.tick.fit=true
|
38447 | * - **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
|
38448 | * @name axis․x․tick․autorotate
|
38449 | * @memberof Options
|
38450 | * @type {boolean}
|
38451 | * @default false
|
38452 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.XAxisTickAutorotate)
|
38453 | * @example
|
38454 | * axis: {
|
38455 | * x: {
|
38456 | * tick: {
|
38457 | * rotate: 15,
|
38458 | * autorotate: true,
|
38459 | * multiline: false,
|
38460 | * culling: false,
|
38461 | * fit: true
|
38462 | * },
|
38463 | * clipPath: false
|
38464 | * }
|
38465 | * }
|
38466 | */
|
38467 | axis_x_tick_autorotate: !1,
|
38468 |
|
38469 | /**
|
38470 | * Rotate x axis tick text.
|
38471 | * - If you set negative value, it will rotate to opposite direction.
|
38472 | * - Applied when [`axis.rotated`](#.axis%25E2%2580%25A4rotated) option is `false`.
|
38473 | * - 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.
|
38474 | * @name axis․x․tick․rotate
|
38475 | * @memberof Options
|
38476 | * @type {number}
|
38477 | * @default 0
|
38478 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.RotateXAxisTickText)
|
38479 | * @example
|
38480 | * axis: {
|
38481 | * x: {
|
38482 | * tick: {
|
38483 | * rotate: 60
|
38484 | * }
|
38485 | * }
|
38486 | * }
|
38487 | */
|
38488 | axis_x_tick_rotate: 0,
|
38489 |
|
38490 | /**
|
38491 | * Show x axis outer tick.
|
38492 | * @name axis․x․tick․outer
|
38493 | * @memberof Options
|
38494 | * @type {boolean}
|
38495 | * @default true
|
38496 | * @example
|
38497 | * axis: {
|
38498 | * x: {
|
38499 | * tick: {
|
38500 | * outer: false
|
38501 | * }
|
38502 | * }
|
38503 | * }
|
38504 | */
|
38505 | axis_x_tick_outer: !0,
|
38506 |
|
38507 | /**
|
38508 | * Set tick text to be multiline
|
38509 | * - **NOTE:**
|
38510 | * > When x tick text contains `\n`, it's used as line break and 'axis.x.tick.width' option is ignored.
|
38511 | * @name axis․x․tick․multiline
|
38512 | * @memberof Options
|
38513 | * @type {boolean}
|
38514 | * @default true
|
38515 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.XAxisTickMultiline)
|
38516 | * @example
|
38517 | * axis: {
|
38518 | * x: {
|
38519 | * tick: {
|
38520 | * multiline: false
|
38521 | * }
|
38522 | * }
|
38523 | * }
|
38524 | * @example
|
38525 | * // example of line break with '\n'
|
38526 | * // In this case, 'axis.x.tick.width' is ignored
|
38527 | * data: {
|
38528 | * x: "x",
|
38529 | * columns: [
|
38530 | * ["x", "long\ntext", "Another\nLong\nText"],
|
38531 | * ...
|
38532 | * ],
|
38533 | * }
|
38534 | */
|
38535 | axis_x_tick_multiline: !0,
|
38536 |
|
38537 | /**
|
38538 | * Set tick width
|
38539 | * - **NOTE:**
|
38540 | * > When x tick text contains `\n`, this option is ignored.
|
38541 | * @name axis․x․tick․width
|
38542 | * @memberof Options
|
38543 | * @type {number}
|
38544 | * @default null
|
38545 | * @example
|
38546 | * axis: {
|
38547 | * x: {
|
38548 | * tick: {
|
38549 | * width: 50
|
38550 | * }
|
38551 | * }
|
38552 | * }
|
38553 | */
|
38554 | axis_x_tick_width: null,
|
38555 |
|
38556 | /**
|
38557 | * Set to display system tooltip(via 'title' attribute) for tick text
|
38558 | * - **NOTE:** Only available for category axis type (`axis.x.type='category'`)
|
38559 | * @name axis․x․tick․tooltip
|
38560 | * @memberof Options
|
38561 | * @type {boolean}
|
38562 | * @default false
|
38563 | * @example
|
38564 | * axis: {
|
38565 | * x: {
|
38566 | * tick: {
|
38567 | * tooltip: true
|
38568 | * }
|
38569 | * }
|
38570 | * }
|
38571 | */
|
38572 | axis_x_tick_tooltip: !1,
|
38573 |
|
38574 | /**
|
38575 | * Set max value of x axis range.
|
38576 | * @name axis․x․max
|
38577 | * @memberof Options
|
38578 | * @property {number} max Set the max value
|
38579 | * @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.
|
38580 | * - **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`.
|
38581 | * @property {number} [max.value] Set the max value
|
38582 | * @example
|
38583 | * axis: {
|
38584 | * x: {
|
38585 | * max: 100,
|
38586 | *
|
38587 | * max: {
|
38588 | * // 'fit=true' will make x axis max to be limited as the bound data value max when 'max.value' is greater.
|
38589 | * // - when bound data max is '10' and max.value: '100' ==> x axis max will be '10'
|
38590 | * // - when bound data max is '1000' and max.value: '100' ==> x axis max will be '100'
|
38591 | * fit: true,
|
38592 | * value: 100
|
38593 | * }
|
38594 | * }
|
38595 | * }
|
38596 | */
|
38597 | axis_x_max: undefined,
|
38598 |
|
38599 | /**
|
38600 | * Set min value of x axis range.
|
38601 | * @name axis․x․min
|
38602 | * @memberof Options
|
38603 | * @property {number} min Set the min value
|
38604 | * @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.
|
38605 | * - **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`.
|
38606 | * @property {number} [min.value] Set the min value
|
38607 | * @example
|
38608 | * axis: {
|
38609 | * x: {
|
38610 | * min: -100,
|
38611 | *
|
38612 | * min: {
|
38613 | * // 'fit=true' will make x axis min to be limited as the bound data value min when 'min.value' is lower.
|
38614 | * // - when bound data min is '-10' and min.value: '-100' ==> x axis min will be '-10'
|
38615 | * // - when bound data min is '-1000' and min.value: '-100' ==> x axis min will be '-100'
|
38616 | * fit: true,
|
38617 | * value: -100
|
38618 | * }
|
38619 | * }
|
38620 | * }
|
38621 | */
|
38622 | axis_x_min: undefined,
|
38623 |
|
38624 | /**
|
38625 | * Set padding for x axis.<br><br>
|
38626 | * If this option is set, the range of x axis will increase/decrease according to the values.
|
38627 | * If no padding is needed in the rage of x axis, 0 should be set.
|
38628 | * By default, left/right padding are set depending on x axis type or chart types.
|
38629 | * - **NOTE:**
|
38630 | * - The meaning of padding values, differs according axis types:<br>
|
38631 | * - **category/indexed:** The unit of tick value
|
38632 | * ex. the given value `1`, is same as the width of 1 tick width
|
38633 | * - **timeseries:** Numeric time value
|
38634 | * 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
|
38635 | * - If want values to be treated as pixels, specify `unit:"px"`.
|
38636 | * - The pixel value will be convered based on the scale values. Hence can not reflect accurate padding result.
|
38637 | * @name axis․x․padding
|
38638 | * @memberof Options
|
38639 | * @type {object|number}
|
38640 | * @default {}
|
38641 | * @example
|
38642 | * axis: {
|
38643 | * x: {
|
38644 | * padding: {
|
38645 | * // when axis type is 'category'
|
38646 | * left: 1, // set left padding width of equivalent value of a tick's width
|
38647 | * right: 0.5 // set right padding width as half of equivalent value of tick's width
|
38648 | *
|
38649 | * // when axis type is 'timeseries'
|
38650 | * left: 1000*60*60*24, // set left padding width of equivalent value of a day tick's width
|
38651 | * right: 1000*60*60*12 // set right padding width as half of equivalent value of a day tick's width
|
38652 | * },
|
38653 | *
|
38654 | * // or set both values at once.
|
38655 | * padding: 10,
|
38656 | *
|
38657 | * // or set padding values as pixel unit.
|
38658 | * padding: {
|
38659 | * left: 100,
|
38660 | * right: 50,
|
38661 | * unit: "px"
|
38662 | * },
|
38663 | * }
|
38664 | * }
|
38665 | */
|
38666 | axis_x_padding: {},
|
38667 |
|
38668 | /**
|
38669 | * Set height of x axis.<br><br>
|
38670 | * 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.
|
38671 | * @name axis․x․height
|
38672 | * @memberof Options
|
38673 | * @type {number}
|
38674 | * @default undefined
|
38675 | * @example
|
38676 | * axis: {
|
38677 | * x: {
|
38678 | * height: 20
|
38679 | * }
|
38680 | * }
|
38681 | */
|
38682 | axis_x_height: undefined,
|
38683 |
|
38684 | /**
|
38685 | * Set default extent for subchart and zoom. This can be an array or function that returns an array.
|
38686 | * @name axis․x․extent
|
38687 | * @memberof Options
|
38688 | * @type {Array|Function}
|
38689 | * @default undefined
|
38690 | * @example
|
38691 | * axis: {
|
38692 | * x: {
|
38693 | * // extent range as a pixel value
|
38694 | * extent: [0, 200],
|
38695 | *
|
38696 | * // when axis is 'timeseries', parsable datetime string
|
38697 | * extent: ["2019-03-01", "2019-03-05"],
|
38698 | *
|
38699 | * // return extent value
|
38700 | * extent: function(domain, scale) {
|
38701 | * var extent = domain.map(function(v) {
|
38702 | * return scale(v);
|
38703 | * });
|
38704 | *
|
38705 | * // it should return a format of array
|
38706 | * // ex) [0, 584]
|
38707 | * return extent;
|
38708 | * }
|
38709 | * }
|
38710 | * }
|
38711 | */
|
38712 | axis_x_extent: undefined,
|
38713 |
|
38714 | /**
|
38715 | * Set label on x axis.<br><br>
|
38716 | * You can set x axis label and change its position by this option.
|
38717 | * `string` and `object` can be passed and we can change the poisiton by passing object that has position key.<br>
|
38718 | * Available position differs according to the axis direction (vertical or horizontal).
|
38719 | * If string set, the position will be the default.
|
38720 | *
|
38721 | * - **If it's horizontal axis:**
|
38722 | * - inner-right [default]
|
38723 | * - inner-center
|
38724 | * - inner-left
|
38725 | * - outer-right
|
38726 | * - outer-center
|
38727 | * - outer-left
|
38728 | * - **If it's vertical axis:**
|
38729 | * - inner-top [default]
|
38730 | * - inner-middle
|
38731 | * - inner-bottom
|
38732 | * - outer-top
|
38733 | * - outer-middle
|
38734 | * - outer-bottom
|
38735 | * @name axis․x․label
|
38736 | * @memberof Options
|
38737 | * @type {string|object}
|
38738 | * @default undefined
|
38739 | * @example
|
38740 | * axis: {
|
38741 | * x: {
|
38742 | * label: "Your X Axis"
|
38743 | * }
|
38744 | * }
|
38745 | *
|
38746 | * axis: {
|
38747 | * x: {
|
38748 | * label: {
|
38749 | * text: "Your X Axis",
|
38750 | * position: "outer-center"
|
38751 | * }
|
38752 | * }
|
38753 | * }
|
38754 | */
|
38755 | axis_x_label: {},
|
38756 |
|
38757 | /**
|
38758 | * Set additional axes for x Axis.
|
38759 | * - **NOTE:** Axis' scale is based on x Axis value if domain option isn't set.
|
38760 | *
|
38761 | * Each axis object should consist with following options:
|
38762 | *
|
38763 | * | Name | Type | Default | Description |
|
38764 | * | --- | --- | --- | --- |
|
38765 | * | domain | Array | - | Set the domain value |
|
38766 | * | tick.outer | boolean | true | Show outer tick |
|
38767 | * | tick.format | Function | - | Set formatter for tick text |
|
38768 | * | tick.count | Number | - | Set the number of y axis ticks |
|
38769 | * | tick.values | Array | - | Set tick values manually |
|
38770 | * @name axis․x․axes
|
38771 | * @memberof Options
|
38772 | * @type {Array}
|
38773 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.MultiAxes)
|
38774 | * @see [Demo: Domain](https://naver.github.io/billboard.js/demo/#Axis.MultiAxesDomain)
|
38775 | * @example
|
38776 | * x: {
|
38777 | * axes: [
|
38778 | * {
|
38779 | * // if set, will not be correlated with the main x Axis domain value
|
38780 | * domain: [0, 1000],
|
38781 | * tick: {
|
38782 | * outer: false,
|
38783 | * format: function(x) {
|
38784 | * return x + "%";
|
38785 | * },
|
38786 | * count: 2,
|
38787 | * values: [10, 20, 30]
|
38788 | * }
|
38789 | * },
|
38790 | * ...
|
38791 | * ]
|
38792 | * }
|
38793 | */
|
38794 | axis_x_axes: []
|
38795 | });
|
38796 | ;// CONCATENATED MODULE: ./src/config/Options/axis/y.ts
|
38797 | /**
|
38798 | * Copyright (c) 2017 ~ present NAVER Corp.
|
38799 | * billboard.js project is licensed under the MIT license
|
38800 | */
|
38801 |
|
38802 | /**
|
38803 | * y Axis config options
|
38804 | */
|
38805 | /* harmony default export */ var y = ({
|
38806 | /**
|
38807 | * Set clip-path attribute for y axis element
|
38808 | * - **NOTE**: `clip-path` attribute for y Axis is set only when `axis.y.inner` option is true.
|
38809 | * @name axis․y․clipPath
|
38810 | * @memberof Options
|
38811 | * @type {boolean}
|
38812 | * @default true
|
38813 | * @example
|
38814 | * // don't set 'clip-path' attribute
|
38815 | * clipPath: false
|
38816 | */
|
38817 | axis_y_clipPath: !0,
|
38818 |
|
38819 | /**
|
38820 | * Show or hide y axis.
|
38821 | * @name axis․y․show
|
38822 | * @memberof Options
|
38823 | * @type {boolean}
|
38824 | * @default true
|
38825 | * @example
|
38826 | * axis: {
|
38827 | * y: {
|
38828 | * show: false
|
38829 | * }
|
38830 | * }
|
38831 | */
|
38832 | axis_y_show: !0,
|
38833 |
|
38834 | /**
|
38835 | * Set type of y axis.<br><br>
|
38836 | * **Available Values:**
|
38837 | * - indexed
|
38838 | * - log
|
38839 | * - timeseries
|
38840 | *
|
38841 | * **NOTE:**<br>
|
38842 | * - **log** type:
|
38843 | * - the bound data values must be exclusively-positive.
|
38844 | * - y axis min value should be >= 0.
|
38845 | * - [`data.groups`](#.data%25E2%2580%25A4groups)(stacked data) option aren't supported.
|
38846 | *
|
38847 | * @name axis․y․type
|
38848 | * @memberof Options
|
38849 | * @type {string}
|
38850 | * @default "indexed"
|
38851 | * @see [Demo: log](https://naver.github.io/billboard.js/demo/#Axis.LogScales)
|
38852 | * @example
|
38853 | * axis: {
|
38854 | * y: {
|
38855 | * type: "log"
|
38856 | * }
|
38857 | * }
|
38858 | */
|
38859 | axis_y_type: "indexed",
|
38860 |
|
38861 | /**
|
38862 | * Set max value of y axis.
|
38863 | * - **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).
|
38864 | * @name axis․y․max
|
38865 | * @memberof Options
|
38866 | * @type {number}
|
38867 | * @default undefined
|
38868 | * @example
|
38869 | * axis: {
|
38870 | * y: {
|
38871 | * max: 1000
|
38872 | * }
|
38873 | * }
|
38874 | */
|
38875 | axis_y_max: undefined,
|
38876 |
|
38877 | /**
|
38878 | * Set min value of y axis.
|
38879 | * - **NOTE:**
|
38880 | * 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).
|
38881 | * @name axis․y․min
|
38882 | * @memberof Options
|
38883 | * @type {number}
|
38884 | * @default undefined
|
38885 | * @example
|
38886 | * axis: {
|
38887 | * y: {
|
38888 | * min: 1000
|
38889 | * }
|
38890 | * }
|
38891 | */
|
38892 | axis_y_min: undefined,
|
38893 |
|
38894 | /**
|
38895 | * Change the direction of y axis.<br><br>
|
38896 | * If true set, the direction will be from the top to the bottom.
|
38897 | * @name axis․y․inverted
|
38898 | * @memberof Options
|
38899 | * @type {boolean}
|
38900 | * @default false
|
38901 | * @example
|
38902 | * axis: {
|
38903 | * y: {
|
38904 | * inverted: true
|
38905 | * }
|
38906 | * }
|
38907 | */
|
38908 | axis_y_inverted: !1,
|
38909 |
|
38910 | /**
|
38911 | * Set center value of y axis.
|
38912 | * @name axis․y․center
|
38913 | * @memberof Options
|
38914 | * @type {number}
|
38915 | * @default undefined
|
38916 | * @example
|
38917 | * axis: {
|
38918 | * y: {
|
38919 | * center: 0
|
38920 | * }
|
38921 | * }
|
38922 | */
|
38923 | axis_y_center: undefined,
|
38924 |
|
38925 | /**
|
38926 | * Show y axis inside of the chart.
|
38927 | * @name axis․y․inner
|
38928 | * @memberof Options
|
38929 | * @type {boolean}
|
38930 | * @default false
|
38931 | * @example
|
38932 | * axis: {
|
38933 | * y: {
|
38934 | * inner: true
|
38935 | * }
|
38936 | * }
|
38937 | */
|
38938 | axis_y_inner: !1,
|
38939 |
|
38940 | /**
|
38941 | * Set label on y axis.<br><br>
|
38942 | * 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).
|
38943 | * @name axis․y․label
|
38944 | * @memberof Options
|
38945 | * @type {string|object}
|
38946 | * @default {}
|
38947 | * @see [axis.x.label](#.axis%25E2%2580%25A4x%25E2%2580%25A4label) for position string value.
|
38948 | * @example
|
38949 | * axis: {
|
38950 | * y: {
|
38951 | * label: "Your Y Axis"
|
38952 | * }
|
38953 | * }
|
38954 | *
|
38955 | * axis: {
|
38956 | * y: {
|
38957 | * label: {
|
38958 | * text: "Your Y Axis",
|
38959 | * position: "outer-middle"
|
38960 | * }
|
38961 | * }
|
38962 | * }
|
38963 | */
|
38964 | axis_y_label: {},
|
38965 |
|
38966 | /**
|
38967 | * Set formatter for y axis tick text.<br><br>
|
38968 | * This option accepts d3.format object as well as a function you define.
|
38969 | * @name axis․y․tick․format
|
38970 | * @memberof Options
|
38971 | * @type {Function}
|
38972 | * @default undefined
|
38973 | * @example
|
38974 | * axis: {
|
38975 | * y: {
|
38976 | * tick: {
|
38977 | * format: function(x) {
|
38978 | * return x.getFullYear();
|
38979 | * }
|
38980 | * }
|
38981 | * }
|
38982 | * }
|
38983 | */
|
38984 | axis_y_tick_format: undefined,
|
38985 |
|
38986 | /**
|
38987 | * Setting for culling ticks.<br><br>
|
38988 | * 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>
|
38989 | * We can change the number of ticks to be shown by axis.y.tick.culling.max.
|
38990 | * @name axis․y․tick․culling
|
38991 | * @memberof Options
|
38992 | * @type {boolean}
|
38993 | * @default false
|
38994 | * @example
|
38995 | * axis: {
|
38996 | * y: {
|
38997 | * tick: {
|
38998 | * culling: false
|
38999 | * }
|
39000 | * }
|
39001 | * }
|
39002 | */
|
39003 | axis_y_tick_culling: !1,
|
39004 |
|
39005 | /**
|
39006 | * The number of tick texts will be adjusted to less than this value.
|
39007 | * @name axis․y․tick․culling․max
|
39008 | * @memberof Options
|
39009 | * @type {number}
|
39010 | * @default 5
|
39011 | * @example
|
39012 | * axis: {
|
39013 | * y: {
|
39014 | * tick: {
|
39015 | * culling: {
|
39016 | * max: 5
|
39017 | * }
|
39018 | * }
|
39019 | * }
|
39020 | * }
|
39021 | */
|
39022 | axis_y_tick_culling_max: 5,
|
39023 |
|
39024 | /**
|
39025 | * Show y axis outer tick.
|
39026 | * @name axis․y․tick․outer
|
39027 | * @memberof Options
|
39028 | * @type {boolean}
|
39029 | * @default true
|
39030 | * @example
|
39031 | * axis: {
|
39032 | * y: {
|
39033 | * tick: {
|
39034 | * outer: false
|
39035 | * }
|
39036 | * }
|
39037 | * }
|
39038 | */
|
39039 | axis_y_tick_outer: !0,
|
39040 |
|
39041 | /**
|
39042 | * Set y axis tick values manually.
|
39043 | * @name axis․y․tick․values
|
39044 | * @memberof Options
|
39045 | * @type {Array|Function}
|
39046 | * @default null
|
39047 | * @example
|
39048 | * axis: {
|
39049 | * y: {
|
39050 | * tick: {
|
39051 | * values: [100, 1000, 10000],
|
39052 | *
|
39053 | * // an Array value should be returned
|
39054 | * values: function() {
|
39055 | * return [ ... ];
|
39056 | * }
|
39057 | * }
|
39058 | * }
|
39059 | * }
|
39060 | */
|
39061 | axis_y_tick_values: null,
|
39062 |
|
39063 | /**
|
39064 | * Rotate y axis tick text.
|
39065 | * - If you set negative value, it will rotate to opposite direction.
|
39066 | * - Applied when [`axis.rotated`](#.axis%25E2%2580%25A4rotated) option is `true`.
|
39067 | * @name axis․y․tick․rotate
|
39068 | * @memberof Options
|
39069 | * @type {number}
|
39070 | * @default 0
|
39071 | * @example
|
39072 | * axis: {
|
39073 | * y: {
|
39074 | * tick: {
|
39075 | * rotate: 60
|
39076 | * }
|
39077 | * }
|
39078 | * }
|
39079 | */
|
39080 | axis_y_tick_rotate: 0,
|
39081 |
|
39082 | /**
|
39083 | * Set the number of y axis ticks.<br><br>
|
39084 | * - **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.
|
39085 | * @name axis․y․tick․count
|
39086 | * @memberof Options
|
39087 | * @type {number}
|
39088 | * @default undefined
|
39089 | * @example
|
39090 | * axis: {
|
39091 | * y: {
|
39092 | * tick: {
|
39093 | * count: 5
|
39094 | * }
|
39095 | * }
|
39096 | * }
|
39097 | */
|
39098 | axis_y_tick_count: undefined,
|
39099 |
|
39100 | /**
|
39101 | * Show or hide y axis tick line.
|
39102 | * @name axis․y․tick․show
|
39103 | * @memberof Options
|
39104 | * @type {boolean}
|
39105 | * @default true
|
39106 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.HideTickLineText)
|
39107 | * @example
|
39108 | * axis: {
|
39109 | * y: {
|
39110 | * tick: {
|
39111 | * show: false
|
39112 | * }
|
39113 | * }
|
39114 | * }
|
39115 | */
|
39116 | axis_y_tick_show: !0,
|
39117 |
|
39118 | /**
|
39119 | * Set axis tick step(interval) size.
|
39120 | * - **NOTE:** Will be ignored if `axis.y.tick.count` or `axis.y.tick.values` options are set.
|
39121 | * @name axis․y․tick․stepSize
|
39122 | * @memberof Options
|
39123 | * @type {number}
|
39124 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.StepSizeForYAxis)
|
39125 | * @example
|
39126 | * axis: {
|
39127 | * y: {
|
39128 | * tick: {
|
39129 | * // tick value will step as indicated interval value.
|
39130 | * // ex) 'stepSize=15' ==> [0, 15, 30, 45, 60]
|
39131 | * stepSize: 15
|
39132 | * }
|
39133 | * }
|
39134 | * }
|
39135 | */
|
39136 | axis_y_tick_stepSize: null,
|
39137 |
|
39138 | /**
|
39139 | * Show or hide y axis tick text.
|
39140 | * @name axis․y․tick․text․show
|
39141 | * @memberof Options
|
39142 | * @type {boolean}
|
39143 | * @default true
|
39144 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.HideTickLineText)
|
39145 | * @example
|
39146 | * axis: {
|
39147 | * y: {
|
39148 | * tick: {
|
39149 | * text: {
|
39150 | * show: false
|
39151 | * }
|
39152 | * }
|
39153 | * }
|
39154 | * }
|
39155 | */
|
39156 | axis_y_tick_text_show: !0,
|
39157 |
|
39158 | /**
|
39159 | * Set the y Axis tick text's position relatively its original position
|
39160 | * @name axis․y․tick․text․position
|
39161 | * @memberof Options
|
39162 | * @type {object}
|
39163 | * @default {x: 0, y:0}
|
39164 | * @example
|
39165 | * axis: {
|
39166 | * y: {
|
39167 | * tick: {
|
39168 | * text: {
|
39169 | * position: {
|
39170 | * x: 10,
|
39171 | * y: 10
|
39172 | * }
|
39173 | * }
|
39174 | * }
|
39175 | * }
|
39176 | * }
|
39177 | */
|
39178 | axis_y_tick_text_position: {
|
39179 | x: 0,
|
39180 | y: 0
|
39181 | },
|
39182 |
|
39183 | /**
|
39184 | * Set the number of y axis ticks.<br><br>
|
39185 | * - **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.
|
39186 | * @name axis․y․tick․time
|
39187 | * @memberof Options
|
39188 | * @private
|
39189 | * @type {object}
|
39190 | * @property {object} time time object
|
39191 | * @property {Function} [time.value] D3's time interval function (https://github.com/d3/d3-time#intervals)
|
39192 | * @example
|
39193 | * axis: {
|
39194 | * y: {
|
39195 | * tick: {
|
39196 | * time: {
|
39197 | * // ticks at 15-minute intervals
|
39198 | * // https://github.com/d3/d3-scale/blob/master/README.md#time_ticks
|
39199 | * value: d3.timeMinute.every(15)
|
39200 | * }
|
39201 | * }
|
39202 | * }
|
39203 | * }
|
39204 | */
|
39205 | // @TODO: not fully implemented yet
|
39206 | axis_y_tick_time_value: undefined,
|
39207 |
|
39208 | /**
|
39209 | * Set padding for y axis.<br><br>
|
39210 | * You can set padding for y axis to create more space on the edge of the axis.
|
39211 | * This option accepts object and it can include top and bottom. top, bottom will be treated as pixels.
|
39212 | *
|
39213 | * - **NOTE:**
|
39214 | * - Given values are translated relative to the y Axis domain value for padding
|
39215 | * - For area and bar type charts, [area.zerobased](#.area) or [bar.zerobased](#.bar) options should be set to 'false` to get padded bottom.
|
39216 | * @name axis․y․padding
|
39217 | * @memberof Options
|
39218 | * @type {object|number}
|
39219 | * @default {}
|
39220 | * @example
|
39221 | * axis: {
|
39222 | * y: {
|
39223 | * padding: {
|
39224 | * top: 0,
|
39225 | * bottom: 0
|
39226 | * },
|
39227 | *
|
39228 | * // or set both values at once.
|
39229 | * padding: 10
|
39230 | * }
|
39231 | * }
|
39232 | */
|
39233 | axis_y_padding: {},
|
39234 |
|
39235 | /**
|
39236 | * Set default range of y axis.<br><br>
|
39237 | * This option set the default value for y axis when there is no data on init.
|
39238 | * @name axis․y․default
|
39239 | * @memberof Options
|
39240 | * @type {Array}
|
39241 | * @default undefined
|
39242 | * @example
|
39243 | * axis: {
|
39244 | * y: {
|
39245 | * default: [0, 1000]
|
39246 | * }
|
39247 | * }
|
39248 | */
|
39249 | axis_y_default: undefined,
|
39250 |
|
39251 | /**
|
39252 | * Set additional axes for y Axis.
|
39253 | * - **NOTE:** Axis' scale is based on y Axis value if domain option isn't set.
|
39254 | *
|
39255 | * Each axis object should consist with following options:
|
39256 | *
|
39257 | * | Name | Type | Default | Description |
|
39258 | * | --- | --- | --- | --- |
|
39259 | * | domain | Array | - | Set the domain value |
|
39260 | * | tick.outer | boolean | true | Show outer tick |
|
39261 | * | tick.format | Function | - | Set formatter for tick text |
|
39262 | * | tick.count | Number | - | Set the number of y axis ticks |
|
39263 | * | tick.values | Array | - | Set tick values manually |
|
39264 | * @name axis․y․axes
|
39265 | * @memberof Options
|
39266 | * @type {Array}
|
39267 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.MultiAxes)
|
39268 | * @see [Demo: Domain](https://naver.github.io/billboard.js/demo/#Axis.MultiAxesDomain)
|
39269 | * @example
|
39270 | * y: {
|
39271 | * axes: [
|
39272 | * {
|
39273 | * // if set, will not be correlated with the main y Axis domain value
|
39274 | * domain: [0, 1000],
|
39275 | * tick: {
|
39276 | * outer: false,
|
39277 | * format: function(x) {
|
39278 | * return x + "%";
|
39279 | * },
|
39280 | * count: 2,
|
39281 | * values: [10, 20, 30]
|
39282 | * }
|
39283 | * },
|
39284 | * ...
|
39285 | * ]
|
39286 | * }
|
39287 | */
|
39288 | axis_y_axes: []
|
39289 | });
|
39290 | ;// CONCATENATED MODULE: ./src/config/Options/axis/y2.ts
|
39291 | /**
|
39292 | * Copyright (c) 2017 ~ present NAVER Corp.
|
39293 | * billboard.js project is licensed under the MIT license
|
39294 | */
|
39295 |
|
39296 | /**
|
39297 | * y2 Axis config options
|
39298 | */
|
39299 | /* harmony default export */ var y2 = ({
|
39300 | /**
|
39301 | * Show or hide y2 axis.
|
39302 | * - **NOTE**:
|
39303 | * - When set to `false` will not generate y2 axis node. In this case, all 'y2' axis related functionality won't work properly.
|
39304 | * - If need to use 'y2' related options while y2 isn't visible, set the value `true` and control visibility by css display property.
|
39305 | * @name axis․y2․show
|
39306 | * @memberof Options
|
39307 | * @type {boolean}
|
39308 | * @default false
|
39309 | * @example
|
39310 | * axis: {
|
39311 | * y2: {
|
39312 | * show: true
|
39313 | * }
|
39314 | * }
|
39315 | */
|
39316 | axis_y2_show: !1,
|
39317 |
|
39318 | /**
|
39319 | * Set type of y2 axis.<br><br>
|
39320 | * **Available Values:**
|
39321 | * - indexed
|
39322 | * - log
|
39323 | * - timeseries
|
39324 | *
|
39325 | * **NOTE:**<br>
|
39326 | * - **log** type:
|
39327 | * - the bound data values must be exclusively-positive.
|
39328 | * - y2 axis min value should be >= 0.
|
39329 | * - [`data.groups`](#.data%25E2%2580%25A4groups)(stacked data) option aren't supported.
|
39330 | *
|
39331 | * @name axis․y2․type
|
39332 | * @memberof Options
|
39333 | * @type {string}
|
39334 | * @default "indexed"
|
39335 | * @see [Demo: log](https://naver.github.io/billboard.js/demo/#Axis.LogScales)
|
39336 | * @example
|
39337 | * axis: {
|
39338 | * y2: {
|
39339 | * type: "indexed"
|
39340 | * }
|
39341 | * }
|
39342 | */
|
39343 | axis_y2_type: "indexed",
|
39344 |
|
39345 | /**
|
39346 | * Set max value of y2 axis.
|
39347 | * @name axis․y2․max
|
39348 | * @memberof Options
|
39349 | * @type {number}
|
39350 | * @default undefined
|
39351 | * @example
|
39352 | * axis: {
|
39353 | * y2: {
|
39354 | * max: 1000
|
39355 | * }
|
39356 | * }
|
39357 | */
|
39358 | axis_y2_max: undefined,
|
39359 |
|
39360 | /**
|
39361 | * Set min value of y2 axis.
|
39362 | * @name axis․y2․min
|
39363 | * @memberof Options
|
39364 | * @type {number}
|
39365 | * @default undefined
|
39366 | * @example
|
39367 | * axis: {
|
39368 | * y2: {
|
39369 | * min: -1000
|
39370 | * }
|
39371 | * }
|
39372 | */
|
39373 | axis_y2_min: undefined,
|
39374 |
|
39375 | /**
|
39376 | * Change the direction of y2 axis.<br><br>
|
39377 | * If true set, the direction will be from the top to the bottom.
|
39378 | * @name axis․y2․inverted
|
39379 | * @memberof Options
|
39380 | * @type {boolean}
|
39381 | * @default false
|
39382 | * @example
|
39383 | * axis: {
|
39384 | * y2: {
|
39385 | * inverted: true
|
39386 | * }
|
39387 | * }
|
39388 | */
|
39389 | axis_y2_inverted: !1,
|
39390 |
|
39391 | /**
|
39392 | * Set center value of y2 axis.
|
39393 | * @name axis․y2․center
|
39394 | * @memberof Options
|
39395 | * @type {number}
|
39396 | * @default undefined
|
39397 | * @example
|
39398 | * axis: {
|
39399 | * y2: {
|
39400 | * center: 0
|
39401 | * }
|
39402 | * }
|
39403 | */
|
39404 | axis_y2_center: undefined,
|
39405 |
|
39406 | /**
|
39407 | * Show y2 axis inside of the chart.
|
39408 | * @name axis․y2․inner
|
39409 | * @memberof Options
|
39410 | * @type {boolean}
|
39411 | * @default false
|
39412 | * @example
|
39413 | * axis: {
|
39414 | * y2: {
|
39415 | * inner: true
|
39416 | * }
|
39417 | * }
|
39418 | */
|
39419 | axis_y2_inner: !1,
|
39420 |
|
39421 | /**
|
39422 | * Set label on y2 axis.<br><br>
|
39423 | * 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).
|
39424 | * @name axis․y2․label
|
39425 | * @memberof Options
|
39426 | * @type {string|object}
|
39427 | * @default {}
|
39428 | * @see [axis.x.label](#.axis%25E2%2580%25A4x%25E2%2580%25A4label) for position string value.
|
39429 | * @example
|
39430 | * axis: {
|
39431 | * y2: {
|
39432 | * label: "Your Y2 Axis"
|
39433 | * }
|
39434 | * }
|
39435 | *
|
39436 | * axis: {
|
39437 | * y2: {
|
39438 | * label: {
|
39439 | * text: "Your Y2 Axis",
|
39440 | * position: "outer-middle"
|
39441 | * }
|
39442 | * }
|
39443 | * }
|
39444 | */
|
39445 | axis_y2_label: {},
|
39446 |
|
39447 | /**
|
39448 | * Set formatter for y2 axis tick text.<br><br>
|
39449 | * This option works in the same way as axis.y.format.
|
39450 | * @name axis․y2․tick․format
|
39451 | * @memberof Options
|
39452 | * @type {Function}
|
39453 | * @default undefined
|
39454 | * @example
|
39455 | * axis: {
|
39456 | * y2: {
|
39457 | * tick: {
|
39458 | * format: d3.format("$,")
|
39459 | * //or format: function(d) { return "$" + d; }
|
39460 | * }
|
39461 | * }
|
39462 | * }
|
39463 | */
|
39464 | axis_y2_tick_format: undefined,
|
39465 |
|
39466 | /**
|
39467 | * Setting for culling ticks.<br><br>
|
39468 | * 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>
|
39469 | * We can change the number of ticks to be shown by axis.y.tick.culling.max.
|
39470 | * @name axis․y2․tick․culling
|
39471 | * @memberof Options
|
39472 | * @type {boolean}
|
39473 | * @default false
|
39474 | * @example
|
39475 | * axis: {
|
39476 | * y2: {
|
39477 | * tick: {
|
39478 | * culling: false
|
39479 | * }
|
39480 | * }
|
39481 | * }
|
39482 | */
|
39483 | axis_y2_tick_culling: !1,
|
39484 |
|
39485 | /**
|
39486 | * The number of tick texts will be adjusted to less than this value.
|
39487 | * @name axis․y2․tick․culling․max
|
39488 | * @memberof Options
|
39489 | * @type {number}
|
39490 | * @default 5
|
39491 | * @example
|
39492 | * axis: {
|
39493 | * y2: {
|
39494 | * tick: {
|
39495 | * culling: {
|
39496 | * max: 5
|
39497 | * }
|
39498 | * }
|
39499 | * }
|
39500 | * }
|
39501 | */
|
39502 | axis_y2_tick_culling_max: 5,
|
39503 |
|
39504 | /**
|
39505 | * Show or hide y2 axis outer tick.
|
39506 | * @name axis․y2․tick․outer
|
39507 | * @memberof Options
|
39508 | * @type {boolean}
|
39509 | * @default true
|
39510 | * @example
|
39511 | * axis: {
|
39512 | * y2: {
|
39513 | * tick: {
|
39514 | * outer: false
|
39515 | * }
|
39516 | * }
|
39517 | * }
|
39518 | */
|
39519 | axis_y2_tick_outer: !0,
|
39520 |
|
39521 | /**
|
39522 | * Set y2 axis tick values manually.
|
39523 | * @name axis․y2․tick․values
|
39524 | * @memberof Options
|
39525 | * @type {Array|Function}
|
39526 | * @default null
|
39527 | * @example
|
39528 | * axis: {
|
39529 | * y2: {
|
39530 | * tick: {
|
39531 | * values: [100, 1000, 10000],
|
39532 | *
|
39533 | * // an Array value should be returned
|
39534 | * values: function() {
|
39535 | * return [ ... ];
|
39536 | * }
|
39537 | * }
|
39538 | * }
|
39539 | * }
|
39540 | */
|
39541 | axis_y2_tick_values: null,
|
39542 |
|
39543 | /**
|
39544 | * Rotate y2 axis tick text.
|
39545 | * - If you set negative value, it will rotate to opposite direction.
|
39546 | * - Applied when [`axis.rotated`](#.axis%25E2%2580%25A4rotated) option is `true`.
|
39547 | * @name axis․y2․tick․rotate
|
39548 | * @memberof Options
|
39549 | * @type {number}
|
39550 | * @default 0
|
39551 | * @example
|
39552 | * axis: {
|
39553 | * y2: {
|
39554 | * tick: {
|
39555 | * rotate: 60
|
39556 | * }
|
39557 | * }
|
39558 | * }
|
39559 | */
|
39560 | axis_y2_tick_rotate: 0,
|
39561 |
|
39562 | /**
|
39563 | * Set the number of y2 axis ticks.
|
39564 | * - **NOTE:** This works in the same way as axis.y.tick.count.
|
39565 | * @name axis․y2․tick․count
|
39566 | * @memberof Options
|
39567 | * @type {number}
|
39568 | * @default undefined
|
39569 | * @example
|
39570 | * axis: {
|
39571 | * y2: {
|
39572 | * tick: {
|
39573 | * count: 5
|
39574 | * }
|
39575 | * }
|
39576 | * }
|
39577 | */
|
39578 | axis_y2_tick_count: undefined,
|
39579 |
|
39580 | /**
|
39581 | * Show or hide y2 axis tick line.
|
39582 | * @name axis․y2․tick․show
|
39583 | * @memberof Options
|
39584 | * @type {boolean}
|
39585 | * @default true
|
39586 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.HideTickLineText)
|
39587 | * @example
|
39588 | * axis: {
|
39589 | * y2: {
|
39590 | * tick: {
|
39591 | * show: false
|
39592 | * }
|
39593 | * }
|
39594 | * }
|
39595 | */
|
39596 | axis_y2_tick_show: !0,
|
39597 |
|
39598 | /**
|
39599 | * Set axis tick step(interval) size.
|
39600 | * - **NOTE:** Will be ignored if `axis.y2.tick.count` or `axis.y2.tick.values` options are set.
|
39601 | * @name axis․y2․tick․stepSize
|
39602 | * @memberof Options
|
39603 | * @type {number}
|
39604 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.StepSizeForYAxis)
|
39605 | * @example
|
39606 | * axis: {
|
39607 | * y2: {
|
39608 | * tick: {
|
39609 | * // tick value will step as indicated interval value.
|
39610 | * // ex) 'stepSize=15' ==> [0, 15, 30, 45, 60]
|
39611 | * stepSize: 15
|
39612 | * }
|
39613 | * }
|
39614 | * }
|
39615 | */
|
39616 | axis_y2_tick_stepSize: null,
|
39617 |
|
39618 | /**
|
39619 | * Show or hide y2 axis tick text.
|
39620 | * @name axis․y2․tick․text․show
|
39621 | * @memberof Options
|
39622 | * @type {boolean}
|
39623 | * @default true
|
39624 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.HideTickLineText)
|
39625 | * @example
|
39626 | * axis: {
|
39627 | * y2: {
|
39628 | * tick: {
|
39629 | * text: {
|
39630 | * show: false
|
39631 | * }
|
39632 | * }
|
39633 | * }
|
39634 | * }
|
39635 | */
|
39636 | axis_y2_tick_text_show: !0,
|
39637 |
|
39638 | /**
|
39639 | * Set the y2 Axis tick text's position relatively its original position
|
39640 | * @name axis․y2․tick․text․position
|
39641 | * @memberof Options
|
39642 | * @type {object}
|
39643 | * @default {x: 0, y:0}
|
39644 | * @example
|
39645 | * axis: {
|
39646 | * y2: {
|
39647 | * tick: {
|
39648 | * text: {
|
39649 | * position: {
|
39650 | * x: 10,
|
39651 | * y: 10
|
39652 | * }
|
39653 | * }
|
39654 | * }
|
39655 | * }
|
39656 | * }
|
39657 | */
|
39658 | axis_y2_tick_text_position: {
|
39659 | x: 0,
|
39660 | y: 0
|
39661 | },
|
39662 |
|
39663 | /**
|
39664 | * Set padding for y2 axis.<br><br>
|
39665 | * You can set padding for y2 axis to create more space on the edge of the axis.
|
39666 | * This option accepts object and it can include top and bottom. top, bottom will be treated as pixels.
|
39667 | *
|
39668 | * - **NOTE:**
|
39669 | * - Given values are translated relative to the y2 Axis domain value for padding
|
39670 | * - For area and bar type charts, [area.zerobased](#.area) or [bar.zerobased](#.bar) options should be set to 'false` to get padded bottom.
|
39671 | * @name axis․y2․padding
|
39672 | * @memberof Options
|
39673 | * @type {object|number}
|
39674 | * @default {}
|
39675 | * @example
|
39676 | * axis: {
|
39677 | * y2: {
|
39678 | * padding: {
|
39679 | * top: 100,
|
39680 | * bottom: 100
|
39681 | * }
|
39682 | *
|
39683 | * // or set both values at once.
|
39684 | * padding: 10
|
39685 | * }
|
39686 | */
|
39687 | axis_y2_padding: {},
|
39688 |
|
39689 | /**
|
39690 | * Set default range of y2 axis.<br><br>
|
39691 | * This option set the default value for y2 axis when there is no data on init.
|
39692 | * @name axis․y2․default
|
39693 | * @memberof Options
|
39694 | * @type {Array}
|
39695 | * @default undefined
|
39696 | * @example
|
39697 | * axis: {
|
39698 | * y2: {
|
39699 | * default: [0, 1000]
|
39700 | * }
|
39701 | * }
|
39702 | */
|
39703 | axis_y2_default: undefined,
|
39704 |
|
39705 | /**
|
39706 | * Set additional axes for y2 Axis.
|
39707 | * - **NOTE:** Axis' scale is based on y2 Axis value if domain option isn't set.
|
39708 | *
|
39709 | * Each axis object should consist with following options:
|
39710 | *
|
39711 | * | Name | Type | Default | Description |
|
39712 | * | --- | --- | --- | --- |
|
39713 | * | domain | Array | - | Set the domain value |
|
39714 | * | tick.outer | boolean | true | Show outer tick |
|
39715 | * | tick.format | Function | - | Set formatter for tick text |
|
39716 | * | tick.count | Number | - | Set the number of y axis ticks |
|
39717 | * | tick.values | Array | - | Set tick values manually |
|
39718 | * @name axis․y2․axes
|
39719 | * @memberof Options
|
39720 | * @type {Array}
|
39721 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.MultiAxes)
|
39722 | * @see [Demo: Domain](https://naver.github.io/billboard.js/demo/#Axis.MultiAxesDomain)
|
39723 | * @example
|
39724 | * y2: {
|
39725 | * axes: [
|
39726 | * {
|
39727 | * // if set, will not be correlated with the main y2 Axis domain value
|
39728 | * domain: [0, 1000],
|
39729 | * tick: {
|
39730 | * outer: false,
|
39731 | * format: function(x) {
|
39732 | * return x + "%";
|
39733 | * },
|
39734 | * count: 2,
|
39735 | * values: [10, 20, 30]
|
39736 | * }
|
39737 | * },
|
39738 | * ...
|
39739 | * ]
|
39740 | * }
|
39741 | */
|
39742 | axis_y2_axes: []
|
39743 | });
|
39744 | ;// CONCATENATED MODULE: ./src/config/Options/axis/axis.ts
|
39745 |
|
39746 |
|
39747 | function axis_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
39748 |
|
39749 | function axis_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { axis_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { axis_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
39750 |
|
39751 | /**
|
39752 | * Copyright (c) 2017 ~ present NAVER Corp.
|
39753 | * billboard.js project is licensed under the MIT license
|
39754 | */
|
39755 |
|
39756 |
|
39757 |
|
39758 | /**
|
39759 | * y Axis config options
|
39760 | */
|
39761 |
|
39762 | /* harmony default export */ var Options_axis_axis = (axis_objectSpread(axis_objectSpread(axis_objectSpread({
|
39763 | /**
|
39764 | * Switch x and y axis position.
|
39765 | * @name axis․rotated
|
39766 | * @memberof Options
|
39767 | * @type {boolean}
|
39768 | * @default false
|
39769 | * @example
|
39770 | * axis: {
|
39771 | * rotated: true
|
39772 | * }
|
39773 | */
|
39774 | axis_rotated: !1
|
39775 | }, axis_x), y), y2));
|
39776 | ;// CONCATENATED MODULE: ./src/config/Options/common/grid.ts
|
39777 | /**
|
39778 | * Copyright (c) 2017 ~ present NAVER Corp.
|
39779 | * billboard.js project is licensed under the MIT license
|
39780 | */
|
39781 |
|
39782 | /**
|
39783 | * grid config options
|
39784 | */
|
39785 | /* harmony default export */ var common_grid = ({
|
39786 | /**
|
39787 | * Set related options
|
39788 | * @name grid
|
39789 | * @memberof Options
|
39790 | * @type {object}
|
39791 | * @property {boolean} [front=false] Set 'grid & focus lines' to be positioned over grid lines and chart elements.
|
39792 | * @property {object} x Grid x object
|
39793 | * @property {boolean} [x.show=false] Show grids along x axis.
|
39794 | * @property {Array} [x.lines=[]] Show additional grid lines along x axis.<br>
|
39795 | * 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.
|
39796 | * 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.
|
39797 | * @property {object} y Grid y object
|
39798 | * @property {boolean} [y.show=false] Show grids along x axis.
|
39799 | * @property {Array} [y.lines=[]] Show additional grid lines along y axis.<br>
|
39800 | * This option accepts array including object that has value, text, position and class.
|
39801 | * @property {number} [y.ticks=10] Number of y grids to be shown.
|
39802 | * @property {object} focus Grid focus object
|
39803 | * @property {boolean} [focus.edge=false] Show edged focus grid line.<br>**NOTE:** Available when [`tooltip.grouped=false`](#.tooltip) option is set.
|
39804 | * @property {boolean} [focus.show=true] Show grid line when focus.
|
39805 | * @property {boolean} [focus.y=false] Show y coordinate focus grid line.<br>**NOTE:** Available when [`tooltip.grouped=false`](#.tooltip) option is set.
|
39806 | * @property {object} lines Grid lines object
|
39807 | * @property {boolean} [lines.front=true] Set grid lines to be positioned over chart elements.
|
39808 | * @default undefined
|
39809 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Grid.GridLines)
|
39810 | * @see [Demo: X Grid Lines](https://naver.github.io/billboard.js/demo/#Grid.OptionalXGridLines)
|
39811 | * @see [Demo: Y Grid Lines](https://naver.github.io/billboard.js/demo/#Grid.OptionalYGridLines)
|
39812 | * @example
|
39813 | * grid: {
|
39814 | * x: {
|
39815 | * show: true,
|
39816 | * lines: [
|
39817 | * {value: 2, text: "Label on 2"},
|
39818 | * {value: 5, text: "Label on 5", class: "label-5"},
|
39819 | * {value: 6, text: "Label on 6", position: "start"}
|
39820 | * ]
|
39821 | * },
|
39822 | * y: {
|
39823 | * show: true,
|
39824 | * lines: [
|
39825 | * {value: 100, text: "Label on 100"},
|
39826 | * {value: 200, text: "Label on 200", class: "label-200"},
|
39827 | * {value: 300, text: "Label on 300", position: 'middle'}
|
39828 | * ],
|
39829 | * ticks: 5
|
39830 | * },
|
39831 | * front: true,
|
39832 | * focus: {
|
39833 | * show: false,
|
39834 | *
|
39835 | * // Below options are available when 'tooltip.grouped=false' option is set
|
39836 | * edge: true,
|
39837 | * y: true
|
39838 | * },
|
39839 | * lines: {
|
39840 | * front: false
|
39841 | * }
|
39842 | * }
|
39843 | */
|
39844 | grid_x_show: !1,
|
39845 | grid_x_type: "tick",
|
39846 | grid_x_lines: [],
|
39847 | grid_y_show: !1,
|
39848 | grid_y_lines: [],
|
39849 | grid_y_ticks: 10,
|
39850 | grid_focus_edge: !1,
|
39851 | grid_focus_show: !0,
|
39852 | grid_focus_y: !1,
|
39853 | grid_front: !1,
|
39854 | grid_lines_front: !0
|
39855 | });
|
39856 | ;// CONCATENATED MODULE: ./src/config/resolver/axis.ts
|
39857 | /**
|
39858 | * Copyright (c) 2017 ~ present NAVER Corp.
|
39859 | * billboard.js project is licensed under the MIT license
|
39860 | */
|
39861 |
|
39862 | /**
|
39863 | * Modules exports for Axis based chart
|
39864 | */
|
39865 | // Chart
|
39866 |
|
39867 |
|
39868 |
|
39869 |
|
39870 |
|
39871 |
|
39872 |
|
39873 | // ChartInternal
|
39874 |
|
39875 |
|
39876 |
|
39877 |
|
39878 |
|
39879 |
|
39880 |
|
39881 | // Axis based options
|
39882 |
|
39883 |
|
39884 |
|
39885 |
|
39886 | var api = [api_axis, api_category, grid_x, grid_y, flow, group, api_regions, x];
|
39887 | var internal = [Axis, clip, eventrect, interactions_flow, grid, region, size_axis];
|
39888 | var options = [data_axis, Options_axis_axis, common_grid];
|
39889 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/array.js
|
39890 | var slice = Array.prototype.slice;
|
39891 | /* harmony default export */ function d3_shape_src_array(x) {
|
39892 | return typeof x === "object" && "length" in x ? x // Array, TypedArray, NodeList, array-like
|
39893 | : Array.from(x); // Map, Set, iterable, string, or anything else
|
39894 | }
|
39895 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/constant.js
|
39896 | /* harmony default export */ function d3_shape_src_constant(x) {
|
39897 | return function () {
|
39898 | return x;
|
39899 | };
|
39900 | }
|
39901 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/descending.js
|
39902 | /* harmony default export */ function descending(a, b) {
|
39903 | return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
|
39904 | }
|
39905 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/identity.js
|
39906 | /* harmony default export */ function d3_shape_src_identity(d) {
|
39907 | return d;
|
39908 | }
|
39909 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/pie.js
|
39910 |
|
39911 |
|
39912 |
|
39913 |
|
39914 |
|
39915 | /* harmony default export */ function pie() {
|
39916 | var value = d3_shape_src_identity,
|
39917 | sortValues = descending,
|
39918 | sort = null,
|
39919 | startAngle = d3_shape_src_constant(0),
|
39920 | endAngle = d3_shape_src_constant(tau),
|
39921 | padAngle = d3_shape_src_constant(0);
|
39922 |
|
39923 | function pie(data) {
|
39924 | var i,
|
39925 | n = (data = d3_shape_src_array(data)).length,
|
39926 | j,
|
39927 | k,
|
39928 | sum = 0,
|
39929 | index = Array(n),
|
39930 | arcs = Array(n),
|
39931 | a0 = +startAngle.apply(this, arguments),
|
39932 | da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),
|
39933 | a1,
|
39934 | p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),
|
39935 | pa = p * (da < 0 ? -1 : 1),
|
39936 | v;
|
39937 |
|
39938 | for (i = 0; i < n; ++i) {
|
39939 | if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {
|
39940 | sum += v;
|
39941 | }
|
39942 | } // Optionally sort the arcs by previously-computed values or by data.
|
39943 |
|
39944 |
|
39945 | if (sortValues != null) index.sort(function (i, j) {
|
39946 | return sortValues(arcs[i], arcs[j]);
|
39947 | });else if (sort != null) index.sort(function (i, j) {
|
39948 | return sort(data[i], data[j]);
|
39949 | }); // Compute the arcs! They are stored in the original data's order.
|
39950 |
|
39951 | for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {
|
39952 | j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {
|
39953 | data: data[j],
|
39954 | index: i,
|
39955 | value: v,
|
39956 | startAngle: a0,
|
39957 | endAngle: a1,
|
39958 | padAngle: p
|
39959 | };
|
39960 | }
|
39961 |
|
39962 | return arcs;
|
39963 | }
|
39964 |
|
39965 | pie.value = function (_) {
|
39966 | return arguments.length ? (value = typeof _ === "function" ? _ : d3_shape_src_constant(+_), pie) : value;
|
39967 | };
|
39968 |
|
39969 | pie.sortValues = function (_) {
|
39970 | return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;
|
39971 | };
|
39972 |
|
39973 | pie.sort = function (_) {
|
39974 | return arguments.length ? (sort = _, sortValues = null, pie) : sort;
|
39975 | };
|
39976 |
|
39977 | pie.startAngle = function (_) {
|
39978 | return arguments.length ? (startAngle = typeof _ === "function" ? _ : d3_shape_src_constant(+_), pie) : startAngle;
|
39979 | };
|
39980 |
|
39981 | pie.endAngle = function (_) {
|
39982 | return arguments.length ? (endAngle = typeof _ === "function" ? _ : d3_shape_src_constant(+_), pie) : endAngle;
|
39983 | };
|
39984 |
|
39985 | pie.padAngle = function (_) {
|
39986 | return arguments.length ? (padAngle = typeof _ === "function" ? _ : d3_shape_src_constant(+_), pie) : padAngle;
|
39987 | };
|
39988 |
|
39989 | return pie;
|
39990 | }
|
39991 | ;// CONCATENATED MODULE: ./node_modules/d3-path/src/path.js
|
39992 | var path_pi = Math.PI,
|
39993 | path_tau = 2 * path_pi,
|
39994 | path_epsilon = 1e-6,
|
39995 | tauEpsilon = path_tau - path_epsilon;
|
39996 |
|
39997 | function Path() {
|
39998 | this._x0 = this._y0 = // start of current subpath
|
39999 | this._x1 = this._y1 = null; // end of current subpath
|
40000 |
|
40001 | this._ = "";
|
40002 | }
|
40003 |
|
40004 | function path() {
|
40005 | return new Path();
|
40006 | }
|
40007 |
|
40008 | Path.prototype = path.prototype = {
|
40009 | constructor: Path,
|
40010 | moveTo: function moveTo(x, y) {
|
40011 | this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y);
|
40012 | },
|
40013 | closePath: function closePath() {
|
40014 | if (this._x1 !== null) {
|
40015 | this._x1 = this._x0, this._y1 = this._y0;
|
40016 | this._ += "Z";
|
40017 | }
|
40018 | },
|
40019 | lineTo: function lineTo(x, y) {
|
40020 | this._ += "L" + (this._x1 = +x) + "," + (this._y1 = +y);
|
40021 | },
|
40022 | quadraticCurveTo: function quadraticCurveTo(x1, y1, x, y) {
|
40023 | this._ += "Q" + +x1 + "," + +y1 + "," + (this._x1 = +x) + "," + (this._y1 = +y);
|
40024 | },
|
40025 | bezierCurveTo: function bezierCurveTo(x1, y1, x2, y2, x, y) {
|
40026 | this._ += "C" + +x1 + "," + +y1 + "," + +x2 + "," + +y2 + "," + (this._x1 = +x) + "," + (this._y1 = +y);
|
40027 | },
|
40028 | arcTo: function arcTo(x1, y1, x2, y2, r) {
|
40029 | x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;
|
40030 | var x0 = this._x1,
|
40031 | y0 = this._y1,
|
40032 | x21 = x2 - x1,
|
40033 | y21 = y2 - y1,
|
40034 | x01 = x0 - x1,
|
40035 | y01 = y0 - y1,
|
40036 | l01_2 = x01 * x01 + y01 * y01; // Is the radius negative? Error.
|
40037 |
|
40038 | if (r < 0) throw new Error("negative radius: " + r); // Is this path empty? Move to (x1,y1).
|
40039 |
|
40040 | if (this._x1 === null) {
|
40041 | this._ += "M" + (this._x1 = x1) + "," + (this._y1 = y1);
|
40042 | } // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.
|
40043 | else if (!(l01_2 > path_epsilon)) ; // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?
|
40044 | // Equivalently, is (x1,y1) coincident with (x2,y2)?
|
40045 | // Or, is the radius zero? Line to (x1,y1).
|
40046 | else if (!(Math.abs(y01 * x21 - y21 * x01) > path_epsilon) || !r) {
|
40047 | this._ += "L" + (this._x1 = x1) + "," + (this._y1 = y1);
|
40048 | } // Otherwise, draw an arc!
|
40049 | else {
|
40050 | var x20 = x2 - x0,
|
40051 | y20 = y2 - y0,
|
40052 | l21_2 = x21 * x21 + y21 * y21,
|
40053 | l21 = Math.sqrt(l21_2),
|
40054 | l01 = Math.sqrt(l01_2),
|
40055 | l = r * Math.tan((path_pi - Math.acos((l21_2 + l01_2 - (x20 * x20 + y20 * y20)) / (2 * l21 * l01))) / 2),
|
40056 | t01 = l / l01,
|
40057 | t21 = l / l21; // If the start tangent is not coincident with (x0,y0), line to.
|
40058 |
|
40059 | if (Math.abs(t01 - 1) > path_epsilon) {
|
40060 | this._ += "L" + (x1 + t01 * x01) + "," + (y1 + t01 * y01);
|
40061 | }
|
40062 |
|
40063 | this._ += "A" + r + "," + r + ",0,0," + +(y01 * x20 > x01 * y20) + "," + (this._x1 = x1 + t21 * x21) + "," + (this._y1 = y1 + t21 * y21);
|
40064 | }
|
40065 | },
|
40066 | arc: function arc(x, y, r, a0, a1, ccw) {
|
40067 | x = +x, y = +y, r = +r, ccw = !!ccw;
|
40068 | var dx = r * Math.cos(a0),
|
40069 | dy = r * Math.sin(a0),
|
40070 | x0 = x + dx,
|
40071 | y0 = y + dy,
|
40072 | cw = 1 ^ ccw,
|
40073 | da = ccw ? a0 - a1 : a1 - a0; // Is the radius negative? Error.
|
40074 |
|
40075 | if (r < 0) throw new Error("negative radius: " + r); // Is this path empty? Move to (x0,y0).
|
40076 |
|
40077 | if (this._x1 === null) {
|
40078 | this._ += "M" + x0 + "," + y0;
|
40079 | } // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).
|
40080 | else if (Math.abs(this._x1 - x0) > path_epsilon || Math.abs(this._y1 - y0) > path_epsilon) {
|
40081 | this._ += "L" + x0 + "," + y0;
|
40082 | } // Is this arc empty? We’re done.
|
40083 |
|
40084 |
|
40085 | if (!r) return; // Does the angle go the wrong way? Flip the direction.
|
40086 |
|
40087 | if (da < 0) da = da % path_tau + path_tau; // Is this a complete circle? Draw two arcs to complete the circle.
|
40088 |
|
40089 | if (da > tauEpsilon) {
|
40090 | this._ += "A" + r + "," + r + ",0,1," + cw + "," + (x - dx) + "," + (y - dy) + "A" + r + "," + r + ",0,1," + cw + "," + (this._x1 = x0) + "," + (this._y1 = y0);
|
40091 | } // Is this arc non-empty? Draw an arc!
|
40092 | else if (da > path_epsilon) {
|
40093 | this._ += "A" + r + "," + r + ",0," + +(da >= path_pi) + "," + cw + "," + (this._x1 = x + r * Math.cos(a1)) + "," + (this._y1 = y + r * Math.sin(a1));
|
40094 | }
|
40095 | },
|
40096 | rect: function rect(x, y, w, h) {
|
40097 | this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y) + "h" + +w + "v" + +h + "h" + -w + "Z";
|
40098 | },
|
40099 | toString: function toString() {
|
40100 | return this._;
|
40101 | }
|
40102 | };
|
40103 | /* harmony default export */ var src_path = (path);
|
40104 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/arc.js
|
40105 |
|
40106 |
|
40107 |
|
40108 |
|
40109 | function arcInnerRadius(d) {
|
40110 | return d.innerRadius;
|
40111 | }
|
40112 |
|
40113 | function arcOuterRadius(d) {
|
40114 | return d.outerRadius;
|
40115 | }
|
40116 |
|
40117 | function arcStartAngle(d) {
|
40118 | return d.startAngle;
|
40119 | }
|
40120 |
|
40121 | function arcEndAngle(d) {
|
40122 | return d.endAngle;
|
40123 | }
|
40124 |
|
40125 | function arcPadAngle(d) {
|
40126 | return d && d.padAngle; // Note: optional!
|
40127 | }
|
40128 |
|
40129 | function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {
|
40130 | var x10 = x1 - x0,
|
40131 | y10 = y1 - y0,
|
40132 | x32 = x3 - x2,
|
40133 | y32 = y3 - y2,
|
40134 | t = y32 * x10 - x32 * y10;
|
40135 | if (t * t < epsilon) return;
|
40136 | t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;
|
40137 | return [x0 + t * x10, y0 + t * y10];
|
40138 | } // Compute perpendicular offset line of length rc.
|
40139 | // http://mathworld.wolfram.com/Circle-LineIntersection.html
|
40140 |
|
40141 |
|
40142 | function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
|
40143 | var x01 = x0 - x1,
|
40144 | y01 = y0 - y1,
|
40145 | lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),
|
40146 | ox = lo * y01,
|
40147 | oy = -lo * x01,
|
40148 | x11 = x0 + ox,
|
40149 | y11 = y0 + oy,
|
40150 | x10 = x1 + ox,
|
40151 | y10 = y1 + oy,
|
40152 | x00 = (x11 + x10) / 2,
|
40153 | y00 = (y11 + y10) / 2,
|
40154 | dx = x10 - x11,
|
40155 | dy = y10 - y11,
|
40156 | d2 = dx * dx + dy * dy,
|
40157 | r = r1 - rc,
|
40158 | D = x11 * y10 - x10 * y11,
|
40159 | d = (dy < 0 ? -1 : 1) * sqrt(math_max(0, r * r * d2 - D * D)),
|
40160 | cx0 = (D * dy - dx * d) / d2,
|
40161 | cy0 = (-D * dx - dy * d) / d2,
|
40162 | cx1 = (D * dy + dx * d) / d2,
|
40163 | cy1 = (-D * dx + dy * d) / d2,
|
40164 | dx0 = cx0 - x00,
|
40165 | dy0 = cy0 - y00,
|
40166 | dx1 = cx1 - x00,
|
40167 | dy1 = cy1 - y00; // Pick the closer of the two intersection points.
|
40168 | // TODO Is there a faster way to determine which intersection to use?
|
40169 |
|
40170 | if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;
|
40171 | return {
|
40172 | cx: cx0,
|
40173 | cy: cy0,
|
40174 | x01: -ox,
|
40175 | y01: -oy,
|
40176 | x11: cx0 * (r1 / r - 1),
|
40177 | y11: cy0 * (r1 / r - 1)
|
40178 | };
|
40179 | }
|
40180 |
|
40181 | /* harmony default export */ function src_arc() {
|
40182 | var innerRadius = arcInnerRadius,
|
40183 | outerRadius = arcOuterRadius,
|
40184 | cornerRadius = d3_shape_src_constant(0),
|
40185 | padRadius = null,
|
40186 | startAngle = arcStartAngle,
|
40187 | endAngle = arcEndAngle,
|
40188 | padAngle = arcPadAngle,
|
40189 | context = null;
|
40190 |
|
40191 | function arc() {
|
40192 | var buffer,
|
40193 | r,
|
40194 | r0 = +innerRadius.apply(this, arguments),
|
40195 | r1 = +outerRadius.apply(this, arguments),
|
40196 | a0 = startAngle.apply(this, arguments) - halfPi,
|
40197 | a1 = endAngle.apply(this, arguments) - halfPi,
|
40198 | da = math_abs(a1 - a0),
|
40199 | cw = a1 > a0;
|
40200 | if (!context) context = buffer = src_path(); // Ensure that the outer radius is always larger than the inner radius.
|
40201 |
|
40202 | if (r1 < r0) r = r1, r1 = r0, r0 = r; // Is it a point?
|
40203 |
|
40204 | if (!(r1 > epsilon)) context.moveTo(0, 0); // Or is it a circle or annulus?
|
40205 | else if (da > tau - epsilon) {
|
40206 | context.moveTo(r1 * cos(a0), r1 * sin(a0));
|
40207 | context.arc(0, 0, r1, a0, a1, !cw);
|
40208 |
|
40209 | if (r0 > epsilon) {
|
40210 | context.moveTo(r0 * cos(a1), r0 * sin(a1));
|
40211 | context.arc(0, 0, r0, a1, a0, cw);
|
40212 | }
|
40213 | } // Or is it a circular or annular sector?
|
40214 | else {
|
40215 | var a01 = a0,
|
40216 | a11 = a1,
|
40217 | a00 = a0,
|
40218 | a10 = a1,
|
40219 | da0 = da,
|
40220 | da1 = da,
|
40221 | ap = padAngle.apply(this, arguments) / 2,
|
40222 | rp = ap > epsilon && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),
|
40223 | rc = math_min(math_abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),
|
40224 | rc0 = rc,
|
40225 | rc1 = rc,
|
40226 | t0,
|
40227 | t1; // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.
|
40228 |
|
40229 | if (rp > epsilon) {
|
40230 | var p0 = asin(rp / r0 * sin(ap)),
|
40231 | p1 = asin(rp / r1 * sin(ap));
|
40232 | if ((da0 -= p0 * 2) > epsilon) p0 *= cw ? 1 : -1, a00 += p0, a10 -= p0;else da0 = 0, a00 = a10 = (a0 + a1) / 2;
|
40233 | if ((da1 -= p1 * 2) > epsilon) p1 *= cw ? 1 : -1, a01 += p1, a11 -= p1;else da1 = 0, a01 = a11 = (a0 + a1) / 2;
|
40234 | }
|
40235 |
|
40236 | var x01 = r1 * cos(a01),
|
40237 | y01 = r1 * sin(a01),
|
40238 | x10 = r0 * cos(a10),
|
40239 | y10 = r0 * sin(a10); // Apply rounded corners?
|
40240 |
|
40241 | if (rc > epsilon) {
|
40242 | var x11 = r1 * cos(a11),
|
40243 | y11 = r1 * sin(a11),
|
40244 | x00 = r0 * cos(a00),
|
40245 | y00 = r0 * sin(a00),
|
40246 | oc; // Restrict the corner radius according to the sector angle.
|
40247 |
|
40248 | if (da < pi && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) {
|
40249 | var ax = x01 - oc[0],
|
40250 | ay = y01 - oc[1],
|
40251 | bx = x11 - oc[0],
|
40252 | by = y11 - oc[1],
|
40253 | kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),
|
40254 | lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);
|
40255 | rc0 = math_min(rc, (r0 - lc) / (kc - 1));
|
40256 | rc1 = math_min(rc, (r1 - lc) / (kc + 1));
|
40257 | }
|
40258 | } // Is the sector collapsed to a line?
|
40259 |
|
40260 |
|
40261 | if (!(da1 > epsilon)) context.moveTo(x01, y01); // Does the sector’s outer ring have rounded corners?
|
40262 | else if (rc1 > epsilon) {
|
40263 | t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);
|
40264 | t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);
|
40265 | context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01); // Have the corners merged?
|
40266 |
|
40267 | if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw); // Otherwise, draw the two corners and the ring.
|
40268 | else {
|
40269 | context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);
|
40270 | context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);
|
40271 | context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);
|
40272 | }
|
40273 | } // Or is the outer ring just a circular arc?
|
40274 | else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw); // Is there no inner ring, and it’s a circular sector?
|
40275 | // Or perhaps it’s an annular sector collapsed due to padding?
|
40276 |
|
40277 | if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10); // Does the sector’s inner ring (or point) have rounded corners?
|
40278 | else if (rc0 > epsilon) {
|
40279 | t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);
|
40280 | t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);
|
40281 | context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01); // Have the corners merged?
|
40282 |
|
40283 | if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw); // Otherwise, draw the two corners and the ring.
|
40284 | else {
|
40285 | context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);
|
40286 | context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);
|
40287 | context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);
|
40288 | }
|
40289 | } // Or is the inner ring just a circular arc?
|
40290 | else context.arc(0, 0, r0, a10, a00, cw);
|
40291 | }
|
40292 | context.closePath();
|
40293 | if (buffer) return context = null, buffer + "" || null;
|
40294 | }
|
40295 |
|
40296 | arc.centroid = function () {
|
40297 | var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,
|
40298 | a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;
|
40299 | return [cos(a) * r, sin(a) * r];
|
40300 | };
|
40301 |
|
40302 | arc.innerRadius = function (_) {
|
40303 | return arguments.length ? (innerRadius = typeof _ === "function" ? _ : d3_shape_src_constant(+_), arc) : innerRadius;
|
40304 | };
|
40305 |
|
40306 | arc.outerRadius = function (_) {
|
40307 | return arguments.length ? (outerRadius = typeof _ === "function" ? _ : d3_shape_src_constant(+_), arc) : outerRadius;
|
40308 | };
|
40309 |
|
40310 | arc.cornerRadius = function (_) {
|
40311 | return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : d3_shape_src_constant(+_), arc) : cornerRadius;
|
40312 | };
|
40313 |
|
40314 | arc.padRadius = function (_) {
|
40315 | return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : d3_shape_src_constant(+_), arc) : padRadius;
|
40316 | };
|
40317 |
|
40318 | arc.startAngle = function (_) {
|
40319 | return arguments.length ? (startAngle = typeof _ === "function" ? _ : d3_shape_src_constant(+_), arc) : startAngle;
|
40320 | };
|
40321 |
|
40322 | arc.endAngle = function (_) {
|
40323 | return arguments.length ? (endAngle = typeof _ === "function" ? _ : d3_shape_src_constant(+_), arc) : endAngle;
|
40324 | };
|
40325 |
|
40326 | arc.padAngle = function (_) {
|
40327 | return arguments.length ? (padAngle = typeof _ === "function" ? _ : d3_shape_src_constant(+_), arc) : padAngle;
|
40328 | };
|
40329 |
|
40330 | arc.context = function (_) {
|
40331 | return arguments.length ? (context = _ == null ? null : _, arc) : context;
|
40332 | };
|
40333 |
|
40334 | return arc;
|
40335 | }
|
40336 | ;// CONCATENATED MODULE: ./src/ChartInternal/shape/arc.ts
|
40337 | /**
|
40338 | * Copyright (c) 2017 ~ present NAVER Corp.
|
40339 | * billboard.js project is licensed under the MIT license
|
40340 | */
|
40341 |
|
40342 |
|
40343 |
|
40344 |
|
40345 |
|
40346 |
|
40347 | /* harmony default export */ var arc = ({
|
40348 | initPie: function initPie() {
|
40349 | var $$ = this,
|
40350 | config = $$.config,
|
40351 | dataType = config.data_type,
|
40352 | padding = config.pie_padding,
|
40353 | startingAngle = config[dataType + "_startingAngle"] || 0,
|
40354 | padAngle = ($$.hasType("pie") && padding ? padding * .01 : config[dataType + "_padAngle"]) || 0;
|
40355 | $$.pie = pie().startAngle(startingAngle).endAngle(startingAngle + 2 * Math.PI).padAngle(padAngle).value(function (d) {
|
40356 | return d.values.reduce(function (a, b) {
|
40357 | return a + b.value;
|
40358 | }, 0);
|
40359 | }).sort($$.getSortCompareFn.bind($$)(!0));
|
40360 | },
|
40361 | updateRadius: function updateRadius() {
|
40362 | var $$ = this,
|
40363 | config = $$.config,
|
40364 | state = $$.state,
|
40365 | padding = config.pie_padding,
|
40366 | w = config.gauge_width || config.donut_width,
|
40367 | gaugeArcWidth = $$.filterTargetsToShow($$.data.targets).length * config.gauge_arcs_minWidth;
|
40368 | // determine radius
|
40369 | state.radiusExpanded = Math.min(state.arcWidth, state.arcHeight) / 2 * ($$.hasMultiArcGauge() ? .85 : 1);
|
40370 | state.radius = state.radiusExpanded * .95;
|
40371 | state.innerRadiusRatio = w ? (state.radius - w) / state.radius : .6;
|
40372 | state.gaugeArcWidth = w || (gaugeArcWidth <= state.radius - state.innerRadius ? state.radius - state.innerRadius : gaugeArcWidth <= state.radius ? gaugeArcWidth : state.radius);
|
40373 | 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
|
40374 |
|
40375 | state.outerRadius = config.pie_outerRadius;
|
40376 | state.innerRadius = $$.hasType("donut") || $$.hasType("gauge") ? state.radius * state.innerRadiusRatio : innerRadius;
|
40377 | },
|
40378 |
|
40379 | /**
|
40380 | * Get pie's inner & outer radius value
|
40381 | * @param {object|undefined} d Data object
|
40382 | * @returns {object}
|
40383 | * @private
|
40384 | */
|
40385 | getRadius: function getRadius(d) {
|
40386 | var $$ = this,
|
40387 | data = d == null ? void 0 : d.data,
|
40388 | _$$$state = $$.state,
|
40389 | innerRadius = _$$$state.innerRadius,
|
40390 | outerRadius = _$$$state.outerRadius;
|
40391 |
|
40392 | if (!isNumber(innerRadius) && data) {
|
40393 | innerRadius = innerRadius[data.id] || 0;
|
40394 | }
|
40395 |
|
40396 | if (isObject(outerRadius) && data && data.id in outerRadius) {
|
40397 | outerRadius = outerRadius[data.id];
|
40398 | } else if (!isNumber(outerRadius)) {
|
40399 | outerRadius = $$.state.radius;
|
40400 | }
|
40401 |
|
40402 | return {
|
40403 | innerRadius: innerRadius,
|
40404 | outerRadius: outerRadius
|
40405 | };
|
40406 | },
|
40407 | updateArc: function updateArc() {
|
40408 | var $$ = this;
|
40409 | $$.updateRadius();
|
40410 | $$.svgArc = $$.getSvgArc();
|
40411 | $$.svgArcExpanded = $$.getSvgArcExpanded();
|
40412 | },
|
40413 | getArcLength: function getArcLength() {
|
40414 | var $$ = this,
|
40415 | config = $$.config,
|
40416 | arcLengthInPercent = config.gauge_arcLength * 3.6,
|
40417 | len = 2 * (arcLengthInPercent / 360);
|
40418 |
|
40419 | if (arcLengthInPercent < -360) {
|
40420 | len = -2;
|
40421 | } else if (arcLengthInPercent > 360) {
|
40422 | len = 2;
|
40423 | }
|
40424 |
|
40425 | return len * Math.PI;
|
40426 | },
|
40427 | getStartAngle: function getStartAngle() {
|
40428 | var $$ = this,
|
40429 | config = $$.config,
|
40430 | isFullCircle = config.gauge_fullCircle,
|
40431 | defaultStartAngle = -1 * Math.PI / 2,
|
40432 | defaultEndAngle = Math.PI / 2,
|
40433 | startAngle = config.gauge_startingAngle;
|
40434 |
|
40435 | if (!isFullCircle && startAngle <= defaultStartAngle) {
|
40436 | startAngle = defaultStartAngle;
|
40437 | } else if (!isFullCircle && startAngle >= defaultEndAngle) {
|
40438 | startAngle = defaultEndAngle;
|
40439 | } else if (startAngle > Math.PI || startAngle < -1 * Math.PI) {
|
40440 | startAngle = Math.PI;
|
40441 | }
|
40442 |
|
40443 | return startAngle;
|
40444 | },
|
40445 | updateAngle: function updateAngle(dValue) {
|
40446 | var $$ = this,
|
40447 | config = $$.config,
|
40448 | state = $$.state,
|
40449 | pie = $$.pie,
|
40450 | d = dValue,
|
40451 | found = !1;
|
40452 |
|
40453 | if (!config) {
|
40454 | return null;
|
40455 | }
|
40456 |
|
40457 | var gStart = $$.getStartAngle(),
|
40458 | radius = config.gauge_fullCircle ? $$.getArcLength() : gStart * -2;
|
40459 |
|
40460 | if (d.data && $$.isGaugeType(d.data) && !$$.hasMultiArcGauge()) {
|
40461 | var _config = config,
|
40462 | min = _config.gauge_min,
|
40463 | max = _config.gauge_max,
|
40464 | totalSum = $$.getTotalDataSum(state.rendered); // to prevent excluding total data sum during the init(when data.hide option is used), use $$.rendered state value
|
40465 |
|
40466 | pie = pie.startAngle(gStart).endAngle(radius * ((totalSum - min) / (max - min)) + gStart);
|
40467 | }
|
40468 |
|
40469 | pie($$.filterTargetsToShow()).forEach(function (t, i) {
|
40470 | if (!found && t.data.id === d.data.id) {
|
40471 | found = !0;
|
40472 | d = t;
|
40473 | d.index = i;
|
40474 | }
|
40475 | });
|
40476 |
|
40477 | if (isNaN(d.startAngle)) {
|
40478 | d.startAngle = 0;
|
40479 | }
|
40480 |
|
40481 | if (isNaN(d.endAngle)) {
|
40482 | d.endAngle = d.startAngle;
|
40483 | }
|
40484 |
|
40485 | if (d.data && $$.hasMultiArcGauge()) {
|
40486 | var gMin = config.gauge_min,
|
40487 | gMax = config.gauge_max,
|
40488 | gValue = d.value < gMin ? 0 : d.value < gMax ? d.value - gMin : gMax - gMin;
|
40489 | d.startAngle = gStart;
|
40490 | d.endAngle = gStart + radius / (gMax - gMin) * gValue;
|
40491 | }
|
40492 |
|
40493 | return found ? d : null;
|
40494 | },
|
40495 | getSvgArc: function getSvgArc() {
|
40496 | var $$ = this,
|
40497 | state = $$.state,
|
40498 | singleArcWidth = state.gaugeArcWidth / $$.filterTargetsToShow($$.data.targets).length,
|
40499 | hasMultiArcGauge = $$.hasMultiArcGauge(),
|
40500 | arc = src_arc().innerRadius(function (d) {
|
40501 | var _$$$getRadius = $$.getRadius(d),
|
40502 | innerRadius = _$$$getRadius.innerRadius;
|
40503 |
|
40504 | return hasMultiArcGauge ? state.radius - singleArcWidth * (d.index + 1) : isNumber(innerRadius) ? innerRadius : 0;
|
40505 | }).outerRadius(function (d) {
|
40506 | var _$$$getRadius2 = $$.getRadius(d),
|
40507 | outerRadius = _$$$getRadius2.outerRadius;
|
40508 |
|
40509 | return hasMultiArcGauge ? state.radius - singleArcWidth * d.index : outerRadius;
|
40510 | }),
|
40511 | newArc = function (d, withoutUpdate) {
|
40512 | var path = "M 0 0";
|
40513 |
|
40514 | if (d.value || d.data) {
|
40515 | var updated = !withoutUpdate && $$.updateAngle(d);
|
40516 |
|
40517 | if (withoutUpdate) {
|
40518 | path = arc(d);
|
40519 | } else if (updated) {
|
40520 | path = arc(updated);
|
40521 | }
|
40522 | }
|
40523 |
|
40524 | return path;
|
40525 | };
|
40526 |
|
40527 | // TODO: extends all function
|
40528 | newArc.centroid = arc.centroid;
|
40529 | return newArc;
|
40530 | },
|
40531 | getSvgArcExpanded: function getSvgArcExpanded(rate) {
|
40532 | var $$ = this,
|
40533 | state = $$.state,
|
40534 | newRate = rate || 1,
|
40535 | singleArcWidth = state.gaugeArcWidth / $$.filterTargetsToShow($$.data.targets).length,
|
40536 | hasMultiArcGauge = $$.hasMultiArcGauge(),
|
40537 | expandWidth = Math.min(state.radiusExpanded * newRate - state.radius, singleArcWidth * .8 - (1 - newRate) * 100),
|
40538 | arc = src_arc().innerRadius(function (d) {
|
40539 | return hasMultiArcGauge ? state.radius - singleArcWidth * (d.index + 1) : $$.getRadius(d).innerRadius;
|
40540 | }).outerRadius(function (d) {
|
40541 | var radius;
|
40542 |
|
40543 | if (hasMultiArcGauge) {
|
40544 | radius = state.radius - singleArcWidth * d.index + expandWidth;
|
40545 | } else {
|
40546 | var _$$$getRadius3 = $$.getRadius(d),
|
40547 | outerRadius = _$$$getRadius3.outerRadius,
|
40548 | radiusExpanded = state.radiusExpanded;
|
40549 |
|
40550 | if (state.radius !== outerRadius) {
|
40551 | radiusExpanded -= Math.abs(state.radius - outerRadius);
|
40552 | }
|
40553 |
|
40554 | radius = radiusExpanded * newRate;
|
40555 | }
|
40556 |
|
40557 | return radius;
|
40558 | });
|
40559 | return function (d) {
|
40560 | var updated = $$.updateAngle(d);
|
40561 | return updated ? arc(updated) : "M 0 0";
|
40562 | };
|
40563 | },
|
40564 | getArc: function getArc(d, withoutUpdate, force) {
|
40565 | return force || this.isArcType(d.data) ? this.svgArc(d, withoutUpdate) : "M 0 0";
|
40566 | },
|
40567 | transformForArcLabel: function transformForArcLabel(d) {
|
40568 | var $$ = this,
|
40569 | config = $$.config,
|
40570 | radiusExpanded = $$.state.radiusExpanded,
|
40571 | updated = $$.updateAngle(d),
|
40572 | translate = "";
|
40573 |
|
40574 | if (updated) {
|
40575 | if ($$.hasMultiArcGauge()) {
|
40576 | var y1 = Math.sin(updated.endAngle - Math.PI / 2),
|
40577 | x = Math.cos(updated.endAngle - Math.PI / 2) * (radiusExpanded + 25),
|
40578 | y = y1 * (radiusExpanded + 15 - Math.abs(y1 * 10)) + 3;
|
40579 | translate = "translate(" + x + "," + y + ")";
|
40580 | } else if (!$$.hasType("gauge") || $$.data.targets.length > 1) {
|
40581 | var _$$$getRadius4 = $$.getRadius(d),
|
40582 | outerRadius = _$$$getRadius4.outerRadius,
|
40583 | c = this.svgArc.centroid(updated),
|
40584 | _c$map = c.map(function (v) {
|
40585 | return isNaN(v) ? 0 : v;
|
40586 | }),
|
40587 | x = _c$map[0],
|
40588 | y = _c$map[1],
|
40589 | h = Math.sqrt(x * x + y * y),
|
40590 | ratio = $$.hasType("donut") && config.donut_label_ratio || $$.hasType("pie") && config.pie_label_ratio;
|
40591 |
|
40592 | if (ratio) {
|
40593 | ratio = isFunction(ratio) ? ratio.bind($$.api)(d, outerRadius, h) : ratio;
|
40594 | } else {
|
40595 | ratio = outerRadius && (h ? (36 / outerRadius > .375 ? 1.175 - 36 / outerRadius : .8) * outerRadius / h : 0);
|
40596 | }
|
40597 |
|
40598 | translate = "translate(" + x * ratio + "," + y * ratio + ")";
|
40599 | }
|
40600 | }
|
40601 |
|
40602 | return translate;
|
40603 | },
|
40604 | convertToArcData: function convertToArcData(d) {
|
40605 | return this.addName({
|
40606 | id: d.data ? d.data.id : d.id,
|
40607 | value: d.value,
|
40608 | ratio: this.getRatio("arc", d),
|
40609 | index: d.index
|
40610 | });
|
40611 | },
|
40612 | textForArcLabel: function textForArcLabel(selection) {
|
40613 | var $$ = this,
|
40614 | hasGauge = $$.hasType("gauge");
|
40615 |
|
40616 | if ($$.shouldShowArcLabel()) {
|
40617 | selection.style("fill", $$.updateTextColor.bind($$)).attr("filter", $$.updateTextBacgroundColor.bind($$)).each(function (d) {
|
40618 | var node = src_select(this),
|
40619 | updated = $$.updateAngle(d),
|
40620 | ratio = $$.getRatio("arc", updated),
|
40621 | isUnderThreshold = $$.meetsLabelThreshold(ratio, $$.hasType("donut") && "donut" || $$.hasType("gauge") && "gauge" || $$.hasType("pie") && "pie");
|
40622 |
|
40623 | if (isUnderThreshold) {
|
40624 | var value = (updated || d).value,
|
40625 | text = ($$.getArcLabelFormat() || $$.defaultArcValueFormat)(value, ratio, d.data.id).toString();
|
40626 | setTextValue(node, text, [-1, 1], hasGauge);
|
40627 | } else {
|
40628 | node.text("");
|
40629 | }
|
40630 | });
|
40631 | }
|
40632 | },
|
40633 | expandArc: function expandArc(targetIds) {
|
40634 | var $$ = this,
|
40635 | transiting = $$.state.transiting,
|
40636 | $el = $$.$el;
|
40637 |
|
40638 | // MEMO: avoid to cancel transition
|
40639 | if (transiting) {
|
40640 | var interval = setInterval(function () {
|
40641 | if (!transiting) {
|
40642 | clearInterval(interval);
|
40643 | $el.legend.selectAll("." + config_classes.legendItemFocused).size() > 0 && $$.expandArc(targetIds);
|
40644 | }
|
40645 | }, 10);
|
40646 | return;
|
40647 | }
|
40648 |
|
40649 | var newTargetIds = $$.mapToTargetIds(targetIds);
|
40650 | $el.svg.selectAll($$.selectorTargets(newTargetIds, "." + config_classes.chartArc)).each(function (d) {
|
40651 | if (!$$.shouldExpand(d.data.id)) {
|
40652 | return;
|
40653 | }
|
40654 |
|
40655 | var expandDuration = $$.getExpandConfig(d.data.id, "duration"),
|
40656 | svgArcExpandedSub = $$.getSvgArcExpanded($$.getExpandConfig(d.data.id, "rate"));
|
40657 | src_select(this).selectAll("path").transition().duration(expandDuration).attr("d", $$.svgArcExpanded).transition().duration(expandDuration * 2).attr("d", svgArcExpandedSub);
|
40658 | });
|
40659 | },
|
40660 | unexpandArc: function unexpandArc(targetIds) {
|
40661 | var $$ = this,
|
40662 | transiting = $$.state.transiting,
|
40663 | svg = $$.$el.svg;
|
40664 |
|
40665 | if (transiting) {
|
40666 | return;
|
40667 | }
|
40668 |
|
40669 | var newTargetIds = $$.mapToTargetIds(targetIds);
|
40670 | svg.selectAll($$.selectorTargets(newTargetIds, "." + config_classes.chartArc)).selectAll("path").transition().duration(function (d) {
|
40671 | return $$.getExpandConfig(d.data.id, "duration");
|
40672 | }).attr("d", $$.svgArc);
|
40673 | svg.selectAll("" + config_classes.arc).style("opacity", null);
|
40674 | },
|
40675 |
|
40676 | /**
|
40677 | * Get expand config value
|
40678 | * @param {string} id data ID
|
40679 | * @param {string} key config key: 'duration | rate'
|
40680 | * @returns {number}
|
40681 | * @private
|
40682 | */
|
40683 | getExpandConfig: function getExpandConfig(id, key) {
|
40684 | var $$ = this,
|
40685 | config = $$.config,
|
40686 | type;
|
40687 |
|
40688 | if ($$.isDonutType(id)) {
|
40689 | type = "donut";
|
40690 | } else if ($$.isGaugeType(id)) {
|
40691 | type = "gauge";
|
40692 | } else if ($$.isPieType(id)) {
|
40693 | type = "pie";
|
40694 | }
|
40695 |
|
40696 | return type ? config[type + "_expand_" + key] : {
|
40697 | duration: 50,
|
40698 | rate: .98
|
40699 | }[key];
|
40700 | },
|
40701 | shouldExpand: function shouldExpand(id) {
|
40702 | var $$ = this,
|
40703 | config = $$.config;
|
40704 | return $$.isDonutType(id) && config.donut_expand || $$.isGaugeType(id) && config.gauge_expand || $$.isPieType(id) && config.pie_expand;
|
40705 | },
|
40706 | shouldShowArcLabel: function shouldShowArcLabel() {
|
40707 | var $$ = this,
|
40708 | config = $$.config;
|
40709 | return ["pie", "donut", "gauge"].some(function (v) {
|
40710 | return $$.hasType(v) && config[v + "_label_show"];
|
40711 | });
|
40712 | },
|
40713 | getArcLabelFormat: function getArcLabelFormat() {
|
40714 | var $$ = this,
|
40715 | config = $$.config,
|
40716 | format = config.pie_label_format;
|
40717 |
|
40718 | if ($$.hasType("gauge")) {
|
40719 | format = config.gauge_label_format;
|
40720 | } else if ($$.hasType("donut")) {
|
40721 | format = config.donut_label_format;
|
40722 | }
|
40723 |
|
40724 | return isFunction(format) ? format.bind($$.api) : format;
|
40725 | },
|
40726 | getArcTitle: function getArcTitle() {
|
40727 | var $$ = this,
|
40728 | type = $$.hasType("donut") && "donut" || $$.hasType("gauge") && "gauge";
|
40729 | return type ? $$.config[type + "_title"] : "";
|
40730 | },
|
40731 | updateTargetsForArc: function updateTargetsForArc(targets) {
|
40732 | var $$ = this,
|
40733 | $el = $$.$el,
|
40734 | hasGauge = $$.hasType("gauge"),
|
40735 | classChartArc = $$.getChartClass("Arc"),
|
40736 | classArcs = $$.getClass("arcs", !0),
|
40737 | classFocus = $$.classFocus.bind($$),
|
40738 | chartArcs = $el.main.select("." + config_classes.chartArcs),
|
40739 | mainPieUpdate = chartArcs.selectAll("." + config_classes.chartArc).data($$.pie(targets)).attr("class", function (d) {
|
40740 | return classChartArc(d) + classFocus(d.data);
|
40741 | }),
|
40742 | mainPieEnter = mainPieUpdate.enter().append("g").attr("class", classChartArc);
|
40743 | mainPieEnter.append("g").attr("class", classArcs).merge(mainPieUpdate);
|
40744 | mainPieEnter.append("text").attr("dy", hasGauge && !$$.hasMultiTargets() ? "-.1em" : ".35em").style("opacity", "0").style("text-anchor", "middle").style("pointer-events", "none");
|
40745 | $el.text = chartArcs.selectAll("." + config_classes.target + " text"); // MEMO: can not keep same color..., but not bad to update color in redraw
|
40746 | // mainPieUpdate.exit().remove();
|
40747 | },
|
40748 | initArc: function initArc() {
|
40749 | var $$ = this,
|
40750 | $el = $$.$el;
|
40751 | $el.arcs = $el.main.select("." + config_classes.chart).append("g").attr("class", config_classes.chartArcs).attr("transform", $$.getTranslate("arc"));
|
40752 | $$.setArcTitle();
|
40753 | },
|
40754 |
|
40755 | /**
|
40756 | * Set arc title text
|
40757 | * @private
|
40758 | */
|
40759 | setArcTitle: function setArcTitle() {
|
40760 | var $$ = this,
|
40761 | title = $$.getArcTitle(),
|
40762 | hasGauge = $$.hasType("gauge");
|
40763 |
|
40764 | if (title) {
|
40765 | var text = $$.$el.arcs.append("text").attr("class", config_classes[hasGauge ? "chartArcsGaugeTitle" : "chartArcsTitle"]).style("text-anchor", "middle");
|
40766 | hasGauge && text.attr("dy", "-0.3em");
|
40767 | setTextValue(text, title, hasGauge ? undefined : [-.6, 1.35], !0);
|
40768 | }
|
40769 | },
|
40770 | redrawArc: function redrawArc(duration, durationForExit, withTransform) {
|
40771 | var $$ = this,
|
40772 | config = $$.config,
|
40773 | state = $$.state,
|
40774 | main = $$.$el.main,
|
40775 | hasInteraction = config.interaction_enabled,
|
40776 | isSelectable = hasInteraction && config.data_selection_isselectable,
|
40777 | mainArc = main.selectAll("." + config_classes.arcs).selectAll("." + config_classes.arc).data($$.arcData.bind($$));
|
40778 | mainArc.exit().transition().duration(durationForExit).style("opacity", "0").remove();
|
40779 | mainArc = mainArc.enter().append("path").attr("class", $$.getClass("arc", !0)).style("fill", function (d) {
|
40780 | return $$.color(d.data);
|
40781 | }).style("cursor", function (d) {
|
40782 | var _isSelectable;
|
40783 |
|
40784 | return (_isSelectable = isSelectable) != null && _isSelectable.bind != null && _isSelectable.bind($$.api)(d) ? "pointer" : null;
|
40785 | }).style("opacity", "0").each(function (d) {
|
40786 | if ($$.isGaugeType(d.data)) {
|
40787 | d.startAngle = config.gauge_startingAngle;
|
40788 | d.endAngle = config.gauge_startingAngle;
|
40789 | }
|
40790 |
|
40791 | this._current = d;
|
40792 | }).merge(mainArc);
|
40793 |
|
40794 | if ($$.hasType("gauge")) {
|
40795 | $$.updateGaugeMax();
|
40796 | $$.hasMultiArcGauge() && $$.redrawMultiArcGauge();
|
40797 | }
|
40798 |
|
40799 | mainArc.attr("transform", function (d) {
|
40800 | return !$$.isGaugeType(d.data) && withTransform ? "scale(0)" : "";
|
40801 | }).style("opacity", function (d) {
|
40802 | return d === this._current ? "0" : null;
|
40803 | }).each(function () {
|
40804 | state.transiting = !0;
|
40805 | }).transition().duration(duration).attrTween("d", function (d) {
|
40806 | var updated = $$.updateAngle(d);
|
40807 |
|
40808 | if (!updated) {
|
40809 | return function () {
|
40810 | return "M 0 0";
|
40811 | };
|
40812 | }
|
40813 |
|
40814 | if (isNaN(this._current.startAngle)) {
|
40815 | this._current.startAngle = 0;
|
40816 | }
|
40817 |
|
40818 | if (isNaN(this._current.endAngle)) {
|
40819 | this._current.endAngle = this._current.startAngle;
|
40820 | }
|
40821 |
|
40822 | var interpolate = value(this._current, updated);
|
40823 | this._current = interpolate(0);
|
40824 | return function (t) {
|
40825 | var interpolated = interpolate(t);
|
40826 | interpolated.data = d.data; // data.id will be updated by interporator
|
40827 |
|
40828 | return $$.getArc(interpolated, !0);
|
40829 | };
|
40830 | }).attr("transform", withTransform ? "scale(1)" : "").style("fill", function (d) {
|
40831 | var color;
|
40832 |
|
40833 | if ($$.levelColor) {
|
40834 | color = $$.levelColor(d.data.values[0].value); // update data's color
|
40835 |
|
40836 | config.data_colors[d.data.id] = color;
|
40837 | } else {
|
40838 | color = $$.color(d.data);
|
40839 | }
|
40840 |
|
40841 | return color;
|
40842 | }) // Where gauge reading color would receive customization.
|
40843 | .style("opacity", null).call(endall, function () {
|
40844 | if ($$.levelColor) {
|
40845 | var path = src_select(this),
|
40846 | d = path.datum();
|
40847 | $$.updateLegendItemColor(d.data.id, path.style("fill"));
|
40848 | }
|
40849 |
|
40850 | state.transiting = !1;
|
40851 | callFn(config.onrendered, $$.api);
|
40852 | }); // bind arc events
|
40853 |
|
40854 | hasInteraction && $$.bindArcEvent(mainArc);
|
40855 | $$.hasType("gauge") && $$.redrawBackgroundArcs();
|
40856 | $$.redrawArcText(duration);
|
40857 | },
|
40858 | redrawBackgroundArcs: function redrawBackgroundArcs() {
|
40859 | var $$ = this,
|
40860 | config = $$.config,
|
40861 | state = $$.state,
|
40862 | hasMultiArcGauge = $$.hasMultiArcGauge(),
|
40863 | isFullCircle = config.gauge_fullCircle,
|
40864 | startAngle = $$.getStartAngle(),
|
40865 | endAngle = isFullCircle ? startAngle + $$.getArcLength() : startAngle * -1,
|
40866 | backgroundArc = $$.$el.arcs.select((hasMultiArcGauge ? "g" : "") + "." + config_classes.chartArcsBackground);
|
40867 |
|
40868 | if (hasMultiArcGauge) {
|
40869 | var index = 0;
|
40870 | backgroundArc = backgroundArc.selectAll("path." + config_classes.chartArcsBackground).data($$.data.targets);
|
40871 | backgroundArc.enter().append("path").attr("class", function (d, i) {
|
40872 | return config_classes.chartArcsBackground + " " + config_classes.chartArcsBackground + "-" + i;
|
40873 | }).merge(backgroundArc).style("fill", config.gauge_background || null).attr("d", function (_ref2) {
|
40874 | var id = _ref2.id;
|
40875 |
|
40876 | if (state.hiddenTargetIds.indexOf(id) >= 0) {
|
40877 | return "M 0 0";
|
40878 | }
|
40879 |
|
40880 | var d = {
|
40881 | data: [{
|
40882 | value: config.gauge_max
|
40883 | }],
|
40884 | startAngle: startAngle,
|
40885 | endAngle: endAngle,
|
40886 | index: index++
|
40887 | };
|
40888 | return $$.getArc(d, !0, !0);
|
40889 | });
|
40890 | backgroundArc.exit().remove();
|
40891 | } else {
|
40892 | backgroundArc.attr("d", function () {
|
40893 | var d = {
|
40894 | data: [{
|
40895 | value: config.gauge_max
|
40896 | }],
|
40897 | startAngle: startAngle,
|
40898 | endAngle: endAngle
|
40899 | };
|
40900 | return $$.getArc(d, !0, !0);
|
40901 | });
|
40902 | }
|
40903 | },
|
40904 | bindArcEvent: function bindArcEvent(arc) {
|
40905 | var $$ = this,
|
40906 | config = $$.config,
|
40907 | state = $$.state,
|
40908 | isTouch = state.inputType === "touch",
|
40909 | isMouse = state.inputType === "mouse";
|
40910 |
|
40911 | // eslint-disable-next-line
|
40912 | function selectArc(_this, arcData, id) {
|
40913 | // transitions
|
40914 | $$.expandArc(id);
|
40915 | $$.api.focus(id);
|
40916 | $$.toggleFocusLegend(id, !0);
|
40917 | $$.showTooltip([arcData], _this);
|
40918 | } // eslint-disable-next-line
|
40919 |
|
40920 |
|
40921 | function unselectArc(arcData) {
|
40922 | var id = (arcData == null ? void 0 : arcData.id) || undefined;
|
40923 | $$.unexpandArc(id);
|
40924 | $$.api.revert();
|
40925 | $$.revertLegend();
|
40926 | $$.hideTooltip();
|
40927 | }
|
40928 |
|
40929 | arc.on("click", function (event, d, i) {
|
40930 | var updated = $$.updateAngle(d),
|
40931 | arcData;
|
40932 |
|
40933 | if (updated) {
|
40934 | arcData = $$.convertToArcData(updated);
|
40935 | $$.toggleShape == null ? void 0 : $$.toggleShape(this, arcData, i);
|
40936 | config.data_onclick.bind($$.api)(arcData, this);
|
40937 | }
|
40938 | }); // mouse events
|
40939 |
|
40940 | if (isMouse) {
|
40941 | arc.on("mouseover", function (event, d) {
|
40942 | var _arcData;
|
40943 |
|
40944 | if (state.transiting) {
|
40945 | // skip while transiting
|
40946 | return;
|
40947 | }
|
40948 |
|
40949 | state.event = event;
|
40950 | var updated = $$.updateAngle(d),
|
40951 | arcData = updated ? $$.convertToArcData(updated) : null,
|
40952 | id = ((_arcData = arcData) == null ? void 0 : _arcData.id) || undefined;
|
40953 | selectArc(this, arcData, id);
|
40954 | $$.setOverOut(!0, arcData);
|
40955 | }).on("mouseout", function (event, d) {
|
40956 | if (state.transiting) {
|
40957 | // skip while transiting
|
40958 | return;
|
40959 | }
|
40960 |
|
40961 | state.event = event;
|
40962 | var updated = $$.updateAngle(d),
|
40963 | arcData = updated ? $$.convertToArcData(updated) : null;
|
40964 | unselectArc();
|
40965 | $$.setOverOut(!1, arcData);
|
40966 | }).on("mousemove", function (event, d) {
|
40967 | var updated = $$.updateAngle(d),
|
40968 | arcData = updated ? $$.convertToArcData(updated) : null;
|
40969 | state.event = event;
|
40970 | $$.showTooltip([arcData], this);
|
40971 | });
|
40972 | } // touch events
|
40973 |
|
40974 |
|
40975 | if (isTouch && $$.hasArcType() && !$$.radars) {
|
40976 | var getEventArc = function (event) {
|
40977 | var touch = event.changedTouches[0],
|
40978 | eventArc = src_select(browser_doc.elementFromPoint(touch.clientX, touch.clientY));
|
40979 | return eventArc;
|
40980 | };
|
40981 |
|
40982 | $$.$el.svg.on("touchstart touchmove", function (event) {
|
40983 | var _datum, _arcData2;
|
40984 |
|
40985 | if (state.transiting) {
|
40986 | // skip while transiting
|
40987 | return;
|
40988 | }
|
40989 |
|
40990 | var eventArc = getEventArc(event),
|
40991 | datum = eventArc.datum(),
|
40992 | updated = (_datum = datum) != null && _datum.data && datum.data.id ? $$.updateAngle(datum) : null,
|
40993 | arcData = updated ? $$.convertToArcData(updated) : null,
|
40994 | id = ((_arcData2 = arcData) == null ? void 0 : _arcData2.id) || undefined;
|
40995 | $$.callOverOutForTouch(arcData);
|
40996 | isUndefined(id) ? unselectArc() : selectArc(this, arcData, id);
|
40997 | });
|
40998 | }
|
40999 | },
|
41000 | redrawArcText: function redrawArcText(duration) {
|
41001 | var $$ = this,
|
41002 | config = $$.config,
|
41003 | state = $$.state,
|
41004 | _$$$$el = $$.$el,
|
41005 | main = _$$$$el.main,
|
41006 | arcs = _$$$$el.arcs,
|
41007 | hasGauge = $$.hasType("gauge"),
|
41008 | hasMultiArcGauge = $$.hasMultiArcGauge(),
|
41009 | text;
|
41010 |
|
41011 | // for gauge type, update text when has no title & multi data
|
41012 | if (!(hasGauge && $$.data.targets.length === 1 && config.gauge_title)) {
|
41013 | text = main.selectAll("." + config_classes.chartArc).select("text").style("opacity", "0").attr("class", function (d) {
|
41014 | return $$.isGaugeType(d.data) ? config_classes.gaugeValue : null;
|
41015 | }).call($$.textForArcLabel.bind($$)).attr("transform", $$.transformForArcLabel.bind($$)).style("font-size", function (d) {
|
41016 | return $$.isGaugeType(d.data) && $$.data.targets.length === 1 && !hasMultiArcGauge ? Math.round(state.radius / 5) + "px" : null;
|
41017 | }).transition().duration(duration).style("opacity", function (d) {
|
41018 | return $$.isTargetToShow(d.data.id) && $$.isArcType(d.data) ? null : "0";
|
41019 | });
|
41020 | hasMultiArcGauge && text.attr("dy", "-.1em");
|
41021 | }
|
41022 |
|
41023 | main.select("." + config_classes.chartArcsTitle).style("opacity", $$.hasType("donut") || hasGauge ? null : "0");
|
41024 |
|
41025 | if (hasGauge) {
|
41026 | var _text,
|
41027 | isFullCircle = config.gauge_fullCircle;
|
41028 |
|
41029 | isFullCircle && ((_text = text) == null ? void 0 : _text.attr("dy", "" + (hasMultiArcGauge ? 0 : Math.round(state.radius / 14))));
|
41030 |
|
41031 | if (config.gauge_label_show) {
|
41032 | arcs.select("." + config_classes.chartArcsGaugeUnit).attr("dy", (isFullCircle ? 1.5 : .75) + "em").text(config.gauge_units);
|
41033 | 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)); // show max text when isn't fullCircle
|
41034 |
|
41035 | 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));
|
41036 | }
|
41037 | }
|
41038 | }
|
41039 | });
|
41040 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/point.js
|
41041 | function point_x(p) {
|
41042 | return p[0];
|
41043 | }
|
41044 | function point_y(p) {
|
41045 | return p[1];
|
41046 | }
|
41047 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/line.js
|
41048 |
|
41049 |
|
41050 |
|
41051 |
|
41052 |
|
41053 | /* harmony default export */ function src_line(x, y) {
|
41054 | var defined = d3_shape_src_constant(!0),
|
41055 | context = null,
|
41056 | curve = curve_linear,
|
41057 | output = null;
|
41058 | x = typeof x === "function" ? x : x === undefined ? point_x : d3_shape_src_constant(x);
|
41059 | y = typeof y === "function" ? y : y === undefined ? point_y : d3_shape_src_constant(y);
|
41060 |
|
41061 | function line(data) {
|
41062 | var i,
|
41063 | n = (data = d3_shape_src_array(data)).length,
|
41064 | d,
|
41065 | defined0 = !1,
|
41066 | buffer;
|
41067 | if (context == null) output = curve(buffer = src_path());
|
41068 |
|
41069 | for (i = 0; i <= n; ++i) {
|
41070 | if (!(i < n && defined(d = data[i], i, data)) === defined0) {
|
41071 | if (defined0 = !defined0) output.lineStart();else output.lineEnd();
|
41072 | }
|
41073 |
|
41074 | if (defined0) output.point(+x(d, i, data), +y(d, i, data));
|
41075 | }
|
41076 |
|
41077 | if (buffer) return output = null, buffer + "" || null;
|
41078 | }
|
41079 |
|
41080 | line.x = function (_) {
|
41081 | return arguments.length ? (x = typeof _ === "function" ? _ : d3_shape_src_constant(+_), line) : x;
|
41082 | };
|
41083 |
|
41084 | line.y = function (_) {
|
41085 | return arguments.length ? (y = typeof _ === "function" ? _ : d3_shape_src_constant(+_), line) : y;
|
41086 | };
|
41087 |
|
41088 | line.defined = function (_) {
|
41089 | return arguments.length ? (defined = typeof _ === "function" ? _ : d3_shape_src_constant(!!_), line) : defined;
|
41090 | };
|
41091 |
|
41092 | line.curve = function (_) {
|
41093 | return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;
|
41094 | };
|
41095 |
|
41096 | line.context = function (_) {
|
41097 | return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;
|
41098 | };
|
41099 |
|
41100 | return line;
|
41101 | }
|
41102 | ;// CONCATENATED MODULE: ./node_modules/d3-shape/src/area.js
|
41103 |
|
41104 |
|
41105 |
|
41106 |
|
41107 |
|
41108 |
|
41109 | /* harmony default export */ function src_area(x0, y0, y1) {
|
41110 | var x1 = null,
|
41111 | defined = d3_shape_src_constant(!0),
|
41112 | context = null,
|
41113 | curve = curve_linear,
|
41114 | output = null;
|
41115 | x0 = typeof x0 === "function" ? x0 : x0 === undefined ? point_x : d3_shape_src_constant(+x0);
|
41116 | y0 = typeof y0 === "function" ? y0 : y0 === undefined ? d3_shape_src_constant(0) : d3_shape_src_constant(+y0);
|
41117 | y1 = typeof y1 === "function" ? y1 : y1 === undefined ? point_y : d3_shape_src_constant(+y1);
|
41118 |
|
41119 | function area(data) {
|
41120 | var i,
|
41121 | j,
|
41122 | k,
|
41123 | n = (data = d3_shape_src_array(data)).length,
|
41124 | d,
|
41125 | defined0 = !1,
|
41126 | buffer,
|
41127 | x0z = Array(n),
|
41128 | y0z = Array(n);
|
41129 | if (context == null) output = curve(buffer = src_path());
|
41130 |
|
41131 | for (i = 0; i <= n; ++i) {
|
41132 | if (!(i < n && defined(d = data[i], i, data)) === defined0) {
|
41133 | if (defined0 = !defined0) {
|
41134 | j = i;
|
41135 | output.areaStart();
|
41136 | output.lineStart();
|
41137 | } else {
|
41138 | output.lineEnd();
|
41139 | output.lineStart();
|
41140 |
|
41141 | for (k = i - 1; k >= j; --k) {
|
41142 | output.point(x0z[k], y0z[k]);
|
41143 | }
|
41144 |
|
41145 | output.lineEnd();
|
41146 | output.areaEnd();
|
41147 | }
|
41148 | }
|
41149 |
|
41150 | if (defined0) {
|
41151 | x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);
|
41152 | output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);
|
41153 | }
|
41154 | }
|
41155 |
|
41156 | if (buffer) return output = null, buffer + "" || null;
|
41157 | }
|
41158 |
|
41159 | function arealine() {
|
41160 | return src_line().defined(defined).curve(curve).context(context);
|
41161 | }
|
41162 |
|
41163 | area.x = function (_) {
|
41164 | return arguments.length ? (x0 = typeof _ === "function" ? _ : d3_shape_src_constant(+_), x1 = null, area) : x0;
|
41165 | };
|
41166 |
|
41167 | area.x0 = function (_) {
|
41168 | return arguments.length ? (x0 = typeof _ === "function" ? _ : d3_shape_src_constant(+_), area) : x0;
|
41169 | };
|
41170 |
|
41171 | area.x1 = function (_) {
|
41172 | return arguments.length ? (x1 = _ == null ? null : typeof _ === "function" ? _ : d3_shape_src_constant(+_), area) : x1;
|
41173 | };
|
41174 |
|
41175 | area.y = function (_) {
|
41176 | return arguments.length ? (y0 = typeof _ === "function" ? _ : d3_shape_src_constant(+_), y1 = null, area) : y0;
|
41177 | };
|
41178 |
|
41179 | area.y0 = function (_) {
|
41180 | return arguments.length ? (y0 = typeof _ === "function" ? _ : d3_shape_src_constant(+_), area) : y0;
|
41181 | };
|
41182 |
|
41183 | area.y1 = function (_) {
|
41184 | return arguments.length ? (y1 = _ == null ? null : typeof _ === "function" ? _ : d3_shape_src_constant(+_), area) : y1;
|
41185 | };
|
41186 |
|
41187 | area.lineX0 = area.lineY0 = function () {
|
41188 | return arealine().x(x0).y(y0);
|
41189 | };
|
41190 |
|
41191 | area.lineY1 = function () {
|
41192 | return arealine().x(x0).y(y1);
|
41193 | };
|
41194 |
|
41195 | area.lineX1 = function () {
|
41196 | return arealine().x(x1).y(y0);
|
41197 | };
|
41198 |
|
41199 | area.defined = function (_) {
|
41200 | return arguments.length ? (defined = typeof _ === "function" ? _ : d3_shape_src_constant(!!_), area) : defined;
|
41201 | };
|
41202 |
|
41203 | area.curve = function (_) {
|
41204 | return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;
|
41205 | };
|
41206 |
|
41207 | area.context = function (_) {
|
41208 | return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;
|
41209 | };
|
41210 |
|
41211 | return area;
|
41212 | }
|
41213 | ;// CONCATENATED MODULE: ./src/ChartInternal/shape/area.ts
|
41214 | /**
|
41215 | * Copyright (c) 2017 ~ present NAVER Corp.
|
41216 | * billboard.js project is licensed under the MIT license
|
41217 | */
|
41218 |
|
41219 |
|
41220 |
|
41221 |
|
41222 | /* harmony default export */ var shape_area = ({
|
41223 | initArea: function initArea(mainLine) {
|
41224 | var $$ = this,
|
41225 | config = $$.config;
|
41226 | mainLine.insert("g", "." + config_classes[config.area_front ? "circles" : "lines"]).attr("class", $$.getClass("areas", !0));
|
41227 | },
|
41228 | updateAreaGradient: function updateAreaGradient() {
|
41229 | var $$ = this,
|
41230 | config = $$.config,
|
41231 | datetimeId = $$.state.datetimeId,
|
41232 | defs = $$.$el.defs;
|
41233 | $$.data.targets.forEach(function (d) {
|
41234 | var id = datetimeId + "-areaGradient" + $$.getTargetSelectorSuffix(d.id);
|
41235 |
|
41236 | if ($$.isAreaType(d) && defs.select("#" + id).empty()) {
|
41237 | var color = $$.color(d),
|
41238 | _config$area_linearGr = config.area_linearGradient,
|
41239 | _config$area_linearGr2 = _config$area_linearGr.x,
|
41240 | x = _config$area_linearGr2 === void 0 ? [0, 0] : _config$area_linearGr2,
|
41241 | _config$area_linearGr3 = _config$area_linearGr.y,
|
41242 | y = _config$area_linearGr3 === void 0 ? [0, 1] : _config$area_linearGr3,
|
41243 | _config$area_linearGr4 = _config$area_linearGr.stops,
|
41244 | stops = _config$area_linearGr4 === void 0 ? [[0, color, 1], [1, color, 0]] : _config$area_linearGr4,
|
41245 | linearGradient = defs.append("linearGradient").attr("id", "" + id).attr("x1", x[0]).attr("x2", x[1]).attr("y1", y[0]).attr("y2", y[1]);
|
41246 | stops.forEach(function (v) {
|
41247 | var stopColor = isFunction(v[1]) ? v[1].bind($$.api)(d.id) : v[1];
|
41248 | linearGradient.append("stop").attr("offset", v[0]).attr("stop-color", stopColor || color).attr("stop-opacity", v[2]);
|
41249 | });
|
41250 | }
|
41251 | });
|
41252 | },
|
41253 | updateAreaColor: function updateAreaColor(d) {
|
41254 | var $$ = this;
|
41255 | return $$.config.area_linearGradient ? "url(#" + $$.state.datetimeId + "-areaGradient" + $$.getTargetSelectorSuffix(d.id) + ")" : $$.color(d);
|
41256 | },
|
41257 |
|
41258 | /**
|
41259 | * Generate/Update elements
|
41260 | * @param {boolean} withTransition Transition for exit elements
|
41261 | * @param {boolean} isSub Subchart draw
|
41262 | * @private
|
41263 | */
|
41264 | updateArea: function updateArea(withTransition, isSub) {
|
41265 | if (isSub === void 0) {
|
41266 | isSub = !1;
|
41267 | }
|
41268 |
|
41269 | var $$ = this,
|
41270 | config = $$.config,
|
41271 | state = $$.state,
|
41272 | $el = $$.$el,
|
41273 | $T = $$.$T,
|
41274 | $root = isSub ? $el.subchart : $el;
|
41275 | config.area_linearGradient && $$.updateAreaGradient();
|
41276 | var area = $root.main.selectAll("." + config_classes.areas).selectAll("." + config_classes.area).data($$.lineData.bind($$));
|
41277 | $T(area.exit(), withTransition).style("opacity", "0").remove();
|
41278 | $root.area = area.enter().append("path").attr("class", $$.getClass("area", !0)).style("fill", $$.updateAreaColor.bind($$)).style("opacity", function () {
|
41279 | state.orgAreaOpacity = src_select(this).style("opacity");
|
41280 | return "0";
|
41281 | }).merge(area);
|
41282 | area.style("opacity", state.orgAreaOpacity);
|
41283 | },
|
41284 |
|
41285 | /**
|
41286 | * Redraw function
|
41287 | * @param {Function} drawFn Retuned functino from .generateDrawCandlestick()
|
41288 | * @param {boolean} withTransition With or without transition
|
41289 | * @param {boolean} isSub Subchart draw
|
41290 | * @returns {Array}
|
41291 | */
|
41292 | redrawArea: function redrawArea(drawFn, withTransition, isSub) {
|
41293 | if (isSub === void 0) {
|
41294 | isSub = !1;
|
41295 | }
|
41296 |
|
41297 | var $$ = this,
|
41298 | _ref = isSub ? this.$el.subchart : this.$el,
|
41299 | area = _ref.area,
|
41300 | orgAreaOpacity = $$.state.orgAreaOpacity;
|
41301 |
|
41302 | return [$$.$T(area, withTransition, getRandom()).attr("d", drawFn).style("fill", $$.updateAreaColor.bind($$)).style("opacity", function (d) {
|
41303 | return ($$.isAreaRangeType(d) ? orgAreaOpacity / 1.75 : orgAreaOpacity) + "";
|
41304 | })];
|
41305 | },
|
41306 |
|
41307 | /**
|
41308 | * Generate area path data
|
41309 | * @param {object} areaIndices Indices
|
41310 | * @param {boolean} isSub Weather is sub axis
|
41311 | * @returns {Function}
|
41312 | * @private
|
41313 | */
|
41314 | generateDrawArea: function generateDrawArea(areaIndices, isSub) {
|
41315 | var $$ = this,
|
41316 | config = $$.config,
|
41317 | lineConnectNull = config.line_connectNull,
|
41318 | isRotated = config.axis_rotated,
|
41319 | getPoints = $$.generateGetAreaPoints(areaIndices, isSub),
|
41320 | yScale = $$.getYScaleById.bind($$),
|
41321 | xValue = function (d) {
|
41322 | return (isSub ? $$.subxx : $$.xx).call($$, d);
|
41323 | },
|
41324 | value0 = function (d, i) {
|
41325 | return $$.isGrouped(d.id) ? getPoints(d, i)[0][1] : yScale(d.id, isSub)($$.isAreaRangeType(d) ? $$.getRangedData(d, "high") : $$.getShapeYMin(d.id));
|
41326 | },
|
41327 | value1 = function (d, i) {
|
41328 | return $$.isGrouped(d.id) ? getPoints(d, i)[1][1] : yScale(d.id, isSub)($$.isAreaRangeType(d) ? $$.getRangedData(d, "low") : d.value);
|
41329 | };
|
41330 |
|
41331 | return function (d) {
|
41332 | var values = lineConnectNull ? $$.filterRemoveNull(d.values) : d.values,
|
41333 | x0 = 0,
|
41334 | y0 = 0,
|
41335 | path;
|
41336 |
|
41337 | if ($$.isAreaType(d)) {
|
41338 | var area = src_area();
|
41339 | area = isRotated ? area.y(xValue).x0(value0).x1(value1) : area.x(xValue) // @ts-ignore
|
41340 | .y0(config.area_above ? 0 : value0).y1(value1);
|
41341 |
|
41342 | if (!lineConnectNull) {
|
41343 | area = area.defined(function (d) {
|
41344 | return $$.getBaseValue(d) !== null;
|
41345 | });
|
41346 | }
|
41347 |
|
41348 | if ($$.isStepType(d)) {
|
41349 | values = $$.convertValuesToStep(values);
|
41350 | }
|
41351 |
|
41352 | path = area.curve($$.getCurve(d))(values);
|
41353 | } else {
|
41354 | if (values[0]) {
|
41355 | x0 = $$.scale.x(values[0].x);
|
41356 | y0 = $$.getYScaleById(d.id)(values[0].value);
|
41357 | }
|
41358 |
|
41359 | path = isRotated ? "M " + y0 + " " + x0 : "M " + x0 + " " + y0;
|
41360 | }
|
41361 |
|
41362 | return path || "M 0 0";
|
41363 | };
|
41364 | },
|
41365 | generateGetAreaPoints: function generateGetAreaPoints(areaIndices, isSub) {
|
41366 | // partial duplication of generateGetBarPoints
|
41367 | var $$ = this,
|
41368 | config = $$.config,
|
41369 | x = $$.getShapeX(0, areaIndices, isSub),
|
41370 | y = $$.getShapeY(!!isSub),
|
41371 | areaOffset = $$.getShapeOffset($$.isAreaType, areaIndices, isSub),
|
41372 | yScale = $$.getYScaleById.bind($$);
|
41373 | return function (d, i) {
|
41374 | var y0 = yScale.call($$, d.id, isSub)($$.getShapeYMin(d.id)),
|
41375 | offset = areaOffset(d, i) || y0,
|
41376 | posX = x(d),
|
41377 | posY = y(d);
|
41378 |
|
41379 | // fix posY not to overflow opposite quadrant
|
41380 | if (config.axis_rotated && (d.value > 0 && posY < y0 || d.value < 0 && y0 < posY)) {
|
41381 | posY = y0;
|
41382 | } // 1 point that marks the area position
|
41383 |
|
41384 |
|
41385 | return [[posX, offset], [posX, posY - (y0 - offset)], [posX, posY - (y0 - offset)], // needed for compatibility
|
41386 | [posX, offset] // needed for compatibility
|
41387 | ];
|
41388 | };
|
41389 | }
|
41390 | });
|
41391 | ;// CONCATENATED MODULE: ./src/ChartInternal/shape/bar.ts
|
41392 | /**
|
41393 | * Copyright (c) 2017 ~ present NAVER Corp.
|
41394 | * billboard.js project is licensed under the MIT license
|
41395 | */
|
41396 |
|
41397 |
|
41398 | /* harmony default export */ var bar = ({
|
41399 | initBar: function initBar() {
|
41400 | var $el = this.$el,
|
41401 | config = this.config,
|
41402 | clip = this.state.clip;
|
41403 | $el.bar = $el.main.select("." + config_classes.chart) // should positioned at the beginning of the shape node to not overlap others
|
41404 | .insert("g", ":first-child").attr("class", config_classes.chartBars); // set clip-path attribute when condition meet
|
41405 | // https://github.com/naver/billboard.js/issues/2421
|
41406 |
|
41407 | if (config.clipPath === !1 && (config.bar_radius || config.bar_radius_ratio)) {
|
41408 | $el.bar.attr("clip-path", clip.pathXAxis.replace(/#[^)]*/, "#" + clip.id));
|
41409 | }
|
41410 | },
|
41411 | updateTargetsForBar: function updateTargetsForBar(targets) {
|
41412 | var $$ = this,
|
41413 | config = $$.config,
|
41414 | $el = $$.$el,
|
41415 | classChartBar = $$.getChartClass("Bar"),
|
41416 | classBars = $$.getClass("bars", !0),
|
41417 | classFocus = $$.classFocus.bind($$),
|
41418 | isSelectable = config.interaction_enabled && config.data_selection_isselectable;
|
41419 |
|
41420 | if (!$el.bar) {
|
41421 | $$.initBar();
|
41422 | }
|
41423 |
|
41424 | var mainBarUpdate = $$.$el.main.select("." + config_classes.chartBars).selectAll("." + config_classes.chartBar).data( // remove
|
41425 | targets.filter(function (v) {
|
41426 | return !v.values.every(function (d) {
|
41427 | return !isNumber(d.value);
|
41428 | });
|
41429 | })).attr("class", function (d) {
|
41430 | return classChartBar(d) + classFocus(d);
|
41431 | }),
|
41432 | mainBarEnter = mainBarUpdate.enter().append("g").attr("class", classChartBar).style("opacity", "0").style("pointer-events", "none");
|
41433 | // Bars for each data
|
41434 | mainBarEnter.append("g").attr("class", classBars).style("cursor", function (d) {
|
41435 | var _isSelectable;
|
41436 |
|
41437 | return (_isSelectable = isSelectable) != null && _isSelectable.bind != null && _isSelectable.bind($$.api)(d) ? "pointer" : null;
|
41438 | });
|
41439 | },
|
41440 |
|
41441 | /**
|
41442 | * Generate/Update elements
|
41443 | * @param {boolean} withTransition Transition for exit elements
|
41444 | * @param {boolean} isSub Subchart draw
|
41445 | * @private
|
41446 | */
|
41447 | updateBar: function updateBar(withTransition, isSub) {
|
41448 | if (isSub === void 0) {
|
41449 | isSub = !1;
|
41450 | }
|
41451 |
|
41452 | var $$ = this,
|
41453 | $el = $$.$el,
|
41454 | $T = $$.$T,
|
41455 | $root = isSub ? $el.subchart : $el,
|
41456 | classBar = $$.getClass("bar", !0),
|
41457 | initialOpacity = $$.initialOpacity.bind($$),
|
41458 | bar = $root.main.selectAll("." + config_classes.bars).selectAll("." + config_classes.bar).data($$.labelishData.bind($$));
|
41459 | $T(bar.exit(), withTransition).style("opacity", "0").remove();
|
41460 | $root.bar = bar.enter().append("path").attr("class", classBar).style("fill", $$.color).merge(bar).style("opacity", initialOpacity);
|
41461 | },
|
41462 |
|
41463 | /**
|
41464 | * Redraw function
|
41465 | * @param {Function} drawFn Retuned functino from .generateDrawCandlestick()
|
41466 | * @param {boolean} withTransition With or without transition
|
41467 | * @param {boolean} isSub Subchart draw
|
41468 | * @returns {Array}
|
41469 | */
|
41470 | redrawBar: function redrawBar(drawFn, withTransition, isSub) {
|
41471 | if (isSub === void 0) {
|
41472 | isSub = !1;
|
41473 | }
|
41474 |
|
41475 | var $$ = this,
|
41476 | _ref = isSub ? $$.$el.subchart : $$.$el,
|
41477 | bar = _ref.bar;
|
41478 |
|
41479 | return [$$.$T(bar, withTransition, getRandom()).attr("d", function (d) {
|
41480 | return isNumber(d.value) && drawFn(d);
|
41481 | }).style("fill", this.color).style("opacity", null)];
|
41482 | },
|
41483 | generateDrawBar: function generateDrawBar(barIndices, isSub) {
|
41484 | var $$ = this,
|
41485 | config = $$.config,
|
41486 | getPoints = $$.generateGetBarPoints(barIndices, isSub),
|
41487 | isRotated = config.axis_rotated,
|
41488 | isGrouped = config.data_groups.length,
|
41489 | barRadius = config.bar_radius,
|
41490 | barRadiusRatio = config.bar_radius_ratio,
|
41491 | getRadius = isNumber(barRadius) && barRadius > 0 ? function () {
|
41492 | return barRadius;
|
41493 | } : isNumber(barRadiusRatio) ? function (w) {
|
41494 | return w * barRadiusRatio;
|
41495 | } : null;
|
41496 | return function (d, i) {
|
41497 | // 4 points that make a bar
|
41498 | var points = getPoints(d, i),
|
41499 | indexX = +isRotated,
|
41500 | indexY = +!indexX,
|
41501 | isNegative = d.value < 0,
|
41502 | pathRadius = ["", ""],
|
41503 | radius = 0; // switch points if axis is rotated, not applicable for sub chart
|
41504 |
|
41505 | if (d.value !== 0 && getRadius && !isGrouped) {
|
41506 | var index = isRotated ? indexY : indexX,
|
41507 | barW = points[2][index] - points[0][index];
|
41508 | radius = getRadius(barW);
|
41509 | var arc = "a" + radius + "," + radius + " " + (isNegative ? "1 0 0" : "0 0 1") + " ";
|
41510 | pathRadius[+!isRotated] = "" + arc + radius + "," + radius;
|
41511 | pathRadius[+isRotated] = "" + arc + [-radius, radius][isRotated ? "sort" : "reverse"]();
|
41512 | isNegative && pathRadius.reverse();
|
41513 | } // path string data shouldn't be containing new line chars
|
41514 | // https://github.com/naver/billboard.js/issues/530
|
41515 |
|
41516 |
|
41517 | 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];
|
41518 | return "M" + points[0][indexX] + "," + points[0][indexY] + path + "z";
|
41519 | };
|
41520 | },
|
41521 | generateGetBarPoints: function generateGetBarPoints(barIndices, isSub) {
|
41522 | var $$ = this,
|
41523 | config = $$.config,
|
41524 | axis = isSub ? $$.axis.subX : $$.axis.x,
|
41525 | barTargetsNum = $$.getIndicesMax(barIndices) + 1,
|
41526 | barW = $$.getBarW("bar", axis, barTargetsNum),
|
41527 | barX = $$.getShapeX(barW, barIndices, !!isSub),
|
41528 | barY = $$.getShapeY(!!isSub),
|
41529 | barOffset = $$.getShapeOffset($$.isBarType, barIndices, !!isSub),
|
41530 | yScale = $$.getYScaleById.bind($$);
|
41531 | return function (d, i) {
|
41532 | var y0 = yScale.call($$, d.id, isSub)($$.getShapeYMin(d.id)),
|
41533 | offset = barOffset(d, i) || y0,
|
41534 | width = isNumber(barW) ? barW : barW[d.id] || barW._$width,
|
41535 | posX = barX(d),
|
41536 | posY = barY(d);
|
41537 |
|
41538 | // fix posY not to overflow opposite quadrant
|
41539 | if (config.axis_rotated && (d.value > 0 && posY < y0 || d.value < 0 && y0 < posY)) {
|
41540 | posY = y0;
|
41541 | }
|
41542 |
|
41543 | posY -= y0 - offset;
|
41544 | var startPosX = posX + width; // 4 points that make a bar
|
41545 |
|
41546 | return [[posX, offset], [posX, posY], [startPosX, posY], [startPosX, offset]];
|
41547 | };
|
41548 | },
|
41549 | isWithinBar: function isWithinBar(that) {
|
41550 | var mouse = getPointer(this.state.event, that),
|
41551 | list = getRectSegList(that),
|
41552 | _list = list,
|
41553 | seg0 = _list[0],
|
41554 | seg1 = _list[1],
|
41555 | x = Math.min(seg0.x, seg1.x),
|
41556 | y = Math.min(seg0.y, seg1.y),
|
41557 | offset = this.config.bar_sensitivity,
|
41558 | _that$getBBox = that.getBBox(),
|
41559 | width = _that$getBBox.width,
|
41560 | height = _that$getBBox.height,
|
41561 | isWithin = x - offset < mouse[0] && mouse[0] < x + width + offset && y - offset < mouse[1] && mouse[1] < y + height + offset;
|
41562 |
|
41563 | return isWithin;
|
41564 | }
|
41565 | });
|
41566 | ;// CONCATENATED MODULE: ./src/ChartInternal/shape/candlestick.ts
|
41567 |
|
41568 |
|
41569 | function candlestick_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
41570 |
|
41571 | function candlestick_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { candlestick_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { candlestick_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
41572 |
|
41573 | /**
|
41574 | * Copyright (c) 2017 ~ present NAVER Corp.
|
41575 | * billboard.js project is licensed under the MIT license
|
41576 | */
|
41577 |
|
41578 |
|
41579 |
|
41580 | /* harmony default export */ var candlestick = ({
|
41581 | initCandlestick: function initCandlestick() {
|
41582 | var $el = this.$el;
|
41583 | $el.candlestick = $el.main.select("." + config_classes.chart) // should positioned at the beginning of the shape node to not overlap others
|
41584 | .append("g").attr("class", config_classes.chartCandlesticks);
|
41585 | },
|
41586 |
|
41587 | /**
|
41588 | * Update targets by its data
|
41589 | * called from: ChartInternal.updateTargets()
|
41590 | * @param {Array} targets Filtered target by type
|
41591 | * @private
|
41592 | */
|
41593 | updateTargetsForCandlestick: function updateTargetsForCandlestick(targets) {
|
41594 | var $$ = this,
|
41595 | $el = $$.$el,
|
41596 | classChart = $$.getChartClass("Candlestick"),
|
41597 | classFocus = $$.classFocus.bind($$);
|
41598 |
|
41599 | if (!$el.candlestick) {
|
41600 | $$.initCandlestick();
|
41601 | }
|
41602 |
|
41603 | var mainUpdate = $$.$el.main.select("." + config_classes.chartCandlesticks).selectAll("." + config_classes.chartCandlestick).data(targets).attr("class", function (d) {
|
41604 | return classChart(d) + classFocus(d);
|
41605 | });
|
41606 | mainUpdate.enter().append("g").attr("class", classChart).style("pointer-events", "none");
|
41607 | },
|
41608 |
|
41609 | /**
|
41610 | * Generate/Update elements
|
41611 | * @param {boolean} withTransition Transition for exit elements
|
41612 | * @param {boolean} isSub Subchart draw
|
41613 | * @private
|
41614 | */
|
41615 | updateCandlestick: function updateCandlestick(withTransition, isSub) {
|
41616 | if (isSub === void 0) {
|
41617 | isSub = !1;
|
41618 | }
|
41619 |
|
41620 | var $$ = this,
|
41621 | $el = $$.$el,
|
41622 | $T = $$.$T,
|
41623 | $root = isSub ? $el.subchart : $el,
|
41624 | classSetter = $$.getClass("candlestick", !0),
|
41625 | initialOpacity = $$.initialOpacity.bind($$),
|
41626 | candlestick = $root.main.selectAll("." + config_classes.chartCandlestick).selectAll("." + config_classes.candlestick).data($$.labelishData.bind($$));
|
41627 | $T(candlestick.exit(), withTransition).style("opacity", "0").remove();
|
41628 | var candlestickEnter = candlestick.enter().filter(function (d) {
|
41629 | return d.value;
|
41630 | }).append("g").attr("class", classSetter);
|
41631 | candlestickEnter.append("line");
|
41632 | candlestickEnter.append("path");
|
41633 |
|
41634 | if (!$root.candlestick) {
|
41635 | $root.candlestick = {};
|
41636 | }
|
41637 |
|
41638 | $root.candlestick = candlestick.merge(candlestickEnter).style("opacity", initialOpacity);
|
41639 | },
|
41640 |
|
41641 | /**
|
41642 | * Get draw function
|
41643 | * @param {object} indices Indice data
|
41644 | * @param {boolean} isSub Subchart draw
|
41645 | * @returns {Function}
|
41646 | * @private
|
41647 | */
|
41648 | generateDrawCandlestick: function generateDrawCandlestick(indices, isSub) {
|
41649 | var $$ = this,
|
41650 | config = $$.config,
|
41651 | getPoints = $$.generateGetCandlestickPoints(indices, isSub),
|
41652 | isRotated = config.axis_rotated,
|
41653 | downColor = config.candlestick_color_down;
|
41654 | return function (d, i, g) {
|
41655 | var _value,
|
41656 | points = getPoints(d, i),
|
41657 | value = $$.getCandlestickData(d),
|
41658 | isUp = (_value = value) == null ? void 0 : _value._isUp,
|
41659 | indexX = +isRotated;
|
41660 |
|
41661 | if (g.classed) {
|
41662 | g.classed(config_classes[isUp ? "valueUp" : "valueDown"], !0);
|
41663 | }
|
41664 |
|
41665 | 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];
|
41666 | g.select("path").attr("d", "M" + points[0][indexX] + "," + points[0][+!indexX] + path + "z").style("fill", function (d) {
|
41667 | var color = isUp ? $$.color(d) : isObject(downColor) ? downColor[d.id] : downColor;
|
41668 | return color || $$.color(d);
|
41669 | }); // set line position
|
41670 |
|
41671 | var line = g.select("line"),
|
41672 | pos = isRotated ? {
|
41673 | x1: points[2][1],
|
41674 | x2: points[2][2],
|
41675 | y1: points[2][0],
|
41676 | y2: points[2][0]
|
41677 | } : {
|
41678 | x1: points[2][0],
|
41679 | x2: points[2][0],
|
41680 | y1: points[2][1],
|
41681 | y2: points[2][2]
|
41682 | };
|
41683 |
|
41684 | for (var x in pos) {
|
41685 | line.attr(x, pos[x]);
|
41686 | }
|
41687 | };
|
41688 | },
|
41689 |
|
41690 | /**
|
41691 | * Generate shape drawing points
|
41692 | * @param {object} indices Indice data
|
41693 | * @param {boolean} isSub Subchart draw
|
41694 | * @returns {Function}
|
41695 | */
|
41696 | generateGetCandlestickPoints: function generateGetCandlestickPoints(indices, isSub) {
|
41697 | if (isSub === void 0) {
|
41698 | isSub = !1;
|
41699 | }
|
41700 |
|
41701 | var $$ = this,
|
41702 | config = $$.config,
|
41703 | axis = isSub ? $$.axis.subX : $$.axis.x,
|
41704 | targetsNum = $$.getIndicesMax(indices) + 1,
|
41705 | barW = $$.getBarW("candlestick", axis, targetsNum),
|
41706 | x = $$.getShapeX(barW, indices, !!isSub),
|
41707 | y = $$.getShapeY(!!isSub),
|
41708 | shapeOffset = $$.getShapeOffset($$.isBarType, indices, !!isSub),
|
41709 | yScale = $$.getYScaleById.bind($$);
|
41710 | return function (d, i) {
|
41711 | var y0 = yScale.call($$, d.id, isSub)($$.getShapeYMin(d.id)),
|
41712 | offset = shapeOffset(d, i) || y0,
|
41713 | width = isNumber(barW) ? barW : barW[d.id] || barW._$width,
|
41714 | value = $$.getCandlestickData(d),
|
41715 | points;
|
41716 |
|
41717 | if (value) {
|
41718 | var posX = {
|
41719 | start: x(d),
|
41720 | end: 0
|
41721 | };
|
41722 | posX.end = posX.start + width;
|
41723 | var posY = {
|
41724 | start: y(value.open),
|
41725 | end: y(value.close)
|
41726 | },
|
41727 | posLine = {
|
41728 | x: posX.start + width / 2,
|
41729 | high: y(value.high),
|
41730 | low: y(value.low)
|
41731 | };
|
41732 |
|
41733 | // fix posY not to overflow opposite quadrant
|
41734 | if (config.axis_rotated && (d.value > 0 && posY.start < y0 || d.value < 0 && y0 < posY.start)) {
|
41735 | posY.start = y0;
|
41736 | }
|
41737 |
|
41738 | posY.start -= y0 - offset;
|
41739 | points = [[posX.start, posY.start], [posX.end, posY.end], [posLine.x, posLine.low, posLine.high]];
|
41740 | } else {
|
41741 | points = [[0, 0], [0, 0], [0, 0, 0]];
|
41742 | }
|
41743 |
|
41744 | return points;
|
41745 | };
|
41746 | },
|
41747 |
|
41748 | /**
|
41749 | * Redraw function
|
41750 | * @param {Function} drawFn Retuned functino from .generateDrawCandlestick()
|
41751 | * @param {boolean} withTransition With or without transition
|
41752 | * @param {boolean} isSub Subchart draw
|
41753 | * @returns {Array}
|
41754 | */
|
41755 | redrawCandlestick: function redrawCandlestick(drawFn, withTransition, isSub) {
|
41756 | if (isSub === void 0) {
|
41757 | isSub = !1;
|
41758 | }
|
41759 |
|
41760 | var $$ = this,
|
41761 | $el = $$.$el,
|
41762 | $T = $$.$T,
|
41763 | _ref = isSub ? $el.subchart : $el,
|
41764 | candlestick = _ref.candlestick,
|
41765 | rand = getRandom(!0);
|
41766 |
|
41767 | return [candlestick.each(function (d, i) {
|
41768 | var g = $T(src_select(this), withTransition, rand);
|
41769 | drawFn(d, i, g);
|
41770 | }).style("opacity", null)];
|
41771 | },
|
41772 |
|
41773 | /**
|
41774 | * Get candlestick data as object
|
41775 | * @param {object} param Data object
|
41776 | * @param {Array|object} param.value Data value
|
41777 | * @returns {object|null} Converted data object
|
41778 | * @private
|
41779 | */
|
41780 | getCandlestickData: function getCandlestickData(_ref2) {
|
41781 | var value = _ref2.value,
|
41782 | d;
|
41783 |
|
41784 | if (isArray(value)) {
|
41785 | var open = value[0],
|
41786 | high = value[1],
|
41787 | low = value[2],
|
41788 | close = value[3],
|
41789 | _value$ = value[4],
|
41790 | volume = _value$ === void 0 ? !1 : _value$;
|
41791 | d = {
|
41792 | open: open,
|
41793 | high: high,
|
41794 | low: low,
|
41795 | close: close
|
41796 | };
|
41797 |
|
41798 | if (volume !== !1) {
|
41799 | d.volume = volume;
|
41800 | }
|
41801 | } else if (isObject(value)) {
|
41802 | d = candlestick_objectSpread({}, value);
|
41803 | }
|
41804 |
|
41805 | if (d) {
|
41806 | d._isUp = d.close >= d.open;
|
41807 | }
|
41808 |
|
41809 | return d || null;
|
41810 | }
|
41811 | });
|
41812 | ;// CONCATENATED MODULE: ./src/ChartInternal/shape/gauge.ts
|
41813 | /**
|
41814 | * Copyright (c) 2017 ~ present NAVER Corp.
|
41815 | * billboard.js project is licensed under the MIT license
|
41816 | */
|
41817 |
|
41818 |
|
41819 |
|
41820 | /* harmony default export */ var gauge = ({
|
41821 | initGauge: function initGauge() {
|
41822 | var $$ = this,
|
41823 | config = $$.config,
|
41824 | arcs = $$.$el.arcs,
|
41825 | appendText = function (className) {
|
41826 | arcs.append("text").attr("class", className).style("text-anchor", "middle").style("pointer-events", "none");
|
41827 | };
|
41828 |
|
41829 | if ($$.hasType("gauge")) {
|
41830 | var hasMulti = $$.hasMultiArcGauge();
|
41831 | arcs.append(hasMulti ? "g" : "path").attr("class", config_classes.chartArcsBackground).style("fill", !hasMulti && config.gauge_background || null);
|
41832 | config.gauge_units && appendText(config_classes.chartArcsGaugeUnit);
|
41833 |
|
41834 | if (config.gauge_label_show) {
|
41835 | appendText(config_classes.chartArcsGaugeMin);
|
41836 | config.gauge_fullCircle || appendText(config_classes.chartArcsGaugeMax);
|
41837 | }
|
41838 | }
|
41839 | },
|
41840 | updateGaugeMax: function updateGaugeMax() {
|
41841 | var $$ = this,
|
41842 | config = $$.config,
|
41843 | state = $$.state,
|
41844 | hasMultiGauge = $$.hasMultiArcGauge(),
|
41845 | max = hasMultiGauge ? $$.getMinMaxData().max[0].value : $$.getTotalDataSum(state.rendered);
|
41846 |
|
41847 | // if gauge_max less than max, make max to max value
|
41848 | if (max + config.gauge_min * (config.gauge_min > 0 ? -1 : 1) > config.gauge_max) {
|
41849 | config.gauge_max = max - config.gauge_min;
|
41850 | }
|
41851 | },
|
41852 | redrawMultiArcGauge: function redrawMultiArcGauge() {
|
41853 | var $$ = this,
|
41854 | config = $$.config,
|
41855 | state = $$.state,
|
41856 | $el = $$.$el,
|
41857 | hiddenTargetIds = $$.state.hiddenTargetIds,
|
41858 | arcLabelLines = $el.main.selectAll("." + config_classes.arcs).selectAll("." + config_classes.arcLabelLine).data($$.arcData.bind($$)),
|
41859 | mainArcLabelLine = arcLabelLines.enter().append("rect").attr("class", function (d) {
|
41860 | return config_classes.arcLabelLine + " " + config_classes.target + " " + config_classes.target + "-" + d.data.id;
|
41861 | }).merge(arcLabelLines);
|
41862 | mainArcLabelLine.style("fill", function (d) {
|
41863 | return $$.levelColor ? $$.levelColor(d.data.values[0].value) : $$.color(d.data);
|
41864 | }).style("display", config.gauge_label_show ? null : "none").each(function (d) {
|
41865 | var lineLength = 0,
|
41866 | lineThickness = 2,
|
41867 | x = 0,
|
41868 | y = 0,
|
41869 | transform = "";
|
41870 |
|
41871 | if (hiddenTargetIds.indexOf(d.data.id) < 0) {
|
41872 | var updated = $$.updateAngle(d),
|
41873 | innerLineLength = state.gaugeArcWidth / $$.filterTargetsToShow($$.data.targets).length * (updated.index + 1),
|
41874 | lineAngle = updated.endAngle - Math.PI / 2,
|
41875 | arcInnerRadius = state.radius - innerLineLength,
|
41876 | linePositioningAngle = lineAngle - (arcInnerRadius === 0 ? 0 : 1 / arcInnerRadius);
|
41877 | lineLength = state.radiusExpanded - state.radius + innerLineLength;
|
41878 | x = Math.cos(linePositioningAngle) * arcInnerRadius;
|
41879 | y = Math.sin(linePositioningAngle) * arcInnerRadius;
|
41880 | transform = "rotate(" + lineAngle * 180 / Math.PI + ", " + x + ", " + y + ")";
|
41881 | }
|
41882 |
|
41883 | 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");
|
41884 | });
|
41885 | },
|
41886 | textForGaugeMinMax: function textForGaugeMinMax(value, isMax) {
|
41887 | var $$ = this,
|
41888 | config = $$.config,
|
41889 | format = config.gauge_label_extents;
|
41890 | return isFunction(format) ? format.bind($$.api)(value, isMax) : value;
|
41891 | },
|
41892 | getGaugeLabelHeight: function getGaugeLabelHeight() {
|
41893 | var config = this.config;
|
41894 | return this.config.gauge_label_show && !config.gauge_fullCircle ? 20 : 0;
|
41895 | },
|
41896 | getPaddingBottomForGauge: function getPaddingBottomForGauge() {
|
41897 | var $$ = this;
|
41898 | return $$.getGaugeLabelHeight() * ($$.config.gauge_label_show ? 2 : 2.5);
|
41899 | }
|
41900 | });
|
41901 | ;// CONCATENATED MODULE: ./src/ChartInternal/shape/bubble.ts
|
41902 | /**
|
41903 | * Copyright (c) 2017 ~ present NAVER Corp.
|
41904 | * billboard.js project is licensed under the MIT license
|
41905 | */
|
41906 |
|
41907 |
|
41908 | /* harmony default export */ var bubble = ({
|
41909 | /**
|
41910 | * Initializer
|
41911 | * @private
|
41912 | */
|
41913 | initBubble: function initBubble() {
|
41914 | var $$ = this,
|
41915 | config = $$.config;
|
41916 |
|
41917 | if ($$.hasType("bubble")) {
|
41918 | config.point_show = !0;
|
41919 | config.point_type = "circle";
|
41920 | config.point_sensitivity = 25;
|
41921 | }
|
41922 | },
|
41923 |
|
41924 | /**
|
41925 | * Get user agent's computed value
|
41926 | * @returns {number}
|
41927 | * @private
|
41928 | */
|
41929 | getBaseLength: function getBaseLength() {
|
41930 | var $$ = this,
|
41931 | _$$$state = $$.state,
|
41932 | width = _$$$state.width,
|
41933 | height = _$$$state.height,
|
41934 | cacheKey = KEY.bubbleBaseLength,
|
41935 | baseLength = $$.cache.get(cacheKey);
|
41936 |
|
41937 | if (!baseLength) {
|
41938 | $$.cache.add(cacheKey, baseLength = getMinMax("min", [width, height]));
|
41939 | }
|
41940 |
|
41941 | return baseLength;
|
41942 | },
|
41943 |
|
41944 | /**
|
41945 | * Get the radius value for bubble circle
|
41946 | * @param {object} d Data object
|
41947 | * @returns {number}
|
41948 | * @private
|
41949 | */
|
41950 | getBubbleR: function getBubbleR(d) {
|
41951 | var $$ = this,
|
41952 | maxR = $$.config.bubble_maxR;
|
41953 |
|
41954 | if (isFunction(maxR)) {
|
41955 | maxR = maxR.bind($$.api)(d);
|
41956 | } else if (!isNumber(maxR)) {
|
41957 | maxR = $$.getBaseLength() / ($$.getMaxDataCount() * 2) + 12;
|
41958 | }
|
41959 |
|
41960 | var max = getMinMax("max", $$.getMinMaxData().max.map(function (d) {
|
41961 | return $$.isBubbleZType(d) ? $$.getBubbleZData(d.value, "y") : isObject(d.value) ? d.value.mid : d.value;
|
41962 | })),
|
41963 | maxArea = maxR * maxR * Math.PI,
|
41964 | area = ($$.isBubbleZType(d) ? $$.getBubbleZData(d.value, "z") : d.value) * (maxArea / max);
|
41965 | return Math.sqrt(area / Math.PI);
|
41966 | },
|
41967 |
|
41968 | /**
|
41969 | * Get bubble dimension data
|
41970 | * @param {object|Array} d data value
|
41971 | * @param {string} type - y or z
|
41972 | * @returns {number}
|
41973 | * @private
|
41974 | */
|
41975 | getBubbleZData: function getBubbleZData(d, type) {
|
41976 | return isObject(d) ? d[type] : d[type === "y" ? 0 : 1];
|
41977 | }
|
41978 | });
|
41979 | ;// CONCATENATED MODULE: ./src/ChartInternal/shape/line.ts
|
41980 | /**
|
41981 | * Copyright (c) 2017 ~ present NAVER Corp.
|
41982 | * billboard.js project is licensed under the MIT license
|
41983 | */
|
41984 |
|
41985 |
|
41986 |
|
41987 |
|
41988 | /* harmony default export */ var line = ({
|
41989 | initLine: function initLine() {
|
41990 | var $el = this.$el;
|
41991 | $el.line = $el.main.select("." + config_classes.chart).append("g").attr("class", config_classes.chartLines);
|
41992 | },
|
41993 | updateTargetsForLine: function updateTargetsForLine(t) {
|
41994 | var $$ = this,
|
41995 | _$$$$el = $$.$el,
|
41996 | area = _$$$$el.area,
|
41997 | line = _$$$$el.line,
|
41998 | main = _$$$$el.main,
|
41999 | classChartLine = $$.getChartClass("Line"),
|
42000 | classLines = $$.getClass("lines", !0),
|
42001 | classFocus = $$.classFocus.bind($$);
|
42002 |
|
42003 | if (!line) {
|
42004 | $$.initLine();
|
42005 | }
|
42006 |
|
42007 | var targets = t.filter(function (d) {
|
42008 | return !($$.isScatterType(d) || $$.isBubbleType(d));
|
42009 | }),
|
42010 | mainLineUpdate = main.select("." + config_classes.chartLines).selectAll("." + config_classes.chartLine).data(targets).attr("class", function (d) {
|
42011 | return classChartLine(d) + classFocus(d);
|
42012 | }),
|
42013 | mainLineEnter = mainLineUpdate.enter().append("g").attr("class", classChartLine).style("opacity", "0").style("pointer-events", "none");
|
42014 | // Lines for each data
|
42015 | mainLineEnter.append("g").attr("class", classLines); // Areas
|
42016 |
|
42017 | if ($$.hasTypeOf("Area")) {
|
42018 | $$.initArea(!area && mainLineEnter.empty() ? mainLineUpdate : mainLineEnter);
|
42019 | }
|
42020 |
|
42021 | $$.updateTargetForCircle(targets, mainLineEnter);
|
42022 | },
|
42023 |
|
42024 | /**
|
42025 | * Generate/Update elements
|
42026 | * @param {boolean} withTransition Transition for exit elements
|
42027 | * @param {boolean} isSub Subchart draw
|
42028 | * @private
|
42029 | */
|
42030 | updateLine: function updateLine(withTransition, isSub) {
|
42031 | if (isSub === void 0) {
|
42032 | isSub = !1;
|
42033 | }
|
42034 |
|
42035 | var $$ = this,
|
42036 | extraLineClasses = $$.format.extraLineClasses,
|
42037 | $el = $$.$el,
|
42038 | $T = $$.$T,
|
42039 | $root = isSub ? $el.subchart : $el,
|
42040 | line = $root.main.selectAll("." + config_classes.lines).selectAll("." + config_classes.line).data($$.lineData.bind($$));
|
42041 | $T(line.exit(), withTransition).style("opacity", "0").remove();
|
42042 | $root.line = line.enter().append("path").attr("class", function (d) {
|
42043 | return $$.getClass("line", !0)(d) + " " + (extraLineClasses(d) || "");
|
42044 | }).style("stroke", $$.color).merge(line).style("opacity", $$.initialOpacity.bind($$)).style("shape-rendering", function (d) {
|
42045 | return $$.isStepType(d) ? "crispEdges" : "";
|
42046 | }).attr("transform", null);
|
42047 | },
|
42048 |
|
42049 | /**
|
42050 | * Redraw function
|
42051 | * @param {Function} drawFn Retuned functino from .generateDrawCandlestick()
|
42052 | * @param {boolean} withTransition With or without transition
|
42053 | * @param {boolean} isSub Subchart draw
|
42054 | * @returns {Array}
|
42055 | */
|
42056 | redrawLine: function redrawLine(drawFn, withTransition, isSub) {
|
42057 | if (isSub === void 0) {
|
42058 | isSub = !1;
|
42059 | }
|
42060 |
|
42061 | var $$ = this,
|
42062 | $el = $$.$el,
|
42063 | $T = $$.$T,
|
42064 | _ref = isSub ? $el.subchart : $el,
|
42065 | line = _ref.line;
|
42066 |
|
42067 | return [$T(line, withTransition, getRandom()).attr("d", drawFn).style("stroke", this.color).style("opacity", null)];
|
42068 | },
|
42069 |
|
42070 | /**
|
42071 | * Get the curve interpolate
|
42072 | * @param {Array} d Data object
|
42073 | * @returns {Function}
|
42074 | * @private
|
42075 | */
|
42076 | getCurve: function getCurve(d) {
|
42077 | var $$ = this,
|
42078 | isRotatedStepType = $$.config.axis_rotated && $$.isStepType(d);
|
42079 | // when is step & rotated, should be computed in different way
|
42080 | // https://github.com/naver/billboard.js/issues/471
|
42081 | return isRotatedStepType ? function (context) {
|
42082 | var step = $$.getInterpolate(d)(context); // keep the original method
|
42083 |
|
42084 | step.orgPoint = step.point; // to get rotated path data
|
42085 |
|
42086 | step.pointRotated = function (x, y) {
|
42087 | this._point === 1 && (this._point = 2);
|
42088 | var y1 = this._y * (1 - this._t) + y * this._t;
|
42089 |
|
42090 | this._context.lineTo(this._x, y1);
|
42091 |
|
42092 | this._context.lineTo(x, y1);
|
42093 |
|
42094 | this._x = x;
|
42095 | this._y = y;
|
42096 | };
|
42097 |
|
42098 | step.point = function (x, y) {
|
42099 | this._point === 0 ? this.orgPoint(x, y) : this.pointRotated(x, y);
|
42100 | };
|
42101 |
|
42102 | return step;
|
42103 | } : $$.getInterpolate(d);
|
42104 | },
|
42105 | generateDrawLine: function generateDrawLine(lineIndices, isSub) {
|
42106 | var $$ = this,
|
42107 | config = $$.config,
|
42108 | scale = $$.scale,
|
42109 | lineConnectNull = config.line_connectNull,
|
42110 | isRotated = config.axis_rotated,
|
42111 | getPoints = $$.generateGetLinePoints(lineIndices, isSub),
|
42112 | yScale = $$.getYScaleById.bind($$),
|
42113 | xValue = function (d) {
|
42114 | return (isSub ? $$.subxx : $$.xx).call($$, d);
|
42115 | },
|
42116 | yValue = function (d, i) {
|
42117 | return $$.isGrouped(d.id) ? getPoints(d, i)[0][1] : yScale(d.id, isSub)($$.getBaseValue(d));
|
42118 | },
|
42119 | line = src_line();
|
42120 |
|
42121 | line = isRotated ? line.x(yValue).y(xValue) : line.x(xValue).y(yValue);
|
42122 |
|
42123 | if (!lineConnectNull) {
|
42124 | line = line.defined(function (d) {
|
42125 | return $$.getBaseValue(d) !== null;
|
42126 | });
|
42127 | }
|
42128 |
|
42129 | var x = isSub ? scale.subX : scale.x;
|
42130 | return function (d) {
|
42131 | var y = yScale(d.id, isSub),
|
42132 | values = lineConnectNull ? $$.filterRemoveNull(d.values) : d.values,
|
42133 | x0 = 0,
|
42134 | y0 = 0,
|
42135 | path;
|
42136 |
|
42137 | if ($$.isLineType(d)) {
|
42138 | var regions = config.data_regions[d.id];
|
42139 |
|
42140 | if (regions) {
|
42141 | path = $$.lineWithRegions(values, scale.zoom || x, y, regions);
|
42142 | } else {
|
42143 | if ($$.isStepType(d)) {
|
42144 | values = $$.convertValuesToStep(values);
|
42145 | }
|
42146 |
|
42147 | path = line.curve($$.getCurve(d))(values);
|
42148 | }
|
42149 | } else {
|
42150 | if (values[0]) {
|
42151 | x0 = x(values[0].x);
|
42152 | y0 = y(values[0].value);
|
42153 | }
|
42154 |
|
42155 | path = isRotated ? "M " + y0 + " " + x0 : "M " + x0 + " " + y0;
|
42156 | }
|
42157 |
|
42158 | return path || "M 0 0";
|
42159 | };
|
42160 | },
|
42161 | lineWithRegions: function lineWithRegions(d, x, y, _regions) {
|
42162 | var $$ = this,
|
42163 | config = $$.config,
|
42164 | isRotated = config.axis_rotated,
|
42165 | isTimeSeries = $$.axis.isTimeSeries(),
|
42166 | xOffset = $$.axis.isCategorized() ? .5 : 0,
|
42167 | regions = [],
|
42168 | dasharray = "2 2",
|
42169 | xp,
|
42170 | yp,
|
42171 | diff,
|
42172 | diffx2,
|
42173 | isWithinRegions = function (withinX, withinRegions) {
|
42174 | for (var i = 0, reg; reg = withinRegions[i]; i++) {
|
42175 | if (reg.start < withinX && withinX <= reg.end) {
|
42176 | return reg.style;
|
42177 | }
|
42178 | }
|
42179 |
|
42180 | return !1;
|
42181 | };
|
42182 |
|
42183 | // Check start/end of regions
|
42184 | if (isDefined(_regions)) {
|
42185 | var getValue = function (v, def) {
|
42186 | return isUndefined(v) ? def : isTimeSeries ? parseDate.call($$, v) : v;
|
42187 | };
|
42188 |
|
42189 | for (var i = 0, reg; reg = _regions[i]; i++) {
|
42190 | var start = getValue(reg.start, d[0].x),
|
42191 | end = getValue(reg.end, d[d.length - 1].x),
|
42192 | style = reg.style || {
|
42193 | dasharray: dasharray
|
42194 | };
|
42195 | regions[i] = {
|
42196 | start: start,
|
42197 | end: end,
|
42198 | style: style
|
42199 | };
|
42200 | }
|
42201 | } // Set scales
|
42202 |
|
42203 |
|
42204 | var xValue = isRotated ? function (dt) {
|
42205 | return y(dt.value);
|
42206 | } : function (dt) {
|
42207 | return x(dt.x);
|
42208 | },
|
42209 | yValue = isRotated ? function (dt) {
|
42210 | return x(dt.x);
|
42211 | } : function (dt) {
|
42212 | return y(dt.value);
|
42213 | },
|
42214 | generateM = function (points) {
|
42215 | return "M" + points[0][0] + "," + points[0][1] + "L" + points[1][0] + "," + points[1][1];
|
42216 | },
|
42217 | sWithRegion = isTimeSeries ? function (d0, d1, k, timeseriesDiff) {
|
42218 | var x0 = d0.x.getTime(),
|
42219 | xDiff = d1.x - d0.x,
|
42220 | xv0 = new Date(x0 + xDiff * k),
|
42221 | xv1 = new Date(x0 + xDiff * (k + timeseriesDiff)),
|
42222 | points = isRotated ? [[y(yp(k)), x(xv0)], [y(yp(k + diff)), x(xv1)]] : [[x(xv0), y(yp(k))], [x(xv1), y(yp(k + diff))]];
|
42223 | return generateM(points);
|
42224 | } : function (d0, d1, k, otherDiff) {
|
42225 | 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))]];
|
42226 | return generateM(points);
|
42227 | },
|
42228 | axisType = {
|
42229 | x: $$.axis.getAxisType("x"),
|
42230 | y: $$.axis.getAxisType("y")
|
42231 | },
|
42232 | path = "";
|
42233 |
|
42234 | for (var _i = 0, data; data = d[_i]; _i++) {
|
42235 | var prevData = d[_i - 1],
|
42236 | hasPrevData = prevData && isValue(prevData.value),
|
42237 | style = isWithinRegions(data.x, regions);
|
42238 |
|
42239 | // https://github.com/naver/billboard.js/issues/1172
|
42240 | if (!isValue(data.value)) {
|
42241 | continue;
|
42242 | } // Draw as normal
|
42243 |
|
42244 |
|
42245 | if (isUndefined(regions) || !style || !hasPrevData) {
|
42246 | path += "" + (_i && hasPrevData ? "L" : "M") + xValue(data) + "," + yValue(data);
|
42247 | } else if (hasPrevData) {
|
42248 | try {
|
42249 | style = style.dasharray.split(" ");
|
42250 | } catch (e) {
|
42251 | style = dasharray.split(" ");
|
42252 | } // Draw with region // TODO: Fix for horizotal charts
|
42253 |
|
42254 |
|
42255 | xp = getScale(axisType.x, prevData.x + xOffset, data.x + xOffset);
|
42256 | yp = getScale(axisType.y, prevData.value, data.value);
|
42257 | var dx = x(data.x) - x(prevData.x),
|
42258 | dy = y(data.value) - y(prevData.value),
|
42259 | dd = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));
|
42260 | diff = style[0] / dd;
|
42261 | diffx2 = diff * style[1];
|
42262 |
|
42263 | for (var j = diff; j <= 1; j += diffx2) {
|
42264 | path += sWithRegion(prevData, data, j, diff); // to make sure correct line drawing
|
42265 |
|
42266 | if (j + diffx2 >= 1) {
|
42267 | path += sWithRegion(prevData, data, 1, 0);
|
42268 | }
|
42269 | }
|
42270 | }
|
42271 | }
|
42272 |
|
42273 | return path;
|
42274 | },
|
42275 | isWithinStep: function isWithinStep(that, y) {
|
42276 | return Math.abs(y - getPointer(this.state.event, that)[1]) < 30;
|
42277 | },
|
42278 | shouldDrawPointsForLine: function shouldDrawPointsForLine(d) {
|
42279 | var linePoint = this.config.line_point;
|
42280 | return linePoint === !0 || isArray(linePoint) && linePoint.indexOf(d.id) !== -1;
|
42281 | }
|
42282 | });
|
42283 | ;// CONCATENATED MODULE: ./src/ChartInternal/shape/point.ts
|
42284 | /**
|
42285 | * Copyright (c) 2017 ~ present NAVER Corp.
|
42286 | * billboard.js project is licensed under the MIT license
|
42287 | */
|
42288 |
|
42289 |
|
42290 |
|
42291 |
|
42292 |
|
42293 | var getTransitionName = function () {
|
42294 | return getRandom();
|
42295 | };
|
42296 |
|
42297 | /* harmony default export */ var point = ({
|
42298 | hasValidPointType: function hasValidPointType(type) {
|
42299 | return /^(circle|rect(angle)?|polygon|ellipse|use)$/i.test(type || this.config.point_type);
|
42300 | },
|
42301 | hasValidPointDrawMethods: function hasValidPointDrawMethods(type) {
|
42302 | var pointType = type || this.config.point_type;
|
42303 | return isObjectType(pointType) && isFunction(pointType.create) && isFunction(pointType.update);
|
42304 | },
|
42305 | initialOpacityForCircle: function initialOpacityForCircle(d) {
|
42306 | var config = this.config,
|
42307 | withoutFadeIn = this.state.withoutFadeIn,
|
42308 | opacity = config.point_opacity;
|
42309 |
|
42310 | if (isUndefined(opacity)) {
|
42311 | opacity = this.getBaseValue(d) !== null && withoutFadeIn[d.id] ? this.opacityForCircle(d) : "0";
|
42312 | }
|
42313 |
|
42314 | return opacity;
|
42315 | },
|
42316 | opacityForCircle: function opacityForCircle(d) {
|
42317 | var config = this.config,
|
42318 | opacity = config.point_opacity;
|
42319 |
|
42320 | if (isUndefined(opacity)) {
|
42321 | opacity = config.point_show && !config.point_focus_only ? null : "0";
|
42322 | opacity = isValue(this.getBaseValue(d)) ? this.isBubbleType(d) || this.isScatterType(d) ? "0.5" : opacity : "0";
|
42323 | }
|
42324 |
|
42325 | return opacity;
|
42326 | },
|
42327 | initCircle: function initCircle() {
|
42328 | var $$ = this,
|
42329 | main = $$.$el.main;
|
42330 | $$.point = $$.generatePoint();
|
42331 |
|
42332 | if (($$.hasType("bubble") || $$.hasType("scatter")) && main.select("." + config_classes.chartCircles).empty()) {
|
42333 | main.select("." + config_classes.chart).append("g").attr("class", config_classes.chartCircles);
|
42334 | }
|
42335 | },
|
42336 | updateTargetForCircle: function updateTargetForCircle(targetsValue, enterNodeValue) {
|
42337 | var _this = this,
|
42338 | $$ = this,
|
42339 | config = $$.config,
|
42340 | data = $$.data,
|
42341 | $el = $$.$el,
|
42342 | selectionEnabled = config.interaction_enabled && config.data_selection_enabled,
|
42343 | isSelectable = selectionEnabled && config.data_selection_isselectable,
|
42344 | classCircles = $$.getClass("circles", !0);
|
42345 |
|
42346 | if (!config.point_show) {
|
42347 | return;
|
42348 | }
|
42349 |
|
42350 | $el.circle || $$.initCircle();
|
42351 | var targets = targetsValue,
|
42352 | enterNode = enterNodeValue;
|
42353 |
|
42354 | // only for scatter & bubble type should generate seprate <g> node
|
42355 | if (!targets) {
|
42356 | targets = data.targets.filter(function (d) {
|
42357 | return _this.isScatterType(d) || _this.isBubbleType(d);
|
42358 | });
|
42359 | var mainCircle = $el.main.select("." + config_classes.chartCircles).style("pointer-events", "none").selectAll("." + config_classes.circles).data(targets).attr("class", classCircles);
|
42360 | mainCircle.exit().remove();
|
42361 | enterNode = mainCircle.enter();
|
42362 | } // Circles for each data point on lines
|
42363 |
|
42364 |
|
42365 | selectionEnabled && enterNode.append("g").attr("class", function (d) {
|
42366 | return $$.generateClass(config_classes.selectedCircles, d.id);
|
42367 | });
|
42368 | enterNode.append("g").attr("class", classCircles).style("cursor", function (d) {
|
42369 | return isFunction(isSelectable) && isSelectable(d) ? "pointer" : null;
|
42370 | }); // Update date for selected circles
|
42371 |
|
42372 | selectionEnabled && targets.forEach(function (t) {
|
42373 | $el.main.selectAll("." + config_classes.selectedCircles + $$.getTargetSelectorSuffix(t.id)).selectAll("" + config_classes.selectedCircle).each(function (d) {
|
42374 | d.value = t.values[d.index].value;
|
42375 | });
|
42376 | });
|
42377 | },
|
42378 | updateCircle: function updateCircle(isSub) {
|
42379 | if (isSub === void 0) {
|
42380 | isSub = !1;
|
42381 | }
|
42382 |
|
42383 | var $$ = this,
|
42384 | config = $$.config,
|
42385 | state = $$.state,
|
42386 | $el = $$.$el,
|
42387 | focusOnly = config.point_focus_only,
|
42388 | $root = isSub ? $el.subchart : $el;
|
42389 |
|
42390 | if (config.point_show && !state.toggling) {
|
42391 | var circles = $root.main.selectAll("." + config_classes.circles).selectAll("." + config_classes.circle).data(function (d) {
|
42392 | return $$.isLineType(d) && $$.shouldDrawPointsForLine(d) || $$.isBubbleType(d) || $$.isRadarType(d) || $$.isScatterType(d) ? focusOnly ? [d.values[0]] : d.values : [];
|
42393 | });
|
42394 | circles.exit().remove();
|
42395 | circles.enter().filter(Boolean).append($$.point("create", this, $$.pointR.bind($$), $$.color));
|
42396 | $root.circle = $root.main.selectAll("." + config_classes.circles + " ." + config_classes.circle).style("stroke", $$.color).style("opacity", $$.initialOpacityForCircle.bind($$));
|
42397 | }
|
42398 | },
|
42399 | redrawCircle: function redrawCircle(cx, cy, withTransition, flow, isSub) {
|
42400 | if (isSub === void 0) {
|
42401 | isSub = !1;
|
42402 | }
|
42403 |
|
42404 | var $$ = this,
|
42405 | rendered = $$.state.rendered,
|
42406 | $el = $$.$el,
|
42407 | $T = $$.$T,
|
42408 | $root = isSub ? $el.subchart : $el,
|
42409 | selectedCircles = $root.main.selectAll("." + config_classes.selectedCircle);
|
42410 |
|
42411 | if (!$$.config.point_show) {
|
42412 | return [];
|
42413 | }
|
42414 |
|
42415 | var fn = $$.point("update", $$, cx, cy, $$.color, withTransition, flow, selectedCircles),
|
42416 | posAttr = $$.isCirclePoint() ? "c" : "",
|
42417 | t = getRandom(),
|
42418 | opacityStyleFn = $$.opacityForCircle.bind($$),
|
42419 | mainCircles = [];
|
42420 | $root.circle.each(function (d) {
|
42421 | var result = fn.bind(this)(d);
|
42422 | result = $T(result, withTransition || !rendered, t).style("opacity", opacityStyleFn);
|
42423 | mainCircles.push(result);
|
42424 | });
|
42425 | return [mainCircles, $T(selectedCircles, withTransition).attr(posAttr + "x", cx).attr(posAttr + "y", cy)];
|
42426 | },
|
42427 |
|
42428 | /**
|
42429 | * Show focused data point circle
|
42430 | * @param {object} d Selected data
|
42431 | * @private
|
42432 | */
|
42433 | showCircleFocus: function showCircleFocus(d) {
|
42434 | var $$ = this,
|
42435 | config = $$.config,
|
42436 | _$$$state = $$.state,
|
42437 | hasRadar = _$$$state.hasRadar,
|
42438 | resizing = _$$$state.resizing,
|
42439 | toggling = _$$$state.toggling,
|
42440 | transiting = _$$$state.transiting,
|
42441 | $el = $$.$el,
|
42442 | circle = $el.circle;
|
42443 |
|
42444 | if (transiting === !1 && config.point_focus_only && circle) {
|
42445 | var cx = (hasRadar ? $$.radarCircleX : $$.circleX).bind($$),
|
42446 | cy = (hasRadar ? $$.radarCircleY : $$.circleY).bind($$),
|
42447 | withTransition = toggling || isUndefined(d),
|
42448 | fn = $$.point("update", $$, cx, cy, $$.color, resizing ? !1 : withTransition);
|
42449 |
|
42450 | if (d) {
|
42451 | circle = circle.filter(function (t) {
|
42452 | var data = d.filter(function (v) {
|
42453 | return v.id === t.id;
|
42454 | });
|
42455 | return data.length ? src_select(this).datum(data[0]) : !1;
|
42456 | });
|
42457 | }
|
42458 |
|
42459 | circle.attr("class", this.updatePointClass.bind(this)).style("opacity", null).each(function (d) {
|
42460 | var id = d.id,
|
42461 | index = d.index,
|
42462 | value = d.value,
|
42463 | visibility = "hidden";
|
42464 |
|
42465 | if (isValue(value)) {
|
42466 | fn.bind(this)(d);
|
42467 | $$.expandCircles(index, id);
|
42468 | visibility = "";
|
42469 | }
|
42470 |
|
42471 | this.style.visibility = visibility;
|
42472 | });
|
42473 | }
|
42474 | },
|
42475 |
|
42476 | /**
|
42477 | * Hide focused data point circle
|
42478 | * @private
|
42479 | */
|
42480 | hideCircleFocus: function hideCircleFocus() {
|
42481 | var $$ = this,
|
42482 | config = $$.config,
|
42483 | circle = $$.$el.circle;
|
42484 |
|
42485 | if (config.point_focus_only && circle) {
|
42486 | $$.unexpandCircles();
|
42487 | circle.style("visibility", "hidden");
|
42488 | }
|
42489 | },
|
42490 | circleX: function circleX(d) {
|
42491 | return this.xx(d);
|
42492 | },
|
42493 | updateCircleY: function updateCircleY(isSub) {
|
42494 | if (isSub === void 0) {
|
42495 | isSub = !1;
|
42496 | }
|
42497 |
|
42498 | var $$ = this,
|
42499 | getPoints = $$.generateGetLinePoints($$.getShapeIndices($$.isLineType), isSub);
|
42500 | return function (d, i) {
|
42501 | var id = d.id;
|
42502 | return $$.isGrouped(id) ? getPoints(d, i)[0][1] : $$.getYScaleById(id, isSub)($$.getBaseValue(d));
|
42503 | };
|
42504 | },
|
42505 | expandCircles: function expandCircles(i, id, reset) {
|
42506 | var $$ = this,
|
42507 | r = $$.pointExpandedR.bind($$);
|
42508 | reset && $$.unexpandCircles();
|
42509 | var circles = $$.getShapeByIndex("circle", i, id).classed(config_classes.EXPANDED, !0),
|
42510 | scale = r(circles) / $$.config.point_r,
|
42511 | ratio = 1 - scale;
|
42512 |
|
42513 | if ($$.isCirclePoint()) {
|
42514 | circles.attr("r", r);
|
42515 | } else {
|
42516 | // transform must be applied to each node individually
|
42517 | circles.each(function () {
|
42518 | var point = src_select(this);
|
42519 |
|
42520 | if (this.tagName === "circle") {
|
42521 | point.attr("r", r);
|
42522 | } else {
|
42523 | var _this$getBBox = this.getBBox(),
|
42524 | width = _this$getBBox.width,
|
42525 | height = _this$getBBox.height,
|
42526 | x = ratio * (+point.attr("x") + width / 2),
|
42527 | y = ratio * (+point.attr("y") + height / 2);
|
42528 |
|
42529 | point.attr("transform", "translate(" + x + " " + y + ") scale(" + scale + ")");
|
42530 | }
|
42531 | });
|
42532 | }
|
42533 | },
|
42534 | unexpandCircles: function unexpandCircles(i) {
|
42535 | var $$ = this,
|
42536 | r = $$.pointR.bind($$),
|
42537 | circles = $$.getShapeByIndex("circle", i).filter(function () {
|
42538 | return src_select(this).classed(config_classes.EXPANDED);
|
42539 | }).classed(config_classes.EXPANDED, !1);
|
42540 | circles.attr("r", r);
|
42541 | $$.isCirclePoint() || circles.attr("transform", "scale(" + r(circles) / $$.config.point_r + ")");
|
42542 | },
|
42543 | pointR: function (d) {
|
42544 | var $$ = this,
|
42545 | config = $$.config,
|
42546 | pointR = config.point_r,
|
42547 | r = pointR;
|
42548 |
|
42549 | if ($$.isBubbleType(d)) {
|
42550 | r = $$.getBubbleR(d);
|
42551 | } else if (isFunction(pointR)) {
|
42552 | r = pointR.bind($$.api)(d);
|
42553 | }
|
42554 |
|
42555 | return r;
|
42556 | },
|
42557 | pointExpandedR: function pointExpandedR(d) {
|
42558 | var $$ = this,
|
42559 | config = $$.config,
|
42560 | scale = $$.isBubbleType(d) ? 1.15 : 1.75;
|
42561 | return config.point_focus_expand_enabled ? config.point_focus_expand_r || $$.pointR(d) * scale : $$.pointR(d);
|
42562 | },
|
42563 | pointSelectR: function pointSelectR(d) {
|
42564 | var $$ = this,
|
42565 | selectR = $$.config.point_select_r;
|
42566 | return isFunction(selectR) ? selectR(d) : selectR || $$.pointR(d) * 4;
|
42567 | },
|
42568 | isWithinCircle: function isWithinCircle(node, r) {
|
42569 | var mouse = getPointer(this.state.event, node),
|
42570 | element = src_select(node),
|
42571 | prefix = this.isCirclePoint(node) ? "c" : "",
|
42572 | cx = +element.attr(prefix + "x"),
|
42573 | cy = +element.attr(prefix + "y");
|
42574 |
|
42575 | // if node don't have cx/y or x/y attribute value
|
42576 | if (!(cx || cy) && node.nodeType === 1) {
|
42577 | var _getBoundingRect = getBoundingRect(node),
|
42578 | x = _getBoundingRect.x,
|
42579 | y = _getBoundingRect.y;
|
42580 |
|
42581 | cx = x;
|
42582 | cy = y;
|
42583 | }
|
42584 |
|
42585 | return Math.sqrt(Math.pow(cx - mouse[0], 2) + Math.pow(cy - mouse[1], 2)) < (r || this.config.point_sensitivity);
|
42586 | },
|
42587 | insertPointInfoDefs: function insertPointInfoDefs(point, id) {
|
42588 | var _node$childNodes,
|
42589 | $$ = this,
|
42590 | copyAttr = function (from, target) {
|
42591 | for (var attribs = from.attributes, i = 0, name; name = attribs[i]; i++) {
|
42592 | name = name.name;
|
42593 | target.setAttribute(name, from.getAttribute(name));
|
42594 | }
|
42595 | },
|
42596 | doc = new DOMParser().parseFromString(point, "image/svg+xml"),
|
42597 | node = doc.documentElement,
|
42598 | clone = browser_doc.createElementNS(namespaces.svg, node.nodeName.toLowerCase());
|
42599 |
|
42600 | clone.id = id;
|
42601 | clone.style.fill = "inherit";
|
42602 | clone.style.stroke = "inherit";
|
42603 | copyAttr(node, clone);
|
42604 |
|
42605 | if ((_node$childNodes = node.childNodes) != null && _node$childNodes.length) {
|
42606 | var parent = src_select(clone);
|
42607 |
|
42608 | if ("innerHTML" in clone) {
|
42609 | parent.html(node.innerHTML);
|
42610 | } else {
|
42611 | toArray(node.childNodes).forEach(function (v) {
|
42612 | copyAttr(v, parent.append(v.tagName).node());
|
42613 | });
|
42614 | }
|
42615 | }
|
42616 |
|
42617 | $$.$el.defs.node().appendChild(clone);
|
42618 | },
|
42619 | pointFromDefs: function pointFromDefs(id) {
|
42620 | return this.$el.defs.select("#" + id);
|
42621 | },
|
42622 | updatePointClass: function updatePointClass(d) {
|
42623 | var $$ = this,
|
42624 | circle = $$.$el.circle,
|
42625 | pointClass = !1;
|
42626 |
|
42627 | if (isObject(d) || circle) {
|
42628 | pointClass = d === !0 ? circle.each(function (d) {
|
42629 | var className = $$.getClass("circle", !0)(d);
|
42630 |
|
42631 | if (this.getAttribute("class").indexOf(config_classes.EXPANDED) > -1) {
|
42632 | className += " " + config_classes.EXPANDED;
|
42633 | }
|
42634 |
|
42635 | this.setAttribute("class", className);
|
42636 | }) : $$.getClass("circle", !0)(d);
|
42637 | }
|
42638 |
|
42639 | return pointClass;
|
42640 | },
|
42641 | generateGetLinePoints: function generateGetLinePoints(lineIndices, isSub) {
|
42642 | // partial duplication of generateGetBarPoints
|
42643 | var $$ = this,
|
42644 | config = $$.config,
|
42645 | x = $$.getShapeX(0, lineIndices, isSub),
|
42646 | y = $$.getShapeY(isSub),
|
42647 | lineOffset = $$.getShapeOffset($$.isLineType, lineIndices, isSub),
|
42648 | yScale = $$.getYScaleById.bind($$);
|
42649 | return function (d, i) {
|
42650 | var y0 = yScale.call($$, d.id, isSub)($$.getShapeYMin(d.id)),
|
42651 | offset = lineOffset(d, i) || y0,
|
42652 | posX = x(d),
|
42653 | posY = y(d);
|
42654 |
|
42655 | // fix posY not to overflow opposite quadrant
|
42656 | if (config.axis_rotated && (d.value > 0 && posY < y0 || d.value < 0 && y0 < posY)) {
|
42657 | posY = y0;
|
42658 | } // 1 point that marks the line position
|
42659 |
|
42660 |
|
42661 | var point = [posX, posY - (y0 - offset)];
|
42662 | return [point, point, // from here and below, needed for compatibility
|
42663 | point, point];
|
42664 | };
|
42665 | },
|
42666 | generatePoint: function generatePoint() {
|
42667 | var $$ = this,
|
42668 | config = $$.config,
|
42669 | datetimeId = $$.state.datetimeId,
|
42670 | ids = [],
|
42671 | pattern = notEmpty(config.point_pattern) ? config.point_pattern : [config.point_type];
|
42672 | return function (method, context) {
|
42673 | for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
42674 | args[_key - 2] = arguments[_key];
|
42675 | }
|
42676 |
|
42677 | return function (d) {
|
42678 | var _d$data,
|
42679 | id = $$.getTargetSelectorSuffix(d.id || ((_d$data = d.data) == null ? void 0 : _d$data.id) || d),
|
42680 | element = src_select(this);
|
42681 |
|
42682 | ids.indexOf(id) < 0 && ids.push(id);
|
42683 | var point = pattern[ids.indexOf(id) % pattern.length];
|
42684 |
|
42685 | if ($$.hasValidPointType(point)) {
|
42686 | point = $$[point];
|
42687 | } else if (!$$.hasValidPointDrawMethods(point)) {
|
42688 | var pointId = datetimeId + "-point" + id,
|
42689 | pointFromDefs = $$.pointFromDefs(pointId);
|
42690 |
|
42691 | if (pointFromDefs.size() < 1) {
|
42692 | $$.insertPointInfoDefs(point, pointId);
|
42693 | }
|
42694 |
|
42695 | if (method === "create") {
|
42696 | return $$.custom.create.bind(context).apply(void 0, [element, pointId].concat(args));
|
42697 | } else if (method === "update") {
|
42698 | return $$.custom.update.bind(context).apply(void 0, [element].concat(args));
|
42699 | }
|
42700 | }
|
42701 |
|
42702 | return point[method].bind(context).apply(void 0, [element].concat(args));
|
42703 | };
|
42704 | };
|
42705 | },
|
42706 | custom: {
|
42707 | create: function create(element, id, sizeFn, fillStyleFn) {
|
42708 | return element.append("use").attr("xlink:href", "#" + id).attr("class", this.updatePointClass.bind(this)).style("fill", fillStyleFn).node();
|
42709 | },
|
42710 | update: function update(element, xPosFn, yPosFn, fillStyleFn, withTransition, flow, selectedCircles) {
|
42711 | var $$ = this,
|
42712 | _element$node$getBBox = element.node().getBBox(),
|
42713 | width = _element$node$getBBox.width,
|
42714 | height = _element$node$getBBox.height,
|
42715 | xPosFn2 = function (d) {
|
42716 | return isValue(d.value) ? xPosFn(d) - width / 2 : 0;
|
42717 | },
|
42718 | mainCircles = element;
|
42719 |
|
42720 | if (withTransition) {
|
42721 | flow && mainCircles.attr("x", xPosFn2);
|
42722 | mainCircles = $$.$T(mainCircles, withTransition, getTransitionName());
|
42723 | selectedCircles && $$.$T(selectedCircles, withTransition, getTransitionName());
|
42724 | }
|
42725 |
|
42726 | return mainCircles.attr("x", xPosFn2).attr("y", function yPosFn2(d) {
|
42727 | return isValue(d.value) ? yPosFn(d) - height / 2 : 0;
|
42728 | }).style("fill", fillStyleFn);
|
42729 | }
|
42730 | },
|
42731 | // 'circle' data point
|
42732 | circle: {
|
42733 | create: function create(element, sizeFn, fillStyleFn) {
|
42734 | return element.append("circle").attr("class", this.updatePointClass.bind(this)).attr("r", sizeFn).style("fill", fillStyleFn).node();
|
42735 | },
|
42736 | update: function update(element, xPosFn, yPosFn, fillStyleFn, withTransition, flow, selectedCircles) {
|
42737 | var $$ = this,
|
42738 | mainCircles = element;
|
42739 |
|
42740 | // when '.load()' called, bubble size should be updated
|
42741 | if ($$.hasType("bubble")) {
|
42742 | mainCircles.attr("r", $$.pointR.bind($$));
|
42743 | }
|
42744 |
|
42745 | if (withTransition) {
|
42746 | flow && mainCircles.attr("cx", xPosFn);
|
42747 |
|
42748 | if (mainCircles.attr("cx")) {
|
42749 | mainCircles = $$.$T(mainCircles, withTransition, getTransitionName());
|
42750 | }
|
42751 |
|
42752 | selectedCircles && $$.$T(mainCircles, withTransition, getTransitionName());
|
42753 | }
|
42754 |
|
42755 | return mainCircles.attr("cx", xPosFn).attr("cy", yPosFn).style("fill", fillStyleFn);
|
42756 | }
|
42757 | },
|
42758 | // 'rectangle' data point
|
42759 | rectangle: {
|
42760 | create: function create(element, sizeFn, fillStyleFn) {
|
42761 | var rectSizeFn = function (d) {
|
42762 | return sizeFn(d) * 2;
|
42763 | };
|
42764 |
|
42765 | return element.append("rect").attr("class", this.updatePointClass.bind(this)).attr("width", rectSizeFn).attr("height", rectSizeFn).style("fill", fillStyleFn).node();
|
42766 | },
|
42767 | update: function update(element, xPosFn, yPosFn, fillStyleFn, withTransition, flow, selectedCircles) {
|
42768 | var $$ = this,
|
42769 | r = $$.config.point_r,
|
42770 | rectXPosFn = function (d) {
|
42771 | return xPosFn(d) - r;
|
42772 | },
|
42773 | mainCircles = element;
|
42774 |
|
42775 | if (withTransition) {
|
42776 | flow && mainCircles.attr("x", rectXPosFn);
|
42777 | mainCircles = $$.$T(mainCircles, withTransition, getTransitionName());
|
42778 | selectedCircles && $$.$T(selectedCircles, withTransition, getTransitionName());
|
42779 | }
|
42780 |
|
42781 | return mainCircles.attr("x", rectXPosFn).attr("y", function rectYPosFn(d) {
|
42782 | return yPosFn(d) - r;
|
42783 | }).style("fill", fillStyleFn);
|
42784 | }
|
42785 | }
|
42786 | });
|
42787 | ;// CONCATENATED MODULE: ./src/ChartInternal/shape/radar.ts
|
42788 | /**
|
42789 | * Copyright (c) 2017 ~ present NAVER Corp.
|
42790 | * billboard.js project is licensed under the MIT license
|
42791 | */
|
42792 |
|
42793 |
|
42794 |
|
42795 |
|
42796 | /**
|
42797 | * Get the position value
|
42798 | * @param {boolean} isClockwise If the direction is clockwise
|
42799 | * @param {string} type Coordinate type 'x' or 'y'
|
42800 | * @param {number} edge Number of edge
|
42801 | * @param {number} pos The indexed position
|
42802 | * @param {number} range Range value
|
42803 | * @param {number} ratio Ratio value
|
42804 | * @returns {number}
|
42805 | * @private
|
42806 | */
|
42807 |
|
42808 | function getPosition(isClockwise, type, edge, pos, range, ratio) {
|
42809 | var index = isClockwise && pos > 0 ? edge - pos : pos,
|
42810 | r = 2 * Math.PI,
|
42811 | func = type === "x" ? Math.sin : Math.cos;
|
42812 | return range * (1 - ratio * func(index * r / edge));
|
42813 | } // cache key
|
42814 |
|
42815 |
|
42816 | var cacheKey = KEY.radarPoints;
|
42817 | /* harmony default export */ var radar = ({
|
42818 | initRadar: function initRadar() {
|
42819 | var $$ = this,
|
42820 | config = $$.config,
|
42821 | current = $$.state.current,
|
42822 | $el = $$.$el;
|
42823 |
|
42824 | if ($$.hasType("radar")) {
|
42825 | $el.radar = $el.main.select("." + config_classes.chart).append("g").attr("class", config_classes.chartRadars); // level
|
42826 |
|
42827 | $el.radar.levels = $el.radar.append("g").attr("class", config_classes.levels); // axis
|
42828 |
|
42829 | $el.radar.axes = $el.radar.append("g").attr("class", config_classes.axis); // shapes
|
42830 |
|
42831 | $el.radar.shapes = $el.radar.append("g").attr("class", config_classes.shapes);
|
42832 | current.dataMax = config.radar_axis_max || $$.getMinMaxData().max[0].value;
|
42833 | }
|
42834 | },
|
42835 | getRadarSize: function getRadarSize() {
|
42836 | var $$ = this,
|
42837 | config = $$.config,
|
42838 | _$$$state = $$.state,
|
42839 | arcWidth = _$$$state.arcWidth,
|
42840 | arcHeight = _$$$state.arcHeight,
|
42841 | padding = config.axis_x_categories.length < 4 ? -20 : 10,
|
42842 | size = (Math.min(arcWidth, arcHeight) - padding) / 2;
|
42843 | return [size, size];
|
42844 | },
|
42845 | updateTargetsForRadar: function updateTargetsForRadar(targets) {
|
42846 | var $$ = this,
|
42847 | config = $$.config;
|
42848 |
|
42849 | if (isEmpty(config.axis_x_categories)) {
|
42850 | config.axis_x_categories = getRange(0, getMinMax("max", targets.map(function (v) {
|
42851 | return v.values.length;
|
42852 | })));
|
42853 | }
|
42854 |
|
42855 | $$.generateRadarPoints();
|
42856 | },
|
42857 | getRadarPosition: function getRadarPosition(type, index, range, ratio) {
|
42858 | var $$ = this,
|
42859 | config = $$.config,
|
42860 | _$$$getRadarSize = $$.getRadarSize(),
|
42861 | width = _$$$getRadarSize[0],
|
42862 | height = _$$$getRadarSize[1],
|
42863 | edge = config.axis_x_categories.length,
|
42864 | isClockwise = config.radar_direction_clockwise,
|
42865 | pos = toArray(type).map(function (v) {
|
42866 | return getPosition(isClockwise, v, edge, index, isDefined(range) ? range : type === "x" ? width : height, isNumber(ratio) ? ratio : config.radar_size_ratio);
|
42867 | });
|
42868 |
|
42869 | return pos.length === 1 ? pos[0] : pos;
|
42870 | },
|
42871 |
|
42872 | /**
|
42873 | * Generate data points
|
42874 | * @private
|
42875 | */
|
42876 | generateRadarPoints: function generateRadarPoints() {
|
42877 | var $$ = this,
|
42878 | targets = $$.data.targets,
|
42879 | _$$$getRadarSize2 = $$.getRadarSize(),
|
42880 | width = _$$$getRadarSize2[0],
|
42881 | height = _$$$getRadarSize2[1],
|
42882 | points = $$.cache.get(cacheKey) || {},
|
42883 | size = points._size;
|
42884 |
|
42885 | // recalculate position only when the previous dimension has been changed
|
42886 | if (!size || size.width !== width && size.height !== height) {
|
42887 | targets.forEach(function (d) {
|
42888 | points[d.id] = d.values.map(function (v, i) {
|
42889 | return $$.getRadarPosition(["x", "y"], i, undefined, $$.getRatio("radar", v));
|
42890 | });
|
42891 | });
|
42892 | points._size = {
|
42893 | width: width,
|
42894 | height: height
|
42895 | };
|
42896 | $$.cache.add(cacheKey, points);
|
42897 | }
|
42898 | },
|
42899 | redrawRadar: function redrawRadar() {
|
42900 | var $$ = this,
|
42901 | _$$$$el = $$.$el,
|
42902 | radar = _$$$$el.radar,
|
42903 | main = _$$$$el.main,
|
42904 | translate = $$.getTranslate("radar");
|
42905 |
|
42906 | // Adjust radar, circles and texts' position
|
42907 | if (translate) {
|
42908 | radar.attr("transform", translate);
|
42909 | main.select("." + config_classes.chartTexts).attr("transform", translate);
|
42910 | $$.generateRadarPoints();
|
42911 | $$.updateRadarLevel();
|
42912 | $$.updateRadarAxes();
|
42913 | $$.updateRadarShape();
|
42914 | }
|
42915 | },
|
42916 | generateGetRadarPoints: function generateGetRadarPoints() {
|
42917 | var points = this.cache.get(cacheKey);
|
42918 | return function (d, i) {
|
42919 | var point = points[d.id][i];
|
42920 | return [point, point, point, point];
|
42921 | };
|
42922 | },
|
42923 | updateRadarLevel: function updateRadarLevel() {
|
42924 | var $$ = this,
|
42925 | config = $$.config,
|
42926 | state = $$.state,
|
42927 | radar = $$.$el.radar,
|
42928 | _$$$getRadarSize3 = $$.getRadarSize(),
|
42929 | width = _$$$getRadarSize3[0],
|
42930 | height = _$$$getRadarSize3[1],
|
42931 | depth = config.radar_level_depth,
|
42932 | edge = config.axis_x_categories.length,
|
42933 | showText = config.radar_level_text_show,
|
42934 | radarLevels = radar.levels,
|
42935 | levelData = getRange(0, depth),
|
42936 | radius = config.radar_size_ratio * Math.min(width, height),
|
42937 | levelRatio = levelData.map(function (l) {
|
42938 | return radius * ((l + 1) / depth);
|
42939 | }),
|
42940 | levelTextFormat = (config.radar_level_text_format || function () {}).bind($$.api),
|
42941 | points = levelData.map(function (v) {
|
42942 | var range = levelRatio[v],
|
42943 | pos = getRange(0, edge).map(function (i) {
|
42944 | return $$.getRadarPosition(["x", "y"], i, range, 1).join(",");
|
42945 | });
|
42946 | return pos.join(" ");
|
42947 | }),
|
42948 | level = radarLevels.selectAll("." + config_classes.level).data(levelData);
|
42949 |
|
42950 | level.exit().remove();
|
42951 | var levelEnter = level.enter().append("g").attr("class", function (d, i) {
|
42952 | return config_classes.level + " " + config_classes.level + "-" + i;
|
42953 | });
|
42954 | levelEnter.append("polygon").style("visibility", config.radar_level_show ? null : "hidden");
|
42955 |
|
42956 | if (showText) {
|
42957 | if (radarLevels.select("text").empty()) {
|
42958 | radarLevels.append("text").attr("dx", "-.5em").attr("dy", "-.7em").style("text-anchor", "end").text(function () {
|
42959 | return levelTextFormat(0);
|
42960 | });
|
42961 | }
|
42962 |
|
42963 | levelEnter.append("text").attr("dx", "-.5em").style("text-anchor", "end").text(function (d) {
|
42964 | return levelTextFormat(state.current.dataMax / levelData.length * (d + 1));
|
42965 | });
|
42966 | }
|
42967 |
|
42968 | levelEnter.merge(level).attr("transform", function (d) {
|
42969 | return "translate(" + (width - levelRatio[d]) + ", " + (height - levelRatio[d]) + ")";
|
42970 | }).selectAll("polygon").attr("points", function (d) {
|
42971 | return points[d];
|
42972 | }); // update level text position
|
42973 |
|
42974 | if (showText) {
|
42975 | radarLevels.selectAll("text").attr("x", function (d) {
|
42976 | return isUndefined(d) ? width : points[d].split(",")[0];
|
42977 | }).attr("y", function (d) {
|
42978 | return isUndefined(d) ? height : 0;
|
42979 | });
|
42980 | }
|
42981 | },
|
42982 | updateRadarAxes: function updateRadarAxes() {
|
42983 | var $$ = this,
|
42984 | config = $$.config,
|
42985 | radar = $$.$el.radar,
|
42986 | _$$$getRadarSize4 = $$.getRadarSize(),
|
42987 | width = _$$$getRadarSize4[0],
|
42988 | height = _$$$getRadarSize4[1],
|
42989 | categories = config.axis_x_categories,
|
42990 | axis = radar.axes.selectAll("g").data(categories);
|
42991 |
|
42992 | axis.exit().remove();
|
42993 | var axisEnter = axis.enter().append("g").attr("class", function (d, i) {
|
42994 | return config_classes.axis + "-" + i;
|
42995 | });
|
42996 | config.radar_axis_line_show && axisEnter.append("line");
|
42997 | config.radar_axis_text_show && axisEnter.append("text");
|
42998 | axis = axisEnter.merge(axis); // axis line
|
42999 |
|
43000 | if (config.radar_axis_line_show) {
|
43001 | axis.select("line").attr("x1", width).attr("y1", height).attr("x2", function (d, i) {
|
43002 | return $$.getRadarPosition("x", i);
|
43003 | }).attr("y2", function (d, i) {
|
43004 | return $$.getRadarPosition("y", i);
|
43005 | });
|
43006 | } // axis text
|
43007 |
|
43008 |
|
43009 | if (config.radar_axis_text_show) {
|
43010 | var _config$radar_axis_te = config.radar_axis_text_position,
|
43011 | _config$radar_axis_te2 = _config$radar_axis_te.x,
|
43012 | x = _config$radar_axis_te2 === void 0 ? 0 : _config$radar_axis_te2,
|
43013 | _config$radar_axis_te3 = _config$radar_axis_te.y,
|
43014 | y = _config$radar_axis_te3 === void 0 ? 0 : _config$radar_axis_te3;
|
43015 | axis.select("text").style("text-anchor", "middle").attr("dy", ".5em").call(function (selection) {
|
43016 | selection.each(function (d) {
|
43017 | setTextValue(src_select(this), d + "", [-.6, 1.2]);
|
43018 | });
|
43019 | }).datum(function (d, i) {
|
43020 | return {
|
43021 | index: i
|
43022 | };
|
43023 | }).attr("transform", function (d) {
|
43024 | if (isUndefined(this.width)) {
|
43025 | // cache evaluated axis text width
|
43026 | this.width = this.getBoundingClientRect().width / 2;
|
43027 | }
|
43028 |
|
43029 | var posX = $$.getRadarPosition("x", d.index, undefined, 1),
|
43030 | posY = Math.round($$.getRadarPosition("y", d.index, undefined, 1));
|
43031 |
|
43032 | if (posX > width) {
|
43033 | posX += this.width + x;
|
43034 | } else if (Math.round(posX) < width) {
|
43035 | posX -= this.width + x;
|
43036 | }
|
43037 |
|
43038 | if (posY > height) {
|
43039 | // update vertical centered edge axis text dy position
|
43040 | if (posY / 2 === height && this.firstChild.tagName === "tspan") {
|
43041 | this.firstChild.setAttribute("dy", "0em");
|
43042 | }
|
43043 |
|
43044 | posY += y;
|
43045 | } else if (posY < height) {
|
43046 | posY -= y;
|
43047 | }
|
43048 |
|
43049 | return "translate(" + posX + " " + posY + ")";
|
43050 | });
|
43051 | }
|
43052 |
|
43053 | $$.bindEvent();
|
43054 | },
|
43055 | bindEvent: function bindEvent() {
|
43056 | var $$ = this,
|
43057 | config = $$.config,
|
43058 | state = $$.state,
|
43059 | _$$$$el2 = $$.$el,
|
43060 | radar = _$$$$el2.radar,
|
43061 | svg = _$$$$el2.svg,
|
43062 | focusOnly = config.point_focus_only,
|
43063 | _state = state,
|
43064 | inputType = _state.inputType,
|
43065 | transiting = _state.transiting;
|
43066 |
|
43067 | if (config.interaction_enabled) {
|
43068 | var isMouse = inputType === "mouse",
|
43069 | getIndex = function (event) {
|
43070 | var target = event.target; // in case of multilined axis text
|
43071 |
|
43072 | if (/tspan/i.test(target.tagName)) {
|
43073 | target = target.parentNode;
|
43074 | }
|
43075 |
|
43076 | var d = src_select(target).datum();
|
43077 | return d && Object.keys(d).length === 1 ? d.index : undefined;
|
43078 | },
|
43079 | hide = function (event) {
|
43080 | var index = getIndex(event),
|
43081 | noIndex = isUndefined(index);
|
43082 |
|
43083 | if (isMouse || noIndex) {
|
43084 | $$.hideTooltip();
|
43085 | focusOnly ? $$.hideCircleFocus() : $$.unexpandCircles();
|
43086 |
|
43087 | if (isMouse) {
|
43088 | $$.setOverOut(!1, index);
|
43089 | } else if (noIndex) {
|
43090 | $$.callOverOutForTouch();
|
43091 | }
|
43092 | }
|
43093 | };
|
43094 |
|
43095 | radar.axes.selectAll("text").on(isMouse ? "mouseover " : "touchstart", function (event) {
|
43096 | if (transiting) {
|
43097 | // skip while transiting
|
43098 | return;
|
43099 | }
|
43100 |
|
43101 | state.event = event;
|
43102 | var index = getIndex(event);
|
43103 | $$.selectRectForSingle(svg.node(), null, index);
|
43104 | isMouse ? $$.setOverOut(!0, index) : $$.callOverOutForTouch(index);
|
43105 | }).on("mouseout", isMouse ? hide : null);
|
43106 |
|
43107 | if (!isMouse) {
|
43108 | svg.on("touchstart", hide);
|
43109 | }
|
43110 | }
|
43111 | },
|
43112 | updateRadarShape: function updateRadarShape() {
|
43113 | var $$ = this,
|
43114 | targets = $$.data.targets.filter(function (d) {
|
43115 | return $$.isRadarType(d);
|
43116 | }),
|
43117 | points = $$.cache.get(cacheKey),
|
43118 | areas = $$.$el.radar.shapes.selectAll("polygon").data(targets),
|
43119 | areasEnter = areas.enter().append("g").attr("class", $$.getChartClass("Radar"));
|
43120 | $$.$T(areas.exit()).remove();
|
43121 | areasEnter.append("polygon").merge(areas).style("fill", $$.color).style("stroke", $$.color).attr("points", function (d) {
|
43122 | return points[d.id].join(" ");
|
43123 | });
|
43124 | $$.updateTargetForCircle(targets, areasEnter);
|
43125 | },
|
43126 |
|
43127 | /**
|
43128 | * Get data point x coordinate
|
43129 | * @param {object} d Data object
|
43130 | * @returns {number}
|
43131 | * @private
|
43132 | */
|
43133 | radarCircleX: function radarCircleX(d) {
|
43134 | return this.cache.get(cacheKey)[d.id][d.index][0];
|
43135 | },
|
43136 |
|
43137 | /**
|
43138 | * Get data point y coordinate
|
43139 | * @param {object} d Data object
|
43140 | * @returns {number}
|
43141 | * @private
|
43142 | */
|
43143 | radarCircleY: function radarCircleY(d) {
|
43144 | return this.cache.get(cacheKey)[d.id][d.index][1];
|
43145 | }
|
43146 | });
|
43147 | ;// CONCATENATED MODULE: ./src/config/Options/common/point.ts
|
43148 | /**
|
43149 | * Copyright (c) 2017 ~ present NAVER Corp.
|
43150 | * billboard.js project is licensed under the MIT license
|
43151 | */
|
43152 |
|
43153 | /**
|
43154 | * point config options
|
43155 | */
|
43156 | /* harmony default export */ var common_point = ({
|
43157 | /**
|
43158 | * Set point options
|
43159 | * @name point
|
43160 | * @memberof Options
|
43161 | * @type {object}
|
43162 | * @property {object} point Point object
|
43163 | * @property {boolean} [point.show=true] Whether to show each point in line.
|
43164 | * @property {number|Function} [point.r=2.5] The radius size of each point.
|
43165 | * - **NOTE:** Disabled for 'bubble' type
|
43166 | * @property {boolean} [point.focus.expand.enabled=true] Whether to expand each point on focus.
|
43167 | * @property {number} [point.focus.expand.r=point.r*1.75] The radius size of each point on focus.
|
43168 | * - **NOTE:** For 'bubble' type, the default is `bubbleSize*1.15`
|
43169 | * @property {boolean} [point.focus.only=false] Show point only when is focused.
|
43170 | * @property {number|null} [point.opacity=undefined] Set point opacity value.
|
43171 | * - **NOTE:**
|
43172 | * - `null` will make to not set inline 'opacity' css prop.
|
43173 | * - when no value(or undefined) is set, it defaults to set opacity value according its chart types.
|
43174 | * @property {number} [point.sensitivity=10] The senstivity value for interaction boundary.
|
43175 | * @property {number} [point.select.r=point.r*4] The radius size of each point on selected.
|
43176 | * @property {string} [point.type="circle"] The type of point to be drawn
|
43177 | * - **NOTE:**
|
43178 | * - If chart has 'bubble' type, only circle can be used.
|
43179 | * - For IE, non circle point expansions are not supported due to lack of transform support.
|
43180 | * - **Available Values:**
|
43181 | * - circle
|
43182 | * - rectangle
|
43183 | * @property {Array} [point.pattern=[]] The type of point or svg shape as string, to be drawn for each line
|
43184 | * - **NOTE:**
|
43185 | * - This is an `experimental` feature and can have some unexpected behaviors.
|
43186 | * - If chart has 'bubble' type, only circle can be used.
|
43187 | * - For IE, non circle point expansions are not supported due to lack of transform support.
|
43188 | * - **Available Values:**
|
43189 | * - circle
|
43190 | * - rectangle
|
43191 | * - svg shape tag interpreted as string<br>
|
43192 | * (ex. `<polygon points='2.5 0 0 5 5 5'></polygon>`)
|
43193 | * @see [Demo: point type](https://naver.github.io/billboard.js/demo/#Point.RectanglePoints)
|
43194 | * @see [Demo: point focus only](https://naver.github.io/billboard.js/demo/#Point.FocusOnly)
|
43195 | * @example
|
43196 | * point: {
|
43197 | * show: false,
|
43198 | * r: 5,
|
43199 | *
|
43200 | * // or customize the radius
|
43201 | * r: function(d) {
|
43202 | * ...
|
43203 | * return r;
|
43204 | * },
|
43205 | *
|
43206 | * focus: {
|
43207 | * expand: {
|
43208 | * enabled: true,
|
43209 | * r: 1
|
43210 | * },
|
43211 | * only: true
|
43212 | * },
|
43213 | *
|
43214 | * // do not set inline 'opacity' css prop setting
|
43215 | * opacity: null,
|
43216 | *
|
43217 | * // set every data point's opacity value
|
43218 | * opacity: 0.7,
|
43219 | *
|
43220 | * select: {
|
43221 | * r: 3
|
43222 | * },
|
43223 | *
|
43224 | * // having lower value, means how closer to be for interaction
|
43225 | * sensitivity: 3,
|
43226 | *
|
43227 | * // valid values are "circle" or "rectangle"
|
43228 | * type: "rectangle",
|
43229 | *
|
43230 | * // or indicate as pattern
|
43231 | * pattern: [
|
43232 | * "circle",
|
43233 | * "rectangle",
|
43234 | * "<polygon points='0 6 4 0 -4 0'></polygon>"
|
43235 | * ],
|
43236 | * }
|
43237 | */
|
43238 | point_show: !0,
|
43239 | point_r: 2.5,
|
43240 | point_sensitivity: 10,
|
43241 | point_focus_expand_enabled: !0,
|
43242 | point_focus_expand_r: undefined,
|
43243 | point_focus_only: !1,
|
43244 | point_opacity: undefined,
|
43245 | point_pattern: [],
|
43246 | point_select_r: undefined,
|
43247 | point_type: "circle"
|
43248 | });
|
43249 | ;// CONCATENATED MODULE: ./src/config/Options/shape/area.ts
|
43250 | /**
|
43251 | * Copyright (c) 2017 ~ present NAVER Corp.
|
43252 | * billboard.js project is licensed under the MIT license
|
43253 | */
|
43254 |
|
43255 | /**
|
43256 | * area config options
|
43257 | */
|
43258 | /* harmony default export */ var Options_shape_area = ({
|
43259 | /**
|
43260 | * Set area options
|
43261 | * @name area
|
43262 | * @memberof Options
|
43263 | * @type {object}
|
43264 | * @property {object} area Area object
|
43265 | * @property {boolean} [area.above=false] Set background area above the data chart line.
|
43266 | * @property {boolean} [area.front=true] Set area node to be positioned over line node.
|
43267 | * @property {boolean|object} [area.linearGradient=false] Set the linear gradient on area.<br><br>
|
43268 | * Or customize by giving below object value:
|
43269 | * - x {Array}: `x1`, `x2` value
|
43270 | * - y {Array}: `y1`, `y2` value
|
43271 | * - stops {Array}: Each item should be having `[offset, stop-color, stop-opacity]` values.
|
43272 | * @property {boolean} [area.zerobased=true] Set if min or max value will be 0 on area chart.
|
43273 | * @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)
|
43274 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Chart.AreaChart)
|
43275 | * @see [Demo: above](https://naver.github.io/billboard.js/demo/#AreaChartOptions.Above)
|
43276 | * @see [Demo: linearGradient](https://naver.github.io/billboard.js/demo/#AreaChartOptions.LinearGradient)
|
43277 | * @example
|
43278 | * area: {
|
43279 | * above: true,
|
43280 | * zerobased: false,
|
43281 | *
|
43282 | * // <g class='bb-areas'> will be positioned behind the line <g class='bb-lines'> in stacking order
|
43283 | * front: false,
|
43284 | *
|
43285 | * // will generate follwing linearGradient:
|
43286 | * // <linearGradient x1="0" x2="0" y1="0" y2="1">
|
43287 | * // <stop offset="0" stop-color="$DATA_COLOR" stop-opacity="1"></stop>
|
43288 | * // <stop offset="1" stop-color="$DATA_COLOR" stop-opacity="0"></stop>
|
43289 | * // </linearGradient>
|
43290 | * linearGradient: true,
|
43291 | *
|
43292 | * // Or customized gradient
|
43293 | * linearGradient: {
|
43294 | * x: [0, 0], // x1, x2 attributes
|
43295 | * y: [0, 0], // y1, y2 attributes
|
43296 | * stops: [
|
43297 | * // offset, stop-color, stop-opacity
|
43298 | * [0, "#7cb5ec", 1],
|
43299 | *
|
43300 | * // setting 'null' for stop-color, will set its original data color
|
43301 | * [0.5, null, 0],
|
43302 | *
|
43303 | * // setting 'function' for stop-color, will pass data id as argument.
|
43304 | * // It should return color string or null value
|
43305 | * [1, function(id) { return id === "data1" ? "red" : "blue"; }, 0],
|
43306 | * ]
|
43307 | * }
|
43308 | * }
|
43309 | */
|
43310 | area_above: !1,
|
43311 | area_front: !0,
|
43312 | area_linearGradient: !1,
|
43313 | area_zerobased: !0
|
43314 | });
|
43315 | ;// CONCATENATED MODULE: ./src/config/Options/shape/bar.ts
|
43316 | /**
|
43317 | * Copyright (c) 2017 ~ present NAVER Corp.
|
43318 | * billboard.js project is licensed under the MIT license
|
43319 | */
|
43320 |
|
43321 | /**
|
43322 | * bar config options
|
43323 | */
|
43324 | /* harmony default export */ var shape_bar = ({
|
43325 | /**
|
43326 | * Set bar options
|
43327 | * @name bar
|
43328 | * @memberof Options
|
43329 | * @type {object}
|
43330 | * @property {object} bar Bar object
|
43331 | * @property {number} [bar.label.threshold=0] Set threshold ratio to show/hide labels.
|
43332 | * @property {number} [bar.padding=0] The padding pixel value between each bar.
|
43333 | * @property {number} [bar.radius] Set the radius of bar edge in pixel.
|
43334 | * - **NOTE:** Works only for non-stacked bar
|
43335 | * @property {number} [bar.radius.ratio] Set the radius ratio of bar edge in relative the bar's width.
|
43336 | * @property {number} [bar.sensitivity=2] The senstivity offset value for interaction boundary.
|
43337 | * @property {number} [bar.width] Change the width of bar chart.
|
43338 | * @property {number} [bar.width.ratio=0.6] Change the width of bar chart by ratio.
|
43339 | * @property {number} [bar.width.max] The maximum width value for ratio.
|
43340 | * @property {number} [bar.width.dataname] Change the width of bar for indicated dataset only.
|
43341 | * - **NOTE:**
|
43342 | * - Works only for non-stacked bar
|
43343 | * - Bars are centered accoding its total width value
|
43344 | * @property {number} [bar.width.dataname.ratio=0.6] Change the width of bar chart by ratio.
|
43345 | * @property {number} [bar.width.dataname.max] The maximum width value for ratio.
|
43346 | * @property {boolean} [bar.zerobased=true] Set if min or max value will be 0 on bar chart.
|
43347 | * @see [Demo: bar padding](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarPadding)
|
43348 | * @see [Demo: bar radius](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarRadius)
|
43349 | * @see [Demo: bar width](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarWidth)
|
43350 | * @see [Demo: bar width variant](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarWidthVariant)
|
43351 | * @example
|
43352 | * bar: {
|
43353 | * padding: 1,
|
43354 | *
|
43355 | * // the 'radius' option can be used only for non-stacking bars
|
43356 | * radius: 10,
|
43357 | * // or
|
43358 | * radius: {
|
43359 | * ratio: 0.5
|
43360 | * }
|
43361 | *
|
43362 | * label: {
|
43363 | * // 0.1(10%) ratio value means, the minimum ratio to show text label relative to the y Axis domain range value.
|
43364 | * // if data value is below than 0.1, text label will be hidden.
|
43365 | * threshold: 0.1,
|
43366 | * },
|
43367 | *
|
43368 | * // will not have offset between each bar elements for interaction
|
43369 | * sensitivity: 0,
|
43370 | *
|
43371 | * width: 10,
|
43372 | *
|
43373 | * // or
|
43374 | * width: {
|
43375 | * ratio: 0.2,
|
43376 | * max: 20
|
43377 | * },
|
43378 | *
|
43379 | * // or specify width per dataset
|
43380 | * width: {
|
43381 | * data1: 20,
|
43382 | * data2: {
|
43383 | * ratio: 0.2,
|
43384 | * max: 20
|
43385 | * }
|
43386 | * },
|
43387 | *
|
43388 | * zerobased: false
|
43389 | * }
|
43390 | */
|
43391 | bar_label_threshold: 0,
|
43392 | bar_padding: 0,
|
43393 | bar_radius: undefined,
|
43394 | bar_radius_ratio: undefined,
|
43395 | bar_sensitivity: 2,
|
43396 | bar_width: undefined,
|
43397 | bar_width_ratio: .6,
|
43398 | bar_width_max: undefined,
|
43399 | bar_zerobased: !0
|
43400 | });
|
43401 | ;// CONCATENATED MODULE: ./src/config/Options/shape/bubble.ts
|
43402 | /**
|
43403 | * Copyright (c) 2017 ~ present NAVER Corp.
|
43404 | * billboard.js project is licensed under the MIT license
|
43405 | */
|
43406 |
|
43407 | /**
|
43408 | * bubble config options
|
43409 | */
|
43410 | /* harmony default export */ var shape_bubble = ({
|
43411 | /**
|
43412 | * Set bubble options
|
43413 | * @name bubble
|
43414 | * @memberof Options
|
43415 | * @type {object}
|
43416 | * @property {object} bubble bubble object
|
43417 | * @property {number|Function} [bubble.maxR=35] Set the max bubble radius value
|
43418 | * @property {boolean} [bubble.zerobased=false] Set if min or max value will be 0 on bubble chart.
|
43419 | * @example
|
43420 | * bubble: {
|
43421 | * // ex) If 100 is the highest value among data bound, the representation bubble of 100 will have radius of 50.
|
43422 | * // And the lesser will have radius relatively from tha max value.
|
43423 | * maxR: 50,
|
43424 | *
|
43425 | * // or set radius callback
|
43426 | * maxR: function(d) {
|
43427 | * // ex. of d param - {x: Fri Oct 06 2017 00:00:00 GMT+0900, value: 80, id: "data2", index: 5}
|
43428 | * ...
|
43429 | * return Math.sqrt(d.value * 2);
|
43430 | * },
|
43431 | * zerobased: false
|
43432 | * }
|
43433 | */
|
43434 | bubble_maxR: 35,
|
43435 | bubble_zerobased: !1
|
43436 | });
|
43437 | ;// CONCATENATED MODULE: ./src/config/Options/shape/candlestick.ts
|
43438 | /**
|
43439 | * Copyright (c) 2017 ~ present NAVER Corp.
|
43440 | * billboard.js project is licensed under the MIT license
|
43441 | */
|
43442 |
|
43443 | /**
|
43444 | * candlestick config options
|
43445 | */
|
43446 | /* harmony default export */ var shape_candlestick = ({
|
43447 | /**
|
43448 | * Set candlestick options
|
43449 | * @name candlestick
|
43450 | * @memberof Options
|
43451 | * @type {object}
|
43452 | * @property {object} candlestick Candlestick object
|
43453 | * @property {number} [candlestick.width] Change the width.
|
43454 | * @property {number} [candlestick.width.ratio=0.6] Change the width by ratio.
|
43455 | * @property {number} [candlestick.width.max] The maximum width value for ratio.
|
43456 | * @property {number} [candlestick.width.dataname] Change the width for indicated dataset only.
|
43457 | * @property {number} [candlestick.width.dataname.ratio=0.6] Change the width of bar chart by ratio.
|
43458 | * @property {number} [candlestick.width.dataname.max] The maximum width value for ratio.
|
43459 | * @property {object} [candlestick.color] Color setting.
|
43460 | * @property {string|object} [candlestick.color.down] Change down(bearish) value color.
|
43461 | * @property {string} [candlestick.color.down.dataname] Change down value color for indicated dataset only.
|
43462 | *
|
43463 | * @see [Demo](https://naver.github.io/billboard.js/demo/##Chart.CandlestickChart)
|
43464 | * @example
|
43465 | * candlestick: {
|
43466 | * width: 10,
|
43467 | *
|
43468 | * // or
|
43469 | * width: {
|
43470 | * ratio: 0.2,
|
43471 | * max: 20
|
43472 | * },
|
43473 | *
|
43474 | * // or specify width per dataset
|
43475 | * width: {
|
43476 | * data1: 20,
|
43477 | * data2: {
|
43478 | * ratio: 0.2,
|
43479 | * max: 20
|
43480 | * }
|
43481 | * },
|
43482 | * color: {
|
43483 | * // spcify bearish color
|
43484 | * down: "red",
|
43485 | *
|
43486 | * // or specify color per dataset
|
43487 | * down: {
|
43488 | * data1: "red",
|
43489 | * data2: "blue",
|
43490 | * }
|
43491 | * }
|
43492 | * }
|
43493 | */
|
43494 | candlestick_width: undefined,
|
43495 | candlestick_width_ratio: .6,
|
43496 | candlestick_width_max: undefined,
|
43497 | candlestick_color_down: "red"
|
43498 | });
|
43499 | ;// CONCATENATED MODULE: ./src/config/Options/shape/line.ts
|
43500 | /**
|
43501 | * Copyright (c) 2017 ~ present NAVER Corp.
|
43502 | * billboard.js project is licensed under the MIT license
|
43503 | */
|
43504 |
|
43505 | /**
|
43506 | * line config options
|
43507 | */
|
43508 | /* harmony default export */ var shape_line = ({
|
43509 | /**
|
43510 | * Set line options
|
43511 | * @name line
|
43512 | * @memberof Options
|
43513 | * @type {object}
|
43514 | * @property {object} line Line object
|
43515 | * @property {boolean} [line.connectNull=false] Set if null data point will be connected or not.<br>
|
43516 | * 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.
|
43517 | * @property {Array} [line.classes=undefined] If set, used to set a css class on each line.
|
43518 | * @property {boolean} [line.step.type=step] Change step type for step chart.<br>
|
43519 | * **Available values:**
|
43520 | * - step
|
43521 | * - step-before
|
43522 | * - step-after
|
43523 | * @property {boolean} [line.step.tooltipMatch=false] Set to `true` for `step-before` and `step-after` types to have cursor/tooltip match to hovered step's point instead of nearest point.
|
43524 | * @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.
|
43525 | * @property {boolean} [line.zerobased=false] Set if min or max value will be 0 on line chart.
|
43526 | * @example
|
43527 | * line: {
|
43528 | * connectNull: true,
|
43529 | * classes: [
|
43530 | * "line-class1",
|
43531 | * "line-class2"
|
43532 | * ],
|
43533 | * step: {
|
43534 | * type: "step-after",
|
43535 | *
|
43536 | * // to have cursor/tooltip match to hovered step's point instead of nearest point.
|
43537 | * tooltipMatch: true
|
43538 | * },
|
43539 | *
|
43540 | * // hide all data points ('point.show=false' also has similar effect)
|
43541 | * point: false,
|
43542 | *
|
43543 | * // show data points for only indicated datas
|
43544 | * point: [
|
43545 | * "data1", "data3"
|
43546 | * ],
|
43547 | *
|
43548 | * zerobased: false
|
43549 | * }
|
43550 | */
|
43551 | line_connectNull: !1,
|
43552 | line_step_type: "step",
|
43553 | line_step_tooltipMatch: !1,
|
43554 | line_zerobased: !1,
|
43555 | line_classes: undefined,
|
43556 | line_point: !0
|
43557 | });
|
43558 | ;// CONCATENATED MODULE: ./src/config/Options/shape/scatter.ts
|
43559 | /**
|
43560 | * Copyright (c) 2017 ~ present NAVER Corp.
|
43561 | * billboard.js project is licensed under the MIT license
|
43562 | */
|
43563 |
|
43564 | /**
|
43565 | * scatter config options
|
43566 | */
|
43567 | /* harmony default export */ var scatter = ({
|
43568 | /**
|
43569 | * Set scatter options
|
43570 | * @name scatter
|
43571 | * @memberof Options
|
43572 | * @type {object}
|
43573 | * @property {object} [scatter] scatter object
|
43574 | * @property {boolean} [scatter.zerobased=false] Set if min or max value will be 0 on scatter chart.
|
43575 | * @example
|
43576 | * scatter: {
|
43577 | * connectNull: true,
|
43578 | * step: {
|
43579 | * type: "step-after"
|
43580 | * },
|
43581 | *
|
43582 | * // hide all data points ('point.show=false' also has similar effect)
|
43583 | * point: false,
|
43584 | *
|
43585 | * // show data points for only indicated datas
|
43586 | * point: [
|
43587 | * "data1", "data3"
|
43588 | * ],
|
43589 | *
|
43590 | * zerobased: false
|
43591 | * }
|
43592 | */
|
43593 | scatter_zerobased: !1
|
43594 | });
|
43595 | ;// CONCATENATED MODULE: ./src/config/Options/shape/spline.ts
|
43596 | /**
|
43597 | * Copyright (c) 2017 ~ present NAVER Corp.
|
43598 | * billboard.js project is licensed under the MIT license
|
43599 | */
|
43600 |
|
43601 | /**
|
43602 | * x Axis config options
|
43603 | */
|
43604 | /* harmony default export */ var spline = ({
|
43605 | /**
|
43606 | * Set spline options
|
43607 | * - **Available interpolation type values:**
|
43608 | * - basis (d3.curveBasis)
|
43609 | * - basis-closed (d3.curveBasisClosed)
|
43610 | * - basis-open (d3.curveBasisOpen)
|
43611 | * - bundle (d3.curveBundle)
|
43612 | * - cardinal (d3.curveCardinal)
|
43613 | * - cardinal-closed (d3.curveCardinalClosed)
|
43614 | * - cardinal-open (d3.curveCardinalOpen)
|
43615 | * - catmull-rom (d3.curveCatmullRom)
|
43616 | * - catmull-rom-closed (d3.curveCatmullRomClosed)
|
43617 | * - catmull-rom-open (d3.curveCatmullRomOpen)
|
43618 | * - monotone-x (d3.curveMonotoneX)
|
43619 | * - monotone-y (d3.curveMonotoneY)
|
43620 | * - natural (d3.curveNatural)
|
43621 | * - linear-closed (d3.curveLinearClosed)
|
43622 | * - linear (d3.curveLinear)
|
43623 | * - step (d3.curveStep)
|
43624 | * - step-after (d3.curveStepAfter)
|
43625 | * - step-before (d3.curveStepBefore)
|
43626 | * @name spline
|
43627 | * @memberof Options
|
43628 | * @type {object}
|
43629 | * @property {object} spline Spline object
|
43630 | * @property {object} spline.interpolation Spline interpolation object
|
43631 | * @property {string} [spline.interpolation.type="cardinal"] Interpolation type
|
43632 | * @see [Interpolation (d3 v4)](http://bl.ocks.org/emmasaunders/c25a147970def2b02d8c7c2719dc7502)
|
43633 | * @example
|
43634 | * spline: {
|
43635 | * interpolation: {
|
43636 | * type: "cardinal"
|
43637 | * }
|
43638 | * }
|
43639 | */
|
43640 | spline_interpolation_type: "cardinal"
|
43641 | });
|
43642 | ;// CONCATENATED MODULE: ./src/config/Options/shape/donut.ts
|
43643 | /**
|
43644 | * Copyright (c) 2017 ~ present NAVER Corp.
|
43645 | * billboard.js project is licensed under the MIT license
|
43646 | */
|
43647 |
|
43648 | /**
|
43649 | * donut config options
|
43650 | */
|
43651 | /* harmony default export */ var donut = ({
|
43652 | /**
|
43653 | * Set donut options
|
43654 | * @name donut
|
43655 | * @memberof Options
|
43656 | * @type {object}
|
43657 | * @property {object} donut Donut object
|
43658 | * @property {boolean} [donut.label.show=true] Show or hide label on each donut piece.
|
43659 | * @property {Function} [donut.label.format] Set formatter for the label on each donut piece.
|
43660 | * @property {number} [donut.label.threshold=0.05] Set threshold ratio to show/hide labels.
|
43661 | * @property {number|Function} [donut.label.ratio=undefined] Set ratio of labels position.
|
43662 | * @property {boolean} [donut.expand=true] Enable or disable expanding donut pieces.
|
43663 | * @property {number} [donut.expand.rate=0.98] Set expand rate.
|
43664 | * @property {number} [donut.expand.duration=50] Set expand transition time in ms.
|
43665 | * @property {number} [donut.width] Set width of donut chart.
|
43666 | * @property {string} [donut.title=""] Set title of donut chart. Use `\n` character for line break.
|
43667 | * @property {number} [donut.padAngle=0] Set padding between data.
|
43668 | * @property {number} [donut.startingAngle=0] Set starting angle where data draws.
|
43669 | * @example
|
43670 | * donut: {
|
43671 | * label: {
|
43672 | * show: false,
|
43673 | * format: function(value, ratio, id) {
|
43674 | * return d3.format("$")(value);
|
43675 | *
|
43676 | * // to multiline, return with '\n' character
|
43677 | * // return value +"%\nLine1\n2Line2";
|
43678 | * },
|
43679 | *
|
43680 | * // 0.1(10%) ratio value means, the minimum ratio to show text label relative to the total value.
|
43681 | * // if data value is below than 0.1, text label will be hidden.
|
43682 | * threshold: 0.1,
|
43683 | *
|
43684 | * // set ratio callback. Should return ratio value
|
43685 | * ratio: function(d, radius, h) {
|
43686 | * ...
|
43687 | * return ratio;
|
43688 | * },
|
43689 | * // or set ratio number
|
43690 | * ratio: 0.5
|
43691 | * },
|
43692 | *
|
43693 | * // disable expand transition for interaction
|
43694 | * expand: false,
|
43695 | *
|
43696 | * expand: {
|
43697 | * // set duration of expand transition to 500ms.
|
43698 | * duration: 500,
|
43699 | *
|
43700 | * // set expand area rate
|
43701 | * rate: 1
|
43702 | * },
|
43703 | *
|
43704 | * width: 10,
|
43705 | * padAngle: 0.2,
|
43706 | * startingAngle: 1,
|
43707 | * title: "Donut Title"
|
43708 | *
|
43709 | * // title with line break
|
43710 | * title: "Title1\nTitle2"
|
43711 | * }
|
43712 | */
|
43713 | donut_label_show: !0,
|
43714 | donut_label_format: undefined,
|
43715 | donut_label_threshold: .05,
|
43716 | donut_label_ratio: undefined,
|
43717 | donut_width: undefined,
|
43718 | donut_title: "",
|
43719 | donut_expand: {},
|
43720 | donut_expand_rate: .98,
|
43721 | donut_expand_duration: 50,
|
43722 | donut_padAngle: 0,
|
43723 | donut_startingAngle: 0
|
43724 | });
|
43725 | ;// CONCATENATED MODULE: ./src/config/Options/shape/gauge.ts
|
43726 | /**
|
43727 | * Copyright (c) 2017 ~ present NAVER Corp.
|
43728 | * billboard.js project is licensed under the MIT license
|
43729 | */
|
43730 |
|
43731 | /**
|
43732 | * gauge config options
|
43733 | */
|
43734 | /* harmony default export */ var shape_gauge = ({
|
43735 | /**
|
43736 | * Set gauge options
|
43737 | * @name gauge
|
43738 | * @memberof Options
|
43739 | * @type {object}
|
43740 | * @property {object} gauge Gauge object
|
43741 | * @property {boolean} [gauge.background=""] Set background color. (The `.bb-chart-arcs-background` element)
|
43742 | * @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.
|
43743 | * @property {boolean} [gauge.label.show=true] Show or hide label on gauge.
|
43744 | * @property {Function} [gauge.label.format] Set formatter for the label on gauge. Label text can be multilined with `\n` character.<br>
|
43745 | * Will pass following arguments to the given function:
|
43746 | * - value {number}: absolute value
|
43747 | * - ratio {number}: value's ratio
|
43748 | * - id {string}: data's id value
|
43749 | * @property {Function} [gauge.label.extents] Set customized min/max label text.
|
43750 | * @property {number} [gauge.label.threshold=0] Set threshold ratio to show/hide labels.
|
43751 | * @property {boolean} [gauge.expand=true] Enable or disable expanding gauge.
|
43752 | * @property {number} [gauge.expand.rate=0.98] Set expand rate.
|
43753 | * @property {number} [gauge.expand.duration=50] Set the expand transition time in milliseconds.
|
43754 | * @property {number} [gauge.min=0] Set min value of the gauge.
|
43755 | * @property {number} [gauge.max=100] Set max value of the gauge.
|
43756 | * @property {number} [gauge.startingAngle=-1 * Math.PI / 2] Set starting angle where data draws.
|
43757 | *
|
43758 | * **Limitations:**
|
43759 | * - when `gauge.fullCircle=false`:
|
43760 | * - -1 * Math.PI / 2 <= startingAngle <= Math.PI / 2
|
43761 | * - `startingAngle <= -1 * Math.PI / 2` defaults to `-1 * Math.PI / 2`
|
43762 | * - `startingAngle >= Math.PI / 2` defaults to `Math.PI / 2`
|
43763 | * - when `gauge.fullCircle=true`:
|
43764 | * - -1 * Math.PI < startingAngle < Math.PI
|
43765 | * - `startingAngle < -1 * Math.PI` defaults to `Math.PI`
|
43766 | * - `startingAngle > Math.PI` defaults to `Math.PI`
|
43767 | * @property {number} [gauge.arcLength=100] Set the length of the arc to be drawn in percent from -100 to 100.<br>
|
43768 | * Negative value will draw the arc **counterclockwise**.
|
43769 | *
|
43770 | * **Limitations:**
|
43771 | * - -100 <= arcLength (in percent) <= 100
|
43772 | * - 'arcLength < -100' defaults to -100
|
43773 | * - 'arcLength > 100' defaults to 100
|
43774 | * @property {string} [gauge.title=""] Set title of gauge chart. Use `\n` character for line break.
|
43775 | * @property {string} [gauge.units] Set units of the gauge.
|
43776 | * @property {number} [gauge.width] Set width of gauge chart.
|
43777 | * @property {string} [gauge.type="single"] Set type of gauge to be displayed.<br><br>
|
43778 | * **Available Values:**
|
43779 | * - single
|
43780 | * - multi
|
43781 | * @property {string} [gauge.arcs.minWidth=5] Set minimal width of gauge arcs until the innerRadius disappears.
|
43782 | * @see [Demo: archLength](https://naver.github.io/billboard.js/demo/#GaugeChartOptions.GaugeArcLength)
|
43783 | * @see [Demo: startingAngle](https://naver.github.io/billboard.js/demo/#GaugeChartOptions.GaugeStartingAngle)
|
43784 | * @example
|
43785 | * gauge: {
|
43786 | * background: "#eee", // will set 'fill' css prop for '.bb-chart-arcs-background' classed element.
|
43787 | * fullCircle: false,
|
43788 | * label: {
|
43789 | * show: false,
|
43790 | * format: function(value, ratio, id) {
|
43791 | * return value;
|
43792 | *
|
43793 | * // to multiline, return with '\n' character
|
43794 | * // return value +"%\nLine1\n2Line2";
|
43795 | * },
|
43796 | *
|
43797 | * extents: function(value, isMax) {
|
43798 | * return (isMax ? "Max:" : "Min:") + value;
|
43799 | * },
|
43800 | *
|
43801 | * // 0.1(10%) ratio value means, the minimum ratio to show text label relative to the total value.
|
43802 | * // if data value is below than 0.1, text label will be hidden.
|
43803 | * threshold: 0.1,
|
43804 | * },
|
43805 | *
|
43806 | * // disable expand transition for interaction
|
43807 | * expand: false,
|
43808 | *
|
43809 | * expand: {
|
43810 | * // set duration of expand transition to 500ms.
|
43811 | * duration: 500,
|
43812 | *
|
43813 | * // set expand area rate
|
43814 | * rate: 1
|
43815 | * },
|
43816 | *
|
43817 | * min: -100,
|
43818 | * max: 200,
|
43819 | * type: "single" // or 'multi'
|
43820 | * title: "Title Text",
|
43821 | * units: "%",
|
43822 | * width: 10,
|
43823 | * startingAngle: -1 * Math.PI / 2,
|
43824 | * arcLength: 100,
|
43825 | * arcs: {
|
43826 | * minWidth: 5
|
43827 | * }
|
43828 | * }
|
43829 | */
|
43830 | gauge_background: "",
|
43831 | gauge_fullCircle: !1,
|
43832 | gauge_label_show: !0,
|
43833 | gauge_label_format: undefined,
|
43834 | gauge_label_extents: undefined,
|
43835 | gauge_label_threshold: 0,
|
43836 | gauge_min: 0,
|
43837 | gauge_max: 100,
|
43838 | gauge_type: "single",
|
43839 | gauge_startingAngle: -1 * Math.PI / 2,
|
43840 | gauge_arcLength: 100,
|
43841 | gauge_title: "",
|
43842 | gauge_units: undefined,
|
43843 | gauge_width: undefined,
|
43844 | gauge_arcs_minWidth: 5,
|
43845 | gauge_expand: {},
|
43846 | gauge_expand_rate: .98,
|
43847 | gauge_expand_duration: 50
|
43848 | });
|
43849 | ;// CONCATENATED MODULE: ./src/config/Options/shape/pie.ts
|
43850 | /**
|
43851 | * Copyright (c) 2017 ~ present NAVER Corp.
|
43852 | * billboard.js project is licensed under the MIT license
|
43853 | */
|
43854 |
|
43855 | /**
|
43856 | * x Axis config options
|
43857 | */
|
43858 | /* harmony default export */ var shape_pie = ({
|
43859 | /**
|
43860 | * Set pie options
|
43861 | * @name pie
|
43862 | * @memberof Options
|
43863 | * @type {object}
|
43864 | * @property {object} pie Pie object
|
43865 | * @property {boolean} [pie.label.show=true] Show or hide label on each pie piece.
|
43866 | * @property {Function} [pie.label.format] Set formatter for the label on each pie piece.
|
43867 | * @property {number} [pie.label.threshold=0.05] Set threshold ratio to show/hide labels.
|
43868 | * @property {number|Function} [pie.label.ratio=undefined] Set ratio of labels position.
|
43869 | * @property {boolean|object} [pie.expand=true] Enable or disable expanding pie pieces.
|
43870 | * @property {number} [pie.expand.rate=0.98] Set expand rate.
|
43871 | * @property {number} [pie.expand.duration=50] Set expand transition time in ms.
|
43872 | * @property {number|object} [pie.innerRadius=0] Sets the inner radius of pie arc.
|
43873 | * @property {number|object|undefined} [pie.outerRadius=undefined] Sets the outer radius of pie arc.
|
43874 | * @property {number} [pie.padAngle=0] Set padding between data.
|
43875 | * @property {number} [pie.padding=0] Sets the gap between pie arcs.
|
43876 | * @property {number} [pie.startingAngle=0] Set starting angle where data draws.
|
43877 | * @see [Demo: expand.rate](https://naver.github.io/billboard.js/demo/#PieChartOptions.ExpandRate)
|
43878 | * @see [Demo: innerRadius](https://naver.github.io/billboard.js/demo/#PieChartOptions.InnerRadius)
|
43879 | * @see [Demo: outerRadius](https://naver.github.io/billboard.js/demo/#PieChartOptions.OuterRadius)
|
43880 | * @see [Demo: startingAngle](https://naver.github.io/billboard.js/demo/#PieChartOptions.StartingAngle)
|
43881 | * @example
|
43882 | * pie: {
|
43883 | * label: {
|
43884 | * show: false,
|
43885 | * format: function(value, ratio, id) {
|
43886 | * return d3.format("$")(value);
|
43887 | *
|
43888 | * // to multiline, return with '\n' character
|
43889 | * // return value +"%\nLine1\n2Line2";
|
43890 | * },
|
43891 | *
|
43892 | * // 0.1(10%) ratio value means, the minimum ratio to show text label relative to the total value.
|
43893 | * // if data value is below than 0.1, text label will be hidden.
|
43894 | * threshold: 0.1,
|
43895 | *
|
43896 | * // set ratio callback. Should return ratio value
|
43897 | * ratio: function(d, radius, h) {
|
43898 | * ...
|
43899 | * return ratio;
|
43900 | * },
|
43901 | * // or set ratio number
|
43902 | * ratio: 0.5
|
43903 | * },
|
43904 | *
|
43905 | * // disable expand transition for interaction
|
43906 | * expand: false,
|
43907 | *
|
43908 | * expand: {
|
43909 | * // set duration of expand transition to 500ms.
|
43910 | * duration: 500,
|
43911 | *
|
43912 | * // set expand area rate
|
43913 | * rate: 1
|
43914 | * },
|
43915 | *
|
43916 | * innerRadius: 0,
|
43917 | *
|
43918 | * // set different innerRadius for each data
|
43919 | * innerRadius: {
|
43920 | * data1: 10,
|
43921 | * data2: 0
|
43922 | * },
|
43923 | *
|
43924 | * outerRadius: 100,
|
43925 | *
|
43926 | * // set different outerRadius for each data
|
43927 | * outerRadius: {
|
43928 | * data1: 50,
|
43929 | * data2: 100
|
43930 | * }
|
43931 | *
|
43932 | * padAngle: 0.1,
|
43933 | * padding: 0,
|
43934 | * startingAngle: 1
|
43935 | * }
|
43936 | */
|
43937 | pie_label_show: !0,
|
43938 | pie_label_format: undefined,
|
43939 | pie_label_threshold: .05,
|
43940 | pie_label_ratio: undefined,
|
43941 | pie_expand: {},
|
43942 | pie_expand_rate: .98,
|
43943 | pie_expand_duration: 50,
|
43944 | pie_innerRadius: 0,
|
43945 | pie_outerRadius: undefined,
|
43946 | pie_padAngle: 0,
|
43947 | pie_padding: 0,
|
43948 | pie_startingAngle: 0
|
43949 | });
|
43950 | ;// CONCATENATED MODULE: ./src/config/Options/shape/radar.ts
|
43951 | /**
|
43952 | * Copyright (c) 2017 ~ present NAVER Corp.
|
43953 | * billboard.js project is licensed under the MIT license
|
43954 | */
|
43955 |
|
43956 | /**
|
43957 | * x Axis config options
|
43958 | */
|
43959 | /* harmony default export */ var shape_radar = ({
|
43960 | /**
|
43961 | * Set radar options
|
43962 | * - **NOTE:**
|
43963 | * > When x tick text contains `\n`, it's used as line break.
|
43964 | * @name radar
|
43965 | * @memberof Options
|
43966 | * @type {object}
|
43967 | * @property {object} radar Radar object
|
43968 | * @property {number} [radar.axis.max=undefined] The max value of axis. If not given, it'll take the max value from the given data.
|
43969 | * @property {boolean} [radar.axis.line.show=true] Show or hide axis line.
|
43970 | * @property {number} [radar.axis.text.position.x=0] x coordinate position, relative the original.
|
43971 | * @property {number} [radar.axis.text.position.y=0] y coordinate position, relative the original.
|
43972 | * @property {boolean} [radar.axis.text.show=true] Show or hide axis text.
|
43973 | * @property {boolean} [radar.direction.clockwise=false] Set the direction to be drawn.
|
43974 | * @property {number} [radar.level.depth=3] Set the level depth.
|
43975 | * @property {boolean} [radar.level.show=true] Show or hide level.
|
43976 | * @property {Function} [radar.level.text.format] Set format function for the level value.<br>- Default value: `(x) => x % 1 === 0 ? x : x.toFixed(2)`
|
43977 | * @property {boolean} [radar.level.text.show=true] Show or hide level text.
|
43978 | * @property {number} [radar.size.ratio=0.87] Set size ratio.
|
43979 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Chart.RadarChart)
|
43980 | * @see [Demo: radar axis](https://naver.github.io/billboard.js/demo/#RadarChartOptions.RadarAxis)
|
43981 | * @see [Demo: radar level](https://naver.github.io/billboard.js/demo/#RadarChartOptions.RadarLevel)
|
43982 | * @see [Demo: radar size](https://naver.github.io/billboard.js/demo/#RadarChartOptions.RadarSize)
|
43983 | * @see [Demo: radar axis multiline](https://naver.github.io/billboard.js/demo/#RadarChartOptions.RadarAxisMultiline)
|
43984 | * @example
|
43985 | * radar: {
|
43986 | * axis: {
|
43987 | * max: 50,
|
43988 | * line: {
|
43989 | * show: false
|
43990 | * },
|
43991 | * text: {
|
43992 | * position: {
|
43993 | * x: 0,
|
43994 | * y: 0
|
43995 | * },
|
43996 | * show: false
|
43997 | * }
|
43998 | * },
|
43999 | * direction: {
|
44000 | * clockwise: true
|
44001 | * },
|
44002 | * level: {
|
44003 | * show: false,
|
44004 | * text: {
|
44005 | * format: function(x) {
|
44006 | * return x + "%";
|
44007 | * },
|
44008 | * show: true
|
44009 | * }
|
44010 | * },
|
44011 | * size: {
|
44012 | * ratio: 0.7
|
44013 | * }
|
44014 | * }
|
44015 | */
|
44016 | radar_axis_max: undefined,
|
44017 | radar_axis_line_show: !0,
|
44018 | radar_axis_text_show: !0,
|
44019 | radar_axis_text_position: {},
|
44020 | radar_level_depth: 3,
|
44021 | radar_level_show: !0,
|
44022 | radar_level_text_format: function radar_level_text_format(x) {
|
44023 | return x % 1 === 0 ? x : x.toFixed(2);
|
44024 | },
|
44025 | radar_level_text_show: !0,
|
44026 | radar_size_ratio: .87,
|
44027 | radar_direction_clockwise: !1
|
44028 | });
|
44029 | ;// CONCATENATED MODULE: ./src/config/resolver/shape.ts
|
44030 | /**
|
44031 | * Copyright (c) 2017 ~ present NAVER Corp.
|
44032 | * billboard.js project is licensed under the MIT license
|
44033 | */
|
44034 |
|
44035 |
|
44036 |
|
44037 |
|
44038 | // Axis
|
44039 |
|
44040 | // Shape
|
44041 |
|
44042 |
|
44043 |
|
44044 |
|
44045 |
|
44046 |
|
44047 |
|
44048 |
|
44049 |
|
44050 | // Options
|
44051 |
|
44052 |
|
44053 |
|
44054 |
|
44055 |
|
44056 |
|
44057 |
|
44058 |
|
44059 | // Non-Axis based
|
44060 |
|
44061 |
|
44062 |
|
44063 |
|
44064 |
|
44065 |
|
44066 | /**
|
44067 | * Extend Axis
|
44068 | * @param {Array} module Module to be extended
|
44069 | * @param {Array} option Option object to be extended
|
44070 | * @private
|
44071 | */
|
44072 |
|
44073 | function extendAxis(module, option) {
|
44074 | util_extend(ChartInternal.prototype, internal.concat(module));
|
44075 | util_extend(Chart.prototype, api);
|
44076 | Options.setOptions(options.concat(option || []));
|
44077 | }
|
44078 | /**
|
44079 | * Extend Line type modules
|
44080 | * @param {object} module Module to be extended
|
44081 | * @param {Array} option Option object to be extended
|
44082 | * @private
|
44083 | */
|
44084 |
|
44085 |
|
44086 | function extendLine(module, option) {
|
44087 | extendAxis([point, line].concat(module || []));
|
44088 | Options.setOptions([common_point, shape_line].concat(option || []));
|
44089 | }
|
44090 | /**
|
44091 | * Extend Arc type modules
|
44092 | * @param {Array} module Module to be extended
|
44093 | * @param {Array} option Option object to be extended
|
44094 | * @private
|
44095 | */
|
44096 |
|
44097 |
|
44098 | function extendArc(module, option) {
|
44099 | util_extend(ChartInternal.prototype, [arc].concat(module || []));
|
44100 | Options.setOptions(option);
|
44101 | } // Area types
|
44102 |
|
44103 |
|
44104 | var _area = function area() {
|
44105 | return extendLine(shape_area, [Options_shape_area]), (_area = function area() {
|
44106 | return TYPE.AREA;
|
44107 | })();
|
44108 | },
|
44109 | areaLineRange = function () {
|
44110 | return extendLine(shape_area, [Options_shape_area]), (areaLineRange = function () {
|
44111 | return TYPE.AREA_LINE_RANGE;
|
44112 | })();
|
44113 | },
|
44114 | areaSpline = function () {
|
44115 | return extendLine(shape_area, [Options_shape_area, spline]), (areaSpline = function () {
|
44116 | return TYPE.AREA_SPLINE;
|
44117 | })();
|
44118 | },
|
44119 | areaSplineRange = function () {
|
44120 | return extendLine(shape_area, [Options_shape_area, spline]), (areaSplineRange = function () {
|
44121 | return TYPE.AREA_SPLINE_RANGE;
|
44122 | })();
|
44123 | },
|
44124 | areaStep = function () {
|
44125 | return extendLine(shape_area, [Options_shape_area]), (areaStep = function () {
|
44126 | return TYPE.AREA_STEP;
|
44127 | })();
|
44128 | },
|
44129 | resolver_shape_line = function () {
|
44130 | return extendLine(), (resolver_shape_line = function () {
|
44131 | return TYPE.LINE;
|
44132 | })();
|
44133 | },
|
44134 | shape_spline = function () {
|
44135 | return extendLine(undefined, [spline]), (shape_spline = function () {
|
44136 | return TYPE.SPLINE;
|
44137 | })();
|
44138 | },
|
44139 | shape_step = function () {
|
44140 | return extendLine(), (shape_step = function () {
|
44141 | return TYPE.STEP;
|
44142 | })();
|
44143 | },
|
44144 | shape_donut = function () {
|
44145 | return extendArc(undefined, [donut]), (shape_donut = function () {
|
44146 | return TYPE.DONUT;
|
44147 | })();
|
44148 | },
|
44149 | resolver_shape_gauge = function () {
|
44150 | return extendArc([gauge], [shape_gauge]), (resolver_shape_gauge = function () {
|
44151 | return TYPE.GAUGE;
|
44152 | })();
|
44153 | },
|
44154 | resolver_shape_pie = function () {
|
44155 | return extendArc(undefined, [shape_pie]), (resolver_shape_pie = function () {
|
44156 | return TYPE.PIE;
|
44157 | })();
|
44158 | },
|
44159 | resolver_shape_radar = function () {
|
44160 | return extendArc([point, radar], [common_point, shape_radar]), (resolver_shape_radar = function () {
|
44161 | return TYPE.RADAR;
|
44162 | })();
|
44163 | },
|
44164 | resolver_shape_bar = function () {
|
44165 | return extendAxis([bar], shape_bar), (resolver_shape_bar = function () {
|
44166 | return TYPE.BAR;
|
44167 | })();
|
44168 | },
|
44169 | resolver_shape_bubble = function () {
|
44170 | return extendAxis([point, bubble], [shape_bubble, common_point]), (resolver_shape_bubble = function () {
|
44171 | return TYPE.BUBBLE;
|
44172 | })();
|
44173 | },
|
44174 | resolver_shape_candlestick = function () {
|
44175 | return extendAxis([candlestick], [shape_candlestick]), (resolver_shape_candlestick = function () {
|
44176 | return TYPE.CANDLESTICK;
|
44177 | })();
|
44178 | },
|
44179 | shape_scatter = function () {
|
44180 | return extendAxis([point], [common_point, scatter]), (shape_scatter = function () {
|
44181 | return TYPE.SCATTER;
|
44182 | })();
|
44183 | };
|
44184 | ;// CONCATENATED MODULE: ./src/Chart/api/selection.ts
|
44185 | /**
|
44186 | * Copyright (c) 2017 ~ present NAVER Corp.
|
44187 | * billboard.js project is licensed under the MIT license
|
44188 | */
|
44189 |
|
44190 |
|
44191 |
|
44192 | /* harmony default export */ var api_selection = ({
|
44193 | /**
|
44194 | * Get selected data points.<br><br>
|
44195 | * By this API, you can get selected data points information. To use this API, data.selection.enabled needs to be set true.
|
44196 | * @function selected
|
44197 | * @instance
|
44198 | * @memberof Chart
|
44199 | * @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.
|
44200 | * @returns {Array} dataPoint Array of the data points.<br>ex.) `[{x: 1, value: 200, id: "data1", index: 1, name: "data1"}, ...]`
|
44201 | * @example
|
44202 | * // all selected data points will be returned.
|
44203 | * chart.selected();
|
44204 | * // --> ex.) [{x: 1, value: 200, id: "data1", index: 1, name: "data1"}, ... ]
|
44205 | *
|
44206 | * // all selected data points of data1 will be returned.
|
44207 | * chart.selected("data1");
|
44208 | */
|
44209 | selected: function selected(targetId) {
|
44210 | var $$ = this.internal,
|
44211 | dataPoint = [];
|
44212 | $$.$el.main.selectAll("." + (config_classes.shapes + $$.getTargetSelectorSuffix(targetId))).selectAll("." + config_classes.shape).filter(function () {
|
44213 | return src_select(this).classed(config_classes.SELECTED);
|
44214 | }).each(function (d) {
|
44215 | return dataPoint.push(d);
|
44216 | });
|
44217 | return dataPoint;
|
44218 | },
|
44219 |
|
44220 | /**
|
44221 | * 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)
|
44222 | * @function select
|
44223 | * @instance
|
44224 | * @memberof Chart
|
44225 | * @param {string|Array} [ids] id value to get selected.
|
44226 | * @param {Array} [indices] The index array of data points. If falsy value given, will select all data points.
|
44227 | * @param {boolean} [resetOther] Unselect already selected.
|
44228 | * @example
|
44229 | * // select all data points
|
44230 | * chart.select();
|
44231 | *
|
44232 | * // select all from 'data2'
|
44233 | * chart.select("data2");
|
44234 | *
|
44235 | * // select all from 'data1' and 'data2'
|
44236 | * chart.select(["data1", "data2"]);
|
44237 | *
|
44238 | * // select from 'data1', indices 2 and unselect others selected
|
44239 | * chart.select("data1", [2], true);
|
44240 | *
|
44241 | * // select from 'data1', indices 0, 3 and 5
|
44242 | * chart.select("data1", [0, 3, 5]);
|
44243 | */
|
44244 | select: function select(ids, indices, resetOther) {
|
44245 | var $$ = this.internal,
|
44246 | config = $$.config,
|
44247 | $el = $$.$el;
|
44248 |
|
44249 | if (!config.data_selection_enabled) {
|
44250 | return;
|
44251 | }
|
44252 |
|
44253 | $el.main.selectAll("." + config_classes.shapes).selectAll("." + config_classes.shape).each(function (d, i) {
|
44254 | var shape = src_select(this),
|
44255 | id = d.data ? d.data.id : d.id,
|
44256 | toggle = $$.getToggle(this, d).bind($$),
|
44257 | isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0,
|
44258 | isTargetIndex = !indices || indices.indexOf(i) >= 0,
|
44259 | isSelected = shape.classed(config_classes.SELECTED);
|
44260 |
|
44261 | // line/area selection not supported yet
|
44262 | if (shape.classed(config_classes.line) || shape.classed(config_classes.area)) {
|
44263 | return;
|
44264 | }
|
44265 |
|
44266 | if (isTargetId && isTargetIndex) {
|
44267 | if (config.data_selection_isselectable.bind($$.api)(d) && !isSelected) {
|
44268 | toggle(!0, shape.classed(config_classes.SELECTED, !0), d, i);
|
44269 | }
|
44270 | } else if (isDefined(resetOther) && resetOther && isSelected) {
|
44271 | toggle(!1, shape.classed(config_classes.SELECTED, !1), d, i);
|
44272 | }
|
44273 | });
|
44274 | },
|
44275 |
|
44276 | /**
|
44277 | * Set data points to be un-selected.
|
44278 | * @function unselect
|
44279 | * @instance
|
44280 | * @memberof Chart
|
44281 | * @param {string|Array} [ids] id value to be unselected.
|
44282 | * @param {Array} [indices] The index array of data points. If falsy value given, will select all data points.
|
44283 | * @example
|
44284 | * // unselect all data points
|
44285 | * chart.unselect();
|
44286 | *
|
44287 | * // unselect all from 'data1'
|
44288 | * chart.unselect("data1");
|
44289 | *
|
44290 | * // unselect from 'data1', indices 2
|
44291 | * chart.unselect("data1", [2]);
|
44292 | */
|
44293 | unselect: function unselect(ids, indices) {
|
44294 | var $$ = this.internal,
|
44295 | config = $$.config,
|
44296 | $el = $$.$el;
|
44297 |
|
44298 | if (!config.data_selection_enabled) {
|
44299 | return;
|
44300 | }
|
44301 |
|
44302 | $el.main.selectAll("." + config_classes.shapes).selectAll("." + config_classes.shape).each(function (d, i) {
|
44303 | var shape = src_select(this),
|
44304 | id = d.data ? d.data.id : d.id,
|
44305 | toggle = $$.getToggle(this, d).bind($$),
|
44306 | isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0,
|
44307 | isTargetIndex = !indices || indices.indexOf(i) >= 0,
|
44308 | isSelected = shape.classed(config_classes.SELECTED);
|
44309 |
|
44310 | // line/area selection not supported yet
|
44311 | if (shape.classed(config_classes.line) || shape.classed(config_classes.area)) {
|
44312 | return;
|
44313 | }
|
44314 |
|
44315 | if (isTargetId && isTargetIndex && config.data_selection_isselectable.bind($$.api)(d) && isSelected) {
|
44316 | toggle(!1, shape.classed(config_classes.SELECTED, !1), d, i);
|
44317 | }
|
44318 | });
|
44319 | }
|
44320 | });
|
44321 | ;// CONCATENATED MODULE: ./src/Chart/api/subchart.ts
|
44322 | /**
|
44323 | * Copyright (c) 2017 ~ present NAVER Corp.
|
44324 | * billboard.js project is licensed under the MIT license
|
44325 | */
|
44326 |
|
44327 | /* harmony default export */ var subchart = ({
|
44328 | subchart: {
|
44329 | /**
|
44330 | * Show subchart
|
44331 | * - **NOTE:** for ESM imports, needs to import 'subchart' exports and instantiate it by calling `subchart()`.
|
44332 | * @function subchart․show
|
44333 | * @instance
|
44334 | * @memberof Chart
|
44335 | * @example
|
44336 | * // for ESM imports, needs to import 'subchart' and must be instantiated first to enable subchart's API.
|
44337 | * import {subchart} from "billboard.js";
|
44338 | *
|
44339 | * const chart = bb.generate({
|
44340 | * ...
|
44341 | * subchart: {
|
44342 | * // need to be instantiated by calling 'subchart()'
|
44343 | * enabled: subchart()
|
44344 | *
|
44345 | * // in case don't want subchart to be shown at initialization, instantiate with '!subchart()'
|
44346 | * enabled: !subchart()
|
44347 | * }
|
44348 | * });
|
44349 | *
|
44350 | * chart.subchart.show();
|
44351 | */
|
44352 | show: function () {
|
44353 | var $$ = this.internal,
|
44354 | subchart = $$.$el.subchart,
|
44355 | config = $$.config,
|
44356 | show = config.subchart_show;
|
44357 |
|
44358 | if (!show) {
|
44359 | // unbind zoom event bound to chart rect area
|
44360 | $$.unbindZoomEvent();
|
44361 | config.subchart_show = !show;
|
44362 | subchart.main || $$.initSubchart();
|
44363 | var $target = subchart.main.selectAll("." + config_classes.target); // need to cover when new data has been loaded
|
44364 |
|
44365 | if ($$.data.targets.length !== $target.size()) {
|
44366 | $$.updateSizes();
|
44367 | $$.updateTargetsForSubchart($$.data.targets);
|
44368 | $target = subchart.main.selectAll("." + config_classes.target);
|
44369 | }
|
44370 |
|
44371 | $target.style("opacity", null);
|
44372 | subchart.main.style("display", null);
|
44373 | this.flush();
|
44374 | }
|
44375 | },
|
44376 |
|
44377 | /**
|
44378 | * Hide generated subchart
|
44379 | * - **NOTE:** for ESM imports, needs to import 'subchart' exports and instantiate it by calling `subchart()`.
|
44380 | * @function subchart․hide
|
44381 | * @instance
|
44382 | * @memberof Chart
|
44383 | * @example
|
44384 | * chart.subchart.hide();
|
44385 | */
|
44386 | hide: function hide() {
|
44387 | var $$ = this.internal,
|
44388 | subchart = $$.$el.subchart,
|
44389 | config = $$.config;
|
44390 |
|
44391 | if (config.subchart_show && subchart.main.style("display") !== "none") {
|
44392 | config.subchart_show = !1;
|
44393 | subchart.main.style("display", "none");
|
44394 | this.flush();
|
44395 | }
|
44396 | },
|
44397 |
|
44398 | /**
|
44399 | * Toggle the visiblity of subchart
|
44400 | * - **NOTE:** for ESM imports, needs to import 'subchart' exports and instantiate it by calling `subchart()`.
|
44401 | * @function subchart․toggle
|
44402 | * @instance
|
44403 | * @memberof Chart
|
44404 | * @example
|
44405 | * // When subchart is hidden, will be shown
|
44406 | * // When subchart is shown, will be hidden
|
44407 | * chart.subchart.toggle();
|
44408 | */
|
44409 | toggle: function toggle() {
|
44410 | var $$ = this.internal,
|
44411 | config = $$.config;
|
44412 | this.subchart[config.subchart_show ? "hide" : "show"]();
|
44413 | }
|
44414 | }
|
44415 | });
|
44416 | ;// CONCATENATED MODULE: ./node_modules/d3-interpolate/src/zoom.js
|
44417 | var epsilon2 = 1e-12;
|
44418 |
|
44419 | function cosh(x) {
|
44420 | return ((x = Math.exp(x)) + 1 / x) / 2;
|
44421 | }
|
44422 |
|
44423 | function sinh(x) {
|
44424 | return ((x = Math.exp(x)) - 1 / x) / 2;
|
44425 | }
|
44426 |
|
44427 | function tanh(x) {
|
44428 | return ((x = Math.exp(2 * x)) - 1) / (x + 1);
|
44429 | }
|
44430 |
|
44431 | /* harmony default export */ var src_zoom = ((function zoomRho(rho, rho2, rho4) {
|
44432 | // p0 = [ux0, uy0, w0]
|
44433 | // p1 = [ux1, uy1, w1]
|
44434 | function zoom(p0, p1) {
|
44435 | var ux0 = p0[0],
|
44436 | uy0 = p0[1],
|
44437 | w0 = p0[2],
|
44438 | ux1 = p1[0],
|
44439 | uy1 = p1[1],
|
44440 | w1 = p1[2],
|
44441 | dx = ux1 - ux0,
|
44442 | dy = uy1 - uy0,
|
44443 | d2 = dx * dx + dy * dy,
|
44444 | i,
|
44445 | S; // Special case for u0 ≅ u1.
|
44446 |
|
44447 | if (d2 < epsilon2) {
|
44448 | S = Math.log(w1 / w0) / rho;
|
44449 |
|
44450 | i = function (t) {
|
44451 | return [ux0 + t * dx, uy0 + t * dy, w0 * Math.exp(rho * t * S)];
|
44452 | };
|
44453 | } // General case.
|
44454 | else {
|
44455 | var d1 = Math.sqrt(d2),
|
44456 | b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),
|
44457 | b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),
|
44458 | r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),
|
44459 | r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
|
44460 | S = (r1 - r0) / rho;
|
44461 |
|
44462 | i = function (t) {
|
44463 | var s = t * S,
|
44464 | coshr0 = cosh(r0),
|
44465 | u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));
|
44466 | return [ux0 + u * dx, uy0 + u * dy, w0 * coshr0 / cosh(rho * s + r0)];
|
44467 | };
|
44468 | }
|
44469 |
|
44470 | i.duration = S * 1e3 * rho / Math.SQRT2;
|
44471 | return i;
|
44472 | }
|
44473 |
|
44474 | zoom.rho = function (_) {
|
44475 | var _1 = Math.max(1e-3, +_),
|
44476 | _2 = _1 * _1;
|
44477 |
|
44478 | return zoomRho(_1, _2, _2 * _2);
|
44479 | };
|
44480 |
|
44481 | return zoom;
|
44482 | })(Math.SQRT2, 2, 4));
|
44483 | ;// CONCATENATED MODULE: ./node_modules/d3-zoom/src/constant.js
|
44484 | /* harmony default export */ var d3_zoom_src_constant = (function (x) {
|
44485 | return function () {
|
44486 | return x;
|
44487 | };
|
44488 | });
|
44489 | ;// CONCATENATED MODULE: ./node_modules/d3-zoom/src/event.js
|
44490 | function ZoomEvent(type, _ref) {
|
44491 | var sourceEvent = _ref.sourceEvent,
|
44492 | target = _ref.target,
|
44493 | transform = _ref.transform,
|
44494 | dispatch = _ref.dispatch;
|
44495 | Object.defineProperties(this, {
|
44496 | type: {
|
44497 | value: type,
|
44498 | enumerable: !0,
|
44499 | configurable: !0
|
44500 | },
|
44501 | sourceEvent: {
|
44502 | value: sourceEvent,
|
44503 | enumerable: !0,
|
44504 | configurable: !0
|
44505 | },
|
44506 | target: {
|
44507 | value: target,
|
44508 | enumerable: !0,
|
44509 | configurable: !0
|
44510 | },
|
44511 | transform: {
|
44512 | value: transform,
|
44513 | enumerable: !0,
|
44514 | configurable: !0
|
44515 | },
|
44516 | _: {
|
44517 | value: dispatch
|
44518 | }
|
44519 | });
|
44520 | }
|
44521 | ;// CONCATENATED MODULE: ./node_modules/d3-zoom/src/transform.js
|
44522 | function Transform(k, x, y) {
|
44523 | this.k = k;
|
44524 | this.x = x;
|
44525 | this.y = y;
|
44526 | }
|
44527 | Transform.prototype = {
|
44528 | constructor: Transform,
|
44529 | scale: function scale(k) {
|
44530 | return k === 1 ? this : new Transform(this.k * k, this.x, this.y);
|
44531 | },
|
44532 | translate: function translate(x, y) {
|
44533 | return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y);
|
44534 | },
|
44535 | apply: function apply(point) {
|
44536 | return [point[0] * this.k + this.x, point[1] * this.k + this.y];
|
44537 | },
|
44538 | applyX: function applyX(x) {
|
44539 | return x * this.k + this.x;
|
44540 | },
|
44541 | applyY: function applyY(y) {
|
44542 | return y * this.k + this.y;
|
44543 | },
|
44544 | invert: function invert(location) {
|
44545 | return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];
|
44546 | },
|
44547 | invertX: function invertX(x) {
|
44548 | return (x - this.x) / this.k;
|
44549 | },
|
44550 | invertY: function invertY(y) {
|
44551 | return (y - this.y) / this.k;
|
44552 | },
|
44553 | rescaleX: function rescaleX(x) {
|
44554 | return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x));
|
44555 | },
|
44556 | rescaleY: function rescaleY(y) {
|
44557 | return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y));
|
44558 | },
|
44559 | toString: function toString() {
|
44560 | return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
|
44561 | }
|
44562 | };
|
44563 | var transform_identity = new Transform(1, 0, 0);
|
44564 | transform_transform.prototype = Transform.prototype;
|
44565 | function transform_transform(node) {
|
44566 | while (!node.__zoom) {
|
44567 | if (!(node = node.parentNode)) return transform_identity;
|
44568 | }
|
44569 |
|
44570 | return node.__zoom;
|
44571 | }
|
44572 | ;// CONCATENATED MODULE: ./node_modules/d3-zoom/src/noevent.js
|
44573 | function src_noevent_nopropagation(event) {
|
44574 | event.stopImmediatePropagation();
|
44575 | }
|
44576 | /* harmony default export */ function d3_zoom_src_noevent(event) {
|
44577 | event.preventDefault();
|
44578 | event.stopImmediatePropagation();
|
44579 | }
|
44580 | ;// CONCATENATED MODULE: ./node_modules/d3-zoom/src/zoom.js
|
44581 |
|
44582 |
|
44583 |
|
44584 |
|
44585 |
|
44586 |
|
44587 |
|
44588 |
|
44589 | // Ignore right-click, since that should open the context menu.
|
44590 | // except for pinch-to-zoom, which is sent as a wheel+ctrlKey event
|
44591 |
|
44592 | function zoom_defaultFilter(event) {
|
44593 | return (!event.ctrlKey || event.type === 'wheel') && !event.button;
|
44594 | }
|
44595 |
|
44596 | function zoom_defaultExtent() {
|
44597 | var e = this;
|
44598 |
|
44599 | if (e instanceof SVGElement) {
|
44600 | e = e.ownerSVGElement || e;
|
44601 |
|
44602 | if (e.hasAttribute("viewBox")) {
|
44603 | e = e.viewBox.baseVal;
|
44604 | return [[e.x, e.y], [e.x + e.width, e.y + e.height]];
|
44605 | }
|
44606 |
|
44607 | return [[0, 0], [e.width.baseVal.value, e.height.baseVal.value]];
|
44608 | }
|
44609 |
|
44610 | return [[0, 0], [e.clientWidth, e.clientHeight]];
|
44611 | }
|
44612 |
|
44613 | function defaultTransform() {
|
44614 | return this.__zoom || transform_identity;
|
44615 | }
|
44616 |
|
44617 | function defaultWheelDelta(event) {
|
44618 | return -event.deltaY * (event.deltaMode === 1 ? .05 : event.deltaMode ? 1 : .002) * (event.ctrlKey ? 10 : 1);
|
44619 | }
|
44620 |
|
44621 | function zoom_defaultTouchable() {
|
44622 | return navigator.maxTouchPoints || "ontouchstart" in this;
|
44623 | }
|
44624 |
|
44625 | function defaultConstrain(transform, extent, translateExtent) {
|
44626 | var dx0 = transform.invertX(extent[0][0]) - translateExtent[0][0],
|
44627 | dx1 = transform.invertX(extent[1][0]) - translateExtent[1][0],
|
44628 | dy0 = transform.invertY(extent[0][1]) - translateExtent[0][1],
|
44629 | dy1 = transform.invertY(extent[1][1]) - translateExtent[1][1];
|
44630 | 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));
|
44631 | }
|
44632 |
|
44633 | /* harmony default export */ function d3_zoom_src_zoom() {
|
44634 | var filter = zoom_defaultFilter,
|
44635 | extent = zoom_defaultExtent,
|
44636 | constrain = defaultConstrain,
|
44637 | wheelDelta = defaultWheelDelta,
|
44638 | touchable = zoom_defaultTouchable,
|
44639 | scaleExtent = [0, Infinity],
|
44640 | translateExtent = [[-Infinity, -Infinity], [Infinity, Infinity]],
|
44641 | duration = 250,
|
44642 | interpolate = src_zoom,
|
44643 | listeners = src_dispatch("start", "zoom", "end"),
|
44644 | touchstarting,
|
44645 | touchfirst,
|
44646 | touchending,
|
44647 | clickDistance2 = 0,
|
44648 | tapDistance = 10;
|
44649 |
|
44650 | function zoom(selection) {
|
44651 | selection.property("__zoom", defaultTransform).on("wheel.zoom", wheeled, {
|
44652 | passive: !1
|
44653 | }).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)");
|
44654 | }
|
44655 |
|
44656 | zoom.transform = function (collection, transform, point, event) {
|
44657 | var selection = collection.selection ? collection.selection() : collection;
|
44658 | selection.property("__zoom", defaultTransform);
|
44659 |
|
44660 | if (collection !== selection) {
|
44661 | schedule(collection, transform, point, event);
|
44662 | } else {
|
44663 | selection.interrupt().each(function () {
|
44664 | gesture(this, arguments).event(event).start().zoom(null, typeof transform === "function" ? transform.apply(this, arguments) : transform).end();
|
44665 | });
|
44666 | }
|
44667 | };
|
44668 |
|
44669 | zoom.scaleBy = function (selection, k, p, event) {
|
44670 | zoom.scaleTo(selection, function () {
|
44671 | var k0 = this.__zoom.k,
|
44672 | k1 = typeof k === "function" ? k.apply(this, arguments) : k;
|
44673 | return k0 * k1;
|
44674 | }, p, event);
|
44675 | };
|
44676 |
|
44677 | zoom.scaleTo = function (selection, k, p, event) {
|
44678 | zoom.transform(selection, function () {
|
44679 | var e = extent.apply(this, arguments),
|
44680 | t0 = this.__zoom,
|
44681 | p0 = p == null ? centroid(e) : typeof p === "function" ? p.apply(this, arguments) : p,
|
44682 | p1 = t0.invert(p0),
|
44683 | k1 = typeof k === "function" ? k.apply(this, arguments) : k;
|
44684 | return constrain(translate(scale(t0, k1), p0, p1), e, translateExtent);
|
44685 | }, p, event);
|
44686 | };
|
44687 |
|
44688 | zoom.translateBy = function (selection, x, y, event) {
|
44689 | zoom.transform(selection, function () {
|
44690 | 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);
|
44691 | }, null, event);
|
44692 | };
|
44693 |
|
44694 | zoom.translateTo = function (selection, x, y, p, event) {
|
44695 | zoom.transform(selection, function () {
|
44696 | var e = extent.apply(this, arguments),
|
44697 | t = this.__zoom,
|
44698 | p0 = p == null ? centroid(e) : typeof p === "function" ? p.apply(this, arguments) : p;
|
44699 | 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);
|
44700 | }, p, event);
|
44701 | };
|
44702 |
|
44703 | function scale(transform, k) {
|
44704 | k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k));
|
44705 | return k === transform.k ? transform : new Transform(k, transform.x, transform.y);
|
44706 | }
|
44707 |
|
44708 | function translate(transform, p0, p1) {
|
44709 | var x = p0[0] - p1[0] * transform.k,
|
44710 | y = p0[1] - p1[1] * transform.k;
|
44711 | return x === transform.x && y === transform.y ? transform : new Transform(transform.k, x, y);
|
44712 | }
|
44713 |
|
44714 | function centroid(extent) {
|
44715 | return [(+extent[0][0] + +extent[1][0]) / 2, (+extent[0][1] + +extent[1][1]) / 2];
|
44716 | }
|
44717 |
|
44718 | function schedule(transition, transform, point, event) {
|
44719 | transition.on("start.zoom", function () {
|
44720 | gesture(this, arguments).event(event).start();
|
44721 | }).on("interrupt.zoom end.zoom", function () {
|
44722 | gesture(this, arguments).event(event).end();
|
44723 | }).tween("zoom", function () {
|
44724 | var that = this,
|
44725 | args = arguments,
|
44726 | g = gesture(that, args).event(event),
|
44727 | e = extent.apply(that, args),
|
44728 | p = point == null ? centroid(e) : typeof point === "function" ? point.apply(that, args) : point,
|
44729 | w = Math.max(e[1][0] - e[0][0], e[1][1] - e[0][1]),
|
44730 | a = that.__zoom,
|
44731 | b = typeof transform === "function" ? transform.apply(that, args) : transform,
|
44732 | i = interpolate(a.invert(p).concat(w / a.k), b.invert(p).concat(w / b.k));
|
44733 | return function (t) {
|
44734 | if (t === 1) t = b; // Avoid rounding error on end.
|
44735 | else {
|
44736 | var l = i(t),
|
44737 | k = w / l[2];
|
44738 | t = new Transform(k, p[0] - l[0] * k, p[1] - l[1] * k);
|
44739 | }
|
44740 | g.zoom(null, t);
|
44741 | };
|
44742 | });
|
44743 | }
|
44744 |
|
44745 | function gesture(that, args, clean) {
|
44746 | return !clean && that.__zooming || new Gesture(that, args);
|
44747 | }
|
44748 |
|
44749 | function Gesture(that, args) {
|
44750 | this.that = that;
|
44751 | this.args = args;
|
44752 | this.active = 0;
|
44753 | this.sourceEvent = null;
|
44754 | this.extent = extent.apply(that, args);
|
44755 | this.taps = 0;
|
44756 | }
|
44757 |
|
44758 | Gesture.prototype = {
|
44759 | event: function event(_event) {
|
44760 | if (_event) this.sourceEvent = _event;
|
44761 | return this;
|
44762 | },
|
44763 | start: function start() {
|
44764 | if (++this.active === 1) {
|
44765 | this.that.__zooming = this;
|
44766 | this.emit("start");
|
44767 | }
|
44768 |
|
44769 | return this;
|
44770 | },
|
44771 | zoom: function (key, transform) {
|
44772 | if (this.mouse && key !== "mouse") this.mouse[1] = transform.invert(this.mouse[0]);
|
44773 | if (this.touch0 && key !== "touch") this.touch0[1] = transform.invert(this.touch0[0]);
|
44774 | if (this.touch1 && key !== "touch") this.touch1[1] = transform.invert(this.touch1[0]);
|
44775 | this.that.__zoom = transform;
|
44776 | this.emit("zoom");
|
44777 | return this;
|
44778 | },
|
44779 | end: function end() {
|
44780 | if (--this.active === 0) {
|
44781 | delete this.that.__zooming;
|
44782 | this.emit("end");
|
44783 | }
|
44784 |
|
44785 | return this;
|
44786 | },
|
44787 | emit: function emit(type) {
|
44788 | var d = src_select(this.that).datum();
|
44789 | listeners.call(type, this.that, new ZoomEvent(type, {
|
44790 | sourceEvent: this.sourceEvent,
|
44791 | target: zoom,
|
44792 | type: type,
|
44793 | transform: this.that.__zoom,
|
44794 | dispatch: listeners
|
44795 | }), d);
|
44796 | }
|
44797 | };
|
44798 |
|
44799 | function wheeled(event) {
|
44800 | for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
44801 | args[_key - 1] = arguments[_key];
|
44802 | }
|
44803 |
|
44804 | if (!filter.apply(this, arguments)) return;
|
44805 | var g = gesture(this, args).event(event),
|
44806 | t = this.__zoom,
|
44807 | k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t.k * Math.pow(2, wheelDelta.apply(this, arguments)))),
|
44808 | p = src_pointer(event); // If the mouse is in the same location as before, reuse it.
|
44809 | // If there were recent wheel events, reset the wheel idle timeout.
|
44810 |
|
44811 | if (g.wheel) {
|
44812 | if (g.mouse[0][0] !== p[0] || g.mouse[0][1] !== p[1]) {
|
44813 | g.mouse[1] = t.invert(g.mouse[0] = p);
|
44814 | }
|
44815 |
|
44816 | clearTimeout(g.wheel);
|
44817 | } // If this wheel event won’t trigger a transform change, ignore it.
|
44818 | else if (t.k === k) return; // Otherwise, capture the mouse point and location at the start.
|
44819 | else {
|
44820 | g.mouse = [p, t.invert(p)];
|
44821 | interrupt(this);
|
44822 | g.start();
|
44823 | }
|
44824 |
|
44825 | d3_zoom_src_noevent(event);
|
44826 | g.wheel = setTimeout(function () {
|
44827 | g.wheel = null;
|
44828 | g.end();
|
44829 | }, 150);
|
44830 | g.zoom("mouse", constrain(translate(scale(t, k), g.mouse[0], g.mouse[1]), g.extent, translateExtent));
|
44831 | }
|
44832 |
|
44833 | function mousedowned(event) {
|
44834 | for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
44835 | args[_key2 - 1] = arguments[_key2];
|
44836 | }
|
44837 |
|
44838 | if (touchending || !filter.apply(this, arguments)) return;
|
44839 | var currentTarget = event.currentTarget,
|
44840 | g = gesture(this, args, !0).event(event),
|
44841 | v = src_select(event.view).on("mousemove.zoom", mousemoved, !0).on("mouseup.zoom", function (event) {
|
44842 | v.on("mousemove.zoom mouseup.zoom", null);
|
44843 | yesdrag(event.view, g.moved);
|
44844 | d3_zoom_src_noevent(event);
|
44845 | g.event(event).end();
|
44846 | }, !0),
|
44847 | p = src_pointer(event, currentTarget),
|
44848 | x0 = event.clientX,
|
44849 | y0 = event.clientY;
|
44850 | nodrag(event.view);
|
44851 | src_noevent_nopropagation(event);
|
44852 | g.mouse = [p, this.__zoom.invert(p)];
|
44853 | interrupt(this);
|
44854 | g.start();
|
44855 |
|
44856 | function mousemoved(event) {
|
44857 | d3_zoom_src_noevent(event);
|
44858 |
|
44859 | if (!g.moved) {
|
44860 | var dx = event.clientX - x0,
|
44861 | dy = event.clientY - y0;
|
44862 | g.moved = dx * dx + dy * dy > clickDistance2;
|
44863 | }
|
44864 |
|
44865 | g.event(event).zoom("mouse", constrain(translate(g.that.__zoom, g.mouse[0] = src_pointer(event, currentTarget), g.mouse[1]), g.extent, translateExtent));
|
44866 | }
|
44867 | }
|
44868 |
|
44869 | function dblclicked(event) {
|
44870 | for (var _len3 = arguments.length, args = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
44871 | args[_key3 - 1] = arguments[_key3];
|
44872 | }
|
44873 |
|
44874 | if (!filter.apply(this, arguments)) return;
|
44875 | var t0 = this.__zoom,
|
44876 | p0 = src_pointer(event.changedTouches ? event.changedTouches[0] : event, this),
|
44877 | p1 = t0.invert(p0),
|
44878 | k1 = t0.k * (event.shiftKey ? .5 : 2),
|
44879 | t1 = constrain(translate(scale(t0, k1), p0, p1), extent.apply(this, args), translateExtent);
|
44880 | d3_zoom_src_noevent(event);
|
44881 | if (duration > 0) src_select(this).transition().duration(duration).call(schedule, t1, p0, event);else src_select(this).call(zoom.transform, t1, p0, event);
|
44882 | }
|
44883 |
|
44884 | function touchstarted(event) {
|
44885 | for (var _len4 = arguments.length, args = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
|
44886 | args[_key4 - 1] = arguments[_key4];
|
44887 | }
|
44888 |
|
44889 | if (!filter.apply(this, arguments)) return;
|
44890 | var touches = event.touches,
|
44891 | n = touches.length,
|
44892 | g = gesture(this, args, event.changedTouches.length === n).event(event),
|
44893 | started,
|
44894 | i,
|
44895 | t,
|
44896 | p;
|
44897 | src_noevent_nopropagation(event);
|
44898 |
|
44899 | for (i = 0; i < n; ++i) {
|
44900 | t = touches[i], p = src_pointer(t, this);
|
44901 | p = [p, this.__zoom.invert(p), t.identifier];
|
44902 | if (!g.touch0) g.touch0 = p, started = !0, g.taps = 1 + !!touchstarting;else if (!g.touch1 && g.touch0[2] !== p[2]) g.touch1 = p, g.taps = 0;
|
44903 | }
|
44904 |
|
44905 | if (touchstarting) touchstarting = clearTimeout(touchstarting);
|
44906 |
|
44907 | if (started) {
|
44908 | if (g.taps < 2) touchfirst = p[0], touchstarting = setTimeout(function () {
|
44909 | touchstarting = null;
|
44910 | }, 500);
|
44911 | interrupt(this);
|
44912 | g.start();
|
44913 | }
|
44914 | }
|
44915 |
|
44916 | function touchmoved(event) {
|
44917 | if (!this.__zooming) return;
|
44918 |
|
44919 | for (var _len5 = arguments.length, args = Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {
|
44920 | args[_key5 - 1] = arguments[_key5];
|
44921 | }
|
44922 |
|
44923 | var g = gesture(this, args).event(event),
|
44924 | touches = event.changedTouches,
|
44925 | n = touches.length,
|
44926 | i,
|
44927 | t,
|
44928 | p,
|
44929 | l;
|
44930 | d3_zoom_src_noevent(event);
|
44931 |
|
44932 | for (i = 0; i < n; ++i) {
|
44933 | t = touches[i], p = src_pointer(t, this);
|
44934 | if (g.touch0 && g.touch0[2] === t.identifier) g.touch0[0] = p;else if (g.touch1 && g.touch1[2] === t.identifier) g.touch1[0] = p;
|
44935 | }
|
44936 |
|
44937 | t = g.that.__zoom;
|
44938 |
|
44939 | if (g.touch1) {
|
44940 | var p0 = g.touch0[0],
|
44941 | l0 = g.touch0[1],
|
44942 | p1 = g.touch1[0],
|
44943 | l1 = g.touch1[1],
|
44944 | dp = (dp = p1[0] - p0[0]) * dp + (dp = p1[1] - p0[1]) * dp,
|
44945 | dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl;
|
44946 | t = scale(t, Math.sqrt(dp / dl));
|
44947 | p = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2];
|
44948 | l = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2];
|
44949 | } else if (g.touch0) p = g.touch0[0], l = g.touch0[1];else return;
|
44950 |
|
44951 | g.zoom("touch", constrain(translate(t, p, l), g.extent, translateExtent));
|
44952 | }
|
44953 |
|
44954 | function touchended(event) {
|
44955 | for (var _len6 = arguments.length, args = Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
|
44956 | args[_key6 - 1] = arguments[_key6];
|
44957 | }
|
44958 |
|
44959 | if (!this.__zooming) return;
|
44960 | var g = gesture(this, args).event(event),
|
44961 | touches = event.changedTouches,
|
44962 | n = touches.length,
|
44963 | i,
|
44964 | t;
|
44965 | src_noevent_nopropagation(event);
|
44966 | if (touchending) clearTimeout(touchending);
|
44967 | touchending = setTimeout(function () {
|
44968 | touchending = null;
|
44969 | }, 500);
|
44970 |
|
44971 | for (i = 0; i < n; ++i) {
|
44972 | t = touches[i];
|
44973 | if (g.touch0 && g.touch0[2] === t.identifier) delete g.touch0;else if (g.touch1 && g.touch1[2] === t.identifier) delete g.touch1;
|
44974 | }
|
44975 |
|
44976 | if (g.touch1 && !g.touch0) g.touch0 = g.touch1, delete g.touch1;
|
44977 | if (g.touch0) g.touch0[1] = this.__zoom.invert(g.touch0[0]);else {
|
44978 | g.end(); // If this was a dbltap, reroute to the (optional) dblclick.zoom handler.
|
44979 |
|
44980 | if (g.taps === 2) {
|
44981 | t = src_pointer(t, this);
|
44982 |
|
44983 | if (Math.hypot(touchfirst[0] - t[0], touchfirst[1] - t[1]) < tapDistance) {
|
44984 | var p = src_select(this).on("dblclick.zoom");
|
44985 | if (p) p.apply(this, arguments);
|
44986 | }
|
44987 | }
|
44988 | }
|
44989 | }
|
44990 |
|
44991 | zoom.wheelDelta = function (_) {
|
44992 | return arguments.length ? (wheelDelta = typeof _ === "function" ? _ : d3_zoom_src_constant(+_), zoom) : wheelDelta;
|
44993 | };
|
44994 |
|
44995 | zoom.filter = function (_) {
|
44996 | return arguments.length ? (filter = typeof _ === "function" ? _ : d3_zoom_src_constant(!!_), zoom) : filter;
|
44997 | };
|
44998 |
|
44999 | zoom.touchable = function (_) {
|
45000 | return arguments.length ? (touchable = typeof _ === "function" ? _ : d3_zoom_src_constant(!!_), zoom) : touchable;
|
45001 | };
|
45002 |
|
45003 | zoom.extent = function (_) {
|
45004 | return arguments.length ? (extent = typeof _ === "function" ? _ : d3_zoom_src_constant([[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]]), zoom) : extent;
|
45005 | };
|
45006 |
|
45007 | zoom.scaleExtent = function (_) {
|
45008 | return arguments.length ? (scaleExtent[0] = +_[0], scaleExtent[1] = +_[1], zoom) : [scaleExtent[0], scaleExtent[1]];
|
45009 | };
|
45010 |
|
45011 | zoom.translateExtent = function (_) {
|
45012 | 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]]];
|
45013 | };
|
45014 |
|
45015 | zoom.constrain = function (_) {
|
45016 | return arguments.length ? (constrain = _, zoom) : constrain;
|
45017 | };
|
45018 |
|
45019 | zoom.duration = function (_) {
|
45020 | return arguments.length ? (duration = +_, zoom) : duration;
|
45021 | };
|
45022 |
|
45023 | zoom.interpolate = function (_) {
|
45024 | return arguments.length ? (interpolate = _, zoom) : interpolate;
|
45025 | };
|
45026 |
|
45027 | zoom.on = function () {
|
45028 | var value = listeners.on.apply(listeners, arguments);
|
45029 | return value === listeners ? zoom : value;
|
45030 | };
|
45031 |
|
45032 | zoom.clickDistance = function (_) {
|
45033 | return arguments.length ? (clickDistance2 = (_ = +_) * _, zoom) : Math.sqrt(clickDistance2);
|
45034 | };
|
45035 |
|
45036 | zoom.tapDistance = function (_) {
|
45037 | return arguments.length ? (tapDistance = +_, zoom) : tapDistance;
|
45038 | };
|
45039 |
|
45040 | return zoom;
|
45041 | }
|
45042 | ;// CONCATENATED MODULE: ./node_modules/d3-zoom/src/index.js
|
45043 |
|
45044 |
|
45045 | ;// CONCATENATED MODULE: ./src/Chart/api/zoom.ts
|
45046 | /**
|
45047 | * Copyright (c) 2017 ~ present NAVER Corp.
|
45048 | * billboard.js project is licensed under the MIT license
|
45049 | */
|
45050 |
|
45051 |
|
45052 | /**
|
45053 | * Check if the given domain is within zoom range
|
45054 | * @param {Array} domain Target domain value
|
45055 | * @param {Array} current Current zoom domain value
|
45056 | * @param {Array} range Zoom range value
|
45057 | * @returns {boolean}
|
45058 | * @private
|
45059 | */
|
45060 |
|
45061 | function withinRange(domain, current, range) {
|
45062 | var min = range[0],
|
45063 | max = range[1];
|
45064 | return domain.every(function (v, i) {
|
45065 | return (i === 0 ? v >= min : v <= max) && !domain.every(function (v, i) {
|
45066 | return v === current[i];
|
45067 | });
|
45068 | });
|
45069 | }
|
45070 | /**
|
45071 | * Zoom by giving x domain range.
|
45072 | * - **NOTE:**
|
45073 | * - For `wheel` type zoom, the minimum zoom range will be set as the given domain range. To get the initial state, [.unzoom()](#unzoom) should be called.
|
45074 | * - To be used [zoom.enabled](Options.html#.zoom) option should be set as `truthy`.
|
45075 | * @function zoom
|
45076 | * @instance
|
45077 | * @memberof Chart
|
45078 | * @param {Array} domainValue If domain range is given, the chart will be zoomed to the given domain. If no argument is given, the current zoomed domain will be returned.
|
45079 | * @returns {Array} domain value in array
|
45080 | * @example
|
45081 | * // Zoom to specified domain range
|
45082 | * chart.zoom([10, 20]);
|
45083 | *
|
45084 | * // For timeseries, the domain value can be string, but the format should match with the 'data.xFormat' option.
|
45085 | * chart.zoom(["2021-02-03", "2021-02-08"]);
|
45086 | *
|
45087 | * // Get the current zoomed domain range
|
45088 | * chart.zoom();
|
45089 | */
|
45090 |
|
45091 |
|
45092 | var zoom = function (domainValue) {
|
45093 | var $$ = this.internal,
|
45094 | $el = $$.$el,
|
45095 | axis = $$.axis,
|
45096 | config = $$.config,
|
45097 | org = $$.org,
|
45098 | scale = $$.scale,
|
45099 | isRotated = config.axis_rotated,
|
45100 | isCategorized = axis.isCategorized(),
|
45101 | domain = domainValue;
|
45102 |
|
45103 | if (config.zoom_enabled && domain) {
|
45104 | if (axis.isTimeSeries()) {
|
45105 | domain = domain.map(function (x) {
|
45106 | return parseDate.bind($$)(x);
|
45107 | });
|
45108 | }
|
45109 |
|
45110 | if (withinRange(domain, $$.getZoomDomain(!0), $$.getZoomDomain())) {
|
45111 | if (isCategorized) {
|
45112 | domain = domain.map(function (v, i) {
|
45113 | return +v + (i === 0 ? 0 : 1);
|
45114 | });
|
45115 | } // hide any possible tooltip show before the zoom
|
45116 |
|
45117 |
|
45118 | $$.api.tooltip.hide();
|
45119 |
|
45120 | if (config.subchart_show) {
|
45121 | var x = scale.zoom || scale.x;
|
45122 | $$.brush.getSelection().call($$.brush.move, domain.map(x)); // resultDomain = domain;
|
45123 | } else {
|
45124 | var _d3ZoomIdentity$scale,
|
45125 | _x = isCategorized ? scale.x.orgScale() : org.xScale || scale.x,
|
45126 | translate = [-_x(domain[0]), 0],
|
45127 | transform = (_d3ZoomIdentity$scale = transform_identity.scale(_x.range()[1] / (_x(domain[1]) - _x(domain[0])))).translate.apply(_d3ZoomIdentity$scale, isRotated ? translate.reverse() : translate);
|
45128 |
|
45129 | $el.eventRect.call($$.zoom.transform, transform);
|
45130 | }
|
45131 |
|
45132 | $$.setZoomResetButton();
|
45133 | }
|
45134 | } else {
|
45135 | domain = scale.zoom ? scale.zoom.domain() : scale.x.orgDomain();
|
45136 | }
|
45137 |
|
45138 | return domain;
|
45139 | };
|
45140 |
|
45141 | util_extend(zoom, {
|
45142 | /**
|
45143 | * Enable and disable zooming.
|
45144 | * @function zoom․enable
|
45145 | * @instance
|
45146 | * @memberof Chart
|
45147 | * @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.
|
45148 | * @example
|
45149 | * // Enable zooming using the mouse wheel
|
45150 | * chart.zoom.enable(true);
|
45151 | * // Or
|
45152 | * chart.zoom.enable("wheel");
|
45153 | *
|
45154 | * // Enable zooming by dragging
|
45155 | * chart.zoom.enable("drag");
|
45156 | *
|
45157 | * // Disable zooming
|
45158 | * chart.zoom.enable(false);
|
45159 | */
|
45160 | enable: function enable(enabled) {
|
45161 | var $$ = this.internal,
|
45162 | config = $$.config;
|
45163 |
|
45164 | if (/^(drag|wheel)$/.test(enabled)) {
|
45165 | config.zoom_type = enabled;
|
45166 | }
|
45167 |
|
45168 | config.zoom_enabled = !!enabled;
|
45169 |
|
45170 | if (!$$.zoom) {
|
45171 | $$.initZoom();
|
45172 | $$.bindZoomEvent();
|
45173 | } else if (enabled === !1) {
|
45174 | $$.bindZoomEvent(!1);
|
45175 | }
|
45176 |
|
45177 | $$.updateAndRedraw();
|
45178 | },
|
45179 |
|
45180 | /**
|
45181 | * Set or get x Axis maximum zoom range value
|
45182 | * @function zoom․max
|
45183 | * @instance
|
45184 | * @memberof Chart
|
45185 | * @param {number} [max] maximum value to set for zoom
|
45186 | * @returns {number} zoom max value
|
45187 | * @example
|
45188 | * // Set maximum range value
|
45189 | * chart.zoom.max(20);
|
45190 | */
|
45191 | max: function max(_max) {
|
45192 | var $$ = this.internal,
|
45193 | config = $$.config,
|
45194 | xDomain = $$.org.xDomain;
|
45195 |
|
45196 | if (_max === 0 || _max) {
|
45197 | config.zoom_x_max = getMinMax("max", [xDomain[1], _max]);
|
45198 | }
|
45199 |
|
45200 | return config.zoom_x_max;
|
45201 | },
|
45202 |
|
45203 | /**
|
45204 | * Set or get x Axis minimum zoom range value
|
45205 | * @function zoom․min
|
45206 | * @instance
|
45207 | * @memberof Chart
|
45208 | * @param {number} [min] minimum value to set for zoom
|
45209 | * @returns {number} zoom min value
|
45210 | * @example
|
45211 | * // Set minimum range value
|
45212 | * chart.zoom.min(-1);
|
45213 | */
|
45214 | min: function min(_min) {
|
45215 | var $$ = this.internal,
|
45216 | config = $$.config,
|
45217 | xDomain = $$.org.xDomain;
|
45218 |
|
45219 | if (_min === 0 || _min) {
|
45220 | config.zoom_x_min = getMinMax("min", [xDomain[0], _min]);
|
45221 | }
|
45222 |
|
45223 | return config.zoom_x_min;
|
45224 | },
|
45225 |
|
45226 | /**
|
45227 | * Set zoom range
|
45228 | * @function zoom․range
|
45229 | * @instance
|
45230 | * @memberof Chart
|
45231 | * @param {object} [range] zoom range
|
45232 | * @returns {object} zoom range value
|
45233 | * {
|
45234 | * min: 0,
|
45235 | * max: 100
|
45236 | * }
|
45237 | * @example
|
45238 | * chart.zoom.range({
|
45239 | * min: 10,
|
45240 | * max: 100
|
45241 | * });
|
45242 | */
|
45243 | range: function range(_range) {
|
45244 | var zoom = this.zoom;
|
45245 |
|
45246 | if (isObject(_range)) {
|
45247 | var min = _range.min,
|
45248 | max = _range.max;
|
45249 | isDefined(min) && zoom.min(min);
|
45250 | isDefined(max) && zoom.max(max);
|
45251 | }
|
45252 |
|
45253 | return {
|
45254 | min: zoom.min(),
|
45255 | max: zoom.max()
|
45256 | };
|
45257 | }
|
45258 | });
|
45259 | /* harmony default export */ var api_zoom = ({
|
45260 | zoom: zoom,
|
45261 |
|
45262 | /**
|
45263 | * Unzoom zoomed area
|
45264 | * - **NOTE:** Calling .unzoom() will not trigger zoom events.
|
45265 | * @function unzoom
|
45266 | * @instance
|
45267 | * @memberof Chart
|
45268 | * @example
|
45269 | * chart.unzoom();
|
45270 | */
|
45271 | unzoom: function unzoom() {
|
45272 | var $$ = this.internal,
|
45273 | config = $$.config,
|
45274 | _$$$$el = $$.$el,
|
45275 | eventRect = _$$$$el.eventRect,
|
45276 | zoomResetBtn = _$$$$el.zoomResetBtn;
|
45277 |
|
45278 | if ($$.scale.zoom) {
|
45279 | var _zoomResetBtn;
|
45280 |
|
45281 | config.subchart_show ? $$.brush.getSelection().call($$.brush.move, null) : $$.zoom.updateTransformScale(transform_identity);
|
45282 | $$.updateZoom(!0);
|
45283 | (_zoomResetBtn = zoomResetBtn) == null ? void 0 : _zoomResetBtn.style("display", "none"); // reset transform
|
45284 |
|
45285 | if (transform_transform(eventRect.node()) !== transform_identity) {
|
45286 | $$.zoom.transform(eventRect, transform_identity);
|
45287 | }
|
45288 | }
|
45289 | }
|
45290 | });
|
45291 | ;// CONCATENATED MODULE: ./src/ChartInternal/interactions/drag.ts
|
45292 | /**
|
45293 | * Copyright (c) 2017 ~ present NAVER Corp.
|
45294 | * billboard.js project is licensed under the MIT license
|
45295 | */
|
45296 |
|
45297 |
|
45298 |
|
45299 | /**
|
45300 | * Module used for data.selection.draggable option
|
45301 | */
|
45302 |
|
45303 | /* harmony default export */ var interactions_drag = ({
|
45304 | /**
|
45305 | * Called when dragging.
|
45306 | * Data points can be selected.
|
45307 | * @private
|
45308 | * @param {object} mouse Object
|
45309 | */
|
45310 | drag: function drag(mouse) {
|
45311 | var $$ = this,
|
45312 | config = $$.config,
|
45313 | state = $$.state,
|
45314 | main = $$.$el.main,
|
45315 | isSelectionGrouped = config.data_selection_grouped,
|
45316 | isSelectable = config.interaction_enabled && config.data_selection_isselectable;
|
45317 |
|
45318 | if ($$.hasArcType() || !config.data_selection_enabled || // do nothing if not selectable
|
45319 | config.zoom_enabled && !$$.zoom.altDomain || // skip if zoomable because of conflict drag behavior
|
45320 | !config.data_selection_multiple // skip when single selection because drag is used for multiple selection
|
45321 | ) {
|
45322 | return;
|
45323 | }
|
45324 |
|
45325 | var _ref = state.dragStart || [0, 0],
|
45326 | sx = _ref[0],
|
45327 | sy = _ref[1],
|
45328 | mx = mouse[0],
|
45329 | my = mouse[1],
|
45330 | minX = Math.min(sx, mx),
|
45331 | maxX = Math.max(sx, mx),
|
45332 | minY = isSelectionGrouped ? state.margin.top : Math.min(sy, my),
|
45333 | maxY = isSelectionGrouped ? state.height : Math.max(sy, my);
|
45334 |
|
45335 | main.select("." + config_classes.dragarea).attr("x", minX).attr("y", minY).attr("width", maxX - minX).attr("height", maxY - minY); // TODO: binary search when multiple xs
|
45336 |
|
45337 | main.selectAll("." + config_classes.shapes).selectAll("." + config_classes.shape).filter(function (d) {
|
45338 | var _isSelectable;
|
45339 |
|
45340 | return (_isSelectable = isSelectable) == null ? void 0 : _isSelectable.bind($$.api)(d);
|
45341 | }).each(function (d, i) {
|
45342 | var shape = src_select(this),
|
45343 | isSelected = shape.classed(config_classes.SELECTED),
|
45344 | isIncluded = shape.classed(config_classes.INCLUDED),
|
45345 | isWithin = !1,
|
45346 | toggle;
|
45347 |
|
45348 | if (shape.classed(config_classes.circle)) {
|
45349 | var x = +shape.attr("cx") * 1,
|
45350 | y = +shape.attr("cy") * 1;
|
45351 | toggle = $$.togglePoint;
|
45352 | isWithin = minX < x && x < maxX && minY < y && y < maxY;
|
45353 | } else if (shape.classed(config_classes.bar)) {
|
45354 | var _getPathBox = getPathBox(this),
|
45355 | _x = _getPathBox.x,
|
45356 | y = _getPathBox.y,
|
45357 | width = _getPathBox.width,
|
45358 | height = _getPathBox.height;
|
45359 |
|
45360 | toggle = $$.togglePath;
|
45361 | isWithin = !(maxX < _x || _x + width < minX) && !(maxY < y || y + height < minY);
|
45362 | } else {
|
45363 | // line/area selection not supported yet
|
45364 | return;
|
45365 | } // @ts-ignore
|
45366 |
|
45367 |
|
45368 | if (isWithin ^ isIncluded) {
|
45369 | shape.classed(config_classes.INCLUDED, !isIncluded); // TODO: included/unincluded callback here
|
45370 |
|
45371 | shape.classed(config_classes.SELECTED, !isSelected);
|
45372 | toggle.call($$, !isSelected, shape, d, i);
|
45373 | }
|
45374 | });
|
45375 | },
|
45376 |
|
45377 | /**
|
45378 | * Called when the drag starts.
|
45379 | * Adds and Shows the drag area.
|
45380 | * @private
|
45381 | * @param {object} mouse Object
|
45382 | */
|
45383 | dragstart: function dragstart(mouse) {
|
45384 | var $$ = this,
|
45385 | config = $$.config,
|
45386 | state = $$.state,
|
45387 | main = $$.$el.main;
|
45388 |
|
45389 | if ($$.hasArcType() || !config.data_selection_enabled) {
|
45390 | return;
|
45391 | }
|
45392 |
|
45393 | state.dragStart = mouse;
|
45394 | main.select("." + config_classes.chart).append("rect").attr("class", config_classes.dragarea).style("opacity", "0.1");
|
45395 | $$.setDragStatus(!0);
|
45396 | },
|
45397 |
|
45398 | /**
|
45399 | * Called when the drag finishes.
|
45400 | * Removes the drag area.
|
45401 | * @private
|
45402 | */
|
45403 | dragend: function dragend() {
|
45404 | var $$ = this,
|
45405 | config = $$.config,
|
45406 | main = $$.$el.main,
|
45407 | $T = $$.$T;
|
45408 |
|
45409 | if ($$.hasArcType() || !config.data_selection_enabled) {
|
45410 | // do nothing if not selectable
|
45411 | return;
|
45412 | }
|
45413 |
|
45414 | $T(main.select("." + config_classes.dragarea)).style("opacity", "0").remove();
|
45415 | main.selectAll("." + config_classes.shape).classed(config_classes.INCLUDED, !1);
|
45416 | $$.setDragStatus(!1);
|
45417 | }
|
45418 | });
|
45419 | ;// CONCATENATED MODULE: ./src/ChartInternal/internals/selection.ts
|
45420 |
|
45421 |
|
45422 | function selection_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
45423 |
|
45424 | function selection_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { selection_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { selection_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
45425 |
|
45426 | /**
|
45427 | * Copyright (c) 2017 ~ present NAVER Corp.
|
45428 | * billboard.js project is licensed under the MIT license
|
45429 | */
|
45430 |
|
45431 |
|
45432 |
|
45433 |
|
45434 | /* harmony default export */ var internals_selection = (selection_objectSpread(selection_objectSpread({}, interactions_drag), {}, {
|
45435 | /**
|
45436 | * Select a point
|
45437 | * @param {object} target Target point
|
45438 | * @param {object} d Data object
|
45439 | * @param {number} i Index number
|
45440 | * @private
|
45441 | */
|
45442 | selectPoint: function selectPoint(target, d, i) {
|
45443 | var $$ = this,
|
45444 | config = $$.config,
|
45445 | main = $$.$el.main,
|
45446 | $T = $$.$T,
|
45447 | isRotated = config.axis_rotated,
|
45448 | cx = (isRotated ? $$.circleY : $$.circleX).bind($$),
|
45449 | cy = (isRotated ? $$.circleX : $$.circleY).bind($$),
|
45450 | r = $$.pointSelectR.bind($$);
|
45451 | callFn(config.data_onselected, $$.api, d, target.node()); // add selected-circle on low layer g
|
45452 |
|
45453 | $T(main.select("." + config_classes.selectedCircles + $$.getTargetSelectorSuffix(d.id)).selectAll("." + config_classes.selectedCircle + "-" + i).data([d]).enter().append("circle").attr("class", function () {
|
45454 | return $$.generateClass(config_classes.selectedCircle, i);
|
45455 | }).attr("cx", cx).attr("cy", cy).attr("stroke", $$.color).attr("r", function (d2) {
|
45456 | return $$.pointSelectR(d2) * 1.4;
|
45457 | })).attr("r", r);
|
45458 | },
|
45459 |
|
45460 | /**
|
45461 | * Unelect a point
|
45462 | * @param {object} target Target point
|
45463 | * @param {object} d Data object
|
45464 | * @param {number} i Index number
|
45465 | * @private
|
45466 | */
|
45467 | unselectPoint: function unselectPoint(target, d, i) {
|
45468 | var $$ = this,
|
45469 | config = $$.config,
|
45470 | main = $$.$el.main,
|
45471 | $T = $$.$T;
|
45472 | callFn(config.data_onunselected, $$.api, d, target.node()); // remove selected-circle from low layer g
|
45473 |
|
45474 | $T(main.select("." + config_classes.selectedCircles + $$.getTargetSelectorSuffix(d.id)).selectAll("." + config_classes.selectedCircle + "-" + i)).attr("r", 0).remove();
|
45475 | },
|
45476 |
|
45477 | /**
|
45478 | * Toggles the selection of points
|
45479 | * @param {boolean} selected whether or not to select.
|
45480 | * @param {object} target Target object
|
45481 | * @param {object} d Data object
|
45482 | * @param {number} i Index number
|
45483 | * @private
|
45484 | */
|
45485 | togglePoint: function togglePoint(selected, target, d, i) {
|
45486 | var method = (selected ? "" : "un") + "selectPoint";
|
45487 | this[method](target, d, i);
|
45488 | },
|
45489 |
|
45490 | /**
|
45491 | * Select a path
|
45492 | * @param {object} target Target path
|
45493 | * @param {object} d Data object
|
45494 | * @private
|
45495 | */
|
45496 | selectPath: function selectPath(target, d) {
|
45497 | var $$ = this,
|
45498 | config = $$.config;
|
45499 | callFn(config.data_onselected, $$.api, d, target.node());
|
45500 |
|
45501 | if (config.interaction_brighten) {
|
45502 | target.style("filter", "brightness(1.25)");
|
45503 | }
|
45504 | },
|
45505 |
|
45506 | /**
|
45507 | * Unelect a path
|
45508 | * @private
|
45509 | * @param {object} target Target path
|
45510 | * @param {object} d Data object
|
45511 | */
|
45512 | unselectPath: function unselectPath(target, d) {
|
45513 | var $$ = this,
|
45514 | config = $$.config;
|
45515 | callFn(config.data_onunselected, $$.api, d, target.node());
|
45516 |
|
45517 | if (config.interaction_brighten) {
|
45518 | target.style("filter", null);
|
45519 | }
|
45520 | },
|
45521 |
|
45522 | /**
|
45523 | * Toggles the selection of lines
|
45524 | * @param {boolean} selected whether or not to select.
|
45525 | * @param {object} target Target object
|
45526 | * @param {object} d Data object
|
45527 | * @param {number} i Index number
|
45528 | * @private
|
45529 | */
|
45530 | togglePath: function togglePath(selected, target, d, i) {
|
45531 | this[(selected ? "" : "un") + "selectPath"](target, d, i);
|
45532 | },
|
45533 |
|
45534 | /**
|
45535 | * Returns the toggle method of the target
|
45536 | * @param {object} that shape
|
45537 | * @param {object} d Data object
|
45538 | * @returns {Function} toggle method
|
45539 | * @private
|
45540 | */
|
45541 | getToggle: function getToggle(that, d) {
|
45542 | var $$ = this;
|
45543 | return that.nodeName === "path" ? $$.togglePath : $$.isStepType(d) ? function () {} : // circle is hidden in step chart, so treat as within the click area
|
45544 | $$.togglePoint;
|
45545 | },
|
45546 |
|
45547 | /**
|
45548 | * Toggles the selection of shapes
|
45549 | * @param {object} that shape
|
45550 | * @param {object} d Data object
|
45551 | * @param {number} i Index number
|
45552 | * @private
|
45553 | */
|
45554 | toggleShape: function toggleShape(that, d, i) {
|
45555 | var $$ = this,
|
45556 | config = $$.config,
|
45557 | main = $$.$el.main,
|
45558 | shape = src_select(that),
|
45559 | isSelected = shape.classed(config_classes.SELECTED),
|
45560 | toggle = $$.getToggle(that, d).bind($$),
|
45561 | toggledShape;
|
45562 |
|
45563 | if (config.data_selection_enabled && config.data_selection_isselectable.bind($$.api)(d)) {
|
45564 | if (!config.data_selection_multiple) {
|
45565 | var selector = "." + config_classes.shapes;
|
45566 |
|
45567 | if (config.data_selection_grouped) {
|
45568 | selector += $$.getTargetSelectorSuffix(d.id);
|
45569 | }
|
45570 |
|
45571 | main.selectAll(selector).selectAll("." + config_classes.shape).each(function (d, i) {
|
45572 | var shape = src_select(this);
|
45573 |
|
45574 | if (shape.classed(config_classes.SELECTED)) {
|
45575 | toggledShape = shape;
|
45576 | toggle(!1, shape.classed(config_classes.SELECTED, !1), d, i);
|
45577 | }
|
45578 | });
|
45579 | }
|
45580 |
|
45581 | if (!toggledShape || toggledShape.node() !== shape.node()) {
|
45582 | shape.classed(config_classes.SELECTED, !isSelected);
|
45583 | toggle(!isSelected, shape, d, i);
|
45584 | }
|
45585 | }
|
45586 | }
|
45587 | }));
|
45588 | ;// CONCATENATED MODULE: ./src/ChartInternal/interactions/subchart.ts
|
45589 | /**
|
45590 | * Copyright (c) 2017 ~ present NAVER Corp.
|
45591 | * billboard.js project is licensed under the MIT license
|
45592 | */
|
45593 |
|
45594 |
|
45595 |
|
45596 |
|
45597 | /* harmony default export */ var interactions_subchart = ({
|
45598 | /**
|
45599 | * Initialize the brush.
|
45600 | * @private
|
45601 | */
|
45602 | initBrush: function initBrush() {
|
45603 | var $$ = this,
|
45604 | config = $$.config,
|
45605 | scale = $$.scale,
|
45606 | subchart = $$.$el.subchart,
|
45607 | isRotated = config.axis_rotated,
|
45608 | lastDomain,
|
45609 | timeout;
|
45610 | // set the brush
|
45611 | $$.brush = (isRotated ? brushY() : brushX()).handleSize(5);
|
45612 |
|
45613 | var getBrushSize = function () {
|
45614 | var brush = $$.$el.svg.select("." + config_classes.brush + " .overlay"),
|
45615 | brushSize = {
|
45616 | width: 0,
|
45617 | height: 0
|
45618 | };
|
45619 |
|
45620 | if (brush.size()) {
|
45621 | brushSize.width = +brush.attr("width");
|
45622 | brushSize.height = +brush.attr("height");
|
45623 | }
|
45624 |
|
45625 | return brushSize[isRotated ? "width" : "height"];
|
45626 | }; // bind brush event
|
45627 |
|
45628 |
|
45629 | $$.brush.on("start brush end", function (event) {
|
45630 | var selection = event.selection,
|
45631 | target = event.target,
|
45632 | type = event.type;
|
45633 |
|
45634 | if (type === "start") {
|
45635 | $$.state.inputType === "touch" && $$.hideTooltip();
|
45636 | }
|
45637 |
|
45638 | if (/(start|brush)/.test(type)) {
|
45639 | $$.redrawForBrush();
|
45640 | }
|
45641 |
|
45642 | if (type === "end") {
|
45643 | lastDomain = scale.x.orgDomain();
|
45644 | } // handle brush's handle position & visibility
|
45645 |
|
45646 |
|
45647 | if (target != null && target.handle) {
|
45648 | if (selection === null) {
|
45649 | $$.brush.handle.attr("display", "none");
|
45650 | } else {
|
45651 | $$.brush.handle.attr("display", null).attr("transform", function (d, i) {
|
45652 | var pos = isRotated ? [33, selection[i] - (i === 0 ? 30 : 24)] : [selection[i], 3];
|
45653 | return "translate(" + pos + ")";
|
45654 | });
|
45655 | }
|
45656 | }
|
45657 | });
|
45658 |
|
45659 | $$.brush.updateResize = function () {
|
45660 | var _this = this;
|
45661 |
|
45662 | timeout && clearTimeout(timeout);
|
45663 | timeout = setTimeout(function () {
|
45664 | var selection = _this.getSelection();
|
45665 |
|
45666 | lastDomain && brushSelection(selection.node()) && _this.move(selection, lastDomain.map(scale.subX.orgScale()));
|
45667 | }, 0);
|
45668 | };
|
45669 |
|
45670 | $$.brush.update = function () {
|
45671 | var extent = this.extent()();
|
45672 |
|
45673 | if (extent[1].filter(function (v) {
|
45674 | return isNaN(v);
|
45675 | }).length === 0) {
|
45676 | var _subchart$main;
|
45677 |
|
45678 | (_subchart$main = subchart.main) == null ? void 0 : _subchart$main.select("." + config_classes.brush).call(this);
|
45679 | }
|
45680 |
|
45681 | return this;
|
45682 | }; // set the brush extent
|
45683 |
|
45684 |
|
45685 | $$.brush.scale = function (scale) {
|
45686 | var h = config.subchart_size_height || getBrushSize(),
|
45687 | extent = $$.getExtent();
|
45688 |
|
45689 | if (!extent && scale.range) {
|
45690 | extent = [[0, 0], [scale.range()[1], h]];
|
45691 | } else if (isArray(extent)) {
|
45692 | extent = extent.map(function (v, i) {
|
45693 | return [v, i > 0 ? h : i];
|
45694 | });
|
45695 | } // [[x0, y0], [x1, y1]], where [x0, y0] is the top-left corner and [x1, y1] is the bottom-right corner
|
45696 |
|
45697 |
|
45698 | isRotated && extent[1].reverse();
|
45699 | this.extent(extent); // when extent updates, brush selection also be re-applied
|
45700 | // https://github.com/d3/d3/issues/2918
|
45701 |
|
45702 | this.update();
|
45703 | };
|
45704 |
|
45705 | $$.brush.getSelection = function () {
|
45706 | return (// @ts-ignore
|
45707 | subchart.main ? subchart.main.select("." + config_classes.brush) : src_select([])
|
45708 | );
|
45709 | };
|
45710 | },
|
45711 |
|
45712 | /**
|
45713 | * Initialize the subchart.
|
45714 | * @private
|
45715 | */
|
45716 | initSubchart: function initSubchart() {
|
45717 | var $$ = this,
|
45718 | config = $$.config,
|
45719 | _$$$state = $$.state,
|
45720 | clip = _$$$state.clip,
|
45721 | hasAxis = _$$$state.hasAxis,
|
45722 | _$$$$el = $$.$el,
|
45723 | defs = _$$$$el.defs,
|
45724 | svg = _$$$$el.svg,
|
45725 | subchart = _$$$$el.subchart,
|
45726 | axis = _$$$$el.axis;
|
45727 |
|
45728 | if (!hasAxis) {
|
45729 | return;
|
45730 | }
|
45731 |
|
45732 | var visibility = config.subchart_show ? null : "hidden",
|
45733 | clipId = clip.id + "-subchart",
|
45734 | clipPath = $$.getClipPath(clipId);
|
45735 | clip.idSubchart = clipId;
|
45736 | $$.appendClip(defs, clipId);
|
45737 | $$.initBrush();
|
45738 | subchart.main = svg.append("g").classed(config_classes.subchart, !0).attr("transform", $$.getTranslate("context"));
|
45739 | var main = subchart.main;
|
45740 | main.style("visibility", visibility); // Define g for chart area
|
45741 |
|
45742 | main.append("g").attr("clip-path", clipPath).attr("class", config_classes.chart); // Define g for chart types area
|
45743 |
|
45744 | ["bar", "line", "bubble", "candlestick", "scatter"].forEach(function (v) {
|
45745 | var type = capitalize(/^(bubble|scatter)$/.test(v) ? "circle" : v);
|
45746 |
|
45747 | if ($$.hasType(v) || $$.hasTypeOf(type)) {
|
45748 | var chart = main.select("." + config_classes.chart),
|
45749 | chartClassName = config_classes["chart" + type + "s"];
|
45750 |
|
45751 | if (chart.select("." + chartClassName).empty()) {
|
45752 | chart.append("g").attr("class", chartClassName);
|
45753 | }
|
45754 | }
|
45755 | }); // Add extent rect for Brush
|
45756 |
|
45757 | var brush = main.append("g").attr("clip-path", clipPath).attr("class", config_classes.brush).call($$.brush);
|
45758 | config.subchart_showHandle && $$.addBrushHandle(brush); // ATTENTION: This must be called AFTER chart added
|
45759 | // Add Axis
|
45760 |
|
45761 | 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");
|
45762 | },
|
45763 |
|
45764 | /**
|
45765 | * Add brush handle
|
45766 | * Enabled when: subchart.showHandle=true
|
45767 | * @param {d3Selection} brush Brush selection
|
45768 | * @private
|
45769 | */
|
45770 | addBrushHandle: function addBrushHandle(brush) {
|
45771 | var $$ = this,
|
45772 | config = $$.config,
|
45773 | isRotated = config.axis_rotated,
|
45774 | initRange = config.subchart_init_range,
|
45775 | customHandleClass = "handle--custom",
|
45776 | path = isRotated ? ["M 5.2491724,29.749209 a 6,6 0 0 0 -5.50000003,-6.5 H -5.7508276 a 6,6 0 0 0 -6.0000004,6.5 z m -5.00000003,-2 H -6.7508276 m 6.99999997,-2 H -6.7508276Z", "M 5.2491724,23.249172 a 6,-6 0 0 1 -5.50000003,6.5 H -5.7508276 a 6,-6 0 0 1 -6.0000004,-6.5 z m -5.00000003,2 H -6.7508276 m 6.99999997,2 H -6.7508276Z"] : ["M 0 18 A 6 6 0 0 0 -6.5 23.5 V 29 A 6 6 0 0 0 0 35 Z M -2 23 V 30 M -4 23 V 30Z", "M 0 18 A 6 6 0 0 1 6.5 23.5 V 29 A 6 6 0 0 1 0 35 Z M 2 23 V 30 M 4 23 V 30Z"];
|
45777 | $$.brush.handle = brush.selectAll("." + customHandleClass).data(isRotated ? [{
|
45778 | type: "n"
|
45779 | }, {
|
45780 | type: "s"
|
45781 | }] : [{
|
45782 | type: "w"
|
45783 | }, {
|
45784 | type: "e"
|
45785 | }]).enter().append("path").attr("class", customHandleClass).attr("cursor", (isRotated ? "ns" : "ew") + "-resize").attr("d", function (d) {
|
45786 | return path[+/[se]/.test(d.type)];
|
45787 | }).attr("display", initRange ? null : "none");
|
45788 | },
|
45789 |
|
45790 | /**
|
45791 | * Update sub chart
|
45792 | * @param {object} targets $$.data.targets
|
45793 | * @private
|
45794 | */
|
45795 | updateTargetsForSubchart: function updateTargetsForSubchart(targets) {
|
45796 | var $$ = this,
|
45797 | config = $$.config,
|
45798 | state = $$.state,
|
45799 | main = $$.$el.subchart.main;
|
45800 |
|
45801 | if (config.subchart_show) {
|
45802 | ["bar", "line", "bubble", "candlestick", "scatter"].filter(function (v) {
|
45803 | return $$.hasType(v) || $$.hasTypeOf(capitalize(v));
|
45804 | }).forEach(function (v) {
|
45805 | var isPointType = /^(bubble|scatter)$/.test(v),
|
45806 | name = capitalize(isPointType ? "circle" : v),
|
45807 | chartClass = $$.getChartClass(name, !0),
|
45808 | shapeClass = $$.getClass(isPointType ? "circles" : v + "s", !0),
|
45809 | shapeChart = main.select("." + config_classes["chart" + (name + "s")]);
|
45810 |
|
45811 | if (isPointType) {
|
45812 | var circle = shapeChart.selectAll("." + config_classes.circles).data(targets.filter($$["is" + capitalize(v) + "Type"].bind($$))).attr("class", shapeClass);
|
45813 | circle.exit().remove();
|
45814 | circle.enter().append("g").attr("class", shapeClass);
|
45815 | } else {
|
45816 | var shapeUpdate = shapeChart.selectAll("." + config_classes["chart" + name]).attr("class", chartClass).data(targets.filter($$["is" + name + "Type"].bind($$))),
|
45817 | shapeEnter = shapeUpdate.enter().append("g").style("opacity", "0").attr("class", chartClass).append("g").attr("class", shapeClass);
|
45818 | shapeUpdate.exit().remove(); // Area
|
45819 |
|
45820 | v === "line" && $$.hasTypeOf("Area") && shapeEnter.append("g").attr("class", $$.getClass("areas", !0));
|
45821 | }
|
45822 | }); // -- Brush --//
|
45823 |
|
45824 | main.selectAll("." + config_classes.brush + " rect").attr(config.axis_rotated ? "width" : "height", config.axis_rotated ? state.width2 : state.height2);
|
45825 | }
|
45826 | },
|
45827 |
|
45828 | /**
|
45829 | * Redraw subchart.
|
45830 | * @private
|
45831 | * @param {boolean} withSubchart whether or not to show subchart
|
45832 | * @param {number} duration duration
|
45833 | * @param {object} shape Shape's info
|
45834 | */
|
45835 | redrawSubchart: function redrawSubchart(withSubchart, duration, shape) {
|
45836 | var $$ = this,
|
45837 | config = $$.config,
|
45838 | main = $$.$el.subchart.main,
|
45839 | state = $$.state,
|
45840 | withTransition = !!duration;
|
45841 | main.style("visibility", config.subchart_show ? null : "hidden"); // subchart
|
45842 |
|
45843 | if (config.subchart_show) {
|
45844 | var _state$event;
|
45845 |
|
45846 | // reflect main chart to extent on subchart if zoomed
|
45847 | if (((_state$event = state.event) == null ? void 0 : _state$event.type) === "zoom") {
|
45848 | $$.brush.update();
|
45849 | } // update subchart elements if needed
|
45850 |
|
45851 |
|
45852 | if (withSubchart) {
|
45853 | var initRange = config.subchart_init_range; // extent rect
|
45854 |
|
45855 | brushEmpty($$) || $$.brush.update();
|
45856 | Object.keys(shape.type).forEach(function (v) {
|
45857 | var name = capitalize(v),
|
45858 | drawFn = $$["generateDraw" + name](shape.indices[v], !0);
|
45859 | // call shape's update & redraw method
|
45860 | $$["update" + name](withTransition, !0);
|
45861 | $$["redraw" + name](drawFn, withTransition, !0);
|
45862 | });
|
45863 |
|
45864 | if ($$.hasType("bubble") || $$.hasType("scatter")) {
|
45865 | var cx = shape.pos.cx,
|
45866 | cy = $$.updateCircleY(!0);
|
45867 | $$.updateCircle(!0);
|
45868 | $$.redrawCircle(cx, cy, withTransition, undefined, !0);
|
45869 | }
|
45870 |
|
45871 | !state.rendered && initRange && $$.brush.move($$.brush.getSelection(), initRange.map($$.scale.x));
|
45872 | }
|
45873 | }
|
45874 | },
|
45875 |
|
45876 | /**
|
45877 | * Redraw the brush.
|
45878 | * @private
|
45879 | */
|
45880 | redrawForBrush: function redrawForBrush() {
|
45881 | var $$ = this,
|
45882 | _$$$config = $$.config,
|
45883 | onBrush = _$$$config.subchart_onbrush,
|
45884 | withY = _$$$config.zoom_rescale,
|
45885 | scale = $$.scale;
|
45886 | $$.redraw({
|
45887 | withTransition: !1,
|
45888 | withY: withY,
|
45889 | withSubchart: !1,
|
45890 | withUpdateXDomain: !0,
|
45891 | withDimension: !1
|
45892 | });
|
45893 | onBrush.bind($$.api)(scale.x.orgDomain());
|
45894 | },
|
45895 |
|
45896 | /**
|
45897 | * Transform context
|
45898 | * @param {boolean} withTransition indicates transition is enabled
|
45899 | * @param {object} transitions The return value of the generateTransitions method of Axis.
|
45900 | * @private
|
45901 | */
|
45902 | transformContext: function transformContext(withTransition, transitions) {
|
45903 | var $$ = this,
|
45904 | subchart = $$.$el.subchart,
|
45905 | $T = $$.$T,
|
45906 | subXAxis = transitions != null && transitions.axisSubX ? transitions.axisSubX : $T(subchart.main.select("." + config_classes.axisX), withTransition);
|
45907 | subchart.main.attr("transform", $$.getTranslate("context"));
|
45908 | subXAxis.attr("transform", $$.getTranslate("subX"));
|
45909 | },
|
45910 |
|
45911 | /**
|
45912 | * Get extent value
|
45913 | * @returns {Array} default extent
|
45914 | * @private
|
45915 | */
|
45916 | getExtent: function getExtent() {
|
45917 | var $$ = this,
|
45918 | config = $$.config,
|
45919 | scale = $$.scale,
|
45920 | extent = config.axis_x_extent;
|
45921 |
|
45922 | if (extent) {
|
45923 | if (isFunction(extent)) {
|
45924 | extent = extent.bind($$.api)($$.getXDomain($$.data.targets), scale.subX);
|
45925 | } else if ($$.axis.isTimeSeries() && extent.every(isNaN)) {
|
45926 | var fn = parseDate.bind($$);
|
45927 | extent = extent.map(function (v) {
|
45928 | return scale.subX(fn(v));
|
45929 | });
|
45930 | }
|
45931 | }
|
45932 |
|
45933 | return extent;
|
45934 | }
|
45935 | });
|
45936 | ;// CONCATENATED MODULE: ./src/ChartInternal/interactions/zoom.ts
|
45937 | /**
|
45938 | * Copyright (c) 2017 ~ present NAVER Corp.
|
45939 | * billboard.js project is licensed under the MIT license
|
45940 | */
|
45941 |
|
45942 |
|
45943 |
|
45944 |
|
45945 | /* harmony default export */ var interactions_zoom = ({
|
45946 | /**
|
45947 | * Initialize zoom.
|
45948 | * @private
|
45949 | */
|
45950 | initZoom: function initZoom() {
|
45951 | var $$ = this;
|
45952 | $$.scale.zoom = null;
|
45953 | $$.generateZoom();
|
45954 | $$.initZoomBehaviour();
|
45955 | },
|
45956 |
|
45957 | /**
|
45958 | * Bind zoom event
|
45959 | * @param {boolean} bind Weather bind or unbound
|
45960 | * @private
|
45961 | */
|
45962 | bindZoomEvent: function bindZoomEvent(bind) {
|
45963 | if (bind === void 0) {
|
45964 | bind = !0;
|
45965 | }
|
45966 |
|
45967 | var $$ = this,
|
45968 | config = $$.config,
|
45969 | zoomEnabled = config.zoom_enabled;
|
45970 |
|
45971 | if (zoomEnabled && bind) {
|
45972 | // Do not bind zoom event when subchart is shown
|
45973 | config.subchart_show || $$.bindZoomOnEventRect();
|
45974 | } else if (bind === !1) {
|
45975 | $$.api.unzoom();
|
45976 | $$.unbindZoomEvent();
|
45977 | }
|
45978 | },
|
45979 |
|
45980 | /**
|
45981 | * Generate zoom
|
45982 | * @private
|
45983 | */
|
45984 | generateZoom: function generateZoom() {
|
45985 | var $$ = this,
|
45986 | config = $$.config,
|
45987 | org = $$.org,
|
45988 | scale = $$.scale,
|
45989 | zoom = d3_zoom_src_zoom().duration(0).on("start", $$.onZoomStart.bind($$)).on("zoom", $$.onZoom.bind($$)).on("end", $$.onZoomEnd.bind($$));
|
45990 |
|
45991 | // get zoom extent
|
45992 | // @ts-ignore
|
45993 | zoom.orgScaleExtent = function () {
|
45994 | var extent = config.zoom_extent || [1, 10];
|
45995 | return [extent[0], Math.max($$.getMaxDataCount() / extent[1], extent[1])];
|
45996 | }; // @ts-ignore
|
45997 |
|
45998 |
|
45999 | zoom.updateScaleExtent = function () {
|
46000 | var ratio = diffDomain($$.scale.x.orgDomain()) / diffDomain($$.getZoomDomain()),
|
46001 | extent = this.orgScaleExtent();
|
46002 | this.scaleExtent([extent[0] * ratio, extent[1] * ratio]);
|
46003 | return this;
|
46004 | };
|
46005 | /**
|
46006 | * Update scale according zoom transform value
|
46007 | * @param {object} transform transform object
|
46008 | * @private
|
46009 | */
|
46010 | // @ts-ignore
|
46011 |
|
46012 |
|
46013 | zoom.updateTransformScale = function (transform) {
|
46014 | var _org$xScale;
|
46015 |
|
46016 | // in case of resize, update range of orgXScale
|
46017 | (_org$xScale = org.xScale) == null ? void 0 : _org$xScale.range(scale.x.range()); // rescale from the original scale
|
46018 |
|
46019 | var newScale = transform[config.axis_rotated ? "rescaleY" : "rescaleX"](org.xScale || scale.x),
|
46020 | domain = $$.trimXDomain(newScale.domain()),
|
46021 | rescale = config.zoom_rescale;
|
46022 | newScale.domain(domain, org.xDomain);
|
46023 |
|
46024 | if (!$$.state.xTickOffset) {
|
46025 | $$.state.xTickOffset = $$.axis.x.tickOffset();
|
46026 | }
|
46027 |
|
46028 | scale.zoom = $$.getCustomizedScale(newScale);
|
46029 | $$.axis.x.scale(scale.zoom);
|
46030 |
|
46031 | if (rescale) {
|
46032 | // copy current initial x scale in case of rescale option is used
|
46033 | org.xScale || (org.xScale = scale.x.copy());
|
46034 | scale.x.domain(domain);
|
46035 | }
|
46036 | };
|
46037 | /**
|
46038 | * Get zoom domain
|
46039 | * @returns {Array} zoom domain
|
46040 | * @private
|
46041 | */
|
46042 | // @ts-ignore
|
46043 |
|
46044 |
|
46045 | zoom.getDomain = function () {
|
46046 | var domain = scale[scale.zoom ? "zoom" : "subX"].domain(),
|
46047 | isCategorized = $$.axis.isCategorized();
|
46048 |
|
46049 | if (isCategorized) {
|
46050 | domain[1] -= 2;
|
46051 | }
|
46052 |
|
46053 | return domain;
|
46054 | };
|
46055 |
|
46056 | $$.zoom = zoom;
|
46057 | },
|
46058 |
|
46059 | /**
|
46060 | * 'start' event listener
|
46061 | * @param {object} event Event object
|
46062 | * @private
|
46063 | */
|
46064 | onZoomStart: function onZoomStart(event) {
|
46065 | var $$ = this,
|
46066 | sourceEvent = event.sourceEvent;
|
46067 |
|
46068 | if (sourceEvent) {
|
46069 | $$.zoom.startEvent = sourceEvent;
|
46070 | $$.state.zooming = !0;
|
46071 | callFn($$.config.zoom_onzoomstart, $$.api, event);
|
46072 | }
|
46073 | },
|
46074 |
|
46075 | /**
|
46076 | * 'zoom' event listener
|
46077 | * @param {object} event Event object
|
46078 | * @private
|
46079 | */
|
46080 | onZoom: function onZoom(event) {
|
46081 | var _sourceEvent,
|
46082 | _sourceEvent2,
|
46083 | _sourceEvent3,
|
46084 | _sourceEvent4,
|
46085 | $$ = this,
|
46086 | config = $$.config,
|
46087 | scale = $$.scale,
|
46088 | state = $$.state,
|
46089 | org = $$.org,
|
46090 | sourceEvent = event.sourceEvent,
|
46091 | isUnZoom = (event == null ? void 0 : event.transform) === transform_identity;
|
46092 |
|
46093 | if (!config.zoom_enabled || $$.filterTargetsToShow($$.data.targets).length === 0 || !scale.zoom && ((_sourceEvent = sourceEvent) == null ? void 0 : _sourceEvent.type.indexOf("touch")) > -1 && ((_sourceEvent2 = sourceEvent) == null ? void 0 : _sourceEvent2.touches.length) === 1) {
|
46094 | return;
|
46095 | }
|
46096 |
|
46097 | if (event.sourceEvent) {
|
46098 | state.zooming = !0;
|
46099 | }
|
46100 |
|
46101 | var isMousemove = ((_sourceEvent3 = sourceEvent) == null ? void 0 : _sourceEvent3.type) === "mousemove",
|
46102 | isZoomOut = ((_sourceEvent4 = sourceEvent) == null ? void 0 : _sourceEvent4.wheelDelta) < 0,
|
46103 | transform = event.transform;
|
46104 |
|
46105 | if (!isMousemove && isZoomOut && scale.x.domain().every(function (v, i) {
|
46106 | return v !== org.xDomain[i];
|
46107 | })) {
|
46108 | scale.x.domain(org.xDomain);
|
46109 | }
|
46110 |
|
46111 | $$.zoom.updateTransformScale(transform); // do zoom transiton when:
|
46112 | // - zoom type 'drag'
|
46113 | // - when .unzoom() is called (event.transform === d3ZoomIdentity)
|
46114 |
|
46115 | var doTransition = config.transition_duration > 0 && !config.subchart_show && (state.dragging || isUnZoom || !event.sourceEvent);
|
46116 | $$.redraw({
|
46117 | withTransition: doTransition,
|
46118 | withY: config.zoom_rescale,
|
46119 | withSubchart: !1,
|
46120 | withEventRect: !1,
|
46121 | withDimension: !1
|
46122 | });
|
46123 | $$.state.cancelClick = isMousemove; // do not call event cb when is .unzoom() is called
|
46124 |
|
46125 | isUnZoom || callFn(config.zoom_onzoom, $$.api, $$.zoom.getDomain());
|
46126 | },
|
46127 |
|
46128 | /**
|
46129 | * 'end' event listener
|
46130 | * @param {object} event Event object
|
46131 | * @private
|
46132 | */
|
46133 | onZoomEnd: function onZoomEnd(event) {
|
46134 | var _startEvent,
|
46135 | $$ = this,
|
46136 | config = $$.config,
|
46137 | state = $$.state,
|
46138 | startEvent = $$.zoom.startEvent,
|
46139 | e = event == null ? void 0 : event.sourceEvent,
|
46140 | isUnZoom = (event == null ? void 0 : event.transform) === transform_identity;
|
46141 |
|
46142 | if (((_startEvent = startEvent) == null ? void 0 : _startEvent.type.indexOf("touch")) > -1) {
|
46143 | var _e, _e$changedTouches;
|
46144 |
|
46145 | startEvent = startEvent.changedTouches[0];
|
46146 | e = (_e = e) == null ? void 0 : (_e$changedTouches = _e.changedTouches) == null ? void 0 : _e$changedTouches[0];
|
46147 | } // if click, do nothing. otherwise, click interaction will be canceled.
|
46148 |
|
46149 |
|
46150 | if (config.zoom_type === "drag" && e && startEvent.clientX === e.clientX && startEvent.clientY === e.clientY) {
|
46151 | return;
|
46152 | }
|
46153 |
|
46154 | $$.redrawEventRect();
|
46155 | $$.updateZoom();
|
46156 | state.zooming = !1; // do not call event cb when is .unzoom() is called
|
46157 |
|
46158 | !isUnZoom && (e || state.dragging) && callFn(config.zoom_onzoomend, $$.api, $$.zoom.getDomain());
|
46159 | },
|
46160 |
|
46161 | /**
|
46162 | * Update zoom
|
46163 | * @param {boolean} force Force unzoom
|
46164 | * @private
|
46165 | */
|
46166 | updateZoom: function updateZoom(force) {
|
46167 | var $$ = this,
|
46168 | _$$$scale = $$.scale,
|
46169 | subX = _$$$scale.subX,
|
46170 | x = _$$$scale.x,
|
46171 | zoom = _$$$scale.zoom;
|
46172 |
|
46173 | if (zoom) {
|
46174 | var zoomDomain = zoom.domain(),
|
46175 | xDomain = subX.domain(),
|
46176 | delta = .015,
|
46177 | isfullyShown = (zoomDomain[0] <= xDomain[0] || zoomDomain[0] - delta <= xDomain[0]) && (xDomain[1] <= zoomDomain[1] || xDomain[1] <= zoomDomain[1] - delta);
|
46178 |
|
46179 | // check if the zoomed chart is fully shown, then reset scale when zoom is out as initial
|
46180 | if (force || isfullyShown) {
|
46181 | $$.axis.x.scale(subX);
|
46182 | x.domain(subX.orgDomain());
|
46183 | $$.scale.zoom = null;
|
46184 | }
|
46185 | }
|
46186 | },
|
46187 |
|
46188 | /**
|
46189 | * Attach zoom event on <rect>
|
46190 | * @private
|
46191 | */
|
46192 | bindZoomOnEventRect: function bindZoomOnEventRect() {
|
46193 | var $$ = this,
|
46194 | config = $$.config,
|
46195 | eventRect = $$.$el.eventRect,
|
46196 | behaviour = config.zoom_type === "drag" ? $$.zoomBehaviour : $$.zoom;
|
46197 | // Since Chrome 89, wheel zoom not works properly
|
46198 | // Applying the workaround: https://github.com/d3/d3-zoom/issues/231#issuecomment-802305692
|
46199 | $$.$el.svg.on("wheel", function () {});
|
46200 | eventRect.call(behaviour).on("dblclick.zoom", null);
|
46201 | },
|
46202 |
|
46203 | /**
|
46204 | * Initialize the drag behaviour used for zooming.
|
46205 | * @private
|
46206 | */
|
46207 | initZoomBehaviour: function initZoomBehaviour() {
|
46208 | var $$ = this,
|
46209 | config = $$.config,
|
46210 | state = $$.state,
|
46211 | isRotated = config.axis_rotated,
|
46212 | start = 0,
|
46213 | end = 0,
|
46214 | zoomRect,
|
46215 | prop = {
|
46216 | axis: isRotated ? "y" : "x",
|
46217 | attr: isRotated ? "height" : "width",
|
46218 | index: isRotated ? 1 : 0
|
46219 | };
|
46220 | $$.zoomBehaviour = drag().clickDistance(4).on("start", function (event) {
|
46221 | state.event = event;
|
46222 | $$.setDragStatus(!0);
|
46223 | $$.unselectRect();
|
46224 |
|
46225 | if (!zoomRect) {
|
46226 | 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);
|
46227 | }
|
46228 |
|
46229 | start = getPointer(event, this)[prop.index];
|
46230 | end = start;
|
46231 | zoomRect.attr(prop.axis, start).attr(prop.attr, 0);
|
46232 | $$.onZoomStart(event);
|
46233 | }).on("drag", function (event) {
|
46234 | end = getPointer(event, this)[prop.index];
|
46235 | zoomRect.attr(prop.axis, Math.min(start, end)).attr(prop.attr, Math.abs(end - start));
|
46236 | }).on("end", function (event) {
|
46237 | var scale = $$.scale.zoom || $$.scale.x;
|
46238 | state.event = event;
|
46239 | zoomRect.attr(prop.axis, 0).attr(prop.attr, 0);
|
46240 |
|
46241 | if (start > end) {
|
46242 | var _ref = [end, start];
|
46243 | start = _ref[0];
|
46244 | end = _ref[1];
|
46245 | }
|
46246 |
|
46247 | if (start < 0) {
|
46248 | end += Math.abs(start);
|
46249 | start = 0;
|
46250 | }
|
46251 |
|
46252 | if (start !== end) {
|
46253 | $$.api.zoom([start, end].map(function (v) {
|
46254 | return scale.invert(v);
|
46255 | }));
|
46256 | }
|
46257 |
|
46258 | $$.setDragStatus(!1);
|
46259 | });
|
46260 | },
|
46261 | setZoomResetButton: function setZoomResetButton() {
|
46262 | var $$ = this,
|
46263 | config = $$.config,
|
46264 | $el = $$.$el,
|
46265 | resetButton = config.zoom_resetButton;
|
46266 |
|
46267 | if (resetButton && config.zoom_type === "drag") {
|
46268 | if (!$el.zoomResetBtn) {
|
46269 | $el.zoomResetBtn = $$.$el.chart.append("div").classed(config_classes.button, !0).append("span").on("click", function () {
|
46270 | isFunction(resetButton.onclick) && resetButton.onclick.bind($$.api)(this);
|
46271 | $$.api.unzoom();
|
46272 | }).classed(config_classes.buttonZoomReset, !0).text(resetButton.text || "Reset Zoom");
|
46273 | } else {
|
46274 | $el.zoomResetBtn.style("display", null);
|
46275 | }
|
46276 | }
|
46277 | }
|
46278 | });
|
46279 | ;// CONCATENATED MODULE: ./src/config/Options/data/selection.ts
|
46280 | /**
|
46281 | * Copyright (c) 2017 ~ present NAVER Corp.
|
46282 | * billboard.js project is licensed under the MIT license
|
46283 | */
|
46284 |
|
46285 | /**
|
46286 | * data.selection config options
|
46287 | */
|
46288 | /* harmony default export */ var data_selection = ({
|
46289 | /**
|
46290 | * Set data selection enabled<br><br>
|
46291 | * 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).
|
46292 | * - **NOTE:** for ESM imports, needs to import 'selection' exports and instantiate it by calling `selection()`.
|
46293 | * - `enabled: selection()`
|
46294 | * @name data․selection․enabled
|
46295 | * @memberof Options
|
46296 | * @type {boolean}
|
46297 | * @default false
|
46298 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Data.DataSelection)
|
46299 | * @example
|
46300 | * data: {
|
46301 | * selection: {
|
46302 | * enabled: true
|
46303 | * }
|
46304 | * }
|
46305 | * @example
|
46306 | * // importing ESM
|
46307 | * import bb, {selection} from "billboard.js";
|
46308 | *
|
46309 | * data: {
|
46310 | * selection: {
|
46311 | * enabled: selection(),
|
46312 | * ...
|
46313 | * }
|
46314 | * }
|
46315 | */
|
46316 | data_selection_enabled: !1,
|
46317 |
|
46318 | /**
|
46319 | * Set grouped selection enabled.<br><br>
|
46320 | * If this option set true, multiple data points that have same x value will be selected by one selection.
|
46321 | * @name data․selection․grouped
|
46322 | * @memberof Options
|
46323 | * @type {boolean}
|
46324 | * @default false
|
46325 | * @example
|
46326 | * data: {
|
46327 | * selection: {
|
46328 | * grouped: true
|
46329 | * }
|
46330 | * }
|
46331 | */
|
46332 | data_selection_grouped: !1,
|
46333 |
|
46334 | /**
|
46335 | * Set a callback for each data point to determine if it's selectable or not.<br><br>
|
46336 | * The callback will receive d as an argument and it has some parameters like id, value, index. This callback should return boolean.
|
46337 | * @name data․selection․isselectable
|
46338 | * @memberof Options
|
46339 | * @type {Function}
|
46340 | * @default function() { return true; }
|
46341 | * @example
|
46342 | * data: {
|
46343 | * selection: {
|
46344 | * isselectable: function(d) { ... }
|
46345 | * }
|
46346 | * }
|
46347 | */
|
46348 | data_selection_isselectable: function data_selection_isselectable() {
|
46349 | return !0;
|
46350 | },
|
46351 |
|
46352 | /**
|
46353 | * Set multiple data points selection enabled.<br><br>
|
46354 | * 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.
|
46355 | * @name data․selection․multiple
|
46356 | * @memberof Options
|
46357 | * @type {boolean}
|
46358 | * @default true
|
46359 | * @example
|
46360 | * data: {
|
46361 | * selection: {
|
46362 | * multiple: false
|
46363 | * }
|
46364 | * }
|
46365 | */
|
46366 | data_selection_multiple: !0,
|
46367 |
|
46368 | /**
|
46369 | * Enable to select data points by dragging.
|
46370 | * If this option set true, data points can be selected by dragging.
|
46371 | * - **NOTE:** If this option set true, scrolling on the chart will be disabled because dragging event will handle the event.
|
46372 | * @name data․selection․draggable
|
46373 | * @memberof Options
|
46374 | * @type {boolean}
|
46375 | * @default false
|
46376 | * @example
|
46377 | * data: {
|
46378 | * selection: {
|
46379 | * draggable: true
|
46380 | * }
|
46381 | * }
|
46382 | */
|
46383 | data_selection_draggable: !1,
|
46384 |
|
46385 | /**
|
46386 | * Set a callback for on data selection.
|
46387 | * @name data․onselected
|
46388 | * @memberof Options
|
46389 | * @type {Function}
|
46390 | * @default function() {}
|
46391 | * @example
|
46392 | * data: {
|
46393 | * onselected: function(d, element) {
|
46394 | * // d - ex) {x: 4, value: 150, id: "data1", index: 4, name: "data1"}
|
46395 | * // element - <circle>
|
46396 | * ...
|
46397 | * }
|
46398 | * }
|
46399 | */
|
46400 | data_onselected: function data_onselected() {},
|
46401 |
|
46402 | /**
|
46403 | * Set a callback for on data un-selection.
|
46404 | * @name data․onunselected
|
46405 | * @memberof Options
|
46406 | * @type {Function}
|
46407 | * @default function() {}
|
46408 | * @example
|
46409 | * data: {
|
46410 | * onunselected: function(d, element) {
|
46411 | * // d - ex) {x: 4, value: 150, id: "data1", index: 4, name: "data1"}
|
46412 | * // element - <circle>
|
46413 | * ...
|
46414 | * }
|
46415 | * }
|
46416 | */
|
46417 | data_onunselected: function data_onunselected() {}
|
46418 | });
|
46419 | ;// CONCATENATED MODULE: ./src/config/Options/interaction/subchart.ts
|
46420 | /**
|
46421 | * Copyright (c) 2017 ~ present NAVER Corp.
|
46422 | * billboard.js project is licensed under the MIT license
|
46423 | */
|
46424 |
|
46425 | /**
|
46426 | * x Axis config options
|
46427 | */
|
46428 | /* harmony default export */ var interaction_subchart = ({
|
46429 | /**
|
46430 | * Set subchart options.
|
46431 | * - **NOTE:** Not supported for `bubble`, `scatter` and non-Axis based(pie, donut, gauge, radar) types.
|
46432 | * @name subchart
|
46433 | * @memberof Options
|
46434 | * @type {object}
|
46435 | * @property {object} subchart Subchart object
|
46436 | * @property {boolean} [subchart.show=false] Show sub chart on the bottom of the chart.
|
46437 | * - **NOTE:** for ESM imports, needs to import 'subchart' exports and instantiate it by calling `subchart()`.
|
46438 | * - `show: subchart()`
|
46439 | * @property {boolean} [subchart.showHandle=false] Show sub chart's handle.
|
46440 | * @property {boolean} [subchart.axis.x.show=true] Show or hide x axis.
|
46441 | * @property {boolean} [subchart.axis.x.tick.show=true] Show or hide x axis tick line.
|
46442 | * @property {Function|string} [subchart.axis.x.tick.format] Use custom format for x axis ticks - see [axis.x.tick.format](#.axis․x․tick․format) for details.
|
46443 | * @property {boolean} [subchart.axis.x.tick.text.show=true] Show or hide x axis tick text.
|
46444 | * @property {Array} [subchart.init.range] Set initial selection domain range.
|
46445 | * @property {number} [subchart.size.height] Change the height of the subchart.
|
46446 | * @property {Function} [subchart.onbrush] Set callback for brush event.<br>
|
46447 | * Specified function receives the current zoomed x domain.
|
46448 | * @see [Demo](https://naver.github.io/billboard.js/demo/#Interaction.SubChart)
|
46449 | * @example
|
46450 | * subchart: {
|
46451 | * show: true,
|
46452 | * showHandle: true,
|
46453 | * size: {
|
46454 | * height: 20
|
46455 | * },
|
46456 | * init: {
|
46457 | * // specify initial range domain selection
|
46458 | * range: [1, 2]
|
46459 | * },
|
46460 | * axis: {
|
46461 | * x: {
|
46462 | * show: true,
|
46463 | * tick: {
|
46464 | * show: true,
|
46465 | * format: (x) => d3Format(".1f")(x)
|
46466 | * text: {
|
46467 | * show: false
|
46468 | * }
|
46469 | * }
|
46470 | * }
|
46471 | * },
|
46472 | * onbrush: function(domain) { ... }
|
46473 | * }
|
46474 | * @example
|
46475 | * // importing ESM
|
46476 | * import bb, {subchart} from "billboard.js";
|
46477 | *
|
46478 | * subchart: {
|
46479 | * show: subchart(),
|
46480 | * ...
|
46481 | * }
|
46482 | */
|
46483 | subchart_show: !1,
|
46484 | subchart_showHandle: !1,
|
46485 | subchart_size_height: 60,
|
46486 | subchart_axis_x_show: !0,
|
46487 | subchart_axis_x_tick_show: !0,
|
46488 | subchart_axis_x_tick_format: undefined,
|
46489 | subchart_axis_x_tick_text_show: !0,
|
46490 | subchart_init_range: undefined,
|
46491 | subchart_onbrush: function subchart_onbrush() {}
|
46492 | });
|
46493 | ;// CONCATENATED MODULE: ./src/config/Options/interaction/zoom.ts
|
46494 | /**
|
46495 | * Copyright (c) 2017 ~ present NAVER Corp.
|
46496 | * billboard.js project is licensed under the MIT license
|
46497 | */
|
46498 |
|
46499 | /**
|
46500 | * zoom config options
|
46501 | */
|
46502 | /* harmony default export */ var interaction_zoom = ({
|
46503 | /**
|
46504 | * Set zoom options
|
46505 | * @name zoom
|
46506 | * @memberof Options
|
46507 | * @type {object}
|
46508 | * @property {object} zoom Zoom object
|
46509 | * @property {boolean} [zoom.enabled=false] Enable zooming.
|
46510 | * - **NOTE:** for ESM imports, needs to import 'zoom' exports and instantiate it by calling `zoom()`.
|
46511 | * - `enabled: zoom()`
|
46512 | * @property {string} [zoom.type='wheel'] Set zoom interaction type.
|
46513 | * - **Available types:**
|
46514 | * - wheel
|
46515 | * - drag
|
46516 | * @property {boolean} [zoom.rescale=false] Enable to rescale after zooming.<br>
|
46517 | * If true set, y domain will be updated according to the zoomed region.
|
46518 | * @property {Array} [zoom.extent=[1, 10]] Change zoom extent.
|
46519 | * @property {number|Date} [zoom.x.min] Set x Axis minimum zoom range
|
46520 | * @property {number|Date} [zoom.x.max] Set x Axis maximum zoom range
|
46521 | * @property {Function} [zoom.onzoomstart=undefined] Set callback that is called when zooming starts.<br>
|
46522 | * Specified function receives the zoom event.
|
46523 | * @property {Function} [zoom.onzoom=undefined] Set callback that is called when the chart is zooming.<br>
|
46524 | * Specified function receives the zoomed domain.
|
46525 | * @property {Function} [zoom.onzoomend=undefined] Set callback that is called when zooming ends.<br>
|
46526 | * Specified function receives the zoomed domain.
|
46527 | * @property {boolean|object} [zoom.resetButton=true] Set to display zoom reset button for 'drag' type zoom
|
46528 | * @property {Function} [zoom.resetButton.onclick] Set callback when clicks the reset button. The callback will receive reset button element reference as argument.
|
46529 | * @property {string} [zoom.resetButton.text='Reset Zoom'] Text value for zoom reset button.
|
46530 | * @see [Demo:zoom](https://naver.github.io/billboard.js/demo/#Interaction.Zoom)
|
46531 | * @see [Demo:drag zoom](https://naver.github.io/billboard.js/demo/#Interaction.DragZoom)
|
46532 | * @example
|
46533 | * zoom: {
|
46534 | * enabled: true,
|
46535 | * type: "drag",
|
46536 | * rescale: true,
|
46537 | * extent: [1, 100] // enable more zooming
|
46538 | * x: {
|
46539 | * min: -1, // set min range
|
46540 | * max: 10 // set max range
|
46541 | * },
|
46542 | * onzoomstart: function(event) { ... },
|
46543 | * onzoom: function(domain) { ... },
|
46544 | * onzoomend: function(domain) { ... },
|
46545 | *
|
46546 | * // show reset button when is zoomed-in
|
46547 | * resetButton: true,
|
46548 | *
|
46549 | * resetButton: {
|
46550 | * // onclick callback when reset button is clicked
|
46551 | * onclick: function(button) {
|
46552 | * button; // Reset button element reference
|
46553 | * ...
|
46554 | * },
|
46555 | *
|
46556 | * // customized text value for reset zoom button
|
46557 | * text: "Unzoom"
|
46558 | * }
|
46559 | * }
|
46560 | * @example
|
46561 | * // importing ESM
|
46562 | * import bb, {zoom} from "billboard.js";
|
46563 | *
|
46564 | * zoom: {
|
46565 | * enabled: zoom(),
|
46566 | * ...
|
46567 | * }
|
46568 | */
|
46569 | zoom_enabled: !1,
|
46570 | zoom_type: "wheel",
|
46571 | zoom_extent: undefined,
|
46572 | zoom_privileged: !1,
|
46573 | zoom_rescale: !1,
|
46574 | zoom_onzoom: undefined,
|
46575 | zoom_onzoomstart: undefined,
|
46576 | zoom_onzoomend: undefined,
|
46577 | zoom_resetButton: !0,
|
46578 | zoom_x_min: undefined,
|
46579 | zoom_x_max: undefined
|
46580 | });
|
46581 | ;// CONCATENATED MODULE: ./src/config/resolver/interaction.ts
|
46582 | /**
|
46583 | * Copyright (c) 2017 ~ present NAVER Corp.
|
46584 | * billboard.js project is licensed under the MIT license
|
46585 | */
|
46586 |
|
46587 |
|
46588 |
|
46589 | // Chart
|
46590 |
|
46591 |
|
46592 |
|
46593 | // ChartInternal
|
46594 |
|
46595 |
|
46596 |
|
46597 | // Axis based options
|
46598 |
|
46599 |
|
46600 |
|
46601 |
|
46602 |
|
46603 |
|
46604 | var _selectionModule = function selectionModule() {
|
46605 | util_extend(ChartInternal.prototype, internals_selection);
|
46606 | util_extend(Chart.prototype, api_selection);
|
46607 | Options.setOptions([data_selection]);
|
46608 | return (_selectionModule = function selectionModule() {
|
46609 | return !0;
|
46610 | })();
|
46611 | },
|
46612 | subchartModule = function () {
|
46613 | util_extend(ChartInternal.prototype, interactions_subchart);
|
46614 | util_extend(Chart.prototype, subchart);
|
46615 | Options.setOptions([interaction_subchart]);
|
46616 | return (subchartModule = function () {
|
46617 | return !0;
|
46618 | })();
|
46619 | },
|
46620 | zoomModule = function () {
|
46621 | util_extend(ChartInternal.prototype, interactions_zoom);
|
46622 | util_extend(Chart.prototype, api_zoom);
|
46623 | Options.setOptions([interaction_zoom]);
|
46624 | return (zoomModule = function () {
|
46625 | return !0;
|
46626 | })();
|
46627 | };
|
46628 | ;// CONCATENATED MODULE: ./src/core.ts
|
46629 | /**
|
46630 | * Copyright (c) 2017 ~ present NAVER Corp.
|
46631 | * billboard project is licensed under the MIT license
|
46632 | */
|
46633 |
|
46634 | // eslint-disable-next-line no-use-before-define
|
46635 |
|
46636 |
|
46637 | var _defaults = {},
|
46638 | bb = {
|
46639 | /**
|
46640 | * Version information
|
46641 | * @property {string} version version
|
46642 | * @example
|
46643 | * bb.version; // "1.0.0"
|
46644 | * @memberof bb
|
46645 | */
|
46646 | version: "3.2.1",
|
46647 |
|
46648 | /**
|
46649 | * Generate chart
|
46650 | * - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when:
|
46651 | * - Unused option value is given.
|
46652 | * - ex) For `data.type="pie"` option, setting 'axis' option can cause unexpected generation error.
|
46653 | * - Insufficient value is given for certain option used.
|
46654 | * - ex) `data: { x: "x", columns: [["x"], ["data1", 30, 200, 100]] }`
|
46655 | * @param {Options} config chart options
|
46656 | * @memberof bb
|
46657 | * @returns {Chart}
|
46658 | * @see {@link Options} for different generation options
|
46659 | * @see {@link Chart} for different methods API
|
46660 | * @example
|
46661 | * <!-- chart holder -->
|
46662 | * <div id="LineChart"></div>
|
46663 | * @example
|
46664 | * // Generate chart with options
|
46665 | * var chart = bb.generate({
|
46666 | * "bindto": "#LineChart"
|
46667 | * "data": {
|
46668 | * "columns": [
|
46669 | * ["data1", 30, 200, 100, 400, 150, 250],
|
46670 | * ["data2", 50, 20, 10, 40, 15, 25]
|
46671 | * ],
|
46672 | * "type": "line"
|
46673 | * }
|
46674 | * });
|
46675 | *
|
46676 | * // call some API
|
46677 | * // ex) get the data of 'data1'
|
46678 | * chart.data("data1");
|
46679 | * @example
|
46680 | * // Generate chart by importing ESM
|
46681 | * // Import types to be used only, where this will make smaller bundle size.
|
46682 | * import bb, {
|
46683 | * area,
|
46684 | * areaLineRange,
|
46685 | * areaSpline,
|
46686 | * areaSplineRange,
|
46687 | * areaStep,
|
46688 | * bar,
|
46689 | * bubble,
|
46690 | * donut,
|
46691 | * gauge,
|
46692 | * line,
|
46693 | * pie,
|
46694 | * radar,
|
46695 | * scatter,
|
46696 | * spline,
|
46697 | * step
|
46698 | * }
|
46699 | *
|
46700 | * bb.generate({
|
46701 | * "bindto": "#LineChart"
|
46702 | * "data": {
|
46703 | * "columns": [
|
46704 | * ["data1", 30, 200, 100, 400, 150, 250],
|
46705 | * ["data2", 50, 20, 10, 40, 15, 25]
|
46706 | * ]
|
46707 | * },
|
46708 | * type: line(),
|
46709 | *
|
46710 | * // or
|
46711 | * types: {
|
46712 | * data1: bar(),
|
46713 | * data2: step()
|
46714 | * }
|
46715 | * });
|
46716 | */
|
46717 | generate: function generate(config) {
|
46718 | var options = mergeObj({}, _defaults, config),
|
46719 | inst = new Chart(options);
|
46720 | inst.internal.charts = this.instance;
|
46721 | this.instance.push(inst);
|
46722 | return inst;
|
46723 | },
|
46724 |
|
46725 | /**
|
46726 | * Set or get global default options.
|
46727 | * - **NOTE:**
|
46728 | * - The options values settings are valid within page context only.
|
46729 | * - If is called multiple times, will override the last value.
|
46730 | * @param {Options} options chart options
|
46731 | * @memberof bb
|
46732 | * @returns {Options}
|
46733 | * @see {@link Options}
|
46734 | * @example
|
46735 | * // Set same option value as for `.generate()`
|
46736 | * bb.defaults({
|
46737 | * data: {
|
46738 | * type: "bar"
|
46739 | * }
|
46740 | * });
|
46741 | *
|
46742 | * bb.defaults(); // {data:{type: "bar"}}
|
46743 | *
|
46744 | * // data.type defaults to 'bar'
|
46745 | * var chart = bb.generate({ ... });
|
46746 | */
|
46747 | defaults: function defaults(options) {
|
46748 | if (isObject(options)) {
|
46749 | _defaults = options;
|
46750 | }
|
46751 |
|
46752 | return _defaults;
|
46753 | },
|
46754 |
|
46755 | /**
|
46756 | * An array containing instance created
|
46757 | * @property {Array} instance instance array
|
46758 | * @example
|
46759 | * // generate charts
|
46760 | * var chart1 = bb.generate(...);
|
46761 | * var chart2 = bb.generate(...);
|
46762 | *
|
46763 | * bb.instance; // [ chart1, chart2, ... ]
|
46764 | * @memberof bb
|
46765 | */
|
46766 | instance: [],
|
46767 |
|
46768 | /**
|
46769 | * Namespace for plugins
|
46770 | * @property {object} plugin plugin namespace
|
46771 | * @example
|
46772 | * // Stanford diagram plugin
|
46773 | * bb.plugin.stanford;
|
46774 | * @memberof bb
|
46775 | */
|
46776 | plugin: {}
|
46777 | };
|
46778 | /**
|
46779 | * @namespace bb
|
46780 | * @version 3.2.1
|
46781 | */
|
46782 | ;// CONCATENATED MODULE: ./src/index.ts
|
46783 | /**
|
46784 | * Copyright (c) 2017 ~ present NAVER Corp.
|
46785 | * billboard project is licensed under the MIT license
|
46786 | */
|
46787 |
|
46788 | // extends shape modules
|
46789 |
|
46790 | Object.keys(resolver_shape_namespaceObject).forEach(function (v) {
|
46791 | return resolver_shape_namespaceObject[v]();
|
46792 | }); // extends interaction modules
|
46793 |
|
46794 | Object.keys(resolver_interaction_namespaceObject).forEach(function (v) {
|
46795 | return resolver_interaction_namespaceObject[v]();
|
46796 | });
|
46797 |
|
46798 |
|
46799 | /***/ }),
|
46800 | /* 427 */
|
46801 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
46802 |
|
46803 | module.exports = __webpack_require__(428);
|
46804 |
|
46805 |
|
46806 | /***/ }),
|
46807 | /* 428 */
|
46808 | /***/ (function(module) {
|
46809 |
|
46810 | /**
|
46811 | * Copyright (c) 2014-present, Facebook, Inc.
|
46812 | *
|
46813 | * This source code is licensed under the MIT license found in the
|
46814 | * LICENSE file in the root directory of this source tree.
|
46815 | */
|
46816 |
|
46817 | var runtime = (function (exports) {
|
46818 | "use strict";
|
46819 |
|
46820 | var Op = Object.prototype;
|
46821 | var hasOwn = Op.hasOwnProperty;
|
46822 | var undefined; // More compressible than void 0.
|
46823 | var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
46824 | var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
46825 | var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
46826 | var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
46827 |
|
46828 | function define(obj, key, value) {
|
46829 | Object.defineProperty(obj, key, {
|
46830 | value: value,
|
46831 | enumerable: true,
|
46832 | configurable: true,
|
46833 | writable: true
|
46834 | });
|
46835 | return obj[key];
|
46836 | }
|
46837 | try {
|
46838 | // IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
46839 | define({}, "");
|
46840 | } catch (err) {
|
46841 | define = function(obj, key, value) {
|
46842 | return obj[key] = value;
|
46843 | };
|
46844 | }
|
46845 |
|
46846 | function wrap(innerFn, outerFn, self, tryLocsList) {
|
46847 | // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
46848 | var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
46849 | var generator = Object.create(protoGenerator.prototype);
|
46850 | var context = new Context(tryLocsList || []);
|
46851 |
|
46852 | // The ._invoke method unifies the implementations of the .next,
|
46853 | // .throw, and .return methods.
|
46854 | generator._invoke = makeInvokeMethod(innerFn, self, context);
|
46855 |
|
46856 | return generator;
|
46857 | }
|
46858 | exports.wrap = wrap;
|
46859 |
|
46860 | // Try/catch helper to minimize deoptimizations. Returns a completion
|
46861 | // record like context.tryEntries[i].completion. This interface could
|
46862 | // have been (and was previously) designed to take a closure to be
|
46863 | // invoked without arguments, but in all the cases we care about we
|
46864 | // already have an existing method we want to call, so there's no need
|
46865 | // to create a new function object. We can even get away with assuming
|
46866 | // the method takes exactly one argument, since that happens to be true
|
46867 | // in every case, so we don't have to touch the arguments object. The
|
46868 | // only additional allocation required is the completion record, which
|
46869 | // has a stable shape and so hopefully should be cheap to allocate.
|
46870 | function tryCatch(fn, obj, arg) {
|
46871 | try {
|
46872 | return { type: "normal", arg: fn.call(obj, arg) };
|
46873 | } catch (err) {
|
46874 | return { type: "throw", arg: err };
|
46875 | }
|
46876 | }
|
46877 |
|
46878 | var GenStateSuspendedStart = "suspendedStart";
|
46879 | var GenStateSuspendedYield = "suspendedYield";
|
46880 | var GenStateExecuting = "executing";
|
46881 | var GenStateCompleted = "completed";
|
46882 |
|
46883 | // Returning this object from the innerFn has the same effect as
|
46884 | // breaking out of the dispatch switch statement.
|
46885 | var ContinueSentinel = {};
|
46886 |
|
46887 | // Dummy constructor functions that we use as the .constructor and
|
46888 | // .constructor.prototype properties for functions that return Generator
|
46889 | // objects. For full spec compliance, you may wish to configure your
|
46890 | // minifier not to mangle the names of these two functions.
|
46891 | function Generator() {}
|
46892 | function GeneratorFunction() {}
|
46893 | function GeneratorFunctionPrototype() {}
|
46894 |
|
46895 | // This is a polyfill for %IteratorPrototype% for environments that
|
46896 | // don't natively support it.
|
46897 | var IteratorPrototype = {};
|
46898 | define(IteratorPrototype, iteratorSymbol, function () {
|
46899 | return this;
|
46900 | });
|
46901 |
|
46902 | var getProto = Object.getPrototypeOf;
|
46903 | var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
46904 | if (NativeIteratorPrototype &&
|
46905 | NativeIteratorPrototype !== Op &&
|
46906 | hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
46907 | // This environment has a native %IteratorPrototype%; use it instead
|
46908 | // of the polyfill.
|
46909 | IteratorPrototype = NativeIteratorPrototype;
|
46910 | }
|
46911 |
|
46912 | var Gp = GeneratorFunctionPrototype.prototype =
|
46913 | Generator.prototype = Object.create(IteratorPrototype);
|
46914 | GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
46915 | define(Gp, "constructor", GeneratorFunctionPrototype);
|
46916 | define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
|
46917 | GeneratorFunction.displayName = define(
|
46918 | GeneratorFunctionPrototype,
|
46919 | toStringTagSymbol,
|
46920 | "GeneratorFunction"
|
46921 | );
|
46922 |
|
46923 | // Helper for defining the .next, .throw, and .return methods of the
|
46924 | // Iterator interface in terms of a single ._invoke method.
|
46925 | function defineIteratorMethods(prototype) {
|
46926 | ["next", "throw", "return"].forEach(function(method) {
|
46927 | define(prototype, method, function(arg) {
|
46928 | return this._invoke(method, arg);
|
46929 | });
|
46930 | });
|
46931 | }
|
46932 |
|
46933 | exports.isGeneratorFunction = function(genFun) {
|
46934 | var ctor = typeof genFun === "function" && genFun.constructor;
|
46935 | return ctor
|
46936 | ? ctor === GeneratorFunction ||
|
46937 | // For the native GeneratorFunction constructor, the best we can
|
46938 | // do is to check its .name property.
|
46939 | (ctor.displayName || ctor.name) === "GeneratorFunction"
|
46940 | : false;
|
46941 | };
|
46942 |
|
46943 | exports.mark = function(genFun) {
|
46944 | if (Object.setPrototypeOf) {
|
46945 | Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
46946 | } else {
|
46947 | genFun.__proto__ = GeneratorFunctionPrototype;
|
46948 | define(genFun, toStringTagSymbol, "GeneratorFunction");
|
46949 | }
|
46950 | genFun.prototype = Object.create(Gp);
|
46951 | return genFun;
|
46952 | };
|
46953 |
|
46954 | // Within the body of any async function, `await x` is transformed to
|
46955 | // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
46956 | // `hasOwn.call(value, "__await")` to determine if the yielded value is
|
46957 | // meant to be awaited.
|
46958 | exports.awrap = function(arg) {
|
46959 | return { __await: arg };
|
46960 | };
|
46961 |
|
46962 | function AsyncIterator(generator, PromiseImpl) {
|
46963 | function invoke(method, arg, resolve, reject) {
|
46964 | var record = tryCatch(generator[method], generator, arg);
|
46965 | if (record.type === "throw") {
|
46966 | reject(record.arg);
|
46967 | } else {
|
46968 | var result = record.arg;
|
46969 | var value = result.value;
|
46970 | if (value &&
|
46971 | typeof value === "object" &&
|
46972 | hasOwn.call(value, "__await")) {
|
46973 | return PromiseImpl.resolve(value.__await).then(function(value) {
|
46974 | invoke("next", value, resolve, reject);
|
46975 | }, function(err) {
|
46976 | invoke("throw", err, resolve, reject);
|
46977 | });
|
46978 | }
|
46979 |
|
46980 | return PromiseImpl.resolve(value).then(function(unwrapped) {
|
46981 | // When a yielded Promise is resolved, its final value becomes
|
46982 | // the .value of the Promise<{value,done}> result for the
|
46983 | // current iteration.
|
46984 | result.value = unwrapped;
|
46985 | resolve(result);
|
46986 | }, function(error) {
|
46987 | // If a rejected Promise was yielded, throw the rejection back
|
46988 | // into the async generator function so it can be handled there.
|
46989 | return invoke("throw", error, resolve, reject);
|
46990 | });
|
46991 | }
|
46992 | }
|
46993 |
|
46994 | var previousPromise;
|
46995 |
|
46996 | function enqueue(method, arg) {
|
46997 | function callInvokeWithMethodAndArg() {
|
46998 | return new PromiseImpl(function(resolve, reject) {
|
46999 | invoke(method, arg, resolve, reject);
|
47000 | });
|
47001 | }
|
47002 |
|
47003 | return previousPromise =
|
47004 | // If enqueue has been called before, then we want to wait until
|
47005 | // all previous Promises have been resolved before calling invoke,
|
47006 | // so that results are always delivered in the correct order. If
|
47007 | // enqueue has not been called before, then it is important to
|
47008 | // call invoke immediately, without waiting on a callback to fire,
|
47009 | // so that the async generator function has the opportunity to do
|
47010 | // any necessary setup in a predictable way. This predictability
|
47011 | // is why the Promise constructor synchronously invokes its
|
47012 | // executor callback, and why async functions synchronously
|
47013 | // execute code before the first await. Since we implement simple
|
47014 | // async functions in terms of async generators, it is especially
|
47015 | // important to get this right, even though it requires care.
|
47016 | previousPromise ? previousPromise.then(
|
47017 | callInvokeWithMethodAndArg,
|
47018 | // Avoid propagating failures to Promises returned by later
|
47019 | // invocations of the iterator.
|
47020 | callInvokeWithMethodAndArg
|
47021 | ) : callInvokeWithMethodAndArg();
|
47022 | }
|
47023 |
|
47024 | // Define the unified helper method that is used to implement .next,
|
47025 | // .throw, and .return (see defineIteratorMethods).
|
47026 | this._invoke = enqueue;
|
47027 | }
|
47028 |
|
47029 | defineIteratorMethods(AsyncIterator.prototype);
|
47030 | define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
47031 | return this;
|
47032 | });
|
47033 | exports.AsyncIterator = AsyncIterator;
|
47034 |
|
47035 | // Note that simple async functions are implemented on top of
|
47036 | // AsyncIterator objects; they just return a Promise for the value of
|
47037 | // the final result produced by the iterator.
|
47038 | exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
47039 | if (PromiseImpl === void 0) PromiseImpl = Promise;
|
47040 |
|
47041 | var iter = new AsyncIterator(
|
47042 | wrap(innerFn, outerFn, self, tryLocsList),
|
47043 | PromiseImpl
|
47044 | );
|
47045 |
|
47046 | return exports.isGeneratorFunction(outerFn)
|
47047 | ? iter // If outerFn is a generator, return the full iterator.
|
47048 | : iter.next().then(function(result) {
|
47049 | return result.done ? result.value : iter.next();
|
47050 | });
|
47051 | };
|
47052 |
|
47053 | function makeInvokeMethod(innerFn, self, context) {
|
47054 | var state = GenStateSuspendedStart;
|
47055 |
|
47056 | return function invoke(method, arg) {
|
47057 | if (state === GenStateExecuting) {
|
47058 | throw new Error("Generator is already running");
|
47059 | }
|
47060 |
|
47061 | if (state === GenStateCompleted) {
|
47062 | if (method === "throw") {
|
47063 | throw arg;
|
47064 | }
|
47065 |
|
47066 | // Be forgiving, per 25.3.3.3.3 of the spec:
|
47067 | // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
47068 | return doneResult();
|
47069 | }
|
47070 |
|
47071 | context.method = method;
|
47072 | context.arg = arg;
|
47073 |
|
47074 | while (true) {
|
47075 | var delegate = context.delegate;
|
47076 | if (delegate) {
|
47077 | var delegateResult = maybeInvokeDelegate(delegate, context);
|
47078 | if (delegateResult) {
|
47079 | if (delegateResult === ContinueSentinel) continue;
|
47080 | return delegateResult;
|
47081 | }
|
47082 | }
|
47083 |
|
47084 | if (context.method === "next") {
|
47085 | // Setting context._sent for legacy support of Babel's
|
47086 | // function.sent implementation.
|
47087 | context.sent = context._sent = context.arg;
|
47088 |
|
47089 | } else if (context.method === "throw") {
|
47090 | if (state === GenStateSuspendedStart) {
|
47091 | state = GenStateCompleted;
|
47092 | throw context.arg;
|
47093 | }
|
47094 |
|
47095 | context.dispatchException(context.arg);
|
47096 |
|
47097 | } else if (context.method === "return") {
|
47098 | context.abrupt("return", context.arg);
|
47099 | }
|
47100 |
|
47101 | state = GenStateExecuting;
|
47102 |
|
47103 | var record = tryCatch(innerFn, self, context);
|
47104 | if (record.type === "normal") {
|
47105 | // If an exception is thrown from innerFn, we leave state ===
|
47106 | // GenStateExecuting and loop back for another invocation.
|
47107 | state = context.done
|
47108 | ? GenStateCompleted
|
47109 | : GenStateSuspendedYield;
|
47110 |
|
47111 | if (record.arg === ContinueSentinel) {
|
47112 | continue;
|
47113 | }
|
47114 |
|
47115 | return {
|
47116 | value: record.arg,
|
47117 | done: context.done
|
47118 | };
|
47119 |
|
47120 | } else if (record.type === "throw") {
|
47121 | state = GenStateCompleted;
|
47122 | // Dispatch the exception by looping back around to the
|
47123 | // context.dispatchException(context.arg) call above.
|
47124 | context.method = "throw";
|
47125 | context.arg = record.arg;
|
47126 | }
|
47127 | }
|
47128 | };
|
47129 | }
|
47130 |
|
47131 | // Call delegate.iterator[context.method](context.arg) and handle the
|
47132 | // result, either by returning a { value, done } result from the
|
47133 | // delegate iterator, or by modifying context.method and context.arg,
|
47134 | // setting context.delegate to null, and returning the ContinueSentinel.
|
47135 | function maybeInvokeDelegate(delegate, context) {
|
47136 | var method = delegate.iterator[context.method];
|
47137 | if (method === undefined) {
|
47138 | // A .throw or .return when the delegate iterator has no .throw
|
47139 | // method always terminates the yield* loop.
|
47140 | context.delegate = null;
|
47141 |
|
47142 | if (context.method === "throw") {
|
47143 | // Note: ["return"] must be used for ES3 parsing compatibility.
|
47144 | if (delegate.iterator["return"]) {
|
47145 | // If the delegate iterator has a return method, give it a
|
47146 | // chance to clean up.
|
47147 | context.method = "return";
|
47148 | context.arg = undefined;
|
47149 | maybeInvokeDelegate(delegate, context);
|
47150 |
|
47151 | if (context.method === "throw") {
|
47152 | // If maybeInvokeDelegate(context) changed context.method from
|
47153 | // "return" to "throw", let that override the TypeError below.
|
47154 | return ContinueSentinel;
|
47155 | }
|
47156 | }
|
47157 |
|
47158 | context.method = "throw";
|
47159 | context.arg = new TypeError(
|
47160 | "The iterator does not provide a 'throw' method");
|
47161 | }
|
47162 |
|
47163 | return ContinueSentinel;
|
47164 | }
|
47165 |
|
47166 | var record = tryCatch(method, delegate.iterator, context.arg);
|
47167 |
|
47168 | if (record.type === "throw") {
|
47169 | context.method = "throw";
|
47170 | context.arg = record.arg;
|
47171 | context.delegate = null;
|
47172 | return ContinueSentinel;
|
47173 | }
|
47174 |
|
47175 | var info = record.arg;
|
47176 |
|
47177 | if (! info) {
|
47178 | context.method = "throw";
|
47179 | context.arg = new TypeError("iterator result is not an object");
|
47180 | context.delegate = null;
|
47181 | return ContinueSentinel;
|
47182 | }
|
47183 |
|
47184 | if (info.done) {
|
47185 | // Assign the result of the finished delegate to the temporary
|
47186 | // variable specified by delegate.resultName (see delegateYield).
|
47187 | context[delegate.resultName] = info.value;
|
47188 |
|
47189 | // Resume execution at the desired location (see delegateYield).
|
47190 | context.next = delegate.nextLoc;
|
47191 |
|
47192 | // If context.method was "throw" but the delegate handled the
|
47193 | // exception, let the outer generator proceed normally. If
|
47194 | // context.method was "next", forget context.arg since it has been
|
47195 | // "consumed" by the delegate iterator. If context.method was
|
47196 | // "return", allow the original .return call to continue in the
|
47197 | // outer generator.
|
47198 | if (context.method !== "return") {
|
47199 | context.method = "next";
|
47200 | context.arg = undefined;
|
47201 | }
|
47202 |
|
47203 | } else {
|
47204 | // Re-yield the result returned by the delegate method.
|
47205 | return info;
|
47206 | }
|
47207 |
|
47208 | // The delegate iterator is finished, so forget it and continue with
|
47209 | // the outer generator.
|
47210 | context.delegate = null;
|
47211 | return ContinueSentinel;
|
47212 | }
|
47213 |
|
47214 | // Define Generator.prototype.{next,throw,return} in terms of the
|
47215 | // unified ._invoke helper method.
|
47216 | defineIteratorMethods(Gp);
|
47217 |
|
47218 | define(Gp, toStringTagSymbol, "Generator");
|
47219 |
|
47220 | // A Generator should always return itself as the iterator object when the
|
47221 | // @@iterator function is called on it. Some browsers' implementations of the
|
47222 | // iterator prototype chain incorrectly implement this, causing the Generator
|
47223 | // object to not be returned from this call. This ensures that doesn't happen.
|
47224 | // See https://github.com/facebook/regenerator/issues/274 for more details.
|
47225 | define(Gp, iteratorSymbol, function() {
|
47226 | return this;
|
47227 | });
|
47228 |
|
47229 | define(Gp, "toString", function() {
|
47230 | return "[object Generator]";
|
47231 | });
|
47232 |
|
47233 | function pushTryEntry(locs) {
|
47234 | var entry = { tryLoc: locs[0] };
|
47235 |
|
47236 | if (1 in locs) {
|
47237 | entry.catchLoc = locs[1];
|
47238 | }
|
47239 |
|
47240 | if (2 in locs) {
|
47241 | entry.finallyLoc = locs[2];
|
47242 | entry.afterLoc = locs[3];
|
47243 | }
|
47244 |
|
47245 | this.tryEntries.push(entry);
|
47246 | }
|
47247 |
|
47248 | function resetTryEntry(entry) {
|
47249 | var record = entry.completion || {};
|
47250 | record.type = "normal";
|
47251 | delete record.arg;
|
47252 | entry.completion = record;
|
47253 | }
|
47254 |
|
47255 | function Context(tryLocsList) {
|
47256 | // The root entry object (effectively a try statement without a catch
|
47257 | // or a finally block) gives us a place to store values thrown from
|
47258 | // locations where there is no enclosing try statement.
|
47259 | this.tryEntries = [{ tryLoc: "root" }];
|
47260 | tryLocsList.forEach(pushTryEntry, this);
|
47261 | this.reset(true);
|
47262 | }
|
47263 |
|
47264 | exports.keys = function(object) {
|
47265 | var keys = [];
|
47266 | for (var key in object) {
|
47267 | keys.push(key);
|
47268 | }
|
47269 | keys.reverse();
|
47270 |
|
47271 | // Rather than returning an object with a next method, we keep
|
47272 | // things simple and return the next function itself.
|
47273 | return function next() {
|
47274 | while (keys.length) {
|
47275 | var key = keys.pop();
|
47276 | if (key in object) {
|
47277 | next.value = key;
|
47278 | next.done = false;
|
47279 | return next;
|
47280 | }
|
47281 | }
|
47282 |
|
47283 | // To avoid creating an additional object, we just hang the .value
|
47284 | // and .done properties off the next function object itself. This
|
47285 | // also ensures that the minifier will not anonymize the function.
|
47286 | next.done = true;
|
47287 | return next;
|
47288 | };
|
47289 | };
|
47290 |
|
47291 | function values(iterable) {
|
47292 | if (iterable) {
|
47293 | var iteratorMethod = iterable[iteratorSymbol];
|
47294 | if (iteratorMethod) {
|
47295 | return iteratorMethod.call(iterable);
|
47296 | }
|
47297 |
|
47298 | if (typeof iterable.next === "function") {
|
47299 | return iterable;
|
47300 | }
|
47301 |
|
47302 | if (!isNaN(iterable.length)) {
|
47303 | var i = -1, next = function next() {
|
47304 | while (++i < iterable.length) {
|
47305 | if (hasOwn.call(iterable, i)) {
|
47306 | next.value = iterable[i];
|
47307 | next.done = false;
|
47308 | return next;
|
47309 | }
|
47310 | }
|
47311 |
|
47312 | next.value = undefined;
|
47313 | next.done = true;
|
47314 |
|
47315 | return next;
|
47316 | };
|
47317 |
|
47318 | return next.next = next;
|
47319 | }
|
47320 | }
|
47321 |
|
47322 | // Return an iterator with no values.
|
47323 | return { next: doneResult };
|
47324 | }
|
47325 | exports.values = values;
|
47326 |
|
47327 | function doneResult() {
|
47328 | return { value: undefined, done: true };
|
47329 | }
|
47330 |
|
47331 | Context.prototype = {
|
47332 | constructor: Context,
|
47333 |
|
47334 | reset: function(skipTempReset) {
|
47335 | this.prev = 0;
|
47336 | this.next = 0;
|
47337 | // Resetting context._sent for legacy support of Babel's
|
47338 | // function.sent implementation.
|
47339 | this.sent = this._sent = undefined;
|
47340 | this.done = false;
|
47341 | this.delegate = null;
|
47342 |
|
47343 | this.method = "next";
|
47344 | this.arg = undefined;
|
47345 |
|
47346 | this.tryEntries.forEach(resetTryEntry);
|
47347 |
|
47348 | if (!skipTempReset) {
|
47349 | for (var name in this) {
|
47350 | // Not sure about the optimal order of these conditions:
|
47351 | if (name.charAt(0) === "t" &&
|
47352 | hasOwn.call(this, name) &&
|
47353 | !isNaN(+name.slice(1))) {
|
47354 | this[name] = undefined;
|
47355 | }
|
47356 | }
|
47357 | }
|
47358 | },
|
47359 |
|
47360 | stop: function() {
|
47361 | this.done = true;
|
47362 |
|
47363 | var rootEntry = this.tryEntries[0];
|
47364 | var rootRecord = rootEntry.completion;
|
47365 | if (rootRecord.type === "throw") {
|
47366 | throw rootRecord.arg;
|
47367 | }
|
47368 |
|
47369 | return this.rval;
|
47370 | },
|
47371 |
|
47372 | dispatchException: function(exception) {
|
47373 | if (this.done) {
|
47374 | throw exception;
|
47375 | }
|
47376 |
|
47377 | var context = this;
|
47378 | function handle(loc, caught) {
|
47379 | record.type = "throw";
|
47380 | record.arg = exception;
|
47381 | context.next = loc;
|
47382 |
|
47383 | if (caught) {
|
47384 | // If the dispatched exception was caught by a catch block,
|
47385 | // then let that catch block handle the exception normally.
|
47386 | context.method = "next";
|
47387 | context.arg = undefined;
|
47388 | }
|
47389 |
|
47390 | return !! caught;
|
47391 | }
|
47392 |
|
47393 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
47394 | var entry = this.tryEntries[i];
|
47395 | var record = entry.completion;
|
47396 |
|
47397 | if (entry.tryLoc === "root") {
|
47398 | // Exception thrown outside of any try block that could handle
|
47399 | // it, so set the completion value of the entire function to
|
47400 | // throw the exception.
|
47401 | return handle("end");
|
47402 | }
|
47403 |
|
47404 | if (entry.tryLoc <= this.prev) {
|
47405 | var hasCatch = hasOwn.call(entry, "catchLoc");
|
47406 | var hasFinally = hasOwn.call(entry, "finallyLoc");
|
47407 |
|
47408 | if (hasCatch && hasFinally) {
|
47409 | if (this.prev < entry.catchLoc) {
|
47410 | return handle(entry.catchLoc, true);
|
47411 | } else if (this.prev < entry.finallyLoc) {
|
47412 | return handle(entry.finallyLoc);
|
47413 | }
|
47414 |
|
47415 | } else if (hasCatch) {
|
47416 | if (this.prev < entry.catchLoc) {
|
47417 | return handle(entry.catchLoc, true);
|
47418 | }
|
47419 |
|
47420 | } else if (hasFinally) {
|
47421 | if (this.prev < entry.finallyLoc) {
|
47422 | return handle(entry.finallyLoc);
|
47423 | }
|
47424 |
|
47425 | } else {
|
47426 | throw new Error("try statement without catch or finally");
|
47427 | }
|
47428 | }
|
47429 | }
|
47430 | },
|
47431 |
|
47432 | abrupt: function(type, arg) {
|
47433 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
47434 | var entry = this.tryEntries[i];
|
47435 | if (entry.tryLoc <= this.prev &&
|
47436 | hasOwn.call(entry, "finallyLoc") &&
|
47437 | this.prev < entry.finallyLoc) {
|
47438 | var finallyEntry = entry;
|
47439 | break;
|
47440 | }
|
47441 | }
|
47442 |
|
47443 | if (finallyEntry &&
|
47444 | (type === "break" ||
|
47445 | type === "continue") &&
|
47446 | finallyEntry.tryLoc <= arg &&
|
47447 | arg <= finallyEntry.finallyLoc) {
|
47448 | // Ignore the finally entry if control is not jumping to a
|
47449 | // location outside the try/catch block.
|
47450 | finallyEntry = null;
|
47451 | }
|
47452 |
|
47453 | var record = finallyEntry ? finallyEntry.completion : {};
|
47454 | record.type = type;
|
47455 | record.arg = arg;
|
47456 |
|
47457 | if (finallyEntry) {
|
47458 | this.method = "next";
|
47459 | this.next = finallyEntry.finallyLoc;
|
47460 | return ContinueSentinel;
|
47461 | }
|
47462 |
|
47463 | return this.complete(record);
|
47464 | },
|
47465 |
|
47466 | complete: function(record, afterLoc) {
|
47467 | if (record.type === "throw") {
|
47468 | throw record.arg;
|
47469 | }
|
47470 |
|
47471 | if (record.type === "break" ||
|
47472 | record.type === "continue") {
|
47473 | this.next = record.arg;
|
47474 | } else if (record.type === "return") {
|
47475 | this.rval = this.arg = record.arg;
|
47476 | this.method = "return";
|
47477 | this.next = "end";
|
47478 | } else if (record.type === "normal" && afterLoc) {
|
47479 | this.next = afterLoc;
|
47480 | }
|
47481 |
|
47482 | return ContinueSentinel;
|
47483 | },
|
47484 |
|
47485 | finish: function(finallyLoc) {
|
47486 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
47487 | var entry = this.tryEntries[i];
|
47488 | if (entry.finallyLoc === finallyLoc) {
|
47489 | this.complete(entry.completion, entry.afterLoc);
|
47490 | resetTryEntry(entry);
|
47491 | return ContinueSentinel;
|
47492 | }
|
47493 | }
|
47494 | },
|
47495 |
|
47496 | "catch": function(tryLoc) {
|
47497 | for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
47498 | var entry = this.tryEntries[i];
|
47499 | if (entry.tryLoc === tryLoc) {
|
47500 | var record = entry.completion;
|
47501 | if (record.type === "throw") {
|
47502 | var thrown = record.arg;
|
47503 | resetTryEntry(entry);
|
47504 | }
|
47505 | return thrown;
|
47506 | }
|
47507 | }
|
47508 |
|
47509 | // The context.catch method must only be called with a location
|
47510 | // argument that corresponds to a known catch block.
|
47511 | throw new Error("illegal catch attempt");
|
47512 | },
|
47513 |
|
47514 | delegateYield: function(iterable, resultName, nextLoc) {
|
47515 | this.delegate = {
|
47516 | iterator: values(iterable),
|
47517 | resultName: resultName,
|
47518 | nextLoc: nextLoc
|
47519 | };
|
47520 |
|
47521 | if (this.method === "next") {
|
47522 | // Deliberately forget the last sent value so that we don't
|
47523 | // accidentally pass it on to the delegate.
|
47524 | this.arg = undefined;
|
47525 | }
|
47526 |
|
47527 | return ContinueSentinel;
|
47528 | }
|
47529 | };
|
47530 |
|
47531 | // Regardless of whether this script is executing as a CommonJS module
|
47532 | // or not, return the runtime object so that we can declare the variable
|
47533 | // regeneratorRuntime in the outer scope, which allows this module to be
|
47534 | // injected easily by `bin/regenerator --include-runtime script.js`.
|
47535 | return exports;
|
47536 |
|
47537 | }(
|
47538 | // If this script is executing as a CommonJS module, use module.exports
|
47539 | // as the regeneratorRuntime namespace. Otherwise create a new empty
|
47540 | // object. Either way, the resulting object will be used to initialize
|
47541 | // the regeneratorRuntime variable at the top of this file.
|
47542 | true ? module.exports : 0
|
47543 | ));
|
47544 |
|
47545 | try {
|
47546 | regeneratorRuntime = runtime;
|
47547 | } catch (accidentalStrictMode) {
|
47548 | // This module should not be running in strict mode, so the above
|
47549 | // assignment should always work unless something is misconfigured. Just
|
47550 | // in case runtime.js accidentally runs in strict mode, in modern engines
|
47551 | // we can explicitly access globalThis. In older engines we can escape
|
47552 | // strict mode using a global Function call. This could conceivably fail
|
47553 | // if a Content Security Policy forbids using Function, but in that case
|
47554 | // the proper solution is to fix the accidental strict mode problem. If
|
47555 | // you've misconfigured your bundler to force strict mode and applied a
|
47556 | // CSP to forbid Function, and you're not willing to fix either of those
|
47557 | // problems, please detail your unique predicament in a GitHub issue.
|
47558 | if (typeof globalThis === "object") {
|
47559 | globalThis.regeneratorRuntime = runtime;
|
47560 | } else {
|
47561 | Function("r", "regeneratorRuntime = r")(runtime);
|
47562 | }
|
47563 | }
|
47564 |
|
47565 |
|
47566 | /***/ })
|
47567 | /******/ ]);
|
47568 | /************************************************************************/
|
47569 | /******/ // The module cache
|
47570 | /******/ var __webpack_module_cache__ = {};
|
47571 | /******/
|
47572 | /******/ // The require function
|
47573 | /******/ function __webpack_require__(moduleId) {
|
47574 | /******/ // Check if module is in cache
|
47575 | /******/ var cachedModule = __webpack_module_cache__[moduleId];
|
47576 | /******/ if (cachedModule !== undefined) {
|
47577 | /******/ return cachedModule.exports;
|
47578 | /******/ }
|
47579 | /******/ // Create a new module (and put it into the cache)
|
47580 | /******/ var module = __webpack_module_cache__[moduleId] = {
|
47581 | /******/ // no module.id needed
|
47582 | /******/ // no module.loaded needed
|
47583 | /******/ exports: {}
|
47584 | /******/ };
|
47585 | /******/
|
47586 | /******/ // Execute the module function
|
47587 | /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
47588 | /******/
|
47589 | /******/ // Return the exports of the module
|
47590 | /******/ return module.exports;
|
47591 | /******/ }
|
47592 | /******/
|
47593 | /************************************************************************/
|
47594 | /******/ /* webpack/runtime/define property getters */
|
47595 | /******/ !function() {
|
47596 | /******/ // define getter functions for harmony exports
|
47597 | /******/ __webpack_require__.d = function(exports, definition) {
|
47598 | /******/ for(var key in definition) {
|
47599 | /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
47600 | /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
47601 | /******/ }
|
47602 | /******/ }
|
47603 | /******/ };
|
47604 | /******/ }();
|
47605 | /******/
|
47606 | /******/ /* webpack/runtime/hasOwnProperty shorthand */
|
47607 | /******/ !function() {
|
47608 | /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
47609 | /******/ }();
|
47610 | /******/
|
47611 | /******/ /* webpack/runtime/make namespace object */
|
47612 | /******/ !function() {
|
47613 | /******/ // define __esModule on exports
|
47614 | /******/ __webpack_require__.r = function(exports) {
|
47615 | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
47616 | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
47617 | /******/ }
|
47618 | /******/ Object.defineProperty(exports, '__esModule', { value: true });
|
47619 | /******/ };
|
47620 | /******/ }();
|
47621 | /******/
|
47622 | /************************************************************************/
|
47623 | /******/
|
47624 | /******/ // startup
|
47625 | /******/ // Load entry module and return exports
|
47626 | /******/ // This entry module used 'module' so it can't be inlined
|
47627 | /******/ __webpack_require__(0);
|
47628 | /******/ var __webpack_exports__ = __webpack_require__(426);
|
47629 | /******/
|
47630 | /******/ return __webpack_exports__;
|
47631 | /******/ })()
|
47632 | ;
|
47633 | }); |
\ | No newline at end of file |