James Kuszmaul | 4867136 | 2020-12-24 13:54:16 -0800 | [diff] [blame] | 1 | // 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 Pleines | 9e40c8e | 2024-02-07 20:58:28 -0800 | [diff] [blame] | 6 | namespace aos.analysis; |
James Kuszmaul | 4867136 | 2020-12-24 13:54:16 -0800 | [diff] [blame] | 7 | |
| 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. |
| 11 | table Position { |
| 12 | top:float (id: 0); |
| 13 | left:float (id: 1); |
| 14 | width:float (id: 2); |
| 15 | height:float (id: 3); |
| 16 | } |
| 17 | |
| 18 | struct Point { |
| 19 | x:double (id: 0); |
| 20 | y:double (id: 1); |
| 21 | } |
| 22 | |
| 23 | // RGB values are in the range [0, 1]. |
| 24 | struct Color { |
| 25 | r:float (id: 0); |
| 26 | g:float (id: 1); |
| 27 | b:float (id: 2); |
| 28 | } |
| 29 | |
James Kuszmaul | 19217a4 | 2022-06-17 10:54:29 -0700 | [diff] [blame] | 30 | table LineStyle { |
| 31 | point_size:float (id: 0); |
| 32 | draw_line:bool (id: 1); |
| 33 | } |
| 34 | |
James Kuszmaul | 4867136 | 2020-12-24 13:54:16 -0800 | [diff] [blame] | 35 | table Line { |
| 36 | label:string (id: 0); |
| 37 | points:[Point] (id: 1); |
| 38 | color:Color (id: 2); |
James Kuszmaul | 19217a4 | 2022-06-17 10:54:29 -0700 | [diff] [blame] | 39 | style:LineStyle (id: 3); |
James Kuszmaul | 4867136 | 2020-12-24 13:54:16 -0800 | [diff] [blame] | 40 | } |
| 41 | |
| 42 | table 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 | |
| 54 | table Plot { |
| 55 | figures:[Figure] (id: 0); |
| 56 | title:string (id: 1); |
| 57 | } |
| 58 | |
| 59 | root_type Plot; |