bibliometa_vis package

Submodules

bibliometa_vis.config module

This file provides constants used throughout other modules.

bibliometa_vis.visualization module

This module provides classes and functions to visualize network data on geographical maps.

class bibliometa_vis.visualization.Map(**kwargs)[source]

Bases: bibliometa.configuration.BibliometaConfiguration

The Map provides functions to visualize geographical network data on a map.

get_config(*args)

Get configuration. If no args given, the full configuration is returned. Otherwise, only the configuration parameters given in args are returned.

Returns

The calling instance if no args given, else a Config object

Return type

bibliometa.configuration.BibliometaConfiguration or bibliometa.configuration.Config

set_config(**kwargs)

Set configuration for key-value pairs given in kwargs.

Returns

The calling instance

Return type

bibliometa.configuration.BibliometaConfiguration

start()[source]

Start visualization.

class bibliometa_vis.visualization.MapUtils[source]

Bases: object

The MapUtils provides utilities for the Map class.

static convert_to_gdf(csv_input, crs, csv_sep)[source]

Convert long/lat to Point objects.

Parameters
  • csv_input (str) – Path to CSV input file with long/lat information

  • crs (str) – Coordinate Reference System

  • csv_sep (str) – CSV separator in input file

static read_shp(f, color='grey', verbose=False)[source]

Read shapefile.

Parameters
  • f (str) – Path to shapefile

  • color (str) – Color of shapefile background

  • verbose (bool) – Verbose parameter

Returns

Shapefile

Return type

GeoDataFrame

class bibliometa_vis.visualization.Plotting[source]

Bases: object

The Plotting provides functions to plot network data.

static cities(df, shp, config)[source]

Plot cities on a certain map.

Parameters
  • df (pandas.DataFrame) – DataFrame with city information

  • shp (GeoDataFrame) – Shapefile

  • config (bibliometa.configuration.Config) – Configuration object

static degrees(df, shp, nodes, config)[source]

Plot graph with node degrees.

Parameters
  • df (pandas.DataFrame) – DataFrame with city information

  • nodes (dict) – Graph nodes with their degrees

  • shp (GeoDataFrame) – Shapefile

  • config (bibliometa.configuration.Config) – Configuration object

static graph_on_map(shapes, subgraph, attributes, pos, df, config)[source]

Plot graph on a map.

Parameters
  • shapes (list) – An iterator of shapely geometries from a shapefile

  • subgraph (networkx.Graph) – Largest component of graph

  • attributes (dict) – Dictionary of graph degrees, labels and sizes

  • pos (dict) – Dictionary of node positions

  • df (pandas.DataFrame) – DataFrame with coordinates

  • config (bibliometa.configuration.Config) – Configuration object

static scatter(df, config)[source]

Create scatter plot.

Parameters
  • df (pandas.DataFrame) – DataFrame with ‘lng’ and ‘lat’ column

  • config (bibliometa.configuration.Config) – Configuration object

Module contents

Visualization subpackage for Bibliometa-Vis.