Vega templates
Template
Source code in dvc_render/vega_templates.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
|
anchor(name)
classmethod
Get ANCHOR formatted with name.
Source code in dvc_render/vega_templates.py
101 102 103 104 |
|
check_field_exists(data, field)
staticmethod
Raise NoFieldInDataError if field
not in data
.
Source code in dvc_render/vega_templates.py
113 114 115 116 117 |
|
escape_special_characters(value)
classmethod
Escape special characters in value
Source code in dvc_render/vega_templates.py
106 107 108 109 110 111 |
|
fill_anchor(name, value)
Replace anchor name
with value
in content.
Source code in dvc_render/vega_templates.py
127 128 129 |
|
has_anchor(name)
Check if ANCHOR formatted with name is in content.
Source code in dvc_render/vega_templates.py
123 124 125 |
|
reset()
Reset self.content to its original state.
Source code in dvc_render/vega_templates.py
119 120 121 |
|
dump_templates(output, targets=None)
Write TEMPLATES in .json
format to output
.
Source code in dvc_render/vega_templates.py
735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 |
|
get_template(template=None, template_dir=None, fs=None)
Return template instance based on given template arg.
If template is already an instance, return it.
If template is None, return default linear
template.
If template is a path, will try to find it:
- Inside template_dir
- As a relative path to cwd.
If template matches one of the DEFAULT_NAMEs in TEMPLATES,
return an instance of the one matching.
Source code in dvc_render/vega_templates.py
699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 |
|