1
|
1 from .base import BaseTable
|
|
2 from .tableaxis import ConditionTableAxis
|
|
3
|
|
4
|
|
5 class ConditionTable(BaseTable):
|
|
6
|
|
7 def __init__(self, conds, *args, **kwargs):
|
|
8 self._dfc = conds # DataFrame of condition cases
|
|
9 super().__init__(*args, **kwargs)
|
|
10 """
|
|
11 Add labels using x and y axes.
|
|
12 The default values should be assigned before adding labels.
|
|
13 """
|
|
14 self.row_tick_fontsize = 5
|
|
15 self.column_tick_fontsize = 5
|
|
16 self._add_labels()
|
|
17 # end of def __init__
|
|
18
|
|
19 def _set_colors(self, colors):
|
|
20 """Assign default color values, if it is not defined.
|
|
21 """
|
|
22 self._set_default_color('cond_up_cell', 'blue')
|
|
23 self._set_default_color('cond_dn_cell', 'white')
|
|
24
|
|
25 def _create_axes(self):
|
|
26 super()._create_axes()
|
|
27 ax = self._axes['base']
|
|
28 self._axes['condition'] = ax
|
|
29 del self._axes['base']
|
|
30
|
|
31 def _create_tables(self):
|
|
32 self._tables = []
|
|
33 tb = ConditionTableAxis(self._axes['condition'],
|
|
34 self._dfc, self._colors)
|
|
35 tb.fontsize = 4
|
|
36 tb.linewidth = 0.5
|
|
37 self._tables.append(tb)
|
|
38
|
|
39 def _add_labels(self):
|
|
40 tb = self._tables[0]
|
|
41 tb.add_row_labels()
|
|
42 tb.add_column_labels()
|
|
43
|
|
44
|