Create abstract data class
After discussion with @ndcn0236 it was decided to dumpy the DataSource
class and instead use a dict
of ColumnDataSource
objects.
Example usage:
source = {
'data_points': ColumnDataSource({'dp2': np.abs(acq['bvec'][:, 2])**2}),
'signal_profile': ColumnDataSource({'dp2': sbvecs[:,2]**2}),
}
source['data_points'].data['signal'] = data_signal
source['signal_profile'].data['signal'] = another_data_signal
All below is deprecated
This class will be an abstraction for the source data from which the plotting is derived.
Currently bokeh.models.ColumnDataSource
is used. When this data source is updated the plots will be redrawn. However, a ColumnDataSource
requires each data vector to be of the same length.
This will be a light-weight wrapper, akin to a dict
, that will accept multiple datasources of different lengths.
Example usage:
data = DataSource()
#data.add(datatype, key, val)
data.add('data_points', 'bval', acq['bval'])
data.add('data_points', 'signal', compartments.get_signal(CompartmentSelector.model, **acq))
Edited by Sean Fitzgibbon