pivot-editor/index.html

48 lines
1008 B
HTML
Raw Normal View History

2021-05-11 06:26:18 -04:00
2021-05-29 11:20:11 -04:00
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="N.js"></script>
<script src="Pivot.js"></script>
</head>
<body>
<script>
2021-05-29 11:33:14 -04:00
let root = N.Create("root");
let recurse = (node, depth) =>
{
// create a set of new nodes off of the input node
let c1 = N.Create(node.Meta+"-1");
let c2 = N.Create(node.Meta+"-2");
N.Connect(node, c1, "parent");
N.Connect(node, c2, "parent");
var iterator;
if(depth < 3)
{
// loop over the new nodes and keep recursing
iterator = (child) =>
{
recurse(child, depth+1);
};
}
else
{
// walk up
iterator = () =>
{
};
}
N.Walk(iterator, node, "parent", true);
}
recurse(root, 0);
2021-05-29 11:20:11 -04:00
</script>
2021-05-29 11:33:14 -04:00
2021-05-29 11:20:11 -04:00
</body>
2021-05-28 19:11:15 -04:00
2021-05-29 11:20:11 -04:00
</html>