Spaces:
Running
Running
Ilyas KHIAT
commited on
Commit
•
ce4fc2a
1
Parent(s):
796a4bb
pp_viz
Browse files- partie_prenante_carte.py +1 -1
- pp_viz.py +5 -6
partie_prenante_carte.py
CHANGED
@@ -171,6 +171,7 @@ def disp_vertical_slider(partie_prenante):
|
|
171 |
def display_pp():
|
172 |
|
173 |
load_dotenv()
|
|
|
174 |
#check if brand name and description are already set
|
175 |
if "Nom de la marque" not in st.session_state:
|
176 |
st.session_state["Nom de la marque"] = ""
|
@@ -184,7 +185,6 @@ def display_pp():
|
|
184 |
st.session_state['parties_prenantes'] = []
|
185 |
|
186 |
st.header("Parties prenantes de la marque")
|
187 |
-
|
188 |
#set brand name and description
|
189 |
brand_name = st.text_input("Nom de la marque", st.session_state["Nom de la marque"])
|
190 |
st.session_state["Nom de la marque"] = brand_name
|
|
|
171 |
def display_pp():
|
172 |
|
173 |
load_dotenv()
|
174 |
+
|
175 |
#check if brand name and description are already set
|
176 |
if "Nom de la marque" not in st.session_state:
|
177 |
st.session_state["Nom de la marque"] = ""
|
|
|
185 |
st.session_state['parties_prenantes'] = []
|
186 |
|
187 |
st.header("Parties prenantes de la marque")
|
|
|
188 |
#set brand name and description
|
189 |
brand_name = st.text_input("Nom de la marque", st.session_state["Nom de la marque"])
|
190 |
st.session_state["Nom de la marque"] = brand_name
|
pp_viz.py
CHANGED
@@ -17,21 +17,20 @@ def display_viz():
|
|
17 |
if parties_prenantes is None or len(parties_prenantes) == 0:
|
18 |
st.write("aucune partie prenante n'a été définie")
|
19 |
else:
|
20 |
-
partie_prenante_non_filtre = [item for sublist in parties_prenantes for item in sublist]
|
21 |
partie_prenante = sorted(list(set(partie_prenante_non_filtre)))
|
22 |
pouvoir = [ 50 for _ in range(len(partie_prenante))]
|
23 |
-
df = pd.DataFrame({'partie_prenante': partie_prenante, 'pouvoir': pouvoir, '
|
24 |
c = (
|
25 |
alt.Chart(df)
|
26 |
.mark_circle(size=800)
|
27 |
-
.encode(x="partie_prenante", y=alt.Y("pouvoir",scale=alt.Scale(domain=[0,100])), color="
|
28 |
-
).configure_legend(orient='
|
29 |
|
30 |
number_of_sliders = len(partie_prenante)
|
31 |
st.write("Modifiez le pouvoir des parties prenantes en utilisant les sliders ci-dessous")
|
|
|
32 |
bar = st.columns(number_of_sliders)
|
33 |
-
|
34 |
-
|
35 |
for i in range(number_of_sliders):
|
36 |
with bar[i]:
|
37 |
temp = 50
|
|
|
17 |
if parties_prenantes is None or len(parties_prenantes) == 0:
|
18 |
st.write("aucune partie prenante n'a été définie")
|
19 |
else:
|
20 |
+
partie_prenante_non_filtre = [item.lower().capitalize() for sublist in parties_prenantes for item in sublist]
|
21 |
partie_prenante = sorted(list(set(partie_prenante_non_filtre)))
|
22 |
pouvoir = [ 50 for _ in range(len(partie_prenante))]
|
23 |
+
df = pd.DataFrame({'partie_prenante': partie_prenante, 'pouvoir': pouvoir, 'Code couleur': partie_prenante})
|
24 |
c = (
|
25 |
alt.Chart(df)
|
26 |
.mark_circle(size=800)
|
27 |
+
.encode(x="partie_prenante", y=alt.Y("pouvoir",scale=alt.Scale(domain=[0,100])), color="Code couleur",tooltip=["partie_prenante","pouvoir"])
|
28 |
+
).configure_legend(orient='top',direction="vertical").properties(height=600)
|
29 |
|
30 |
number_of_sliders = len(partie_prenante)
|
31 |
st.write("Modifiez le pouvoir des parties prenantes en utilisant les sliders ci-dessous")
|
32 |
+
|
33 |
bar = st.columns(number_of_sliders)
|
|
|
|
|
34 |
for i in range(number_of_sliders):
|
35 |
with bar[i]:
|
36 |
temp = 50
|