Empirical
|
Namespaces | |
internal | |
Classes | |
class | Animate |
An object that, when active, repeatedly calls a function as fast as possible, to a maximum of 60 frames per second. More... | |
class | Attributes |
Maintains a map of attribute names to values for use in JavaScript Closely related to Style.h, which is for CSS-values. More... | |
class | Button |
Create or control an HTML Button object that you can manipulate and update as needed. More... | |
class | Canvas |
Manage an HTML Canvas object. More... | |
class | CanvasAction |
Base class to maintain canvas actions. More... | |
class | CanvasCircle |
Track a circle shape to be drawn on a canvas. More... | |
class | CanvasClearRect |
Clear a rectangular area in a canvas. More... | |
class | CanvasFont |
Change the default font to be used. More... | |
class | CanvasImage |
Change the default font to be used. More... | |
class | CanvasLine |
A line segment on the canvas. More... | |
class | CanvasMultiLine |
class | CanvasPolygon |
An arbitrary-sized polygon to be drawn on a canvas. More... | |
class | CanvasRect |
Track a rectangle shape to be drawn on a canvas. More... | |
class | CanvasRotate |
Rotate the entire canvas for subsequent drawings. More... | |
class | CanvasShape |
Define an arbitrary shape to draw on a canvas (base clase) More... | |
class | CanvasStrokeColor |
Set the line color on subsequent draw-related actions. More... | |
class | CanvasText |
Text to be written on a canvas. More... | |
class | Close |
class | D3Visualization |
class | Div |
A widget to track a div in an HTML file, and all of its contents. More... | |
class | Document |
class | DotPlot |
struct | Event |
Data common to all web events. More... | |
class | FileInput |
class | Font |
Maintain information about an HTML font. More... | |
class | HeatMap |
class | HistogramChart |
class | Image |
struct | KeyboardEvent |
Keyboard-specific information about web events. More... | |
class | KeypressManager |
class | LineGraph |
class | Listeners |
Track a set of JavaScript Listeners with their callback IDs. More... | |
struct | MouseEvent |
Mouse-specific information about web events. More... | |
class | PrintStr |
The PrintStr command will print a pre-specified string to a widget. More... | |
class | Selector |
struct | SpatialGridTreeNode |
class | SpatialGridTreeVisualization |
class | Style |
class | Table |
class | TableCell |
An object that focuses on a single cell in a specified table. More... | |
class | TableCol |
An object that focuses on a single column in a specified table. More... | |
class | TableColGroup |
An object that focuses on a group of columns in a specified table. More... | |
class | TableRow |
An object that focuses on a single column in a specified table. More... | |
class | TableRowGroup |
An object that focuses on a group of rows in a specified table. More... | |
class | TableWidget |
class | Text |
A Text widget handles putting text on a web page that can be controlled and modified. More... | |
class | TextArea |
struct | TreeDataNode |
struct | TreeNode |
class | TreeVisualization |
class | TreeVisualizationReplacement |
class | Tween |
struct | WheelEvent |
Mouse-wheel-specific information about web events. More... | |
class | Widget |
Widget is effectively a smart pointer to a WidgetInfo object, plus some basic accessors. More... | |
struct | WidgetExtras |
Functions | |
void | Draw (Canvas canvas, const emp::Circle &circle, const std::string &fill="", const std::string &line="") |
Draw a Circle onto the canvas. More... | |
template<size_t COLS, size_t ROWS> | |
void | Draw (Canvas canvas, const BitMatrix< COLS, ROWS > &matrix, double w, double h) |
Draw a BitMatrix onto a canvas using black and white squares (can specify cell width and height) More... | |
template<typename BODY_TYPE > | |
void | Draw (Canvas canvas, const Surface2D< BODY_TYPE > &surface, const emp::vector< std::string > &color_map) |
template<typename BODY_TYPE > | |
void | Draw (Canvas canvas, const Surface2D< BODY_TYPE > &surface, size_t num_colors) |
void | Draw (Canvas canvas, const emp::vector< emp::vector< size_t >> &grid, const emp::vector< std::string > &color_map, std::string line_color, double cell_width, double cell_height, double offset_x, double offset_y) |
void | Draw (Canvas canvas, const emp::vector< emp::vector< size_t >> &grid, const emp::vector< std::string > &color_map, std::string line_color, double cell_w, double cell_h) |
void | Draw (Canvas canvas, const emp::vector< emp::vector< size_t >> &grid, const emp::vector< std::string > &color_map, std::string line_color="black") |
void | Draw (Canvas canvas, const emp::vector< size_t > &grid, size_t grid_cols, const emp::vector< std::string > &color_map, std::string line_color, double cell_width, double cell_height, double offset_x, double offset_y) |
void | Draw (Canvas canvas, const StateGrid &state_grid, const emp::vector< std::string > &color_map, std::string line_color="black") |
void | DrawGridBG (Canvas canvas, size_t rows, size_t cols, const std::string &bg_color, const std::string &line_color) |
template<typename CONTAINER_T , typename POINT_FUN_T , typename COLOR_FUN_T > | |
void | DrawPoints (Canvas canvas, CONTAINER_T &&container, double radius, POINT_FUN_T &&point_fun, COLOR_FUN_T &&color_fun, const std::string &line_color="black") |
static const PrintStr | endl ("<br>") |
Pre-define emp::endl to insert a "<br>" and thus acting like a newline. More... | |
template<typename FUN_TYPE > | |
void | OnDocumentReady (FUN_TYPE &&fun) |
Runs the specified function when the document is finished loading and being set up. More... | |
void emp::web::Draw | ( | Canvas | canvas, |
const emp::Circle & | circle, | ||
const std::string & | fill = "" , |
||
const std::string & | line = "" |
||
) |
Draw a Circle onto the canvas.
void emp::web::Draw | ( | Canvas | canvas, |
const BitMatrix< COLS, ROWS > & | matrix, | ||
double | w, | ||
double | h | ||
) |
Draw a BitMatrix onto a canvas using black and white squares (can specify cell width and height)
void emp::web::Draw | ( | Canvas | canvas, |
const Surface2D< BODY_TYPE > & | surface, | ||
const emp::vector< std::string > & | color_map | ||
) |
void emp::web::Draw | ( | Canvas | canvas, |
const Surface2D< BODY_TYPE > & | surface, | ||
size_t | num_colors | ||
) |
Draw a Surface2D, just specifying the number of colors (and using a generated hue map). The surface has a range of circle bodies, each with a color id.
canvas | The Canvas to draw on. |
surface | A surface containing a set of shapes to draw. |
num_colors | The number of distinct colors to use in visualization. |
void emp::web::Draw | ( | Canvas | canvas, |
const emp::vector< emp::vector< size_t >> & | grid, | ||
const emp::vector< std::string > & | color_map, | ||
std::string | line_color, | ||
double | cell_width, | ||
double | cell_height, | ||
double | offset_x, | ||
double | offset_y | ||
) |
Draw a grid onto a canvas.
canvas | The Canvas to draw on. |
grid | A vector of vectors of color IDs. |
color_map | Mapping of values to the colors with which they should be associated. |
line_color | The background line color for the grid. |
cell_width | How many pixels wide is each cell to draw? |
cell_height | How many pixels tall is each cell to draw? |
offset_x | How far should we shift the grid relative to the left side of the canvas? |
offset_y | How far should we shift the grid relative to the top of the canvas? |
void emp::web::Draw | ( | Canvas | canvas, |
const emp::vector< emp::vector< size_t >> & | grid, | ||
const emp::vector< std::string > & | color_map, | ||
std::string | line_color, | ||
double | cell_w, | ||
double | cell_h | ||
) |
Draw a grid onto a canvas, but without offsets provided – the grid is centered.
canvas | The Canvas to draw on. |
grid | A vector of vectors of color IDs. |
color_map | Mapping of values to the colors with which they should be associated. |
line_color | The background line color for the grid. |
cell_width | How many pixels wide is each cell to draw? |
cell_height | How many pixels tall is each cell to draw? |
void emp::web::Draw | ( | Canvas | canvas, |
const emp::vector< emp::vector< size_t >> & | grid, | ||
const emp::vector< std::string > & | color_map, | ||
std::string | line_color = "black" |
||
) |
Draw a grid onto a canvas, but without cell size provided – maximize to fill the canvas!
canvas | The Canvas to draw on. |
grid | A vector of vectors of color IDs. |
color_map | Mapping of values to the colors with which they should be associated. |
line_color | The background line color for the grid. |
void emp::web::Draw | ( | Canvas | canvas, |
const emp::vector< size_t > & | grid, | ||
size_t | grid_cols, | ||
const emp::vector< std::string > & | color_map, | ||
std::string | line_color, | ||
double | cell_width, | ||
double | cell_height, | ||
double | offset_x, | ||
double | offset_y | ||
) |
Draw a vector onto a canvas as a grid.
canvas | The Canvas to draw on. |
grid | A vector of vectors of color IDs |
grid_cols | Number of columns in the grid |
color_map | Mapping of values to the colors with which they should be associated. |
line_color | The background line color for the grid |
cell_width | How many pixels wide is each cell to draw? |
cell_height | How many pixels tall is each cell to draw? |
offset_x | How far should we shift the grid relative to the left side of the canvas? |
offset_y | How far should we shift the grid relative to the top of the canvas? |
void emp::web::Draw | ( | Canvas | canvas, |
const StateGrid & | state_grid, | ||
const emp::vector< std::string > & | color_map, | ||
std::string | line_color = "black" |
||
) |
void emp::web::DrawGridBG | ( | Canvas | canvas, |
size_t | rows, | ||
size_t | cols, | ||
const std::string & | bg_color, | ||
const std::string & | line_color | ||
) |
Draw a grid as the background of a canvas. Since this is a BG, clear the canvas first.
canvas | The Canvas to draw on. |
rows | Number of rows to draw in the grid. |
cols | Number of columns to draw in the grid. |
bg_color | The background color for the grid. |
line_color | The color of the liens on the grid. |
void emp::web::DrawPoints | ( | Canvas | canvas, |
CONTAINER_T && | container, | ||
double | radius, | ||
POINT_FUN_T && | point_fun, | ||
COLOR_FUN_T && | color_fun, | ||
const std::string & | line_color = "black" |
||
) |
|
static |
Pre-define emp::endl to insert a "<br>" and thus acting like a newline.
void emp::web::OnDocumentReady | ( | FUN_TYPE && | fun | ) |
Runs the specified function when the document is finished loading and being set up.