Returns the dimension for the name of the trait for the specified mark. If `mark_type` is `None`, then the `trait_name` is returned as is. Returns `None` if the `trait_name` is not valid for `mark_type`.
(trait_name, mark_type=None)
| 1284 | |
| 1285 | |
| 1286 | def _get_attribute_dimension(trait_name, mark_type=None): |
| 1287 | """Returns the dimension for the name of the trait for the specified mark. |
| 1288 | |
| 1289 | If `mark_type` is `None`, then the `trait_name` is returned |
| 1290 | as is. |
| 1291 | Returns `None` if the `trait_name` is not valid for `mark_type`. |
| 1292 | """ |
| 1293 | if mark_type is None: |
| 1294 | return trait_name |
| 1295 | scale_metadata = mark_type.class_traits()['scales_metadata']\ |
| 1296 | .default_args[0] |
| 1297 | return scale_metadata.get(trait_name, {}).get('dimension', None) |
| 1298 | |
| 1299 | |
| 1300 | def _apply_properties(widget, properties={}): |
no outgoing calls
no test coverage detected
searching dependent graphs…