(self, data_dict)
Feed a block from a block dict.
Feed a block from a block dict.
Feed a block from a block dict .
def from_dict(self, data_dict):
        """Feed a block from a block dict."""
        component = data_dict.get('componentName', 'N/A')
        if component != 'TsAggregationCompact':
            raise TypeError('Not an aggregation block.')

        props = data_dict.get('componentProps', {})
        agg_dict = props.get('aggregation')
        if not agg_dict:
            raise TypeError('Aggregation not defined')

        self._agg_id = agg_dict.get('id', 0)
        self._agg_name = agg_dict.get('name', '')
        self._chart_type = agg_dict.get('chart_type', 'table')
        self._agg_dict = agg_dict
def from_dict ( self , data_dict ) : component = data_dict . get ( 'componentName' , 'N/A' ) if component != 'TsAggregationCompact' : raise TypeError ( 'Not an aggregation block.' ) props = data_dict . get ( 'componentProps' , { } ) agg_dict = props . get ( 'aggregation' ) if not agg_dict : raise TypeError ( 'Aggregation not defined' ) self . _agg_id = agg_dict . get ( 'id' , 0 ) self . _agg_name = agg_dict . get ( 'name' , '' ) self . _chart_type = agg_dict . get ( 'chart_type' , 'table' ) self . _agg_dict = agg_dict