How to use the @jupyter-widgets/controls.FloatSliderView 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
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);
    },

    update: function(options) {
        FixedFloatSliderView.__super__.update.apply(this, arguments);

        this.$slider.slider('option', 'range', false);

        let value = this.model.get('value');

        this.$slider.slider('option', 'value', this.scale(value));
    },