From fc0ee0aa4e08735086d1f764da410eeeca591649 Mon Sep 17 00:00:00 2001 From: dberenbaum Date: Mon, 16 Oct 2023 16:07:58 -0400 Subject: [PATCH] toggle confusion matrix text --- src/dvc_render/vega_templates.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/dvc_render/vega_templates.py b/src/dvc_render/vega_templates.py index 36e23d9..bb7db74 100644 --- a/src/dvc_render/vega_templates.py +++ b/src/dvc_render/vega_templates.py @@ -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": [ { @@ -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",