I am building some tools to help me visualize fitting of generic n-dimensional nonlinear model. I have the data and results stored in a nested association. I've written a few functions to generate a Tree[] that provides a high level view of the structure.
The edge labels are unfortunately overlapping, as you can see. My desire is to rotate the labels to lay (lie?) parallel to their edges. I have been trying to understand the behavior of ParentEdgeLabel but i cannot make sense of it, even the use of Placed[].
If possible, how do I rotate labels in a Tree[]
for reference, here is the code i used to generate this smaller example tree (Using 14.0, fresh kernel, I tried on 13.0 but some of the options for Tree[] are newer i spose)
burnLeaves[l_List|l_Association]:=If[AllTrue[l,Not[ListQ[#]]&],{},Map[burnLeaves,l]]; burnLeaves[x_]:=Nothing; emptyLeaves[list_List|list_Association]:=Map[emptyLeaves,list]; emptyLeaves[tree_Tree]:=tree; emptyLeaves[_]={}; linearIndicize[list_]:=Block[{n},n=1;Map[n++&,burnLeaves[list],{-2}]] applyToNestedAssociation[f_,expr_]:=Module[{sortedPosfa,inner,out},sortedPosa=SortBy[Position[expr,_Association],-Length[#]&]; inner=FoldList[ReplacePart[#1,#2->f[Extract[#1,#2]]]&,expr,sortedPosa];If[AssociationQ[expr],out=f[Last@inner],out=inner]; out] treeAssociation[assoc_]:=Module[{treemaker,viewer,out},treemaker[assc_]:=Tree[assc,TreeLayout->"RadialEmbedding",PlotRangePadding->0]; viewer[asc_]:=Module[{step1,step21,step31,innerout},If[LeafCount[asc]<100,Return[treemaker[asc]],step1=emptyLeaves[asc];]; If[LeafCount[step1]<100,Return[treemaker[step1]],step2=linearIndicize[step1];]; step3=Dimensions/@step2; innerout=treemaker[step3]; innerout]; out=Tree[applyToNestedAssociation[viewer,assoc],TreeElementLabel->"Root"]; out] Tree[<|"keyA"->{b1,b2,b3,b4},"keyB"->{1,2,3},"keyC"-><|"keyC1"->"C1","keyC2"->"C2"|>|>] 


