Class: Schedule

PD.SVG. Schedule

Generates a simple and relatively lightweight annual schedule chart.

This chart is a much simpler and more light-weight version of the PD.SVG.ScheduleEditor chart. It is not selectable or editable and is typically used to visually represent PD.Schedule and/or BIM.Schedule data within lists or albums of such objects.

Like the schedule editor, it displays the 365 days of the year (366 in a leap year), laid out in a 53x7 grid (53x12 when in EnergyPlus mode). The horizontal axis is effectively weeks of the year and the vertical axis is days of the week. Individual days of the year are color-coded based on either their assigned daily schedule or values derived from it.

          JAN   FEB  MAR  APR   MAY  JUN  JUL   AUG  SEP   OCT  NOV  DEC
        +------------------------------------------------------------------+
    MON | ☐☐☐☐☐ ☐☐☐☐ ☐☐☐☐ ☐☐☐☐☐ ☐☐☐☐ ☐☐☐☐ ☐☐☐☐☐ ☐☐☐☐ ☐☐☐☐☐ ☐☐☐☐ ☐☐☐☐ ☐☐☐☐☐ |
    TUE | ☐☐☐☐☐ ☐☐☐☐ ☐☐☐☐ ☐☐☐☐☐ ☐☐☐☐ ☐☐☐☐ ☐☐☐☐☐ ☐☐☐☐ ☐☐☐☐ ☐☐☐☐☐ ☐☐☐☐ ☐☐☐☐☐ |
    WED | ☐☐☐☐☐ ☐☐☐☐ ☐☐☐☐ ☐☐☐☐ ☐☐☐☐☐ ☐☐☐☐ ☐☐☐☐☐ ☐☐☐☐ ☐☐☐☐ ☐☐☐☐☐ ☐☐☐☐ ☐☐☐☐  |
    THU | ☐☐☐☐ ☐☐☐☐☐ ☐☐☐☐ ☐☐☐☐ ☐☐☐☐☐ ☐☐☐☐ ☐☐☐☐ ☐☐☐☐☐ ☐☐☐☐ ☐☐☐☐☐ ☐☐☐☐ ☐☐☐☐  |
    FRI | ☐☐☐☐ ☐☐☐☐ ☐☐☐☐☐ ☐☐☐☐ ☐☐☐☐☐ ☐☐☐☐ ☐☐☐☐ ☐☐☐☐☐ ☐☐☐☐ ☐☐☐☐ ☐☐☐☐☐ ☐☐☐☐  |
    SAT | ☐☐☐☐ ☐☐☐☐ ☐☐☐☐☐ ☐☐☐☐ ☐☐☐☐ ☐☐☐☐☐ ☐☐☐☐ ☐☐☐☐☐ ☐☐☐☐ ☐☐☐☐ ☐☐☐☐☐ ☐☐☐☐  |
    SUN | ☐☐☐☐ ☐☐☐☐ ☐☐☐☐☐ ☐☐☐☐ ☐☐☐☐ ☐☐☐☐☐ ☐☐☐☐ ☐☐☐☐ ☐☐☐☐☐ ☐☐☐☐ ☐☐☐☐ ☐☐☐☐☐  |
        +------------------------------------------------------------------+
          1    5     10    15    20    25    30    35     40    45    50
                              WEEKS OF THE YEAR

new Schedule(config)

Creates a new simple annual schedule chart instance.

Parameters:
Name Type Description
config object

A configuration object.

Properties of config:
Name Type Argument Description
svgId SVGElement | string

The SVG element to use, or the DOM ID of an SVG element.

schedule PD.Schedule <optional>

An optional annual schedule to display.

Author:
  • drajmarsh
Throws:

Throws an error if provided with an invalid svgId element or id.

Type
Error

Members


:number

id

A unique identifier for this sun-path.

Type
  • number

:boolean

isSVGSchedule <readonly>

A flag identifying this object as a annual daily schedule chart.

Type
  • boolean

:PD.Schedule

legend

The legend to use to display the schedule.

Type

:PD.Schedule

schedule

The annual schedule to display/edit.

Type

:SVGElement

svgElem

The SVG element to render the diagram to.

Type
  • SVGElement

Methods


colorScaleCallback( [callback])

Get/set the callback function used for the color scale.

Parameters:
Name Type Argument Description
callback function <optional>

When provided, this sets the new callback function.

Returns:

Returns the current callback function.

Type
function

height( [height])

Get/set the overall height of the chart, in pixels.

Parameters:
Name Type Argument Description
height number <optional>

When provided, this sets the new chart height in pixels.

Returns:

Returns the current chart height in pixels.

Type
number

paddingBottom( [pixels])

Get/set the inset on the bottom side of the chart.

Parameters:
Name Type Argument Description
pixels number <optional>

When provided, this sets the number of pixels the chart axis is indented from the parent container edge on the bottom side.

Returns:

Returns the current bottom padding in pixels.

Type
number

paddingLeft( [pixels])

Get/set the inset on the left side of the chart.

Parameters:
Name Type Argument Description
pixels number <optional>

When provided, this sets the number of pixels the chart axis is indented from the parent container edge on the left side.

Returns:

Returns the current left padding in pixels.

Type
number

paddingRight( [pixels])

Get/set the inset on the right side of the chart.

Parameters:
Name Type Argument Description
pixels number <optional>

When provided, this sets the number of pixels the chart axis is indented from the parent container edge on the right side.

Returns:

Returns the current right padding in pixels.

Type
number

paddingTop( [pixels])

Get/set the inset on the top side of the chart.

Parameters:
Name Type Argument Description
pixels number <optional>

When provided, this sets the number of pixels the chart axis is indented from the parent container edge on the top side.

Returns:

Returns the current top padding in pixels.

Type
number

set(config [, update])

Sets one or more properties of the schedule and updates it.

Parameters:
Name Type Argument Default Description
config number

A configuration object.

update boolean <optional>
true

Whether or not to update the chart if changed.

Returns:

Returns true if anything changed, otherwise false.

Type
boolean

show(state)

Shows or hides the chart based on given state.

Parameters:
Name Type Description
state boolean

Use true to show, false to hide.

Returns:

Returns this chart instance to support method chaining.

Type
object

subTitle( [subtitle])

Get/set the chart sub-title displayed in the header above the chart.

Parameters:
Name Type Argument Description
subtitle string <optional>

When provided, this sets the new sub-title for the chart.

Returns:

Returns the current chart sub-title.

Type
string

throttledRescale( [ms])

Get/set the timer value for throttling calls to the rescale() method.

This basically means that multiple calls to the rescale() method that occur within the specified number of milliseconds will be amalgamated to a single call that occurs at the end of that period.

Parameters:
Name Type Argument Description
ms number <optional>

When provided, this sets the throttling time, in milliseconds. Any value less than 5ms effectively turns off throttling.

Returns:

Returns the current throttling time in milliseconds.

Type
number

title( [title])

Get/set the chart title displayed in the header above the chart.

Parameters:
Name Type Argument Description
title string <optional>

When provided, this sets the new title for the chart.

Returns:

Returns the current chart title.

Type
string

titleSeparation( [fraction])

Get/set the title/sub-title separation as a fraction pf the chart width.

Parameters:
Name Type Argument Description
fraction number <optional>

When provided, this sets the fraction of chart width to separate titles by (0 to 1).

Returns:

Returns the current separation value.

Type
number

units( [units])

Get/set the chart units displayed in the header above the chart.

Parameters:
Name Type Argument Description
units string <optional>

When provided, this sets the new units for the chart.

Returns:

Returns the current chart units.

Type
string

update( [updateSky])

Performs a complete update of the diagram.

This method updates the diagram to reflect the current date, time and location.

Parameters:
Name Type Argument Description
updateSky boolean <optional>

When true, forces the sky distribution to update.

Returns:

Returns this schedule instance to support method chaining.

Type
PD.SVG.Schedule

width( [width])

Get/set the overall width of the chart.

Parameters:
Name Type Argument Description
width number <optional>

When provided, this sets the new chart width in pixels.

Returns:

Returns the current width in pixels.

Type
number