@@ -1571,30 +1571,51 @@ def get_base_layout(**kwargs):
1571
1571
[
1572
1572
dbc .Row (
1573
1573
[
1574
+ # Checkbox and Label
1575
+ dbc .Col (
1576
+ [
1577
+ dbc .Checkbox (
1578
+ id = 'show-average-checkbox' ,
1579
+ className = 'custom-checkbox' ,
1580
+ value = True ,
1581
+ ),
1582
+ html .Label (
1583
+ 'Show average line' ,
1584
+ htmlFor = 'show-average-checkbox' ,
1585
+ style = {'margin-top' :'3px' , 'margin-left' : '5px' }
1586
+ ),
1587
+ ],
1588
+ id = 'average_option' ,
1589
+ style = {'display' :'none' },
1590
+ width = 'auto'
1591
+ ),
1592
+ # Radio Items
1574
1593
dbc .Col (
1575
1594
dbc .RadioItems (
1576
1595
id = {
1577
1596
"type" : "area_breakdowns" ,
1578
1597
"index" : "AIO_AREA" ,
1579
1598
},
1580
- value = "TOTAL" ,
1599
+ value = "TOTAL" ,
1581
1600
class_name = "force-inline-control responsive-radio-items" ,
1582
1601
inline = True ,
1583
1602
),
1584
1603
width = "auto" ,
1585
1604
className = "radio-items-col" ,
1586
1605
),
1606
+ # Dropdown and label
1587
1607
dbc .Col (
1588
1608
html .Div ([
1589
1609
html .P ("Select country to highlight:" , style = {"margin-bottom" : "10px" , "margin-top" : "5px" , "margin-right" : "5px" }),
1590
1610
dcc .Dropdown (
1591
1611
id = "highlighted_country"
1592
- ),
1593
- ], style = {"display" : "none" }),
1594
- id = "highlight_option" ,
1612
+ ),
1613
+ ], style = {"display" : "none" }),
1614
+ id = "highlight_option" ,
1595
1615
width = "auto" ,
1596
- ),
1616
+ ),
1597
1617
],
1618
+ style = {"display" : "flex" , "align-items" : "center" },
1598
1619
)
1599
1620
],
1600
1621
style = {
@@ -1812,25 +1833,6 @@ def get_base_layout(**kwargs):
1812
1833
),
1813
1834
dbc .Col (
1814
1835
[
1815
- dbc .Row (
1816
- [
1817
- dbc .Col (
1818
- dbc .Checkbox (
1819
- id = 'show-average-checkbox' ,
1820
- className = 'custom-checkbox' ,
1821
- value = True ,
1822
- ),
1823
- style = {"padding" :"0px" },
1824
- width = 'auto'
1825
- ),
1826
- dbc .Col (
1827
- html .Label ('Show average line' , htmlFor = 'show-average-checkbox' , style = {'margin-top' :'3px' }),
1828
- style = {"padding" :"0px" },
1829
- width = 'auto'
1830
- ),
1831
- ],
1832
- style = {"display" :"flex" , "justifyContent" :"center" , "marginTop" :"25px" },
1833
- ),
1834
1836
dbc .Row (
1835
1837
[
1836
1838
html .Button (
@@ -2718,6 +2720,19 @@ def default_compare(compare_options, selected_type, indicator):
2718
2720
return compare_options [0 ]["value" ]
2719
2721
2720
2722
2723
+ def average_option (compare , selected_type ):
2724
+ if selected_type == "bar" and compare == 'TOTAL' :
2725
+ return {
2726
+ "padding" :"0px" ,
2727
+ "display" : "flex" ,
2728
+ "align-items" : "center"
2729
+ }
2730
+ else :
2731
+ return {
2732
+ "display" : "none"
2733
+ }
2734
+
2735
+
2721
2736
def highlight_option (fig_type , indicator , years_slider , countries , country_group , compare ):
2722
2737
if fig_type == "line" and indicator :
2723
2738
filters , country_selector , selected_years , country_text = get_filters (
0 commit comments