INNER CODE UNIT · JavaScript
d
business-science/free_r_tips · 030_slide_decks_xaringan/libs/datatables-binding/datatables.js:496
var d = Math.round(Math.log(scale) / Math.log(10));
// to avoid problems like 3.423/100 -> 0.034230000000000003
return (x / scale).toFixed(d);
};
var slider_min = function() {
return filter.noUiSlider('options').range.min;
};
var slider_max = function() {
return filter.noUiSlider('options').range.max;
};
$input.on({
focus: function() {
$x0.show().trigger('show');
// first, make sure the slider div leaves at least 20px between
// the two (slider value) span's
$x0.width(Math.max(160, $span1.outerWidth() + $span2.outerWidth() + 20));
// then, if the input is really wide, make the slider the same
// width as the input