components.md (756B)
1 # Components 2 Second attempt at a plan, at least for the component *structs*. A component 3 should be an interface with the function `draw()`. 4 5 ## Figure 6 - rectangle 7 - anything containing other components inside it. Can contain other figures. 8 - variables: 9 ``` 10 (x0, y0) 11 (x1, y1) 12 components[] 13 ``` 14 - `.draw()` for a figure simply calls `.draw()` for all compoments in the list. 15 16 ## Box 17 - rectangle only containing text (label) 18 - variables: 19 ``` 20 (x0, y0) 21 (x1, y1) 22 label 23 ``` 24 25 ## Line 26 - a simple start position, stop position, and line type (dotted, thick? etc) 27 - variables: 28 ``` 29 (x0, y0) 30 (x1, y1) 31 type 32 ``` 33 34 ## Arrow 35 - (x, y) 36 - direction 37 ``` 38 0 1 2 3 39 UP DOWN LEFT RIGHT 40 ^ v < > 41 ```