Link in a graph as a property. Multiple, controlled, atomically, properties inheritable on graphs.
meteor add shuttler:selection
var paths = new Mongo.Collection('paths');
paths.attachGraph();
var select = new Mongo.Collection('select');
select.attachGraph();
var selection = Shuttler.Selection(select, { source: 'source' })
.byPaths(paths, { sources: ['source'], targets: ['target'] })
.watchSelections().watchPaths(paths)
In one graph can be created by a few more selections.In
(selects: Mongo.Collection, sides: Shuttler.GraphSidesSchema, options: Shuttler.Selection.OptionsSchema)
It creates a an instance of controlled selection. If you do not activate some watchers and do not cause any methods that do not act independently.
var paths = new Mongo.Collection('paths');
paths.attachGraph();
var properties = new Mongo.Collection('properties');
properties.attachGraph();
Shuttler.Selection(properties);
Function
By default:
function(selector) {
return !selector._selected;
}
Function.call(selection)
By default:
function() {
return { [this._options.selectedField]: { $exists: false } };
}
Function
By default:
function(selected) {
return !!selected._selected;
}
Function.call(selection)
By default:
function() {
return { [this._options.selectedField]: { $exists: true } };
}
String = '_selected'
(selected: Document) => String|undefined
(directions: 'sources'/'targets', object: Document, handler: .call(this, path: Document, direction: 'source'/'target'/'link', graph: Mongo.Collection)) => this find all paths from source/target
(side: 'source'/'target', object: Document, handler: .call(this, selected: Document)) => this find all selected from source/target
(side: 'source'/'target', object: Document, handler: .call(this, selector: Document)) => this find all selectors from source/target
(directions: 'sources'/'targets', path: Document, handler: .call(this, object: Document, path: Document, graph: Mongo.Collection)) => this find all sources/targets of path
(selector: Document) => this
insert first selected to selector
(selected: Document) => this
select from selected
(source: Document, selected: Document) => this
find all paths from source and insert to each path.targets selected
(source: Document) => this
find all paths from source and insert to each path.targets each source selection
(path: Document, from: Document|Ref, selected: Document) => this
find all path.targets and insert to it selected
(path: Document) => this
find all path.targets and insert to it each path.sources selection
(target: Document, path: Document, from: Document|Ref, selected: Document) => this insert selected to target
(target: Document, path: Document) => this
insert each path.sources selection to target
(target: Document) => this
find all paths to target and insert to target each path.sources selection find all selectors on target and insert selected
(selector: Document) => this
remove first selected from selector
(path: Document|Ref) => this
clear path from any selected
(selected: Document) => this
remove all with .prev: selected._id
(target: Document) => this
clear target from any selected
(selected: Document) => Boolean
(selector: Document) => Boolean
(target: Document, prev: Document, from?: Ref, path?: Document, selector: String, selection?: Shuttle.Selection)
graph.deny({
selection: function(target, prev, from, path, selector, selection) {
return false;
}
});
()
It maintains integrity in the event of a change selected
and selector
links in current selection.
(paths: Mongo.Collection)
It maintains the integrity of the selected
link in the event of changes in the paths the graph.
(paths: Mongo.Collection, directions: Shuttler.GraphDirectionsSchema) => this
Sets a graph as a path for distribution of this selection.
Add to the array selection._paths
object { graph: paths, directions: directions }
.
Actions will operate on the basis of the registered paths.
Mongo.Collection
() => this
enables protection against recursion