Skip to content

Commit

Permalink
final updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Raei-MH committed Oct 3, 2023
1 parent 90cbc58 commit fc8875e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion phase3 Dashboard/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ def get_publisher_translator(mysql: MySQLConnection) -> pd.DataFrame:
GROUP BY p.id, t.name) AS translator_counts ON p.id = translator_counts.publisher_id\
AND tp.name = translator_counts.translator_name\
GROUP BY p.name\
HAVING MAX(translation_count) > 100\
ORDER BY book_count desc"
return pandas_sql(mysql, query)

Expand All @@ -336,5 +337,5 @@ def get_publisher_genres(mysql: MySQLConnection) -> pd.DataFrame:
GROUP BY t.id, p.id\
) AS max_counts ON t.id = max_counts.tag_id AND p.id = max_counts.publisher_id\
GROUP BY t.name\
limit 20;"
HAVING MAX(book_count) >= 500"
return pandas_sql(mysql, query)
14 changes: 12 additions & 2 deletions phase3 Dashboard/pages/4πŸ“Š_Further_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,21 @@ def prepare_data(_mysqldb: MySQLConnection):
labels={'book_count': 'Book Count', 'publisher_name': 'Publisher Name'},
title="Publisher Translator Book Count")
st.plotly_chart(fig1, use_container_width=True)
st.markdown(
"As you can see, this plot shows the most translations by the publications which demonstrates "
"that how much did the publications preferred to translate good books except of creating them.", unsafe_allow_html=True)

fig2 = px.bar(publisher_genres, x='genre_name', y='max_book_count',
hover_data=['best_publisher_name'], color='max_book_count',
labels={'max_book_count': 'Max Book Count', 'genre_name': 'Genre Name'},
title="Publisher Genres Max Book Count")
st.plotly_chart(fig2)

st.markdown("<h6 style='text-align: left;'><strong>Publisher's Same Books Correlation</strong></h6>", unsafe_allow_html=True)
st.markdown(
"As you can see, this plot shows the most common genres which are printed by the publications which absolutely "
"shows the demand of the buyers.",
unsafe_allow_html=True)
st.markdown("<h6 style='text-align: left;'><strong>Publisher's Same Books Correlation</strong></h6>",
unsafe_allow_html=True)
df = get_number_of_books_published_by_pubs(mysqldb)

net = Network()
Expand All @@ -63,3 +70,6 @@ def prepare_data(_mysqldb: MySQLConnection):
with open("network.html", "r") as f:
network_html = f.read()
st.components.v1.html(network_html, width=800, height=600)
st.markdown(
"As you can see, this graph shows the correlations between different publications. The correlation depends on the thickness of the edges between the nodes; the thicker the edge, the stronger the correlation. For instance, the \"Neyestan\" publication has a strong correlation with the \"Bonyad NahjolBalagheh\" publication, as they are both considered Persian Islamic religious publications.",
unsafe_allow_html=True)

0 comments on commit fc8875e

Please sign in to comment.