# Table of Contents
# Plot
Graphs plots from the pre module.
Import it with:
const plots = require('@epispot/epijs').plots
# plot
Plots models from pre or model modules. If in Node, this will generate a localhost, otherwise it will plot it in the HTML div element provided.
# Parameters
model
Object (opens new window) A model class from the pre or model modules.time
Number (opens new window) The number of days to plot.name
String (opens new window) The ID of the plot. If this is in HTML, it will be the ID of the div element for the graph.title
String (opens new window) The title of the graph. (optional, default'Cases vs. Time'
)
# Examples
let susceptible = new Idiom("S-(B*S*I/p)");
let infected = new Idiom("I+(B*S*I/p)-(u*I)");
let recovered = new Idiom("R+(u*I)");
let key = {
"S": 10000,
"B": 0.3,
"I": 100,
"R": 0,
"p": 10100,
"u": 0.2
};
let sirm = new Model([[susceptible2, "S"], [infected2, "I"], [recovered2, "R"]], key)
plot(sirout1, 100, "SIR", "SIR Model (Population vs. Time)")