Skip to content

Commit

Permalink
chore: Don't set constants in theme.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Oct 23, 2023
1 parent c5443d8 commit 8252e56
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ Style attributes of individual data points can be set by value using a :func:`.s
.. figure:: ../examples/charts/colorized_dots.svg

Creating dashed lines
----------------------------
---------------------

When adding a line using :meth:`.Chart.add_line` you can set the `stroke_dasharray` property. More details on the property `here <https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray>`_.
When using :meth:`.Chart.add_line`, you can set the `stroke_dasharray property <https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray>`_.

.. literalinclude:: ../examples/lines_dashes.py
:language: python
Expand Down
2 changes: 1 addition & 1 deletion leather/shapes/line.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _new_path(self, stroke_color):
fill='none'
)
path.set('stroke-width', str(self._width))
if self._stroke_dasharray != theme.STROKE_DASHARRAY_NONE:
if self._stroke_dasharray != 'none':
path.set('stroke-dasharray', self._stroke_dasharray)

return path
Expand Down
3 changes: 1 addition & 2 deletions leather/theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,4 @@
default_line_width = 2

#: Default stroke-dasharray property when using dashes on a line
STROKE_DASHARRAY_NONE = 'none'
default_stroke_dasharray = STROKE_DASHARRAY_NONE
default_stroke_dasharray = 'none'

0 comments on commit 8252e56

Please sign in to comment.