Skip to content

Commit 5280aa2

Browse files
authored
toggle confusion matrix text (#146)
* toggle confusion matrix text * rename toggle
1 parent e04c5de commit 5280aa2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/dvc_render/vega_templates.py

+13
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,12 @@ class ConfusionTemplate(Template):
205205
"data": {"values": Template.anchor("data")},
206206
"title": Template.anchor("title"),
207207
"facet": {"field": "rev", "type": "nominal"},
208+
"params": [
209+
{
210+
"name": "showValues",
211+
"bind": {"input": "checkbox"},
212+
},
213+
],
208214
"spec": {
209215
"transform": [
210216
{
@@ -294,6 +300,13 @@ class ConfusionTemplate(Template):
294300
{
295301
"mark": "text",
296302
"encoding": {
303+
"text": {
304+
"condition": {
305+
"param": "showValues",
306+
"field": "xy_count",
307+
"type": "quantitative",
308+
},
309+
},
297310
"color": {
298311
"condition": {
299312
"test": "datum.percent_of_max > 0.5",

0 commit comments

Comments
 (0)