vega-scale
Advanced tools
Comparing version 7.1.1 to 7.2.0
import { toNumber, peek, hasOwnProperty, toSet, array, constant, isNumber, span, isObject, isString, error, isArray } from 'vega-util'; | ||
import { bisectRight, range, bisect } from 'd3-array'; | ||
import { scaleOrdinal, tickFormat as tickFormat$1, scaleIdentity, scaleLinear, scaleLog, scalePow, scaleSqrt, scaleSymlog, scaleTime, scaleUtc, scaleSequential, scaleSequentialLog, scaleSequentialPow, scaleSequentialSqrt, scaleSequentialSymlog, scaleDiverging, scaleDivergingLog, scaleDivergingPow, scaleDivergingSqrt, scaleDivergingSymlog, scaleQuantile, scaleQuantize, scaleThreshold } from 'd3-scale'; | ||
import * as $ from 'd3-scale'; | ||
import { scaleOrdinal, tickFormat as tickFormat$1 } from 'd3-scale'; | ||
export { scaleImplicit } from 'd3-scale'; | ||
import * as $ from 'd3-interpolate'; | ||
import { piecewise } from 'd3-interpolate'; | ||
import * as $$1 from 'd3-interpolate'; | ||
import { timeInterval, utcInterval } from 'vega-time'; | ||
@@ -339,32 +339,32 @@ | ||
scale(Identity, scaleIdentity); // continuous scales | ||
scale(Identity, $.scaleIdentity); // continuous scales | ||
scale(Linear, scaleLinear, Continuous); | ||
scale(Log, scaleLog, [Continuous, Log]); | ||
scale(Pow, scalePow, Continuous); | ||
scale(Sqrt, scaleSqrt, Continuous); | ||
scale(Symlog, scaleSymlog, Continuous); | ||
scale(Time, scaleTime, [Continuous, Temporal]); | ||
scale(UTC, scaleUtc, [Continuous, Temporal]); // sequential scales | ||
scale(Linear, $.scaleLinear, Continuous); | ||
scale(Log, $.scaleLog, [Continuous, Log]); | ||
scale(Pow, $.scalePow, Continuous); | ||
scale(Sqrt, $.scaleSqrt, Continuous); | ||
scale(Symlog, $.scaleSymlog, Continuous); | ||
scale(Time, $.scaleTime, [Continuous, Temporal]); | ||
scale(UTC, $.scaleUtc, [Continuous, Temporal]); // sequential scales | ||
scale(Sequential, scaleSequential, [Continuous, Interpolating]); // backwards compat | ||
scale(Sequential, $.scaleSequential, [Continuous, Interpolating]); // backwards compat | ||
scale("".concat(Sequential, "-").concat(Linear), scaleSequential, [Continuous, Interpolating]); | ||
scale("".concat(Sequential, "-").concat(Log), scaleSequentialLog, [Continuous, Interpolating, Log]); | ||
scale("".concat(Sequential, "-").concat(Pow), scaleSequentialPow, [Continuous, Interpolating]); | ||
scale("".concat(Sequential, "-").concat(Sqrt), scaleSequentialSqrt, [Continuous, Interpolating]); | ||
scale("".concat(Sequential, "-").concat(Symlog), scaleSequentialSymlog, [Continuous, Interpolating]); // diverging scales | ||
scale("".concat(Sequential, "-").concat(Linear), $.scaleSequential, [Continuous, Interpolating]); | ||
scale("".concat(Sequential, "-").concat(Log), $.scaleSequentialLog, [Continuous, Interpolating, Log]); | ||
scale("".concat(Sequential, "-").concat(Pow), $.scaleSequentialPow, [Continuous, Interpolating]); | ||
scale("".concat(Sequential, "-").concat(Sqrt), $.scaleSequentialSqrt, [Continuous, Interpolating]); | ||
scale("".concat(Sequential, "-").concat(Symlog), $.scaleSequentialSymlog, [Continuous, Interpolating]); // diverging scales | ||
scale("".concat(Diverging, "-").concat(Linear), scaleDiverging, [Continuous, Interpolating]); | ||
scale("".concat(Diverging, "-").concat(Log), scaleDivergingLog, [Continuous, Interpolating, Log]); | ||
scale("".concat(Diverging, "-").concat(Pow), scaleDivergingPow, [Continuous, Interpolating]); | ||
scale("".concat(Diverging, "-").concat(Sqrt), scaleDivergingSqrt, [Continuous, Interpolating]); | ||
scale("".concat(Diverging, "-").concat(Symlog), scaleDivergingSymlog, [Continuous, Interpolating]); // discretizing scales | ||
scale("".concat(Diverging, "-").concat(Linear), $.scaleDiverging, [Continuous, Interpolating]); | ||
scale("".concat(Diverging, "-").concat(Log), $.scaleDivergingLog, [Continuous, Interpolating, Log]); | ||
scale("".concat(Diverging, "-").concat(Pow), $.scaleDivergingPow, [Continuous, Interpolating]); | ||
scale("".concat(Diverging, "-").concat(Sqrt), $.scaleDivergingSqrt, [Continuous, Interpolating]); | ||
scale("".concat(Diverging, "-").concat(Symlog), $.scaleDivergingSymlog, [Continuous, Interpolating]); // discretizing scales | ||
scale(Quantile, scaleQuantile, [Discretizing, Quantile]); | ||
scale(Quantize, scaleQuantize, Discretizing); | ||
scale(Threshold, scaleThreshold, Discretizing); // discrete scales | ||
scale(Quantile, $.scaleQuantile, [Discretizing, Quantile]); | ||
scale(Quantize, $.scaleQuantize, Discretizing); | ||
scale(Threshold, $.scaleThreshold, Discretizing); // discrete scales | ||
scale(BinOrdinal, scaleBinOrdinal, [Discrete, Discretizing]); | ||
scale(Ordinal, scaleOrdinal, Discrete); | ||
scale(Ordinal, $.scaleOrdinal, Discrete); | ||
scale(Band, band, Discrete); | ||
@@ -412,3 +412,3 @@ scale(Point, point, Discrete); | ||
function interpolateColors(colors, type, gamma) { | ||
return piecewise(interpolate(type || 'rgb', gamma), colors); | ||
return $$1.piecewise(interpolate(type || 'rgb', gamma), colors); | ||
} | ||
@@ -444,3 +444,3 @@ function quantizeInterpolator(interpolator, count) { | ||
function interpolate(type, gamma) { | ||
const interp = $[method(type)]; | ||
const interp = $$1[method(type)]; | ||
return gamma != null && interp && interp.gamma ? interp.gamma(gamma) : interp; | ||
@@ -810,13 +810,13 @@ } | ||
else if (isDiscrete(scale.type)) { | ||
const d = scale.domain(), | ||
n = d.length, | ||
v = n > max ? d.slice(0, max - 2).map(fmt).join(', ') + ', ending with ' + d.slice(-1).map(fmt) : d.map(fmt).join(', '); | ||
return "".concat(n, " value").concat(n === 1 ? '' : 's', ": ").concat(v); | ||
} // if scale domain is continuous, describe value range | ||
else { | ||
const d = scale.domain(); | ||
return "values from ".concat(fmt(d[0]), " to ").concat(fmt(peek(d))); | ||
} | ||
const d = scale.domain(), | ||
n = d.length, | ||
v = n > max ? d.slice(0, max - 2).map(fmt).join(', ') + ', ending with ' + d.slice(-1).map(fmt) : d.map(fmt).join(', '); | ||
return "".concat(n, " value").concat(n === 1 ? '' : 's', ": ").concat(v); | ||
} // if scale domain is continuous, describe value range | ||
else { | ||
const d = scale.domain(); | ||
return "values from ".concat(fmt(d[0]), " to ").concat(fmt(peek(d))); | ||
} | ||
} | ||
export { Band, BinOrdinal, DiscreteLegend, Diverging, GradientLegend, Identity, Linear, Log, Ordinal, Point, Pow, Quantile, Quantize, Sequential, Sqrt, SymbolLegend, Symlog, Threshold, Time, UTC, bandSpace, domainCaption, interpolate, interpolateColors, interpolateRange, isContinuous, isDiscrete, isDiscretizing, isInterpolating, isLogarithmic, isQuantile, isTemporal, isValidScaleType, labelFormat, labelFraction, labelValues, quantizeInterpolator, scale, scaleCopy, scaleFraction, scheme, tickCount, tickFormat, tickValues, validTicks }; |
{ | ||
"name": "vega-scale", | ||
"version": "7.1.1", | ||
"version": "7.2.0", | ||
"description": "Scales and color schemes for visual encoding.", | ||
@@ -25,9 +25,9 @@ "keywords": [ | ||
"dependencies": { | ||
"d3-array": "^2.7.1", | ||
"d3-interpolate": "^2.0.1", | ||
"d3-scale": "^3.2.2", | ||
"vega-time": "^2.0.4", | ||
"vega-util": "^1.15.2" | ||
"d3-array": "^3.1.1", | ||
"d3-interpolate": "^3.0.1", | ||
"d3-scale": "^4.0.2", | ||
"vega-time": "^2.1.0", | ||
"vega-util": "^1.17.0" | ||
}, | ||
"gitHead": "4affcbedb9d14815dbb6d3b250ed231b54fc95c0" | ||
"gitHead": "9a3faca4395cade9ecdfde90af98f1c53e9916b2" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
528940
5602
2
+ Addedd3-color@3.1.0(transitive)
+ Addedd3-format@3.1.0(transitive)
+ Addedd3-interpolate@3.0.1(transitive)
+ Addedd3-scale@4.0.2(transitive)
+ Addedd3-time-format@4.1.0(transitive)
+ Addedinternmap@2.0.3(transitive)
- Removedd3-array@2.12.1(transitive)
- Removedd3-color@2.0.0(transitive)
- Removedd3-format@2.0.0(transitive)
- Removedd3-interpolate@2.0.1(transitive)
- Removedd3-scale@3.3.0(transitive)
- Removedd3-time@2.1.1(transitive)
- Removedd3-time-format@3.0.0(transitive)
- Removedinternmap@1.0.1(transitive)
Updatedd3-array@^3.1.1
Updatedd3-interpolate@^3.0.1
Updatedd3-scale@^4.0.2
Updatedvega-time@^2.1.0
Updatedvega-util@^1.17.0