Container classes are classes that are used to transport data between the model thread and the GUI thread.
When complex data sets need to be visualized (eg.: charts, intervals), built-in python types don’t contain enough information, while dictionary like structures are not self documented. Hence the need of specialized container classes to transport this data between the model and the GUI.
To use this classes :
eg:
class MyEntity(Entity):
@property def my_interval(self):
return IntervalsContainer()
- class Admin(EntityAdmin):
- form_display = [‘my_interval’] field_attributes = dict(my_interval=dict(delegate=IntervalsDelegate))
Bases: camelot.container.Container
Container to describe arrows
Bases: object
Helper class for IntervalsContainer, specifications for one interval
Bases: camelot.container.Container
Containter to hold interval data
eg : representing the time frame of 8pm till 6am that someone was at work using an hourly precision :
intervals = IntervalsContainer(0, 24, [Interval(8, 18, ‘work’)])
Bases: camelot.container.Container
A container that is able to generate a plot on a matplotlib axes. Methods can be called on this class as if it were a matplotlib Axes class. All method calls will be recorded. Of course the methods won’t return matplotlib objects. The set_auto_legend method can be used to turn legens on without the need for matplotlib objects.
Bases: object
Helper class to substitute a method on an Axes object and record its calls
Bases: camelot.container.Container
A container that is able to plot itself on a matplotlib figure canvas.
Its ‘plot_on_figure’ method will be called in the gui thread to fill the figure canvas.
One figure canvas can contain multiple axes (=sub plots)
Convert a structure to a figure container, if the structure is an instance of a FigureContainer, return as is.
If the structure is an instance of an AxesContainer, return a FigureContainer with a single Axes.
If the structure is a list, use the structure as a constructor argument for the FigureContainer