From 5280aa2915c73e2d529d7825811a72961b9b0def Mon Sep 17 00:00:00 2001 From: Dave Berenbaum Date: Mon, 6 Nov 2023 17:55:47 -0500 Subject: [PATCH] toggle confusion matrix text (#146) * toggle confusion matrix text * rename toggle --- 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..3940ac3 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": "showValues", + "bind": {"input": "checkbox"}, + }, + ], "spec": { "transform": [ { @@ -294,6 +300,13 @@ class ConfusionTemplate(Template): { "mark": "text", "encoding": { + "text": { + "condition": { + "param": "showValues", + "field": "xy_count", + "type": "quantitative", + }, + }, "color": { "condition": { "test": "datum.percent_of_max > 0.5",