score balancing
This commit is contained in:
parent
c347b79f02
commit
826dd64f1a
@ -65,8 +65,8 @@ function searchHandler(dbConn) {
|
|||||||
if (!_.get(q, 'showRegionsWithNullScore', false)) {
|
if (!_.get(q, 'showRegionsWithNullScore', false)) {
|
||||||
console.log('without null scores');
|
console.log('without null scores');
|
||||||
searchResults.forEach(el => console.log('region:', el.name, 'score:', el.score))
|
searchResults.forEach(el => console.log('region:', el.name, 'score:', el.score))
|
||||||
//searchResults = searchResults.filter(el => !_.some(el.scores, score => _.isNaN(score.score) || _.isNil(score.score)/* || score.score <= 0*/))
|
searchResults = searchResults.filter(el => !_.some(el.scores, score => _.isNaN(score.score) || _.isNil(score.score) || score.score <= 0))
|
||||||
searchResults = searchResults.filter(el => !(_.isNil(el.score) || _.isNaN(el.score)) )
|
// searchResults = searchResults.filter(el => !(_.isNil(el.score) || _.isNaN(el.score)) )
|
||||||
// searchResults = searchResults.filter(el => {
|
// searchResults = searchResults.filter(el => {
|
||||||
// let nullcnt = 0
|
// let nullcnt = 0
|
||||||
// el.scores.forEach(sc => {
|
// el.scores.forEach(sc => {
|
||||||
|
|||||||
9
backend/test.js
Normal file
9
backend/test.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
const moment = require('moment')
|
||||||
|
|
||||||
|
let date = {
|
||||||
|
year: 2012,
|
||||||
|
month: 3,
|
||||||
|
day: 13
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(moment(date));
|
||||||
@ -33,15 +33,15 @@ exports.easeOut = function (x, exponent) {
|
|||||||
|
|
||||||
exports.easeInOut = function (sc, exponent) {
|
exports.easeInOut = function (sc, exponent) {
|
||||||
const x = (sc ) / 10
|
const x = (sc ) / 10
|
||||||
console.log(sc, x);
|
// console.log(sc, x);
|
||||||
if (x<0) return 0
|
if (x<0) return 0
|
||||||
if (x>1) return 10
|
if (x>1) return 10
|
||||||
return x < 0.5 ? Math.pow(2, exponent-1) * Math.pow(x,exponent) * 10 : (1 - Math.pow(-2 * x + 2, exponent)/2) * 10
|
return x < 0.5 ? Math.pow(2, exponent-1) * Math.pow(x,exponent) * 10 : (1 - Math.pow(-2 * x + 2, exponent)/2) * 10
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.easeInOut2 = function (sc, exponent) {
|
exports.easeInOutAsymmetric = function (sc, exponent) {
|
||||||
const x = (sc ) / 10
|
const x = (sc ) / 10
|
||||||
console.log(sc, x);
|
// console.log(sc, x);
|
||||||
if (x<0) return 0
|
if (x<0) return 0
|
||||||
if (x>1) return 10
|
if (x>1) return 10
|
||||||
return x < 0.5 ? (2 * x) - 0.5 * 10 : (1 - Math.pow(-2 * x + 2, exponent)/2) * 10
|
return x < 0.5 ? (2 * x) - 0.5 * 10 : (1 - Math.pow(-2 * x + 2, exponent)/2) * 10
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user