gismap 0.2.2__py3-none-any.whl → 0.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gismap/__init__.py +2 -0
- gismap/build.py +4 -0
- gismap/gisgraphs/__init__.py +0 -0
- gismap/gisgraphs/builder.py +105 -0
- gismap/{lab → gisgraphs}/graph.py +70 -66
- gismap/gisgraphs/groups.py +70 -0
- gismap/gisgraphs/js.py +190 -0
- gismap/gisgraphs/options.py +37 -0
- gismap/gisgraphs/style.py +119 -0
- gismap/gisgraphs/widget.py +145 -0
- gismap/lab/__init__.py +0 -4
- gismap/lab/egomap.py +6 -7
- gismap/lab/expansion.py +7 -6
- gismap/lab/filters.py +1 -1
- gismap/lab/lab_author.py +50 -6
- gismap/lab/labmap.py +7 -6
- gismap/lab_examples/__init__.py +0 -0
- gismap/lab_examples/cedric.py +46 -0
- gismap/lab_examples/lamsade.py +43 -0
- gismap/{lab → lab_examples}/lincs.py +2 -2
- gismap/{lab → lab_examples}/toulouse.py +20 -3
- gismap/sources/dblp.py +16 -18
- gismap/sources/dblp_ttl.py +168 -0
- gismap/sources/hal.py +19 -10
- gismap/sources/ldb.py +501 -0
- gismap/sources/models.py +7 -0
- gismap/sources/multi.py +25 -17
- gismap/utils/common.py +15 -10
- gismap/utils/logger.py +2 -0
- gismap/utils/requests.py +6 -2
- gismap/utils/zlist.py +68 -0
- {gismap-0.2.2.dist-info → gismap-0.4.0.dist-info}/METADATA +37 -8
- gismap-0.4.0.dist-info/RECORD +43 -0
- {gismap-0.2.2.dist-info → gismap-0.4.0.dist-info}/WHEEL +1 -1
- gismap/lab/vis.py +0 -329
- gismap-0.2.2.dist-info/RECORD +0 -30
- /gismap/{lab → lab_examples}/lip6.py +0 -0
- {gismap-0.2.2.dist-info → gismap-0.4.0.dist-info}/licenses/AUTHORS.md +0 -0
gismap/utils/zlist.py
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
from gismo.common import MixInIO
|
|
2
|
+
import zstandard as zstd
|
|
3
|
+
import numpy as np
|
|
4
|
+
import pickle
|
|
5
|
+
|
|
6
|
+
dctx = zstd.ZstdDecompressor()
|
|
7
|
+
cctx = zstd.ZstdCompressor()
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ZList(MixInIO):
|
|
11
|
+
"""
|
|
12
|
+
List compressed by frames of elements. Allows to store compressed data in memory with decent seek and scan.
|
|
13
|
+
|
|
14
|
+
Parameters
|
|
15
|
+
----------
|
|
16
|
+
frame_size: :class:`int`
|
|
17
|
+
Size of each frame in number of elements.
|
|
18
|
+
"""
|
|
19
|
+
def __init__(self, frame_size=1000):
|
|
20
|
+
self.frame_size = frame_size
|
|
21
|
+
self.frame = None
|
|
22
|
+
self._frame_index = None
|
|
23
|
+
self._blob = None
|
|
24
|
+
self._off = None
|
|
25
|
+
self._n = None
|
|
26
|
+
self._batch = None
|
|
27
|
+
|
|
28
|
+
def _merge_batch(self):
|
|
29
|
+
if self._batch:
|
|
30
|
+
frame = cctx.compress(pickle.dumps(self._batch))
|
|
31
|
+
self._blob += frame
|
|
32
|
+
self._off.append(len(self._blob))
|
|
33
|
+
self._batch = []
|
|
34
|
+
|
|
35
|
+
def append(self, entry):
|
|
36
|
+
self._batch.append(entry)
|
|
37
|
+
self._n += 1
|
|
38
|
+
if len(self._batch) == self.frame_size:
|
|
39
|
+
self._merge_batch()
|
|
40
|
+
|
|
41
|
+
@property
|
|
42
|
+
def size(self):
|
|
43
|
+
return len(self._blob)
|
|
44
|
+
|
|
45
|
+
def __enter__(self):
|
|
46
|
+
self._blob = bytearray()
|
|
47
|
+
self._off = [0]
|
|
48
|
+
self._n = 0
|
|
49
|
+
self._batch = []
|
|
50
|
+
return self
|
|
51
|
+
|
|
52
|
+
def __exit__(self, exc_type, exc_val, exc_tb):
|
|
53
|
+
self._merge_batch()
|
|
54
|
+
self._blob = bytes(self._blob)
|
|
55
|
+
self._off = np.array(self._off, dtype=int)
|
|
56
|
+
|
|
57
|
+
def load_frame(self, f):
|
|
58
|
+
self.frame = pickle.loads(dctx.decompress(self._blob[self._off[f]:self._off[f + 1]]))
|
|
59
|
+
|
|
60
|
+
def __getitem__(self, i):
|
|
61
|
+
g, f = i // self.frame_size, i % self.frame_size
|
|
62
|
+
if g != self._frame_index:
|
|
63
|
+
self.load_frame(g)
|
|
64
|
+
self._frame_index = g
|
|
65
|
+
return self.frame[f]
|
|
66
|
+
|
|
67
|
+
def __len__(self):
|
|
68
|
+
return self._n
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gismap
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 0.4.0
|
|
4
|
+
Summary: GisMap leverages DBLP and HAL databases to provide cartography tools for you and your lab.
|
|
5
5
|
Project-URL: Repository, https://github.com/balouf/gismap
|
|
6
6
|
Project-URL: Documentation, https://balouf.github.io/gismap
|
|
7
7
|
Author-email: Fabien Mathieu <fabien.mathieu@normalesup.org>
|
|
@@ -9,9 +9,14 @@ Maintainer-email: Fabien Mathieu <fabien.mathieu@normalesup.org>
|
|
|
9
9
|
License-Expression: MIT
|
|
10
10
|
License-File: AUTHORS.md
|
|
11
11
|
Requires-Python: >=3.10
|
|
12
|
+
Requires-Dist: beautifulsoup4>=4.14.2
|
|
12
13
|
Requires-Dist: bof>=0.3.5
|
|
14
|
+
Requires-Dist: distinctipy>=1.3.4
|
|
15
|
+
Requires-Dist: domonic>=0.9.13
|
|
13
16
|
Requires-Dist: gismo>=0.5.2
|
|
14
17
|
Requires-Dist: ipykernel>=6.30.1
|
|
18
|
+
Requires-Dist: ipywidgets>=8.1.8
|
|
19
|
+
Requires-Dist: platformdirs>=4.5.0
|
|
15
20
|
Requires-Dist: tqdm>=4.67.1
|
|
16
21
|
Description-Content-Type: text/markdown
|
|
17
22
|
|
|
@@ -19,12 +24,13 @@ Description-Content-Type: text/markdown
|
|
|
19
24
|
|
|
20
25
|
|
|
21
26
|
[](https://pypi.python.org/pypi/gismap)
|
|
27
|
+
[](https://mybinder.org/v2/gh/balouf/gismap/HEAD?urlpath=%2Fdoc%2Ftree%2Fbinder%2Finteractive.ipynb)
|
|
22
28
|
[](https://github.com/balouf/gismap/actions?query=workflow%3Abuild)
|
|
23
29
|
[](https://github.com/balouf/gismap/actions?query=workflow%3Adocs)
|
|
24
30
|
[](https://opensource.org/licenses/MIT)
|
|
25
31
|
[](https://codecov.io/gh/balouf/gismap/tree/main)
|
|
26
32
|
|
|
27
|
-
|
|
33
|
+
GisMap leverages DBLP and HAL databases to provide cartography tools for you and your lab.
|
|
28
34
|
|
|
29
35
|
- Free software: MIT
|
|
30
36
|
- Documentation: <https://balouf.github.io/gismap/>.
|
|
@@ -37,25 +43,48 @@ GISMAP leverages DBLP and HAL databases to provide cartography tools for you and
|
|
|
37
43
|
- Automatically keeps track of a Lab/Department members and publications.
|
|
38
44
|
- Builds interactive collaboration graphs.
|
|
39
45
|
|
|
46
|
+
## Test GisMap online!
|
|
47
|
+
|
|
48
|
+
Don't want to install GisMap on your computer (yet)? No worries, you can play with it using https://mybinder.org/.
|
|
49
|
+
|
|
50
|
+
For example:
|
|
51
|
+
|
|
52
|
+
- [A simple interface to display and save collaboration graphs](https://mybinder.org/v2/gh/balouf/gismap/HEAD?urlpath=%2Fdoc%2Ftree%2Fbinder%2Finteractive.ipynb)
|
|
53
|
+
- [Tutorial: Making LabMaps](https://mybinder.org/v2/gh/balouf/gismap/HEAD?urlpath=%2Fdoc%2Ftree%2Fdocs%2Ftutorials%2Flab_tutorial.ipynb)
|
|
54
|
+
- [Tutorial: Making EgoMaps](https://mybinder.org/v2/gh/balouf/gismap/HEAD?urlpath=%2Fdoc%2Ftree%2Fdocs%2Ftutorials%2Fegomap.ipynb)
|
|
55
|
+
- [Jupyter Lab instance with GisMap installed](https://mybinder.org/v2/gh/balouf/gismap/HEAD)
|
|
56
|
+
|
|
57
|
+
|
|
40
58
|
## Quickstart
|
|
41
59
|
|
|
42
|
-
Install
|
|
60
|
+
Install GisMap:
|
|
43
61
|
|
|
44
62
|
```console
|
|
45
63
|
$ pip install gismap
|
|
46
64
|
```
|
|
47
65
|
|
|
48
|
-
Use
|
|
66
|
+
Use GisMap to display a collaboration graph (HTML) from a Notebook:
|
|
49
67
|
|
|
50
68
|
```pycon
|
|
51
|
-
>>> from gismap.
|
|
52
|
-
>>>
|
|
53
|
-
>>> lab = ListLab(["Fabien Mathieu", "François Baccelli", "Ludovic Noirie", "Céline Comte", "Sébastien Tixeuil"], dbs="hal")
|
|
69
|
+
>>> from gismap.lab import ListMap
|
|
70
|
+
>>> lab = ListMap(["Fabien Mathieu", "François Baccelli", "Ludovic Noirie", "Céline Comte", "Sébastien Tixeuil"], dbs="hal")
|
|
54
71
|
>>> lab.update_authors()
|
|
55
72
|
>>> lab.update_publis()
|
|
56
73
|
>>> lab.show_html()
|
|
57
74
|
```
|
|
58
75
|
|
|
76
|
+
If you are not using Jupyter Lab/Notebook, rich display will not work.
|
|
77
|
+
Instead, save the HTML and display it on your browser:
|
|
78
|
+
|
|
79
|
+
```pycon
|
|
80
|
+
>>> from gismap.lab import ListMap
|
|
81
|
+
>>> lab = ListMap(["Fabien Mathieu", "François Baccelli", "Ludovic Noirie", "Céline Comte", "Sébastien Tixeuil"], dbs="hal")
|
|
82
|
+
>>> lab.update_authors()
|
|
83
|
+
>>> lab.update_publis()
|
|
84
|
+
>>> lab.save_html("my_graph")
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
|
|
59
88
|
## Credits
|
|
60
89
|
|
|
61
90
|
This package was created with [Cookiecutter][CC] and the [Package Helper 3][PH3] project template.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
gismap/__init__.py,sha256=FHZLy3T2zFVrFRe3sqSRTuXkZ6DYise9HtXCWWfXrys,866
|
|
2
|
+
gismap/author.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
gismap/build.py,sha256=1oNs3qjm2DNkOP19iVDPderF2Sx3w5qJH4SgirDHKcU,103
|
|
4
|
+
gismap/gismap.py,sha256=h0hwdogXGFqerm-5ZPeT-irPn91pCcQRjiHThXsRzEk,19
|
|
5
|
+
gismap/gismo.py,sha256=oDAryl4XQzHE0tUmOWC-3G1n_zUgTeykPL-JWSDYwe0,6307
|
|
6
|
+
gismap/search.py,sha256=nsUoDsFGeEtvCZ0dB7ooRPC_6qsazkiWx_oM7dHdNV4,4932
|
|
7
|
+
gismap/gisgraphs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
+
gismap/gisgraphs/builder.py,sha256=La01_OczsSfZ1hu8sq6rdQN_TelBatN8wP3xLF7TwIg,3234
|
|
9
|
+
gismap/gisgraphs/graph.py,sha256=RuUuWdPudrbrDyoGMj2V9SuJGkrsClL_4_4tUMptsjk,7028
|
|
10
|
+
gismap/gisgraphs/groups.py,sha256=1E-7Xrv0uDw2SgqwtdjgeRLVBLaC7agUrrVics4jVLs,2405
|
|
11
|
+
gismap/gisgraphs/js.py,sha256=Gbz5nMWORabZkgIdyZAe1sMlnwJZ9jy7sLrx0vYStzI,6283
|
|
12
|
+
gismap/gisgraphs/options.py,sha256=lmUSnfSwrZQyJpGGs16JUGDIQNcJeX4Y0tA8cyC0nuM,817
|
|
13
|
+
gismap/gisgraphs/style.py,sha256=sXNUnv690kxiJiRQZ7lv4iKKrsxMqAfblheJbqesd48,4653
|
|
14
|
+
gismap/gisgraphs/widget.py,sha256=ccTgmfs1-23aVFnOv09aKMf07pfsEsgeLdcywVELzL8,4537
|
|
15
|
+
gismap/lab/__init__.py,sha256=ifyZqI9BpC5NRlMfSmJ671tnKWJDoXbo18iDoE-VR1s,181
|
|
16
|
+
gismap/lab/egomap.py,sha256=RabRJSWJ0xrG67l012En0rbi7ukr4R2lR0hc_K7Xp0o,1211
|
|
17
|
+
gismap/lab/expansion.py,sha256=CMUsXqo-shRyb_MiuPRL5-ZgaitxAxjfbSY_fvzi_1E,6236
|
|
18
|
+
gismap/lab/filters.py,sha256=pG_g2POQXMbyUUw0aXOaeyiGBbiSc7M2NzxLCTQrALk,1875
|
|
19
|
+
gismap/lab/lab_author.py,sha256=tiv6Z2RUrmfba0zYNS83cPTwN2YyGj7_bcqN2Ak_JXk,4420
|
|
20
|
+
gismap/lab/labmap.py,sha256=jDXFIxe0Jk89wUaweodPxN2thxMgi-hgnqSavhaapZc,5748
|
|
21
|
+
gismap/lab_examples/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
|
+
gismap/lab_examples/cedric.py,sha256=AjgYy5dhzqh3vDsr9ia_hbtSc9_2Ic238rmJO198FMM,1764
|
|
23
|
+
gismap/lab_examples/lamsade.py,sha256=m5uDT9IGpBT1ARknKl44WmFv5b_tLWfvtOjgOThp5fA,1294
|
|
24
|
+
gismap/lab_examples/lincs.py,sha256=-mIVMGQMrtCtJ3N-oCU8j4Ko9mDuhEPB_pA0gaIw4QA,1126
|
|
25
|
+
gismap/lab_examples/lip6.py,sha256=K32Jqe3-o99QYI--akmwBDFAWKgq0HFEk_psC4akR60,1740
|
|
26
|
+
gismap/lab_examples/toulouse.py,sha256=OUKrK0uefn4uvW74qMsF792un203z3OUfKTquLPGBH4,2091
|
|
27
|
+
gismap/sources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
28
|
+
gismap/sources/dblp.py,sha256=FXVsRhrPc0iqsd_a9cMzUYB5YdMxOC4ho3Ip4lCyjtE,4834
|
|
29
|
+
gismap/sources/dblp_ttl.py,sha256=JI_1C7yv1T8TfXMfLNPSFBbCoghYMYoDY7s6K_2arUs,5456
|
|
30
|
+
gismap/sources/hal.py,sha256=VOd7mEUeM0wcfetHYYsX5n4jXNVYQKP12G-iNQsa0XE,10313
|
|
31
|
+
gismap/sources/ldb.py,sha256=KEHREkne7hUy-04VKJOlvzkJQhvKKZJADcvhEBLCgfY,16766
|
|
32
|
+
gismap/sources/models.py,sha256=XlNrQWTF-DQbfIFaSLPsgWPN-c79_0rfr_2jDasgukM,713
|
|
33
|
+
gismap/sources/multi.py,sha256=QlVtuQasznXSXSmJryWFWb2ZmaOOJFoEpgn2Js-IGcc,4709
|
|
34
|
+
gismap/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
|
+
gismap/utils/common.py,sha256=6JhdB_EJnaXwnBGiJutPx5vFEr4wYEvsqKcivVDbGMk,3115
|
|
36
|
+
gismap/utils/logger.py,sha256=zvOPJqC7V6GV4Ov8M9-tnK63c2poDAEcWq_UarOLcpg,117
|
|
37
|
+
gismap/utils/requests.py,sha256=ZSKYJ08MlEtJTHdKYi61KxK6RjYxTBNxWjEUH-EtbbI,1468
|
|
38
|
+
gismap/utils/text.py,sha256=1_9DlduAYh7Nz-yAg-MaCTmdKbPPmuIY20bb87t7JAQ,3810
|
|
39
|
+
gismap/utils/zlist.py,sha256=F66rilTalbRgqiJaPIxDJxKs_2KFOp2ZEH8Ef_CRxYA,1810
|
|
40
|
+
gismap-0.4.0.dist-info/METADATA,sha256=wrptTFqdKckSixC0KEzzQ8pVH5aes2vDfz-5NKFrS-A,3903
|
|
41
|
+
gismap-0.4.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
42
|
+
gismap-0.4.0.dist-info/licenses/AUTHORS.md,sha256=oDR4mptVUBMq0WKIpt19Km1Bdfz3cO2NAOVgwVfTO8g,131
|
|
43
|
+
gismap-0.4.0.dist-info/RECORD,,
|
gismap/lab/vis.py
DELETED
|
@@ -1,329 +0,0 @@
|
|
|
1
|
-
from string import Template
|
|
2
|
-
import uuid
|
|
3
|
-
import json
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
vis_template = Template("""
|
|
7
|
-
<div class="gismap-content">
|
|
8
|
-
<div id="${container_id}"></div>
|
|
9
|
-
<a
|
|
10
|
-
href="https://balouf.github.io/gismap/"
|
|
11
|
-
target="_blank"
|
|
12
|
-
id="gismap-brand"
|
|
13
|
-
style="position: absolute; left: 10px; bottom: 10px; text-decoration: none; color: #888; font-size: min(2vw, 10px);
|
|
14
|
-
z-index: 10; pointer-events: auto;"
|
|
15
|
-
>
|
|
16
|
-
© Gismap 2025
|
|
17
|
-
</a>
|
|
18
|
-
<div id="${modal_id}" class="modal">
|
|
19
|
-
<div class="modal-content">
|
|
20
|
-
<span class="close" id="${modal_close_id}">×</span>
|
|
21
|
-
<div id="${modal_body_id}"></div>
|
|
22
|
-
</div>
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
<style>
|
|
26
|
-
.gismap-content {
|
|
27
|
-
position: relative;
|
|
28
|
-
width: 100%;
|
|
29
|
-
height: 80vh !important;
|
|
30
|
-
max-width: 100vw;
|
|
31
|
-
max-height: 100vh !important;
|
|
32
|
-
}
|
|
33
|
-
/* Styles adaptatifs pour dark/light */
|
|
34
|
-
/* Default: dark mode styles */
|
|
35
|
-
#${container_id} {
|
|
36
|
-
width: 100%;
|
|
37
|
-
height: 100%;
|
|
38
|
-
box-sizing: border-box;
|
|
39
|
-
border: 1px solid #444;
|
|
40
|
-
background: #181818;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.modal {
|
|
44
|
-
display: none;
|
|
45
|
-
position: fixed;
|
|
46
|
-
z-index: 1000;
|
|
47
|
-
left: 0; top: 0;
|
|
48
|
-
width: 100%; height: 100%;
|
|
49
|
-
overflow: auto;
|
|
50
|
-
background-color: rgba(10,10,10,0.85);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.modal-content {
|
|
54
|
-
background-color: #23272e;
|
|
55
|
-
color: #f0f0f0;
|
|
56
|
-
margin: 10% auto;
|
|
57
|
-
padding: 24px;
|
|
58
|
-
border: 1px solid #888;
|
|
59
|
-
width: 50%;
|
|
60
|
-
border-radius: 8px;
|
|
61
|
-
box-shadow: 0 5px 15px rgba(0,0,0,.6);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.close {
|
|
65
|
-
color: #aaa;
|
|
66
|
-
float: right;
|
|
67
|
-
font-size: 28px;
|
|
68
|
-
font-weight: bold;
|
|
69
|
-
cursor: pointer;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.close:hover, .close:focus {
|
|
73
|
-
color: #fff;
|
|
74
|
-
text-decoration: none;
|
|
75
|
-
cursor: pointer;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/* PyData Sphinx Light Theme */
|
|
79
|
-
html[data-theme="light"] #${container_id},
|
|
80
|
-
body[data-jp-theme-light="true"] #${container_id} {
|
|
81
|
-
background: #fff;
|
|
82
|
-
border: 1px solid #ccc;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
html[data-theme="light"] .modal,
|
|
86
|
-
body[data-jp-theme-light="true"] .modal {
|
|
87
|
-
background-color: rgba(220,220,220,0.85);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
html[data-theme="light"] .modal-content,
|
|
91
|
-
body[data-jp-theme-light="true"] .modal-content {
|
|
92
|
-
background: #fff;
|
|
93
|
-
color: #222;
|
|
94
|
-
border: 1px solid #888;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
html[data-theme="light"] .close,
|
|
98
|
-
body[data-jp-theme-light="true"] .close {
|
|
99
|
-
color: #222;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
html[data-theme="light"] .close:hover, html[data-theme="light"] .close:focus,
|
|
103
|
-
body[data-jp-theme-light="true"] .close:hover, body[data-jp-theme-light="true"] .close:focus {
|
|
104
|
-
color: #555;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/* Fallback: system light mode */
|
|
108
|
-
@media (prefers-color-scheme: light) {
|
|
109
|
-
#${container_id} {
|
|
110
|
-
background: #fff;
|
|
111
|
-
border: 1px solid #ccc;
|
|
112
|
-
}
|
|
113
|
-
.modal {
|
|
114
|
-
background-color: rgba(220,220,220,0.85);
|
|
115
|
-
}
|
|
116
|
-
.modal-content {
|
|
117
|
-
background: #fff;
|
|
118
|
-
color: #222;
|
|
119
|
-
border: 1px solid #888;
|
|
120
|
-
}
|
|
121
|
-
.close {
|
|
122
|
-
color: #222;
|
|
123
|
-
}
|
|
124
|
-
.close:hover, .close:focus {
|
|
125
|
-
color: #555;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
</style>
|
|
129
|
-
<script type="text/javascript">
|
|
130
|
-
(function() {
|
|
131
|
-
// Détection du thème
|
|
132
|
-
function getTheme() {
|
|
133
|
-
// Try PyData Sphinx theme on <html>
|
|
134
|
-
const pydataTheme = document.documentElement.getAttribute("data-theme");
|
|
135
|
-
if (pydataTheme === "dark" || pydataTheme === "light") {
|
|
136
|
-
return pydataTheme;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// Try JupyterLab theme on <body>
|
|
140
|
-
const jupyterLabTheme = document.body.getAttribute("data-jp-theme-name");
|
|
141
|
-
if (jupyterLabTheme) {
|
|
142
|
-
// Simplify theme name to 'dark' or 'light'
|
|
143
|
-
const lowerName = jupyterLabTheme.toLowerCase();
|
|
144
|
-
if (lowerName.includes("dark")) {
|
|
145
|
-
return "dark";
|
|
146
|
-
}
|
|
147
|
-
if (lowerName.includes("light")) {
|
|
148
|
-
return "light";
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// Fallback to system preference
|
|
153
|
-
return window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? "dark" : "light";
|
|
154
|
-
};
|
|
155
|
-
function getVisOptions(theme) {
|
|
156
|
-
if (theme === 'dark') {
|
|
157
|
-
return {
|
|
158
|
-
nodes: {
|
|
159
|
-
shape: 'circle', size: 20,
|
|
160
|
-
font: { size: 16, color: '#f0f0f0' },
|
|
161
|
-
color: {
|
|
162
|
-
background: '#222e3c',
|
|
163
|
-
border: '#5d90f5',
|
|
164
|
-
highlight: { background: '#2f3d4d', border: '#f5a25d' }
|
|
165
|
-
},
|
|
166
|
-
borderWidth: 2
|
|
167
|
-
},
|
|
168
|
-
edges: {
|
|
169
|
-
width: 2,
|
|
170
|
-
color: { color: '#888', highlight: '#f5a25d' },
|
|
171
|
-
smooth: { type: 'continuous' }
|
|
172
|
-
},
|
|
173
|
-
interaction: { hover: true }
|
|
174
|
-
};
|
|
175
|
-
} else {
|
|
176
|
-
return {
|
|
177
|
-
nodes: {
|
|
178
|
-
shape: 'circle', size: 20,
|
|
179
|
-
font: { size: 16, color: '#222' },
|
|
180
|
-
color: {
|
|
181
|
-
background: '#e3eaff',
|
|
182
|
-
border: '#3d6cf7',
|
|
183
|
-
highlight: { background: '#fffbe6', border: '#f5a25d' }
|
|
184
|
-
},
|
|
185
|
-
borderWidth: 2
|
|
186
|
-
},
|
|
187
|
-
edges: {
|
|
188
|
-
width: 2,
|
|
189
|
-
color: { color: '#848484', highlight: '#f5a25d' },
|
|
190
|
-
smooth: { type: 'continuous' }
|
|
191
|
-
},
|
|
192
|
-
interaction: { hover: true }
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
var physics = {
|
|
198
|
-
physics: {
|
|
199
|
-
solver: "forceAtlas2Based",
|
|
200
|
-
forceAtlas2Based: {
|
|
201
|
-
gravitationalConstant: -50,
|
|
202
|
-
centralGravity: 0.01,
|
|
203
|
-
springLength: 200,
|
|
204
|
-
springConstant: 0.08,
|
|
205
|
-
damping: 0.98,
|
|
206
|
-
avoidOverlap: 1
|
|
207
|
-
},
|
|
208
|
-
maxVelocity: 10,
|
|
209
|
-
minVelocity: 0.9,
|
|
210
|
-
stabilization: {
|
|
211
|
-
enabled: true,
|
|
212
|
-
iterations: 2000,
|
|
213
|
-
updateInterval: 50,
|
|
214
|
-
onlyDynamicEdges: false,
|
|
215
|
-
fit: true
|
|
216
|
-
},
|
|
217
|
-
timestep: 0.25
|
|
218
|
-
}
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
function renderNetwork() {
|
|
222
|
-
const nodes = new vis.DataSet(${nodes_json});
|
|
223
|
-
const edges = new vis.DataSet(${edges_json});
|
|
224
|
-
const container = document.getElementById('${container_id}');
|
|
225
|
-
let network = null;
|
|
226
|
-
const theme = getTheme();
|
|
227
|
-
const options = getVisOptions(theme);
|
|
228
|
-
network = new vis.Network(container, { nodes: nodes, edges: edges }, options);
|
|
229
|
-
network.setOptions(physics)
|
|
230
|
-
// Tooltip survol
|
|
231
|
-
network.on("hoverNode", function(params) {
|
|
232
|
-
const node = nodes.get(params.node);
|
|
233
|
-
network.body.container.title = node.hover || '';
|
|
234
|
-
});
|
|
235
|
-
network.on("blurNode", function(params) {
|
|
236
|
-
network.body.container.title = '';
|
|
237
|
-
});
|
|
238
|
-
network.on("hoverEdge", function(params) {
|
|
239
|
-
const edge = edges.get(params.edge);
|
|
240
|
-
network.body.container.title = edge.hover || '';
|
|
241
|
-
});
|
|
242
|
-
network.on("blurEdge", function(params) {
|
|
243
|
-
network.body.container.title = '';
|
|
244
|
-
});
|
|
245
|
-
// Modal overlay
|
|
246
|
-
const modal = document.getElementById('${modal_id}');
|
|
247
|
-
const modalBody = document.getElementById('${modal_body_id}');
|
|
248
|
-
const modalClose = document.getElementById('${modal_close_id}');
|
|
249
|
-
network.on("click", function(params) {
|
|
250
|
-
if (params.nodes.length === 1) {
|
|
251
|
-
const node = nodes.get(params.nodes[0]);
|
|
252
|
-
modalBody.innerHTML = node.overlay || '';
|
|
253
|
-
modal.style.display = "block";
|
|
254
|
-
} else if (params.edges.length === 1) {
|
|
255
|
-
const edge = edges.get(params.edges[0]);
|
|
256
|
-
modalBody.innerHTML = edge.overlay || '';
|
|
257
|
-
modal.style.display = "block";
|
|
258
|
-
} else {
|
|
259
|
-
modal.style.display = "none";
|
|
260
|
-
}
|
|
261
|
-
});
|
|
262
|
-
modalClose.onclick = function() { modal.style.display = "none"; };
|
|
263
|
-
window.onclick = function(event) {
|
|
264
|
-
if (event.target == modal) { modal.style.display = "none"; }
|
|
265
|
-
};
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
function loadVisAndRender() {
|
|
269
|
-
if (typeof vis === 'undefined') {
|
|
270
|
-
var script = document.createElement('script');
|
|
271
|
-
script.src = "https://unpkg.com/vis-network/standalone/umd/vis-network.min.js";
|
|
272
|
-
script.type = "text/javascript";
|
|
273
|
-
script.onload = function() {
|
|
274
|
-
console.log("vis-network loaded dynamically");
|
|
275
|
-
renderNetwork(); // Graph init after vis is loaded
|
|
276
|
-
};
|
|
277
|
-
document.head.appendChild(script);
|
|
278
|
-
} else {
|
|
279
|
-
console.log("vis-network already loaded");
|
|
280
|
-
renderNetwork(); // Graph init immediately
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
loadVisAndRender();
|
|
284
|
-
|
|
285
|
-
// Adapter dynamiquement si le thème change
|
|
286
|
-
window.addEventListener("theme-changed", () => loadVisAndRender());
|
|
287
|
-
const observer = new MutationObserver(mutations => {
|
|
288
|
-
for (const mutation of mutations) {
|
|
289
|
-
if (mutation.type === "attributes" && mutation.attributeName === "data-jp-theme-name") {
|
|
290
|
-
loadVisAndRender();
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
});
|
|
294
|
-
observer.observe(document.body, { attributes: true });
|
|
295
|
-
if (window.matchMedia) {
|
|
296
|
-
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => loadVisAndRender());
|
|
297
|
-
};
|
|
298
|
-
})();
|
|
299
|
-
</script>
|
|
300
|
-
""")
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
def generate_html(nodes, edges):
|
|
304
|
-
"""
|
|
305
|
-
Parameters
|
|
306
|
-
----------
|
|
307
|
-
nodes: :class:`list`
|
|
308
|
-
edges: :class:`list`
|
|
309
|
-
|
|
310
|
-
Returns
|
|
311
|
-
-------
|
|
312
|
-
:class:`str`
|
|
313
|
-
"""
|
|
314
|
-
uid = str(uuid.uuid4())[:8] # identifiant unique pour éviter les collisions
|
|
315
|
-
container_id = f"mynetwork_{uid}"
|
|
316
|
-
modal_id = f"modal_{uid}"
|
|
317
|
-
modal_body_id = f"modal_body_{uid}"
|
|
318
|
-
modal_close_id = f"modal_close_{uid}"
|
|
319
|
-
nodes_json = json.dumps(nodes)
|
|
320
|
-
edges_json = json.dumps(edges)
|
|
321
|
-
dico = {
|
|
322
|
-
"container_id": container_id,
|
|
323
|
-
"modal_id": modal_id,
|
|
324
|
-
"modal_body_id": modal_body_id,
|
|
325
|
-
"modal_close_id": modal_close_id,
|
|
326
|
-
"nodes_json": nodes_json,
|
|
327
|
-
"edges_json": edges_json,
|
|
328
|
-
}
|
|
329
|
-
return vis_template.substitute(dico) # html_template
|
gismap-0.2.2.dist-info/RECORD
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
gismap/__init__.py,sha256=wZhnsqnlouh2Ugsb4L36K9QG8IEGrvI7s9biEv6LjRw,735
|
|
2
|
-
gismap/author.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
gismap/gismap.py,sha256=h0hwdogXGFqerm-5ZPeT-irPn91pCcQRjiHThXsRzEk,19
|
|
4
|
-
gismap/gismo.py,sha256=oDAryl4XQzHE0tUmOWC-3G1n_zUgTeykPL-JWSDYwe0,6307
|
|
5
|
-
gismap/search.py,sha256=nsUoDsFGeEtvCZ0dB7ooRPC_6qsazkiWx_oM7dHdNV4,4932
|
|
6
|
-
gismap/lab/__init__.py,sha256=xYLZzcXn9oNbD3nNF3sLGvy_uvRkFnBoOS6fQeB3iZw,426
|
|
7
|
-
gismap/lab/egomap.py,sha256=eH2FOoB7rD4-UA3__nq9gmgNJRB6FcyCKmbgi4CviQA,1348
|
|
8
|
-
gismap/lab/expansion.py,sha256=bolmFhotkjFywUmjaqWqyZGzAmHauM5F4MTcTMeH9gI,6204
|
|
9
|
-
gismap/lab/filters.py,sha256=eNEqg7vChmXE2y-TfWghpIy1fHKUFrJ4NRsSCihFeFs,1852
|
|
10
|
-
gismap/lab/graph.py,sha256=B7S63clj4tEOnuGugDmPahCqkKbuOuuvJEcabHmBDPk,6764
|
|
11
|
-
gismap/lab/lab_author.py,sha256=jQhq1spZP5P-Bpzr5E_OP73gWy3SG6UjiVCGotjm57s,2439
|
|
12
|
-
gismap/lab/labmap.py,sha256=H1ESWeoQdVN9jWaKIzErsFi0DE51BoPiu1Di4VtVnaE,5680
|
|
13
|
-
gismap/lab/lincs.py,sha256=RblzZOkfY99dcMj_NIStFMSwmBTlACgG9LKgs9l1iU0,1103
|
|
14
|
-
gismap/lab/lip6.py,sha256=K32Jqe3-o99QYI--akmwBDFAWKgq0HFEk_psC4akR60,1740
|
|
15
|
-
gismap/lab/toulouse.py,sha256=SsQmjGIaq_ZKOPu4u-bXpehjWsWbdMvsvNlxQLstg4w,1510
|
|
16
|
-
gismap/lab/vis.py,sha256=YwMkoSa3-IsoNooQgZbluvIrQsYRbti1dlVRewypBNY,8734
|
|
17
|
-
gismap/sources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
-
gismap/sources/dblp.py,sha256=_AgPgDbHYYaeJVam43eExv1VsglvAV46eP77RL7o9Fo,5278
|
|
19
|
-
gismap/sources/hal.py,sha256=FZVKB1mjOYZMXk7M5VrpzH_IDPYjW0snFKfa5BT73vI,10021
|
|
20
|
-
gismap/sources/models.py,sha256=yJPBXcJO6MgOrSXgpGPepHDDtniJP1OsK8OSz__VzYc,543
|
|
21
|
-
gismap/sources/multi.py,sha256=UNVFiCgV-2xiEgKix2Ava6260008HmCS664K0EB3LbU,4387
|
|
22
|
-
gismap/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
23
|
-
gismap/utils/common.py,sha256=nx1f60yNwFpl1oz08h-R5o0xK9CbJv9tmYLDk61dwYA,2898
|
|
24
|
-
gismap/utils/logger.py,sha256=1YALIaNYKTqeIyyCnYxzvZTK7x4FTSfYYl5CP9IMw8E,86
|
|
25
|
-
gismap/utils/requests.py,sha256=DA-ifVMdcOtipDSqYdVRQi-7CGR5WCTYiGyZ7Xu78q0,1291
|
|
26
|
-
gismap/utils/text.py,sha256=1_9DlduAYh7Nz-yAg-MaCTmdKbPPmuIY20bb87t7JAQ,3810
|
|
27
|
-
gismap-0.2.2.dist-info/METADATA,sha256=vAHxaSUyILKqv9brEdkaxFWA6vRSQTDzOAg2ifZw-44,2542
|
|
28
|
-
gismap-0.2.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
29
|
-
gismap-0.2.2.dist-info/licenses/AUTHORS.md,sha256=oDR4mptVUBMq0WKIpt19Km1Bdfz3cO2NAOVgwVfTO8g,131
|
|
30
|
-
gismap-0.2.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|