@@ -692,12 +692,12 @@ def test_unequal_z_text_size(self):
692
692
693
693
# check: PlotlyError if z and text are not the same dimmensions
694
694
695
- kwargs = {'z' : [[1 , 2 ], [1 , 2 ]], 'text ' : [[1 , 2 , 3 ], [1 , 2 ]]}
695
+ kwargs = {'z' : [[1 , 2 ], [1 , 2 ]], 'annotation_text ' : [[1 , 2 , 3 ], [1 ]]}
696
696
self .assertRaises (PlotlyError ,
697
697
tls .FigureFactory .create_annotated_heatmap ,
698
698
** kwargs )
699
699
700
- kwargs = {'z' : [[1 , 2 ], [1 , 2 ]], 'text ' : [[1 , 2 ], [1 , 2 ], [1 , 2 ]]}
700
+ kwargs = {'z' : [[1 ], [1 ]], 'annotation_text ' : [[1 ], [1 ], [1 ]]}
701
701
self .assertRaises (PlotlyError ,
702
702
tls .FigureFactory .create_annotated_heatmap ,
703
703
** kwargs )
@@ -710,45 +710,46 @@ def test_simple_annotated_heatmap(self):
710
710
z = [[1 , 0 , .5 ], [.25 , .75 , .45 ]]
711
711
a_heat = tls .FigureFactory .create_annotated_heatmap (z )
712
712
expected_a_heat = {
713
- 'data' : [{'showscale' : False ,
713
+ 'data' : [{'colorscale' : None ,
714
+ 'showscale' : False ,
714
715
'type' : 'heatmap' ,
715
716
'z' : [[1 , 0 , 0.5 ], [0.25 , 0.75 , 0.45 ]]}],
716
- 'layout' : {'annotations' : [{'font' : {'color' : '#000000 ' },
717
+ 'layout' : {'annotations' : [{'font' : {'color' : '#FFFFFF ' },
717
718
'showarrow' : False ,
718
719
'text' : '1' ,
719
720
'x' : 0 ,
720
721
'xref' : 'x1' ,
721
722
'y' : 0 ,
722
723
'yref' : 'y1' },
723
- {'font' : {'color' : '#FFFFFF ' },
724
+ {'font' : {'color' : '#000000 ' },
724
725
'showarrow' : False ,
725
726
'text' : '0' ,
726
727
'x' : 1 ,
727
728
'xref' : 'x1' ,
728
729
'y' : 0 ,
729
730
'yref' : 'y1' },
730
- {'font' : {'color' : '#000000 ' },
731
+ {'font' : {'color' : '#FFFFFF ' },
731
732
'showarrow' : False ,
732
733
'text' : '0.5' ,
733
734
'x' : 2 ,
734
735
'xref' : 'x1' ,
735
736
'y' : 0 ,
736
737
'yref' : 'y1' },
737
- {'font' : {'color' : '#FFFFFF ' },
738
+ {'font' : {'color' : '#000000 ' },
738
739
'showarrow' : False ,
739
740
'text' : '0.25' ,
740
741
'x' : 0 ,
741
742
'xref' : 'x1' ,
742
743
'y' : 1 ,
743
744
'yref' : 'y1' },
744
- {'font' : {'color' : '#000000 ' },
745
+ {'font' : {'color' : '#FFFFFF ' },
745
746
'showarrow' : False ,
746
747
'text' : '0.75' ,
747
748
'x' : 1 ,
748
749
'xref' : 'x1' ,
749
750
'y' : 1 ,
750
751
'yref' : 'y1' },
751
- {'font' : {'color' : '#000000 ' },
752
+ {'font' : {'color' : '#FFFFFF ' },
752
753
'showarrow' : False ,
753
754
'text' : '0.45' ,
754
755
'x' : 2 ,
@@ -774,63 +775,62 @@ def test_more_kwargs(self):
774
775
x = ['A' , 'B' ],
775
776
y = ['One' , 'Two' ,
776
777
'Three' ],
777
- text = text ,
778
+ annotation_text = text ,
778
779
colorscale = [[0 ,
779
780
'#ffffff' ],
780
781
[1 ,
781
782
'#e6005a' ]]
782
783
)
783
784
expected_a = {'data' : [{'colorscale' : [[0 , '#ffffff' ], [1 , '#e6005a' ]],
784
- 'showscale' : False ,
785
- 'type' : 'heatmap' ,
786
- 'x' : ['A' , 'B' ],
787
- 'y' : ['One' , 'Two' , 'Three' ],
788
- 'z' : [[1 , 0 ], [0.25 , 0.75 ], [0.45 , 0.5 ]]}],
789
- 'layout' : {'annotations' : [{'font' : {'color' : '#FFFFFF' },
790
- 'showarrow' : False ,
791
- 'text' : 'first' ,
792
- 'x' : 'A' ,
793
- 'xref' : 'x1' ,
794
- 'y' : 'One' ,
795
- 'yref' : 'y1' },
796
- {'font' : {'color' : '#000000' },
797
- 'showarrow' : False ,
798
- 'text' : 'second' ,
799
- 'x' : 'B' ,
800
- 'xref' : 'x1' ,
801
- 'y' : 'One' ,
802
- 'yref' : 'y1' },
803
- {'font' : {'color' : '#000000' },
804
- 'showarrow' : False ,
805
- 'text' : 'third' ,
806
- 'x' : 'A' ,
807
- 'xref' : 'x1' ,
808
- 'y' : 'Two' ,
809
- 'yref' : 'y1' },
810
- {'font' : {'color' : '#FFFFFF' },
811
- 'showarrow' : False ,
812
- 'text' : 'fourth' ,
813
- 'x' : 'B' ,
814
- 'xref' : 'x1' ,
815
- 'y' : 'Two' ,
816
- 'yref' : 'y1' },
817
- {'font' : {'color' : '#FFFFFF' },
818
- 'showarrow' : False ,
819
- 'text' : 'fifth' ,
820
- 'x' : 'A' ,
821
- 'xref' : 'x1' ,
822
- 'y' : 'Three' ,
823
- 'yref' : 'y1' },
824
- {'font' : {'color' : '#FFFFFF' },
825
- 'showarrow' : False ,
826
- 'text' : 'sixth' ,
827
- 'x' : 'B' ,
828
- 'xref' : 'x1' ,
829
- 'y' : 'Three' ,
830
- 'yref' : 'y1' }],
831
- 'xaxis' : {'gridcolor' : 'rgb(0, 0, 0)' ,
832
- 'side' : 'top' , 'ticks' : '' },
833
- 'yaxis' : {'ticks' : '' , 'ticksuffix' : ' ' }}}
785
+ 'showscale' : False ,
786
+ 'type' : 'heatmap' ,
787
+ 'x' : ['A' , 'B' ],
788
+ 'y' : ['One' , 'Two' , 'Three' ],
789
+ 'z' : [[1 , 0 ], [0.25 , 0.75 ], [0.45 , 0.5 ]]}],
790
+ 'layout' : {'annotations' : [{'font' : {'color' : '#FFFFFF' },
791
+ 'showarrow' : False ,
792
+ 'text' : 'first' ,
793
+ 'x' : 'A' ,
794
+ 'xref' : 'x1' ,
795
+ 'y' : 'One' ,
796
+ 'yref' : 'y1' },
797
+ {'font' : {'color' : '#000000' },
798
+ 'showarrow' : False ,
799
+ 'text' : 'second' ,
800
+ 'x' : 'B' ,
801
+ 'xref' : 'x1' ,
802
+ 'y' : 'One' ,
803
+ 'yref' : 'y1' },
804
+ {'font' : {'color' : '#000000' },
805
+ 'showarrow' : False ,
806
+ 'text' : 'third' ,
807
+ 'x' : 'A' ,
808
+ 'xref' : 'x1' ,
809
+ 'y' : 'Two' ,
810
+ 'yref' : 'y1' },
811
+ {'font' : {'color' : '#FFFFFF' },
812
+ 'showarrow' : False ,
813
+ 'text' : 'fourth' ,
814
+ 'x' : 'B' ,
815
+ 'xref' : 'x1' ,
816
+ 'y' : 'Two' ,
817
+ 'yref' : 'y1' },
818
+ {'font' : {'color' : '#FFFFFF' },
819
+ 'showarrow' : False ,
820
+ 'text' : 'fifth' ,
821
+ 'x' : 'A' ,
822
+ 'xref' : 'x1' ,
823
+ 'y' : 'Three' ,
824
+ 'yref' : 'y1' },
825
+ {'font' : {'color' : '#FFFFFF' },
826
+ 'showarrow' : False ,
827
+ 'text' : 'sixth' ,
828
+ 'x' : 'B' ,
829
+ 'xref' : 'x1' ,
830
+ 'y' : 'Three' ,
831
+ 'yref' : 'y1' }],
832
+ 'xaxis' : {'gridcolor' : 'rgb(0, 0, 0)' , 'side' : 'top' , 'ticks' : '' },
833
+ 'yaxis' : {'ticks' : '' , 'ticksuffix' : ' ' }}}
834
834
self .assertEqual (a , expected_a )
835
835
836
836
@@ -840,12 +840,12 @@ def test_fontcolor_input(self):
840
840
841
841
# check: PlotlyError if fontcolor input is incorrect
842
842
843
- kwargs = {'text ' : [['one' , 'two' ], [1 , 2 ], [1 , 2 ], [1 , 2 ]],
843
+ kwargs = {'table_text ' : [['one' , 'two' ], [1 , 2 ], [1 , 2 ], [1 , 2 ]],
844
844
'fontcolor' : '#000000' }
845
845
self .assertRaises (PlotlyError ,
846
846
tls .FigureFactory .create_table , ** kwargs )
847
847
848
- kwargs = {'text ' : [['one' , 'two' ], [1 , 2 ], [1 , 2 ], [1 , 2 ]],
848
+ kwargs = {'table_text ' : [['one' , 'two' ], [1 , 2 ], [1 , 2 ], [1 , 2 ]],
849
849
'fontcolor' : ['red' , 'blue' ]}
850
850
self .assertRaises (PlotlyError ,
851
851
tls .FigureFactory .create_table , ** kwargs )
0 commit comments