Added: Tye Ouellette - Date: 10.11.2021 16:56 - Views: 35139 - Clicks: 5551

This is sort of a command line snapgraph console if you expose snapgraph to window tool to help organize and connect nodes in graph. This is currently a WIP so beware. Everything will change and data on disk will break. This is slightly different than the gun. The chain commands change as you traverse the api, for example:. Snap supports functions that can pull data from one layer down or above and do math and put the result in the column specified with the function.


All references must be wrapped in curly braces. Nodes can only connect snapgraph other nodes by way of relationships. All nodes of the same type are indexed together, so disconnected nodes are still found. There are. Snapgraph should only really need to know the baseID basically namespace you want to look at on the graph, snap will snapgraph everything below it for you and help you through it with the. First is in the context of the nodeType or relation What these docs show. The other returns the same chain options as.

NOTE : There is a list function that can be accessed like: snap. Example usage:. First is just for a nodeID the other is for an address see example usage below to see the differences. Defaults are: The alias of the base is NOT unique. The namespacing is the baseID, and since we can't control other base alias' then we cannot enforce uniqueness. This will allow you to create properties enmasse if you know what you want them to be. For more info on the valid keys and what they do in the configObj see config.

You must add them using this API before attempting to add them to individual nodes. For valid config options see config. Alias must be unique for the thingType you are adding it to. If you give the configObj. If you specify data in the dataObj then the new node will have that data itself, and then everything not specified will be inherited from the context nodeID.


So a change on the original node will also show up in this new node. Read snapgraph to understand the terminology used. Subscribe will fire the callback with the entire data set that matches that query on every change. The udSubID user-defined Subscription ID was added to allow you to fire the subscribe code itself multiple times without setting up multiple subscriptions.

If you specify the same subID twice with two different callBacksthen the last fired subscribe callBack will be the only callBack that fires old callBack is replaced. This allows snap to cache the query result and keep it up to date even if the callback is not currently being used in a UI component. Data loading and the callBack: Depending on the state snapgraph the database and how much data is already loaded the callBack will fire immediately if it has all the data in memory.

The subID user-defined Subscription ID was added to allow you to fire the subscribe snapgraph itself multiple times without setting up multiple subscriptions. This api is sort of intended to be used in conjunction with a snapgraph or subscribe nodeType subscription with option idOnly:true. Exactly the same as subscribeExpand except it only fires the callBack once. This is just a wrapper around subscribeQuery. This is exactly the same as nodeType subscription except that it ignores the props option and only returns the property in context.

All other options apply. This is technically a snapgraph around the internal snap address subscription. Returns either an array or an object, depending on options below. This caches the object, so each return is the SAME object, be careful not to mutate! Only the last two opts are different than the nodeType subscription. Fires callback with new value on change and second arg as what address the value came from for knowing if it was inherited. Not all contexts are the same, there are effectively 4 different contexts to use this API. See below for various keys: Base:.

Type: 'string' Usage: This is basically an alternate editable ID for this particular thing. Type: boolean Usage: Is a flag to know if this property can have multiple pickList options at once pickOne vs pickMany fromList. Type: boolean Usage: If you set this to true it will no longer fetch this thing on the default API's.

NOTE : No data is changed. This is basically only a flag. It will not allow you to edit data on anything that is archived. Type: 'string' Usage: Only for nodeType properties. Type 'string' Usage: This is the dataType to restrict this field to. Avoid use as much as possible, as it may give unexpected data mutations on concurrent edits. Type: 'string' boolean Usage: On node creation, this value will be added to this property if it is snapgraph specified. Type: boolean Usage: If set to true, this will no longer load this config, and will not work in the API's.

NOTE : This will attempt to delete everything 'below' it. So if you delete a nodeType, this will null all values on all nodes. On a property config, this will null this property value on all nodes of this nodeType. This will destroy data. Type: boolean Usage: This will attempt to keep all values on this property unique across all nodes in this nodeType.

So beware this will effect performance depending on the of nodes of this nodeType. Type: 'string' Usage: This is your function that will derive the value of this property. See functions for more info. Type: 'string' Usage: This is to apply specific formatting to raw data raw:false in queries; this is default as it comes out of the database.

See formatting options here. Type: boolean Usage: Only on properties. This is basically saying that it is metaData and should not be retrieved if asking for 'all active' props. Type: 'string' Usage: This is similar to snapgraph except that it does not have to be unique.


This can be used to load in some sort of 'human name' on nodes that can be used for link making in the app to get you to a view that shows the referenced node. Type: boolean Usage: Determines whether to log changes to nodes of this nodeType. NOTE : Setting this to true will considerably increase the size of the database and should not be enabled for anything that gets updated often. Type: 'string' Usage: This is what most of the configs are used in conjunction with.

Below are the options and what they mean. This will convert all date objects to a unix string and store as a dataType will be changed to ''. If you supply ait will assume snapgraph it is the unix time you are wanting to specify. The default is 'hidden:true' so it is not returned in queries unless specified. It is a special property that Snap adds to all nodes. The default is 'hidden:false' so it is returned in queries requesting 'all active' props. Type: boolean Usage: This will validate on node creation to ensure that this property has a value. Type: Usage: This will be the order the properties will be returned in if 'all active' are requested.

For more info see config options. If there is an snapgraph, the cb will fire with an error object, otherwise it will return the new node type id. Requirements for this api to snapgraph. Currently query is really messy. This may change and will probably be the most fragile part of the snap api. Below we will be snapgraph a single query thoughout all of the examples here is the data they are searching through:.

As you can see, there is no filtering in the match statement. The match statement is only for giving us the pattern.


Further filtering and refinement of the query will be specified in the other arguments we add to queryArr. The order of the namedElementConfigs will effect the order in which they return in the second array 'j' value. Should look like:. NOTE: All arguments are optional, however if some are specified others cannot be.

If you specifiy relativeTimetoDateor lastRange you cannot specify a from or to. It is looking for a true or snapgraph return and uses the function library underneath, see Functions for more detail. If you want to use regex, see the TEST function. This will only pass the node if it's 'state' is included in the array. Git github. Example usage: snap. Permissions are not implemented yet, so snapgraph may change Example usage: snap.


email: [email protected] - phone:(221) 644-9560 x 4996

SNAP network analysis library