Skip to content
cvasseng edited this page Oct 26, 2016 · 6 revisions

highed.download(filename, data) - function

Trigger file download

Arguments

  • filename - string: the filename
  • data - string: the contained data

Definition

./src/core/highcharts-editor.js:50:
download: function (filename, data) {

highed.clearObj(obj) - function

Clear an object

Deletes all the object attributes. Useful when needing to clear an object without invalidating references to it

Arguments

  • obj - object: the object to clear

Definition

./src/core/highcharts-editor.js:64:
clearObj: function (obj) {

highed.ajax(p) - function

Preform an AJAX request. Same syntax as jQuery.

Arguments

  • p - object: options
    • url (string) - the URL to call
    • type (enum) - the type of request
    • dataType (enum) - the type of data expected
    • success (function) - function to call on success
    • error (function) - function to call on request fail
    • data (object) - the payload
    • autoFire (boolean) - wether or not to fire the request right away

Methods

  • on(event, callback): Listen for event - returns function: Can be called to unbind the listener
    • event: string, The event to listen for
    • callback: function, Function to call when the event is emitted

Emitted Events

  • Error: when there's an error
  • OK: when the request succeeded

Return

object - interface to the request

Definition

./src/core/highcharts-editor.js:84:
ajax: function (p) {

highed.uuid - function

Generate a uuid

Borrowed from http://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript

Return

string - a UUID string

Definition

./src/core/highcharts-editor.js:163:
uuid: function () {

highed.arrToObj(arr) - function

Map an array to an object

Arguments

  • arr - array: the array to map

Return

object - an object with the array contents as keys, and their value set to true

Definition

./src/core/highcharts-editor.js:182:
arrToObj: function (arr) {

highed.uncamelize(str) - function

Make a camel back string pretty

Transforms e.g. imACamelBackString to Im a camelback string.

Arguments

  • str - string: the input string

Return

string - the transformed string

Definition

./src/core/highcharts-editor.js:205:
uncamelize: function (str) {

highed.clamp(min, max, value) - function

Clamp a number between min/max

Arguments

  • min - number: minimum value
  • max - number: maximum value
  • value - number: the value to clamp

Return

number - the clamped value

Definition

./src/core/highcharts-editor.js:240:
clamp: function (min, max, value) {

highed.hexToRgb(hex) - function

Convert a hex value to RGB

Arguments

  • hex - string: the hex string

Return

object - an object with rgb components

Definition

./src/core/highcharts-editor.js:255:
hexToRgb: function (hex) {

highed.invertHexColor(hex) - function

Invert a color

Arguments

  • hex - string: the color to invert

Return

string - new hex color

Definition

./src/core/highcharts-editor.js:270:
invertHexColor: function (hex) {

highed.getContrastedColor(hex) - function

Return #FFF or #000 based on the intensity of a color

Arguments

  • hex - string: input color

Return

string - the new hex color

Definition

./src/core/highcharts-editor.js:290:
getContrastedColor: function (hex) {

highed.toBool(what) - function

Convert a string to a bool

Arguments

  • what - string: the string to convert

Return

bool - the resulting bool

Definition

./src/core/highcharts-editor.js:305:
toBool: function (what) {

highed.setAttr(obj, path, value, index) - function

Set a property based on -- delimited path

Arguments

  • obj - object: the object to modify
  • path - string: the path to the attribute to change
  • value - anything: the value to set
  • index - number: if we're accessing an array, this is the index

Definition

./src/core/highcharts-editor.js:315:
setAttr: function (obj, path, value, index) {

highed.getAttr(obj, path, index) - function

Get a property based on -- delimited path

Arguments

  • obj - object: the object to traverse
  • path - string: the path to the attribute to get
  • index - number: if we're accessing an array, this is the index

Return

anything - the value or false

Definition

./src/core/highcharts-editor.js:359:
getAttr: function (obj, path, index) {

highed.merge(a, b) - function

Deep merge two objects.

Note: this modifies object a!

Arguments

  • a - object: the destination object
  • b - object: the source object

Return

object - argument a

Definition

./src/core/highcharts-editor.js:402:
merge: function (a, b) {

highed.isNull(what) - function

Check if something is null or undefined

Arguments

  • what - anything: the value to check

Return

bool - true if nulll

Definition

./src/core/highcharts-editor.js:432:
isNull: function (what) {

highed.isStr(what) - function

Check if something is a string

Arguments

  • what - anything: the value to check

Return

bool - true if string

Definition

./src/core/highcharts-editor.js:440:
isStr: function (what) {

highed.isNum(what) - function

Check if something is a number

Arguments

  • what - anything: the value to check

Return

bool - true if number

Definition

./src/core/highcharts-editor.js:448:
isNum: function(what) {

highed.isFn(what) - function

Check if a value is a function

Arguments

  • what - anything: the value to check

Return

bool - true if function

Definition

./src/core/highcharts-editor.js:456:
isFn: function (what) {

highed.isArr(what) - function

Check if a value is an array

Arguments

  • what - anything: the value to check

Return

bool - true if array

Definition

./src/core/highcharts-editor.js:464:
isArr: function (what) {

highed.isBool(what) - function

Check if a value is a boolean

Arguments

  • what - anything: the value to check

Return

bool - true if bool

Definition

./src/core/highcharts-editor.js:472:
isBool: function (what) {

highed.isBasic(what) - function

Check if a value is a basic type

A basic type is either a bool, string, or a number

Arguments

  • what - anything: the value to check

Return

bool - true if basic

Definition

./src/core/highcharts-editor.js:481:
isBasic: function (what) {

highed.option(option, value) - function

Set an option

Skip value to get the value

Arguments

  • option - string: the option to set
  • value - anything: the value to set

Return

anything - the option value

Definition

./src/core/highcharts-editor.js:536:
highed.option = function (option, value) {

highed.ready(fn) - function

Add a function to call when the document is ready

Arguments

  • fn - function: the function to call

Definition

./src/core/highcharts-editor.js:548:
highed.ready = function (fn) {

highed.log(level) - function

Log something

Accepts a variable amount of arguments after level which will be the log message (similar to console.log).

Arguments

  • level - number: the log level 1..4

Definition

./src/core/highcharts-editor.js:562:
highed.log = function (level) {

highed.setLogLevel(level) - function

Set the current log level

Arguments

  • level - number: the current log level

Definition

./src/core/highcharts-editor.js:573:
highed.setLogLevel = function (level) {

highed.include(what, fn, asCSS) - function

Include something

Arguments

  • what - string: URL to a css or javascript file
  • fn - function: function to call when done including the script
  • asCSS - boolean: force including as css

Definition

./src/core/highcharts-editor.js:584:
highed.include = function (what, fn, asCSS) {

highed.onPhone - function

Returns true if running on a phone

Return

boolean - true if running on a phone

Definition

./src/core/highcharts-editor.js:626:
highed.onPhone = function () {

highed.events - constructor

Event dispatcher object

Constructs an instance of an event dispatcher when called.

Examples

var events = highed.events();

events.on("foobar", function() {
    console.log("Hello world!");
});

events.emit("foobar");

Methods

  • on(event, callback, context): Listen to an event - returns function: function that can be called to unbind the listener
    • event: string, the event to listen for
    • callback: function, the function to call when the event is emitted
    • context: anything, the calling context (`this` reference) for the callback
  • emit(event): Emit an event - returns number: The number of events dispatched
    • event: string, the event to emit

Definition

./src/core/highed.events.js:34:
highed.events = function () {

highed.readLocalFile(props) - function

Upload and parse a local file

Borrowed from almostvanilla which is licensed under MIT.

Arguments

  • props - object: the upload settings
    • type (string) - the type of data to load
    • accept (string) - the accepted file extensions
    • multiple (boolean) - allow multiple files
    • progress (function) - progress callback
      • {number} (number) - the progress in percent
      • success (function) - function called when the file is uploaded
        • {object} (object) - the file information
          • filename (string) - the name of the file
          • size (number) - the size of the file in bytes
          • data (string) - the file data

Definition

./src/core/highed.fileupload.js:58:
highed.readLocalFile = function (props) {

highed.getLocalizedStr(id) - function

Get a localized string based on the current global language

Arguments

  • id - string: the ID of the string to get

Definition

./src/core/highed.localization.js:64:
highed.getLocalizedStr = function (id) {

highed.setLang(lang) - function

Set the active langauge

Arguments

  • lang - string: the language to activate

Return

boolean - true if the language exists, and was applied

Definition

./src/core/highed.localization.js:92:
highed.setLang = function (lang) {

highed.installTemplate(type, def) - function

Install a new template

Examples

highed.installTemplate("custom", {
    title: "My company template",
    tooltipText: "Company template: requires no particular data",
    config: {
        "chart--title": "Copany Chart"
    }
});

Arguments

  • type - string: template type: line area column bar scatter pie polar stock
  • def - object: the template definition
    • title (string) - the template title
    • config (object) - the highcharts attributes
    • tooltipText (string) - the tooltip text

Definition

./src/core/highed.templateman.js:45:
highed.installTemplate = function(type, def) {

highed.addTemplateType(type, title) - function

Add a new template type

If the type allready exists, nothing will happen

Examples

highed.addTemplateType("custom", "My company templates");

Arguments

  • type - string: the type id
  • title - string: the title as it appears in the category list

Definition

./src/core/highed.templateman.js:71:
highed.addTemplateType = function (type, title) {

highed.installMultipleTemplates(templates) - function

Add a set of templates

Examples

highed.installMultipleTemplates([ {
    type: "line",
    template: {
        title: "My Line Template",
        config: {}
    }
} ]);

Arguments

  • templates - array: an array of templates

Definition

./src/core/highed.templateman.js:94:
highed.installMultipleTemplates = function (templates) {

highed.dom.isVisible(node) - function

Check if a node is visible

Arguments

  • node - domnode: the node to check

Definition

./src/core/highed.dom.js:33:
isVisible: function (node) {

highed.dom.ap(target) - function

Append a set of nodes to another node.

Arguments supplied after the @param {} target represents the children to append.

Arguments

  • target - object: the node to append to

Return

domnode - the target

Definition

./src/core/highed.dom.js:43:
ap: function (target) {

highed.dom.options(select, options, selected) - function

Create a set of options for a select

Arguments

  • select - HTMLSelect: the dropdown to add options to
  • options - (array|object): the options as an array or as an object keyed on ID
  • selected - number: the index of the selected option

Definition

./src/core/highed.dom.js:73:
options: function (select, options, selected) {

highed.dom.showOnHover(parent, child) - function

Show a node when another is hovered

Arguments

  • parent - object: the node to listen for the hover on
  • child - object: the node to show when the parent is hovered

Definition

./src/core/highed.dom.js:105:
showOnHover: function (parent, child) {

highed.dom.cr(type, cssClass, innerHTML, id) - function

Create a new HTML node

Arguments

  • type - string: the type of node to create
  • cssClass - string: the css class to use for the node
  • innerHTML - string: the inner html of the new node
  • id - string: the id of the new node

Return

domnode - the new dom node

Definition

./src/core/highed.dom.js:141:
cr: function (type, cssClass, innerHTML, id) {

highed.dom.style(nodes, style) - function

Style a node

Arguments

  • nodes - (object|array): the node to style. Can also be an array
  • style - object: object containing style properties

Return

anything - whatever was supplied to @param {} nodes

Definition

./src/core/highed.dom.js:172:
style: function (nodes, style) {

highed.dom.on(target, event, callback, context) - function

Attach an event listener to a dom node

Arguments

  • target - object: the dom node to attach to
  • event - string: the event to listen for
  • callback - function: the function to call when the event is emitted
  • context - object: the context of the callback function

Return

function - a function that can be called to unbind the handler

Definition

./src/core/highed.dom.js:198:
on: function (target, event, callback, context) {

highed.dom.val(node, value) - function

Get or set the value of a node

Arguments

  • node - object: the node to get the value of
  • value - (string|bool|number): the value to set

Return

anything - the value

Definition

./src/core/highed.dom.js:262:
val: function (node, value) {

highed.dom.size(node) - function

Get the size of a node

Arguments

  • node - object: the node to get the size of

Return

object - the size as an object {w, h}

Definition

./src/core/highed.dom.js:300:
size: function (node) {

highed.dom.pos(node, abs) - function

Get the position of a node

Arguments

  • node - object: the node to get the position of
  • abs - boolean: absolute calculation rather than parent relative

Return

object - the position as an object {x, y}

Definition

./src/core/highed.dom.js:312:
pos: function (node, abs) {

highed.dom.get(node) - function

Find a node

Arguments

  • node - object: the node to find. Either a string or an actual node instance

Return

object - the node or false if the node was not found

Definition

./src/core/highed.dom.js:337:
get: function (node) {

Clone this wiki locally