4.2 Component architecture

Creating a graph involves a variety of tasks, which thus can be separated into components without significant additional costs. This structure manifests itself also in the PyX source, where there are different modules for the different tasks. They interact by some well-defined interfaces. They certainly have to be completed and stabilized in their details, but the basic structure came up in the continuous development quite clearly. The basic parts of a graph are:

graph
Defines the geometry of the graph by means of graph coordinates with range [0:1]. Keeps lists of plotted data, axes etc.
data
Produces or prepares data to be plotted in graphs.
style
Performs the plotting of the data into the graph. It gets data, converts them via the axes into graph coordinates and uses the graph to finally plot the data with respect to the graph geometry methods.
key
Responsible for the graph keys.
axis
Creates axes for the graph, which take care of the mapping from data values to graph coordinates. Because axes are also responsible for creating ticks and labels, showing up in the graph themselves and other things, this task is splitted into several independent subtasks. Axes are discussed separately in chapter 5.