Merge a collection of templates into a single combined template. Templates are process from left to right so if multiple templates specify the same propery, the right-most template will take precedence. Parameters ---------- args: list of Tem
(self, *args)
| 187 | return available |
| 188 | |
| 189 | def merge_templates(self, *args): |
| 190 | """ |
| 191 | Merge a collection of templates into a single combined template. |
| 192 | Templates are process from left to right so if multiple templates |
| 193 | specify the same propery, the right-most template will take |
| 194 | precedence. |
| 195 | |
| 196 | Parameters |
| 197 | ---------- |
| 198 | args: list of Template |
| 199 | Zero or more template objects (or dicts with compatible properties) |
| 200 | |
| 201 | Returns |
| 202 | ------- |
| 203 | template: |
| 204 | A combined template object |
| 205 | |
| 206 | Examples |
| 207 | -------- |
| 208 | |
| 209 | >>> pio.templates.merge_templates( |
| 210 | ... go.layout.Template(layout={'font': {'size': 20}}), |
| 211 | ... go.layout.Template(data={'scatter': [{'mode': 'markers'}]}), |
| 212 | ... go.layout.Template(layout={'font': {'family': 'Courier'}})) |
| 213 | layout.Template({ |
| 214 | 'data': {'scatter': [{'mode': 'markers', 'type': 'scatter'}]}, |
| 215 | 'layout': {'font': {'family': 'Courier', 'size': 20}} |
| 216 | }) |
| 217 | """ |
| 218 | if args: |
| 219 | return reduce(self._merge_2_templates, args) |
| 220 | else: |
| 221 | from plotly.graph_objs.layout import Template |
| 222 | |
| 223 | return Template() |
| 224 | |
| 225 | def _merge_2_templates(self, template1, template2): |
| 226 | """ |