Skip to content

Commit 4701aa1

Browse files
committed
[gephi-lite] fix attribute wording (#304)
1 parent 6755ec3 commit 4701aa1

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

packages/gephi-lite/src/components/GraphFilters/ScriptFilter.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,21 +94,21 @@ export const ScriptFilter: FC<{
9494
if (!fn) throw new Error("Function is not defined");
9595
// Check/test the function
9696
let id = null;
97-
let attributs = null;
97+
let attributes = null;
9898
const graphDataset = graphDatasetAtom.get();
9999

100100
const graphGraph = dataGraphToFullGraph(graphDataset, parentGraph);
101101

102102
if (filter.itemType === "nodes" && parentGraph.order > 0) {
103103
id = parentGraph.nodes()[0];
104-
attributs = graphGraph.getNodeAttributes(id);
104+
attributes = graphGraph.getNodeAttributes(id);
105105
}
106106
if (filter.itemType === "edges" && parentGraph.size > 0) {
107107
id = parentGraph.edges()[0];
108-
attributs = graphGraph.getEdgeAttributes(id);
108+
attributes = graphGraph.getEdgeAttributes(id);
109109
}
110110

111-
const result = fn(id ?? "0", attributs ?? {}, graphGraph);
111+
const result = fn(id ?? "0", attributes ?? {}, graphGraph);
112112
if (!isBoolean(result)) throw new Error("Function must return a boolean");
113113
},
114114
},

packages/gephi-lite/src/components/data/CreateScriptedFieldModel.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ const BASE_JS = {
3232
* @param {GraphNode} attributes Attributes of the node
3333
* @param {number} index The index position of the node in the graph
3434
* @param {AbstractGraph<GraphNode, GraphEdge>} graph Graphology instance (https://graphology.github.io/)
35-
* @returns number|string|boolean|null|undefined" The value of the new node's attribut
35+
* @returns number|string|boolean|null|undefined" The value of the new node's attribute
3636
*/`,
37-
baseFn: `function addNodeAttribut(id, attributes, index, graph) {
37+
baseFn: `function addNodeAttribute(id, attributes, index, graph) {
3838
//
3939
// Your code goes here
4040
//
@@ -44,8 +44,8 @@ const BASE_JS = {
4444
if (!fn) throw new Error("Function is not defined");
4545
const fullGraph = dataGraphToFullGraph(graphDatasetAtom.get());
4646
const id = fullGraph.nodes()[0];
47-
const attributs = fullGraph.getNodeAttributes(id);
48-
const result = fn(id, attributs, 0, fullGraph);
47+
const attributes = fullGraph.getNodeAttributes(id);
48+
const result = fn(id, attributes, 0, fullGraph);
4949
if (!isScalar(result)) throw new Error("Function must returns a number, a string, a boolean, null or undefined");
5050
},
5151
},
@@ -57,9 +57,9 @@ const BASE_JS = {
5757
* @param {GraphNode} attributes Attributes of the node
5858
* @param {number} index The index position of the node in the graph
5959
* @param {AbstractGraph<GraphNode, GraphEdge>} graph Graphology instance (https://graphology.github.io/)
60-
* @returns number|string|boolean|null|undefined" The value of the new edge's attribut
60+
* @returns number|string|boolean|null|undefined" The value of the new edge's attribute
6161
*/`,
62-
baseFn: `function addEdgeAttribut(id, attributes, index, graph) {
62+
baseFn: `function addEdgeAttribute(id, attributes, index, graph) {
6363
//
6464
// Your code goes here
6565
//
@@ -94,8 +94,8 @@ export const useCreateScriptedFieldModelForm = ({
9494

9595
const fullGraph = dataGraphToFullGraph(graphDatasetAtom.get());
9696
const id = fullGraph[type]()[0];
97-
const attributs = type === "nodes" ? fullGraph.getNodeAttributes(id) : fullGraph.getEdgeAttributes(id);
98-
const result = fn(id, attributs, 0, fullGraph);
97+
const attributes = type === "nodes" ? fullGraph.getNodeAttributes(id) : fullGraph.getEdgeAttributes(id);
98+
const result = fn(id, attributes, 0, fullGraph);
9999
if (!isScalar(result)) throw new Error("Function must returns a number, a string, a boolean, null or undefined");
100100
},
101101
[type],

packages/gephi-lite/src/core/file/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export function parseGephiLiteJsonContent<T extends { type: "gephi-lite" } & { [
201201
graph = Graph.from(graphDataset.fullGraph as any);
202202
}
203203

204-
// Merging node's attributs
204+
// Merging node's attributes
205205
const nodeMapDataType = ["layout", "nodeRenderingData", "nodeData"] as const;
206206
for (const nodeMapData of nodeMapDataType) {
207207
if (has(graphDataset, nodeMapData) && isObject(graphDataset[nodeMapData])) {
@@ -213,7 +213,7 @@ export function parseGephiLiteJsonContent<T extends { type: "gephi-lite" } & { [
213213
}
214214
}
215215

216-
// Merging edge's attributs
216+
// Merging edge's attributes
217217
const edgeMapDataType = ["edgeRenderingData", "edgeData"] as const;
218218
for (const edgeMapData of edgeMapDataType) {
219219
if (has(graphDataset, edgeMapData) && isObject(graphDataset[edgeMapData])) {

packages/gephi-lite/src/core/layouts/collection/script.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ export const ScriptLayout = {
3939
// Check & test the function
4040
const fullGraph = dataGraphToFullGraph(graphDatasetAtom.get());
4141
const id = fullGraph.nodes()[0];
42-
const attributs = fullGraph.getNodeAttributes(id);
43-
const result = fn(id, attributs, 0, fullGraph);
42+
const attributes = fullGraph.getNodeAttributes(id);
43+
const result = fn(id, attributes, 0, fullGraph);
4444
if (!isObject(result)) throw new Error("Function must return an object");
4545
if (isNil(result.x)) throw new Error("Function must return an object with a `x` property");
4646
if (isNil(result.y)) throw new Error("Function must return an object with a `y` property");

0 commit comments

Comments
 (0)