Hi, everyone! I hope you’re fine! I’m trying to create organisation structure Tree chart diagram.
At first looks very simple:
- Use “apexcharts” library.
- Create an HTML
- Inject JSON data to HTML body.
- Use Glide HTML to URL column to create a link
- Show link in Glide Web Embed component.
Main difficulty for me is to craft an JSON data, because “apexcharts” require each child component must include they Children. This one became to loop dependency error in Glide. I can solve it by creating independent computed column for each layers, but how to craft JSON without independent computed column for each layer(i mean infinity layers). Yes it can be solved in a flow of data creating(on every data inputs - is to run update), but if data already there, how i can do it?
My basically data structure is:
Staff Table:
Staff_id, Staff_Name
Parent to children table:
ParentStaff_id, ChildrenStaff_id
Sample JSON:
{
id: 'ms',
data: {
imageURL: 'https://i.pravatar.cc/300?img=68',
name: 'Margret Swanson',
},
options: {
nodeBGColor: '#cdb4db',
nodeBGColorHover: '#cdb4db',
},
children: [
{
id: 'mh',
data: {
imageURL: 'https://i.pravatar.cc/300?img=69',
name: 'Mark Hudson',
},
options: {
nodeBGColor: '#ffafcc',
nodeBGColorHover: '#ffafcc',
},
children: [
{
id: 'kb',
data: {
imageURL: 'https://i.pravatar.cc/300?img=65',
name: 'Karyn Borbas',
},
options: {
nodeBGColor: '#f8ad9d',
nodeBGColorHover: '#f8ad9d',
},
},
{
id: 'cr',
data: {
imageURL: 'https://i.pravatar.cc/300?img=60',
name: 'Chris Rup',
},
options: {
nodeBGColor: '#c9cba3',
nodeBGColorHover: '#c9cba3',
},
},
],
},
{
id: 'cs',
data: {
imageURL: 'https://i.pravatar.cc/300?img=59',
name: 'Chris Lysek',
},
options: {
nodeBGColor: '#00afb9',
nodeBGColorHover: '#00afb9',
},
children: [
{
id: 'Noah_Chandler',
data: {
imageURL: 'https://i.pravatar.cc/300?img=57',
name: 'Noah Chandler',
},
options: {
nodeBGColor: '#84a59d',
nodeBGColorHover: '#84a59d',
},
},
{
id: 'Felix_Wagner',
data: {
imageURL: 'https://i.pravatar.cc/300?img=52',
name: 'Felix Wagner',
},
options: {
nodeBGColor: '#0081a7',
nodeBGColorHover: '#0081a7',
},
},
],
},
],
}
May be it is very simple to solve but I stupid there for now.
Thanks for any suggestions!