Web Tools (for use with Emscripten)¶
D3 Data Visualization Tools¶
Animations¶
Manage animations on a web site.
To build an animation, you must provide a function to be run repeatedly. When Start() is triggered, the function will be called 60 time per second (or as close as possible), until Stop() is caled.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2017
-
namespace
emp
¶ If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
-
namespace
web
¶ -
class
Animate
¶ - #include <Animate.h>
An object that, when active, repeatedly calls a function as fast as possible, to a maximum of 60 frames per second.
Parameters to the animation function can be:
- double (representing time since the last frame)
- a const reference to the animation object itself
- nothing
Control methods: void Start() void Stop() void Step() void ToggleActive()
Access methods: bool GetActive() const bool GetDoStep() const double GetStartTime() const double GetPrevTime() const double GetCurTime() const double GetStepTime() const double GetRunTime() const int GetFrameCount() const
Config methods: void SetCallback(const std::function<void(const Animate &)> & fun) void SetCallback(const std::function<void(double)> & fun) void SetCallback(const std::function<void()> & fun)
Public Functions
-
Animate
()¶ Setup an Animate object to call an anim_fun as fast as possible, at most 60 times a second. Call virtual function DoFrame() if no other functon is provided (which can be overridden if you derive a new class from Animate)
-
template <typename... W_TYPES>
Animate
(const anim_fun_t &fun, W_TYPES&... targets)¶ Construct an Animate object with the function to run each animation step and zero or more UI elements that should be updated after each frame.
-
template <typename... W_TYPES>
Animate
(const std::function<void(double)> &fun, W_TYPES&... targets, )¶
-
virtual
~Animate
()¶
-
void
Start
()¶ Start this animation running.
-
void
Stop
()¶ Halt this animation for now.
-
void
Step
()¶ Take a single step in this animation.
-
void
ToggleActive
()¶ Toggle whether this animation is running or paused.
-
bool
GetActive
() const¶ Determine if this animation is currently running.
-
bool
GetDoStep
() const¶ Determine if this animation is currently in the process of running a single step.
-
double
GetStartTime
() const¶ Return the time point that this animation started MOST RECENTLY.
-
double
GetPrevTime
() const¶ Determine the time point when this animation last updated a frame.
-
double
GetCurTime
() const¶ Get the current time of the animation.
-
double
GetStepTime
() const¶ Determine how long the last step between frames took.
-
double
GetRunTime
() const¶ Determine the total amount of time that this animation has run.
-
int
GetFrameCount
() const¶ Determine how many total frames have existed thus far in this animation.
-
void
SetCallback
(const anim_fun_t &fun)¶ Set a new function for this animation to call when running that takes a const reference to the Animation object as an argument.
-
void
SetCallback
(const std::function<void(double)> &fun)¶ Set a new function for this animation to call when running that takes the amount of time since the last frame (a double) as an argument.
-
void
SetCallback
(const std::function<void()> &fun)¶ Set a new function for this animation to call when running that takes no arguments.
-
Button
GetToggleButton
(const std::string &but_name, const std::string &start_label = "Start", const std::string &stop_label = "Stop")¶ Get a toggle button that will start/stop this animation.
- Parameters
but_name
: The HTML identifier used for this button.start_label
: The name on the button when it will start the animation (default=”Start”)stop_label
: The name on the button when it will halt the animation (default=”Stop”)
Protected Types
Protected Attributes
-
anim_fun_t
anim_fun
¶ Function to repeatedly run for animation.
-
bool
active
¶ Is this animation currently running?
-
bool
do_step
¶ Should this animation take just a single step?
-
size_t
callback_id
¶ Intenral ID for javascript to call back AdvanceFrame()
-
double
start_time
¶ At what time did this animation most recently start?
-
double
prev_time
¶ What was the time point of the previous frame?
-
double
cur_time
¶ What time did the current frame start?
-
double
run_time
¶ How much run time has accumulated?
-
int
frame_count
¶ How many animation frames have gone by?
-
class
Attributes¶
An Attributes class for tracking non-style features about HTML objects.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2017
-
namespace
emp
¶ If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
-
namespace
web
¶ -
class
Attributes
¶ - #include <Attributes.h>
Maintains a map of attribute names to values for use in JavaScript Closely related to Style.h, which is for CSS-values.
Public Functions
-
Attributes
()¶
-
Attributes
(const Attributes&)¶
-
Attributes &
operator=
(const Attributes&)¶
-
int
GetSize
() const¶ Return a count of the number of attributes that have been set.
-
Attributes &
DoSet
(const std::string &in_set, const std::string &in_val)¶
-
template <typename SET_TYPE>
Attributes &Set
(const std::string &s, SET_TYPE v)¶ Record that attribute “a” is set to value “v” (converted to string) and return this object.
-
Attributes &
Insert
(const Attributes &in_attr)¶ Set all values from in_attr here as well. Return this object.
-
bool
Has
(const std::string &setting) const¶ Return true/false based on whether “setting” has been given a value in this Attributes obj.
-
const std::string &
Get
(const std::string &setting)¶ Return the (string) value of “setting” that has been recorded in this Attributes obj. If setting did not exist, this does create an empty entry and return it.
-
void
Clear
()¶ Remove all setting values.
-
void
Apply
(const std::string &widget_id)¶ Apply ALL of the Attribute’s settings to dom element “widget_id”.
-
void
Apply
(const std::string &widget_id, const std::string &setting)¶ Apply onlay a SPECIFIC attributes setting from the setting library to widget_id.
-
operator bool
() const¶ Convert to true if there are any setting, false otherwise.
Public Static Functions
-
-
class
Buttons¶
Create/control an HTML button and call a specified function when that button is clicked.
Use example:
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2017
emp::web::Button my_button(MyFun, “Button Name”, “html_id”);
Where my_button is the C++ object linking to the button, MyFun is the function you want to call on clicks, “Button Name” is the label on the button itself, and “html_id” is the optional id you want it to use in the HTML code (otherwise it will generate a unique name on its own.)
Member functions to set state: Button & Callback(const std::function<void()> & in_callback) Button & Label(const std::string & in_label) Button & Title(const std::string & in_t) Button & Autofocus(bool in_af) Button & Disabled(bool in_dis)
Retriving current state: const std::string & GetLabel() const const std::string & GetTitle() const bool HasAutofocus() const bool IsDisabled() const
-
namespace
emp
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
-
namespace
web
-
class
Button
: public emp::web::internal::WidgetFacet<Button>¶ - #include <Button.h>
Create or control an HTML Button object that you can manipulate and update as needed.
Public Types
-
using
INFO_TYPE
= ButtonInfo¶
Public Functions
-
Button
(const std::function<void()> &in_cbconst std::string &in_label, const std::string &in_id = "", )¶ Create a new button.
- Parameters
in_cb
: The function to call when the button is clicked.in_label
: The label that should appear on the button.in_id
: The HTML ID to use for this button (leave blank for auto-generated)
-
Button
()¶
-
virtual
~Button
()¶
-
Button &
Callback
(const std::function<void()> &in_cb)¶ Set a new callback function to trigger when the button is clicked.
-
bool
HasAutofocus
() const¶ Determine if this button currently has autofocus.
-
bool
IsDisabled
() const¶ Determine if this button is currently disabled.
Protected Functions
-
ButtonInfo *
Info
()¶
-
const ButtonInfo *
Info
() const¶
-
Button
(ButtonInfo *in_info)¶
Friends
-
friend
emp::web::ButtonInfo
-
class
ButtonInfo
: public emp::web::internal::WidgetInfo¶ - #include <Button.h>
Protected Functions
-
ButtonInfo
(const ButtonInfo&)¶
-
ButtonInfo &
operator=
(const ButtonInfo&)¶
-
virtual
~ButtonInfo
()¶
-
virtual bool
IsButtonInfo
() const¶
-
void
DoCallback
()¶
-
void
UpdateAutofocus
(bool in_af)¶
-
void
UpdateDisabled
(bool in_dis)¶
Private Members
-
friend emp::web::Button::ButtonInfo::Button
-
-
using
-
class
Canvas¶
Manage an HTML canvas object.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2018
-
namespace
emp
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
-
namespace
web
-
class
Canvas
: public emp::web::internal::WidgetFacet<Canvas>¶ - #include <Canvas.h>
Manage an HTML Canvas object.
Public Types
-
using
INFO_TYPE
= CanvasInfo¶
Public Functions
-
Canvas
(double w, double h, const std::string &in_id = "")¶ Create a new canvas with the specified size and optional HTML identifier.
-
Canvas
()¶
-
virtual
~Canvas
()¶
-
template <typename... Ts>
Canvas &Circle
(Point center, double _r, Ts&&... vals)¶ Add a Circle to this canvas; provide constructor for the CanvasCircle with a position and radius as well as optional face color, line color, and line width.
-
template <typename... Ts>
Canvas &Rect
(Point corner, double w, double h, Ts&&... vals)¶ Add a Rectangle to this canvas at x,y with width w and heigh h. Optional face color and line color.
-
template <typename... Ts>
Canvas &Image
(const emp::RawImage &image, Point corner, Ts&&... vals)¶ Add an Image to this canvas at x,y with width w and heigh h.
-
template <typename... Ts>
Canvas &Image
(const emp::RawImage &image, double x, double y, Ts&&... vals)¶
-
template <typename... Ts>
Canvas &Line
(double x1, double y1, double x2, double y2, Ts&&... vals)¶ Add a Line from x1,y1 to x2,y2. Optional face color and line color.
-
template <typename... Ts>
Canvas &MultiLine
(emp::Point p1, const emp::vector<emp::Point> &points, Ts&&... vals)¶ Add a Line from x1,y1 to x2,y2. Optional face color and line color.
-
template <typename... Ts>
Canvas &Text
(emp::Point p, Ts&&... vals)¶ Add a string to this canvas at x,y with specified text. Optional face color and line color.
-
template <typename... Ts>
Canvas &CenterText
(emp::Point p, Ts&&... vals)¶ Add a string to this canvas centered at x,y with specified text. Optional face color and line color.
-
Canvas &
Draw
(const emp::Circle &circle, const std::string &fc = "", const std::string &lc = "")¶ Draw a circle onto this canvas.
-
Canvas &
Draw
(const CanvasShape &shape)¶ Draw an arbitrary shape onto this canvas.
Protected Functions
-
CanvasInfo *
Info
()¶
-
const CanvasInfo *
Info
() const¶
-
Canvas
(CanvasInfo *in_info)¶
Friends
-
friend
emp::web::CanvasInfo
-
class
CanvasInfo
: public emp::web::internal::WidgetInfo¶ - #include <Canvas.h>
Protected Functions
-
CanvasInfo
(const CanvasInfo&)¶
-
CanvasInfo &
operator=
(const CanvasInfo&)¶
-
virtual
~CanvasInfo
()¶
-
virtual bool
IsCanvasInfo
() const¶
-
void
TargetCanvas
()¶
-
void
TriggerJS
()¶
-
void
AddAction
(CanvasAction *new_action)¶
-
void
ClearActions
()¶
Protected Attributes
-
double
width
¶ pixel width of the canvas.
-
double
height
¶ pixel height of the canvas.
-
emp::vector<CanvasAction *>
actions
¶
Private Members
-
friend emp::web::Canvas::CanvasInfo::Canvas
-
-
using
-
class
Canvas Utilities¶
Various versions of the Draw() function to draw images onto a canvas.
Each version of
Draw() takes a canvas widget and some form of data to be drawn on the widget, such as a circle, a bit matrix, or a geometric surface.- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2018
-
namespace
emp
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
-
namespace
web
Functions
-
void
Draw
(Canvas canvas, const emp::Circle &circle, const std::string &fill = "", const std::string &line = "")¶ Draw a Circle onto the canvas.
-
template <size_t COLS, size_t ROWS>
voidDraw
(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)
-
template <typename BODY_TYPE>
voidDraw
(Canvas canvas, const Surface2D<BODY_TYPE> &surface, const emp::vector<std::string> &color_map)¶ Draw a Surface2D, specifying the full colormap to be used. The surface has a range of circle bodies, each with a color id.
- Parameters
canvas
: The Canvas to draw on.surface
: A surface containing a set of shapes to draw.color_map
: Mapping of values to the colors with which they should be associated.
-
template <typename BODY_TYPE>
voidDraw
(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.
- Parameters
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
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.
- Parameters
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
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.
- Parameters
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
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!
- Parameters
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
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.
- Parameters
canvas
: The Canvas to draw on.grid
: A vector of vectors of color IDsgrid_cols
: Number of columns in the gridcolor_map
: Mapping of values to the colors with which they should be associated.line_color
: The background line color for the gridcell_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
Draw
(Canvas canvas, const StateGrid &state_grid, const emp::vector<std::string> &color_map, std::string line_color = "black")¶ Draw a state grid onto a canvas.
- Parameters
canvas
: The Canvas to draw on.state_grid
: A StateGrid object.color_map
: Mapping of values to the colors with which they should be associated.line_color
: The background line color for the grid.
-
void
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.
- Parameters
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
Canvas Actions¶
Define a base class for all actions that can be done to widgets, plus simple actions.
CanvasAction objects modify the appearance of a canvas and can be tracked to reconstruct the state of the canvas from scratch.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2018
Other, more specific actions defined here are: CanvasStrokeColor CanvasRotate CanvasFont
See also CanvasShape.h for more actions.
-
namespace
emp
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
-
namespace
web
-
class
CanvasAction
¶ - #include <CanvasAction.h>
Base class to maintain canvas actions.
Subclassed by emp::web::CanvasFont, emp::web::CanvasImage, emp::web::CanvasRotate, emp::web::CanvasShape, emp::web::CanvasStrokeColor
Public Functions
-
CanvasAction
()¶
-
CanvasAction
(const CanvasAction&)¶
-
virtual
~CanvasAction
()¶
-
virtual void
Apply
() = 0¶ Apply current action to emp_i.ctx.
-
virtual CanvasAction *
Clone
() const = 0¶ Make a copy of the current action.
-
-
class
CanvasFont
: public emp::web::CanvasAction¶ - #include <CanvasAction.h>
Change the default font to be used.
Public Functions
-
void
Apply
()¶ Apply current action to emp_i.ctx.
-
CanvasAction *
Clone
() const¶ Make a copy of the current action.
Protected Functions
-
void
LineWidth
(double line_width = 1.0)¶ Helper function to set the stroke status.
-
void
-
class
CanvasImage
: public emp::web::CanvasAction¶ - #include <CanvasAction.h>
Change the default font to be used.
Public Functions
-
CanvasImage
(const RawImage &raw_image, double _x = 0.0, double _y = 0.0, double _w = 0.0, double _h = 0.0)¶
-
CanvasImage
(const std::string &url, double _x = 0.0, double _y = 0.0, double _w = 0.0, double _h = 0.0)¶
-
void
Apply
()¶ Apply current action to emp_i.ctx.
-
CanvasAction *
Clone
() const¶ Make a copy of the current action.
-
-
class
CanvasRotate
: public emp::web::CanvasAction¶ - #include <CanvasAction.h>
Rotate the entire canvas for subsequent drawings.
Public Functions
-
CanvasRotate
(double a)¶
-
void
Apply
()¶ Apply current action to emp_i.ctx.
-
CanvasAction *
Clone
() const¶ Make a copy of the current action.
Protected Functions
-
void
Fill
(const std::string &style = "") Helper function to set the fill status.
-
void
Stroke
(const std::string &style = "") Helper function to set the stroke status.
-
void
LineWidth
(double line_width = 1.0) Helper function to set the stroke status.
Protected Attributes
-
double
angle
¶
-
-
class
CanvasStrokeColor
: public emp::web::CanvasAction¶ - #include <CanvasAction.h>
Set the line color on subsequent draw-related actions.
Public Functions
-
void
Apply
()¶ Apply current action to emp_i.ctx.
-
CanvasAction *
Clone
() const¶ Make a copy of the current action.
-
void
-
class
Canvas Shapes¶
Define simple shapes to draw on a canvas.
Canvas shapes can be definied in detail, describing how they modify a canvas.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2017
Other, more specific actions defined here are: CanvasCircle CanvasRect
-
namespace
emp
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
-
namespace
web
-
class
CanvasCircle
: public emp::web::CanvasShape¶ - #include <CanvasShape.h>
Track a circle shape to be drawn on a canvas.
Public Functions
-
CanvasCircle
(double _x, double _y, double _r, const std::string &fc = "", const std::string &lc = "", double lw = 1.0)¶
-
CanvasCircle
(Point _p, double _r, const std::string &fc = "", const std::string &lc = "", double lw = 1.0)¶
-
CanvasCircle
(emp::Circle circle, const std::string &fc = "", const std::string &lc = "", double lw = 1.0)¶
-
void
Apply
()¶ Apply current action to emp_i.ctx.
-
CanvasAction *
Clone
() const¶ Make a copy of the current action.
-
void
MoveTo
(Point _p)¶ Shift the position of this shape to a point.
-
void
MoveTo
(double _x, double _y)¶ Shift the position of this shape to coordinates.
-
void
SetLineWidth
(double lw = 1.0)¶ Setup details needed before drawing lines.
-
void
ApplyColor
()¶ Actually change the color on screen.
Protected Attributes
-
Point
p
¶ Anchor point for this shape.
-
double
line_width
¶ How wide should lines be?
Private Members
-
double
radius
¶ Circle radius.
-
-
class
CanvasClearRect
: public emp::web::CanvasShape¶ - #include <CanvasShape.h>
Clear a rectangular area in a canvas.
Public Functions
-
CanvasClearRect
(Point _p, double _w, double _h)¶
-
void
Apply
()¶ Apply current action to emp_i.ctx.
-
CanvasAction *
Clone
() const¶ Make a copy of the current action.
-
void
MoveTo
(Point _p)¶ Shift the position of this shape to a point.
-
void
MoveTo
(double _x, double _y)¶ Shift the position of this shape to coordinates.
-
void
SetLineWidth
(double lw = 1.0)¶ Setup details needed before drawing lines.
-
void
ApplyColor
()¶ Actually change the color on screen.
-
-
class
CanvasLine
: public emp::web::CanvasShape¶ - #include <CanvasShape.h>
A line segment on the canvas.
Public Functions
-
CanvasLine
(double _x1, double _y1, double _x2, double _y2, const std::string &lc = "", double lw = 1.0)¶ Y-position for second point of line segment.
-
void
Apply
()¶ Apply current action to emp_i.ctx.
-
CanvasAction *
Clone
() const¶ Make a copy of the current action.
-
void
MoveTo
(Point _p) Shift the position of this shape to a point.
-
void
MoveTo
(double _x, double _y) Shift the position of this shape to coordinates.
-
void
SetLineWidth
(double lw = 1.0) Setup details needed before drawing lines.
-
void
SetFillColor
(const std::string &color) Change the fill color of this shape.
-
void
SetLineColor
(const std::string &color) Change the stroke color of this shape.
-
void
ApplyColor
() Actually change the color on screen.
-
-
class
CanvasMultiLine
: public emp::web::CanvasShape¶ - #include <CanvasShape.h>
A whole series of line segments on the canvas. Currently not working…
Public Functions
-
CanvasMultiLine
(double _x1, double _y1, const emp::vector<Point> &_points, const std::string &lc = "", double lw = 1.0)¶
-
CanvasMultiLine
(Point p1, const emp::vector<Point> &_points, const std::string &lc = "", double lw = 1.0)¶
-
void
Apply
()¶ Apply current action to emp_i.ctx.
-
CanvasAction *
Clone
() const¶ Make a copy of the current action.
-
void
MoveTo
(Point _p) Shift the position of this shape to a point.
-
void
MoveTo
(double _x, double _y) Shift the position of this shape to coordinates.
-
void
SetLineWidth
(double lw = 1.0) Setup details needed before drawing lines.
-
void
SetFillColor
(const std::string &color) Change the fill color of this shape.
-
void
SetLineColor
(const std::string &color) Change the stroke color of this shape.
-
void
ApplyColor
() Actually change the color on screen.
-
-
class
CanvasPolygon
: public emp::web::CanvasShape¶ - #include <CanvasShape.h>
An arbitrary-sized polygon to be drawn on a canvas.
Public Functions
-
CanvasPolygon &
AddPoint
(double x, double y)¶
-
CanvasPolygon &
AddPoint
(Point p)¶
-
void
Apply
()¶ Apply current action to emp_i.ctx.
-
CanvasAction *
Clone
() const¶ Make a copy of the current action.
-
void
MoveTo
(Point _p) Shift the position of this shape to a point.
-
void
MoveTo
(double _x, double _y) Shift the position of this shape to coordinates.
-
void
SetLineWidth
(double lw = 1.0) Setup details needed before drawing lines.
-
void
SetFillColor
(const std::string &color) Change the fill color of this shape.
-
void
SetLineColor
(const std::string &color) Change the stroke color of this shape.
-
void
ApplyColor
() Actually change the color on screen.
-
CanvasPolygon &
-
class
CanvasRect
: public emp::web::CanvasShape¶ - #include <CanvasShape.h>
Track a rectangle shape to be drawn on a canvas.
Public Functions
-
CanvasRect
(double _x, double _y, double _w, double _h, const std::string &fc = "", const std::string &lc = "")¶
-
void
Apply
()¶ Apply current action to emp_i.ctx.
-
CanvasAction *
Clone
() const¶ Make a copy of the current action.
-
void
MoveTo
(Point _p) Shift the position of this shape to a point.
-
void
MoveTo
(double _x, double _y) Shift the position of this shape to coordinates.
-
void
SetLineWidth
(double lw = 1.0) Setup details needed before drawing lines.
-
void
SetFillColor
(const std::string &color) Change the fill color of this shape.
-
void
SetLineColor
(const std::string &color) Change the stroke color of this shape.
-
void
ApplyColor
() Actually change the color on screen.
-
-
class
CanvasShape
: public emp::web::CanvasAction¶ - #include <CanvasShape.h>
Define an arbitrary shape to draw on a canvas (base clase)
Subclassed by emp::web::CanvasCircle, emp::web::CanvasClearRect, emp::web::CanvasLine, emp::web::CanvasMultiLine, emp::web::CanvasPolygon, emp::web::CanvasRect, emp::web::CanvasText
Public Functions
-
CanvasShape
(double _x, double _y, const std::string &fc = "", const std::string &lc = "", double lw = 1.0)¶
-
virtual
~CanvasShape
()¶
-
void
MoveTo
(Point _p) Shift the position of this shape to a point.
-
void
MoveTo
(double _x, double _y) Shift the position of this shape to coordinates.
-
void
SetLineWidth
(double lw = 1.0) Setup details needed before drawing lines.
-
void
SetFillColor
(const std::string &color) Change the fill color of this shape.
-
void
SetLineColor
(const std::string &color) Change the stroke color of this shape.
-
void
ApplyColor
() Actually change the color on screen.
-
-
class
CanvasText
: public emp::web::CanvasShape¶ - #include <CanvasShape.h>
Text to be written on a canvas.
Public Functions
-
CanvasText
(Point p, const std::string &_text, const std::string &fc = "", const std::string &lc = "")¶
-
void
Apply
()¶ Apply current action to emp_i.ctx.
-
void
Center
(bool c = true)¶ Center this text.
-
bool
GetCenter
() const¶ Identify if text is centered.
-
CanvasAction *
Clone
() const¶ Make a copy of the current action.
-
void
MoveTo
(Point _p) Shift the position of this shape to a point.
-
void
MoveTo
(double _x, double _y) Shift the position of this shape to coordinates.
-
void
SetLineWidth
(double lw = 1.0) Setup details needed before drawing lines.
-
void
SetFillColor
(const std::string &color) Change the fill color of this shape.
-
void
SetLineColor
(const std::string &color) Change the stroke color of this shape.
-
void
ApplyColor
() Actually change the color on screen.
-
-
class
Color maps¶
Tools to dynamically build (and cache) color maps.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2017
-
namespace
emp
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
Functions
-
std::string
ColorHSL
(double h, double s, double l)¶ Generate a string to describe a JS color out of HSL values.
-
std::string
ColorRGB
(int r, int g, int b)¶ Generate a string to describe a JS color out of RGB values.
-
std::string
ColorRGB
(int r, int g, int b, double a)¶ Generate a string to describe a JS color with an alpha channel.
Commands¶
A set of command-defining classes that can be fed into widgets using the << operator.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2017
-
namespace
emp
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
-
namespace
web
Functions
-
static const PrintStr emp::web::endl("<br>")
Pre-define emp::endl to insert a “<br>” and thus acting like a newline.
-
class
Close
: public emp::web::internal::WidgetCommand¶ - #include <commands.h>
The Close command will prevent the specified widget from accepting further appends (and instead revert to trying parents)
Public Functions
-
bool
Trigger
(internal::WidgetInfo &w) const¶
-
bool
-
Divs¶
Div Widgets maintain an ordered collection of other widgets in an HTML div.
To create a Div:
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2017
- Note
- Formerly called Slate.h When printed to the web page, these internal widgets are presented in order.
emp::web::Div my_div(“name”);
To use a Div:
my_div << “Add this text!” << emp::web::Image(“my_image.png”) << “<br>”;
To register a Div in a Document:
my_doc << my_div;
-
namespace
emp
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
-
namespace
web
-
class
Div
: public emp::web::internal::WidgetFacet<Div>¶ - #include <Div.h>
A widget to track a div in an HTML file, and all of its contents.
Subclassed by emp::web::Document
Public Functions
-
Div
()¶
-
~Div
()¶
-
double
ScrollTop
() const¶ Where is the top of the scroll region?
-
void
Clear
()¶ Clear the contents of this div.
-
void
ClearChildren
()¶ Remove all child widgets from this div.
-
bool
HasChild
(const Widget &test_child) const¶ Determine if a specified widget is internal to this one.
-
void
Deactivate
(bool top_level)¶ Remove this widget from the current document.
-
Widget &
Find
(const std::string &test_name)¶ Get an internal widget to this div, by the specified name.
-
-
namespace
internal
¶ -
class
DivInfo
: public emp::web::internal::WidgetInfo¶ - #include <Div.h>
Protected Functions
-
virtual
~DivInfo
()¶
-
virtual bool
IsDivInfo
() const¶
-
void
ClearChildren
()¶
-
void
Clear
()¶
-
void
DoActivate
(bool top_level = true)¶
-
bool
AppendOK
() const¶
-
void
PreventAppend
()¶
-
Widget
Append
(const Font &font)¶ Start a new set of Text with this font (even if one already exists.)
-
void
ReplaceHTML
()¶
Protected Attributes
-
double
scroll_top
¶ Where should div scroll to? (0.0 to 1.0)
-
bool
append_ok
¶ Can we add more children?
-
bool
text_append
¶ Can we append to a current text widget?
Private Members
-
friend emp::web::internal::DivInfo::Div
-
friend emp::web::internal::DivInfo::TableInfo
-
virtual
-
class
-
class
Documents¶
Manage an entire document.
The Document class is built off of Div, but initializes the EMP web framework, if neeeded, and activates itself. It also provides quick ways to add and lookup widgets.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2017
For example, you can use doc.AddButon(…) to add a new button to the document, where the … can be any of the mechanisms to build a new button. This technique works for any widget type.
You can also look up any widget by name. For example, if you previously created a Canvas widget with the HTML id “my_canvas”, you can look it up later by using doc.Canvas(“my_canvas”)
-
namespace
emp
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
Useful functions for emscripten¶
Specialized, useful function for Empirical.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2017
Defines
-
AlertVar
(VAR)¶
-
namespace
emp
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
Functions
-
static void
DelayCall
(const std::function<void()> &in_funint delay, )¶ Call a function after a specified amount of time.
-
static void
OnResize
(const std::function<void()> &in_fun)¶ Provide a function to call whenever a window’s size changes (no arguments).
-
static void
OnResize
(const std::function<void(int, int)> &in_fun)¶ Provide a function to call whenever a window’s size changes (new size as arguments)
-
double
GetTime
()¶ Get the current time, as provided by the web browser.
-
int
GetWindowInnerWidth
()¶ Determine with width of the current window.
-
int
GetWindowInnerHeight
()¶ Determine with height of the current window.
-
static void
SetCursor
(const char *type)¶
Event Handling¶
Event handlers that use JQuery.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2017
-
namespace
emp
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
-
namespace
web
Functions
-
template <typename FUN_TYPE>
voidOnDocumentReady
(FUN_TYPE &&fun)¶ Runs the specified function when the document is finished loading and being set up.
-
struct
Event
¶ - #include <events.h>
Data common to all web events.
Subclassed by emp::web::KeyboardEvent, emp::web::MouseEvent, emp::web::WheelEvent
Public Functions
-
template <int ARG_ID>
voidLoadFromArg
()¶
-
template <int ARG_ID>
-
struct
KeyboardEvent
: public emp::web::Event¶ - #include <events.h>
Keyboard-specific information about web events.
Public Functions
-
template <int ARG_ID>
voidLoadFromArg
()¶
Public Members
-
bool
altKey
¶ Was “ALT” key was pressed?
-
bool
ctrlKey
¶ Was “CTRL” key pressed?
-
bool
metaKey
¶ Was “META” key pressed?
-
bool
shiftKey
¶ Was “SHIFT” key pressed?
-
int
charCode
¶ Unicode character pressed.
-
int
keyCode
¶ Which key was pressed on the keyboard (e.g., ‘a’ and ‘A’ are the same)
-
bool
bubbles
¶ Is this a bubbling event?
-
bool
cancelable
¶ Can the default action be prevented?
-
template <int ARG_ID>
-
struct
MouseEvent
: public emp::web::Event¶ - #include <events.h>
Mouse-specific information about web events.
Public Functions
-
template <int ARG_ID>
voidLoadFromArg
()¶
Public Members
-
bool
altKey
¶ Was “ALT” key was pressed?
-
bool
ctrlKey
¶ Was “CTRL” key pressed?
-
bool
metaKey
¶ Was “META” key pressed?
-
bool
shiftKey
¶ Was “SHIFT” key pressed?
Which mouse button was pressed? -1=none (0/1/2)
-
int
detail
¶ How many clicks happened in short succession?
-
int
clientX
¶ X-mouse postion, relative to current window.
-
int
clientY
¶ Y-mouse postion, relative to current window.
-
int
screenX
¶ X-mouse position, relative to the screen.
-
int
screenY
¶ Y-mouse position, relative to the screen.
-
bool
bubbles
Is this a bubbling event?
-
bool
cancelable
Can the default action be prevented?
-
template <int ARG_ID>
-
struct
WheelEvent
: public emp::web::Event¶ - #include <events.h>
Mouse-wheel-specific information about web events.
Public Functions
-
template <int ARG_ID>
voidLoadFromArg
()¶
Public Members
-
int
deltaX
¶ Horizontal scroll amount.
-
int
deltaY
¶ Vertical scroll amount.
-
int
deltaZ
¶ Scroll amount of a mouse wheel for the z-axis.
-
int
deltaMode
¶ The unit of measurements for delta values (pixels, lines or pages)
-
bool
bubbles
Is this a bubbling event?
-
bool
cancelable
Can the default action be prevented?
-
template <int ARG_ID>
-
template <typename FUN_TYPE>
File Input¶
Specs for the FileInput widget (click on to upload a file)
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2018
-
namespace
emp
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
-
namespace
web
-
class
FileInput
: public emp::web::internal::WidgetFacet<FileInput>¶ - #include <FileInput.h>
FileInput will convert the file to a std::string and pass the result to a designated function.
To create a new file input, you must pass it a void function that takes a const std::string & as its only argument. When a file is loaded, the specified function is called and the body of the file is passed in as the string.
Public Types
-
using
INFO_TYPE
= FileInputInfo¶
Public Functions
-
FileInput
(const std::function<void(const std::string&)> &in_cb, const std::string &in_id = "", )¶ Create a new Fileinput; supply the function to call with the file contents as a string (and optionally the HTML identifier to be used).
-
FileInput
(const std::function<void(const emp::File&)> &cb, const std::string &in_id = "", )¶ Create a new FileInput; supply the function to call with the file contents as a File object (and optionally the HTML identifier to be used).
-
virtual
~FileInput
()¶
-
FileInput &
Callback
(const std::function<void(const std::string&)> &in_cb)¶ Change the callback function to use when a new file is loaded.
-
bool
HasAutofocus
() const¶ Determine if this object currently has autofocus.
-
bool
IsDisabled
() const¶ Determine if this object is currently disabled.
Protected Functions
-
FileInputInfo *
Info
()¶
-
const FileInputInfo *
Info
() const¶
-
FileInput
(FileInputInfo *in_info)¶
Friends
-
friend
emp::web::FileInputInfo
-
class
FileInputInfo
: public emp::web::internal::WidgetInfo¶ - #include <FileInput.h>
Protected Functions
-
FileInputInfo
(const FileInputInfo&)¶
-
FileInputInfo &
operator=
(const FileInputInfo&)¶
-
virtual
~FileInputInfo
()¶
-
void
UpdateAutofocus
(bool in_af)¶
-
void
UpdateDisabled
(bool in_dis)¶
Private Members
-
friend emp::web::FileInput::FileInputInfo::FileInput
-
-
using
-
class
Font¶
Maintains basic information about a font to be used in HTML.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2017
-
namespace
emp
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
-
namespace
web
-
class
Font
¶ - #include <Font.h>
Maintain information about an HTML font.
Public Functions
-
Font
(const std::string &_family = "Helvetica", int _size = 15, const std::string &_color = "black", bool _bold = false, bool _italic = false)¶
-
~Font
()¶
-
int
GetSize
() const¶
-
bool
IsBold
() const¶
-
bool
IsItalic
() const¶
-
bool
IsSmallcaps
() const¶
-
bool
IsUnderlined
() const¶
-
bool
IsOverlined
() const¶
-
bool
IsStrikethrough
() const¶
-
bool
IsWavyLine
() const¶
-
bool
HasLine
() const¶
Protected Attributes
-
bool
is_bold
¶ Is this font bold?
-
bool
is_italic
¶ Is this font itaic?
-
bool
is_smallcaps
¶ Should this test be in small caps?
-
bool
is_underlined
¶ Should this text be underlined?
-
bool
is_overlined
¶ Should this text have a line above it?
-
bool
is_linethrough
¶ Should this text have a line through it?
-
bool
is_wavy_line
¶ Should lines be made wavy?
-
-
class
Images¶
Easily load an image and place it in a document.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2017
-
namespace
emp
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
-
namespace
web
-
class
Image
: public emp::web::internal::WidgetFacet<Image>¶ - #include <Image.h>
The Image widget will load an image from a specified URL. For example, you can use emp::web::Image(“http://kripken.github.io/emscripten-site/_static/Emscripten_logo_full.png”) to load the emscripten logo from its website. These can be easily inserted into a web document using << and all JS callbacks (after loading) will be handled automatically.
You can also set the Alt-text with the Alt() function.
Public Functions
-
Image
(const std::string &in_url, const std::string &in_id = "")¶ Create a new image, indicating the URL to load from.
-
virtual
~Image
()¶
Friends
-
friend
emp::web::ImageInfo
-
class
ImageInfo
: public emp::web::internal::WidgetInfo¶ - #include <Image.h>
Private Members
-
friend emp::web::Image::ImageInfo::Image
-
-
-
class
Initialization¶
Define Initialize() and other functions to set up Empirical to build Emscripten projects.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2017
-
namespace
emp
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
Javascript Utilities¶
Tools for passing data between C++ and Javascript.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2018
-
namespace
emp
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
Functions
-
std::map<std::string, std::string>
get_type_to_string_map
()¶ This function returns a std::map mapping typeid names to the appropriate strings to describe those types in Javscript. This is useful when using getValue() from within EM_ASM macros.
For example, say we have a templated function that takes a pointer to type T. We find out the appropriate string for type T: std::map<const char*, std::string> type_map = GetTypeToStringMap(); std::string type_string = type_map[typeid(T).name()];
Now we can pass type_string.c_str() into EM_ASM_ARGS: `EM_ASM_ARGS({ var value = getValue($0, $1); }, pointer, type_string.c_str();`
-
template <typename C, class = typename C::value_type>
voidpass_array_to_javascript
(C values)¶ This function can be called to pass an array, vector, or other container with contiguously stored data into Javascript. The array will be stored in emp.__incoming_array. Currently supports arrays containing all of the types defined in get_type_to_string_map, which are also all of the types that emscripten supports getting via pointer. This function also supports nested arrays, and arrays of objects created with introspective tuple structs.
-
template <std::size_t SIZE, typename T>
voidpass_array_to_cpp
(emp::array<T, SIZE> &arr, bool recurse = false)¶ This function lets you pass an array from javascript to C++! It takes a reference to the array as an argument and populates it with the contents of emp.__outgoing_array.
Currently accepts arrays of ints, floats, doubles, chars, and std::strings The size of the passed array must be equal to the size of the array stored in emp.__outgoing_array
JSWrap¶
Wrap a C++ function and convert it to an integer that can be called from Javascript.
To wrap a function, call:
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2018
uint32_t fun_id = emp::JSWrap(FunctionToBeWrapped, "JS_Function_Name");
`
To manually callback a function from Javascript, first set emp_i.cb_args
to an array of function arguments, then call empCppCallback( fun_id );
This all happens automatically if you use the emp.Callback(fun_id, args...)
function from Javascript.
The JS_Function_Name string is optional, but if you use it, the appropriate function will be automatically generated in Javascript by JSWrap, in the emp class.
For example, if you have:
int AddPair(int x, int y) { return x + y; }
`
You can wrap it with:
size_t fun_id = emp::JSWrap(AddPair, "AddPair");
And then in Javascript, you can simply call it as:
emp.AddPair(4, 5); // will return 9.
Keypress Manager¶
KeypressManager is a tracker for keypresses in HTML5 pages.
When a KeypressManager is created, it can be given functions to run in response to different types of key presses via overloaded version of the AddKeydownCallback method. Each of these accepts an order parameter that is optional and, if provided, will indicate the order in which tests should be performed to resolve a keypress. If order is not provided, tests will occur in the order that they were given to the manager.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2017
The specific versions of AddKeydownCallback are:
void AddKeydownCallback(std::function<bool(const html5::KeyboardEvent &)> cb_fun, int order=-1)
Link a function to the KeypressManager that is called for any unresolved keypress. The function must take in an html5::KeyboardEvent (which includes information about the specific key pressed as well as any modifiers such as SHIFT or CTRL) and it must return a boolean value indicating whether it has resolved the keypress.
void AddKeydownCallback(char key, std::function<void()> cb_fun, int order=-1)
Link a specific key to a target function to be called when that key is pressed. The function my return a void and take no arguments.
void AddKeydownCallback(const std::string & key_set, std::function<void()> cb_fun, int order=-1)
Same as the previous method, but will respond to any of the keys in the provided string.
-
namespace
emp
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
-
namespace
web
-
class
KeypressManager
¶ - #include <KeypressManager.h>
Public Functions
-
KeypressManager
()¶
-
~KeypressManager
()¶
-
int
GetFunCount
() const¶
-
int
GetNextOrder
() const¶
-
void
AddKeydownCallback
(std::function<bool(const KeyboardEvent&)> cb_fun, int order = -1, )¶ Link a function to the KeypressManager that is called for any unresolved keypress. The function must take in an html5::KeyboardEvent (which includes information about the specific key pressed as well as any modifiers such as SHIFT or CTRL) and it must return a boolean value indicating whether it has resolved the keypress.
-
void
AddKeydownCallback
(char key, std::function<void()> cb_funint order = -1, )¶ Link a specific key to a target function to be called when that key is pressed. The function my return a void and take no arguments.
Private Functions
-
bool
DoCallback
(const KeyboardEvent &evt_info)¶
-
-
class
Listeners¶
A class for tracking font event listeners for Widgets.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2017
-
namespace
emp
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
-
namespace
web
-
class
Listeners
¶ - #include <Listeners.h>
Track a set of JavaScript Listeners with their callback IDs.
Public Functions
-
Listeners
()¶
-
size_t
GetSize
() const¶ How many listeners are we tracking?
-
Listeners &
Set
(const std::string &name, size_t fun_id)¶ Use a pre-calculated function ID with a new listener.
-
template <typename... Ts>
Listeners &Set
(const std::string &name, const std::function<void(Ts... args)> &in_fun)¶ Calculate its own function ID with JSWrap.
-
void
Clear
()¶ Remove all listeners.
-
operator bool
() const¶ true/false : do any listeners exist?
Public Static Functions
-
-
class
Raw Image¶
Handle the fundamental loading of an image (without Widget tracking)
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2018
-
namespace
emp
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
-
class
RawImage
¶ - #include <RawImage.h>
Fundamental information about a single image.
Public Functions
-
~RawImage
()¶
-
int
GetID
() const¶
-
bool
HasLoaded
() const¶
-
bool
HasError
() const¶
Private Static Functions
-
static internal::ImageManager &
GetManager
()¶
-
-
namespace
internal
¶ -
struct
ImageInfo
¶ - #include <RawImage.h>
Detailed information about an image.
Public Functions
-
void
MarkLoaded
()¶ Trigger this image as loaded.
-
void
MarkError
()¶ Trigger this image as having an error.
-
void
-
class
ImageManager
¶ - #include <RawImage.h>
-
struct
Selector¶
Specs for the Selector widget.
A Selector widget provides the user with a pull-down menu. It can be examined at any time (via GetSelectID()) or else alerts call a designated function when a particular option is chosen.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2017
UI::Selector sel(“sel”);
sel.SetOption(“Option 1”); sel.SetOption(“Option B”, TriggerB) ; sel.SetOption(“Option the Third”, [](){ emp::Alert(“3 chosen!”} ); sel.SetOption(“Option IV”);
In this example, the second option will call TriggerB when it is chosen, while the third option will call the provided lambda function.
-
namespace
emp
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
-
namespace
web
-
class
Selector
: public emp::web::internal::WidgetFacet<Selector>¶ - #include <Selector.h>
Public Types
-
using
INFO_TYPE
= SelectorInfo¶
Public Functions
-
virtual
~Selector
()¶
-
size_t
GetSelectID
() const¶ Get the ID of the currently active selection.
-
size_t
GetNumOptions
() const¶ Get the total number of options setup in the selector.
-
bool
HasAutofocus
() const¶ Determine if the selector has autofocus.
-
bool
IsDisabled
() const¶ Is the selector currently disabled?
-
Selector &
SetOption
(const std::string &in_option, const std::function<void()> &in_cb)¶ Add a new option to the selector and the function to be called if it is chosen.
-
Selector &
SetOption
(const std::string &in_option, const std::function<void()> &in_cbsize_t opt_id, )¶ Add an option to the selector associated with a specific ID (and the function to be called if it is chosen)
-
Selector &
SetOption
(const std::string &in_option)¶ Set a selector option name, but no function to be called.
Protected Functions
-
SelectorInfo *
Info
()¶
-
const SelectorInfo *
Info
() const¶
-
Selector
(SelectorInfo *in_info)¶
Friends
-
friend
emp::web::SelectorInfo
-
class
SelectorInfo
: public emp::web::internal::WidgetInfo¶ - #include <Selector.h>
Protected Functions
-
SelectorInfo
(const SelectorInfo&)¶
-
SelectorInfo &
operator=
(const SelectorInfo&)¶
-
virtual
~SelectorInfo
()¶
-
virtual bool
IsSelectorInfo
() const¶
-
void
DoChange
(size_t new_id)¶
-
void
UpdateAutofocus
(bool in_af)¶
-
void
UpdateDisabled
(bool in_dis)¶
Protected Attributes
-
size_t
select_id
¶ Which index is currently selected?
-
bool
autofocus
¶
-
bool
disabled
¶
-
size_t
callback_id
¶
Private Members
-
friend emp::web::Selector::SelectorInfo::Selector
-
-
using
-
class
Styles¶
A CSS class for tracking font style, etc.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2017
-
namespace
emp
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
-
namespace
web
-
class
Style
¶ - #include <Style.h>
Class to maintain a map of setting names to values that can be easily ported over to JavaScript. A companial class, Attributes, also exists.
Public Functions
-
Style
()¶
-
size_t
GetSize
() const¶ Return a count of the number of settings that have been set.
-
template <typename SET_TYPE>
Style &Set
(const std::string &s, SET_TYPE v)¶ Record that setting “s” is set to value “v” (converted to string) and return this object.
-
bool
Has
(const std::string &setting) const¶ Return true/false based on whether “setting” has been given a value in this Style.
-
const std::string &
Get
(const std::string &setting)¶ Return the (string) value of “setting” that has been recorded in this Style. If setting did not exist, this does create an empty entry and return it.
-
void
Clear
()¶ Remove all setting values.
-
void
Apply
(const std::string &widget_id, const std::string &setting)¶ Apply only a SPECIFIC style setting from the setting library.
-
operator bool
() const¶ Have any settings be set?
Public Static Functions
-
-
class
Tables¶
Specs for the Table widget.
TableInfo is the core information for a table and has two helper classes: TableRowInfo and TableDataInfo. The Table class is a smart pointer to a TableInfo object.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2017
A Table is composed of a series of rows, each with the same number of columns. TableDataInfo may be muliple cells wide/tall, masking other cells.
-
namespace
emp
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
-
namespace
web
-
class
Table
: public emp::web::TableWidget¶ - #include <Table.h>
Public Functions
-
Table
(const TableWidget &in)¶
-
Table
()¶
-
template <typename SETTING_TYPE>
Table &RowCSS
(size_t row_id, const std::string &setting, SETTING_TYPE &&value)¶ Apply CSS to target row.
-
template <typename SETTING_TYPE>
Table &CellCSS
(size_t row_id, size_t col_id, const std::string &setting, SETTING_TYPE &&value)¶ Apply CSS to target cell.
-
template <typename SETTING_TYPE>
Table &RowsCSS
(const std::string &setting, SETTING_TYPE &&value)¶ Apply CSS to all rows. (: Should we use fancier jquery here?)
-
template <typename SETTING_TYPE>
Table &CellsCSS
(const std::string &setting, SETTING_TYPE &&value)¶ Apply CSS to all cells.
-
size_t
GetNumCols
() const¶
-
size_t
GetNumRows
() const¶
-
size_t
GetNumCells
() const¶
-
virtual void
PrepareAppend
()¶ Setup << operator to redirect to Append; option preparation can be overridden.
-
size_t
GetCurRow
() const¶ Determine which row currnetly has focus.
-
size_t
GetCurCol
() const¶ Determine which column currently has focus.
-
void
ClearTable
()¶
-
void
ClearRows
()¶
-
void
ClearRow
(size_t r)¶
-
void
ClearCol
(size_t c)¶
-
void
ClearRowGroup
(size_t r)¶
-
void
ClearColGroup
(size_t c)¶
-
void
ClearCells
()¶
-
void
ClearCell
(size_t r, size_t c)¶
-
TableCell
GetCell
(size_t r, size_t c)¶ Focus on a specifc cell in the table.
-
TableRow
GetRow
(size_t r)¶ Focus on a specifc row in the table.
-
TableCol
GetCol
(size_t c)¶ Focus on a specifc column in the table.
-
TableRowGroup
GetRowGroup
(size_t r)¶ Focus on a specifc group of rows in the table.
-
TableColGroup
GetColGroup
(size_t c)¶ Focus on a specifc group of columns in the table.
-
Widget
AddText
(size_t r, size_t c, const std::string &text)¶ Add text to a specified cell in the table.
Protected Types
-
using
parent_t
= internal::WidgetFacet<TableWidget>¶
-
-
class
TableWidget
: public emp::web::internal::WidgetFacet<TableWidget>¶ - #include <Table.h>
Subclassed by emp::web::Table, emp::web::TableCell, emp::web::TableCol, emp::web::TableColGroup, emp::web::TableRow, emp::web::TableRowGroup
Public Functions
-
TableWidget
(const TableWidget &in)¶
-
TableWidget
()¶
-
virtual
~TableWidget
()¶
-
size_t
GetNumCols
() const¶
-
size_t
GetNumRows
() const¶
-
size_t
GetNumCells
() const¶
-
virtual void
PrepareAppend
()¶ Setup << operator to redirect to Append; option preparation can be overridden.
-
size_t
GetCurRow
() const¶ Determine which row currnetly has focus.
-
size_t
GetCurCol
() const¶ Determine which column currently has focus.
-
void
ClearTable
()¶
-
void
ClearRows
()¶
-
void
ClearRow
(size_t r)¶
-
void
ClearCol
(size_t c)¶
-
void
ClearRowGroup
(size_t r)¶
-
void
ClearColGroup
(size_t c)¶
-
void
ClearCells
()¶
-
void
ClearCell
(size_t r, size_t c)¶
-
TableCell
GetCell
(size_t r, size_t c)¶ Focus on a specifc cell in the table.
-
TableRow
GetRow
(size_t r)¶ Focus on a specifc row in the table.
-
TableCol
GetCol
(size_t c)¶ Focus on a specifc column in the table.
-
TableRowGroup
GetRowGroup
(size_t r)¶ Focus on a specifc group of rows in the table.
-
TableColGroup
GetColGroup
(size_t c)¶ Focus on a specifc group of columns in the table.
-
Widget
AddText
(size_t r, size_t c, const std::string &text)¶ Add text to a specified cell in the table.
Protected Types
-
using
parent_t
= internal::WidgetFacet<TableWidget>
Protected Functions
-
void
DoCSS
(const std::string &setting, const std::string &value)¶ Apply CSS to appropriate component based on current state.
Friends
-
friend
emp::web::internal::TableInfo
-
-
namespace
internal
¶ -
struct
TableColInfo
¶ - #include <Table.h>
Public Members
-
WidgetExtras
extras
¶
-
WidgetExtras
-
struct
TableDataInfo
¶ - #include <Table.h>
Public Functions
Public Members
-
size_t
colspan
=1¶ How many columns wide is this TableData?
-
size_t
rowspan
=1¶ How many rows deep is this TableData?
-
bool
header
=false¶ Is this TableData a header (
vs
)?
-
bool
masked
=false¶ Is this cell masked by another cell?
-
WidgetExtras
extras
¶ Extra annotations (attributes, style, listeners)
-
size_t
-
struct
TableGroupInfo
: public emp::web::WidgetExtras¶ - #include <Table.h>
Public Members
-
size_t
span
= 1¶
-
bool
masked
= false¶ How many rows/columns does this group represent?
-
WidgetExtras
extras
¶ Is the current group masked because of a previous span?
-
size_t
-
class
TableInfo
: public emp::web::internal::WidgetInfo¶ - #include <Table.h>
Protected Functions
-
virtual
~TableInfo
()¶
-
virtual bool
IsTableInfo
() const¶
-
void
Resize
(size_t new_rows, size_t new_cols)¶
-
void
DoActivate
(bool top_level = true)¶
-
void
ClearCellChildren
(size_t row_id, size_t col_id)¶
-
void
ClearRowChildren
(size_t row_id)¶
-
void
ClearColChildren
(size_t col_id)¶
-
void
ClearRowGroupChildren
(size_t row_id)¶
-
void
ClearColGroupChildren
(size_t col_id)¶
-
void
ClearTableChildren
()¶
-
void
ClearCell
(size_t row_id, size_t col_id)¶
-
void
ClearRowCells
(size_t row_id)¶
-
void
ClearColCells
(size_t col_id)¶
-
void
ClearRow
(size_t row_id)¶
-
void
ClearCol
(size_t col_id)¶
-
void
ClearRowGroup
(size_t row_id)¶
-
void
ClearColGroup
(size_t col_id)¶
-
void
ClearTableCells
()¶
-
void
ClearTableRows
()¶
-
void
ClearTable
()¶
-
void
ReplaceHTML
()¶
Protected Attributes
-
size_t
row_count
¶
-
size_t
col_count
¶ How big is this table?
-
emp::vector<TableRowInfo>
rows
¶
-
emp::vector<TableColInfo>
cols
¶ Detail object for each row.
-
emp::vector<TableGroupInfo>
col_groups
¶ Detail object for each column (if needed)
-
emp::vector<TableGroupInfo>
row_groups
¶ Detail object for each column group (if needed)
-
size_t
append_row
¶ Detail object for each row group (if needed)
-
size_t
append_col
¶ Which row is triggering an append?
Private Members
-
friend emp::web::internal::TableInfo::TableWidget
-
friend emp::web::internal::TableInfo::Table
-
friend emp::web::internal::TableInfo::TableCell
-
friend emp::web::internal::TableInfo::TableRow
-
friend emp::web::internal::TableInfo::TableCol
-
friend emp::web::internal::TableInfo::TableRowGroup
-
friend emp::web::internal::TableInfo::TableColGroup
-
virtual
-
struct
TableRowInfo
¶ - #include <Table.h>
Public Functions
-
template <typename SETTING_TYPE>
TableRowInfo &CellsCSS
(const std::string &setting, SETTING_TYPE &&value)¶ Apply CSS to all cells in row.
-
template <typename SETTING_TYPE>
TableRowInfo &CellCSS
(size_t col_id, const std::string &setting, SETTING_TYPE &&value)¶ Apply CSS to specific cell in row.
Public Members
-
emp::vector<TableDataInfo>
data
¶ detail object for each cell in this row.
-
WidgetExtras
extras
¶ Extra annotations (attributes, style, listeners)
-
template <typename SETTING_TYPE>
-
struct
-
class
Text¶
Specs for the Text widget.
A representation of text on a web page. Text Widgets can be included inside of Divs or Tables to cordon off a section of text (and will be automatically created when text is streamed into these other widgets). The primary benefit of explicitly creating your own text widget is to control the text style.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2017
-
namespace
emp
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
-
namespace
web
-
class
Text
: public emp::web::internal::WidgetFacet<Text>¶ - #include <Text.h>
A Text widget handles putting text on a web page that can be controlled and modified.
Public Functions
-
~Text
()¶
Friends
-
friend
emp::web::TextInfo
-
class
TextInfo
: public emp::web::internal::WidgetInfo¶ - #include <Text.h>
Protected Functions
-
virtual
~TextInfo
()¶
-
virtual bool
IsTextInfo
() const¶
-
bool
AppendOK
() const¶
-
void
PreventAppend
()¶
-
Widget
Append
(const std::function<std::string()> &in_fun)¶ Add a function that produces text to this widget. Every time the widget is re-drawn, the function will be re-run to get the latest version of the text. When a Live() function wraps a variable it simply makes sure that this version of Append is called so that the value of the variable is kept live.
Protected Attributes
-
DynamicString
strings
¶ All string (and functions returning strings) in Text widget.
Private Members
-
friend emp::web::Text::TextInfo::Text
-
virtual
-
-
class
Text Areas¶
Specs for the TextArea widget.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2017
-
namespace
emp
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
-
namespace
web
-
class
TextArea
: public emp::web::internal::WidgetFacet<TextArea>¶ - #include <TextArea.h>
An input field for text data. A function provided at creation time will be called each time the contents of the TextWidget are changed. The current text contents can also always be accessed with the GetText() member function.
Public Types
-
using
INFO_TYPE
= TextAreaInfo¶
Public Functions
-
TextArea
(std::function<void(const std::string&)> in_cb, const std::string &in_id = "", )¶ Build a text area with a specified function to call with every change.
-
virtual
~TextArea
()¶
-
TextArea &
SetCallback
(const std::function<void(const std::string&)> &in_cb)¶ Change the callback function for this TextArea.
-
bool
HasAutofocus
() const¶ Does this widget have auto focus set?
-
bool
IsDisabled
() const¶ Is this widget currently disabled?
Protected Functions
-
TextAreaInfo *
Info
()¶
-
const TextAreaInfo *
Info
() const¶
-
TextArea
(TextAreaInfo *in_info)¶
Friends
-
friend
emp::web::TextAreaInfo
-
class
TextAreaInfo
: public emp::web::internal::WidgetInfo¶ - #include <TextArea.h>
Protected Functions
-
TextAreaInfo
(const TextAreaInfo&)¶
-
TextAreaInfo &
operator=
(const TextAreaInfo&)¶
-
virtual
~TextAreaInfo
()¶
-
virtual bool
IsTextAreaInfo
() const¶
-
void
UpdateAutofocus
(bool in_af)¶
-
void
UpdateDisabled
(bool in_dis)¶
Protected Attributes
-
int
cols
¶ How many columns of text in the area?
-
int
rows
¶ How many rows of text in the area?
-
int
max_length
¶ Maximum number of total characters allowed.
-
uint32_t
callback_id
¶ Callback ID the built-in function for this text area.
Private Members
-
friend emp::web::TextArea::TextAreaInfo::TextArea
-
-
using
-
class
Tweens¶
A Tween manages the gradual shift in properties of one or more widgets over time.
To create a Tween, a duration must be specified, along with an optional default target. Once a Tween is setup, paths can be added to it, which represent the changes that should occur over the specified duration.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2017
A path can be a function to call (with the 0.0 to 1.0 fraction of the time that’s gone by) or a variable to set to the current fraction. Dependants can also be set to refresh with each Tween update.
Available methods include: Tween & AddPath(std::function<void(double)> set_fun, double start_val, double end_val, std::function<double(double)> timing=LINEAR); Tween & AddPath(double & set_var, double start_val, double end_val, std::function<double(double)> timing=LINEAR); Tween & AddDependant(Widget w); void Start(); void Stop();
-
namespace
emp
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
-
namespace
web
-
class
Tween
¶ - #include <Tween.h>
Public Functions
-
Tween
(double d = 1.0, const Widget &t = nullptr)¶ Build a new tween, specifying the duration it should run for and the widget it should modify.
-
~Tween
()¶
-
Tween &
AddPath
(std::function<void(double)> set_fun, double start_val, double end_val, std::function<double(double)> timing = LINEAR)¶ Alter the path of the change that this tween should take and the function it should call.
-
Tween &
AddPath
(double &set_var, double start_val, double end_val, std::function<double(double)> timing = LINEAR)¶ Alter the path of the change that this tween should take and the variable it should modify.
-
Tween &
AddPath
(Widget w, std::string setting, double start_val, double end_val)¶ Alter the path of the change that this tween should take and the widget setting it should alter. (TODO!)
Private Functions
-
void
AdvanceFrame
()¶
Private Members
-
double
duration
¶
-
bool
running
¶
-
size_t
callback_id
¶
-
double
start_time
¶
-
double
cur_time
¶
-
double
run_time
¶
Private Static Functions
-
static double
LINEAR
(double in)¶
-
struct
Event
¶
-
-
class
Widgets¶
Widgets maintain individual components on a web page and link to Elements.
Each HTML Widget has all of its details stored in a WidgetInfo object; Multiple Widgets can be attached to the same WidgetInfo, simplifying the usage. All the library user needs to worry about is the Widget object itself; the WidgetInfo will be managed behind the scenes.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2017
WidgetInfo contains the basic information for all Widgets Widget is a generic base class, with a shared pointer to WidgetInfo WidgetFacet is a template that allows Set* methods to return derived return-type.
In other files, Widgets will be used to define specific elements. ELEMENTInfo maintains information about the specific widget (derived from WidgetInfo) ELEMENT interfaces to ELEMENTInfo so multiple elements use same core; derived from WidgetFacet
Library users should not need to access Widgets directly, only specific derived types.
Tips for using widgets:
- If you are about to make a lot of changes at once, run Freeze(), make the changes, and then run Activate() again. Freeze prevents widgets from being updated immediately.
- Trust the Widget to handle all of the manipulation behind the scenes
-
namespace
emp
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
-
namespace
web
-
class
Widget
¶ - #include <Widget.h>
Widget is effectively a smart pointer to a WidgetInfo object, plus some basic accessors.
Subclassed by emp::web::internal::WidgetFacet< RETURN_TYPE >, emp::web::internal::WidgetFacet< Button >, emp::web::internal::WidgetFacet< Canvas >, emp::web::internal::WidgetFacet< D3Visualization >, emp::web::internal::WidgetFacet< Div >, emp::web::internal::WidgetFacet< FileInput >, emp::web::internal::WidgetFacet< Image >, emp::web::internal::WidgetFacet< Selector >, emp::web::internal::WidgetFacet< TableWidget >, emp::web::internal::WidgetFacet< Text >, emp::web::internal::WidgetFacet< TextArea >
Public Functions
-
Widget
(WidgetInfo *in_info = nullptr)¶
-
~Widget
()¶
-
bool
IsNull
() const¶ Test if this widget is valid.
-
bool
IsInactive
() const¶ Test if the activity state of this widget is currently INACTIVE.
-
bool
IsWaiting
() const¶ Test if the activity state of this widget is currently WAITING.
-
bool
IsFrozen
() const¶ Test if the activity state of this widget is currently FROZEN.
-
bool
IsActive
() const¶ Test if the activity state of this widget is currently ACTIVE.
-
bool
AppendOK
() const¶ Is it okay to add more internal Widgets into this one?
-
std::string
GetCSS
(const std::string &setting)¶ Retrieve a specific CSS trait associated with this Widget. Note: CSS-related options may be overridden in derived classes that have multiple styles.
-
std::string
GetAttr
(const std::string &setting)¶ Retrieve a specific attribute associated with this Widget.
-
void
Activate
()¶ Make this widget live, so changes occur immediately (once document is ready)
-
void
Freeze
()¶ Record changes internally, but keep static screen until Activate() is called.
-
void
Deactivate
(bool top_level = true)¶ Record changes internally and REMOVE from screen until Activate is called. (Argument is for recursive, internal use only.)
-
bool
ToggleActive
()¶ Doggle between Active and Deactivated.
-
void
Redraw
()¶ Clear and redraw the current widget on the screen.
-
Widget &
AddDependant
(const Widget &w)¶ Add a dependant to this Widget that should be redrawn when it is.
-
virtual void
PrepareAppend
()¶ Setup << operator to redirect to Append; option preparation can be overridden.
Protected Types
-
enum
ActivityState
¶ Four activity states for any widget: INACTIVE - Not be in DOM at all. WAITING - Will become active once the page finishes loading. FROZEN - Part of DOM, but not updating on the screen. ACTIVE - Fully active; changes are reflected as they happen.
Values:
-
INACTIVE
¶
-
WAITING
¶
-
FROZEN
¶
-
ACTIVE
¶
-
-
using
WidgetInfo
= internal::WidgetInfo¶
Protected Functions
-
template <typename FWD_TYPE>
Widget &ForwardAppend
(FWD_TYPE &&arg)¶ If an Append doesn’t work with current class, forward it to the parent and try there.
-
Widget &
SetInfo
(WidgetInfo *in_info)¶ Set the information associated with this widget.
-
WidgetInfo *
operator->
()¶ Internally, we can treat a Widget as a pointer to its WidgetInfo.
Protected Attributes
-
WidgetInfo *
info
¶ Information associated with this widget.
Protected Static Functions
-
static WidgetInfo *
Info
(const Widget &w)¶ Give derived classes the ability to access widget info.
-
-
namespace
internal
Functions
-
class
WidgetCommand
¶ - #include <Widget.h>
Base class for command-objects that can be fed into widgets.
Subclassed by emp::web::Close, emp::web::PrintStr
-
template <typename RETURN_TYPE>
classWidgetFacet
: public emp::web::Widget¶ - #include <Widget.h>
WidgetFacet is a template that provides accessors into Widget with a derived return type.
Public Types
-
template<>
usingreturn_t
= RETURN_TYPE¶
Public Functions
-
template <typename SETTING_TYPE>
return_t &SetCSS
(const std::string &setting, SETTING_TYPE &&value)¶ Set a specific CSS value for this widget.
-
template <typename SETTING_TYPE>
return_t &SetAttr
(const std::string &setting, SETTING_TYPE &&value)¶ Set a specific Attribute value for this widget.
-
template <typename T1, typename T2, typename... OTHER_SETTINGS>
return_t &SetCSS
(const std::string &setting1, T1 &&val1, const std::string &setting2, T2 &&val2, OTHER_SETTINGS... others)¶ Multiple CSS settings can be provided simultaneously.
-
template <typename T1, typename T2, typename... OTHER_SETTINGS>
return_t &SetAttr
(const std::string &setting1, T1 &&val1, const std::string &setting2, T2 &&val2, OTHER_SETTINGS... others)¶ Multiple Attributes can be provided simultaneously.
-
return_t &
SetCSS
(const Style &in_style)¶ Allow multiple CSS settings to be provided as a single object. (still go through DoCSS given need for virtual re-routing.)
-
return_t &
SetAttr
(const Attributes &in_attr)¶ Allow multiple Attr settings to be provided as a single object. (still go through DoAttr given need for virtual re-routing.)
-
return_t &
On
(const std::string &event_name, const std::function<void()> &fun)¶ Provide an event and a function that will be called when that event is triggered. In this case, the function as no arguments.
-
return_t &
On
(const std::string &event_name, const std::function<void(MouseEvent evt)> &fun)¶ Provide an event and a function that will be called when that event is triggered. In this case, the function takes a mouse event as an argument, with full info about mouse.
-
return_t &
On
(const std::string &event_name, const std::function<void(double, double)> &fun)¶ Provide an event and a function that will be called when that event is triggered. In this case, the function takes two doubles which will be filled in with mouse coordinates.
-
template <typename T>
return_t &OnResize
(T &&arg)¶ Provide a function to be called when the window is resized.
-
template <typename T>
return_t &OnClick
(T &&arg)¶ Provide a function to be called when the mouse button is clicked in this Widget.
-
template <typename T>
return_t &OnDoubleClick
(T &&arg)¶ Provide a function to be called when the mouse button is double clicked in this Widget.
-
template <typename T>
return_t &OnMouseDown
(T &&arg)¶ Provide a function to be called when the mouse button is pushed down in this Widget.
-
template <typename T>
return_t &OnMouseUp
(T &&arg)¶ Provide a function to be called when the mouse button is released in this Widget.
-
template <typename T>
return_t &OnMouseMove
(T &&arg)¶ Provide a function to be called whenever the mouse moves in this Widget.
-
template <typename T>
return_t &OnMouseOut
(T &&arg)¶ Provide a function to be called whenever the mouse leaves the Widget.
-
template <typename T>
return_t &OnMouseOver
(T &&arg)¶ Provide a function to be called whenever the mouse moves over the Widget.
-
template <typename T>
return_t &OnMouseWheel
(T &&arg)¶ Provide a function to be called whenever the mouse wheel moves in this Widget.
-
template <typename T>
return_t &OnKeydown
(T &&arg)¶ Provide a function to be called whenever a key is pressed down in this Widget.
-
template <typename T>
return_t &OnKeypress
(T &&arg)¶ Provide a function to be called whenever a key is pressed down and released in this Widget.
-
template <typename T>
return_t &OnKeyup
(T &&arg)¶ Provide a function to be called whenever a key is pressed released in this Widget.
-
template <typename T>
return_t &OnCopy
(T &&arg)¶ Provide a function to be called whenever text is copied in this Widget.
-
template <typename T>
return_t &OnCut
(T &&arg)¶ Provide a function to be called whenever text is cut in this Widget.
-
template <typename T>
return_t &OnPaste
(T &&arg)¶ Provide a function to be called whenever text is pasted in this Widget.
-
return_t &
SetWidth
(double w, const std::string &unit = "px")¶ Update the width of this Widget.
- Parameters
unit
: defaults to pixels (“px”), but can also be a measured distance (e.g, “inches”) or a percentage(“%”)
-
return_t &
SetHeight
(double h, const std::string &unit = "px")¶ Update the height of this Widget.
- Parameters
unit
: defaults to pixels (“px”), but can also be a measured distance (e.g, “inches”) or a percentage(“%”)
-
return_t &
SetSize
(double w, double h, const std::string &unit = "px")¶ Update the size (width and height) of this widget.
- Parameters
unit
: defaults to pixels (“px”), but can also be a measured distance (e.g, “inches”) or a percentage(“%”)
-
return_t &
Center
()¶ Move this widget to the center of its container.
-
return_t &
SetPosition
(int x, int y, const std::string &unit = "px", const std::string &pos_type = "absolute", const std::string &x_anchor = "left", const std::string &y_anchor = "top")¶ Set the x-y position of this widget within its container.
-
return_t &
SetPositionRT
(int x, int y, const std::string &unit = "px")¶ Set the x-y position of this Widget within its container, using the TOP-RIGHT as an anchor.
-
return_t &
SetPositionRB
(int x, int y, const std::string &unit = "px")¶ Set the x-y position of this Widget within its container, using the BOTTOM-RIGHT as an anchor.
-
return_t &
SetPositionLB
(int x, int y, const std::string &unit = "px")¶ Set the x-y position of this Widget within its container, using the BOTTOM-LEFT as an anchor.
-
return_t &
SetPositionFixed
(int x, int y, const std::string &unit = "px")¶ Set the x-y position of this Widget, fixed within the browser window.
-
return_t &
SetPositionFixedRT
(int x, int y, const std::string &unit = "px")¶ Set the x-y position of the top-right corner this Widget, fixed within the browser window.
-
return_t &
SetPositionFixedRB
(int x, int y, const std::string &unit = "px")¶ Set the x-y position of the bottom-right corner this Widget, fixed within the browser window.
-
return_t &
SetPositionFixedLB
(int x, int y, const std::string &unit = "px")¶ Set the x-y position of the bottom-left corner this Widget, fixed within the browser window.
-
return_t &
SetFloat
(const std::string &f = "left")¶ Set this Widget to float appropriately within its containter.
-
return_t &
SetFontSizeVW
(double s)¶ Setup the size of the Font to be used in this Widget in units of % of viewport width.
-
return_t &
SetCenterText
()¶ Align text to be centered.
-
return_t &
SetPadding
(double p, const std::string &unit = "px")¶ The the number of pixels (or alternate unit) for the padding around cells (used with Tables)
-
bool
IsNull
() const¶ Test if this widget is valid.
-
bool
IsInactive
() const¶ Test if the activity state of this widget is currently INACTIVE.
-
bool
IsWaiting
() const¶ Test if the activity state of this widget is currently WAITING.
-
bool
IsFrozen
() const¶ Test if the activity state of this widget is currently FROZEN.
-
bool
IsActive
() const¶ Test if the activity state of this widget is currently ACTIVE.
-
bool
AppendOK
() const¶ Is it okay to add more internal Widgets into this one?
-
std::string
GetCSS
(const std::string &setting)¶ Retrieve a specific CSS trait associated with this Widget. Note: CSS-related options may be overridden in derived classes that have multiple styles.
-
std::string
GetAttr
(const std::string &setting)¶ Retrieve a specific attribute associated with this Widget.
-
void
Activate
()¶ Make this widget live, so changes occur immediately (once document is ready)
-
void
Freeze
()¶ Record changes internally, but keep static screen until Activate() is called.
-
void
Deactivate
(bool top_level = true)¶ Record changes internally and REMOVE from screen until Activate is called. (Argument is for recursive, internal use only.)
-
bool
ToggleActive
()¶ Doggle between Active and Deactivated.
-
void
Redraw
()¶ Clear and redraw the current widget on the screen.
-
Widget &
AddDependant
(const Widget &w)¶ Add a dependant to this Widget that should be redrawn when it is.
-
virtual void
PrepareAppend
()¶ Setup << operator to redirect to Append; option preparation can be overridden.
Protected Types
-
enum
ActivityState
¶ Four activity states for any widget: INACTIVE - Not be in DOM at all. WAITING - Will become active once the page finishes loading. FROZEN - Part of DOM, but not updating on the screen. ACTIVE - Fully active; changes are reflected as they happen.
Values:
-
INACTIVE
¶
-
WAITING
¶
-
FROZEN
¶
-
ACTIVE
¶
-
-
using
WidgetInfo
= internal::WidgetInfo
Protected Functions
-
WidgetFacet
(const std::string &in_id = "")¶ WidgetFacet cannot be built unless within derived class, so constructors are protected.
-
WidgetFacet
(const WidgetFacet &in)¶
-
WidgetFacet
(WidgetInfo *in_info)¶
-
WidgetFacet &
operator=
(const WidgetFacet &in)¶
-
virtual
~WidgetFacet
()¶
-
virtual void
DoCSS
(const std::string &setting, const std::string &value)¶ CSS-related options may be overridden in derived classes that have multiple styles. By default DoCSS will track the new information and apply it (if active) to the widget.
-
virtual void
DoAttr
(const std::string &setting, const std::string &value)¶ Attr-related options may be overridden in derived classes that have multiple attributes. By default DoAttr will track the new information and apply it (if active) to the widget.
-
virtual void
DoListen
(const std::string &event_name, size_t fun_id)¶ Listener options may be overridden in derived classes that have multiple listen targets. By default DoListen will track new listens and set them up immediately, if active.
-
template <typename FWD_TYPE>
Widget &ForwardAppend
(FWD_TYPE &&arg)¶ If an Append doesn’t work with current class, forward it to the parent and try there.
-
Widget &
SetInfo
(WidgetInfo *in_info)¶ Set the information associated with this widget.
-
WidgetInfo *
operator->
()¶ Internally, we can treat a Widget as a pointer to its WidgetInfo.
Protected Attributes
-
WidgetInfo *
info
¶ Information associated with this widget.
Protected Static Functions
-
static WidgetInfo *
Info
(const Widget &w)¶ Give derived classes the ability to access widget info.
-
template<>
-
class
WidgetInfo
¶ - #include <Widget.h>
Subclassed by emp::web::Button::ButtonInfo, emp::web::Canvas::CanvasInfo, emp::web::D3Visualization::D3VisualizationInfo, emp::web::FileInput::FileInputInfo, emp::web::Image::ImageInfo, emp::web::internal::DivInfo, emp::web::internal::TableInfo, emp::web::Selector::SelectorInfo, emp::web::Text::TextInfo, emp::web::TextArea::TextAreaInfo
Public Functions
-
WidgetInfo
(const std::string &in_id = "")¶ WidgetInfo cannot be built unless within derived class, so constructor is protected.
-
WidgetInfo
(const WidgetInfo&)¶ No copies of INFO allowed.
-
WidgetInfo &
operator=
(const WidgetInfo&)¶
-
virtual
~WidgetInfo
()¶
-
virtual bool
IsButtonInfo
() const¶
-
virtual bool
IsCanvasInfo
() const¶
-
virtual bool
IsImageInfo
() const¶
-
virtual bool
IsSelectorInfo
() const¶
-
virtual bool
IsDivInfo
() const¶
-
virtual bool
IsTableInfo
() const¶
-
virtual bool
IsTextInfo
() const¶
-
virtual bool
IsTextAreaInfo
() const¶
-
virtual bool
IsD3VisualiationInfo
() const¶
-
void
AddDependants
()¶
-
void
UpdateDependants
()¶
-
virtual void
DoActivate
(bool top_level = true)¶
-
virtual bool
AppendOK
() const¶
-
virtual void
PreventAppend
()¶
-
virtual void
TriggerJS
()¶
-
virtual void
ReplaceHTML
()¶
Public Members
-
int
ptr_count
¶ How many widgets are pointing to this info?
-
WidgetExtras
extras
¶ HTML attributes, CSS style, and listeners for web events.
-
WidgetInfo *
parent
¶ Which WidgetInfo is this one contained within?
-
-
class
-
class
A collection of extra details about HTML Widgets (attributes, style, listerns)
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2015-2017
-
namespace
emp
If we are in emscripten, make sure to include the header.
This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
This file contains functions for adding additional data files to Worlds.
- Note
- This file is part of Empirical, https://github.com/devosoft/Empirical
- Copyright
- Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md
- Date
- 2018
-
namespace
web
-
struct
WidgetExtras
¶ - #include <WidgetExtras.h>
Subclassed by emp::web::internal::TableGroupInfo
Public Functions
-
void
Clear
()¶ Clear all of style, attributes, and listeners.
-
operator bool
() const¶ Have any details been set?
Public Members
-
Attributes
attr
¶ HTML Attributes about a cell.
-
void
-
struct