|
272 | 272 | size: d3_map_size, |
273 | 273 | empty: d3_map_empty, |
274 | 274 | forEach: function(f) { |
275 | | - for (var key in this) if (key.charCodeAt(0) === d3_map_prefixCode) f.call(this, key.substring(1), this[key]); |
| 275 | + for (var key in this) if (key.charCodeAt(0) === d3_map_prefixCode) f.call(this, key.slice(1), this[key]); |
276 | 276 | } |
277 | 277 | }); |
278 | 278 | var d3_map_prefix = "\x00", d3_map_prefixCode = d3_map_prefix.charCodeAt(0); |
|
382 | 382 | size: d3_map_size, |
383 | 383 | empty: d3_map_empty, |
384 | 384 | forEach: function(f) { |
385 | | - for (var value in this) if (value.charCodeAt(0) === d3_map_prefixCode) f.call(this, value.substring(1)); |
| 385 | + for (var value in this) if (value.charCodeAt(0) === d3_map_prefixCode) f.call(this, value.slice(1)); |
386 | 386 | } |
387 | 387 | }); |
388 | 388 | d3.behavior = {}; |
|
399 | 399 | } |
400 | 400 | function d3_vendorSymbol(object, name) { |
401 | 401 | if (name in object) return name; |
402 | | - name = name.charAt(0).toUpperCase() + name.substring(1); |
| 402 | + name = name.charAt(0).toUpperCase() + name.slice(1); |
403 | 403 | for (var i = 0, n = d3_vendorPrefixes.length; i < n; ++i) { |
404 | 404 | var prefixName = d3_vendorPrefixes[i] + name; |
405 | 405 | if (prefixName in object) return prefixName; |
|
416 | 416 | d3_dispatch.prototype.on = function(type, listener) { |
417 | 417 | var i = type.indexOf("."), name = ""; |
418 | 418 | if (i >= 0) { |
419 | | - name = type.substring(i + 1); |
420 | | - type = type.substring(0, i); |
| 419 | + name = type.slice(i + 1); |
| 420 | + type = type.slice(0, i); |
421 | 421 | } |
422 | 422 | if (type) return arguments.length < 2 ? this[type].on(name) : this[type].on(name, listener); |
423 | 423 | if (arguments.length === 2) { |
|
558 | 558 | qualify: function(name) { |
559 | 559 | var i = name.indexOf(":"), prefix = name; |
560 | 560 | if (i >= 0) { |
561 | | - prefix = name.substring(0, i); |
562 | | - name = name.substring(i + 1); |
| 561 | + prefix = name.slice(0, i); |
| 562 | + name = name.slice(i + 1); |
563 | 563 | } |
564 | 564 | return d3_nsPrefix.hasOwnProperty(prefix) ? { |
565 | 565 | space: d3_nsPrefix[prefix], |
|
1008 | 1008 | }; |
1009 | 1009 | function d3_selection_on(type, listener, capture) { |
1010 | 1010 | var name = "__on" + type, i = type.indexOf("."), wrap = d3_selection_onListener; |
1011 | | - if (i > 0) type = type.substring(0, i); |
| 1011 | + if (i > 0) type = type.slice(0, i); |
1012 | 1012 | var filter = d3_selection_onFilters.get(type); |
1013 | 1013 | if (filter) type = filter, wrap = d3_selection_onFilter; |
1014 | 1014 | function onRemove() { |
|
1623 | 1623 | } |
1624 | 1624 | } |
1625 | 1625 | if (color = d3_rgb_names.get(format)) return rgb(color.r, color.g, color.b); |
1626 | | - if (format != null && format.charAt(0) === "#" && !isNaN(color = parseInt(format.substring(1), 16))) { |
| 1626 | + if (format != null && format.charAt(0) === "#" && !isNaN(color = parseInt(format.slice(1), 16))) { |
1627 | 1627 | if (format.length === 4) { |
1628 | 1628 | r = (color & 3840) >> 4; |
1629 | 1629 | r = r >> 4 | r; |
|
1970 | 1970 | } else if (c === 10) { |
1971 | 1971 | eol = true; |
1972 | 1972 | } |
1973 | | - return text.substring(j + 1, i).replace(/""/g, '"'); |
| 1973 | + return text.slice(j + 1, i).replace(/""/g, '"'); |
1974 | 1974 | } |
1975 | 1975 | while (I < N) { |
1976 | 1976 | var c = text.charCodeAt(I++), k = 1; |
1977 | 1977 | if (c === 10) eol = true; else if (c === 13) { |
1978 | 1978 | eol = true; |
1979 | 1979 | if (text.charCodeAt(I) === 10) ++I, ++k; |
1980 | 1980 | } else if (c !== delimiterCode) continue; |
1981 | | - return text.substring(j, I - k); |
| 1981 | + return text.slice(j, I - k); |
1982 | 1982 | } |
1983 | | - return text.substring(j); |
| 1983 | + return text.slice(j); |
1984 | 1984 | } |
1985 | 1985 | while ((t = token()) !== EOF) { |
1986 | 1986 | var a = []; |
|
2121 | 2121 | function d3_locale_numberFormat(locale) { |
2122 | 2122 | var locale_decimal = locale.decimal, locale_thousands = locale.thousands, locale_grouping = locale.grouping, locale_currency = locale.currency, formatGroup = locale_grouping ? function(value) { |
2123 | 2123 | var i = value.length, t = [], j = 0, g = locale_grouping[0]; |
2124 | | - while (i > 0 && g > 0) { |
| 2124 | + while (g > 0 && i > 0) { |
2125 | 2125 | t.push(value.substring(i -= g, i + g)); |
2126 | 2126 | g = locale_grouping[j = (j + 1) % locale_grouping.length]; |
2127 | 2127 | } |
|
2415 | 2415 | var string = [], i = -1, j = 0, c, p, f; |
2416 | 2416 | while (++i < n) { |
2417 | 2417 | if (template.charCodeAt(i) === 37) { |
2418 | | - string.push(template.substring(j, i)); |
| 2418 | + string.push(template.slice(j, i)); |
2419 | 2419 | if ((p = d3_time_formatPads[c = template.charAt(++i)]) != null) c = template.charAt(++i); |
2420 | 2420 | if (f = d3_time_formats[c]) c = f(date, p == null ? c === "e" ? " " : "0" : p); |
2421 | 2421 | string.push(c); |
2422 | 2422 | j = i + 1; |
2423 | 2423 | } |
2424 | 2424 | } |
2425 | | - string.push(template.substring(j, i)); |
| 2425 | + string.push(template.slice(j, i)); |
2426 | 2426 | return string.join(""); |
2427 | 2427 | } |
2428 | 2428 | format.parse = function(string) { |
|
2589 | 2589 | }; |
2590 | 2590 | function d3_time_parseWeekdayAbbrev(date, string, i) { |
2591 | 2591 | d3_time_dayAbbrevRe.lastIndex = 0; |
2592 | | - var n = d3_time_dayAbbrevRe.exec(string.substring(i)); |
| 2592 | + var n = d3_time_dayAbbrevRe.exec(string.slice(i)); |
2593 | 2593 | return n ? (date.w = d3_time_dayAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; |
2594 | 2594 | } |
2595 | 2595 | function d3_time_parseWeekday(date, string, i) { |
2596 | 2596 | d3_time_dayRe.lastIndex = 0; |
2597 | | - var n = d3_time_dayRe.exec(string.substring(i)); |
| 2597 | + var n = d3_time_dayRe.exec(string.slice(i)); |
2598 | 2598 | return n ? (date.w = d3_time_dayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; |
2599 | 2599 | } |
2600 | 2600 | function d3_time_parseMonthAbbrev(date, string, i) { |
2601 | 2601 | d3_time_monthAbbrevRe.lastIndex = 0; |
2602 | | - var n = d3_time_monthAbbrevRe.exec(string.substring(i)); |
| 2602 | + var n = d3_time_monthAbbrevRe.exec(string.slice(i)); |
2603 | 2603 | return n ? (date.m = d3_time_monthAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; |
2604 | 2604 | } |
2605 | 2605 | function d3_time_parseMonth(date, string, i) { |
2606 | 2606 | d3_time_monthRe.lastIndex = 0; |
2607 | | - var n = d3_time_monthRe.exec(string.substring(i)); |
| 2607 | + var n = d3_time_monthRe.exec(string.slice(i)); |
2608 | 2608 | return n ? (date.m = d3_time_monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1; |
2609 | 2609 | } |
2610 | 2610 | function d3_time_parseLocaleFull(date, string, i) { |
|
2617 | 2617 | return d3_time_parse(date, d3_time_formats.X.toString(), string, i); |
2618 | 2618 | } |
2619 | 2619 | function d3_time_parseAmPm(date, string, i) { |
2620 | | - var n = d3_time_periodLookup.get(string.substring(i, i += 2).toLowerCase()); |
| 2620 | + var n = d3_time_periodLookup.get(string.slice(i, i += 2).toLowerCase()); |
2621 | 2621 | return n == null ? -1 : (date.p = n, i); |
2622 | 2622 | } |
2623 | 2623 | return d3_time_format; |
|
2641 | 2641 | } |
2642 | 2642 | function d3_time_parseWeekdayNumber(date, string, i) { |
2643 | 2643 | d3_time_numberRe.lastIndex = 0; |
2644 | | - var n = d3_time_numberRe.exec(string.substring(i, i + 1)); |
| 2644 | + var n = d3_time_numberRe.exec(string.slice(i, i + 1)); |
2645 | 2645 | return n ? (date.w = +n[0], i + n[0].length) : -1; |
2646 | 2646 | } |
2647 | 2647 | function d3_time_parseWeekNumberSunday(date, string, i) { |
2648 | 2648 | d3_time_numberRe.lastIndex = 0; |
2649 | | - var n = d3_time_numberRe.exec(string.substring(i)); |
| 2649 | + var n = d3_time_numberRe.exec(string.slice(i)); |
2650 | 2650 | return n ? (date.U = +n[0], i + n[0].length) : -1; |
2651 | 2651 | } |
2652 | 2652 | function d3_time_parseWeekNumberMonday(date, string, i) { |
2653 | 2653 | d3_time_numberRe.lastIndex = 0; |
2654 | | - var n = d3_time_numberRe.exec(string.substring(i)); |
| 2654 | + var n = d3_time_numberRe.exec(string.slice(i)); |
2655 | 2655 | return n ? (date.W = +n[0], i + n[0].length) : -1; |
2656 | 2656 | } |
2657 | 2657 | function d3_time_parseFullYear(date, string, i) { |
2658 | 2658 | d3_time_numberRe.lastIndex = 0; |
2659 | | - var n = d3_time_numberRe.exec(string.substring(i, i + 4)); |
| 2659 | + var n = d3_time_numberRe.exec(string.slice(i, i + 4)); |
2660 | 2660 | return n ? (date.y = +n[0], i + n[0].length) : -1; |
2661 | 2661 | } |
2662 | 2662 | function d3_time_parseYear(date, string, i) { |
2663 | 2663 | d3_time_numberRe.lastIndex = 0; |
2664 | | - var n = d3_time_numberRe.exec(string.substring(i, i + 2)); |
| 2664 | + var n = d3_time_numberRe.exec(string.slice(i, i + 2)); |
2665 | 2665 | return n ? (date.y = d3_time_expandYear(+n[0]), i + n[0].length) : -1; |
2666 | 2666 | } |
2667 | 2667 | function d3_time_parseZone(date, string, i) { |
2668 | | - return /^[+-]\d{4}$/.test(string = string.substring(i, i + 5)) ? (date.Z = -string, |
| 2668 | + return /^[+-]\d{4}$/.test(string = string.slice(i, i + 5)) ? (date.Z = -string, |
2669 | 2669 | i + 5) : -1; |
2670 | 2670 | } |
2671 | 2671 | function d3_time_expandYear(d) { |
2672 | 2672 | return d + (d > 68 ? 1900 : 2e3); |
2673 | 2673 | } |
2674 | 2674 | function d3_time_parseMonthNumber(date, string, i) { |
2675 | 2675 | d3_time_numberRe.lastIndex = 0; |
2676 | | - var n = d3_time_numberRe.exec(string.substring(i, i + 2)); |
| 2676 | + var n = d3_time_numberRe.exec(string.slice(i, i + 2)); |
2677 | 2677 | return n ? (date.m = n[0] - 1, i + n[0].length) : -1; |
2678 | 2678 | } |
2679 | 2679 | function d3_time_parseDay(date, string, i) { |
2680 | 2680 | d3_time_numberRe.lastIndex = 0; |
2681 | | - var n = d3_time_numberRe.exec(string.substring(i, i + 2)); |
| 2681 | + var n = d3_time_numberRe.exec(string.slice(i, i + 2)); |
2682 | 2682 | return n ? (date.d = +n[0], i + n[0].length) : -1; |
2683 | 2683 | } |
2684 | 2684 | function d3_time_parseDayOfYear(date, string, i) { |
2685 | 2685 | d3_time_numberRe.lastIndex = 0; |
2686 | | - var n = d3_time_numberRe.exec(string.substring(i, i + 3)); |
| 2686 | + var n = d3_time_numberRe.exec(string.slice(i, i + 3)); |
2687 | 2687 | return n ? (date.j = +n[0], i + n[0].length) : -1; |
2688 | 2688 | } |
2689 | 2689 | function d3_time_parseHour24(date, string, i) { |
2690 | 2690 | d3_time_numberRe.lastIndex = 0; |
2691 | | - var n = d3_time_numberRe.exec(string.substring(i, i + 2)); |
| 2691 | + var n = d3_time_numberRe.exec(string.slice(i, i + 2)); |
2692 | 2692 | return n ? (date.H = +n[0], i + n[0].length) : -1; |
2693 | 2693 | } |
2694 | 2694 | function d3_time_parseMinutes(date, string, i) { |
2695 | 2695 | d3_time_numberRe.lastIndex = 0; |
2696 | | - var n = d3_time_numberRe.exec(string.substring(i, i + 2)); |
| 2696 | + var n = d3_time_numberRe.exec(string.slice(i, i + 2)); |
2697 | 2697 | return n ? (date.M = +n[0], i + n[0].length) : -1; |
2698 | 2698 | } |
2699 | 2699 | function d3_time_parseSeconds(date, string, i) { |
2700 | 2700 | d3_time_numberRe.lastIndex = 0; |
2701 | | - var n = d3_time_numberRe.exec(string.substring(i, i + 2)); |
| 2701 | + var n = d3_time_numberRe.exec(string.slice(i, i + 2)); |
2702 | 2702 | return n ? (date.S = +n[0], i + n[0].length) : -1; |
2703 | 2703 | } |
2704 | 2704 | function d3_time_parseMilliseconds(date, string, i) { |
2705 | 2705 | d3_time_numberRe.lastIndex = 0; |
2706 | | - var n = d3_time_numberRe.exec(string.substring(i, i + 3)); |
| 2706 | + var n = d3_time_numberRe.exec(string.slice(i, i + 3)); |
2707 | 2707 | return n ? (date.L = +n[0], i + n[0].length) : -1; |
2708 | 2708 | } |
2709 | 2709 | function d3_time_zone(d) { |
|
2712 | 2712 | } |
2713 | 2713 | function d3_time_parseLiteralPercent(date, string, i) { |
2714 | 2714 | d3_time_percentRe.lastIndex = 0; |
2715 | | - var n = d3_time_percentRe.exec(string.substring(i, i + 1)); |
| 2715 | + var n = d3_time_percentRe.exec(string.slice(i, i + 1)); |
2716 | 2716 | return n ? i + n[0].length : -1; |
2717 | 2717 | } |
2718 | 2718 | function d3_time_formatMulti(formats) { |
|
5615 | 5615 | a = a + "", b = b + ""; |
5616 | 5616 | while ((am = d3_interpolate_numberA.exec(a)) && (bm = d3_interpolate_numberB.exec(b))) { |
5617 | 5617 | if ((bs = bm.index) > bi) { |
5618 | | - bs = b.substring(bi, bs); |
| 5618 | + bs = b.slice(bi, bs); |
5619 | 5619 | if (s[i]) s[i] += bs; else s[++i] = bs; |
5620 | 5620 | } |
5621 | 5621 | if ((am = am[0]) === (bm = bm[0])) { |
|
5630 | 5630 | bi = d3_interpolate_numberB.lastIndex; |
5631 | 5631 | } |
5632 | 5632 | if (bi < b.length) { |
5633 | | - bs = b.substring(bi); |
| 5633 | + bs = b.slice(bi); |
5634 | 5634 | if (s[i]) s[i] += bs; else s[++i] = bs; |
5635 | 5635 | } |
5636 | 5636 | return s.length < 2 ? q[0] ? (b = q[0].x, function(t) { |
|
5700 | 5700 | } |
5701 | 5701 | }); |
5702 | 5702 | d3.ease = function(name) { |
5703 | | - var i = name.indexOf("-"), t = i >= 0 ? name.substring(0, i) : name, m = i >= 0 ? name.substring(i + 1) : "in"; |
| 5703 | + var i = name.indexOf("-"), t = i >= 0 ? name.slice(0, i) : name, m = i >= 0 ? name.slice(i + 1) : "in"; |
5704 | 5704 | t = d3_ease.get(t) || d3_ease_default; |
5705 | 5705 | m = d3_ease_mode.get(m) || d3_identity; |
5706 | 5706 | return d3_ease_clamp(m(t.apply(null, d3_arraySlice.call(arguments, 1)))); |
|
0 commit comments