From fdaab748bf440fc808101ecf04945807c693cf9e 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 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/dvc_render/vega_templates.py b/src/dvc_render/vega_templates.py index 36e23d9..0d7212d 100644 --- a/src/dvc_render/vega_templates.py +++ b/src/dvc_render/vega_templates.py @@ -205,6 +205,12 @@ class ConfusionTemplate(Template): "data": {"values": Template.anchor("data")}, "title": Template.anchor("title"), "facet": {"field": "rev", "type": "nominal"}, + "params": [ + { + "name": "toggleText", + "bind": {"input": "checkbox"}, + }, + ], "spec": { "transform": [ { @@ -294,6 +300,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",