repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
partition
stringclasses
1 value
nhn/tui.grid
src/js/theme/styleGenerator.js
bgTextRuleString
function bgTextRuleString(className, options) { return classRule(className) .bg(options.background) .text(options.text) .build(); }
javascript
function bgTextRuleString(className, options) { return classRule(className) .bg(options.background) .text(options.text) .build(); }
[ "function", "bgTextRuleString", "(", "className", ",", "options", ")", "{", "return", "classRule", "(", "className", ")", ".", "bg", "(", "options", ".", "background", ")", ".", "text", "(", "options", ".", "text", ")", ".", "build", "(", ")", ";", "}"...
Creates a rule string for background and text colors. @param {String} className - class name @param {Objecr} options - options @returns {String} @ignore
[ "Creates", "a", "rule", "string", "for", "background", "and", "text", "colors", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/theme/styleGenerator.js#L32-L37
train
nhn/tui.grid
src/js/theme/styleGenerator.js
bgBorderRuleString
function bgBorderRuleString(className, options) { return classRule(className) .bg(options.background) .border(options.border) .build(); }
javascript
function bgBorderRuleString(className, options) { return classRule(className) .bg(options.background) .border(options.border) .build(); }
[ "function", "bgBorderRuleString", "(", "className", ",", "options", ")", "{", "return", "classRule", "(", "className", ")", ".", "bg", "(", "options", ".", "background", ")", ".", "border", "(", "options", ".", "border", ")", ".", "build", "(", ")", ";",...
Creates a rule string for background and border colors. @param {String} className - class name @param {Objecr} options - options @returns {String} @ignore
[ "Creates", "a", "rule", "string", "for", "background", "and", "border", "colors", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/theme/styleGenerator.js#L46-L51
train
nhn/tui.grid
src/js/theme/styleGenerator.js
function(options) { var borderTopRule = classRule(classNameConst.BORDER_TOP).bg(options.border); var borderBottomRule = classComposeRule(' .', [ classNameConst.NO_SCROLL_X, classNameConst.BORDER_BOTTOM ]).bg(options.border); var rules = [ borderTopRule...
javascript
function(options) { var borderTopRule = classRule(classNameConst.BORDER_TOP).bg(options.border); var borderBottomRule = classComposeRule(' .', [ classNameConst.NO_SCROLL_X, classNameConst.BORDER_BOTTOM ]).bg(options.border); var rules = [ borderTopRule...
[ "function", "(", "options", ")", "{", "var", "borderTopRule", "=", "classRule", "(", "classNameConst", ".", "BORDER_TOP", ")", ".", "bg", "(", "options", ".", "border", ")", ";", "var", "borderBottomRule", "=", "classComposeRule", "(", "' .'", ",", "[", "c...
Generates a css string for grid outline. @param {Object} options - options @returns {String}
[ "Generates", "a", "css", "string", "for", "grid", "outline", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/theme/styleGenerator.js#L59-L82
train
nhn/tui.grid
src/js/theme/styleGenerator.js
function(options) { var webkitScrollbarRules = builder.createWebkitScrollbarRules('.' + classNameConst.CONTAINER, options); var ieScrollbarRule = builder.createIEScrollbarRule('.' + classNameConst.CONTAINER, options); var xInnerBorderRule = classRule(classNameConst.BORDER_BOTTOM).bg(options.bord...
javascript
function(options) { var webkitScrollbarRules = builder.createWebkitScrollbarRules('.' + classNameConst.CONTAINER, options); var ieScrollbarRule = builder.createIEScrollbarRule('.' + classNameConst.CONTAINER, options); var xInnerBorderRule = classRule(classNameConst.BORDER_BOTTOM).bg(options.bord...
[ "function", "(", "options", ")", "{", "var", "webkitScrollbarRules", "=", "builder", ".", "createWebkitScrollbarRules", "(", "'.'", "+", "classNameConst", ".", "CONTAINER", ",", "options", ")", ";", "var", "ieScrollbarRule", "=", "builder", ".", "createIEScrollbar...
Generates a css string for scrollbars. @param {Object} options - options @returns {String}
[ "Generates", "a", "css", "string", "for", "scrollbars", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/theme/styleGenerator.js#L100-L131
train
nhn/tui.grid
src/js/theme/styleGenerator.js
function(options) { return classRule(classNameConst.HEAD_AREA) .bg(options.background) .border(options.border) .build(); }
javascript
function(options) { return classRule(classNameConst.HEAD_AREA) .bg(options.background) .border(options.border) .build(); }
[ "function", "(", "options", ")", "{", "return", "classRule", "(", "classNameConst", ".", "HEAD_AREA", ")", ".", "bg", "(", "options", ".", "background", ")", ".", "border", "(", "options", ".", "border", ")", ".", "build", "(", ")", ";", "}" ]
Generates a css string for head area. @param {Object} options - options @returns {String}
[ "Generates", "a", "css", "string", "for", "head", "area", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/theme/styleGenerator.js#L165-L170
train
nhn/tui.grid
src/js/theme/styleGenerator.js
function(options) { var contentAreaRule = classRule(classNameConst.SUMMARY_AREA) .bg(options.background) .border(options.border); var bodyAreaRule = classComposeRule(' .', [ classNameConst.HAS_SUMMARY_TOP, classNameConst.BODY_AREA ]).border(options...
javascript
function(options) { var contentAreaRule = classRule(classNameConst.SUMMARY_AREA) .bg(options.background) .border(options.border); var bodyAreaRule = classComposeRule(' .', [ classNameConst.HAS_SUMMARY_TOP, classNameConst.BODY_AREA ]).border(options...
[ "function", "(", "options", ")", "{", "var", "contentAreaRule", "=", "classRule", "(", "classNameConst", ".", "SUMMARY_AREA", ")", ".", "bg", "(", "options", ".", "background", ")", ".", "border", "(", "options", ".", "border", ")", ";", "var", "bodyAreaRu...
Generates a css string for summary area. @param {Object} options - options @returns {String}
[ "Generates", "a", "css", "string", "for", "summary", "area", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/theme/styleGenerator.js#L188-L201
train
nhn/tui.grid
src/js/theme/styleGenerator.js
function(options) { return classRule(classNameConst.CELL) .bg(options.background) .border(options.border) .borderWidth(options) .text(options.text) .build(); }
javascript
function(options) { return classRule(classNameConst.CELL) .bg(options.background) .border(options.border) .borderWidth(options) .text(options.text) .build(); }
[ "function", "(", "options", ")", "{", "return", "classRule", "(", "classNameConst", ".", "CELL", ")", ".", "bg", "(", "options", ".", "background", ")", ".", "border", "(", "options", ".", "border", ")", ".", "borderWidth", "(", "options", ")", ".", "t...
Generates a css string for table cells. @param {Object} options - options @returns {String}
[ "Generates", "a", "css", "string", "for", "table", "cells", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/theme/styleGenerator.js#L208-L215
train
nhn/tui.grid
src/js/theme/styleGenerator.js
function(options) { return classComposeRule('.', [ classNameConst.CELL_HEAD, classNameConst.CELL_SELECTED ]).bg(options.background) .text(options.text) .build(); }
javascript
function(options) { return classComposeRule('.', [ classNameConst.CELL_HEAD, classNameConst.CELL_SELECTED ]).bg(options.background) .text(options.text) .build(); }
[ "function", "(", "options", ")", "{", "return", "classComposeRule", "(", "'.'", ",", "[", "classNameConst", ".", "CELL_HEAD", ",", "classNameConst", ".", "CELL_SELECTED", "]", ")", ".", "bg", "(", "options", ".", "background", ")", ".", "text", "(", "optio...
Generates a css string for selected head cells. @param {Object} options - options @returns {String}
[ "Generates", "a", "css", "string", "for", "selected", "head", "cells", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/theme/styleGenerator.js#L319-L326
train
nhn/tui.grid
src/js/theme/styleGenerator.js
function(options) { var focusLayerRule = classRule(classNameConst.LAYER_FOCUS_BORDER).bg(options.border); var editingLayerRule = classRule(classNameConst.LAYER_EDITING).border(options.border); return builder.buildAll([focusLayerRule, editingLayerRule]); }
javascript
function(options) { var focusLayerRule = classRule(classNameConst.LAYER_FOCUS_BORDER).bg(options.border); var editingLayerRule = classRule(classNameConst.LAYER_EDITING).border(options.border); return builder.buildAll([focusLayerRule, editingLayerRule]); }
[ "function", "(", "options", ")", "{", "var", "focusLayerRule", "=", "classRule", "(", "classNameConst", ".", "LAYER_FOCUS_BORDER", ")", ".", "bg", "(", "options", ".", "border", ")", ";", "var", "editingLayerRule", "=", "classRule", "(", "classNameConst", ".",...
Generates a css string for focused cell. @param {Object} options - options @returns {String}
[ "Generates", "a", "css", "string", "for", "focused", "cell", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/theme/styleGenerator.js#L347-L352
train
nhn/tui.grid
src/js/theme/styleGenerator.js
function(options) { return classComposeRule(' .', [ classNameConst.LAYER_FOCUS_DEACTIVE, classNameConst.LAYER_FOCUS_BORDER ]).bg(options.border).build(); }
javascript
function(options) { return classComposeRule(' .', [ classNameConst.LAYER_FOCUS_DEACTIVE, classNameConst.LAYER_FOCUS_BORDER ]).bg(options.border).build(); }
[ "function", "(", "options", ")", "{", "return", "classComposeRule", "(", "' .'", ",", "[", "classNameConst", ".", "LAYER_FOCUS_DEACTIVE", ",", "classNameConst", ".", "LAYER_FOCUS_BORDER", "]", ")", ".", "bg", "(", "options", ".", "border", ")", ".", "build", ...
Generates a css string for focus inactive cell. @param {Object} options - options @returns {String}
[ "Generates", "a", "css", "string", "for", "focus", "inactive", "cell", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/theme/styleGenerator.js#L359-L364
train
nhn/tui.grid
src/js/common/clipboardUtil.js
setDataInSpanRange
function setDataInSpanRange(value, data, colspanRange, rowspanRange) { var startColspan = colspanRange[0]; var endColspan = colspanRange[1]; var startRowspan = rowspanRange[0]; var endRowspan = rowspanRange[1]; var cIndex, rIndex; for (rIndex = startRowspan; rIndex < endRowspan; rIndex += 1) { ...
javascript
function setDataInSpanRange(value, data, colspanRange, rowspanRange) { var startColspan = colspanRange[0]; var endColspan = colspanRange[1]; var startRowspan = rowspanRange[0]; var endRowspan = rowspanRange[1]; var cIndex, rIndex; for (rIndex = startRowspan; rIndex < endRowspan; rIndex += 1) { ...
[ "function", "setDataInSpanRange", "(", "value", ",", "data", ",", "colspanRange", ",", "rowspanRange", ")", "{", "var", "startColspan", "=", "colspanRange", "[", "0", "]", ";", "var", "endColspan", "=", "colspanRange", "[", "1", "]", ";", "var", "startRowspa...
Set to the data matrix as colspan & rowspan range @param {string} value - Text from getting td element @param {array} data - Data matrix to set value @param {array} colspanRange - colspan range (ex: [start,Index endIndex]) @param {array} rowspanRange - rowspan range (ex: [start,Index endIndex]) @private
[ "Set", "to", "the", "data", "matrix", "as", "colspan", "&", "rowspan", "range" ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/common/clipboardUtil.js#L27-L40
train
nhn/tui.grid
src/js/common/clipboardUtil.js
function(table) { var data = []; var rows = table.rows; var index = 0; var length = rows.length; var columnIndex, colspanRange, rowspanRange; // Step 1: Init the data matrix for (; index < length; index += 1) { data[index] = []; } // ...
javascript
function(table) { var data = []; var rows = table.rows; var index = 0; var length = rows.length; var columnIndex, colspanRange, rowspanRange; // Step 1: Init the data matrix for (; index < length; index += 1) { data[index] = []; } // ...
[ "function", "(", "table", ")", "{", "var", "data", "=", "[", "]", ";", "var", "rows", "=", "table", ".", "rows", ";", "var", "index", "=", "0", ";", "var", "length", "=", "rows", ".", "length", ";", "var", "columnIndex", ",", "colspanRange", ",", ...
Convert cell data of table to clipboard data @param {HTMLElement} table - Table element @returns {array} clipboard data (2*2 matrix)
[ "Convert", "cell", "data", "of", "table", "to", "clipboard", "data" ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/common/clipboardUtil.js#L52-L86
train
nhn/tui.grid
src/js/common/clipboardUtil.js
function(text) { // Each newline cell data is wrapping double quotes in the text and // newline characters should be replaced with substitution characters temporarily // before spliting the text by newline characters. text = clipboardUtil.replaceNewlineToSubchar(text); return _....
javascript
function(text) { // Each newline cell data is wrapping double quotes in the text and // newline characters should be replaced with substitution characters temporarily // before spliting the text by newline characters. text = clipboardUtil.replaceNewlineToSubchar(text); return _....
[ "function", "(", "text", ")", "{", "// Each newline cell data is wrapping double quotes in the text and", "// newline characters should be replaced with substitution characters temporarily", "// before spliting the text by newline characters.", "text", "=", "clipboardUtil", ".", "replaceNewl...
Convert plain text to clipboard data @param {string} text - Copied plain text @returns {array} clipboard data (2*2 matrix)
[ "Convert", "plain", "text", "to", "clipboard", "data" ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/common/clipboardUtil.js#L93-L107
train
nhn/tui.grid
src/js/common/clipboardUtil.js
function(text) { if (text.match(CUSTOM_LF_REGEXP)) { text = text.substring(1, text.length - 1) .replace(/""/g, '"'); } return text; }
javascript
function(text) { if (text.match(CUSTOM_LF_REGEXP)) { text = text.substring(1, text.length - 1) .replace(/""/g, '"'); } return text; }
[ "function", "(", "text", ")", "{", "if", "(", "text", ".", "match", "(", "CUSTOM_LF_REGEXP", ")", ")", "{", "text", "=", "text", ".", "substring", "(", "1", ",", "text", ".", "length", "-", "1", ")", ".", "replace", "(", "/", "\"\"", "/", "g", ...
Remove double quetes on text when including substitution characters @param {string} text - Original text @returns {string} Replaced text
[ "Remove", "double", "quetes", "on", "text", "when", "including", "substitution", "characters" ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/common/clipboardUtil.js#L127-L134
train
nhn/tui.grid
src/js/common/clipboardUtil.js
function(text) { return text.replace(/"([^"]|"")*"/g, function(value) { return value.replace(LF, CUSTOM_LF_SUBCHAR) .replace(CR, CUSTOM_CR_SUBCHAR); }); }
javascript
function(text) { return text.replace(/"([^"]|"")*"/g, function(value) { return value.replace(LF, CUSTOM_LF_SUBCHAR) .replace(CR, CUSTOM_CR_SUBCHAR); }); }
[ "function", "(", "text", ")", "{", "return", "text", ".", "replace", "(", "/", "\"([^\"]|\"\")*\"", "/", "g", ",", "function", "(", "value", ")", "{", "return", "value", ".", "replace", "(", "LF", ",", "CUSTOM_LF_SUBCHAR", ")", ".", "replace", "(", "CR...
Replace newline characters to substitution characters @param {string} text - Original text @returns {string} Replaced text
[ "Replace", "newline", "characters", "to", "substitution", "characters" ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/common/clipboardUtil.js#L141-L146
train
nhn/tui.grid
src/js/view/layout/frame-rside.js
function() { var dimensionModel, height; if (this.$scrollBorder) { dimensionModel = this.dimensionModel; height = dimensionModel.get('bodyHeight') - dimensionModel.getScrollXHeight(); this.$scrollBorder.height(height); } }
javascript
function() { var dimensionModel, height; if (this.$scrollBorder) { dimensionModel = this.dimensionModel; height = dimensionModel.get('bodyHeight') - dimensionModel.getScrollXHeight(); this.$scrollBorder.height(height); } }
[ "function", "(", ")", "{", "var", "dimensionModel", ",", "height", ";", "if", "(", "this", ".", "$scrollBorder", ")", "{", "dimensionModel", "=", "this", ".", "dimensionModel", ";", "height", "=", "dimensionModel", ".", "get", "(", "'bodyHeight'", ")", "-"...
Resets the height of a vertical scroll-bar border @private
[ "Resets", "the", "height", "of", "a", "vertical", "scroll", "-", "bar", "border" ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/view/layout/frame-rside.js#L96-L104
train
nhn/tui.grid
src/js/view/layout/frame-rside.js
function() { var dimensionModel = this.dimensionModel; var scrollX = dimensionModel.get('scrollX'); var scrollY = dimensionModel.get('scrollY'); var spaceHeights = this._getSpaceHeights(scrollX, scrollY); this._setScrollbar(scrollX, scrollY, spaceHeights); if (dimension...
javascript
function() { var dimensionModel = this.dimensionModel; var scrollX = dimensionModel.get('scrollX'); var scrollY = dimensionModel.get('scrollY'); var spaceHeights = this._getSpaceHeights(scrollX, scrollY); this._setScrollbar(scrollX, scrollY, spaceHeights); if (dimension...
[ "function", "(", ")", "{", "var", "dimensionModel", "=", "this", ".", "dimensionModel", ";", "var", "scrollX", "=", "dimensionModel", ".", "get", "(", "'scrollX'", ")", ";", "var", "scrollY", "=", "dimensionModel", ".", "get", "(", "'scrollY'", ")", ";", ...
To be called at the end of the 'render' method. @override
[ "To", "be", "called", "at", "the", "end", "of", "the", "render", "method", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/view/layout/frame-rside.js#L119-L132
train
nhn/tui.grid
src/js/view/layout/frame-rside.js
function(scrollX, scrollY) { var dimensionModel = this.dimensionModel; var summaryHeight = dimensionModel.get('summaryHeight'); var summaryPosition = dimensionModel.get('summaryPosition'); var topHeight = dimensionModel.get('headerHeight'); var bottomHeight = scrollX ? dimensionC...
javascript
function(scrollX, scrollY) { var dimensionModel = this.dimensionModel; var summaryHeight = dimensionModel.get('summaryHeight'); var summaryPosition = dimensionModel.get('summaryPosition'); var topHeight = dimensionModel.get('headerHeight'); var bottomHeight = scrollX ? dimensionC...
[ "function", "(", "scrollX", ",", "scrollY", ")", "{", "var", "dimensionModel", "=", "this", ".", "dimensionModel", ";", "var", "summaryHeight", "=", "dimensionModel", ".", "get", "(", "'summaryHeight'", ")", ";", "var", "summaryPosition", "=", "dimensionModel", ...
Get height values of top, bottom space on scroll area @param {boolean} scrollX - Whether the grid has x-scroll or not @param {boolean} scrollY - Whether the grid has y-scroll or not @returns {object} Heighs value @private
[ "Get", "height", "values", "of", "top", "bottom", "space", "on", "scroll", "area" ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/view/layout/frame-rside.js#L141-L160
train
nhn/tui.grid
src/js/view/layout/frame-rside.js
function(scrollX, scrollY, spaceHeights) { var $yInnerBorder, $yOuterBorder, $spaceRightTop, $spaceRightBottom, $frozenBorder; if (scrollX) { $frozenBorder = createDiv(classNameConst.SCROLLBAR_FROZEN_BORDER, { height: dimensionConst.SCROLLBAR_WIDTH }); } ...
javascript
function(scrollX, scrollY, spaceHeights) { var $yInnerBorder, $yOuterBorder, $spaceRightTop, $spaceRightBottom, $frozenBorder; if (scrollX) { $frozenBorder = createDiv(classNameConst.SCROLLBAR_FROZEN_BORDER, { height: dimensionConst.SCROLLBAR_WIDTH }); } ...
[ "function", "(", "scrollX", ",", "scrollY", ",", "spaceHeights", ")", "{", "var", "$yInnerBorder", ",", "$yOuterBorder", ",", "$spaceRightTop", ",", "$spaceRightBottom", ",", "$frozenBorder", ";", "if", "(", "scrollX", ")", "{", "$frozenBorder", "=", "createDiv"...
Create scrollbar area and set styles @param {boolean} scrollX - Whether the grid has x-scroll or not @param {boolean} scrollY - Whether the grid has y-scroll or not @param {object} spaceHeights - Height values of top, bottom space on scroll area @private
[ "Create", "scrollbar", "area", "and", "set", "styles" ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/view/layout/frame-rside.js#L169-L204
train
nhn/tui.grid
src/js/view/layout/frame-rside.js
function() { var dimensionModel = this.dimensionModel; var headerHeight = dimensionModel.get('headerHeight'); var frozenBorderWidth = dimensionModel.get('frozenBorderWidth'); var resizeHandleView = this.viewFactory.createHeaderResizeHandle(frameConst.L, [headerHeight], true); var...
javascript
function() { var dimensionModel = this.dimensionModel; var headerHeight = dimensionModel.get('headerHeight'); var frozenBorderWidth = dimensionModel.get('frozenBorderWidth'); var resizeHandleView = this.viewFactory.createHeaderResizeHandle(frameConst.L, [headerHeight], true); var...
[ "function", "(", ")", "{", "var", "dimensionModel", "=", "this", ".", "dimensionModel", ";", "var", "headerHeight", "=", "dimensionModel", ".", "get", "(", "'headerHeight'", ")", ";", "var", "frozenBorderWidth", "=", "dimensionModel", ".", "get", "(", "'frozen...
Create frozen border and set styles @param {boolean} scrollX - Whether the grid has x-scroll or not @private
[ "Create", "frozen", "border", "and", "set", "styles" ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/view/layout/frame-rside.js#L211-L228
train
nhn/tui.grid
src/js/event/keyEvent.js
getKeyStrokeString
function getKeyStrokeString(ev) { var keys = []; if (ev.ctrlKey || ev.metaKey) { keys.push('ctrl'); } if (ev.shiftKey) { keys.push('shift'); } keys.push(keyNameMap[ev.keyCode]); return keys.join('-'); }
javascript
function getKeyStrokeString(ev) { var keys = []; if (ev.ctrlKey || ev.metaKey) { keys.push('ctrl'); } if (ev.shiftKey) { keys.push('shift'); } keys.push(keyNameMap[ev.keyCode]); return keys.join('-'); }
[ "function", "getKeyStrokeString", "(", "ev", ")", "{", "var", "keys", "=", "[", "]", ";", "if", "(", "ev", ".", "ctrlKey", "||", "ev", ".", "metaKey", ")", "{", "keys", ".", "push", "(", "'ctrl'", ")", ";", "}", "if", "(", "ev", ".", "shiftKey", ...
Returns the keyStroke string @param {Event} ev - Keyboard event @returns {String} @ignore
[ "Returns", "the", "keyStroke", "string" ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/event/keyEvent.js#L78-L90
train
nhn/tui.grid
src/js/theme/manager.js
buildCssString
function buildCssString(options) { var styles = [ styleGen.outline(options.outline), styleGen.frozenBorder(options.frozenBorder), styleGen.scrollbar(options.scrollbar), styleGen.heightResizeHandle(options.heightResizeHandle), styleGen.pagination(options.pagination), s...
javascript
function buildCssString(options) { var styles = [ styleGen.outline(options.outline), styleGen.frozenBorder(options.frozenBorder), styleGen.scrollbar(options.scrollbar), styleGen.heightResizeHandle(options.heightResizeHandle), styleGen.pagination(options.pagination), s...
[ "function", "buildCssString", "(", "options", ")", "{", "var", "styles", "=", "[", "styleGen", ".", "outline", "(", "options", ".", "outline", ")", ",", "styleGen", ".", "frozenBorder", "(", "options", ".", "frozenBorder", ")", ",", "styleGen", ".", "scrol...
build css string with given options. @param {Object} options - options @returns {String} @ignore
[ "build", "css", "string", "with", "given", "options", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/theme/manager.js#L26-L66
train
nhn/tui.grid
src/js/theme/manager.js
setDocumentStyle
function setDocumentStyle(options) { var cssString = buildCssString(options); $('#' + STYLE_ELEMENT_ID).remove(); util.appendStyleElement(STYLE_ELEMENT_ID, cssString); }
javascript
function setDocumentStyle(options) { var cssString = buildCssString(options); $('#' + STYLE_ELEMENT_ID).remove(); util.appendStyleElement(STYLE_ELEMENT_ID, cssString); }
[ "function", "setDocumentStyle", "(", "options", ")", "{", "var", "cssString", "=", "buildCssString", "(", "options", ")", ";", "$", "(", "'#'", "+", "STYLE_ELEMENT_ID", ")", ".", "remove", "(", ")", ";", "util", ".", "appendStyleElement", "(", "STYLE_ELEMENT...
Set document style with given options. @param {Object} options - options @ignore
[ "Set", "document", "style", "with", "given", "options", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/theme/manager.js#L73-L78
train
nhn/tui.grid
src/js/theme/manager.js
function(themeName, extOptions) { var options = presetOptions[themeName]; if (!options) { options = presetOptions[themeNameConst.DEFAULT]; } options = $.extend(true, {}, options, extOptions); setDocumentStyle(options); }
javascript
function(themeName, extOptions) { var options = presetOptions[themeName]; if (!options) { options = presetOptions[themeNameConst.DEFAULT]; } options = $.extend(true, {}, options, extOptions); setDocumentStyle(options); }
[ "function", "(", "themeName", ",", "extOptions", ")", "{", "var", "options", "=", "presetOptions", "[", "themeName", "]", ";", "if", "(", "!", "options", ")", "{", "options", "=", "presetOptions", "[", "themeNameConst", ".", "DEFAULT", "]", ";", "}", "op...
Creates a style element using theme options identified by given name, and appends it to the document. @param {String} themeName - preset theme name @param {Object} extOptions - if exist, extend preset theme options with it.
[ "Creates", "a", "style", "element", "using", "theme", "options", "identified", "by", "given", "name", "and", "appends", "it", "to", "the", "document", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/theme/manager.js#L87-L95
train
nhn/tui.grid
src/js/view/layout/header.js
getSameColumnCount
function getSameColumnCount(currentColumn, prevColumn) { var index = 0; var len = Math.min(currentColumn.length, prevColumn.length); for (; index < len; index += 1) { if (currentColumn[index].name !== prevColumn[index].name) { break; } } return index; }
javascript
function getSameColumnCount(currentColumn, prevColumn) { var index = 0; var len = Math.min(currentColumn.length, prevColumn.length); for (; index < len; index += 1) { if (currentColumn[index].name !== prevColumn[index].name) { break; } } return index; }
[ "function", "getSameColumnCount", "(", "currentColumn", ",", "prevColumn", ")", "{", "var", "index", "=", "0", ";", "var", "len", "=", "Math", ".", "min", "(", "currentColumn", ".", "length", ",", "prevColumn", ".", "length", ")", ";", "for", "(", ";", ...
Get count of same columns in complex columns @param {array} currentColumn - Current column's model @param {array} prevColumn - Previous column's model @returns {number} Count of same columns @ignore
[ "Get", "count", "of", "same", "columns", "in", "complex", "columns" ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/view/layout/header.js#L37-L48
train
nhn/tui.grid
src/js/view/layout/header.js
function() { var columnRange = this.selectionModel.get('range').column; var visibleColumns = this.columnModel.getVisibleColumns(); var selectedColumns = visibleColumns.slice(columnRange[0], columnRange[1] + 1); return _.pluck(selectedColumns, 'name'); }
javascript
function() { var columnRange = this.selectionModel.get('range').column; var visibleColumns = this.columnModel.getVisibleColumns(); var selectedColumns = visibleColumns.slice(columnRange[0], columnRange[1] + 1); return _.pluck(selectedColumns, 'name'); }
[ "function", "(", ")", "{", "var", "columnRange", "=", "this", ".", "selectionModel", ".", "get", "(", "'range'", ")", ".", "column", ";", "var", "visibleColumns", "=", "this", ".", "columnModel", ".", "getVisibleColumns", "(", ")", ";", "var", "selectedCol...
Returns an array of names of columns in selection range. @private @returns {Array.<String>}
[ "Returns", "an", "array", "of", "names", "of", "columns", "in", "selection", "range", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/view/layout/header.js#L175-L181
train
nhn/tui.grid
src/js/view/layout/header.js
function(columnNames) { var columnModel = this.columnModel; var mergedColumnNames = _.pluck(columnModel.get('complexHeaderColumns'), 'name'); return _.filter(mergedColumnNames, function(mergedColumnName) { var unitColumnNames = columnModel.getUnitColumnNamesIfMerged(mergedColumnName...
javascript
function(columnNames) { var columnModel = this.columnModel; var mergedColumnNames = _.pluck(columnModel.get('complexHeaderColumns'), 'name'); return _.filter(mergedColumnNames, function(mergedColumnName) { var unitColumnNames = columnModel.getUnitColumnNamesIfMerged(mergedColumnName...
[ "function", "(", "columnNames", ")", "{", "var", "columnModel", "=", "this", ".", "columnModel", ";", "var", "mergedColumnNames", "=", "_", ".", "pluck", "(", "columnModel", ".", "get", "(", "'complexHeaderColumns'", ")", ",", "'name'", ")", ";", "return", ...
Returns an array of names of merged-column which contains every column name in the given array. @param {Array.<String>} columnNames - an array of column names to test @returns {Array.<String>} @private
[ "Returns", "an", "array", "of", "names", "of", "merged", "-", "column", "which", "contains", "every", "column", "name", "in", "the", "given", "array", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/view/layout/header.js#L198-L209
train
nhn/tui.grid
src/js/view/layout/header.js
function(ev) { var $target = $(ev.target); var columnName; if (!this._triggerPublicMousedown(ev)) { return; } if ($target.hasClass(classNameConst.BTN_SORT)) { return; } columnName = $target.closest('th').attr(ATTR_COLUMN_NAME); i...
javascript
function(ev) { var $target = $(ev.target); var columnName; if (!this._triggerPublicMousedown(ev)) { return; } if ($target.hasClass(classNameConst.BTN_SORT)) { return; } columnName = $target.closest('th').attr(ATTR_COLUMN_NAME); i...
[ "function", "(", "ev", ")", "{", "var", "$target", "=", "$", "(", "ev", ".", "target", ")", ";", "var", "columnName", ";", "if", "(", "!", "this", ".", "_triggerPublicMousedown", "(", "ev", ")", ")", "{", "return", ";", "}", "if", "(", "$target", ...
Mousedown event handler @param {jQuery.Event} ev - MouseDown event @private
[ "Mousedown", "event", "handler" ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/view/layout/header.js#L251-L269
train
nhn/tui.grid
src/js/view/layout/header.js
function(ev) { var $target = $(ev.target); var columnName = $target.closest('th').attr(ATTR_COLUMN_NAME); var eventData = new GridEvent(ev); if (columnName === '_button' && $target.is('input')) { eventData.setData({ checked: $target.prop('checked') ...
javascript
function(ev) { var $target = $(ev.target); var columnName = $target.closest('th').attr(ATTR_COLUMN_NAME); var eventData = new GridEvent(ev); if (columnName === '_button' && $target.is('input')) { eventData.setData({ checked: $target.prop('checked') ...
[ "function", "(", "ev", ")", "{", "var", "$target", "=", "$", "(", "ev", ".", "target", ")", ";", "var", "columnName", "=", "$target", ".", "closest", "(", "'th'", ")", ".", "attr", "(", "ATTR_COLUMN_NAME", ")", ";", "var", "eventData", "=", "new", ...
Event handler for click event @param {jQuery.Event} ev - MouseEvent @private
[ "Event", "handler", "for", "click", "event" ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/view/layout/header.js#L368-L384
train
nhn/tui.grid
src/js/view/layout/header.js
function() { var hierarchyList = this._getColumnHierarchyList(); var maxRowCount = this._getHierarchyMaxRowCount(hierarchyList); var rowHeight = util.getRowHeight(maxRowCount, this.headerHeight) - 1; var handleHeights = []; var index = 1; var coulmnLen = hierarchyList.len...
javascript
function() { var hierarchyList = this._getColumnHierarchyList(); var maxRowCount = this._getHierarchyMaxRowCount(hierarchyList); var rowHeight = util.getRowHeight(maxRowCount, this.headerHeight) - 1; var handleHeights = []; var index = 1; var coulmnLen = hierarchyList.len...
[ "function", "(", ")", "{", "var", "hierarchyList", "=", "this", ".", "_getColumnHierarchyList", "(", ")", ";", "var", "maxRowCount", "=", "this", ".", "_getHierarchyMaxRowCount", "(", "hierarchyList", ")", ";", "var", "rowHeight", "=", "util", ".", "getRowHeig...
Get height values of resize handlers @returns {array} Height values of resize handles
[ "Get", "height", "values", "of", "resize", "handlers" ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/view/layout/header.js#L578-L597
train
nhn/tui.grid
karma.conf.js
setConfig
function setConfig(defaultConfig, server) { if (server === 'ne') { defaultConfig.captureTimeout = 100000; defaultConfig.customLaunchers = { 'IE8': { base: 'WebDriver', config: webdriverConfig, browserName: 'internet explorer', ...
javascript
function setConfig(defaultConfig, server) { if (server === 'ne') { defaultConfig.captureTimeout = 100000; defaultConfig.customLaunchers = { 'IE8': { base: 'WebDriver', config: webdriverConfig, browserName: 'internet explorer', ...
[ "function", "setConfig", "(", "defaultConfig", ",", "server", ")", "{", "if", "(", "server", "===", "'ne'", ")", "{", "defaultConfig", ".", "captureTimeout", "=", "100000", ";", "defaultConfig", ".", "customLaunchers", "=", "{", "'IE8'", ":", "{", "base", ...
Set config by environment @param {object} defaultConfig - default config @param {string} server - server type ('ne' or local)
[ "Set", "config", "by", "environment" ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/karma.conf.js#L20-L142
train
nhn/tui.grid
src/js/common/util.js
function(arr) { return { min: Math.min.apply(null, arr), max: Math.max.apply(null, arr) }; }
javascript
function(arr) { return { min: Math.min.apply(null, arr), max: Math.max.apply(null, arr) }; }
[ "function", "(", "arr", ")", "{", "return", "{", "min", ":", "Math", ".", "min", ".", "apply", "(", "null", ",", "arr", ")", ",", "max", ":", "Math", ".", "max", ".", "apply", "(", "null", ",", "arr", ")", "}", ";", "}" ]
Returns the minimum value and the maximum value of the values in array. @param {Array} arr - Target array @returns {{min: number, max: number}} Min and Max @see {@link http://jsperf.com/getminmax}
[ "Returns", "the", "minimum", "value", "and", "the", "maximum", "value", "of", "the", "values", "in", "array", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/common/util.js#L94-L99
train
nhn/tui.grid
src/js/common/util.js
function(obj) { var pruned = {}; _.each(obj, function(value, key) { if (!_.isUndefined(value) && !_.isNull(value)) { pruned[key] = value; } }); return pruned; }
javascript
function(obj) { var pruned = {}; _.each(obj, function(value, key) { if (!_.isUndefined(value) && !_.isNull(value)) { pruned[key] = value; } }); return pruned; }
[ "function", "(", "obj", ")", "{", "var", "pruned", "=", "{", "}", ";", "_", ".", "each", "(", "obj", ",", "function", "(", "value", ",", "key", ")", "{", "if", "(", "!", "_", ".", "isUndefined", "(", "value", ")", "&&", "!", "_", ".", "isNull...
Omits all undefined or null properties of given object. @param {Object} obj - object @returns {Object}
[ "Omits", "all", "undefined", "or", "null", "properties", "of", "given", "object", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/common/util.js#L118-L127
train
nhn/tui.grid
src/js/common/util.js
function(targetObj, distObj) { var result = false; snippet.forEach(targetObj, function(item, key) { result = (item === distObj[key]); return result; }); return result; }
javascript
function(targetObj, distObj) { var result = false; snippet.forEach(targetObj, function(item, key) { result = (item === distObj[key]); return result; }); return result; }
[ "function", "(", "targetObj", ",", "distObj", ")", "{", "var", "result", "=", "false", ";", "snippet", ".", "forEach", "(", "targetObj", ",", "function", "(", "item", ",", "key", ")", "{", "result", "=", "(", "item", "===", "distObj", "[", "key", "]"...
eslint-disable-line complexity
[ "eslint", "-", "disable", "-", "line", "complexity" ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/common/util.js#L180-L190
train
nhn/tui.grid
src/js/common/util.js
function(target) { if (_.isString(target)) { return !target.length; } return _.isUndefined(target) || _.isNull(target); }
javascript
function(target) { if (_.isString(target)) { return !target.length; } return _.isUndefined(target) || _.isNull(target); }
[ "function", "(", "target", ")", "{", "if", "(", "_", ".", "isString", "(", "target", ")", ")", "{", "return", "!", "target", ".", "length", ";", "}", "return", "_", ".", "isUndefined", "(", "target", ")", "||", "_", ".", "isNull", "(", "target", ...
Returns whether the string blank. @memberof module:util @param {*} target - target object @returns {boolean} True if target is undefined or null or ''
[ "Returns", "whether", "the", "string", "blank", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/common/util.js#L215-L221
train
nhn/tui.grid
src/js/common/util.js
function(id, cssString) { var style = document.createElement('style'); style.type = 'text/css'; style.id = id; if (style.styleSheet) { style.styleSheet.cssText = cssString; } else { style.appendChild(document.createTextNode(cssString)); } ...
javascript
function(id, cssString) { var style = document.createElement('style'); style.type = 'text/css'; style.id = id; if (style.styleSheet) { style.styleSheet.cssText = cssString; } else { style.appendChild(document.createTextNode(cssString)); } ...
[ "function", "(", "id", ",", "cssString", ")", "{", "var", "style", "=", "document", ".", "createElement", "(", "'style'", ")", ";", "style", ".", "type", "=", "'text/css'", ";", "style", ".", "id", "=", "id", ";", "if", "(", "style", ".", "styleSheet...
create style element and append it into the head element. @param {String} id - element id @param {String} cssString - css string
[ "create", "style", "element", "and", "append", "it", "into", "the", "head", "element", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/common/util.js#L390-L403
train
nhn/tui.grid
src/js/common/util.js
function(ev) { var rightClick; ev = ev || window.event; if (ev.which) { rightClick = ev.which === 3; } else if (ev.button) { rightClick = ev.button === 2; } return rightClick; }
javascript
function(ev) { var rightClick; ev = ev || window.event; if (ev.which) { rightClick = ev.which === 3; } else if (ev.button) { rightClick = ev.button === 2; } return rightClick; }
[ "function", "(", "ev", ")", "{", "var", "rightClick", ";", "ev", "=", "ev", "||", "window", ".", "event", ";", "if", "(", "ev", ".", "which", ")", "{", "rightClick", "=", "ev", ".", "which", "===", "3", ";", "}", "else", "if", "(", "ev", ".", ...
Detect right button by mouse event @param {object} ev - Mouse event @returns {boolean} State
[ "Detect", "right", "button", "by", "mouse", "event" ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/common/util.js#L434-L446
train
nhn/tui.grid
src/js/view/layout/content-area.js
function() { var factory = this.viewFactory; this._addChildren([ factory.createFrame(frameConst.L), factory.createFrame(frameConst.R) ]); }
javascript
function() { var factory = this.viewFactory; this._addChildren([ factory.createFrame(frameConst.L), factory.createFrame(frameConst.R) ]); }
[ "function", "(", ")", "{", "var", "factory", "=", "this", ".", "viewFactory", ";", "this", ".", "_addChildren", "(", "[", "factory", ".", "createFrame", "(", "frameConst", ".", "L", ")", ",", "factory", ".", "createFrame", "(", "frameConst", ".", "R", ...
Creates Frame views and add them as children. @private
[ "Creates", "Frame", "views", "and", "add", "them", "as", "children", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/view/layout/content-area.js#L49-L56
train
nhn/tui.grid
src/js/view/datePickerLayer.js
function() { var datePickerMap = {}; var columnModelMap = this.columnModel.get('columnModelMap'); _.each(columnModelMap, function(columnModel) { var name = columnModel.name; var component = columnModel.component; var options; if (component && com...
javascript
function() { var datePickerMap = {}; var columnModelMap = this.columnModel.get('columnModelMap'); _.each(columnModelMap, function(columnModel) { var name = columnModel.name; var component = columnModel.component; var options; if (component && com...
[ "function", "(", ")", "{", "var", "datePickerMap", "=", "{", "}", ";", "var", "columnModelMap", "=", "this", ".", "columnModel", ".", "get", "(", "'columnModelMap'", ")", ";", "_", ".", "each", "(", "columnModelMap", ",", "function", "(", "columnModel", ...
Creates instances map of 'tui-date-picker' @returns {Object.<string, DatePicker>} @private
[ "Creates", "instances", "map", "of", "tui", "-", "date", "-", "picker" ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/view/datePickerLayer.js#L63-L82
train
nhn/tui.grid
src/js/view/datePickerLayer.js
function(datePicker) { var self = this; datePicker.on('open', function() { self.textPainter.blockFocusingOut(); }); datePicker.on('close', function() { var focusModel = self.focusModel; var address = focusModel.which(); var rowKey = addre...
javascript
function(datePicker) { var self = this; datePicker.on('open', function() { self.textPainter.blockFocusingOut(); }); datePicker.on('close', function() { var focusModel = self.focusModel; var address = focusModel.which(); var rowKey = addre...
[ "function", "(", "datePicker", ")", "{", "var", "self", "=", "this", ";", "datePicker", ".", "on", "(", "'open'", ",", "function", "(", ")", "{", "self", ".", "textPainter", ".", "blockFocusingOut", "(", ")", ";", "}", ")", ";", "datePicker", ".", "o...
Bind custom event on the DatePicker instance @param {DatePicker} datePicker - instance of DatePicker @private
[ "Bind", "custom", "event", "on", "the", "DatePicker", "instance" ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/view/datePickerLayer.js#L89-L111
train
nhn/tui.grid
src/js/view/datePickerLayer.js
function(options, $input, columnName) { var datePicker = this.datePickerMap[columnName]; var format = options.format || DEFAULT_DATE_FORMAT; var date = options.date || (new Date()); var selectableRanges = options.selectableRanges; datePicker.setInput($input, { format...
javascript
function(options, $input, columnName) { var datePicker = this.datePickerMap[columnName]; var format = options.format || DEFAULT_DATE_FORMAT; var date = options.date || (new Date()); var selectableRanges = options.selectableRanges; datePicker.setInput($input, { format...
[ "function", "(", "options", ",", "$input", ",", "columnName", ")", "{", "var", "datePicker", "=", "this", ".", "datePickerMap", "[", "columnName", "]", ";", "var", "format", "=", "options", ".", "format", "||", "DEFAULT_DATE_FORMAT", ";", "var", "date", "=...
Resets date picker options @param {Object} options - datePicker options @param {jQuery} $input - target input element @param {string} columnName - name to find the DatePicker instance created on each column @private
[ "Resets", "date", "picker", "options" ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/view/datePickerLayer.js#L120-L141
train
nhn/tui.grid
src/js/view/datePickerLayer.js
function($input) { var inputOffset = $input.offset(); var inputHeight = $input.outerHeight(); var wrapperOffset = this.domState.getOffset(); return { top: inputOffset.top - wrapperOffset.top + inputHeight, left: inputOffset.left - wrapperOffset.left }; ...
javascript
function($input) { var inputOffset = $input.offset(); var inputHeight = $input.outerHeight(); var wrapperOffset = this.domState.getOffset(); return { top: inputOffset.top - wrapperOffset.top + inputHeight, left: inputOffset.left - wrapperOffset.left }; ...
[ "function", "(", "$input", ")", "{", "var", "inputOffset", "=", "$input", ".", "offset", "(", ")", ";", "var", "inputHeight", "=", "$input", ".", "outerHeight", "(", ")", ";", "var", "wrapperOffset", "=", "this", ".", "domState", ".", "getOffset", "(", ...
Calculates the position of the layer and returns the object that contains css properties. @param {jQuery} $input - input element @returns {Object} @private
[ "Calculates", "the", "position", "of", "the", "layer", "and", "returns", "the", "object", "that", "contains", "css", "properties", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/view/datePickerLayer.js#L149-L158
train
nhn/tui.grid
src/js/view/datePickerLayer.js
function() { var name = this.focusModel.which().columnName; var datePicker = this.datePickerMap[name]; if (datePicker && datePicker.isOpened()) { datePicker.close(); } }
javascript
function() { var name = this.focusModel.which().columnName; var datePicker = this.datePickerMap[name]; if (datePicker && datePicker.isOpened()) { datePicker.close(); } }
[ "function", "(", ")", "{", "var", "name", "=", "this", ".", "focusModel", ".", "which", "(", ")", ".", "columnName", ";", "var", "datePicker", "=", "this", ".", "datePickerMap", "[", "name", "]", ";", "if", "(", "datePicker", "&&", "datePicker", ".", ...
Close the date picker layer that is already opend @private
[ "Close", "the", "date", "picker", "layer", "that", "is", "already", "opend" ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/view/datePickerLayer.js#L187-L194
train
nhn/tui.grid
src/js/painter/controller.js
function(address, force) { var result; if (force) { this.focusModel.finishEditing(); } result = this.focusModel.startEditing(address.rowKey, address.columnName); if (result) { this.selectionModel.end(); } return result; }
javascript
function(address, force) { var result; if (force) { this.focusModel.finishEditing(); } result = this.focusModel.startEditing(address.rowKey, address.columnName); if (result) { this.selectionModel.end(); } return result; }
[ "function", "(", "address", ",", "force", ")", "{", "var", "result", ";", "if", "(", "force", ")", "{", "this", ".", "focusModel", ".", "finishEditing", "(", ")", ";", "}", "result", "=", "this", ".", "focusModel", ".", "startEditing", "(", "address", ...
Starts editing a cell identified by a given address, and returns the result. @param {{rowKey:String, columnName:String}} address - cell address @param {Boolean} force - if set to true, finish current editing before start. @returns {Boolean} true if succeeded, false otherwise
[ "Starts", "editing", "a", "cell", "identified", "by", "a", "given", "address", "and", "returns", "the", "result", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/painter/controller.js#L34-L48
train
nhn/tui.grid
src/js/painter/controller.js
function(columnName, value) { var column = this.columnModel.getColumnModel(columnName); var maxLength = snippet.pick(column, 'editOptions', 'maxLength'); if (maxLength > 0 && value.length > maxLength) { return value.substring(0, maxLength); } return value; }
javascript
function(columnName, value) { var column = this.columnModel.getColumnModel(columnName); var maxLength = snippet.pick(column, 'editOptions', 'maxLength'); if (maxLength > 0 && value.length > maxLength) { return value.substring(0, maxLength); } return value; }
[ "function", "(", "columnName", ",", "value", ")", "{", "var", "column", "=", "this", ".", "columnModel", ".", "getColumnModel", "(", "columnName", ")", ";", "var", "maxLength", "=", "snippet", ".", "pick", "(", "column", ",", "'editOptions'", ",", "'maxLen...
Check if given column has 'maxLength' property and returns the substring limited by maxLength. @param {string} columnName - columnName @param {string} value - value @returns {string} @private
[ "Check", "if", "given", "column", "has", "maxLength", "property", "and", "returns", "the", "substring", "limited", "by", "maxLength", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/painter/controller.js#L57-L66
train
nhn/tui.grid
src/js/painter/controller.js
function(address, shouldBlur, value) { var focusModel = this.focusModel; var row, currentValue; if (!focusModel.isEditingCell(address.rowKey, address.columnName)) { return false; } this.selectionModel.enable(); if (!_.isUndefined(value)) { row =...
javascript
function(address, shouldBlur, value) { var focusModel = this.focusModel; var row, currentValue; if (!focusModel.isEditingCell(address.rowKey, address.columnName)) { return false; } this.selectionModel.enable(); if (!_.isUndefined(value)) { row =...
[ "function", "(", "address", ",", "shouldBlur", ",", "value", ")", "{", "var", "focusModel", "=", "this", ".", "focusModel", ";", "var", "row", ",", "currentValue", ";", "if", "(", "!", "focusModel", ".", "isEditingCell", "(", "address", ".", "rowKey", ",...
Ends editing a cell identified by a given address, and returns the result. @param {{rowKey:String, columnName:String}} address - cell address @param {Boolean} shouldBlur - if set to true, make the current input lose focus. @param {String} [value] - if exists, set the value of the data model to this value. @returns {Boo...
[ "Ends", "editing", "a", "cell", "identified", "by", "a", "given", "address", "and", "returns", "the", "result", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/painter/controller.js#L75-L104
train
nhn/tui.grid
src/js/painter/controller.js
function(reverse) { var focusModel = this.focusModel; var address = reverse ? focusModel.prevAddress() : focusModel.nextAddress(); focusModel.focusIn(address.rowKey, address.columnName, true); }
javascript
function(reverse) { var focusModel = this.focusModel; var address = reverse ? focusModel.prevAddress() : focusModel.nextAddress(); focusModel.focusIn(address.rowKey, address.columnName, true); }
[ "function", "(", "reverse", ")", "{", "var", "focusModel", "=", "this", ".", "focusModel", ";", "var", "address", "=", "reverse", "?", "focusModel", ".", "prevAddress", "(", ")", ":", "focusModel", ".", "nextAddress", "(", ")", ";", "focusModel", ".", "f...
Moves focus to the next cell, and starts editing the cell. @param {Boolean} reverse - if set to true, find the previous cell instead of next cell
[ "Moves", "focus", "to", "the", "next", "cell", "and", "starts", "editing", "the", "cell", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/painter/controller.js#L110-L115
train
nhn/tui.grid
src/js/painter/controller.js
function(address, value) { var columnModel = this.columnModel.getColumnModel(address.columnName); if (_.isString(value)) { value = $.trim(value); } if (columnModel.validation && columnModel.validation.dataType === 'number') { value = convertToNumber(value); ...
javascript
function(address, value) { var columnModel = this.columnModel.getColumnModel(address.columnName); if (_.isString(value)) { value = $.trim(value); } if (columnModel.validation && columnModel.validation.dataType === 'number') { value = convertToNumber(value); ...
[ "function", "(", "address", ",", "value", ")", "{", "var", "columnModel", "=", "this", ".", "columnModel", ".", "getColumnModel", "(", "address", ".", "columnName", ")", ";", "if", "(", "_", ".", "isString", "(", "value", ")", ")", "{", "value", "=", ...
Sets the value of the given cell. @param {{rowKey:String, columnName:String}} address - cell address @param {(Number|String|Boolean)} value - value
[ "Sets", "the", "value", "of", "the", "given", "cell", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/painter/controller.js#L153-L171
train
nhn/tui.grid
src/js/painter/controller.js
function(address, value) { var columnModel = this.columnModel.getColumnModel(address.columnName); if (!snippet.pick(columnModel, 'editOptions', 'useViewMode')) { this.setValue(address, value); } }
javascript
function(address, value) { var columnModel = this.columnModel.getColumnModel(address.columnName); if (!snippet.pick(columnModel, 'editOptions', 'useViewMode')) { this.setValue(address, value); } }
[ "function", "(", "address", ",", "value", ")", "{", "var", "columnModel", "=", "this", ".", "columnModel", ".", "getColumnModel", "(", "address", ".", "columnName", ")", ";", "if", "(", "!", "snippet", ".", "pick", "(", "columnModel", ",", "'editOptions'",...
Sets the value of the given cell, if the given column is not using view-mode. @param {{rowKey:String, columnName:String}} address - cell address @param {(Number|String|Boolean)} value - value
[ "Sets", "the", "value", "of", "the", "given", "cell", "if", "the", "given", "column", "is", "not", "using", "view", "-", "mode", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/painter/controller.js#L178-L184
train
nhn/tui.grid
src/js/painter/controller.js
convertToNumber
function convertToNumber(value) { if (_.isString(value)) { value = value.replace(/,/g, ''); } if (_.isNumber(value) || isNaN(value) || util.isBlank(value)) { return value; } return Number(value); }
javascript
function convertToNumber(value) { if (_.isString(value)) { value = value.replace(/,/g, ''); } if (_.isNumber(value) || isNaN(value) || util.isBlank(value)) { return value; } return Number(value); }
[ "function", "convertToNumber", "(", "value", ")", "{", "if", "(", "_", ".", "isString", "(", "value", ")", ")", "{", "value", "=", "value", ".", "replace", "(", "/", ",", "/", "g", ",", "''", ")", ";", "}", "if", "(", "_", ".", "isNumber", "(",...
Converts given value to a number type and returns it. If the value is not a number type, returns the original value. @param {*} value - value @returns {*}
[ "Converts", "given", "value", "to", "a", "number", "type", "and", "returns", "it", ".", "If", "the", "value", "is", "not", "a", "number", "type", "returns", "the", "original", "value", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/painter/controller.js#L206-L216
train
nhn/tui.grid
wdio.conf.js
getScreenshotName
function getScreenshotName(basePath) { return function(context) { var testName = context.test.title.replace(/\s+/g, '-'); var browserName = context.browser.name; var browserVersion = parseInt(context.browser.version, 10); var subDir = browserName + '_v' + browserVersion; var ...
javascript
function getScreenshotName(basePath) { return function(context) { var testName = context.test.title.replace(/\s+/g, '-'); var browserName = context.browser.name; var browserVersion = parseInt(context.browser.version, 10); var subDir = browserName + '_v' + browserVersion; var ...
[ "function", "getScreenshotName", "(", "basePath", ")", "{", "return", "function", "(", "context", ")", "{", "var", "testName", "=", "context", ".", "test", ".", "title", ".", "replace", "(", "/", "\\s+", "/", "g", ",", "'-'", ")", ";", "var", "browserN...
Returns the screenshot name @param {String} basePath - base path @returns {String}
[ "Returns", "the", "screenshot", "name" ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/wdio.conf.js#L11-L21
train
jacomyal/sigma.js
src/classes/sigma.classes.configurable.js
function(a1, a2) { var o, i, l, k; if (arguments.length === 1 && typeof a1 === 'string') { if (data[a1] !== undefined) return data[a1]; for (i = 0, l = datas.length; i < l; i++) if (datas[i][a1] !== undefined) return datas[i][a1]...
javascript
function(a1, a2) { var o, i, l, k; if (arguments.length === 1 && typeof a1 === 'string') { if (data[a1] !== undefined) return data[a1]; for (i = 0, l = datas.length; i < l; i++) if (datas[i][a1] !== undefined) return datas[i][a1]...
[ "function", "(", "a1", ",", "a2", ")", "{", "var", "o", ",", "i", ",", "l", ",", "k", ";", "if", "(", "arguments", ".", "length", "===", "1", "&&", "typeof", "a1", "===", "'string'", ")", "{", "if", "(", "data", "[", "a1", "]", "!==", "undefi...
The method to use to set or get any property of this instance. @param {string|object} a1 If it is a string and if a2 is undefined, then it will return the corresponding property. If it is a string and if a2 is set, then it will set a2 as the property corresponding to a1, and return this. If it is an object, then e...
[ "The", "method", "to", "use", "to", "set", "or", "get", "any", "property", "of", "this", "instance", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/classes/sigma.classes.configurable.js#L51-L77
train
jacomyal/sigma.js
src/classes/sigma.classes.edgequad.js
function(n) { return { x1: n.x - n.size, y1: n.y - n.size, x2: n.x + n.size, y2: n.y - n.size, height: n.size * 2 }; }
javascript
function(n) { return { x1: n.x - n.size, y1: n.y - n.size, x2: n.x + n.size, y2: n.y - n.size, height: n.size * 2 }; }
[ "function", "(", "n", ")", "{", "return", "{", "x1", ":", "n", ".", "x", "-", "n", ".", "size", ",", "y1", ":", "n", ".", "y", "-", "n", ".", "size", ",", "x2", ":", "n", ".", "x", "+", "n", ".", "size", ",", "y2", ":", "n", ".", "y",...
Transforms a graph node with x, y and size into an axis-aligned square. @param {object} A graph node with at least a point (x, y) and a size. @return {object} A square: two points (x1, y1), (x2, y2) and height.
[ "Transforms", "a", "graph", "node", "with", "x", "y", "and", "size", "into", "an", "axis", "-", "aligned", "square", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/classes/sigma.classes.edgequad.js#L31-L39
train
jacomyal/sigma.js
src/classes/sigma.classes.edgequad.js
function(e) { if (e.y1 < e.y2) { // (e.x1, e.y1) on top if (e.x1 < e.x2) { // (e.x1, e.y1) on left return { x1: e.x1 - e.size, y1: e.y1 - e.size, x2: e.x2 + e.size, y2: e.y1 - e.size, height: e.y2 - e.y1 + e.size * 2 ...
javascript
function(e) { if (e.y1 < e.y2) { // (e.x1, e.y1) on top if (e.x1 < e.x2) { // (e.x1, e.y1) on left return { x1: e.x1 - e.size, y1: e.y1 - e.size, x2: e.x2 + e.size, y2: e.y1 - e.size, height: e.y2 - e.y1 + e.size * 2 ...
[ "function", "(", "e", ")", "{", "if", "(", "e", ".", "y1", "<", "e", ".", "y2", ")", "{", "// (e.x1, e.y1) on top", "if", "(", "e", ".", "x1", "<", "e", ".", "x2", ")", "{", "// (e.x1, e.y1) on left", "return", "{", "x1", ":", "e", ".", "x1", "...
Transforms a graph edge with x1, y1, x2, y2 and size into an axis-aligned square. @param {object} A graph edge with at least two points (x1, y1), (x2, y2) and a size. @return {object} A square: two points (x1, y1), (x2, y2) and height.
[ "Transforms", "a", "graph", "edge", "with", "x1", "y1", "x2", "y2", "and", "size", "into", "an", "axis", "-", "aligned", "square", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/classes/sigma.classes.edgequad.js#L49-L91
train
jacomyal/sigma.js
src/classes/sigma.classes.edgequad.js
function(e, cp) { var pt = sigma.utils.getPointOnQuadraticCurve( 0.5, e.x1, e.y1, e.x2, e.y2, cp.x, cp.y ); // Bounding box of the two points and the point at the middle of the // curve: var minX = Math.min(e.x1, e.x2, pt.x), ...
javascript
function(e, cp) { var pt = sigma.utils.getPointOnQuadraticCurve( 0.5, e.x1, e.y1, e.x2, e.y2, cp.x, cp.y ); // Bounding box of the two points and the point at the middle of the // curve: var minX = Math.min(e.x1, e.x2, pt.x), ...
[ "function", "(", "e", ",", "cp", ")", "{", "var", "pt", "=", "sigma", ".", "utils", ".", "getPointOnQuadraticCurve", "(", "0.5", ",", "e", ".", "x1", ",", "e", ".", "y1", ",", "e", ".", "x2", ",", "e", ".", "y2", ",", "cp", ".", "x", ",", "...
Transforms a graph edge of type 'curve' with x1, y1, x2, y2, control point and size into an axis-aligned square. @param {object} e A graph edge with at least two points (x1, y1), (x2, y2) and a size. @param {object} cp A control point (x,y). @return {object} A square: two points (x1, y1), (x2, y2) and height.
[ "Transforms", "a", "graph", "edge", "of", "type", "curve", "with", "x1", "y1", "x2", "y2", "control", "point", "and", "size", "into", "an", "axis", "-", "aligned", "square", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/classes/sigma.classes.edgequad.js#L102-L127
train
jacomyal/sigma.js
src/classes/sigma.classes.edgequad.js
function(n) { // Fitting to the curve is too costly, we compute a larger bounding box // using the control points: var cp = sigma.utils.getSelfLoopControlPoints(n.x, n.y, n.size); // Bounding box of the point and the two control points: var minX = Math.min(n.x, cp.x1, cp.x2), ma...
javascript
function(n) { // Fitting to the curve is too costly, we compute a larger bounding box // using the control points: var cp = sigma.utils.getSelfLoopControlPoints(n.x, n.y, n.size); // Bounding box of the point and the two control points: var minX = Math.min(n.x, cp.x1, cp.x2), ma...
[ "function", "(", "n", ")", "{", "// Fitting to the curve is too costly, we compute a larger bounding box", "// using the control points:", "var", "cp", "=", "sigma", ".", "utils", ".", "getSelfLoopControlPoints", "(", "n", ".", "x", ",", "n", ".", "y", ",", "n", "."...
Transforms a graph self loop into an axis-aligned square. @param {object} n A graph node with a point (x, y) and a size. @return {object} A square: two points (x1, y1), (x2, y2) and height.
[ "Transforms", "a", "graph", "self", "loop", "into", "an", "axis", "-", "aligned", "square", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/classes/sigma.classes.edgequad.js#L135-L153
train
jacomyal/sigma.js
src/classes/sigma.classes.edgequad.js
function(r) { var width = ( Math.sqrt( Math.pow(r.x2 - r.x1, 2) + Math.pow(r.y2 - r.y1, 2) ) ); return { x: r.x1 - (r.y2 - r.y1) * r.height / width, y: r.y1 + (r.x2 - r.x1) * r.height / width }; }
javascript
function(r) { var width = ( Math.sqrt( Math.pow(r.x2 - r.x1, 2) + Math.pow(r.y2 - r.y1, 2) ) ); return { x: r.x1 - (r.y2 - r.y1) * r.height / width, y: r.y1 + (r.x2 - r.x1) * r.height / width }; }
[ "function", "(", "r", ")", "{", "var", "width", "=", "(", "Math", ".", "sqrt", "(", "Math", ".", "pow", "(", "r", ".", "x2", "-", "r", ".", "x1", ",", "2", ")", "+", "Math", ".", "pow", "(", "r", ".", "y2", "-", "r", ".", "y1", ",", "2"...
Get coordinates of a rectangle's lower left corner from its top points. @param {object} A rectangle defined by two points (x1, y1) and (x2, y2). @return {object} Coordinates of the corner (x, y).
[ "Get", "coordinates", "of", "a", "rectangle", "s", "lower", "left", "corner", "from", "its", "top", "points", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/classes/sigma.classes.edgequad.js#L211-L223
train
jacomyal/sigma.js
src/classes/sigma.classes.edgequad.js
function(r, llc) { return { x: llc.x - r.x1 + r.x2, y: llc.y - r.y1 + r.y2 }; }
javascript
function(r, llc) { return { x: llc.x - r.x1 + r.x2, y: llc.y - r.y1 + r.y2 }; }
[ "function", "(", "r", ",", "llc", ")", "{", "return", "{", "x", ":", "llc", ".", "x", "-", "r", ".", "x1", "+", "r", ".", "x2", ",", "y", ":", "llc", ".", "y", "-", "r", ".", "y1", "+", "r", ".", "y2", "}", ";", "}" ]
Get coordinates of a rectangle's lower right corner from its top points and its lower left corner. @param {object} A rectangle defined by two points (x1, y1) and (x2, y2). @param {object} A corner's coordinates (x, y). @return {object} Coordinates of the corner (x, y).
[ "Get", "coordinates", "of", "a", "rectangle", "s", "lower", "right", "corner", "from", "its", "top", "points", "and", "its", "lower", "left", "corner", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/classes/sigma.classes.edgequad.js#L233-L238
train
jacomyal/sigma.js
src/classes/sigma.classes.edgequad.js
function(r) { var llc = this.lowerLeftCoor(r), lrc = this.lowerRightCoor(r, llc); return [ {x: r.x1, y: r.y1}, {x: r.x2, y: r.y2}, {x: llc.x, y: llc.y}, {x: lrc.x, y: lrc.y} ]; }
javascript
function(r) { var llc = this.lowerLeftCoor(r), lrc = this.lowerRightCoor(r, llc); return [ {x: r.x1, y: r.y1}, {x: r.x2, y: r.y2}, {x: llc.x, y: llc.y}, {x: lrc.x, y: lrc.y} ]; }
[ "function", "(", "r", ")", "{", "var", "llc", "=", "this", ".", "lowerLeftCoor", "(", "r", ")", ",", "lrc", "=", "this", ".", "lowerRightCoor", "(", "r", ",", "llc", ")", ";", "return", "[", "{", "x", ":", "r", ".", "x1", ",", "y", ":", "r", ...
Get the coordinates of all the corners of a rectangle from its top point. @param {object} A rectangle defined by two points (x1, y1) and (x2, y2). @return {array} An array of the four corners' coordinates (x, y).
[ "Get", "the", "coordinates", "of", "all", "the", "corners", "of", "a", "rectangle", "from", "its", "top", "point", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/classes/sigma.classes.edgequad.js#L246-L256
train
jacomyal/sigma.js
src/classes/sigma.classes.edgequad.js
function(b) { return [ [ {x: b.x, y: b.y}, {x: b.x + b.width / 2, y: b.y}, {x: b.x, y: b.y + b.height / 2}, {x: b.x + b.width / 2, y: b.y + b.height / 2} ], [ {x: b.x + b.width / 2, y: b.y}, {x: b.x + b.width, y: b.y}, {...
javascript
function(b) { return [ [ {x: b.x, y: b.y}, {x: b.x + b.width / 2, y: b.y}, {x: b.x, y: b.y + b.height / 2}, {x: b.x + b.width / 2, y: b.y + b.height / 2} ], [ {x: b.x + b.width / 2, y: b.y}, {x: b.x + b.width, y: b.y}, {...
[ "function", "(", "b", ")", "{", "return", "[", "[", "{", "x", ":", "b", ".", "x", ",", "y", ":", "b", ".", "y", "}", ",", "{", "x", ":", "b", ".", "x", "+", "b", ".", "width", "/", "2", ",", "y", ":", "b", ".", "y", "}", ",", "{", ...
Split a square defined by its boundaries into four. @param {object} Boundaries of the square (x, y, width, height). @return {array} An array containing the four new squares, themselves defined by an array of their four corners (x, y).
[ "Split", "a", "square", "defined", "by", "its", "boundaries", "into", "four", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/classes/sigma.classes.edgequad.js#L265-L292
train
jacomyal/sigma.js
src/classes/sigma.classes.edgequad.js
function(c1, c2) { return [ {x: c1[1].x - c1[0].x, y: c1[1].y - c1[0].y}, {x: c1[1].x - c1[3].x, y: c1[1].y - c1[3].y}, {x: c2[0].x - c2[2].x, y: c2[0].y - c2[2].y}, {x: c2[0].x - c2[1].x, y: c2[0].y - c2[1].y} ]; }
javascript
function(c1, c2) { return [ {x: c1[1].x - c1[0].x, y: c1[1].y - c1[0].y}, {x: c1[1].x - c1[3].x, y: c1[1].y - c1[3].y}, {x: c2[0].x - c2[2].x, y: c2[0].y - c2[2].y}, {x: c2[0].x - c2[1].x, y: c2[0].y - c2[1].y} ]; }
[ "function", "(", "c1", ",", "c2", ")", "{", "return", "[", "{", "x", ":", "c1", "[", "1", "]", ".", "x", "-", "c1", "[", "0", "]", ".", "x", ",", "y", ":", "c1", "[", "1", "]", ".", "y", "-", "c1", "[", "0", "]", ".", "y", "}", ",",...
Compute the four axis between corners of rectangle A and corners of rectangle B. This is needed later to check an eventual collision. @param {array} An array of rectangle A's four corners (x, y). @param {array} An array of rectangle B's four corners (x, y). @return {array} An array of four axis defined by their coor...
[ "Compute", "the", "four", "axis", "between", "corners", "of", "rectangle", "A", "and", "corners", "of", "rectangle", "B", ".", "This", "is", "needed", "later", "to", "check", "an", "eventual", "collision", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/classes/sigma.classes.edgequad.js#L302-L309
train
jacomyal/sigma.js
src/classes/sigma.classes.edgequad.js
function(c, a) { var l = ( (c.x * a.x + c.y * a.y) / (Math.pow(a.x, 2) + Math.pow(a.y, 2)) ); return { x: l * a.x, y: l * a.y }; }
javascript
function(c, a) { var l = ( (c.x * a.x + c.y * a.y) / (Math.pow(a.x, 2) + Math.pow(a.y, 2)) ); return { x: l * a.x, y: l * a.y }; }
[ "function", "(", "c", ",", "a", ")", "{", "var", "l", "=", "(", "(", "c", ".", "x", "*", "a", ".", "x", "+", "c", ".", "y", "*", "a", ".", "y", ")", "/", "(", "Math", ".", "pow", "(", "a", ".", "x", ",", "2", ")", "+", "Math", ".", ...
Project a rectangle's corner on an axis. @param {object} Coordinates of a corner (x, y). @param {object} Coordinates of an axis (x, y). @return {object} The projection defined by coordinates (x, y).
[ "Project", "a", "rectangle", "s", "corner", "on", "an", "axis", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/classes/sigma.classes.edgequad.js#L318-L328
train
jacomyal/sigma.js
src/classes/sigma.classes.edgequad.js
function(a, c1, c2) { var sc1 = [], sc2 = []; for (var ci = 0; ci < 4; ci++) { var p1 = this.projection(c1[ci], a), p2 = this.projection(c2[ci], a); sc1.push(p1.x * a.x + p1.y * a.y); sc2.push(p2.x * a.x + p2.y * a.y); } var maxc1 = Math.max.apply...
javascript
function(a, c1, c2) { var sc1 = [], sc2 = []; for (var ci = 0; ci < 4; ci++) { var p1 = this.projection(c1[ci], a), p2 = this.projection(c2[ci], a); sc1.push(p1.x * a.x + p1.y * a.y); sc2.push(p2.x * a.x + p2.y * a.y); } var maxc1 = Math.max.apply...
[ "function", "(", "a", ",", "c1", ",", "c2", ")", "{", "var", "sc1", "=", "[", "]", ",", "sc2", "=", "[", "]", ";", "for", "(", "var", "ci", "=", "0", ";", "ci", "<", "4", ";", "ci", "++", ")", "{", "var", "p1", "=", "this", ".", "projec...
Check whether two rectangles collide on one particular axis. @param {object} An axis' coordinates (x, y). @param {array} Rectangle A's corners. @param {array} Rectangle B's corners. @return {boolean} True if the rectangles collide on the axis.
[ "Check", "whether", "two", "rectangles", "collide", "on", "one", "particular", "axis", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/classes/sigma.classes.edgequad.js#L338-L356
train
jacomyal/sigma.js
src/classes/sigma.classes.edgequad.js
function(c1, c2) { var axis = this.axis(c1, c2), col = true; for (var i = 0; i < 4; i++) col = col && this.axisCollision(axis[i], c1, c2); return col; }
javascript
function(c1, c2) { var axis = this.axis(c1, c2), col = true; for (var i = 0; i < 4; i++) col = col && this.axisCollision(axis[i], c1, c2); return col; }
[ "function", "(", "c1", ",", "c2", ")", "{", "var", "axis", "=", "this", ".", "axis", "(", "c1", ",", "c2", ")", ",", "col", "=", "true", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "4", ";", "i", "++", ")", "col", "=", "col", ...
Check whether two rectangles collide on each one of their four axis. If all axis collide, then the two rectangles do collide on the plane. @param {array} Rectangle A's corners. @param {array} Rectangle B's corners. @return {boolean} True if the rectangles collide.
[ "Check", "whether", "two", "rectangles", "collide", "on", "each", "one", "of", "their", "four", "axis", ".", "If", "all", "axis", "collide", "then", "the", "two", "rectangles", "do", "collide", "on", "the", "plane", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/classes/sigma.classes.edgequad.js#L366-L374
train
jacomyal/sigma.js
src/classes/sigma.classes.edgequad.js
_quadIndexes
function _quadIndexes(rectangle, quadCorners) { var indexes = []; // Iterating through quads for (var i = 0; i < 4; i++) if ((rectangle.x2 >= quadCorners[i][0].x) && (rectangle.x1 <= quadCorners[i][1].x) && (rectangle.y1 + rectangle.height >= quadCorners[i][0].y) && (rec...
javascript
function _quadIndexes(rectangle, quadCorners) { var indexes = []; // Iterating through quads for (var i = 0; i < 4; i++) if ((rectangle.x2 >= quadCorners[i][0].x) && (rectangle.x1 <= quadCorners[i][1].x) && (rectangle.y1 + rectangle.height >= quadCorners[i][0].y) && (rec...
[ "function", "_quadIndexes", "(", "rectangle", ",", "quadCorners", ")", "{", "var", "indexes", "=", "[", "]", ";", "// Iterating through quads", "for", "(", "var", "i", "=", "0", ";", "i", "<", "4", ";", "i", "++", ")", "if", "(", "(", "rectangle", "....
Get a list of indexes of nodes containing an axis-aligned rectangle @param {object} rectangle A rectangle defined by two points (x1, y1), (x2, y2) and height. @param {array} quadCorners An array of the quad nodes' corners. @return {array} An array of indexes containing one to four integers.
[ "Get", "a", "list", "of", "indexes", "of", "nodes", "containing", "an", "axis", "-", "aligned", "rectangle" ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/classes/sigma.classes.edgequad.js#L431-L443
train
jacomyal/sigma.js
src/classes/sigma.classes.edgequad.js
_quadCollision
function _quadCollision(corners, quadCorners) { var indexes = []; // Iterating through quads for (var i = 0; i < 4; i++) if (_geom.collision(corners, quadCorners[i])) indexes.push(i); return indexes; }
javascript
function _quadCollision(corners, quadCorners) { var indexes = []; // Iterating through quads for (var i = 0; i < 4; i++) if (_geom.collision(corners, quadCorners[i])) indexes.push(i); return indexes; }
[ "function", "_quadCollision", "(", "corners", ",", "quadCorners", ")", "{", "var", "indexes", "=", "[", "]", ";", "// Iterating through quads", "for", "(", "var", "i", "=", "0", ";", "i", "<", "4", ";", "i", "++", ")", "if", "(", "_geom", ".", "colli...
Get a list of indexes of nodes containing a non-axis-aligned rectangle @param {array} corners An array containing each corner of the rectangle defined by its coordinates (x, y). @param {array} quadCorners An array of the quad nodes' corners. @return {array} An array of indexes containing one to...
[ "Get", "a", "list", "of", "indexes", "of", "nodes", "containing", "a", "non", "-", "axis", "-", "aligned", "rectangle" ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/classes/sigma.classes.edgequad.js#L454-L463
train
jacomyal/sigma.js
src/classes/sigma.classes.edgequad.js
_quadSubdivide
function _quadSubdivide(index, quad) { var next = quad.level + 1, subw = Math.round(quad.bounds.width / 2), subh = Math.round(quad.bounds.height / 2), qx = Math.round(quad.bounds.x), qy = Math.round(quad.bounds.y), x, y; switch (index) { case 0: x =...
javascript
function _quadSubdivide(index, quad) { var next = quad.level + 1, subw = Math.round(quad.bounds.width / 2), subh = Math.round(quad.bounds.height / 2), qx = Math.round(quad.bounds.x), qy = Math.round(quad.bounds.y), x, y; switch (index) { case 0: x =...
[ "function", "_quadSubdivide", "(", "index", ",", "quad", ")", "{", "var", "next", "=", "quad", ".", "level", "+", "1", ",", "subw", "=", "Math", ".", "round", "(", "quad", ".", "bounds", ".", "width", "/", "2", ")", ",", "subh", "=", "Math", ".",...
Subdivide a quad by creating a node at a precise index. The function does not generate all four nodes not to potentially create unused nodes. @param {integer} index The index of the node to create. @param {object} quad The quad object to subdivide. @return {object} A new quad representing the node create...
[ "Subdivide", "a", "quad", "by", "creating", "a", "node", "at", "a", "precise", "index", ".", "The", "function", "does", "not", "generate", "all", "four", "nodes", "not", "to", "potentially", "create", "unused", "nodes", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/classes/sigma.classes.edgequad.js#L473-L507
train
jacomyal/sigma.js
src/classes/sigma.classes.edgequad.js
_quadInsert
function _quadInsert(el, sizedPoint, quad) { if (quad.level < quad.maxLevel) { // Searching appropriate quads var indexes = _quadIndexes(sizedPoint, quad.corners); // Iterating for (var i = 0, l = indexes.length; i < l; i++) { // Subdividing if necessary if (quad.nodes[ind...
javascript
function _quadInsert(el, sizedPoint, quad) { if (quad.level < quad.maxLevel) { // Searching appropriate quads var indexes = _quadIndexes(sizedPoint, quad.corners); // Iterating for (var i = 0, l = indexes.length; i < l; i++) { // Subdividing if necessary if (quad.nodes[ind...
[ "function", "_quadInsert", "(", "el", ",", "sizedPoint", ",", "quad", ")", "{", "if", "(", "quad", ".", "level", "<", "quad", ".", "maxLevel", ")", "{", "// Searching appropriate quads", "var", "indexes", "=", "_quadIndexes", "(", "sizedPoint", ",", "quad", ...
Recursively insert an element into the quadtree. Only points with size, i.e. axis-aligned squares, may be inserted with this method. @param {object} el The element to insert in the quadtree. @param {object} sizedPoint A sized point defined by two top points (x1, y1), (x2, y2) and height. @param {object} ...
[ "Recursively", "insert", "an", "element", "into", "the", "quadtree", ".", "Only", "points", "with", "size", "i", ".", "e", ".", "axis", "-", "aligned", "squares", "may", "be", "inserted", "with", "this", "method", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/classes/sigma.classes.edgequad.js#L520-L542
train
jacomyal/sigma.js
src/classes/sigma.classes.edgequad.js
_quadRetrievePoint
function _quadRetrievePoint(point, quad) { if (quad.level < quad.maxLevel) { var index = _quadIndex(point, quad.bounds); // If node does not exist we return an empty list if (quad.nodes[index] !== undefined) { return _quadRetrievePoint(point, quad.nodes[index]); } else { ...
javascript
function _quadRetrievePoint(point, quad) { if (quad.level < quad.maxLevel) { var index = _quadIndex(point, quad.bounds); // If node does not exist we return an empty list if (quad.nodes[index] !== undefined) { return _quadRetrievePoint(point, quad.nodes[index]); } else { ...
[ "function", "_quadRetrievePoint", "(", "point", ",", "quad", ")", "{", "if", "(", "quad", ".", "level", "<", "quad", ".", "maxLevel", ")", "{", "var", "index", "=", "_quadIndex", "(", "point", ",", "quad", ".", "bounds", ")", ";", "// If node does not ex...
Recursively retrieve every elements held by the node containing the searched point. @param {object} point The searched point (x, y). @param {object} quad The searched quad. @return {array} An array of elements contained in the relevant node.
[ "Recursively", "retrieve", "every", "elements", "held", "by", "the", "node", "containing", "the", "searched", "point", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/classes/sigma.classes.edgequad.js#L553-L568
train
jacomyal/sigma.js
src/classes/sigma.classes.edgequad.js
_quadRetrieveArea
function _quadRetrieveArea(rectData, quad, collisionFunc, els) { els = els || {}; if (quad.level < quad.maxLevel) { var indexes = collisionFunc(rectData, quad.corners); for (var i = 0, l = indexes.length; i < l; i++) if (quad.nodes[indexes[i]] !== undefined) _quadRetrieveArea( ...
javascript
function _quadRetrieveArea(rectData, quad, collisionFunc, els) { els = els || {}; if (quad.level < quad.maxLevel) { var indexes = collisionFunc(rectData, quad.corners); for (var i = 0, l = indexes.length; i < l; i++) if (quad.nodes[indexes[i]] !== undefined) _quadRetrieveArea( ...
[ "function", "_quadRetrieveArea", "(", "rectData", ",", "quad", ",", "collisionFunc", ",", "els", ")", "{", "els", "=", "els", "||", "{", "}", ";", "if", "(", "quad", ".", "level", "<", "quad", ".", "maxLevel", ")", "{", "var", "indexes", "=", "collis...
Recursively retrieve every elements contained within an rectangular area that may or may not be axis-aligned. @param {object|array} rectData The searched area defined either by an array of four corners (x, y) in the case of a non-axis-aligned rectangle or an object with two top points (x1, y1), (x2, y2) and hei...
[ "Recursively", "retrieve", "every", "elements", "contained", "within", "an", "rectangular", "area", "that", "may", "or", "may", "not", "be", "axis", "-", "aligned", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/classes/sigma.classes.edgequad.js#L586-L606
train
jacomyal/sigma.js
plugins/sigma.plugins.filter/sigma.plugins.filter.js
register
function register(fn, p, key) { if (key != undefined && typeof key !== 'string') throw 'The filter key "'+ key.toString() +'" must be a string.'; if (key != undefined && !key.length) throw 'The filter key must be a non-empty string.'; if (typeof fn !== 'function') throw 'The predicate of...
javascript
function register(fn, p, key) { if (key != undefined && typeof key !== 'string') throw 'The filter key "'+ key.toString() +'" must be a string.'; if (key != undefined && !key.length) throw 'The filter key must be a non-empty string.'; if (typeof fn !== 'function') throw 'The predicate of...
[ "function", "register", "(", "fn", ",", "p", ",", "key", ")", "{", "if", "(", "key", "!=", "undefined", "&&", "typeof", "key", "!==", "'string'", ")", "throw", "'The filter key \"'", "+", "key", ".", "toString", "(", ")", "+", "'\" must be a string.'", "...
This function adds a filter to the chain of filters. @param {function} fn The filter (i.e. predicate processor). @param {function} p The predicate. @param {?string} key The key to identify the filter.
[ "This", "function", "adds", "a", "filter", "to", "the", "chain", "of", "filters", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/plugins/sigma.plugins.filter/sigma.plugins.filter.js#L138-L162
train
jacomyal/sigma.js
plugins/sigma.plugins.filter/sigma.plugins.filter.js
unregister
function unregister (o) { _chain = _chain.filter(function(a) { return !(a.key in o); }); for(var key in o) delete _keysIndex[key]; }
javascript
function unregister (o) { _chain = _chain.filter(function(a) { return !(a.key in o); }); for(var key in o) delete _keysIndex[key]; }
[ "function", "unregister", "(", "o", ")", "{", "_chain", "=", "_chain", ".", "filter", "(", "function", "(", "a", ")", "{", "return", "!", "(", "a", ".", "key", "in", "o", ")", ";", "}", ")", ";", "for", "(", "var", "key", "in", "o", ")", "del...
This function removes a set of filters from the chain. @param {object} o The filter keys.
[ "This", "function", "removes", "a", "set", "of", "filters", "from", "the", "chain", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/plugins/sigma.plugins.filter/sigma.plugins.filter.js#L169-L176
train
jacomyal/sigma.js
plugins/sigma.plugins.filter/sigma.plugins.filter.js
deepCopy
function deepCopy(o) { var copy = Object.create(null); for (var i in o) { if (typeof o[i] === "object" && o[i] !== null) { copy[i] = deepCopy(o[i]); } else if (typeof o[i] === "function" && o[i] !== null) { // clone function: eval(" copy[i] = " + o[i].toString()); ...
javascript
function deepCopy(o) { var copy = Object.create(null); for (var i in o) { if (typeof o[i] === "object" && o[i] !== null) { copy[i] = deepCopy(o[i]); } else if (typeof o[i] === "function" && o[i] !== null) { // clone function: eval(" copy[i] = " + o[i].toString()); ...
[ "function", "deepCopy", "(", "o", ")", "{", "var", "copy", "=", "Object", ".", "create", "(", "null", ")", ";", "for", "(", "var", "i", "in", "o", ")", "{", "if", "(", "typeof", "o", "[", "i", "]", "===", "\"object\"", "&&", "o", "[", "i", "]...
fast deep copy function
[ "fast", "deep", "copy", "function" ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/plugins/sigma.plugins.filter/sigma.plugins.filter.js#L368-L384
train
jacomyal/sigma.js
src/captors/sigma.captors.mouse.js
_upHandler
function _upHandler(e) { if (_settings('mouseEnabled') && _isMouseDown) { _isMouseDown = false; if (_movingTimeoutId) clearTimeout(_movingTimeoutId); _camera.isMoving = false; var x = sigma.utils.getX(e), y = sigma.utils.getY(e); if (_isMoving) { ...
javascript
function _upHandler(e) { if (_settings('mouseEnabled') && _isMouseDown) { _isMouseDown = false; if (_movingTimeoutId) clearTimeout(_movingTimeoutId); _camera.isMoving = false; var x = sigma.utils.getX(e), y = sigma.utils.getY(e); if (_isMoving) { ...
[ "function", "_upHandler", "(", "e", ")", "{", "if", "(", "_settings", "(", "'mouseEnabled'", ")", "&&", "_isMouseDown", ")", "{", "_isMouseDown", "=", "false", ";", "if", "(", "_movingTimeoutId", ")", "clearTimeout", "(", "_movingTimeoutId", ")", ";", "_came...
The handler listening to the 'up' mouse event. It will stop dragging the graph. @param {event} e A mouse event.
[ "The", "handler", "listening", "to", "the", "up", "mouse", "event", ".", "It", "will", "stop", "dragging", "the", "graph", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/captors/sigma.captors.mouse.js#L151-L192
train
jacomyal/sigma.js
src/captors/sigma.captors.mouse.js
_downHandler
function _downHandler(e) { if (_settings('mouseEnabled')) { _startCameraX = _camera.x; _startCameraY = _camera.y; _lastCameraX = _camera.x; _lastCameraY = _camera.y; _startMouseX = sigma.utils.getX(e); _startMouseY = sigma.utils.getY(e); _hasDragged = fal...
javascript
function _downHandler(e) { if (_settings('mouseEnabled')) { _startCameraX = _camera.x; _startCameraY = _camera.y; _lastCameraX = _camera.x; _lastCameraY = _camera.y; _startMouseX = sigma.utils.getX(e); _startMouseY = sigma.utils.getY(e); _hasDragged = fal...
[ "function", "_downHandler", "(", "e", ")", "{", "if", "(", "_settings", "(", "'mouseEnabled'", ")", ")", "{", "_startCameraX", "=", "_camera", ".", "x", ";", "_startCameraY", "=", "_camera", ".", "y", ";", "_lastCameraX", "=", "_camera", ".", "x", ";", ...
The handler listening to the 'down' mouse event. It will start observing the mouse position for dragging the graph. @param {event} e A mouse event.
[ "The", "handler", "listening", "to", "the", "down", "mouse", "event", ".", "It", "will", "start", "observing", "the", "mouse", "position", "for", "dragging", "the", "graph", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/captors/sigma.captors.mouse.js#L200-L233
train
jacomyal/sigma.js
src/captors/sigma.captors.mouse.js
_clickHandler
function _clickHandler(e) { if (_settings('mouseEnabled')) { var event = sigma.utils.mouseCoords(e); event.isDragging = (((new Date()).getTime() - _downStartTime) > 100) && _hasDragged; _self.dispatchEvent('click', event); } if (e.preventDefault) e.preventDef...
javascript
function _clickHandler(e) { if (_settings('mouseEnabled')) { var event = sigma.utils.mouseCoords(e); event.isDragging = (((new Date()).getTime() - _downStartTime) > 100) && _hasDragged; _self.dispatchEvent('click', event); } if (e.preventDefault) e.preventDef...
[ "function", "_clickHandler", "(", "e", ")", "{", "if", "(", "_settings", "(", "'mouseEnabled'", ")", ")", "{", "var", "event", "=", "sigma", ".", "utils", ".", "mouseCoords", "(", "e", ")", ";", "event", ".", "isDragging", "=", "(", "(", "(", "new", ...
The handler listening to the 'click' mouse event. It will redispatch the click event, but with normalized X and Y coordinates. @param {event} e A mouse event.
[ "The", "handler", "listening", "to", "the", "click", "mouse", "event", ".", "It", "will", "redispatch", "the", "click", "event", "but", "with", "normalized", "X", "and", "Y", "coordinates", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/captors/sigma.captors.mouse.js#L252-L267
train
jacomyal/sigma.js
src/captors/sigma.captors.mouse.js
_doubleClickHandler
function _doubleClickHandler(e) { var pos, ratio, animation; if (_settings('mouseEnabled')) { ratio = 1 / _settings('doubleClickZoomingRatio'); _self.dispatchEvent('doubleclick', sigma.utils.mouseCoords(e, _startMouseX, _startMouseY)); if (_settings...
javascript
function _doubleClickHandler(e) { var pos, ratio, animation; if (_settings('mouseEnabled')) { ratio = 1 / _settings('doubleClickZoomingRatio'); _self.dispatchEvent('doubleclick', sigma.utils.mouseCoords(e, _startMouseX, _startMouseY)); if (_settings...
[ "function", "_doubleClickHandler", "(", "e", ")", "{", "var", "pos", ",", "ratio", ",", "animation", ";", "if", "(", "_settings", "(", "'mouseEnabled'", ")", ")", "{", "ratio", "=", "1", "/", "_settings", "(", "'doubleClickZoomingRatio'", ")", ";", "_self"...
The handler listening to the double click custom event. It will basically zoom into the graph. @param {event} e A mouse event.
[ "The", "handler", "listening", "to", "the", "double", "click", "custom", "event", ".", "It", "will", "basically", "zoom", "into", "the", "graph", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/captors/sigma.captors.mouse.js#L275-L308
train
jacomyal/sigma.js
src/captors/sigma.captors.mouse.js
_wheelHandler
function _wheelHandler(e) { var pos, ratio, animation, wheelDelta = sigma.utils.getDelta(e); if (_settings('mouseEnabled') && _settings('mouseWheelEnabled') && wheelDelta !== 0) { ratio = wheelDelta > 0 ? 1 / _settings('zoomingRatio') : _settings('z...
javascript
function _wheelHandler(e) { var pos, ratio, animation, wheelDelta = sigma.utils.getDelta(e); if (_settings('mouseEnabled') && _settings('mouseWheelEnabled') && wheelDelta !== 0) { ratio = wheelDelta > 0 ? 1 / _settings('zoomingRatio') : _settings('z...
[ "function", "_wheelHandler", "(", "e", ")", "{", "var", "pos", ",", "ratio", ",", "animation", ",", "wheelDelta", "=", "sigma", ".", "utils", ".", "getDelta", "(", "e", ")", ";", "if", "(", "_settings", "(", "'mouseEnabled'", ")", "&&", "_settings", "(...
The handler listening to the 'wheel' mouse event. It will basically zoom in or not into the graph. @param {event} e A mouse event.
[ "The", "handler", "listening", "to", "the", "wheel", "mouse", "event", ".", "It", "will", "basically", "zoom", "in", "or", "not", "into", "the", "graph", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/captors/sigma.captors.mouse.js#L316-L347
train
jacomyal/sigma.js
src/classes/sigma.classes.graph.js
function(settings) { var k, fn, data; /** * DATA: * ***** * Every data that is callable from graph methods are stored in this "data" * object. This object will be served as context for all these methods, * and it is possible to add other type of data in it. */ ...
javascript
function(settings) { var k, fn, data; /** * DATA: * ***** * Every data that is callable from graph methods are stored in this "data" * object. This object will be served as context for all these methods, * and it is possible to add other type of data in it. */ ...
[ "function", "(", "settings", ")", "{", "var", "k", ",", "fn", ",", "data", ";", "/**\n * DATA:\n * *****\n * Every data that is callable from graph methods are stored in this \"data\"\n * object. This object will be served as context for all these methods,\n * and it is p...
The graph constructor. It initializes the data and the indexes, and binds the custom indexes and methods to its own scope. Recognized parameters: ********************** Here is the exhaustive list of every accepted parameters in the settings object: {boolean} clone Indicates if the data have to be cloned in metho...
[ "The", "graph", "constructor", ".", "It", "initializes", "the", "data", "and", "the", "indexes", "and", "binds", "the", "custom", "indexes", "and", "methods", "to", "its", "own", "scope", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/classes/sigma.classes.graph.js#L35-L94
train
jacomyal/sigma.js
src/classes/sigma.classes.graph.js
__bindGraphMethod
function __bindGraphMethod(methodName, scope, fn) { var result = function() { var k, res; // Execute "before" bound functions: for (k in _methodBeforeBindings[methodName]) _methodBeforeBindings[methodName][k].apply(scope, arguments); // Apply the method: res = fn.ap...
javascript
function __bindGraphMethod(methodName, scope, fn) { var result = function() { var k, res; // Execute "before" bound functions: for (k in _methodBeforeBindings[methodName]) _methodBeforeBindings[methodName][k].apply(scope, arguments); // Apply the method: res = fn.ap...
[ "function", "__bindGraphMethod", "(", "methodName", ",", "scope", ",", "fn", ")", "{", "var", "result", "=", "function", "(", ")", "{", "var", "k", ",", "res", ";", "// Execute \"before\" bound functions:", "for", "(", "k", "in", "_methodBeforeBindings", "[", ...
A custom tool to bind methods such that function that are bound to it will be executed anytime the method is called. @param {string} methodName The name of the method to bind. @param {object} scope The scope where the method must be executed. @param {function} fn The method itself. @return {functio...
[ "A", "custom", "tool", "to", "bind", "methods", "such", "that", "function", "that", "are", "bound", "to", "it", "will", "be", "executed", "anytime", "the", "method", "is", "called", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/classes/sigma.classes.graph.js#L108-L129
train
jacomyal/sigma.js
src/classes/sigma.classes.quad.js
_quadTree
function _quadTree(bounds, level, maxElements, maxLevel) { return { level: level || 0, bounds: bounds, corners: _geom.splitSquare(bounds), maxElements: maxElements || 20, maxLevel: maxLevel || 4, elements: [], nodes: [] }; }
javascript
function _quadTree(bounds, level, maxElements, maxLevel) { return { level: level || 0, bounds: bounds, corners: _geom.splitSquare(bounds), maxElements: maxElements || 20, maxLevel: maxLevel || 4, elements: [], nodes: [] }; }
[ "function", "_quadTree", "(", "bounds", ",", "level", ",", "maxElements", ",", "maxLevel", ")", "{", "return", "{", "level", ":", "level", "||", "0", ",", "bounds", ":", "bounds", ",", "corners", ":", "_geom", ".", "splitSquare", "(", "bounds", ")", ",...
Creates the quadtree object itself. @param {object} bounds The boundaries of the quad defined by an origin (x, y), width and heigth. @param {integer} level The level of the quad in the tree. @param {integer} maxElements The max number of element in a leaf node. @param {integer} maxLevel The ...
[ "Creates", "the", "quadtree", "object", "itself", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/classes/sigma.classes.quad.js#L503-L513
train
jacomyal/sigma.js
src/captors/sigma.captors.touch.js
_handleLeave
function _handleLeave(e) { if (_settings('touchEnabled')) { _downTouches = e.touches; var inertiaRatio = _settings('touchInertiaRatio'); if (_movingTimeoutId) { _isMoving = false; clearTimeout(_movingTimeoutId); } switch (_touchMode) { case 2...
javascript
function _handleLeave(e) { if (_settings('touchEnabled')) { _downTouches = e.touches; var inertiaRatio = _settings('touchInertiaRatio'); if (_movingTimeoutId) { _isMoving = false; clearTimeout(_movingTimeoutId); } switch (_touchMode) { case 2...
[ "function", "_handleLeave", "(", "e", ")", "{", "if", "(", "_settings", "(", "'touchEnabled'", ")", ")", "{", "_downTouches", "=", "e", ".", "touches", ";", "var", "inertiaRatio", "=", "_settings", "(", "'touchInertiaRatio'", ")", ";", "if", "(", "_movingT...
The handler listening to the 'touchend', 'touchcancel' and 'touchleave' event. It will update the touch mode if there are still at least one finger, and stop dragging else. @param {event} e A touch event.
[ "The", "handler", "listening", "to", "the", "touchend", "touchcancel", "and", "touchleave", "event", ".", "It", "will", "update", "the", "touch", "mode", "if", "there", "are", "still", "at", "least", "one", "finger", "and", "stop", "dragging", "else", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/captors/sigma.captors.touch.js#L172-L217
train
jacomyal/sigma.js
src/captors/sigma.captors.touch.js
_doubleTapHandler
function _doubleTapHandler(e) { var pos, ratio, animation; if (e.touches && e.touches.length === 1 && _settings('touchEnabled')) { _doubleTap = true; ratio = 1 / _settings('doubleClickZoomingRatio'); pos = position(e.touches[0]); _self.dispatchEvent('do...
javascript
function _doubleTapHandler(e) { var pos, ratio, animation; if (e.touches && e.touches.length === 1 && _settings('touchEnabled')) { _doubleTap = true; ratio = 1 / _settings('doubleClickZoomingRatio'); pos = position(e.touches[0]); _self.dispatchEvent('do...
[ "function", "_doubleTapHandler", "(", "e", ")", "{", "var", "pos", ",", "ratio", ",", "animation", ";", "if", "(", "e", ".", "touches", "&&", "e", ".", "touches", ".", "length", "===", "1", "&&", "_settings", "(", "'touchEnabled'", ")", ")", "{", "_d...
The handler listening to the double tap custom event. It will basically zoom into the graph. @param {event} e A touch event.
[ "The", "handler", "listening", "to", "the", "double", "tap", "custom", "event", ".", "It", "will", "basically", "zoom", "into", "the", "graph", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/captors/sigma.captors.touch.js#L369-L408
train
jacomyal/sigma.js
plugins/sigma.parsers.gexf/gexf-parser.js
Edge
function Edge(properties) { // Possible Properties var edge = { id: properties.id, type: properties.type || 'undirected', label: properties.label || '', source: properties.source, target: properties.target, weight: +properties.weight || 1.0 }; if (properties.viz) ...
javascript
function Edge(properties) { // Possible Properties var edge = { id: properties.id, type: properties.type || 'undirected', label: properties.label || '', source: properties.source, target: properties.target, weight: +properties.weight || 1.0 }; if (properties.viz) ...
[ "function", "Edge", "(", "properties", ")", "{", "// Possible Properties", "var", "edge", "=", "{", "id", ":", "properties", ".", "id", ",", "type", ":", "properties", ".", "type", "||", "'undirected'", ",", "label", ":", "properties", ".", "label", "||", ...
Edge structure. A function returning an object guarded with default value. @param {object} properties The edge properties. @return {object} The guarded edge object.
[ "Edge", "structure", ".", "A", "function", "returning", "an", "object", "guarded", "with", "default", "value", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/plugins/sigma.parsers.gexf/gexf-parser.js#L170-L189
train
jacomyal/sigma.js
plugins/sigma.parsers.gexf/gexf-parser.js
_data
function _data(model, node_or_edge) { var data = {}; var attvalues_els = node_or_edge.getElementsByTagName('attvalue'); // Getting Node Indicated Attributes var ah = _helpers.nodeListToHash(attvalues_els, function(el) { var attributes = _helpers.namedNodeMapToObject(el.attributes); ...
javascript
function _data(model, node_or_edge) { var data = {}; var attvalues_els = node_or_edge.getElementsByTagName('attvalue'); // Getting Node Indicated Attributes var ah = _helpers.nodeListToHash(attvalues_els, function(el) { var attributes = _helpers.namedNodeMapToObject(el.attributes); ...
[ "function", "_data", "(", "model", ",", "node_or_edge", ")", "{", "var", "data", "=", "{", "}", ";", "var", "attvalues_els", "=", "node_or_edge", ".", "getElementsByTagName", "(", "'attvalue'", ")", ";", "// Getting Node Indicated Attributes", "var", "ah", "=", ...
Data from nodes or edges
[ "Data", "from", "nodes", "or", "edges" ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/plugins/sigma.parsers.gexf/gexf-parser.js#L271-L297
train
jacomyal/sigma.js
plugins/sigma.parsers.gexf/gexf-parser.js
_nodeViz
function _nodeViz(node) { var viz = {}; // Color var color_el = _helpers.getFirstElementByTagNS(node, 'viz', 'color'); if (color_el) { var color = ['r', 'g', 'b', 'a'].map(function(c) { return color_el.getAttribute(c); }); viz.color = _helpers.getRGB(color); ...
javascript
function _nodeViz(node) { var viz = {}; // Color var color_el = _helpers.getFirstElementByTagNS(node, 'viz', 'color'); if (color_el) { var color = ['r', 'g', 'b', 'a'].map(function(c) { return color_el.getAttribute(c); }); viz.color = _helpers.getRGB(color); ...
[ "function", "_nodeViz", "(", "node", ")", "{", "var", "viz", "=", "{", "}", ";", "// Color", "var", "color_el", "=", "_helpers", ".", "getFirstElementByTagNS", "(", "node", ",", "'viz'", ",", "'color'", ")", ";", "if", "(", "color_el", ")", "{", "var",...
Viz information from nodes
[ "Viz", "information", "from", "nodes" ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/plugins/sigma.parsers.gexf/gexf-parser.js#L328-L364
train
jacomyal/sigma.js
plugins/sigma.parsers.gexf/gexf-parser.js
_edgeViz
function _edgeViz(edge) { var viz = {}; // Color var color_el = _helpers.getFirstElementByTagNS(edge, 'viz', 'color'); if (color_el) { var color = ['r', 'g', 'b', 'a'].map(function(c) { return color_el.getAttribute(c); }); viz.color = _helpers.getRGB(color); ...
javascript
function _edgeViz(edge) { var viz = {}; // Color var color_el = _helpers.getFirstElementByTagNS(edge, 'viz', 'color'); if (color_el) { var color = ['r', 'g', 'b', 'a'].map(function(c) { return color_el.getAttribute(c); }); viz.color = _helpers.getRGB(color); ...
[ "function", "_edgeViz", "(", "edge", ")", "{", "var", "viz", "=", "{", "}", ";", "// Color", "var", "color_el", "=", "_helpers", ".", "getFirstElementByTagNS", "(", "edge", ",", "'viz'", ",", "'color'", ")", ";", "if", "(", "color_el", ")", "{", "var",...
Viz information from edges
[ "Viz", "information", "from", "edges" ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/plugins/sigma.parsers.gexf/gexf-parser.js#L395-L420
train
jacomyal/sigma.js
plugins/sigma.parsers.gexf/gexf-parser.js
fetchAndParse
function fetchAndParse(gexf_url, callback) { if (typeof callback === 'function') { return fetch(gexf_url, function(gexf) { callback(Graph(gexf)); }); } else return Graph(fetch(gexf_url)); }
javascript
function fetchAndParse(gexf_url, callback) { if (typeof callback === 'function') { return fetch(gexf_url, function(gexf) { callback(Graph(gexf)); }); } else return Graph(fetch(gexf_url)); }
[ "function", "fetchAndParse", "(", "gexf_url", ",", "callback", ")", "{", "if", "(", "typeof", "callback", "===", "'function'", ")", "{", "return", "fetch", "(", "gexf_url", ",", "function", "(", "gexf", ")", "{", "callback", "(", "Graph", "(", "gexf", ")...
Fetch and parse the GEXF File
[ "Fetch", "and", "parse", "the", "GEXF", "File" ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/plugins/sigma.parsers.gexf/gexf-parser.js#L521-L528
train
jacomyal/sigma.js
plugins/sigma.plugins.dragNodes/sigma.plugins.dragNodes.js
calculateOffset
function calculateOffset(element) { var style = window.getComputedStyle(element); var getCssProperty = function(prop) { return parseInt(style.getPropertyValue(prop).replace('px', '')) || 0; }; return { left: element.getBoundingClientRect().left + getCssProperty('padding-left'), ...
javascript
function calculateOffset(element) { var style = window.getComputedStyle(element); var getCssProperty = function(prop) { return parseInt(style.getPropertyValue(prop).replace('px', '')) || 0; }; return { left: element.getBoundingClientRect().left + getCssProperty('padding-left'), ...
[ "function", "calculateOffset", "(", "element", ")", "{", "var", "style", "=", "window", ".", "getComputedStyle", "(", "element", ")", ";", "var", "getCssProperty", "=", "function", "(", "prop", ")", "{", "return", "parseInt", "(", "style", ".", "getPropertyV...
Calculates the global offset of the given element more accurately than element.offsetTop and element.offsetLeft.
[ "Calculates", "the", "global", "offset", "of", "the", "given", "element", "more", "accurately", "than", "element", ".", "offsetTop", "and", "element", ".", "offsetLeft", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/plugins/sigma.plugins.dragNodes/sigma.plugins.dragNodes.js#L96-L105
train
jacomyal/sigma.js
plugins/sigma.layout.forceAtlas2/worker.js
function(e) { switch (e.data.action) { case 'start': init( new Float32Array(e.data.nodes), new Float32Array(e.data.edges), e.data.config ); // First iteration(s) run(W.settings.startingIterations); break; case ...
javascript
function(e) { switch (e.data.action) { case 'start': init( new Float32Array(e.data.nodes), new Float32Array(e.data.edges), e.data.config ); // First iteration(s) run(W.settings.startingIterations); break; case ...
[ "function", "(", "e", ")", "{", "switch", "(", "e", ".", "data", ".", "action", ")", "{", "case", "'start'", ":", "init", "(", "new", "Float32Array", "(", "e", ".", "data", ".", "nodes", ")", ",", "new", "Float32Array", "(", "e", ".", "data", "."...
On supervisor message
[ "On", "supervisor", "message" ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/plugins/sigma.layout.forceAtlas2/worker.js#L993-L1029
train
jacomyal/sigma.js
src/conrad.js
_dispatch
function _dispatch(events, data) { var i, j, i_end, j_end, event, eventName, eArray = Array.isArray(events) ? events : events.split(/ /); data = data === undefined ? {} : data; for (i = 0, i_end = eArray.length; i !== i_...
javascript
function _dispatch(events, data) { var i, j, i_end, j_end, event, eventName, eArray = Array.isArray(events) ? events : events.split(/ /); data = data === undefined ? {} : data; for (i = 0, i_end = eArray.length; i !== i_...
[ "function", "_dispatch", "(", "events", ",", "data", ")", "{", "var", "i", ",", "j", ",", "i_end", ",", "j_end", ",", "event", ",", "eventName", ",", "eArray", "=", "Array", ".", "isArray", "(", "events", ")", "?", "events", ":", "events", ".", "sp...
Executes each handler bound to the event. @param {string} events The name of the event (or the events separated by spaces). @param {?Object} data The content of the event (optional). @return {Object} Returns conrad.
[ "Executes", "each", "handler", "bound", "to", "the", "event", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/conrad.js#L225-L253
train
jacomyal/sigma.js
src/conrad.js
_activateJob
function _activateJob(job) { var l = _sortedByPriorityJobs.length; // Add the job to the running jobs: _runningJobs[job.id] = job; job.status = 'running'; // Add the job to the priorities: if (l) { job.weightTime = _sortedByPriorityJobs[l - 1].weightTime; job.currentTime = job.weig...
javascript
function _activateJob(job) { var l = _sortedByPriorityJobs.length; // Add the job to the running jobs: _runningJobs[job.id] = job; job.status = 'running'; // Add the job to the priorities: if (l) { job.weightTime = _sortedByPriorityJobs[l - 1].weightTime; job.currentTime = job.weig...
[ "function", "_activateJob", "(", "job", ")", "{", "var", "l", "=", "_sortedByPriorityJobs", ".", "length", ";", "// Add the job to the running jobs:", "_runningJobs", "[", "job", ".", "id", "]", "=", "job", ";", "job", ".", "status", "=", "'running'", ";", "...
Activates a job, by adding it to the _runningJobs object and the _sortedByPriorityJobs array. It also initializes its currentTime value. @param {Object} job The job to activate.
[ "Activates", "a", "job", "by", "adding", "it", "to", "the", "_runningJobs", "object", "and", "the", "_sortedByPriorityJobs", "array", ".", "It", "also", "initializes", "its", "currentTime", "value", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/conrad.js#L306-L324
train
jacomyal/sigma.js
src/conrad.js
_addJob
function _addJob(v1, v2) { var i, l, o; // Array of jobs: if (Array.isArray(v1)) { // Keep conrad to start until the last job is added: _noStart = true; for (i = 0, l = v1.length; i < l; i++) _addJob(v1[i].id, __extend(v1[i], v2)); _noStart = false; i...
javascript
function _addJob(v1, v2) { var i, l, o; // Array of jobs: if (Array.isArray(v1)) { // Keep conrad to start until the last job is added: _noStart = true; for (i = 0, l = v1.length; i < l; i++) _addJob(v1[i].id, __extend(v1[i], v2)); _noStart = false; i...
[ "function", "_addJob", "(", "v1", ",", "v2", ")", "{", "var", "i", ",", "l", ",", "o", ";", "// Array of jobs:", "if", "(", "Array", ".", "isArray", "(", "v1", ")", ")", "{", "// Keep conrad to start until the last job is added:", "_noStart", "=", "true", ...
Adds one or more jobs, and starts the loop if no job was running before. A job is at least a unique string "id" and a function, and there are some parameters that you can specify for each job to modify the way conrad will execute it. If a job is added with the "id" of another job that is waiting or still running, an er...
[ "Adds", "one", "or", "more", "jobs", "and", "starts", "the", "loop", "if", "no", "job", "was", "running", "before", ".", "A", "job", "is", "at", "least", "a", "unique", "string", "id", "and", "a", "function", "and", "there", "are", "some", "parameters"...
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/conrad.js#L473-L579
train
jacomyal/sigma.js
src/conrad.js
_killJob
function _killJob(v1) { var i, l, k, a, job, found = false; // Array of job ids: if (Array.isArray(v1)) for (i = 0, l = v1.length; i < l; i++) _killJob(v1[i]); // One job's id: else if (typeof v1 === 'string') { a = [_runningJobs, _waitin...
javascript
function _killJob(v1) { var i, l, k, a, job, found = false; // Array of job ids: if (Array.isArray(v1)) for (i = 0, l = v1.length; i < l; i++) _killJob(v1[i]); // One job's id: else if (typeof v1 === 'string') { a = [_runningJobs, _waitin...
[ "function", "_killJob", "(", "v1", ")", "{", "var", "i", ",", "l", ",", "k", ",", "a", ",", "job", ",", "found", "=", "false", ";", "// Array of job ids:", "if", "(", "Array", ".", "isArray", "(", "v1", ")", ")", "for", "(", "i", "=", "0", ",",...
Kills one or more jobs, indicated by their ids. It is only possible to kill running jobs or waiting jobs. If you try to kill a job that does not exist or that is already killed, a warning will be thrown. @param {Array|String} v1 A string job id or an array of job ids. @return {Object} Returns conrad.
[ "Kills", "one", "or", "more", "jobs", "indicated", "by", "their", "ids", ".", "It", "is", "only", "possible", "to", "kill", "running", "jobs", "or", "waiting", "jobs", ".", "If", "you", "try", "to", "kill", "a", "job", "that", "does", "not", "exist", ...
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/conrad.js#L589-L641
train
jacomyal/sigma.js
src/conrad.js
_killAll
function _killAll() { var k, jobs = __extend(_jobs, _runningJobs, _waitingJobs); // Take every jobs and push them into the _doneJobs object: if (_parameters.history) for (k in jobs) { jobs[k].status = 'done'; _doneJobs.push(jobs[k]); if (typeof jobs[k].end === 'functi...
javascript
function _killAll() { var k, jobs = __extend(_jobs, _runningJobs, _waitingJobs); // Take every jobs and push them into the _doneJobs object: if (_parameters.history) for (k in jobs) { jobs[k].status = 'done'; _doneJobs.push(jobs[k]); if (typeof jobs[k].end === 'functi...
[ "function", "_killAll", "(", ")", "{", "var", "k", ",", "jobs", "=", "__extend", "(", "_jobs", ",", "_runningJobs", ",", "_waitingJobs", ")", ";", "// Take every jobs and push them into the _doneJobs object:", "if", "(", "_parameters", ".", "history", ")", "for", ...
Kills every running, waiting, and just added jobs. @return {Object} Returns conrad.
[ "Kills", "every", "running", "waiting", "and", "just", "added", "jobs", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/conrad.js#L648-L672
train
jacomyal/sigma.js
src/conrad.js
_hasJob
function _hasJob(id) { var job = _jobs[id] || _runningJobs[id] || _waitingJobs[id]; return job ? __extend(job) : null; }
javascript
function _hasJob(id) { var job = _jobs[id] || _runningJobs[id] || _waitingJobs[id]; return job ? __extend(job) : null; }
[ "function", "_hasJob", "(", "id", ")", "{", "var", "job", "=", "_jobs", "[", "id", "]", "||", "_runningJobs", "[", "id", "]", "||", "_waitingJobs", "[", "id", "]", ";", "return", "job", "?", "__extend", "(", "job", ")", ":", "null", ";", "}" ]
Returns true if a job with the specified id is currently running or waiting, and false else. @param {String} id The id of the job. @return {?Object} Returns the job object if it exists.
[ "Returns", "true", "if", "a", "job", "with", "the", "specified", "id", "is", "currently", "running", "or", "waiting", "and", "false", "else", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/conrad.js#L681-L684
train
jacomyal/sigma.js
src/conrad.js
_settings
function _settings(v1, v2) { var o; if (typeof a1 === 'string' && arguments.length === 1) return _parameters[a1]; else { o = (typeof a1 === 'object' && arguments.length === 1) ? a1 || {} : {}; if (typeof a1 === 'string') o[a1] = a2; for (var k in o) ...
javascript
function _settings(v1, v2) { var o; if (typeof a1 === 'string' && arguments.length === 1) return _parameters[a1]; else { o = (typeof a1 === 'object' && arguments.length === 1) ? a1 || {} : {}; if (typeof a1 === 'string') o[a1] = a2; for (var k in o) ...
[ "function", "_settings", "(", "v1", ",", "v2", ")", "{", "var", "o", ";", "if", "(", "typeof", "a1", "===", "'string'", "&&", "arguments", ".", "length", "===", "1", ")", "return", "_parameters", "[", "a1", "]", ";", "else", "{", "o", "=", "(", "...
This method will set the setting specified by "v1" to the value specified by "v2" if both are given, and else return the current value of the settings "v1". @param {String} v1 The name of the property. @param {?*} v2 Eventually, a value to set to the specified property. @return {Object|*} Returns the specifi...
[ "This", "method", "will", "set", "the", "setting", "specified", "by", "v1", "to", "the", "value", "specified", "by", "v2", "if", "both", "are", "given", "and", "else", "return", "the", "current", "value", "of", "the", "settings", "v1", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/conrad.js#L697-L717
train
jacomyal/sigma.js
src/conrad.js
_getStats
function _getStats(v1, v2) { var a, k, i, l, stats, pattern, isPatternString; if (!arguments.length) { stats = []; for (k in _jobs) stats.push(_jobs[k]); for (k in _waitingJobs) stats.push(_waitingJobs[k]); for (k in _ru...
javascript
function _getStats(v1, v2) { var a, k, i, l, stats, pattern, isPatternString; if (!arguments.length) { stats = []; for (k in _jobs) stats.push(_jobs[k]); for (k in _waitingJobs) stats.push(_waitingJobs[k]); for (k in _ru...
[ "function", "_getStats", "(", "v1", ",", "v2", ")", "{", "var", "a", ",", "k", ",", "i", ",", "l", ",", "stats", ",", "pattern", ",", "isPatternString", ";", "if", "(", "!", "arguments", ".", "length", ")", "{", "stats", "=", "[", "]", ";", "fo...
Returns a snapshot of every data about jobs that wait to be started, are currently running or are done. It is possible to get only running, waiting or done jobs by giving "running", "waiting" or "done" as fist argument. It is also possible to get every job with a specified id by giving it as first argument. Also, usi...
[ "Returns", "a", "snapshot", "of", "every", "data", "about", "jobs", "that", "wait", "to", "be", "started", "are", "currently", "running", "or", "are", "done", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/conrad.js#L764-L842
train
jacomyal/sigma.js
src/conrad.js
__clone
function __clone(item) { var result, i, k, l; if (!item) return item; if (Array.isArray(item)) { result = []; for (i = 0, l = item.length; i < l; i++) result.push(__clone(item[i])); } else if (typeof item === 'object') { result = {}; for (i in item) result...
javascript
function __clone(item) { var result, i, k, l; if (!item) return item; if (Array.isArray(item)) { result = []; for (i = 0, l = item.length; i < l; i++) result.push(__clone(item[i])); } else if (typeof item === 'object') { result = {}; for (i in item) result...
[ "function", "__clone", "(", "item", ")", "{", "var", "result", ",", "i", ",", "k", ",", "l", ";", "if", "(", "!", "item", ")", "return", "item", ";", "if", "(", "Array", ".", "isArray", "(", "item", ")", ")", "{", "result", "=", "[", "]", ";"...
This function simply clones an object. This object must contain only objects, arrays and immutable values. Since it is not public, it does not deal with cyclic references, DOM elements and instantiated objects - so use it carefully. @param {Object} The object to clone. @return {Object} The clone.
[ "This", "function", "simply", "clones", "an", "object", ".", "This", "object", "must", "contain", "only", "objects", "arrays", "and", "immutable", "values", ".", "Since", "it", "is", "not", "public", "it", "does", "not", "deal", "with", "cyclic", "references...
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/conrad.js#L902-L920
train
jacomyal/sigma.js
src/conrad.js
__objectValues
function __objectValues(o) { var k, a = []; for (k in o) a.push(o[k]); return a; }
javascript
function __objectValues(o) { var k, a = []; for (k in o) a.push(o[k]); return a; }
[ "function", "__objectValues", "(", "o", ")", "{", "var", "k", ",", "a", "=", "[", "]", ";", "for", "(", "k", "in", "o", ")", "a", ".", "push", "(", "o", "[", "k", "]", ")", ";", "return", "a", ";", "}" ]
Returns an array containing the values of an object. @param {Object} The object. @return {Array} The array of values.
[ "Returns", "an", "array", "containing", "the", "values", "of", "an", "object", "." ]
c49589f2419ca98542fd21b82b926dea21bb9fef
https://github.com/jacomyal/sigma.js/blob/c49589f2419ca98542fd21b82b926dea21bb9fef/src/conrad.js#L928-L936
train