Class: SearchBar

SearchBar

As the name suggests, SearchBar represents the search bar found in Shiviz's visualization page. Both the text input and the drop-down panel are considered part of the search bar. This class is responsible for binding user input to the search bar with the appropriate actions.

Text searches, pre-defined motif searches, and user-define motif searches can all be performed with the search bar. The SearchBar's mode indicates what type of query is currently being performed and is one of the mode static constants defined in this class (e.g. SearchBar.MODE_TEXT).

The search bar is associated with a Global. That global is what will be searched through and modified when a search is performed.

Constructor

SearchBar is a Singleton. Do not call its constructor directly. Use SearchBar.getInstance()
Source:

Members

(static, constant) MAX_NUM_OF_ELEMENTS_IN_HISTORY

Source:

(static, constant) MODE_CUSTOM

Source:

(static, constant) MODE_EMPTY

Source:

(static, constant) MODE_MOTIF

Source:

(static, constant) MODE_PREDEFINED

Source:

(static, constant) MODE_TEXT

Source:

(static, constant) SEARCH_HISTORY_KEY

Source:

Methods

(static) getInstance()

Gets the SearchBar instance.
Source:

addToSearchHistory()

Adds the given value to the seatch history.
Source:

clear()

Clears the drawn motif, the text input, and the search results
Source:
See:

clearMotifsTab()

Clears the results in the motifs tab and uncheck all the checkboxes
Source:

clearResults()

Clears search results. In other words, un-highlights found nodes and motifs
Source:

clearStructure()

Clears the drawn structure
Source:

clearText()

Clears the text input
Source:

countMotifs()

This function creates a new MotifNavigator to count the number of times a highlighted motif occurs in the active views
Source:

getBuilderGraphFromJSON(json) → {BuilderGraph}

Creates a BuilderGraph from a json object containing hosts and vector timestamps
Parameters:
Name Type Description
json String The json object specifying hosts and vector timestamps
Source:
Returns:
the builderGraph created from the given json object
Type
BuilderGraph

getGlobal() → {Global}

Returns the global associated with this search bar.
Source:
Returns:
global the global associated with this search bar
Type
Global

getMode() → {Number}

Gets the current mode the search bar is in. The mode indicates what type of query is currently being performed and is one of the mode static constants defined in this class (e.g. SearchBar.MODE_TEXT).
Source:
Returns:
the mode
Type
Number

getValue() → {String}

Gets the value of the text in the search bar.
Source:
Returns:
The text in the search bar
Type
String

hidePanel()

Hides the drop-down panel
Source:

isPanelShown() → {Boolean}

Determines if the drop-down panel is currently shown
Source:
Returns:
true if drop-down panel is shown
Type
Boolean

query()

Performs a query based on what is currently in the text field.
Source:

resetMotifResults()

Resets the motif results so that no execution is selected
Source:

setGlobal(global)

Sets the global associated with this search bar. The global associated with this search bar is what will be searched through and modified when a search is performed.
Parameters:
Name Type Description
global Global the global associated with this search bar.
Source:

setValue(val)

Sets the value of the text in the search bar
Parameters:
Name Type Description
val String The new value of the text in the search bar
Source:

showPanel()

Shows the drop-down panel
Source:

showSearchHistory()

Shows search history in its tab
Source:

storageAvailable()

Checks if local storage is supported by the browser
Source:

update()

Updates the search bar to reflect any changes made to either the text or the drawn graph.
Source:

updateMode()

Updates the mode of this search bar. The mode indicates what type of query is currently being performed and is one of the mode static constants defined in this class (e.g. SearchBar.MODE_TEXT). This method automatically deduces what type of query is currently entered based on the contents of the text field.
Source: