honeybee_vtk.legend_parameter module

Vtk legend parameters.

class honeybee_vtk.legend_parameter.ColorSets(value)[source]

Bases: enum.Enum

Colors for a legend.

annual_comfort = 'annual_comfort'
benefit = 'benefit'
benefit_harm = 'benefit_harm'
black_to_white = 'black_to_white'
blue_green_red = 'blue_green_red'
cloud_cover = 'cloud_cover'
cold_sensation = 'cold_sensation'
ecotect = 'ecotect'
energy_balance = 'energy_balance'
energy_balance_storage = 'energy_balance_storage'
glare_study = 'glare_study'
harm = 'harm'
heat_sensation = 'heat_sensation'
multi_colored = 'multi_colored'
multicolored_2 = 'multicolored_2'
multicolored_3 = 'multicolored_3'
nuanced = 'nuanced'
openstudio_palette = 'openstudio_palette'
original = 'original'
peak_load_balance = 'peak_load_balance'
shade_benefit = 'shade_benefit'
shade_benefit_harm = 'shade_benefit_harm'
shade_harm = 'shade_harm'
shadow_study = 'shadow_study'
therm = 'therm'
thermal_comfort = 'thermal_comfort'
view_study = 'view_study'
class honeybee_vtk.legend_parameter.DecimalCount(value)[source]

Bases: enum.Enum

Controlling the number of decimals on each label of the legend.

decimal_three = 'decimal_three'
decimal_two = 'decimal_two'
default = 'default'
integer = 'integer'
class honeybee_vtk.legend_parameter.LegendParameter(name: str = 'Legend', unit: str = '', colorset: honeybee_vtk.legend_parameter.ColorSets = <ColorSets.ecotect: 'ecotect'>, reverse_colorset: bool = False, hide_legend: bool = False, orientation: honeybee_vtk.legend_parameter.Orientation = <Orientation.horizontal: 'horizontal'>, position: Tuple[float, float] = (0.5, 0.1), width: float = 0.45, height: float = 0.05, color_count: int = None, label_count: int = None, decimal_count: honeybee_vtk.legend_parameter.DecimalCount = <DecimalCount.default: 'default'>, preceding_labels: bool = False, label_parameters: honeybee_vtk.legend_parameter.Text = Font color: (0.0, 0.0, 0.0) | Font size: 0 | Bold: False, title_parameters: honeybee_vtk.legend_parameter.Text = Font color: (0.0, 0.0, 0.0) | Font size: 0 | Bold: True, min: Union[float, int] = None, max: Union[float, int] = None, auto_range: Tuple[float, float] = None)[source]

Bases: object

Legend parameters for the vtk legend (scalarbar) object.

A vtk legend has a number of colors, labels, and a title. Here, labels mean the numbers you see on a legend such as 0, 1, 2, 3, 4, 5 on a legend with max value of 5.

Args:
name: A text string representing the name of the legend object and the

title of the legend. Default to “Legend”.

unit: A text string representing the unit of the data that the legend

represents. Examples are ‘celsius’, ‘kwn/m2’, etc.

colorset: A ColorSet object. Defaults to Ecotect colorset. reverse_colorset: A boolean to specify whether the colorset should be

reversed. Defaults to False.

hide_legend: A boolean to set the visibility of a legend in Scene.

Defaults to False.

orientation: An Orientation object that sets the orientation of the legend in

the scene. Defaults to horizontal orientation.

position: A tuple of two decimal values. The values represent the fraction

of viewport width and the fraction of viewport height. These fractions in decimal numbers will define the location of the start point of the legend. For example, a value of (0.0, 0.5) will place the start point of the legend at the left most side of the viewport and at the 50% height of the viewport. Defaults to (0.5, 0.1).

width: A decimal number representing the fraction of viewport width that

will be used to define the width of the legend. A value of 0.45 will make the width of legend equal to the 45% width of the viewport. Defaults to 0.45.

height: A decimal number representing the fraction of viewport height that

will be used to define the height of the legend. A value of 0.05 will make the height of legend equal to the 5% height of the viewport. Defaults to 0.05.

color_count: An integer representing the number of colors in a legend.

Defaults to None which will use all the colors in the colors property.

label_count: An integer representing the number of text labels on a

legend. Default to None which will use vtk legend’s default setting.

decimal_count: A DecimalCount object that specifies the number of decimals

on each label of the legend. Defaults to the type of data. For data with integer values this will default to integer. Similarly, for data with decimal values, this will default to decimal point numbers.

preceding_labels: A boolean value to indicate whether the title and the

labels should precede the legend or not. Defaults to False.

label_parameters: A Text object. Defaults to size 30 black text. title_parameters: A Text object. Defaults to size 50 black bold text. min: A number that will be set as the lower bound of the legend.

Defaults to None.

min: A number that will be set as the upper bound of the legend.

Defaults to None.

auto_range: A tuple of minimum and maximum values for legend. This is

auto set when Data is loaded on a model. Use min and max arguments to customize this auto calculated range.

get_lookuptable() → vtkmodules.vtkCommonCore.vtkLookupTable[source]

Get a vtk lookuptable.

get_scalarbar() → vtkmodules.vtkRenderingAnnotation.vtkScalarBarActor[source]

Get a vtk scalar bar (legend).

property color_count

Number of colors in the legend.

property colorset

Colors to be used in the legend.

property decimal_count

The format of legend labels.

property height

height of the legend as a fraction of viewport height.

property hide_legend

Visibility of legend in the scene.

property label_count

Number of text labels in the legend.

property label_parameters

Font for the legend labels.

property max
property min
property name

Name of the legend parameter object and the title of the legend.

property orientation

Orientation of a legend in the scene.

property position
property preceding_labels

Boolean to indicate whether the title and the labels should precede the legend or not.

property range
property reverse_colorset

A boolean to specify whether the colorset should be reversed.

property title_parameters

Font for the legend title.

property unit

Unit for the data that the legend represents.

property width

Width of the legend as a fraction of viewport width.

class honeybee_vtk.legend_parameter.Orientation(value)[source]

Bases: enum.Enum

Orientation of a legend.

horizontal = 'horizontal'
vertical = 'vertical'
class honeybee_vtk.legend_parameter.Text(color: Tuple[float, float, float] = (0, 0, 0), size: int = 30, bold: bool = False)[source]

Bases: object

Text parameters for the legend.

Parameters
  • color – A tuple of three integer values for R, G, and B. Defaults (0, 0, 0).

  • size – An integer representing the size of fonts in points. Defaults to 30.

  • bold – A boolean to specify whether the fonts should be made bold. Defaults to False.

to_vtk() → vtkmodules.vtkRenderingCore.vtkTextProperty[source]

Create a vtk TextProperty object.

property bold

To make font bold nor not.

property color

Color of fonts in RGB decimal.

property size

Size of fonts.