pax_global_header 0000666 0000000 0000000 00000000064 14515550103 0014511 g ustar 00root root 0000000 0000000 52 comment=372e49611c40e50bfc8b223329879164da2d5014
leather-0.4.0/ 0000775 0000000 0000000 00000000000 14515550103 0013136 5 ustar 00root root 0000000 0000000 leather-0.4.0/.github/ 0000775 0000000 0000000 00000000000 14515550103 0014476 5 ustar 00root root 0000000 0000000 leather-0.4.0/.github/workflows/ 0000775 0000000 0000000 00000000000 14515550103 0016533 5 ustar 00root root 0000000 0000000 leather-0.4.0/.github/workflows/ci.yml 0000664 0000000 0000000 00000001341 14515550103 0017650 0 ustar 00root root 0000000 0000000 name: CI
on: [push, pull_request]
jobs:
build:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
python-version: [3.8, 3.9, '3.10', '3.11', '3.12', pypy-3.9]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: setup.py
- run: pip install .[test] coveralls
- run: pytest --cov leather
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coveralls --service=github
leather-0.4.0/.github/workflows/lint.yml 0000664 0000000 0000000 00000001174 14515550103 0020227 0 ustar 00root root 0000000 0000000 name: Lint
on: [push, pull_request]
env:
BASEDIR: https://raw.githubusercontent.com/open-contracting/standard-maintenance-scripts/main
jobs:
build:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: pip
cache-dependency-path: setup.py
- run: pip install --upgrade check-manifest flake8 isort setuptools
- run: check-manifest
- run: flake8 .
- run: isort . --check-only
leather-0.4.0/.github/workflows/pypi.yml 0000664 0000000 0000000 00000001326 14515550103 0020241 0 ustar 00root root 0000000 0000000 name: Publish to PyPI
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: pip install --upgrade build
- run: python -m build --sdist --wheel
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
skip-existing: true
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
leather-0.4.0/.gitignore 0000664 0000000 0000000 00000000150 14515550103 0015122 0 ustar 00root root 0000000 0000000 .DS_Store
*.pyc
*.swp
*.swo
*.egg-info
docs/_build
dist
.coverage
build
.proof
.ipynb_checkpoints
.idea
leather-0.4.0/.readthedocs.yaml 0000664 0000000 0000000 00000000253 14515550103 0016365 0 ustar 00root root 0000000 0000000 version: 2
build:
os: ubuntu-20.04
tools:
python: "3.9"
python:
install:
- path: .
- requirements: docs/requirements.txt
sphinx:
fail_on_warning: true
leather-0.4.0/AUTHORS.rst 0000664 0000000 0000000 00000001044 14515550103 0015014 0 ustar 00root root 0000000 0000000 The following individuals have contributed code, documentation, or expertise to leather:
* `Christopher Groskopf `_
* `Peter M. Landwehr `_
* `Ghislain Vaillant `_
* `Todd `_
* `Loïc Corbasson `_
* `Brian `_
* `James McKinney `_
* `Tim Gates `_
* `Mathias `_
leather-0.4.0/CHANGELOG.rst 0000664 0000000 0000000 00000005265 14515550103 0015167 0 ustar 00root root 0000000 0000000 0.4.0 - October 23, 2023
------------------------
* feat: :meth:`.Chart.add_line` accepts a `stroke_dasharray argument `_.
* feat: Add a ``default_stroke_dasharray`` theme option.
* fix: Apply the ``axis_title_font_size`` and ``tick_font_size`` theme options.
0.3.5 - October 23, 2023
------------------------
* Leather no longer reconfigures Python warnings globally.
* Add Python 3.11 and 3.12 support.
* Drop Python 3.7 support (end-of-life was June 27, 2023).
0.3.4 - October 8, 2021
-----------------------
* Add Python 3.10 support.
0.3.3 - November 30, 2016
-------------------------
* Fix examples that used invalid column data. (#81)
* lxml is no longer imported by default. (#83)
* Ordinal scales can now display data from multiple series with different values. (#76)
* Better error handling for data types supported by different shapes.
0.3.2 - November 11, 2016
-------------------------
* Fix trove classifiers.
0.3.1 - November 11, 2016
-------------------------
* Fix unicode rendering issue in Python2.7 and PyPy. (#74)
0.3.0 - November 11, 2016
-------------------------
* Add examples for many more use-cases. (#11)
* Fixed bars so that data are displayed top-down when using :meth:`.Chart.add_bars`. (#72)
* Changed default colors. (#51)
* Fixed a rare file handling bug when saving SVG files.
* Leather will now issue a warning if you attempt to render a chart with data exceeding the scale domain. (#42)
* Linear scales will now default to the domain :code:`[0, 1]` if no values are provided. (#66)
* Axis no longer takes a number of ticks as an argument. Instead pass a list of custom tick values.
* Scales :code:`tick` methods no longer take a number of ticks as an argument. (They should self-optimize.)
* Scales that cross :code:`0` will now always have a tick at :code:`0`. (#54)
* Implemented auto-ticking. (#23)
* :func:`.style_function` now takes a :class:`.Datum` instances, rather than a list of arguments.
* Renamed the :code:`Lines` class to :class:`.Line` to be more accurate.
* Implemented :class:`.CategorySeries`.
* Implemented a more elegant pattern for colorizing series.
* Refactored :class:`.Series` so :class:`.Shape` is no longer a parameter.
* Tick values can now be overridden with the :code:`tick_values` argument. (#56)
* Added methods to customize scales and axes for :class:`.Lattice` charts. (#17)
* Expanded unit tests for :class:`.Scale` subclasses.
* Zero lines now render above other tick marks. (#31)
* Fixed rendering of :class:`.Bar` and :class:`.Column` shapes for negative values. (#52)
* Refactored the :class:`.Lattice` API.
0.2.0
-----
* Initial prototype
0.1.0
-----
* Never released
leather-0.4.0/COPYING 0000664 0000000 0000000 00000002113 14515550103 0014166 0 ustar 00root root 0000000 0000000 The MIT License
Copyright (c) 2016 Christopher Groskopf and contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
leather-0.4.0/MANIFEST.in 0000664 0000000 0000000 00000000620 14515550103 0014672 0 ustar 00root root 0000000 0000000 include *.py
include *.rst
include *.sh
include COPYING
recursive-include docs *.py
recursive-include docs *.rst
recursive-include docs *.txt
recursive-include docs Makefile
recursive-include examples *.csv
recursive-include examples *.md
recursive-include examples *.placeholder
recursive-include examples *.py
recursive-include examples *.svg
recursive-include tests *.py
exclude .readthedocs.yaml
leather-0.4.0/README.rst 0000664 0000000 0000000 00000002466 14515550103 0014635 0 ustar 00root root 0000000 0000000 .. image:: https://github.com/wireservice/leather/workflows/CI/badge.svg
:target: https://github.com/wireservice/leather/actions
:alt: Build status
.. image:: https://coveralls.io/repos/wireservice/leather/badge.svg?branch=master
:target: https://coveralls.io/r/wireservice/leather
:alt: Coverage status
.. image:: https://img.shields.io/pypi/dw/leather.svg
:target: https://pypi.python.org/pypi/leather
:alt: PyPI downloads
.. image:: https://img.shields.io/pypi/v/leather.svg
:target: https://pypi.python.org/pypi/leather
:alt: Version
.. image:: https://img.shields.io/pypi/l/leather.svg
:target: https://pypi.python.org/pypi/leather
:alt: License
.. image:: https://img.shields.io/pypi/pyversions/leather.svg
:target: https://pypi.python.org/pypi/leather
:alt: Support Python versions
Leather is the Python charting library for those who need charts *now* and don't care if they're perfect.
Leather isn't picky. It's rough. It gets dirty. It looks sexy just hanging on the back of a chair. Leather doesn't need your accessories. Leather is how Snake Plissken would make charts.
Get it?
Important links:
* Documentation: https://leather.rtfd.io
* Repository: https://github.com/wireservice/leather
* Issues: https://github.com/wireservice/leather/issues
leather-0.4.0/docs/ 0000775 0000000 0000000 00000000000 14515550103 0014066 5 ustar 00root root 0000000 0000000 leather-0.4.0/docs/Makefile 0000664 0000000 0000000 00000010762 14515550103 0015534 0 ustar 00root root 0000000 0000000 # Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
help:
@echo "Please use \`make ' where is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
clean:
-rm -rf $(BUILDDIR)/*
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/leather.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/leather.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/leather"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/leather"
@echo "# devhelp"
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
make -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
leather-0.4.0/docs/about.rst 0000664 0000000 0000000 00000001066 14515550103 0015735 0 ustar 00root root 0000000 0000000 =============
About leather
=============
Why leather?
============
* A readable and user-friendly API.
* Optimized for exploratory charting.
* Produces scale-independent SVG charts.
* Completely type-agnostic. Chart your data, whatever it is.
* Designed with `iPython `_, `Jupyter `_ and `atom/hydrogen `_ in mind.
* Pure Python. No C dependencies to compile.
* MIT licensed and free for all purposes.
* Zealously `zen `_.
* Made with love.
leather-0.4.0/docs/api.rst 0000664 0000000 0000000 00000000237 14515550103 0015373 0 ustar 00root root 0000000 0000000 ===
API
===
.. toctree::
:maxdepth: 1
api/chart
api/grid
api/lattice
api/scales
api/axis
api/series
api/shapes
api/theme
leather-0.4.0/docs/api/ 0000775 0000000 0000000 00000000000 14515550103 0014637 5 ustar 00root root 0000000 0000000 leather-0.4.0/docs/api/axis.rst 0000664 0000000 0000000 00000000133 14515550103 0016332 0 ustar 00root root 0000000 0000000 ====
Axis
====
.. automodule:: leather.axis
:no-members:
.. autoclass:: leather.Axis
leather-0.4.0/docs/api/chart.rst 0000664 0000000 0000000 00000001266 14515550103 0016477 0 ustar 00root root 0000000 0000000 =====
Chart
=====
.. automodule:: leather.chart
:no-members:
.. autosummary::
:nosignatures:
leather.Chart
Adding data
-----------
.. autosummary::
:nosignatures:
leather.Chart.add_series
leather.Chart.add_bars
leather.Chart.add_columns
leather.Chart.add_dots
leather.Chart.add_line
Customizing
-----------
.. autosummary::
:nosignatures:
leather.Chart.set_x_scale
leather.Chart.set_y_scale
leather.Chart.set_x_axis
leather.Chart.set_y_axis
Rendering
---------
.. autosummary::
:nosignatures:
leather.Chart.to_svg
leather.Chart.to_svg_group
Detailed list
-------------
.. autoclass:: leather.Chart
:members:
leather-0.4.0/docs/api/grid.rst 0000664 0000000 0000000 00000000133 14515550103 0016313 0 ustar 00root root 0000000 0000000 ====
Grid
====
.. automodule:: leather.grid
:no-members:
.. autoclass:: leather.Grid
leather-0.4.0/docs/api/lattice.rst 0000664 0000000 0000000 00000000152 14515550103 0017014 0 ustar 00root root 0000000 0000000 =======
Lattice
=======
.. automodule:: leather.lattice
:no-members:
.. autoclass:: leather.Lattice
leather-0.4.0/docs/api/scales.rst 0000664 0000000 0000000 00000000304 14515550103 0016640 0 ustar 00root root 0000000 0000000 ======
Scales
======
.. automodule:: leather.scales
:no-members:
.. autoclass:: leather.Scale
.. autoclass:: leather.Linear
.. autoclass:: leather.Ordinal
.. autoclass:: leather.Temporal
leather-0.4.0/docs/api/series.rst 0000664 0000000 0000000 00000000215 14515550103 0016661 0 ustar 00root root 0000000 0000000 ======
Series
======
.. automodule:: leather.series
:no-members:
.. autoclass:: leather.Series
.. autofunction:: leather.key_function
leather-0.4.0/docs/api/shapes.rst 0000664 0000000 0000000 00000000405 14515550103 0016653 0 ustar 00root root 0000000 0000000 ======
Shapes
======
.. automodule:: leather.shapes
:no-members:
.. autoclass:: leather.Shape
.. autoclass:: leather.Bars
.. autoclass:: leather.Columns
.. autoclass:: leather.Dots
.. autoclass:: leather.Line
.. autofunction:: leather.style_function
leather-0.4.0/docs/api/theme.rst 0000664 0000000 0000000 00000000123 14515550103 0016467 0 ustar 00root root 0000000 0000000 =====
Theme
=====
.. automodule:: leather.theme
:members:
:undoc-members:
leather-0.4.0/docs/changelog.rst 0000664 0000000 0000000 00000000075 14515550103 0016551 0 ustar 00root root 0000000 0000000 =========
Changelog
=========
.. include:: ../CHANGELOG.rst
leather-0.4.0/docs/conf.py 0000664 0000000 0000000 00000002424 14515550103 0015367 0 ustar 00root root 0000000 0000000 # Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
project = 'leather'
copyright = '2016, Christopher Groskopf'
version = '0.4.0'
release = version
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = [
'sphinx.ext.autosummary',
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx'
]
templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = 'furo'
htmlhelp_basename = 'leatherdoc'
autodoc_default_options = {
'members': None,
'member-order': 'bysource',
'show-inheritance': True,
}
intersphinx_mapping = {
'python': ('https://docs.python.org/3', None)
}
leather-0.4.0/docs/examples.rst 0000664 0000000 0000000 00000013006 14515550103 0016436 0 ustar 00root root 0000000 0000000 ========
Examples
========
Data series
===========
Simple pairs
------------
.. literalinclude:: ../examples/simple_pairs.py
:language: python
.. figure:: ../examples/charts/simple_pairs.svg
Table from csv.reader
---------------------
Sequence row data, such as is returned by :func:`csv.reader` can be accessed by specifying the indices of the columns containing the :code:`x` and :code:`y` values.
Note that leather does not automatically convert numerical strings, such as those stored in a CSV. If you want that you'll need to use a smarter table reader, such as `agate `_
.. literalinclude:: ../examples/csv_reader.py
:language: python
.. figure:: ../examples/charts/csv_reader.svg
Table from csv.DictReader
-------------------------
Dict row data, such as is returned by :class:`csv.DictReader` can be accessed by specifying the indices of the columns containing the :code:`x` and :code:`y` values.
See previous example for note on strings from CSVs.
.. literalinclude:: ../examples/csv_dict_reader.py
:language: python
.. figure:: ../examples/charts/csv_dict_reader.svg
Custom data
-----------
Completely custom data formats are also supported via accessor functions.
.. literalinclude:: ../examples/custom_data.py
:language: python
.. figure:: ../examples/charts/custom_data.svg
Multiple series
---------------
Multiple data series can be displayed on a single chart so long as they all use the same type of :class:`.Scale`.
.. literalinclude:: ../examples/multiple_series.py
:language: python
.. figure:: ../examples/charts/multiple_series.svg
Shapes
======
Bars
----
.. literalinclude:: ../examples/bars.py
:language: python
.. figure:: ../examples/charts/bars.svg
Columns
-------
.. literalinclude:: ../examples/columns.py
:language: python
.. figure:: ../examples/charts/columns.svg
Dots
----
.. literalinclude:: ../examples/dots.py
:language: python
.. figure:: ../examples/charts/dots.svg
Lines
-----
.. literalinclude:: ../examples/lines.py
:language: python
.. figure:: ../examples/charts/lines.svg
Mixing shapes
-------------
You can mix different shapes for different series on the same chart.
.. literalinclude:: ../examples/mixed_shapes.py
:language: python
.. figure:: ../examples/charts/mixed_shapes.svg
Scales
======
Linear
------
When using numerical data :class:`.Linear` scales are created automatically and by default. You may override the domain by adding a scale manually.
.. literalinclude:: ../examples/linear.py
:language: python
.. figure:: ../examples/charts/linear.svg
Ordinal
-------
When using text data :class:`.Ordinal` scales are created automatically and by default. It is generally not useful to override these defaults.
.. literalinclude:: ../examples/ordinal.py
:language: python
.. figure:: ../examples/charts/ordinal.svg
Temporal
--------
When using date/time data :class:`.Temporal` scales are created automatically and by default. You may override the domain by adding a scale manually.
.. literalinclude:: ../examples/temporal.py
:language: python
.. figure:: ../examples/charts/temporal.svg
Axes
====
Changing tick values
--------------------
You can change the list of ticks that are displayed using :meth:`.Chart.add_x_axis` and :meth:`.Chart.add_y_axis` methods. This will not adjust automatically adjust the scale, so it is possible to pick tick values that are not displayed.
.. literalinclude:: ../examples/ticks.py
:language: python
.. figure:: ../examples/charts/ticks.svg
Customizing tick format
-----------------------
You can provide a tick formatter method to change how ticks are displayed using the :meth:`.Chart.add_x_axis` and :meth:`.Chart.add_y_axis` methods.
.. literalinclude:: ../examples/tick_format.py
:language: python
.. figure:: ../examples/charts/tick_format.svg
Styling
=======
Changing theme values
---------------------
Chart styles are set using a dead simple :mod:`.theme` system. Leather is meant for making quick and dirty charts. It is neither expected nor recommended for user's to customize these styles.
.. literalinclude:: ../examples/theme.py
:language: python
.. figure:: ../examples/charts/theme.svg
Changing series colors
----------------------
More practically, individual default :class:`.Series` colors can be overridden when they are created.
.. literalinclude:: ../examples/series_color.py
:language: python
.. figure:: ../examples/charts/series_color.svg
Styling data based on value
---------------------------
Style attributes of individual data points can be set by value using a :func:`.style_function`.
.. literalinclude:: ../examples/colorized_dots.py
:language: python
.. figure:: ../examples/charts/colorized_dots.svg
Creating dashed lines
---------------------
When using :meth:`.Chart.add_line`, you can set the `stroke_dasharray property `_.
.. literalinclude:: ../examples/lines_dashes.py
:language: python
.. figure:: ../examples/charts/lines_dashes.svg
Chart grids
===========
With mixed scales
-----------------
You can add charts of completely different types to a single graphic by using :class:`.Grid`.
.. literalinclude:: ../examples/grid.py
:language: python
.. figure:: ../examples/charts/grid.svg
With consistent scales
----------------------
A grid of charts can automatically be synchronized to a consistent view using :class:`.Lattice`.
.. literalinclude:: ../examples/lattice.py
:language: python
.. figure:: ../examples/charts/lattice.svg
leather-0.4.0/docs/index.rst 0000664 0000000 0000000 00000002105 14515550103 0015725 0 ustar 00root root 0000000 0000000 =================
leather |release|
=================
.. include:: ../README.rst
.. toctree::
:hidden:
:maxdepth: 2
about
install
examples
api
changelog
release_process
license
Show me docs
============
* `About `_ - why you should use leather
* `Install `_ - how to install for users and developers
* `Examples `_ - code + output examples of every feature of leather
* `API `_ - technical documentation for the leather API
* `Changelog `_ - a record of every change made for each release
Show me code
============
.. literalinclude:: ../examples/colorized_dots.py
:language: python
.. figure:: ../examples/charts/colorized_dots.svg
Join us
=======
* `Release process `_ - the process for maintainers to publish new releases
* `License `_ - a copy of the MIT open source license covering leather
Who we are
==========
.. include:: ../AUTHORS.rst
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
leather-0.4.0/docs/install.rst 0000664 0000000 0000000 00000001521 14515550103 0016265 0 ustar 00root root 0000000 0000000 ============
Installation
============
Users
-----
To use leather install it with pip::
pip install leather
Developers
----------
If you are a developer that also wants to hack on leather, install it from git::
git clone git://github.com/wireservice/leather.git
cd leather
mkvirtualenv leather
pip install -e .[test]
python setup.py develop
.. note::
To run the leather tests with coverage::
pytest --cov leather
Supported platforms
-------------------
leather supports the following versions of Python:
* Python 2.7
* Python 3.3+
* `PyPy `_
It is tested primarily on OSX, but due to its minimal dependencies it should work on both Linux and Windows.
.. note::
`iPython `_ or `Jupyter `_ user? Leather works great there too.
leather-0.4.0/docs/license.rst 0000664 0000000 0000000 00000000061 14515550103 0016237 0 ustar 00root root 0000000 0000000 =======
License
=======
.. include:: ../COPYING
leather-0.4.0/docs/release_process.rst 0000664 0000000 0000000 00000002225 14515550103 0017777 0 ustar 00root root 0000000 0000000 ===============
Release process
===============
This is the release process for leather:
1. Verify all tests pass.
2. Check test coverage: ``pytest --cov leather``.
3. Ensure any new modules have been added to setup.py's ``packages`` list.
#. Ensure any new public interfaces have been added to the documentation.
#. Make sure the example scripts still work: ``./examples.sh``.
#. Ensure ``CHANGELOG.rst`` is up to date. Add the release date and summary.
#. Create a release tag: ``git tag -a x.y.z -m "x.y.z release."``
#. Push tags upstream: ``git push --tags``
#. If this is a major release, merge ``master`` into ``stable``: ``git checkout stable; git merge master; git push``
#. Upload to `PyPI `_: ``python setup.py sdist bdist_wheel upload``.
#. Flag the release to build on `RTFD `_.
#. Update the "default version" on `RTFD `_ to the latest.
#. Rev to latest version: ``docs/conf.py``, ``setup.py`` and ``CHANGELOG.rst`` need updates.
#. Commit revision: ``git commit -am "Update to version x.y.z for development."``.
leather-0.4.0/docs/requirements.txt 0000664 0000000 0000000 00000000035 14515550103 0017350 0 ustar 00root root 0000000 0000000 furo
sphinx>2
docutils>=0.18
leather-0.4.0/examples.sh 0000775 0000000 0000000 00000000157 14515550103 0015316 0 ustar 00root root 0000000 0000000 #!/bin/bash
export PYTHONPATH="$PYTHONPATH:$(pwd)"
for f in examples/*.py; do
echo $f
python $f
done
leather-0.4.0/examples/ 0000775 0000000 0000000 00000000000 14515550103 0014754 5 ustar 00root root 0000000 0000000 leather-0.4.0/examples/bars.py 0000664 0000000 0000000 00000000271 14515550103 0016255 0 ustar 00root root 0000000 0000000 import leather
data = [
(3, 'Hello'),
(5, 'How'),
(9, 'Are'),
(4, 'You')
]
chart = leather.Chart('Bars')
chart.add_bars(data)
chart.to_svg('examples/charts/bars.svg')
leather-0.4.0/examples/charts/ 0000775 0000000 0000000 00000000000 14515550103 0016240 5 ustar 00root root 0000000 0000000 leather-0.4.0/examples/charts/.placeholder 0000664 0000000 0000000 00000000000 14515550103 0020511 0 ustar 00root root 0000000 0000000 leather-0.4.0/examples/charts/bars.svg 0000664 0000000 0000000 00000005165 14515550103 0017717 0 ustar 00root root 0000000 0000000