Source code for hail.ggplot.aes

from import Mapping

from hail.expr import Expression, literal

[docs]class Aesthetic(Mapping): def __init__(self, properties): = properties def __getitem__(self, item): return[item] def __len__(self): return len( def __contains__(self, item): return item in def __iter__(self): return iter( def __repr__(self): return def merge(self, other): return Aesthetic({**, **})
[docs]def aes(**kwargs): """Create an aesthetic mapping Parameters ---------- kwargs: Map aesthetic names to hail expressions based on table's plot. Returns ------- :class:`.Aesthetic` The aesthetic mapping to be applied. """ hail_field_properties = {} for k, v in kwargs.items(): _v = v if not isinstance(v, Expression): _v = literal(v) hail_field_properties[k] = _v return Aesthetic(hail_field_properties)