@@ -48,23 +48,23 @@ class Cartesian(Widget):
48
48
:param int y: y position of the plane origin
49
49
50
50
:param int background_color: background color to use defaults to black (0x000000)
51
- :param int width: requested width, in pixels defaults to 100 pixels
52
- :param int height: requested height, in pixels defaults to 100 pixels
51
+ :param int width: requested width, in pixels.
52
+ :param int height: requested height, in pixels.
53
53
54
- :param (int, int) xrange: X axes range
55
- :param (int, int) yrange: Y axes range
54
+ :param (int, int) xrange: X axes range. Defaults to (0, 100)
55
+ :param (int, int) yrange: Y axes range. Defaults to (0, 100)
56
56
57
57
:param int axes_color: axes lines color defaults to white (0xFFFFFF)
58
58
:param int axes_stroke: axes lines thickness in pixels defaults to 2
59
59
60
- :param int major_tick_stroke: tick lines thickness in pixels dafaults to 1
60
+ :param int major_tick_stroke: tick lines thickness in pixels defaults to 1
61
61
:param int major_tick_length: tick lines length in pixels defaults to 5
62
62
63
63
:param int tick_label_font: tick label text font
64
- :param int font_color: font color
64
+ :param int font_color: font color. Defaults to white (0xFFFFFF)
65
65
66
66
:param int pointer_radius: pointer radius in pixels defaults to 1
67
- :param int pointer_color: pointer color defaults to white (0xFFFFFF)
67
+ :param int pointer_color: pointer color. Defaults to white (0xFFFFFF)
68
68
69
69
70
70
**Quickstart: Importing and using Cartesian**
@@ -105,6 +105,27 @@ class Cartesian(Widget):
105
105
display.show(my_group) # add the group to the display
106
106
107
107
108
+ **Summary: Cartesian Features and input variables**
109
+
110
+ The `cartesian` widget has some options for controlling its position, visible appearance,
111
+ and scale through a collection of input variables:
112
+
113
+ - **position**: ``x``, ``y`` or ``anchor_point`` and ``anchored_position``
114
+
115
+ - **size**: ``width`` and ``height``
116
+
117
+ - **color**: ``axes_color``, ``font_color``, ``tick_color``, ``pointer_color``
118
+
119
+ - **background color**: ``background_color``
120
+
121
+ - **linewidths**: ``axes_stroke`` and ``major_tick_stroke``
122
+
123
+ - **range**: ``xrange`` and ``yrange`` This is the range in absolute units.
124
+ For example, when using (20-90), the X axis will start at 20 finishing at 90.
125
+ However the height of the graph is given by the height parameter. The scale
126
+ is handled internal to provide a 1:1 experience when you update the graph.
127
+
128
+
108
129
.. figure:: cartesian.gif
109
130
:scale: 100 %
110
131
:figwidth: 50%
@@ -134,7 +155,7 @@ class Cartesian(Widget):
134
155
135
156
def __init__ (
136
157
self ,
137
- background_color = 0x000000 ,
158
+ background_color : int = 0x000000 ,
138
159
xrange : Tuple [int , int ] = (0 , 100 ),
139
160
yrange : Tuple [int , int ] = (0 , 100 ),
140
161
axes_color : int = 0xFFFFFF ,
@@ -465,9 +486,10 @@ def set_widget_style(self, new_style: str) -> None:
465
486
try :
466
487
from adafruit_styles import get_hex
467
488
from adafruit_styles import styles
489
+
490
+ colorset = styles .THEME
491
+ self ._pointer_color = get_hex (colorset [new_style ]["TEXT" ])
492
+ self ._font_color = get_hex (colorset [new_style ]["TEXT" ])
493
+ self ._draw_ticks ()
468
494
except ImportError :
469
- pass
470
- colorset = styles .THEME
471
- self ._pointer_color = get_hex (colorset [new_style ]["TEXT" ])
472
- self ._font_color = get_hex (colorset [new_style ]["TEXT" ])
473
- self ._draw_ticks ()
495
+ print ("This feature is not yet implemented" )
0 commit comments