{
const mytree = new hyt.Hypertree(
{ parent: view },
{
dataloader: ok=> ok(data),
dataInitBFS: (ht, n)=> {
if (n.mergeId == 1)
n.precalc.imageHref =
'https://upload.wikimedia.org/wikipedia/commons/e/e9/6_df.png'
},
langInitBFS: (ht, n)=> {
n.precalc.label = `${n.data.name}`
if (iconmap[n.data.name] && showicons)
n.precalc.icon = iconmap[n.data.name]
},
layout: {
rootWedge: {
orientation: 0,
angle: Math.PI*1.99999
}
},
filter: {
maxlabels: 15,
},
geometry: {
layerOptions: {
'stem-arc': { invisible: true, hideOnDrag: true },
symbols: { invisible:true, hideOnDrag:true },
cells: { invisible:true, hideOnDrag:true },
λ: { invisible:true, hideOnDrag:true },
labels: { invisible:true, hideOnDrag:false, background: n=> true },
'labels-force': { invisible:false, hideOnDrag:true, background: n=> true },
images: { width: .05, height: .05 },
nodes: {
fill: n=> n.precalc.imageHref ? 'white' : undefined,
strokeWidth: n=> n.parent ? .1 : .001,
stroke: n=> {
if (n.hasOutChildren) return '#ff000010'
if (!n.parent) return '#999'
return '#a5d6a710'
},
},
},
nodeFilter: n=> n.precalc.imageHref || n.hasOutChildren || !n.children,
nodeRadius: (ud, n) => n.parent ? .025 : .05,
},
interaction: {
λbounds: [.25, .65],
onNodeClick: (n, m, l)=> {
mytree.api.goto({ re:-n.layout.z.re, im:-n.layout.z.im }, null)
.then(()=> l.view.hypertree.drawDetailFrame())
},
}
}
)
return mytree
}