Skip to content

Commit 2cf0440

Browse files
committed
Build d3.mjs with newer rollup
1 parent f175ca6 commit 2cf0440

2 files changed

Lines changed: 18 additions & 19 deletions

File tree

libs/d3.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

modules/d3.mjs

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -610,19 +610,19 @@ function compareValue(compare) {
610610
};
611611
}
612612

613-
function chord() {
614-
return chord$1(false, false);
613+
function chord_default() {
614+
return chord(false, false);
615615
}
616616

617617
function chordTranspose() {
618-
return chord$1(false, true);
618+
return chord(false, true);
619619
}
620620

621621
function chordDirected() {
622-
return chord$1(true, false);
622+
return chord(true, false);
623623
}
624624

625-
function chord$1(directed, transpose) {
625+
function chord(directed, transpose) {
626626
var padAngle = 0,
627627
sortGroups = null,
628628
sortSubgroups = null,
@@ -1001,7 +1001,7 @@ function ribbon(headRadius) {
10011001
return ribbon;
10021002
}
10031003

1004-
function ribbon$1() {
1004+
function ribbon_default() {
10051005
return ribbon();
10061006
}
10071007

@@ -3283,8 +3283,8 @@ function formatDecimal(x) {
32833283
// significant digits p, where x is positive and p is in [1, 21] or undefined.
32843284
// For example, formatDecimalParts(1.23) returns ["123", 0].
32853285
function formatDecimalParts(x, p) {
3286-
if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null; // NaN, ±Infinity
3287-
var i, coefficient = x.slice(0, i);
3286+
if (!isFinite(x) || x === 0) return null; // NaN, ±Infinity, ±0
3287+
var i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e"), coefficient = x.slice(0, i);
32883288

32893289
// The string returned by toExponential either has the form \d\.\d+e[-+]\d+
32903290
// (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3).
@@ -3389,7 +3389,7 @@ var prefixExponent;
33893389

33903390
function formatPrefixAuto(x, p) {
33913391
var d = formatDecimalParts(x, p);
3392-
if (!d) return x + "";
3392+
if (!d) return prefixExponent = undefined, x.toPrecision(p);
33933393
var coefficient = d[0],
33943394
exponent = d[1],
33953395
i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,
@@ -3443,7 +3443,7 @@ function formatLocale$1(locale) {
34433443
minus = locale.minus === undefined ? "−" : locale.minus + "",
34443444
nan = locale.nan === undefined ? "NaN" : locale.nan + "";
34453445

3446-
function newFormat(specifier) {
3446+
function newFormat(specifier, options) {
34473447
specifier = formatSpecifier(specifier);
34483448

34493449
var fill = specifier.fill,
@@ -3468,8 +3468,8 @@ function formatLocale$1(locale) {
34683468

34693469
// Compute the prefix and suffix.
34703470
// For SI-prefix, the suffix is lazily computed.
3471-
var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "",
3472-
suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : "";
3471+
var prefix = (options && options.prefix !== undefined ? options.prefix : "") + (symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : ""),
3472+
suffix = (symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : "") + (options && options.suffix !== undefined ? options.suffix : "");
34733473

34743474
// What format function should we use?
34753475
// Is this an integer type?
@@ -3510,7 +3510,7 @@ function formatLocale$1(locale) {
35103510

35113511
// Compute the prefix and suffix.
35123512
valuePrefix = (valueNegative ? (sign === "(" ? sign : minus) : sign === "-" || sign === "(" ? "" : sign) + valuePrefix;
3513-
valueSuffix = (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : "");
3513+
valueSuffix = (type === "s" && !isNaN(value) && prefixExponent !== undefined ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : "");
35143514

35153515
// Break the formatted value into the integer “value” part that can be
35163516
// grouped, and fractional or exponential “suffix” part that is not.
@@ -3555,12 +3555,11 @@ function formatLocale$1(locale) {
35553555
}
35563556

35573557
function formatPrefix(specifier, value) {
3558-
var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)),
3559-
e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,
3558+
var e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,
35603559
k = Math.pow(10, -e),
3561-
prefix = prefixes[8 + e / 3];
3560+
f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier), {suffix: prefixes[8 + e / 3]});
35623561
return function(value) {
3563-
return f(k * value) + prefix;
3562+
return f(k * value);
35643563
};
35653564
}
35663565

@@ -6877,4 +6876,4 @@ function active(node, name) {
68776876
return null;
68786877
}
68796878

6880-
export { active, arc, chord, chordDirected, chordTranspose, color, create$1 as create, creator, cubehelix, drag, nodrag as dragDisable, yesdrag as dragEnable, gray, hcl, hsl, interrupt, formatIso as isoFormat, parseIso as isoParse, lab, lch, local, matcher, namespace, namespaces, pointer, pointers, rgb, ribbon$1 as ribbon, ribbonArrow, band as scaleBand, diverging as scaleDiverging, divergingLog as scaleDivergingLog, divergingPow as scaleDivergingPow, divergingSqrt as scaleDivergingSqrt, divergingSymlog as scaleDivergingSymlog, identity as scaleIdentity, implicit as scaleImplicit, linear as scaleLinear, log as scaleLog, ordinal as scaleOrdinal, point as scalePoint, pow as scalePow, quantile as scaleQuantile, quantize as scaleQuantize, radial as scaleRadial, sequential as scaleSequential, sequentialLog as scaleSequentialLog, sequentialPow as scaleSequentialPow, sequentialQuantile as scaleSequentialQuantile, sequentialSqrt as scaleSequentialSqrt, sequentialSymlog as scaleSequentialSymlog, sqrt$1 as scaleSqrt, symlog as scaleSymlog, threshold as scaleThreshold, time as scaleTime, utcTime as scaleUtc, select, selectAll, selection, selector, selectorAll, styleValue as style, tickFormat, timeFormat, defaultLocale as timeFormatDefaultLocale, formatLocale as timeFormatLocale, timeParse, transition, utcFormat, utcParse, version, defaultView as window };
6879+
export { active, arc, chord_default as chord, chordDirected, chordTranspose, color, create$1 as create, creator, cubehelix, drag, nodrag as dragDisable, yesdrag as dragEnable, gray, hcl, hsl, interrupt, formatIso as isoFormat, parseIso as isoParse, lab, lch, local, matcher, namespace, namespaces, pointer, pointers, rgb, ribbon_default as ribbon, ribbonArrow, band as scaleBand, diverging as scaleDiverging, divergingLog as scaleDivergingLog, divergingPow as scaleDivergingPow, divergingSqrt as scaleDivergingSqrt, divergingSymlog as scaleDivergingSymlog, identity as scaleIdentity, implicit as scaleImplicit, linear as scaleLinear, log as scaleLog, ordinal as scaleOrdinal, point as scalePoint, pow as scalePow, quantile as scaleQuantile, quantize as scaleQuantize, radial as scaleRadial, sequential as scaleSequential, sequentialLog as scaleSequentialLog, sequentialPow as scaleSequentialPow, sequentialQuantile as scaleSequentialQuantile, sequentialSqrt as scaleSequentialSqrt, sequentialSymlog as scaleSequentialSymlog, sqrt$1 as scaleSqrt, symlog as scaleSymlog, threshold as scaleThreshold, time as scaleTime, utcTime as scaleUtc, select, selectAll, selection, selector, selectorAll, styleValue as style, tickFormat, timeFormat, defaultLocale as timeFormatDefaultLocale, formatLocale as timeFormatLocale, timeParse, transition, utcFormat, utcParse, version, defaultView as window };

0 commit comments

Comments
 (0)