@@ -2927,6 +2927,14 @@ mod tests {
2927
2927
2928
2928
#[ test]
2929
2929
fn test_serialize_layout_template ( ) {
2930
+
2931
+ let mut xaxis: Vec < Option < Box < Axis > > > = Vec :: new ( ) ;
2932
+ let mut yaxis: Vec < Option < Box < Axis > > > = Vec :: new ( ) ;
2933
+ for _ in 0 ..8 {
2934
+ xaxis. push ( Some ( Box :: new ( Axis :: new ( ) ) ) ) ;
2935
+ yaxis. push ( Some ( Box :: new ( Axis :: new ( ) ) ) ) ;
2936
+ }
2937
+
2930
2938
let layout_template = LayoutTemplate :: new ( )
2931
2939
. title ( "Title" )
2932
2940
. show_legend ( false )
@@ -2953,22 +2961,8 @@ mod tests {
2953
2961
. hover_label ( Label :: new ( ) )
2954
2962
. grid ( LayoutGrid :: new ( ) )
2955
2963
. calendar ( Calendar :: Jalali )
2956
- . x_axis ( Axis :: new ( ) )
2957
- . x_axis2 ( Axis :: new ( ) )
2958
- . x_axis3 ( Axis :: new ( ) )
2959
- . x_axis4 ( Axis :: new ( ) )
2960
- . x_axis5 ( Axis :: new ( ) )
2961
- . x_axis6 ( Axis :: new ( ) )
2962
- . x_axis7 ( Axis :: new ( ) )
2963
- . x_axis8 ( Axis :: new ( ) )
2964
- . y_axis ( Axis :: new ( ) )
2965
- . y_axis2 ( Axis :: new ( ) )
2966
- . y_axis3 ( Axis :: new ( ) )
2967
- . y_axis4 ( Axis :: new ( ) )
2968
- . y_axis5 ( Axis :: new ( ) )
2969
- . y_axis6 ( Axis :: new ( ) )
2970
- . y_axis7 ( Axis :: new ( ) )
2971
- . y_axis8 ( Axis :: new ( ) )
2964
+ . x_axis ( xaxis)
2965
+ . y_axis ( yaxis)
2972
2966
. annotations ( vec ! [ Annotation :: new( ) ] )
2973
2967
. shapes ( vec ! [ Shape :: new( ) ] )
2974
2968
. new_shape ( NewShape :: new ( ) )
@@ -3069,6 +3063,14 @@ mod tests {
3069
3063
3070
3064
#[ test]
3071
3065
fn test_serialize_layout ( ) {
3066
+
3067
+ let mut xaxis: Vec < Option < Box < Axis > > > = Vec :: new ( ) ;
3068
+ let mut yaxis: Vec < Option < Box < Axis > > > = Vec :: new ( ) ;
3069
+ for _ in 0 ..8 {
3070
+ xaxis. push ( Some ( Box :: new ( Axis :: new ( ) ) ) ) ;
3071
+ yaxis. push ( Some ( Box :: new ( Axis :: new ( ) ) ) ) ;
3072
+ }
3073
+
3072
3074
let layout = Layout :: new ( )
3073
3075
. title ( "Title" )
3074
3076
. title ( String :: from ( "Title" ) )
@@ -3098,22 +3100,8 @@ mod tests {
3098
3100
. template ( Template :: new ( ) )
3099
3101
. grid ( LayoutGrid :: new ( ) )
3100
3102
. calendar ( Calendar :: Jalali )
3101
- . x_axis ( Axis :: new ( ) )
3102
- . x_axis2 ( Axis :: new ( ) )
3103
- . x_axis3 ( Axis :: new ( ) )
3104
- . x_axis4 ( Axis :: new ( ) )
3105
- . x_axis5 ( Axis :: new ( ) )
3106
- . x_axis6 ( Axis :: new ( ) )
3107
- . x_axis7 ( Axis :: new ( ) )
3108
- . x_axis8 ( Axis :: new ( ) )
3109
- . y_axis ( Axis :: new ( ) )
3110
- . y_axis2 ( Axis :: new ( ) )
3111
- . y_axis3 ( Axis :: new ( ) )
3112
- . y_axis4 ( Axis :: new ( ) )
3113
- . y_axis5 ( Axis :: new ( ) )
3114
- . y_axis6 ( Axis :: new ( ) )
3115
- . y_axis7 ( Axis :: new ( ) )
3116
- . y_axis8 ( Axis :: new ( ) )
3103
+ . x_axis ( xaxis)
3104
+ . y_axis ( yaxis)
3117
3105
. annotations ( vec ! [ Annotation :: new( ) ] )
3118
3106
. shapes ( vec ! [ Shape :: new( ) ] )
3119
3107
. new_shape ( NewShape :: new ( ) )
@@ -3135,7 +3123,7 @@ mod tests {
3135
3123
. extend_pie_colors ( true )
3136
3124
. sunburst_colorway ( vec ! [ "#654654" ] )
3137
3125
. extend_sunburst_colors ( false )
3138
- . z_axis ( Axis :: new ( ) )
3126
+ . z_axis ( Vec :: from ( [ Some ( Box :: new ( Axis :: new ( ) ) ) ] ) )
3139
3127
. scene ( LayoutScene :: new ( ) ) ;
3140
3128
3141
3129
let expected = json ! ( {
0 commit comments