oioioi.statistics.plottypes

Module Contents

Classes

PlotType

PlainTextPlot

Uses the following keys from :param data:

TablePlot

Uses the following keys from :param data: :

StaticHighchartsPlot

Base class for static (non-updating) plots using Highcharts library.

ColumnStaticHighchartsPlot

Uses the following extra keys from :param data: :

BarPercentStaticHighchartsPlot

Uses the following extra keys from :param data: :

XYStaticHighchartsPlot

Base class for static (non-updating) plots using Highcharts library.

PointsToSourceLengthProblemPlot

Base class for static (non-updating) plots using Highcharts library.

class oioioi.statistics.plottypes.PlotType[source]

Bases: object

head_libraries()[source]

Returns a list containing paths to all CSS and JS files required to plot data. The paths should be relative to static folder. The list will be converted to HTML by controller.

Currently supported extensions: .css, .js

abstract render_plot(request, data, plot_id)[source]

Renders an instance of a plot to HTML.

Parameters
  • data (Dict) – Dict describing a plot, specific for plot type.

  • plot_id – Unique number used to create a ‘namespace’ in HTML. For example, Highcharts JS use an id attribute to identify div containing the plot.

class oioioi.statistics.plottypes.PlainTextPlot[source]

Bases: PlotType

Uses the following keys from :param data:: text plain text to be displayed

render_plot(request, data, plot_id)[source]

Renders an instance of a plot to HTML.

Parameters
  • data (Dict) – Dict describing a plot, specific for plot type.

  • plot_id – Unique number used to create a ‘namespace’ in HTML. For example, Highcharts JS use an id attribute to identify div containing the plot.

class oioioi.statistics.plottypes.TablePlot[source]

Bases: PlotType

Uses the following keys from :param data: :

keys list of headers series list of series names data rectantular array of data plot_name table name to be used as a caption

head_libraries()[source]

Returns a list containing paths to all CSS and JS files required to plot data. The paths should be relative to static folder. The list will be converted to HTML by controller.

Currently supported extensions: .css, .js

render_plot(request, data, plot_id)[source]

Renders an instance of a plot to HTML.

Parameters
  • data (Dict) – Dict describing a plot, specific for plot type.

  • plot_id – Unique number used to create a ‘namespace’ in HTML. For example, Highcharts JS use an id attribute to identify div containing the plot.

class oioioi.statistics.plottypes.StaticHighchartsPlot[source]

Bases: PlotType

Base class for static (non-updating) plots using Highcharts library. Uses the following keys from :param data: :

  • series list of series names

  • data rectantular array of data

  • titles dictionary of axes titles

  • x_min, y_min, x_max, y_max fixed axes bounds

  • series_extra_options list of extra options for each serie

  • highcharts_extra_options hook for adding extra Highcharts options

head_libraries()[source]

Returns a list containing paths to all CSS and JS files required to plot data. The paths should be relative to static folder. The list will be converted to HTML by controller.

Currently supported extensions: .css, .js

highcharts_options(data)[source]

Function generating options for Highcharts chart, as specified in http://www.highcharts.com/docs/getting-started/how-to-set-options

render_plot(request, data, plot_id)[source]

Renders an instance of a plot to HTML.

Parameters
  • data (Dict) – Dict describing a plot, specific for plot type.

  • plot_id – Unique number used to create a ‘namespace’ in HTML. For example, Highcharts JS use an id attribute to identify div containing the plot.

class oioioi.statistics.plottypes.ColumnStaticHighchartsPlot[source]

Bases: StaticHighchartsPlot

Uses the following extra keys from :param data: :

keys list of column names

highcharts_options(data)[source]

Function generating options for Highcharts chart, as specified in http://www.highcharts.com/docs/getting-started/how-to-set-options

class oioioi.statistics.plottypes.BarPercentStaticHighchartsPlot[source]

Bases: StaticHighchartsPlot

Uses the following extra keys from :param data: :

keys list of rows names

highcharts_options(data)[source]

Function generating options for Highcharts chart, as specified in http://www.highcharts.com/docs/getting-started/how-to-set-options

class oioioi.statistics.plottypes.XYStaticHighchartsPlot[source]

Bases: StaticHighchartsPlot

Base class for static (non-updating) plots using Highcharts library. Uses the following keys from :param data: :

  • series list of series names

  • data rectantular array of data

  • titles dictionary of axes titles

  • x_min, y_min, x_max, y_max fixed axes bounds

  • series_extra_options list of extra options for each serie

  • highcharts_extra_options hook for adding extra Highcharts options

highcharts_options(data)[source]

Function generating options for Highcharts chart, as specified in http://www.highcharts.com/docs/getting-started/how-to-set-options

class oioioi.statistics.plottypes.PointsToSourceLengthProblemPlot[source]

Bases: XYStaticHighchartsPlot

Base class for static (non-updating) plots using Highcharts library. Uses the following keys from :param data: :

  • series list of series names

  • data rectantular array of data

  • titles dictionary of axes titles

  • x_min, y_min, x_max, y_max fixed axes bounds

  • series_extra_options list of extra options for each serie

  • highcharts_extra_options hook for adding extra Highcharts options

head_libraries()[source]

Returns a list containing paths to all CSS and JS files required to plot data. The paths should be relative to static folder. The list will be converted to HTML by controller.

Currently supported extensions: .css, .js

highcharts_options(data)[source]

Function generating options for Highcharts chart, as specified in http://www.highcharts.com/docs/getting-started/how-to-set-options