Shapes ====== Docraft supports several geometric shape elements. All shapes share ``background_color``, ``border_color``, and ``border_width`` attributes. Rectangle --------- ```` draws a box and can contain children rendered on top. .. code-block:: xml Inside the box .. list-table:: :header-rows: 1 :widths: 20 15 65 * - Attribute - Type - Description * - ``background_color`` - color - Fill color. * - ``border_color`` - color - Stroke color. * - ``border_width`` - float - Stroke width in points (default ``1``). Circle ------ ```` draws a circle based on the node's bounding box. .. code-block:: xml Attributes are the same as ````. Triangle -------- ```` is defined by three points in local coordinates. .. code-block:: xml .. list-table:: :header-rows: 1 :widths: 20 15 65 * - Attribute - Type - Description * - ``points`` - string - Three points as ``x1,y1 x2,y2 x3,y3``. * - ``background_color`` - color - Fill color. * - ``border_color`` - color - Stroke color. * - ``border_width`` - float - Stroke width in points. Line ---- ```` draws a line between two points. .. code-block:: xml .. list-table:: :header-rows: 1 :widths: 20 15 65 * - Attribute - Type - Description * - ``x1``, ``y1`` - float - Start point. * - ``x2``, ``y2`` - float - End point. * - ``border_color`` - color - Stroke color. * - ``border_width`` - float - Stroke width in points. Polygon ------- ```` draws an arbitrary closed polygon. .. code-block:: xml .. list-table:: :header-rows: 1 :widths: 20 15 65 * - Attribute - Type - Description * - ``points`` - string - Space-separated ``x,y`` pairs. * - ``background_color`` - color - Fill color. * - ``border_color`` - color - Stroke color. * - ``border_width`` - float - Stroke width in points.