code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
constructor({ property, expected, received }) {
const plural = Array.isArray(expected)
const expectedString = plural
? `are ${expected.map((v) => JSON.stringify(v)).join(', ')}`
: `is ${JSON.stringify(expected)}`
super(
`Invalid value with type ${JSON.stringify(
received
)} w... | Returns the constructor name of any value.
@param {any} value
@returns string | constructor | javascript | dayhaysoos/use-shopping-cart | use-shopping-cart/core/middleware/helpers.js | https://github.com/dayhaysoos/use-shopping-cart/blob/master/use-shopping-cart/core/middleware/helpers.js | MIT |
constructor({ property, between, below, above, received }) {
let expectedString
if (Array.isArray(between))
expectedString = `between ${between[0]} and ${between[1]}`
else if (['string', 'number'].includes(typeof below))
expectedString = `below ${below}`
else if (['string', 'number'].include... | Returns the constructor name of any value.
@param {any} value
@returns string | constructor | javascript | dayhaysoos/use-shopping-cart | use-shopping-cart/core/middleware/helpers.js | https://github.com/dayhaysoos/use-shopping-cart/blob/master/use-shopping-cart/core/middleware/helpers.js | MIT |
check = function() {
if (--server.__pending === 0) {
server.close();
server.__listening = false;
}
} | Assert response from `server` with
the given `req` object and `res` assertions object.
@param {Server} server
@param {Object} req
@param {Object|Function} res
@param {String} msg | check | javascript | tilemill-project/tilemill | test/support/start.js | https://github.com/tilemill-project/tilemill/blob/master/test/support/start.js | BSD-3-Clause |
function removeAllDuplicateVideos() {
const videos = document.querySelectorAll('video');
videos.forEach(video => {
if (video.src.includes('www.youtube.com')) {
video.muted = true;
video.pause();
video.addEventListener('volumechange', function(... | remove the "Ad blockers violate YouTube's Terms of Service" screen for safari | removeAllDuplicateVideos | javascript | TheRealJoelmatic/RemoveAdblockThing | Youtube-Ad-blocker-Reminder-Remover.user.js | https://github.com/TheRealJoelmatic/RemoveAdblockThing/blob/master/Youtube-Ad-blocker-Reminder-Remover.user.js | MIT |
function clearAllPlayers() {
const videoPlayerElements = document.querySelectorAll('.html5-video-player');
if (videoPlayerElements.length === 0) {
console.error("No elements with class 'html5-video-player' found.");
return false;
}
videoPlayerElemen... | remove the "Ad blockers violate YouTube's Terms of Service" screen for safari | clearAllPlayers | javascript | TheRealJoelmatic/RemoveAdblockThing | Youtube-Ad-blocker-Reminder-Remover.user.js | https://github.com/TheRealJoelmatic/RemoveAdblockThing/blob/master/Youtube-Ad-blocker-Reminder-Remover.user.js | MIT |
function changeTimestamp(timestamp) {
const videoPlayerElements = document.querySelectorAll('.html5-video-player');
videoPlayerElements.forEach(videoPlayerElement => {
const iframes = videoPlayerElement.querySelectorAll('iframe');
iframes.forEach(iframe => {
if (i... | remove the "Ad blockers violate YouTube's Terms of Service" screen for safari | changeTimestamp | javascript | TheRealJoelmatic/RemoveAdblockThing | Youtube-Ad-blocker-Reminder-Remover.user.js | https://github.com/TheRealJoelmatic/RemoveAdblockThing/blob/master/Youtube-Ad-blocker-Reminder-Remover.user.js | MIT |
function timestampFix() {
document.addEventListener('click', function(event) {
const target = event.target;
if (target.classList.contains('yt-core-attributed-string__link') && target.href.includes('&t=')) {
event.preventDefault();
const timestamp = target... | remove the "Ad blockers violate YouTube's Terms of Service" screen for safari | timestampFix | javascript | TheRealJoelmatic/RemoveAdblockThing | Youtube-Ad-blocker-Reminder-Remover.user.js | https://github.com/TheRealJoelmatic/RemoveAdblockThing/blob/master/Youtube-Ad-blocker-Reminder-Remover.user.js | MIT |
function observerCallback(mutations) {
let isVideoAdded = mutations.some(mutation =>
Array.from(mutation.addedNodes).some(node => node.tagName === 'VIDEO')
);
if (isVideoAdded) {
log("New video detected, checking for duplicates.");
// Ignore for youtube shor... | remove the "Ad blockers violate YouTube's Terms of Service" screen for safari | observerCallback | javascript | TheRealJoelmatic/RemoveAdblockThing | Youtube-Ad-blocker-Reminder-Remover.user.js | https://github.com/TheRealJoelmatic/RemoveAdblockThing/blob/master/Youtube-Ad-blocker-Reminder-Remover.user.js | MIT |
function checkForUpdate(){
if (window.top !== window.self && !(window.location.href.includes("youtube.com"))){
return;
}
if (hasIgnoredUpdate){
return;
}
const scriptUrl = 'https://raw.githubusercontent.com/TheRealJoelmatic/RemoveAdblockThing/main/Youtu... | remove the "Ad blockers violate YouTube's Terms of Service" screen for safari | checkForUpdate | javascript | TheRealJoelmatic/RemoveAdblockThing | Youtube-Ad-blocker-Reminder-Remover.user.js | https://github.com/TheRealJoelmatic/RemoveAdblockThing/blob/master/Youtube-Ad-blocker-Reminder-Remover.user.js | MIT |
function getConfigFromFile(configName, filename) {
try {
const loaded = getConfigExplorer().search(filename)
if (loaded) {
return {
options: loaded.config[configName],
path: loaded.filepath,
}
}
} catch (e) {
return {error: e}
}
return {}
} | Other plugins that run before babel-plugin-macros might use path.replace, where a path is
put into its own replacement. Apparently babel does not update the scope after such
an operation. As a remedy, the whole scope is traversed again with an empty "Identifier"
visitor - this makes the problem go away.
See: https://g... | getConfigFromFile | javascript | kentcdodds/babel-plugin-macros | src/index.js | https://github.com/kentcdodds/babel-plugin-macros/blob/master/src/index.js | MIT |
function getConfigFromOptions(configName, options) {
if (options.hasOwnProperty(configName)) {
if (options[configName] && typeof options[configName] !== 'object') {
// eslint-disable-next-line no-console
console.error(
`The macro plugin options' ${configName} property was not an object or null... | Other plugins that run before babel-plugin-macros might use path.replace, where a path is
put into its own replacement. Apparently babel does not update the scope after such
an operation. As a remedy, the whole scope is traversed again with an empty "Identifier"
visitor - this makes the problem go away.
See: https://g... | getConfigFromOptions | javascript | kentcdodds/babel-plugin-macros | src/index.js | https://github.com/kentcdodds/babel-plugin-macros/blob/master/src/index.js | MIT |
function getConfig(macro, filename, source, options) {
const {configName} = macro.options
if (configName) {
const fileConfig = getConfigFromFile(configName, filename)
const optionsConfig = getConfigFromOptions(configName, options)
if (
optionsConfig.options === undefined &&
fileConfig.optio... | Other plugins that run before babel-plugin-macros might use path.replace, where a path is
put into its own replacement. Apparently babel does not update the scope after such
an operation. As a remedy, the whole scope is traversed again with an empty "Identifier"
visitor - this makes the problem go away.
See: https://g... | getConfig | javascript | kentcdodds/babel-plugin-macros | src/index.js | https://github.com/kentcdodds/babel-plugin-macros/blob/master/src/index.js | MIT |
function getFullFilename(filename) {
if (p.isAbsolute(filename)) {
return filename
}
return p.join(process.cwd(), filename)
} | Other plugins that run before babel-plugin-macros might use path.replace, where a path is
put into its own replacement. Apparently babel does not update the scope after such
an operation. As a remedy, the whole scope is traversed again with an empty "Identifier"
visitor - this makes the problem go away.
See: https://g... | getFullFilename | javascript | kentcdodds/babel-plugin-macros | src/index.js | https://github.com/kentcdodds/babel-plugin-macros/blob/master/src/index.js | MIT |
function looksLike(a, b) {
return (
a &&
b &&
Object.keys(b).every(bKey => {
const bVal = b[bKey]
const aVal = a[bKey]
if (typeof bVal === 'function') {
return bVal(aVal)
}
return isPrimitive(bVal) ? bVal === aVal : looksLike(aVal, bVal)
})
)
} | Other plugins that run before babel-plugin-macros might use path.replace, where a path is
put into its own replacement. Apparently babel does not update the scope after such
an operation. As a remedy, the whole scope is traversed again with an empty "Identifier"
visitor - this makes the problem go away.
See: https://g... | looksLike | javascript | kentcdodds/babel-plugin-macros | src/index.js | https://github.com/kentcdodds/babel-plugin-macros/blob/master/src/index.js | MIT |
function isPrimitive(val) {
// eslint-disable-next-line
return val == null || /^[sbn]/.test(typeof val)
} | Other plugins that run before babel-plugin-macros might use path.replace, where a path is
put into its own replacement. Apparently babel does not update the scope after such
an operation. As a remedy, the whole scope is traversed again with an empty "Identifier"
visitor - this makes the problem go away.
See: https://g... | isPrimitive | javascript | kentcdodds/babel-plugin-macros | src/index.js | https://github.com/kentcdodds/babel-plugin-macros/blob/master/src/index.js | MIT |
function lintGulpfile() {
return lint('gulpfile.babel.js');
} | /*.js');
}
function lintTest() {
return lint('test/* | lintGulpfile | javascript | UDST/vizicities | gulpfile.babel.js | https://github.com/UDST/vizicities/blob/master/gulpfile.babel.js | BSD-3-Clause |
function build() {
return gulp.src(path.join('src', config.entryFileName + '.js'))
.pipe($.plumber())
.pipe(webpackStream({
output: {
filename: exportFileName + '.js',
libraryTarget: 'umd',
library: config.mainVarName
},
externals: {
// Proxy the global THREE ... | /*.js');
}
function lintTest() {
return lint('test/* | build | javascript | UDST/vizicities | gulpfile.babel.js | https://github.com/UDST/vizicities/blob/master/gulpfile.babel.js | BSD-3-Clause |
function moveCSS() {
return gulp.src(path.join('src', config.entryFileName + '.css'))
.pipe(gulp.dest(destinationFolder));
} | /*.js');
}
function lintTest() {
return lint('test/* | moveCSS | javascript | UDST/vizicities | gulpfile.babel.js | https://github.com/UDST/vizicities/blob/master/gulpfile.babel.js | BSD-3-Clause |
function _mocha() {
return gulp.src(['test/setup/node.js', 'test/unit/**/*.js'], {read: false})
.pipe($.mocha({
reporter: 'dot',
globals: config.mochaGlobals,
ignoreLeaks: false
}));
} | /*.js');
}
function lintTest() {
return lint('test/* | _mocha | javascript | UDST/vizicities | gulpfile.babel.js | https://github.com/UDST/vizicities/blob/master/gulpfile.babel.js | BSD-3-Clause |
function test() {
_registerBabel();
return _mocha();
} | /*.js');
}
function lintTest() {
return lint('test/* | test | javascript | UDST/vizicities | gulpfile.babel.js | https://github.com/UDST/vizicities/blob/master/gulpfile.babel.js | BSD-3-Clause |
function coverage(done) {
_registerBabel();
gulp.src(['src/**/*.js'])
.pipe($.istanbul({ instrumenter: Instrumenter }))
.pipe($.istanbul.hookRequire())
.on('finish', () => {
return test()
.pipe($.istanbul.writeReports())
.on('end', done);
});
} | /*.js');
}
function lintTest() {
return lint('test/* | coverage | javascript | UDST/vizicities | gulpfile.babel.js | https://github.com/UDST/vizicities/blob/master/gulpfile.babel.js | BSD-3-Clause |
function assignValue(object, key, value) {
var objValue = object[key];
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
(value === undefined && !(key in object))) {
object[key] = value;
}
} | Assigns `value` to `key` of `object` if the existing value is not equivalent
using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
for equality comparisons.
@private
@param {Object} object The object to modify.
@param {string} key The key of the property to assign.
@param {*} value The... | assignValue | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function baseProperty(key) {
return function(object) {
return object == null ? undefined : object[key];
};
} | The base implementation of `_.property` without support for deep paths.
@private
@param {string} key The key of the property to get.
@returns {Function} Returns the new accessor function. | baseProperty | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function copyObject(source, props, object, customizer) {
object || (object = {});
var index = -1,
length = props.length;
while (++index < length) {
var key = props[index];
var newValue = customizer
? customizer(object[key], source[key], key, object, source)
: source[key];
... | Copies properties of `source` to `object`.
@private
@param {Object} source The object to copy properties from.
@param {Array} props The property identifiers to copy.
@param {Object} [object={}] The object to copy properties to.
@param {Function} [customizer] The function to customize copied values.
@returns {Object} R... | copyObject | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function createAssigner(assigner) {
return rest(function(object, sources) {
var index = -1,
length = sources.length,
customizer = length > 1 ? sources[length - 1] : undefined,
guard = length > 2 ? sources[2] : undefined;
customizer = (assigner.length > 3 && typeof customizer ==... | Creates a function like `_.assign`.
@private
@param {Function} assigner The function to assign values.
@returns {Function} Returns the new assigner function. | createAssigner | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function isIndex(value, length) {
length = length == null ? MAX_SAFE_INTEGER : length;
return !!length &&
(typeof value == 'number' || reIsUint.test(value)) &&
(value > -1 && value % 1 == 0 && value < length);
} | Checks if `value` is a valid array-like index.
@private
@param {*} value The value to check.
@param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
@returns {boolean} Returns `true` if `value` is a valid index, else `false`. | isIndex | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function isIterateeCall(value, index, object) {
if (!isObject(object)) {
return false;
}
var type = typeof index;
if (type == 'number'
? (isArrayLike(object) && isIndex(index, object.length))
: (type == 'string' && index in object)
) {
return eq(object[index], value);
}... | Checks if the given arguments are from an iteratee call.
@private
@param {*} value The potential iteratee value argument.
@param {*} index The potential iteratee index or key argument.
@param {*} object The potential iteratee object argument.
@returns {boolean} Returns `true` if the arguments are from an iteratee call... | isIterateeCall | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function isPrototype(value) {
var Ctor = value && value.constructor,
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
return value === proto;
} | Checks if `value` is likely a prototype object.
@private
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is a prototype, else `false`. | isPrototype | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function eq(value, other) {
return value === other || (value !== value && other !== other);
} | Performs a
[`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
comparison between two values to determine if they are equivalent.
@static
@memberOf _
@since 4.0.0
@category Lang
@param {*} value The value to compare.
@param {*} other The other value to compare.
@returns {boolean} Returns `... | eq | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function isArrayLike(value) {
return value != null && isLength(getLength(value)) && !isFunction(value);
} | Checks if `value` is array-like. A value is considered array-like if it's
not a function and has a `value.length` that's an integer greater than or
equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
@static
@memberOf _
@since 4.0.0
@category Lang
@param {*} value The value to check.
@returns {boolean} R... | isArrayLike | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors,
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value... | Checks if `value` is classified as a `Function` object.
@static
@memberOf _
@since 0.1.0
@category Lang
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is correctly classified,
else `false`.
@example
_.isFunction(_);
// => true
_.isFunction(/abc/);
// => false | isFunction | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function isLength(value) {
return typeof value == 'number' &&
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
} | Checks if `value` is a valid array-like length.
**Note:** This function is loosely based on
[`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
@static
@memberOf _
@since 4.0.0
@category Lang
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is a valid length,
else... | isLength | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function isObject(value) {
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
} | Checks if `value` is the
[language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types)
of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
@static
@memberOf _
@since 0.1.0
@category Lang
@param {*} value The value to check.
@returns {boolean} ... | isObject | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function baseTimes(n, iteratee) {
var index = -1,
result = Array(n);
while (++index < n) {
result[index] = iteratee(index);
}
return result;
} | The base implementation of `_.times` without support for iteratee shorthands
or max array length checks.
@private
@param {number} n The number of times to invoke `iteratee`.
@param {Function} iteratee The function invoked per iteration.
@returns {Array} Returns the array of results. | baseTimes | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function baseHas(object, key) {
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
// that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them.
return hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && ge... | The base implementation of `_.has` without support for deep paths.
@private
@param {Object} object The object to query.
@param {Array|string} key The key to check.
@returns {boolean} Returns `true` if `key` exists, else `false`. | baseHas | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function baseKeys(object) {
return nativeKeys(Object(object));
} | The base implementation of `_.keys` which doesn't skip the constructor
property of prototypes or treat sparse arrays as dense.
@private
@param {Object} object The object to query.
@returns {Array} Returns the array of property names. | baseKeys | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function baseProperty(key) {
return function(object) {
return object == null ? undefined : object[key];
};
} | The base implementation of `_.property` without support for deep paths.
@private
@param {string} key The key of the property to get.
@returns {Function} Returns the new accessor function. | baseProperty | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function getPrototype(value) {
return nativeGetPrototype(Object(value));
} | Gets the `[[Prototype]]` of `value`.
@private
@param {*} value The value to query.
@returns {null|Object} Returns the `[[Prototype]]`. | getPrototype | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function indexKeys(object) {
var length = object ? object.length : undefined;
if (isLength(length) &&
(isArray(object) || isString(object) || isArguments(object))) {
return baseTimes(length, String);
}
return null;
} | Creates an array of index keys for `object` values of arrays,
`arguments` objects, and strings, otherwise `null` is returned.
@private
@param {Object} object The object to query.
@returns {Array|null} Returns index keys, else `null`. | indexKeys | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function isIndex(value, length) {
length = length == null ? MAX_SAFE_INTEGER : length;
return !!length &&
(typeof value == 'number' || reIsUint.test(value)) &&
(value > -1 && value % 1 == 0 && value < length);
} | Checks if `value` is a valid array-like index.
@private
@param {*} value The value to check.
@param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
@returns {boolean} Returns `true` if `value` is a valid index, else `false`. | isIndex | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function isPrototype(value) {
var Ctor = value && value.constructor,
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
return value === proto;
} | Checks if `value` is likely a prototype object.
@private
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is a prototype, else `false`. | isPrototype | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function isArguments(value) {
// Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.
return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
(!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
} | Checks if `value` is likely an `arguments` object.
@static
@memberOf _
@since 0.1.0
@category Lang
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is correctly classified,
else `false`.
@example
_.isArguments(function() { return arguments; }());
// => true
_.isArguments([1, 2, 3]);... | isArguments | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function isArrayLike(value) {
return value != null && isLength(getLength(value)) && !isFunction(value);
} | Checks if `value` is array-like. A value is considered array-like if it's
not a function and has a `value.length` that's an integer greater than or
equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
@static
@memberOf _
@since 4.0.0
@category Lang
@param {*} value The value to check.
@returns {boolean} R... | isArrayLike | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function isArrayLikeObject(value) {
return isObjectLike(value) && isArrayLike(value);
} | This method is like `_.isArrayLike` except that it also checks if `value`
is an object.
@static
@memberOf _
@since 4.0.0
@category Lang
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is an array-like object,
else `false`.
@example
_.isArrayLikeObject([1, 2, 3]);
// => true
_.isArr... | isArrayLikeObject | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors,
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value... | Checks if `value` is classified as a `Function` object.
@static
@memberOf _
@since 0.1.0
@category Lang
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is correctly classified,
else `false`.
@example
_.isFunction(_);
// => true
_.isFunction(/abc/);
// => false | isFunction | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function isLength(value) {
return typeof value == 'number' &&
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
} | Checks if `value` is a valid array-like length.
**Note:** This function is loosely based on
[`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
@static
@memberOf _
@since 4.0.0
@category Lang
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is a valid length,
else... | isLength | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function isObject(value) {
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
} | Checks if `value` is the
[language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types)
of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
@static
@memberOf _
@since 0.1.0
@category Lang
@param {*} value The value to check.
@returns {boolean} ... | isObject | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function isObjectLike(value) {
return !!value && typeof value == 'object';
} | Checks if `value` is object-like. A value is object-like if it's not `null`
and has a `typeof` result of "object".
@static
@memberOf _
@since 4.0.0
@category Lang
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is object-like, else `false`.
@example
_.isObjectLike({});
// => true
_.... | isObjectLike | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function keys(object) {
var isProto = isPrototype(object);
if (!(isProto || isArrayLike(object))) {
return baseKeys(object);
}
var indexes = indexKeys(object),
skipIndexes = !!indexes,
result = indexes || [],
length = result.length;
for (var key in object) {
if (baseHas(o... | Creates an array of the own enumerable property names of `object`.
**Note:** Non-object values are coerced to objects. See the
[ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
for more details.
@static
@since 0.1.0
@memberOf _
@category Object
@param {Object} object The object to query.
@returns... | keys | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function apply(func, thisArg, args) {
var length = args.length;
switch (length) {
case 0: return func.call(thisArg);
case 1: return func.call(thisArg, args[0]);
case 2: return func.call(thisArg, args[0], args[1]);
case 3: return func.call(thisArg, args[0], args[1], args[2]);
}
return fun... | A faster alternative to `Function#apply`, this function invokes `func`
with the `this` binding of `thisArg` and the arguments of `args`.
@private
@param {Function} func The function to invoke.
@param {*} thisArg The `this` binding of `func`.
@param {Array} args The arguments to invoke `func` with.
@returns {*} Returns... | apply | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function rest(func, start) {
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0);
return function() {
var args = arguments,
index = -1,
length = nativeMax(args.length - start, 0)... | Creates a function that invokes `func` with the `this` binding of the
created function and arguments from `start` and beyond provided as
an array.
**Note:** This method is based on the
[rest parameter](https://mdn.io/rest_parameters).
@static
@memberOf _
@since 4.0.0
@category Function
@param {Function} func The func... | rest | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors,
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value... | Checks if `value` is classified as a `Function` object.
@static
@memberOf _
@since 0.1.0
@category Lang
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is correctly classified,
else `false`.
@example
_.isFunction(_);
// => true
_.isFunction(/abc/);
// => false | isFunction | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function isObject(value) {
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
} | Checks if `value` is the
[language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types)
of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
@static
@memberOf _
@since 0.1.0
@category Lang
@param {*} value The value to check.
@returns {boolean} ... | isObject | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function isObjectLike(value) {
return !!value && typeof value == 'object';
} | Checks if `value` is object-like. A value is object-like if it's not `null`
and has a `typeof` result of "object".
@static
@memberOf _
@since 4.0.0
@category Lang
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is object-like, else `false`.
@example
_.isObjectLike({});
// => true
_.... | isObjectLike | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function toFinite(value) {
if (!value) {
return value === 0 ? value : 0;
}
value = toNumber(value);
if (value === INFINITY || value === -INFINITY) {
var sign = (value < 0 ? -1 : 1);
return sign * MAX_INTEGER;
}
return value === value ? value : 0;
} | Converts `value` to a finite number.
@static
@memberOf _
@since 4.12.0
@category Lang
@param {*} value The value to convert.
@returns {number} Returns the converted number.
@example
_.toFinite(3.2);
// => 3.2
_.toFinite(Number.MIN_VALUE);
// => 5e-324
_.toFinite(Infinity);
// => 1.7976931348623157e+308
_.toFinite(... | toFinite | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function toInteger(value) {
var result = toFinite(value),
remainder = result % 1;
return result === result ? (remainder ? result - remainder : result) : 0;
} | Converts `value` to an integer.
**Note:** This function is loosely based on
[`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
@static
@memberOf _
@since 4.0.0
@category Lang
@param {*} value The value to convert.
@returns {number} Returns the converted integer.
@example
_.toInteger(3.2);
... | toInteger | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function toNumber(value) {
if (typeof value == 'number') {
return value;
}
if (isSymbol(value)) {
return NAN;
}
if (isObject(value)) {
var other = isFunction(value.valueOf) ? value.valueOf() : value;
value = isObject(other) ? (other + '') : other;
}
if (typeof value != 'string')... | Converts `value` to a number.
@static
@memberOf _
@since 4.0.0
@category Lang
@param {*} value The value to process.
@returns {number} Returns the number.
@example
_.toNumber(3.2);
// => 3.2
_.toNumber(Number.MIN_VALUE);
// => 5e-324
_.toNumber(Infinity);
// => Infinity
_.toNumber('3.2');
// => 3.2 | toNumber | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
CSS3DObject = function CSS3DObject(element) {
_three2['default'].Object3D.call(this);
this.element = element;
this.element.style.position = 'absolute';
this.addEventListener('removed', function (event) {
if (this.element.parentNode !== null) {
this.element.parentNode.removeChild(this.element);
... | Based on http://www.emagix.net/academic/mscs-project/item/camera-sync-with-css3-and-webgl-threejs
@author mrdoob / http://mrdoob.com/ | CSS3DObject | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
CSS3DSprite = function CSS3DSprite(element) {
CSS3DObject.call(this, element);
} | Based on http://www.emagix.net/academic/mscs-project/item/camera-sync-with-css3-and-webgl-threejs
@author mrdoob / http://mrdoob.com/ | CSS3DSprite | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
CSS3DRenderer = function CSS3DRenderer() {
console.log('THREE.CSS3DRenderer', _three2['default'].REVISION);
var _width, _height;
var _widthHalf, _heightHalf;
var matrix = new _three2['default'].Matrix4();
var cache = {
camera: { fov: 0, style: '' },
objects: {}
};
var domElement = document... | Based on http://www.emagix.net/academic/mscs-project/item/camera-sync-with-css3-and-webgl-threejs
@author mrdoob / http://mrdoob.com/ | CSS3DRenderer | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
epsilon = function epsilon(value) {
return Math.abs(value) < Number.EPSILON ? 0 : value;
} | Based on http://www.emagix.net/academic/mscs-project/item/camera-sync-with-css3-and-webgl-threejs
@author mrdoob / http://mrdoob.com/ | epsilon | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
getCameraCSSMatrix = function getCameraCSSMatrix(matrix) {
var elements = matrix.elements;
return 'matrix3d(' + epsilon(elements[0]) + ',' + epsilon(-elements[1]) + ',' + epsilon(elements[2]) + ',' + epsilon(elements[3]) + ',' + epsilon(elements[4]) + ',' + epsilon(-elements[5]) + ',' + epsilon(elements[6]) +... | Based on http://www.emagix.net/academic/mscs-project/item/camera-sync-with-css3-and-webgl-threejs
@author mrdoob / http://mrdoob.com/ | getCameraCSSMatrix | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
getObjectCSSMatrix = function getObjectCSSMatrix(matrix) {
var elements = matrix.elements;
return 'translate3d(-50%,-50%,0) matrix3d(' + epsilon(elements[0]) + ',' + epsilon(elements[1]) + ',' + epsilon(elements[2]) + ',' + epsilon(elements[3]) + ',' + epsilon(-elements[4]) + ',' + epsilon(-elements[5]) + ','... | Based on http://www.emagix.net/academic/mscs-project/item/camera-sync-with-css3-and-webgl-threejs
@author mrdoob / http://mrdoob.com/ | getObjectCSSMatrix | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
renderObject = function renderObject(object, camera) {
if (object instanceof CSS3DObject) {
var style;
if (object instanceof CSS3DSprite) {
// http://swiftcoder.wordpress.com/2008/11/25/constructing-a-billboard-matrix/
matrix.copy(camera.matrixWorldInverse);
matrix.transpose();
... | Based on http://www.emagix.net/academic/mscs-project/item/camera-sync-with-css3-and-webgl-threejs
@author mrdoob / http://mrdoob.com/ | renderObject | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
Sky = function Sky() {
var skyShader = _three2['default'].ShaderLib['sky'];
var skyUniforms = _three2['default'].UniformsUtils.clone(skyShader.uniforms);
var skyMat = new _three2['default'].ShaderMaterial({
fragmentShader: skyShader.fragmentShader,
vertexShader: skyShader.vertexShader,
uniforms: skyU... | @author zz85 / https://github.com/zz85
Based on 'A Practical Analytic Model for Daylight'
aka The Preetham Model, the de facto standard analytic skydome model
http://www.cs.utah.edu/~shirley/papers/sunsky/sunsky.pdf
First implemented by Simon Wallner
http://www.simonwallner.at/projects/atmospheric-scattering
Improve... | Sky | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function throttle(func, wait, options) {
var leading = true,
trailing = true;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
if (isObject(options)) {
leading = 'leading' in options ? !!options.leading : leading;
trailing = 'trailing' in options ? !!options.t... | Creates a throttled function that only invokes `func` at most once per
every `wait` milliseconds. The throttled function comes with a `cancel`
method to cancel delayed `func` invocations and a `flush` method to
immediately invoke them. Provide an options object to indicate whether
`func` should be invoked on the leadin... | throttle | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function isObject(value) {
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
} | Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
(e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
@static
@memberOf _
@category Lang
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is an object, else `false`.
@example
_... | isObject | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function debounce(func, wait, options) {
var lastArgs,
lastThis,
maxWait,
result,
timerId,
lastCallTime = 0,
lastInvokeTime = 0,
leading = false,
maxing = false,
trailing = true;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_T... | Creates a debounced function that delays invoking `func` until after `wait`
milliseconds have elapsed since the last time the debounced function was
invoked. The debounced function comes with a `cancel` method to cancel
delayed `func` invocations and a `flush` method to immediately invoke them.
Provide an options objec... | debounce | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function invokeFunc(time) {
var args = lastArgs,
thisArg = lastThis;
lastArgs = lastThis = undefined;
lastInvokeTime = time;
result = func.apply(thisArg, args);
return result;
} | Creates a debounced function that delays invoking `func` until after `wait`
milliseconds have elapsed since the last time the debounced function was
invoked. The debounced function comes with a `cancel` method to cancel
delayed `func` invocations and a `flush` method to immediately invoke them.
Provide an options objec... | invokeFunc | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function leadingEdge(time) {
// Reset any `maxWait` timer.
lastInvokeTime = time;
// Start the timer for the trailing edge.
timerId = setTimeout(timerExpired, wait);
// Invoke the leading edge.
return leading ? invokeFunc(time) : result;
} | Creates a debounced function that delays invoking `func` until after `wait`
milliseconds have elapsed since the last time the debounced function was
invoked. The debounced function comes with a `cancel` method to cancel
delayed `func` invocations and a `flush` method to immediately invoke them.
Provide an options objec... | leadingEdge | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function remainingWait(time) {
var timeSinceLastCall = time - lastCallTime,
timeSinceLastInvoke = time - lastInvokeTime,
result = wait - timeSinceLastCall;
return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
} | Creates a debounced function that delays invoking `func` until after `wait`
milliseconds have elapsed since the last time the debounced function was
invoked. The debounced function comes with a `cancel` method to cancel
delayed `func` invocations and a `flush` method to immediately invoke them.
Provide an options objec... | remainingWait | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function shouldInvoke(time) {
var timeSinceLastCall = time - lastCallTime,
timeSinceLastInvoke = time - lastInvokeTime;
// Either this is the first call, activity has stopped and we're at the
// trailing edge, the system time has gone backwards and we're treating
// it as the trailing edg... | Creates a debounced function that delays invoking `func` until after `wait`
milliseconds have elapsed since the last time the debounced function was
invoked. The debounced function comes with a `cancel` method to cancel
delayed `func` invocations and a `flush` method to immediately invoke them.
Provide an options objec... | shouldInvoke | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function timerExpired() {
var time = now();
if (shouldInvoke(time)) {
return trailingEdge(time);
}
// Restart the timer.
timerId = setTimeout(timerExpired, remainingWait(time));
} | Creates a debounced function that delays invoking `func` until after `wait`
milliseconds have elapsed since the last time the debounced function was
invoked. The debounced function comes with a `cancel` method to cancel
delayed `func` invocations and a `flush` method to immediately invoke them.
Provide an options objec... | timerExpired | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function trailingEdge(time) {
clearTimeout(timerId);
timerId = undefined;
// Only invoke if we have `lastArgs` which means `func` has been
// debounced at least once.
if (trailing && lastArgs) {
return invokeFunc(time);
}
lastArgs = lastThis = undefined;
return result;
... | Creates a debounced function that delays invoking `func` until after `wait`
milliseconds have elapsed since the last time the debounced function was
invoked. The debounced function comes with a `cancel` method to cancel
delayed `func` invocations and a `flush` method to immediately invoke them.
Provide an options objec... | trailingEdge | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function cancel() {
if (timerId !== undefined) {
clearTimeout(timerId);
}
lastCallTime = lastInvokeTime = 0;
lastArgs = lastThis = timerId = undefined;
} | Creates a debounced function that delays invoking `func` until after `wait`
milliseconds have elapsed since the last time the debounced function was
invoked. The debounced function comes with a `cancel` method to cancel
delayed `func` invocations and a `flush` method to immediately invoke them.
Provide an options objec... | cancel | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function flush() {
return timerId === undefined ? result : trailingEdge(now());
} | Creates a debounced function that delays invoking `func` until after `wait`
milliseconds have elapsed since the last time the debounced function was
invoked. The debounced function comes with a `cancel` method to cancel
delayed `func` invocations and a `flush` method to immediately invoke them.
Provide an options objec... | flush | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function debounced() {
var time = now(),
isInvoking = shouldInvoke(time);
lastArgs = arguments;
lastThis = this;
lastCallTime = time;
if (isInvoking) {
if (timerId === undefined) {
return leadingEdge(lastCallTime);
}
if (maxing) {
// Handle in... | Creates a debounced function that delays invoking `func` until after `wait`
milliseconds have elapsed since the last time the debounced function was
invoked. The debounced function comes with a `cancel` method to cancel
delayed `func` invocations and a `flush` method to immediately invoke them.
Provide an options objec... | debounced | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function isFunction(value) {
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 8 which returns 'object' for typed array and weak map constructors,
// and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
var tag = isObject(value) ? objectToString.call(value... | Checks if `value` is classified as a `Function` object.
@static
@memberOf _
@since 0.1.0
@category Lang
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is correctly classified,
else `false`.
@example
_.isFunction(_);
// => true
_.isFunction(/abc/);
// => false | isFunction | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function isObject(value) {
var type = typeof value;
return !!value && (type == 'object' || type == 'function');
} | Checks if `value` is the
[language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types)
of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
@static
@memberOf _
@since 0.1.0
@category Lang
@param {*} value The value to check.
@returns {boolean} ... | isObject | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function isObjectLike(value) {
return !!value && typeof value == 'object';
} | Checks if `value` is object-like. A value is object-like if it's not `null`
and has a `typeof` result of "object".
@static
@memberOf _
@since 4.0.0
@category Lang
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is object-like, else `false`.
@example
_.isObjectLike({});
// => true
_.... | isObjectLike | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function toNumber(value) {
if (typeof value == 'number') {
return value;
}
if (isSymbol(value)) {
return NAN;
}
if (isObject(value)) {
var other = isFunction(value.valueOf) ? value.valueOf() : value;
value = isObject(other) ? (other + '') : other;
}
if (typeof value != 'string')... | Converts `value` to a number.
@static
@memberOf _
@since 4.0.0
@category Lang
@param {*} value The value to process.
@returns {number} Returns the number.
@example
_.toNumber(3);
// => 3
_.toNumber(Number.MIN_VALUE);
// => 5e-324
_.toNumber(Infinity);
// => Infinity
_.toNumber('3');
// => 3 | toNumber | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
OrbitControls = function OrbitControls(object, domElement) {
this.object = object;
this.domElement = domElement !== undefined ? domElement : document;
// Set to false to disable this control
this.enabled = true;
// "target" sets the location of focus, where the object orbits around
this.target = new... | @author qiao / https://github.com/qiao
@author mrdoob / http://mrdoob.com
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author erich666 / http://erichaines.com | OrbitControls | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function getAutoRotationAngle() {
return 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed;
} | @author qiao / https://github.com/qiao
@author mrdoob / http://mrdoob.com
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author erich666 / http://erichaines.com | getAutoRotationAngle | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function getZoomScale() {
return Math.pow(0.95, scope.zoomSpeed);
} | @author qiao / https://github.com/qiao
@author mrdoob / http://mrdoob.com
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author erich666 / http://erichaines.com | getZoomScale | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function rotateLeft(angle) {
thetaDelta -= angle;
} | @author qiao / https://github.com/qiao
@author mrdoob / http://mrdoob.com
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author erich666 / http://erichaines.com | rotateLeft | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function rotateUp(angle) {
phiDelta -= angle;
} | @author qiao / https://github.com/qiao
@author mrdoob / http://mrdoob.com
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author erich666 / http://erichaines.com | rotateUp | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function dollyIn(dollyScale) {
if (scope.object instanceof _three2['default'].PerspectiveCamera) {
scale /= dollyScale;
} else if (scope.object instanceof _three2['default'].OrthographicCamera) {
scope.object.zoom = Math.max(scope.minZoom, Math.min(scope.maxZoom, scope.object.zoom * dollyScale));
... | @author qiao / https://github.com/qiao
@author mrdoob / http://mrdoob.com
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author erich666 / http://erichaines.com | dollyIn | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function dollyOut(dollyScale) {
if (scope.object instanceof _three2['default'].PerspectiveCamera) {
scale *= dollyScale;
} else if (scope.object instanceof _three2['default'].OrthographicCamera) {
scope.object.zoom = Math.max(scope.minZoom, Math.min(scope.maxZoom, scope.object.zoom / dollyScale));
... | @author qiao / https://github.com/qiao
@author mrdoob / http://mrdoob.com
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author erich666 / http://erichaines.com | dollyOut | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function handleMouseDownRotate(event) {
//console.log( 'handleMouseDownRotate' );
rotateStart.set(event.clientX, event.clientY);
} | @author qiao / https://github.com/qiao
@author mrdoob / http://mrdoob.com
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author erich666 / http://erichaines.com | handleMouseDownRotate | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function handleMouseDownDolly(event) {
//console.log( 'handleMouseDownDolly' );
dollyStart.set(event.clientX, event.clientY);
} | @author qiao / https://github.com/qiao
@author mrdoob / http://mrdoob.com
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author erich666 / http://erichaines.com | handleMouseDownDolly | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function handleMouseDownPan(event) {
//console.log( 'handleMouseDownPan' );
panStart.set(event.clientX, event.clientY);
} | @author qiao / https://github.com/qiao
@author mrdoob / http://mrdoob.com
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author erich666 / http://erichaines.com | handleMouseDownPan | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function handleMouseMoveRotate(event) {
//console.log( 'handleMouseMoveRotate' );
rotateEnd.set(event.clientX, event.clientY);
rotateDelta.subVectors(rotateEnd, rotateStart);
var element = scope.domElement === document ? scope.domElement.body : scope.domElement;
// rotating across whole screen go... | @author qiao / https://github.com/qiao
@author mrdoob / http://mrdoob.com
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author erich666 / http://erichaines.com | handleMouseMoveRotate | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function handleMouseMoveDolly(event) {
//console.log( 'handleMouseMoveDolly' );
dollyEnd.set(event.clientX, event.clientY);
dollyDelta.subVectors(dollyEnd, dollyStart);
if (dollyDelta.y > 0) {
dollyIn(getZoomScale());
} else if (dollyDelta.y < 0) {
dollyOut(getZoomScale());
}
... | @author qiao / https://github.com/qiao
@author mrdoob / http://mrdoob.com
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author erich666 / http://erichaines.com | handleMouseMoveDolly | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function handleMouseMovePan(event) {
//console.log( 'handleMouseMovePan' );
panEnd.set(event.clientX, event.clientY);
panDelta.subVectors(panEnd, panStart);
pan(panDelta.x, panDelta.y);
panStart.copy(panEnd);
scope.update();
} | @author qiao / https://github.com/qiao
@author mrdoob / http://mrdoob.com
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author erich666 / http://erichaines.com | handleMouseMovePan | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function handleMouseUp(event) {
//console.log( 'handleMouseUp' );
} | @author qiao / https://github.com/qiao
@author mrdoob / http://mrdoob.com
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author erich666 / http://erichaines.com | handleMouseUp | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function handleMouseWheel(event) {
//console.log( 'handleMouseWheel' );
var delta = 0;
if (event.wheelDelta !== undefined) {
// WebKit / Opera / Explorer 9
delta = event.wheelDelta;
} else if (event.detail !== undefined) {
// Firefox
delta = -event.detail;
}
if (delta >... | @author qiao / https://github.com/qiao
@author mrdoob / http://mrdoob.com
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author erich666 / http://erichaines.com | handleMouseWheel | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function handleKeyDown(event) {
//console.log( 'handleKeyDown' );
switch (event.keyCode) {
case scope.keys.UP:
pan(0, scope.keyPanSpeed);
scope.update();
break;
case scope.keys.BOTTOM:
pan(0, -scope.keyPanSpeed);
scope.update();
break;
case scope.keys.LEFT:
... | @author qiao / https://github.com/qiao
@author mrdoob / http://mrdoob.com
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author erich666 / http://erichaines.com | handleKeyDown | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function handleTouchStartRotate(event) {
//console.log( 'handleTouchStartRotate' );
rotateStart.set(event.pointers[0].pageX, event.pointers[0].pageY);
} | @author qiao / https://github.com/qiao
@author mrdoob / http://mrdoob.com
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author erich666 / http://erichaines.com | handleTouchStartRotate | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function handleTouchStartDolly(event) {
//console.log( 'handleTouchStartDolly' );
var dx = event.pointers[0].pageX - event.pointers[1].pageX;
var dy = event.pointers[0].pageY - event.pointers[1].pageY;
var distance = Math.sqrt(dx * dx + dy * dy);
dollyStart.set(0, distance);
} | @author qiao / https://github.com/qiao
@author mrdoob / http://mrdoob.com
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author erich666 / http://erichaines.com | handleTouchStartDolly | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
function handleTouchStartPan(event) {
//console.log( 'handleTouchStartPan' );
panStart.set(event.deltaX, event.deltaY);
} | @author qiao / https://github.com/qiao
@author mrdoob / http://mrdoob.com
@author alteredq / http://alteredqualia.com/
@author WestLangley / http://github.com/WestLangley
@author erich666 / http://erichaines.com | handleTouchStartPan | javascript | UDST/vizicities | dist/vizicities.js | https://github.com/UDST/vizicities/blob/master/dist/vizicities.js | BSD-3-Clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.