VisJS network interface#
VisJS offers nice graph displays.
- gismap.gisgraphs.builder.make_vis(lab, **kwargs)[source]#
Generate HTML visualization of a lab’s collaboration network.
- Parameters:
lab (
LabMap) – Lab to display.uid (
str, optional) – Unique identifier for DOM elements. Auto-generated if not provided.vis_url (
str, optional) – URL to vis-network library.groups (
dict, optional) – Group styling configuration.draw_legend (
bool, optional) – Whether to draw the legend. Defaults to True if multiple groups.physics (
dict, optional) – Physics engine configuration.nodes_options (
dict, optional) – Node styling options.edges_options (
dict, optional) – Edge styling options.interaction_options (
dict, optional) – Interaction settings.style (
string.Template, optional) – CSS template.script (
string.Template, optional) – JavaScript template.
- Returns:
HTML code as a string.
- Return type:
- gismap.gisgraphs.graph.author_html(author)[source]#
- Parameters:
author (
Author) – Author.- Return type:
HTML string with URL if applicable.
- gismap.gisgraphs.graph.lab_to_graph(lab)[source]#
- Parameters:
lab (
LabMap) – A lab populated with authors and publications.- Returns:
Collaboration graph.
- Return type:
Examples
>>> from gismap.lab import ListMap as Map >>> lab = Map(author_list=['Tixeuil Sébastien', 'Mathieu Fabien'], name='mini', dbs="hal") >>> lab.update_authors() >>> lab.update_publis() >>> len(lab.authors) 2 >>> 330 < len(lab.publications) < 430 True >>> nodes, edges = lab_to_graph(lab) >>> nodes[0]['group'] 'mini' >>> edges[0]['hover'] 'Show joint publications from Mathieu Fabien and Tixeuil Sébastien' >>> html = lab.html(groups={"mini": {"color": "#777"}})
- gismap.gisgraphs.graph.pub_html(pub)[source]#
- Parameters:
pub (
Publication) – Publication.- Return type:
HTML string with hyperlinks where applicable.
- gismap.gisgraphs.graph.publications_list(publications, n=10)[source]#
- Parameters:
publications (
listofPublication) – Publications to display.n (
int, default=10) – Number of publications to display. If there are more publications, a Show more option is available to unravel them.
- Return type:
ul
- class gismap.gisgraphs.widget.GismapWidget[source]#
A simple widget to test the production of LabMaps and EgoMaps.
Examples
This is a doctest example. Use a notebook to play with the widget.
>>> gw = GismapWidget() VBox(children=(HTML(value=''), Output(), HBox(children=(Textarea(value='', ... >>> gw.names.value = "Fabien Mathieu" >>> gw.dbs.value = "HAL" >>> gw.size.value = 3 >>> gw.compute_function(gw.compute, show=False) >>> gw.save_link.value[:30] "<a href='data:text/html;base64" >>> gw.names.value = "Diego Perino, Laurent Viennot" >>> gw.compute_function(gw.compute, show=False) >>> gw.save_link.value[:30] "<a href='data:text/html;base64"