Skip to content

Commit

Permalink
updating nodes widget
Browse files Browse the repository at this point in the history
  • Loading branch information
nicobako committed Oct 27, 2024
1 parent f72a9d6 commit ad73fe4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions node-parents-children/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function initGrist() {
{
title: "Data",
name: "data",
description: "Column with the data, a dictionary with {name:str, children: list[dict[name, id]], parents: list[dict[name, id]]}."
description: "Column with the data, a dictionary with {children: list[dict[title, id]], parents: list[dict[title, id]]}."
}
],
allowSelectBy: true,
Expand All @@ -41,16 +41,17 @@ function initGrist() {
}

function renderPage(mapped) {
console.log("rendering page", "mapped", mapped);
const node = parseNode(mapped);
const nodeElement = document.getElementById("node");
renderList(nodeElement, [node])

const parents = mapped.parents.map((parent=>parseNode(parent)))
const parents = mapped.data.parents.map((parent=>parseNode(parent)))
const parentsElement = document.getElementById("parents");
renderList(parentsElement, parents);


const children = mapped.children.map((child=>parseNode(child)));
const children = mapped.data.children.map((child=>parseNode(child)));
const childrenElement = document.getElementById("children");
renderList(childrenElement, children);
}
Expand Down

0 comments on commit ad73fe4

Please sign in to comment.