Skip to content

Commit f571d08

Browse files
committed
set sans font in report (#714)
1 parent d94397a commit f571d08

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

supervised/base_automl.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,6 @@
4747
from supervised.utils.metric import Metric, UserDefinedEvalMetric
4848
from supervised.utils.utils import dump_data, load_data
4949

50-
try:
51-
import matplotlib.font_manager as font_manager
52-
53-
# Get a list of all font families available on the system
54-
font_families = font_manager.findSystemFonts()
55-
56-
# Load the font file for the first font family in the list and get the name of the first font family
57-
REPORT_FONT = font_manager.FontProperties(fname=font_families[0]).get_name()
58-
except Exception:
59-
REPORT_FONT = "Arial"
60-
6150
logger = logging.getLogger(__name__)
6251
logger.setLevel(LOG_LEVEL)
6352

@@ -2281,7 +2270,7 @@ def from_json(self, json_data):
22812270
.styled-table {{
22822271
border-collapse: collapse;
22832272
font-size: 0.9em;
2284-
font-family:Courier New;
2273+
font-family: Courier New;
22852274
}}
22862275
22872276
.styled-table td, .styled-table th {{
@@ -2302,8 +2291,7 @@ def from_json(self, json_data):
23022291
}}
23032292
23042293
body {{
2305-
font-family: {REPORT_FONT};
2306-
font-size: 1.0em;
2294+
font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
23072295
background-color: rgba(236, 243, 249, 0.15);
23082296
}}
23092297
@@ -2404,7 +2392,7 @@ def _md_to_html(self, md_fname, page_type, dir_path, me=None):
24042392

24052393
beginning = ""
24062394

2407-
if page_type == "main":
2395+
if page_type == "automl-report-main":
24082396
beginning += """<img src="https://raw.githubusercontent.com/mljar/visual-identity/main/media/mljar_AutomatedML.png" style="height:128px; margin-left: auto;
24092397
margin-right: auto;display: block;"/>\n\n"""
24102398
if os.path.exists(os.path.join(self._results_path, "optuna/README.md")):

0 commit comments

Comments
 (0)