You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vartext0=['forty','two','thirty-eight','one and a half','two and a half','thirty-four','one','two','three','twenty-eight','one and twenty-five hundredths','one and seventy-five hundredths','two and twenty-five hundredths','two and seventy-five hundredths','twenty','one','one and a half','two','two and a half','three','ten','one','one and a half','two','two and a half','three'];
639
+
640
+
afterEach(destroyGraphDiv);
641
+
642
+
functionrun(spec){
643
+
gd=createGraphDiv();
644
+
645
+
vardata=(spec.traces||[{}]).map(function(t){
646
+
t.type='treemap';
647
+
t.text=text0;
648
+
t.values=values0;
649
+
t.level=spec.level;
650
+
t.branchvalues='total';
651
+
t.hovertemplate='path = %{currentPath}<br>label = %{label}<br>text = %{text}<br>value = %{value}<br>ratio to %{parent} = %{percentParent}<br>ratio to %{entry} = %{percentEntry}<br>ratio to %{root} = %{percentRoot}';
nums: 'path = Alpha/Charlie/Foxtrot/Juliet/Oscar/Uniform/\nlabel = X ray\ntext = two\nvalue = 2\nratio to Uniform = 0.2\nratio to X ray = 1\nratio to Alpha = 0.05',
694
+
},
695
+
ptData: {
696
+
curveNumber: 0,
697
+
pointNumber: 23,
698
+
label: 'X ray',
699
+
parent: 'Uniform'
700
+
}
701
+
}
702
+
},{
703
+
desc: 'entry',
704
+
level: 'Oscar',
705
+
pos: 0,
706
+
exp: {
707
+
label: {
708
+
name: 'trace 0',
709
+
nums: 'path = Alpha/Charlie/Foxtrot/Juliet/\nlabel = Oscar\ntext = twenty\nvalue = 20\nratio to Juliet = 0.7142857142857143\nratio to Oscar = 1\nratio to Alpha = 0.5',
710
+
},
711
+
ptData: {
712
+
curveNumber: 0,
713
+
pointNumber: 14,
714
+
label: 'Oscar',
715
+
parent: 'Juliet'
716
+
}
717
+
}
718
+
},{
719
+
desc: 'leaf',
720
+
level: 'Oscar',
721
+
pos: 10,
722
+
exp: {
723
+
label: {
724
+
name: 'trace 0',
725
+
nums: 'path = Alpha/Charlie/Foxtrot/Juliet/Oscar/Uniform/\nlabel = X ray\ntext = two\nvalue = 2\nratio to Uniform = 0.2\nratio to Oscar = 0.1\nratio to Alpha = 0.05',
726
+
},
727
+
ptData: {
728
+
curveNumber: 0,
729
+
pointNumber: 23,
730
+
label: 'X ray',
731
+
parent: 'Uniform'
732
+
}
733
+
}
734
+
},{
735
+
desc: 'entry',
736
+
level: undefined,// root
737
+
pos: 0,
738
+
exp: {
739
+
label: {
740
+
name: 'trace 0',
741
+
nums: 'path = /\nlabel = Alpha\ntext = forty\nvalue = 40\nratio to = 1\nratio to Alpha = 1\nratio to Alpha = 1',
742
+
},
743
+
ptData: {
744
+
curveNumber: 0,
745
+
pointNumber: 0,
746
+
label: 'Alpha',
747
+
parent: ''
748
+
}
749
+
}
750
+
},{
751
+
desc: 'leaf',
752
+
level: undefined,// root
753
+
pos: 10,
754
+
exp: {
755
+
label: {
756
+
name: 'trace 0',
757
+
nums: 'path = Alpha/Charlie/Foxtrot/\nlabel = Golf\ntext = one\nvalue = 1\nratio to Foxtrot = 0.029411764705882353\nratio to Alpha = 0.025\nratio to Alpha = 0.025',
758
+
},
759
+
ptData: {
760
+
curveNumber: 0,
761
+
pointNumber: 6,
762
+
label: 'Golf',
763
+
parent: 'Foxtrot'
764
+
}
765
+
}
766
+
}]
767
+
.forEach(function(spec){
768
+
it('should generate correct hover labels and event data - '+spec.desc+' with level:'+spec.level,function(done){
0 commit comments