Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Calendar

Each Calendar object represents the information displayed on one calendar, including the courses selected and colors used to render. It also includes various d3 object instances, such as axes, required for rendering.

Hierarchy

  • Calendar

Index

Constructors

constructor

  • Parameters

    • calendars: Calendar[]

      The master list of Calendars, to be passed in by reference. Is mostly used to facilitate deletion of Calendars.

    Returns Calendar

Properties

axisorigin

axisorigin: string

The origin of the axes, represented in CSS translate() format.

colors

colors: ColorPicker

The ColorPicker used to select colors.

courses

courses: Array<SelectedCourse>

An array of the selected courses for this calendar.

dayaxis

dayaxis: Axis

d3 Axis object for rendering the day axis.

master

master: Calendar[]

A reference to the global list of Calendar.

selector

selector: string

The selector for the Calendar on the SVG.

timeaxis

timeaxis: Axis

d3 Axis object for rendering the time axis.

timescale

timescale: Scale<number, number>

The current time-to-coordinates Scale.

Methods

changeTimeAxis

  • changeTimeAxis(timestart: Date, timeend: Date): void
  • Rescale the time axis.

    Parameters

    • timestart: Date

      The start time of the axis.

    • timeend: Date

      The end time of the axis.

    Returns void

delete

  • delete(calendars: Calendar[], active: number): void
  • Remove this calendar from the list.

    todo

    Figure out why function accepts calendars instead of using master.

    Parameters

    • calendars: Calendar[]

      Master list of calendars.

    • active: number

      The calendar to focus the camera on after deletion.

    Returns void

draw

  • draw(): void
  • Redraw the calendar in the SVG.

    Returns void

erase

  • erase(): void
  • Make a calendar "shrink" via transformations, then remove it

    Returns void

moveToNewSelector

  • moveToNewSelector(calendar: Calendar, oldsel: string): void
  • Changes a calendar's old selector to a new one, and "slide" the SVG representation to the new position.

    todo

    Figure out why this function doesn't operate on "this" calendar object, instead operating on a param-provided one.

    Parameters

    • calendar: Calendar

      The calendar to move

    • oldsel: string

      The previous selector.

    Returns void

Generated using TypeDoc