id
int32
0
58k
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
6,000
louischatriot/nedb
browser-version/out/nedb.js
getRandomArray
function getRandomArray (n) { var res, next; if (n === 0) { return []; } if (n === 1) { return [0]; } res = getRandomArray(n - 1); next = Math.floor(Math.random() * n); res.splice(next, 0, n - 1); // Add n-1 at a random position in the array return res; }
javascript
function getRandomArray (n) { var res, next; if (n === 0) { return []; } if (n === 1) { return [0]; } res = getRandomArray(n - 1); next = Math.floor(Math.random() * n); res.splice(next, 0, n - 1); // Add n-1 at a random position in the array return res; }
[ "function", "getRandomArray", "(", "n", ")", "{", "var", "res", ",", "next", ";", "if", "(", "n", "===", "0", ")", "{", "return", "[", "]", ";", "}", "if", "(", "n", "===", "1", ")", "{", "return", "[", "0", "]", ";", "}", "res", "=", "getR...
Return an array with the numbers from 0 to n-1, in a random order
[ "Return", "an", "array", "with", "the", "numbers", "from", "0", "to", "n", "-", "1", "in", "a", "random", "order" ]
aa3302e5dcefa471431901a8f3fe63e532a5a7b2
https://github.com/louischatriot/nedb/blob/aa3302e5dcefa471431901a8f3fe63e532a5a7b2/browser-version/out/nedb.js#L5368-L5379
6,001
louischatriot/nedb
browser-version/out/nedb.js
Promise
function Promise(resolver) { if (!isFunction(resolver)) { throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); } if (!(this instanceof Promise)) { throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, t...
javascript
function Promise(resolver) { if (!isFunction(resolver)) { throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); } if (!(this instanceof Promise)) { throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, t...
[ "function", "Promise", "(", "resolver", ")", "{", "if", "(", "!", "isFunction", "(", "resolver", ")", ")", "{", "throw", "new", "TypeError", "(", "'You must pass a resolver function as the first argument to the promise constructor'", ")", ";", "}", "if", "(", "!", ...
default async is asap;
[ "default", "async", "is", "asap", ";" ]
aa3302e5dcefa471431901a8f3fe63e532a5a7b2
https://github.com/louischatriot/nedb/blob/aa3302e5dcefa471431901a8f3fe63e532a5a7b2/browser-version/out/nedb.js#L5711-L5723
6,002
Blizzard/node-rdkafka
lib/kafka-consumer-stream.js
KafkaConsumerStream
function KafkaConsumerStream(consumer, options) { if (!(this instanceof KafkaConsumerStream)) { return new KafkaConsumerStream(consumer, options); } if (options === undefined) { options = { waitInterval: 1000 }; } else if (typeof options === 'number') { options = { waitInterval: options }; } else...
javascript
function KafkaConsumerStream(consumer, options) { if (!(this instanceof KafkaConsumerStream)) { return new KafkaConsumerStream(consumer, options); } if (options === undefined) { options = { waitInterval: 1000 }; } else if (typeof options === 'number') { options = { waitInterval: options }; } else...
[ "function", "KafkaConsumerStream", "(", "consumer", ",", "options", ")", "{", "if", "(", "!", "(", "this", "instanceof", "KafkaConsumerStream", ")", ")", "{", "return", "new", "KafkaConsumerStream", "(", "consumer", ",", "options", ")", ";", "}", "if", "(", ...
ReadableStream integrating with the Kafka Consumer. This class is used to read data off of Kafka in a streaming way. It is useful if you'd like to have a way to pipe Kafka into other systems. You should generally not make this class yourself, as it is not even exposed as part of module.exports. Instead, you should Kaf...
[ "ReadableStream", "integrating", "with", "the", "Kafka", "Consumer", "." ]
50f99ab46c4a475678b94af07c2ea02e1ba353ff
https://github.com/Blizzard/node-rdkafka/blob/50f99ab46c4a475678b94af07c2ea02e1ba353ff/lib/kafka-consumer-stream.js#L47-L124
6,003
Blizzard/node-rdkafka
lib/kafka-consumer-stream.js
retry
function retry() { if (!self.waitInterval) { setImmediate(function() { self._read(size); }); } else { setTimeout(function() { self._read(size); }, self.waitInterval * Math.random()).unref(); } }
javascript
function retry() { if (!self.waitInterval) { setImmediate(function() { self._read(size); }); } else { setTimeout(function() { self._read(size); }, self.waitInterval * Math.random()).unref(); } }
[ "function", "retry", "(", ")", "{", "if", "(", "!", "self", ".", "waitInterval", ")", "{", "setImmediate", "(", "function", "(", ")", "{", "self", ".", "_read", "(", "size", ")", ";", "}", ")", ";", "}", "else", "{", "setTimeout", "(", "function", ...
Retry function. Will wait up to the wait interval, with some random noise if one is provided. Otherwise, will go immediately.
[ "Retry", "function", ".", "Will", "wait", "up", "to", "the", "wait", "interval", "with", "some", "random", "noise", "if", "one", "is", "provided", ".", "Otherwise", "will", "go", "immediately", "." ]
50f99ab46c4a475678b94af07c2ea02e1ba353ff
https://github.com/Blizzard/node-rdkafka/blob/50f99ab46c4a475678b94af07c2ea02e1ba353ff/lib/kafka-consumer-stream.js#L166-L176
6,004
Blizzard/node-rdkafka
lib/tools/ref-counter.js
RefCounter
function RefCounter(onActive, onPassive) { this.context = {}; this.onActive = onActive; this.onPassive = onPassive; this.currentValue = 0; this.isRunning = false; }
javascript
function RefCounter(onActive, onPassive) { this.context = {}; this.onActive = onActive; this.onPassive = onPassive; this.currentValue = 0; this.isRunning = false; }
[ "function", "RefCounter", "(", "onActive", ",", "onPassive", ")", "{", "this", ".", "context", "=", "{", "}", ";", "this", ".", "onActive", "=", "onActive", ";", "this", ".", "onPassive", "=", "onPassive", ";", "this", ".", "currentValue", "=", "0", ";...
Ref counter class. Is used to basically determine active/inactive and allow callbacks that hook into each. For the producer, it is used to begin rapid polling after a produce until the delivery report is dispatched.
[ "Ref", "counter", "class", "." ]
50f99ab46c4a475678b94af07c2ea02e1ba353ff
https://github.com/Blizzard/node-rdkafka/blob/50f99ab46c4a475678b94af07c2ea02e1ba353ff/lib/tools/ref-counter.js#L21-L27
6,005
Blizzard/node-rdkafka
lib/client.js
Client
function Client(globalConf, SubClientType, topicConf) { if (!(this instanceof Client)) { return new Client(globalConf, SubClientType, topicConf); } Emitter.call(this); // This superclass must be initialized with the Kafka.{Producer,Consumer} // @example var client = new Client({}, Kafka.Producer); // ...
javascript
function Client(globalConf, SubClientType, topicConf) { if (!(this instanceof Client)) { return new Client(globalConf, SubClientType, topicConf); } Emitter.call(this); // This superclass must be initialized with the Kafka.{Producer,Consumer} // @example var client = new Client({}, Kafka.Producer); // ...
[ "function", "Client", "(", "globalConf", ",", "SubClientType", ",", "topicConf", ")", "{", "if", "(", "!", "(", "this", "instanceof", "Client", ")", ")", "{", "return", "new", "Client", "(", "globalConf", ",", "SubClientType", ",", "topicConf", ")", ";", ...
Base class for Consumer and Producer This should not be created independently, but rather is the base class on which both producer and consumer get their common functionality. @param {object} globalConf - Global configuration in key value pairs. @param {function} SubClientType - The function representing the subclien...
[ "Base", "class", "for", "Consumer", "and", "Producer" ]
50f99ab46c4a475678b94af07c2ea02e1ba353ff
https://github.com/Blizzard/node-rdkafka/blob/50f99ab46c4a475678b94af07c2ea02e1ba353ff/lib/client.js#L35-L113
6,006
Blizzard/node-rdkafka
lib/topic-partition.js
TopicPartition
function TopicPartition(topic, partition, offset) { if (!(this instanceof TopicPartition)) { return new TopicPartition(topic, partition, offset); } // Validate that the elements we are iterating over are actual topic partition // js objects. They do not need an offset, but they do need partition if (!top...
javascript
function TopicPartition(topic, partition, offset) { if (!(this instanceof TopicPartition)) { return new TopicPartition(topic, partition, offset); } // Validate that the elements we are iterating over are actual topic partition // js objects. They do not need an offset, but they do need partition if (!top...
[ "function", "TopicPartition", "(", "topic", ",", "partition", ",", "offset", ")", "{", "if", "(", "!", "(", "this", "instanceof", "TopicPartition", ")", ")", "{", "return", "new", "TopicPartition", "(", "topic", ",", "partition", ",", "offset", ")", ";", ...
Create a topic partition. Just does some validation and decoration on topic partitions provided. Goal is still to behave like a plain javascript object but with validation and potentially some extra methods
[ "Create", "a", "topic", "partition", ".", "Just", "does", "some", "validation", "and", "decoration", "on", "topic", "partitions", "provided", "." ]
50f99ab46c4a475678b94af07c2ea02e1ba353ff
https://github.com/Blizzard/node-rdkafka/blob/50f99ab46c4a475678b94af07c2ea02e1ba353ff/lib/topic-partition.js#L46-L88
6,007
Blizzard/node-rdkafka
lib/kafka-consumer.js
KafkaConsumer
function KafkaConsumer(conf, topicConf) { if (!(this instanceof KafkaConsumer)) { return new KafkaConsumer(conf, topicConf); } conf = shallowCopy(conf); topicConf = shallowCopy(topicConf); var onRebalance = conf.rebalance_cb; var self = this; // If rebalance is undefined we don't want any part of ...
javascript
function KafkaConsumer(conf, topicConf) { if (!(this instanceof KafkaConsumer)) { return new KafkaConsumer(conf, topicConf); } conf = shallowCopy(conf); topicConf = shallowCopy(topicConf); var onRebalance = conf.rebalance_cb; var self = this; // If rebalance is undefined we don't want any part of ...
[ "function", "KafkaConsumer", "(", "conf", ",", "topicConf", ")", "{", "if", "(", "!", "(", "this", "instanceof", "KafkaConsumer", ")", ")", "{", "return", "new", "KafkaConsumer", "(", "conf", ",", "topicConf", ")", ";", "}", "conf", "=", "shallowCopy", "...
KafkaConsumer class for reading messages from Kafka This is the main entry point for reading data from Kafka. You configure this like you do any other client, with a global configuration and default topic configuration. Once you instantiate this object, connecting will open a socket. Data will not be read until you t...
[ "KafkaConsumer", "class", "for", "reading", "messages", "from", "Kafka" ]
50f99ab46c4a475678b94af07c2ea02e1ba353ff
https://github.com/Blizzard/node-rdkafka/blob/50f99ab46c4a475678b94af07c2ea02e1ba353ff/lib/kafka-consumer.js#L40-L128
6,008
Blizzard/node-rdkafka
lib/producer/high-level-producer.js
createSerializer
function createSerializer(serializer) { var applyFn = function serializationWrapper(v, cb) { try { return cb ? serializer(v, cb) : serializer(v); } catch (e) { var modifiedError = new Error('Could not serialize value: ' + e.message); modifiedError.value = v; modifiedError.serializer = ...
javascript
function createSerializer(serializer) { var applyFn = function serializationWrapper(v, cb) { try { return cb ? serializer(v, cb) : serializer(v); } catch (e) { var modifiedError = new Error('Could not serialize value: ' + e.message); modifiedError.value = v; modifiedError.serializer = ...
[ "function", "createSerializer", "(", "serializer", ")", "{", "var", "applyFn", "=", "function", "serializationWrapper", "(", "v", ",", "cb", ")", "{", "try", "{", "return", "cb", "?", "serializer", "(", "v", ",", "cb", ")", ":", "serializer", "(", "v", ...
Create a serializer Method simply wraps a serializer provided by a user so it adds context to the error @returns {function} Serialization function
[ "Create", "a", "serializer" ]
50f99ab46c4a475678b94af07c2ea02e1ba353ff
https://github.com/Blizzard/node-rdkafka/blob/50f99ab46c4a475678b94af07c2ea02e1ba353ff/lib/producer/high-level-producer.js#L34-L52
6,009
Blizzard/node-rdkafka
lib/producer/high-level-producer.js
HighLevelProducer
function HighLevelProducer(conf, topicConf) { if (!(this instanceof HighLevelProducer)) { return new HighLevelProducer(conf, topicConf); } // Force this to be true for the high level producer conf = shallowCopy(conf); conf.dr_cb = true; // producer is an initialized consumer object // @see NodeKafka...
javascript
function HighLevelProducer(conf, topicConf) { if (!(this instanceof HighLevelProducer)) { return new HighLevelProducer(conf, topicConf); } // Force this to be true for the high level producer conf = shallowCopy(conf); conf.dr_cb = true; // producer is an initialized consumer object // @see NodeKafka...
[ "function", "HighLevelProducer", "(", "conf", ",", "topicConf", ")", "{", "if", "(", "!", "(", "this", "instanceof", "HighLevelProducer", ")", ")", "{", "return", "new", "HighLevelProducer", "(", "conf", ",", "topicConf", ")", ";", "}", "// Force this to be tr...
Producer class for sending messages to Kafka in a higher level fashion This is the main entry point for writing data to Kafka if you want more functionality than librdkafka supports out of the box. You configure this like you do any other client, with a global configuration and default topic configuration. Once you i...
[ "Producer", "class", "for", "sending", "messages", "to", "Kafka", "in", "a", "higher", "level", "fashion" ]
50f99ab46c4a475678b94af07c2ea02e1ba353ff
https://github.com/Blizzard/node-rdkafka/blob/50f99ab46c4a475678b94af07c2ea02e1ba353ff/lib/producer/high-level-producer.js#L84-L143
6,010
Blizzard/node-rdkafka
lib/producer/high-level-producer.js
doProduce
function doProduce(v, k) { try { var r = self._oldProduce(topic, partition, v, k, timestamp, opaque); self._hl.deliveryEmitter.once(opaque.__message_id, function(err, offset) { self._hl.pollingRef.decrement(); setImmediate(function() { // Offset must be greater...
javascript
function doProduce(v, k) { try { var r = self._oldProduce(topic, partition, v, k, timestamp, opaque); self._hl.deliveryEmitter.once(opaque.__message_id, function(err, offset) { self._hl.pollingRef.decrement(); setImmediate(function() { // Offset must be greater...
[ "function", "doProduce", "(", "v", ",", "k", ")", "{", "try", "{", "var", "r", "=", "self", ".", "_oldProduce", "(", "topic", ",", "partition", ",", "v", ",", "k", ",", "timestamp", ",", "opaque", ")", ";", "self", ".", "_hl", ".", "deliveryEmitter...
Actually do the produce with new key and value based on deserialized results
[ "Actually", "do", "the", "produce", "with", "new", "key", "and", "value", "based", "on", "deserialized", "results" ]
50f99ab46c4a475678b94af07c2ea02e1ba353ff
https://github.com/Blizzard/node-rdkafka/blob/50f99ab46c4a475678b94af07c2ea02e1ba353ff/lib/producer/high-level-producer.js#L180-L199
6,011
Blizzard/node-rdkafka
lib/error.js
LibrdKafkaError
function LibrdKafkaError(e) { if (!(this instanceof LibrdKafkaError)) { return new LibrdKafkaError(e); } if (typeof e === 'number') { this.message = librdkafka.err2str(e); this.code = e; this.errno = e; if (e >= LibrdKafkaError.codes.ERR__END) { this.origin = 'local'; } else { ...
javascript
function LibrdKafkaError(e) { if (!(this instanceof LibrdKafkaError)) { return new LibrdKafkaError(e); } if (typeof e === 'number') { this.message = librdkafka.err2str(e); this.code = e; this.errno = e; if (e >= LibrdKafkaError.codes.ERR__END) { this.origin = 'local'; } else { ...
[ "function", "LibrdKafkaError", "(", "e", ")", "{", "if", "(", "!", "(", "this", "instanceof", "LibrdKafkaError", ")", ")", "{", "return", "new", "LibrdKafkaError", "(", "e", ")", ";", "}", "if", "(", "typeof", "e", "===", "'number'", ")", "{", "this", ...
Representation of a librdkafka error This can be created by giving either another error to piggy-back on. In this situation it tries to parse the error string to figure out the intent. However, more usually, it is constructed by an error object created by a C++ Baton. @param {object|error} e - An object or error to w...
[ "Representation", "of", "a", "librdkafka", "error" ]
50f99ab46c4a475678b94af07c2ea02e1ba353ff
https://github.com/Blizzard/node-rdkafka/blob/50f99ab46c4a475678b94af07c2ea02e1ba353ff/lib/error.js#L275-L331
6,012
Blizzard/node-rdkafka
lib/producer.js
Producer
function Producer(conf, topicConf) { if (!(this instanceof Producer)) { return new Producer(conf, topicConf); } conf = shallowCopy(conf); topicConf = shallowCopy(topicConf); /** * Producer message. This is sent to the wrapper, not received from it * * @typedef {object} Producer~Message * @pr...
javascript
function Producer(conf, topicConf) { if (!(this instanceof Producer)) { return new Producer(conf, topicConf); } conf = shallowCopy(conf); topicConf = shallowCopy(topicConf); /** * Producer message. This is sent to the wrapper, not received from it * * @typedef {object} Producer~Message * @pr...
[ "function", "Producer", "(", "conf", ",", "topicConf", ")", "{", "if", "(", "!", "(", "this", "instanceof", "Producer", ")", ")", "{", "return", "new", "Producer", "(", "conf", ",", "topicConf", ")", ";", "}", "conf", "=", "shallowCopy", "(", "conf", ...
Producer class for sending messages to Kafka This is the main entry point for writing data to Kafka. You configure this like you do any other client, with a global configuration and default topic configuration. Once you instantiate this object, you need to connect to it first. This allows you to get the metadata and ...
[ "Producer", "class", "for", "sending", "messages", "to", "Kafka" ]
50f99ab46c4a475678b94af07c2ea02e1ba353ff
https://github.com/Blizzard/node-rdkafka/blob/50f99ab46c4a475678b94af07c2ea02e1ba353ff/lib/producer.js#L41-L101
6,013
Blizzard/node-rdkafka
lib/producer-stream.js
ProducerStream
function ProducerStream(producer, options) { if (!(this instanceof ProducerStream)) { return new ProducerStream(producer, options); } if (options === undefined) { options = {}; } else if (typeof options === 'string') { options = { encoding: options }; } else if (options === null || typeof options...
javascript
function ProducerStream(producer, options) { if (!(this instanceof ProducerStream)) { return new ProducerStream(producer, options); } if (options === undefined) { options = {}; } else if (typeof options === 'string') { options = { encoding: options }; } else if (options === null || typeof options...
[ "function", "ProducerStream", "(", "producer", ",", "options", ")", "{", "if", "(", "!", "(", "this", "instanceof", "ProducerStream", ")", ")", "{", "return", "new", "ProducerStream", "(", "producer", ",", "options", ")", ";", "}", "if", "(", "options", ...
Writable stream integrating with the Kafka Producer. This class is used to write data to Kafka in a streaming way. It takes buffers of data and puts them into the appropriate Kafka topic. If you need finer control over partitions or keys, this is probably not the class for you. In that situation just use the Producer ...
[ "Writable", "stream", "integrating", "with", "the", "Kafka", "Producer", "." ]
50f99ab46c4a475678b94af07c2ea02e1ba353ff
https://github.com/Blizzard/node-rdkafka/blob/50f99ab46c4a475678b94af07c2ea02e1ba353ff/lib/producer-stream.js#L39-L89
6,014
Blizzard/node-rdkafka
lib/admin.js
createAdminClient
function createAdminClient(conf) { var client = new AdminClient(conf); // Wrap the error so we throw if it failed with some context LibrdKafkaError.wrap(client.connect(), true); // Return the client if we succeeded return client; }
javascript
function createAdminClient(conf) { var client = new AdminClient(conf); // Wrap the error so we throw if it failed with some context LibrdKafkaError.wrap(client.connect(), true); // Return the client if we succeeded return client; }
[ "function", "createAdminClient", "(", "conf", ")", "{", "var", "client", "=", "new", "AdminClient", "(", "conf", ")", ";", "// Wrap the error so we throw if it failed with some context", "LibrdKafkaError", ".", "wrap", "(", "client", ".", "connect", "(", ")", ",", ...
Create a new AdminClient for making topics, partitions, and more. This is a factory method because it immediately starts an active handle with the brokers.
[ "Create", "a", "new", "AdminClient", "for", "making", "topics", "partitions", "and", "more", "." ]
50f99ab46c4a475678b94af07c2ea02e1ba353ff
https://github.com/Blizzard/node-rdkafka/blob/50f99ab46c4a475678b94af07c2ea02e1ba353ff/lib/admin.js#L28-L36
6,015
Blizzard/node-rdkafka
lib/admin.js
AdminClient
function AdminClient(conf) { if (!(this instanceof AdminClient)) { return new AdminClient(conf); } conf = shallowCopy(conf); /** * NewTopic model. * * This is the representation of a new message that is requested to be made * using the Admin client. * * @typedef {object} AdminClient~NewT...
javascript
function AdminClient(conf) { if (!(this instanceof AdminClient)) { return new AdminClient(conf); } conf = shallowCopy(conf); /** * NewTopic model. * * This is the representation of a new message that is requested to be made * using the Admin client. * * @typedef {object} AdminClient~NewT...
[ "function", "AdminClient", "(", "conf", ")", "{", "if", "(", "!", "(", "this", "instanceof", "AdminClient", ")", ")", "{", "return", "new", "AdminClient", "(", "conf", ")", ";", "}", "conf", "=", "shallowCopy", "(", "conf", ")", ";", "/**\n * NewTopic ...
AdminClient class for administering Kafka This client is the way you can interface with the Kafka Admin APIs. This class should not be made using the constructor, but instead should be made using the factory method. <code> var client = AdminClient.create({ ... }); </code> Once you instantiate this object, it will ha...
[ "AdminClient", "class", "for", "administering", "Kafka" ]
50f99ab46c4a475678b94af07c2ea02e1ba353ff
https://github.com/Blizzard/node-rdkafka/blob/50f99ab46c4a475678b94af07c2ea02e1ba353ff/lib/admin.js#L58-L82
6,016
nhn/tui.grid
src/js/view/clipboard.js
function(ev) { var gridEvent; if (this.isLocked) { ev.preventDefault(); return; } gridEvent = keyEvent.generate(ev); if (!gridEvent) { return; } this._lock(); if (shouldPreventDefault(gridEvent)) { ev.p...
javascript
function(ev) { var gridEvent; if (this.isLocked) { ev.preventDefault(); return; } gridEvent = keyEvent.generate(ev); if (!gridEvent) { return; } this._lock(); if (shouldPreventDefault(gridEvent)) { ev.p...
[ "function", "(", "ev", ")", "{", "var", "gridEvent", ";", "if", "(", "this", ".", "isLocked", ")", "{", "ev", ".", "preventDefault", "(", ")", ";", "return", ";", "}", "gridEvent", "=", "keyEvent", ".", "generate", "(", "ev", ")", ";", "if", "(", ...
Event handler for the keydown event @param {Event} ev - Event @private
[ "Event", "handler", "for", "the", "keydown", "event" ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/view/clipboard.js#L104-L128
6,017
nhn/tui.grid
src/js/view/clipboard.js
function(ev) { var clipboardData = (ev.originalEvent || ev).clipboardData || window.clipboardData; if (!isEdge && !supportWindowClipboardData) { ev.preventDefault(); this._pasteInOtherBrowsers(clipboardData); } else { this._pasteInMSBrowsers(clipboardData); ...
javascript
function(ev) { var clipboardData = (ev.originalEvent || ev).clipboardData || window.clipboardData; if (!isEdge && !supportWindowClipboardData) { ev.preventDefault(); this._pasteInOtherBrowsers(clipboardData); } else { this._pasteInMSBrowsers(clipboardData); ...
[ "function", "(", "ev", ")", "{", "var", "clipboardData", "=", "(", "ev", ".", "originalEvent", "||", "ev", ")", ".", "clipboardData", "||", "window", ".", "clipboardData", ";", "if", "(", "!", "isEdge", "&&", "!", "supportWindowClipboardData", ")", "{", ...
onpaste event handler The original 'paste' event should be prevented on browsers except MS to block that copied data is appending on contenteditable element. @param {jQueryEvent} ev - Event object @private
[ "onpaste", "event", "handler", "The", "original", "paste", "event", "should", "be", "prevented", "on", "browsers", "except", "MS", "to", "block", "that", "copied", "data", "is", "appending", "on", "contenteditable", "element", "." ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/view/clipboard.js#L159-L168
6,018
nhn/tui.grid
src/js/common/i18n.js
flattenMessageMap
function flattenMessageMap(data) { var obj = {}; var newKey; _.each(data, function(groupMessages, key) { _.each(groupMessages, function(message, subKey) { newKey = [key, subKey].join('.'); obj[newKey] = message; }); }, this); return obj; }
javascript
function flattenMessageMap(data) { var obj = {}; var newKey; _.each(data, function(groupMessages, key) { _.each(groupMessages, function(message, subKey) { newKey = [key, subKey].join('.'); obj[newKey] = message; }); }, this); return obj; }
[ "function", "flattenMessageMap", "(", "data", ")", "{", "var", "obj", "=", "{", "}", ";", "var", "newKey", ";", "_", ".", "each", "(", "data", ",", "function", "(", "groupMessages", ",", "key", ")", "{", "_", ".", "each", "(", "groupMessages", ",", ...
Flatten message map @param {object} data - Messages @returns {object} Flatten message object (key foramt is 'key.subKey') @ignore
[ "Flatten", "message", "map" ]
9f66e339485e505bb85490c03a6a2db8dd599e0a
https://github.com/nhn/tui.grid/blob/9f66e339485e505bb85490c03a6a2db8dd599e0a/src/js/common/i18n.js#L60-L72
6,019
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
6,020
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
6,021
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
6,022
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
6,023
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
6,024
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
6,025
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
6,026
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
6,027
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
6,028
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
6,029
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
6,030
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
6,031
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
6,032
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
6,033
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
6,034
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
6,035
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
6,036
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
6,037
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
6,038
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
6,039
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
6,040
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
6,041
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
6,042
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
6,043
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
6,044
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
6,045
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
6,046
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
6,047
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
6,048
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
6,049
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
6,050
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
6,051
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
6,052
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
6,053
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
6,054
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
6,055
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
6,056
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
6,057
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
6,058
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
6,059
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
6,060
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
6,061
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
6,062
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
6,063
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
6,064
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
6,065
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
6,066
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
6,067
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
6,068
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
6,069
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
6,070
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
6,071
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
6,072
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
6,073
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
6,074
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
6,075
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
6,076
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
6,077
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
6,078
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
6,079
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
6,080
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
6,081
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
6,082
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
6,083
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
6,084
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
6,085
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
6,086
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
6,087
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
6,088
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
6,089
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
6,090
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
6,091
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
6,092
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
6,093
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
6,094
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
6,095
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
6,096
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
6,097
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
6,098
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
6,099
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