StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics
https://doi.org/10.1109/TVCG.2020.3030352
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
101 lines
2.6 KiB
101 lines
2.6 KiB
"use strict";
|
|
|
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
|
|
var _bootstrapSlider = _interopRequireDefault(require("bootstrap-slider"));
|
|
|
|
var _camelCase = _interopRequireDefault(require("lodash/camelCase"));
|
|
|
|
var _snakeCase = _interopRequireDefault(require("lodash/snakeCase"));
|
|
|
|
var _throttle = _interopRequireDefault(require("lodash/throttle"));
|
|
|
|
var _properties = _interopRequireDefault(require("./properties"));
|
|
|
|
var _watchers = _interopRequireDefault(require("./watchers"));
|
|
|
|
// @vue/component
|
|
var _default = {
|
|
name: 'FormSlider',
|
|
props: _properties.default,
|
|
data: function data() {
|
|
return {
|
|
slider: null,
|
|
lastEvent: {}
|
|
};
|
|
},
|
|
watch: _watchers.default,
|
|
mounted: function mounted() {
|
|
var props = {};
|
|
|
|
for (var key in this.$props) {
|
|
if (this.$props.hasOwnProperty(key)) {
|
|
var propskey = key === 'rangeHighlights' ? key : (0, _snakeCase.default)(key);
|
|
props[propskey] = this.$props[key];
|
|
}
|
|
}
|
|
|
|
props.enabled = !this.disabled;
|
|
this.slider = new _bootstrapSlider.default(this.$refs.input, props);
|
|
this.bindEvents();
|
|
},
|
|
beforeDestroy: function beforeDestroy() {
|
|
if (this.slider) {
|
|
this.slider.destroy();
|
|
delete this.slider;
|
|
}
|
|
},
|
|
methods: {
|
|
refresh: (0, _throttle.default)(function () {
|
|
if (this.slider) {
|
|
this.slider.refresh({
|
|
useCurrentValue: true
|
|
});
|
|
this.bindEvents();
|
|
}
|
|
}, 10),
|
|
bindEvents: function bindEvents() {
|
|
var _this = this;
|
|
|
|
var events = ['slide', 'slide-start', 'slide-stop', 'change', 'slide-enabled', 'slide-disabled'];
|
|
events.forEach(function (event) {
|
|
// only bind the event if the event is bound to us
|
|
if (event === 'change' || _this.$listeners[event]) {
|
|
_this.slider.on((0, _camelCase.default)(event), function (value) {
|
|
if (_this.debounce > 0) {
|
|
var now = new Date().getTime();
|
|
|
|
if (_this.lastEvent[event] !== null && now <= _this.lastEvent[event] + _this.debounce) {
|
|
return;
|
|
}
|
|
|
|
_this.lastEvent[event] = now;
|
|
}
|
|
|
|
_this.$emit(event, value);
|
|
|
|
if (event === 'change') {
|
|
_this.$emit('input', value.newValue);
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
},
|
|
render: function render(h) {
|
|
return h('div', {
|
|
staticClass: 'd-inline-block'
|
|
}, [h('input', {
|
|
ref: 'input',
|
|
attrs: {
|
|
type: 'text'
|
|
}
|
|
})]);
|
|
}
|
|
};
|
|
exports.default = _default; |