Source code for visual_viper.notation_builders.forest_plot_binding_notation

import json
from .abstract_chart_notation import AbstractChartNotation

[docs] class ForestPlotBinding(AbstractChartNotation): def __init__(self, measure, hr, lo, hi) -> None: super().__init__() self.measure = measure self._hr = hr self._lo = lo self._hi = hi @property def data(self) -> dict: return dict( measure=self.measure, lo=self._lo, hr=self._hr, hi=self._hi, # TODO @mariana.pais replace this with a better key cohort=" " ) @property def solved_data(self) -> dict: return dict( measure=self.measure, lo=self.lo, hr=self.hr, hi=self.hi, # TODO @mariana.pais replace this with a better key cohort=" " ) @property def lo(self): return self.solve(self._lo) @property def hr(self): return self.solve(self._hr) @property def hi(self): return self.solve(self._hi)
[docs] def items(self): yield ("hr", self._hr) yield ("lo", self._lo) yield ("hi", self._hi)
def __repr__(self): return f"hr:{self.hr}, lo:{self.lo}, hi:{self.hi}"