![]() |
Bridges-Python 3.5.0-dev1
Bridges(Python API)
|
This class provides an API to building, displaying and manipulating US maps and counties in BRIDGES. More...
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. | |
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
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.
|
protected |
|
protected |
bridges.us_map.USMap.get_data_structure_representation | ( | self | ) |
Getter for the data structure's JSON representatoin.
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.
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.
bridges.us_map.USMap.get_overlay | ( | self | ) |
Reimplemented from bridges.map.Map.
bridges.us_map.USMap.get_projection | ( | self | ) |
Reimplemented from bridges.map.Map.
|
protected |
|
protected |
bridges.us_map.USMap.all |
|
static |
Returns a list of USState objects.