code: def test_to_json_vega_split(mocker):
      revs = ["bar", "foo"]
      content = json.dumps(
          {
              "this": "is split vega",
              "encoding": {"color": "<DVC_METRIC_COLOR>"},
              "data": {"values": "<DVC_METRIC_DATA>"},
          }
      )
      anchor_definitions = {
          "<DVC_METRIC_COLOR>": {
              "field": "rev",
              "scale": {
                  "domain": revs,
                  "range": ["#ff0000", "#00ff00"],
              },
          },
          "<DVC_METRIC_DATA>": [
              {
                  "x": 1,
                  "y": 2,
                  REVISION: "foo",
                  FILENAME: "foo.json",
              },
              {
                  "x": 2,
                  "y": 1,
                  REVISION: "bar",
                  FILENAME: "foo.json",
              },
          ],
      }
  
      vega_renderer = mocker.MagicMock()
      vega_renderer.TYPE = "vega"
      vega_renderer.get_partial_filled_template.return_value = (
          content,
          {ANCHOR_DEFINITIONS: anchor_definitions},
      )
      vega_renderer.get_revs.return_value = ["bar", "foo"]
  
      result = to_json(vega_renderer, split=True)
      assert result[0] == {
          ANCHOR_DEFINITIONS: anchor_definitions,
          TYPE_KEY: vega_renderer.TYPE,
          REVISIONS: revs,
          "content": content,
      }
      vega_renderer.get_partial_filled_template.assert_called_once()
  
imports: import json
  import pytest
  from dvc.render import ANCHOR_DEFINITIONS, FILENAME, REVISION, REVISIONS, SRC, TYPE_KEY
  from dvc.render.convert import to_json
label_desc: Use image node_id 2 for calling a global function with example usage: test_to_json_vega_split(mocker) without return types