Skip to content

Commit

Permalink
up edge clickable
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviercaron committed Oct 20, 2023
1 parent c192ea7 commit 333c288
Show file tree
Hide file tree
Showing 12 changed files with 67,375 additions and 32,490 deletions.
6 changes: 0 additions & 6 deletions .ipynb_checkpoints/Untitled-checkpoint.ipynb

This file was deleted.

484 changes: 484 additions & 0 deletions .ipynb_checkpoints/sigmagrid_test-checkpoint.ipynb

Large diffs are not rendered by default.

27,711 changes: 27,711 additions & 0 deletions list_ref_test_to_delete.csv

Large diffs are not rendered by default.

34 changes: 26 additions & 8 deletions networks.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ import plotly.express as px
import re
import inspect
from ipysigma import Sigma
from ipysigma import Sigma, SigmaGrid
from itertools import combinations
from datetime import datetime
Expand Down Expand Up @@ -620,18 +620,19 @@ def sigma_graph(dataframe, year_period):
# Construct the sigma graph and customize visualization
Sigma.write_html(G,
default_edge_type = "curve", # Default edge type
clickable_edges = True, # Clickable edges
edge_size = "value", # Set edge size
fullscreen = True, # Display in fullscreen
label_density = 2, # Label density
label_font = "Helvetica Neue", # Label font
label_font = "Helvetica Neue", # Label font
max_categorical_colors = 10, # Max categorical colors
node_border_color_from = 'node', # Node border color from node attribute
node_color = "community", # Set node colors
node_label_size = "citations", # Node label size
node_label_size_range = (12, 25), # Node label size range
node_label_size_range = (12, 36), # Node label size range
node_metrics = {"community": {"name": "louvain", "resolution": 1}}, # Specify node metrics
node_size = "citations", # Node size
node_size_range = (3, 20), # Node size range
node_size_range = (3, 30), # Node size range
path = f"networks/authors/{year_period}_sigma.html", # Output file path
start_layout = 3 # Start layout algorithm
#node_border_color = "black", # Node border color
Expand Down Expand Up @@ -882,7 +883,10 @@ list_references <- list_references %>%
mutate(year = as.character(year)) %>%
select(-`prism:coverDate`)
write_csv2(list_references, 'list_ref_test_to_delete.csv')
```

```{python}
skim(list_references)
```

Expand Down Expand Up @@ -1030,8 +1034,7 @@ reactable(

#### Get missing data (to be done later if necessary)

We have a lot of missing data when it comes to the year of publication of the articles, the title, the sourcetitle the authors, DOI.
It could be helpful to retrieve these data so we can see them when we click on the nodes.
We have a lot of missing data when it comes to the year of publication of the articles, the title, the sourcetitle the authors, DOI. It could be helpful to retrieve these data so we can see them when we click on the nodes.

```{r}
#| label: citations-get-missing-data-todo
Expand Down Expand Up @@ -1271,7 +1274,6 @@ def sigma_graph_references(dataframe, period_label):
return G
```

### Citations network for 2022-2023 ([click here for fullscreen](https://oliviercaron.github.io/systematic_lit_review/networks/references/2022_2023_sigma.html))
Expand All @@ -1286,6 +1288,20 @@ G_2022_2023_references = sigma_graph_references(citations_df_2022_2023, "2022_20
#df_sorted = df_burt_constraint.sort_values(by='Burt_Constraint_Unweighted')
#print(df_sorted)
SigmaGrid.to_html(
G_2022_2023_references,
views=[{'node_size': G_2022_2023_references.in_degree}, {'node_size': 'citations_year'}],
node_size_range=(2, 10),
default_edge_type='curve',
path="networks/references/2022_2023_sigma_grid.html",
)
SigmaGrid(G_2022_2023_references,
views=[{'node_size': G_2022_2023_references.in_degree}, {'node_size': 'citations_year'}],
node_size_range=(2, 10),
default_edge_type='curve',
#path="networks/references/2022_2023_sigma_grid.html"
)
```

```{=html}
Expand Down Expand Up @@ -1347,6 +1363,7 @@ G_overall_references = sigma_graph_references(citations_df_overall, "overall")
#| output: false
# Create a dataframe with the density of each graph
density_df_references = pd.DataFrame({
'period': ['before-2013', '2013-2017', '2018-2021', '2022-2023', 'overall'],
Expand Down Expand Up @@ -1378,6 +1395,7 @@ density_df_references = pd.DataFrame({
```{r}
#| label: citations-graph-density-comparison
#| fig.cap: Comparison of network densities and average degree of nodes over time
#| column: body-outset
# Density plot
density_plot <- ggplot() +
Expand Down Expand Up @@ -1412,6 +1430,6 @@ avg_degree_plot <- ggplot() +
# Combine density and average degree plots
density_plot / linear_density_plot / avg_degree_plot
ggsave("images/citations-graph-density-comparison.png", width=27, height=18, units="cm", dpi=300)
ggsave("images/citations-graph-density-comparison.png", width=270, height=180, units="cm", dpi=300)
```
Loading

0 comments on commit 333c288

Please sign in to comment.