Skip to content

Commit

Permalink
toggle confusion matrix text
Browse files Browse the repository at this point in the history
  • Loading branch information
dberenbaum committed Oct 16, 2023
1 parent e04c5de commit fc0ee0a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/dvc_render/vega_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,13 @@ class ConfusionTemplate(Template):
"data": {"values": Template.anchor("data")},
"title": Template.anchor("title"),
"facet": {"field": "rev", "type": "nominal"},
"params": [
{
"name": "toggleText",
"bind": {"input": "checkbox"},
"title": "Toggle cell value text",
},
],
"spec": {
"transform": [
{
Expand Down Expand Up @@ -294,6 +301,13 @@ class ConfusionTemplate(Template):
{
"mark": "text",
"encoding": {
"text": {
"condition": {
"param": "toggleText",
"field": "xy_count",
"type": "quantitative",
},
},
"color": {
"condition": {
"test": "datum.percent_of_max > 0.5",
Expand Down

0 comments on commit fc0ee0a

Please sign in to comment.