22 #include <rapidjson/document.h>
23 #include <rapidjson/stringbuffer.h>
24 #include <rapidjson/writer.h>
27 namespace datastructure {
54 vector<string> state_names;
55 vector<USState> state_data;
57 virtual const string getDataStructureRepresentation ()
101 for (
auto& st : state_data) {
106 + st.getStrokeColor().getCSSRepresentation() +
COMMA +
110 st.getFillColor().getCSSRepresentation() +
COMMA +
117 for (
auto& c : st.getCounties()) {
128 c.second.getStrokeColor().getCSSRepresentation() +
COMMA +
132 c.second.getFillColor().getCSSRepresentation() +
COMMA +
138 if (st.getCounties().size())
139 map_str = map_str.substr(0, map_str.size() - 1);
143 map_str = map_str.substr(0, map_str.size() - 1) +
CLOSE_BOX;
276 state_data = st_data;
296 state_data = st_data;
This is the superclass of all data structure types in BRIDGES.
Definition: DataStructure.h:74
Abstract class for Map API.
Definition: Map.h:16
This class provides an API to building, displaying and manipulating US maps and counties in BRIDGES.
Definition: USMap.h:52
virtual const string getMapRepresentation() const override
Generates the JSON representation of the US map.
Definition: USMap.h:97
void setStateData(vector< USState > st_data)
Definition: USMap.h:295
vector< USState > & getMapData()
Definition: USMap.h:285
virtual const string getDStype() const override
Definition: USMap.h:306
const string getProjection() const override
Gets the type of map projection. For US map we currently use albersusa.
Definition: USMap.h:80
USMap(vector< USState > st_data)
Definition: USMap.h:275
const bool getOverlay() const override
Gets the map overlay flag.
Definition: USMap.h:88
std::string JSONencode(const T &d)
Definition: JSONutil.h:38
Support for drawing Bar charts.
Definition: alltypes.h:4
const string COLON
Definition: DataStructure.h:52
const string OPEN_BOX
Definition: DataStructure.h:55
const string COMMA
Definition: DataStructure.h:51
const string OPEN_CURLY
Definition: DataStructure.h:53
const string CLOSE_BOX
Definition: DataStructure.h:56
const string CLOSE_CURLY
Definition: DataStructure.h:54
const string QUOTE
Definition: DataStructure.h:50