From 0fda3058c92b5591f910b8792717ec9e3f5c249f Mon Sep 17 00:00:00 2001 From: AnthonyGuillauma Date: Sun, 6 Apr 2025 16:57:52 +0200 Subject: [PATCH 1/2] =?UTF-8?q?Feat:=20Am=C3=A9lioration=20de=20la=20lisib?= =?UTF-8?q?ilit=C3=A9=20des=20camemberts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Agrandissement des camemberts --- app/export/exporteur.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/app/export/exporteur.py b/app/export/exporteur.py index 650c565..56a136a 100644 --- a/app/export/exporteur.py +++ b/app/export/exporteur.py @@ -4,7 +4,7 @@ from os.path import abspath, isdir, join from json import dump -from altair import Chart +from altair import Chart, Text, Theta, Color, vconcat from pandas import DataFrame @@ -110,15 +110,20 @@ def export_vers_html_camembert(self, # Exportation try: chemin_fichier = join(self._chemin_sortie, nom_fichier) - camembert = Chart(axes).mark_arc().encode( - theta='y:Q', - color='x:N', + base = Chart(axes).encode( + theta=Theta(field="y", type="quantitative"), + color=Color(field="x", type="nominal"), tooltip=['x:N', 'y:Q'] ) - camembert.save(chemin_fichier) + camembert = base.mark_arc(outerRadius=200) + graphique = (camembert).properties( + width=400, + height=400 + ) + graphique.save(chemin_fichier) except Exception as ex: raise ExportationCamembertHtmlException("Erreur lors de l'exportation " - f"du camembert {nom_fichier}.") from ex + f"du camembert {nom_fichier} {ex}.") from ex class ExportationException(Exception): From 9762d522a6a2329c61c71ada28f4a66f4d87555e Mon Sep 17 00:00:00 2001 From: AnthonyGuillauma Date: Sun, 6 Apr 2025 17:00:41 +0200 Subject: [PATCH 2/2] Refactor: Suppression des imports inutiles - Suppressions des imports inutiles --- app/export/exporteur.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/export/exporteur.py b/app/export/exporteur.py index 56a136a..75de743 100644 --- a/app/export/exporteur.py +++ b/app/export/exporteur.py @@ -4,7 +4,7 @@ from os.path import abspath, isdir, join from json import dump -from altair import Chart, Text, Theta, Color, vconcat +from altair import Chart, Theta, Color from pandas import DataFrame