Source code for hail.ggplot.aes

from import Mapping
from hail.expr import Expression
from hail import 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(): if not isinstance(v, Expression): v = literal(v) hail_field_properties[k] = v return Aesthetic(hail_field_properties)