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 |
|---|---|---|---|---|---|---|---|
setRef = ref => {
this.setRef(ref, _props.key)
element.ref && element.ref(ref)
} | Normalize a transition hook's argument length. The hook may be:
- a merged hook (invoker) with the original in .fns
- a wrapped component method (check ._length)
- a plain function (.length) | setRef | javascript | GeekyAnts/vue-native-core | src/platforms/vue-native/runtime/render-helpers/transitionWeb.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/vue-native/runtime/render-helpers/transitionWeb.js | MIT |
setRef = ref => {
this.setRef(ref, _props.key)
element.ref && element.ref(ref)
} | Normalize a transition hook's argument length. The hook may be:
- a merged hook (invoker) with the original in .fns
- a wrapped component method (check ._length)
- a plain function (.length) | setRef | javascript | GeekyAnts/vue-native-core | src/platforms/vue-native/runtime/render-helpers/transitionWeb.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/vue-native/runtime/render-helpers/transitionWeb.js | MIT |
triggerTransitionExp() {
const tagKey = this.state.tagKey
const transition = this.state.transObj[tagKey]
// someone want to hide and his prev state is show
if (transition) {
const transObj = {}
transObj[tagKey] = Object.assign({}, transition, {
exp: !transition.exp,
... | Normalize a transition hook's argument length. The hook may be:
- a merged hook (invoker) with the original in .fns
- a wrapped component method (check ._length)
- a plain function (.length) | triggerTransitionExp | javascript | GeekyAnts/vue-native-core | src/platforms/vue-native/runtime/render-helpers/transitionWeb.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/vue-native/runtime/render-helpers/transitionWeb.js | MIT |
UNSAFE_componentWillMount() {
this.transitionResolved = resolveTransition(this.props)
this.isAppear = true
const state = this.resolveData(this.props)
state && this.setState(state)
} | Normalize a transition hook's argument length. The hook may be:
- a merged hook (invoker) with the original in .fns
- a wrapped component method (check ._length)
- a plain function (.length) | UNSAFE_componentWillMount | javascript | GeekyAnts/vue-native-core | src/platforms/vue-native/runtime/render-helpers/transitionWeb.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/vue-native/runtime/render-helpers/transitionWeb.js | MIT |
componentDidMount() {
this.resolveEnterTransition({
el: this._refs[this.state.tagKey],
})
} | Normalize a transition hook's argument length. The hook may be:
- a merged hook (invoker) with the original in .fns
- a wrapped component method (check ._length)
- a plain function (.length) | componentDidMount | javascript | GeekyAnts/vue-native-core | src/platforms/vue-native/runtime/render-helpers/transitionWeb.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/vue-native/runtime/render-helpers/transitionWeb.js | MIT |
UNSAFE_componentWillReceiveProps(nextProps) {
this.transitionResolved = resolveTransition(nextProps)
this.isAppear = false
const nextState = this.resolveData(nextProps, 'update')
this._shouldComponentUpdateTransitionResult = nextState
? this._shouldComponentUpdateTransition(nextProps, ne... | Normalize a transition hook's argument length. The hook may be:
- a merged hook (invoker) with the original in .fns
- a wrapped component method (check ._length)
- a plain function (.length) | UNSAFE_componentWillReceiveProps | javascript | GeekyAnts/vue-native-core | src/platforms/vue-native/runtime/render-helpers/transitionWeb.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/vue-native/runtime/render-helpers/transitionWeb.js | MIT |
_shouldComponentUpdateTransition(nextProps, nextState) {
if (
Object.keys(nextState.transObj).length !==
Object.keys(this.state.transObj).length
) {
return true
}
if (nextState.tagKey === this.state.tagKey) {
const nextTransition = nextState.transObj[nextState.tag... | Normalize a transition hook's argument length. The hook may be:
- a merged hook (invoker) with the original in .fns
- a wrapped component method (check ._length)
- a plain function (.length) | _shouldComponentUpdateTransition | javascript | GeekyAnts/vue-native-core | src/platforms/vue-native/runtime/render-helpers/transitionWeb.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/vue-native/runtime/render-helpers/transitionWeb.js | MIT |
resolveEnterTransition(option) {
enter.call(this, option)
} | Normalize a transition hook's argument length. The hook may be:
- a merged hook (invoker) with the original in .fns
- a wrapped component method (check ._length)
- a plain function (.length) | resolveEnterTransition | javascript | GeekyAnts/vue-native-core | src/platforms/vue-native/runtime/render-helpers/transitionWeb.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/vue-native/runtime/render-helpers/transitionWeb.js | MIT |
resolveLeaveTransition(option) {
leave.call(this, option)
} | Normalize a transition hook's argument length. The hook may be:
- a merged hook (invoker) with the original in .fns
- a wrapped component method (check ._length)
- a plain function (.length) | resolveLeaveTransition | javascript | GeekyAnts/vue-native-core | src/platforms/vue-native/runtime/render-helpers/transitionWeb.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/vue-native/runtime/render-helpers/transitionWeb.js | MIT |
componentDidUpdate(prevProps, prevState) {
if (
this.state.animated === false ||
this._shouldComponentUpdateTransition === false
) {
return
}
if (this.state.tagKey === prevState.tagKey) {
// same element
const ref = this._refs[this.state.tagKey]
co... | Normalize a transition hook's argument length. The hook may be:
- a merged hook (invoker) with the original in .fns
- a wrapped component method (check ._length)
- a plain function (.length) | componentDidUpdate | javascript | GeekyAnts/vue-native-core | src/platforms/vue-native/runtime/render-helpers/transitionWeb.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/vue-native/runtime/render-helpers/transitionWeb.js | MIT |
render() {
const transObj = this.state.transObj
const tag = this.props.tag || 'null'
return createElement(
tag,
null,
Object.keys(transObj).map(k => {
const type = transObj[k].element.type
const props = transObj[k].props
const children = props.chil... | Normalize a transition hook's argument length. The hook may be:
- a merged hook (invoker) with the original in .fns
- a wrapped component method (check ._length)
- a plain function (.length) | render | javascript | GeekyAnts/vue-native-core | src/platforms/vue-native/runtime/render-helpers/transitionWeb.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/vue-native/runtime/render-helpers/transitionWeb.js | MIT |
function addClass(el: HTMLElement, cls: ?string) {
/* istanbul ignore if */
if (!cls || !(cls = cls.trim())) {
return
}
/* istanbul ignore else */
if (el.classList) {
if (cls.indexOf(' ') > -1) {
cls.split(/\s+/).forEach(c => el.classList.add(c))
} else {
el.classList.add(cls)
}
... | Add class with compatibility for SVG since classList is not supported on
SVG elements in IE | addClass | javascript | GeekyAnts/vue-native-core | src/platforms/web/runtime/class-util.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/web/runtime/class-util.js | MIT |
function removeClass(el: HTMLElement, cls: ?string) {
/* istanbul ignore if */
if (!cls || !(cls = cls.trim())) {
return
}
/* istanbul ignore else */
if (el.classList) {
if (cls.indexOf(' ') > -1) {
cls.split(/\s+/).forEach(c => el.classList.remove(c))
} else {
el.classList.remove(cls... | Remove class with compatibility for SVG since classList is not supported on
SVG elements in IE | removeClass | javascript | GeekyAnts/vue-native-core | src/platforms/web/runtime/class-util.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/web/runtime/class-util.js | MIT |
inserted(el, binding, vnode) {
if (vnode.tag === 'select') {
const cb = () => {
setSelected(el, binding, vnode.context)
}
cb()
/* istanbul ignore if */
if (isIE || isEdge) {
setTimeout(cb, 0)
}
} else if (
vnode.tag === 'textarea' ||
el.type === 't... | Not type checking this file because flow doesn't like attaching
properties to Elements. | inserted | javascript | GeekyAnts/vue-native-core | src/platforms/web/runtime/directives/model.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/web/runtime/directives/model.js | MIT |
cb = () => {
setSelected(el, binding, vnode.context)
} | Not type checking this file because flow doesn't like attaching
properties to Elements. | cb | javascript | GeekyAnts/vue-native-core | src/platforms/web/runtime/directives/model.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/web/runtime/directives/model.js | MIT |
cb = () => {
setSelected(el, binding, vnode.context)
} | Not type checking this file because flow doesn't like attaching
properties to Elements. | cb | javascript | GeekyAnts/vue-native-core | src/platforms/web/runtime/directives/model.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/web/runtime/directives/model.js | MIT |
componentUpdated(el, binding, vnode) {
if (vnode.tag === 'select') {
setSelected(el, binding, vnode.context)
// in case the options rendered by v-for have changed,
// it's possible that the value is out-of-sync with the rendered options.
// detect such cases and filter out values that no lon... | Not type checking this file because flow doesn't like attaching
properties to Elements. | componentUpdated | javascript | GeekyAnts/vue-native-core | src/platforms/web/runtime/directives/model.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/web/runtime/directives/model.js | MIT |
function setSelected(el, binding, vm) {
const value = binding.value
const isMultiple = el.multiple
if (isMultiple && !Array.isArray(value)) {
process.env.NODE_ENV !== 'production' &&
warn(
`<select multiple v-model="${binding.expression}"> ` +
`expects an Array value for its binding, b... | Not type checking this file because flow doesn't like attaching
properties to Elements. | setSelected | javascript | GeekyAnts/vue-native-core | src/platforms/web/runtime/directives/model.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/web/runtime/directives/model.js | MIT |
function hasNoMatchingOption(value, options) {
for (let i = 0, l = options.length; i < l; i++) {
if (looseEqual(getValue(options[i]), value)) {
return false
}
}
return true
} | Not type checking this file because flow doesn't like attaching
properties to Elements. | hasNoMatchingOption | javascript | GeekyAnts/vue-native-core | src/platforms/web/runtime/directives/model.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/web/runtime/directives/model.js | MIT |
function getValue(option) {
return '_value' in option ? option._value : option.value
} | Not type checking this file because flow doesn't like attaching
properties to Elements. | getValue | javascript | GeekyAnts/vue-native-core | src/platforms/web/runtime/directives/model.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/web/runtime/directives/model.js | MIT |
function onCompositionStart(e) {
e.target.composing = true
} | Not type checking this file because flow doesn't like attaching
properties to Elements. | onCompositionStart | javascript | GeekyAnts/vue-native-core | src/platforms/web/runtime/directives/model.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/web/runtime/directives/model.js | MIT |
function onCompositionEnd(e) {
e.target.composing = false
trigger(e.target, 'input')
} | Not type checking this file because flow doesn't like attaching
properties to Elements. | onCompositionEnd | javascript | GeekyAnts/vue-native-core | src/platforms/web/runtime/directives/model.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/web/runtime/directives/model.js | MIT |
function trigger(el, type) {
const e = document.createEvent('HTMLEvents')
e.initEvent(type, true, true)
el.dispatchEvent(e)
} | Not type checking this file because flow doesn't like attaching
properties to Elements. | trigger | javascript | GeekyAnts/vue-native-core | src/platforms/web/runtime/directives/model.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/web/runtime/directives/model.js | MIT |
function getHookArgumentsLength(fn: Function): boolean {
if (isUndef(fn)) {
return false
}
const invokerFns = fn.fns
if (isDef(invokerFns)) {
// invoker
return getHookArgumentsLength(
Array.isArray(invokerFns) ? invokerFns[0] : invokerFns,
)
} else {
return (fn._length || fn.length) ... | Normalize a transition hook's argument length. The hook may be:
- a merged hook (invoker) with the original in .fns
- a wrapped component method (check ._length)
- a plain function (.length) | getHookArgumentsLength | javascript | GeekyAnts/vue-native-core | src/platforms/web/runtime/modules/transition.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/web/runtime/modules/transition.js | MIT |
function _enter(_: any, vnode: VNodeWithData) {
if (vnode.data.show !== true) {
enter(vnode)
}
} | Normalize a transition hook's argument length. The hook may be:
- a merged hook (invoker) with the original in .fns
- a wrapped component method (check ._length)
- a plain function (.length) | _enter | javascript | GeekyAnts/vue-native-core | src/platforms/web/runtime/modules/transition.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/web/runtime/modules/transition.js | MIT |
if (vnode.data.show !== true) {
leave(vnode, rm)
} | Normalize a transition hook's argument length. The hook may be:
- a merged hook (invoker) with the original in .fns
- a wrapped component method (check ._length)
- a plain function (.length) | if | javascript | GeekyAnts/vue-native-core | src/platforms/web/runtime/modules/transition.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/web/runtime/modules/transition.js | MIT |
if (typeof el === 'string') {
const selected = document.querySelector(el)
if (!selected) {
process.env.NODE_ENV !== 'production' &&
warn('Cannot find element: ' + el)
return document.createElement('div')
}
return selected
} | Query an element selector if it's not an element already. | if | javascript | GeekyAnts/vue-native-core | src/platforms/web/util/index.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/web/util/index.js | MIT |
function getStyle(vnode: VNode, checkChild: boolean): Object {
const res = {}
let styleData
if (checkChild) {
let childNode = vnode
while (childNode.componentInstance) {
childNode = childNode.componentInstance._vnode
if (childNode.data && (styleData = normalizeStyleData(childNode.data))) {
... | parent component style should be after child's
so that parent component's style could override it | getStyle | javascript | GeekyAnts/vue-native-core | src/platforms/web/util/style.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/platforms/web/util/style.js | MIT |
function parseComponent(
content: string,
options?: Object = {},
): SFCDescriptor {
const sfc: SFCDescriptor = {
template: null,
script: null,
styles: [],
customBlocks: [],
}
let depth = 0
let currentBlock: ?(SFCBlock | SFCCustomBlock) = null
function start(
tag: string,
attrs: Ar... | Parse a single-file component (*.vue) file into an SFC Descriptor Object. | parseComponent | javascript | GeekyAnts/vue-native-core | src/sfc/parser.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/sfc/parser.js | MIT |
function start(
tag: string,
attrs: Array<Attribute>,
unary: boolean,
start: number,
end: number,
) {
if (depth === 0) {
currentBlock = {
type: tag,
content: '',
start: end,
attrs: attrs.reduce((cumulated, { name, value }) => {
cumulated[name] = ... | Parse a single-file component (*.vue) file into an SFC Descriptor Object. | start | javascript | GeekyAnts/vue-native-core | src/sfc/parser.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/sfc/parser.js | MIT |
function checkAttrs(block: SFCBlock, attrs: Array<Attribute>) {
for (let i = 0; i < attrs.length; i++) {
const attr = attrs[i]
if (attr.name === 'lang') {
block.lang = attr.value
}
if (attr.name === 'scoped') {
block.scoped = true
}
if (attr.name === 'module') {
... | Parse a single-file component (*.vue) file into an SFC Descriptor Object. | checkAttrs | javascript | GeekyAnts/vue-native-core | src/sfc/parser.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/sfc/parser.js | MIT |
function end(tag: string, start: number, end: number) {
if (depth === 1 && currentBlock) {
currentBlock.end = start
let text = deindent(content.slice(currentBlock.start, currentBlock.end))
// pad content so that linters and pre-processors can output correct
// line numbers in errors and warn... | Parse a single-file component (*.vue) file into an SFC Descriptor Object. | end | javascript | GeekyAnts/vue-native-core | src/sfc/parser.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/sfc/parser.js | MIT |
function padContent(
block: SFCBlock | SFCCustomBlock,
pad: true | 'line' | 'space',
) {
if (pad === 'space') {
return content.slice(0, block.start).replace(replaceRE, ' ')
} else {
const offset = content.slice(0, block.start).split(splitRE).length
const padChar = block.type === 'scr... | Parse a single-file component (*.vue) file into an SFC Descriptor Object. | padContent | javascript | GeekyAnts/vue-native-core | src/sfc/parser.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/sfc/parser.js | MIT |
function isPlainObject(obj: any): boolean {
return toString.call(obj) === OBJECT_STRING
} | Strict object type check. Only returns true
for plain JavaScript objects. | isPlainObject | javascript | GeekyAnts/vue-native-core | src/shared/util.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/shared/util.js | MIT |
function _toString(val: any): string {
return val == null
? ''
: typeof val === 'object'
? JSON.stringify(val, null, 2)
: String(val)
} | Convert a value to a string that is actually rendered. | _toString | javascript | GeekyAnts/vue-native-core | src/shared/util.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/shared/util.js | MIT |
if (arr.length) {
const index = arr.indexOf(item)
if (index > -1) {
return arr.splice(index, 1)
}
} | Remove an item from an array | if | javascript | GeekyAnts/vue-native-core | src/shared/util.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/shared/util.js | MIT |
if (arr[i]) {
extend(res, arr[i])
} | Merge an Array of Objects into a single Object. | if | javascript | GeekyAnts/vue-native-core | src/shared/util.js | https://github.com/GeekyAnts/vue-native-core/blob/master/src/shared/util.js | MIT |
newQuery = function newQuery() {
return {
checks: []
};
} | Make a new query object
@prop type {Type} The type enum (int) of the query
@prop checks List of checks to make against an ele to test for a match | newQuery | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
stateSelectorMatches = function stateSelectorMatches(sel, ele) {
return lookup[sel](ele);
} | Always matches, useful placeholder for subject in `COMPOUND_SPLIT` | stateSelectorMatches | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
cleanMetaChars = function cleanMetaChars(str) {
return str.replace(new RegExp('\\\\(' + tokens.metaChar + ')', 'g'), function (match, $1) {
return $1;
});
} | Always matches, useful placeholder for subject in `COMPOUND_SPLIT` | cleanMetaChars | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
replaceLastQuery = function replaceLastQuery(selector, examiningQuery, replacementQuery) {
selector[selector.length - 1] = replacementQuery;
} | Always matches, useful placeholder for subject in `COMPOUND_SPLIT` | replaceLastQuery | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
consumeExpr = function consumeExpr(remaining) {
var expr;
var match;
var name;
for (var j = 0; j < exprs.length; j++) {
var e = exprs[j];
var n = e.name;
var m = remaining.match(e.regexObj);
if (m != null) {
match = m;
expr = e;
name = n;
var consumed = m[0];
rema... | Of all the expressions, find the first match in the remaining text.
@param {string} remaining The remaining text to parse
@returns The matched expression and the newly remaining text `{ expr, match, name, remaining }` | consumeExpr | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
consumeWhitespace = function consumeWhitespace(remaining) {
var match = remaining.match(/^\s+/);
if (match) {
var consumed = match[0];
remaining = remaining.substring(consumed.length);
}
return remaining;
} | Consume all the leading whitespace
@param {string} remaining The text to consume
@returns The text with the leading whitespace removed | consumeWhitespace | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
parse = function parse(selector) {
var self = this;
var remaining = self.inputText = selector;
var currentQuery = self[0] = newQuery();
self.length = 1;
remaining = consumeWhitespace(remaining); // get rid of leading whitespace
for (;;) {
var exprInfo = consumeExpr(remaining);
if (exprInfo.expr ==... | Parse the string and store the parsed representation in the Selector.
@param {string} selector The selector string
@returns `true` if the selector was successfully parsed, `false` otherwise | parse | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
toString = function toString() {
if (this.toStringCache != null) {
return this.toStringCache;
}
var clean = function clean(obj) {
if (obj == null) {
return '';
} else {
return obj;
}
};
var cleanVal = function cleanVal(val) {
if (string(val)) {
return '"' + val + '"';
... | Get the selector represented as a string. This value uses default formatting,
so things like spacing may differ from the input text passed to the constructor.
@returns {string} The selector string | toString | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
clean = function clean(obj) {
if (obj == null) {
return '';
} else {
return obj;
}
} | Get the selector represented as a string. This value uses default formatting,
so things like spacing may differ from the input text passed to the constructor.
@returns {string} The selector string | clean | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
cleanVal = function cleanVal(val) {
if (string(val)) {
return '"' + val + '"';
} else {
return clean(val);
}
} | Get the selector represented as a string. This value uses default formatting,
so things like spacing may differ from the input text passed to the constructor.
@returns {string} The selector string | cleanVal | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
space = function space(val) {
return ' ' + val + ' ';
} | Get the selector represented as a string. This value uses default formatting,
so things like spacing may differ from the input text passed to the constructor.
@returns {string} The selector string | space | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
checkToString = function checkToString(check, subject) {
var type = check.type,
value = check.value;
switch (type) {
case Type.GROUP:
{
var group = clean(value);
return group.substring(0, group.length - 1);
}
case Type.DATA_COMPARE:
{
v... | Get the selector represented as a string. This value uses default formatting,
so things like spacing may differ from the input text passed to the constructor.
@returns {string} The selector string | checkToString | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
queryToString = function queryToString(query, subject) {
return query.checks.reduce(function (str, chk, i) {
return str + (subject === query && i === 0 ? '$' : '') + checkToString(chk, subject);
}, '');
} | Get the selector represented as a string. This value uses default formatting,
so things like spacing may differ from the input text passed to the constructor.
@returns {string} The selector string | queryToString | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
valCmp = function valCmp(fieldVal, operator, value) {
var matches;
var isFieldStr = string(fieldVal);
var isFieldNum = number(fieldVal);
var isValStr = string(value);
var fieldStr, valStr;
var caseInsensitive = false;
var notExpr = false;
var isIneqCmp = false;
if (operator.indexOf('!') >= 0) {
o... | Get the selector represented as a string. This value uses default formatting,
so things like spacing may differ from the input text passed to the constructor.
@returns {string} The selector string | valCmp | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
boolCmp = function boolCmp(fieldVal, operator) {
switch (operator) {
case '?':
return fieldVal ? true : false;
case '!':
return fieldVal ? false : true;
case '^':
return fieldVal === undefined;
}
} | Get the selector represented as a string. This value uses default formatting,
so things like spacing may differ from the input text passed to the constructor.
@returns {string} The selector string | boolCmp | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
existCmp = function existCmp(fieldVal) {
return fieldVal !== undefined;
} | Get the selector represented as a string. This value uses default formatting,
so things like spacing may differ from the input text passed to the constructor.
@returns {string} The selector string | existCmp | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
data = function data(ele, field) {
return ele.data(field);
} | Get the selector represented as a string. This value uses default formatting,
so things like spacing may differ from the input text passed to the constructor.
@returns {string} The selector string | data | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
meta = function meta(ele, field) {
return ele[field]();
} | Get the selector represented as a string. This value uses default formatting,
so things like spacing may differ from the input text passed to the constructor.
@returns {string} The selector string | meta | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
matches = function matches(query, ele) {
return query.checks.every(function (chk) {
return match[chk.type](chk, ele);
});
} | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | matches | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
filter = function filter(collection) {
var self = this; // for 1 id #foo queries, just get the element
if (self.length === 1 && self[0].checks.length === 1 && self[0].checks[0].type === Type.ID) {
return collection.getElementById(self[0].checks[0].value).collection();
}
var selectorFunction = function sel... | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | filter | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
selectorFunction = function selectorFunction(element) {
for (var j = 0; j < self.length; j++) {
var query = self[j];
if (matches(query, element)) {
return true;
}
}
return false;
} | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | selectorFunction | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
matches$1 = function matches$1(ele) {
var self = this;
for (var j = 0; j < self.length; j++) {
var query = self[j];
if (matches(query, ele)) {
return true;
}
}
return false;
} | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | matches$1 | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
Selector = function Selector(selector) {
this.inputText = selector;
this.currentSubject = null;
this.compoundCount = 0;
this.edgeCount = 0;
this.length = 0;
if (selector == null || string(selector) && selector.match(/^\s*$/)) ; else if (elementOrCollection(selector)) {
this.addQuery({
checks: [{
... | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | Selector | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
cache = function cache(fn, name) {
return function traversalCache(arg1, arg2, arg3, arg4) {
var selectorOrEles = arg1;
var eles = this;
var key;
if (selectorOrEles == null) {
key = '';
} else if (elementOrCollection(selectorOrEles) && selectorOrEles.length === 1) {
key = selectorOrEle... | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | cache | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
function add(eles) {
for (var i = 0; i < eles.length; i++) {
var ele = eles[i];
elements.push(ele);
if (ele.children().nonempty()) {
add(ele.children());
}
}
} | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | add | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
function forEachCompound(eles, fn, includeSelf, recursiveStep) {
var q = [];
var did = new Set$1();
var cy = eles.cy();
var hasCompounds = cy.hasCompoundNodes();
for (var i = 0; i < eles.length; i++) {
var ele = eles[i];
if (includeSelf) {
q.push(ele);
} else if (hasCompounds) {
recu... | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | forEachCompound | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
function addChildren(q, did, ele) {
if (ele.isParent()) {
var children = ele._private.children;
for (var i = 0; i < children.length; i++) {
var child = children[i];
if (!did.has(child.id())) {
q.push(child);
}
}
}
} // very efficient version of eles.add( eles.descendants() ).... | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | addChildren | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
function addParent(q, did, ele) {
if (ele.isChild()) {
var parent = ele._private.parent;
if (!did.has(parent.id())) {
q.push(parent);
}
}
} | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | addParent | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
function addParentAndChildren(q, did, ele) {
addParent(q, did, ele);
addChildren(q, did, ele);
} | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | addParentAndChildren | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
function defineDegreeFunction(callback) {
return function (includeLoops) {
var self = this;
if (includeLoops === undefined) {
includeLoops = true;
}
if (self.length === 0) {
return;
}
if (self.isNode() && !self.removed()) {
var degree = 0;
var node = self[0];
v... | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | defineDegreeFunction | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
function defineDegreeBoundsFunction(degreeFn, callback) {
return function (includeLoops) {
var ret;
var nodes = this.nodes();
for (var i = 0; i < nodes.length; i++) {
var ele = nodes[i];
var degree = ele[degreeFn](includeLoops);
if (degree !== undefined && (ret === undefined || callbac... | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | defineDegreeBoundsFunction | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
beforePositionSet = function beforePositionSet(eles, newPos, silent) {
for (var i = 0; i < eles.length; i++) {
var ele = eles[i];
if (!ele.locked()) {
var oldPos = ele._private.position;
var delta = {
x: newPos.x != null ? newPos.x - oldPos.x : 0,
y: newPos.y != null ? newPos.y - ... | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | beforePositionSet | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
function update(parent) {
if (!parent.isParent()) {
return;
}
var _p = parent._private;
var children = parent.children();
var includeLabels = parent.pstyle('compound-sizing-wrt-labels').value === 'include';
var min = {
width: {
val: parent.pstyle('min-width').pfValue,
... | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | update | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
function computeBiasValues(propDiff, propBias, propBiasComplement) {
var biasDiff = 0;
var biasComplementDiff = 0;
var biasTotal = propBias + propBiasComplement;
if (propDiff > 0 && biasTotal > 0) {
biasDiff = propBias / biasTotal * propDiff;
biasComplementDiff = propBiasComplem... | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | computeBiasValues | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
function computePaddingValues(width, height, paddingObject, relativeTo) {
// Assuming percentage is number from 0 to 1
if (paddingObject.units === '%') {
switch (relativeTo) {
case 'width':
return width > 0 ? paddingObject.pfValue * width : 0;
case 'height':
... | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | computePaddingValues | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
noninf = function noninf(x) {
if (x === Infinity || x === -Infinity) {
return 0;
}
return x;
} | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | noninf | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
updateBounds = function updateBounds(b, x1, y1, x2, y2) {
// don't update with zero area boxes
if (x2 - x1 === 0 || y2 - y1 === 0) {
return;
} // don't update with null dim
if (x1 == null || y1 == null || x2 == null || y2 == null) {
return;
}
b.x1 = x1 < b.x1 ? x1 : b.x1;
b.x2 = x2 > b.x2 ? x2 ... | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | updateBounds | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
updateBoundsFromBox = function updateBoundsFromBox(b, b2) {
if (b2 == null) {
return b;
}
return updateBounds(b, b2.x1, b2.y1, b2.x2, b2.y2);
} | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | updateBoundsFromBox | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
prefixedProperty = function prefixedProperty(obj, field, prefix) {
return getPrefixedProperty(obj, field, prefix);
} | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | prefixedProperty | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
updateBoundsFromArrow = function updateBoundsFromArrow(bounds, ele, prefix) {
if (ele.cy().headless()) {
return;
}
var _p = ele._private;
var rstyle = _p.rstyle;
var halfArW = rstyle.arrowWidth / 2;
var arrowType = ele.pstyle(prefix + '-arrow-shape').value;
var x;
var y;
if (arrowType !== 'none'... | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | updateBoundsFromArrow | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
updateBoundsFromLabel = function updateBoundsFromLabel(bounds, ele, prefix) {
if (ele.cy().headless()) {
return;
}
var prefixDash;
if (prefix) {
prefixDash = prefix + '-';
} else {
prefixDash = '';
}
var _p = ele._private;
var rstyle = _p.rstyle;
var label = ele.pstyle(prefixDash + 'lab... | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | updateBoundsFromLabel | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
rotate = function rotate(x, y) {
x = x - xo;
y = y - yo;
return {
x: x * cos - y * sin + xo,
y: x * sin + y * cos + yo
};
} | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | rotate | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
boundingBoxImpl = function boundingBoxImpl(ele, options) {
var cy = ele._private.cy;
var styleEnabled = cy.styleEnabled();
var headless = cy.headless();
var bounds = makeBoundingBox();
var _p = ele._private;
var isNode = ele.isNode();
var isEdge = ele.isEdge();
var ex1, ex2, ey1, ey2; // extrema of body... | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | boundingBoxImpl | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
isDisplayed = function isDisplayed(ele) {
return ele.pstyle('display').value !== 'none';
} | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | isDisplayed | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
getKey = function getKey(opts) {
var i = 0;
var tf = function tf(val) {
return (val ? 1 : 0) << i++;
};
var key = 0;
key += tf(opts.incudeNodes);
key += tf(opts.includeEdges);
key += tf(opts.includeLabels);
key += tf(opts.includeMainLabels);
key += tf(opts.includeSourceLabels);
key += tf(opts.... | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | getKey | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
tf = function tf(val) {
return (val ? 1 : 0) << i++;
} | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | tf | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
getBoundingBoxPosKey = function getBoundingBoxPosKey(ele) {
if (ele.isEdge()) {
var p1 = ele.source().position();
var p2 = ele.target().position();
var r = function r(x) {
return Math.round(x);
};
return hashIntsArray([r(p1.x), r(p1.y), r(p2.x), r(p2.y)]);
} else {
return 0;
}
} | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | getBoundingBoxPosKey | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
r = function r(x) {
return Math.round(x);
} | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | r | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
cachedBoundingBoxImpl = function cachedBoundingBoxImpl(ele, opts) {
var _p = ele._private;
var bb;
var isEdge = ele.isEdge();
var key = opts == null ? defBbOptsKey : getKey(opts);
var usingDefOpts = key === defBbOptsKey;
var currPosKey = getBoundingBoxPosKey(ele);
var isPosKeySame = _p.bbCachePosKey === c... | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | cachedBoundingBoxImpl | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
isDirty = function isDirty(ele) {
return ele._private.bbCache == null || ele._private.styleDirty;
} | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | isDirty | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
storeOldPos = function storeOldPos(node, i) {
return node._private.bbAtOldPos = fn(node, i);
} | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | storeOldPos | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
getOldPos = function getOldPos(node) {
return node._private.bbAtOldPos;
} | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | getOldPos | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
defineDimFns = function defineDimFns(opts) {
opts.uppercaseName = capitalize(opts.name);
opts.autoName = 'auto' + opts.uppercaseName;
opts.labelName = 'label' + opts.uppercaseName;
opts.outerName = 'outer' + opts.uppercaseName;
opts.uppercaseOuterName = capitalize(opts.outerName);
fn$4[opts.name] = functio... | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | defineDimFns | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
ifEdge = function ifEdge(ele, getValue) {
if (ele.isEdge()) {
return getValue(ele);
}
} | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | ifEdge | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
ifEdgeRenderedPosition = function ifEdgeRenderedPosition(ele, getPoint) {
if (ele.isEdge()) {
var cy = ele.cy();
return modelToRenderedPosition(getPoint(ele), cy.zoom(), cy.pan());
}
} | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | ifEdgeRenderedPosition | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
ifEdgeRenderedPositions = function ifEdgeRenderedPositions(ele, getPoints) {
if (ele.isEdge()) {
var cy = ele.cy();
var pan = cy.pan();
var zoom = cy.zoom();
return getPoints(ele).map(function (p) {
return modelToRenderedPosition(p, zoom, pan);
});
}
} | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | ifEdgeRenderedPositions | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
controlPoints = function controlPoints(ele) {
return ele.renderer().getControlPoints(ele);
} | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | controlPoints | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
segmentPoints = function segmentPoints(ele) {
return ele.renderer().getSegmentPoints(ele);
} | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | segmentPoints | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
sourceEndpoint = function sourceEndpoint(ele) {
return ele.renderer().getSourceEndpoint(ele);
} | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | sourceEndpoint | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
targetEndpoint = function targetEndpoint(ele) {
return ele.renderer().getTargetEndpoint(ele);
} | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | targetEndpoint | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
midpoint = function midpoint(ele) {
return ele.renderer().getEdgeMidpoint(ele);
} | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | midpoint | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
renderedName = function renderedName(name) {
return 'rendered' + name[0].toUpperCase() + name.substr(1);
} | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | renderedName | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
Event = function Event(src, props) {
this.recycle(src, props);
} | Returns whether the query matches for the element
@param query The `{ type, value, ... }` query object
@param ele The element to compare against | Event | javascript | pistazie/cdk-dia | src/render/cytoscape/base/js/app.8e9fe77f.js | https://github.com/pistazie/cdk-dia/blob/master/src/render/cytoscape/base/js/app.8e9fe77f.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.