@@ -547,7 +547,17 @@ def get_card_popover_body(sources):
547
547
sources_sorted = sources .sort_values (by = sort_col )
548
548
for i in range (len (sources_sorted )):
549
549
source_info = sources_sorted .iloc [i ]
550
- country_list .append (f"- { source_info .name [0 ]} : { source_info .iloc [0 ]} ({ source_info .name [1 ]} )" )
550
+ value = source_info .iloc [0 ]
551
+
552
+ # Check if the value is an integer
553
+ if isinstance (value , float ) and value .is_integer ():
554
+ # Format it as an integer with thousands separators
555
+ formatted_value = "{:,}" .format (int (value ))
556
+ else :
557
+ # Otherwise, convert the value directly to a string
558
+ formatted_value = str (value )
559
+
560
+ country_list .append (f"- { source_info .name [0 ]} : { formatted_value } ({ source_info .name [1 ]} )" )
551
561
card_countries = "\n " .join (country_list )
552
562
return card_countries
553
563
else :
@@ -852,8 +862,14 @@ def update_indicator_dropdown_class(indicator):
852
862
[
853
863
html .Span (f"{ merged_page_config [domain ]['domain_name' ]} / " ),
854
864
html .Br (),
855
- html .Span (f"{ merged_page_config [domain ]['SUBDOMAINS' ][subdomain ]['NAME' ]} " ,
856
- id = f"popover-target" ),
865
+ html .Span (f"{ merged_page_config [domain ]['SUBDOMAINS' ][subdomain ]['NAME' ]} " ),
866
+ html .I (
867
+ id = "popover-target" ,
868
+ className = "fas fa-info-circle" ,
869
+ style = {
870
+ "paddingLeft" : "5px" ,
871
+ },
872
+ ),
857
873
popover
858
874
],
859
875
style = {
@@ -875,8 +891,14 @@ def update_indicator_dropdown_class(indicator):
875
891
[
876
892
html .Span (f"{ merged_page_config [domain ]['domain_name' ]} Choose indicator/ " , style = {"font-weight" : "bold" }),
877
893
html .Br (),
878
- html .Span (f"{ merged_page_config [domain ]['SUBDOMAINS' ][subdomain ]['NAME' ]} " ,
879
- id = f"popover-target" ),
894
+ html .Span (f"{ merged_page_config [domain ]['SUBDOMAINS' ][subdomain ]['NAME' ]} " ),
895
+ html .I (
896
+ id = "popover-target" ,
897
+ className = "fas fa-info-circle" ,
898
+ style = {
899
+ "paddingLeft" : "5px" ,
900
+ },
901
+ ),
880
902
popover
881
903
],
882
904
style = {
@@ -891,63 +913,6 @@ def update_indicator_dropdown_class(indicator):
891
913
])
892
914
)
893
915
894
- def update_indicator_dropdown_class2 (indicator ):
895
- if indicator is None :
896
- return (
897
- "crm_dropdown" ,
898
- html .P (
899
- "No indicator selected" ,
900
- style = {
901
- "color" : "black" ,
902
- "display" : "inline-block" ,
903
- "position" : "relative" ,
904
- "marginBottom" :"5px" ,
905
- "marginTop" :"0px" ,
906
- "font-weight" : "bold"
907
- }
908
- )
909
- )
910
-
911
- domain , _ , subdomain = update_domain_and_subdomain_values (indicator )
912
- domain_colour = merged_page_config [domain ]['domain_colour' ]
913
- # Map the selected domain to its corresponding CSS class
914
- if domain and domain in domain_classes :
915
- return (
916
- domain_classes [domain ],
917
- html .P (
918
- [
919
- html .Span (f"{ merged_page_config [domain ]['domain_name' ]} / " ),
920
- html .Br (),
921
- html .Span (f"{ merged_page_config [domain ]['SUBDOMAINS' ][subdomain ]['NAME' ]} " ),
922
- ],
923
- style = {
924
- "color" : domain_colour ,
925
- "display" : "inline-block" ,
926
- "position" : "relative" ,
927
- "marginBottom" :"5px" ,
928
- "marginTop" :"0px" ,
929
- "font-weight" : "bold"
930
- }
931
- ),
932
- )
933
- return (
934
- "crm_dropdown" ,
935
- html .P (
936
- [
937
- html .Span (f"{ merged_page_config [domain ]['domain_name' ]} Choose indicator/ " , style = {"font-weight" : "bold" }),
938
- html .Br (),
939
- merged_page_config [domain ]['SUBDOMAINS' ][subdomain ]['NAME' ]
940
- ],
941
- style = {
942
- "color" : domain_colour ,
943
- "display" : "inline-block" ,
944
- "position" : "relative" ,
945
- "marginBottom" :"5px" ,
946
- "marginTop" :"0px" ,
947
- "font-weight" : "bold"
948
- }
949
- ),
950
- )
951
916
952
917
def get_data (
953
918
indicators : list ,
0 commit comments