API Docs for:
Show:

Multigraph Class

Module: core
Parent Module: multigraph

The Multigraph Jermaine model is the root class for the js-multigraph project.

Constructor

Multigraph

()

Methods

browserHasCanvasSupport

() private static

Determines if the browser supports canvas elements.

createDefaultMessageHandlers

(
  • div
)
Object static

Creates default error and warning functions for multigraph.

Parameters:

  • div HTML Element

Returns:

Object:

Object keyed by error and warning which respectively point to the generated default error and warning functions.

createGraph

(
  • options
)
Promise

Creates a Multigraph according to specified options. Returns a jQuery promise which interacts with the multigraph through its done function.

Parameters:

  • options Object
    • div String | HTML Element | JQuery Object

      (REQUIRED) The DOM element div into which the multigraph should be placed; this value may be either (a) a string which is taken to be the id attribute of a div in the page, (b) a reference to the div DOM element itself, or (c) a jQuery object corresponding to the div DOM element.

    • mugl URI

      (REQUIRED, unless muglString is present) the URL from which the MUGL file for the Multigraph can be loaded

    • muglString String

      (REQUIRED, unless mugl is present) a string containing the MUGL XML for the graph

    • driver String

      (OPTIONAL) Indicates which graphics driver to use; should be one of the strings "canvas", "raphael", or "auto". The default (which is used if the 'driver' tag is absent) is "auto", which causes Multigraph to check the features of the browser it is running in and choose the most appropriate driver.

    • error Function

      (OPTIONAL) A function for displaying error messages to the user. Multigraph will call this function if and when it encounters an error. The function should receive a single argument which is an instance of the JavaScript Error object. The default is to use Multigraph's own internal mechanism for displaying user messages.

    • warning Function

      (OPTIONAL) A function for displaying warning messages to the user. Multigraph will call this function if and when it needs to display a warning message. The function should receive a single argument which is an instance of the JavaScript Error object. The default is to use Multigraph's own internal mechanism for displaying user messages.

Returns:

Promise:

jQuery promise which provides interaction with the graph through its done function.

initializeGeometry

(
  • width
  • height
  • graphicsContext
)

Initializes the Multigraph's geometry by calling the initializeGeometry function of each of its graph children.

Parameters:

  • width Integer

    Width of the multigraph's div.

  • height Integer

    Height of the multigraph's div.

  • graphicsContext Object

registerCommonDataCallback

(
  • callback
)

Convience function for registering callback functions for data becoming ready.

Parameters:

  • callback Function

    Callback function to be registered.

window.multigraph.create

(
  • options
)
Promise static

window.multigraph.create is an alias for window.multigraph.core.Multigraph.createGraph.

Parameters:

  • options Object
    • div String | HTML Element | JQuery Object

      (REQUIRED) The DOM element div into which the multigraph should be placed; this value may be either (a) a string which is taken to be the id attribute of a div in the page, (b) a reference to the div DOM element itself, or (c) a jQuery object corresponding to the div DOM element.

    • mugl URI

      (REQUIRED) the URL from which the MUGL file for the Multigraph can be loaded

    • driver String

      (OPTIONAL) Indicates which graphics driver to use; should be one of the strings "canvas", "raphael", or "auto". The default (which is used if the 'driver' tag is absent) is "auto", which causes Multigraph to check the features of the browser it is running in and choose the most appropriate driver.

    • error Function

      (OPTIONAL) A function for displaying error messages to the user. Multigraph will call this function if and when it encounters an error. The function should receive a single argument which is an instance of the JavaScrip Error object. The default is to use Multigraph's own internal mechanism for displaying user messages.

    • warning Function

      (OPTIONAL) A function for displaying warning messages to the user. Multigraph will call this function if and when it needs to display a warning message. The function should receive a single argument which is an instance of the JavaScript Error object. The default is to use Multigraph's own internal mechanism for displaying user messages.

Returns:

Promise:

jQuery promise which provides interaction with the graph through its done function.

Properties

ajaxthrottles

Array

JavaScript array of ajax throttles; each entry in this array is an object with the following properties: regex : regular expression for matching URLs ajaxthrottle : instance of $.ajaxthrottle

busySpinner

HTML Element

The busy spinner

div

HTML Element

The div the multigraph is rendered in.

graphs

Graph

Jermiane Attr_List of all the graphs in a Multigraph.

mugl

String

The url for the mugl file this graph was created from, if any