Timeline

Timeline

new Timeline()

Source:

Timeline graph is a graph with no Y Axis. This is primarily used to denote an action at a given point of time. It also accepts/supplies a content property which can be used to display non-numeric values which typically cannot be represented using traditional graphs like Line or Paired Result.

  • Axes - X axis only
  • X Axis ticks
  • Legend
  • X Axis label
  • Data points

Lifecycle functions include:

  • BeforeInit
  • Init
  • Render
  • AfterInit

Methods

destroy() → {Timeline}

Source:

Destroys the graph: Container and canvas.

Returns:
  • Timeline instance
Type
Timeline

generate(input) → {HTMLElement}

Source:

Since we don't have the concept of z-index in visualization, the order of rendering should be following:

  • SVG container
  • X-Axis
  • X Axis Label
  • Legend
  • Data [In our case we have load and unload]
Parameters:
Name Type Description
input object

Input JSON

Returns:

d3 selection node of svg.

Type
HTMLElement

loadContent(input) → {Timeline}

Source:

Loads the content onto the graph. The content serves as a 1to1 relationship. For rendering multiple data sets respective number of content needs to be provided.

Parameters:
Name Type Description
input object

Timeline content

Returns:
  • Timeline instance
Type
Timeline

reflow(graphData) → {Timeline}

Source:

Updates the graph axisData and content.

Parameters:
Name Type Description
graphData Array

Input array that holds updated values and key

Returns:
  • Timeline instance
Type
Timeline

resize() → {Timeline}

Source:

Resizes the graph canvas. Uses the clipPath def. It scales the graph on resize, and translates the graph elements: X-Axis Label

Returns:
  • Timeline instance
Type
Timeline

unloadContent(input) → {Timeline}

Source:

Unloads the content from the graph. The content serves as a 1to1 relationship. For rendering multiple data sets respective number of content needs to be provided.

Parameters:
Name Type Description
input object

Timeline content to be removed

Returns:
  • Timeline instance
Type
Timeline

Timeline

new Timeline(input)

Source:
Parameters:
Name Type Description
input TimelineConfig

Input JSON instance created using TimelineConfig

Methods

destroy() → {Timeline}

Source:

Destroys the graph: Container and canvas.

Returns:
  • Timeline instance
Type
Timeline

generate(input) → {HTMLElement}

Source:

Since we don't have the concept of z-index in visualization, the order of rendering should be following:

  • SVG container
  • X-Axis
  • X Axis Label
  • Legend
  • Data [In our case we have load and unload]
Parameters:
Name Type Description
input object

Input JSON

Returns:

d3 selection node of svg.

Type
HTMLElement

loadContent(input) → {Timeline}

Source:

Loads the content onto the graph. The content serves as a 1to1 relationship. For rendering multiple data sets respective number of content needs to be provided.

Parameters:
Name Type Description
input object

Timeline content

Returns:
  • Timeline instance
Type
Timeline

reflow(graphData) → {Timeline}

Source:

Updates the graph axisData and content.

Parameters:
Name Type Description
graphData Array

Input array that holds updated values and key

Returns:
  • Timeline instance
Type
Timeline

resize() → {Timeline}

Source:

Resizes the graph canvas. Uses the clipPath def. It scales the graph on resize, and translates the graph elements: X-Axis Label

Returns:
  • Timeline instance
Type
Timeline

unloadContent(input) → {Timeline}

Source:

Unloads the content from the graph. The content serves as a 1to1 relationship. For rendering multiple data sets respective number of content needs to be provided.

Parameters:
Name Type Description
input object

Timeline content to be removed

Returns:
  • Timeline instance
Type
Timeline