Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove "Help explain button" in Manage rule view #1909

Merged
merged 4 commits into from Nov 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -23,7 +23,10 @@
>
<records-counter :total="dataset.results.total"></records-counter>
</filters-area>
<explain-help-info v-if="isExplainedRecord" :dataset="dataset" />
<explain-help-info
v-if="isExplainedRecord && !isRuleListView"
:dataset="dataset"
/>
<global-actions :dataset="dataset">
<validate-discard-action
:dataset="dataset"
Expand Down Expand Up @@ -59,6 +62,9 @@ export default {
isMultiLabel() {
return this.dataset.isMultiLabel;
},
isRuleListView() {
return this.dataset.viewSettings?.visibleRulesList || false;
},
leiyre marked this conversation as resolved.
Show resolved Hide resolved
availableLabels() {
const record = this.dataset.results.records[0];
let labels =
Expand Down
14 changes: 11 additions & 3 deletions frontend/components/text-classifier/results/RecordExplain.vue
Expand Up @@ -41,6 +41,11 @@ export default {
type: Array,
},
},
data() {
return {
colorSensitivity: 1, // color sensitivity (values from 1 to 4)
};
},
computed: {
predicted() {
return this.record.predicted;
Expand All @@ -60,9 +65,9 @@ export default {
let percent = Math.round(Math.abs(grad) * 100);
if (percent !== 0) {
/* eslint-disable no-mixed-operators */
const colorSensitivity = 1; // color sensitivity (values from 1 to 4)
const logNumber = 100 / Math.log10(100) ** colorSensitivity;
percent = Math.round(Math.log10(percent) ** colorSensitivity * logNumber);
percent = Math.round(
Math.log10(percent) ** this.colorSensitivity * this.logNumber
);
leiyre marked this conversation as resolved.
Show resolved Hide resolved
}
return {
text: this.record.search_keywords
Expand All @@ -73,6 +78,9 @@ export default {
};
});
},
logNumber() {
return 100 / Math.log10(100) ** this.colorSensitivity;
},
},
methods: {
customClass(tokenItem) {
Expand Down