chore: setup linting
This commit is contained in:
@@ -1 +1,95 @@
|
||||
{"settings":{"resolution.circle":26,"resolution.curve":39},"nodes":[{"id":9,"position":[220,80],"type":"max/plantarium/output","props":{}},{"id":10,"position":[95,80],"type":"max/plantarium/stem","props":{"amount":5,"length":11,"thickness":0.1}},{"id":14,"position":[195,80],"type":"max/plantarium/gravity","props":{"strength":0.38,"scale":39,"fixBottom":0,"directionalStrength":[1,1,1],"depth":1,"curviness":1}},{"id":15,"position":[120,80],"type":"max/plantarium/noise","props":{"strength":4.9,"scale":2.2,"fixBottom":1,"directionalStrength":[1,1,1],"depth":1,"octaves":1}},{"id":16,"position":[70,80],"type":"max/plantarium/vec3","props":{"0":0,"1":0,"2":0}},{"id":17,"position":[45,80],"type":"max/plantarium/random","props":{"min":-2,"max":2}},{"id":18,"position":[170,80],"type":"max/plantarium/branch","props":{"length":1.6,"thickness":0.69,"amount":36,"offsetSingle":0.5,"lowestBranch":0.46,"highestBranch":1,"depth":1,"rotation":180}},{"id":19,"position":[145,80],"type":"max/plantarium/gravity","props":{"strength":0.38,"scale":39,"fixBottom":0,"directionalStrength":[1,1,1],"depth":1,"curviness":1}},{"id":20,"position":[70,120],"type":"max/plantarium/random","props":{"min":0.073,"max":0.15}}],"edges":[[14,0,9,"input"],[10,0,15,"plant"],[16,0,10,"origin"],[17,0,16,"0"],[17,0,16,"2"],[18,0,14,"plant"],[15,0,19,"plant"],[19,0,18,"plant"],[20,0,10,"thickness"]]}
|
||||
{
|
||||
"settings": { "resolution.circle": 26, "resolution.curve": 39 },
|
||||
"nodes": [
|
||||
{ "id": 9, "position": [220, 80], "type": "max/plantarium/output", "props": {} },
|
||||
{
|
||||
"id": 10,
|
||||
"position": [95, 80],
|
||||
"type": "max/plantarium/stem",
|
||||
"props": { "amount": 5, "length": 11, "thickness": 0.1 }
|
||||
},
|
||||
{
|
||||
"id": 14,
|
||||
"position": [195, 80],
|
||||
"type": "max/plantarium/gravity",
|
||||
"props": {
|
||||
"strength": 0.38,
|
||||
"scale": 39,
|
||||
"fixBottom": 0,
|
||||
"directionalStrength": [1, 1, 1],
|
||||
"depth": 1,
|
||||
"curviness": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 15,
|
||||
"position": [120, 80],
|
||||
"type": "max/plantarium/noise",
|
||||
"props": {
|
||||
"strength": 4.9,
|
||||
"scale": 2.2,
|
||||
"fixBottom": 1,
|
||||
"directionalStrength": [1, 1, 1],
|
||||
"depth": 1,
|
||||
"octaves": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 16,
|
||||
"position": [70, 80],
|
||||
"type": "max/plantarium/vec3",
|
||||
"props": { "0": 0, "1": 0, "2": 0 }
|
||||
},
|
||||
{
|
||||
"id": 17,
|
||||
"position": [45, 80],
|
||||
"type": "max/plantarium/random",
|
||||
"props": { "min": -2, "max": 2 }
|
||||
},
|
||||
{
|
||||
"id": 18,
|
||||
"position": [170, 80],
|
||||
"type": "max/plantarium/branch",
|
||||
"props": {
|
||||
"length": 1.6,
|
||||
"thickness": 0.69,
|
||||
"amount": 36,
|
||||
"offsetSingle": 0.5,
|
||||
"lowestBranch": 0.46,
|
||||
"highestBranch": 1,
|
||||
"depth": 1,
|
||||
"rotation": 180
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 19,
|
||||
"position": [145, 80],
|
||||
"type": "max/plantarium/gravity",
|
||||
"props": {
|
||||
"strength": 0.38,
|
||||
"scale": 39,
|
||||
"fixBottom": 0,
|
||||
"directionalStrength": [1, 1, 1],
|
||||
"depth": 1,
|
||||
"curviness": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 20,
|
||||
"position": [70, 120],
|
||||
"type": "max/plantarium/random",
|
||||
"props": { "min": 0.073, "max": 0.15 }
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
[14, 0, 9, "input"],
|
||||
[10, 0, 15, "plant"],
|
||||
[16, 0, 10, "origin"],
|
||||
[17, 0, 16, "0"],
|
||||
[17, 0, 16, "2"],
|
||||
[18, 0, 14, "plant"],
|
||||
[15, 0, 19, "plant"],
|
||||
[19, 0, 18, "plant"],
|
||||
[20, 0, 10, "thickness"]
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import type { Graph } from "@nodarium/types";
|
||||
import type { Graph } from '@nodarium/types';
|
||||
|
||||
export function grid(width: number, height: number) {
|
||||
|
||||
const graph: Graph = {
|
||||
id: Math.floor(Math.random() * 100000),
|
||||
edges: [],
|
||||
nodes: [],
|
||||
nodes: []
|
||||
};
|
||||
|
||||
const amount = width * height;
|
||||
@@ -18,19 +17,18 @@ export function grid(width: number, height: number) {
|
||||
id: i,
|
||||
position: [x * 30, y * 40],
|
||||
props: i == 0 ? { value: 0 } : { op_type: 0, a: 1, b: 0.05 },
|
||||
type: i == 0 ? "max/plantarium/float" : "max/plantarium/math",
|
||||
type: i == 0 ? 'max/plantarium/float' : 'max/plantarium/math'
|
||||
});
|
||||
|
||||
graph.edges.push([i, 0, i + 1, i === amount - 1 ? "input" : "a",]);
|
||||
graph.edges.push([i, 0, i + 1, i === amount - 1 ? 'input' : 'a']);
|
||||
}
|
||||
|
||||
graph.nodes.push({
|
||||
id: amount,
|
||||
position: [width * 30, (height - 1) * 40],
|
||||
type: "max/plantarium/output",
|
||||
props: {},
|
||||
type: 'max/plantarium/output',
|
||||
props: {}
|
||||
});
|
||||
|
||||
return graph;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
export { grid } from "./grid";
|
||||
export { tree } from "./tree";
|
||||
export { plant } from "./plant";
|
||||
export { default as lottaFaces } from "./lotta-faces.json";
|
||||
export { default as lottaNodes } from "./lotta-nodes.json";
|
||||
export { default as defaultPlant } from "./default.json"
|
||||
export { default as lottaNodesAndFaces } from "./lotta-nodes-and-faces.json";
|
||||
|
||||
export { default as defaultPlant } from './default.json';
|
||||
export { grid } from './grid';
|
||||
export { default as lottaFaces } from './lotta-faces.json';
|
||||
export { default as lottaNodesAndFaces } from './lotta-nodes-and-faces.json';
|
||||
export { default as lottaNodes } from './lotta-nodes.json';
|
||||
export { plant } from './plant';
|
||||
export { tree } from './tree';
|
||||
|
||||
@@ -1 +1,44 @@
|
||||
{"settings":{"resolution.circle":64,"resolution.curve":64,"randomSeed":false},"nodes":[{"id":9,"position":[260,0],"type":"max/plantarium/output","props":{}},{"id":18,"position":[185,0],"type":"max/plantarium/stem","props":{"amount":64,"length":12,"thickness":0.15}},{"id":19,"position":[210,0],"type":"max/plantarium/noise","props":{"scale":1.3,"strength":5.4}},{"id":20,"position":[235,0],"type":"max/plantarium/branch","props":{"length":0.8,"thickness":0.8,"amount":3}},{"id":21,"position":[160,0],"type":"max/plantarium/vec3","props":{"0":0.39,"1":0,"2":0.41}},{"id":22,"position":[130,0],"type":"max/plantarium/random","props":{"min":-2,"max":2}}],"edges":[[18,0,19,"plant"],[19,0,20,"plant"],[20,0,9,"input"],[21,0,18,"origin"],[22,0,21,"0"],[22,0,21,"2"]]}
|
||||
{
|
||||
"settings": { "resolution.circle": 64, "resolution.curve": 64, "randomSeed": false },
|
||||
"nodes": [
|
||||
{ "id": 9, "position": [260, 0], "type": "max/plantarium/output", "props": {} },
|
||||
{
|
||||
"id": 18,
|
||||
"position": [185, 0],
|
||||
"type": "max/plantarium/stem",
|
||||
"props": { "amount": 64, "length": 12, "thickness": 0.15 }
|
||||
},
|
||||
{
|
||||
"id": 19,
|
||||
"position": [210, 0],
|
||||
"type": "max/plantarium/noise",
|
||||
"props": { "scale": 1.3, "strength": 5.4 }
|
||||
},
|
||||
{
|
||||
"id": 20,
|
||||
"position": [235, 0],
|
||||
"type": "max/plantarium/branch",
|
||||
"props": { "length": 0.8, "thickness": 0.8, "amount": 3 }
|
||||
},
|
||||
{
|
||||
"id": 21,
|
||||
"position": [160, 0],
|
||||
"type": "max/plantarium/vec3",
|
||||
"props": { "0": 0.39, "1": 0, "2": 0.41 }
|
||||
},
|
||||
{
|
||||
"id": 22,
|
||||
"position": [130, 0],
|
||||
"type": "max/plantarium/random",
|
||||
"props": { "min": -2, "max": 2 }
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
[18, 0, 19, "plant"],
|
||||
[19, 0, 20, "plant"],
|
||||
[20, 0, 9, "input"],
|
||||
[21, 0, 18, "origin"],
|
||||
[22, 0, 21, "0"],
|
||||
[22, 0, 21, "2"]
|
||||
]
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,12 +1,71 @@
|
||||
export const plant = {
|
||||
"settings": { "resolution.circle": 26, "resolution.curve": 39 },
|
||||
"nodes": [
|
||||
{ "id": 9, "position": [180, 80], "type": "max/plantarium/output", "props": {} },
|
||||
{ "id": 10, "position": [55, 80], "type": "max/plantarium/stem", "props": { "amount": 1, "length": 11, "thickness": 0.71 } },
|
||||
{ "id": 11, "position": [80, 80], "type": "max/plantarium/noise", "props": { "strength": 35, "scale": 4.6, "fixBottom": 1, "directionalStrength": [1, 0.74, 0.083], "depth": 1 } },
|
||||
{ "id": 12, "position": [105, 80], "type": "max/plantarium/branch", "props": { "length": 3, "thickness": 0.6, "amount": 10, "rotation": 180, "offsetSingle": 0.34, "lowestBranch": 0.53, "highestBranch": 1, "depth": 1 } },
|
||||
{ "id": 13, "position": [130, 80], "type": "max/plantarium/noise", "props": { "strength": 8, "scale": 7.7, "fixBottom": 1, "directionalStrength": [1, 0, 1], "depth": 1 } },
|
||||
{ "id": 14, "position": [155, 80], "type": "max/plantarium/gravity", "props": { "strength": 0.11, "scale": 39, "fixBottom": 0, "directionalStrength": [1, 1, 1], "depth": 1, "curviness": 1 } }
|
||||
'settings': { 'resolution.circle': 26, 'resolution.curve': 39 },
|
||||
'nodes': [
|
||||
{ 'id': 9, 'position': [180, 80], 'type': 'max/plantarium/output', 'props': {} },
|
||||
{
|
||||
'id': 10,
|
||||
'position': [55, 80],
|
||||
'type': 'max/plantarium/stem',
|
||||
'props': { 'amount': 1, 'length': 11, 'thickness': 0.71 }
|
||||
},
|
||||
{
|
||||
'id': 11,
|
||||
'position': [80, 80],
|
||||
'type': 'max/plantarium/noise',
|
||||
'props': {
|
||||
'strength': 35,
|
||||
'scale': 4.6,
|
||||
'fixBottom': 1,
|
||||
'directionalStrength': [1, 0.74, 0.083],
|
||||
'depth': 1
|
||||
}
|
||||
},
|
||||
{
|
||||
'id': 12,
|
||||
'position': [105, 80],
|
||||
'type': 'max/plantarium/branch',
|
||||
'props': {
|
||||
'length': 3,
|
||||
'thickness': 0.6,
|
||||
'amount': 10,
|
||||
'rotation': 180,
|
||||
'offsetSingle': 0.34,
|
||||
'lowestBranch': 0.53,
|
||||
'highestBranch': 1,
|
||||
'depth': 1
|
||||
}
|
||||
},
|
||||
{
|
||||
'id': 13,
|
||||
'position': [130, 80],
|
||||
'type': 'max/plantarium/noise',
|
||||
'props': {
|
||||
'strength': 8,
|
||||
'scale': 7.7,
|
||||
'fixBottom': 1,
|
||||
'directionalStrength': [1, 0, 1],
|
||||
'depth': 1
|
||||
}
|
||||
},
|
||||
{
|
||||
'id': 14,
|
||||
'position': [155, 80],
|
||||
'type': 'max/plantarium/gravity',
|
||||
'props': {
|
||||
'strength': 0.11,
|
||||
'scale': 39,
|
||||
'fixBottom': 0,
|
||||
'directionalStrength': [1, 1, 1],
|
||||
'depth': 1,
|
||||
'curviness': 1
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [[10, 0, 11, "plant"], [11, 0, 12, "plant"], [12, 0, 13, "plant"], [13, 0, 14, "plant"], [14, 0, 9, "input"]]
|
||||
}
|
||||
'edges': [
|
||||
[10, 0, 11, 'plant'],
|
||||
[11, 0, 12, 'plant'],
|
||||
[12, 0, 13, 'plant'],
|
||||
[13, 0, 14, 'plant'],
|
||||
[14, 0, 9, 'input']
|
||||
]
|
||||
};
|
||||
|
||||
@@ -1,28 +1,26 @@
|
||||
import type { Graph, SerializedNode } from "@nodarium/types";
|
||||
import type { Graph, SerializedNode } from '@nodarium/types';
|
||||
|
||||
export function tree(depth: number): Graph {
|
||||
|
||||
const nodes: SerializedNode[] = [
|
||||
{
|
||||
id: 0,
|
||||
type: "max/plantarium/output",
|
||||
type: 'max/plantarium/output',
|
||||
position: [0, 0]
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
type: "max/plantarium/math",
|
||||
type: 'max/plantarium/math',
|
||||
position: [-40, -10]
|
||||
}
|
||||
]
|
||||
];
|
||||
|
||||
const edges: [number, number, number, string][] = [
|
||||
[1, 0, 0, "input"]
|
||||
[1, 0, 0, 'input']
|
||||
];
|
||||
|
||||
for (let d = 0; d < depth; d++) {
|
||||
const amount = Math.pow(2, d);
|
||||
for (let i = 0; i < amount; i++) {
|
||||
|
||||
const id0 = amount * 2 + i * 2;
|
||||
const id1 = amount * 2 + i * 2 + 1;
|
||||
|
||||
@@ -33,24 +31,22 @@ export function tree(depth: number): Graph {
|
||||
|
||||
nodes.push({
|
||||
id: id0,
|
||||
type: "max/plantarium/math",
|
||||
position: [x, y],
|
||||
type: 'max/plantarium/math',
|
||||
position: [x, y]
|
||||
});
|
||||
edges.push([id0, 0, parent, "a"]);
|
||||
edges.push([id0, 0, parent, 'a']);
|
||||
nodes.push({
|
||||
id: id1,
|
||||
type: "max/plantarium/math",
|
||||
position: [x, y + 35],
|
||||
type: 'max/plantarium/math',
|
||||
position: [x, y + 35]
|
||||
});
|
||||
edges.push([id1, 0, parent, "b"]);
|
||||
edges.push([id1, 0, parent, 'b']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
id: Math.floor(Math.random() * 100000),
|
||||
nodes,
|
||||
edges
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user