@@ -616,33 +616,27 @@ def configure_cartesian_axes(args, fig, orders):
616
616
if "is_timeline" in args :
617
617
fig .update_xaxes (type = "date" )
618
618
619
- return fig .layout
620
-
621
619
622
620
def configure_ternary_axes (args , fig , orders ):
623
- fig .update_layout (
624
- ternary = dict (
625
- aaxis = dict (title_text = get_label (args , args ["a" ])),
626
- baxis = dict (title_text = get_label (args , args ["b" ])),
627
- caxis = dict (title_text = get_label (args , args ["c" ])),
628
- )
621
+ fig .update_ternaries (
622
+ aaxis = dict (title_text = get_label (args , args ["a" ])),
623
+ baxis = dict (title_text = get_label (args , args ["b" ])),
624
+ caxis = dict (title_text = get_label (args , args ["c" ])),
629
625
)
630
626
631
627
632
628
def configure_polar_axes (args , fig , orders ):
633
- layout = dict (
634
- polar = dict (
635
- angularaxis = dict (direction = args ["direction" ], rotation = args ["start_angle" ]),
636
- radialaxis = dict (),
637
- )
629
+ patch = dict (
630
+ angularaxis = dict (direction = args ["direction" ], rotation = args ["start_angle" ]),
631
+ radialaxis = dict (),
638
632
)
639
633
640
634
for var , axis in [("r" , "radialaxis" ), ("theta" , "angularaxis" )]:
641
635
if args [var ] in orders :
642
- layout [ "polar" ] [axis ]["categoryorder" ] = "array"
643
- layout [ "polar" ] [axis ]["categoryarray" ] = orders [args [var ]]
636
+ patch [axis ]["categoryorder" ] = "array"
637
+ patch [axis ]["categoryarray" ] = orders [args [var ]]
644
638
645
- radialaxis = layout [ "polar" ] ["radialaxis" ]
639
+ radialaxis = patch ["radialaxis" ]
646
640
if args ["log_r" ]:
647
641
radialaxis ["type" ] = "log"
648
642
if args ["range_r" ]:
@@ -652,21 +646,19 @@ def configure_polar_axes(args, fig, orders):
652
646
radialaxis ["range" ] = args ["range_r" ]
653
647
654
648
if args ["range_theta" ]:
655
- layout [ "polar" ] ["sector" ] = args ["range_theta" ]
656
- fig .update ( layout = layout )
649
+ patch ["sector" ] = args ["range_theta" ]
650
+ fig .update_polars ( patch )
657
651
658
652
659
653
def configure_3d_axes (args , fig , orders ):
660
- layout = dict (
661
- scene = dict (
662
- xaxis = dict (title_text = get_label (args , args ["x" ])),
663
- yaxis = dict (title_text = get_label (args , args ["y" ])),
664
- zaxis = dict (title_text = get_label (args , args ["z" ])),
665
- )
654
+ patch = dict (
655
+ xaxis = dict (title_text = get_label (args , args ["x" ])),
656
+ yaxis = dict (title_text = get_label (args , args ["y" ])),
657
+ zaxis = dict (title_text = get_label (args , args ["z" ])),
666
658
)
667
659
668
660
for letter in ["x" , "y" , "z" ]:
669
- axis = layout [ "scene" ] [letter + "axis" ]
661
+ axis = patch [letter + "axis" ]
670
662
if args ["log_" + letter ]:
671
663
axis ["type" ] = "log"
672
664
if args ["range_" + letter ]:
@@ -677,7 +669,7 @@ def configure_3d_axes(args, fig, orders):
677
669
if args [letter ] in orders :
678
670
axis ["categoryorder" ] = "array"
679
671
axis ["categoryarray" ] = orders [args [letter ]]
680
- fig .update ( layout = layout )
672
+ fig .update_scenes ( patch )
681
673
682
674
683
675
def configure_mapbox (args , fig , orders ):
@@ -687,23 +679,19 @@ def configure_mapbox(args, fig, orders):
687
679
lat = args ["data_frame" ][args ["lat" ]].mean (),
688
680
lon = args ["data_frame" ][args ["lon" ]].mean (),
689
681
)
690
- fig .update_layout (
691
- mapbox = dict (
692
- accesstoken = MAPBOX_TOKEN ,
693
- center = center ,
694
- zoom = args ["zoom" ],
695
- style = args ["mapbox_style" ],
696
- )
682
+ fig .update_mapboxes (
683
+ accesstoken = MAPBOX_TOKEN ,
684
+ center = center ,
685
+ zoom = args ["zoom" ],
686
+ style = args ["mapbox_style" ],
697
687
)
698
688
699
689
700
690
def configure_geo (args , fig , orders ):
701
- fig .update_layout (
702
- geo = dict (
703
- center = args ["center" ],
704
- scope = args ["scope" ],
705
- projection = dict (type = args ["projection" ]),
706
- )
691
+ fig .update_geos (
692
+ center = args ["center" ],
693
+ scope = args ["scope" ],
694
+ projection = dict (type = args ["projection" ]),
707
695
)
708
696
709
697
0 commit comments