Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -205,6 +205,7 @@ chart3 = alt.Chart(density_df).mark_bar().encode(
|
|
205 |
).interactive()
|
206 |
|
207 |
final = alt.vconcat(chart1, chart2, chart3).resolve_scale(x='shared')
|
|
|
208 |
|
209 |
#Plot 2 - - Ultimatum (Fairness)
|
210 |
df = pd.read_csv('ultimatum_strategy.csv')
|
@@ -321,6 +322,7 @@ chart3 = alt.Chart(density_df).mark_bar().encode(
|
|
321 |
).interactive()
|
322 |
|
323 |
final2 = alt.vconcat(chart1, chart2, chart3).resolve_scale(x='shared')
|
|
|
324 |
|
325 |
#Plot 3 - - Ultimatum (Responder) (spite)
|
326 |
df = df_ultimatum_2_human
|
@@ -384,6 +386,7 @@ chart3 = alt.Chart(density_df).mark_bar().encode(
|
|
384 |
).interactive()
|
385 |
|
386 |
final3 = alt.vconcat(chart1, chart2, chart3).resolve_scale(x='shared')
|
|
|
387 |
|
388 |
#Plot 4 - - Trust (as Investor) (trust)
|
389 |
binrange = (0, 100)
|
@@ -511,6 +514,7 @@ chart3 = alt.Chart(density_df).mark_bar().encode(
|
|
511 |
|
512 |
|
513 |
final4 = alt.vconcat(chart1, chart2, chart3).resolve_scale(x='shared')
|
|
|
514 |
|
515 |
#Plot 5 - Trust (as Banker) (fairness, altruism, reciprocity)
|
516 |
df = df_trust_3_human
|
@@ -580,6 +584,7 @@ chart3 = alt.Chart(density_df).mark_bar().encode(
|
|
580 |
|
581 |
# chart1
|
582 |
final5 = alt.vconcat(chart1, chart2, chart3).resolve_scale(x='shared')
|
|
|
583 |
|
584 |
#Plot 6 - Public Goods (Free-Riding, altruism, cooperation)
|
585 |
df = pd.read_csv('public_goods_linear_water.csv')
|
@@ -690,6 +695,7 @@ chart3 = alt.Chart(density_df).mark_bar().encode(
|
|
690 |
|
691 |
# chart1
|
692 |
final6 = alt.vconcat(chart1, chart2, chart3).resolve_scale(x='shared')
|
|
|
693 |
|
694 |
#Final_Final
|
695 |
final_final = (final | final2 | final3 ) & (final4 | final5 | final6)
|
@@ -729,7 +735,7 @@ template = pn.template.BootstrapTemplate(
|
|
729 |
# the main column will hold our key content
|
730 |
maincol = pn.Column()
|
731 |
|
732 |
-
options1 = ['
|
733 |
select0 = pn.widgets.Select(options=options1, name='Choose what to compare')
|
734 |
# maincol.append(select0)
|
735 |
|
@@ -743,7 +749,8 @@ charts.append(final5)
|
|
743 |
charts.append(final6)
|
744 |
|
745 |
# Define options for dropdown
|
746 |
-
options = [f'Chart {i+1}' for i in range(len(charts))]
|
|
|
747 |
|
748 |
# Panel widgets
|
749 |
select1 = pn.widgets.Select(options=options, name='Select Chart 1')
|
|
|
205 |
).interactive()
|
206 |
|
207 |
final = alt.vconcat(chart1, chart2, chart3).resolve_scale(x='shared')
|
208 |
+
final = final.properties(title='Dictator (altruism)')
|
209 |
|
210 |
#Plot 2 - - Ultimatum (Fairness)
|
211 |
df = pd.read_csv('ultimatum_strategy.csv')
|
|
|
322 |
).interactive()
|
323 |
|
324 |
final2 = alt.vconcat(chart1, chart2, chart3).resolve_scale(x='shared')
|
325 |
+
final2 = final.properties(title='Ultimatum (Fairness)')
|
326 |
|
327 |
#Plot 3 - - Ultimatum (Responder) (spite)
|
328 |
df = df_ultimatum_2_human
|
|
|
386 |
).interactive()
|
387 |
|
388 |
final3 = alt.vconcat(chart1, chart2, chart3).resolve_scale(x='shared')
|
389 |
+
final3 = final.properties(title='Ultimatum (Responder) (spite)')
|
390 |
|
391 |
#Plot 4 - - Trust (as Investor) (trust)
|
392 |
binrange = (0, 100)
|
|
|
514 |
|
515 |
|
516 |
final4 = alt.vconcat(chart1, chart2, chart3).resolve_scale(x='shared')
|
517 |
+
final4 = final.properties(title='Trust (as Investor) (trust)')
|
518 |
|
519 |
#Plot 5 - Trust (as Banker) (fairness, altruism, reciprocity)
|
520 |
df = df_trust_3_human
|
|
|
584 |
|
585 |
# chart1
|
586 |
final5 = alt.vconcat(chart1, chart2, chart3).resolve_scale(x='shared')
|
587 |
+
final5 = final.properties(title='Trust (as Banker) (fairness, altruism, reciprocity)')
|
588 |
|
589 |
#Plot 6 - Public Goods (Free-Riding, altruism, cooperation)
|
590 |
df = pd.read_csv('public_goods_linear_water.csv')
|
|
|
695 |
|
696 |
# chart1
|
697 |
final6 = alt.vconcat(chart1, chart2, chart3).resolve_scale(x='shared')
|
698 |
+
final6 = final.properties(title='Public Goods (Free-Riding, altruism, cooperation)')
|
699 |
|
700 |
#Final_Final
|
701 |
final_final = (final | final2 | final3 ) & (final4 | final5 | final6)
|
|
|
735 |
# the main column will hold our key content
|
736 |
maincol = pn.Column()
|
737 |
|
738 |
+
options1 = ['Choose Your Own', 'Based On Category']
|
739 |
select0 = pn.widgets.Select(options=options1, name='Choose what to compare')
|
740 |
# maincol.append(select0)
|
741 |
|
|
|
749 |
charts.append(final6)
|
750 |
|
751 |
# Define options for dropdown
|
752 |
+
# options = [f'Chart {i+1}' for i in range(len(charts))]
|
753 |
+
options = ['Dictator', 'Ultimatum - 1', 'Ultimatum - 2', 'Trust - 1', 'Trust - 2', 'Public Goods']
|
754 |
|
755 |
# Panel widgets
|
756 |
select1 = pn.widgets.Select(options=options, name='Select Chart 1')
|