@@ -39,15 +39,15 @@ function filter(id, attributes, graph) {
3939}
4040```
4141
42- - Filtering node that have a property 'age' below 18 and with a degree inferior to 10 :
42+ - Keep nodes that have a property 'age' below 18 and with a degree inferior to 10 :
4343
4444``` js
4545function filter (id , attributes , graph ) {
4646 return attributes .age < 18 && graph .degree (id) < 10 ;
4747}
4848```
4949
50- - Filtering nodes on which the property 'job' is not defined
50+ - Keep nodes on which the property 'job' is defined
5151
5252``` js
5353function filter (id , attributes , graph ) {
@@ -110,9 +110,9 @@ On the **Data** page, choosing **Create nodes scripted attribute** in the **Data
110110 * @param {GraphNode} attributes Attributes of the node/edge
111111 * @param {number} index The index position of the node/edge in the graph
112112 * @param {AbstractGraph<GraphNode, GraphEdge>} graph Graphology instance (https://graphology.github.io/)
113- * @returns number|string|boolean|null|undefined" The value of the new node/edge's attribut
113+ * @returns number|string|boolean|null|undefined" The value of the new node/edge's attribute
114114 */
115- function addAttribut (id , attributes , index , graph ) {
115+ function addAttribute (id , attributes , index , graph ) {
116116 //
117117 // Your code goes here
118118 //
@@ -122,18 +122,18 @@ function addAttribut(id, attributes, index, graph) {
122122
123123### Examples
124124
125- - If you have an attribut named 'valid' which take 0 or 1 and you want to cast it into a boolean
125+ - If you have an attribute named 'valid' which take 0 or 1 and you want to cast it into a boolean
126126
127127``` js
128- function addAttribut (id , attributes , index , graph ) {
128+ function addAttribute (id , attributes , index , graph ) {
129129 return attributes .valid === 1 ;
130130}
131131```
132132
133133- If you have attributs named 'firstname' and 'lastname' and you want to concatenate them (usefull for graph label)
134134
135135``` js
136- function addAttribut (id , attributes , index , graph ) {
136+ function addAttribute (id , attributes , index , graph ) {
137137 return (attributes .firstname || " " ) + " " + (attributes .lastname || " );
138138}
139139```
0 commit comments