simetri.settings.settings

Settings and default values for the Simetri library. Do not modify these values here. If you are going to share your code with others, you should set these values in your code.

   1"""Settings and default values for the Simetri library.
   2Do not modify these values here.
   3If you are going to share your code with others, you should set these values in your code.
   4"""
   5
   6__all__ = ["defaults", "set_defaults", "tikz_defaults", "set_tikz_defaults"]
   7
   8import sys
   9from collections import defaultdict
  10from math import pi
  11
  12import numpy as np
  13
  14from ..graphics.all_enums import FontFamily
  15
  16VOID = 'VOID'
  17
  18# This is the alpha testing stage for the Simetri library.
  19# These default values may change in the future.
  20
  21
  22
  23class _Defaults:
  24    """A singleton class that behaves like a dictionary.
  25
  26    It is used to store default values for the Simetri library.
  27    It should not be modified directly.
  28    """
  29
  30    _instance = None
  31
  32    def __init__(self):
  33        """Initializes the _Defaults singleton instance."""
  34        if _Defaults._instance is not None:
  35            raise Exception("This class is a singleton!")
  36        self.defaults = {}
  37        self.log = set()
  38
  39    def __getitem__(self, key):
  40        """Gets the value associated with the key.
  41
  42        Args:
  43            key: The key to look up.
  44
  45        Returns:
  46            The value associated with the key.
  47        """
  48        value = self.defaults[key]
  49        str_value = str(value)
  50        self.log.add((key, str_value))
  51        return value
  52
  53    def __setitem__(self, key, value):
  54        """Sets the value for the given key.
  55
  56        Args:
  57            key: The key to set.
  58            value: The value to associate with the key.
  59        """
  60        self.defaults[key] = value
  61
  62    def get(self, key, default=None):
  63        """Gets the value of a key. If the key does not exist, return the default value.
  64
  65        Args:
  66            key: The key to look up.
  67            default: The default value to return if the key does not exist.
  68
  69        Returns:
  70            The value associated with the key, or the default value.
  71        """
  72        if key in self.defaults:
  73            res = self.defaults[key]
  74        else:
  75            res = default
  76
  77        return res
  78
  79    def keys(self):
  80        """Returns the keys of the dictionary.
  81
  82        Returns:
  83            A view object that displays a list of all the keys.
  84        """
  85        return self.defaults.keys()
  86
  87    def items(self):
  88        """Returns the items of the dictionary.
  89
  90        Returns:
  91            A view object that displays a list of dictionary's key-value tuple pairs.
  92        """
  93        return self.defaults.items()
  94
  95    def values(self):
  96        """Returns the values of the dictionary.
  97
  98        Returns:
  99            A view object that displays a list of all the values.
 100        """
 101        return self.defaults.values()
 102
 103
 104defaults = _Defaults()
 105default_types = {}
 106defaults_help = {}
 107
 108def set_defaults():
 109    """Sets the default values for the Simetri library."""
 110    from ..graphics.all_enums import (
 111        Anchor,
 112        BackStyle,
 113        BlendMode,
 114        DocumentClass,
 115        FillMode,
 116        FrameShape,
 117        LineCap,
 118        LineJoin,
 119        MarkerType,
 120        PageMargins,
 121        PageNumberPosition,
 122        PageNumbering,
 123        PageSize,
 124        Compiler,
 125        PageOrientation,
 126        PatternType,
 127        ShadeType,
 128        Align,
 129    )
 130    from ..canvas.style_map import (
 131        ShapeStyle,
 132        TagStyle,
 133        LineStyle,
 134        FillStyle,
 135        FrameStyle,
 136        MarkerStyle,
 137    )
 138
 139    from ..colors.palettes import seq_MATTER_256
 140    from ..colors import colors
 141
 142    global defaults
 143    global default_types
 144    global defaults_help
 145
 146    # tol, rtol, and rtol are used for comparing floats
 147    # These are used in numpy.isclose and numpy.allclose
 148    # If you are not careful you may get unexpected results
 149    # They do not mean that the difference in the compared numbers are within these values
 150    # numpy isclose returns np.absolute(a - b) <= (atol + rtol * np.absolute(b))
 151    # if you set atol=.1 and rtol=.1, it means that the difference between a and b
 152    # is within .1 and .1 * b
 153    # np.isclose(721, 800, rtol=.1) returns True
 154    # np.isclose(800, 721, rtol=.1) returns False
 155    # atol makes a bigger difference when comparing values close to zero
 156    # if this surrprises you, please read the numpy documentation
 157    defaults["BB_EPSILON"] = 0.01
 158    default_types["BB_EPSILON"] = float
 159    defaults_help["BB_EPSILON"] = (
 160        "Bounding box epsilon. "
 161        "Positive float. Length in <points>. "
 162        "This is a small value used for line/point bounding boxes."
 163    )
 164    defaults["INF"] = np.inf
 165    defaults_help["INF"] = (
 166        "Infinity. Positive integer. "
 167        "Used for representing very large numbers. "
 168        "Maybe usefull for zero division or comparisons."
 169    )
 170    defaults["PRINTTEXOUTPUT"] = True  # Print output from the TeX compiler
 171    defaults["active"] = True  # active objects are drawn
 172    defaults_help["active"] = (
 173        "Boolean property for drawable objects. "
 174        "Currently only used for drawing objects. "
 175        "If False, the object is not drawn."
 176        "In the future it may be used with modifiers and transformations."
 177        "All drawable objects have this property set to True by default."
 178        "Example: shape.active = False"
 179    )
 180    defaults["all_caps"] = False  # use all caps for text
 181    defaults_help["all_caps"] = (
 182        "Boolean property for text objects. "
 183        "If True, the text is displayed in all caps."
 184    )
 185    defaults["alpha"] = 1.0  # used for transparency
 186    defaults_help["alpha"] = (
 187        "Alpha value for transparency. "
 188        "Float between 0 and 1. "
 189        "0 is fully transparent, 1 is fully opaque."
 190        "Both line opacity and fill opacity are set with this value."
 191    )
 192    defaults["allow_consec_dup_points"] = False  # use all caps for text
 193    defaults_help["allow_consec_dup_points"] = (
 194        "Boolean property for allowing consecutive duplicate points in Shape objects. "
 195        "Do not change this unless you absolutely have to. Likely to cause problems."
 196    )
 197    defaults["alpha"] = 1.0  # used for transparency
 198    defaults_help["alpha"] = (
 199
 200    )
 201    defaults["anchor"] = Anchor.CENTER  # used for text alignment
 202    defaults_help["anchor"] = (
 203        "Specifies text object location. "
 204        "Anchor.CENTER, Anchor.NORTH, Anchor.SOUTH, "
 205        "Anchor.EAST, Anchor.WEST, Anchor.NORTHEAST, "
 206        "Anchor.NORTHWEST, Anchor.SOUTHEAST, Anchor.SOUTHWEST"
 207        "Example: text.anchor = Anchor.NORTH"
 208    )
 209    defaults["angle_atol"] = 0.001  # used for comparing angles
 210    defaults_help["angle_atol"] = (
 211        "Angle absolute tolerance. "
 212        "Positive float. Angle in radians. "
 213        "Used for comparing angles."
 214    )
 215    defaults["angle_rtol"] = 0.001  # used for comparing angles
 216    defaults_help["angle_rtol"] = (
 217        "Angle relative tolerance. "
 218        "Positive float. Angle in radians. "
 219        "Used for comparing angles."
 220    )
 221    defaults["angle_tol"] = (
 222        0.001  # used for comparing angles in radians .001 rad = .057 degrees
 223    )
 224    defaults_help["angle_tol"] = (
 225        "Angle tolerance. "
 226        "Positive float. Angle in radians. "
 227        "Used for comparing angles."
 228    )
 229    defaults["area_atol"] = 0.001  # used for comparing areas
 230    defaults_help["area_atol"] = (
 231        "Area absolute tolerance. "
 232        "Positive float. Length in <points>. "
 233        "Used for comparing areas."
 234    )
 235    defaults["area_rtol"] = 0.001  # used for comparing areas
 236    defaults_help["area_rtol"] = (
 237        "Area relative tolerance. "
 238        "Positive float. Length in <points>. "
 239        "Used for comparing areas."
 240    )
 241    defaults["area_threshold"] = 1  # used for grouping fragments in a lace object
 242    defaults_help["area_threshold"] = (
 243        "Area threshold. "
 244        "Positive float. Length in <points>. "
 245        "Used for grouping fragments in a lace object."
 246    )
 247    defaults["arrow_head_length"] = 8
 248    defaults_help["arrow_head_length"] = (
 249        "Arrow head length. "
 250        "Positive float. Length in <points>. "
 251        "Length of the arrow head."
 252    )
 253    defaults["arrow_head_width"] = 3
 254    defaults_help["arrow_head_width"] = (
 255        "Arrow head width. "
 256        "Positive float. Length in <points>. "
 257        "Width of the arrow head."
 258    )
 259    defaults["atol"] = 0.05  # used for comparing floats
 260    defaults_help["atol"] = (
 261        "Absolute tolerance. "
 262        "Positive float. Length in <points>. "
 263        "1in = 72pt."
 264        "Used for comparing floats."
 265    )
 266
 267    defaults["back_color"] = colors.white  # canvas background color
 268    defaults_help["back_color"] = (
 269        "Background color. Color object. Background color for the canvas."
 270    )
 271    defaults["back_style"] = (
 272        BackStyle.COLOR
 273    )  # EMPTY, COLOR, SHADING, PATTERN, GRIDLINES
 274    defaults_help["back_style"] = (
 275        "Background style for the Canvas. "
 276        "BackStyle.EMPTY, BackStyle.COLOR, BackStyle.SHADING, "
 277        "BackStyle.PATTERN, BackStyle.GRIDLINES."
 278    )
 279    defaults["begin_doc"] = "\\begin{document}\n"
 280    defaults_help["begin_doc"] = "Used with the generated .tex file."
 281    defaults["begin_tikz"] = "\\begin{tikzpicture}[x=1pt, y=1pt, scale=1]\n"
 282    defaults_help["begin_tikz"] = "Used with the generated .tex file."
 283    defaults["blend_mode"] = BlendMode.NORMAL
 284    defaults_help["blend_mode"] = (
 285        "Blend mode. This can be set with the Canvas or Batch objects. "
 286        "BlendMode.NORMAL, BlendMode.MULTIPLY, BlendMode.SCREEN, "
 287        "BlendMode.OVERLAY, BlendMode.DARKEN, BlendMode.LIGHTEN, "
 288        "BlendMode.COLOR_DODGE, BlendMode.COLOR_BURN, "
 289        "BlendMode.HARD_LIGHT, "
 290        "BlendMode.SOFT_LIGHT, BlendMode.DIFFERENCE, "
 291        "BlendMode.EXCLUSION, "
 292        "BlendMode.HUE, BlendMode.SATURATION, BlendMode.COLOR, "
 293        "BlendMode.LUMINOSITY."
 294    )
 295    defaults["bold"] = False  # use bold font if True
 296    defaults_help["bold"] = (
 297        "Boolean property for text objects. If True, the text is displayed in bold."
 298    )
 299    defaults["border"] = 25  # border around canvas
 300    defaults_help["border"] = (
 301        "Border around the canvas. "
 302        "Positive float. Length in <points>. "
 303        "Border size for the canvas."
 304    )
 305    defaults["border_size"] = 4  # border size for the canvas
 306    defaults_help["border_size"] = (
 307        "Border size for the canvas. "
 308        "Positive float. Length in <points>. "
 309        "Border size for the canvas."
 310    )
 311    defaults["canvas_back_style"] = BackStyle.EMPTY
 312    defaults_help["canvas_back_style"] = (
 313        "Canvas background style. "
 314        "BackStyle.EMPTY, BackStyle.COLOR, BackStyle.SHADING, "
 315        "BackStyle.PATTERN, BackStyle.GRIDLINES."
 316    )
 317    defaults["canvas_frame_color"] = colors.black # frame color for the canvas
 318    defaults_help["canvas_frame_color"] = (
 319        "Frame color for the canvas. Color object."
 320    )
 321    defaults["canvas_frame_margin"] = 15  # margin around the canvas frame
 322    defaults_help["canvas_frame_margin"] = (
 323        "Margin around the canvas frame. "
 324    )
 325    defaults["canvas_frame_shadow_width"] = 5  # shadow width for the canvas frame
 326    defaults_help["canvas_frame_shadow_width"] = (
 327        "Shadow width for the canvas frame. "
 328    )
 329    defaults["canvas_frame_width"] = 45  # frame width for the canvas
 330    defaults_help["canvas_frame_width"] = (
 331        "Frame width for the canvas. Positive float. Length in <points>."
 332    )
 333    defaults["canvas_size"] = None  # (width, height) canvas size in points
 334    defaults_help["canvas_size"] = (
 335        "Canvas size. "
 336        "Tuple of two positive floats. Length in <points>. "
 337        "Canvas size in points."
 338    )
 339    defaults["circle_radius"] = 20
 340    defaults_help["circle_radius"] = (
 341        "Circle radius. Positive float. Length in <points>. Radius of the circle."
 342    )
 343    defaults["clip"] = False  # clip the outside of the clip_path to the canvas
 344    defaults_help["clip"] = (
 345        "Boolean property for the canvas and Batch objects. "
 346        "If true, clip the outside of the canvas.mask to the canvas"
 347        "or Batch elemetns."
 348    )
 349    defaults["color"] = colors.black
 350    defaults_help["color"] = "Color. Color object."
 351    defaults["shade_color_wheel"] = False
 352    defaults_help["shade_color_wheel"] = (
 353        "Boolean property for the shape objects. "
 354        "If True, use the color wheel for shading."
 355    )
 356    defaults["shade_color_wheel_black"] = False
 357    defaults_help["shade_color_wheel_black"] = (
 358        "Boolean property for the shape object. "
 359        "If True, use the color wheel for shading."
 360    )
 361    defaults["shade_color_wheel_white"] = False
 362    defaults_help["shade_color_wheel_white"] = (
 363        "Boolean property for the shape object. "
 364        "If True, use the color wheel for shading."
 365    )
 366    defaults["CS_origin_size"] = (
 367        2  # size of the circle at the origin of the coordinate system
 368    )
 369    defaults_help["CS_origin_size"] = (
 370        "Size of the circle at the origin of the coordinate system. "
 371        "Positive float. Length in <points>."
 372    )
 373    defaults["CS_origin_color"] = colors.gray
 374    defaults_help["CS_origin_color"] = (
 375        "Color of the circle at the origin of the coordinate "
 376        "system. "
 377        "Color object."
 378    )
 379    defaults["CS_size"] = (
 380        25  # size of the coordinate system axes. Used with canvas.draw_CS
 381    )
 382    defaults_help["CS_size"] = (
 383        "Size of the coordinate system axes. Positive float. Length in <points>."
 384    )
 385    defaults["CS_line_width"] = 2
 386    defaults_help["CS_line_width"] = (
 387        "Line width of the coordinate system axes. "
 388        "Positive float. Length in <points>."
 389    )
 390    defaults["CS_x_color"] = colors.red
 391    defaults_help["CS_x_color"] = (
 392        "Color of the x-axis in the coordinate system. Color object."
 393    )
 394    defaults["CS_y_color"] = colors.green
 395    defaults_help["CS_y_color"] = (
 396        "Color of the y-axis in the coordinate system. Color object."
 397    )
 398    defaults["debug_mode"] = False
 399    defaults_help["debug_mode"] = (
 400        "Boolean property for enabling debug mode. "
 401        "If True, debug information is printed."
 402    )
 403
 404    defaults["dist_tol"] = (
 405        0.05  # used for comparing two points to check if they are the
 406    )
 407    # same if their distance is less than or equal to dist_tol,
 408    # they are considered the same
 409    defaults_help["dist_tol"] = (
 410        "Distance tolerance for comparing two points. "
 411        "Positive float. Length in <points>."
 412    )
 413
 414    defaults["document_class"] = DocumentClass.STANDALONE  # STANDALONE, ARTICLE, BOOK,
 415    # REPORT, LETTER, SLIDES, BEAMER,
 416    # MINIMAL
 417    defaults_help["document_class"] = (
 418        "Document class for the LaTeX document. DocumentClass enum."
 419    )
 420    defaults["document_options"] = ["12pt", "border=25pt"]
 421    defaults_help["document_options"] = (
 422        "Options for the LaTeX document class. List of strings."
 423    )
 424    defaults["dot_color"] = colors.black  # for Dot objects
 425    defaults_help["dot_color"] = "Color for Dot objects. Color object."
 426    defaults["double_lines"] = False
 427    defaults_help["double_lines"] = (
 428        "Boolean property for using double lines. If True, double lines are used."
 429    )
 430    defaults["double_distance"] = 2
 431    defaults_help["double_distance"] = (
 432        "Distance between double lines. Positive float. Length in <points>."
 433    )
 434    defaults["draw_fillets"] = False  # draw rounded corners for shapes
 435    defaults_help["draw_fillets"] = (
 436        "Boolean property for drawing rounded corners for shapes. "
 437        "If True, rounded corners are drawn."
 438    )
 439    defaults["draw_frame"] = False  # draw a frame around the Tag objects
 440    defaults_help["draw_frame"] = (
 441        "Boolean property for drawing a frame around Tag objects. "
 442        "If True, a frame is drawn."
 443    )
 444    defaults["draw_markers"] = False  # draw markers at each vertex of a Shape object
 445    defaults_help["draw_markers"] = (
 446        "Boolean property for drawing markers at each vertex "
 447        "of a Shape object. "
 448        "If True, markers are drawn."
 449    )
 450
 451    defaults["ellipse_width_height"] = (40, 20)  # width and height of the ellipse
 452    defaults_help["ellipse_width_height"] = (
 453        "Width and height of the ellipse. "
 454        "Tuple of two positive floats. Length in <points>."
 455    )
 456    defaults["end_doc"] = "\\end{document}\n"
 457    defaults_help["end_doc"] = "End document string for the generated .tex file."
 458    defaults["end_tikz"] = "\\end{tikzpicture}\n"
 459    defaults_help["end_tikz"] = "End TikZ picture string for the generated .tex file."
 460    defaults["even_odd"] = True  # use even-odd rule for filling shapes
 461    defaults_help["even_odd"] = (
 462        "Boolean property for using the even-odd rule for filling shapes. "
 463        "If True, the even-odd rule is used."
 464    )
 465    defaults["ext_length2"] = 25  # dimension extra extension length
 466    defaults_help["ext_length2"] = (
 467        "Dimension extra extension length. Positive float. Length in <points>."
 468    )
 469    defaults["fill"] = True
 470    defaults_help["fill"] = (
 471        "Boolean property for filling shapes. If True, shapes are filled."
 472    )
 473    defaults["fill_alpha"] = 1
 474    defaults_help["fill_alpha"] = (
 475        "Alpha value for fill transparency. Float between 0 and 1."
 476    )
 477    defaults["fill_color"] = colors.black
 478    defaults_help["fill_color"] = "Fill color for shapes. Color object."
 479    defaults["fill_mode"] = FillMode.EVENODD
 480    defaults_help["fill_mode"] = "Fill mode for shapes. FillMode enum."
 481    defaults["fill_blend_mode"] = BlendMode.NORMAL
 482    defaults_help["fill_blend_mode"] = "Blend mode for fill. BlendMode enum."
 483    defaults["fillet_radius"] = None
 484    defaults_help["fillet_radius"] = (
 485        "Radius for rounded corners (fillets). Positive float. Length in <points>."
 486    )
 487    defaults["font_blend_mode"] = BlendMode.NORMAL
 488    defaults_help["font_blend_mode"] = "Blend mode for font. BlendMode enum."
 489    defaults["font_alpha"] = 1
 490    defaults_help["font_alpha"] = (
 491        "Alpha value for font transparency. Float between 0 and 1."
 492    )
 493    defaults["font_color"] = colors.black  # use the default font color in LaTeX engine
 494    defaults_help["font_color"] = (
 495        "Font color. Color object. Font color for the text objects."
 496    )
 497    defaults["font_family"] = (
 498        FontFamily.SERIF  # use the default font family in LaTeX engine
 499    )
 500    defaults_help["font_family"] = (
 501        "Font family. String. Font family for the text objects."
 502    )
 503    defaults["font_size"] = 12
 504    defaults_help["font_size"] = (
 505        "Font size. "
 506        "Positive float. Length in <points>. "
 507        "Font size for the text objects."
 508    )
 509    defaults["font_style"] = ""
 510    defaults_help["font_style"] = "Font style. String. Font style for the text objects."
 511    defaults["frame_active"] = True
 512    defaults_help["frame_active"] = (
 513        "Boolean property for active frames. If True, frames are drawn."
 514    )
 515    defaults["frame_alpha"] = 1
 516    defaults_help["frame_alpha"] = (
 517        "Alpha value for frame transparency. Float between 0 and 1."
 518    )
 519    defaults["frame_back_alpha"] = 1
 520    defaults_help["frame_back_alpha"] = (
 521        "Alpha value for frame background transparency. Float between 0 and 1."
 522    )
 523    defaults["frame_back_color"] = colors.white
 524    defaults_help["frame_back_color"] = "Frame background color. Color object."
 525    defaults["frame_blend_mode"] = BlendMode.NORMAL
 526    defaults_help["frame_blend_mode"] = "Blend mode for frame. BlendMode enum."
 527    defaults["frame_color"] = colors.black
 528    defaults_help["frame_color"] = "Frame color. Color object."
 529    defaults["frame_draw_fillets"] = False
 530    defaults_help["frame_draw_fillets"] = (
 531        "Boolean property for drawing fillets for frames. "
 532        "If True, fillets are drawn."
 533    )
 534    defaults["frame_fill"] = True
 535    defaults_help["frame_fill"] = (
 536        "Boolean property for filling frames. If True, frames are filled."
 537    )
 538    defaults["frame_fillet_radius"] = 3
 539    defaults_help["frame_fillet_radius"] = (
 540        "Fillet radius for frames. Positive float. Length in <points>."
 541    )
 542    defaults["frame_gradient"] = None
 543    defaults_help["frame_gradient"] = "Frame gradient. Gradient object."
 544    defaults["frame_inner_sep"] = 3
 545    defaults_help["frame_inner_sep"] = (
 546        "Frame inner separation. Positive float. Length in <points>."
 547    )
 548    defaults["frame_inner_xsep"] = None
 549    defaults_help["frame_inner_xsep"] = (
 550        "Frame inner x separation. Positive float. Length in <points>."
 551    )
 552    defaults["frame_inner_ysep"] = None
 553    defaults_help["frame_inner_ysep"] = (
 554        "Frame inner y separation. Positive float. Length in <points>."
 555    )
 556    defaults["frame_outer_sep"] = 0
 557    defaults_help["frame_outer_sep"] = (
 558        "Frame outer separation. Positive float. Length in <points>."
 559    )
 560    defaults["frame_line_cap"] = LineCap.BUTT
 561    defaults_help["frame_line_cap"] = "Line cap for frames. LineCap enum."
 562    defaults["frame_line_dash_array"] = []
 563    defaults_help["frame_line_dash_array"] = (
 564        "Line dash array for frames. List of floats."
 565    )
 566    defaults["frame_line_join"] = LineJoin.MITER
 567    defaults_help["frame_line_join"] = "Line join for frames. LineJoin enum."
 568    defaults["frame_line_width"] = 1
 569    defaults_help["frame_line_width"] = (
 570        "Line width for frames. Positive float. Length in <points>."
 571    )
 572    defaults["frame_min_height"] = 50
 573    defaults_help["frame_min_height"] = (
 574        "Minimum height for frames. Positive float. Length in <points>."
 575    )
 576    defaults["frame_min_width"] = 50
 577    defaults_help["frame_min_width"] = (
 578        "Minimum width for frames. Positive float. Length in <points>."
 579    )
 580    defaults["frame_min_size"] = 50
 581    defaults_help["frame_min_size"] = (
 582        "Minimum size for frames. Positive float. Length in <points>."
 583    )
 584    defaults["frame_pattern"] = None
 585    defaults_help["frame_pattern"] = "Frame pattern. Pattern object."
 586    defaults["frame_rounded_corners"] = False
 587    defaults_help["frame_rounded_corners"] = (
 588        "Boolean property for rounded corners for frames. "
 589        "If True, rounded corners are drawn."
 590    )
 591    defaults["frame_shape"] = FrameShape.RECTANGLE
 592    defaults_help["frame_shape"] = "Frame shape. FrameShape enum."
 593    defaults["frame_smooth"] = True
 594    defaults_help["frame_smooth"] = (
 595        "Boolean property for smooth frames. If True, frames are smooth."
 596    )
 597    defaults["frame_stroke"] = True
 598    defaults_help["frame_stroke"] = (
 599        "Boolean property for stroke frames. If True, frames are stroked."
 600    )
 601    defaults["frame_visible"] = True
 602    defaults_help["frame_visible"] = (
 603        "Boolean property for visible frames. If True, frames are visible."
 604    )
 605    defaults["gap"] = 5  # dimension extension gap
 606    defaults_help["gap"] = (
 607        "Dimension extension gap. Positive float. Length in <points>."
 608    )
 609    defaults["graph_palette"] = seq_MATTER_256  # this needs to be a 256 color palette
 610    defaults_help["graph_palette"] = "Graph palette. List of colors."
 611    defaults["grid_back_color"] = colors.white
 612    defaults_help["grid_back_color"] = "Grid background color. Color object."
 613    defaults["grid_line_color"] = colors.gray
 614    defaults_help["grid_line_color"] = "Grid line color. Color object."
 615    defaults["grid_line_width"] = 0.5
 616    defaults_help["grid_line_width"] = (
 617        "Grid line width. Positive float. Length in <points>."
 618    )
 619    defaults["grid_alpha"] = 0.5
 620    defaults_help["grid_alpha"] = "Grid alpha value. Float between 0 and 1."
 621    defaults["grid_line_dash_array"] = [2, 2]
 622    defaults_help["grid_line_dash_array"] = "Grid line dash array. List of floats."
 623    defaults["indices_font_family"] = "ttfamily"  # ttfamily, rmfamily, sffamily
 624    defaults_help["indices_font_family"] = "Indices font family. String."
 625    defaults["indices_font_size"] = "tiny"  # tiny, scriptsize, footnotesize, small,
 626    # normalsize, large, Large, LARGE, huge, Huge
 627    defaults_help["indices_font_size"] = "Indices font size. String."
 628    defaults["italic"] = False
 629    defaults_help["italic"] = (
 630        "Boolean property for italic font. If True, the font is displayed in italic."
 631    )
 632    defaults["job_dir"] = None
 633    defaults_help["job_dir"] = "Job directory. String. Directory for the job files."
 634    defaults["keep_aux_files"] = False
 635    defaults_help["keep_aux_files"] = (
 636        "Boolean property for keeping auxiliary files. "
 637        "If True, auxiliary files are kept."
 638    )
 639    defaults["keep_tex_files"] = False
 640    defaults_help["keep_tex_files"] = (
 641        "Boolean property for keeping TeX files. If True, TeX files are kept."
 642    )
 643    defaults["keep_log_files"] = False
 644    defaults_help["keep_log_files"] = (
 645        "Boolean property for keeping log files. If True, log files are kept."
 646    )
 647    defaults["lace_offset"] = 4
 648    defaults_help["lace_offset"] = "Lace offset. Positive float. Length in <points>."
 649    defaults["latex_compiler"] = Compiler.XELATEX  # PDFLATEX, XELATEX, LUALATEX
 650    defaults_help["latex_compiler"] = "LaTeX compiler. Compiler enum."
 651    defaults["line_alpha"] = 1
 652    defaults_help["line_alpha"] = (
 653        "Alpha value for line transparency. Float between 0 and 1."
 654    )
 655    defaults["line_blend_mode"] = BlendMode.NORMAL
 656    defaults_help["line_blend_mode"] = "Blend mode for line. BlendMode enum."
 657    defaults["line_cap"] = LineCap.BUTT
 658    defaults_help["line_cap"] = "Line cap for line. LineCap enum."
 659    defaults["line_color"] = colors.black
 660    defaults_help["line_color"] = "Line color. Color object."
 661    defaults["line_dash_array"] = None
 662    defaults_help["line_dash_array"] = "Line dash array. List of floats."
 663    defaults["line_dash_phase"] = 0
 664    defaults_help["line_dash_phase"] = (
 665        "Line dash phase. Positive float. Length in <points>."
 666    )
 667    defaults["line_join"] = LineJoin.MITER
 668    defaults_help["line_join"] = "Line join for line. LineJoin enum."
 669    defaults["line_miter_limit"] = 10
 670    defaults_help["line_miter_limit"] = "Line miter limit. Positive float."
 671    defaults["line_width"] = 1
 672    defaults_help["line_width"] = "Line width. Positive float. Length in <points>."
 673    defaults["lualatex_run_options"] = None
 674    defaults_help["lualatex_run_options"] = "LuaLaTeX run options. String."
 675    defaults["main_font"] = "Times New Roman"
 676    defaults_help["main_font"] = "Main font. String."
 677    defaults["margin"] = 1
 678    defaults_help["margin"] = "Margin. Positive float. Length in <points>."
 679    defaults["margin_bottom"] = 1
 680    defaults_help["margin_bottom"] = (
 681        "Bottom margin. Positive float. Length in <points>."
 682    )
 683    defaults["margin_left"] = 1
 684    defaults_help["margin_left"] = "Left margin. Positive float. Length in <points>."
 685    defaults["margin_right"] = 1
 686    defaults_help["margin_right"] = "Right margin. Positive float. Length in <points>."
 687    defaults["margin_top"] = 1  # to do! change these to point units
 688    defaults_help["margin_top"] = "Top margin. Positive float. Length in <points>."
 689    defaults["marker"] = None
 690    defaults_help["marker"] = "Marker. Marker object."
 691    defaults["marker_color"] = colors.black
 692    defaults_help["marker_color"] = "Marker color. Color object."
 693    defaults["marker_line_style"] = "solid"
 694    defaults_help["marker_line_style"] = "Marker line style. String."
 695    defaults["marker_line_width"] = 1
 696    defaults_help["marker_line_width"] = (
 697        "Marker line width. Positive float. Length in <points>."
 698    )
 699    defaults["marker_palette"] = seq_MATTER_256  # this needs to be a 256 color
 700    # palette
 701    defaults_help["marker_palette"] = "Marker palette. List of colors."
 702    defaults["marker_radius"] = 3  # Used for MarkerType.CIRCLE, MarkerType.STAR
 703    defaults_help["marker_radius"] = (
 704        "Marker radius. Positive float. Length in <points>."
 705    )
 706    defaults["marker_size"] = 3  # To do: find out what the default is
 707    defaults_help["marker_size"] = "Marker size. Positive float. Length in <points>."
 708    defaults["marker_type"] = MarkerType.FCIRCLE
 709    defaults_help["marker_type"] = "Marker type. MarkerType enum."
 710    defaults["markers_only"] = False
 711    defaults_help["markers_only"] = (
 712        "Boolean property for drawing markers only. If True, only markers are drawn."
 713    )
 714    defaults["mask"] = None
 715    defaults_help["mask"] = "Mask. Mask object."
 716    defaults["merge"] = True  # merge transformations with reps > 0
 717    defaults_help["merge"] = (
 718        "Boolean property for merging transformations. "
 719        "If True, transformations with reps > 0 are merged."
 720    )
 721    defaults["merge_tol"] = 0.01  # if the distance between two nodes is less
 722    # than this value,
 723    defaults_help["merge_tol"] = "Merge tolerance. Positive float. Length in <points>."
 724    # defaults['min_height'] = 10
 725    # defaults['min_width'] = 20
 726    # defaults['min_size'] = 50
 727    defaults["mono_font"] = "Courier New"
 728    defaults_help["mono_font"] = "Monospace font. String."
 729    defaults['n_arc_points'] = 40  # number of proportional points for arcs
 730    defaults_help['n_arc_points'] = 'Number of points for arcs. Positive integer.'
 731    defaults['n_circle_points'] = 30  # number of points for circles
 732    defaults_help['n_circle_points'] = 'Number of points for circles. Positive integer.'
 733    defaults['n_bezier_points'] = 40  # number of points for Bezier curves
 734    defaults_help['n_bezier_points'] = 'Number of points for Bezier curves. Positive integer.'
 735    defaults['n_ellipse_points'] = 40  # number of points for ellipses
 736    defaults_help['n_ellipse_points'] = 'Number of points for ellipses. Positive integer.'
 737    defaults['n_hobby_points'] = 40  # number of points for Hobby curves
 738    defaults_help['n_hobby_points'] = 'Number of points for Hobby curves. Positive integer.'
 739    defaults['n_q_bezier_points'] = 30  # number of points for quadratic Bezier curves
 740    defaults_help['n_q_bezier_points'] = 'Number of points for quadratic Bezier curves. Positive integer.'
 741    defaults["n_round"] = 2  # used for rounding floats
 742    defaults_help["n_round"] = (
 743        "Number of decimal places to round floats. Positive integer."
 744    )
 745    defaults["old_style_nums"] = False
 746    defaults_help["old_style_nums"] = (
 747        "Boolean property for old style numbers. "
 748        "If True, old style numbers are used."
 749    )
 750    defaults["orientation"] = PageOrientation.PORTRAIT  # PORTRAIT, LANDSCAPE
 751    defaults_help["orientation"] = "Page orientation. PageOrientation enum."
 752    defaults["output_dir"] = None  # output directory for TeX files if None, use
 753    # the current directory
 754    defaults_help["output_dir"] = "Output directory for TeX files. String."
 755    defaults["overline"] = False
 756    defaults_help["overline"] = (
 757        "Boolean property for overline. If True, overline is used."
 758    )
 759    defaults["overwrite_files"] = False
 760    defaults_help["overwrite_files"] = (
 761        "Boolean property for overwriting files. If True, files are overwritten."
 762    )
 763    defaults["packages"] = ["tikz", "pgf"]
 764    defaults_help["packages"] = "Packages. List of strings."
 765    defaults["page_grid_back_color"] = colors.white
 766    defaults_help["page_grid_back_color"] = "Page grid background color. Color object."
 767    defaults["page_grid_line_color"] = colors.gray
 768    defaults_help["page_grid_line_color"] = "Page grid line color. Color object."
 769    defaults["page_grid_line_dash_array"] = [2, 2]
 770    defaults_help["page_grid_line_dash_array"] = (
 771        "Page grid line dash array. List of floats."
 772    )
 773    defaults["page_grid_line_width"] = 0.5
 774    defaults_help["page_grid_line_width"] = (
 775        "Page grid line width. Positive float. Length in <points>."
 776    )
 777    defaults["page_grid_spacing"] = 18
 778    defaults_help["page_grid_spacing"] = (
 779        "Page grid spacing. Positive float. Length in <points>."
 780    )
 781    defaults["page_grid_x_shift"] = 0
 782    defaults_help["page_grid_x_shift"] = (
 783        "Page grid x shift. Positive float. Length in <points>."
 784    )
 785    defaults["page_grid_y_shift"] = 0
 786    defaults_help["page_grid_y_shift"] = (
 787        "Page grid y shift. Positive float. Length in <points>."
 788    )
 789    defaults["page_margins"] = PageMargins.CUSTOM
 790    defaults_help["page_margins"] = "Page margins. PageMargins enum."
 791    defaults["page_number_position"] = PageNumberPosition.BOTTOM_CENTER
 792    defaults_help["page_number_position"] = (
 793        "Page number position. PageNumberPosition enum."
 794    )
 795    defaults["page_numbering"] = PageNumbering.NONE
 796    defaults_help["page_numbering"] = "Page numbering. PageNumbering enum."
 797    defaults["page_size"] = PageSize.A4  #  A0, A1, A2, A3, A4, A5, A6, B0, B1, B2,
 798    # B3, B4, B5, B6, LETTER, LEGAL,
 799    # EXECUTIVE, 11X17
 800    defaults_help["page_size"] = "Page size. PageSize enum."
 801    defaults["pattern_style"] = None
 802    defaults_help["pattern_style"] = "Pattern style. PatternStyle object."
 803    defaults["pattern_type"] = PatternType.HORIZONTAL_LINES  #  DOTS, HATCH, STARS
 804    defaults_help["pattern_type"] = "Pattern type. PatternType enum."
 805    defaults["pattern_color"] = colors.black
 806    defaults_help["pattern_color"] = "Pattern color. Color object."
 807    defaults["pattern_distance"] = 3  # distance between items
 808    defaults_help["pattern_distance"] = (
 809        "Pattern distance. Positive float. Length in <points>."
 810    )
 811    defaults["pattern_angle"] = 0  # angle of the pattern in radians
 812    defaults_help["pattern_angle"] = "Pattern angle. Float. Angle in radians."
 813    defaults["pattern_x_shift"] = 0  # shift in the x direction
 814    defaults_help["pattern_x_shift"] = (
 815        "Pattern x shift. Positive float. Length in <points>."
 816    )
 817    defaults["pattern_y_shift"] = 0  # shift in the y direction
 818    defaults_help["pattern_y_shift"] = (
 819        "Pattern y shift. Positive float. Length in <points>."
 820    )
 821    defaults["pattern_line_width"] = 0  # line width for LINES and HATCH
 822    defaults_help["pattern_line_width"] = (
 823        "Pattern line width. Positive float. Length in <points>."
 824    )
 825    defaults["pattern_radius"] = 10  # radius of the circle for STARS
 826    defaults_help["pattern_radius"] = (
 827        "Pattern radius. Positive float. Length in <points>."
 828    )
 829    defaults["pattern_points"] = 5  # number of points for STAR
 830    defaults_help["pattern_points"] = "Pattern points. Positive integer."
 831    defaults["pdflatex_run_options"] = None
 832    defaults_help["pdflatex_run_options"] = "PDFLaTeX run options. String."
 833    defaults["plait_color"] = colors.bluegreen
 834    defaults_help["plait_color"] = "Plait color. Color object."
 835    defaults["preamble"] = ""
 836    defaults_help["preamble"] = "Preamble. String."
 837    defaults["radius_threshold"] = 1  # used for grouping fragments in a lace object
 838    defaults_help["radius_threshold"] = (
 839        "Radius threshold. Positive float. Length in <points>. "
 840    )
 841    defaults["random_marker_colors"] = True
 842    defaults_help["random_marker_colors"] = (
 843        "Boolean property for random marker colors. "
 844        "If True, random marker colors are used."
 845    )
 846    defaults["random_node_colors"] = True
 847    defaults_help["random_node_colors"] = (
 848        "Boolean property for random node colors. "
 849        "If True, random node colors are used."
 850    )
 851    defaults["rectangle_width_height"] = (40, 20)  # width and height of the rectangle
 852    defaults_help["rectangle_width_height"] = (
 853        "Width and height of the rectangle. "
 854        "Tuple of two positive floats. Length in <points>."
 855    )
 856    defaults["render"] = "TEX"  # Render.TEX, Render.SVG, Render.PNG use string values
 857    defaults_help["render"] = "Render. Render enum."
 858    defaults["rev_arrow_length"] = 20  # length of reverse arrow
 859    defaults_help["rev_arrow_length"] = (
 860        "Length of reverse arrow. Positive float. Length in <points>."
 861    )
 862    defaults["rtol"] = (
 863        0  # used for comparing floats. If this is 0 then only atol is used
 864    )
 865    defaults_help["rtol"] = "Relative tolerance. Positive float. Length in <points>. "
 866    defaults["sans_font"] = "Arial"
 867    defaults_help["sans_font"] = "Sans font. String."
 868    defaults["save_with_versions"] = (
 869        False  # if the file exists, save with a version number
 870    )
 871    defaults_help["save_with_versions"] = (
 872        "Boolean property for saving with versions. "
 873        "If True, files are saved with a version number."
 874    )
 875    defaults["section_color"] = colors.black
 876    defaults_help["section_color"] = "Section color. Color object."
 877    defaults["section_dash_array"] = None
 878    defaults_help["section_dash_array"] = "Section dash array. List of floats."
 879    defaults["section_line_cap"] = LineCap.BUTT.value
 880    defaults_help["section_line_cap"] = "Section line cap. LineCap enum."
 881    defaults["section_line_join"] = LineJoin.MITER.value
 882    defaults_help["section_line_join"] = "Section line join. LineJoin enum."
 883    defaults["section_width"] = 1
 884    defaults_help["section_width"] = (
 885        "Section width. Positive float. Length in <points>."
 886    )
 887    defaults["shade_axis_angle"] = (
 888        pi / 4
 889    )  # angle from the x-axis for the shading in radians
 890    defaults_help["shade_axis_angle"] = (
 891        "Axis angle for shading. Float. Angle in radians."
 892    )
 893    defaults["shade_ball_color"] = colors.black
 894    defaults_help["shade_ball_color"] = "Ball color for shading. Color object."
 895    defaults["shade_bottom_color"] = colors.white
 896    defaults_help["shade_bottom_color"] = "Bottom color for shading. Color object."
 897    defaults["shade_inner_color"] = colors.white
 898    defaults_help["shade_inner_color"] = "Inner color for shading. Color object."
 899    defaults["shade_middle_color"] = colors.white
 900    defaults_help["shade_middle_color"] = "Middle color for shading. Color object."
 901    defaults["shade_outer_color"] = colors.white
 902    defaults_help["shade_outer_color"] = "Outer color for shading. Color object."
 903    defaults["shade_left_color"] = colors.black
 904    defaults_help["shade_left_color"] = "Left color for shading. Color object."
 905    defaults["shade_lower_left_color"] = colors.black
 906    defaults_help["shade_lower_left_color"] = (
 907        "Lower left color for shading. Color object."
 908    )
 909    defaults["shade_lower_right_color"] = colors.white
 910    defaults_help["shade_lower_right_color"] = (
 911        "Lower right color for shading. Color object."
 912    )
 913    defaults["shade_right_color"] = colors.white
 914    defaults_help["shade_right_color"] = "Right color for shading. Color object."
 915    defaults["shade_top_color"] = colors.black
 916    defaults_help["shade_top_color"] = "Top color for shading. Color object."
 917    defaults["shade_type"] = ShadeType.AXIS_TOP_BOTTOM
 918    defaults_help["shade_type"] = "Shade type. ShadeType enum."
 919    defaults["shade_upper_left_color"] = colors.black
 920    defaults_help["shade_upper_left_color"] = (
 921        "Upper left color for shading. Color object."
 922    )
 923    defaults["shade_upper_right_color"] = colors.white
 924    defaults_help["shade_upper_right_color"] = (
 925        "Upper right color for shading. Color object."
 926    )
 927    defaults["show_browser"] = True
 928    defaults_help["show_browser"] = (
 929        "Boolean property for showing the browser. If True, the browser is shown."
 930    )
 931    defaults["show_log_on_console"] = True  # show log messages on console
 932    defaults_help["show_log_on_console"] = (
 933        "Boolean property for showing LateX log messages on console. "
 934        "If True, log messages are shown on console."
 935    )
 936    defaults["slanted"] = False
 937    defaults_help["slanted"] = (
 938        "Boolean property for slanted font. "
 939        "If True, the font is displayed in slanted."
 940    )
 941    defaults["small_caps"] = False
 942    defaults_help["small_caps"] = (
 943        "Boolean property for small caps font. "
 944        "If True, the font is displayed in small caps."
 945    )
 946    defaults["smooth"] = False
 947    defaults_help["smooth"] = (
 948        "Boolean property for smooth lines. If True, lines are smooth."
 949    )
 950    defaults["strike_through"] = False
 951    defaults_help["strike_through"] = (
 952        "Boolean property for strike through. If True, strike through is used."
 953    )
 954    defaults["stroke"] = True
 955    defaults_help["stroke"] = "Boolean property for stroke. If True, stroke is used."
 956    defaults["swatch"] = seq_MATTER_256
 957    defaults_help["swatch"] = "Swatch. List of colors."
 958    defaults["tag_align"] = Align.LEFT
 959    defaults_help["tag_align"] = "Tag text alignment. Align enum."
 960    defaults["tag_alpha"] = 1
 961    defaults_help["tag_alpha"] = (
 962        "Alpha value for tag transparency. Float between 0 and 1."
 963    )
 964    defaults["tag_blend_mode"] = BlendMode.NORMAL
 965    defaults_help["tag_blend_mode"] = "Blend mode for tag. BlendMode enum."
 966    defaults["temp_dir"] = "sytem_temp_dir"
 967    defaults_help["temp_dir"] = "Temporary directory. String."
 968    defaults["text_offset"] = 5  # gap between text and dimension line
 969    defaults_help["text_offset"] = "Text offset. Positive float. Length in <points>."
 970    defaults["text_width"] = None  # width of the text box
 971    defaults_help["text_width"] = "Text width. Positive float. Length in <points>."
 972    defaults["tikz_libraries"] = [
 973        "plotmarks",
 974        "calc",
 975        "shapes.multipart",
 976        "arrows",
 977        "decorations.pathmorphing",
 978        "decorations.markings",
 979        "backgrounds",
 980        "patterns",
 981        "patterns.meta",
 982        "shapes",
 983        "shadings",
 984    ]
 985    defaults_help["tikz_libraries"] = "TikZ libraries. List of strings."
 986    defaults["tikz_nround"] = 3
 987    defaults_help["tikz_nround"] = (
 988        "Number of decimal places to round floats in TikZ. Positive integer."
 989    )
 990    defaults["tikz_scale"] = 1
 991    defaults_help["tikz_scale"] = "TikZ scale. Positive float."
 992    defaults["tol"] = 0.005  # used for comparing angles and collinearity
 993    defaults_help["tol"] = "Tolerance. Positive float. Length in <points>."
 994    defaults["underline"] = False
 995    defaults_help["underline"] = (
 996        "Boolean property for underline. If True, underline is used."
 997    )
 998    defaults["use_packages"] = ["tikz", "pgf"]
 999    defaults_help["use_packages"] = "Use packages. List of strings."
1000    defaults["validate"] = False
1001    defaults_help["validate"] = (
1002        "Boolean property for validating. If True, validation is used."
1003    )
1004    defaults["visible"] = True
1005    defaults_help["visible"] = "Boolean property for visible. If True, visible is used."
1006    defaults["xelatex_run_options"] = None
1007    defaults_help["xelatex_run_options"] = "XeLaTeX run options. String."
1008    defaults["x_marker"] = (
1009        2  # a circle with radius=2 will be drawn at each intersection
1010    )
1011    defaults_help["x_marker"] = (
1012        "Marker for intersection points. Positive float. Length in <points>."
1013    )
1014    defaults["x_visible"] = False  # do not show intersection points by default
1015    defaults_help["x_visible"] = (
1016        "Boolean property for visible intersection points. "
1017        "If True, intersection points are visible."
1018    )
1019    # styles need to be set after the defaults are set
1020    defaults["marker_style"] = MarkerStyle()
1021    defaults["line_style"] = LineStyle()
1022    defaults["fill_style"] = FillStyle()
1023    defaults["circle_style"] = ShapeStyle()
1024    defaults["edge_style"] = LineStyle()
1025    defaults["plait_style"] = ShapeStyle()
1026    defaults["section_style"] = LineStyle()
1027    defaults["shape_style"] = ShapeStyle()
1028    defaults["tag_frame_style"] = FrameStyle()
1029    defaults["tag_style"] = TagStyle()
1030
1031
1032
1033    # Populate default_types with corresponding types
1034    default_types["BB_EPSILON"] = float
1035    default_types["INF"] = float
1036    default_types["PRINTTEXOUTPUT"] = bool
1037    default_types["active"] = bool
1038    default_types["all_caps"] = bool
1039    default_types["allow_consec_dup_points"] = bool
1040    default_types["alpha"] = float
1041    default_types["anchor"] = Anchor
1042    default_types["angle_atol"] = float
1043    default_types["angle_rtol"] = float
1044    default_types["angle_tol"] = float
1045    default_types["area_atol"] = float
1046    default_types["area_rtol"] = float
1047    default_types["area_threshold"] = float
1048    default_types["arrow_head_length"] = float
1049    default_types["arrow_head_width"] = float
1050    default_types["atol"] = float
1051    default_types["back_color"] = colors.Color
1052    default_types["back_style"] = BackStyle
1053    default_types["begin_doc"] = str
1054    default_types["begin_tikz"] = str
1055    default_types["blend_mode"] = BlendMode
1056    default_types["bold"] = bool
1057    default_types["border"] = float
1058    default_types["border_size"] = float
1059    default_types["canvas_back_style"] = BackStyle
1060    default_types["canvas_frame_color"] = colors.Color
1061    default_types["canvas_frame_margin"] = float
1062    default_types["canvas_frame_shadow_width"] = float
1063    default_types["canvas_frame_width"] = float
1064    default_types["canvas_size"] = tuple
1065    default_types["circle_radius"] = float
1066    default_types["clip"] = bool
1067    default_types["color"] = colors.Color
1068    default_types["shade_color_wheel"] = bool
1069    default_types["shade_color_wheel_black"] = bool
1070    default_types["shade_color_wheel_white"] = bool
1071    default_types["CS_origin_size"] = float
1072    default_types["CS_origin_color"] = colors.Color
1073    default_types["CS_size"] = float
1074    default_types["CS_line_width"] = float
1075    default_types["CS_x_color"] = colors.Color
1076    default_types["CS_y_color"] = colors.Color
1077    default_types["debug_mode"] = bool
1078    default_types["dist_tol"] = float
1079    default_types["document_class"] = DocumentClass
1080    default_types["document_options"] = list
1081    default_types["dot_color"] = colors.Color
1082    default_types["double_lines"] = bool
1083    default_types["double_distance"] = float
1084    default_types["draw_fillets"] = bool
1085    default_types["draw_frame"] = bool
1086    default_types["draw_markers"] = bool
1087    default_types["ellipse_width_height"] = tuple
1088    default_types["end_doc"] = str
1089    default_types["end_tikz"] = str
1090    default_types["even_odd"] = bool
1091    default_types["ext_length2"] = float
1092    default_types["fill"] = bool
1093    default_types["fill_alpha"] = float
1094    default_types["fill_color"] = colors.Color
1095    default_types["fill_mode"] = FillMode
1096    default_types["fill_blend_mode"] = BlendMode
1097    default_types["fillet_radius"] = float
1098    default_types["font_blend_mode"] = BlendMode
1099    default_types["font_alpha"] = float
1100    default_types["font_color"] = colors.Color
1101    default_types["font_family"] = str
1102    default_types["font_size"] = float
1103    default_types["font_style"] = str
1104    default_types["frame_active"] = bool
1105    default_types["frame_alpha"] = float
1106    default_types["frame_back_alpha"] = float
1107    default_types["frame_back_color"] = colors.Color
1108    default_types["frame_blend_mode"] = BlendMode
1109    default_types["frame_color"] = colors.Color
1110    default_types["frame_draw_fillets"] = bool
1111    default_types["frame_fill"] = bool
1112    default_types["frame_fillet_radius"] = float
1113    default_types["frame_gradient"] = object  # Assuming gradient is a custom object
1114    default_types["frame_inner_sep"] = float
1115    default_types["frame_inner_xsep"] = float
1116    default_types["frame_inner_ysep"] = float
1117    default_types["frame_outer_sep"] = float
1118    default_types["frame_line_cap"] = LineCap
1119    default_types["frame_line_dash_array"] = list
1120    default_types["frame_line_join"] = LineJoin
1121    default_types["frame_line_width"] = float
1122    default_types["frame_min_height"] = float
1123    default_types["frame_min_width"] = float
1124    default_types["frame_min_size"] = float
1125    default_types["frame_pattern"] = object  # Assuming pattern is a custom object
1126    default_types["frame_rounded_corners"] = bool
1127    default_types["frame_shape"] = FrameShape
1128    default_types["frame_smooth"] = bool
1129    default_types["frame_stroke"] = bool
1130    default_types["frame_visible"] = bool
1131    default_types["gap"] = float
1132    default_types["graph_palette"] = list
1133    default_types["grid_back_color"] = colors.Color
1134    default_types["grid_line_color"] = colors.Color
1135    default_types["grid_line_width"] = float
1136    default_types["grid_alpha"] = float
1137    default_types["grid_line_dash_array"] = list
1138    default_types["indices_font_family"] = str
1139    default_types["indices_font_size"] = str
1140    default_types["italic"] = bool
1141    default_types["job_dir"] = str
1142    default_types["keep_aux_files"] = bool
1143    default_types["keep_tex_files"] = bool
1144    default_types["keep_log_files"] = bool
1145    default_types["lace_offset"] = float
1146    default_types["latex_compiler"] = Compiler
1147    default_types["line_alpha"] = float
1148    default_types["line_blend_mode"] = BlendMode
1149    default_types["line_cap"] = LineCap
1150    default_types["line_color"] = colors.Color
1151    default_types["line_dash_array"] = list
1152    default_types["line_dash_phase"] = float
1153    default_types["line_join"] = LineJoin
1154    default_types["line_miter_limit"] = float
1155    default_types["line_width"] = float
1156    default_types["lualatex_run_options"] = str
1157    default_types["main_font"] = str
1158    default_types["margin"] = float
1159    default_types["margin_bottom"] = float
1160    default_types["margin_left"] = float
1161    default_types["margin_right"] = float
1162    default_types["margin_top"] = float
1163    default_types["marker"] = object  # Assuming marker is a custom object
1164    default_types["marker_color"] = colors.Color
1165    default_types["marker_line_style"] = str
1166    default_types["marker_line_width"] = float
1167    default_types["marker_palette"] = list
1168    default_types["marker_radius"] = float
1169    default_types["marker_size"] = float
1170    default_types["marker_type"] = MarkerType
1171    default_types["markers_only"] = bool
1172    default_types["mask"] = object  # Assuming mask is a custom object
1173    default_types["merge"] = bool
1174    default_types["merge_tol"] = float
1175    default_types["mono_font"] = str
1176    default_types["n_arc_points"] = int
1177    default_types["n_circle_points"] = int
1178    default_types["n_bezier_points"] = int
1179    default_types["n_ellipse_points"] = int
1180    default_types["n_hobby_points"] = int
1181    default_types["n_q_bezier_points"] = int
1182    default_types["n_round"] = int
1183    default_types["old_style_nums"] = bool
1184    default_types["orientation"] = PageOrientation
1185    default_types["output_dir"] = str
1186    default_types["overline"] = bool
1187    default_types["overwrite_files"] = bool
1188    default_types["packages"] = list
1189    default_types["page_grid_back_color"] = colors.Color
1190    default_types["page_grid_line_color"] = colors.Color
1191    default_types["page_grid_line_dash_array"] = list
1192    default_types["page_grid_line_width"] = float
1193    default_types["page_grid_spacing"] = float
1194    default_types["page_grid_x_shift"] = float
1195    default_types["page_grid_y_shift"] = float
1196    default_types["page_margins"] = PageMargins
1197    default_types["page_number_position"] = PageNumberPosition
1198    default_types["page_numbering"] = PageNumbering
1199    default_types["page_size"] = PageSize
1200    default_types["pattern_style"] = object  # Assuming pattern style is a custom object
1201    default_types["pattern_type"] = PatternType
1202    default_types["pattern_color"] = colors.Color
1203    default_types["pattern_distance"] = float
1204    default_types["pattern_angle"] = float
1205    default_types["pattern_x_shift"] = float
1206    default_types["pattern_y_shift"] = float
1207    default_types["pattern_line_width"] = float
1208    default_types["pattern_radius"] = float
1209    default_types["pattern_points"] = int
1210    default_types["pdflatex_run_options"] = str
1211    default_types["plait_color"] = colors.Color
1212    default_types["preamble"] = str
1213    default_types["radius_threshold"] = float
1214    default_types["random_marker_colors"] = bool
1215    default_types["random_node_colors"] = bool
1216    default_types["rectangle_width_height"] = tuple
1217    default_types["render"] = str
1218    default_types["rev_arrow_length"] = float
1219    default_types["rtol"] = float
1220    default_types["sans_font"] = str
1221    default_types["save_with_versions"] = bool
1222    default_types["section_color"] = colors.Color
1223    default_types["section_dash_array"] = list
1224    default_types["section_line_cap"] = LineCap
1225    default_types["section_line_join"] = LineJoin
1226    default_types["section_width"] = float
1227    default_types["shade_axis_angle"] = float
1228    default_types["shade_ball_color"] = colors.Color
1229    default_types["shade_bottom_color"] = colors.Color
1230    default_types["shade_inner_color"] = colors.Color
1231    default_types["shade_middle_color"] = colors.Color
1232    default_types["shade_outer_color"] = colors.Color
1233    default_types["shade_left_color"] = colors.Color
1234    default_types["shade_lower_left_color"] = colors.Color
1235    default_types["shade_lower_right_color"] = colors.Color
1236    default_types["shade_right_color"] = colors.Color
1237    default_types["shade_top_color"] = colors.Color
1238    default_types["shade_type"] = ShadeType
1239    default_types["shade_upper_left_color"] = colors.Color
1240    default_types["shade_upper_right_color"] = colors.Color
1241    default_types["show_browser"] = bool
1242    default_types["show_log_on_console"] = bool
1243    default_types["slanted"] = bool
1244    default_types["small_caps"] = bool
1245    default_types["smooth"] = bool
1246    default_types["strike_through"] = bool
1247    default_types["stroke"] = bool
1248    default_types["swatch"] = list
1249    default_types["tag_align"] = Align
1250    default_types["tag_alpha"] = float
1251    default_types["tag_blend_mode"] = BlendMode
1252    default_types["temp_dir"] = str
1253    default_types["text_offset"] = float
1254    default_types["text_width"] = float
1255    default_types["tikz_libraries"] = list
1256    default_types["tikz_nround"] = int
1257    default_types["tikz_scale"] = float
1258    default_types["tol"] = float
1259    default_types["underline"] = bool
1260    default_types["use_packages"] = list
1261    default_types["validate"] = bool
1262    default_types["visible"] = bool
1263    default_types["xelatex_run_options"] = str
1264    default_types["x_marker"] = float
1265    default_types["x_visible"] = bool
1266
1267
1268tikz_defaults = defaultdict(str)
1269
1270
1271def set_tikz_defaults():
1272    """Sets the default values for the TikZ objects."""
1273    from ..colors import colors
1274    from ..graphics.all_enums import LineCap, LineJoin, BlendMode
1275
1276    tikz_defaults.update(
1277        {
1278            "color": colors.black,
1279            "line width": 1,
1280            "line cap": LineCap.BUTT,
1281            "line join": LineJoin.MITER,
1282            "fill": colors.black,
1283            "fill opacity": 1,
1284            "draw": colors.black,
1285            "miter limit": 10,
1286            "dash pattern": [],
1287            "dash phase": 0,
1288            "blend mode": BlendMode.NORMAL,
1289            "font": "",
1290            "font size": 12,
1291            "font color": colors.black,
1292            "font opacity": 1,
1293            "text opacity": 1,
1294            "rotate": 0,
1295        }
1296    )
defaults = <simetri.settings.settings._Defaults object>
def set_defaults():
 109def set_defaults():
 110    """Sets the default values for the Simetri library."""
 111    from ..graphics.all_enums import (
 112        Anchor,
 113        BackStyle,
 114        BlendMode,
 115        DocumentClass,
 116        FillMode,
 117        FrameShape,
 118        LineCap,
 119        LineJoin,
 120        MarkerType,
 121        PageMargins,
 122        PageNumberPosition,
 123        PageNumbering,
 124        PageSize,
 125        Compiler,
 126        PageOrientation,
 127        PatternType,
 128        ShadeType,
 129        Align,
 130    )
 131    from ..canvas.style_map import (
 132        ShapeStyle,
 133        TagStyle,
 134        LineStyle,
 135        FillStyle,
 136        FrameStyle,
 137        MarkerStyle,
 138    )
 139
 140    from ..colors.palettes import seq_MATTER_256
 141    from ..colors import colors
 142
 143    global defaults
 144    global default_types
 145    global defaults_help
 146
 147    # tol, rtol, and rtol are used for comparing floats
 148    # These are used in numpy.isclose and numpy.allclose
 149    # If you are not careful you may get unexpected results
 150    # They do not mean that the difference in the compared numbers are within these values
 151    # numpy isclose returns np.absolute(a - b) <= (atol + rtol * np.absolute(b))
 152    # if you set atol=.1 and rtol=.1, it means that the difference between a and b
 153    # is within .1 and .1 * b
 154    # np.isclose(721, 800, rtol=.1) returns True
 155    # np.isclose(800, 721, rtol=.1) returns False
 156    # atol makes a bigger difference when comparing values close to zero
 157    # if this surrprises you, please read the numpy documentation
 158    defaults["BB_EPSILON"] = 0.01
 159    default_types["BB_EPSILON"] = float
 160    defaults_help["BB_EPSILON"] = (
 161        "Bounding box epsilon. "
 162        "Positive float. Length in <points>. "
 163        "This is a small value used for line/point bounding boxes."
 164    )
 165    defaults["INF"] = np.inf
 166    defaults_help["INF"] = (
 167        "Infinity. Positive integer. "
 168        "Used for representing very large numbers. "
 169        "Maybe usefull for zero division or comparisons."
 170    )
 171    defaults["PRINTTEXOUTPUT"] = True  # Print output from the TeX compiler
 172    defaults["active"] = True  # active objects are drawn
 173    defaults_help["active"] = (
 174        "Boolean property for drawable objects. "
 175        "Currently only used for drawing objects. "
 176        "If False, the object is not drawn."
 177        "In the future it may be used with modifiers and transformations."
 178        "All drawable objects have this property set to True by default."
 179        "Example: shape.active = False"
 180    )
 181    defaults["all_caps"] = False  # use all caps for text
 182    defaults_help["all_caps"] = (
 183        "Boolean property for text objects. "
 184        "If True, the text is displayed in all caps."
 185    )
 186    defaults["alpha"] = 1.0  # used for transparency
 187    defaults_help["alpha"] = (
 188        "Alpha value for transparency. "
 189        "Float between 0 and 1. "
 190        "0 is fully transparent, 1 is fully opaque."
 191        "Both line opacity and fill opacity are set with this value."
 192    )
 193    defaults["allow_consec_dup_points"] = False  # use all caps for text
 194    defaults_help["allow_consec_dup_points"] = (
 195        "Boolean property for allowing consecutive duplicate points in Shape objects. "
 196        "Do not change this unless you absolutely have to. Likely to cause problems."
 197    )
 198    defaults["alpha"] = 1.0  # used for transparency
 199    defaults_help["alpha"] = (
 200
 201    )
 202    defaults["anchor"] = Anchor.CENTER  # used for text alignment
 203    defaults_help["anchor"] = (
 204        "Specifies text object location. "
 205        "Anchor.CENTER, Anchor.NORTH, Anchor.SOUTH, "
 206        "Anchor.EAST, Anchor.WEST, Anchor.NORTHEAST, "
 207        "Anchor.NORTHWEST, Anchor.SOUTHEAST, Anchor.SOUTHWEST"
 208        "Example: text.anchor = Anchor.NORTH"
 209    )
 210    defaults["angle_atol"] = 0.001  # used for comparing angles
 211    defaults_help["angle_atol"] = (
 212        "Angle absolute tolerance. "
 213        "Positive float. Angle in radians. "
 214        "Used for comparing angles."
 215    )
 216    defaults["angle_rtol"] = 0.001  # used for comparing angles
 217    defaults_help["angle_rtol"] = (
 218        "Angle relative tolerance. "
 219        "Positive float. Angle in radians. "
 220        "Used for comparing angles."
 221    )
 222    defaults["angle_tol"] = (
 223        0.001  # used for comparing angles in radians .001 rad = .057 degrees
 224    )
 225    defaults_help["angle_tol"] = (
 226        "Angle tolerance. "
 227        "Positive float. Angle in radians. "
 228        "Used for comparing angles."
 229    )
 230    defaults["area_atol"] = 0.001  # used for comparing areas
 231    defaults_help["area_atol"] = (
 232        "Area absolute tolerance. "
 233        "Positive float. Length in <points>. "
 234        "Used for comparing areas."
 235    )
 236    defaults["area_rtol"] = 0.001  # used for comparing areas
 237    defaults_help["area_rtol"] = (
 238        "Area relative tolerance. "
 239        "Positive float. Length in <points>. "
 240        "Used for comparing areas."
 241    )
 242    defaults["area_threshold"] = 1  # used for grouping fragments in a lace object
 243    defaults_help["area_threshold"] = (
 244        "Area threshold. "
 245        "Positive float. Length in <points>. "
 246        "Used for grouping fragments in a lace object."
 247    )
 248    defaults["arrow_head_length"] = 8
 249    defaults_help["arrow_head_length"] = (
 250        "Arrow head length. "
 251        "Positive float. Length in <points>. "
 252        "Length of the arrow head."
 253    )
 254    defaults["arrow_head_width"] = 3
 255    defaults_help["arrow_head_width"] = (
 256        "Arrow head width. "
 257        "Positive float. Length in <points>. "
 258        "Width of the arrow head."
 259    )
 260    defaults["atol"] = 0.05  # used for comparing floats
 261    defaults_help["atol"] = (
 262        "Absolute tolerance. "
 263        "Positive float. Length in <points>. "
 264        "1in = 72pt."
 265        "Used for comparing floats."
 266    )
 267
 268    defaults["back_color"] = colors.white  # canvas background color
 269    defaults_help["back_color"] = (
 270        "Background color. Color object. Background color for the canvas."
 271    )
 272    defaults["back_style"] = (
 273        BackStyle.COLOR
 274    )  # EMPTY, COLOR, SHADING, PATTERN, GRIDLINES
 275    defaults_help["back_style"] = (
 276        "Background style for the Canvas. "
 277        "BackStyle.EMPTY, BackStyle.COLOR, BackStyle.SHADING, "
 278        "BackStyle.PATTERN, BackStyle.GRIDLINES."
 279    )
 280    defaults["begin_doc"] = "\\begin{document}\n"
 281    defaults_help["begin_doc"] = "Used with the generated .tex file."
 282    defaults["begin_tikz"] = "\\begin{tikzpicture}[x=1pt, y=1pt, scale=1]\n"
 283    defaults_help["begin_tikz"] = "Used with the generated .tex file."
 284    defaults["blend_mode"] = BlendMode.NORMAL
 285    defaults_help["blend_mode"] = (
 286        "Blend mode. This can be set with the Canvas or Batch objects. "
 287        "BlendMode.NORMAL, BlendMode.MULTIPLY, BlendMode.SCREEN, "
 288        "BlendMode.OVERLAY, BlendMode.DARKEN, BlendMode.LIGHTEN, "
 289        "BlendMode.COLOR_DODGE, BlendMode.COLOR_BURN, "
 290        "BlendMode.HARD_LIGHT, "
 291        "BlendMode.SOFT_LIGHT, BlendMode.DIFFERENCE, "
 292        "BlendMode.EXCLUSION, "
 293        "BlendMode.HUE, BlendMode.SATURATION, BlendMode.COLOR, "
 294        "BlendMode.LUMINOSITY."
 295    )
 296    defaults["bold"] = False  # use bold font if True
 297    defaults_help["bold"] = (
 298        "Boolean property for text objects. If True, the text is displayed in bold."
 299    )
 300    defaults["border"] = 25  # border around canvas
 301    defaults_help["border"] = (
 302        "Border around the canvas. "
 303        "Positive float. Length in <points>. "
 304        "Border size for the canvas."
 305    )
 306    defaults["border_size"] = 4  # border size for the canvas
 307    defaults_help["border_size"] = (
 308        "Border size for the canvas. "
 309        "Positive float. Length in <points>. "
 310        "Border size for the canvas."
 311    )
 312    defaults["canvas_back_style"] = BackStyle.EMPTY
 313    defaults_help["canvas_back_style"] = (
 314        "Canvas background style. "
 315        "BackStyle.EMPTY, BackStyle.COLOR, BackStyle.SHADING, "
 316        "BackStyle.PATTERN, BackStyle.GRIDLINES."
 317    )
 318    defaults["canvas_frame_color"] = colors.black # frame color for the canvas
 319    defaults_help["canvas_frame_color"] = (
 320        "Frame color for the canvas. Color object."
 321    )
 322    defaults["canvas_frame_margin"] = 15  # margin around the canvas frame
 323    defaults_help["canvas_frame_margin"] = (
 324        "Margin around the canvas frame. "
 325    )
 326    defaults["canvas_frame_shadow_width"] = 5  # shadow width for the canvas frame
 327    defaults_help["canvas_frame_shadow_width"] = (
 328        "Shadow width for the canvas frame. "
 329    )
 330    defaults["canvas_frame_width"] = 45  # frame width for the canvas
 331    defaults_help["canvas_frame_width"] = (
 332        "Frame width for the canvas. Positive float. Length in <points>."
 333    )
 334    defaults["canvas_size"] = None  # (width, height) canvas size in points
 335    defaults_help["canvas_size"] = (
 336        "Canvas size. "
 337        "Tuple of two positive floats. Length in <points>. "
 338        "Canvas size in points."
 339    )
 340    defaults["circle_radius"] = 20
 341    defaults_help["circle_radius"] = (
 342        "Circle radius. Positive float. Length in <points>. Radius of the circle."
 343    )
 344    defaults["clip"] = False  # clip the outside of the clip_path to the canvas
 345    defaults_help["clip"] = (
 346        "Boolean property for the canvas and Batch objects. "
 347        "If true, clip the outside of the canvas.mask to the canvas"
 348        "or Batch elemetns."
 349    )
 350    defaults["color"] = colors.black
 351    defaults_help["color"] = "Color. Color object."
 352    defaults["shade_color_wheel"] = False
 353    defaults_help["shade_color_wheel"] = (
 354        "Boolean property for the shape objects. "
 355        "If True, use the color wheel for shading."
 356    )
 357    defaults["shade_color_wheel_black"] = False
 358    defaults_help["shade_color_wheel_black"] = (
 359        "Boolean property for the shape object. "
 360        "If True, use the color wheel for shading."
 361    )
 362    defaults["shade_color_wheel_white"] = False
 363    defaults_help["shade_color_wheel_white"] = (
 364        "Boolean property for the shape object. "
 365        "If True, use the color wheel for shading."
 366    )
 367    defaults["CS_origin_size"] = (
 368        2  # size of the circle at the origin of the coordinate system
 369    )
 370    defaults_help["CS_origin_size"] = (
 371        "Size of the circle at the origin of the coordinate system. "
 372        "Positive float. Length in <points>."
 373    )
 374    defaults["CS_origin_color"] = colors.gray
 375    defaults_help["CS_origin_color"] = (
 376        "Color of the circle at the origin of the coordinate "
 377        "system. "
 378        "Color object."
 379    )
 380    defaults["CS_size"] = (
 381        25  # size of the coordinate system axes. Used with canvas.draw_CS
 382    )
 383    defaults_help["CS_size"] = (
 384        "Size of the coordinate system axes. Positive float. Length in <points>."
 385    )
 386    defaults["CS_line_width"] = 2
 387    defaults_help["CS_line_width"] = (
 388        "Line width of the coordinate system axes. "
 389        "Positive float. Length in <points>."
 390    )
 391    defaults["CS_x_color"] = colors.red
 392    defaults_help["CS_x_color"] = (
 393        "Color of the x-axis in the coordinate system. Color object."
 394    )
 395    defaults["CS_y_color"] = colors.green
 396    defaults_help["CS_y_color"] = (
 397        "Color of the y-axis in the coordinate system. Color object."
 398    )
 399    defaults["debug_mode"] = False
 400    defaults_help["debug_mode"] = (
 401        "Boolean property for enabling debug mode. "
 402        "If True, debug information is printed."
 403    )
 404
 405    defaults["dist_tol"] = (
 406        0.05  # used for comparing two points to check if they are the
 407    )
 408    # same if their distance is less than or equal to dist_tol,
 409    # they are considered the same
 410    defaults_help["dist_tol"] = (
 411        "Distance tolerance for comparing two points. "
 412        "Positive float. Length in <points>."
 413    )
 414
 415    defaults["document_class"] = DocumentClass.STANDALONE  # STANDALONE, ARTICLE, BOOK,
 416    # REPORT, LETTER, SLIDES, BEAMER,
 417    # MINIMAL
 418    defaults_help["document_class"] = (
 419        "Document class for the LaTeX document. DocumentClass enum."
 420    )
 421    defaults["document_options"] = ["12pt", "border=25pt"]
 422    defaults_help["document_options"] = (
 423        "Options for the LaTeX document class. List of strings."
 424    )
 425    defaults["dot_color"] = colors.black  # for Dot objects
 426    defaults_help["dot_color"] = "Color for Dot objects. Color object."
 427    defaults["double_lines"] = False
 428    defaults_help["double_lines"] = (
 429        "Boolean property for using double lines. If True, double lines are used."
 430    )
 431    defaults["double_distance"] = 2
 432    defaults_help["double_distance"] = (
 433        "Distance between double lines. Positive float. Length in <points>."
 434    )
 435    defaults["draw_fillets"] = False  # draw rounded corners for shapes
 436    defaults_help["draw_fillets"] = (
 437        "Boolean property for drawing rounded corners for shapes. "
 438        "If True, rounded corners are drawn."
 439    )
 440    defaults["draw_frame"] = False  # draw a frame around the Tag objects
 441    defaults_help["draw_frame"] = (
 442        "Boolean property for drawing a frame around Tag objects. "
 443        "If True, a frame is drawn."
 444    )
 445    defaults["draw_markers"] = False  # draw markers at each vertex of a Shape object
 446    defaults_help["draw_markers"] = (
 447        "Boolean property for drawing markers at each vertex "
 448        "of a Shape object. "
 449        "If True, markers are drawn."
 450    )
 451
 452    defaults["ellipse_width_height"] = (40, 20)  # width and height of the ellipse
 453    defaults_help["ellipse_width_height"] = (
 454        "Width and height of the ellipse. "
 455        "Tuple of two positive floats. Length in <points>."
 456    )
 457    defaults["end_doc"] = "\\end{document}\n"
 458    defaults_help["end_doc"] = "End document string for the generated .tex file."
 459    defaults["end_tikz"] = "\\end{tikzpicture}\n"
 460    defaults_help["end_tikz"] = "End TikZ picture string for the generated .tex file."
 461    defaults["even_odd"] = True  # use even-odd rule for filling shapes
 462    defaults_help["even_odd"] = (
 463        "Boolean property for using the even-odd rule for filling shapes. "
 464        "If True, the even-odd rule is used."
 465    )
 466    defaults["ext_length2"] = 25  # dimension extra extension length
 467    defaults_help["ext_length2"] = (
 468        "Dimension extra extension length. Positive float. Length in <points>."
 469    )
 470    defaults["fill"] = True
 471    defaults_help["fill"] = (
 472        "Boolean property for filling shapes. If True, shapes are filled."
 473    )
 474    defaults["fill_alpha"] = 1
 475    defaults_help["fill_alpha"] = (
 476        "Alpha value for fill transparency. Float between 0 and 1."
 477    )
 478    defaults["fill_color"] = colors.black
 479    defaults_help["fill_color"] = "Fill color for shapes. Color object."
 480    defaults["fill_mode"] = FillMode.EVENODD
 481    defaults_help["fill_mode"] = "Fill mode for shapes. FillMode enum."
 482    defaults["fill_blend_mode"] = BlendMode.NORMAL
 483    defaults_help["fill_blend_mode"] = "Blend mode for fill. BlendMode enum."
 484    defaults["fillet_radius"] = None
 485    defaults_help["fillet_radius"] = (
 486        "Radius for rounded corners (fillets). Positive float. Length in <points>."
 487    )
 488    defaults["font_blend_mode"] = BlendMode.NORMAL
 489    defaults_help["font_blend_mode"] = "Blend mode for font. BlendMode enum."
 490    defaults["font_alpha"] = 1
 491    defaults_help["font_alpha"] = (
 492        "Alpha value for font transparency. Float between 0 and 1."
 493    )
 494    defaults["font_color"] = colors.black  # use the default font color in LaTeX engine
 495    defaults_help["font_color"] = (
 496        "Font color. Color object. Font color for the text objects."
 497    )
 498    defaults["font_family"] = (
 499        FontFamily.SERIF  # use the default font family in LaTeX engine
 500    )
 501    defaults_help["font_family"] = (
 502        "Font family. String. Font family for the text objects."
 503    )
 504    defaults["font_size"] = 12
 505    defaults_help["font_size"] = (
 506        "Font size. "
 507        "Positive float. Length in <points>. "
 508        "Font size for the text objects."
 509    )
 510    defaults["font_style"] = ""
 511    defaults_help["font_style"] = "Font style. String. Font style for the text objects."
 512    defaults["frame_active"] = True
 513    defaults_help["frame_active"] = (
 514        "Boolean property for active frames. If True, frames are drawn."
 515    )
 516    defaults["frame_alpha"] = 1
 517    defaults_help["frame_alpha"] = (
 518        "Alpha value for frame transparency. Float between 0 and 1."
 519    )
 520    defaults["frame_back_alpha"] = 1
 521    defaults_help["frame_back_alpha"] = (
 522        "Alpha value for frame background transparency. Float between 0 and 1."
 523    )
 524    defaults["frame_back_color"] = colors.white
 525    defaults_help["frame_back_color"] = "Frame background color. Color object."
 526    defaults["frame_blend_mode"] = BlendMode.NORMAL
 527    defaults_help["frame_blend_mode"] = "Blend mode for frame. BlendMode enum."
 528    defaults["frame_color"] = colors.black
 529    defaults_help["frame_color"] = "Frame color. Color object."
 530    defaults["frame_draw_fillets"] = False
 531    defaults_help["frame_draw_fillets"] = (
 532        "Boolean property for drawing fillets for frames. "
 533        "If True, fillets are drawn."
 534    )
 535    defaults["frame_fill"] = True
 536    defaults_help["frame_fill"] = (
 537        "Boolean property for filling frames. If True, frames are filled."
 538    )
 539    defaults["frame_fillet_radius"] = 3
 540    defaults_help["frame_fillet_radius"] = (
 541        "Fillet radius for frames. Positive float. Length in <points>."
 542    )
 543    defaults["frame_gradient"] = None
 544    defaults_help["frame_gradient"] = "Frame gradient. Gradient object."
 545    defaults["frame_inner_sep"] = 3
 546    defaults_help["frame_inner_sep"] = (
 547        "Frame inner separation. Positive float. Length in <points>."
 548    )
 549    defaults["frame_inner_xsep"] = None
 550    defaults_help["frame_inner_xsep"] = (
 551        "Frame inner x separation. Positive float. Length in <points>."
 552    )
 553    defaults["frame_inner_ysep"] = None
 554    defaults_help["frame_inner_ysep"] = (
 555        "Frame inner y separation. Positive float. Length in <points>."
 556    )
 557    defaults["frame_outer_sep"] = 0
 558    defaults_help["frame_outer_sep"] = (
 559        "Frame outer separation. Positive float. Length in <points>."
 560    )
 561    defaults["frame_line_cap"] = LineCap.BUTT
 562    defaults_help["frame_line_cap"] = "Line cap for frames. LineCap enum."
 563    defaults["frame_line_dash_array"] = []
 564    defaults_help["frame_line_dash_array"] = (
 565        "Line dash array for frames. List of floats."
 566    )
 567    defaults["frame_line_join"] = LineJoin.MITER
 568    defaults_help["frame_line_join"] = "Line join for frames. LineJoin enum."
 569    defaults["frame_line_width"] = 1
 570    defaults_help["frame_line_width"] = (
 571        "Line width for frames. Positive float. Length in <points>."
 572    )
 573    defaults["frame_min_height"] = 50
 574    defaults_help["frame_min_height"] = (
 575        "Minimum height for frames. Positive float. Length in <points>."
 576    )
 577    defaults["frame_min_width"] = 50
 578    defaults_help["frame_min_width"] = (
 579        "Minimum width for frames. Positive float. Length in <points>."
 580    )
 581    defaults["frame_min_size"] = 50
 582    defaults_help["frame_min_size"] = (
 583        "Minimum size for frames. Positive float. Length in <points>."
 584    )
 585    defaults["frame_pattern"] = None
 586    defaults_help["frame_pattern"] = "Frame pattern. Pattern object."
 587    defaults["frame_rounded_corners"] = False
 588    defaults_help["frame_rounded_corners"] = (
 589        "Boolean property for rounded corners for frames. "
 590        "If True, rounded corners are drawn."
 591    )
 592    defaults["frame_shape"] = FrameShape.RECTANGLE
 593    defaults_help["frame_shape"] = "Frame shape. FrameShape enum."
 594    defaults["frame_smooth"] = True
 595    defaults_help["frame_smooth"] = (
 596        "Boolean property for smooth frames. If True, frames are smooth."
 597    )
 598    defaults["frame_stroke"] = True
 599    defaults_help["frame_stroke"] = (
 600        "Boolean property for stroke frames. If True, frames are stroked."
 601    )
 602    defaults["frame_visible"] = True
 603    defaults_help["frame_visible"] = (
 604        "Boolean property for visible frames. If True, frames are visible."
 605    )
 606    defaults["gap"] = 5  # dimension extension gap
 607    defaults_help["gap"] = (
 608        "Dimension extension gap. Positive float. Length in <points>."
 609    )
 610    defaults["graph_palette"] = seq_MATTER_256  # this needs to be a 256 color palette
 611    defaults_help["graph_palette"] = "Graph palette. List of colors."
 612    defaults["grid_back_color"] = colors.white
 613    defaults_help["grid_back_color"] = "Grid background color. Color object."
 614    defaults["grid_line_color"] = colors.gray
 615    defaults_help["grid_line_color"] = "Grid line color. Color object."
 616    defaults["grid_line_width"] = 0.5
 617    defaults_help["grid_line_width"] = (
 618        "Grid line width. Positive float. Length in <points>."
 619    )
 620    defaults["grid_alpha"] = 0.5
 621    defaults_help["grid_alpha"] = "Grid alpha value. Float between 0 and 1."
 622    defaults["grid_line_dash_array"] = [2, 2]
 623    defaults_help["grid_line_dash_array"] = "Grid line dash array. List of floats."
 624    defaults["indices_font_family"] = "ttfamily"  # ttfamily, rmfamily, sffamily
 625    defaults_help["indices_font_family"] = "Indices font family. String."
 626    defaults["indices_font_size"] = "tiny"  # tiny, scriptsize, footnotesize, small,
 627    # normalsize, large, Large, LARGE, huge, Huge
 628    defaults_help["indices_font_size"] = "Indices font size. String."
 629    defaults["italic"] = False
 630    defaults_help["italic"] = (
 631        "Boolean property for italic font. If True, the font is displayed in italic."
 632    )
 633    defaults["job_dir"] = None
 634    defaults_help["job_dir"] = "Job directory. String. Directory for the job files."
 635    defaults["keep_aux_files"] = False
 636    defaults_help["keep_aux_files"] = (
 637        "Boolean property for keeping auxiliary files. "
 638        "If True, auxiliary files are kept."
 639    )
 640    defaults["keep_tex_files"] = False
 641    defaults_help["keep_tex_files"] = (
 642        "Boolean property for keeping TeX files. If True, TeX files are kept."
 643    )
 644    defaults["keep_log_files"] = False
 645    defaults_help["keep_log_files"] = (
 646        "Boolean property for keeping log files. If True, log files are kept."
 647    )
 648    defaults["lace_offset"] = 4
 649    defaults_help["lace_offset"] = "Lace offset. Positive float. Length in <points>."
 650    defaults["latex_compiler"] = Compiler.XELATEX  # PDFLATEX, XELATEX, LUALATEX
 651    defaults_help["latex_compiler"] = "LaTeX compiler. Compiler enum."
 652    defaults["line_alpha"] = 1
 653    defaults_help["line_alpha"] = (
 654        "Alpha value for line transparency. Float between 0 and 1."
 655    )
 656    defaults["line_blend_mode"] = BlendMode.NORMAL
 657    defaults_help["line_blend_mode"] = "Blend mode for line. BlendMode enum."
 658    defaults["line_cap"] = LineCap.BUTT
 659    defaults_help["line_cap"] = "Line cap for line. LineCap enum."
 660    defaults["line_color"] = colors.black
 661    defaults_help["line_color"] = "Line color. Color object."
 662    defaults["line_dash_array"] = None
 663    defaults_help["line_dash_array"] = "Line dash array. List of floats."
 664    defaults["line_dash_phase"] = 0
 665    defaults_help["line_dash_phase"] = (
 666        "Line dash phase. Positive float. Length in <points>."
 667    )
 668    defaults["line_join"] = LineJoin.MITER
 669    defaults_help["line_join"] = "Line join for line. LineJoin enum."
 670    defaults["line_miter_limit"] = 10
 671    defaults_help["line_miter_limit"] = "Line miter limit. Positive float."
 672    defaults["line_width"] = 1
 673    defaults_help["line_width"] = "Line width. Positive float. Length in <points>."
 674    defaults["lualatex_run_options"] = None
 675    defaults_help["lualatex_run_options"] = "LuaLaTeX run options. String."
 676    defaults["main_font"] = "Times New Roman"
 677    defaults_help["main_font"] = "Main font. String."
 678    defaults["margin"] = 1
 679    defaults_help["margin"] = "Margin. Positive float. Length in <points>."
 680    defaults["margin_bottom"] = 1
 681    defaults_help["margin_bottom"] = (
 682        "Bottom margin. Positive float. Length in <points>."
 683    )
 684    defaults["margin_left"] = 1
 685    defaults_help["margin_left"] = "Left margin. Positive float. Length in <points>."
 686    defaults["margin_right"] = 1
 687    defaults_help["margin_right"] = "Right margin. Positive float. Length in <points>."
 688    defaults["margin_top"] = 1  # to do! change these to point units
 689    defaults_help["margin_top"] = "Top margin. Positive float. Length in <points>."
 690    defaults["marker"] = None
 691    defaults_help["marker"] = "Marker. Marker object."
 692    defaults["marker_color"] = colors.black
 693    defaults_help["marker_color"] = "Marker color. Color object."
 694    defaults["marker_line_style"] = "solid"
 695    defaults_help["marker_line_style"] = "Marker line style. String."
 696    defaults["marker_line_width"] = 1
 697    defaults_help["marker_line_width"] = (
 698        "Marker line width. Positive float. Length in <points>."
 699    )
 700    defaults["marker_palette"] = seq_MATTER_256  # this needs to be a 256 color
 701    # palette
 702    defaults_help["marker_palette"] = "Marker palette. List of colors."
 703    defaults["marker_radius"] = 3  # Used for MarkerType.CIRCLE, MarkerType.STAR
 704    defaults_help["marker_radius"] = (
 705        "Marker radius. Positive float. Length in <points>."
 706    )
 707    defaults["marker_size"] = 3  # To do: find out what the default is
 708    defaults_help["marker_size"] = "Marker size. Positive float. Length in <points>."
 709    defaults["marker_type"] = MarkerType.FCIRCLE
 710    defaults_help["marker_type"] = "Marker type. MarkerType enum."
 711    defaults["markers_only"] = False
 712    defaults_help["markers_only"] = (
 713        "Boolean property for drawing markers only. If True, only markers are drawn."
 714    )
 715    defaults["mask"] = None
 716    defaults_help["mask"] = "Mask. Mask object."
 717    defaults["merge"] = True  # merge transformations with reps > 0
 718    defaults_help["merge"] = (
 719        "Boolean property for merging transformations. "
 720        "If True, transformations with reps > 0 are merged."
 721    )
 722    defaults["merge_tol"] = 0.01  # if the distance between two nodes is less
 723    # than this value,
 724    defaults_help["merge_tol"] = "Merge tolerance. Positive float. Length in <points>."
 725    # defaults['min_height'] = 10
 726    # defaults['min_width'] = 20
 727    # defaults['min_size'] = 50
 728    defaults["mono_font"] = "Courier New"
 729    defaults_help["mono_font"] = "Monospace font. String."
 730    defaults['n_arc_points'] = 40  # number of proportional points for arcs
 731    defaults_help['n_arc_points'] = 'Number of points for arcs. Positive integer.'
 732    defaults['n_circle_points'] = 30  # number of points for circles
 733    defaults_help['n_circle_points'] = 'Number of points for circles. Positive integer.'
 734    defaults['n_bezier_points'] = 40  # number of points for Bezier curves
 735    defaults_help['n_bezier_points'] = 'Number of points for Bezier curves. Positive integer.'
 736    defaults['n_ellipse_points'] = 40  # number of points for ellipses
 737    defaults_help['n_ellipse_points'] = 'Number of points for ellipses. Positive integer.'
 738    defaults['n_hobby_points'] = 40  # number of points for Hobby curves
 739    defaults_help['n_hobby_points'] = 'Number of points for Hobby curves. Positive integer.'
 740    defaults['n_q_bezier_points'] = 30  # number of points for quadratic Bezier curves
 741    defaults_help['n_q_bezier_points'] = 'Number of points for quadratic Bezier curves. Positive integer.'
 742    defaults["n_round"] = 2  # used for rounding floats
 743    defaults_help["n_round"] = (
 744        "Number of decimal places to round floats. Positive integer."
 745    )
 746    defaults["old_style_nums"] = False
 747    defaults_help["old_style_nums"] = (
 748        "Boolean property for old style numbers. "
 749        "If True, old style numbers are used."
 750    )
 751    defaults["orientation"] = PageOrientation.PORTRAIT  # PORTRAIT, LANDSCAPE
 752    defaults_help["orientation"] = "Page orientation. PageOrientation enum."
 753    defaults["output_dir"] = None  # output directory for TeX files if None, use
 754    # the current directory
 755    defaults_help["output_dir"] = "Output directory for TeX files. String."
 756    defaults["overline"] = False
 757    defaults_help["overline"] = (
 758        "Boolean property for overline. If True, overline is used."
 759    )
 760    defaults["overwrite_files"] = False
 761    defaults_help["overwrite_files"] = (
 762        "Boolean property for overwriting files. If True, files are overwritten."
 763    )
 764    defaults["packages"] = ["tikz", "pgf"]
 765    defaults_help["packages"] = "Packages. List of strings."
 766    defaults["page_grid_back_color"] = colors.white
 767    defaults_help["page_grid_back_color"] = "Page grid background color. Color object."
 768    defaults["page_grid_line_color"] = colors.gray
 769    defaults_help["page_grid_line_color"] = "Page grid line color. Color object."
 770    defaults["page_grid_line_dash_array"] = [2, 2]
 771    defaults_help["page_grid_line_dash_array"] = (
 772        "Page grid line dash array. List of floats."
 773    )
 774    defaults["page_grid_line_width"] = 0.5
 775    defaults_help["page_grid_line_width"] = (
 776        "Page grid line width. Positive float. Length in <points>."
 777    )
 778    defaults["page_grid_spacing"] = 18
 779    defaults_help["page_grid_spacing"] = (
 780        "Page grid spacing. Positive float. Length in <points>."
 781    )
 782    defaults["page_grid_x_shift"] = 0
 783    defaults_help["page_grid_x_shift"] = (
 784        "Page grid x shift. Positive float. Length in <points>."
 785    )
 786    defaults["page_grid_y_shift"] = 0
 787    defaults_help["page_grid_y_shift"] = (
 788        "Page grid y shift. Positive float. Length in <points>."
 789    )
 790    defaults["page_margins"] = PageMargins.CUSTOM
 791    defaults_help["page_margins"] = "Page margins. PageMargins enum."
 792    defaults["page_number_position"] = PageNumberPosition.BOTTOM_CENTER
 793    defaults_help["page_number_position"] = (
 794        "Page number position. PageNumberPosition enum."
 795    )
 796    defaults["page_numbering"] = PageNumbering.NONE
 797    defaults_help["page_numbering"] = "Page numbering. PageNumbering enum."
 798    defaults["page_size"] = PageSize.A4  #  A0, A1, A2, A3, A4, A5, A6, B0, B1, B2,
 799    # B3, B4, B5, B6, LETTER, LEGAL,
 800    # EXECUTIVE, 11X17
 801    defaults_help["page_size"] = "Page size. PageSize enum."
 802    defaults["pattern_style"] = None
 803    defaults_help["pattern_style"] = "Pattern style. PatternStyle object."
 804    defaults["pattern_type"] = PatternType.HORIZONTAL_LINES  #  DOTS, HATCH, STARS
 805    defaults_help["pattern_type"] = "Pattern type. PatternType enum."
 806    defaults["pattern_color"] = colors.black
 807    defaults_help["pattern_color"] = "Pattern color. Color object."
 808    defaults["pattern_distance"] = 3  # distance between items
 809    defaults_help["pattern_distance"] = (
 810        "Pattern distance. Positive float. Length in <points>."
 811    )
 812    defaults["pattern_angle"] = 0  # angle of the pattern in radians
 813    defaults_help["pattern_angle"] = "Pattern angle. Float. Angle in radians."
 814    defaults["pattern_x_shift"] = 0  # shift in the x direction
 815    defaults_help["pattern_x_shift"] = (
 816        "Pattern x shift. Positive float. Length in <points>."
 817    )
 818    defaults["pattern_y_shift"] = 0  # shift in the y direction
 819    defaults_help["pattern_y_shift"] = (
 820        "Pattern y shift. Positive float. Length in <points>."
 821    )
 822    defaults["pattern_line_width"] = 0  # line width for LINES and HATCH
 823    defaults_help["pattern_line_width"] = (
 824        "Pattern line width. Positive float. Length in <points>."
 825    )
 826    defaults["pattern_radius"] = 10  # radius of the circle for STARS
 827    defaults_help["pattern_radius"] = (
 828        "Pattern radius. Positive float. Length in <points>."
 829    )
 830    defaults["pattern_points"] = 5  # number of points for STAR
 831    defaults_help["pattern_points"] = "Pattern points. Positive integer."
 832    defaults["pdflatex_run_options"] = None
 833    defaults_help["pdflatex_run_options"] = "PDFLaTeX run options. String."
 834    defaults["plait_color"] = colors.bluegreen
 835    defaults_help["plait_color"] = "Plait color. Color object."
 836    defaults["preamble"] = ""
 837    defaults_help["preamble"] = "Preamble. String."
 838    defaults["radius_threshold"] = 1  # used for grouping fragments in a lace object
 839    defaults_help["radius_threshold"] = (
 840        "Radius threshold. Positive float. Length in <points>. "
 841    )
 842    defaults["random_marker_colors"] = True
 843    defaults_help["random_marker_colors"] = (
 844        "Boolean property for random marker colors. "
 845        "If True, random marker colors are used."
 846    )
 847    defaults["random_node_colors"] = True
 848    defaults_help["random_node_colors"] = (
 849        "Boolean property for random node colors. "
 850        "If True, random node colors are used."
 851    )
 852    defaults["rectangle_width_height"] = (40, 20)  # width and height of the rectangle
 853    defaults_help["rectangle_width_height"] = (
 854        "Width and height of the rectangle. "
 855        "Tuple of two positive floats. Length in <points>."
 856    )
 857    defaults["render"] = "TEX"  # Render.TEX, Render.SVG, Render.PNG use string values
 858    defaults_help["render"] = "Render. Render enum."
 859    defaults["rev_arrow_length"] = 20  # length of reverse arrow
 860    defaults_help["rev_arrow_length"] = (
 861        "Length of reverse arrow. Positive float. Length in <points>."
 862    )
 863    defaults["rtol"] = (
 864        0  # used for comparing floats. If this is 0 then only atol is used
 865    )
 866    defaults_help["rtol"] = "Relative tolerance. Positive float. Length in <points>. "
 867    defaults["sans_font"] = "Arial"
 868    defaults_help["sans_font"] = "Sans font. String."
 869    defaults["save_with_versions"] = (
 870        False  # if the file exists, save with a version number
 871    )
 872    defaults_help["save_with_versions"] = (
 873        "Boolean property for saving with versions. "
 874        "If True, files are saved with a version number."
 875    )
 876    defaults["section_color"] = colors.black
 877    defaults_help["section_color"] = "Section color. Color object."
 878    defaults["section_dash_array"] = None
 879    defaults_help["section_dash_array"] = "Section dash array. List of floats."
 880    defaults["section_line_cap"] = LineCap.BUTT.value
 881    defaults_help["section_line_cap"] = "Section line cap. LineCap enum."
 882    defaults["section_line_join"] = LineJoin.MITER.value
 883    defaults_help["section_line_join"] = "Section line join. LineJoin enum."
 884    defaults["section_width"] = 1
 885    defaults_help["section_width"] = (
 886        "Section width. Positive float. Length in <points>."
 887    )
 888    defaults["shade_axis_angle"] = (
 889        pi / 4
 890    )  # angle from the x-axis for the shading in radians
 891    defaults_help["shade_axis_angle"] = (
 892        "Axis angle for shading. Float. Angle in radians."
 893    )
 894    defaults["shade_ball_color"] = colors.black
 895    defaults_help["shade_ball_color"] = "Ball color for shading. Color object."
 896    defaults["shade_bottom_color"] = colors.white
 897    defaults_help["shade_bottom_color"] = "Bottom color for shading. Color object."
 898    defaults["shade_inner_color"] = colors.white
 899    defaults_help["shade_inner_color"] = "Inner color for shading. Color object."
 900    defaults["shade_middle_color"] = colors.white
 901    defaults_help["shade_middle_color"] = "Middle color for shading. Color object."
 902    defaults["shade_outer_color"] = colors.white
 903    defaults_help["shade_outer_color"] = "Outer color for shading. Color object."
 904    defaults["shade_left_color"] = colors.black
 905    defaults_help["shade_left_color"] = "Left color for shading. Color object."
 906    defaults["shade_lower_left_color"] = colors.black
 907    defaults_help["shade_lower_left_color"] = (
 908        "Lower left color for shading. Color object."
 909    )
 910    defaults["shade_lower_right_color"] = colors.white
 911    defaults_help["shade_lower_right_color"] = (
 912        "Lower right color for shading. Color object."
 913    )
 914    defaults["shade_right_color"] = colors.white
 915    defaults_help["shade_right_color"] = "Right color for shading. Color object."
 916    defaults["shade_top_color"] = colors.black
 917    defaults_help["shade_top_color"] = "Top color for shading. Color object."
 918    defaults["shade_type"] = ShadeType.AXIS_TOP_BOTTOM
 919    defaults_help["shade_type"] = "Shade type. ShadeType enum."
 920    defaults["shade_upper_left_color"] = colors.black
 921    defaults_help["shade_upper_left_color"] = (
 922        "Upper left color for shading. Color object."
 923    )
 924    defaults["shade_upper_right_color"] = colors.white
 925    defaults_help["shade_upper_right_color"] = (
 926        "Upper right color for shading. Color object."
 927    )
 928    defaults["show_browser"] = True
 929    defaults_help["show_browser"] = (
 930        "Boolean property for showing the browser. If True, the browser is shown."
 931    )
 932    defaults["show_log_on_console"] = True  # show log messages on console
 933    defaults_help["show_log_on_console"] = (
 934        "Boolean property for showing LateX log messages on console. "
 935        "If True, log messages are shown on console."
 936    )
 937    defaults["slanted"] = False
 938    defaults_help["slanted"] = (
 939        "Boolean property for slanted font. "
 940        "If True, the font is displayed in slanted."
 941    )
 942    defaults["small_caps"] = False
 943    defaults_help["small_caps"] = (
 944        "Boolean property for small caps font. "
 945        "If True, the font is displayed in small caps."
 946    )
 947    defaults["smooth"] = False
 948    defaults_help["smooth"] = (
 949        "Boolean property for smooth lines. If True, lines are smooth."
 950    )
 951    defaults["strike_through"] = False
 952    defaults_help["strike_through"] = (
 953        "Boolean property for strike through. If True, strike through is used."
 954    )
 955    defaults["stroke"] = True
 956    defaults_help["stroke"] = "Boolean property for stroke. If True, stroke is used."
 957    defaults["swatch"] = seq_MATTER_256
 958    defaults_help["swatch"] = "Swatch. List of colors."
 959    defaults["tag_align"] = Align.LEFT
 960    defaults_help["tag_align"] = "Tag text alignment. Align enum."
 961    defaults["tag_alpha"] = 1
 962    defaults_help["tag_alpha"] = (
 963        "Alpha value for tag transparency. Float between 0 and 1."
 964    )
 965    defaults["tag_blend_mode"] = BlendMode.NORMAL
 966    defaults_help["tag_blend_mode"] = "Blend mode for tag. BlendMode enum."
 967    defaults["temp_dir"] = "sytem_temp_dir"
 968    defaults_help["temp_dir"] = "Temporary directory. String."
 969    defaults["text_offset"] = 5  # gap between text and dimension line
 970    defaults_help["text_offset"] = "Text offset. Positive float. Length in <points>."
 971    defaults["text_width"] = None  # width of the text box
 972    defaults_help["text_width"] = "Text width. Positive float. Length in <points>."
 973    defaults["tikz_libraries"] = [
 974        "plotmarks",
 975        "calc",
 976        "shapes.multipart",
 977        "arrows",
 978        "decorations.pathmorphing",
 979        "decorations.markings",
 980        "backgrounds",
 981        "patterns",
 982        "patterns.meta",
 983        "shapes",
 984        "shadings",
 985    ]
 986    defaults_help["tikz_libraries"] = "TikZ libraries. List of strings."
 987    defaults["tikz_nround"] = 3
 988    defaults_help["tikz_nround"] = (
 989        "Number of decimal places to round floats in TikZ. Positive integer."
 990    )
 991    defaults["tikz_scale"] = 1
 992    defaults_help["tikz_scale"] = "TikZ scale. Positive float."
 993    defaults["tol"] = 0.005  # used for comparing angles and collinearity
 994    defaults_help["tol"] = "Tolerance. Positive float. Length in <points>."
 995    defaults["underline"] = False
 996    defaults_help["underline"] = (
 997        "Boolean property for underline. If True, underline is used."
 998    )
 999    defaults["use_packages"] = ["tikz", "pgf"]
1000    defaults_help["use_packages"] = "Use packages. List of strings."
1001    defaults["validate"] = False
1002    defaults_help["validate"] = (
1003        "Boolean property for validating. If True, validation is used."
1004    )
1005    defaults["visible"] = True
1006    defaults_help["visible"] = "Boolean property for visible. If True, visible is used."
1007    defaults["xelatex_run_options"] = None
1008    defaults_help["xelatex_run_options"] = "XeLaTeX run options. String."
1009    defaults["x_marker"] = (
1010        2  # a circle with radius=2 will be drawn at each intersection
1011    )
1012    defaults_help["x_marker"] = (
1013        "Marker for intersection points. Positive float. Length in <points>."
1014    )
1015    defaults["x_visible"] = False  # do not show intersection points by default
1016    defaults_help["x_visible"] = (
1017        "Boolean property for visible intersection points. "
1018        "If True, intersection points are visible."
1019    )
1020    # styles need to be set after the defaults are set
1021    defaults["marker_style"] = MarkerStyle()
1022    defaults["line_style"] = LineStyle()
1023    defaults["fill_style"] = FillStyle()
1024    defaults["circle_style"] = ShapeStyle()
1025    defaults["edge_style"] = LineStyle()
1026    defaults["plait_style"] = ShapeStyle()
1027    defaults["section_style"] = LineStyle()
1028    defaults["shape_style"] = ShapeStyle()
1029    defaults["tag_frame_style"] = FrameStyle()
1030    defaults["tag_style"] = TagStyle()
1031
1032
1033
1034    # Populate default_types with corresponding types
1035    default_types["BB_EPSILON"] = float
1036    default_types["INF"] = float
1037    default_types["PRINTTEXOUTPUT"] = bool
1038    default_types["active"] = bool
1039    default_types["all_caps"] = bool
1040    default_types["allow_consec_dup_points"] = bool
1041    default_types["alpha"] = float
1042    default_types["anchor"] = Anchor
1043    default_types["angle_atol"] = float
1044    default_types["angle_rtol"] = float
1045    default_types["angle_tol"] = float
1046    default_types["area_atol"] = float
1047    default_types["area_rtol"] = float
1048    default_types["area_threshold"] = float
1049    default_types["arrow_head_length"] = float
1050    default_types["arrow_head_width"] = float
1051    default_types["atol"] = float
1052    default_types["back_color"] = colors.Color
1053    default_types["back_style"] = BackStyle
1054    default_types["begin_doc"] = str
1055    default_types["begin_tikz"] = str
1056    default_types["blend_mode"] = BlendMode
1057    default_types["bold"] = bool
1058    default_types["border"] = float
1059    default_types["border_size"] = float
1060    default_types["canvas_back_style"] = BackStyle
1061    default_types["canvas_frame_color"] = colors.Color
1062    default_types["canvas_frame_margin"] = float
1063    default_types["canvas_frame_shadow_width"] = float
1064    default_types["canvas_frame_width"] = float
1065    default_types["canvas_size"] = tuple
1066    default_types["circle_radius"] = float
1067    default_types["clip"] = bool
1068    default_types["color"] = colors.Color
1069    default_types["shade_color_wheel"] = bool
1070    default_types["shade_color_wheel_black"] = bool
1071    default_types["shade_color_wheel_white"] = bool
1072    default_types["CS_origin_size"] = float
1073    default_types["CS_origin_color"] = colors.Color
1074    default_types["CS_size"] = float
1075    default_types["CS_line_width"] = float
1076    default_types["CS_x_color"] = colors.Color
1077    default_types["CS_y_color"] = colors.Color
1078    default_types["debug_mode"] = bool
1079    default_types["dist_tol"] = float
1080    default_types["document_class"] = DocumentClass
1081    default_types["document_options"] = list
1082    default_types["dot_color"] = colors.Color
1083    default_types["double_lines"] = bool
1084    default_types["double_distance"] = float
1085    default_types["draw_fillets"] = bool
1086    default_types["draw_frame"] = bool
1087    default_types["draw_markers"] = bool
1088    default_types["ellipse_width_height"] = tuple
1089    default_types["end_doc"] = str
1090    default_types["end_tikz"] = str
1091    default_types["even_odd"] = bool
1092    default_types["ext_length2"] = float
1093    default_types["fill"] = bool
1094    default_types["fill_alpha"] = float
1095    default_types["fill_color"] = colors.Color
1096    default_types["fill_mode"] = FillMode
1097    default_types["fill_blend_mode"] = BlendMode
1098    default_types["fillet_radius"] = float
1099    default_types["font_blend_mode"] = BlendMode
1100    default_types["font_alpha"] = float
1101    default_types["font_color"] = colors.Color
1102    default_types["font_family"] = str
1103    default_types["font_size"] = float
1104    default_types["font_style"] = str
1105    default_types["frame_active"] = bool
1106    default_types["frame_alpha"] = float
1107    default_types["frame_back_alpha"] = float
1108    default_types["frame_back_color"] = colors.Color
1109    default_types["frame_blend_mode"] = BlendMode
1110    default_types["frame_color"] = colors.Color
1111    default_types["frame_draw_fillets"] = bool
1112    default_types["frame_fill"] = bool
1113    default_types["frame_fillet_radius"] = float
1114    default_types["frame_gradient"] = object  # Assuming gradient is a custom object
1115    default_types["frame_inner_sep"] = float
1116    default_types["frame_inner_xsep"] = float
1117    default_types["frame_inner_ysep"] = float
1118    default_types["frame_outer_sep"] = float
1119    default_types["frame_line_cap"] = LineCap
1120    default_types["frame_line_dash_array"] = list
1121    default_types["frame_line_join"] = LineJoin
1122    default_types["frame_line_width"] = float
1123    default_types["frame_min_height"] = float
1124    default_types["frame_min_width"] = float
1125    default_types["frame_min_size"] = float
1126    default_types["frame_pattern"] = object  # Assuming pattern is a custom object
1127    default_types["frame_rounded_corners"] = bool
1128    default_types["frame_shape"] = FrameShape
1129    default_types["frame_smooth"] = bool
1130    default_types["frame_stroke"] = bool
1131    default_types["frame_visible"] = bool
1132    default_types["gap"] = float
1133    default_types["graph_palette"] = list
1134    default_types["grid_back_color"] = colors.Color
1135    default_types["grid_line_color"] = colors.Color
1136    default_types["grid_line_width"] = float
1137    default_types["grid_alpha"] = float
1138    default_types["grid_line_dash_array"] = list
1139    default_types["indices_font_family"] = str
1140    default_types["indices_font_size"] = str
1141    default_types["italic"] = bool
1142    default_types["job_dir"] = str
1143    default_types["keep_aux_files"] = bool
1144    default_types["keep_tex_files"] = bool
1145    default_types["keep_log_files"] = bool
1146    default_types["lace_offset"] = float
1147    default_types["latex_compiler"] = Compiler
1148    default_types["line_alpha"] = float
1149    default_types["line_blend_mode"] = BlendMode
1150    default_types["line_cap"] = LineCap
1151    default_types["line_color"] = colors.Color
1152    default_types["line_dash_array"] = list
1153    default_types["line_dash_phase"] = float
1154    default_types["line_join"] = LineJoin
1155    default_types["line_miter_limit"] = float
1156    default_types["line_width"] = float
1157    default_types["lualatex_run_options"] = str
1158    default_types["main_font"] = str
1159    default_types["margin"] = float
1160    default_types["margin_bottom"] = float
1161    default_types["margin_left"] = float
1162    default_types["margin_right"] = float
1163    default_types["margin_top"] = float
1164    default_types["marker"] = object  # Assuming marker is a custom object
1165    default_types["marker_color"] = colors.Color
1166    default_types["marker_line_style"] = str
1167    default_types["marker_line_width"] = float
1168    default_types["marker_palette"] = list
1169    default_types["marker_radius"] = float
1170    default_types["marker_size"] = float
1171    default_types["marker_type"] = MarkerType
1172    default_types["markers_only"] = bool
1173    default_types["mask"] = object  # Assuming mask is a custom object
1174    default_types["merge"] = bool
1175    default_types["merge_tol"] = float
1176    default_types["mono_font"] = str
1177    default_types["n_arc_points"] = int
1178    default_types["n_circle_points"] = int
1179    default_types["n_bezier_points"] = int
1180    default_types["n_ellipse_points"] = int
1181    default_types["n_hobby_points"] = int
1182    default_types["n_q_bezier_points"] = int
1183    default_types["n_round"] = int
1184    default_types["old_style_nums"] = bool
1185    default_types["orientation"] = PageOrientation
1186    default_types["output_dir"] = str
1187    default_types["overline"] = bool
1188    default_types["overwrite_files"] = bool
1189    default_types["packages"] = list
1190    default_types["page_grid_back_color"] = colors.Color
1191    default_types["page_grid_line_color"] = colors.Color
1192    default_types["page_grid_line_dash_array"] = list
1193    default_types["page_grid_line_width"] = float
1194    default_types["page_grid_spacing"] = float
1195    default_types["page_grid_x_shift"] = float
1196    default_types["page_grid_y_shift"] = float
1197    default_types["page_margins"] = PageMargins
1198    default_types["page_number_position"] = PageNumberPosition
1199    default_types["page_numbering"] = PageNumbering
1200    default_types["page_size"] = PageSize
1201    default_types["pattern_style"] = object  # Assuming pattern style is a custom object
1202    default_types["pattern_type"] = PatternType
1203    default_types["pattern_color"] = colors.Color
1204    default_types["pattern_distance"] = float
1205    default_types["pattern_angle"] = float
1206    default_types["pattern_x_shift"] = float
1207    default_types["pattern_y_shift"] = float
1208    default_types["pattern_line_width"] = float
1209    default_types["pattern_radius"] = float
1210    default_types["pattern_points"] = int
1211    default_types["pdflatex_run_options"] = str
1212    default_types["plait_color"] = colors.Color
1213    default_types["preamble"] = str
1214    default_types["radius_threshold"] = float
1215    default_types["random_marker_colors"] = bool
1216    default_types["random_node_colors"] = bool
1217    default_types["rectangle_width_height"] = tuple
1218    default_types["render"] = str
1219    default_types["rev_arrow_length"] = float
1220    default_types["rtol"] = float
1221    default_types["sans_font"] = str
1222    default_types["save_with_versions"] = bool
1223    default_types["section_color"] = colors.Color
1224    default_types["section_dash_array"] = list
1225    default_types["section_line_cap"] = LineCap
1226    default_types["section_line_join"] = LineJoin
1227    default_types["section_width"] = float
1228    default_types["shade_axis_angle"] = float
1229    default_types["shade_ball_color"] = colors.Color
1230    default_types["shade_bottom_color"] = colors.Color
1231    default_types["shade_inner_color"] = colors.Color
1232    default_types["shade_middle_color"] = colors.Color
1233    default_types["shade_outer_color"] = colors.Color
1234    default_types["shade_left_color"] = colors.Color
1235    default_types["shade_lower_left_color"] = colors.Color
1236    default_types["shade_lower_right_color"] = colors.Color
1237    default_types["shade_right_color"] = colors.Color
1238    default_types["shade_top_color"] = colors.Color
1239    default_types["shade_type"] = ShadeType
1240    default_types["shade_upper_left_color"] = colors.Color
1241    default_types["shade_upper_right_color"] = colors.Color
1242    default_types["show_browser"] = bool
1243    default_types["show_log_on_console"] = bool
1244    default_types["slanted"] = bool
1245    default_types["small_caps"] = bool
1246    default_types["smooth"] = bool
1247    default_types["strike_through"] = bool
1248    default_types["stroke"] = bool
1249    default_types["swatch"] = list
1250    default_types["tag_align"] = Align
1251    default_types["tag_alpha"] = float
1252    default_types["tag_blend_mode"] = BlendMode
1253    default_types["temp_dir"] = str
1254    default_types["text_offset"] = float
1255    default_types["text_width"] = float
1256    default_types["tikz_libraries"] = list
1257    default_types["tikz_nround"] = int
1258    default_types["tikz_scale"] = float
1259    default_types["tol"] = float
1260    default_types["underline"] = bool
1261    default_types["use_packages"] = list
1262    default_types["validate"] = bool
1263    default_types["visible"] = bool
1264    default_types["xelatex_run_options"] = str
1265    default_types["x_marker"] = float
1266    default_types["x_visible"] = bool

Sets the default values for the Simetri library.

tikz_defaults = defaultdict(<class 'str'>, {'color': Color(0.0, 0.0, 0.0), 'line width': 1, 'line cap': <LineCap.BUTT: 'butt'>, 'line join': <LineJoin.MITER: 'miter'>, 'fill': Color(0.0, 0.0, 0.0), 'fill opacity': 1, 'draw': Color(0.0, 0.0, 0.0), 'miter limit': 10, 'dash pattern': [], 'dash phase': 0, 'blend mode': <BlendMode.NORMAL: 'normal'>, 'font': '', 'font size': 12, 'font color': Color(0.0, 0.0, 0.0), 'font opacity': 1, 'text opacity': 1, 'rotate': 0})
def set_tikz_defaults():
1272def set_tikz_defaults():
1273    """Sets the default values for the TikZ objects."""
1274    from ..colors import colors
1275    from ..graphics.all_enums import LineCap, LineJoin, BlendMode
1276
1277    tikz_defaults.update(
1278        {
1279            "color": colors.black,
1280            "line width": 1,
1281            "line cap": LineCap.BUTT,
1282            "line join": LineJoin.MITER,
1283            "fill": colors.black,
1284            "fill opacity": 1,
1285            "draw": colors.black,
1286            "miter limit": 10,
1287            "dash pattern": [],
1288            "dash phase": 0,
1289            "blend mode": BlendMode.NORMAL,
1290            "font": "",
1291            "font size": 12,
1292            "font color": colors.black,
1293            "font opacity": 1,
1294            "text opacity": 1,
1295            "rotate": 0,
1296        }
1297    )

Sets the default values for the TikZ objects.