UNPKG

cacatoo

Version:

Building, exploring, and sharing spatially structured models

544 lines (136 loc) 7.52 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Class: Graph</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Class: Graph</h1> <section> <header> <h2><span class="attribs"><span class="type-signature"></span></span>Graph<span class="signature">(labels, values, colours, title, opts)</span><span class="type-signature"></span></h2> <div class="class-description">Graph is a wrapper-class for a Dygraph element (see https://dygraphs.com/). It is attached to the DOM-windows, and stores all values to be plotted, colours, title, axis names, etc.</div> </header> <article> <div class="container-overview"> <h2>Constructor</h2> <h4 class="name" id="Graph"><span class="type-signature"></span>new Graph<span class="signature">(labels, values, colours, title, opts)</span><span class="type-signature"></span></h4> <div class="description"> The constructor function for a @Canvas object. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>labels</code></td> <td class="type"> <span class="param-type">Array</span> </td> <td class="description last">array of strings containing the labels for datapoints (e.g. for the legend)</td> </tr> <tr> <td class="name"><code>values</code></td> <td class="type"> <span class="param-type">Array</span> </td> <td class="description last">Array of floats to plot (here plotted over time)</td> </tr> <tr> <td class="name"><code>colours</code></td> <td class="type"> <span class="param-type">Array</span> </td> <td class="description last">Array of colours to use for plotting</td> </tr> <tr> <td class="name"><code>title</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="description last">Title of the plot</td> </tr> <tr> <td class="name"><code>opts</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last">dictionary-style list of opts to pass onto dygraphs</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="cacatoo.js.html">cacatoo.js</a>, <a href="cacatoo.js.html#line24">line 24</a> </li></ul></dd> </dl> </div> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="push_data"><span class="type-signature"></span>push_data<span class="signature">(array)</span><span class="type-signature"></span></h4> <div class="description"> Push data to your graph-element </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>array</code></td> <td class="type"> <span class="param-type">array</span> </td> <td class="description last">of floats to be added to the dygraph object (stored in 'data')</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="cacatoo.js.html">cacatoo.js</a>, <a href="cacatoo.js.html#line80">line 80</a> </li></ul></dd> </dl> <h4 class="name" id="update"><span class="type-signature"></span>update<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> Update the graph axes </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="cacatoo.js.html">cacatoo.js</a>, <a href="cacatoo.js.html#line98">line 98</a> </li></ul></dd> </dl> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Canvas.html">Canvas</a></li><li><a href="Flockmodel.html">Flockmodel</a></li><li><a href="Graph.html">Graph</a></li><li><a href="Gridmodel.html">Gridmodel</a></li><li><a href="Gridpoint.html">Gridpoint</a></li><li><a href="ODE.html">ODE</a></li><li><a href="QuadTree.html">QuadTree</a></li><li><a href="Simulation.html">Simulation</a></li></ul><h3>Global</h3><ul><li><a href="global.html#CopyGridODEs">CopyGridODEs</a></li><li><a href="global.html#MakeGrid">MakeGrid</a></li><li><a href="global.html#copy">copy</a></li><li><a href="global.html#default_colours">default_colours</a></li><li><a href="global.html#dict_reverse">dict_reverse</a></li><li><a href="global.html#get2DFromCanvas">get2DFromCanvas</a></li><li><a href="global.html#hexToRGB">hexToRGB</a></li><li><a href="global.html#nameToRGB">nameToRGB</a></li><li><a href="global.html#parseColours">parseColours</a></li><li><a href="global.html#pause">pause</a></li><li><a href="global.html#random_colours">random_colours</a></li><li><a href="global.html#shuffle">shuffle</a></li><li><a href="global.html#stringToRGB">stringToRGB</a></li></ul> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Wed Dec 18 2024 17:10:07 GMT+0100 (Central European Standard Time) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>