Shapes

class leather.Shape

Bases: object

Base class for shapes that can be used to render data Series.

legend_to_svg(series, palette)

Render the legend entries for these shapes.

to_svg(width, height, x_scale, y_scale, series, palette)

Render this shape to an SVG.

validate_series(series)

Verify this shape can be used to render a given series.

class leather.Bars(fill_color=None)

Bases: leather.shapes.base.Shape

Render a series of data as bars.

Parameters:fill_color – The color to fill the bars. You may also specify a style_function().
to_svg(width, height, x_scale, y_scale, series, palette)

Render bars to SVG elements.

validate_series(series)

Verify this shape can be used to render a given series.

class leather.Columns(fill_color=None)

Bases: leather.shapes.base.Shape

Render a series of data as columns.

Parameters:fill_color – The color to fill the columns. You may also specify a style_function().
to_svg(width, height, x_scale, y_scale, series, palette)

Render columns to SVG elements.

validate_series(series)

Verify this shape can be used to render a given series.

class leather.Dots(fill_color=None, radius=None)

Bases: leather.shapes.base.Shape

Render a series of data as dots.

Parameters:
legend_to_svg(series, palette)

Render the legend entries for these shapes.

to_svg(width, height, x_scale, y_scale, series, palette)

Render dots to SVG elements.

validate_series(series)

Verify this shape can be used to render a given series.

class leather.Line(stroke_color=None, width=None)

Bases: leather.shapes.base.Shape

Render a series of data as a line.

Parameters:
  • stroke_color – The color to stroke the lines. If not provided, default chart colors will be used.
  • width – The width of the lines. Defaults to theme.default_line_width.
to_svg(width, height, x_scale, y_scale, series, palette)

Render lines to SVG elements.

validate_series(series)

Verify this shape can be used to render a given series.

leather.style_function(datum)

This example shows how to define a function to specify style values for individual data points.

Parameters:datum – A Datum instance for the data row.