blob: 20689c5e979c6f7b84b54417d090c8471ad636e7 [file] [log] [blame]
James Kuszmaul48671362020-12-24 13:54:16 -08001// This flatbuffer defines the interface that is used by the in-process
2// web plotter to plot data dynamically. Both the structure of the plot and
3// the data to plot is all packaged within a single Plot message. Each Plot
4// message will correspond to a single view/tab on the web-page, and can have
5// multiple figures, each of which can have multiple lines.
Stephan Pleines9e40c8e2024-02-07 20:58:28 -08006namespace aos.analysis;
James Kuszmaul48671362020-12-24 13:54:16 -08007
8// Position within the web-page to plot a figure at. [0, 0] will be the upper
9// left corner of the allowable places where plots can be put, and should
10// generally be the default location. All values in pixels.
11table Position {
12 top:float (id: 0);
13 left:float (id: 1);
14 width:float (id: 2);
15 height:float (id: 3);
16}
17
18struct Point {
19 x:double (id: 0);
20 y:double (id: 1);
21}
22
23// RGB values are in the range [0, 1].
24struct Color {
25 r:float (id: 0);
26 g:float (id: 1);
27 b:float (id: 2);
28}
29
James Kuszmaul19217a42022-06-17 10:54:29 -070030table LineStyle {
31 point_size:float (id: 0);
32 draw_line:bool (id: 1);
33}
34
James Kuszmaul48671362020-12-24 13:54:16 -080035table Line {
36 label:string (id: 0);
37 points:[Point] (id: 1);
38 color:Color (id: 2);
James Kuszmaul19217a42022-06-17 10:54:29 -070039 style:LineStyle (id: 3);
James Kuszmaul48671362020-12-24 13:54:16 -080040}
41
42table Figure {
43 position:Position (id: 0);
44 lines:[Line] (id: 1);
45 // Specifies whether to link the x-axis of this Figure with that of other
46 // figures in this Plot. Only the axes of Figure's with this flag set will
47 // be linked.
48 share_x_axis:bool (id: 2);
49 title:string (id: 3);
50 xlabel:string (id: 4);
51 ylabel:string (id: 5);
52}
53
54table Plot {
55 figures:[Figure] (id: 0);
56 title:string (id: 1);
57}
58
59root_type Plot;