Compare commits
9 Commits
1daec59fbc
...
dfc26cedaa
Author | SHA1 | Date | |
---|---|---|---|
dfc26cedaa | |||
13b83e4efd | |||
97f7c410d3 | |||
c526e00039 | |||
d8ddaf3c77 | |||
dbdde37976 | |||
e1ec317e0e | |||
821087138a | |||
36b5b92a97 |
@@ -1,4 +1,4 @@
|
|||||||
id,place,x,y,count_of_texts
|
id,place,x,y,count_of_texts
|
||||||
894089,Sippar,44.253809,33.059195,2428
|
894089,Sippar,44.253809,33.059195,2428
|
||||||
912950,Abu Salabikh,45.054494428,32.2526542346,423
|
912950,Abu Salabikh,45.054494428,32.2526542346,423
|
||||||
874621,Ninua,43.151937,36.358684,41981
|
874621,Ninua,43.151937,36.358684,41981
|
||||||
|
|
70
ratios.py
Normal file
70
ratios.py
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
import pandas as pd
|
||||||
|
import dash
|
||||||
|
from dash import dcc, html
|
||||||
|
from dash.dependencies import Input, Output
|
||||||
|
import plotly.graph_objects as go
|
||||||
|
|
||||||
|
# Read the CSV file into a Pandas DataFrame
|
||||||
|
file_path = "texts_by_period_and_location_saparated_by_periods_in_columns.csv"
|
||||||
|
df = pd.read_csv(file_path)
|
||||||
|
|
||||||
|
# Initialize the Dash app
|
||||||
|
app = dash.Dash(__name__)
|
||||||
|
|
||||||
|
# Define the columns to summarize
|
||||||
|
columns_to_summarize = ["ancient", "old", "middle", "new", "late"]
|
||||||
|
|
||||||
|
# Create the figure for the initial graph (placeholder data)
|
||||||
|
initial_data = df.groupby("place")[columns_to_summarize].sum().reset_index()
|
||||||
|
initial_fig = go.Figure()
|
||||||
|
initial_fig.layout.height = 700 # You can set the desired height here
|
||||||
|
for col in columns_to_summarize:
|
||||||
|
initial_fig.add_trace(
|
||||||
|
go.Bar(
|
||||||
|
name=col, x=initial_data["place"],
|
||||||
|
y=initial_data[col],
|
||||||
|
text=initial_data[col],
|
||||||
|
textposition="auto"))
|
||||||
|
|
||||||
|
# Define the app layout
|
||||||
|
app.layout = html.Div([
|
||||||
|
html.H1("Dynamic Stacked Bar Graph with Labels"),
|
||||||
|
dcc.Dropdown(
|
||||||
|
id="place-selector",
|
||||||
|
options=[{"label": place, "value": place} for place in df["place"].unique()],
|
||||||
|
multi=True,
|
||||||
|
placeholder="Select Places",
|
||||||
|
),
|
||||||
|
dcc.Graph(id="bar-graph", figure=initial_fig),
|
||||||
|
])
|
||||||
|
|
||||||
|
# Define a callback to update the graph based on selected places
|
||||||
|
|
||||||
|
|
||||||
|
@app.callback(
|
||||||
|
Output("bar-graph", "figure"),
|
||||||
|
[Input("place-selector", "value")]
|
||||||
|
)
|
||||||
|
def update_graph(selected_places):
|
||||||
|
filtered_df = df[df["place"].isin(selected_places)]
|
||||||
|
grouped = filtered_df.groupby("place")[columns_to_summarize].sum().reset_index()
|
||||||
|
|
||||||
|
fig = go.Figure()
|
||||||
|
|
||||||
|
for col in columns_to_summarize:
|
||||||
|
fig.add_trace(go.Bar(name=col, x=grouped["place"], y=grouped[col], text=grouped[col], textposition="auto"))
|
||||||
|
|
||||||
|
fig.update_layout(barmode="stack") # Set the bars to be stacked
|
||||||
|
|
||||||
|
for index, place in enumerate(grouped["place"]):
|
||||||
|
total = grouped[columns_to_summarize].iloc[index].sum()
|
||||||
|
fig.add_annotation(text=f"Total: {total}", x=place, y=total + 5)
|
||||||
|
|
||||||
|
# Adjust the height of the plot area
|
||||||
|
fig.update_layout(height=700) # You can set the desired height here
|
||||||
|
|
||||||
|
return fig
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
app.run_server(debug=True)
|
@@ -1,4 +1,4 @@
|
|||||||
provenience,pperiod,x,y,count
|
provenience,pperiod,x,y,count
|
||||||
Dur-Šarrukin,3,43.228261,36.510016,5
|
Dur-Šarrukin,3,43.228261,36.510016,5
|
||||||
Larsa,2,45.853611,31.285833,287
|
Larsa,2,45.853611,31.285833,287
|
||||||
Adab,3,45.628335,31.951644,12
|
Adab,3,45.628335,31.951644,12
|
||||||
|
|
198
texts_by_period_and_location_saparated_by_periods_in_columns.csv
Normal file
198
texts_by_period_and_location_saparated_by_periods_in_columns.csv
Normal file
@@ -0,0 +1,198 @@
|
|||||||
|
place,x,y,ancient,old,middle,new,late,sum
|
||||||
|
Sippar,44.253809,33.059195,42,307,19,1979,81,2428
|
||||||
|
Abu Salabikh,45.05449443,32.25265423,423,,,,,423
|
||||||
|
Ninua,43.151937,36.358684,5,85,530,41361,,41981
|
||||||
|
Girsu,46.175712,31.576909,4191,17,,,,4208
|
||||||
|
Aššur,43.252949,35.526848,18,616,2849,6673,,10156
|
||||||
|
Nagar,41.0703913,36.6687803,17,,1,,,18
|
||||||
|
Akhetaten,30.899569,27.645956,,,765,,,765
|
||||||
|
Lagaš,46.40836,31.420485,197,,,,,197
|
||||||
|
Argištiḫinili,44.04,40.15,,,,49,,49
|
||||||
|
Tell Agrab,44.87428506,33.3391862,9,,,,,9
|
||||||
|
Assyria,43.2,36.2,,36,24,175,,235
|
||||||
|
Rusahinili Eidurukai,43.2485,38.661167,,,,194,,194
|
||||||
|
Bad-Tibira,46,31.766667,15,4,,,,19
|
||||||
|
Borsippa,44.344757,32.390721,,3,6,155,4,168
|
||||||
|
Larsa,45.853611,31.285833,17,287,5,59,3,371
|
||||||
|
Sippar Amnanum,44.298871,33.099559,2,26,,,,28
|
||||||
|
Ešnunna,44.7247598,33.4873408,39,163,,,,202
|
||||||
|
Nerebtum,44.583333,33.3,,43,,,,43
|
||||||
|
Umma,45.9,31.65,311,10,,,,321
|
||||||
|
Egypt,30.802498,26.820553,,,5,,,5
|
||||||
|
Tell al-Ubaid,46.030628,30.9723062,36,,,,,36
|
||||||
|
Diqdiqqah,46.11862957,30.97454762,70,11,,,,81
|
||||||
|
Šaduppum,44.466548,33.309745,3,303,,,,306
|
||||||
|
Puzriš-Dagan,45.29101,32.06236,517,,,,,517
|
||||||
|
Babylonia,44.5,32.5,3,35,21,227,23,309
|
||||||
|
Atmannu,43.681395,35.38201,,,37,,,37
|
||||||
|
Daskyleion,28.062536,40.138708,,,,12,,12
|
||||||
|
Tell Hammam,39.026003,36.521038,4,3,,,,7
|
||||||
|
Altıntepe,39.6479773,39.6978948,,,,11,,11
|
||||||
|
Van Kalesi,43.38,38.494166,,,,122,,122
|
||||||
|
Rusahinili Qilbanikai,43.4038002,38.5205001,,,,65,,65
|
||||||
|
Edremit,43.276591,38.422069,,,,15,,15
|
||||||
|
Patnos,42.866666,39.233333,,,,41,,41
|
||||||
|
Başkale,44.0180863,38.0444545,,,,4,,4
|
||||||
|
Isin,45.267191,31.920259,21,302,18,5,,346
|
||||||
|
Kalḫu,43.3275,36.099167,,,7,6682,,6689
|
||||||
|
Ḫattuša,34.615278,40.019722,,1,393,,,394
|
||||||
|
Tarbisu,43.077311,36.4087884,,,,129,,129
|
||||||
|
Ḫarbe,39.498189,36.6465219,,,194,,,194
|
||||||
|
Ḫadatu,38.407778,36.848889,,,,27,,27
|
||||||
|
Šibaniba,43.316666,36.433326,,,138,90,,228
|
||||||
|
Tell al-Hawa,42.301984,36.747619,,,,25,,25
|
||||||
|
Kizkapanlı,37.293138,37.37502,,,,8,,8
|
||||||
|
Sabaʾa,40.65609,36.08196,,,,5,,5
|
||||||
|
Pāra,41.491003,36.371137,,,,5,,5
|
||||||
|
Til Barsip,38.1191944,36.6749623,,,,99,,99
|
||||||
|
Lake Urmia,45.518417,37.086953,,,5,,,5
|
||||||
|
Beisan,43.1044,36.4087,,,,2,,2
|
||||||
|
Tulul al-Lak,43.263445,36.298266,,,,9,,9
|
||||||
|
Judi Dagh,42.3288972,37.3923021,,,,31,,31
|
||||||
|
Jerwan,43.393475,36.669779,,,,45,,45
|
||||||
|
Tikrit,43.698871,34.581814,,,,9,,9
|
||||||
|
Arbail,44.00924,36.191265,,,,3,,3
|
||||||
|
Kaḫat,41.1270848,36.73900024,,,7,6,,13
|
||||||
|
Ugarit,35.780703,35.610222,,1,195,,,196
|
||||||
|
Sur Jarʾa,42.20561,34.311256,,,,74,,74
|
||||||
|
Ḫursagkalama,44.5993371,32.5407858,1,4,,2,,7
|
||||||
|
ʾAna,41.978974,34.469451,,,,28,,28
|
||||||
|
Eridu,45.96982,30.821525,65,9,,,,74
|
||||||
|
Seleucia,44.520378,33.094346,,,,8,,8
|
||||||
|
Dur-Šarrukin,43.228261,36.510016,,5,5,461,,471
|
||||||
|
Tema,38.549681,27.622821,,,,36,,36
|
||||||
|
Ḫarran,39.031184,36.864682,,,,69,,69
|
||||||
|
Maškan-šapir,45.3067537,32.2285887,,5,,,,5
|
||||||
|
Kabnak,48.32896632,32.08077487,,,26,,,26
|
||||||
|
Kavuncu,43.4767586,38.5124956,,,,4,,4
|
||||||
|
Der,45.947885,33.109452,,5,,,,5
|
||||||
|
Nahr el-Kelb,35.598922,33.956087,,,,17,,17
|
||||||
|
Dohok,42.918763,36.858746,,,,5,,5
|
||||||
|
Negub Tunnel,43.405813,36.022095,,,,9,,9
|
||||||
|
Tutub,44.55662,33.354728,48,12,,,,60
|
||||||
|
Terqa,40.568065,34.923106,,13,,5,,18
|
||||||
|
el-Ghab,36.356,35.587,,,,8,,8
|
||||||
|
Dilbat,44.466967,32.295211,,2,,12,,14
|
||||||
|
Kār-Tukultī-Ninurta,43.268593,35.496419,,,124,,,124
|
||||||
|
Tigris Tunnel,40.5475,38.529722,,,5,20,,25
|
||||||
|
Kilizu,43.751839,36.105774,,,,77,,77
|
||||||
|
Luristan,48.4,33.6,3,,141,50,,194
|
||||||
|
Tell Zurghul,46.714373,31.403458,36,,,,,36
|
||||||
|
Zabalam,45.8777935,31.7434653,7,16,,,,23
|
||||||
|
Gubla,35.645732,34.119026,1,2,,5,,8
|
||||||
|
Turlu Höyük,37.069119,37.758916,,,,6,,6
|
||||||
|
Teišebaini,44.4502581,40.1551476,,,,290,,290
|
||||||
|
Sardurihinili,43.45988598,38.35266151,,,,63,,63
|
||||||
|
Ecbatana,48.512209,34.799294,,,,36,,36
|
||||||
|
Pasargadae,53.1684426,30.1930914,,,,15,,15
|
||||||
|
Elvend,48.43661,34.759872,,,,6,,6
|
||||||
|
El-Khargeh,30.553476,25.438054,,,,3,,3
|
||||||
|
Pārśa,52.889437,29.93534033,,,,189,,189
|
||||||
|
Suez,31.51108534,30.57238231,,,,18,,18
|
||||||
|
Persia,51.5,30.5,,,,72,,72
|
||||||
|
Tell Mozan (Urkesh),40.99775813,37.05784015,1,,,,,1
|
||||||
|
Alalakh,36.38346384,36.2384509,,17,10,1,,28
|
||||||
|
Ashdod,34.652079,31.765635,,,,6,,6
|
||||||
|
Bavian,43.420619,36.76194,,,,21,,21
|
||||||
|
Carchemish,38.013529,36.829505,,,,19,,19
|
||||||
|
Dunnu-ša-Uzībi,40.7499196,37.816986,,,30,,,30
|
||||||
|
Hazor,35.56813718,33.01746213,,,3,,,3
|
||||||
|
Ašqelon,34.545947,31.6659785,,,2,,,2
|
||||||
|
Šapinuwa,35.25,40.266667,,,2,,,2
|
||||||
|
El-Qitar,38.18072422,36.38403625,,,2,,,2
|
||||||
|
Tell Jidr,45.725183,31.815617,3,,,,,3
|
||||||
|
Tell el-Ḥesi,34.7307012,31.5471245,,,2,,,2
|
||||||
|
Sūr-marrati,43.876735,34.200116,2,,,15,,17
|
||||||
|
Mê-Turan,45.095015,34.225642,1,64,,26,,91
|
||||||
|
Ḫaradum,41.6,34.433333,,1,4,,,5
|
||||||
|
Dūr-Katlimmu,40.740208,35.643628,,,167,659,,826
|
||||||
|
Qatara,42.45005691,36.25699083,,20,122,5,,147
|
||||||
|
Apqu-ša-Adad,42.597299,36.429708,,,5,20,,25
|
||||||
|
Selaʾ,35.726658,30.750217,,,,6,,6
|
||||||
|
Kaniš,35.63486,38.85093,,23,,,,23
|
||||||
|
Ṭabatum,40.78481,36.364184,,4,22,,,26
|
||||||
|
Jemdet Nasr,44.77963319,32.71821045,4,,,,,4
|
||||||
|
Ben Shemen,34.9249,31.954,,,,8,,8
|
||||||
|
Diniktum,44.482146,33.29375,,4,,,,4
|
||||||
|
Sar-i-pul-i-Zohāb,65.927298,36.225626,,4,,,,4
|
||||||
|
Tell al-Dibaʾi,45.516946,31.6932,,5,,,,5
|
||||||
|
Mila Mergi,42.9135,37.0058333,,,,9,,9
|
||||||
|
Unqi,36.376389,36.2475,,,,27,,27
|
||||||
|
Kibbutz Hamaʿapil,34.983333,32.377778,,,,9,,9
|
||||||
|
Kurkh,40.539708,37.825989,,,,9,,9
|
||||||
|
Babil,42.027333,37.18775,,,,5,,5
|
||||||
|
Imgur-Enlil,43.414221,36.221946,,,,302,,302
|
||||||
|
Šadikanni,40.720582,36.208061,,,,6,,6
|
||||||
|
Padakku,40.467002,25.97861,,,,6,,6
|
||||||
|
Dawali,41.992053,34.453904,,,,4,,4
|
||||||
|
Glaiʾa,42.211404,34.302925,,,,8,,8
|
||||||
|
Tell Biʾa (Tuttul),39.0472663,35.95804988,,1,,,,1
|
||||||
|
Samʾal,36.678477,37.102208,,,,15,,15
|
||||||
|
Syria,37.051252,36.150945,,,,6,,6
|
||||||
|
Dur-Kurigalzu,44.201763,33.354401,,,22,10,,32
|
||||||
|
Wadi Bastura Tunnel,44.1158443,36.3516938,,,,6,,6
|
||||||
|
Kenk Boǧazı,37.8543333,37.2416667,,,,4,,4
|
||||||
|
Antakya,36.137399,36.182294,,,,4,,4
|
||||||
|
Brissa,36.310844,34.432209,,,,8,,8
|
||||||
|
Mardin,40.739222,37.319049,,4,,,,4
|
||||||
|
Yoncali,42.187778,39.128611,,,5,,,5
|
||||||
|
Kermanshah,47.5,34.5,,3,,,,3
|
||||||
|
Larnaka,33.633337,34.916662,,,,5,,5
|
||||||
|
Tunip,36.4,35.2833333,,,,6,,6
|
||||||
|
Arslantepe (Melidu),38.382217,38.361152,,,,20,,20
|
||||||
|
Tang-i Var,46.623466,35.0123977,,,,6,,6
|
||||||
|
Qalʾeh-i Imam,46.1758797,35.4913372,,,,6,,6
|
||||||
|
Sāmerīna,35.190436,32.276529,,,,6,,6
|
||||||
|
Tell Baradan,45.063962,34.238641,,,,6,,6
|
||||||
|
Aliler,43.4991276,38.8439399,,,,4,,4
|
||||||
|
Kars,43.10403027,40.60134912,,,,4,,4
|
||||||
|
Garni,44.72767453,40.11469767,,,,4,,4
|
||||||
|
Gazandži,44.026552,40.0067314,,,,4,,4
|
||||||
|
Hamam,41.2727638,39.9063215,,,,4,,4
|
||||||
|
Habıbuşağı,38.793772,38.433449,,,,4,,4
|
||||||
|
Džanfida,44.02456738,40.04420031,,,,4,,4
|
||||||
|
Bingöl Dağ,41.5,39.5,,,,4,,4
|
||||||
|
Bastam,44.893607,38.891105,,,,66,,66
|
||||||
|
Zvartnots,44.336575,40.159714,,,,4,,4
|
||||||
|
Erek Dağ,43.4938043,38.4537563,,,,4,,4
|
||||||
|
Bitlis,42.116666,38.4,,,,2,,2
|
||||||
|
Behistun,47.454353,34.393528,,,,36,,36
|
||||||
|
Gherla,23.899912,47.019833,,,,3,,3
|
||||||
|
Naqš-i-Rustam,52.87465819,29.98873469,,,,18,,18
|
||||||
|
Zawiya,42.175323,34.292103,,,,5,,5
|
||||||
|
Pasinler,41.6662835,39.984743,,,,4,,4
|
||||||
|
Hillah,44.433333,32.483333,,1,,,,1
|
||||||
|
Dura-Europus,40.73002886,34.74754662,,1,,,,1
|
||||||
|
Acem Höyük,33.833806,38.4097631,,3,,,,3
|
||||||
|
Firakdin,35.623396,38.253654,,1,,,,1
|
||||||
|
Shir as-Sanam,36.26839,34.52795,,,,2,,2
|
||||||
|
Tell Sabi Abyad,39.09153,36.505714,,,27,,,27
|
||||||
|
Larak,45.66028572,32.31245586,8,,,,,8
|
||||||
|
Kalmakarra Cave,47.3796339,33.0010272,,,,7,,7
|
||||||
|
Waššukanni,40.0709816,36.8425922,,,27,5,,32
|
||||||
|
Kissik,46.3341009,30.8348232,4,1,,13,,18
|
||||||
|
Marad,44.78567,32.070556,,1,1,17,,19
|
||||||
|
Zalu-Ab,46.905556,33.026389,,,,4,,4
|
||||||
|
Judeideh,42.028552,34.3887,,,,4,,4
|
||||||
|
Idu,44.697222,35.878056,,,,5,,5
|
||||||
|
Ekalte,38.1299921,36.2194381,2,,2,,,4
|
||||||
|
Tell Bazmusian,44.924366,36.161481,,,14,,,14
|
||||||
|
Kastri island,22.981207,36.267241,,1,,,,1
|
||||||
|
Megiddo,35.185167,32.579667,,,1,,,1
|
||||||
|
Adab,45.628335,31.951644,184,12,12,,,208
|
||||||
|
Babylon,44.422236,32.543395,7,208,57,2608,2223,5103
|
||||||
|
Uruk,45.638752,31.32446,1476,892,18,2731,780,5897
|
||||||
|
Šuruppak,45.5097359,31.7778493,202,2,,,,204
|
||||||
|
Nuzi,44.25493969,35.36989757,2,,16,,,18
|
||||||
|
Susa,48.257787,32.189217,160,385,2,168,,715
|
||||||
|
Kiš,44.585271,32.551977,35,207,15,1110,5,1372
|
||||||
|
Mari,40.889225,34.550398,121,193,,,,314
|
||||||
|
Ebla,36.7983658,35.79904468,623,1,,,,624
|
||||||
|
Ur,46.104748,30.96158,1189,1403,63,516,2,3173
|
||||||
|
Nippur,45.230832,32.126944,1259,11893,552,584,4,14292
|
||||||
|
Huzirina,38.9061,37.05,,,,1506,,1506
|
||||||
|
Emar,38.11099765,35.98702031,,1,486,1,,488
|
||||||
|
Dilmun,49.21475846,27.76062744,,4,2,,,6
|
||||||
|
Kišesim,48.5924864,33.3322314,,,,5,,5
|
||||||
|
Dūr-Bēl-Harrān-bēlī-uṣur,42.1622211,36.2145244,,,,5,,5
|
||||||
|
Šubat-Enlil,41.505096,36.958877,,22,,,,22
|
|
Reference in New Issue
Block a user