API Docs for:
Show:

Object Class

Module: ChartUtils

Methods

addProtectedMethod

(
  • methodName
  • method
)
Object chainable

Defined in chart_utils.js:124

Shortcut for defyning a method which will be considered protected by createSafeProxy;
Usage: obj.addProtectedMethod("name", method)
to add function method to obj as property obj["name"].

Parameters:

  • methodName String

    The name of the new property to be added to this object
    WARNING: if Object[methodName] exists, then it will be overwritten.

  • method Function

    The method body.

Returns:

Object: This object, to enable method chaining

addPublicMethod

(
  • methodName
  • method
)
Object chainable

Defined in chart_utils.js:72

Shortcut for defyning a method which will be considered public by createSafeProxy;
Usage: obj.addPublicMethod("name", method)
to add function method to obj as property obj["name"].

Parameters:

  • methodName String

    The name of the new property to be added to this object
    WARNING: if Object[methodName] exists, then it will be overwritten.

  • method Function

    The method body.

Returns:

Object: This object, to enable method chaining

clear

() Object chainable

Defined in chart_utils.js:52

Deletes every property from an object

Returns:

Object: The same object on whom this method is called.

createSafeProxy

(
  • [canDestroy=false]
)
Object chainable

Defined in chart_utils.js:175

Creates and returns a safe proxy for the object passed, that will wrap around it and expose only those methods marked as public (i.e. those that are declared as enumerable).

Parameters:

  • [canDestroy=false] Boolean optional

    States if the proxy consumer has the authority to call destroy on the original object;
    We assume the convention that object's uses destroy method as their destructor.

Returns:

Object: A proxy wrapping this object.

init

(
  • proto
  • [properties]
)
Object

Defined in chart_utils.js:17

Creates an object inheriting from a given prototype and then, if required, inits it with a list of properties tha can be passed as its second argument.

Parameters:

  • proto Object

    The protetype to inherit from;

  • [properties] Object optional

    A dictionary of key-value properties to be used for the new object's initialization;

Returns:

Object: The newly created object.

isArray

(
  • obj
)
Boolean

Defined in chart_utils.js:495

Checks if its argument is an array.

Parameters:

  • obj Object

    The argument to be checked.

Returns:

Boolean: true <=> the object is an Array.

isFunction

(
  • arg
)
Boolean

Defined in chart_utils.js:523

Checks if its argument is a Function.

Parameters:

  • arg Object

    The argument to be checked.

Returns:

Boolean: true <=> the object is a Function.

isNumber

(
  • obj
)
Boolean

Defined in chart_utils.js:537

Checks if its argument is a Number.

Parameters:

  • obj Object

    The argument to be checked.

Returns:

Boolean: true <=> the object is a Number.

isString

(
  • obj
)
Boolean

Defined in chart_utils.js:509

Checks if its argument is a string.

Parameters:

  • obj Object

    The argument to be checked.

Returns:

Boolean: true <=> the object is a String.

isUndefined

(
  • arg
)
Boolean

Defined in chart_utils.js:551

Checks if its argument is undefined.

Parameters:

  • arg Object

    The argument to be checked.

Returns:

Boolean: true <=> the argument is undefined.

setProperty

(
  • property
  • value
)
chainable

Defined in chart_utils.js:282

Assign the value "value" to the property "property" of the current object.
"property" MUST be an existing property of current object or of its ancestors: if this[property] is undefined, it recursively checks along its inheritance chain.

Parameters:

  • property String

    The name of the property to look up for in this object and its super object.

  • value Object

    The value to be assigned to the property.

Returns:

This object, to allow for method chaining

shallowCopy

() Object

Defined in chart_utils.js:565

Creates a new object (shallow)copying the elements of the current one.

Returns:

Object: A new object, with a shallow copy of all the properties in the original one.

superMethod

(
  • methodName
  • [args]
)

Defined in chart_utils.js:238

Checks if the super object of this object has a method (i.e. a property which is a function) whose name is methodName, and then calls it. Otherwise checks recursively its super object, i.e. its prototype.

Parameters:

  • methodName String

    The name of the method to look up for in this object's super objects.

  • [args] Object optional multiple

    The arguments to be passed to the super method, if any is needed;

Returns:

The result of the call to the method named methodName of this object's super object.