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.
41 lines
1.1 KiB
41 lines
1.1 KiB
'use strict';
|
|
|
|
var utils = require('./');
|
|
|
|
function normalizeKeypressEvents(value, key) {
|
|
return {
|
|
value: value,
|
|
key: key || {}
|
|
};
|
|
}
|
|
|
|
module.exports = function(rl) {
|
|
var keypress = utils.rx.Observable.fromEvent(rl.input, 'keypress', normalizeKeypressEvents)
|
|
.filter(function(e) {
|
|
// Ignore `enter` key. On the readline, we only care about the `line` event.
|
|
return e.key.name !== 'enter' && e.key.name !== 'return';
|
|
});
|
|
|
|
return {
|
|
line: utils.rx.Observable.fromEvent(rl, 'line'),
|
|
keypress: keypress,
|
|
|
|
normalizedUpKey: keypress.filter(function(e) {
|
|
return e.key.name === 'up' || e.key.name === 'k';
|
|
}).share(),
|
|
|
|
normalizedDownKey: keypress.filter(function(e) {
|
|
return e.key.name === 'down' || e.key.name === 'j';
|
|
}).share(),
|
|
|
|
numberKey: keypress.filter(function(e) {
|
|
return e.value && '123456789'.indexOf(e.value) >= 0;
|
|
}).map(function(e) {
|
|
return Number(e.value);
|
|
}).share(),
|
|
|
|
spaceKey: keypress.filter(function(e) {
|
|
return e.key && e.key.name === 'space';
|
|
}).share()
|
|
};
|
|
};
|
|
|