Bridges-Python 3.5.0-dev1
Bridges(Python API)
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
bridges.us_map.USMap Class Reference

This class provides an API to building, displaying and manipulating US maps and counties in BRIDGES. More...

Inheritance diagram for bridges.us_map.USMap:
bridges.map.Map

Public Member Functions

 get_projection (self)
 
 get_overlay (self)
 
 get_data_structure_type (self)
 Getter for the data structure type as a JSON string Returns str the data structure type.
 
 get_data_structure_representation (self)
 Getter for the data structure's JSON representatoin.
 
 get_map_representation (self)
 gets the JSON representation of the map data
 
 __init__ (self, states=None)
 Constructor: creates an object with the given state data.
 

Public Attributes

 all
 

Protected Member Functions

 _county_to_obj (self, co)
 
 _state_to_obj (self, st)
 

Protected Attributes

 _all
 
 _states
 

Properties

 states = property
 Returns a list of USState objects.
 

Detailed Description

This class provides an API to building, displaying and manipulating US maps and counties in BRIDGES.

In the current implementation, we can draw a US map with all state boundaries, a map with all US state and county boundaries, or specify a set of states and display the state and/or county boundaries.

Functions are provided to access each US state or county and color its boundary or its interior using the stroke color and fill color functions. This lets us build map based applications where the fill fill color can be used to represent different data attributes, such population counts, election statistics or any attribute at the state or county level.

See the Maps tutorials for examples of the usage of the US Map API at https://bridgesuncc.github.io/tutorials/Map.html

Constructor & Destructor Documentation

◆ __init__()

bridges.us_map.USMap.__init__ (   self,
  states = None 
)

Constructor: creates an object with the given state data.

   @param states state and county information for a set of states

Reimplemented from bridges.map.Map.

Member Function Documentation

◆ _county_to_obj()

bridges.us_map.USMap._county_to_obj (   self,
  co 
)
protected

◆ _state_to_obj()

bridges.us_map.USMap._state_to_obj (   self,
  st 
)
protected

◆ get_data_structure_representation()

bridges.us_map.USMap.get_data_structure_representation (   self)

Getter for the data structure's JSON representatoin.

Returns
str the data structure representation

◆ get_data_structure_type()

bridges.us_map.USMap.get_data_structure_type (   self)

Getter for the data structure type as a JSON string Returns str the data structure type.

◆ get_map_representation()

bridges.us_map.USMap.get_map_representation (   self)

gets the JSON representation of the map data

   Uses functions to convert the state and country attributes to objects
   before serialization into a JSON string

Reimplemented from bridges.map.Map.

◆ get_overlay()

bridges.us_map.USMap.get_overlay (   self)

Reimplemented from bridges.map.Map.

◆ get_projection()

bridges.us_map.USMap.get_projection (   self)

Reimplemented from bridges.map.Map.

Member Data Documentation

◆ _all

bridges.us_map.USMap._all
protected

◆ _states

bridges.us_map.USMap._states
protected

◆ all

bridges.us_map.USMap.all

Property Documentation

◆ states

bridges.us_map.USMap.states = property
static

Returns a list of USState objects.


The documentation for this class was generated from the following file: