Spaces:
Running
Running
Commit
·
1e6e2b3
1
Parent(s):
6aca28d
moved data files to new folder, update README
Browse files- README.md +47 -14
- config.json +1 -1
- check_json.py → data/check_json.py +0 -0
- graph.graphml → data/graph.graphml +0 -0
- graph.json → data/graph.json +0 -0
- graphml_to_json.py → data/graphml_to_json.py +0 -0
- json_converter.js → data/json_converter.js +3 -3
- paper_atlas_data.json → data/paper_atlas_data.json +0 -0
- sigma_graph.json → data/sigma_graph.json +0 -0
- js/main.js +6 -0
README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
-
# Daily
|
2 |
|
3 |
-
|
4 |
|
5 |
## Features
|
6 |
|
@@ -11,21 +11,51 @@ A visualization tool for exploring papers and authors network graphs, inspired b
|
|
11 |
- Node details panel
|
12 |
- Responsive zoom and navigation
|
13 |
|
14 |
-
##
|
15 |
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
```bash
|
19 |
-
|
|
|
20 |
```
|
21 |
|
22 |
-
|
|
|
|
|
23 |
|
24 |
```bash
|
|
|
25 |
python app.py
|
26 |
```
|
27 |
|
28 |
-
|
29 |
|
30 |
## Technology Stack
|
31 |
|
@@ -37,13 +67,16 @@ python app.py
|
|
37 |
|
38 |
## Data Format
|
39 |
|
40 |
-
The
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
-
|
|
|
|
|
|
|
46 |
|
47 |
## Credits
|
48 |
|
49 |
-
This visualization is inspired by the work described in ["Charting and Navigating Hugging Face's Model Atlas"](https://arxiv.org/abs/2503.10633)
|
|
|
1 |
+
# Daily Papers Atlas
|
2 |
|
3 |
+
The atlas visualization demo of the daily papers listed in [Hugging Face Daily Papers](https://huggingface.co/papers).
|
4 |
|
5 |
## Features
|
6 |
|
|
|
11 |
- Node details panel
|
12 |
- Responsive zoom and navigation
|
13 |
|
14 |
+
## Project Structure
|
15 |
|
16 |
+
- `data/` - Contains all data files and conversion scripts
|
17 |
+
- `graph.graphml` - Source GraphML file
|
18 |
+
- `graph.json` - Intermediate JSON format
|
19 |
+
- `sigma_graph.json` - SigmaJS-compatible JSON
|
20 |
+
- `paper_atlas_data.json` - Additional data
|
21 |
+
- `paper_atlas_data.json.gz` - Compressed data
|
22 |
+
- `graphml_to_json.py` - GraphML to JSON converter
|
23 |
+
- `json_converter.js` - JSON format converter
|
24 |
+
- `check_json.py` - JSON validation script
|
25 |
+
- `js/` - JavaScript files
|
26 |
+
- `css/` - CSS stylesheets
|
27 |
+
- `config.json` - Application configuration
|
28 |
+
- `index.html` - Main application page
|
29 |
+
- `app.py` - Simple web server
|
30 |
+
|
31 |
+
## Setup and Running the Application
|
32 |
+
|
33 |
+
### Data Conversion
|
34 |
+
|
35 |
+
If you need to convert a GraphML file to JSON:
|
36 |
+
|
37 |
+
```bash
|
38 |
+
# Convert GraphML to JSON
|
39 |
+
python data/graphml_to_json.py data/graph.graphml data/paper_atlas_data.json data/paper_atlas_data.json.gz
|
40 |
+
```
|
41 |
+
|
42 |
+
To convert the intermediate JSON to SigmaJS format:
|
43 |
|
44 |
```bash
|
45 |
+
# Convert to SigmaJS format
|
46 |
+
node data/json_converter.js
|
47 |
```
|
48 |
|
49 |
+
### Running the Application
|
50 |
+
|
51 |
+
Start the local web server:
|
52 |
|
53 |
```bash
|
54 |
+
# Start the web server
|
55 |
python app.py
|
56 |
```
|
57 |
|
58 |
+
Then open your browser to http://localhost:7860
|
59 |
|
60 |
## Technology Stack
|
61 |
|
|
|
67 |
|
68 |
## Data Format
|
69 |
|
70 |
+
The data is exported from [Gephi](https://gephi.org/) in the GraphML/JSON format.
|
71 |
+
|
72 |
+
## Configuration
|
73 |
+
|
74 |
+
The `config.json` file controls various aspects of the visualization:
|
75 |
+
- Data source path
|
76 |
+
- Node colors and sizes
|
77 |
+
- UI text and labels
|
78 |
+
- Sigma.js visualization settings
|
79 |
|
80 |
## Credits
|
81 |
|
82 |
+
This visualization is inspired by the work described in ["Charting and Navigating Hugging Face's Model Atlas"](https://arxiv.org/abs/2503.10633).
|
config.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
{
|
2 |
"type": "network",
|
3 |
"version": "1.0",
|
4 |
-
"data": "sigma_graph.json",
|
5 |
"logo": {
|
6 |
"file": "",
|
7 |
"link": "",
|
|
|
1 |
{
|
2 |
"type": "network",
|
3 |
"version": "1.0",
|
4 |
+
"data": "data/sigma_graph.json",
|
5 |
"logo": {
|
6 |
"file": "",
|
7 |
"link": "",
|
check_json.py → data/check_json.py
RENAMED
File without changes
|
graph.graphml → data/graph.graphml
RENAMED
File without changes
|
graph.json → data/graph.json
RENAMED
File without changes
|
graphml_to_json.py → data/graphml_to_json.py
RENAMED
File without changes
|
json_converter.js → data/json_converter.js
RENAMED
@@ -10,13 +10,13 @@ const fs = require('fs');
|
|
10 |
const path = require('path');
|
11 |
|
12 |
// File paths
|
13 |
-
const sourcePath = 'graph.json';
|
14 |
-
const outputPath = 'sigma_graph.json';
|
15 |
|
16 |
// Load config to access node type colors
|
17 |
let config;
|
18 |
try {
|
19 |
-
config = JSON.parse(fs.readFileSync('config.json', 'utf8'));
|
20 |
} catch (error) {
|
21 |
console.error('Error loading config.json:', error);
|
22 |
config = {
|
|
|
10 |
const path = require('path');
|
11 |
|
12 |
// File paths
|
13 |
+
const sourcePath = path.join(__dirname, 'graph.json');
|
14 |
+
const outputPath = path.join(__dirname, 'sigma_graph.json');
|
15 |
|
16 |
// Load config to access node type colors
|
17 |
let config;
|
18 |
try {
|
19 |
+
config = JSON.parse(fs.readFileSync(path.join(__dirname, '../config.json'), 'utf8'));
|
20 |
} catch (error) {
|
21 |
console.error('Error loading config.json:', error);
|
22 |
config = {
|
paper_atlas_data.json → data/paper_atlas_data.json
RENAMED
File without changes
|
sigma_graph.json → data/sigma_graph.json
RENAMED
File without changes
|
js/main.js
CHANGED
@@ -31,6 +31,12 @@ $(document).ready(function() {
|
|
31 |
document.title = config.text.title || 'Daily Paper Atlas';
|
32 |
$('#title').text(config.text.title || 'Daily Paper Atlas');
|
33 |
$('#titletext').text(config.text.intro || '');
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
loadGraph();
|
35 |
}).fail(function(jqXHR, textStatus, errorThrown) {
|
36 |
console.error("Failed to load config:", textStatus, errorThrown);
|
|
|
31 |
document.title = config.text.title || 'Daily Paper Atlas';
|
32 |
$('#title').text(config.text.title || 'Daily Paper Atlas');
|
33 |
$('#titletext').text(config.text.intro || '');
|
34 |
+
|
35 |
+
// Update the path to load data from the data folder
|
36 |
+
if (config.data && !config.data.startsWith('data/')) {
|
37 |
+
config.data = 'data/' + config.data;
|
38 |
+
}
|
39 |
+
|
40 |
loadGraph();
|
41 |
}).fail(function(jqXHR, textStatus, errorThrown) {
|
42 |
console.error("Failed to load config:", textStatus, errorThrown);
|