Skip to content

Commit

Permalink
move confusion matrix text to tooltip (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
dberenbaum authored Apr 20, 2023
1 parent 33eae51 commit 8aab523
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/dvc_render/vega_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ class ConfusionTemplate(Template):
"tooltip": [
{"field": Template.anchor("x"), "type": "nominal"},
{"field": Template.anchor("y"), "type": "nominal"},
{"field": "xy_count", "type": "quantitative"},
],
"opacity": {
"condition": {"selection": "label", "value": 1},
Expand All @@ -283,7 +284,6 @@ class ConfusionTemplate(Template):
{
"mark": "text",
"encoding": {
"text": {"field": "xy_count", "type": "quantitative"},
"color": {
"condition": {
"test": "datum.percent_of_max > 0.5",
Expand Down Expand Up @@ -377,6 +377,11 @@ class NormalizedConfusionTemplate(Template):
"tooltip": [
{"field": Template.anchor("x"), "type": "nominal"},
{"field": Template.anchor("y"), "type": "nominal"},
{
"field": "percent_of_y",
"type": "quantitative",
"format": ".2f",
},
],
"opacity": {
"condition": {"selection": "label", "value": 1},
Expand All @@ -393,11 +398,6 @@ class NormalizedConfusionTemplate(Template):
{
"mark": "text",
"encoding": {
"text": {
"field": "percent_of_y",
"type": "quantitative",
"format": ".2f",
},
"color": {
"condition": {
"test": "datum.percent_of_y > 0.5",
Expand Down

0 comments on commit 8aab523

Please sign in to comment.