This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'''html | |
<body> | |
<div class="d-flex flex-row" id= "first_row"> | |
<div class="p-2" ><select id="selectNumber"> | |
<option>Choose Age</option> | |
</select> | |
</div> | |
<div class="p-2" id ="plot_le"> Wait plotting histogram...</div> | |
<div class = "p-2" id ="plot_le_time"> </div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function form (json){ | |
return Object.keys(json).map(key=>encodeURIComponent(key)+'='+encodeURIComponent(json[key])).join('&'); | |
}; | |
function createRobject(Rlib, Rfunc, Rparams) { | |
return fetch(Rlib + Rfunc, { | |
method: 'post', | |
headers: { | |
'Accept': 'application/json, text/plain, */*', | |
'Content-Type': 'application/x-www-form-urlencoded' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function workflow (age){ | |
co(function *(){ | |
// initialize views | |
document.getElementById('plot_le').innerHTML = "Please wait, loading graphs ..." | |
document.getElementById('plot_le_time').innerHTML = "Please wait, loading graphs ..." | |
// generate the R objects: | |
var stochasticSet = yield createRobject(Riskmodel,"loadSimData",{}) ; | |
var expectedLife = yield createRobject(Riskmodel,"eex", |