VisJS network interface#

VisJS offers nice graph displays.

gismap.gisgraphs.builder.make_vis(lab, **kwargs)[source]#
Parameters:
  • lab (LabMap) – Lab to display.

  • uid (str) – Unique identifier.

  • vis_url (str) – Location of visJS network.

Returns:

HTML code.

Return type:

str

gismap.gisgraphs.graph.author_html(author)[source]#
Parameters:

author (Author) – Searcher.

Return type:

HTML string with URL if applicable.

gismap.gisgraphs.graph.initials(name)[source]#
Parameters:

name (str) – Person’s name.

Returns:

Person’s initials (2 letters only).

Return type:

str

gismap.gisgraphs.graph.lab_to_graph(lab)[source]#
Parameters:

lab (LabMap) – A lab populated with searchers and publications.

Returns:

Collaboration graph.

Return type:

str

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 (list of Publication) – 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

gismap.gisgraphs.graph.to_edge(k, v, searchers)[source]#
Parameters:
  • k (tuple) – Keys of the searchers involved.

  • v (list) – List of joint publications.

  • searchers (dict) – Searchers.

Returns:

A display-ready representation of the collaboration edge.

Return type:

dict

gismap.gisgraphs.graph.to_node(s, node_pubs)[source]#
Parameters:
  • s (LabAuthor) – Searcher.

  • node_pubs (dict) – Lab publications.

Returns:

A display-ready representation of the searcher.

Return type:

dict

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"
gismap.gisgraphs.widget.safe_filename(name)[source]#
Parameters:

name (str) – Pretty much anything.

Returns:

Gismap filename.

Return type:

str