Bridges-Java
3.4.3
Bridges(Java API)
|
The Bridges class is the main class that provides interfaces to datasets, maintains user and assignment information, and connects to the Bridges server.
The Bridges class is responsible for initializing the Bridges system, specifying parameters (user id, assignment id, title, description, data structure type, etc) for the student assignment, generating the data structure representation and transmission to the Bridges server. In addition, it provides interfaces to a number of real-world datasets, that makes it easy to access the data for use algorithms/data structure assignments.
Datasets. The datasets that are currently supported through the BRIDGES API include USGS Earthquake Data, IMDB Actor/Movie Data (2 versions), Gutenberg Book Collection Meta Data, a Video Game Dataset and Shakespeare Dataset. More information is found in the respective methods (below) and at
https://bridgesuncc.github.io/datasets.html
A typical Bridges program includes creating the Bridges object, followed by creation of the data structure by the user, assigning visual attributes to elements of the data structure, followed by specification of the data structure type and the call to visualize the data structure (Bridges::setDataStructure() and visualize() methods).
Public Member Functions | |
Bridges () | |
DataSource | getDataSource () |
get the current data source object being used by BRIDGES More... | |
Bridges (int assignment, String username, String appl_id) | |
void | setTitle (String title) |
Change the title of the assignment. More... | |
void | setDescription (String description) |
Change the textual description of the assignment. More... | |
void | setServer (String server) |
sets the server type. More... | |
void | setMapOverlay (Boolean flag) |
Turns on map overlay for subsequent visualizations - used with location specific datasets. More... | |
void | setMap (String map, String info) |
Sets the type of map overlay to use. More... | |
void | setDisplayMode (String mode) throws IllegalArgumentException |
void | setCoordSystemType (String coord) |
Sets the coordinate system type. More... | |
void | setWindow (int x1, int x2, int y1, int y2) |
Specify the window that will be used to render the view by default. More... | |
void | setWindow (float x1, float x2, float y1, float y2) |
Specify the window that will be used to render the view by default. More... | |
void | setWindow (double x1, double x2, double y1, double y2) |
Specify the window that will be used to render the view by default. More... | |
boolean | getJSONFlag () |
Flag to control printing the JSON of the data structure. Used only for debugging BRIDGES. More... | |
void | setJSONFlag (boolean flag) |
void | setLabelFlag (boolean flag) |
void | postVisualizationLink (boolean link_url_flag) |
void | setDataStructure (DataStruct ds) throws NullPointerException |
Provide BRIDGES a handle to the data structure to be visualized. More... | |
void | clearAssignment () |
void | visualize () throws IOException, RateLimitException |
String | getVisualizeURL () |
Static Public Member Functions | |
static void | setDebugFlag (Boolean flag) |
sets a debug flag, used for debugging BRIDGES More... | |
static Boolean | getDebugFlag () |
gets the debug flag value, used for debugging BRIDGES More... | |
static String | getAssignment () |
Get the assignment id. More... | |
static int | getAssignmentID () |
Get the assignment id as an integer. More... | |
static void | setAssignment (int assignment) |
static String | getUserName () |
static void | setUserName (String userName) |
static String | getKey () |
static void | setKey (String key) |
Protected Member Functions | |
void | init (int assignment, String username, String appl_id) |
Package Functions | |
String | getJSONHeader () |
String | getServerURL () |
Static Package Attributes | |
static String | vis_type |
static String | title = "" |
static String | description = "" |
static Integer | MaxDescrSize = 1000 |
static String | COMMA = "," |
static String | COLON = ":" |
static String | OPEN_CURLY = "{" |
static String | CLOSE_CURLY = "}" |
static String | OPEN_PAREN = "(" |
static String | CLOSE_PAREN = ")" |
static String | OPEN_BOX = "[" |
static String | CLOSE_BOX = "]" |
bridges.connect.Bridges.Bridges | ( | ) |
Constructors
If the FORCE_BRIDGES_APIKEY environment variable is set, use the environment variable as APIkey in all cases.
If the FORCE_BRIDGES_USERNAME environment variable is set, use the environment variable as username in all cases.
If the FORCE_BRIDGES_ASSIGNMENT environment variable is set, use the environment variable as assignment number in all cases.
bridges.connect.Bridges.Bridges | ( | int | assignment, |
String | username, | ||
String | appl_id | ||
) |
Initialize Bridges (Constructor)
If the FORCE_BRIDGES_APIKEY environment variable is set, use the environment variable as APIkey in all cases.
If the FORCE_BRIDGES_USERNAME environment variable is set, use the environment variable as username in all cases.
If the FORCE_BRIDGES_ASSIGNMENT environment variable is set, use the environment variable as assignment number in all cases.
assignment | this is the assignmen id (integer) |
appl_id | this is the appl authentication key(from the Bridges account) |
username | this is the username (from the Bridges account) |
void bridges.connect.Bridges.clearAssignment | ( | ) |
This method deletes the user's current assignment from the Bridges server
IOException |
|
static |
Get the assignment id.
|
static |
Get the assignment id as an integer.
DataSource bridges.connect.Bridges.getDataSource | ( | ) |
get the current data source object being used by BRIDGES
|
static |
gets the debug flag value, used for debugging BRIDGES
boolean bridges.connect.Bridges.getJSONFlag | ( | ) |
Flag to control printing the JSON of the data structure. Used only for debugging BRIDGES.
|
package |
|
static |
Get application key
|
package |
|
static |
This exists to prevent duplicate error traces.
String bridges.connect.Bridges.getVisualizeURL | ( | ) |
|
protected |
void bridges.connect.Bridges.postVisualizationLink | ( | boolean | link_url_flag | ) |
This method is used to suppress the visualization link that is usually printed to the console
link_url_flag | - flag that controls if the link is printed to console |
|
static |
set the assignment id
assignment | number (int) |
void bridges.connect.Bridges.setCoordSystemType | ( | String | coord | ) |
Sets the coordinate system type.
Coordinate system type options are: ['cartesian', 'albersusa', 'equirectangular', 'window'], and 'cartesian' is the default; The "window" option only works for graphs and will automatically scale the view on the browser to include all vertices which have a fixed location. A different window can be specified using setWindow().
coord | this is the desired coordinate space |
void bridges.connect.Bridges.setDataStructure | ( | DataStruct | ds | ) | throws NullPointerException |
Provide BRIDGES a handle to the data structure to be visualized.
This method sets the handle to the current data structure; this can be an array, the head of a linked list, root of a tree structure, a graph Arrays of upto 3 dimensions are suppported. It can be any of the data structures supported by BRIDGES. Polymorphism and type casting is used to determine the actual data structure and extract its representtion.
ds | The data structure to set (any of the subclasses of DataStruct) |
|
static |
sets a debug flag, used for debugging BRIDGES
flag | boolean |
void bridges.connect.Bridges.setDescription | ( | String | description | ) |
Change the textual description of the assignment.
This description is capped at MaxDescrSize characters.
description | description to annotate the visualization; |
void bridges.connect.Bridges.setDisplayMode | ( | String | mode | ) | throws IllegalArgumentException |
Set the current assignment display mode to slide or stack, or throw an error;
mode | One of: ['slide', 'stack']. |
void bridges.connect.Bridges.setJSONFlag | ( | boolean | flag | ) |
flag | the flag to print the JSON represenation of the data structure to standard output. Used for debugging BRIDGES |
|
static |
Set application key
key | application key value (string) |
void bridges.connect.Bridges.setLabelFlag | ( | boolean | flag | ) |
flag | the flag to turn labels on/off on the entire visualization |
void bridges.connect.Bridges.setMap | ( | String | map, |
String | info | ||
) |
Sets the type of map overlay to use.
map | this is an Array describing the map overlay. The first element of the array is which map to use: "world" or "us" and the second element is what attribute from the map to show: a country from world map, or a state from US map. |
void bridges.connect.Bridges.setMapOverlay | ( | Boolean | flag | ) |
Turns on map overlay for subsequent visualizations - used with location specific datasets.
flag | this is the boolean flag for displaying a map overlay |
void bridges.connect.Bridges.setServer | ( | String | server | ) |
sets the server type.
Options are: ['live', 'local', 'clone'], and 'live' is the default;
server | server to which to connect. |
void bridges.connect.Bridges.setTitle | ( | String | title | ) |
Change the title of the assignment.
The title is capped at MaxTitleSize characters.
title | title used in the visualization; |
|
static |
set User id
userName | (string) |
void bridges.connect.Bridges.setWindow | ( | double | x1, |
double | x2, | ||
double | y1, | ||
double | y2 | ||
) |
Specify the window that will be used to render the view by default.
This function enables specifying the window that will rendered by default in the view. This only works for graph data types. And the coordinate system need ot be set to "window" using setCoordSystemType().
@param x1 minimum window x @param x2 maximum window x @param y1 minimum window y @param y2 maximum window y
void bridges.connect.Bridges.setWindow | ( | float | x1, |
float | x2, | ||
float | y1, | ||
float | y2 | ||
) |
Specify the window that will be used to render the view by default.
This function enables specifying the window that will rendered by default in the view. This only works for graph data types. And the coordinate system need ot be set to "window" using setCoordSystemType().
@param x1 minimum window x @param x2 maximum window x @param y1 minimum window y @param y2 maximum window y
void bridges.connect.Bridges.setWindow | ( | int | x1, |
int | x2, | ||
int | y1, | ||
int | y2 | ||
) |
Specify the window that will be used to render the view by default.
This function enables specifying the window that will rendered by default in the view. This only works for graph data types. And the coordinate system need ot be set to "window" using setCoordSystemType().
x1 | minimum window x |
x2 | maximum window x |
y1 | minimum window y |
y2 | maximum window y |
void bridges.connect.Bridges.visualize | ( | ) | throws IOException, RateLimitException |
This method generates the representation of the current data structure (JSON) and sends that to the Bridges server for generating a visualization.
RateLimitException | |
IOException |
|
staticpackage |
|
staticpackage |
|
staticpackage |
|
staticpackage |
|
staticpackage |
|
staticpackage |
|
staticpackage |
|
staticpackage |
|
staticpackage |
|
staticpackage |
|
staticpackage |
|
staticpackage |