Skip to content

Commit

Permalink
center-align confusion matrix title (#160)
Browse files Browse the repository at this point in the history
* center-align confusion matrix title

* set `anchor: middle` for all Vega-Lite plot titles
  • Loading branch information
sisp authored Apr 10, 2024
1 parent c38eeeb commit 5671fe3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/dvc_render/vega_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class BarHorizontalSortedTemplate(Template):
DEFAULT_CONTENT = {
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {"values": Template.anchor("data")},
"title": Template.anchor("title"),
"title": {"text": Template.anchor("title"), "anchor": "middle"},
"width": Template.anchor("plot_width"),
"height": Template.anchor("plot_height"),
"mark": {"type": "bar"},
Expand Down Expand Up @@ -166,7 +166,7 @@ class BarHorizontalTemplate(Template):
DEFAULT_CONTENT = {
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {"values": Template.anchor("data")},
"title": Template.anchor("title"),
"title": {"text": Template.anchor("title"), "anchor": "middle"},
"width": Template.anchor("plot_width"),
"height": Template.anchor("plot_height"),
"mark": {"type": "bar"},
Expand Down Expand Up @@ -195,7 +195,7 @@ class ConfusionTemplate(Template):
DEFAULT_CONTENT = {
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {"values": Template.anchor("data")},
"title": Template.anchor("title"),
"title": {"text": Template.anchor("title"), "anchor": "middle"},
"facet": {
"column": {"field": "rev", "sort": []},
"row": Template.anchor("row"),
Expand Down Expand Up @@ -321,7 +321,7 @@ class NormalizedConfusionTemplate(Template):
DEFAULT_CONTENT = {
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {"values": Template.anchor("data")},
"title": Template.anchor("title"),
"title": {"text": Template.anchor("title"), "anchor": "middle"},
"facet": {
"column": {"field": "rev", "sort": []},
"row": Template.anchor("row"),
Expand Down Expand Up @@ -439,7 +439,7 @@ class ScatterTemplate(Template):
DEFAULT_CONTENT = {
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {"values": Template.anchor("data")},
"title": Template.anchor("title"),
"title": {"text": Template.anchor("title"), "anchor": "middle"},
"width": Template.anchor("plot_width"),
"height": Template.anchor("plot_height"),
"mark": {"type": "point", "tooltip": {"content": "data"}},
Expand Down Expand Up @@ -468,7 +468,7 @@ class ScatterJitterTemplate(Template):
DEFAULT_CONTENT = {
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {"values": Template.anchor("data")},
"title": Template.anchor("title"),
"title": {"text": Template.anchor("title"), "anchor": "middle"},
"width": Template.anchor("plot_width"),
"height": Template.anchor("plot_height"),
"transform": [
Expand Down Expand Up @@ -499,7 +499,7 @@ class SmoothLinearTemplate(Template):
DEFAULT_CONTENT = {
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {"values": Template.anchor("data")},
"title": Template.anchor("title"),
"title": {"text": Template.anchor("title"), "anchor": "middle"},
"width": Template.anchor("plot_width"),
"height": Template.anchor("plot_height"),
"params": [
Expand Down Expand Up @@ -637,7 +637,7 @@ class SimpleLinearTemplate(Template):
DEFAULT_CONTENT = {
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {"values": Template.anchor("data")},
"title": Template.anchor("title"),
"title": {"text": Template.anchor("title"), "anchor": "middle"},
"params": [Template.anchor("zoom_and_pan")],
"width": Template.anchor("plot_width"),
"height": Template.anchor("plot_height"),
Expand Down

0 comments on commit 5671fe3

Please sign in to comment.