Skip to content

Commit

Permalink
fix(#1211): fix score scale (#1261)
Browse files Browse the repository at this point in the history
Using the fixed range [0-1] for score filter visualization.

Closes #1211
  • Loading branch information
frascuchon committed Mar 16, 2022
1 parent 9e11933 commit 093f78b
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 13 deletions.
14 changes: 10 additions & 4 deletions frontend/components/commons/header/filters/FilterScore.vue
Expand Up @@ -115,6 +115,7 @@ export default {
color: "#D9D7E4",
binSpacing: 0,
},
bar: {
binSpacing: 0,
discreteBandSize: 0,
Expand All @@ -129,15 +130,20 @@ export default {
},
},
encoding: {
x: { field: "key", type: "ordinal", scale: { rangeStep: null } },
x: {
scale: { zero: true },
bin: { maxbins: 100, extent: [0.0, 1.0] },
field: "key",
type: "quantitative",
},
y: { field: "count", type: "quantitative", aggregate: "sum" },
},
}),
computed: {
options() {
let test = Object.keys(this.filter.options).map((key) => {
return {
key: key,
key: Number(key),
count: this.filter.options[key],
};
});
Expand Down Expand Up @@ -228,8 +234,8 @@ export default {
text-align: center;
}
.range__container {
margin-top: -8px;
padding: 0 0.5em;
margin-top: 2px;
padding: 0;
}
.range {
@include font-size(14px);
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/core/ReRange.vue
Expand Up @@ -1160,7 +1160,7 @@ export default {
-webkit-user-select: none;
-moz-user-select: none;
-o-user-select: none;
padding: 0;
padding: 0 !important;
&.vue-slider-disabled {
.vue-slider-dot {
background: $line-light-color;
Expand Down
Expand Up @@ -39,7 +39,7 @@ export default {
},
explain: {
type: Array,
}
},
},
computed: {
predicted() {
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/text-classifier/results/RecordInputs.vue
Expand Up @@ -48,8 +48,8 @@ export default {
props: {
record: {
type: Object,
required: true
}
required: true,
},
},
data: () => ({
showFullRecord: false,
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/text-classifier/results/RecordString.vue
Expand Up @@ -50,8 +50,8 @@ export default {
},
computed: {
keywords() {
return this.record.search_keywords
}
return this.record.search_keywords;
},
},
methods: {
isList(record) {
Expand Down
Expand Up @@ -36,8 +36,8 @@ export default {
props: {
record: {
type: Object,
required: true
}
required: true,
},
},
data: () => ({
showFullRecord: false,
Expand Down
Expand Up @@ -68,7 +68,7 @@ export default {
record: {
type: Object,
required: true,
}
},
},
data: () => {
return {
Expand Down

0 comments on commit 093f78b

Please sign in to comment.