How to use the @jupyter-widgets/controls.FloatSliderModel function in @jupyter-widgets/controls

To help you get started, we’ve selected a few @jupyter-widgets/controls examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github martinRenou / Odysis / js / lib / src / slider.js View on Github external
scale: function(x) {
        let min = this.model.get('min');
        let max = this.model.get('max');

        return (x - min) / (max - min);
    },

    unscale: function(x) {
        let min = this.model.get('min');
        let max = this.model.get('max');

        return min + x * (max - min);
    }
};

let FixedFloatSliderModel = widgets_ctrl.FloatSliderModel.extend({
    defaults: _.extend({}, widgets_ctrl.FloatSliderModel.prototype.defaults, {
        _model_name : 'FixedFloatSliderModel',
        _view_name : 'FixedFloatSliderView',
        _model_module : 'odysis',
        _view_module : 'odysis',
        _model_module_version : odysis_version,
        _view_module_version : odysis_version
    })
});

let FixedFloatSliderView = widgets_ctrl.FloatSliderView.extend(FixedFloatSliderBaseView).extend({
    render: function() {
        FixedFloatSliderView.__super__.render.apply(this, arguments);

        this.$slider.slider('option', 'min', 0);
        this.$slider.slider('option', 'max', 1);
github martinRenou / Odysis / js / lib / src / slider.js View on Github external
let min = this.model.get('min');
        let max = this.model.get('max');

        return (x - min) / (max - min);
    },

    unscale: function(x) {
        let min = this.model.get('min');
        let max = this.model.get('max');

        return min + x * (max - min);
    }
};

let FixedFloatSliderModel = widgets_ctrl.FloatSliderModel.extend({
    defaults: _.extend({}, widgets_ctrl.FloatSliderModel.prototype.defaults, {
        _model_name : 'FixedFloatSliderModel',
        _view_name : 'FixedFloatSliderView',
        _model_module : 'odysis',
        _view_module : 'odysis',
        _model_module_version : odysis_version,
        _view_module_version : odysis_version
    })
});

let FixedFloatSliderView = widgets_ctrl.FloatSliderView.extend(FixedFloatSliderBaseView).extend({
    render: function() {
        FixedFloatSliderView.__super__.render.apply(this, arguments);

        this.$slider.slider('option', 'min', 0);
        this.$slider.slider('option', 'max', 1);
    },