MCPcopy Index your code
hub / github.com/bqplot/bqplot / _get_attribute_dimension

Function _get_attribute_dimension

bqplot/pyplot.py:1286–1297  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

1284
1285
1286def _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
1300def _apply_properties(widget, properties={}):

Callers 5

scalesFunction · 0.85
set_limFunction · 0.85
_draw_markFunction · 0.85
histFunction · 0.85
binFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…