Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
iRGBColorObj = d3Interpolate.interpolateObject(d3Color.rgb('steelblue'), d3Color.rgb('seagreen'));
objRGBColor = iRGBColorObj(0.5);
// test interpolateTransformCss(a, b) signature ----------------------------------------------------
iString = d3Interpolate.interpolateTransformCss('rotate(0deg)', 'rotate(60deg)');
str = iString(0.5);
// test interpolateTransformSvg(a, b) signature ----------------------------------------------------
iString = d3Interpolate.interpolateTransformSvg('rotate(0)', 'rotate(60)');
str = iString(0.5);
// test interpolateZoom(a, b) signature ----------------------------------------------------
iZoom = d3Interpolate.interpolateZoom([50, 50, 300], [100, 100, 500]);
zoom = iZoom(0.5);
console.log('Recommended transition duration = %d', iZoom.duration);
// test quantize(interpolator, n) signature ------------------------------------------------
arrNum = d3Interpolate.quantize(d3Interpolate.interpolateRound(-1, 2), 4); // infered template parameter type
arrStr = d3Interpolate.quantize(d3Interpolate.interpolateString('-1', '2'), 4); // explicit template parameter typing
// arrStr = d3Interpolate.quantize(d3Interpolate.interpolateRound(-1, 2), 4); // test fails, due to explicit typing v argument type mismatch
// test interpolateRgb(a, b) signatures ----------------------------------------------------------------
// without gamma correction
iString = d3Interpolate.interpolateRgb('seagreen', 'steelblue');
iString = d3Interpolate.interpolateRgb(d3Color.rgb('seagreen'), d3Color.hcl('steelblue'));
objRGBColor = iRGBColorObj(0.5);
// test interpolateTransformCss(a, b) signature ----------------------------------------------------
iString = d3Interpolate.interpolateTransformCss('rotate(0deg)', 'rotate(60deg)');
str = iString(0.5);
// test interpolateTransformSvg(a, b) signature ----------------------------------------------------
iString = d3Interpolate.interpolateTransformSvg('rotate(0)', 'rotate(60)');
str = iString(0.5);
// test interpolateZoom(a, b) signature ----------------------------------------------------
iZoom = d3Interpolate.interpolateZoom([50, 50, 300], [100, 100, 500]);
zoom = iZoom(0.5);
console.log('Recommended transition duration = %d', iZoom.duration);
// test quantize(interpolator, n) signature ------------------------------------------------
arrNum = d3Interpolate.quantize(d3Interpolate.interpolateRound(-1, 2), 4); // infered template parameter type
arrStr = d3Interpolate.quantize(d3Interpolate.interpolateString('-1', '2'), 4); // explicit template parameter typing
// arrStr = d3Interpolate.quantize(d3Interpolate.interpolateRound(-1, 2), 4); // test fails, due to explicit typing v argument type mismatch
// test interpolateRgb(a, b) signatures ----------------------------------------------------------------
// without gamma correction
iString = d3Interpolate.interpolateRgb('seagreen', 'steelblue');
iString = d3Interpolate.interpolateRgb(d3Color.rgb('seagreen'), d3Color.hcl('steelblue'));
.tween("zoom", function () {
const i = d3InterpolateZoom(context.view, [context._focus.x, context._focus.y, context._focus.r * 2]);
return function (t) { context.zoomTo(i(t)); };
});
.tween("zoom", function () {
const i = d3InterpolateZoom(context.view, [context._focus.x, context._focus.y, context._focus.r * 2]);
return function (t) { context.zoomTo(i(t)); };
});